Changeset 1235 for branches/1.2/content/plugins
- Timestamp:
- 02/24/10 05:57:23 (3 years ago)
- Location:
- branches/1.2/content/plugins/twitter_widget
- Files:
-
- 4 edited
-
css/twitter_widget.css (modified) (5 diffs)
-
languages/twitter_widget_language.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
twitter_widget.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/content/plugins/twitter_widget/css/twitter_widget.css
r1162 r1235 1 /* by Antonio Lupetti http://woork.blogspot.com/2009/06/super-simple-way-to-work-with-twitter.html */ 2 1 /* Thanks to Antonio Lupetti http://woork.blogspot.com/2009/06/super-simple-way-to-work-with-twitter.html */ 3 2 4 3 .twitter_container{ … … 9 8 margin: 0 auto; 10 9 } 11 12 10 .twitter_container a { 13 11 color:#0066CC; … … 22 20 } 23 21 .twitter_header h3{ 24 padding-top: 4px;22 padding-top:7px; 25 23 } 26 24 .twitter_header h3 a{ 27 font-size:1 .2em;25 font-size:14px; 28 26 padding-top:4px; 29 27 color:#0066CC; … … 39 37 } 40 38 .twitter_status{ 39 border-bottom:solid 1px #DEDEDE; 41 40 height:50px; 41 *height:64px; 42 overflow:hidden; 42 43 padding:6px; 43 border-bottom:solid 1px #DEDEDE;44 45 44 } 46 45 .twitter_image{ … … 51 50 height:48px; 52 51 } 52 53 53 .twitter_posted_at{ 54 54 font-size:11px; -
branches/1.2/content/plugins/twitter_widget/languages/twitter_widget_language.php
r1159 r1235 37 37 /* Sidebar */ 38 38 $lang["twitter_widget_follow_us"] = "Follow Us on Twitter!"; 39 $lang["twitter_widget_followers"] = "Followers"; 40 39 41 ?> -
branches/1.2/content/plugins/twitter_widget/readme.txt
r1151 r1235 2 2 --------------------------------- 3 3 Created by: Jon Harvey 4 Uses Twitterlibphp4 Uses: Twitterlibphp 5 5 Thanks to : Antonio Lupetti 6 6 … … 19 19 Changelog 20 20 --------- 21 v.0.1 2010/ --/--- JonH - Released first version21 v.0.1 2010/02/24 - JonH - Released first version -
branches/1.2/content/plugins/twitter_widget/twitter_widget.php
r1203 r1235 2 2 /** 3 3 * name: Twitter Widget 4 * description: Sidebar widget that shows your sites Twitter follower count and tweets4 * description: Sidebar widget that shows your sites Twitter follower count and friends tweets 5 5 * version: 0.1 6 6 * folder: twitter_widget 7 7 * class: TwitterWidget 8 * requires: widgets 0.7 8 * requires: widgets 0.7, sb_base 0.1 9 9 * hooks: install_plugin, header_include, admin_plugin_settings, admin_sidebar_plugin_settings 10 10 * author: Jon Harvey … … 58 58 public function widget_twitter_widget($h) 59 59 { 60 61 // your twitter username and password 62 $twitter_widget_username = $h->getSetting('twitter_widget_username', 'twitter_widget'); 63 $twitter_widget_password = $h->getSetting('twitter_widget_password', 'twitter_widget'); 64 65 // include Twitterlibphp 66 require_once(PLUGINS . 'twitter_widget/libs/twitter_lib.php'); 67 68 // initialize the twitter class 69 $twitter = new Twitter($twitter_widget_username, $twitter_widget_password); 70 71 72 ///// testing purposes (doesn't count against your hit limit to call up remaining hits) 73 if ($h->isDebug) { 74 // grabs status for API rate limit for testing cache 75 $calls = $twitter->rateLimitStatus(); 76 77 $hits = new SimpleXMLElement($calls); 78 79 echo '<br/>'; 80 echo 'remaining hits for this hour = ' . $hits->{'remaining-hits'}; 81 } 82 60 83 $need_cache = false; 61 84 62 85 // check for a cached version and use it if no recent update: 63 $cached_output = $h->smartCache('html', 'posts', 60, '', 'twitter_widget');86 $cached_output = $h->smartCache('html', 'posts', 10, '', 'twitter_widget'); 64 87 if ($cached_output) { 65 88 echo $cached_output; // cached HTML … … 69 92 } 70 93 71 // your twitter username and password72 $twitter_widget_username = $h->getSetting('twitter_widget_username', 'twitter_widget');73 $twitter_widget_password = $h->getSetting('twitter_widget_password', 'twitter_widget');74 75 // include Twitterlibphp76 require_once(PLUGINS . 'twitter_widget/libs/twitter_lib.php');77 78 // initialize the twitter class79 $twitter = new Twitter($twitter_widget_username, $twitter_widget_password);80 81 // grabs status for API rate limit for testing cache82 $calls = $twitter->rateLimitStatus();83 84 $hits = new SimpleXMLElement($calls);85 86 94 // fetch your profile in xml format 87 95 $user = $twitter->showUser(); … … 89 97 $my_info = new SimpleXMLElement($user); 90 98 91 // fetch your friends in xml format or use getUserTimelineto show your own99 // fetch your friends (people you follow) in xml format or use getUserTimeline() to show your own 92 100 $xml = $twitter->getFriendsTimeline(); 93 101 … … 109 117 110 118 111 112 119 // show twitter widget template 113 120 $output = "<div class='twitter_container'>\n"; 114 121 $output .= "<div class='twitter_header'>\n"; 115 122 $output .= "<img src='".$my_info->profile_image_url."' alt=".$my_info->screen_name." title=".$my_info->screen_name." >\n"; 116 $output .= "<h3><a href='http://www.twitter.com/".$my_info->screen_name."'>".$my_info->followers_count ." Followers</a></h3>\n";123 $output .= "<h3><a href='http://www.twitter.com/".$my_info->screen_name."'>".$my_info->followers_count ." ". $h->lang['twitter_widget_followers']."</a></h3>\n"; 117 124 //$output .= "<br/>\n"; 118 125 $output .= "<a href='http://www.twitter.com/".$my_info->screen_name."'>".$h->lang['twitter_widget_follow_us']."</a>\n"; … … 124 131 $output .= "<div class='twitter_status'>\n"; 125 132 foreach($status->user as $user){ 126 $output .= "<img src='".$user->profile_image_url."' class='twitter_image'>\n";133 $output .= "<img src='".$user->profile_image_url."' alt=".$user->screen_name." title=".$user->screen_name." class='twitter_image'>\n"; 127 134 $output .= "<a href='http://www.twitter.com/".$user->screen_name."'>".$user->name."</a>: \n"; 128 135 } … … 137 144 $output .= "</div>"; 138 145 139 ///// testing purposes (doesn't count against your hit limit to call up remaining hits)140 if ($h->isDebug) {141 $output .= '<br/>';142 $output .= 'remaining hits for this hour = ' . $hits->{'remaining-hits'};143 }144 146 145 146 ///////////////////////////////////147 148 147 if ($need_cache) { 149 148 $h->smartCache('html', 'posts', 10, $output, 'twitter_widget'); … … 152 151 echo $output; 153 152 154 //////////////////////////////////////////155 156 153 } 157 154
Note: See TracChangeset
for help on using the changeset viewer.