Youtube Channel Gallery - Version 1.8.5

Version Description

  • Added option to show only thumbnails without player.
  • Added option to add target="_blank" to thumbnails if the option without player is selected.
  • Control 50 thumbnails limit.
  • Changes in CSS.
  • Changes in admin CSS and JS.
  • Update language file.
Download this release

Release Info

Developer javitxu123
Plugin Icon 128x128 Youtube Channel Gallery
Version 1.8.5
Comparing to
See all releases

Code changes from version 1.8.4 to 1.8.5

admin-scripts.js CHANGED
@@ -23,6 +23,7 @@ jQuery(document).ready(function($) {
23
  ytchg_SetChosen( $(this) );
24
  show_title_description( $(this) );
25
  changeFeedType( $(this) );
 
26
 
27
  });
28
  }
@@ -70,6 +71,15 @@ jQuery(document).ready(function($) {
70
  changeFeedType ($current_widget);
71
  });
72
 
 
 
 
 
 
 
 
 
 
73
  }
74
 
75
 
@@ -146,4 +156,25 @@ jQuery(document).ready(function($) {
146
  }
147
  }
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  });
23
  ytchg_SetChosen( $(this) );
24
  show_title_description( $(this) );
25
  changeFeedType( $(this) );
26
+ changeplayerType( $(this) );
27
 
28
  });
29
  }
71
  changeFeedType ($current_widget);
72
  });
73
 
74
+ //player?
75
+ var playerSelect = '.tabs-2 select[id*="ytchag_player"]';
76
+ $(playerSelect, $widget).change(
77
+ function (event) {
78
+ $player_change = event.currentTarget;
79
+ $current_widget = $(event.currentTarget).parents('.widget');
80
+ changeplayerType ($current_widget);
81
+ });
82
+
83
  }
84
 
85
 
156
  }
157
  }
158
 
159
+
160
+ //Feed label title
161
+ //---------------
162
+
163
+ function changeplayerType ( widget ) {
164
+ $widget = $(widget);
165
+
166
+ var playerSelect = '.tabs-2 select[id*="ytchag_player"]';
167
+ var player_options = '.tabs-2 .player_options';
168
+ var thumb_window = '.tabs-3 .thumb_window';
169
+
170
+ if($(playerSelect + ' option:selected', $widget).val() === '0'){
171
+ $(thumb_window, $widget).show();
172
+ $(player_options, $widget).slideUp('fast');
173
+ }
174
+ if($(playerSelect + ' option:selected', $widget).val() === '1'){
175
+ $(thumb_window, $widget).hide();
176
+ $(player_options, $widget).slideDown('fast');
177
+ }
178
+ }
179
+
180
  });
admin-styles.css CHANGED
@@ -34,15 +34,18 @@
34
  padding: 5px;
35
  display: inline-block;
36
  text-decoration: none;
 
37
  }
38
 
39
  /*content*/
40
- .ytchgtabs div {
41
  border: 1px solid #DFDFDF;
42
  padding: 15px 12px;
43
  background: #FAFAFA;
44
  }
45
 
 
 
46
  /*
47
  tab1
48
  ---------------
34
  padding: 5px;
35
  display: inline-block;
36
  text-decoration: none;
37
+ outline: 0;
38
  }
39
 
40
  /*content*/
41
+ .ytchgtabs div.ytchgtabs-content {
42
  border: 1px solid #DFDFDF;
43
  padding: 15px 12px;
44
  background: #FAFAFA;
45
  }
46
 
47
+ .ytchgtabs-content p:last-child{ margin-bottom: 0}
48
+
49
  /*
50
  tab1
51
  ---------------
languages/youtube-channel-gallery-es_ES.mo CHANGED
Binary file
languages/youtube-channel-gallery-es_ES.po CHANGED
@@ -7,9 +7,9 @@ msgid ""
7
  msgstr ""
8
  "Project-Id-Version: youtube-channel-gallery\n"
9
  "Report-Msgid-Bugs-To: \n"
10
- "POT-Creation-Date: 2013-05-20 22:17+0100\n"
11
- "PO-Revision-Date: 2013-05-20 22:19+0100\n"
12
- "Last-Translator: \n"
13
  "Language-Team: PoseLab <javierpose@gmail.com>\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -31,320 +31,317 @@ msgstr "Galería de Canal de Youtube"
31
  msgid "Show a youtube video and a gallery of thumbnails for a youtube channel"
32
  msgstr "Muestra un vídeo y una galería de miniaturas de una canal de Youtube "
33
 
34
- #: youtube-channel-gallery.php:174
35
  msgid "Title:"
36
  msgstr "Título:"
37
 
38
- #: youtube-channel-gallery.php:180
39
  msgid "Feed"
40
  msgstr "Feed"
41
 
42
- #: youtube-channel-gallery.php:181
43
  msgid "Player"
44
  msgstr "Reproductor"
45
 
46
- #: youtube-channel-gallery.php:182
47
  msgid "Thumbnails"
48
  msgstr "Miniaturas"
49
 
50
- #: youtube-channel-gallery.php:183
51
  msgid "Link"
52
  msgstr "Enlace"
53
 
54
- #: youtube-channel-gallery.php:196
55
  msgid "Video feed type:"
56
  msgstr "Tipo de feed de vídeo:"
57
 
58
- #: youtube-channel-gallery.php:198
59
  msgid "Uploaded by a user"
60
  msgstr "Subidos por el usuario"
61
 
62
- #: youtube-channel-gallery.php:200
63
  msgid "Playlist"
64
  msgstr "Lista de reproducción"
65
 
66
- #: youtube-channel-gallery.php:205
67
  msgid "YouTube user id:"
68
  msgstr "Id de usuario de Youtube:"
69
 
70
- #: youtube-channel-gallery.php:206
71
  msgid "YouTube playlist id:"
72
  msgstr "Id de lista de reproducción de YouTube:"
73
 
74
- #: youtube-channel-gallery.php:211
75
  msgid "Playlist order:"
76
  msgstr "Orden de lista de reproducción:"
77
 
78
- #: youtube-channel-gallery.php:213
79
  msgid "Ascending Order"
80
  msgstr "Ascendente"
81
 
82
- #: youtube-channel-gallery.php:214
83
  msgid "Descending Order"
84
  msgstr "Descendente"
85
 
86
- #: youtube-channel-gallery.php:219
87
  msgid "Cache time (hours):"
88
  msgstr "Tiempo de cache (horas):"
89
 
90
- #: youtube-channel-gallery.php:221
91
  msgid "Hours that RSS data is saved in database, to not make a request every time the page is displayed. Assign this value according to how often you upgrade your playlist in YouTube."
92
  msgstr "Horas que los datos del RSS se guardan en la base de datos, para no hacer una solicitud cada vez que se muestra la página. Asigna este valor en función de la frecuencia con que actualizas la lista de reproducción en YouTube."
93
 
94
- #: youtube-channel-gallery.php:226
95
  msgid "Activate cache"
96
  msgstr "Activar caché"
97
 
98
- #: youtube-channel-gallery.php:227
99
  msgid "If you disable this field the cache will be deleted and will not be used. This is useful to refresh immediately the YouTube RSS used by the plugin. Reenable the cache when the gallery shows the changes you made in your youtube account."
100
  msgstr "Si se deshabilita este campo la caché se borrará y no será utilizada. Esto es útil para actualizar inmediatamente el RSS de YouTube usado por el plugin. Vuelve a habilitar la caché cuando la galería muestre los cambios que ha realizado en su cuenta de YouTube."
101
 
102
- #: youtube-channel-gallery.php:242
103
- #: youtube-channel-gallery.php:324
 
 
 
 
 
 
 
 
 
 
 
 
104
  msgid "Aspect ratio:"
105
  msgstr "Relación de aspecto:"
106
 
107
- #: youtube-channel-gallery.php:244
108
- #: youtube-channel-gallery.php:326
109
  msgid "Standard (4x3)"
110
  msgstr "Estándar (4x3)"
111
 
112
- #: youtube-channel-gallery.php:245
113
- #: youtube-channel-gallery.php:327
114
  msgid "Widescreen (16x9)"
115
  msgstr "Panorámico (16x9)"
116
 
117
- #: youtube-channel-gallery.php:250
118
  msgid "Theme:"
119
  msgstr "Tema:"
120
 
121
- #: youtube-channel-gallery.php:252
122
  msgid "Dark"
123
  msgstr "Oscuro"
124
 
125
- #: youtube-channel-gallery.php:253
126
  msgid "Light"
127
  msgstr "Claro"
128
 
129
- #: youtube-channel-gallery.php:258
130
  msgid "Progress bar color:"
131
  msgstr "Color de barra de progreso:"
132
 
133
- #: youtube-channel-gallery.php:260
134
  msgid "Red"
135
  msgstr "Rojo"
136
 
137
- #: youtube-channel-gallery.php:261
138
  msgid "White"
139
  msgstr "Blanco"
140
 
141
- #: youtube-channel-gallery.php:266
142
  msgid "Video quality:"
143
  msgstr "Calidad del vídeo:"
144
 
145
- #: youtube-channel-gallery.php:268
146
  msgid "default"
147
  msgstr "por defecto"
148
 
149
- #: youtube-channel-gallery.php:269
150
  msgid "highres"
151
  msgstr "alta resolución"
152
 
153
- #: youtube-channel-gallery.php:270
154
  msgid "hd1080"
155
  msgstr "hd1080"
156
 
157
- #: youtube-channel-gallery.php:271
158
  msgid "hd720"
159
  msgstr "hd720"
160
 
161
- #: youtube-channel-gallery.php:272
162
  msgid "large"
163
  msgstr "largo"
164
 
165
- #: youtube-channel-gallery.php:273
166
  msgid "medium"
167
  msgstr "mediano"
168
 
169
- #: youtube-channel-gallery.php:274
170
  msgid "small"
171
  msgstr "pequeño"
172
 
173
- #: youtube-channel-gallery.php:276
174
  msgid "Default value enables YouTube to select the most appropriate playback quality. If you select a quality level that is not available for the video, then the quality will be set to the next lowest level that is available."
175
  msgstr "El valor predeterminado permite a YouTube seleccionar la calidad de reproducción más adecuada. Si selecciona un nivel de calidad que no está disponible para el vídeo, la calidad se ajustará al siguiente nivel más bajo que este disponible."
176
 
177
- #: youtube-channel-gallery.php:280
178
  msgid "Autoplay"
179
  msgstr "Autoplay"
180
 
181
- #: youtube-channel-gallery.php:285
182
  msgid "Show YouTube logo"
183
  msgstr "Mostrar el logotipo de YouTube"
184
 
185
- #: youtube-channel-gallery.php:286
186
  msgid "Activate this field to show the YouTube logo in the control bar. Setting the color parameter to white will show the YouTube logo in the control bar."
187
  msgstr "Activa este campo para mostrar el logotipo de YouTube en la barra de control. Un ajuste del parámetro de color a blanco mostrará el logotipo de YouTube en la barra de control."
188
 
189
- #: youtube-channel-gallery.php:291
190
  msgid "Show related videos"
191
  msgstr "Mostrar los vídeos relacionados"
192
 
193
- #: youtube-channel-gallery.php:292
194
  msgid "Activate this field to show related videos when playback of the video ends."
195
  msgstr "Activa este campo para mostrar videos relacionados cuando termine la reproducción del vídeo."
196
 
197
- #: youtube-channel-gallery.php:297
198
  msgid "Show info"
199
  msgstr "Mostrar información"
200
 
201
- #: youtube-channel-gallery.php:298
202
  msgid "Activate this field to display information like the video title and uploader before the video starts playing."
203
  msgstr "Active este campo para mostrar información como el título del vídeo y nombre de usuario antes de que el vídeo comience a reproducirse."
204
 
205
- #: youtube-channel-gallery.php:311
206
  msgid "Number of videos to show:"
207
  msgstr "Número de vídeos a mostrar:"
208
 
209
- #: youtube-channel-gallery.php:313
210
  msgid "The plugin can display a maximum of 50 videos. This limitation will change in a future release."
211
  msgstr "El plugin puede mostrar un máximo de 50 vídeos. Esta limitación cambiará en una futura versión."
212
 
213
- #: youtube-channel-gallery.php:317
214
  msgid "Thumbnail width:"
215
  msgstr "Ancho de miniaturas:"
216
 
217
- #: youtube-channel-gallery.php:319
218
  msgid "This field is used to assign the appropriate quality of thumbnail images in top and bottom alignments and to assign width to thumbnails in left and right alignments. If the quality of thumbnail images is not enough, insert a larger value. If you are unsure you can assign one of the following values​​: 120, 320, 480 or 640"
219
  msgstr "Este campo se utiliza para asignar la calidad de imagen más adecuada a las miniaturas en las alineaciones superior e inferior y para asignar ancho a las miniaturas en las alineaciones izquierda y derecha. Si la calidad de las imágenes de las miniaturas no es suficiente, introduzca un valor mayor. Si no está seguro de que valor usar puede asignar uno de los siguientes valores: 120, 320, 480 ó 640"
220
 
221
- #: youtube-channel-gallery.php:332
222
  msgid "Thumbnail columns:"
223
  msgstr "Columnas de las miniaturas:"
224
 
225
- #: youtube-channel-gallery.php:338
226
  msgid "Add \"nofollow\" attribute to links"
227
  msgstr "Añade el atributo \"nofollow\" a los enlaces"
228
 
229
- #: youtube-channel-gallery.php:339
230
  msgid "\"nofollow\" attribute provides a way for webmasters to tell search engines \"Don't follow this specific link.\""
231
  msgstr "El atributo \"nofollow\" ofrece a los webmasters un modo de indicar a los motores de búsqueda para no seguir un enlace."
232
 
233
- #: youtube-channel-gallery.php:344
 
 
 
 
 
234
  msgid "Show title or description"
235
  msgstr "Mostrar título y descripción"
236
 
237
- #: youtube-channel-gallery.php:351
238
  msgid "Show title"
239
  msgstr "Mostrar Título"
240
 
241
- #: youtube-channel-gallery.php:356
242
  msgid "Show description"
243
  msgstr "Mostrar descripción"
244
 
245
- #: youtube-channel-gallery.php:360
246
  msgid "Thumbnail alignment:"
247
  msgstr "Alineación de miniaturas:"
248
 
249
- #: youtube-channel-gallery.php:362
250
  msgid "Left"
251
  msgstr "Izquierda"
252
 
253
- #: youtube-channel-gallery.php:363
254
  msgid "Right"
255
  msgstr "Derecha"
256
 
257
- #: youtube-channel-gallery.php:364
258
  msgid "Top"
259
  msgstr "Arriba"
260
 
261
- #: youtube-channel-gallery.php:365
262
  msgid "Bottom"
263
  msgstr "Abajo"
264
 
265
- #: youtube-channel-gallery.php:370
266
  msgid "Description words number:"
267
  msgstr "Número de palabras en la descripción:"
268
 
269
- #: youtube-channel-gallery.php:372
270
  msgid "Set the maximum number of words that will be displayed of the description. This field is useful when the descriptions of videos in the gallery have different sizes."
271
  msgstr "Establece el número máximo de palabras que se mostrarán en la descripción. Este campo es útil cuando la descripción de los vídeos de la galería tienen diferentes tamaños."
272
 
273
- #: youtube-channel-gallery.php:392
274
  msgid "Link text:"
275
  msgstr "Texto del enlace"
276
 
277
- #: youtube-channel-gallery.php:398
278
  msgid "Show link to channel"
279
  msgstr "Mostrar enlace al canal"
280
 
281
- #: youtube-channel-gallery.php:403
282
- msgid "Open in a new window or tab"
283
- msgstr "Abrir en una ventana nueva o pestaña"
284
-
285
- #: youtube-channel-gallery.php:492
286
  msgid "Show more videos»"
287
  msgstr "Ver más vídeos»"
288
 
289
- #: youtube-channel-gallery.php:505
290
  msgid "There is no video to show."
291
  msgstr "No hay ningún vídeo para mostrar."
292
 
293
- #: youtube-channel-gallery.php:576
294
  #, php-format
295
  msgid "Message from server: %1$s. Check in YouTube if the id <a href=\"%2$s\" target=\"_blank\">%3$s</a> belongs to a %4$s. To locate the id of your %4$s check the <a href=\"http://wordpress.org/extend/plugins/youtube-channel-gallery/faq/\" target=\"_blank\">FAQ</a> of the plugin."
296
  msgstr "Mensaje del servidor: %1$s. Compruebe en YouTube si el id <a href=\"%2$s\" target=\"_blank\">%3$s</a> pertenece a un %4$s. Para localizar el id de la carpeta %4$s revise el <a href=\"http://wordpress.org/extend/plugins/youtube-channel-gallery/faq/\" target=\"_blank\"> FAQ </ a> del plugin."
297
 
298
  #~ msgid "Video width:"
299
  #~ msgstr "Ancho del vídeo:"
300
-
301
  #~ msgid "Show info (title, uploader)"
302
  #~ msgstr "Mostrar información (título, cargador)"
303
-
304
  #~ msgid "You must insert a valid YouTube user id."
305
  #~ msgstr "Debes introducir un id válido de usuario de YouTube."
306
-
307
  #~ msgid "You must insert a valid playlist id."
308
  #~ msgstr "Debes introducir un id válido de lista de reproducción de YouTube."
309
-
310
  #~ msgid "User's favorites"
311
  #~ msgstr "Favoritos del usuario"
312
-
313
  #~ msgid "Light:"
314
  #~ msgstr "Claro"
315
-
316
  #~ msgid "No post to duplicate has been supplied!"
317
  #~ msgstr "No se facilitó ninguna entrada a copiar"
318
-
319
  #~ msgid "Post creation failed, could not find original post:"
320
  #~ msgstr ""
321
  #~ "Creación realizada sin éxito, no ha sido posible encontrar la entrada "
322
  #~ "original:"
323
-
324
  #~ msgid "No page to duplicate has been supplied!"
325
  #~ msgstr "No se facilitó ninguna página a copiar"
326
-
327
  #~ msgid "Make a duplicate from this post"
328
  #~ msgstr "Crea una copia de esta entrada"
329
-
330
  #~ msgid "Duplicate"
331
  #~ msgstr "Duplicar"
332
-
333
  #~ msgid "Make a duplicate from this page"
334
  #~ msgstr "Crea una copia de esta página"
335
-
336
  #~ msgid "Copy to a new draft"
337
  #~ msgstr "Copia en un borrador nuevo"
338
-
339
  #~ msgid "Duplicate Post Options"
340
  #~ msgstr "Opciones"
341
-
342
  #~ msgid "Duplicate Post"
343
  #~ msgstr "Duplicate Post"
344
-
345
  #~ msgid "Copy post/page date also"
346
  #~ msgstr "Copiar también fecha del post o la página"
347
-
348
  #~ msgid ""
349
  #~ "Normally, the new draft has publication date set to current time: check "
350
  #~ "the box to copy the original post/page date"
@@ -352,54 +349,42 @@ msgstr "Mensaje del servidor: %1$s. Compruebe en YouTube si el id <a href=\"%2$s
352
  #~ "Normalmente se establece la fecha de publicación del nuevo borrador a la "
353
  #~ "fecha actual: compruebe la casilla para copiar la fecha original del post "
354
  #~ "o la página"
355
-
356
  #~ msgid "Do not copy these fields"
357
  #~ msgstr "No copiar estos campos"
358
-
359
  #~ msgid ""
360
  #~ "Comma-separated list of meta fields that must not be copied when cloning "
361
  #~ "a post/page"
362
  #~ msgstr ""
363
  #~ "Lista separada por comas de meta campos que no pueden ser copiados cuando "
364
  #~ "se clona una entrada/pagina."
365
-
366
  #~ msgid "Title prefix"
367
  #~ msgstr "Prefijo del titulo"
368
-
369
  #~ msgid ""
370
  #~ "Prefix to be added before the original title when cloning a post/page, e."
371
  #~ "g. \"Copy of\" (blank for no prefix)"
372
  #~ msgstr ""
373
  #~ "Prefijo a ser agregado antes del titulo original cuando se clona una "
374
  #~ "entrada/pagina, ej. \"Copia de\" (en blanco para no agregar prefijo)"
375
-
376
  #~ msgid "Minimum level to copy posts"
377
  #~ msgstr "Nivel mínimo para copiar posts"
378
-
379
  #~ msgid ""
380
  #~ "Warning: users will be able to copy all posts, even those of higher level "
381
  #~ "users"
382
  #~ msgstr ""
383
  #~ "Atención: los usuarios podrán copiar todos los posts, incluso aquellos de "
384
  #~ "usuarios de nivel más alto"
385
-
386
  #~ msgid "Save Changes"
387
  #~ msgstr "Guardar los cambios"
388
-
389
  #~ msgid "Donate"
390
  #~ msgstr "Hacer una donación"
391
-
392
  #~ msgid "Translate"
393
  #~ msgstr "Traducir"
394
-
395
  #~ msgid "http://www.lopo.it/duplicate-post-plugin/"
396
  #~ msgstr "Copy text \t http://www.lopo.it/duplicate-post-plugin/"
397
-
398
  #~ msgid "Creates a copy of a post."
399
  #~ msgstr "Crear una copia de las entradas."
400
-
401
  #~ msgid "Enrico Battocchi"
402
  #~ msgstr "Enrico Battocchi"
403
-
404
  #~ msgid "http://www.lopo.it"
405
  #~ msgstr "http://www.lopo.it"
 
7
  msgstr ""
8
  "Project-Id-Version: youtube-channel-gallery\n"
9
  "Report-Msgid-Bugs-To: \n"
10
+ "POT-Creation-Date: 2013-05-21 17:37+0100\n"
11
+ "PO-Revision-Date: 2013-05-21 17:37+0100\n"
12
+ "Last-Translator: Javier <javierpose@gmail.com>\n"
13
  "Language-Team: PoseLab <javierpose@gmail.com>\n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=UTF-8\n"
31
  msgid "Show a youtube video and a gallery of thumbnails for a youtube channel"
32
  msgstr "Muestra un vídeo y una galería de miniaturas de una canal de Youtube "
33
 
34
+ #: youtube-channel-gallery.php:175
35
  msgid "Title:"
36
  msgstr "Título:"
37
 
38
+ #: youtube-channel-gallery.php:181
39
  msgid "Feed"
40
  msgstr "Feed"
41
 
42
+ #: youtube-channel-gallery.php:182
43
  msgid "Player"
44
  msgstr "Reproductor"
45
 
46
+ #: youtube-channel-gallery.php:183
47
  msgid "Thumbnails"
48
  msgstr "Miniaturas"
49
 
50
+ #: youtube-channel-gallery.php:184
51
  msgid "Link"
52
  msgstr "Enlace"
53
 
54
+ #: youtube-channel-gallery.php:197
55
  msgid "Video feed type:"
56
  msgstr "Tipo de feed de vídeo:"
57
 
58
+ #: youtube-channel-gallery.php:199
59
  msgid "Uploaded by a user"
60
  msgstr "Subidos por el usuario"
61
 
62
+ #: youtube-channel-gallery.php:201
63
  msgid "Playlist"
64
  msgstr "Lista de reproducción"
65
 
66
+ #: youtube-channel-gallery.php:206
67
  msgid "YouTube user id:"
68
  msgstr "Id de usuario de Youtube:"
69
 
70
+ #: youtube-channel-gallery.php:207
71
  msgid "YouTube playlist id:"
72
  msgstr "Id de lista de reproducción de YouTube:"
73
 
74
+ #: youtube-channel-gallery.php:212
75
  msgid "Playlist order:"
76
  msgstr "Orden de lista de reproducción:"
77
 
78
+ #: youtube-channel-gallery.php:214
79
  msgid "Ascending Order"
80
  msgstr "Ascendente"
81
 
82
+ #: youtube-channel-gallery.php:215
83
  msgid "Descending Order"
84
  msgstr "Descendente"
85
 
86
+ #: youtube-channel-gallery.php:220
87
  msgid "Cache time (hours):"
88
  msgstr "Tiempo de cache (horas):"
89
 
90
+ #: youtube-channel-gallery.php:222
91
  msgid "Hours that RSS data is saved in database, to not make a request every time the page is displayed. Assign this value according to how often you upgrade your playlist in YouTube."
92
  msgstr "Horas que los datos del RSS se guardan en la base de datos, para no hacer una solicitud cada vez que se muestra la página. Asigna este valor en función de la frecuencia con que actualizas la lista de reproducción en YouTube."
93
 
94
+ #: youtube-channel-gallery.php:227
95
  msgid "Activate cache"
96
  msgstr "Activar caché"
97
 
98
+ #: youtube-channel-gallery.php:228
99
  msgid "If you disable this field the cache will be deleted and will not be used. This is useful to refresh immediately the YouTube RSS used by the plugin. Reenable the cache when the gallery shows the changes you made in your youtube account."
100
  msgstr "Si se deshabilita este campo la caché se borrará y no será utilizada. Esto es útil para actualizar inmediatamente el RSS de YouTube usado por el plugin. Vuelve a habilitar la caché cuando la galería muestre los cambios que ha realizado en su cuenta de YouTube."
101
 
102
+ #: youtube-channel-gallery.php:243
103
+ msgid "Player:"
104
+ msgstr "Reproductor:"
105
+
106
+ #: youtube-channel-gallery.php:245
107
+ msgid "Without player"
108
+ msgstr "Sin reproductor"
109
+
110
+ #: youtube-channel-gallery.php:246
111
+ msgid "Show player above thumbnails"
112
+ msgstr "Mostrar reproductor sobre miniaturas"
113
+
114
+ #: youtube-channel-gallery.php:252
115
+ #: youtube-channel-gallery.php:335
116
  msgid "Aspect ratio:"
117
  msgstr "Relación de aspecto:"
118
 
119
+ #: youtube-channel-gallery.php:254
120
+ #: youtube-channel-gallery.php:337
121
  msgid "Standard (4x3)"
122
  msgstr "Estándar (4x3)"
123
 
124
+ #: youtube-channel-gallery.php:255
125
+ #: youtube-channel-gallery.php:338
126
  msgid "Widescreen (16x9)"
127
  msgstr "Panorámico (16x9)"
128
 
129
+ #: youtube-channel-gallery.php:260
130
  msgid "Theme:"
131
  msgstr "Tema:"
132
 
133
+ #: youtube-channel-gallery.php:262
134
  msgid "Dark"
135
  msgstr "Oscuro"
136
 
137
+ #: youtube-channel-gallery.php:263
138
  msgid "Light"
139
  msgstr "Claro"
140
 
141
+ #: youtube-channel-gallery.php:268
142
  msgid "Progress bar color:"
143
  msgstr "Color de barra de progreso:"
144
 
145
+ #: youtube-channel-gallery.php:270
146
  msgid "Red"
147
  msgstr "Rojo"
148
 
149
+ #: youtube-channel-gallery.php:271
150
  msgid "White"
151
  msgstr "Blanco"
152
 
153
+ #: youtube-channel-gallery.php:276
154
  msgid "Video quality:"
155
  msgstr "Calidad del vídeo:"
156
 
157
+ #: youtube-channel-gallery.php:278
158
  msgid "default"
159
  msgstr "por defecto"
160
 
161
+ #: youtube-channel-gallery.php:279
162
  msgid "highres"
163
  msgstr "alta resolución"
164
 
165
+ #: youtube-channel-gallery.php:280
166
  msgid "hd1080"
167
  msgstr "hd1080"
168
 
169
+ #: youtube-channel-gallery.php:281
170
  msgid "hd720"
171
  msgstr "hd720"
172
 
173
+ #: youtube-channel-gallery.php:282
174
  msgid "large"
175
  msgstr "largo"
176
 
177
+ #: youtube-channel-gallery.php:283
178
  msgid "medium"
179
  msgstr "mediano"
180
 
181
+ #: youtube-channel-gallery.php:284
182
  msgid "small"
183
  msgstr "pequeño"
184
 
185
+ #: youtube-channel-gallery.php:286
186
  msgid "Default value enables YouTube to select the most appropriate playback quality. If you select a quality level that is not available for the video, then the quality will be set to the next lowest level that is available."
187
  msgstr "El valor predeterminado permite a YouTube seleccionar la calidad de reproducción más adecuada. Si selecciona un nivel de calidad que no está disponible para el vídeo, la calidad se ajustará al siguiente nivel más bajo que este disponible."
188
 
189
+ #: youtube-channel-gallery.php:290
190
  msgid "Autoplay"
191
  msgstr "Autoplay"
192
 
193
+ #: youtube-channel-gallery.php:295
194
  msgid "Show YouTube logo"
195
  msgstr "Mostrar el logotipo de YouTube"
196
 
197
+ #: youtube-channel-gallery.php:296
198
  msgid "Activate this field to show the YouTube logo in the control bar. Setting the color parameter to white will show the YouTube logo in the control bar."
199
  msgstr "Activa este campo para mostrar el logotipo de YouTube en la barra de control. Un ajuste del parámetro de color a blanco mostrará el logotipo de YouTube en la barra de control."
200
 
201
+ #: youtube-channel-gallery.php:301
202
  msgid "Show related videos"
203
  msgstr "Mostrar los vídeos relacionados"
204
 
205
+ #: youtube-channel-gallery.php:302
206
  msgid "Activate this field to show related videos when playback of the video ends."
207
  msgstr "Activa este campo para mostrar videos relacionados cuando termine la reproducción del vídeo."
208
 
209
+ #: youtube-channel-gallery.php:307
210
  msgid "Show info"
211
  msgstr "Mostrar información"
212
 
213
+ #: youtube-channel-gallery.php:308
214
  msgid "Activate this field to display information like the video title and uploader before the video starts playing."
215
  msgstr "Active este campo para mostrar información como el título del vídeo y nombre de usuario antes de que el vídeo comience a reproducirse."
216
 
217
+ #: youtube-channel-gallery.php:322
218
  msgid "Number of videos to show:"
219
  msgstr "Número de vídeos a mostrar:"
220
 
221
+ #: youtube-channel-gallery.php:324
222
  msgid "The plugin can display a maximum of 50 videos. This limitation will change in a future release."
223
  msgstr "El plugin puede mostrar un máximo de 50 vídeos. Esta limitación cambiará en una futura versión."
224
 
225
+ #: youtube-channel-gallery.php:328
226
  msgid "Thumbnail width:"
227
  msgstr "Ancho de miniaturas:"
228
 
229
+ #: youtube-channel-gallery.php:330
230
  msgid "This field is used to assign the appropriate quality of thumbnail images in top and bottom alignments and to assign width to thumbnails in left and right alignments. If the quality of thumbnail images is not enough, insert a larger value. If you are unsure you can assign one of the following values​​: 120, 320, 480 or 640"
231
  msgstr "Este campo se utiliza para asignar la calidad de imagen más adecuada a las miniaturas en las alineaciones superior e inferior y para asignar ancho a las miniaturas en las alineaciones izquierda y derecha. Si la calidad de las imágenes de las miniaturas no es suficiente, introduzca un valor mayor. Si no está seguro de que valor usar puede asignar uno de los siguientes valores: 120, 320, 480 ó 640"
232
 
233
+ #: youtube-channel-gallery.php:343
234
  msgid "Thumbnail columns:"
235
  msgstr "Columnas de las miniaturas:"
236
 
237
+ #: youtube-channel-gallery.php:349
238
  msgid "Add \"nofollow\" attribute to links"
239
  msgstr "Añade el atributo \"nofollow\" a los enlaces"
240
 
241
+ #: youtube-channel-gallery.php:350
242
  msgid "\"nofollow\" attribute provides a way for webmasters to tell search engines \"Don't follow this specific link.\""
243
  msgstr "El atributo \"nofollow\" ofrece a los webmasters un modo de indicar a los motores de búsqueda para no seguir un enlace."
244
 
245
+ #: youtube-channel-gallery.php:356
246
+ #: youtube-channel-gallery.php:421
247
+ msgid "Open in a new window or tab"
248
+ msgstr "Abrir en una ventana nueva o pestaña"
249
+
250
+ #: youtube-channel-gallery.php:362
251
  msgid "Show title or description"
252
  msgstr "Mostrar título y descripción"
253
 
254
+ #: youtube-channel-gallery.php:369
255
  msgid "Show title"
256
  msgstr "Mostrar Título"
257
 
258
+ #: youtube-channel-gallery.php:374
259
  msgid "Show description"
260
  msgstr "Mostrar descripción"
261
 
262
+ #: youtube-channel-gallery.php:378
263
  msgid "Thumbnail alignment:"
264
  msgstr "Alineación de miniaturas:"
265
 
266
+ #: youtube-channel-gallery.php:380
267
  msgid "Left"
268
  msgstr "Izquierda"
269
 
270
+ #: youtube-channel-gallery.php:381
271
  msgid "Right"
272
  msgstr "Derecha"
273
 
274
+ #: youtube-channel-gallery.php:382
275
  msgid "Top"
276
  msgstr "Arriba"
277
 
278
+ #: youtube-channel-gallery.php:383
279
  msgid "Bottom"
280
  msgstr "Abajo"
281
 
282
+ #: youtube-channel-gallery.php:388
283
  msgid "Description words number:"
284
  msgstr "Número de palabras en la descripción:"
285
 
286
+ #: youtube-channel-gallery.php:390
287
  msgid "Set the maximum number of words that will be displayed of the description. This field is useful when the descriptions of videos in the gallery have different sizes."
288
  msgstr "Establece el número máximo de palabras que se mostrarán en la descripción. Este campo es útil cuando la descripción de los vídeos de la galería tienen diferentes tamaños."
289
 
290
+ #: youtube-channel-gallery.php:410
291
  msgid "Link text:"
292
  msgstr "Texto del enlace"
293
 
294
+ #: youtube-channel-gallery.php:416
295
  msgid "Show link to channel"
296
  msgstr "Mostrar enlace al canal"
297
 
298
+ #: youtube-channel-gallery.php:517
 
 
 
 
299
  msgid "Show more videos»"
300
  msgstr "Ver más vídeos»"
301
 
302
+ #: youtube-channel-gallery.php:530
303
  msgid "There is no video to show."
304
  msgstr "No hay ningún vídeo para mostrar."
305
 
306
+ #: youtube-channel-gallery.php:601
307
  #, php-format
308
  msgid "Message from server: %1$s. Check in YouTube if the id <a href=\"%2$s\" target=\"_blank\">%3$s</a> belongs to a %4$s. To locate the id of your %4$s check the <a href=\"http://wordpress.org/extend/plugins/youtube-channel-gallery/faq/\" target=\"_blank\">FAQ</a> of the plugin."
309
  msgstr "Mensaje del servidor: %1$s. Compruebe en YouTube si el id <a href=\"%2$s\" target=\"_blank\">%3$s</a> pertenece a un %4$s. Para localizar el id de la carpeta %4$s revise el <a href=\"http://wordpress.org/extend/plugins/youtube-channel-gallery/faq/\" target=\"_blank\"> FAQ </ a> del plugin."
310
 
311
  #~ msgid "Video width:"
312
  #~ msgstr "Ancho del vídeo:"
 
313
  #~ msgid "Show info (title, uploader)"
314
  #~ msgstr "Mostrar información (título, cargador)"
 
315
  #~ msgid "You must insert a valid YouTube user id."
316
  #~ msgstr "Debes introducir un id válido de usuario de YouTube."
 
317
  #~ msgid "You must insert a valid playlist id."
318
  #~ msgstr "Debes introducir un id válido de lista de reproducción de YouTube."
 
319
  #~ msgid "User's favorites"
320
  #~ msgstr "Favoritos del usuario"
 
321
  #~ msgid "Light:"
322
  #~ msgstr "Claro"
 
323
  #~ msgid "No post to duplicate has been supplied!"
324
  #~ msgstr "No se facilitó ninguna entrada a copiar"
 
325
  #~ msgid "Post creation failed, could not find original post:"
326
  #~ msgstr ""
327
  #~ "Creación realizada sin éxito, no ha sido posible encontrar la entrada "
328
  #~ "original:"
 
329
  #~ msgid "No page to duplicate has been supplied!"
330
  #~ msgstr "No se facilitó ninguna página a copiar"
 
331
  #~ msgid "Make a duplicate from this post"
332
  #~ msgstr "Crea una copia de esta entrada"
 
333
  #~ msgid "Duplicate"
334
  #~ msgstr "Duplicar"
 
335
  #~ msgid "Make a duplicate from this page"
336
  #~ msgstr "Crea una copia de esta página"
 
337
  #~ msgid "Copy to a new draft"
338
  #~ msgstr "Copia en un borrador nuevo"
 
339
  #~ msgid "Duplicate Post Options"
340
  #~ msgstr "Opciones"
 
341
  #~ msgid "Duplicate Post"
342
  #~ msgstr "Duplicate Post"
 
343
  #~ msgid "Copy post/page date also"
344
  #~ msgstr "Copiar también fecha del post o la página"
 
345
  #~ msgid ""
346
  #~ "Normally, the new draft has publication date set to current time: check "
347
  #~ "the box to copy the original post/page date"
349
  #~ "Normalmente se establece la fecha de publicación del nuevo borrador a la "
350
  #~ "fecha actual: compruebe la casilla para copiar la fecha original del post "
351
  #~ "o la página"
 
352
  #~ msgid "Do not copy these fields"
353
  #~ msgstr "No copiar estos campos"
 
354
  #~ msgid ""
355
  #~ "Comma-separated list of meta fields that must not be copied when cloning "
356
  #~ "a post/page"
357
  #~ msgstr ""
358
  #~ "Lista separada por comas de meta campos que no pueden ser copiados cuando "
359
  #~ "se clona una entrada/pagina."
 
360
  #~ msgid "Title prefix"
361
  #~ msgstr "Prefijo del titulo"
 
362
  #~ msgid ""
363
  #~ "Prefix to be added before the original title when cloning a post/page, e."
364
  #~ "g. \"Copy of\" (blank for no prefix)"
365
  #~ msgstr ""
366
  #~ "Prefijo a ser agregado antes del titulo original cuando se clona una "
367
  #~ "entrada/pagina, ej. \"Copia de\" (en blanco para no agregar prefijo)"
 
368
  #~ msgid "Minimum level to copy posts"
369
  #~ msgstr "Nivel mínimo para copiar posts"
 
370
  #~ msgid ""
371
  #~ "Warning: users will be able to copy all posts, even those of higher level "
372
  #~ "users"
373
  #~ msgstr ""
374
  #~ "Atención: los usuarios podrán copiar todos los posts, incluso aquellos de "
375
  #~ "usuarios de nivel más alto"
 
376
  #~ msgid "Save Changes"
377
  #~ msgstr "Guardar los cambios"
 
378
  #~ msgid "Donate"
379
  #~ msgstr "Hacer una donación"
 
380
  #~ msgid "Translate"
381
  #~ msgstr "Traducir"
 
382
  #~ msgid "http://www.lopo.it/duplicate-post-plugin/"
383
  #~ msgstr "Copy text \t http://www.lopo.it/duplicate-post-plugin/"
 
384
  #~ msgid "Creates a copy of a post."
385
  #~ msgstr "Crear una copia de las entradas."
 
386
  #~ msgid "Enrico Battocchi"
387
  #~ msgstr "Enrico Battocchi"
 
388
  #~ msgid "http://www.lopo.it"
389
  #~ msgstr "http://www.lopo.it"
390
+
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://poselab.com/
4
  Tags: widget, gallery, youtube, channel, user, sidebar, video, youtube playlist, html5, iframe, Youtube channel, youtube videos
5
  Requires at least: 2.8
6
  Tested up to: 3.5.1
7
- Stable tag: 1.8.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -50,6 +50,7 @@ Description of the different fields of the plugin:
50
 
51
  **Player tab:**
52
 
 
53
  * **Aspect ratio:** indicates the proportions of the player, standard (4:3) or widescreen (16:9) format. Shortcode attribute:** ratio; values: 4x3 (default) or 16x9. (Optional).
54
  * **Theme:** display player controls (like a 'play' button or volume control) within a dark or light control bar. Shortcode attribute: theme; values: dark (default) or light. (Optional).
55
  * **Progress bar color:** specifies the color that will be used in the player's video progress bar to highlight the amount of the video that the viewer has already seen. Shortcode attribute: color; values: red (default) or white. (Optional).
@@ -66,6 +67,7 @@ Description of the different fields of the plugin:
66
  * **Aspect ratio:** indicates the proportions of the thumbnails, standard (4:3) or widescreen (16:9) format. Shortcode attribute: thumbratio; values: 4x3 (default) or 16x9. (Optional).
67
  * **Thumbnail columns:** it allows to control the number of columns in which the thumbnails are distributed. Shortcode attribute: thumbcolumns; value: Number. (Optional).
68
  * **Add "nofollow" attribute to links:** "nofollow" attribute provides a way for webmasters to tell search engines "Don't follow this specific link". Shortcode attribute: nofollow; values: 0 (default) or 1. (Optional).
 
69
  * **Show title:** it displays the title of the thumbnail with a link to play the video in the player. Shortcode attribute: title; values: 0 (default) or 1. (Optional).
70
  * **Show description:** it shows the description of the thumbnail with the number of specified words. Shortcode attribute: description; values: 0 (default) or 1. (Optional).
71
  * **Thumbnail alignment:** it defines the alignment of the thumbnail respect to its description and title. Shortcode attribute: thumbnail_alignment; values: left (default), right, top or bottom. (Optional).
@@ -132,6 +134,14 @@ If another plugin or your theme throws a javascript error before Youtube Channel
132
 
133
  == Changelog ==
134
 
 
 
 
 
 
 
 
 
135
  = 1.8.4 =
136
  * Changes in CSS.
137
  * Added option to add "nofollow" attribute to links.
4
  Tags: widget, gallery, youtube, channel, user, sidebar, video, youtube playlist, html5, iframe, Youtube channel, youtube videos
5
  Requires at least: 2.8
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.8.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
50
 
51
  **Player tab:**
52
 
53
+ * **Player:** Select whether you want to display the gallery with or without player. Shortcode attribute: player; values: 0 or 1 (default). (Optional).
54
  * **Aspect ratio:** indicates the proportions of the player, standard (4:3) or widescreen (16:9) format. Shortcode attribute:** ratio; values: 4x3 (default) or 16x9. (Optional).
55
  * **Theme:** display player controls (like a 'play' button or volume control) within a dark or light control bar. Shortcode attribute: theme; values: dark (default) or light. (Optional).
56
  * **Progress bar color:** specifies the color that will be used in the player's video progress bar to highlight the amount of the video that the viewer has already seen. Shortcode attribute: color; values: red (default) or white. (Optional).
67
  * **Aspect ratio:** indicates the proportions of the thumbnails, standard (4:3) or widescreen (16:9) format. Shortcode attribute: thumbratio; values: 4x3 (default) or 16x9. (Optional).
68
  * **Thumbnail columns:** it allows to control the number of columns in which the thumbnails are distributed. Shortcode attribute: thumbcolumns; value: Number. (Optional).
69
  * **Add "nofollow" attribute to links:** "nofollow" attribute provides a way for webmasters to tell search engines "Don't follow this specific link". Shortcode attribute: nofollow; values: 0 (default) or 1. (Optional).
70
+ * **Open in a new window or tab:** this option only appears if you select to use the gallery without player. Thumbnails links will open in a new window or tab. Shortcode attribute: thumb_window; values: 0 (default) or 1. (Optional).
71
  * **Show title:** it displays the title of the thumbnail with a link to play the video in the player. Shortcode attribute: title; values: 0 (default) or 1. (Optional).
72
  * **Show description:** it shows the description of the thumbnail with the number of specified words. Shortcode attribute: description; values: 0 (default) or 1. (Optional).
73
  * **Thumbnail alignment:** it defines the alignment of the thumbnail respect to its description and title. Shortcode attribute: thumbnail_alignment; values: left (default), right, top or bottom. (Optional).
134
 
135
  == Changelog ==
136
 
137
+ = 1.8.5 =
138
+ * Added option to show only thumbnails without player.
139
+ * Added option to add target="_blank" to thumbnails if the option without player is selected.
140
+ * Control 50 thumbnails limit.
141
+ * Changes in CSS.
142
+ * Changes in admin CSS and JS.
143
+ * Update language file.
144
+
145
  = 1.8.4 =
146
  * Changes in CSS.
147
  * Added option to add "nofollow" attribute to links.
styles.css CHANGED
@@ -1,7 +1,7 @@
1
  /*------------------------------------------------------------
2
  Plugin Name: Youtube Channel Gallery
3
  Plugin URI: http://www.poselab.com/
4
- Version: 1.8.4
5
  Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
  ------------------------------------------------------------*/
7
  /*plugin wrapper*/
1
  /*------------------------------------------------------------
2
  Plugin Name: Youtube Channel Gallery
3
  Plugin URI: http://www.poselab.com/
4
+ Version: 1.8.5
5
  Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
  ------------------------------------------------------------*/
7
  /*plugin wrapper*/
templates/player.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ // Load js
5
+ $this->register_scripts();
6
+
7
+ //player
8
+ //------------
9
+
10
+ // to control the width of the
11
+ $content = '<div class="ytcplayer-fixwidthwrapper">';
12
+ $content .= '<div class="ytcplayer-wrapper ytc-player' . $ytchag_ratio . '">';
13
+
14
+ //iframe
15
+ $content .= '<iframe id="ytcplayer' . $plugincount . '" class="ytcplayer" allowfullscreen src="http://www.youtube.com/embed/' . $youtubeid . '?version=3' . $ytchag_theme . $ytchag_color . $ytchag_autoplay. $ytchag_modestbranding . $ytchag_rel . $ytchag_showinfo .'&enablejsapi=1&wmode=transparent" frameborder="0"></iframe>';
16
+ $content .= '</div></div>';
youtube-channel-gallery.php CHANGED
@@ -5,7 +5,7 @@
5
  Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
  Author: Javier Gómez Pose
7
  Author URI: http://www.poselab.com/
8
- Version: 1.8.4
9
  License: GPL2
10
 
11
  Copyright 2013 Javier Gómez Pose (email : javierpose@gmail.com)
@@ -47,7 +47,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
47
 
48
  array( 'classname' => 'youtubechannelgallery ytccf', 'description' => __( 'Show a youtube video and a gallery of thumbnails for a youtube channel', 'youtube-channel-gallery' ), ), // Args
49
 
50
- array( 'width' => 260)
51
  );
52
  }
53
 
@@ -58,9 +58,6 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
58
  */
59
  public function widget( $args, $instance ) {
60
 
61
- // Load JavaScript and stylesheets
62
- $this->register_scripts_and_styles();
63
-
64
  extract( $args );
65
  $title = apply_filters( 'widget_title', $instance['title'] );
66
 
@@ -89,6 +86,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
89
  $instance['ytchag_cache'] = strip_tags( $new_instance['ytchag_cache'] );
90
 
91
  // Player options
 
92
  $instance['ytchag_ratio'] = strip_tags( $new_instance['ytchag_ratio'] );
93
  $instance['ytchag_theme'] = strip_tags( $new_instance['ytchag_theme'] );
94
  $instance['ytchag_color'] = strip_tags( $new_instance['ytchag_color'] );
@@ -104,6 +102,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
104
  $instance['ytchag_thumb_ratio'] = strip_tags( $new_instance['ytchag_thumb_ratio'] );
105
  $instance['ytchag_thumb_columns'] = strip_tags( $new_instance['ytchag_thumb_columns'] );
106
  $instance['ytchag_nofollow'] = strip_tags( $new_instance['ytchag_nofollow'] );
 
107
 
108
  $instance['ytchag_title'] = strip_tags( $new_instance['ytchag_title'] );
109
  $instance['ytchag_description'] = strip_tags( $new_instance['ytchag_description'] );
@@ -133,6 +132,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
133
  'ytchag_cache' => '1',
134
 
135
  // Player options
 
136
  'ytchag_ratio' => '4x3',
137
  'ytchag_theme' => 'dark',
138
  'ytchag_color' => 'red',
@@ -148,6 +148,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
148
  'ytchag_thumb_ratio' => '4x3',
149
  'ytchag_thumb_columns' => '3',
150
  'ytchag_nofollow' => '',
 
151
 
152
  'ytchag_title' => '',
153
  'ytchag_description' => '',
@@ -239,63 +240,73 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
239
  <div id="tabs-<?php echo $this->id; ?>-2" class="ytchgtabs-content tabs-2">
240
 
241
  <p>
242
- <label for="<?php echo $this->get_field_id( 'ytchag_ratio' ); ?>"><?php _e( 'Aspect ratio:', 'youtube-channel-gallery' ); ?></label>
243
- <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_ratio' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_ratio' ); ?>">
244
- <option value="4x3"<?php selected( $instance['ytchag_ratio'], '4x3' ); ?>><?php _e( 'Standard (4x3)', 'youtube-channel-gallery' ); ?></option>
245
- <option value="16x9"<?php selected( $instance['ytchag_ratio'], '16x9' ); ?>><?php _e( 'Widescreen (16x9)', 'youtube-channel-gallery' ); ?></option>
246
- </select>
247
- </p>
248
-
249
- <p>
250
- <label for="<?php echo $this->get_field_id( 'ytchag_theme' ); ?>"><?php _e( 'Theme:', 'youtube-channel-gallery' ); ?></label>
251
- <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_theme' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_theme' ); ?>">
252
- <option value="dark"<?php selected( $instance['ytchag_theme'], 'dark' ); ?>><?php _e( 'Dark', 'youtube-channel-gallery' ); ?></option>
253
- <option value="light"<?php selected( $instance['ytchag_theme'], 'light' ); ?>><?php _e( 'Light', 'youtube-channel-gallery' ); ?></option>
254
- </select>
255
- </p>
256
-
257
- <p>
258
- <label for="<?php echo $this->get_field_id( 'ytchag_color' ); ?>"><?php _e( 'Progress bar color:', 'youtube-channel-gallery' ); ?></label>
259
- <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_color' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_color' ); ?>">
260
- <option value="red"<?php selected( $instance['ytchag_color'], 'red' ); ?>><?php _e( 'Red', 'youtube-channel-gallery' ); ?></option>
261
- <option value="white"<?php selected( $instance['ytchag_color'], 'white' ); ?>><?php _e( 'White', 'youtube-channel-gallery' ); ?></option>
262
  </select>
263
  </p>
264
 
265
- <p>
266
- <label for="<?php echo $this->get_field_id( 'ytchag_quality' ); ?>"><?php _e( 'Video quality:', 'youtube-channel-gallery' ); ?></label>
267
- <select class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_quality' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_quality' ); ?>">
268
- <option value="default"<?php selected( $instance['ytchag_quality'], 'default' ); ?>><?php _e( 'default', 'youtube-channel-gallery' ); ?></option>
269
- <option value="highres"<?php selected( $instance['ytchag_quality'], 'highres' ); ?>><?php _e( 'highres', 'youtube-channel-gallery' ); ?></option>
270
- <option value="hd1080"<?php selected( $instance['ytchag_quality'], 'hd1080' ); ?>><?php _e( 'hd1080', 'youtube-channel-gallery' ); ?></option>
271
- <option value="hd720"<?php selected( $instance['ytchag_quality'], 'hd720' ); ?>><?php _e( 'hd720', 'youtube-channel-gallery' ); ?></option>
272
- <option value="large"<?php selected( $instance['ytchag_quality'], 'large' ); ?>><?php _e( 'large', 'youtube-channel-gallery' ); ?></option>
273
- <option value="medium"<?php selected( $instance['ytchag_quality'], 'medium' ); ?>><?php _e( 'medium', 'youtube-channel-gallery' ); ?></option>
274
- <option value="small"<?php selected( $instance['ytchag_quality'], 'small' ); ?>><?php _e( 'small', 'youtube-channel-gallery' ); ?></option>
275
- </select>
276
- <span class="ytchag_info" title="<?php _e( 'Default value enables YouTube to select the most appropriate playback quality. If you select a quality level that is not available for the video, then the quality will be set to the next lowest level that is available.', 'youtube-channel-gallery' ); ?>">?</span>
277
- </p>
278
-
279
- <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_autoplay'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_autoplay' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_autoplay' ); ?>" />
280
- <label for="<?php echo $this->get_field_id( 'ytchag_autoplay' ); ?>"><?php _e( 'Autoplay', 'youtube-channel-gallery' ); ?></label>
281
-
282
- <br>
283
-
284
- <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_modestbranding'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_modestbranding' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_modestbranding' ); ?>" />
285
- <label for="<?php echo $this->get_field_id( 'ytchag_modestbranding' ); ?>"><?php _e( 'Show YouTube logo', 'youtube-channel-gallery' ); ?></label>
286
- <span class="ytchag_info" title="<?php _e( 'Activate this field to show the YouTube logo in the control bar. Setting the color parameter to white will show the YouTube logo in the control bar.', 'youtube-channel-gallery' ); ?>">?</span>
287
-
288
- <br>
289
-
290
- <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_rel'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_rel' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_rel' ); ?>" />
291
- <label for="<?php echo $this->get_field_id( 'ytchag_rel' ); ?>"><?php _e( 'Show related videos', 'youtube-channel-gallery' ); ?></label>
292
- <span class="ytchag_info" title="<?php _e( 'Activate this field to show related videos when playback of the video ends.', 'youtube-channel-gallery' ); ?>">?</span>
293
-
294
- <br>
295
-
296
- <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_showinfo'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_showinfo' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_showinfo' ); ?>" />
297
- <label for="<?php echo $this->get_field_id( 'ytchag_showinfo' ); ?>"><?php _e( 'Show info', 'youtube-channel-gallery' ); ?></label>
298
- <span class="ytchag_info" title="<?php _e( 'Activate this field to display information like the video title and uploader before the video starts playing.', 'youtube-channel-gallery' ); ?>">?</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
 
300
  </div>
301
 
@@ -338,13 +349,20 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
338
  <label for="<?php echo $this->get_field_id( 'ytchag_nofollow' ); ?>"><?php _e( 'Add "nofollow" attribute to links', 'youtube-channel-gallery' ); ?></label>
339
  <span class="ytchag_info" title="<?php _e( '"nofollow" attribute provides a way for webmasters to tell search engines "Don\'t follow this specific link."', 'youtube-channel-gallery' ); ?>">?</span>
340
 
 
 
 
 
 
 
 
341
  <p>
342
  <fieldset class="ytchg-field-tit-desc">
343
  <legend class="ytchg-tit-desc">
344
  <a href="#"><?php _e( 'Show title or description', 'youtube-channel-gallery' ); ?></a>
345
  </legend>
346
 
347
- <div class="ytchg-title-and-description">
348
 
349
  <p>
350
  <input class="checkbox ytchg-tit" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_title'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_title' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_title' ); ?>" />
@@ -430,6 +448,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
430
  $ytchag_cache = apply_filters( 'ytchag_cache', $instance['ytchag_cache'] );
431
 
432
  // Player options
 
433
  $ytchag_ratio = apply_filters( 'ytchag_ratio', $instance['ytchag_ratio'] );
434
  $ytchag_theme = apply_filters( 'ytchag_theme', $instance['ytchag_theme'] );
435
  $ytchag_color = apply_filters( 'ytchag_color', $instance['ytchag_color'] );
@@ -445,6 +464,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
445
  $ytchag_thumb_ratio = apply_filters( 'ytchag_thumb_ratio', $instance['ytchag_thumb_ratio'] );
446
  $ytchag_thumb_columns = apply_filters( 'ytchag_thumb_columns', $instance['ytchag_thumb_columns'] );
447
  $ytchag_nofollow = apply_filters( 'ytchag_nofollow', $instance['ytchag_nofollow'] );
 
448
 
449
  $ytchag_title = apply_filters( 'ytchag_title', $instance['ytchag_title'] );
450
  $ytchag_description = apply_filters( 'ytchag_description', $instance['ytchag_description'] );
@@ -467,6 +487,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
467
  $ytchag_feed_order = ( $ytchag_feed_order ) ? $ytchag_feed_order : 'asc'; //default ascending
468
 
469
  // Player options
 
470
  $ytchag_theme = ( $ytchag_theme ) ? '&theme='. $ytchag_theme : ''; //default dark
471
  $ytchag_color = ( $ytchag_color ) ? '&color='. $ytchag_color : ''; //default red
472
  $ytchag_quality = ( $ytchag_quality ) ? $ytchag_quality : 'default'; //default default
@@ -477,9 +498,13 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
477
 
478
  // Thumbnail options
479
  $ytchag_maxitems = ( $ytchag_maxitems ) ? $ytchag_maxitems : 9;
 
 
 
480
  $ytchag_thumb_width = ( $ytchag_thumb_width ) ? $ytchag_thumb_width : 85;
481
  $ytchag_thumb_columns = ( ( $ytchag_thumb_columns ) || ( $ytchag_thumb_columns != 0 ) ) ? $ytchag_thumb_columns : 0;
482
  $ytchag_nofollow = ( $ytchag_nofollow ) ? ' rel="nofollow"' : '';
 
483
 
484
  //title and desc
485
  $ytchag_title = ( $ytchag_title ) ? $ytchag_title : 0;
@@ -522,11 +547,11 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
522
  //HTTP API
523
 
524
  $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_maxitems );
525
-
526
  $videos_result = $this->get_rss_data ( $ytchag_cache, $transientId, $ytchag_rss_url, $ytchag_cache_time );
527
-
528
  $rss = simplexml_load_string( $videos_result['body'] );
529
-
530
  $response_code = wp_remote_retrieve_response_code( $videos_result );
531
  $response_message = wp_remote_retrieve_response_message( $videos_result );
532
  $entries = $rss;
@@ -546,24 +571,24 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
546
  }
547
 
548
  $ytchag_rss_url = $youtube_feed_url . '/playlists/' . $ytchag_user . '?v=2&prettyprint=true&start-index=' . $startindex . '&max-results=' . $ytchag_maxitems;// . '&orderby=reversedPosition';
549
-
550
  $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_feed_order . $ytchag_maxitems );
551
 
552
  $videos_result = $this->get_rss_data ( $ytchag_cache, $transientId, $ytchag_rss_url, $ytchag_cache_time );
553
  $rss = simplexml_load_string( $videos_result['body'] );
554
-
555
  $response_code = wp_remote_retrieve_response_code( $videos_result );
556
  $response_message = wp_remote_retrieve_response_message( $videos_result );
557
 
558
  // parameter orderby=reversedPosition of Google Data API is not working, so I will use this to reverse the order
559
  //get entries
560
-
561
  $new_rss = new stdClass();
562
- for ($i = sizeof($rss->entry) - 1; $i >= 0; --$i) {
563
- $new_rss->entry[$i] = $rss->entry[$i];
564
- }
565
  $entries = $new_rss;
566
-
567
  }
568
 
569
  }
@@ -589,7 +614,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
589
  array_unshift( $namespaces, "" ); // add a blank at the beginning of the array to deal with the unprefixed default
590
 
591
 
592
-
593
  foreach ( $entries->entry as $entry ) {
594
  // get nodes in media: namespace for media information
595
  $media = $entry->children( 'http://search.yahoo.com/mrss/' );
@@ -646,7 +671,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
646
 
647
  //sort array by width
648
  foreach ( $thumb_attrs as $key => $row ) {
649
- $new_thumb_attrs[$key] = $row['width'];
650
  }
651
  array_multisort( $new_thumb_attrs, SORT_NUMERIC, $thumb_attrs );
652
  unset( $new_thumb_attrs[$key] );
@@ -708,7 +733,16 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
708
  //count the plugin occurrences on page
709
  $plugincount++;
710
 
711
- $content = '<div class="ytcplayer-fixwidthwrapper"><div class="ytcplayer-wrapper ytc-player' . $ytchag_ratio . '"><iframe id="ytcplayer' . $plugincount . '" class="ytcplayer" allowfullscreen src="http://www.youtube.com/embed/' . $youtubeid . '?version=3' . $ytchag_theme . $ytchag_color . $ytchag_autoplay. $ytchag_modestbranding . $ytchag_rel . $ytchag_showinfo .'&enablejsapi=1&wmode=transparent" frameborder="0"></iframe></div></div>';
 
 
 
 
 
 
 
 
 
712
  $content.= '<ul class="ytchagallery ytccf' . $tableclass . $title_and_description_alignment_class . $columnnumber . ' ytc-thumb' . $ytchag_thumb_ratio . '">';
713
 
714
  } // if player end
@@ -753,7 +787,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
753
  }
754
 
755
  $content.= '<div class="ytcthumb-cont"' . $ytchag_thumbnail_fixed_witdh . '>';
756
- $content.= '<a class="ytcthumb ytclink" href="http://youtu.be/' . $youtubeid . '" data-playerid="ytcplayer' . $plugincount . '" data-quality="' . $ytchag_quality . '" title="' . $title . '" style="background-image:url(' . $thumb . ')" ' . $ytchag_nofollow . '>';
757
  $content.= '<div class="ytcplay"></div>';
758
  $content.= '</a>';
759
  $content.= '</div>';
@@ -774,7 +808,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
774
  }
775
  if ( $thumb_count == $ytchag_maxitems ) {
776
  break;
777
- }
778
  } //foreach end
779
 
780
  //if last row
@@ -797,10 +831,10 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
797
 
798
 
799
 
800
- function get_rss_data ( $ytchag_cache, $transientId, $ytchag_rss_url, $ytchag_cache_time ) {
801
  //use cache
802
  if ( $ytchag_cache == '1' ) {
803
-
804
  //if cache does not exist
805
  if ( false === ( $videos_result = get_transient( $transientId ) ) ) {
806
  //get rss
@@ -810,12 +844,12 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
810
  $response_message = wp_remote_retrieve_response_message( $videos_result );
811
 
812
  if ( $response_code == 200 ) {
813
-
814
  set_transient( $transientId, $videos_result, $ytchag_cache_time * HOUR_IN_SECONDS );
815
  }
816
  }
817
 
818
- //not to use cache
819
  } else {
820
  //get rss
821
  $videos_result = wp_remote_get( $ytchag_rss_url );
@@ -830,7 +864,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
830
 
831
  function get_appropriate_thumbnail( $thumb_attrs, $ytchag_thumb_width, $ytchag_thumb_height, $type ) {
832
  // get appropriate thumbnail width
833
-
834
  // to check only this type of thumbnails
835
  $ytchag_thumb_size_names = array( 'default', 'mqdefault', 'hqdefault', 'sddefault' );
836
 
@@ -842,7 +876,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
842
  return $row['width'];
843
  }
844
  }
845
- } else{
846
  if ( !in_array( $row['name'], $ytchag_thumb_size_names ) ) {
847
  if ( $row['width'] >= $ytchag_thumb_width && $row['height'] >= $ytchag_thumb_height ) {
848
  return $row['width'];
@@ -866,13 +900,17 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
866
  return $results;
867
  }
868
 
869
- // load css or js
870
- private function register_scripts_and_styles() {
 
 
 
 
 
871
  wp_enqueue_script( 'jquery' );
872
  wp_enqueue_script( 'youtube_player_api', 'http://www.youtube.com/player_api', false, false, true );
873
  wp_enqueue_script( 'youtube-channel-gallery', plugins_url( '/scripts.js', __FILE__ ), false, false, true );
874
- wp_enqueue_style( 'youtube-channel-gallery', plugins_url( '/styles.css', __FILE__ ), false, false, 'all' );
875
- }//register_scripts_and_styles
876
 
877
 
878
  public function register_admin_scripts_and_styles( $hook ) {
@@ -889,9 +927,6 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
889
 
890
  public function YoutubeChannelGallery_Shortcode( $atts ) {
891
 
892
- // Load JavaScript and stylesheets
893
- $this->register_scripts_and_styles();
894
-
895
  extract( shortcode_atts( array(
896
  'user' => 'youtube',
897
 
@@ -902,6 +937,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
902
  'cache' => '1',
903
 
904
  // Player options
 
905
  'ratio' => '4x3',
906
  'theme' => 'dark',
907
  'color' => 'red',
@@ -917,6 +953,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
917
  'thumbratio' => '4x3',
918
  'thumbcolumns' => '3',
919
  'nofollow' => '',
 
920
 
921
  'title' => '',
922
  'description' => '',
@@ -938,6 +975,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
938
  $instance['ytchag_cache'] = $cache;
939
 
940
  // Player options
 
941
  $instance['ytchag_ratio'] = $ratio;
942
  $instance['ytchag_theme'] = $theme;
943
  $instance['ytchag_color'] = $color;
@@ -953,6 +991,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
953
  $instance['ytchag_thumb_ratio'] = $thumbratio;
954
  $instance['ytchag_thumb_columns'] = $thumbcolumns;
955
  $instance['ytchag_nofollow'] = $nofollow;
 
956
 
957
  $instance['ytchag_title'] = $title;
958
  $instance['ytchag_description'] = $description;
@@ -975,4 +1014,4 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
975
  // register YoutubeChannelGallery_Widget widget
976
  add_action( 'widgets_init', create_function( '', 'register_widget( "YoutubeChannelGallery_Widget" );' ) );
977
 
978
- ?>
5
  Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
  Author: Javier Gómez Pose
7
  Author URI: http://www.poselab.com/
8
+ Version: 1.8.5
9
  License: GPL2
10
 
11
  Copyright 2013 Javier Gómez Pose (email : javierpose@gmail.com)
47
 
48
  array( 'classname' => 'youtubechannelgallery ytccf', 'description' => __( 'Show a youtube video and a gallery of thumbnails for a youtube channel', 'youtube-channel-gallery' ), ), // Args
49
 
50
+ array( 'width' => 260 )
51
  );
52
  }
53
 
58
  */
59
  public function widget( $args, $instance ) {
60
 
 
 
 
61
  extract( $args );
62
  $title = apply_filters( 'widget_title', $instance['title'] );
63
 
86
  $instance['ytchag_cache'] = strip_tags( $new_instance['ytchag_cache'] );
87
 
88
  // Player options
89
+ $instance['ytchag_player'] = strip_tags( $new_instance['ytchag_player'] );
90
  $instance['ytchag_ratio'] = strip_tags( $new_instance['ytchag_ratio'] );
91
  $instance['ytchag_theme'] = strip_tags( $new_instance['ytchag_theme'] );
92
  $instance['ytchag_color'] = strip_tags( $new_instance['ytchag_color'] );
102
  $instance['ytchag_thumb_ratio'] = strip_tags( $new_instance['ytchag_thumb_ratio'] );
103
  $instance['ytchag_thumb_columns'] = strip_tags( $new_instance['ytchag_thumb_columns'] );
104
  $instance['ytchag_nofollow'] = strip_tags( $new_instance['ytchag_nofollow'] );
105
+ $instance['ytchag_thumb_window'] = strip_tags( $new_instance['ytchag_thumb_window'] );
106
 
107
  $instance['ytchag_title'] = strip_tags( $new_instance['ytchag_title'] );
108
  $instance['ytchag_description'] = strip_tags( $new_instance['ytchag_description'] );
132
  'ytchag_cache' => '1',
133
 
134
  // Player options
135
+ 'ytchag_player' => '1',
136
  'ytchag_ratio' => '4x3',
137
  'ytchag_theme' => 'dark',
138
  'ytchag_color' => 'red',
148
  'ytchag_thumb_ratio' => '4x3',
149
  'ytchag_thumb_columns' => '3',
150
  'ytchag_nofollow' => '',
151
+ 'ytchag_thumb_window' => '',
152
 
153
  'ytchag_title' => '',
154
  'ytchag_description' => '',
240
  <div id="tabs-<?php echo $this->id; ?>-2" class="ytchgtabs-content tabs-2">
241
 
242
  <p>
243
+ <label for="<?php echo $this->get_field_id( 'ytchag_player' ); ?>"><?php _e( 'Player:', 'youtube-channel-gallery' ); ?></label>
244
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_player' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_player' ); ?>">
245
+ <option value="0"<?php selected( $instance['ytchag_player'], '0' ); ?>><?php _e( 'Without player', 'youtube-channel-gallery' ); ?></option>
246
+ <option value="1"<?php selected( $instance['ytchag_player'], '1' ); ?>><?php _e( 'show player above thumbnails', 'youtube-channel-gallery' ); ?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  </select>
248
  </p>
249
 
250
+ <span class="player_options">
251
+ <p>
252
+ <label for="<?php echo $this->get_field_id( 'ytchag_ratio' ); ?>"><?php _e( 'Aspect ratio:', 'youtube-channel-gallery' ); ?></label>
253
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_ratio' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_ratio' ); ?>">
254
+ <option value="4x3"<?php selected( $instance['ytchag_ratio'], '4x3' ); ?>><?php _e( 'Standard (4x3)', 'youtube-channel-gallery' ); ?></option>
255
+ <option value="16x9"<?php selected( $instance['ytchag_ratio'], '16x9' ); ?>><?php _e( 'Widescreen (16x9)', 'youtube-channel-gallery' ); ?></option>
256
+ </select>
257
+ </p>
258
+
259
+ <p>
260
+ <label for="<?php echo $this->get_field_id( 'ytchag_theme' ); ?>"><?php _e( 'Theme:', 'youtube-channel-gallery' ); ?></label>
261
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_theme' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_theme' ); ?>">
262
+ <option value="dark"<?php selected( $instance['ytchag_theme'], 'dark' ); ?>><?php _e( 'Dark', 'youtube-channel-gallery' ); ?></option>
263
+ <option value="light"<?php selected( $instance['ytchag_theme'], 'light' ); ?>><?php _e( 'Light', 'youtube-channel-gallery' ); ?></option>
264
+ </select>
265
+ </p>
266
+
267
+ <p>
268
+ <label for="<?php echo $this->get_field_id( 'ytchag_color' ); ?>"><?php _e( 'Progress bar color:', 'youtube-channel-gallery' ); ?></label>
269
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_color' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_color' ); ?>">
270
+ <option value="red"<?php selected( $instance['ytchag_color'], 'red' ); ?>><?php _e( 'Red', 'youtube-channel-gallery' ); ?></option>
271
+ <option value="white"<?php selected( $instance['ytchag_color'], 'white' ); ?>><?php _e( 'White', 'youtube-channel-gallery' ); ?></option>
272
+ </select>
273
+ </p>
274
+
275
+ <p>
276
+ <label for="<?php echo $this->get_field_id( 'ytchag_quality' ); ?>"><?php _e( 'Video quality:', 'youtube-channel-gallery' ); ?></label>
277
+ <select class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_quality' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_quality' ); ?>">
278
+ <option value="default"<?php selected( $instance['ytchag_quality'], 'default' ); ?>><?php _e( 'default', 'youtube-channel-gallery' ); ?></option>
279
+ <option value="highres"<?php selected( $instance['ytchag_quality'], 'highres' ); ?>><?php _e( 'highres', 'youtube-channel-gallery' ); ?></option>
280
+ <option value="hd1080"<?php selected( $instance['ytchag_quality'], 'hd1080' ); ?>><?php _e( 'hd1080', 'youtube-channel-gallery' ); ?></option>
281
+ <option value="hd720"<?php selected( $instance['ytchag_quality'], 'hd720' ); ?>><?php _e( 'hd720', 'youtube-channel-gallery' ); ?></option>
282
+ <option value="large"<?php selected( $instance['ytchag_quality'], 'large' ); ?>><?php _e( 'large', 'youtube-channel-gallery' ); ?></option>
283
+ <option value="medium"<?php selected( $instance['ytchag_quality'], 'medium' ); ?>><?php _e( 'medium', 'youtube-channel-gallery' ); ?></option>
284
+ <option value="small"<?php selected( $instance['ytchag_quality'], 'small' ); ?>><?php _e( 'small', 'youtube-channel-gallery' ); ?></option>
285
+ </select>
286
+ <span class="ytchag_info" title="<?php _e( 'Default value enables YouTube to select the most appropriate playback quality. If you select a quality level that is not available for the video, then the quality will be set to the next lowest level that is available.', 'youtube-channel-gallery' ); ?>">?</span>
287
+ </p>
288
+
289
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_autoplay'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_autoplay' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_autoplay' ); ?>" />
290
+ <label for="<?php echo $this->get_field_id( 'ytchag_autoplay' ); ?>"><?php _e( 'Autoplay', 'youtube-channel-gallery' ); ?></label>
291
+
292
+ <br>
293
+
294
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_modestbranding'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_modestbranding' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_modestbranding' ); ?>" />
295
+ <label for="<?php echo $this->get_field_id( 'ytchag_modestbranding' ); ?>"><?php _e( 'Show YouTube logo', 'youtube-channel-gallery' ); ?></label>
296
+ <span class="ytchag_info" title="<?php _e( 'Activate this field to show the YouTube logo in the control bar. Setting the color parameter to white will show the YouTube logo in the control bar.', 'youtube-channel-gallery' ); ?>">?</span>
297
+
298
+ <br>
299
+
300
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_rel'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_rel' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_rel' ); ?>" />
301
+ <label for="<?php echo $this->get_field_id( 'ytchag_rel' ); ?>"><?php _e( 'Show related videos', 'youtube-channel-gallery' ); ?></label>
302
+ <span class="ytchag_info" title="<?php _e( 'Activate this field to show related videos when playback of the video ends.', 'youtube-channel-gallery' ); ?>">?</span>
303
+
304
+ <br>
305
+
306
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_showinfo'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_showinfo' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_showinfo' ); ?>" />
307
+ <label for="<?php echo $this->get_field_id( 'ytchag_showinfo' ); ?>"><?php _e( 'Show info', 'youtube-channel-gallery' ); ?></label>
308
+ <span class="ytchag_info" title="<?php _e( 'Activate this field to display information like the video title and uploader before the video starts playing.', 'youtube-channel-gallery' ); ?>">?</span>
309
+ </span>
310
 
311
  </div>
312
 
349
  <label for="<?php echo $this->get_field_id( 'ytchag_nofollow' ); ?>"><?php _e( 'Add "nofollow" attribute to links', 'youtube-channel-gallery' ); ?></label>
350
  <span class="ytchag_info" title="<?php _e( '"nofollow" attribute provides a way for webmasters to tell search engines "Don\'t follow this specific link."', 'youtube-channel-gallery' ); ?>">?</span>
351
 
352
+
353
+ <span class="thumb_window">
354
+ </br>
355
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_thumb_window'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_thumb_window' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_window' ); ?>" />
356
+ <label for="<?php echo $this->get_field_id( 'ytchag_thumb_window' ); ?>"><?php _e( 'Open in a new window or tab', 'youtube-channel-gallery' ); ?></label>
357
+ </span>
358
+
359
  <p>
360
  <fieldset class="ytchg-field-tit-desc">
361
  <legend class="ytchg-tit-desc">
362
  <a href="#"><?php _e( 'Show title or description', 'youtube-channel-gallery' ); ?></a>
363
  </legend>
364
 
365
+ <div class="ytchg-title-and-description ytchgtabs-content">
366
 
367
  <p>
368
  <input class="checkbox ytchg-tit" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_title'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_title' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_title' ); ?>" />
448
  $ytchag_cache = apply_filters( 'ytchag_cache', $instance['ytchag_cache'] );
449
 
450
  // Player options
451
+ $ytchag_player = apply_filters( 'ytchag_player', $instance['ytchag_player'] );
452
  $ytchag_ratio = apply_filters( 'ytchag_ratio', $instance['ytchag_ratio'] );
453
  $ytchag_theme = apply_filters( 'ytchag_theme', $instance['ytchag_theme'] );
454
  $ytchag_color = apply_filters( 'ytchag_color', $instance['ytchag_color'] );
464
  $ytchag_thumb_ratio = apply_filters( 'ytchag_thumb_ratio', $instance['ytchag_thumb_ratio'] );
465
  $ytchag_thumb_columns = apply_filters( 'ytchag_thumb_columns', $instance['ytchag_thumb_columns'] );
466
  $ytchag_nofollow = apply_filters( 'ytchag_nofollow', $instance['ytchag_nofollow'] );
467
+ $ytchag_thumb_window = apply_filters( 'ytchag_thumb_window', $instance['ytchag_thumb_window'] );
468
 
469
  $ytchag_title = apply_filters( 'ytchag_title', $instance['ytchag_title'] );
470
  $ytchag_description = apply_filters( 'ytchag_description', $instance['ytchag_description'] );
487
  $ytchag_feed_order = ( $ytchag_feed_order ) ? $ytchag_feed_order : 'asc'; //default ascending
488
 
489
  // Player options
490
+ $ytchag_player = isset( $ytchag_player ) ? $ytchag_player : '1'; //player?
491
  $ytchag_theme = ( $ytchag_theme ) ? '&theme='. $ytchag_theme : ''; //default dark
492
  $ytchag_color = ( $ytchag_color ) ? '&color='. $ytchag_color : ''; //default red
493
  $ytchag_quality = ( $ytchag_quality ) ? $ytchag_quality : 'default'; //default default
498
 
499
  // Thumbnail options
500
  $ytchag_maxitems = ( $ytchag_maxitems ) ? $ytchag_maxitems : 9;
501
+ if ( (int) $ytchag_maxitems > 50 ) {
502
+ $ytchag_maxitems = 50;
503
+ }
504
  $ytchag_thumb_width = ( $ytchag_thumb_width ) ? $ytchag_thumb_width : 85;
505
  $ytchag_thumb_columns = ( ( $ytchag_thumb_columns ) || ( $ytchag_thumb_columns != 0 ) ) ? $ytchag_thumb_columns : 0;
506
  $ytchag_nofollow = ( $ytchag_nofollow ) ? ' rel="nofollow"' : '';
507
+ $ytchag_thumb_window = ( ( $ytchag_thumb_window ) && ( $ytchag_player == 0 ) ) ? 'target="_blank"' : '';
508
 
509
  //title and desc
510
  $ytchag_title = ( $ytchag_title ) ? $ytchag_title : 0;
547
  //HTTP API
548
 
549
  $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_maxitems );
550
+
551
  $videos_result = $this->get_rss_data ( $ytchag_cache, $transientId, $ytchag_rss_url, $ytchag_cache_time );
552
+
553
  $rss = simplexml_load_string( $videos_result['body'] );
554
+
555
  $response_code = wp_remote_retrieve_response_code( $videos_result );
556
  $response_message = wp_remote_retrieve_response_message( $videos_result );
557
  $entries = $rss;
571
  }
572
 
573
  $ytchag_rss_url = $youtube_feed_url . '/playlists/' . $ytchag_user . '?v=2&prettyprint=true&start-index=' . $startindex . '&max-results=' . $ytchag_maxitems;// . '&orderby=reversedPosition';
574
+
575
  $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_feed_order . $ytchag_maxitems );
576
 
577
  $videos_result = $this->get_rss_data ( $ytchag_cache, $transientId, $ytchag_rss_url, $ytchag_cache_time );
578
  $rss = simplexml_load_string( $videos_result['body'] );
579
+
580
  $response_code = wp_remote_retrieve_response_code( $videos_result );
581
  $response_message = wp_remote_retrieve_response_message( $videos_result );
582
 
583
  // parameter orderby=reversedPosition of Google Data API is not working, so I will use this to reverse the order
584
  //get entries
585
+
586
  $new_rss = new stdClass();
587
+ for ( $i = sizeof( $rss->entry ) - 1; $i >= 0; --$i ) {
588
+ $new_rss->entry[$i] = $rss->entry[$i];
589
+ }
590
  $entries = $new_rss;
591
+
592
  }
593
 
594
  }
614
  array_unshift( $namespaces, "" ); // add a blank at the beginning of the array to deal with the unprefixed default
615
 
616
 
617
+
618
  foreach ( $entries->entry as $entry ) {
619
  // get nodes in media: namespace for media information
620
  $media = $entry->children( 'http://search.yahoo.com/mrss/' );
671
 
672
  //sort array by width
673
  foreach ( $thumb_attrs as $key => $row ) {
674
+ $new_thumb_attrs[$key] = $row['width'];
675
  }
676
  array_multisort( $new_thumb_attrs, SORT_NUMERIC, $thumb_attrs );
677
  unset( $new_thumb_attrs[$key] );
733
  //count the plugin occurrences on page
734
  $plugincount++;
735
 
736
+ // Load css
737
+ $this->register_styles();
738
+
739
+ $content = '';
740
+
741
+ //player
742
+ if ( $ytchag_player == '1' ) {
743
+ require 'templates/player.php';
744
+ }
745
+
746
  $content.= '<ul class="ytchagallery ytccf' . $tableclass . $title_and_description_alignment_class . $columnnumber . ' ytc-thumb' . $ytchag_thumb_ratio . '">';
747
 
748
  } // if player end
787
  }
788
 
789
  $content.= '<div class="ytcthumb-cont"' . $ytchag_thumbnail_fixed_witdh . '>';
790
+ $content.= '<a class="ytcthumb ytclink" ' .$ytchag_thumb_window. ' href="http://youtu.be/' . $youtubeid . '" data-playerid="ytcplayer' . $plugincount . '" data-quality="' . $ytchag_quality . '" title="' . $title . '" style="background-image:url(' . $thumb . ')" ' . $ytchag_nofollow . '>';
791
  $content.= '<div class="ytcplay"></div>';
792
  $content.= '</a>';
793
  $content.= '</div>';
808
  }
809
  if ( $thumb_count == $ytchag_maxitems ) {
810
  break;
811
+ }
812
  } //foreach end
813
 
814
  //if last row
831
 
832
 
833
 
834
+ function get_rss_data( $ytchag_cache, $transientId, $ytchag_rss_url, $ytchag_cache_time ) {
835
  //use cache
836
  if ( $ytchag_cache == '1' ) {
837
+
838
  //if cache does not exist
839
  if ( false === ( $videos_result = get_transient( $transientId ) ) ) {
840
  //get rss
844
  $response_message = wp_remote_retrieve_response_message( $videos_result );
845
 
846
  if ( $response_code == 200 ) {
847
+
848
  set_transient( $transientId, $videos_result, $ytchag_cache_time * HOUR_IN_SECONDS );
849
  }
850
  }
851
 
852
+ //not to use cache
853
  } else {
854
  //get rss
855
  $videos_result = wp_remote_get( $ytchag_rss_url );
864
 
865
  function get_appropriate_thumbnail( $thumb_attrs, $ytchag_thumb_width, $ytchag_thumb_height, $type ) {
866
  // get appropriate thumbnail width
867
+
868
  // to check only this type of thumbnails
869
  $ytchag_thumb_size_names = array( 'default', 'mqdefault', 'hqdefault', 'sddefault' );
870
 
876
  return $row['width'];
877
  }
878
  }
879
+ } else {
880
  if ( !in_array( $row['name'], $ytchag_thumb_size_names ) ) {
881
  if ( $row['width'] >= $ytchag_thumb_width && $row['height'] >= $ytchag_thumb_height ) {
882
  return $row['width'];
900
  return $results;
901
  }
902
 
903
+ // load css
904
+ private function register_styles() {
905
+ wp_enqueue_style( 'youtube-channel-gallery', plugins_url( '/styles.css', __FILE__ ), false, false, 'all' );
906
+ }
907
+
908
+ // load js
909
+ private function register_scripts() {
910
  wp_enqueue_script( 'jquery' );
911
  wp_enqueue_script( 'youtube_player_api', 'http://www.youtube.com/player_api', false, false, true );
912
  wp_enqueue_script( 'youtube-channel-gallery', plugins_url( '/scripts.js', __FILE__ ), false, false, true );
913
+ }
 
914
 
915
 
916
  public function register_admin_scripts_and_styles( $hook ) {
927
 
928
  public function YoutubeChannelGallery_Shortcode( $atts ) {
929
 
 
 
 
930
  extract( shortcode_atts( array(
931
  'user' => 'youtube',
932
 
937
  'cache' => '1',
938
 
939
  // Player options
940
+ 'player' => '1',
941
  'ratio' => '4x3',
942
  'theme' => 'dark',
943
  'color' => 'red',
953
  'thumbratio' => '4x3',
954
  'thumbcolumns' => '3',
955
  'nofollow' => '',
956
+ 'thumb_window' => '',
957
 
958
  'title' => '',
959
  'description' => '',
975
  $instance['ytchag_cache'] = $cache;
976
 
977
  // Player options
978
+ $instance['ytchag_player'] = $player;
979
  $instance['ytchag_ratio'] = $ratio;
980
  $instance['ytchag_theme'] = $theme;
981
  $instance['ytchag_color'] = $color;
991
  $instance['ytchag_thumb_ratio'] = $thumbratio;
992
  $instance['ytchag_thumb_columns'] = $thumbcolumns;
993
  $instance['ytchag_nofollow'] = $nofollow;
994
+ $instance['ytchag_thumb_window'] = $thumb_window;
995
 
996
  $instance['ytchag_title'] = $title;
997
  $instance['ytchag_description'] = $description;
1014
  // register YoutubeChannelGallery_Widget widget
1015
  add_action( 'widgets_init', create_function( '', 'register_widget( "YoutubeChannelGallery_Widget" );' ) );
1016
 
1017
+ ?>