Smart YouTube PRO - Version 3.7.1

Version Description

  • Widget function now supports multi-languge plugins (thanks Emmanuel Gravel)
  • Playlist link in the feeds correctly displayed
Download this release

Release Info

Developer freediver
Plugin Icon 128x128 Smart YouTube PRO
Version 3.7.1
Comparing to
See all releases

Code changes from version 3.6.1 to 3.7.1

Files changed (3) hide show
  1. readme.txt +9 -1
  2. smartyoutube.class.php +22 -17
  3. smartyoutube.php +52 -33
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: freediver
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
4
  Tags: youtube, video, play, media, Post, posts, admin
5
  Requires at least: 2.0
6
- Tested up to: 2.9.2
7
  Stable tag: trunk
8
 
9
  Smart Youtube plugin allows you to insert full featured YouTube videos into your post, comments and in RSS feed.
@@ -37,6 +37,14 @@ Plugin by Vladimir Prelovac. Looking for <a href="http://www.prelovac.com/vladim
37
 
38
  == Changelog ==
39
 
 
 
 
 
 
 
 
 
40
  = 3.6.1 =
41
  * Added iPad compatibility
42
 
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
4
  Tags: youtube, video, play, media, Post, posts, admin
5
  Requires at least: 2.0
6
+ Tested up to: 3.0.1
7
  Stable tag: trunk
8
 
9
  Smart Youtube plugin allows you to insert full featured YouTube videos into your post, comments and in RSS feed.
37
 
38
  == Changelog ==
39
 
40
+ = 3.7.1 =
41
+ * Widget function now supports multi-languge plugins (thanks Emmanuel Gravel)
42
+ * Playlist link in the feeds correctly displayed
43
+
44
+ = 3.7 =
45
+ * WP3.0 checked
46
+ * Fixed hd and related videos parameter option
47
+
48
  = 3.6.1 =
49
  * Added iPad compatibility
50
 
smartyoutube.class.php CHANGED
@@ -14,7 +14,7 @@ class SmartYouTube
14
 
15
  function __construct()
16
  {
17
- $this->local_version = '3.4'; // TODO: Change this number???
18
  $this->custom_colors = array(
19
  'blank' => array('d6d6d6', 'f0f0f0'),
20
  'storm' => array('3a3a3a', '999999'),
@@ -480,7 +480,7 @@ END;
480
 
481
  if ($playlist)
482
  {
483
- $video_url = htmlspecialchars("$root_url/p/$file&rel=$disp_rel&color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay{$disp_info}$disp_ann&showsearch=$disp_search", ENT_QUOTES) . $high . $time;
484
  $yte_tag = <<<EOT
485
  <span class="youtube">
486
  <object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url" >
@@ -493,7 +493,7 @@ EOT;
493
  }
494
  elseif ($valid == 'off' || strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')===TRUE || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod')===TRUE || strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')===TRUE)
495
  {
496
- $video_url = htmlspecialchars("$root_url/v/$file&rel=$disp_rel&color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay{$disp_info}$disp_ann&showsearch=$disp_search", ENT_QUOTES) . $high . $time;
497
  $yte_tag = <<<EOT
498
  <span class="youtube">
499
  <object width="$width" height="$height">
@@ -507,7 +507,7 @@ EOT;
507
  }
508
  else
509
  {
510
- $video_url = htmlspecialchars("$root_url/v/$file&rel=$disp_rel&color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay{$disp_info}$disp_ann&showsearch=$disp_search", ENT_QUOTES) . $high . $time;
511
 
512
  $yte_tag = <<<EOT
513
  <span class="youtube">
@@ -527,15 +527,19 @@ EOT;
527
  {
528
  $high = '&fmt=18';
529
  }
530
-
 
 
 
 
531
  if ($this->options['img'] == 'on')
532
  {
533
- $yte_tag .= '<p><a href="http://www.youtube.com/watch?v=' . $file . $high. '"><img src="http://img.youtube.com/vi/' . $file . '/default.jpg" width="130" height="97" border=0></a></p>';
534
  }
535
 
536
  if ($this->options['link'] == 'on')
537
  {
538
- $yte_tag.='<p><a href="http://www.youtube.com/watch?v=' . $file . $high . '">www.youtube.com/watch?v=' . $file . '</a></p>';
539
  }
540
  // if ($this->options['link'] == 'off' && $this->options['img'] == 'off')
541
  // $yte_tag='http://www.youtube.com/watch?v='.$file;
@@ -599,17 +603,18 @@ EOT;
599
 
600
  add_option($this->key, $this->options);
601
  }
602
-
603
  function widget($args = array())
604
- {
605
- extract ($args);
606
- $text = $this->check($this->options['wtext'], 1);
607
- echo
608
- $before_widget,
609
- $before_title, $this->options['wtitle'], $after_title,
610
- $text,
611
- $after_widget;
612
- }
 
613
 
614
  function widget_control()
615
  {
14
 
15
  function __construct()
16
  {
17
+ $this->local_version = '3.6.1'; // TODO: Change this number???
18
  $this->custom_colors = array(
19
  'blank' => array('d6d6d6', 'f0f0f0'),
20
  'storm' => array('3a3a3a', '999999'),
480
 
481
  if ($playlist)
482
  {
483
+ $video_url = htmlspecialchars("$root_url/p/$file&color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay{$disp_info}$disp_ann&showsearch=$disp_search?rel=$disp_rel", ENT_QUOTES) . $high . $time;
484
  $yte_tag = <<<EOT
485
  <span class="youtube">
486
  <object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url" >
493
  }
494
  elseif ($valid == 'off' || strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')===TRUE || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod')===TRUE || strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')===TRUE)
495
  {
496
+ $video_url = htmlspecialchars("$root_url/v/$file&color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay{$disp_info}$disp_ann&showsearch=$disp_search?rel=$disp_rel", ENT_QUOTES) . $high . $time;
497
  $yte_tag = <<<EOT
498
  <span class="youtube">
499
  <object width="$width" height="$height">
507
  }
508
  else
509
  {
510
+ $video_url = htmlspecialchars("$root_url/v/$file&color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en&autoplay=$autoplay{$disp_info}$disp_ann&showsearch=$disp_search?rel=$disp_rel", ENT_QUOTES) . $high . $time;
511
 
512
  $yte_tag = <<<EOT
513
  <span class="youtube">
527
  {
528
  $high = '&fmt=18';
529
  }
530
+ if ($playlist)
531
+ $url='http://www.youtube.com/view_play_list?p=';
532
+ else
533
+ $url='http://www.youtube.com/watch?v=';
534
+
535
  if ($this->options['img'] == 'on')
536
  {
537
+ $yte_tag .= '<p><a href="'.$url . $file . $high. '"><img src="http://img.youtube.com/vi/' . $file . '/default.jpg" width="130" height="97" border=0></a></p>';
538
  }
539
 
540
  if ($this->options['link'] == 'on')
541
  {
542
+ $yte_tag.='<p><a href="'.$url . $file . $high . '">www.youtube.com/watch?v=' . $file . '</a></p>';
543
  }
544
  // if ($this->options['link'] == 'off' && $this->options['img'] == 'off')
545
  // $yte_tag='http://www.youtube.com/watch?v='.$file;
603
 
604
  add_option($this->key, $this->options);
605
  }
606
+
607
  function widget($args = array())
608
+ {
609
+ extract ($args);
610
+ $text = apply_filters( 'widget_text', $this->check($this->options['wtext'], 1));
611
+ $title = apply_filters( 'widget_title', $this->options['wtitle']);
612
+ echo
613
+ $before_widget,
614
+ $before_title, $title, $after_title,
615
+ $text,
616
+ $after_widget;
617
+ }
618
 
619
  function widget_control()
620
  {
smartyoutube.php CHANGED
@@ -4,48 +4,67 @@ Plugin Name: Smart Youtube
4
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube
5
  Description: Insert YouTube videos in posts, comments and RSS feeds with ease and full customization.
6
  Author: Vladimir Prelovac
7
- Version: 3.6.1
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
- Updates:
11
- 3.6.1 - Added Ipad compatbility (credits Lew Ayotte)
12
- 3.6 - Added compatibility with other youtube plugins such as wp-youtube ([yt]...[/yt] type code)
13
- 3.5 - Fixed Iphone issues
14
- 3.4.3 - Fixed privacy option
15
- 3.4.2 - Supports new #! style youtube urls
16
- 3.4.1 - Fixed widget
17
- 3.4 - Completely rewritten the plugin, added new HD video support, added video privacy option
18
- 3.3.2 - Fixed xHTML validation for playlists (credit Dietmar)
19
- 3.3.1 - Fixed Iphone validation (credit John Neumann)
20
- 3.3 - Supports migrated blogs from Wordpress.com replacing [youtube=youtubeadresss]
21
- 3.2 - Added title to widget, fixed HTML code issue with widget
22
- 3.1.1 - param closed properly for validation
23
- 3.1 - wmode transparent parameter updated to better handle transparancy
24
- 3.0 - Added video template, option to set sidebar video size, fixed sidebar widget code, fixed video syntax issue
25
- 2.8.1 - Display Annotioans added as option
26
- 2.8 - Support for playlists
27
- 2.7.5 - Plugin url updated to use WP_PLUGIN_URL
28
- 2.7.4 - Added option to remove info&ratings
29
- 2.7.3 - Removed annotiations
30
- 2.7 - Supports a sidebar widget for videos
31
- 2.6 - Added option to remove search button
32
- 2.5 - Added DVD quality support (httpvq)
33
- 2.4.1 - Small fixes in embed and rss links
34
- 2.4 - Added support for extra parameters like &start=50 to start the video at 50th second of play
35
- 2.2 - Full xHTML validaiton
36
- 2.1 - Made the application iPhone compatible and allowed full screen
37
- 2.0 - Support for playback high quality YouTube videos
38
- 1.9 - Added video autoplay option
39
- 1.8 - Solved Problem with HTML validation, enabled full video preview in RSS
40
- 1.6 - Solving a problem with wordpress handling special characters
41
- 1.5 - Added new admin interface and more options to control the video
42
 
43
  To-Do:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  - marinas javascript suggestion for hq videos
45
  - add editor button
46
  - The plugin places a preview image in the RSS feed which is great, but it links to the video on http://www.youtube.com. I would like to change it so the image links to the blog post so I can generate some traffic on my blog.
47
  - localization
48
  - the images appear under the embedded Smart Youtube videos. Is there any way to edit the z-index for Smart Youtube CSS? I
 
 
 
 
 
 
49
  */
50
 
51
 
4
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube
5
  Description: Insert YouTube videos in posts, comments and RSS feeds with ease and full customization.
6
  Author: Vladimir Prelovac
7
+ Version: 3.7.1
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  To-Do:
12
+
13
+ - Is there a way to have smart youtube display multiple thumbnails of youtube videos in this fashion:
14
+ http://wordpress.org/extend/plugins/my-youtube-playlist/
15
+
16
+ The author of this plugin has done a good job in birthing the concept, but is unable to really do much by way of support or add features, e.g. highlight thumbnail currently playing, flexible grouping styles of thumbnails (horizontal, vertical listing) etc.
17
+
18
+ - Wondering if there's a way to have smartyoutube generate a thumbnail of the youtube video that shows up as one of the thumbnail options for the article when someone shares the blog post?
19
+
20
+ - Would it be possible to overwrite the global autoplay param in a post, something like httpv://www.youtube.com/watch?v=00000000&autoplay=true; I tried to add autoplay=1 but unfortunately in the resuling html it adds autoplay=0 (the global option) and also autoplay=1
21
+ The result is no autoplay :(
22
+
23
+ - Instead of editing the shortcut, we have copied from youtube.
24
+ I would love to have a button,
25
+ like insert Smart YouTube Video
26
+ A dialogue box would pop up,
27
+ and allow me to just simply paste the link.
28
+ Then having check boxes on the side,
29
+ which allow me to choose whether you would like HD or not.
30
+ thus editing the link correctly.
31
+
32
+ I find this would greatly help, especiall when I help create video blogs for community provider who have very little computer background.
33
+
34
+ - Please add support for it on the BuddyPress Acitivity page, currently it just shows the url (which won't work because of the httpv and httpvh)
35
+
36
+ - Was wondering if it was possible for you to have the plugin take the URL for the Youtube thumbnail for the video and place it into a user defined custom field. The plugin "YoutubeThumb2CustomField" but no longer works in WP 3.0 (network).
37
+
38
+ - love to see vimeo support! i have video intensive site...love Vimeo
39
+
40
+ Only issue is I would LOVE to add the widget into another sidebar and I do not see this possibility. Can you have multiple Smart YouTubes?
41
+
42
+ - 1. Adding few possibilities for posting videos into post � I have great production of videos but before end of 2009 all was in 320 x 240 and after end of 2009 I start publishing video in 640 x 480 resolution. I have adjusted player video for 640 x 480 but now 320 x 240 videos are stretched across all of player window.
43
+
44
+ For changes to be easy implemented � I suggest adding 2 or even 3 possibilities for playing videos � like this:
45
+ Your original code httpv://www.youtube.com/********************
46
+ Another version of httpv#1://www.youtube.com/********************
47
+ Another version of httpv#2://www.youtube.com/********************
48
+ Another version of httpv#3://www.youtube.com/********************
49
+
50
+ Adding #1 after v will allow us to predefine what will be size of player for #1 or number #2 or number #3 � I think it is good idea
51
+
52
+ If you don�t put #1, #2, #3 player will be those which is default (without number) � in my case that is 640 x 480.
53
+
54
+ 2. If some video is for �personal use� which mean somebody must be log into you tube to see it, than I suggest making possibility for login for authors of those videos � If I put all my materials to be private (up to 25 people can see it) � than I cant publish them trough this way � and allowing authors to write theirs username and password will allow that those vides can be seen on my posts. That way I can protect all my archive of video on youtube, but allow those video can be visible on my blog � which can increase hits, visits and others possibility � that possibility is visible on this plug in http://tubepress.org/ where people can use its username and password for publishing all vides from if they have account on youtube
55
+
56
+
57
  - marinas javascript suggestion for hq videos
58
  - add editor button
59
  - The plugin places a preview image in the RSS feed which is great, but it links to the video on http://www.youtube.com. I would like to change it so the image links to the blog post so I can generate some traffic on my blog.
60
  - localization
61
  - the images appear under the embedded Smart Youtube videos. Is there any way to edit the z-index for Smart Youtube CSS? I
62
+ - would like to use multiple instances of the Smart YouTube plugin. I saw the reply that said to simply use multiple calls in one instance of the widget, but that doesn't let me choose different videos for different pages.
63
+ - was wondering if it's possible to get a vid and playlist in a custom page template?? Is it possible to add a preview image to search results?
64
+ - I wondered if there were a way to bring the video to the forefront layer (perhaps z-index)? I know this actually breaks good design practice in my intended use, but have a look here:
65
+ - However, on one page I have two videos and therefore I want to add a a parameter to the second video embed URL to _not_ start automatically. Something like httpv://www.youtube.com/watch?v=xyz123&autostart=off
66
+ - Single videos work well from wordpress on the Iphone/ipod. Is there a way to make the playlists work, just getting the ? cube instead of image.
67
+ - I would like to "inject" automatically this preview image url in a custom field, in each post, to auto-generate the thumb on my homepage with this image.
68
  */
69
 
70