Shortcodes Ultimate - Version 3.6.0

Version Description

Upgrade normally via your Wordpress admin -> Plugins panel.

Download this release

Release Info

Developer gn_themes
Plugin Icon 128x128 Shortcodes Ultimate
Version 3.6.0
Comparing to
See all releases

Code changes from version 3.5.0 to 3.6.0

Files changed (7) hide show
  1. lib/available.php +18 -1
  2. lib/images.php +7 -5
  3. lib/media.php +9 -27
  4. lib/shortcodes.php +17 -7
  5. readme.txt +22 -2
  6. shortcodes-ultimate.php +14 -4
  7. todo.txt +4 -0
lib/available.php CHANGED
@@ -771,9 +771,18 @@
771
  'values' => false,
772
  'default' => '400',
773
  'desc' => __( 'Height', 'shortcodes-ultimate' )
 
 
 
 
 
 
 
 
 
774
  )
775
  ),
776
- 'usage' => '[media url="http://www.youtube.com/watch?v=2c2EEacfC1M"]<br/>[media url="http://vimeo.com/15069551"]<br/>[media url="video.mp4"]<br/>[media url="video.flv"]<br/>[media url="audio.mp3"]<br/>[media url="image.jpg"]',
777
  'desc' => __( 'YouTube video, Vimeo video, .mp4/.flv video, .mp3 file or images', 'shortcodes-ultimate' )
778
  ),
779
  # document
@@ -991,6 +1000,14 @@
991
  'default' => 'image',
992
  'desc' => __( 'Images links', 'shortcodes-ultimate' )
993
  ),
 
 
 
 
 
 
 
 
994
  'size' => array(
995
  'values' => array(
996
  '100x100',
771
  'values' => false,
772
  'default' => '400',
773
  'desc' => __( 'Height', 'shortcodes-ultimate' )
774
+ ),
775
+ 'jwplayer' => array(
776
+ 'values' => array(
777
+ '',
778
+ 'autostart=true',
779
+ 'controlbar=bottom'
780
+ ),
781
+ 'default' => '',
782
+ 'desc' => __( 'jwPlayer url-encoded params', 'shortcodes-ultimate' )
783
  )
784
  ),
785
+ 'usage' => '[media url="http://www.youtube.com/watch?v=2c2EEacfC1M"]<br/>[media url="http://vimeo.com/15069551"]<br/>[media url="video.mp4"]<br/>[media url="video.flv"]<br/>[media url="audio.mp3"]<br/>[media url="image.jpg"]<br/>[media url="video.flv" jwplayer="controlbar=bottom&autostart=true"]',
786
  'desc' => __( 'YouTube video, Vimeo video, .mp4/.flv video, .mp3 file or images', 'shortcodes-ultimate' )
787
  ),
788
  # document
1000
  'default' => 'image',
1001
  'desc' => __( 'Images links', 'shortcodes-ultimate' )
1002
  ),
1003
+ 'description' => array(
1004
+ 'values' => array(
1005
+ '0',
1006
+ '1'
1007
+ ),
1008
+ 'default' => '0',
1009
+ 'desc' => __( 'Show image description', 'shortcodes-ultimate' )
1010
+ ),
1011
  'size' => array(
1012
  'values' => array(
1013
  '100x100',
lib/images.php CHANGED
@@ -11,9 +11,9 @@
11
  function su_build_gallery( $source = 'post', $link = 'none', $size = '150x150', $limit = 10, $options = array( ) ) {
12
 
13
  // Thumbnail dimensions
14
- $dimensions = explode( 'x', $size );
15
- $width = $dimensions[0];
16
- $height = $dimensions[1];
17
 
18
  ### SOURCE: POST ###
19
  if ( strpos( $source, 'post' ) !== false ) {
@@ -53,7 +53,8 @@
53
  'image' => $attachment->guid,
54
  'thumbnail' => su_plugin_url() . '/lib/timthumb.php?src=' . $attachment->guid . '&amp;w=' . $width . '&amp;h=' . $height . '&amp;zc=1&amp;q=100',
55
  'link' => $linked,
56
- 'name' => $attachment->post_title
 
57
  );
58
  }
59
  }
@@ -84,7 +85,8 @@
84
  'image' => su_get_post_image( $image->ID ),
85
  'thumbnail' => su_plugin_url() . '/lib/timthumb.php?src=' . su_get_post_image( $image->ID ) . '&amp;w=' . $width . '&amp;h=' . $height . '&amp;zc=1&amp;q=100',
86
  'link' => $linked,
87
- 'name' => $image->post_title
 
88
  );
89
  }
90
  }
11
  function su_build_gallery( $source = 'post', $link = 'none', $size = '150x150', $limit = 10, $options = array( ) ) {
12
 
13
  // Thumbnail dimensions
14
+ $dims = explode( 'x', $size );
15
+ $width = $dims[0];
16
+ $height = $dims[1];
17
 
18
  ### SOURCE: POST ###
19
  if ( strpos( $source, 'post' ) !== false ) {
53
  'image' => $attachment->guid,
54
  'thumbnail' => su_plugin_url() . '/lib/timthumb.php?src=' . $attachment->guid . '&amp;w=' . $width . '&amp;h=' . $height . '&amp;zc=1&amp;q=100',
55
  'link' => $linked,
56
+ 'name' => $attachment->post_title,
57
+ 'description' => $attachment->post_content
58
  );
59
  }
60
  }
85
  'image' => su_get_post_image( $image->ID ),
86
  'thumbnail' => su_plugin_url() . '/lib/timthumb.php?src=' . su_get_post_image( $image->ID ) . '&amp;w=' . $width . '&amp;h=' . $height . '&amp;zc=1&amp;q=100',
87
  'link' => $linked,
88
+ 'name' => $image->post_title,
89
+ 'description' => $image->post_excerpt
90
  );
91
  }
92
  }
lib/media.php CHANGED
@@ -8,7 +8,7 @@
8
  * @param int $height Media object height
9
  * @return string Object markup
10
  */
11
- function su_get_media( $media_url, $width, $height, $preview = false ) {
12
 
13
  // Youtube video
14
  $video_url = parse_url( $media_url );
@@ -44,38 +44,20 @@
44
  if ( in_array( $video_ext, $videos ) ) {
45
  $player_id = uniqid( '_', false );
46
 
47
- $return = '
48
- <div id="player' . $player_id . '"> </div>
49
- <script type="text/javascript">
50
- jwplayer("player' . $player_id . '").setup({
51
- flashplayer: "' . su_plugin_url() . '/lib/player.swf",
52
- file: "' . $media_url . '",
53
- height: ' . $height . ',
54
- width: ' . $width . '
55
- });
56
- </script>
57
- ';
58
  }
59
 
60
  // Audio file (mp3)
61
  if ( mb_substr( $media_url, -4 ) == '.mp3' ) {
62
  $player_id = uniqid( '_', false );
63
 
64
- $return = '
65
- <div id="player' . $player_id . '"> </div>
66
- <script type="text/javascript">
67
- jwplayer("player' . $player_id . '").setup({
68
- flashplayer: "' . su_plugin_url() . '/lib/player.swf",
69
- file: "' . $media_url . '",
70
- height: ' . $height . ',
71
- width: ' . $width . ',
72
- controlbar: "bottom",
73
- image: "' . su_plugin_url() . '/images/media-audio.jpg",
74
- icons: "none",
75
- screencolor: "F0F0F0"
76
- });
77
- </script>
78
- ';
79
  }
80
 
81
  return $return;
8
  * @param int $height Media object height
9
  * @return string Object markup
10
  */
11
+ function su_get_media( $media_url, $width, $height, $jwplayer = false ) {
12
 
13
  // Youtube video
14
  $video_url = parse_url( $media_url );
44
  if ( in_array( $video_ext, $videos ) ) {
45
  $player_id = uniqid( '_', false );
46
 
47
+ if ( is_array( $jwplayer ) ) {
48
+ foreach( $jwplayer as $jwplayer_option => $jwplayer_value ) {
49
+ $jwplayer_options .= ',' . $jwplayer_option . ':"' . $jwplayer_value . '"';
50
+ }
51
+ }
52
+
53
+ $return = '<div id="player' . $player_id . '"><script type="text/javascript">jwplayer("player' . $player_id . '").setup({flashplayer:"' . su_plugin_url() . '/lib/player.swf",file:"' . $media_url . '",height:' . $height . ',width:' . $width . $jwplayer_options . '});</script></div>';
 
 
 
 
54
  }
55
 
56
  // Audio file (mp3)
57
  if ( mb_substr( $media_url, -4 ) == '.mp3' ) {
58
  $player_id = uniqid( '_', false );
59
 
60
+ $return = '<div id="player' . $player_id . '"><script type="text/javascript">jwplayer("player' . $player_id . '").setup({flashplayer:"' . su_plugin_url() . '/lib/player.swf",file:"' . $media_url . '",height: ' . $height . ',width:' . $width . ',controlbar:"bottom",image:"' . su_plugin_url() . '/images/media-audio.jpg",icons:"none",screencolor:"F0F0F0"});</script></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  return $return;
lib/shortcodes.php CHANGED
@@ -91,7 +91,7 @@
91
  $open_class = ( $open ) ? ' su-spoiler-open' : '';
92
  $open_display = ( $open ) ? ' style="display:block"' : '';
93
 
94
- return '<div class="su-spoiler su-spoiler-style-' . $style . $open_class . '"><div class="su-spoiler-title">' . $title . '</div><div class="su-spoiler-content"' . $open_display . '>' . do_shortcode( $content ) . '</div></div>';
95
  }
96
 
97
  /**
@@ -412,11 +412,17 @@
412
  extract( shortcode_atts( array(
413
  'url' => '',
414
  'width' => 600,
415
- 'height' => 400
 
416
  ), $atts ) );
417
 
 
 
 
 
 
418
  $return = '<div class="su-media">';
419
- $return .= ( $url ) ? su_get_media( $url, $width, $height ) : __( 'Please specify media url', 'shortcodes-ultimate' );
420
  $return .= '</div>';
421
 
422
  return $return;
@@ -625,14 +631,15 @@
625
  extract( shortcode_atts( array(
626
  'source' => 'post',
627
  'link' => 'image',
 
628
  'size' => '200x200',
629
  'limit' => 10
630
  ), $atts ) );
631
 
632
  // Get dimensions
633
- $size = explode( 'x', strtolower( $size ) );
634
- $width = $size[0];
635
- $height = $size[1];
636
 
637
  // Define unique gallery ID
638
  $gallery_id = uniqid( 'su-custom-gallery_' );
@@ -645,7 +652,10 @@
645
 
646
  $return = '<div id="' . $gallery_id . '" class="su-custom-gallery">';
647
  foreach ( $slides as $slide ) {
648
- $return .= '<a href="' . $slide['link'] . '" title="' . $slide['name'] . '"><img src="' . $slide['thumbnail'] . '" alt="' . $slide['name'] . '" width=" ' . $width . ' " height="' . $height . '" /></a>';
 
 
 
649
  }
650
  $return .= '<div class="su-spacer"></div></div>';
651
  }
91
  $open_class = ( $open ) ? ' su-spoiler-open' : '';
92
  $open_display = ( $open ) ? ' style="display:block"' : '';
93
 
94
+ return '<div class="su-spoiler su-spoiler-style-' . $style . $open_class . '"><div class="su-spoiler-title">' . $title . '</div><div class="su-spoiler-content"' . $open_display . '>' . su_do_shortcode( $content ) . '</div></div>';
95
  }
96
 
97
  /**
412
  extract( shortcode_atts( array(
413
  'url' => '',
414
  'width' => 600,
415
+ 'height' => 400,
416
+ 'jwplayer' => false
417
  ), $atts ) );
418
 
419
+ if ( $jwplayer ) {
420
+ $jwplayer = str_replace( '#038;', '&', $jwplayer );
421
+ parse_str( $jwplayer, $jwplayer_options );
422
+ }
423
+
424
  $return = '<div class="su-media">';
425
+ $return .= ( $url ) ? su_get_media( $url, $width, $height, $jwplayer_options ) : __( 'Please specify media url', 'shortcodes-ultimate' );
426
  $return .= '</div>';
427
 
428
  return $return;
631
  extract( shortcode_atts( array(
632
  'source' => 'post',
633
  'link' => 'image',
634
+ 'description' => false,
635
  'size' => '200x200',
636
  'limit' => 10
637
  ), $atts ) );
638
 
639
  // Get dimensions
640
+ $dims = explode( 'x', strtolower( $size ) );
641
+ $width = $dims[0];
642
+ $height = $dims[1];
643
 
644
  // Define unique gallery ID
645
  $gallery_id = uniqid( 'su-custom-gallery_' );
652
 
653
  $return = '<div id="' . $gallery_id . '" class="su-custom-gallery">';
654
  foreach ( $slides as $slide ) {
655
+
656
+ // Description
657
+ $desc = ( $description ) ? '<span>' . $slide['description'] . '</span>' : false;
658
+ $return .= '<a href="' . $slide['link'] . '" title="' . $slide['name'] . '"><img src="' . $slide['thumbnail'] . '" alt="' . $slide['name'] . '" width=" ' . $width . ' " height="' . $height . '" />' . $desc . '</a>';
659
  }
660
  $return .= '<div class="su-spacer"></div></div>';
661
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://gndev.info/donate/
4
  Tags: shortcode, shortcodes, short code, shortcodes, tab, tabs, button, buttons, jquery, box, boxes, toggle, spoiler, column, columns, services, service, pullquote, list, lists, frame, images, image, links, fancy, fancy link, fancy links, fancy buttons, jquery tabs, accordeon, slider, nivo, nivo slider, plugin, admin, photoshop, gallery, bloginfo, list pages, sub pages, navigation, siblings pages, children pages, permalink, permalinks, feed, document, member, members, documents, jcarousel, rss
5
  Requires at least: 3.0
6
  Tested up to: 3.3
7
- Stable tag: 3.5.0
8
 
9
  Provides support for multiple useful shortcodes
10
 
@@ -25,6 +25,10 @@ With this plugin you can easily create buttons, boxes, different sliders and muc
25
  * Improved spoiler shortcode (check settings page)
26
  * Multiple tabs bugfix
27
  * Authors can also use shortcode generator
 
 
 
 
28
 
29
  = Got a bug? =
30
  * [Support forum](http://wordpress.org/tags/shortcodes-ultimate?forum_id=10)
@@ -68,6 +72,7 @@ Upgrade normally via your Wordpress admin -> Plugins panel.
68
 
69
  = What mean compatibility mode? =
70
  This mode adds a prefix to all plugin shortcodes
 
71
  * [button] => [gn_button]
72
  * [tabs] => [gn_tabs]
73
  * [tab] => [gn_tab]
@@ -80,17 +85,23 @@ Search it near Upload/Insert buttons. See screenshots.
80
  With these shortcodes you can create different galleries from attached to post images, or from category posts.
81
 
82
  Way 1: gallery from attachments
 
83
  * Create new post
84
  * Upload images
85
  * Use next shortcode on pages, posts or even widgets
 
86
  `[nivo_slider source="post=XX" link="image"]`
 
87
  XX - ID of the post with uploaded images
88
 
89
  Way 2: gallery from category
 
90
  * Create some posts in some category
91
  * Set the thumbnails of posts
92
  * Use next shortcode on pages, posts or even widgets
 
93
  `[nivo_slider source="cat=XX" link="image"]`
 
94
  XX - ID of the category with new posts
95
 
96
  Also, you can use [jcarousel] and [custom_gallery] according these principles.
@@ -98,8 +109,17 @@ Also, you can use [jcarousel] and [custom_gallery] according these principles.
98
 
99
  == Changelog ==
100
 
101
- = 3.5 =
 
 
 
102
 
 
 
 
 
 
 
103
 
104
  = 3.4 =
105
  * Belarusian translation
4
  Tags: shortcode, shortcodes, short code, shortcodes, tab, tabs, button, buttons, jquery, box, boxes, toggle, spoiler, column, columns, services, service, pullquote, list, lists, frame, images, image, links, fancy, fancy link, fancy links, fancy buttons, jquery tabs, accordeon, slider, nivo, nivo slider, plugin, admin, photoshop, gallery, bloginfo, list pages, sub pages, navigation, siblings pages, children pages, permalink, permalinks, feed, document, member, members, documents, jcarousel, rss
5
  Requires at least: 3.0
6
  Tested up to: 3.3
7
+ Stable tag: 3.6.0
8
 
9
  Provides support for multiple useful shortcodes
10
 
25
  * Improved spoiler shortcode (check settings page)
26
  * Multiple tabs bugfix
27
  * Authors can also use shortcode generator
28
+ * Nested shortcodes: spoiler, column, tabs, box, note
29
+ * Descriptions for [custom_gallery]
30
+ * Custom options for jwPlayer
31
+ * Fixed size option for sliders and gallery
32
 
33
  = Got a bug? =
34
  * [Support forum](http://wordpress.org/tags/shortcodes-ultimate?forum_id=10)
72
 
73
  = What mean compatibility mode? =
74
  This mode adds a prefix to all plugin shortcodes
75
+
76
  * [button] => [gn_button]
77
  * [tabs] => [gn_tabs]
78
  * [tab] => [gn_tab]
85
  With these shortcodes you can create different galleries from attached to post images, or from category posts.
86
 
87
  Way 1: gallery from attachments
88
+
89
  * Create new post
90
  * Upload images
91
  * Use next shortcode on pages, posts or even widgets
92
+
93
  `[nivo_slider source="post=XX" link="image"]`
94
+
95
  XX - ID of the post with uploaded images
96
 
97
  Way 2: gallery from category
98
+
99
  * Create some posts in some category
100
  * Set the thumbnails of posts
101
  * Use next shortcode on pages, posts or even widgets
102
+
103
  `[nivo_slider source="cat=XX" link="image"]`
104
+
105
  XX - ID of the category with new posts
106
 
107
  Also, you can use [jcarousel] and [custom_gallery] according these principles.
109
 
110
  == Changelog ==
111
 
112
+ = 3.6 =
113
+ * Descriptions for [custom_gallery]
114
+ * Custom options for jwPlayer
115
+ * Fixed size option for sliders and gallery
116
 
117
+ = 3.5 =
118
+ * New shortcode [accordion] for muliple spoilers
119
+ * Improved spoiler shortcode (check settings page)
120
+ * Multiple tabs bugfix
121
+ * Authors can also use shortcode generator
122
+ * Nested shortcodes: spoiler, column, tabs, box, note
123
 
124
  = 3.4 =
125
  * Belarusian translation
shortcodes-ultimate.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Shortcodes Ultimate
4
  Plugin URI: http://gndev.info/shortcodes-ultimate/
5
- Version: 3.5.0
6
  Author: Vladimir Anokhin
7
  Author URI: http://gndev.info/
8
  Description: Provides support for many easy to use shortcodes
@@ -184,6 +184,16 @@
184
  $strings = __( 'Shortcodes Ultimate', 'shortcodes-ultimate' ) . __( 'Vladimir Anokhin', 'shortcodes-ultimate' ) . __( 'Provides support for many easy to use shortcodes', 'shortcodes-ultimate' );
185
  }
186
 
 
 
 
 
 
 
 
 
 
 
187
  /**
188
  * Disable auto-formatting for shortcodes
189
  *
@@ -309,9 +319,9 @@
309
  <div id="su-generator-header">
310
  <select id="su-generator-select">
311
  <option value="raw"><?php _e( 'Select shortcode', 'shortcodes-ultimate' ); ?></option>
312
- <?php
313
- foreach ( su_shortcodes() as $name => $shortcode ) {
314
- ?>
315
  <option value="<?php echo $name; ?>"><?php echo strtoupper( $name ); ?>:&nbsp;&nbsp;<?php echo $shortcode['desc']; ?></option>
316
  <?php
317
  }
2
  /*
3
  Plugin Name: Shortcodes Ultimate
4
  Plugin URI: http://gndev.info/shortcodes-ultimate/
5
+ Version: 3.6.0
6
  Author: Vladimir Anokhin
7
  Author URI: http://gndev.info/
8
  Description: Provides support for many easy to use shortcodes
184
  $strings = __( 'Shortcodes Ultimate', 'shortcodes-ultimate' ) . __( 'Vladimir Anokhin', 'shortcodes-ultimate' ) . __( 'Provides support for many easy to use shortcodes', 'shortcodes-ultimate' );
185
  }
186
 
187
+ /*
188
+ * Custom shortcode function for nested shortcodes support
189
+ */
190
+ function su_do_shortcode( $content ) {
191
+ if ( strpos( $content, '[=' ) !== false ) {
192
+ $content = preg_replace( '@(\[=*)=(s|/)@', "$1$2", $content );
193
+ }
194
+ return do_shortcode( $content );
195
+ }
196
+
197
  /**
198
  * Disable auto-formatting for shortcodes
199
  *
319
  <div id="su-generator-header">
320
  <select id="su-generator-select">
321
  <option value="raw"><?php _e( 'Select shortcode', 'shortcodes-ultimate' ); ?></option>
322
+ <?php
323
+ foreach ( su_shortcodes() as $name => $shortcode ) {
324
+ ?>
325
  <option value="<?php echo $name; ?>"><?php echo strtoupper( $name ); ?>:&nbsp;&nbsp;<?php echo $shortcode['desc']; ?></option>
326
  <?php
327
  }
todo.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ Shortcode [twitter]/[tweet]
2
+ Shortcode [label]
3
+ Shortcode [pricing] + [plan] (pricing tables)
4
+ Nested shortcodes