Twitter Widget Pro - Version 1.4.2

Version Description

  • Thanks to RaveN and Dries Arnold for pointing out that the "about # ____ ago" phrases weren't translatable
Download this release

Release Info

Developer aaroncampbell
Plugin Icon wp plugin Twitter Widget Pro
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

languages/twitter-widget-pro.pot CHANGED
@@ -7,13 +7,14 @@ msgid ""
7
  msgstr ""
8
  "Project-Id-Version: PACKAGE VERSION\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/twitter-widget-pro\n"
10
- "POT-Creation-Date: 2009-06-24 21:46+0000\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=CHARSET\n"
16
  "Content-Transfer-Encoding: 8bit\n"
 
17
 
18
  #: wp-twitter-widget.php:48
19
  msgid "Twitter Widget Pro"
@@ -152,6 +153,55 @@ msgstr ""
152
  msgid "Show Link to Twitter Widget Pro"
153
  msgstr ""
154
 
155
- #: wp-twitter-widget.php:642
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  msgid "Settings"
157
  msgstr ""
7
  msgstr ""
8
  "Project-Id-Version: PACKAGE VERSION\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/twitter-widget-pro\n"
10
+ "POT-Creation-Date: 2009-06-25 16:28+0000\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=CHARSET\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
18
 
19
  #: wp-twitter-widget.php:48
20
  msgid "Twitter Widget Pro"
153
  msgid "Show Link to Twitter Widget Pro"
154
  msgstr ""
155
 
156
+ #: wp-twitter-widget.php:570
157
+ #, php-format
158
+ msgid "about %s year ago"
159
+ msgid_plural "about %s years ago"
160
+ msgstr[0] ""
161
+ msgstr[1] ""
162
+
163
+ #: wp-twitter-widget.php:571
164
+ #, php-format
165
+ msgid "about %s month ago"
166
+ msgid_plural "about %s months ago"
167
+ msgstr[0] ""
168
+ msgstr[1] ""
169
+
170
+ #: wp-twitter-widget.php:572
171
+ #, php-format
172
+ msgid "about %s week ago"
173
+ msgid_plural "about %s weeks ago"
174
+ msgstr[0] ""
175
+ msgstr[1] ""
176
+
177
+ #: wp-twitter-widget.php:573
178
+ #, php-format
179
+ msgid "about %s day ago"
180
+ msgid_plural "about %s days ago"
181
+ msgstr[0] ""
182
+ msgstr[1] ""
183
+
184
+ #: wp-twitter-widget.php:574
185
+ #, php-format
186
+ msgid "about %s hour ago"
187
+ msgid_plural "about %s hours ago"
188
+ msgstr[0] ""
189
+ msgstr[1] ""
190
+
191
+ #: wp-twitter-widget.php:575
192
+ #, php-format
193
+ msgid "about %s minute ago"
194
+ msgid_plural "about %s minutes ago"
195
+ msgstr[0] ""
196
+ msgstr[1] ""
197
+
198
+ #: wp-twitter-widget.php:576
199
+ #, php-format
200
+ msgid "about %s second ago"
201
+ msgid_plural "about %s seconds ago"
202
+ msgstr[0] ""
203
+ msgstr[1] ""
204
+
205
+ #: wp-twitter-widget.php:673
206
  msgid "Settings"
207
  msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal%4
4
  Tags: twitter, widget, feed
5
  Requires at least: 2.7
6
  Tested up to: 2.8
7
- Stable tag: 1.4.1
8
 
9
  A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links. Requires PHP5.
10
 
@@ -46,7 +46,10 @@ Aparently the database queries required to display the friends feed was causing
46
 
47
  == Changelog ==
48
 
49
- = 1.4.0 =
 
 
 
50
  * Fixed some translatable strings
51
  * Fixed readme text
52
 
4
  Tags: twitter, widget, feed
5
  Requires at least: 2.7
6
  Tested up to: 2.8
7
+ Stable tag: 1.4.2
8
 
9
  A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links. Requires PHP5.
10
 
46
 
47
  == Changelog ==
48
 
49
+ = 1.4.2 =
50
+ * Thanks to RaveN and Dries Arnold for pointing out that the "about # ____ ago" phrases weren't translatable
51
+
52
+ = 1.4.1 =
53
  * Fixed some translatable strings
54
  * Fixed readme text
55
 
wp-twitter-widget.php CHANGED
@@ -3,13 +3,13 @@
3
  * Plugin Name: Twitter Widget Pro
4
  * Plugin URI: http://xavisys.com/wordpress-twitter-widget/
5
  * Description: A widget that properly handles twitter feeds, including @username, #hashtag, and link parsing. It can even display profile images for the users. Requires PHP5.
6
- * Version: 1.4.1
7
  * Author: Aaron D. Campbell
8
  * Author URI: http://xavisys.com/
9
  * Text Domain: twitter-widget-pro
10
  */
11
 
12
- define('TWP_VERSION', '1.4.1');
13
 
14
  /* Copyright 2006 Aaron D. Campbell (email : wp_plugins@xavisys.com)
15
 
@@ -544,13 +544,13 @@ profileImage;
544
  private function _timeSince($startTimestamp, $max) {
545
  // array of time period chunks
546
  $chunks = array(
547
- array('seconds' => 60 * 60 * 24 * 365, 'name' => 'year'),
548
- array('seconds' => 60 * 60 * 24 * 30, 'name' => 'month'),
549
- array('seconds' => 60 * 60 * 24 * 7, 'name' => 'week'),
550
- array('seconds' => 60 * 60 * 24, 'name' => 'day'),
551
- array('seconds' => 60 * 60, 'name' => 'hour'),
552
- array('seconds' => 60, 'name' => 'minute'),
553
- array('seconds' => 1, 'name' => 'second')
554
  );
555
 
556
  $since = time() - $startTimestamp;
@@ -559,6 +559,23 @@ profileImage;
559
  return date('h:i:s A F d, Y', $startTimestamp);
560
  }
561
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  // $j saves performing the count function each time around the loop
563
  for ($i = 0, $j = count($chunks); $i < $j; $i++) {
564
  extract($chunks[$i]);
@@ -574,7 +591,21 @@ profileImage;
574
  $print .= 's';
575
  }
576
 
577
- return "about {$print} ago";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
578
  }
579
 
580
  public function activatePlugin() {
3
  * Plugin Name: Twitter Widget Pro
4
  * Plugin URI: http://xavisys.com/wordpress-twitter-widget/
5
  * Description: A widget that properly handles twitter feeds, including @username, #hashtag, and link parsing. It can even display profile images for the users. Requires PHP5.
6
+ * Version: 1.4.2
7
  * Author: Aaron D. Campbell
8
  * Author URI: http://xavisys.com/
9
  * Text Domain: twitter-widget-pro
10
  */
11
 
12
+ define('TWP_VERSION', '1.4.2');
13
 
14
  /* Copyright 2006 Aaron D. Campbell (email : wp_plugins@xavisys.com)
15
 
544
  private function _timeSince($startTimestamp, $max) {
545
  // array of time period chunks
546
  $chunks = array(
547
+ 'year' => 60 * 60 * 24 * 365, // 31,536,000 seconds
548
+ 'month' => 60 * 60 * 24 * 7, // 2,592,000 seconds
549
+ 'week' => 60 * 60 * 24 * 7, // 604,800 seconds
550
+ 'day' => 60 * 60 * 24, // 86,400 seconds
551
+ 'hour' => 60 * 60, // 3600 seconds
552
+ 'minute' => 60, // 60 seconds
553
+ 'second' => 1 // 1 second
554
  );
555
 
556
  $since = time() - $startTimestamp;
559
  return date('h:i:s A F d, Y', $startTimestamp);
560
  }
561
 
562
+ foreach ( $chunks as $key => $seconds ) {
563
+ // finding the biggest chunk (if the chunk fits, break)
564
+ if (($count = floor($since / $seconds)) != 0) {
565
+ break;
566
+ }
567
+ }
568
+
569
+ $messages = array(
570
+ 'year' => _n('about %s year ago', 'about %s years ago', $count),
571
+ 'month' => _n('about %s month ago', 'about %s months ago', $count),
572
+ 'week' => _n('about %s week ago', 'about %s weeks ago', $count),
573
+ 'day' => _n('about %s day ago', 'about %s days ago', $count),
574
+ 'hour' => _n('about %s hour ago', 'about %s hours ago', $count),
575
+ 'minute' => _n('about %s minute ago', 'about %s minutes ago', $count),
576
+ 'second' => _n('about %s second ago', 'about %s seconds ago', $count),
577
+ );
578
+ /*
579
  // $j saves performing the count function each time around the loop
580
  for ($i = 0, $j = count($chunks); $i < $j; $i++) {
581
  extract($chunks[$i]);
591
  $print .= 's';
592
  }
593
 
594
+ // array of time period chunks
595
+ $chunks = array(
596
+ array(
597
+ 'seconds' => 60 * 60 * 24 * 365,
598
+ 'name' => _n('about %s year ago', 'about %s years ago', $count)
599
+ ),
600
+ array('seconds' => 60 * 60 * 24 * 30, 'name' => 'month'),
601
+ array('seconds' => 60 * 60 * 24 * 7, 'name' => 'week'),
602
+ array('seconds' => 60 * 60 * 24, 'name' => 'day'),
603
+ array('seconds' => 60 * 60, 'name' => 'hour'),
604
+ array('seconds' => 60, 'name' => 'minute'),
605
+ array('seconds' => 1, 'name' => 'second')
606
+ );
607
+ */
608
+ return sprintf($messages[$key], $count);
609
  }
610
 
611
  public function activatePlugin() {