Version Description
- Support for WiziApp
- Bug fixes
Download this release
Release Info
Developer | freediver |
Plugin | Smart YouTube PRO |
Version | 3.9.1 |
Comparing to | |
See all releases |
Code changes from version 3.9.0 to 3.9.1
- readme.txt +5 -1
- smartyoutube.class.php +57 -71
- smartyoutube.php +1 -1
readme.txt
CHANGED
@@ -37,7 +37,11 @@ Plugin by Vladimir Prelovac. Looking for <a href="http://www.prelovac.com/vladim
|
|
37 |
|
38 |
== Changelog ==
|
39 |
|
40 |
-
= 3.9 =
|
|
|
|
|
|
|
|
|
41 |
* Support for no-branding player
|
42 |
* Fixed a bug with two dashes in name
|
43 |
|
37 |
|
38 |
== Changelog ==
|
39 |
|
40 |
+
= 3.9.1 =
|
41 |
+
* Support for [WiziApp](http://www.wiziapp.com/ "WiziApp")
|
42 |
+
* Bug fixes
|
43 |
+
|
44 |
+
= 3.9.0 =
|
45 |
* Support for no-branding player
|
46 |
* Fixed a bug with two dashes in name
|
47 |
|
smartyoutube.class.php
CHANGED
@@ -2,7 +2,6 @@
|
|
2 |
class SmartYouTube
|
3 |
{
|
4 |
var $local_version;
|
5 |
-
var $custom_colors;
|
6 |
var $plugin_url;
|
7 |
var $options;
|
8 |
var $key;
|
@@ -15,17 +14,6 @@ class SmartYouTube
|
|
15 |
function __construct()
|
16 |
{
|
17 |
$this->local_version = '3.8.9'; // TODO: Change this number???
|
18 |
-
$this->custom_colors = array(
|
19 |
-
'blank' => array('d6d6d6', 'f0f0f0'),
|
20 |
-
'storm' => array('3a3a3a', '999999'),
|
21 |
-
'iceberg' => array('2b405b', '6b8ab6'),
|
22 |
-
'acid' => array('006699', '54abd6'),
|
23 |
-
'green' => array('234900', '4e9e00'),
|
24 |
-
'orange' => array('e1600f', 'febd01'),
|
25 |
-
'pink' => array('cc2550', 'e87a9f'),
|
26 |
-
'purple' => array('402061', '9461ca'),
|
27 |
-
'rubyred' => array('5d1719', 'cd311b'),
|
28 |
-
);
|
29 |
|
30 |
$this->plugin_url = defined('WP_PLUGIN_URL') ?
|
31 |
trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) :
|
@@ -103,8 +91,6 @@ class SmartYouTube
|
|
103 |
$this->options['heightside'] = !isset($_POST['disp_heightside']) ? 125 : intval($_POST['disp_heightside']);
|
104 |
|
105 |
$this->options['rel'] = !isset($_POST['embedRel']) ? 1 : $_POST['embedRel'];
|
106 |
-
$this->options['border'] = !isset($_POST['embedBorder']) ? 0 : 1;
|
107 |
-
$this->options['color'] = !isset($_POST['embedColor']) ? 'blank' : $_POST['embedColor'];
|
108 |
$this->options['autoplay'] = !isset($_POST['autoplay']) ? 0 : 1;
|
109 |
$this->options['loop'] = !isset($_POST['loop']) ? 0 : 1;
|
110 |
$this->options['privacy'] = !isset($_POST['disp_privacy']) ? 0 : 1;
|
@@ -116,8 +102,9 @@ class SmartYouTube
|
|
116 |
$this->options['template'] = !isset($_POST['disp_template']) ?
|
117 |
'{video}' :
|
118 |
stripslashes(htmlspecialchars($_POST['disp_template']));;
|
119 |
-
|
120 |
-
$this->options['
|
|
|
121 |
$this->options['logoless'] = ! isset( $_POST['logoless'] ) ? 'off' : 'on';
|
122 |
|
123 |
update_option($this->key, $this->options);
|
@@ -150,8 +137,6 @@ class SmartYouTube
|
|
150 |
$disp_loop = $this->options['loop'] ? 'checked="checked"' : '';
|
151 |
$disp_rel = $this->options['rel'] ? 'checked="checked"' : '';
|
152 |
$disp_rel2 = $this->options['rel'] ? '' : 'checked="checked"';
|
153 |
-
$disp_border = $this->options['border'] ? 'checked="checked"' : '';
|
154 |
-
$disp_color = $this->options['color'];
|
155 |
$disp_posts = $this->options['posts'] == 'on' ? 'checked="checked"' : '' ;
|
156 |
$disp_comments = $this->options['comments'] == 'on' ? 'checked="checked"' : '';
|
157 |
|
@@ -160,7 +145,8 @@ class SmartYouTube
|
|
160 |
|
161 |
$disp_template = wp_specialchars($this->options['template']);
|
162 |
$tag = $this->options['tag'];
|
163 |
-
|
|
|
164 |
$logoless = $this->options['logoless'] == 'on' ? 'checked="checked"' : '';
|
165 |
|
166 |
if (!$disp_width)
|
@@ -174,6 +160,8 @@ class SmartYouTube
|
|
174 |
}
|
175 |
|
176 |
global $wp_version;
|
|
|
|
|
177 |
|
178 |
$embed_img = $this->plugin_url . '/img/embed_selection-vfl29294.png';
|
179 |
|
@@ -184,7 +172,7 @@ class SmartYouTube
|
|
184 |
$actionurl = $_SERVER['REQUEST_URI'];
|
185 |
$nonce = wp_create_nonce( 'smart-youtube');
|
186 |
$example = htmlentities('<div style="float:left;margin-right: 10px;">{video}</div>');
|
187 |
-
|
188 |
// Configuration Page
|
189 |
|
190 |
echo <<<END
|
@@ -329,29 +317,15 @@ class SmartYouTube
|
|
329 |
<input type="radio" $disp_rel2 id="embedCustomization0" name="embedRel" value="0"/>
|
330 |
<label for="embedCustomization0">Do not include related videos</label><br/>
|
331 |
</div>
|
332 |
-
<
|
333 |
-
<div id="watch-customize-embed-theme-swatches">
|
334 |
-
<a onclick="onChangeColor('blank'); return false;" class="watch-image-radio-link radio_selected" href="#" id="theme_color_blank_img"><img alt="" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="watch-embed-select watch-embed-blank"/></a>
|
335 |
-
<a onclick="onChangeColor('storm'); return false;" class="watch-image-radio-link" href="#" id="theme_color_storm_img"><img alt="" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="watch-embed-select watch-embed-storm"/></a>
|
336 |
-
<a onclick="onChangeColor('iceberg'); return false;" class="watch-image-radio-link " href="#" id="theme_color_iceberg_img"><img alt="" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="watch-embed-select watch-embed-iceberg"/></a>
|
337 |
-
<a onclick="onChangeColor('acid'); return false;" class="watch-image-radio-link" href="#" id="theme_color_acid_img"><img alt="" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="watch-embed-select watch-embed-acid"/></a>
|
338 |
-
<a onclick="onChangeColor('green'); return false;" class="watch-image-radio-link" href="#" id="theme_color_green_img"><img alt="" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="watch-embed-select watch-embed-green"/></a>
|
339 |
-
<a onclick="onChangeColor('orange'); return false;" class="watch-image-radio-link" href="#" id="theme_color_orange_img"><img alt="" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="watch-embed-select watch-embed-orange"/></a>
|
340 |
-
<a onclick="onChangeColor('pink'); return false;" class="watch-image-radio-link" href="#" id="theme_color_pink_img"><img alt="" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="watch-embed-select watch-embed-pink"/></a>
|
341 |
-
<a onclick="onChangeColor('purple'); return false;" class="watch-image-radio-link" href="#" id="theme_color_purple_img"><img alt="" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="watch-embed-select watch-embed-purple"/></a>
|
342 |
-
<a onclick="onChangeColor('rubyred'); return false;" class="watch-image-radio-link" href="#" id="theme_color_rubyred_img"><img alt="" src="http://s.ytimg.com/yt/img/pixel-vfl73.gif" class="watch-embed-select watch-embed-rubyred"/></a>
|
343 |
-
<input id="embedColor" type="hidden" name="embedColor" value="$disp_color">
|
344 |
-
<input id="prevUrl" type="hidden" name="prevUrl" value="$this->plugin_url/img/">
|
345 |
-
</div>
|
346 |
<div style="margin: 0 0 0 4px; clear: both;">
|
347 |
-
<input type="checkbox" onchange="onUpdatePreviewImage();" id="show_border_checkbox" name="embedBorder" $disp_border /><label for="show_border_checkbox"> Show Border</label><br />
|
348 |
<input type="checkbox" id="autoplay_checkbox" name="autoplay" $disp_autoplay /><label for="autoplay_checkbox"> Autoplay videos</label><br />
|
349 |
<input type="checkbox" id="loop_checkbox" name="loop" $disp_loop /><label for="loop_checkbox"> Loop videos</label><br />
|
350 |
<input type="checkbox" id="disp_search" name="disp_search" $disp_search /><label for="disp_search"> Display search box</label><br />
|
351 |
<input type="checkbox" id="disp_info" name="disp_info" $disp_info /><label for="disp_info"> Remove Titles & Ratings</label><br />
|
352 |
<input type="checkbox" id="disp_ann" name="disp_ann" $disp_ann /><label for="disp_ann"> Remove Annotations</label><br />
|
353 |
<input type="checkbox" id="privacy" name="disp_privacy" $disp_privacy /><label for="privacy"> Enable privacy-enhanced mode [<a target="_blank" href="http://www.google.com/support/youtube/bin/answer.py?answer=141046">?</a>] (videos may not work for Iphone users)</label><br />
|
354 |
-
|
355 |
<input type="checkbox" id="logoless" name="logoless" $logoless /><label for="logoless">Hide YouTube Logo</label><br />
|
356 |
</div>
|
357 |
|
@@ -361,6 +335,11 @@ class SmartYouTube
|
|
361 |
<input id="tag" type="text" name="tag" value="$tag" />
|
362 |
<label for="tag">Custom code</label>
|
363 |
|
|
|
|
|
|
|
|
|
|
|
364 |
<h3>xHTML validation</h3>
|
365 |
<p class="instruct">Enabling the option below will change default YouTube code to be xHTML valid. (videos may not work for Iphone users)</p>
|
366 |
<input id="valid" type="checkbox" name="valid" $valid />
|
@@ -409,7 +388,15 @@ END;
|
|
409 |
if (isset($matches['youtube.com']))
|
410 |
foreach ($matches['youtube.com'] as $match)
|
411 |
{
|
412 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
}
|
414 |
|
415 |
if (isset($matches['youtu.be']))
|
@@ -417,17 +404,32 @@ END;
|
|
417 |
|
418 |
foreach ($matches['youtu.be'] as $match)
|
419 |
{
|
420 |
-
|
421 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
}
|
423 |
}
|
424 |
|
425 |
|
426 |
|
427 |
-
preg_match_all("/http(vp|vhp)
|
428 |
foreach ($matches as $match)
|
429 |
{
|
430 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
}
|
432 |
|
433 |
|
@@ -460,9 +462,7 @@ END;
|
|
460 |
function tag($file, $high = 'v', $time = '', $side = 0)
|
461 |
{
|
462 |
$playlist = 0;
|
463 |
-
|
464 |
-
$disp_border = $this->options['border'];
|
465 |
-
$disp_color = $this->options['color'];
|
466 |
$autoplay = $this->options['autoplay'];
|
467 |
$loop = $this->options['loop'];
|
468 |
$disp_search = $this->options['search'] == 'on' ? 1 : 0;
|
@@ -470,7 +470,7 @@ END;
|
|
470 |
$disp_ann = $this->options['ann'] == 'on' ? '&iv_load_policy=3' : '';
|
471 |
$template = trim($this->options['template']) == '' ? '{video}' : $this->options['template'];
|
472 |
$valid = $this->options['valid'];
|
473 |
-
$
|
474 |
$logoless = $this->options['logoless'];
|
475 |
|
476 |
switch ($high)
|
@@ -521,40 +521,30 @@ END;
|
|
521 |
}
|
522 |
|
523 |
if ( $logoless = 'on' ) {
|
524 |
-
$ll = '
|
|
|
525 |
} else {
|
526 |
$ll = '';
|
527 |
}
|
528 |
|
|
|
529 |
if ($autoplay)
|
530 |
$ap='&autoplay=1';
|
531 |
|
532 |
$root_url = $this->options['privacy'] ? 'http://www.youtube-nocookie.com' : 'http://www.youtube.com';
|
533 |
|
534 |
if ($this->options['iframe']=='on')
|
535 |
-
$video_url = htmlspecialchars("$root_url/embed/$file
|
536 |
else
|
537 |
-
$video_url = htmlspecialchars("$root_url/v/$file
|
538 |
|
539 |
if ($playlist)
|
540 |
{
|
541 |
|
542 |
-
$video_url = htmlspecialchars("$root_url/
|
543 |
-
|
544 |
-
if ($this->options['iframe']=='on')
|
545 |
-
$yte_tag = <<<EOT
|
546 |
-
<span class="youtube">
|
547 |
-
<object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url" >
|
548 |
-
<param name="movie" value="$video_url" />
|
549 |
-
<param name="allowFullScreen" value="true" />
|
550 |
-
<param name="allowscriptaccess" value="always" />
|
551 |
-
</object>
|
552 |
-
</span>
|
553 |
-
EOT;
|
554 |
-
else
|
555 |
-
$yte_tag = <<<EOT
|
556 |
<span class="youtube">
|
557 |
-
<iframe
|
558 |
</span>
|
559 |
EOT;
|
560 |
}
|
@@ -656,8 +646,6 @@ EOT;
|
|
656 |
'widthside' => 150,
|
657 |
'heightside' => 125,
|
658 |
'rel' => 1,
|
659 |
-
'color' => 'blank',
|
660 |
-
'border' => 0,
|
661 |
'link' => 'on',
|
662 |
'valid' => 'off',
|
663 |
'search' => 'off',
|
@@ -669,7 +657,7 @@ EOT;
|
|
669 |
'wtext' => '',
|
670 |
'wtitle' => '',
|
671 |
'tag' => '',
|
672 |
-
|
673 |
);
|
674 |
|
675 |
// migrate the old-fashion options
|
@@ -701,8 +689,6 @@ EOT;
|
|
701 |
'widthside' => 150,
|
702 |
'heightside' => 125,
|
703 |
'rel' => 1,
|
704 |
-
'color' => 'blank',
|
705 |
-
'border' => 0,
|
706 |
'link' => 'on',
|
707 |
'valid' => 'off',
|
708 |
'search' => 'off',
|
@@ -714,9 +700,9 @@ EOT;
|
|
714 |
'wtext' => '',
|
715 |
'wtitle' => '',
|
716 |
'tag' => '',
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
);
|
721 |
|
722 |
$saved = get_option($this->key);
|
2 |
class SmartYouTube
|
3 |
{
|
4 |
var $local_version;
|
|
|
5 |
var $plugin_url;
|
6 |
var $options;
|
7 |
var $key;
|
14 |
function __construct()
|
15 |
{
|
16 |
$this->local_version = '3.8.9'; // TODO: Change this number???
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
$this->plugin_url = defined('WP_PLUGIN_URL') ?
|
19 |
trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) :
|
91 |
$this->options['heightside'] = !isset($_POST['disp_heightside']) ? 125 : intval($_POST['disp_heightside']);
|
92 |
|
93 |
$this->options['rel'] = !isset($_POST['embedRel']) ? 1 : $_POST['embedRel'];
|
|
|
|
|
94 |
$this->options['autoplay'] = !isset($_POST['autoplay']) ? 0 : 1;
|
95 |
$this->options['loop'] = !isset($_POST['loop']) ? 0 : 1;
|
96 |
$this->options['privacy'] = !isset($_POST['disp_privacy']) ? 0 : 1;
|
102 |
$this->options['template'] = !isset($_POST['disp_template']) ?
|
103 |
'{video}' :
|
104 |
stripslashes(htmlspecialchars($_POST['disp_template']));;
|
105 |
+
$this->options['tag'] = !isset($_POST['tag']) ? '' : $_POST['tag'];
|
106 |
+
$this->options['wiziapp'] = ! isset( $_POST['wiziapp'] ) ? 'off' : 'on';
|
107 |
+
$this->options['theme'] = ! isset( $_POST['theme'] ) ? '' : $_POST['theme'];
|
108 |
$this->options['logoless'] = ! isset( $_POST['logoless'] ) ? 'off' : 'on';
|
109 |
|
110 |
update_option($this->key, $this->options);
|
137 |
$disp_loop = $this->options['loop'] ? 'checked="checked"' : '';
|
138 |
$disp_rel = $this->options['rel'] ? 'checked="checked"' : '';
|
139 |
$disp_rel2 = $this->options['rel'] ? '' : 'checked="checked"';
|
|
|
|
|
140 |
$disp_posts = $this->options['posts'] == 'on' ? 'checked="checked"' : '' ;
|
141 |
$disp_comments = $this->options['comments'] == 'on' ? 'checked="checked"' : '';
|
142 |
|
145 |
|
146 |
$disp_template = wp_specialchars($this->options['template']);
|
147 |
$tag = $this->options['tag'];
|
148 |
+
$wiziapp = $this->options['wiziapp'] == 'on' ? 'checked="checked"' : '';
|
149 |
+
$theme = $this->options['theme'];
|
150 |
$logoless = $this->options['logoless'] == 'on' ? 'checked="checked"' : '';
|
151 |
|
152 |
if (!$disp_width)
|
160 |
}
|
161 |
|
162 |
global $wp_version;
|
163 |
+
|
164 |
+
$theme_selector = "<select id=\"theme\" name=\"theme\" /><option value=\"dark\" " . ( ( $theme == 'dark' ) ? "selected=\"yes\"" : '' ) . ">Dark</option><option value=\"light\" " . ( ( $theme == 'light' ) ? "selected=\"yes\"" : '' ) . ">Light</option></select><br />";
|
165 |
|
166 |
$embed_img = $this->plugin_url . '/img/embed_selection-vfl29294.png';
|
167 |
|
172 |
$actionurl = $_SERVER['REQUEST_URI'];
|
173 |
$nonce = wp_create_nonce( 'smart-youtube');
|
174 |
$example = htmlentities('<div style="float:left;margin-right: 10px;">{video}</div>');
|
175 |
+
|
176 |
// Configuration Page
|
177 |
|
178 |
echo <<<END
|
317 |
<input type="radio" $disp_rel2 id="embedCustomization0" name="embedRel" value="0"/>
|
318 |
<label for="embedCustomization0">Do not include related videos</label><br/>
|
319 |
</div>
|
320 |
+
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
<div style="margin: 0 0 0 4px; clear: both;">
|
|
|
322 |
<input type="checkbox" id="autoplay_checkbox" name="autoplay" $disp_autoplay /><label for="autoplay_checkbox"> Autoplay videos</label><br />
|
323 |
<input type="checkbox" id="loop_checkbox" name="loop" $disp_loop /><label for="loop_checkbox"> Loop videos</label><br />
|
324 |
<input type="checkbox" id="disp_search" name="disp_search" $disp_search /><label for="disp_search"> Display search box</label><br />
|
325 |
<input type="checkbox" id="disp_info" name="disp_info" $disp_info /><label for="disp_info"> Remove Titles & Ratings</label><br />
|
326 |
<input type="checkbox" id="disp_ann" name="disp_ann" $disp_ann /><label for="disp_ann"> Remove Annotations</label><br />
|
327 |
<input type="checkbox" id="privacy" name="disp_privacy" $disp_privacy /><label for="privacy"> Enable privacy-enhanced mode [<a target="_blank" href="http://www.google.com/support/youtube/bin/answer.py?answer=141046">?</a>] (videos may not work for Iphone users)</label><br />
|
328 |
+
<label for="theme">Theme (YouTube only):</label>$theme_selector
|
329 |
<input type="checkbox" id="logoless" name="logoless" $logoless /><label for="logoless">Hide YouTube Logo</label><br />
|
330 |
</div>
|
331 |
|
335 |
<input id="tag" type="text" name="tag" value="$tag" />
|
336 |
<label for="tag">Custom code</label>
|
337 |
|
338 |
+
<h3>WiziApp support</h3>
|
339 |
+
<p>WiziApp helps you publish your blog as an iPhone app. This will integrate your videos seamlessly. <a href="http://wiziapp.com">Learn more about WiziApp</a>.</p>
|
340 |
+
<input id="wiziapp" type="checkbox" name="wiziapp" $wiziapp />
|
341 |
+
<label for="wiziapp">Enable WiziApp support</label>
|
342 |
+
|
343 |
<h3>xHTML validation</h3>
|
344 |
<p class="instruct">Enabling the option below will change default YouTube code to be xHTML valid. (videos may not work for Iphone users)</p>
|
345 |
<input id="valid" type="checkbox" name="valid" $valid />
|
388 |
if (isset($matches['youtube.com']))
|
389 |
foreach ($matches['youtube.com'] as $match)
|
390 |
{
|
391 |
+
if ( 'on' == $this->options['wiziapp'] ) {
|
392 |
+
$videos = array();
|
393 |
+
$video_info['src'] = "http://www.youtube.com/watch?v={$match[4]}";
|
394 |
+
array_push( $videos, $video_info );
|
395 |
+
$replace_text = '';
|
396 |
+
$replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
|
397 |
+
$the_content = str_replace( $match[0], $replace_text, $the_content );
|
398 |
+
} else
|
399 |
+
$the_content = preg_replace("/http".$match[1].":\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^\s<]*)/", $this->tag($match[4], $match[1], $match[5], $side), $the_content, 1);
|
400 |
}
|
401 |
|
402 |
if (isset($matches['youtu.be']))
|
404 |
|
405 |
foreach ($matches['youtu.be'] as $match)
|
406 |
{
|
407 |
+
if ( 'on' == $this->options['wiziapp'] ) {
|
408 |
+
$videos = array();
|
409 |
+
$video_info['src'] = "http://www.youtube.com/watch?v={$match[3]}";
|
410 |
+
array_push( $videos, $video_info );
|
411 |
+
$replace_text = '';
|
412 |
+
$replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
|
413 |
+
$the_content = str_replace( $match[0], $replace_text, $the_content );
|
414 |
+
} else
|
415 |
+
$the_content = preg_replace("/http".$match[1].":\/\/([a-zA-Z0-9\-\_]+\.|)youtu\.be\/([a-zA-Z0-9\-\_]{11})([^<\s]*)/", $this->tag($match[3], $match[1], $match[4], $side), $the_content, 1);
|
416 |
}
|
417 |
}
|
418 |
|
419 |
|
420 |
|
421 |
+
preg_match_all("/http(vp|vhp)?:\/\/?([a-zA-Z0-9\-\_]+\.|)?youtube\.com\/(view_play_list|playlist)(\?p\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{18})([^<\s]*)/", $the_content, $matches, PREG_SET_ORDER);
|
422 |
foreach ($matches as $match)
|
423 |
{
|
424 |
+
if ( 'on' == $this->options['wiziapp'] ) {
|
425 |
+
$videos = array();
|
426 |
+
$video_info['src'] = "http://www.youtube.com/watch?v={$match[5]}";
|
427 |
+
array_push( $videos, $video_info );
|
428 |
+
$replace_text = '';
|
429 |
+
$replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
|
430 |
+
$the_content = str_replace( $match[0], $replace_text, $the_content );
|
431 |
+
} else
|
432 |
+
$the_content = preg_replace("/http".$match[1].":\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/(view_play_list|playlist)(\?p\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{18})([^\s<]*)/", $this->tag($match[5], $match[1], $match[6], $side), $the_content, 1);
|
433 |
}
|
434 |
|
435 |
|
462 |
function tag($file, $high = 'v', $time = '', $side = 0)
|
463 |
{
|
464 |
$playlist = 0;
|
465 |
+
$disp_rel = $this->options['rel'];
|
|
|
|
|
466 |
$autoplay = $this->options['autoplay'];
|
467 |
$loop = $this->options['loop'];
|
468 |
$disp_search = $this->options['search'] == 'on' ? 1 : 0;
|
470 |
$disp_ann = $this->options['ann'] == 'on' ? '&iv_load_policy=3' : '';
|
471 |
$template = trim($this->options['template']) == '' ? '{video}' : $this->options['template'];
|
472 |
$valid = $this->options['valid'];
|
473 |
+
$theme = $this->options['theme'];
|
474 |
$logoless = $this->options['logoless'];
|
475 |
|
476 |
switch ($high)
|
521 |
}
|
522 |
|
523 |
if ( $logoless = 'on' ) {
|
524 |
+
$ll = 'modestbranding=1';
|
525 |
+
$disp_info = '';
|
526 |
} else {
|
527 |
$ll = '';
|
528 |
}
|
529 |
|
530 |
+
$ap = '';
|
531 |
if ($autoplay)
|
532 |
$ap='&autoplay=1';
|
533 |
|
534 |
$root_url = $this->options['privacy'] ? 'http://www.youtube-nocookie.com' : 'http://www.youtube.com';
|
535 |
|
536 |
if ($this->options['iframe']=='on')
|
537 |
+
$video_url = htmlspecialchars("$root_url/embed/$file?$ll&fs=1&hl=en$ap&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel&theme=$theme", ENT_QUOTES) . $high . $time;
|
538 |
else
|
539 |
+
$video_url = htmlspecialchars("$root_url/v/$file?$ll&fs=1&hl=en$ap&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel&theme=$theme", ENT_QUOTES) . $high . $time;
|
540 |
|
541 |
if ($playlist)
|
542 |
{
|
543 |
|
544 |
+
$video_url = htmlspecialchars( "$root_url/embed/videoseries?list=$file&fs=1&hl=en$ap$ll&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel&theme=$theme", ENT_QUOTES ) . $high . $time;
|
545 |
+
$yte_tag = <<<EOT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
<span class="youtube">
|
547 |
+
<iframe class="youtube-player" src="$video_url" width="$width" height="$height" frameborder="0" allowfullscreen></iframe>
|
548 |
</span>
|
549 |
EOT;
|
550 |
}
|
646 |
'widthside' => 150,
|
647 |
'heightside' => 125,
|
648 |
'rel' => 1,
|
|
|
|
|
649 |
'link' => 'on',
|
650 |
'valid' => 'off',
|
651 |
'search' => 'off',
|
657 |
'wtext' => '',
|
658 |
'wtitle' => '',
|
659 |
'tag' => '',
|
660 |
+
'iframe' => 'on'
|
661 |
);
|
662 |
|
663 |
// migrate the old-fashion options
|
689 |
'widthside' => 150,
|
690 |
'heightside' => 125,
|
691 |
'rel' => 1,
|
|
|
|
|
692 |
'link' => 'on',
|
693 |
'valid' => 'off',
|
694 |
'search' => 'off',
|
700 |
'wtext' => '',
|
701 |
'wtitle' => '',
|
702 |
'tag' => '',
|
703 |
+
'iframe' => 'on',
|
704 |
+
'theme' => 'dark',
|
705 |
+
'logoless' => 'on'
|
706 |
);
|
707 |
|
708 |
$saved = get_option($this->key);
|
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: Insert YouTube videos in posts, comments and RSS feeds with ease and full customization.
|
6 |
Author: Vladimir Prelovac
|
7 |
-
Version: 3.9.
|
8 |
Author URI: http://www.prelovac.com/vladimir/
|
9 |
|
10 |
|
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.9.1
|
8 |
Author URI: http://www.prelovac.com/vladimir/
|
9 |
|
10 |
|