Smart YouTube PRO - Version 3.4.2

Version Description

Download this release

Release Info

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

Code changes from version 3.5 to 3.4.2

Files changed (4) hide show
  1. readme.txt +2 -6
  2. screenshot-1.png +0 -0
  3. smartyoutube.class.php +57 -32
  4. smartyoutube.php +1 -3
readme.txt CHANGED
@@ -36,14 +36,10 @@ Plugin by Vladimir Prelovac. Looking for <a href="http://www.prelovac.com/vladim
36
 
37
  == Changelog ==
38
 
39
- = 3.5 =
40
- * Fixed Iphone Issues
41
-
42
- = 3.4.3 =
43
- * Fixed privacy option
44
  * Supports new #! style Youtube URLs
45
 
46
- = 3.4.1 =
47
  * Fixed widget problem
48
 
49
  = 3.4 =
36
 
37
  == Changelog ==
38
 
39
+ = 3.4.2=
 
 
 
 
40
  * Supports new #! style Youtube URLs
41
 
42
+ = 3.4.1=
43
  * Fixed widget problem
44
 
45
  = 3.4 =
screenshot-1.png CHANGED
Binary file
smartyoutube.class.php CHANGED
@@ -105,7 +105,7 @@ class SmartYouTube
105
  $this->options['border'] = !isset($_POST['embedBorder']) ? 0 : 1;
106
  $this->options['color'] = !isset($_POST['embedColor']) ? 'blank' : $_POST['embedColor'];
107
  $this->options['autoplay'] = !isset($_POST['autoplay']) ? 0 : 1;
108
- $this->options['privacy'] = !isset($_POST['disp_privacy']) ? 0 : 1;
109
 
110
  $this->options['posts'] = !isset($_POST['disp_posts']) ? 'off' : 'on';
111
  $this->options['comments'] = !isset($_POST['disp_comments']) ? 'off' : 'on';
@@ -331,7 +331,7 @@ class SmartYouTube
331
  </div>
332
 
333
  <h3>xHTML validation</h3>
334
- <p class="instruct">Enabling the option below will change default YouTube code to be xHTML valid.</p>
335
  <input id="valid" type="checkbox" name="valid" $valid />
336
  <label for="valid">Enable xHTML Validation</label>
337
 
@@ -350,7 +350,7 @@ class SmartYouTube
350
  </div>
351
  </div>
352
  </div>
353
- <h5 class="author">Another fine WordPress plugin by <a href="http://www.prelovac.com/vladimir/">Vladimir Prelovac</a></h5>
354
  END;
355
  }
356
 
@@ -458,27 +458,51 @@ END;
458
  {
459
  $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;
460
  $yte_tag = <<<EOT
461
- <span class="youtube">
462
- <object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url" >
463
- <param name="movie" value="$video_url" />
464
- <param name="allowFullScreen" value="true" />
465
- <param name="allowscriptaccess" value="always" />
466
- </object>
467
- </span>
 
468
  EOT;
469
- }
470
- elseif ($valid == 'off' || strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')===TRUE || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod')===TRUE)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  {
472
  $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;
473
  $yte_tag = <<<EOT
474
- <span class="youtube">
475
- <object width="$width" height="$height">
476
- <param name="movie" value="$video_url" />
477
- <param name="allowFullScreen" value="true" />
478
- <embed wmode="transparent" src="$video_url" type="application/x-shockwave-flash" allowfullscreen="true" width="$width" height="$height"></embed>
479
- <param name="wmode" value="transparent" />
480
- </object>
481
- </span>
 
 
 
 
 
 
 
482
  EOT;
483
  }
484
  else
@@ -486,13 +510,14 @@ EOT;
486
  $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;
487
 
488
  $yte_tag = <<<EOT
489
- <span class="youtube">
490
- <object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url">
491
- <param name="movie" value="$video_url" />
492
- <param name="allowFullScreen" value="true" />
493
- <param name="wmode" value="transparent" />
494
- </object>
495
- </span>
 
496
  EOT;
497
  }
498
 
@@ -506,12 +531,12 @@ EOT;
506
 
507
  if ($this->options['img'] == 'on')
508
  {
509
- $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>';
510
  }
511
 
512
  if ($this->options['link'] == 'on')
513
  {
514
- $yte_tag.='<p><a href="http://www.youtube.com/watch?v=' . $file . $high . '">www.youtube.com/watch?v=' . $file . '</a></p>';
515
  }
516
  // if ($this->options['link'] == 'off' && $this->options['img'] == 'off')
517
  // $yte_tag='http://www.youtube.com/watch?v='.$file;
@@ -546,8 +571,8 @@ EOT;
546
  'heighthq' => 295,
547
  'widthside' => 150,
548
  'heightside' => 125,
549
- 'rel' => 1,
550
- 'color' => 'blank',
551
  'border' => 0,
552
  'link' => 'on',
553
  'valid' => 'off',
@@ -556,7 +581,7 @@ EOT;
556
  'ann' => 'on',
557
  'template' => '{video}',
558
  'autoplay' => 0,
559
- 'privacy' => 0,
560
  'wtext' => '',
561
  'wtitle' => '',
562
  );
105
  $this->options['border'] = !isset($_POST['embedBorder']) ? 0 : 1;
106
  $this->options['color'] = !isset($_POST['embedColor']) ? 'blank' : $_POST['embedColor'];
107
  $this->options['autoplay'] = !isset($_POST['autoplay']) ? 0 : 1;
108
+ $this->options['privacy'] = !isset($_POST['disp_ann']) ? 0 : 1;
109
 
110
  $this->options['posts'] = !isset($_POST['disp_posts']) ? 'off' : 'on';
111
  $this->options['comments'] = !isset($_POST['disp_comments']) ? 'off' : 'on';
331
  </div>
332
 
333
  <h3>xHTML validation</h3>
334
+ <p class="instruct">Enabling the option below will make your YouTube code xHTML valid. </p>
335
  <input id="valid" type="checkbox" name="valid" $valid />
336
  <label for="valid">Enable xHTML Validation</label>
337
 
350
  </div>
351
  </div>
352
  </div>
353
+ <h5 class="author">Another fine plugin by <a href="http://www.prelovac.com/vladimir/">Vladimir Prelovac</a></h5>
354
  END;
355
  }
356
 
458
  {
459
  $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;
460
  $yte_tag = <<<EOT
461
+ <!-- Smart Youtube -->
462
+ <span class="youtube">
463
+ <object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url" >
464
+ <param name="movie" value="$video_url" />
465
+ <param name="allowFullScreen" value="true" />
466
+ <param name="allowscriptaccess" value="always" />
467
+ </object>
468
+ </span>
469
  EOT;
470
+ }
471
+ // This was added to check for iPhone and iPod devices and checks to see if having valid xhtml is on. If valid xhtml is on then the iPhone/iPod will not see the video, so instead we just output the same code that we would if the valid flag was off. This allows us to serve up valid xhtml for our web users and non-valid xhtml to our iPhone/iPod users so they can still enjoy the experience.
472
+ elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') && $valid == 'on')
473
+ {
474
+ $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;
475
+
476
+ $yte_tag = <<<EOT
477
+ <!-- Smart Youtube -->
478
+ <span class="youtube">
479
+ <object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url">
480
+ <param name="movie" value="$video_url" />
481
+ <param name="allowFullScreen" value="true" />
482
+ <param name="wmode" value="transparent" />
483
+ </object>
484
+ </span>
485
+ EOT;
486
+ }
487
+ elseif ($valid == 'off')
488
  {
489
  $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;
490
  $yte_tag = <<<EOT
491
+ <!-- Smart Youtube -->
492
+ <span class="youtube">
493
+ <object width="$width" height="$height">
494
+ <param name="movie" value="$video_url" />
495
+ <param name="allowFullScreen" value="true" />
496
+ <embed wmode="transparent"
497
+ src="$video_url"
498
+ type="application/x-shockwave-flash"
499
+ allowfullscreen="true"
500
+ width="$width"
501
+ height="$height">
502
+ </embed>
503
+ <param name="wmode" value="transparent" />
504
+ </object>
505
+ </span>
506
  EOT;
507
  }
508
  else
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
+ <!-- Smart Youtube -->
514
+ <span class="youtube">
515
+ <object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url">
516
+ <param name="movie" value="$video_url" />
517
+ <param name="allowFullScreen" value="true" />
518
+ <param name="wmode" value="transparent" />
519
+ </object>
520
+ </span>
521
  EOT;
522
  }
523
 
531
 
532
  if ($this->options['img'] == 'on')
533
  {
534
+ $yte_tag .= '<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>';
535
  }
536
 
537
  if ($this->options['link'] == 'on')
538
  {
539
+ $yte_tag.='<a href="http://www.youtube.com/watch?v=' . $file . $high . '">www.youtube.com/watch?v=' . $file . '</a>';
540
  }
541
  // if ($this->options['link'] == 'off' && $this->options['img'] == 'off')
542
  // $yte_tag='http://www.youtube.com/watch?v='.$file;
571
  'heighthq' => 295,
572
  'widthside' => 150,
573
  'heightside' => 125,
574
+ 'rel' => 1,
575
+ 'color' => 'blank',
576
  'border' => 0,
577
  'link' => 'on',
578
  'valid' => 'off',
581
  'ann' => 'on',
582
  'template' => '{video}',
583
  'autoplay' => 0,
584
+ 'privacy' => 0,
585
  'wtext' => '',
586
  'wtitle' => '',
587
  );
smartyoutube.php CHANGED
@@ -4,12 +4,10 @@ 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.5
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
  Updates:
11
- 3.5 - Fixed Iphone issues
12
- 3.4.3 - Fixed privacy option
13
  3.4.2 - Supports new #! style youtube urls
14
  3.4.1 - Fixed widget
15
  3.4 - Completely rewritten the plugin, added new HD video support, added video privacy option
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.4.2
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
  Updates:
 
 
11
  3.4.2 - Supports new #! style youtube urls
12
  3.4.1 - Fixed widget
13
  3.4 - Completely rewritten the plugin, added new HD video support, added video privacy option