'',
'count' => 1
), $atts));
$transient = "$screenname"."_$count"."_twitter_status";
$statuses = get_transient($transient);
if ($statuses == true )
{
return $statuses;
}
elseif ($screenname != false)
{
$site = "http://twitter.com/statuses/user_timeline.json?screen_name=$screenname&count=$count";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $site);
$result = curl_exec($ch);
$tweets = json_decode($result);
ob_start();
foreach ( (array) $tweets as $tweet){
$tweetcontent = $tweet->text;
$newcontent = preg_replace('%@([^\s]*)%', "@\\1", $tweetcontent);
echo "
";
}
$tweet_display = ob_get_clean();
set_transient($transient, $tweet_display, 120);
return $tweet_display;
}
else
{
return false;
}
}
add_shortcode('twitter_status', 'twitter_status');
// end twitter_status shortcode
// [show_bookmark_image_list catagory_name='']
function show_bookmark_image_list($atts){
extract(shortcode_atts(array(
'catagory_name' => false
), $atts));
if ( $catagory_name == false )
$bookmarks = get_bookmarks();
else
$bookmarks = get_bookmarks("catagory_name=$catagory_name");
ob_start();
echo "";
foreach($bookmarks as $bookmark){
echo ".")
";
}
echo "";
$list = ob_get_clean();
return $list;
}
add_shortcode('show_bookmark_image_list', 'show_bookmark_image_list');
//end show_bookmark_image_list
// [show_current_year]
function show_current_year(){
return date('Y');
}
add_shortcode('show_current_year', 'show_current_year');
// end show_current_year
?>