Version Description
- Fixed z-index problem with flash and iframe object
- Add option to try to fix 'No items' error
- Add donate button in options dialog
Download this release
Release Info
Developer | urkekg |
Plugin | YouTube Channel |
Version | 1.3 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.3
- readme.txt +19 -18
- youtube-channel.php +12 -3
readme.txt
CHANGED
@@ -3,10 +3,10 @@ Contributors: urkekg
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q6Q762MQ97XJ6
|
4 |
Tags: youtube, channel, playlist, single, widget, widgets, youtube player, flash player, rss, feed, video, thumbnail, embed, sidebar, chromeless, iframe, html5
|
5 |
Requires at least: 3.2.1
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
-
Sidebar widget
|
10 |
|
11 |
== Description ==
|
12 |
|
@@ -32,31 +32,27 @@ If you like this extension and you find it useful, please rate it on the right s
|
|
32 |
* Option to show link to channel
|
33 |
* Option to open channel in new tab/window
|
34 |
* Option to use target="_blank" instead of javascript window.open() for chanel link in new tab/window
|
35 |
-
* Translated to Serbian and Spanish
|
36 |
|
37 |
= Credits =
|
38 |
Chromeless option borrowed from [Chromeless YouTube](http://wordpress.org/extend/plugins/chromeless-youtube/) extension.
|
39 |
Code improvements and textdomain adds done by [dimadin](http://wordpress.org/extend/plugins/profile/dimadin).
|
|
|
40 |
|
41 |
== Installation ==
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
1.
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
1. If you need enter FTP parameters for your host and click on `Proceed`.
|
52 |
-
1. Activate the plugin through the `Plugins` menu in WordPress.
|
53 |
-
1. Insert new widget on `Appearance` → `Widgets`.
|
54 |
-
1. Set YouTube channel in proper widget field.
|
55 |
|
56 |
== TODO ==
|
57 |
|
58 |
* Add option to show favorite videos
|
59 |
-
* Enable translations
|
60 |
* Option to force display of HD video (useless for small sized video?)
|
61 |
* Add option to show more than one (and how much) latest videos
|
62 |
|
@@ -67,6 +63,11 @@ Code improvements and textdomain adds done by [dimadin](http://wordpress.org/ext
|
|
67 |
I could not to find widget with link to channel and thumbnail instead of video object, so I made this one.
|
68 |
|
69 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
70 |
= 1.2 =
|
71 |
* Fixed number of items for random video (min 1, max 50)
|
72 |
* Fixed no-controls for HTML5 iframe
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q6Q762MQ97XJ6
|
4 |
Tags: youtube, channel, playlist, single, widget, widgets, youtube player, flash player, rss, feed, video, thumbnail, embed, sidebar, chromeless, iframe, html5
|
5 |
Requires at least: 3.2.1
|
6 |
+
Tested up to: 3.3.1
|
7 |
+
Stable tag: 1.3
|
8 |
|
9 |
+
Sidebar widget to show latest video thumbnail, playable flash object or chromeless video from YouTube Channel or Playlist.
|
10 |
|
11 |
== Description ==
|
12 |
|
32 |
* Option to show link to channel
|
33 |
* Option to open channel in new tab/window
|
34 |
* Option to use target="_blank" instead of javascript window.open() for chanel link in new tab/window
|
35 |
+
* Translated to Serbian and Spanish (English by default)
|
36 |
|
37 |
= Credits =
|
38 |
Chromeless option borrowed from [Chromeless YouTube](http://wordpress.org/extend/plugins/chromeless-youtube/) extension.
|
39 |
Code improvements and textdomain adds done by [dimadin](http://wordpress.org/extend/plugins/profile/dimadin).
|
40 |
+
[Federico Bozo](http://corchoweb.com/) reminded me to fix z-index problem
|
41 |
|
42 |
== Installation ==
|
43 |
+
|
44 |
+
You can use the built in installer and upgrader, or you can install the plugin manually.
|
45 |
+
|
46 |
+
1. You can either use the automatic plugin installer or your FTP program to upload unziped `youtube-channel` directory to your `wp-content/plugins` directory.
|
47 |
+
2. Activate the plugin through the `Plugins` menu in WordPress
|
48 |
+
3. Add YouTube Channel widget to your sidebar
|
49 |
+
4. Set channel name and save changes
|
50 |
+
|
51 |
+
If you have to upgrade manually simply repeat the installation steps and re-enable the plugin.
|
|
|
|
|
|
|
|
|
52 |
|
53 |
== TODO ==
|
54 |
|
55 |
* Add option to show favorite videos
|
|
|
56 |
* Option to force display of HD video (useless for small sized video?)
|
57 |
* Add option to show more than one (and how much) latest videos
|
58 |
|
63 |
I could not to find widget with link to channel and thumbnail instead of video object, so I made this one.
|
64 |
|
65 |
== Changelog ==
|
66 |
+
= 1.3 =
|
67 |
+
* Fixed z-index problem with flash and iframe object
|
68 |
+
* Add option to try to fix 'No items' error
|
69 |
+
* Add donate button in options dialog
|
70 |
+
|
71 |
= 1.2 =
|
72 |
* Fixed number of items for random video (min 1, max 50)
|
73 |
* Fixed no-controls for HTML5 iframe
|
youtube-channel.php
CHANGED
@@ -4,7 +4,7 @@ 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 or Playlist.
|
6 |
Author: Aleksandar Urošević
|
7 |
-
Version: 1.
|
8 |
Author URI: http://urosevic.net/
|
9 |
*/
|
10 |
|
@@ -41,6 +41,7 @@ class YouTube_Channel_Widget extends WP_Widget {
|
|
41 |
$to_show = esc_attr($instance['to_show']);
|
42 |
$autoplay = esc_attr($instance['autoplay']);
|
43 |
$controls = esc_attr($instance['controls']);
|
|
|
44 |
$ratio = esc_attr($instance['ratio']);
|
45 |
$fixyt = esc_attr($instance['fixyt']);
|
46 |
$hideinfo = esc_attr($instance['hideinfo']);
|
@@ -69,6 +70,7 @@ class YouTube_Channel_Widget extends WP_Widget {
|
|
69 |
<option value="chromeless"<?php selected( $instance['to_show'], 'chromeless' ); ?>><?php _e('chromeless video', 'youtube-channel'); ?></option>
|
70 |
</select>
|
71 |
<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', 'youtube-channel'); ?></label><br />
|
|
|
72 |
<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', 'youtube-channel'); ?></label><br />
|
73 |
<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', 'youtube-channel'); ?></label><br />
|
74 |
<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', 'youtube-channel'); ?></label><br />
|
@@ -78,6 +80,7 @@ class YouTube_Channel_Widget extends WP_Widget {
|
|
78 |
<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', 'youtube-channel'); ?></label><br />
|
79 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['popupgoto'], true ); ?> id="<?php echo $this->get_field_id( 'popupgoto' ); ?>" name="<?php echo $this->get_field_name( 'popupgoto' ); ?>" /> <label for="<?php echo $this->get_field_id( 'popupgoto' ); ?>"><?php _e('Open channel in new window/tab', 'youtube-channel'); ?></label><br />
|
80 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['target'], true ); ?> id="<?php echo $this->get_field_id( 'target' ); ?>" name="<?php echo $this->get_field_name( 'target' ); ?>" /> <label for="<?php echo $this->get_field_id( 'target' ); ?>"><?php _e('Use target="_blank" (invalid XHTML)', 'youtube-channel'); ?></label></p>
|
|
|
81 |
<?php
|
82 |
}
|
83 |
|
@@ -100,6 +103,7 @@ class YouTube_Channel_Widget extends WP_Widget {
|
|
100 |
$instance['to_show'] = strip_tags($new_instance['to_show']);
|
101 |
$instance['autoplay'] = $new_instance['autoplay'];
|
102 |
$instance['controls'] = $new_instance['controls'];
|
|
|
103 |
$instance['ratio'] = strip_tags($new_instance['ratio']);
|
104 |
$instance['fixyt'] = $new_instance['fixyt'];
|
105 |
$instance['hideinfo'] = $new_instance['hideinfo'];
|
@@ -166,7 +170,11 @@ class YouTube_Channel_Widget extends WP_Widget {
|
|
166 |
<div class="youtube_channel">
|
167 |
<?php
|
168 |
include_once(ABSPATH . WPINC . '/rss.php');
|
169 |
-
$rss_settings = '?alt=rss&v=2
|
|
|
|
|
|
|
|
|
170 |
if ( $usepl ) {
|
171 |
$rss_url = 'http://gdata.youtube.com/feeds/api/playlists/'.$playlist.$rss_settings;
|
172 |
} else {
|
@@ -233,7 +241,7 @@ EOF;
|
|
233 |
} else if ( $to_show == "iframe" ) {
|
234 |
if (!$usepl) { $yt_url = $yt_id; }
|
235 |
?>
|
236 |
-
<iframe title="YouTube video player" width="<?php echo $width; ?>" height="<?php echo $height; ?>" src="http://www.youtube.com/embed/<? echo $yt_url."?enablejsapi=1"; if ( $controls ) { echo "&controls=0"; } if ( $hideinfo ) { echo "&showinfo=0"; } if ( $autoplay ) { echo "&autoplay=1"; } ?>" frameborder="0" allowfullscreen></iframe>
|
237 |
<?php
|
238 |
} else { // default is object
|
239 |
?>
|
@@ -242,6 +250,7 @@ EOF;
|
|
242 |
<!--[if !IE]>-->
|
243 |
<object type="application/x-shockwave-flash" data="http://www.youtube.com/<?php echo $yt_url; ?>?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; ?>">
|
244 |
<!--<![endif]-->
|
|
|
245 |
<!--[if !IE]>-->
|
246 |
</object>
|
247 |
<!--<![endif]-->
|
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 or Playlist.
|
6 |
Author: Aleksandar Urošević
|
7 |
+
Version: 1.3
|
8 |
Author URI: http://urosevic.net/
|
9 |
*/
|
10 |
|
41 |
$to_show = esc_attr($instance['to_show']);
|
42 |
$autoplay = esc_attr($instance['autoplay']);
|
43 |
$controls = esc_attr($instance['controls']);
|
44 |
+
$fixnoitem = esc_attr($instance['fixnoitem']);
|
45 |
$ratio = esc_attr($instance['ratio']);
|
46 |
$fixyt = esc_attr($instance['fixyt']);
|
47 |
$hideinfo = esc_attr($instance['hideinfo']);
|
70 |
<option value="chromeless"<?php selected( $instance['to_show'], 'chromeless' ); ?>><?php _e('chromeless video', 'youtube-channel'); ?></option>
|
71 |
</select>
|
72 |
<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', 'youtube-channel'); ?></label><br />
|
73 |
+
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['fixnoitem'], true ); ?> id="<?php echo $this->get_field_id( 'fixnoitem' ); ?>" name="<?php echo $this->get_field_name( 'fixnoitem' ); ?>" /> <label for="<?php echo $this->get_field_id( 'fixnoitem' ); ?>"><?php _e('Try to fix `No items` error', 'youtube-channel'); ?></label><br />
|
74 |
<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', 'youtube-channel'); ?></label><br />
|
75 |
<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', 'youtube-channel'); ?></label><br />
|
76 |
<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', 'youtube-channel'); ?></label><br />
|
80 |
<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', 'youtube-channel'); ?></label><br />
|
81 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['popupgoto'], true ); ?> id="<?php echo $this->get_field_id( 'popupgoto' ); ?>" name="<?php echo $this->get_field_name( 'popupgoto' ); ?>" /> <label for="<?php echo $this->get_field_id( 'popupgoto' ); ?>"><?php _e('Open channel in new window/tab', 'youtube-channel'); ?></label><br />
|
82 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['target'], true ); ?> id="<?php echo $this->get_field_id( 'target' ); ?>" name="<?php echo $this->get_field_name( 'target' ); ?>" /> <label for="<?php echo $this->get_field_id( 'target' ); ?>"><?php _e('Use target="_blank" (invalid XHTML)', 'youtube-channel'); ?></label></p>
|
83 |
+
<p><input type="button" value="Support YTC / Donate via PayPal" onclick="window.location='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q6Q762MQ97XJ6'" class="button-secondary"></p>
|
84 |
<?php
|
85 |
}
|
86 |
|
103 |
$instance['to_show'] = strip_tags($new_instance['to_show']);
|
104 |
$instance['autoplay'] = $new_instance['autoplay'];
|
105 |
$instance['controls'] = $new_instance['controls'];
|
106 |
+
$instance['fixnoitem'] = $new_instance['fixnoitem'];
|
107 |
$instance['ratio'] = strip_tags($new_instance['ratio']);
|
108 |
$instance['fixyt'] = $new_instance['fixyt'];
|
109 |
$instance['hideinfo'] = $new_instance['hideinfo'];
|
170 |
<div class="youtube_channel">
|
171 |
<?php
|
172 |
include_once(ABSPATH . WPINC . '/rss.php');
|
173 |
+
$rss_settings = '?alt=rss&v=2';
|
174 |
+
if ( !$instance['fixnoitem'] ) {
|
175 |
+
$rss_settings .= '&orderby=published';
|
176 |
+
}
|
177 |
+
$rss_settings .= '&rel=0&max-results='.$maxrnd;
|
178 |
if ( $usepl ) {
|
179 |
$rss_url = 'http://gdata.youtube.com/feeds/api/playlists/'.$playlist.$rss_settings;
|
180 |
} else {
|
241 |
} else if ( $to_show == "iframe" ) {
|
242 |
if (!$usepl) { $yt_url = $yt_id; }
|
243 |
?>
|
244 |
+
<iframe title="YouTube video player" width="<?php echo $width; ?>" height="<?php echo $height; ?>" src="http://www.youtube.com/embed/<?php echo $yt_url."?wmode=opaque&enablejsapi=1"; if ( $controls ) { echo "&controls=0"; } if ( $hideinfo ) { echo "&showinfo=0"; } if ( $autoplay ) { echo "&autoplay=1"; } ?>" frameborder="0" allowfullscreen></iframe>
|
245 |
<?php
|
246 |
} else { // default is object
|
247 |
?>
|
250 |
<!--[if !IE]>-->
|
251 |
<object type="application/x-shockwave-flash" data="http://www.youtube.com/<?php echo $yt_url; ?>?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; ?>">
|
252 |
<!--<![endif]-->
|
253 |
+
<param name="wmode" value="opaque" />
|
254 |
<!--[if !IE]>-->
|
255 |
</object>
|
256 |
<!--<![endif]-->
|