$sp =& $scriptProperties;
$screenName = isset($sp['screenName'])? '&screen_name=' . $sp['screenName'] : ''; $id = isset($sp['userId'])? '&id=' . $sp['userId'] : ''; $count = isset($sp['count'])? '&count=' . $sp['count'] : ''; $includeRts = isset($sp['includeRts'])? $sp['includeRts'] : '1';
$screenName = isset($screenName)? '&screen_name=' . $screenName : ''; $id = isset($userId)? '&id=' . $userId : ''; $count = isset($count)? '&count=' . $count : ''; $includeRts = isset($includeRts)? $includeRts : '1';
Gonna look into how to implement a tpl into this snippet. Loving modx so far.
[ed. note: tonitox2 last edited this post 14 years, 1 month ago.]
<?php
/* ShowTweets snippet */
$screenName = isset($screenName)? '&screen_name=' . $screenName : '';
$id = isset($userId)? '&id=' . $userId : '';
$count = isset($count)? '&count=' . $count : '';
$includeRts = isset($includeRts)? $includeRts : '1';
$url = '<a href="http://api.twitter.com/1/statuses/user_timeline.json?include_rts='" target="_blank" rel="nofollow">http://api.twitter.com/1/statuses/user_timeline.json?include_rts='</a>
. $includeRts . $id . $screenName . $count;
$tw = curl_init();
curl_setopt($tw, CURLOPT_URL, $url);
curl_setopt($tw, CURLOPT_RETURNTRANSFER, TRUE);
$twi = curl_exec($tw);
$twi = json_decode($twi);
//echo var_dump($twi);
$output = '';
foreach ($twi as $tweet) {
$output .= 'Time: ' . $tweet->created_at . "";
$output .= 'Tweet: ' . $tweet->text . "";
}
curl_close($tw);
return $output;
?>Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/mcpytemp/public_html/manager/includes/document.parser.class.inc.php(814) : eval()'d code on line 9
[!ShowTweets? &screenName=`BobRay` &count=`2`]
A agree, but I can't check it for you because the forum software has mangled that code.
$url = '<a href="hppp://api.twitter.com/1/statuses/user_timeline.json?include_rts='" target="_blank" rel="nofollow">hppp://api.twitter.com/1/statuses/user_timeline.json?include_rts='</a> . $includeRts . $id . $screenName . $count;
). I'm not sure what the output you're trying to get would look like. Can you post it?
$url = '<a href="http://api.twitter.com/1/statuses/user_timeline.json?include_rts=" target="_blank" rel="nofollow">http://api.twitter.com/1/statuses/user_timeline.json?include_rts=</a>' . $includeRts . $id . $screenName . $count;
"hppp://api.twitter.com/1/statuses/user_timeline.json?include_rts=1&screen_name=BobRay&count=2"
[ed. note: alchemy last edited this post 13 years, 11 months ago.]