YouTube Channel - Version 1.2

Version Description

  • Fixed number of items for random video (min 1, max 50)
  • Fixed no-controls for HTML5 iframe
Download this release

Release Info

Developer urkekg
Plugin Icon YouTube Channel
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

languages/youtube-channel-es_ES.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-09-24 10:16+0200\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Aleksandar Urošević <urke@users.sourceforge.net>\n"
8
  "Language-Team: \n"
@@ -12,7 +12,8 @@ msgstr ""
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
  "X-Poedit-SourceCharset: utf-8\n"
15
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
 
16
  "X-Textdomain-Support: yes\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
@@ -57,11 +58,11 @@ msgid "Hide video info"
57
  msgstr "Esconder info de vídeo"
58
 
59
  #: ../youtube-channel.php:52
60
- msgid "Maximum items to fetch:"
61
- msgstr "Máximo de elementos en busca de:"
62
 
63
  # @ youtube-channel
64
- #: ../youtube-channel.php:185
65
  msgid "No items"
66
  msgstr "No hay elementos"
67
 
@@ -99,13 +100,13 @@ msgid "Visit YouTube Channel text:"
99
  msgstr "Visitar canal de YouTube"
100
 
101
  # @ youtube-channel
102
- #: ../youtube-channel.php:253
103
  #, php-format
104
  msgid "Visit channel %1$s"
105
  msgstr "Visitar canal %1$s"
106
 
107
  # @ youtube-channel
108
- #: ../youtube-channel.php:217
109
  #, php-format
110
  msgid "Watch video %1$s published on %2$s"
111
  msgstr "Ver vídeo %1$s publicado en %2$s"
@@ -141,8 +142,7 @@ msgid "custom"
141
  msgstr "Personalizado"
142
 
143
  # @ youtube-channel
144
- #: ../youtube-channel.php:54
145
- #: ../youtube-channel.php:55
146
  msgid "default"
147
  msgstr "por defecto"
148
 
@@ -152,7 +152,7 @@ msgid "iframe (HTML5 player)"
152
  msgstr "iframe (html5) - el bueno"
153
 
154
  # @ youtube-channel
155
- #: ../youtube-channel.php:256
156
  msgid "in new window/tab"
157
  msgstr "en nueva ventana/pestaña"
158
 
@@ -166,3 +166,5 @@ msgstr "objeto (flash)"
166
  msgid "thumbnail"
167
  msgstr "miniatura"
168
 
 
 
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-09-28 21:16+0200\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Aleksandar Urošević <urke@users.sourceforge.net>\n"
8
  "Language-Team: \n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
  "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
  "X-Textdomain-Support: yes\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
 
58
  msgstr "Esconder info de vídeo"
59
 
60
  #: ../youtube-channel.php:52
61
+ msgid "Items to fetch (min 1, max 50):"
62
+ msgstr ""
63
 
64
  # @ youtube-channel
65
+ #: ../youtube-channel.php:187
66
  msgid "No items"
67
  msgstr "No hay elementos"
68
 
100
  msgstr "Visitar canal de YouTube"
101
 
102
  # @ youtube-channel
103
+ #: ../youtube-channel.php:256
104
  #, php-format
105
  msgid "Visit channel %1$s"
106
  msgstr "Visitar canal %1$s"
107
 
108
  # @ youtube-channel
109
+ #: ../youtube-channel.php:219
110
  #, php-format
111
  msgid "Watch video %1$s published on %2$s"
112
  msgstr "Ver vídeo %1$s publicado en %2$s"
142
  msgstr "Personalizado"
143
 
144
  # @ youtube-channel
145
+ #: ../youtube-channel.php:54 ../youtube-channel.php:55
 
146
  msgid "default"
147
  msgstr "por defecto"
148
 
152
  msgstr "iframe (html5) - el bueno"
153
 
154
  # @ youtube-channel
155
+ #: ../youtube-channel.php:259
156
  msgid "in new window/tab"
157
  msgstr "en nueva ventana/pestaña"
158
 
166
  msgid "thumbnail"
167
  msgstr "miniatura"
168
 
169
+ #~ msgid "Maximum items to fetch:"
170
+ #~ msgstr "Máximo de elementos en busca de:"
languages/youtube-channel-sr_RS.mo CHANGED
Binary file
languages/youtube-channel-sr_RS.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-09-24 10:16+0200\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Aleksandar Urošević <urke@users.sourceforge.net>\n"
8
  "Language-Team: \n"
@@ -57,11 +57,11 @@ msgid "Hide video info"
57
  msgstr "Сакривање информација о видеу"
58
 
59
  #: ../youtube-channel.php:52
60
- msgid "Maximum items to fetch:"
61
- msgstr "Максималан број видеа:"
62
 
63
  # @ youtube-channel
64
- #: ../youtube-channel.php:185
65
  msgid "No items"
66
  msgstr "Нема видео снимака"
67
 
@@ -99,13 +99,13 @@ msgid "Visit YouTube Channel text:"
99
  msgstr "Текст за везу „посети Јутјуб канал“:"
100
 
101
  # @ youtube-channel
102
- #: ../youtube-channel.php:253
103
  #, php-format
104
  msgid "Visit channel %1$s"
105
  msgstr "Посети канал %1$s"
106
 
107
  # @ youtube-channel
108
- #: ../youtube-channel.php:217
109
  #, php-format
110
  msgid "Watch video %1$s published on %2$s"
111
  msgstr "Погледај видео %1$s објављен дана %2$s"
@@ -152,7 +152,7 @@ msgid "iframe (HTML5 player)"
152
  msgstr "уграђени фрејм (HTML5 плејер)"
153
 
154
  # @ youtube-channel
155
- #: ../youtube-channel.php:256
156
  msgid "in new window/tab"
157
  msgstr "у новом прозору/језичку"
158
 
@@ -166,3 +166,5 @@ msgstr "објекат (флеш плејер)"
166
  msgid "thumbnail"
167
  msgstr "умањену слику"
168
 
 
 
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-09-28 21:16+0200\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Aleksandar Urošević <urke@users.sourceforge.net>\n"
8
  "Language-Team: \n"
57
  msgstr "Сакривање информација о видеу"
58
 
59
  #: ../youtube-channel.php:52
60
+ msgid "Items to fetch (min 1, max 50):"
61
+ msgstr "Ставки за добављање (мин 1, макс 50)"
62
 
63
  # @ youtube-channel
64
+ #: ../youtube-channel.php:187
65
  msgid "No items"
66
  msgstr "Нема видео снимака"
67
 
99
  msgstr "Текст за везу „посети Јутјуб канал“:"
100
 
101
  # @ youtube-channel
102
+ #: ../youtube-channel.php:256
103
  #, php-format
104
  msgid "Visit channel %1$s"
105
  msgstr "Посети канал %1$s"
106
 
107
  # @ youtube-channel
108
+ #: ../youtube-channel.php:219
109
  #, php-format
110
  msgid "Watch video %1$s published on %2$s"
111
  msgstr "Погледај видео %1$s објављен дана %2$s"
152
  msgstr "уграђени фрејм (HTML5 плејер)"
153
 
154
  # @ youtube-channel
155
+ #: ../youtube-channel.php:259
156
  msgid "in new window/tab"
157
  msgstr "у новом прозору/језичку"
158
 
166
  msgid "thumbnail"
167
  msgstr "умањену слику"
168
 
169
+ #~ msgid "Maximum items to fetch:"
170
+ #~ msgstr "Максималан број видеа:"
languages/youtube-channel-xx_XX.pot CHANGED
@@ -7,7 +7,7 @@
7
  msgid ""
8
  msgstr "Project-Id-Version: PACKAGE VERSION\n"
9
  "Report-Msgid-Bugs-To: \n"
10
- "POT-Creation-Date: 2011-09-24 10:16+0200\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -49,10 +49,10 @@ msgid "Hide video info"
49
  msgstr ""
50
 
51
  #: ../youtube-channel.php:52
52
- msgid "Maximum items to fetch:"
53
  msgstr ""
54
 
55
- #: ../youtube-channel.php:185
56
  msgid "No items"
57
  msgstr ""
58
 
@@ -84,12 +84,12 @@ msgstr ""
84
  msgid "Visit YouTube Channel text:"
85
  msgstr ""
86
 
87
- #: ../youtube-channel.php:253
88
  #, php-format
89
  msgid "Visit channel %1$s"
90
  msgstr ""
91
 
92
- #: ../youtube-channel.php:217
93
  #, php-format
94
  msgid "Watch video %1$s published on %2$s"
95
  msgstr ""
@@ -126,7 +126,7 @@ msgstr ""
126
  msgid "iframe (HTML5 player)"
127
  msgstr ""
128
 
129
- #: ../youtube-channel.php:256
130
  msgid "in new window/tab"
131
  msgstr ""
132
 
7
  msgid ""
8
  msgstr "Project-Id-Version: PACKAGE VERSION\n"
9
  "Report-Msgid-Bugs-To: \n"
10
+ "POT-Creation-Date: 2011-09-28 21:16+0200\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
49
  msgstr ""
50
 
51
  #: ../youtube-channel.php:52
52
+ msgid "Items to fetch (min 1, max 50):"
53
  msgstr ""
54
 
55
+ #: ../youtube-channel.php:187
56
  msgid "No items"
57
  msgstr ""
58
 
84
  msgid "Visit YouTube Channel text:"
85
  msgstr ""
86
 
87
+ #: ../youtube-channel.php:256
88
  #, php-format
89
  msgid "Visit channel %1$s"
90
  msgstr ""
91
 
92
+ #: ../youtube-channel.php:219
93
  #, php-format
94
  msgid "Watch video %1$s published on %2$s"
95
  msgstr ""
126
  msgid "iframe (HTML5 player)"
127
  msgstr ""
128
 
129
+ #: ../youtube-channel.php:259
130
  msgid "in new window/tab"
131
  msgstr ""
132
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
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.2.1
7
- Stable tag: 1.1
8
 
9
  Sidebar widget that display latest video thumbnail, playable flash object or chromeless video from YouTube Channel or Playlist.
10
 
@@ -67,6 +67,10 @@ 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.1 =
71
  * Added option to use the playlist instead of channel (suggested by Stacy)
72
 
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.2.1
7
+ Stable tag: 1.2
8
 
9
  Sidebar widget that display latest video thumbnail, playable flash object or chromeless video from YouTube Channel or Playlist.
10
 
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
73
+
74
  = 1.1 =
75
  * Added option to use the playlist instead of channel (suggested by Stacy)
76
 
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.1
8
  Author URI: http://urosevic.net/
9
  */
10
 
@@ -49,7 +49,7 @@ class YouTube_Channel_Widget extends WP_Widget {
49
  <p><label for="<?php echo $this->get_field_id('channel'); ?>"><?php _e('Channel:', 'youtube-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>
50
  <p><label for="<?php echo $this->get_field_id('playlist'); ?>"><?php _e('Playlist:', 'youtube-channel'); ?> <input class="widefat" id="<?php echo $this->get_field_id('playlist'); ?>" name="<?php echo $this->get_field_name('playlist'); ?>" type="text" value="<?php echo $playlist; ?>" /></label>
51
  <input class="checkbox" type="checkbox" <?php checked( (bool) $instance['usepl'], true ); ?> id="<?php echo $this->get_field_id( 'usepl' ); ?>" name="<?php echo $this->get_field_name( 'usepl' ); ?>" /> <label for="<?php echo $this->get_field_id( 'usepl' ); ?>"><?php _e('Use the playlist instead of channel', 'youtube-channel'); ?></label></p>
52
- <p><label for="<?php echo $this->get_field_id('maxrnd'); ?>"><?php _e('Maximum items to fetch:', 'youtube-channel'); ?> <input class="widefat" id="<?php echo $this->get_field_id('maxrnd'); ?>" name="<?php echo $this->get_field_name('maxrnd'); ?>" type="text" value="<?php echo $maxrnd; ?>" /></label><br />
53
  <input class="checkbox" type="checkbox" <?php checked( (bool) $instance['getrnd'], true ); ?> id="<?php echo $this->get_field_id( 'getrnd' ); ?>" name="<?php echo $this->get_field_name( 'getrnd' ); ?>" /> <label for="<?php echo $this->get_field_id( 'getrnd' ); ?>"><?php _e('Get random video from channel', 'youtube-channel'); ?></label></p>
54
  <p><label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width', 'youtube-channel'); ?> (<?php _e('default', 'youtube-channel'); ?> 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>
55
  <p><label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height', 'youtube-channel'); ?> (<?php _e('default', 'youtube-channel'); ?> 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>
@@ -118,13 +118,15 @@ class YouTube_Channel_Widget extends WP_Widget {
118
 
119
  // set playlist id
120
  $playlist = $instance['playlist'];
 
 
121
  if ( $playlist == "" ) { $playlist = "9DD839E3EB7475DF"; }
122
  $usepl = $instance['usepl'];
123
 
124
  // get max items for random video
125
  $maxrnd = $instance['maxrnd'];
126
  if ( $maxrnd < 1 ) { $maxrnd = 10; } // default 10
127
-
128
  // get hideinfo, autoplay and controls settings
129
  $hideinfo = $instance['hideinfo'];
130
  $autoplay = $instance['autoplay'];
@@ -164,11 +166,11 @@ class YouTube_Channel_Widget extends WP_Widget {
164
  <div class="youtube_channel">
165
  <?php
166
  include_once(ABSPATH . WPINC . '/rss.php');
167
-
168
  if ( $usepl ) {
169
- $rss_url = 'http://gdata.youtube.com/feeds/api/playlists/'.$playlist.'?alt=rss&v=2&orderby=published';
170
  } else {
171
- $rss_url = 'http://gdata.youtube.com/feeds/base/users/'.$channel.'/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile';
172
  }
173
 
174
  $rss = fetch_feed($rss_url);
@@ -229,8 +231,9 @@ EOF;
229
  </object>
230
  <?php
231
  } else if ( $to_show == "iframe" ) {
 
232
  ?>
233
- <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 "&amp;autoplay=1"; } ?>" frameborder="0" allowfullscreen></iframe>
234
  <?php
235
  } else { // default is object
236
  ?>
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.2
8
  Author URI: http://urosevic.net/
9
  */
10
 
49
  <p><label for="<?php echo $this->get_field_id('channel'); ?>"><?php _e('Channel:', 'youtube-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>
50
  <p><label for="<?php echo $this->get_field_id('playlist'); ?>"><?php _e('Playlist:', 'youtube-channel'); ?> <input class="widefat" id="<?php echo $this->get_field_id('playlist'); ?>" name="<?php echo $this->get_field_name('playlist'); ?>" type="text" value="<?php echo $playlist; ?>" /></label>
51
  <input class="checkbox" type="checkbox" <?php checked( (bool) $instance['usepl'], true ); ?> id="<?php echo $this->get_field_id( 'usepl' ); ?>" name="<?php echo $this->get_field_name( 'usepl' ); ?>" /> <label for="<?php echo $this->get_field_id( 'usepl' ); ?>"><?php _e('Use the playlist instead of channel', 'youtube-channel'); ?></label></p>
52
+ <p><label for="<?php echo $this->get_field_id('maxrnd'); ?>"><?php _e('Items to fetch (min 1, max 50):', 'youtube-channel'); ?> <input class="widefat" id="<?php echo $this->get_field_id('maxrnd'); ?>" name="<?php echo $this->get_field_name('maxrnd'); ?>" type="text" value="<?php echo $maxrnd; ?>" /></label><br />
53
  <input class="checkbox" type="checkbox" <?php checked( (bool) $instance['getrnd'], true ); ?> id="<?php echo $this->get_field_id( 'getrnd' ); ?>" name="<?php echo $this->get_field_name( 'getrnd' ); ?>" /> <label for="<?php echo $this->get_field_id( 'getrnd' ); ?>"><?php _e('Get random video from channel', 'youtube-channel'); ?></label></p>
54
  <p><label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width', 'youtube-channel'); ?> (<?php _e('default', 'youtube-channel'); ?> 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>
55
  <p><label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height', 'youtube-channel'); ?> (<?php _e('default', 'youtube-channel'); ?> 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>
118
 
119
  // set playlist id
120
  $playlist = $instance['playlist'];
121
+ // trim PL in front of playlist ID
122
+ $playlist = preg_replace('/^PL/', '', $playlist);
123
  if ( $playlist == "" ) { $playlist = "9DD839E3EB7475DF"; }
124
  $usepl = $instance['usepl'];
125
 
126
  // get max items for random video
127
  $maxrnd = $instance['maxrnd'];
128
  if ( $maxrnd < 1 ) { $maxrnd = 10; } // default 10
129
+ elseif ( $maxrnd > 50 ) { $maxrnd = 50; } // max 50
130
  // get hideinfo, autoplay and controls settings
131
  $hideinfo = $instance['hideinfo'];
132
  $autoplay = $instance['autoplay'];
166
  <div class="youtube_channel">
167
  <?php
168
  include_once(ABSPATH . WPINC . '/rss.php');
169
+ $rss_settings = '?alt=rss&v=2&orderby=published&rel=0&max-results='.$maxrnd;
170
  if ( $usepl ) {
171
+ $rss_url = 'http://gdata.youtube.com/feeds/api/playlists/'.$playlist.$rss_settings;
172
  } else {
173
+ $rss_url = 'http://gdata.youtube.com/feeds/base/users/'.$channel.'/uploads'.$rss_settings;
174
  }
175
 
176
  $rss = fetch_feed($rss_url);
231
  </object>
232
  <?php
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
  ?>