Version Description
- Fixed option to toggle video title visibility
- Added option to hide controls for iframe and object videos
- Added option to hide video info
- Enabled autostart for iframe and object videos
Download this release
Release Info
Developer | urkekg |
Plugin | YouTube Channel |
Version | 0.1.1 |
Comparing to | |
See all releases |
Code changes from version 0.1.0 to 0.1.1
- readme.txt +18 -8
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- youtube-channel.php +83 -76
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== YouTube Channel ===
|
2 |
Contributors: urkekg
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q6Q762MQ97XJ6
|
4 |
-
Tags: youtube, channel, widget, widgets, youtube player, flash player, rss, feed, video, thumbnail, embed, sidebar, chromeless
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.1
|
7 |
-
Stable tag: 0.1.
|
8 |
|
9 |
Sidebar widget that display latest video thumbnail, playable flash object or chromeless video from YouTube Channel.
|
10 |
|
@@ -22,12 +22,13 @@ If you like this extension and you find it useful, please rate it on the right s
|
|
22 |
* Display or hide video title on the top of video
|
23 |
* Custom set of width and height of video thumbnail/embeded object (default 220x165 px)
|
24 |
* Preferred aspect ratio relative to width (custom, 4:3, 16:10 and 16:9)
|
25 |
-
* Choose to display video thumbnail,
|
26 |
* Fix height for old and new YouTube embed and Chromeless video object taken by controls
|
27 |
-
* Option to enable autoplay
|
28 |
-
* Option to
|
|
|
29 |
* Set custom text for link to channel
|
30 |
-
*
|
31 |
|
32 |
= Credits =
|
33 |
Chromeless option borrowed from [Chromeless YouTube](http://wordpress.org/extend/plugins/chromeless-youtube/) extension.
|
@@ -61,16 +62,25 @@ I could not to find widget with link to channel and thumbnail instead of video o
|
|
61 |
|
62 |
== Changelog ==
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
= 0.1.0 =
|
65 |
* Initial release
|
66 |
|
67 |
== Upgrade Notice ==
|
68 |
|
|
|
|
|
|
|
69 |
= 0.1.0 =
|
70 |
Just try it and rate it. Only initial release is available right now.
|
71 |
|
72 |
== Screenshots ==
|
73 |
|
74 |
1. Widget configuration panel
|
75 |
-
2. Widget `YouTube Channel` in action with
|
76 |
-
3. Widget `YouTube Channel` in action with
|
1 |
=== YouTube Channel ===
|
2 |
Contributors: urkekg
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q6Q762MQ97XJ6
|
4 |
+
Tags: youtube, channel, widget, widgets, youtube player, flash player, rss, feed, video, thumbnail, embed, sidebar, chromeless, iframe, html5
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.1
|
7 |
+
Stable tag: 0.1.1
|
8 |
|
9 |
Sidebar widget that display latest video thumbnail, playable flash object or chromeless video from YouTube Channel.
|
10 |
|
22 |
* Display or hide video title on the top of video
|
23 |
* Custom set of width and height of video thumbnail/embeded object (default 220x165 px)
|
24 |
* Preferred aspect ratio relative to width (custom, 4:3, 16:10 and 16:9)
|
25 |
+
* Choose to display video thumbnail, iframe (HTML5 video), object embed (Flash video) or chromeless video
|
26 |
* Fix height for old and new YouTube embed and Chromeless video object taken by controls
|
27 |
+
* Option to enable autoplay video
|
28 |
+
* Option to hide video controls
|
29 |
+
* Option to hide video info
|
30 |
* Set custom text for link to channel
|
31 |
+
* Option to show link to channel
|
32 |
|
33 |
= Credits =
|
34 |
Chromeless option borrowed from [Chromeless YouTube](http://wordpress.org/extend/plugins/chromeless-youtube/) extension.
|
62 |
|
63 |
== Changelog ==
|
64 |
|
65 |
+
= 0.1.1 =
|
66 |
+
* Fixed option to toggle video title visibility
|
67 |
+
* Added option to hide controls for iframe and object videos
|
68 |
+
* Added option to hide video info
|
69 |
+
* Enabled autostart for iframe and object videos
|
70 |
+
|
71 |
= 0.1.0 =
|
72 |
* Initial release
|
73 |
|
74 |
== Upgrade Notice ==
|
75 |
|
76 |
+
= 0.1.1 =
|
77 |
+
After upgrade please reconfigure widget. Some variables are changed and implemented new features.
|
78 |
+
|
79 |
= 0.1.0 =
|
80 |
Just try it and rate it. Only initial release is available right now.
|
81 |
|
82 |
== Screenshots ==
|
83 |
|
84 |
1. Widget configuration panel
|
85 |
+
2. Widget `YouTube Channel` in action with iframe video w/o controls
|
86 |
+
3. Widget `YouTube Channel` in action with iframe video w/ controls and fixed height
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|
youtube-channel.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: YouTube Channel
|
4 |
-
Plugin URI: http://blog.urosevic.net/wordpress/
|
5 |
-
Description: <a href="widgets.php">Widget</a> that display latest video thumbnail,
|
6 |
Author: Aleksandar Urošević
|
7 |
-
Version: 0.1.
|
8 |
Author URI: http://urosevic.net/
|
9 |
*/
|
10 |
|
@@ -20,41 +20,44 @@ class YouTube_Channel_Widget extends WP_Widget {
|
|
20 |
$title = esc_attr($instance['title']);
|
21 |
$channel = esc_attr($instance['channel']);
|
22 |
$goto_txt = esc_attr($instance['goto_txt']);
|
23 |
-
$
|
24 |
-
$
|
25 |
$width = esc_attr($instance['width']);
|
26 |
$height = esc_attr($instance['height']);
|
27 |
$to_show = esc_attr($instance['to_show']);
|
28 |
$autoplay = esc_attr($instance['autoplay']);
|
29 |
-
$
|
30 |
$ratio = esc_attr($instance['ratio']);
|
31 |
$fixyt = esc_attr($instance['fixyt']);
|
|
|
32 |
?>
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
<option value="0"<?php if ($instance['ratio'] == "0") { echo 'selected="selected"'; } ?>><?php _e('Custom'); ?></option>
|
41 |
<option value="1"<?php if ($instance['ratio'] == "1") { echo 'selected="selected"'; } ?>>4:3</option>
|
42 |
<option value="2"<?php if ($instance['ratio'] == "2") { echo 'selected="selected"'; } ?>>16:10</option>
|
43 |
<option value="3"<?php if ($instance['ratio'] == "3") { echo 'selected="selected"'; } ?>>16:9</option>
|
44 |
</select>
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
<option value="thumbnail"<?php if ($instance['to_show']
|
49 |
-
<option value="
|
50 |
-
<option value="
|
51 |
-
<option value="chromeless"<?php if ($instance['to_show'] == "chromeless") { echo 'selected="selected"'; } ?>><?php _e('
|
52 |
</select>
|
53 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['fixyt'], true ); ?> id="<?php echo $this->get_field_id( 'fixyt' ); ?>" name="<?php echo $this->get_field_name( 'fixyt' ); ?>" /> <label for="<?php echo $this->get_field_id( 'fixyt' ); ?>"><?php _e('Fix height taken by controls'); ?></label><br />
|
54 |
-
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['autoplay'], true ); ?> id="<?php echo $this->get_field_id( 'autoplay' ); ?>" name="<?php echo $this->get_field_name( 'autoplay' ); ?>" /> <label for="<?php echo $this->get_field_id( 'autoplay' ); ?>"><?php _e('Autoplay
|
55 |
-
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['
|
56 |
-
|
57 |
-
|
|
|
|
|
58 |
<?php
|
59 |
}
|
60 |
|
@@ -64,15 +67,16 @@ class YouTube_Channel_Widget extends WP_Widget {
|
|
64 |
$instance['title'] = strip_tags($new_instance['title']);
|
65 |
$instance['channel'] = strip_tags($new_instance['channel']);
|
66 |
$instance['goto_txt'] = strip_tags($new_instance['goto_txt']);
|
67 |
-
$instance['
|
68 |
-
$instance['
|
69 |
$instance['width'] = strip_tags($new_instance['width']);
|
70 |
$instance['height'] = strip_tags($new_instance['height']);
|
71 |
$instance['to_show'] = strip_tags($new_instance['to_show']);
|
72 |
$instance['autoplay'] = $new_instance['autoplay'];
|
73 |
-
$instance['
|
74 |
$instance['ratio'] = strip_tags($new_instance['ratio']);
|
75 |
$instance['fixyt'] = $new_instance['fixyt'];
|
|
|
76 |
|
77 |
return $instance;
|
78 |
}
|
@@ -81,10 +85,20 @@ class YouTube_Channel_Widget extends WP_Widget {
|
|
81 |
// outputs the content of the widget
|
82 |
extract( $args );
|
83 |
$title = apply_filters('widget_title', $instance['title']);
|
|
|
|
|
84 |
$channel = $instance['channel'];
|
85 |
if ( $channel == "" ) { $channel = "urkekg"; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
$width = $instance['width'];
|
87 |
if ( $width == "" ) { $width = 220; }
|
|
|
88 |
$ratio = $instance['ratio'];
|
89 |
if ( $ratio == 1 ) { // 4:3
|
90 |
$height = round(($width / 4 ) * 3);
|
@@ -92,31 +106,20 @@ class YouTube_Channel_Widget extends WP_Widget {
|
|
92 |
$height = round(($width / 16 ) * 10);
|
93 |
} else if ( $ratio == 3 ) { // 16:9
|
94 |
$height = round(($width / 16 ) * 9);
|
95 |
-
} else { // 0
|
96 |
$height = $instance['height'];
|
97 |
-
if ( $height == "" ) {
|
98 |
-
$height = 165;
|
99 |
-
}
|
100 |
}
|
101 |
|
|
|
102 |
$to_show = $instance['to_show'];
|
103 |
-
if ( $to_show == "" ) { $to_show = "
|
104 |
-
|
105 |
-
if
|
|
|
106 |
$height += 25;
|
107 |
}
|
108 |
|
109 |
-
$goto_txt = $instance['goto_txt'];
|
110 |
-
if ( $goto_txt == "" ) { $goto_txt = __("Visit channel")." $channel"; }
|
111 |
-
$goto_show = $instance['goto_show'];
|
112 |
-
$title_show = $instance['title_show'];
|
113 |
-
|
114 |
-
// chromeless autplay and controls
|
115 |
-
$autoplay = $instance['autoplay'];
|
116 |
-
if ( $autoplay ) { $autoplay = "Yes"; } else { $autoplay = "No"; }
|
117 |
-
$ccontrol = $instance['ccontrol'];
|
118 |
-
if ( $ccontrol ) { $ccontrol = "Yes"; } else { $ccontrol = "No"; }
|
119 |
-
|
120 |
echo $before_widget;
|
121 |
if ( $title )
|
122 |
echo $before_title . $title . $after_title;
|
@@ -142,48 +145,52 @@ class YouTube_Channel_Widget extends WP_Widget {
|
|
142 |
// $next_id = split(":", $next['guid']);
|
143 |
// $next_id = $yt_id[3];
|
144 |
|
145 |
-
|
|
|
146 |
echo "<h3>$yt_title</h3>";
|
147 |
-
}
|
|
|
|
|
148 |
if ( $to_show == "thumbnail" ) {
|
149 |
echo <<<EOF
|
150 |
<a href="$yt_video" title="Watch video $yt_title published on $yt_date"><img src="$yt_thumb" alt="$yt_title" style="width: ${width}px; height: ${height}px; border: 0;" /></a>
|
151 |
EOF;
|
152 |
} else if ( $to_show == "chromeless" ) {
|
153 |
?>
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
<?php
|
162 |
-
} else if ( $to_show == "
|
163 |
-
|
164 |
-
<iframe title="YouTube video player" width="$width" height="$height" src="http://www.youtube.com/embed
|
165 |
-
|
166 |
-
} else {
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
</object>
|
175 |
-
<!--<![endif]-->
|
176 |
</object>
|
177 |
-
|
|
|
|
|
178 |
}
|
179 |
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
187 |
}
|
188 |
?>
|
189 |
</div>
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: YouTube Channel
|
4 |
+
Plugin URI: http://blog.urosevic.net/wordpress/youtube-channel/
|
5 |
+
Description: <a href="widgets.php">Widget</a> that display latest video thumbnail, iframe (HTML5 video), object (Flash video) or chromeless video from YouTube Channel.
|
6 |
Author: Aleksandar Urošević
|
7 |
+
Version: 0.1.1
|
8 |
Author URI: http://urosevic.net/
|
9 |
*/
|
10 |
|
20 |
$title = esc_attr($instance['title']);
|
21 |
$channel = esc_attr($instance['channel']);
|
22 |
$goto_txt = esc_attr($instance['goto_txt']);
|
23 |
+
$showgoto = esc_attr($instance['showgoto']);
|
24 |
+
$showtitle = esc_attr($instance['showtitle']);
|
25 |
$width = esc_attr($instance['width']);
|
26 |
$height = esc_attr($instance['height']);
|
27 |
$to_show = esc_attr($instance['to_show']);
|
28 |
$autoplay = esc_attr($instance['autoplay']);
|
29 |
+
$controls = esc_attr($instance['controls']);
|
30 |
$ratio = esc_attr($instance['ratio']);
|
31 |
$fixyt = esc_attr($instance['fixyt']);
|
32 |
+
$hideinfo = esc_attr($instance['hideinfo']);
|
33 |
?>
|
34 |
+
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget Title:'); ?><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
|
35 |
+
<p><label for="<?php echo $this->get_field_id('channel'); ?>"><?php _e('Channel:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('channel'); ?>" name="<?php echo $this->get_field_name('channel'); ?>" type="text" value="<?php echo $channel; ?>" /></label></p>
|
36 |
+
<p><input class="checkbox" type="checkbox" <?php checked( (bool) $instance['showtitle'], true ); ?> id="<?php echo $this->get_field_id( 'showtitle' ); ?>" name="<?php echo $this->get_field_name( 'showtitle' ); ?>" /> <label for="<?php echo $this->get_field_id( 'showtitle' ); ?>"><?php _e('Show video title'); ?></label></p>
|
37 |
+
<p><label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width'); ?> (<?php _e('default'); ?> 220):<input class="widefat" id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo $width; ?>" /></label></p>
|
38 |
+
<p><label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height'); ?> (<?php _e('default'); ?> 165):<input class="widefat" id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo $height; ?>" /></label></p>
|
39 |
+
<p><label for="<?php echo $this->get_field_id('to_show'); ?>"><?php _e('Aspect ratio (relative to width):'); ?>
|
40 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'ratio' ); ?>" name="<?php echo $this->get_field_name( 'ratio' ); ?>">
|
41 |
<option value="0"<?php if ($instance['ratio'] == "0") { echo 'selected="selected"'; } ?>><?php _e('Custom'); ?></option>
|
42 |
<option value="1"<?php if ($instance['ratio'] == "1") { echo 'selected="selected"'; } ?>>4:3</option>
|
43 |
<option value="2"<?php if ($instance['ratio'] == "2") { echo 'selected="selected"'; } ?>>16:10</option>
|
44 |
<option value="3"<?php if ($instance['ratio'] == "3") { echo 'selected="selected"'; } ?>>16:9</option>
|
45 |
</select>
|
46 |
+
</p>
|
47 |
+
<p><label for="<?php echo $this->get_field_id('to_show'); ?>"><?php _e('What to show?'); ?>
|
48 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'to_show' ); ?>" name="<?php echo $this->get_field_name( 'to_show' ); ?>">
|
49 |
+
<option value="thumbnail"<?php if ($instance['to_show'] == "thumbnail") { echo 'selected="selected"'; } ?>><?php _e('Thumbnail'); ?></option>
|
50 |
+
<option value="object"<?php if ($instance['to_show'] == "object") { echo 'selected="selected"'; } ?>><?php _e('object (flash player)'); ?></option>
|
51 |
+
<option value="iframe"<?php if ($instance['to_show'] == "iframe") { echo 'selected="selected"'; } ?>><?php _e('iframe (HTML5 player)'); ?></option>
|
52 |
+
<option value="chromeless"<?php if ($instance['to_show'] == "chromeless") { echo 'selected="selected"'; } ?>><?php _e('chromeless video'); ?></option>
|
53 |
</select>
|
54 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['fixyt'], true ); ?> id="<?php echo $this->get_field_id( 'fixyt' ); ?>" name="<?php echo $this->get_field_name( 'fixyt' ); ?>" /> <label for="<?php echo $this->get_field_id( 'fixyt' ); ?>"><?php _e('Fix height taken by controls'); ?></label><br />
|
55 |
+
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['autoplay'], true ); ?> id="<?php echo $this->get_field_id( 'autoplay' ); ?>" name="<?php echo $this->get_field_name( 'autoplay' ); ?>" /> <label for="<?php echo $this->get_field_id( 'autoplay' ); ?>"><?php _e('Autoplay video'); ?></label><br />
|
56 |
+
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['controls'], true ); ?> id="<?php echo $this->get_field_id( 'controls' ); ?>" name="<?php echo $this->get_field_name( 'controls' ); ?>" /> <label for="<?php echo $this->get_field_id( 'controls' ); ?>"><?php _e('Hide player controls'); ?></label><br />
|
57 |
+
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['hideinfo'], true ); ?> id="<?php echo $this->get_field_id( 'hideinfo' ); ?>" name="<?php echo $this->get_field_name( 'hideinfo' ); ?>" /> <label for="<?php echo $this->get_field_id( 'hideinfo' ); ?>"><?php _e('Hide video info'); ?></label>
|
58 |
+
</p>
|
59 |
+
<p><label for="<?php echo $this->get_field_id('goto_txt'); ?>"><?php _e('Visit YouTube Channel text:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('goto_txt'); ?>" name="<?php echo $this->get_field_name('goto_txt'); ?>" type="text" value="<?php echo $goto_txt; ?>" /></label>
|
60 |
+
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['showgoto'], true ); ?> id="<?php echo $this->get_field_id( 'showgoto' ); ?>" name="<?php echo $this->get_field_name( 'showgoto' ); ?>" /> <label for="<?php echo $this->get_field_id( 'showgoto' ); ?>"><?php _e('Show link to channel'); ?></label></p>
|
61 |
<?php
|
62 |
}
|
63 |
|
67 |
$instance['title'] = strip_tags($new_instance['title']);
|
68 |
$instance['channel'] = strip_tags($new_instance['channel']);
|
69 |
$instance['goto_txt'] = strip_tags($new_instance['goto_txt']);
|
70 |
+
$instance['showgoto'] = $new_instance['showgoto'];
|
71 |
+
$instance['showtitle']= $new_instance['showtitle'];
|
72 |
$instance['width'] = strip_tags($new_instance['width']);
|
73 |
$instance['height'] = strip_tags($new_instance['height']);
|
74 |
$instance['to_show'] = strip_tags($new_instance['to_show']);
|
75 |
$instance['autoplay'] = $new_instance['autoplay'];
|
76 |
+
$instance['controls'] = $new_instance['controls'];
|
77 |
$instance['ratio'] = strip_tags($new_instance['ratio']);
|
78 |
$instance['fixyt'] = $new_instance['fixyt'];
|
79 |
+
$instance['hideinfo'] = $new_instance['hideinfo'];
|
80 |
|
81 |
return $instance;
|
82 |
}
|
85 |
// outputs the content of the widget
|
86 |
extract( $args );
|
87 |
$title = apply_filters('widget_title', $instance['title']);
|
88 |
+
|
89 |
+
// set default channel if nothing predefined
|
90 |
$channel = $instance['channel'];
|
91 |
if ( $channel == "" ) { $channel = "urkekg"; }
|
92 |
+
|
93 |
+
// get hideinfo, autoplay and controls settings
|
94 |
+
$hideinfo = $instance['hideinfo'];
|
95 |
+
$autoplay = $instance['autoplay'];
|
96 |
+
$controls = $instance['controls'];
|
97 |
+
|
98 |
+
// set width and height
|
99 |
$width = $instance['width'];
|
100 |
if ( $width == "" ) { $width = 220; }
|
101 |
+
// use ratio?
|
102 |
$ratio = $instance['ratio'];
|
103 |
if ( $ratio == 1 ) { // 4:3
|
104 |
$height = round(($width / 4 ) * 3);
|
106 |
$height = round(($width / 16 ) * 10);
|
107 |
} else if ( $ratio == 3 ) { // 16:9
|
108 |
$height = round(($width / 16 ) * 9);
|
109 |
+
} else { // set default if 0 or ratio not set
|
110 |
$height = $instance['height'];
|
111 |
+
if ( $height == "" ) { $height = 165; }
|
|
|
|
|
112 |
}
|
113 |
|
114 |
+
// which type to show
|
115 |
$to_show = $instance['to_show'];
|
116 |
+
if ( $to_show == "" ) { $to_show = "object"; }
|
117 |
+
|
118 |
+
// if not thumbnail, increase video height for 25px taken by video controls
|
119 |
+
if ( !$instance['thumbnail'] && !$controls ) {
|
120 |
$height += 25;
|
121 |
}
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
echo $before_widget;
|
124 |
if ( $title )
|
125 |
echo $before_title . $title . $after_title;
|
145 |
// $next_id = split(":", $next['guid']);
|
146 |
// $next_id = $yt_id[3];
|
147 |
|
148 |
+
// show video title?
|
149 |
+
if ( $instance['showtitle'] ) {
|
150 |
echo "<h3>$yt_title</h3>";
|
151 |
+
}
|
152 |
+
|
153 |
+
// print out video
|
154 |
if ( $to_show == "thumbnail" ) {
|
155 |
echo <<<EOF
|
156 |
<a href="$yt_video" title="Watch video $yt_title published on $yt_date"><img src="$yt_thumb" alt="$yt_title" style="width: ${width}px; height: ${height}px; border: 0;" /></a>
|
157 |
EOF;
|
158 |
} else if ( $to_show == "chromeless" ) {
|
159 |
?>
|
160 |
+
<object type="application/x-shockwave-flash" data="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/youtube-channel/chromeless.swf" width="<?php echo $width; ?>" height="<?php echo $height; ?>">
|
161 |
+
<param name="flashVars" value="video_source=<?php echo $yt_id; ?>&video_width=<?php echo $width; ?>&video_height=<?php echo $height; ?><?php if ( $autoplay ) { echo "&autoplay=Yes"; } if ( !$controls ) { echo "&youtube_controls=Yes"; } ?>" />
|
162 |
+
<param name="quality" value="high" />
|
163 |
+
<param name="wmode" value="opaque" />
|
164 |
+
<param name="swfversion" value="6.0.65.0" />
|
165 |
+
<param name="movie" value="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/youtube-channel/chromeless.swf" />
|
166 |
+
</object>
|
167 |
<?php
|
168 |
+
} else if ( $to_show == "iframe" ) {
|
169 |
+
?>
|
170 |
+
<iframe title="YouTube video player" width="<?php echo $width; ?>" height="<?php echo $height; ?>" src="http://www.youtube.com/embed/<?php echo "$yt_id?enablejsapi=1"; if ( $controls ) { echo "&controls=0"; } if ( $hideinfo ) { echo "&showinfo=0"; } if ( $autoplay ) { echo "&autoplay=1"; } ?>" frameborder="0" allowfullscreen></iframe>
|
171 |
+
<?php
|
172 |
+
} else { // default is object
|
173 |
+
?>
|
174 |
+
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="<?php echo $width; ?>" height="<?php echo $height; ?>">
|
175 |
+
<param name="movie" value="http://www.youtube.com/v/<?php echo $yt_id; ?>?version=3<?php if ( $controls ) { echo "&controls=0"; } if ( $hideinfo ) { echo "&showinfo=0"; } if ( $autoplay ) { echo "&autoplay=1"; } ?>" />
|
176 |
+
<!--[if !IE]>-->
|
177 |
+
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/<?php echo $yt_id; ?>?version=3<?php if ( $controls ) { echo "&controls=0"; } if ( $hideinfo ) { echo "&showinfo=0"; } if ( $autoplay ) { echo "&autoplay=1"; } ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>">
|
178 |
+
<!--<![endif]-->
|
179 |
+
<!--[if !IE]>-->
|
|
|
|
|
180 |
</object>
|
181 |
+
<!--<![endif]-->
|
182 |
+
</object>
|
183 |
+
<?php
|
184 |
}
|
185 |
|
186 |
+
// do we need to show goto link?
|
187 |
+
if ( $instance['showgoto'] ) {
|
188 |
+
$goto_txt = $instance['goto_txt'];
|
189 |
+
if ( $goto_txt == "" ) { $goto_txt = __("Visit channel")." $channel"; }
|
190 |
+
echo <<<EOF
|
191 |
+
<p><a href="javascript: window.open('http://www.youtube.com/user/$channel/'); void 0;" title="$goto_txt">$goto_txt</a></p>
|
192 |
+
EOF;
|
193 |
+
} // showgoto
|
194 |
}
|
195 |
?>
|
196 |
</div>
|