SimpleTwitter"; if (!function_exists('curl_init')) { _show_simpletwitter_curl_warning(); } else { if (isset($_POST['info_update'])) { global $_opt_twitter_id; global $_opt_cache_mins; $twitterId = $_POST['twitter_id']; $cacheMins = $_POST['cache_mins']; update_option($_opt_twitter_id, $twitterId); update_option($_opt_cache_mins, $cacheMins); } _show_simpletwitter_form(); } } // Displays a form to edit configuration options function _show_simpletwitter_form() { ?>

SimpleTwitter needs the php cURL library to be installed

SimpleTwitter uses the cURL php library to connect to the Twitter website. This doesn't seem to be available with your current php configuration - it has possibly been disabled in your php.ini file.

Please contact your System Administrator or Service Provider for information.

$cache_time; if ($cache_expired) { update_twitter_message(); } } // Updates the message cache function update_twitter_message() { // Update cache global $_opt_twitter_id; global $_opt_twitter_msg; global $_opt_last_cache_time; $twitterId = get_option($_opt_twitter_id); if ($twitterId != '') { $url = 'http://twitter.com/statuses/user_timeline/'.$twitterId.'.rss'; $title = get_message_from_url($url); if ($title != '') { $msg = extract_message_from_twitter_title($title); update_option($_opt_twitter_msg, $msg); update_option($_opt_last_cache_time, time()); } } } // Message comes in the format 'Name : Message'. This removes the 'Name : ' part function extract_message_from_twitter_title($title) { $msg = substr($title, strpos($title, ':') + 2); return $msg; } // Gets the RSS feed and reads the title of the first item function get_message_from_url($url, $tag = 'title', $item = 'item') { $msg = ''; $page = ''; if (function_exists('curl_init')) { $curl_session = curl_init($url); curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_session, CURLOPT_CONNECTTIMEOUT, 4); curl_setopt($curl_session, CURLOPT_TIMEOUT, 8); $page = curl_exec($curl_session); curl_close($curl_session); } if ($page == '') { return ''; } $lines = explode("\n",$page); $itemTag = "<$item>"; $startTag = "<$tag>"; $endTag = ""; $inItem = false; foreach ($lines as $s) { $s = rtrim($s); if (strpos($s, $itemTag)) { $inItem = true; } if ($inItem) { $msg .= $s; } if ($inItem && strpos($s, $endTag)) { $msg = substr_replace($msg, '', strpos($msg, $endTag)); $msg = substr($msg, strpos($msg, $startTag) + strlen($startTag)); break; } } return $msg; } ?>