Rotating Tweets (Twitter widget and shortcode) - Version 0.502

Version Description

Javascript fix for zero height tweets problem

=

Download this release

Release Info

Developer mpntod
Plugin Icon wp plugin Rotating Tweets (Twitter widget and shortcode)
Version 0.502
Comparing to
See all releases

Code changes from version 0.501 to 0.502

Files changed (4) hide show
  1. css/style.css +2 -0
  2. js/rotating_tweet.js +29 -6
  3. readme.txt +9 -6
  4. rotatingtweets.php +14 -9
css/style.css CHANGED
@@ -17,6 +17,7 @@ p.rtw_meta {
17
  padding-top: 1%;
18
  padding-bottom: 1%;
19
  }
 
20
  div.rtw_nav {
21
  text-align: center;
22
  font-size: 2em;
@@ -24,3 +25,4 @@ div.rtw_nav {
24
  div.rtw_nav a.activeSlide {
25
  color: red;
26
  }
 
17
  padding-top: 1%;
18
  padding-bottom: 1%;
19
  }
20
+ /*
21
  div.rtw_nav {
22
  text-align: center;
23
  font-size: 2em;
25
  div.rtw_nav a.activeSlide {
26
  color: red;
27
  }
28
+ */
js/rotating_tweet.js CHANGED
@@ -8,15 +8,37 @@ jQuery(document).ready(function() {
8
  var rotate_id_split = rotate_id.split('_');
9
  var rotate_timeout = rotate_id_split[1];
10
  var rotate_fx = rotate_id_split[2];
11
- /* If we have the zeebizcard template - set a minimum height - used to do this via a separate script, but this is easier to maintain */
12
- if (jQuery('#zee_stylesheet-css').is('link')) {
13
- var rotate_height = '7em';
14
- } else {
15
- var rotate_height = 'auto';
16
- }
17
  /* If the rotation type has not been set - then set it to scrollUp */
18
  if(rotate_fx == null){rotate_fx = 'scrollUp'};
19
  /* Call the rotation */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  jQuery(rotate_id).cycle({
21
  pause: 1,
22
  height: rotate_height,
@@ -30,6 +52,7 @@ jQuery(document).ready(function() {
30
  },
31
  fx: rotate_fx
32
  });
 
33
  });
34
  });
35
  /* And call the Twitter script while we're at it! */
8
  var rotate_id_split = rotate_id.split('_');
9
  var rotate_timeout = rotate_id_split[1];
10
  var rotate_fx = rotate_id_split[2];
 
 
 
 
 
 
11
  /* If the rotation type has not been set - then set it to scrollUp */
12
  if(rotate_fx == null){rotate_fx = 'scrollUp'};
13
  /* Call the rotation */
14
+ jQuery(rotate_id).cycle({
15
+ pause: 1,
16
+ height: 'auto',
17
+ timeout: rotate_timeout,
18
+ fx: rotate_fx
19
+ });
20
+ /* If the height of the rotating tweet box is zero - kill the box and start again */
21
+ var rt_height = jQuery(rotate_id).height();
22
+ if(rt_height == 0) {
23
+ var rt_children_id = rotate_id + ' .rotatingtweet';
24
+ var rt_height = 0;
25
+ /* Go through the tweets - get their height - and set the minimum height */
26
+ jQuery(rt_children_id).each(function() {
27
+ var rt_tweet_height = jQuery(this).height();
28
+ if(rt_tweet_height > rt_height) {
29
+ rt_height = rt_tweet_height;
30
+ }
31
+ });
32
+ var rt_height_px = rt_height + 'px';
33
+ jQuery(rotate_id).cycle('destroy');
34
+ jQuery(rotate_id).cycle({
35
+ pause: 1,
36
+ height: rt_height_px,
37
+ timeout: rotate_timeout,
38
+ fx: rotate_fx
39
+ });
40
+ }
41
+ /*
42
  jQuery(rotate_id).cycle({
43
  pause: 1,
44
  height: rotate_height,
52
  },
53
  fx: rotate_fx
54
  });
55
+ */
56
  });
57
  });
58
  /* And call the Twitter script while we're at it! */
readme.txt CHANGED
@@ -1,14 +1,14 @@
1
- === Rotating Tweets widget and shortcode ===
2
  Contributors: mpntod
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9XCNM4QSVHYT8
4
  Tags: shortcode,widget,twitter,rotating,rotate,rotator,tweet,tweets,animation,jquery,jquery cycle,cycle
5
  Requires at least: 2.6
6
- Tested up to: 3.4
7
- Stable tag: 0.500
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Widget and/or shortcode to show your latest tweets one at a time an animated rotation
12
 
13
  == Description ==
14
  * **Replaces a [shortcode](http://codex.wordpress.org/Shortcode) such as `[rotatingtweets screen_name='your_twitter']`, or a [widget](http://codex.wordpress.org/WordPress_Widgets), with a rotating display of your most recent tweets**
@@ -58,10 +58,13 @@ although the only one you *have* to have is `screen_name`.
58
  In most cases, each use (or "instance") of this plug-in gets data from Twitter every 2 minutes. The exception is when two or more instances share the same settings (screen name etc.), in which case they share the same data rather than each calling it separately.
59
 
60
  == Upgrade notice ==
61
- = 0.500 =
62
- Adds options for how tweet information is displayed and how the tweet rotates.
63
 
64
  == Changelog ==
 
 
 
65
  = 0.500 =
66
  Adds options for how tweet information is displayed and how the tweet rotates.
67
 
1
+ === Rotating Tweets (Twitter widget and shortcode) ===
2
  Contributors: mpntod
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9XCNM4QSVHYT8
4
  Tags: shortcode,widget,twitter,rotating,rotate,rotator,tweet,tweets,animation,jquery,jquery cycle,cycle
5
  Requires at least: 2.6
6
+ Tested up to: 3.4.1
7
+ Stable tag: 0.502
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Twitter widget and shortcode to show your latest tweets one at a time an animated rotation
12
 
13
  == Description ==
14
  * **Replaces a [shortcode](http://codex.wordpress.org/Shortcode) such as `[rotatingtweets screen_name='your_twitter']`, or a [widget](http://codex.wordpress.org/WordPress_Widgets), with a rotating display of your most recent tweets**
58
  In most cases, each use (or "instance") of this plug-in gets data from Twitter every 2 minutes. The exception is when two or more instances share the same settings (screen name etc.), in which case they share the same data rather than each calling it separately.
59
 
60
  == Upgrade notice ==
61
+ = 0.502 =
62
+ Javascript fix for zero height tweets problem
63
 
64
  == Changelog ==
65
+ = 0.502 =
66
+ Javascript fix for zero height tweets problem
67
+
68
  = 0.500 =
69
  Adds options for how tweet information is displayed and how the tweet rotates.
70
 
rotatingtweets.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /*
3
- Plugin Name: Rotating Tweets widget & shortcode
4
  Description: Replaces a shortcode such as [rotatingtweets userid='your_twitter_name'], or a widget, with a rotating tweets display
5
- Version: 0.501
6
  Author: Martin Tod
7
  Author URI: http://www.martintod.org.uk
8
  License: GPL2
@@ -472,11 +472,12 @@ function rotating_tweets_display($json,$args,$print=TRUE) {
472
  if(!empty($meta)) $meta .= ' &middot; ';
473
  $meta .= '<a href="http://twitter.com/intent/tweet?in_reply_to='.$twitter_object->id_str.'">reply</a> &middot; <a href="http://twitter.com/intent/retweet?tweet_id='.$twitter_object->id_str.'">retweet</a> &middot; <a href="http://twitter.com/intent/favorite?tweet_id='.$twitter_object->id_str.'">favorite</a>';
474
  endif;
475
- /* Experiment with Prev / Next buttons */
476
- if(!$args['show_meta_prev_next']):
477
  if(!empty($meta)) $meta .= ' &middot; ';
478
  $meta .= '<a href="#" class="rtw_prev">prev</a> &middot; <a href="#" class="rtw_next">next</a>';
479
  endif;
 
480
  if(!empty($meta)):
481
  $result .= "\n\t\t<p class='rtw_meta'>".ucfirst($meta)."</p>";
482
  endif;
@@ -490,11 +491,15 @@ function rotating_tweets_display($json,$args,$print=TRUE) {
490
  endforeach;
491
  endif;
492
  $result .= "\n</div>";
493
- $result .= "<div id='".$id."_nav' class='rtw_nav'>";
494
- for ($i = 1; $i <= $tweet_count; $i++) {
495
- $result .= '<a href="#">&bull;</a> ';
496
- }
497
- $result .= "</div>";
 
 
 
 
498
  if($args['show_follow'] && !empty($user->screen_name)):
499
  unset($shortenvariables);
500
  if($args['no_show_count']) $shortenvariables = ' data-show-count="false"';
1
  <?php
2
  /*
3
+ Plugin Name: Rotating Tweets (Twitter widget & shortcode)
4
  Description: Replaces a shortcode such as [rotatingtweets userid='your_twitter_name'], or a widget, with a rotating tweets display
5
+ Version: 0.502
6
  Author: Martin Tod
7
  Author URI: http://www.martintod.org.uk
8
  License: GPL2
472
  if(!empty($meta)) $meta .= ' &middot; ';
473
  $meta .= '<a href="http://twitter.com/intent/tweet?in_reply_to='.$twitter_object->id_str.'">reply</a> &middot; <a href="http://twitter.com/intent/retweet?tweet_id='.$twitter_object->id_str.'">retweet</a> &middot; <a href="http://twitter.com/intent/favorite?tweet_id='.$twitter_object->id_str.'">favorite</a>';
474
  endif;
475
+ /* Experiment with Prev / Next buttons
476
+ if($args['show_meta_prev_next']):
477
  if(!empty($meta)) $meta .= ' &middot; ';
478
  $meta .= '<a href="#" class="rtw_prev">prev</a> &middot; <a href="#" class="rtw_next">next</a>';
479
  endif;
480
+ */
481
  if(!empty($meta)):
482
  $result .= "\n\t\t<p class='rtw_meta'>".ucfirst($meta)."</p>";
483
  endif;
491
  endforeach;
492
  endif;
493
  $result .= "\n</div>";
494
+ /*
495
+ if($args['show_meta_progress_blobs']):
496
+ $result .= "<div id='".$id."_nav' class='rtw_nav'>";
497
+ for ($i = 1; $i <= $tweet_count; $i++) {
498
+ $result .= '<a href="#">&bull;</a> ';
499
+ }
500
+ $result .= "</div>";
501
+ endif;
502
+ */
503
  if($args['show_follow'] && !empty($user->screen_name)):
504
  unset($shortenvariables);
505
  if($args['no_show_count']) $shortenvariables = ' data-show-count="false"';