Smart YouTube PRO - Version 2.3

Version Description

Download this release

Release Info

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

Code changes from version 2.2.1 to 2.3

Files changed (2) hide show
  1. readme.txt +4 -1
  2. smartyoutube.php +20 -4
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.6
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.
@@ -30,6 +30,9 @@ Main Features:
30
 
31
 
32
  Change Log:
 
 
 
33
  v2.2:
34
  - Full xHTML validation
35
 
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.6.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.
30
 
31
 
32
  Change Log:
33
+ v2.3:
34
+ - xHTML valid code is now an option because it breaks videos in some browsers and feeds
35
+
36
  v2.2:
37
  - Full xHTML validation
38
 
smartyoutube.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Smart Youtube
4
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube
5
  Description: Easily insert YouTube videos in posts, comments and RSS feeds.
6
  Author: Vladimir Prelovac
7
- Version: 2.2.1
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
  Updates:
@@ -21,7 +21,7 @@ To-Doo:
21
  - localization
22
  */
23
 
24
- $yte_localversion="2.2.1";
25
 
26
  $CustomColors=array (
27
  "blank" => array("d6d6d6","f0f0f0"),
@@ -69,10 +69,12 @@ function yte_options_page()
69
  {
70
 
71
  $disp_img = !isset($_POST['disp_img'])? 'off': 'on';
72
- $disp_link = !isset($_POST['disp_link'])? 'off': 'on';
 
73
 
74
  update_option('smart_yt_img', $disp_img);
75
  update_option('smart_yt_link', $disp_link);
 
76
 
77
  $disp_width = (int) ($_POST['disp_width']=="")? '425': $_POST['disp_width'];
78
  $disp_height = (int) ($_POST['disp_height']=="")? '344': $_POST['disp_height'];
@@ -120,6 +122,8 @@ function yte_options_page()
120
  $disp_img = (get_option('smart_yt_img')=='on') ? 'checked':'';
121
  $disp_link = (get_option('smart_yt_link')=='on') ? 'checked':'';
122
 
 
 
123
 
124
  $disp_width = get_option('smart_yt_width');
125
  $disp_height = get_option('smart_yt_height');
@@ -360,6 +364,12 @@ text-decoration:none;
360
  </div>
361
 
362
 
 
 
 
 
 
 
363
  <br>
364
  <p><strong>RSS feed options</strong></p>
365
  <p>Some RSS feed readers like Bloglines will show embeded YouTube videos. Some will not and Smart YouTube allows you to display a video link and a video screenshot instead.</p>
@@ -413,7 +423,9 @@ global $CustomColors;
413
  $height+=18;
414
 
415
 
416
- if ( strpos($_SERVER['HTTP_USER_AGENT'], "iPhone") || strpos($_SERVER['HTTP_USER_AGENT'], "iPod") )
 
 
417
  $yte_tag = '<!-- Smart Youtube --><span class="youtube"><object width="'.$width.'" height="'.$height.'"><param name="movie" value="'.htmlspecialchars('http://www.youtube.com/v/'.$file.'&rel='.$disp_rel.'&color1='.$CustomColors[$disp_color][0].'&color2='.$CustomColors[$disp_color][1].'&border='.$disp_border.'&fs=1&autoplay='.$autoplay.$high, ENT_QUOTES).'"></param><param name="allowFullScreen" value="true"></param><embed src="'.htmlspecialchars('http://www.youtube.com/v/'.$file.'&amp;rel='.$disp_rel.'&amp;color1='.$CustomColors[$disp_color][0].'&amp;color2='.$CustomColors[$disp_color][1].'&amp;border='.$disp_border.'&amp;fs=1&amp;autoplay='.$autoplay.$high, ENT_QUOTES).'" type="application/x-shockwave-flash" allowfullscreen="true" width="'.$width.'" height="'.$height.'" ></embed><param name="wmode" value="transparent" /></object></span>';
418
  else
419
  $yte_tag = '<!-- Smart Youtube --><span class="youtube"><object type="application/x-shockwave-flash" width="'.$width.'" height="'.$height.'" data="'.htmlspecialchars('http://www.youtube.com/v/'.$file.'&rel='.$disp_rel.'&color1='.$CustomColors[$disp_color][0].'&color2='.$CustomColors[$disp_color][1].'&border='.$disp_border.'&fs=1&autoplay='.$autoplay.$high, ENT_QUOTES).'"><param name="movie" value="'.htmlspecialchars('http://www.youtube.com/v/'.$file.'&rel='.$disp_rel.'&color1='.$CustomColors[$disp_color][0].'&color2='.$CustomColors[$disp_color][1].'&border='.$disp_border.'&fs=1&autoplay='.$autoplay.$high, ENT_QUOTES).'"></param><param name="allowFullScreen" value="true"></param><param name="wmode" value="transparent" /></object></span>';
@@ -484,6 +496,10 @@ function yte_install(){
484
  add_option('smart_yt_link', 'on');
485
  }
486
 
 
 
 
 
487
 
488
 
489
  }
4
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube
5
  Description: Easily insert YouTube videos in posts, comments and RSS feeds.
6
  Author: Vladimir Prelovac
7
+ Version: 2.3
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
  Updates:
21
  - localization
22
  */
23
 
24
+ $yte_localversion="2.3";
25
 
26
  $CustomColors=array (
27
  "blank" => array("d6d6d6","f0f0f0"),
69
  {
70
 
71
  $disp_img = !isset($_POST['disp_img'])? 'off': 'on';
72
+ $disp_link = !isset($_POST['disp_link'])? 'off': 'on';
73
+ $valid = !isset($_POST['valid'])? 'off': 'on';
74
 
75
  update_option('smart_yt_img', $disp_img);
76
  update_option('smart_yt_link', $disp_link);
77
+ update_option('smart_yt_valid', $valid);
78
 
79
  $disp_width = (int) ($_POST['disp_width']=="")? '425': $_POST['disp_width'];
80
  $disp_height = (int) ($_POST['disp_height']=="")? '344': $_POST['disp_height'];
122
  $disp_img = (get_option('smart_yt_img')=='on') ? 'checked':'';
123
  $disp_link = (get_option('smart_yt_link')=='on') ? 'checked':'';
124
 
125
+ $valid = (get_option('smart_yt_valid')=='on') ? 'checked':'';
126
+
127
 
128
  $disp_width = get_option('smart_yt_width');
129
  $disp_height = get_option('smart_yt_height');
364
  </div>
365
 
366
 
367
+ <br>
368
+ <p><strong>xHTML validation</strong></p>
369
+ <p>Enabling the option below will make your YouTube code xHTML valid. But be warned that code may not work in some browsers like iPhone and in feed readers.</p>
370
+ <div><input id="valid" type="checkbox" name="valid" $valid />
371
+ <label for="valid">Enable xHTML Validation</label></div>
372
+
373
  <br>
374
  <p><strong>RSS feed options</strong></p>
375
  <p>Some RSS feed readers like Bloglines will show embeded YouTube videos. Some will not and Smart YouTube allows you to display a video link and a video screenshot instead.</p>
423
  $height+=18;
424
 
425
 
426
+ // if ( strpos($_SERVER['HTTP_USER_AGENT'], "iPhone") || strpos($_SERVER['HTTP_USER_AGENT'], "iPod") )
427
+
428
+ if (!get_option('smart_yt_valid'))
429
  $yte_tag = '<!-- Smart Youtube --><span class="youtube"><object width="'.$width.'" height="'.$height.'"><param name="movie" value="'.htmlspecialchars('http://www.youtube.com/v/'.$file.'&rel='.$disp_rel.'&color1='.$CustomColors[$disp_color][0].'&color2='.$CustomColors[$disp_color][1].'&border='.$disp_border.'&fs=1&autoplay='.$autoplay.$high, ENT_QUOTES).'"></param><param name="allowFullScreen" value="true"></param><embed src="'.htmlspecialchars('http://www.youtube.com/v/'.$file.'&amp;rel='.$disp_rel.'&amp;color1='.$CustomColors[$disp_color][0].'&amp;color2='.$CustomColors[$disp_color][1].'&amp;border='.$disp_border.'&amp;fs=1&amp;autoplay='.$autoplay.$high, ENT_QUOTES).'" type="application/x-shockwave-flash" allowfullscreen="true" width="'.$width.'" height="'.$height.'" ></embed><param name="wmode" value="transparent" /></object></span>';
430
  else
431
  $yte_tag = '<!-- Smart Youtube --><span class="youtube"><object type="application/x-shockwave-flash" width="'.$width.'" height="'.$height.'" data="'.htmlspecialchars('http://www.youtube.com/v/'.$file.'&rel='.$disp_rel.'&color1='.$CustomColors[$disp_color][0].'&color2='.$CustomColors[$disp_color][1].'&border='.$disp_border.'&fs=1&autoplay='.$autoplay.$high, ENT_QUOTES).'"><param name="movie" value="'.htmlspecialchars('http://www.youtube.com/v/'.$file.'&rel='.$disp_rel.'&color1='.$CustomColors[$disp_color][0].'&color2='.$CustomColors[$disp_color][1].'&border='.$disp_border.'&fs=1&autoplay='.$autoplay.$high, ENT_QUOTES).'"></param><param name="allowFullScreen" value="true"></param><param name="wmode" value="transparent" /></object></span>';
496
  add_option('smart_yt_link', 'on');
497
  }
498
 
499
+ if(get_option('smart_yt_valid' == '') || !get_option('smart_yt_valid')){
500
+ add_option('smart_yt_valid', '');
501
+ }
502
+
503
 
504
 
505
  }