Rotating Tweets (Twitter widget and shortcode) - Version 1.7.3

Version Description

  • Adds show_tco_link shortcode variable to allow people to show t.co.links. Support for Newswire template.

=

Download this release

Release Info

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

Code changes from version 1.7.2 to 1.7.3

Files changed (3) hide show
  1. js/jquery.cycle2.carousel.js +269 -0
  2. readme.txt +17 -11
  3. rotatingtweets.php +16 -4
js/jquery.cycle2.carousel.js ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! carousel transition plugin for Cycle2; version: 20130528 */
2
+ (function($) {
3
+ "use strict";
4
+
5
+ $( document ).on('cycle-bootstrap', function( e, opts, API ) {
6
+ if ( opts.fx !== 'carousel' )
7
+ return;
8
+
9
+ API.getSlideIndex = function( el ) {
10
+ var slides = this.opts()._carouselWrap.children();
11
+ var i = slides.index( el );
12
+ return i % slides.length;
13
+ };
14
+
15
+ // override default 'next' function
16
+ API.next = function() {
17
+ var count = opts.reverse ? -1 : 1;
18
+ if ( opts.allowWrap === false && ( opts.currSlide + count ) > opts.slideCount - opts.carouselVisible )
19
+ return;
20
+ opts.API.advanceSlide( count );
21
+ opts.API.trigger('cycle-next', [ opts ]).log('cycle-next');
22
+ };
23
+
24
+ });
25
+
26
+
27
+ $.fn.cycle.transitions.carousel = {
28
+ // transition API impl
29
+ preInit: function( opts ) {
30
+ opts.hideNonActive = false;
31
+
32
+ opts.container.on('cycle-destroyed', $.proxy(this.onDestroy, opts.API));
33
+ // override default API implementation
34
+ opts.API.stopTransition = this.stopTransition;
35
+
36
+ // issue #10
37
+ for (var i=0; i < opts.startingSlide; i++) {
38
+ opts.container.append( opts.slides[0] );
39
+ }
40
+ },
41
+
42
+ // transition API impl
43
+ postInit: function( opts ) {
44
+ var i, j, slide, pagerCutoffIndex, wrap;
45
+ var vert = opts.carouselVertical;
46
+ if (opts.carouselVisible && opts.carouselVisible > opts.slideCount)
47
+ opts.carouselVisible = opts.slideCount - 1;
48
+ var visCount = opts.carouselVisible || opts.slides.length;
49
+ var slideCSS = { display: vert ? 'block' : 'inline-block', position: 'static' };
50
+
51
+ // required styles
52
+ opts.container.css({ position: 'relative', overflow: 'hidden' });
53
+ opts.slides.css( slideCSS );
54
+
55
+ opts._currSlide = opts.currSlide;
56
+
57
+ // wrap slides in a div; this div is what is animated
58
+ wrap = $('<div class="cycle-carousel-wrap"></div>')
59
+ .prependTo( opts.container )
60
+ .css({ margin: 0, padding: 0, top: 0, left: 0, position: 'absolute' })
61
+ .append( opts.slides );
62
+
63
+ opts._carouselWrap = wrap;
64
+
65
+ if ( !vert )
66
+ wrap.css('white-space', 'nowrap');
67
+
68
+ if ( opts.allowWrap !== false ) {
69
+ // prepend and append extra slides so we don't see any empty space when we
70
+ // near the end of the carousel. for fluid containers, add even more clones
71
+ // so there is plenty to fill the screen
72
+ // @todo: optimzie this based on slide sizes
73
+
74
+ for ( j=0; j < (opts.carouselVisible === undefined ? 2 : 1); j++ ) {
75
+ for ( i=0; i < opts.slideCount; i++ ) {
76
+ wrap.append( opts.slides[i].cloneNode(true) );
77
+ }
78
+ i = opts.slideCount;
79
+ while ( i-- ) { // #160, #209
80
+ wrap.prepend( opts.slides[i].cloneNode(true) );
81
+ }
82
+ }
83
+
84
+ wrap.find('.cycle-slide-active').removeClass('cycle-slide-active');
85
+ opts.slides.eq(opts.startingSlide).addClass('cycle-slide-active');
86
+ }
87
+
88
+ if ( opts.pager && opts.allowWrap === false ) {
89
+ // hide "extra" pagers
90
+ pagerCutoffIndex = opts.slideCount - visCount;
91
+ $( opts.pager ).children().filter( ':gt('+pagerCutoffIndex+')' ).hide();
92
+ }
93
+
94
+ opts._nextBoundry = opts.slideCount - opts.carouselVisible;
95
+
96
+ this.prepareDimensions( opts );
97
+ },
98
+
99
+ prepareDimensions: function( opts ) {
100
+ var dim, offset, pagerCutoffIndex, tmp;
101
+ var vert = opts.carouselVertical;
102
+ var visCount = opts.carouselVisible || opts.slides.length;
103
+
104
+ if ( opts.carouselFluid && opts.carouselVisible ) {
105
+ if ( ! opts._carouselResizeThrottle ) {
106
+ // fluid container AND fluid slides; slides need to be resized to fit container
107
+ this.fluidSlides( opts );
108
+ }
109
+ }
110
+ else if ( opts.carouselVisible && opts.carouselSlideDimension ) {
111
+ dim = visCount * opts.carouselSlideDimension;
112
+ opts.container[ vert ? 'height' : 'width' ]( dim );
113
+ }
114
+ else if ( opts.carouselVisible ) {
115
+ dim = visCount * $(opts.slides[0])[vert ? 'outerHeight' : 'outerWidth'](true);
116
+ opts.container[ vert ? 'height' : 'width' ]( dim );
117
+ }
118
+ // else {
119
+ // // fluid; don't size the container
120
+ // }
121
+
122
+ offset = ( opts.carouselOffset || 0 );
123
+ if ( opts.allowWrap !== false ) {
124
+ if ( opts.carouselSlideDimension ) {
125
+ offset -= ( (opts.slideCount + opts.currSlide) * opts.carouselSlideDimension );
126
+ }
127
+ else {
128
+ // calculate offset based on actual slide dimensions
129
+ tmp = opts._carouselWrap.children();
130
+ for (var j=0; j < (opts.slideCount + opts.currSlide); j++) {
131
+ offset -= $(tmp[j])[vert?'outerHeight':'outerWidth'](true);
132
+ }
133
+ }
134
+ }
135
+
136
+ opts._carouselWrap.css( vert ? 'top' : 'left', offset );
137
+ },
138
+
139
+ fluidSlides: function( opts ) {
140
+ var timeout;
141
+ var slide = opts.slides.eq(0);
142
+ var adjustment = slide.outerWidth() - slide.width();
143
+ var prepareDimensions = this.prepareDimensions;
144
+
145
+ // throttle resize event
146
+ $(window).on( 'resize', resizeThrottle);
147
+
148
+ opts._carouselResizeThrottle = resizeThrottle;
149
+ onResize();
150
+
151
+ function resizeThrottle() {
152
+ clearTimeout( timeout );
153
+ timeout = setTimeout( onResize, 20 );
154
+ }
155
+
156
+ function onResize() {
157
+ opts._carouselWrap.stop( false, true );
158
+ var slideWidth = opts.container.width() / opts.carouselVisible;
159
+ slideWidth = Math.ceil( slideWidth - adjustment );
160
+ opts._carouselWrap.children().width( slideWidth );
161
+ if ( opts._sentinel )
162
+ opts._sentinel.width( slideWidth );
163
+ prepareDimensions( opts );
164
+ }
165
+ },
166
+
167
+ // transition API impl
168
+ transition: function( opts, curr, next, fwd, callback ) {
169
+ var moveBy, props = {};
170
+ var hops = opts.nextSlide - opts.currSlide;
171
+ var vert = opts.carouselVertical;
172
+ var speed = opts.speed;
173
+
174
+ // handle all the edge cases for wrapping & non-wrapping
175
+ if ( opts.allowWrap === false ) {
176
+ fwd = hops > 0;
177
+ var currSlide = opts._currSlide;
178
+ var maxCurr = opts.slideCount - opts.carouselVisible;
179
+ if ( hops > 0 && opts.nextSlide > maxCurr && currSlide == maxCurr ) {
180
+ hops = 0;
181
+ }
182
+ else if ( hops > 0 && opts.nextSlide > maxCurr ) {
183
+ hops = opts.nextSlide - currSlide - (opts.nextSlide - maxCurr);
184
+ }
185
+ else if ( hops < 0 && opts.currSlide > maxCurr && opts.nextSlide > maxCurr ) {
186
+ hops = 0;
187
+ }
188
+ else if ( hops < 0 && opts.currSlide > maxCurr ) {
189
+ hops += opts.currSlide - maxCurr;
190
+ }
191
+ else
192
+ currSlide = opts.currSlide;
193
+
194
+ moveBy = this.getScroll( opts, vert, currSlide, hops );
195
+ opts.API.opts()._currSlide = opts.nextSlide > maxCurr ? maxCurr : opts.nextSlide;
196
+ }
197
+ else {
198
+ if ( fwd && opts.nextSlide === 0 ) {
199
+ // moving from last slide to first
200
+ moveBy = this.getDim( opts, opts.currSlide, vert );
201
+ callback = this.genCallback( opts, fwd, vert, callback );
202
+ }
203
+ else if ( !fwd && opts.nextSlide == opts.slideCount - 1 ) {
204
+ // moving from first slide to last
205
+ moveBy = this.getDim( opts, opts.currSlide, vert );
206
+ callback = this.genCallback( opts, fwd, vert, callback );
207
+ }
208
+ else {
209
+ moveBy = this.getScroll( opts, vert, opts.currSlide, hops );
210
+ }
211
+ }
212
+
213
+ props[ vert ? 'top' : 'left' ] = fwd ? ( "-=" + moveBy ) : ( "+=" + moveBy );
214
+
215
+ // throttleSpeed means to scroll slides at a constant rate, rather than
216
+ // a constant speed
217
+ if ( opts.throttleSpeed )
218
+ speed = (moveBy / $(opts.slides[0])[vert ? 'height' : 'width']() ) * opts.speed;
219
+
220
+ opts._carouselWrap.animate( props, speed, opts.easing, callback );
221
+ },
222
+
223
+ getDim: function( opts, index, vert ) {
224
+ var slide = $( opts.slides[index] );
225
+ return slide[ vert ? 'outerHeight' : 'outerWidth'](true);
226
+ },
227
+
228
+ getScroll: function( opts, vert, currSlide, hops ) {
229
+ var i, moveBy = 0;
230
+
231
+ if (hops > 0) {
232
+ for (i=currSlide; i < currSlide+hops; i++)
233
+ moveBy += this.getDim( opts, i, vert);
234
+ }
235
+ else {
236
+ for (i=currSlide; i > currSlide+hops; i--)
237
+ moveBy += this.getDim( opts, i, vert);
238
+ }
239
+ return moveBy;
240
+ },
241
+
242
+ genCallback: function( opts, fwd, vert, callback ) {
243
+ // returns callback fn that resets the left/top wrap position to the "real" slides
244
+ return function() {
245
+ var pos = $(opts.slides[opts.nextSlide]).position();
246
+ var offset = 0 - pos[vert?'top':'left'] + (opts.carouselOffset || 0);
247
+ opts._carouselWrap.css( opts.carouselVertical ? 'top' : 'left', offset );
248
+ callback();
249
+ };
250
+ },
251
+
252
+ // core API override
253
+ stopTransition: function() {
254
+ var opts = this.opts();
255
+ opts.slides.stop( false, true );
256
+ opts._carouselWrap.stop( false, true );
257
+ },
258
+
259
+ // core API supplement
260
+ onDestroy: function( e ) {
261
+ var opts = this.opts();
262
+ if ( opts._carouselResizeThrottle )
263
+ $( window ).off( 'resize', opts._carouselResizeThrottle );
264
+ opts.slides.prependTo( opts.container );
265
+ opts._carouselWrap.remove();
266
+ }
267
+ };
268
+
269
+ })(jQuery);
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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,multilingual,responsive
5
  Requires at least: 2.6
6
- Tested up to: 3.9.1
7
- Stable tag: 1.7.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,7 +12,7 @@ Twitter widget and shortcode to show your latest tweets one at a time an animate
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**
15
- * **Supports v 1.1 of the Twitter API** - yes! it will keep working after [June 11, 2013](https://dev.twitter.com/blog/api-v1-is-retired)
16
  * **Space efficient** - instead of showing all your tweets at once, shows one at a time and then smoothly replaces it with the next one. After showing all your tweets, loops back to the beginning again.
17
  * **Reliable** - keeps showing your latest Tweets even if the Twitter website is down.
18
  * **Customisable** - you decide whose tweets to show, how many to show, whether to include retweets and replies, and whether to show a follow button. You can also decide how quickly the tweets rotate and what type of animation to use.
@@ -20,7 +20,7 @@ Twitter widget and shortcode to show your latest tweets one at a time an animate
20
  * Gives you the option to show a fully customisable Twitter 'follow' button
21
  * Replaces [t.co](http://t.co) links with the original link
22
  * Caches the most recent data from Twitter to avoid problems with rate limiting
23
- * Uses [jQuery](http://jquery.com/) and [jQuery.Cycle](http://jquery.malsup.com/cycle/) to produce a nice smooth result.
24
  * **Multi-lingual** - now set up to be multi-lingual. The Twitter 'follow' button is automatically translated to match your site's language setting [if Twitter has made the appropriate language available](https://dev.twitter.com/docs/api/1.1/get/help/languages). Also uses [Wordpress's multi-lingual capability](http://codex.wordpress.org/I18n_for_WordPress_Developers) to enable translation of all the other text used by the plug-in via language packs.
25
 
26
  Currently the following languages are available:
@@ -77,9 +77,10 @@ Possible variables for the shortcode include:
77
  * `links_in_new_window` = `'0'` or `'1'` - show links in a new tab or window - default is `'0'`
78
  * `rotation_type` = If you are using version 1 of the JavaScript, you can use any of the options listed on the [jQuery.cycle website](http://jquery.malsup.com/cycle/browser.html) - default is `'scrollUp'.` If you are using version 2 of the JavaScript, then the options are `'scrollUp'`,`'scrollDown'`,`'scrollHorz'`,`'scrollLeft'`,`'scrollRight'`,`'toss'`,`'scrollVert'`,`'fade'` and `'carousel'`
79
  * `carousel_horizontal` = `0` or `1` - if you've chosen 'carousel' as a rotation type, allow horizontal scrolling - default is `0`
80
- * 'carousel_count' => ''number'' - if you've chosen 'carousel' as a rotation type, set the number of slides to appear in the carousel - default is 3 for vertical carousel and enough to fill the width of the page for horizontal carousel
81
- * 'carousel_responsive' => `0` or `1` - if you've chosen a 'horizontal carousel' as a rotation type, makes the carousel responsive to the size of the page - default is `0`
82
- * `url_length` = sets the length that the URL should be trimmed to... - optional
 
83
  * `show_meta_timestamp` = `'0'` or `'1'` - show the time and date of each tweet - default is `'1'`
84
  * `show_meta_screen_name` = `'0'` or `'1'` - show who posted each tweet - default is `'1'`
85
  * `show_meta_via` = `'0'` or `'1'` - show how each tweet was posted - default is `'1'`
@@ -173,13 +174,18 @@ into your CSS - changing `123px;` to the width you're aiming at - either via put
173
  You can do this by going to the `rotatingtweets/css` directory and renaming `rotatingtweets-sample.css` to `rotatingtweets.css` and putting it in the `wp-content/uploads/` directory. This displays a Twitter bird to the left of your tweets. Any CSS you put into `rotatingtweets.css` won't be overwritten when the plug-in is upgraded to the latest version.
174
 
175
  == Upgrade notice ==
176
- = 1.7.2 =
177
- * Removes 'expand' for carousel rotation. Adds new 'insidebottom' option for 'next / prev' buttons.
178
 
179
  == Changelog ==
 
 
 
 
 
180
  = 1.7.2 =
181
- * Removes 'expand' for carousel rotation.
182
- * Adds new `insidebottom` option for position of 'next / prev' buttons
183
 
184
  = 1.7.1 =
185
  * Improved CSS support for horizontal carousel scrolling
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,multilingual,responsive
5
  Requires at least: 2.6
6
+ Tested up to: 4.0
7
+ Stable tag: 1.7.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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**
15
+ * **Supports v 1.1 of the Twitter API** ([i.e. it still works](https://dev.twitter.com/blog/api-v1-is-retired))
16
  * **Space efficient** - instead of showing all your tweets at once, shows one at a time and then smoothly replaces it with the next one. After showing all your tweets, loops back to the beginning again.
17
  * **Reliable** - keeps showing your latest Tweets even if the Twitter website is down.
18
  * **Customisable** - you decide whose tweets to show, how many to show, whether to include retweets and replies, and whether to show a follow button. You can also decide how quickly the tweets rotate and what type of animation to use.
20
  * Gives you the option to show a fully customisable Twitter 'follow' button
21
  * Replaces [t.co](http://t.co) links with the original link
22
  * Caches the most recent data from Twitter to avoid problems with rate limiting
23
+ * Uses [jQuery](http://jquery.com/), [jQuery.Cycle](http://jquery.malsup.com/cycle/) and [jQuery.Cycle2](http://jquery.malsup.com/cycle2/) to produce a nice smooth result.
24
  * **Multi-lingual** - now set up to be multi-lingual. The Twitter 'follow' button is automatically translated to match your site's language setting [if Twitter has made the appropriate language available](https://dev.twitter.com/docs/api/1.1/get/help/languages). Also uses [Wordpress's multi-lingual capability](http://codex.wordpress.org/I18n_for_WordPress_Developers) to enable translation of all the other text used by the plug-in via language packs.
25
 
26
  Currently the following languages are available:
77
  * `links_in_new_window` = `'0'` or `'1'` - show links in a new tab or window - default is `'0'`
78
  * `rotation_type` = If you are using version 1 of the JavaScript, you can use any of the options listed on the [jQuery.cycle website](http://jquery.malsup.com/cycle/browser.html) - default is `'scrollUp'.` If you are using version 2 of the JavaScript, then the options are `'scrollUp'`,`'scrollDown'`,`'scrollHorz'`,`'scrollLeft'`,`'scrollRight'`,`'toss'`,`'scrollVert'`,`'fade'` and `'carousel'`
79
  * `carousel_horizontal` = `0` or `1` - if you've chosen 'carousel' as a rotation type, allow horizontal scrolling - default is `0`
80
+ * `carousel_count` = ''number'' - if you've chosen 'carousel' as a rotation type, set the number of slides to appear in the carousel - default is 3 for vertical carousel and enough to fill the width of the page for horizontal carousel
81
+ * `carousel_responsive` = `0` or `1` - if you've chosen a 'horizontal carousel' as a rotation type, makes the carousel responsive to the size of the page - default is `0`
82
+ * `url_length` = sets the length that the URL of links should be trimmed to... - optional
83
+ * `show_tco_link` = `'0'` or `'1'` allows you to show Twitter's t.co link instead of the original link - optional
84
  * `show_meta_timestamp` = `'0'` or `'1'` - show the time and date of each tweet - default is `'1'`
85
  * `show_meta_screen_name` = `'0'` or `'1'` - show who posted each tweet - default is `'1'`
86
  * `show_meta_via` = `'0'` or `'1'` - show how each tweet was posted - default is `'1'`
174
  You can do this by going to the `rotatingtweets/css` directory and renaming `rotatingtweets-sample.css` to `rotatingtweets.css` and putting it in the `wp-content/uploads/` directory. This displays a Twitter bird to the left of your tweets. Any CSS you put into `rotatingtweets.css` won't be overwritten when the plug-in is upgraded to the latest version.
175
 
176
  == Upgrade notice ==
177
+ = 1.7.3 =
178
+ * Adds `show_tco_link` shortcode variable to allow people to show t.co.links. Support for Newswire template.
179
 
180
  == Changelog ==
181
+ = 1.7.3 =
182
+ * Adds `show_tco_link` shortcode variable to allow people to show t.co.links.
183
+ * Support for Newswire template
184
+ * Restores the caching of Tweet co-ordinates
185
+
186
  = 1.7.2 =
187
+ * Switches off JavaScript expansion of 'expand' to 'reply retweet favorite' for carousel rotation.
188
+ * Adds new `insidebottom` option for `np_pos` shortcode variable
189
 
190
  = 1.7.1 =
191
  * Improved CSS support for horizontal carousel scrolling
rotatingtweets.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Rotating Tweets (Twitter widget & shortcode)
4
  Description: Replaces a shortcode such as [rotatingtweets screen_name='your_twitter_name'], or a widget, with a rotating tweets display
5
- Version: 1.7.2
6
  Text Domain: rotatingtweets
7
  Author: Martin Tod
8
  Author URI: http://www.martintod.org.uk
@@ -505,7 +505,8 @@ function rotatingtweets_display_shortcode( $atts, $content=null, $code="", $prin
505
  'carousel_horizontal' => 0,
506
  'carousel_count' => 0,
507
  'carousel_responsive' => 0,
508
- 'no_emoji' => 0
 
509
  ), $atts ) ;
510
  extract($args);
511
  if(empty($screen_name) && empty($search) && !empty($url)):
@@ -1104,7 +1105,7 @@ function rotatingtweets_shrink_json($json) {
1104
  }
1105
  function rotatingtweets_shrink_element($json) {
1106
  global $args;
1107
- $rt_top_elements = array('text','retweeted_status','user','entities','source','id_str','created_at');
1108
  $return = array();
1109
  foreach($rt_top_elements as $rt_element):
1110
  if(isset($json[$rt_element])):
@@ -1514,7 +1515,11 @@ function rotating_tweets_display($json,$args,$print=TRUE) {
1514
  $displayurl = str_replace(json_decode('"\u2026"'),"",$displayurl);
1515
  $displayurl = substr($displayurl,0,$urllength)."&hellip;";
1516
  endif;
1517
- $after[] = "<a href='".$url['url']."' title='".$url['expanded_url']."'".$targetvalue.">".esc_html($displayurl)."</a>";
 
 
 
 
1518
  endforeach;
1519
  endif;
1520
  if(isset($entities['media'])):
@@ -1868,6 +1873,13 @@ function rotatingtweets_enqueue_scripts() {
1868
  'jquery-cycle2-scrollvert' => plugins_url('cyclone-slider-2/libs/cycle2/jquery.cycle2.scrollVert.min.js'),
1869
  'rotating_tweet' => plugins_url('js/rotatingtweets_v2_cyclone.js', __FILE__)
1870
  );
 
 
 
 
 
 
 
1871
  else:
1872
  $rt_enqueue_script_list = array(
1873
  'jquery-cycle2-renamed' => plugins_url('js/jquery.cycle2.renamed.js', __FILE__),
2
  /*
3
  Plugin Name: Rotating Tweets (Twitter widget & shortcode)
4
  Description: Replaces a shortcode such as [rotatingtweets screen_name='your_twitter_name'], or a widget, with a rotating tweets display
5
+ Version: 1.7.3
6
  Text Domain: rotatingtweets
7
  Author: Martin Tod
8
  Author URI: http://www.martintod.org.uk
505
  'carousel_horizontal' => 0,
506
  'carousel_count' => 0,
507
  'carousel_responsive' => 0,
508
+ 'no_emoji' => 0,
509
+ 'show_tco_link' => 0
510
  ), $atts ) ;
511
  extract($args);
512
  if(empty($screen_name) && empty($search) && !empty($url)):
1105
  }
1106
  function rotatingtweets_shrink_element($json) {
1107
  global $args;
1108
+ $rt_top_elements = array('text','retweeted_status','user','entities','source','id_str','created_at','coordinates');
1109
  $return = array();
1110
  foreach($rt_top_elements as $rt_element):
1111
  if(isset($json[$rt_element])):
1515
  $displayurl = str_replace(json_decode('"\u2026"'),"",$displayurl);
1516
  $displayurl = substr($displayurl,0,$urllength)."&hellip;";
1517
  endif;
1518
+ if(isset($args['show_tco_link']) && $args['show_tco_link']):
1519
+ $after[] = "<a href='".$url['url']."' title='".$url['expanded_url']."'".$targetvalue.">".esc_html($url['url'])."</a>";
1520
+ else:
1521
+ $after[] = "<a href='".$url['url']."' title='".$url['expanded_url']."'".$targetvalue.">".esc_html($displayurl)."</a>";
1522
+ endif;
1523
  endforeach;
1524
  endif;
1525
  if(isset($entities['media'])):
1873
  'jquery-cycle2-scrollvert' => plugins_url('cyclone-slider-2/libs/cycle2/jquery.cycle2.scrollVert.min.js'),
1874
  'rotating_tweet' => plugins_url('js/rotatingtweets_v2_cyclone.js', __FILE__)
1875
  );
1876
+ elseif ( function_exists( 'newswire_custom_scripts' ) ):
1877
+ $rt_enqueue_script_list = array(
1878
+ 'cycle2' => get_template_directory_uri() . '/library/js/jquery.cycle2.min.js' ,
1879
+ 'cycle2_scrollvert' => get_template_directory_uri() . '/library/js/jquery.cycle2.scrollVert.min.js' ,
1880
+ 'cycle2_carousel' => plugins_url('js/jquery.cycle2.carousel.js', __FILE__),
1881
+ 'rotating_tweet' => plugins_url('js/rotatingtweets_v2_cyclone.js', __FILE__)
1882
+ );
1883
  else:
1884
  $rt_enqueue_script_list = array(
1885
  'jquery-cycle2-renamed' => plugins_url('js/jquery.cycle2.renamed.js', __FILE__),