Youtube Channel Gallery - Version 2.0.0

Version Description

  • Update in order to make it compatible with YouTube API 3.
  • Option to set player width.
  • Options to set the order of elements of each tab.
  • Options to improve responsive behavior based on Bootstrap grid system.
  • Options to select title tag.
  • Optimization of alignment behavior.
  • Options to set the order of elements of thumbnails tab.
  • Option to promotion.
  • Rewritted code.
Download this release

Release Info

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

Code changes from version 1.8.7 to 2.0.0

admin-scripts.js CHANGED
@@ -177,4 +177,35 @@ jQuery(document).ready(function($) {
177
  }
178
  }
179
 
180
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  }
178
  }
179
 
180
+ $('.ytchgtabs[id^="tabs-youtubechannelgallery_widget-"]:not([id*="__i__"])').each(function() {
181
+
182
+ var $this = $(this);
183
+
184
+ $this.on('keyup', '[id$="ytchag_search_playlists"]:not([id*="__i__"])', function(e) {
185
+
186
+ var campos = this.value.split('#'),
187
+ $select = $this.find('[id$="ytchag_search_restrict"]:not([id*="__i__"])'),
188
+ restrict = '',
189
+ options = '';
190
+
191
+
192
+ $.each(campos, function(i, c) {
193
+
194
+ var tag = c.toLocaleLowerCase().replace(/ /g, '_');
195
+
196
+ if (c !== '') {
197
+ restrict += (restrict ? ',' : '') + 'restrict#' + tag;
198
+ options += '<option value="' + tag + '">' + c + '</option>';
199
+ }
200
+ });
201
+
202
+ $this.find('.restrict').html(restrict);
203
+ $select.find('option:gt(0)').remove();
204
+ $select.append(options);
205
+
206
+ return true;
207
+ });
208
+ });
209
+
210
+
211
+ });
admin-styles.css CHANGED
@@ -1,77 +1 @@
1
-
2
- /*clearfix*/
3
- .ytchgtabs .clearfix:before, .ytchgtabs .clearfix:after { content: ""; display: table; }
4
- .ytchgtabs .clearfix:after { clear: both; }
5
- .ytchgtabs .clearfix { zoom: 1; }
6
-
7
-
8
- /*tabs ul*/
9
- .ytchgtabs ul{
10
- margin: 0;
11
- padding: 0;
12
- }
13
-
14
- /*tabs li*/
15
- .ytchgtabs li {
16
- display: inline-block; margin: 1px .2em 0 0;
17
- padding: 0;
18
- list-style: none; white-space: nowrap;
19
- position: relative;
20
- background: #F3F3F3;
21
- border: 1px solid #DFDFDF;
22
- border-bottom: none;
23
- border-radius: 5px 5px 0 0;
24
- }
25
- .ytchgtabs li.active{
26
- margin-bottom: -1px;
27
- padding-bottom: 1px;
28
- background: #FAFAFA;
29
- }
30
-
31
-
32
- /*tabs a*/
33
- .ytchgtabs-tabs a{
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
- ---------------
52
- */
53
- .feed_playlist_id_label{display: none;}
54
-
55
-
56
- /*
57
- tab3
58
- ---------------
59
- */
60
- /*title and description*/
61
- .ytchgtabs div.ytchg-title-and-description{border: none; background: none;}
62
-
63
-
64
- .ytchgtabs fieldset.ytchg-fieldborder{border: 1px solid #DFDFDF;border-radius: 5px;}
65
-
66
- .ytchgtabs .ytchag_info {
67
- background: #ADD3E2;
68
- border-radius: 20px;
69
- font-size: 11px;
70
- width: 15px;
71
- height: 15px;
72
- line-height: 14px;
73
- display: inline-block;
74
- text-align: center;
75
- cursor: pointer;
76
- }
77
- .wideinfo{width: 88%;margin-right: 2px;}
1
+ .ytchgtabs *{box-sizing:border-box}.ytchgtabs :before,.ytchgtabs :after{box-sizing:border-box}.ytchgtabs .clearfix:before,.ytchgtabs .clearfix:after{content:"";display:table}.ytchgtabs .clearfix:after{clear:both}.ytchgtabs .clearfix{zoom:1}.ytchgtabs ul{margin:0;padding:0}.ytchgtabs li{display:inline-block;margin:1px .2em 0 0;padding:0;list-style:none;white-space:nowrap;position:relative;background:#F3F3F3;border:1px solid #DFDFDF;border-bottom:none;border-radius:5px 5px 0 0}.ytchgtabs li.active{margin-bottom:-1px;padding-bottom:1px;background:#FAFAFA}.ytchgtabs-tabs a{padding:5px;display:inline-block;text-decoration:none;outline:0}.ytchgtabs select{vertical-align:baseline}.ytchgtabs div.ytchgtabs-content{border:1px solid #DFDFDF;padding:15px 12px;background:#FAFAFA}.ytchgtabs-content p:last-child{margin-bottom:0}.feed_playlist_id_label{display:none}.ytchg-field-tit-desc{margin:13px 0}.ytchgtabs div.ytchg-title-and-description{border:none;background:0 0;display:none}.ytchgtabs fieldset.ytchg-fieldborder{border:1px solid #DFDFDF;border-radius:5px}.ytchgtabs .ytchag_info{background:#ADD3E2;border-radius:20px;font-size:11px;width:15px;height:15px;line-height:14px;display:inline-block;text-align:center;cursor:pointer}.wideinfo{width:88%;margin-right:2px}.ytchgtabs .row{margin-left:-7px;margin-right:-7px}.ytchgtabs .clearfix:before,.ytchgtabs .clearfix:after,.ytchgtabs .row:before,.ytchgtabs .row:after{content:" ";display:table}.ytchgtabs .clearfix:after,.ytchgtabs .row:after{clear:both}.ytchgtabs .col-md-6{position:relative;min-height:1px;padding-left:7px;padding-right:7px;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:flex-end;-ms-flex-align:end;align-items:flex-end}.ytchgtabs .col-md-6{width:50%;float:left}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
jquery.magnific-popup.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! Magnific Popup - v1.0.0 - 2015-01-03
2
+ * http://dimsemenov.com/plugins/magnific-popup/
3
+ * Copyright (c) 2015 Dmitry Semenov; */
4
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isIE7=-1!==c.indexOf("MSIE 7."),b.isIE8=-1!==c.indexOf("MSIE 8."),b.isLowIE=b.isIE7||b.isIE8,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",b.ev=c.mainEl&&c.mainEl.length?c.mainEl.eq(0):d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.wrap.css(b.fixedContentPos?{overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}:{top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),b.currTemplate[d]=f?a(f):!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||2!==c.which&&!c.ctrlKey&&!c.metaKey){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(a,c){if(void 0===c||c===!1)return!0;if(e=a.split("_"),e.length>1){var d=b.find(p+"-"+e[0]);if(d.length>0){var f=e[1];"replaceWith"===f?d[0]!==c[0]&&d.replaceWith(c):"img"===f?d.is("img")?d.attr("src",c):d.replaceWith('<img src="'+c+'" class="'+d.attr("class")+'" />'):d.attr(e[1],c)}}else b.find(p+"-"+a).html(c)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&times;</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery",g=Boolean(a.fn.mfpFastClick);return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s),h=g?"mfpFastClick":"click";e[h](function(){b.prev()}),f[h](function(){b.next()}),b.isIE7&&(x("b",e[0],!1,!0),x("a",e[0],!1,!0),x("b",f[0],!1,!0),x("a",f[0],!1,!0)),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowLeft&&g&&b.arrowLeft.add(b.arrowRight).destroyMfpFastClick(),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){v.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var g,h=a(this);if(c){var i,j,k,l,m,n;h.on("touchstart"+f,function(a){l=!1,n=1,m=a.originalEvent?a.originalEvent.touches[0]:a.touches[0],j=m.clientX,k=m.clientY,v.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0],(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)&&(l=!0,d())}).on("touchend"+f,function(a){d(),l||n>1||(g=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){g=!1},b),e())})})}h.on("click"+f,function(){g||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&v.off("touchmove"+f+" touchend"+f)}}(),A()});
languages/youtube-channel-gallery-es_ES.mo CHANGED
Binary file
languages/youtube-channel-gallery-es_ES.po CHANGED
@@ -7,341 +7,558 @@ msgid ""
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"
16
  "Content-Transfer-Encoding: 8bit\n"
17
  "X-Launchpad-Export-Date: 2010-06-23 21:48+0000\n"
18
- "X-Generator: Launchpad (build Unknown)\n"
19
  "X-Poedit-Basepath: ..\n"
20
- "X-Poedit-Language: Spanish\n"
21
- "X-Poedit-Country: SPAIN\n"
22
  "X-Poedit-KeywordsList: _e;__\n"
23
  "X-Poedit-SourceCharset: utf-8\n"
24
  "X-Poedit-SearchPath-0: .\n"
25
 
26
- #: youtube-channel-gallery.php:46
27
- msgid "Youtube Channel Gallery"
28
- msgstr "Galería de Canal de Youtube"
29
-
30
- #: youtube-channel-gallery.php:48
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,42 +566,54 @@ msgstr "Mensaje del servidor: %1$s. Compruebe en YouTube si el id <a href=\"%2$s
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
-
7
  msgstr ""
8
  "Project-Id-Version: youtube-channel-gallery\n"
9
  "Report-Msgid-Bugs-To: \n"
10
+ "POT-Creation-Date: 2015-06-05 10:40+0100\n"
11
+ "PO-Revision-Date: 2015-06-05 10:46+0100\n"
12
  "Last-Translator: Javier <javierpose@gmail.com>\n"
13
  "Language-Team: PoseLab <javierpose@gmail.com>\n"
14
+ "Language: es_ES\n"
15
  "MIME-Version: 1.0\n"
16
  "Content-Type: text/plain; charset=UTF-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
  "X-Launchpad-Export-Date: 2010-06-23 21:48+0000\n"
19
+ "X-Generator: Poedit 1.7.3\n"
20
  "X-Poedit-Basepath: ..\n"
 
 
21
  "X-Poedit-KeywordsList: _e;__\n"
22
  "X-Poedit-SourceCharset: utf-8\n"
23
  "X-Poedit-SearchPath-0: .\n"
24
 
25
+ #: templates/admin_tabs.php:3 templates/admin_tabs.php:321
 
 
 
 
 
 
 
 
26
  msgid "Title:"
27
  msgstr "Título:"
28
 
29
+ #: templates/admin_tabs.php:9
30
  msgid "Feed"
31
  msgstr "Feed"
32
 
33
+ #: templates/admin_tabs.php:10
34
  msgid "Player"
35
  msgstr "Reproductor"
36
 
37
+ #: templates/admin_tabs.php:11
38
+ msgid "Search"
39
+ msgstr "Búsqueda"
40
+
41
+ #: templates/admin_tabs.php:12
42
  msgid "Thumbnails"
43
  msgstr "Miniaturas"
44
 
45
+ #: templates/admin_tabs.php:13
46
  msgid "Link"
47
  msgstr "Enlace"
48
 
49
+ #: templates/admin_tabs.php:26
50
+ msgid "YouTube API Key:"
51
+ msgstr "YouTube API Key:"
52
+
53
+ #: templates/admin_tabs.php:28
54
+ msgid "Get your own YouTube API Key and put here."
55
+ msgstr "Inserta tu YouTube API Key."
56
+
57
+ #: templates/admin_tabs.php:32
58
  msgid "Video feed type:"
59
  msgstr "Tipo de feed de vídeo:"
60
 
61
+ #: templates/admin_tabs.php:34
62
  msgid "Uploaded by a user"
63
  msgstr "Subidos por el usuario"
64
 
65
+ #: templates/admin_tabs.php:36
66
  msgid "Playlist"
67
  msgstr "Lista de reproducción"
68
 
69
+ #: templates/admin_tabs.php:41
70
  msgid "YouTube user id:"
71
  msgstr "Id de usuario de Youtube:"
72
 
73
+ #: templates/admin_tabs.php:42
74
  msgid "YouTube playlist id:"
75
  msgstr "Id de lista de reproducción de YouTube:"
76
 
77
+ #: templates/admin_tabs.php:48
78
  msgid "Playlist order:"
79
  msgstr "Orden de lista de reproducción:"
80
 
81
+ #: templates/admin_tabs.php:50
82
  msgid "Ascending Order"
83
  msgstr "Ascendente"
84
 
85
+ #: templates/admin_tabs.php:51
86
  msgid "Descending Order"
87
  msgstr "Descendente"
88
 
89
+ #: templates/admin_tabs.php:56
90
  msgid "Cache time (hours):"
91
  msgstr "Tiempo de cache (horas):"
92
 
93
+ #: templates/admin_tabs.php:58
94
+ msgid ""
95
+ "Hours that RSS data is saved in database, to not make a request every time "
96
+ "the page is displayed. Assign this value according to how often you upgrade "
97
+ "your playlist in YouTube."
98
+ msgstr ""
99
+ "Horas que los datos del RSS se guardan en la base de datos, para no hacer una "
100
+ "solicitud cada vez que se muestra la página. Asigna este valor en función de "
101
+ "la frecuencia con que actualizas la lista de reproducción en YouTube."
102
 
103
+ #: templates/admin_tabs.php:63
104
  msgid "Activate cache"
105
  msgstr "Activar caché"
106
 
107
+ #: templates/admin_tabs.php:64
108
+ msgid ""
109
+ "If you disable this field the cache will be deleted and will not be used. "
110
+ "This is useful to refresh immediately the YouTube RSS used by the plugin. "
111
+ "Reenable the cache when the gallery shows the changes you made in your "
112
+ "youtube account."
113
+ msgstr ""
114
+ "Si se deshabilita este campo la caché se borrará y no será utilizada. Esto es "
115
+ "útil para actualizar inmediatamente el RSS de YouTube usado por el plugin. "
116
+ "Vuelve a habilitar la caché cuando la galería muestre los cambios que ha "
117
+ "realizado en su cuenta de YouTube."
118
 
119
+ #: templates/admin_tabs.php:79
120
  msgid "Player:"
121
  msgstr "Reproductor:"
122
 
123
+ #: templates/admin_tabs.php:81
124
  msgid "Without player"
125
  msgstr "Sin reproductor"
126
 
127
+ #: templates/admin_tabs.php:82
128
+ msgid "show player above thumbnails"
129
  msgstr "Mostrar reproductor sobre miniaturas"
130
 
131
+ #: templates/admin_tabs.php:83
132
+ msgid "show player in Magnific Popup"
133
+ msgstr "Mostrar reproductor en Magnific Popup"
134
+
135
+ #: templates/admin_tabs.php:89
136
+ msgid "Width:"
137
+ msgstr "Ancho:"
138
+
139
+ #: templates/admin_tabs.php:92
140
+ msgid "%"
141
+ msgstr ""
142
+
143
+ #: templates/admin_tabs.php:93
144
+ msgid "px"
145
+ msgstr ""
146
+
147
+ #: templates/admin_tabs.php:97 templates/admin_tabs.php:232
148
  msgid "Aspect ratio:"
149
  msgstr "Relación de aspecto:"
150
 
151
+ #: templates/admin_tabs.php:99 templates/admin_tabs.php:234
 
152
  msgid "Standard (4x3)"
153
  msgstr "Estándar (4x3)"
154
 
155
+ #: templates/admin_tabs.php:100 templates/admin_tabs.php:235
 
156
  msgid "Widescreen (16x9)"
157
  msgstr "Panorámico (16x9)"
158
 
159
+ #: templates/admin_tabs.php:105
160
  msgid "Theme:"
161
  msgstr "Tema:"
162
 
163
+ #: templates/admin_tabs.php:107
164
  msgid "Dark"
165
  msgstr "Oscuro"
166
 
167
+ #: templates/admin_tabs.php:108
168
  msgid "Light"
169
  msgstr "Claro"
170
 
171
+ #: templates/admin_tabs.php:113
172
  msgid "Progress bar color:"
173
  msgstr "Color de barra de progreso:"
174
 
175
+ #: templates/admin_tabs.php:115
176
  msgid "Red"
177
  msgstr "Rojo"
178
 
179
+ #: templates/admin_tabs.php:116
180
  msgid "White"
181
  msgstr "Blanco"
182
 
183
+ #: templates/admin_tabs.php:121
184
  msgid "Video quality:"
185
  msgstr "Calidad del vídeo:"
186
 
187
+ #: templates/admin_tabs.php:123
188
  msgid "default"
189
  msgstr "por defecto"
190
 
191
+ #: templates/admin_tabs.php:124
192
  msgid "highres"
193
  msgstr "alta resolución"
194
 
195
+ #: templates/admin_tabs.php:125
196
  msgid "hd1080"
197
  msgstr "hd1080"
198
 
199
+ #: templates/admin_tabs.php:126
200
  msgid "hd720"
201
  msgstr "hd720"
202
 
203
+ #: templates/admin_tabs.php:127
204
  msgid "large"
205
  msgstr "largo"
206
 
207
+ #: templates/admin_tabs.php:128
208
  msgid "medium"
209
  msgstr "mediano"
210
 
211
+ #: templates/admin_tabs.php:129
212
  msgid "small"
213
  msgstr "pequeño"
214
 
215
+ #: templates/admin_tabs.php:131
216
+ msgid ""
217
+ "Default value enables YouTube to select the most appropriate playback "
218
+ "quality. If you select a quality level that is not available for the video, "
219
+ "then the quality will be set to the next lowest level that is available."
220
+ msgstr ""
221
+ "El valor predeterminado permite a YouTube seleccionar la calidad de "
222
+ "reproducción más adecuada. Si selecciona un nivel de calidad que no está "
223
+ "disponible para el vídeo, la calidad se ajustará al siguiente nivel más bajo "
224
+ "que este disponible."
225
 
226
+ #: templates/admin_tabs.php:135
227
  msgid "Autoplay"
228
  msgstr "Autoplay"
229
 
230
+ #: templates/admin_tabs.php:140
231
  msgid "Show YouTube logo"
232
  msgstr "Mostrar el logotipo de YouTube"
233
 
234
+ #: templates/admin_tabs.php:141
235
+ msgid ""
236
+ "Activate this field to show the YouTube logo in the control bar. Setting the "
237
+ "color parameter to white will show the YouTube logo in the control bar."
238
+ msgstr ""
239
+ "Activa este campo para mostrar el logotipo de YouTube en la barra de control. "
240
+ "Un ajuste del parámetro de color a blanco mostrará el logotipo de YouTube en "
241
+ "la barra de control."
242
 
243
+ #: templates/admin_tabs.php:146
244
  msgid "Show related videos"
245
  msgstr "Mostrar los vídeos relacionados"
246
 
247
+ #: templates/admin_tabs.php:147
248
+ msgid ""
249
+ "Activate this field to show related videos when playback of the video ends."
250
+ msgstr ""
251
+ "Activa este campo para mostrar videos relacionados cuando termine la "
252
+ "reproducción del vídeo."
253
 
254
+ #: templates/admin_tabs.php:152
255
  msgid "Show info"
256
  msgstr "Mostrar información"
257
 
258
+ #: templates/admin_tabs.php:153
259
+ msgid ""
260
+ "Activate this field to display information like the video title and uploader "
261
+ "before the video starts playing."
262
+ msgstr ""
263
+ "Active este campo para mostrar información como el título del vídeo y nombre "
264
+ "de usuario antes de que el vídeo comience a reproducirse."
265
+
266
+ #: templates/admin_tabs.php:155 templates/admin_tabs.php:207
267
+ #: templates/admin_tabs.php:317 templates/admin_tabs.php:328
268
+ #: templates/admin_tabs.php:365
269
+ msgid "Order:"
270
+ msgstr "Orden:"
271
+
272
+ #: templates/admin_tabs.php:172
273
+ msgid "Search input text:"
274
+ msgstr ""
275
+
276
+ #: templates/admin_tabs.php:176
277
+ msgid "Restrict search to (# separated):"
278
+ msgstr ""
279
 
280
+ #: templates/admin_tabs.php:180
281
+ msgid "You must assing this tags to your videos to restrict the search:"
282
+ msgstr ""
283
+
284
+ #: templates/admin_tabs.php:189
285
+ msgid "Restrict search by default: It will overwrite results of feed tab)"
286
+ msgstr ""
287
+
288
+ #: templates/admin_tabs.php:191 templates/search.php:10
289
+ msgid "None"
290
+ msgstr "Ninguno"
291
+
292
+ #: templates/admin_tabs.php:199
293
+ msgid "Show search box"
294
+ msgstr ""
295
+
296
+ #: templates/admin_tabs.php:203
297
+ msgid "Show select with Playlists"
298
+ msgstr ""
299
+
300
+ #: templates/admin_tabs.php:219
301
  msgid "Number of videos to show:"
302
  msgstr "Número de vídeos a mostrar:"
303
 
304
+ #: templates/admin_tabs.php:221
305
+ msgid ""
306
+ "The plugin can display a maximum of 50 videos. This limitation will change in "
307
+ "a future release."
308
+ msgstr ""
309
+ "El plugin puede mostrar un máximo de 50 vídeos. Esta limitación cambiará en "
310
+ "una futura versión."
311
 
312
+ #: templates/admin_tabs.php:225
313
  msgid "Thumbnail width:"
314
  msgstr "Ancho de miniaturas:"
315
 
316
+ #: templates/admin_tabs.php:227
317
+ msgid ""
318
+ "This field is used to assign the appropriate quality of thumbnail images in "
319
+ "top and bottom alignments and to assign width to thumbnails in left and right "
320
+ "alignments. If the quality of thumbnail images is not enough, insert a larger "
321
+ "value. If you are unsure you can assign one of the following values​​: 120, "
322
+ "320, 480 or 640"
323
+ msgstr ""
324
+ "Este campo se utiliza para asignar la calidad de imagen más adecuada a las "
325
+ "miniaturas en las alineaciones superior e inferior y para asignar ancho a las "
326
+ "miniaturas en las alineaciones izquierda y derecha. Si la calidad de las "
327
+ "imágenes de las miniaturas no es suficiente, introduzca un valor mayor. Si no "
328
+ "está seguro de que valor usar puede asignar uno de los siguientes valores: "
329
+ "120, 320, 480 ó 640"
330
+
331
+ #: templates/admin_tabs.php:240
332
  msgid "Thumbnail columns:"
333
  msgstr "Columnas de las miniaturas:"
334
 
335
+ #: templates/admin_tabs.php:242
336
+ msgid "Phones:"
337
+ msgstr "Móvil:"
338
 
339
+ #: templates/admin_tabs.php:244
340
+ msgid "Tablets:"
341
+ msgstr "Tablet:"
342
 
343
+ #: templates/admin_tabs.php:247
344
+ msgid "Medium Desktops:"
345
+ msgstr "Escritorio medio:"
 
346
 
347
+ #: templates/admin_tabs.php:249
348
+ msgid "Large Desktops:"
349
+ msgstr "Escritorio grandes:"
350
+
351
+ #: templates/admin_tabs.php:258
352
  msgid "Show title or description"
353
  msgstr "Mostrar título y descripción"
354
 
355
+ #: templates/admin_tabs.php:265
356
  msgid "Show title"
357
  msgstr "Mostrar Título"
358
 
359
+ #: templates/admin_tabs.php:270
360
  msgid "Show description"
361
  msgstr "Mostrar descripción"
362
 
363
+ #: templates/admin_tabs.php:274
364
+ msgid "Title tag:"
365
+ msgstr "Etiqueta de título:"
366
+
367
+ #: templates/admin_tabs.php:276
368
+ msgid "h1"
369
+ msgstr ""
370
+
371
+ #: templates/admin_tabs.php:277
372
+ msgid "h2"
373
+ msgstr ""
374
+
375
+ #: templates/admin_tabs.php:278
376
+ msgid "h3"
377
+ msgstr ""
378
+
379
+ #: templates/admin_tabs.php:279
380
+ msgid "h4"
381
+ msgstr "h4"
382
+
383
+ #: templates/admin_tabs.php:280
384
+ msgid "h5"
385
+ msgstr ""
386
+
387
+ #: templates/admin_tabs.php:281
388
+ msgid "h6"
389
+ msgstr ""
390
+
391
+ #: templates/admin_tabs.php:286
392
  msgid "Thumbnail alignment:"
393
  msgstr "Alineación de miniaturas:"
394
 
395
+ #: templates/admin_tabs.php:288
396
+ msgid "none"
397
+ msgstr "Ninguno"
398
+
399
+ #: templates/admin_tabs.php:289
400
  msgid "Left"
401
  msgstr "Izquierda"
402
 
403
+ #: templates/admin_tabs.php:290
404
  msgid "Right"
405
  msgstr "Derecha"
406
 
407
+ #: templates/admin_tabs.php:295
 
 
 
 
 
 
 
 
408
  msgid "Description words number:"
409
  msgstr "Número de palabras en la descripción:"
410
 
411
+ #: templates/admin_tabs.php:297
412
+ msgid ""
413
+ "Set the maximum number of words that will be displayed of the description. "
414
+ "This field is useful when the descriptions of videos in the gallery have "
415
+ "different sizes."
416
+ msgstr ""
417
+ "Establece el número máximo de palabras que se mostrarán en la descripción. "
418
+ "Este campo es útil cuando la descripción de los vídeos de la galería tienen "
419
+ "diferentes tamaños."
420
+
421
+ #: templates/admin_tabs.php:303
422
+ msgid "Add \"nofollow\" attribute to links"
423
+ msgstr "Añade el atributo \"nofollow\" a los enlaces"
424
+
425
+ #: templates/admin_tabs.php:304
426
+ msgid ""
427
+ "\"nofollow\" attribute provides a way for webmasters to tell search engines "
428
+ "\"Don't follow this specific link.\""
429
+ msgstr ""
430
+ "El atributo \"nofollow\" ofrece a los webmasters un modo de indicar a los "
431
+ "motores de búsqueda para no seguir un enlace."
432
+
433
+ #: templates/admin_tabs.php:310 templates/admin_tabs.php:355
434
+ msgid "Open in a new window or tab"
435
+ msgstr "Abrir en una ventana nueva o pestaña"
436
+
437
+ #: templates/admin_tabs.php:315
438
+ msgid "Show pagination"
439
+ msgstr "Mostrar paginación"
440
+
441
+ #: templates/admin_tabs.php:319
442
+ msgid "Thumbnail:"
443
+ msgstr "Miniatura"
444
+
445
+ #: templates/admin_tabs.php:323
446
+ msgid "Description:"
447
+ msgstr "Descripción:"
448
 
449
+ #: templates/admin_tabs.php:344
450
  msgid "Link text:"
451
  msgstr "Texto del enlace"
452
 
453
+ #: templates/admin_tabs.php:350
454
  msgid "Show link to channel"
455
  msgstr "Mostrar enlace al canal"
456
 
457
+ #: templates/admin_tabs.php:360
458
+ msgid "Show link to thank the developer"
459
+ msgstr "Mostrar enlace para agradecer al desarrollador"
460
+
461
+ #: templates/link.php:9
462
+ msgid "By PoseLab"
463
+ msgstr ""
464
+
465
+ #: templates/link.php:18
466
+ msgid "Show more videos"
467
+ msgstr "Ver más vídeos»"
468
+
469
+ #: templates/thumbs.php:55
470
+ msgid "«Previous"
471
+ msgstr "«Anterior"
472
+
473
+ #: templates/thumbs.php:64
474
+ msgid "Next»"
475
+ msgstr "Siguiente»"
476
+
477
+ #: youtube-channel-gallery.php:48
478
+ msgid "Youtube Channel Gallery"
479
+ msgstr "Galería de Canal de Youtube"
480
+
481
+ #: youtube-channel-gallery.php:50
482
+ msgid "Show a youtube video and a gallery of thumbnails for a youtube channel"
483
+ msgstr "Muestra un vídeo y una galería de miniaturas de una canal de Youtube "
484
+
485
+ #: youtube-channel-gallery.php:552
486
  msgid "Show more videos»"
487
  msgstr "Ver más vídeos»"
488
 
489
+ #: youtube-channel-gallery.php:561
490
  msgid "There is no video to show."
491
  msgstr "No hay ningún vídeo para mostrar."
492
 
493
+ #: youtube-channel-gallery.php:616
494
  #, php-format
495
+ msgid ""
496
+ "Message from server: %1$s. Check in YouTube if the id <a href=\"%2$s\" target="
497
+ "\"_blank\">%3$s</a> belongs to a %4$s. To locate the id of your %4$s check "
498
+ "the <a href=\"http://wordpress.org/extend/plugins/youtube-channel-gallery/faq/"
499
+ "\" target=\"_blank\">FAQ</a> of the plugin."
500
+ msgstr ""
501
+ "Mensaje del servidor: %1$s. Compruebe en YouTube si el id <a href=\"%2$s\" "
502
+ "target=\"_blank\">%3$s</a> pertenece a un %4$s. Para localizar el id de la "
503
+ "carpeta %4$s revise el <a href=\"http://wordpress.org/extend/plugins/youtube-"
504
+ "channel-gallery/faq/\" target=\"_blank\"> FAQ </ a> del plugin."
505
+
506
+ #~ msgid "Top"
507
+ #~ msgstr "Arriba"
508
+
509
+ #~ msgid "Bottom"
510
+ #~ msgstr "Abajo"
511
 
512
  #~ msgid "Video width:"
513
  #~ msgstr "Ancho del vídeo:"
514
+
515
  #~ msgid "Show info (title, uploader)"
516
  #~ msgstr "Mostrar información (título, cargador)"
517
+
518
  #~ msgid "You must insert a valid YouTube user id."
519
  #~ msgstr "Debes introducir un id válido de usuario de YouTube."
520
+
521
  #~ msgid "You must insert a valid playlist id."
522
  #~ msgstr "Debes introducir un id válido de lista de reproducción de YouTube."
523
+
524
  #~ msgid "User's favorites"
525
  #~ msgstr "Favoritos del usuario"
526
+
527
  #~ msgid "Light:"
528
  #~ msgstr "Claro"
529
+
530
  #~ msgid "No post to duplicate has been supplied!"
531
  #~ msgstr "No se facilitó ninguna entrada a copiar"
532
+
533
  #~ msgid "Post creation failed, could not find original post:"
534
  #~ msgstr ""
535
  #~ "Creación realizada sin éxito, no ha sido posible encontrar la entrada "
536
  #~ "original:"
537
+
538
  #~ msgid "No page to duplicate has been supplied!"
539
  #~ msgstr "No se facilitó ninguna página a copiar"
540
+
541
  #~ msgid "Make a duplicate from this post"
542
  #~ msgstr "Crea una copia de esta entrada"
543
+
544
  #~ msgid "Duplicate"
545
  #~ msgstr "Duplicar"
546
+
547
  #~ msgid "Make a duplicate from this page"
548
  #~ msgstr "Crea una copia de esta página"
549
+
550
  #~ msgid "Copy to a new draft"
551
  #~ msgstr "Copia en un borrador nuevo"
552
+
553
  #~ msgid "Duplicate Post Options"
554
  #~ msgstr "Opciones"
555
+
556
  #~ msgid "Duplicate Post"
557
  #~ msgstr "Duplicate Post"
558
+
559
  #~ msgid "Copy post/page date also"
560
  #~ msgstr "Copiar también fecha del post o la página"
561
+
562
  #~ msgid ""
563
  #~ "Normally, the new draft has publication date set to current time: check "
564
  #~ "the box to copy the original post/page date"
566
  #~ "Normalmente se establece la fecha de publicación del nuevo borrador a la "
567
  #~ "fecha actual: compruebe la casilla para copiar la fecha original del post "
568
  #~ "o la página"
569
+
570
  #~ msgid "Do not copy these fields"
571
  #~ msgstr "No copiar estos campos"
572
+
573
  #~ msgid ""
574
+ #~ "Comma-separated list of meta fields that must not be copied when cloning a "
575
+ #~ "post/page"
576
  #~ msgstr ""
577
  #~ "Lista separada por comas de meta campos que no pueden ser copiados cuando "
578
  #~ "se clona una entrada/pagina."
579
+
580
  #~ msgid "Title prefix"
581
  #~ msgstr "Prefijo del titulo"
582
+
583
  #~ msgid ""
584
  #~ "Prefix to be added before the original title when cloning a post/page, e."
585
  #~ "g. \"Copy of\" (blank for no prefix)"
586
  #~ msgstr ""
587
  #~ "Prefijo a ser agregado antes del titulo original cuando se clona una "
588
  #~ "entrada/pagina, ej. \"Copia de\" (en blanco para no agregar prefijo)"
589
+
590
  #~ msgid "Minimum level to copy posts"
591
  #~ msgstr "Nivel mínimo para copiar posts"
592
+
593
  #~ msgid ""
594
  #~ "Warning: users will be able to copy all posts, even those of higher level "
595
  #~ "users"
596
  #~ msgstr ""
597
  #~ "Atención: los usuarios podrán copiar todos los posts, incluso aquellos de "
598
  #~ "usuarios de nivel más alto"
599
+
600
  #~ msgid "Save Changes"
601
  #~ msgstr "Guardar los cambios"
602
+
603
  #~ msgid "Donate"
604
  #~ msgstr "Hacer una donación"
605
+
606
  #~ msgid "Translate"
607
  #~ msgstr "Traducir"
608
+
609
  #~ msgid "http://www.lopo.it/duplicate-post-plugin/"
610
  #~ msgstr "Copy text \t http://www.lopo.it/duplicate-post-plugin/"
611
+
612
  #~ msgid "Creates a copy of a post."
613
  #~ msgstr "Crear una copia de las entradas."
614
+
615
  #~ msgid "Enrico Battocchi"
616
  #~ msgstr "Enrico Battocchi"
617
+
618
  #~ msgid "http://www.lopo.it"
619
  #~ msgstr "http://www.lopo.it"
 
magnific-popup.css ADDED
@@ -0,0 +1,374 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Magnific Popup CSS */
2
+ .mfp-bg {
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ z-index: 1042;
8
+ overflow: hidden;
9
+ position: fixed;
10
+ background: #0b0b0b;
11
+ opacity: 0.8;
12
+ filter: alpha(opacity=80); }
13
+
14
+ .mfp-wrap {
15
+ top: 0;
16
+ left: 0;
17
+ width: 100%;
18
+ height: 100%;
19
+ z-index: 1043;
20
+ position: fixed;
21
+ outline: none !important;
22
+ -webkit-backface-visibility: hidden; }
23
+
24
+ .mfp-container {
25
+ text-align: center;
26
+ position: absolute;
27
+ width: 100%;
28
+ height: 100%;
29
+ left: 0;
30
+ top: 0;
31
+ padding: 0 8px;
32
+ -webkit-box-sizing: border-box;
33
+ -moz-box-sizing: border-box;
34
+ box-sizing: border-box; }
35
+
36
+ .mfp-container:before {
37
+ content: '';
38
+ display: inline-block;
39
+ height: 100%;
40
+ vertical-align: middle; }
41
+
42
+ .mfp-align-top .mfp-container:before {
43
+ display: none; }
44
+
45
+ .mfp-content {
46
+ position: relative;
47
+ display: inline-block;
48
+ vertical-align: middle;
49
+ margin: 0 auto;
50
+ text-align: left;
51
+ z-index: 1045; }
52
+
53
+ .mfp-inline-holder .mfp-content, .mfp-ajax-holder .mfp-content {
54
+ width: 100%;
55
+ cursor: auto; }
56
+
57
+ .mfp-ajax-cur {
58
+ cursor: progress; }
59
+
60
+ .mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
61
+ cursor: -moz-zoom-out;
62
+ cursor: -webkit-zoom-out;
63
+ cursor: zoom-out; }
64
+
65
+ .mfp-zoom {
66
+ cursor: pointer;
67
+ cursor: -webkit-zoom-in;
68
+ cursor: -moz-zoom-in;
69
+ cursor: zoom-in; }
70
+
71
+ .mfp-auto-cursor .mfp-content {
72
+ cursor: auto; }
73
+
74
+ .mfp-close, .mfp-arrow, .mfp-preloader, .mfp-counter {
75
+ -webkit-user-select: none;
76
+ -moz-user-select: none;
77
+ user-select: none; }
78
+
79
+ .mfp-loading.mfp-figure {
80
+ display: none; }
81
+
82
+ .mfp-hide {
83
+ display: none !important; }
84
+
85
+ .mfp-preloader {
86
+ color: #CCC;
87
+ position: absolute;
88
+ top: 50%;
89
+ width: auto;
90
+ text-align: center;
91
+ margin-top: -0.8em;
92
+ left: 8px;
93
+ right: 8px;
94
+ z-index: 1044; }
95
+ .mfp-preloader a {
96
+ color: #CCC; }
97
+ .mfp-preloader a:hover {
98
+ color: #FFF; }
99
+
100
+ .mfp-s-ready .mfp-preloader {
101
+ display: none; }
102
+
103
+ .mfp-s-error .mfp-content {
104
+ display: none; }
105
+
106
+ button.mfp-close, button.mfp-arrow {
107
+ overflow: visible;
108
+ cursor: pointer;
109
+ background: transparent;
110
+ border: 0;
111
+ -webkit-appearance: none;
112
+ display: block;
113
+ outline: none;
114
+ padding: 0;
115
+ z-index: 1046;
116
+ -webkit-box-shadow: none;
117
+ box-shadow: none; }
118
+ button::-moz-focus-inner {
119
+ padding: 0;
120
+ border: 0; }
121
+
122
+ .mfp-close {
123
+ width: 44px;
124
+ height: 44px;
125
+ line-height: 44px;
126
+ position: absolute;
127
+ right: 0;
128
+ top: 0;
129
+ text-decoration: none;
130
+ text-align: center;
131
+ opacity: 0.65;
132
+ filter: alpha(opacity=65);
133
+ padding: 0 0 18px 10px;
134
+ color: #FFF;
135
+ font-style: normal;
136
+ font-size: 28px;
137
+ font-family: Arial, Baskerville, monospace; }
138
+ .mfp-close:hover, .mfp-close:focus {
139
+ opacity: 1;
140
+ filter: alpha(opacity=100); }
141
+ .mfp-close:active {
142
+ top: 1px; }
143
+
144
+ .mfp-close-btn-in .mfp-close {
145
+ color: #333; }
146
+
147
+ .mfp-image-holder .mfp-close, .mfp-iframe-holder .mfp-close {
148
+ color: #FFF;
149
+ right: -6px;
150
+ text-align: right;
151
+ padding-right: 6px;
152
+ width: 100%; }
153
+
154
+ .mfp-counter {
155
+ position: absolute;
156
+ top: 0;
157
+ right: 0;
158
+ color: #CCC;
159
+ font-size: 12px;
160
+ line-height: 18px;
161
+ white-space: nowrap; }
162
+
163
+ .mfp-arrow {
164
+ position: absolute;
165
+ opacity: 0.65;
166
+ filter: alpha(opacity=65);
167
+ margin: 0;
168
+ top: 50%;
169
+ margin-top: -55px;
170
+ padding: 0;
171
+ width: 90px;
172
+ height: 110px;
173
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
174
+ .mfp-arrow:active {
175
+ margin-top: -54px; }
176
+ .mfp-arrow:hover, .mfp-arrow:focus {
177
+ opacity: 1;
178
+ filter: alpha(opacity=100); }
179
+ .mfp-arrow:before, .mfp-arrow:after, .mfp-arrow .mfp-b, .mfp-arrow .mfp-a {
180
+ content: '';
181
+ display: block;
182
+ width: 0;
183
+ height: 0;
184
+ position: absolute;
185
+ left: 0;
186
+ top: 0;
187
+ margin-top: 35px;
188
+ margin-left: 35px;
189
+ border: medium inset transparent; }
190
+ .mfp-arrow:after, .mfp-arrow .mfp-a {
191
+ border-top-width: 13px;
192
+ border-bottom-width: 13px;
193
+ top: 8px; }
194
+ .mfp-arrow:before, .mfp-arrow .mfp-b {
195
+ border-top-width: 21px;
196
+ border-bottom-width: 21px;
197
+ opacity: 0.7; }
198
+
199
+ .mfp-arrow-left {
200
+ left: 0; }
201
+ .mfp-arrow-left:after, .mfp-arrow-left .mfp-a {
202
+ border-right: 17px solid #FFF;
203
+ margin-left: 31px; }
204
+ .mfp-arrow-left:before, .mfp-arrow-left .mfp-b {
205
+ margin-left: 25px;
206
+ border-right: 27px solid #3F3F3F; }
207
+
208
+ .mfp-arrow-right {
209
+ right: 0; }
210
+ .mfp-arrow-right:after, .mfp-arrow-right .mfp-a {
211
+ border-left: 17px solid #FFF;
212
+ margin-left: 39px; }
213
+ .mfp-arrow-right:before, .mfp-arrow-right .mfp-b {
214
+ border-left: 27px solid #3F3F3F; }
215
+
216
+ .mfp-iframe-holder {
217
+ padding-top: 40px;
218
+ padding-bottom: 40px; }
219
+ .mfp-iframe-holder .mfp-content {
220
+ line-height: 0;
221
+ width: 100%;
222
+ max-width: 900px; }
223
+ .mfp-iframe-holder .mfp-close {
224
+ top: -40px; }
225
+
226
+ .mfp-iframe-scaler {
227
+ width: 100%;
228
+ height: 0;
229
+ overflow: hidden;
230
+ padding-top: 56.25%; }
231
+ .mfp-iframe-scaler iframe {
232
+ position: absolute;
233
+ display: block;
234
+ top: 0;
235
+ left: 0;
236
+ width: 100%;
237
+ height: 100%;
238
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
239
+ background: #000; }
240
+
241
+ /* Main image in popup */
242
+ img.mfp-img {
243
+ width: auto;
244
+ max-width: 100%;
245
+ height: auto;
246
+ display: block;
247
+ line-height: 0;
248
+ -webkit-box-sizing: border-box;
249
+ -moz-box-sizing: border-box;
250
+ box-sizing: border-box;
251
+ padding: 40px 0 40px;
252
+ margin: 0 auto; }
253
+
254
+ /* The shadow behind the image */
255
+ .mfp-figure {
256
+ line-height: 0; }
257
+ .mfp-figure:after {
258
+ content: '';
259
+ position: absolute;
260
+ left: 0;
261
+ top: 40px;
262
+ bottom: 40px;
263
+ display: block;
264
+ right: 0;
265
+ width: auto;
266
+ height: auto;
267
+ z-index: -1;
268
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
269
+ background: #444; }
270
+ .mfp-figure small {
271
+ color: #BDBDBD;
272
+ display: block;
273
+ font-size: 12px;
274
+ line-height: 14px; }
275
+ .mfp-figure figure {
276
+ margin: 0; }
277
+
278
+ .mfp-bottom-bar {
279
+ margin-top: -36px;
280
+ position: absolute;
281
+ top: 100%;
282
+ left: 0;
283
+ width: 100%;
284
+ cursor: auto; }
285
+
286
+ .mfp-title {
287
+ text-align: left;
288
+ line-height: 18px;
289
+ color: #F3F3F3;
290
+ word-wrap: break-word;
291
+ padding-right: 36px; }
292
+
293
+ .mfp-image-holder .mfp-content {
294
+ max-width: 100%; }
295
+
296
+ .mfp-gallery .mfp-image-holder .mfp-figure {
297
+ cursor: pointer; }
298
+
299
+ @media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
300
+ /**
301
+ * Remove all paddings around the image on small screen
302
+ */
303
+ .mfp-img-mobile .mfp-image-holder {
304
+ padding-left: 0;
305
+ padding-right: 0; }
306
+ .mfp-img-mobile img.mfp-img {
307
+ padding: 0; }
308
+ .mfp-img-mobile .mfp-figure:after {
309
+ top: 0;
310
+ bottom: 0; }
311
+ .mfp-img-mobile .mfp-figure small {
312
+ display: inline;
313
+ margin-left: 5px; }
314
+ .mfp-img-mobile .mfp-bottom-bar {
315
+ background: rgba(0, 0, 0, 0.6);
316
+ bottom: 0;
317
+ margin: 0;
318
+ top: auto;
319
+ padding: 3px 5px;
320
+ position: fixed;
321
+ -webkit-box-sizing: border-box;
322
+ -moz-box-sizing: border-box;
323
+ box-sizing: border-box; }
324
+ .mfp-img-mobile .mfp-bottom-bar:empty {
325
+ padding: 0; }
326
+ .mfp-img-mobile .mfp-counter {
327
+ right: 5px;
328
+ top: 3px; }
329
+ .mfp-img-mobile .mfp-close {
330
+ top: 0;
331
+ right: 0;
332
+ width: 35px;
333
+ height: 35px;
334
+ line-height: 35px;
335
+ background: rgba(0, 0, 0, 0.6);
336
+ position: fixed;
337
+ text-align: center;
338
+ padding: 0; }
339
+ }
340
+
341
+ @media all and (max-width: 900px) {
342
+ .mfp-arrow {
343
+ -webkit-transform: scale(0.75);
344
+ transform: scale(0.75); }
345
+
346
+ .mfp-arrow-left {
347
+ -webkit-transform-origin: 0;
348
+ transform-origin: 0; }
349
+
350
+ .mfp-arrow-right {
351
+ -webkit-transform-origin: 100%;
352
+ transform-origin: 100%; }
353
+
354
+ .mfp-container {
355
+ padding-left: 6px;
356
+ padding-right: 6px; }
357
+ }
358
+
359
+ .mfp-ie7 .mfp-img {
360
+ padding: 0; }
361
+ .mfp-ie7 .mfp-bottom-bar {
362
+ width: 600px;
363
+ left: 50%;
364
+ margin-left: -300px;
365
+ margin-top: 5px;
366
+ padding-bottom: 5px; }
367
+ .mfp-ie7 .mfp-container {
368
+ padding: 0; }
369
+ .mfp-ie7 .mfp-content {
370
+ padding-top: 44px; }
371
+ .mfp-ie7 .mfp-close {
372
+ top: 0;
373
+ right: 0;
374
+ padding-top: 0; }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Youtube Channel Gallery ===
2
  Contributors: javitxu123
3
  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.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,6 +12,8 @@ Show a YouTube video and a gallery of thumbnails for a YouTube channel.
12
 
13
  == Description ==
14
 
 
 
15
  Show a YouTube video and a gallery of thumbnails for a YouTube user channel.
16
 
17
 
@@ -42,6 +44,7 @@ Description of the different fields of the plugin:
42
 
43
  **Feed tab:**
44
 
 
45
  * **Video feed type:** option to select the feed type to use to show videos. Yo can select uploaded by the user or playlist. Shortcode attribute: feed; value: user (default) or playlist. (Optional).
46
  * **YouTube user id/YouTube playlist id:** the user id of the user's Youtube videos you want to show or the id of the playlist. Shortcode attribute: user; value: String. (Required).
47
  * **Playlist order:** this option appears if you selected playlist as Video feed type. You can show videos in a playlist by ascending or descending order. Shortcode attribute: feedorder; value: asc (default) or desc. (Optional).
@@ -50,7 +53,9 @@ Description of the different fields of the plugin:
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).
@@ -59,31 +64,34 @@ Description of the different fields of the plugin:
59
  * **Show YouTube logo:** 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. Shortcode attribute: modestbranding; values: 0 (default) or 1. (Optional).
60
  * **Show related videos:** this parameter indicates whether the player should show related videos when playback of the initial video ends. Shortcode attribute: rel; values: 0 (default) or 1. (Optional).
61
  * **Show info (title, uploader):** display information like the video title and rating before the video starts playing. Shortcode attribute: showinfo; values: 0 (default) or 1. (Optional).
 
62
 
63
  **Thumbnails tab:**
64
 
65
  * **Number of videos to show:** it must be a number indicating the number of thumbnails to be displayed. Shortcode attribute: maxitems; value: Number. (Optional).
66
- * **Thumbnail width:** indicates the width of the thumbnails. The height is automatically generated based on the aspect ratio selected. Shortcode attribute: thumbwidth; value: Number. (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).
74
- * **Description words number:** the maximum number of words displayed in the description. Shortcode attribute: descriptionwordsnumber; value: Number. (Optional).
 
75
 
76
  **Link tab:**
77
 
78
  * **Link text:** field to customize the text of the link to the gallery on YouTube. Shortcode attribute: link_tx; value: String. (Optional).
79
  * **Show link to channel:** option to display a link to the YouTube user channel. Shortcode attribute: link; values: 0 (default) or 1. (Optional).
80
  * **Open in a new window or tab:** option to open the link to YouTube in a new window or tab . Shortcode attribute: link_window; values: 0 (default) or 1. (Optional).
 
81
 
82
 
83
  = Shortcode syntax: =
84
  In the following example are many attributes that can be used with the shortcode and explained above:
85
 
86
- `[Youtube_Channel_Gallery feed="user" user="MaxonC4D" feedorder="desc" videowidth="500" ratio="16x9" theme="light" color="white" quality="small" autoplay="1" rel="1" showinfo="1" maxitems="9" thumbwidth="90" thumbratio="16x9" thumbcolumns="3" title="1" description="1" thumbnail_alignment="left" descriptionwordsnumber="10" link_window="0"]`
87
 
88
 
89
  = Languages: =
@@ -142,6 +150,17 @@ See [HTTPS Support for YouTube Embeds](http://apiblog.youtube.com/2011/02/https-
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
 
 
 
 
 
 
145
  = 1.8.7 =
146
  * Fixed problem with SSL.
147
  * Changes in CSS to correct IE columns.
1
  === Youtube Channel Gallery ===
2
  Contributors: javitxu123
3
  Donate link: http://poselab.com/
4
+ Tags: widget, gallery, youtube, channel, user, sidebar, video, youtube playlist, html5, iframe, Youtube channel, youtube videos, API 3
5
  Requires at least: 2.8
6
+ Tested up to: 3.8.8
7
+ Stable tag: 2.00
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ `WARNING: The name of some Shortcode options has change`
16
+
17
  Show a YouTube video and a gallery of thumbnails for a YouTube user channel.
18
 
19
 
44
 
45
  **Feed tab:**
46
 
47
+ * **Key:** You must insert your own API key. The API key inserted is an example anf if you do not change the API key for yours you may receive an error message of exceeded quota. This is necessary in version 3 of the YouTube API, [Obtaining authorization credentials](https://developers.google.com/youtube/registering_an_application). Shortcode attribute: key; value: API key. (Required).
48
  * **Video feed type:** option to select the feed type to use to show videos. Yo can select uploaded by the user or playlist. Shortcode attribute: feed; value: user (default) or playlist. (Optional).
49
  * **YouTube user id/YouTube playlist id:** the user id of the user's Youtube videos you want to show or the id of the playlist. Shortcode attribute: user; value: String. (Required).
50
  * **Playlist order:** this option appears if you selected playlist as Video feed type. You can show videos in a playlist by ascending or descending order. Shortcode attribute: feedorder; value: asc (default) or desc. (Optional).
53
 
54
  **Player tab:**
55
 
56
+ * **Player:** Select whether you want to display the gallery with, without player or in Magnific Popup. Shortcode attribute: player; values: 0, 1 (default) or 2. (Optional).
57
+ * **Width:** Width of player. Shortcode attribute:** width_value; values: Number. 100 (default). (Optional).
58
+ * **Width dimensions:** dimensionn of player width. Shortcode attribute:** width_type; values: % (default) or px. (Optional).
59
  * **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).
60
  * **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).
61
  * **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).
64
  * **Show YouTube logo:** 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. Shortcode attribute: modestbranding; values: 0 (default) or 1. (Optional).
65
  * **Show related videos:** this parameter indicates whether the player should show related videos when playback of the initial video ends. Shortcode attribute: rel; values: 0 (default) or 1. (Optional).
66
  * **Show info (title, uploader):** display information like the video title and rating before the video starts playing. Shortcode attribute: showinfo; values: 0 (default) or 1. (Optional).
67
+ * **Order:** order of player. Shortcode attribute: player_order; values: Number. 1 (default). (Optional).
68
 
69
  **Thumbnails tab:**
70
 
71
  * **Number of videos to show:** it must be a number indicating the number of thumbnails to be displayed. Shortcode attribute: maxitems; value: Number. (Optional).
72
+ * **Thumbnail width:** indicates the width of the thumbnails. The height is automatically generated based on the aspect ratio selected. Shortcode attribute: thumb_width; value: Number. (Optional).
73
+ * **Aspect ratio:** indicates the proportions of the thumbnails, standard (4:3) or widescreen (16:9) format. Shortcode attribute: thumb_ratio; values: 4x3 (default) or 16x9. (Optional).
74
+ * **Thumbnail columns:** it allows to control the number of columns in which the thumbnails are distributed. It uses [Bootstrap Grid system](http://getbootstrap.com/css/#grid) to allow responsive behavior. Shortcode attribute: thumb_columns_phones (Phones), thumb_columns_tablets (Tablets), thumb_columns_md (Medium Desktops), thumb_columns_ld (Large Desktops); value: Number. Max value 12. (Optional).
75
  * **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).
76
  * **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).
77
  * **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).
78
  * **Show description:** it shows the description of the thumbnail with the number of specified words. Shortcode attribute: description; values: 0 (default) or 1. (Optional).
79
+ * **Title tag:** select an appropriate tag for the title. Shortcode attribute: title_tag; values: h1, h2, h3, h4, h5 (default), h6. (Optional).
80
+ * **Thumbnail alignment:** it defines the alignment of the thumbnail respect to its description and title. Shortcode attribute: thumbnail_alignment; values: none (default), left, right. (Optional).
81
+ * **Description words number:** the maximum number of words displayed in the description. Shortcode attribute: description_words_number; value: Number. (Optional).
82
 
83
  **Link tab:**
84
 
85
  * **Link text:** field to customize the text of the link to the gallery on YouTube. Shortcode attribute: link_tx; value: String. (Optional).
86
  * **Show link to channel:** option to display a link to the YouTube user channel. Shortcode attribute: link; values: 0 (default) or 1. (Optional).
87
  * **Open in a new window or tab:** option to open the link to YouTube in a new window or tab . Shortcode attribute: link_window; values: 0 (default) or 1. (Optional).
88
+ * **Show link to thank the developer:** option to add a small link to home page of the developer . Shortcode attribute: promotion; values: 0 or 1 (default). (Optional).
89
 
90
 
91
  = Shortcode syntax: =
92
  In the following example are many attributes that can be used with the shortcode and explained above:
93
 
94
+ `[Youtube_Channel_Gallery user="Autodesk" videowidth="580" ratio="16x9" theme="light" color="white" autoplay="0" rel="0" showinfo="0" maxitems="16" thumb_width="125" thumb_ratio="16x9" thumb_columns_ld="4" promotion="0" pagination_show="0"]`
95
 
96
 
97
  = Languages: =
150
 
151
  == Changelog ==
152
 
153
+ = 2.0.0 =
154
+ * Update in order to make it compatible with YouTube API 3.
155
+ * Option to set player width.
156
+ * Options to set the order of elements of each tab.
157
+ * Options to improve responsive behavior based on Bootstrap grid system.
158
+ * Options to select title tag.
159
+ * Optimization of alignment behavior.
160
+ * Options to set the order of elements of thumbnails tab.
161
+ * Option to promotion.
162
+ * Rewritted code.
163
+
164
  = 1.8.7 =
165
  * Fixed problem with SSL.
166
  * Changes in CSS to correct IE columns.
scripts.js CHANGED
@@ -1,14 +1,14 @@
1
  /*------------------------------------------------------------
2
  Plugin Name: Youtube Channel Gallery
3
  Plugin URI: http://www.poselab.com/
4
- Version: 1.8.7
5
  Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
  ------------------------------------------------------------*/
7
  jQuery(document).ready(function($) {
8
 
9
  //thumbnails
10
  var ytcplayer = {};
11
- $('.ytclink').click(function(){
12
  var iframeid = $(this).attr('data-playerid');
13
  var youtubeid = $(this).attr('href').split("watch?v=")[1];
14
  var quality = $(this).attr('data-quality');
@@ -18,6 +18,19 @@ jQuery(document).ready(function($) {
18
  return false;
19
  });
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  function ytcplayVideo (iframeid, youtubeid, quality) {
22
  if(iframeid in ytcplayer) {
23
  ytcplayer[iframeid].loadVideoById(youtubeid);
@@ -54,7 +67,7 @@ jQuery(document).ready(function($) {
54
  //http://css-tricks.com/equal-height-blocks-in-rows/
55
  var currentTallest = 0,
56
  currentRowStart = 0,
57
- rowDivs = new Array(),
58
  $el,
59
  topPosition = 0;
60
 
@@ -86,4 +99,98 @@ jQuery(document).ready(function($) {
86
 
87
  });
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  });
1
  /*------------------------------------------------------------
2
  Plugin Name: Youtube Channel Gallery
3
  Plugin URI: http://www.poselab.com/
4
+ Version: 2.0.0
5
  Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
  ------------------------------------------------------------*/
7
  jQuery(document).ready(function($) {
8
 
9
  //thumbnails
10
  var ytcplayer = {};
11
+ $('.youtubechannelgallery').on('click', '.ytclink', function(e) {
12
  var iframeid = $(this).attr('data-playerid');
13
  var youtubeid = $(this).attr('href').split("watch?v=")[1];
14
  var quality = $(this).attr('data-quality');
18
  return false;
19
  });
20
 
21
+ $('.popup-youtube').magnificPopup({
22
+ disableOn: 700,
23
+ type: 'iframe',
24
+ mainClass: 'mfp-fade',
25
+ removalDelay: 160,
26
+ preloader: false,
27
+
28
+ fixedContentPos: false,
29
+ gallery: {
30
+ enabled:true
31
+ }
32
+ });
33
+
34
  function ytcplayVideo (iframeid, youtubeid, quality) {
35
  if(iframeid in ytcplayer) {
36
  ytcplayer[iframeid].loadVideoById(youtubeid);
67
  //http://css-tricks.com/equal-height-blocks-in-rows/
68
  var currentTallest = 0,
69
  currentRowStart = 0,
70
+ rowDivs = [],
71
  $el,
72
  topPosition = 0;
73
 
99
 
100
  });
101
 
102
+ $('.widget.youtubechannelgallery').on('click', '.ytc-paginationlink', function(e) {
103
+
104
+ var token = $(this).data('token'),
105
+ playlist = $(this).data('playlist'),
106
+ cid = $(this).data('cid'),
107
+ wid = $(this).data('wid');
108
+
109
+ $.ajax({
110
+ url: ytcAjax.ajaxurl,
111
+ type: 'POST',
112
+ data: {
113
+ action: 'ytc_next',
114
+ token: token,
115
+ cid: cid,
116
+ playlist: playlist
117
+ },
118
+ success: function(data) {
119
+
120
+ var widget = $('#youtubechannelgallery_widget-' + wid);
121
+
122
+ widget.find('.ytc-thumbnails').empty();
123
+
124
+ widget.find('.ytc-thumbnails').prepend(data);
125
+
126
+ $('.popup-youtube').magnificPopup({
127
+ disableOn: 700,
128
+ type: 'iframe',
129
+ mainClass: 'mfp-fade',
130
+ removalDelay: 160,
131
+ preloader: false,
132
+
133
+ fixedContentPos: false,
134
+ gallery: {
135
+ enabled:true
136
+ }
137
+ });
138
+ }
139
+ });
140
+
141
+ return true;
142
+ });
143
+
144
+ $('.widget.youtubechannelgallery').on('keyup blur', '.search', function(e) {
145
+
146
+ var $this = $(this);
147
+
148
+ if (e.type === 'blur' || e.type === 'focusout' || (e.type === 'keyup' && e.which === 13)) {
149
+
150
+ var $widget = $('.widget.youtubechannelgallery'),
151
+ wid = $this.data('wid'),
152
+ cid = $this.data('cid'),
153
+ tag = $widget.find('.select-tag').val();
154
+
155
+ $.ajax({
156
+ url: ytcAjax.ajaxurl,
157
+ type: 'POST',
158
+ data: {
159
+ action: 'ytc_search',
160
+ cid: cid,
161
+ q: this.value,
162
+ tag: tag
163
+ },
164
+ success: function(data) {
165
+
166
+ if (data === '') {
167
+ $this.val('');
168
+ return;
169
+ }
170
+
171
+ var widget = $('#youtubechannelgallery_widget-' + wid);
172
+
173
+ widget.find('ytc-thumbnails').remove();
174
+ widget.find('.ytc-paginationlink').remove();
175
+
176
+ widget.prepend(data);
177
+
178
+ $('.popup-youtube').magnificPopup({
179
+ disableOn: 700,
180
+ type: 'iframe',
181
+ mainClass: 'mfp-fade',
182
+ removalDelay: 160,
183
+ preloader: false,
184
+
185
+ fixedContentPos: false,
186
+ gallery: {
187
+ enabled:true
188
+ }
189
+ });
190
+ }
191
+ });
192
+
193
+ }
194
+ return true;
195
+ });
196
  });
styles.css CHANGED
@@ -1,133 +1 @@
1
- /*------------------------------------------------------------
2
- Plugin Name: Youtube Channel Gallery
3
- Plugin URI: http://www.poselab.com/
4
- Version: 1.8.7
5
- Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
- ------------------------------------------------------------*/
7
- /*plugin wrapper*/
8
- .youtubechannelgallery, .youtubechannelgallery *,
9
- .ytcplayer-fixwidthwrapper, .ytcplayer-fixwidthwrapper *,
10
- .ytchagallery, .ytchagallery * {
11
- -webkit-box-sizing: border-box!important;
12
- -moz-box-sizing: border-box!important;
13
- box-sizing: border-box!important;
14
- }
15
-
16
- /*clearfix*/
17
- .ytccf:before,.ytccf:after {content: " "!important; display: table!important;}
18
- .ytccf:after {clear: both!important;}
19
- .ytccf {*zoom: 1!important;}
20
-
21
-
22
- /*shortcode wrapper*/
23
- .ytcshort{margin: 10px 0}
24
-
25
- /*Player*/
26
- /*---------------------------------------------------*/
27
-
28
- /*
29
- padding-top: player chrome height
30
- padding-bottom: height of player;
31
- */
32
- .ytcplayer-wrapper{
33
- position: relative!important;padding: 0!important;padding-bottom: 56.25%!important; height: 0!important; width: 100%!important;
34
- margin-bottom: 10px; background:
35
- }
36
- .ytcplayer-wrapper.ytc-player4x3{
37
- padding-bottom: 75%!important;
38
- }
39
- iframe.ytcplayer{
40
- position: absolute!important; top: 0!important;left: 0!important; width: 100%!important; height: 100%!important; padding: 0!important; border: 0!important;
41
- }
42
-
43
- /*Thumbnails, title and description*/
44
- /*---------------------------------------------------*/
45
- ul.ytchagallery{margin: 0!important; padding: 0!important;list-style: none!important; width: 100%!important; overflow: hidden!important;}
46
- ul.ytchagallery .ytc-row{width:-webkit-calc(100% + 10px)!important; width:calc(100% + 10px)!important;margin: 0!important;padding: 0!important}
47
- ul.ytchagallery li{float:left!important;margin: 0!important;list-style: none!important;padding: 0!important;clear: none!important;}
48
- ul.ytchagallery li.ytccell-first{clear: left!important;}
49
- ul.ytchagallery li .ytcliinner {overflow: hidden!important;padding: 0 10px 10px 0!important}
50
-
51
- /*Thumbnails*/
52
- /*----------------------------*/
53
- ul.ytchagallery a.ytcthumb{
54
- display: block!important;border:1px solid #999; position: relative!important; line-height: 0!important;width: 100%!important;
55
- padding: 0!important; margin: 0!important; height: 0!important; overflow: hidden!important;
56
- background-size: cover!important; background-position: center!important;
57
- }
58
-
59
- /*Play button*/
60
- ul.ytchagallery a.ytcthumb .ytcplay{background: url(img/play.png) no-repeat!important; background-position: -9999px -9999px!important;position: absolute!important; width: 100%!important; height: 100%!important}
61
- ul.ytchagallery a.ytcthumb:hover{opacity: 0.75;}
62
- ul.ytchagallery a.ytcthumb:hover .ytcplay{background-position: center center!important;}
63
-
64
- ul.ytchagallery p{display: none!important}/*for some themes*/
65
-
66
- /*images*/
67
- /*----------------------------*/
68
-
69
- /*4x3*/
70
- ul.ytc-thumb4x3 a.ytcthumb{
71
- padding-bottom: 75%!important;
72
- }
73
-
74
- /*16x9*/
75
- ul.ytc-thumb16x9 a.ytcthumb{
76
- padding-bottom: 55%!important;
77
- }
78
-
79
-
80
-
81
- /*Title and description*/
82
- /*----------------------------*/
83
- ul.ytchagallery .ytctitledesc-cont * {clear: none!important; }
84
- ul.ytchagallery .ytctitle a{word-wrap: break-word; }
85
-
86
- ul.ytchagallery .ytctitle{margin: 5px 0 10px 0}
87
-
88
- /*left*/
89
- ul.ytchagallery.ytc-td-left div.ytcthumb-cont{float: left!important; margin: 0 5px 5px 0!important;}
90
-
91
- /*right*/
92
- ul.ytchagallery.ytc-td-right div.ytcthumb-cont{float: right!important; margin: 0 0 5px 5px!important}
93
-
94
-
95
- /*top*/
96
- ul.ytchagallery.ytc-td-top div.ytcthumb-cont{float: none!important;}
97
-
98
- /*bottom*/
99
- ul.ytchagallery.ytc-td-bottom div.ytcthumb-cont{float: none!important; }
100
- ul.ytchagallery.ytc-td-bottom div.ytctitledesc-cont{margin-bottom: 5px}
101
- ul.ytchagallery.ytc-td-bottom div.ytctitledesc-cont h5{margin-bottom: 5px}
102
-
103
-
104
-
105
- /*columns*/
106
- .ytc-row{clear: both!important;}
107
-
108
- .ytc-columns1 li{ width: 100%!important;}
109
-
110
- .ytc-columns2 li{ width: 50%!important;}
111
-
112
- .ytc-columns3 li{ width: 33.33%!important;}
113
-
114
- .ytc-columns4 li{ width: 25%!important;}
115
-
116
- .ytc-columns5 li{ width: 20%!important;}
117
-
118
- .ytc-columns6 li{ width: 16.66%!important;}
119
-
120
- .ytc-columns7 li{ width: 14.28%!important;}
121
-
122
- .ytc-columns8 li{ width: 12.5%!important;}
123
-
124
- .ytc-columns9 li{ width: 11.11%!important;}
125
-
126
- .ytc-columns10 li{ width: 10%!important;}
127
-
128
-
129
- /*link to YouTube*/
130
- /*---------------------------------------------------*/
131
- .ytcmore{display: block}
132
-
133
-
1
+ .ytc-pslb .container{margin-right:auto;margin-left:auto;padding-left:7px;padding-right:7px}@media (min-width:768px){.ytc-pslb .container{width:734px}}@media (min-width:992px){.ytc-pslb .container{width:954px}}@media (min-width:1200px){.ytc-pslb .container{width:1154px}}.ytc-pslb .container-fluid{margin-right:auto;margin-left:auto;padding-left:7px;padding-right:7px}.ytc-pslb .row{margin-left:-7px;margin-right:-7px}.ytc-pslb .col-xs-1,.ytc-pslb .col-sm-1,.ytc-pslb .col-md-1,.ytc-pslb .col-lg-1,.ytc-pslb .col-xs-2,.ytc-pslb .col-sm-2,.ytc-pslb .col-md-2,.ytc-pslb .col-lg-2,.ytc-pslb .col-xs-3,.ytc-pslb .col-sm-3,.ytc-pslb .col-md-3,.ytc-pslb .col-lg-3,.ytc-pslb .col-xs-4,.ytc-pslb .col-sm-4,.ytc-pslb .col-md-4,.ytc-pslb .col-lg-4,.ytc-pslb .col-xs-5,.ytc-pslb .col-sm-5,.ytc-pslb .col-md-5,.ytc-pslb .col-lg-5,.ytc-pslb .col-xs-6,.ytc-pslb .col-sm-6,.ytc-pslb .col-md-6,.ytc-pslb .col-lg-6,.ytc-pslb .col-xs-7,.ytc-pslb .col-sm-7,.ytc-pslb .col-md-7,.ytc-pslb .col-lg-7,.ytc-pslb .col-xs-8,.ytc-pslb .col-sm-8,.ytc-pslb .col-md-8,.ytc-pslb .col-lg-8,.ytc-pslb .col-xs-9,.ytc-pslb .col-sm-9,.ytc-pslb .col-md-9,.ytc-pslb .col-lg-9,.ytc-pslb .col-xs-10,.ytc-pslb .col-sm-10,.ytc-pslb .col-md-10,.ytc-pslb .col-lg-10,.ytc-pslb .col-xs-11,.ytc-pslb .col-sm-11,.ytc-pslb .col-md-11,.ytc-pslb .col-lg-11,.ytc-pslb .col-xs-12,.ytc-pslb .col-sm-12,.ytc-pslb .col-md-12,.ytc-pslb .col-lg-12{position:relative;min-height:1px;padding-left:7px;padding-right:7px}.ytc-pslb .col-xs-1,.ytc-pslb .col-xs-2,.ytc-pslb .col-xs-3,.ytc-pslb .col-xs-4,.ytc-pslb .col-xs-5,.ytc-pslb .col-xs-6,.ytc-pslb .col-xs-7,.ytc-pslb .col-xs-8,.ytc-pslb .col-xs-9,.ytc-pslb .col-xs-10,.ytc-pslb .col-xs-11,.ytc-pslb .col-xs-12{float:left}.ytc-pslb .col-xs-12{width:100%}.ytc-pslb .col-xs-11{width:91.66666667%}.ytc-pslb .col-xs-10{width:83.33333333%}.ytc-pslb .col-xs-9{width:75%}.ytc-pslb .col-xs-8{width:66.66666667%}.ytc-pslb .col-xs-7{width:58.33333333%}.ytc-pslb .col-xs-6{width:50%}.ytc-pslb .col-xs-5{width:41.66666667%}.ytc-pslb .col-xs-4{width:33.33333333%}.ytc-pslb .col-xs-3{width:25%}.ytc-pslb .col-xs-2{width:16.66666667%}.ytc-pslb .col-xs-1{width:8.33333333%}@media (min-width:768px){.ytc-pslb .col-sm-1,.ytc-pslb .col-sm-2,.ytc-pslb .col-sm-3,.ytc-pslb .col-sm-4,.ytc-pslb .col-sm-5,.ytc-pslb .col-sm-6,.ytc-pslb .col-sm-7,.ytc-pslb .col-sm-8,.ytc-pslb .col-sm-9,.ytc-pslb .col-sm-10,.ytc-pslb .col-sm-11,.ytc-pslb .col-sm-12{float:left}.ytc-pslb .col-sm-12{width:100%}.ytc-pslb .col-sm-11{width:91.66666667%}.ytc-pslb .col-sm-10{width:83.33333333%}.ytc-pslb .col-sm-9{width:75%}.ytc-pslb .col-sm-8{width:66.66666667%}.ytc-pslb .col-sm-7{width:58.33333333%}.ytc-pslb .col-sm-6{width:50%}.ytc-pslb .col-sm-5{width:41.66666667%}.ytc-pslb .col-sm-4{width:33.33333333%}.ytc-pslb .col-sm-3{width:25%}.ytc-pslb .col-sm-2{width:16.66666667%}.ytc-pslb .col-sm-1{width:8.33333333%}}@media (min-width:992px){.ytc-pslb .col-md-1,.ytc-pslb .col-md-2,.ytc-pslb .col-md-3,.ytc-pslb .col-md-4,.ytc-pslb .col-md-5,.ytc-pslb .col-md-6,.ytc-pslb .col-md-7,.ytc-pslb .col-md-8,.ytc-pslb .col-md-9,.ytc-pslb .col-md-10,.ytc-pslb .col-md-11,.ytc-pslb .col-md-12{float:left}.ytc-pslb .col-md-12{width:100%}.ytc-pslb .col-md-11{width:91.66666667%}.ytc-pslb .col-md-10{width:83.33333333%}.ytc-pslb .col-md-9{width:75%}.ytc-pslb .col-md-8{width:66.66666667%}.ytc-pslb .col-md-7{width:58.33333333%}.ytc-pslb .col-md-6{width:50%}.ytc-pslb .col-md-5{width:41.66666667%}.ytc-pslb .col-md-4{width:33.33333333%}.ytc-pslb .col-md-3{width:25%}.ytc-pslb .col-md-2{width:16.66666667%}.ytc-pslb .col-md-1{width:8.33333333%}}@media (min-width:1200px){.ytc-pslb .col-lg-1,.ytc-pslb .col-lg-2,.ytc-pslb .col-lg-3,.ytc-pslb .col-lg-4,.ytc-pslb .col-lg-5,.ytc-pslb .col-lg-6,.ytc-pslb .col-lg-7,.ytc-pslb .col-lg-8,.ytc-pslb .col-lg-9,.ytc-pslb .col-lg-10,.ytc-pslb .col-lg-11,.ytc-pslb .col-lg-12{float:left}.ytc-pslb .col-lg-12{width:100%}.ytc-pslb .col-lg-11{width:91.66666667%}.ytc-pslb .col-lg-10{width:83.33333333%}.ytc-pslb .col-lg-9{width:75%}.ytc-pslb .col-lg-8{width:66.66666667%}.ytc-pslb .col-lg-7{width:58.33333333%}.ytc-pslb .col-lg-6{width:50%}.ytc-pslb .col-lg-5{width:41.66666667%}.ytc-pslb .col-lg-4{width:33.33333333%}.ytc-pslb .col-lg-3{width:25%}.ytc-pslb .col-lg-2{width:16.66666667%}.ytc-pslb .col-lg-1{width:8.33333333%}}.ytc-pslb .embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.ytc-pslb .embed-responsive .embed-responsive-item,.ytc-pslb .embed-responsive iframe,.ytc-pslb .embed-responsive embed,.ytc-pslb .embed-responsive object,.ytc-pslb .embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.ytc-pslb .embed-responsive-16by9{padding-bottom:56.25%}.ytc-pslb .embed-responsive-4by3{padding-bottom:75%}.ytc-pslb .clearfix:before,.ytc-pslb .clearfix:after,.ytc-pslb .container:before,.ytc-pslb .container:after,.ytc-pslb .container-fluid:before,.ytc-pslb .container-fluid:after,.ytc-pslb .row:before,.ytc-pslb .row:after{content:" ";display:table}.ytc-pslb .clearfix:after,.ytc-pslb .container:after,.ytc-pslb .container-fluid:after,.ytc-pslb .row:after{clear:both}.ytc-pslb .center-block{display:block;margin-left:auto;margin-right:auto}.ytc-pslb .pull-right{float:right!important}.ytc-pslb .pull-left{float:left!important}.ytc-pslb .hide{display:none!important}.ytc-pslb .show{display:block!important}.ytc-pslb .invisible{visibility:hidden}.ytc-pslb .text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.ytc-pslb .hidden{display:none!important}.ytc-pslb .affix{position:fixed}.ytc-pslb div{margin:0;padding:0}.ytc-pslb *{-webkit-box-sizing:border-box!important;box-sizing:border-box!important}.ytc-pslb :before,.ytc-pslb :after{-webkit-box-sizing:border-box!important;box-sizing:border-box!important}.ytc-pslb.container-fluid{padding:0!important}.ytc-pslb.ytcplayer-wrapper{border:1px solid #999;margin-bottom:14px}.ytc-pslb.ytcplayer-wrapper iframe{margin:0!important;padding:0!important}.ytc-pslb.ytc-thumbnails{padding:0!important}.ytc-pslb.ytc-thumbnails .ytc-row .ytc-column{margin-left:0!important;margin-right:0!important;-webkit-box-sizing:border-box!important;box-sizing:border-box!important;position:relative!important;margin-bottom:10px}.ytc-pslb.ytc-thumbnails.ytc-thumb-align-left .ytcthumb-cont{top:0;left:7px;position:absolute}.ytc-pslb.ytc-thumbnails.ytc-thumb-align-right .ytcthumb-cont{top:0;right:7px;position:absolute}.ytc-pslb.ytc-thumbnails a.ytcthumb{padding-bottom:55%!important}.ytc-pslb.ytc-thumbnails.ytc-thumb4x3 a.ytcthumb{padding-bottom:75%!important}.ytc-pslb.ytc-thumbnails a.ytcthumb{display:block!important;border:1px solid #999;position:relative!important;line-height:0!important;width:100%!important;padding-top:0!important;padding-left:0!important;padding-right:0!important;margin:0!important;height:0!important;overflow:hidden!important;background-size:cover!important;background-position:center!important}.ytc-pslb.ytc-thumbnails a.ytcthumb:hover{opacity:.75}.ytc-pslb.ytc-thumbnails a.ytcthumb .ytcplay{background:url(img/play.png) no-repeat!important;background-position:-9999px -9999px!important;position:absolute!important;width:100%!important;height:100%!important}.ytc-pslb.ytc-thumbnails a.ytcthumb:hover .ytcplay{background-position:center center!important}.ytc-pslb.ytc-thumbnails p{display:none!important}.ytc-pslb.ytc-thumbnails .ytc-pagination{margin-top:16px}.ytc-pslb.ytc-thumbnails .ytc-pagination div.ytc-next{text-align:right}.ytc-pslb.ytc-thumbnails .ytc-pagination a{cursor:pointer}.ytc-pslb.ytc-thumbnails .ytc-pagination .ytc-numeration{text-align:center}.ytc-pslb.ytc-links{margin-top:16px}.ytc-pslb.ytc-links .ytc-promotion a{font-size:10px;opacity:.3}.ytc-pslb.ytc-links .ytc-youtubelink{text-align:right}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/admin_tabs.php ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="ytchg">
2
+ <p>
3
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'youtube-channel-gallery' ); ?></label>
4
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
5
+ </p>
6
+
7
+ <div id="tabs-<?php echo $this->id; ?>" class="ytchgtabs">
8
+ <ul class="ytchgtabs-tabs">
9
+ <li><a href=".tabs-1"><?php _e( 'Feed', 'youtube-channel-gallery' ); ?></a></li>
10
+ <li><a href=".tabs-2"><?php _e( 'Player', 'youtube-channel-gallery' ); ?></a></li>
11
+ <!-- <li><a href=".tabs-3"><?php _e( 'Search', 'youtube-channel-gallery' ); ?></a></li> -->
12
+ <li><a href=".tabs-4"><?php _e( 'Thumbnails', 'youtube-channel-gallery' ); ?></a></li>
13
+ <li><a href=".tabs-5"><?php _e( 'Link', 'youtube-channel-gallery' ); ?></a></li>
14
+ </ul>
15
+
16
+
17
+ <?php
18
+ /*
19
+ Feed Tab
20
+ --------------------
21
+ */
22
+ ?>
23
+ <div id="tabs-<?php echo $this->id; ?>-1" class="ytchgtabs-content tabs-1">
24
+
25
+ <p class="<?php echo $this->get_field_id( 'ytchag_key' ); ?>">
26
+ <label for="<?php echo $this->get_field_id( 'ytchag_key' ); ?>"><?php _e( 'YouTube API Key:', 'youtube-channel-gallery' ); ?></label>
27
+ <input class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_key' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_key' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_key); ?>" />
28
+ <span class="ytchag_info" title="<?php _e( 'Get your own YouTube API Key and put here.', 'youtube-channel-gallery' ); ?>">?</span>
29
+ </p>
30
+
31
+ <p>
32
+ <label for="<?php echo $this->get_field_id( 'ytchag_feed' ); ?>"><?php _e( 'Video feed type:', 'youtube-channel-gallery' ); ?></label>
33
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_feed' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_feed' ); ?>">
34
+ <option value="user"<?php selected( $instance['ytchag_feed'], 'user' ); ?>><?php _e( 'Uploaded by a user', 'youtube-channel-gallery' ); ?></option>
35
+ <?php /*<option value="favorites"<?php selected( $instance['ytchag_feed'], 'favorites' ); ?>><?php _e( 'User\'s favorites', 'youtube-channel-gallery' ); ?></option>*/?>
36
+ <option value="playlist"<?php selected( $instance['ytchag_feed'], 'playlist' ); ?>><?php _e( 'Playlist', 'youtube-channel-gallery' ); ?></option>
37
+ </select>
38
+ </p>
39
+
40
+ <p>
41
+ <label class="feed_user_id_label" for="<?php echo $this->get_field_id( 'ytchag_user' ); ?>"><?php _e( 'YouTube user id:', 'youtube-channel-gallery' ); ?></label>
42
+ <label class="feed_playlist_id_label" for="<?php echo $this->get_field_id( 'ytchag_user' ); ?>"><?php _e( 'YouTube playlist id:', 'youtube-channel-gallery' ); ?></label>
43
+ <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_user' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_user' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_user ); ?>" />
44
+ [<?php echo esc_attr( $ytchag_user_uploads ); ?>]
45
+ </p>
46
+
47
+ <p class="<?php echo $this->get_field_id( 'ytchag_feed_order' ); ?>">
48
+ <label for="<?php echo $this->get_field_id( 'ytchag_feed_order' ); ?>"><?php _e( 'Playlist order:', 'youtube-channel-gallery' ); ?></label>
49
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_feed_order' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_feed_order' ); ?>">
50
+ <option value="asc"<?php selected( $instance['ytchag_feed_order'], 'asc' ); ?>><?php _e( 'Ascending Order', 'youtube-channel-gallery' ); ?></option>
51
+ <option value="desc"<?php selected( $instance['ytchag_feed_order'], 'desc' ); ?>><?php _e( 'Descending Order', 'youtube-channel-gallery' ); ?></option>
52
+ </select>
53
+ </p>
54
+
55
+ <p class="<?php echo $this->get_field_id( 'ytchag_cache_time' ); ?>">
56
+ <label for="<?php echo $this->get_field_id( 'ytchag_cache_time' ); ?>"><?php _e( 'Cache time (hours):', 'youtube-channel-gallery' ); ?></label>
57
+ <input class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_cache_time' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_cache_time' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_cache_time ); ?>" />
58
+ <span class="ytchag_info" title="<?php _e( '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.', 'youtube-channel-gallery' ); ?>">?</span>
59
+ </p>
60
+
61
+ <p class="<?php echo $this->get_field_id( 'ytchag_cache' ); ?>">
62
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_cache'], true, true ); ?> id="<?php echo $this->get_field_id( 'ytchag_cache' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_cache' ); ?>" />
63
+ <label for="<?php echo $this->get_field_id( 'ytchag_cache' ); ?>"><?php _e( 'Activate cache', 'youtube-channel-gallery' ); ?></label>
64
+ <span class="ytchag_info" title="<?php _e( '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.', 'youtube-channel-gallery' ); ?>">?</span>
65
+ </p>
66
+
67
+ </div>
68
+
69
+
70
+ <?php
71
+ /*
72
+ Player Tab
73
+ --------------------
74
+ */
75
+ ?>
76
+ <div id="tabs-<?php echo $this->id; ?>-2" class="ytchgtabs-content tabs-2">
77
+
78
+ <p>
79
+ <label for="<?php echo $this->get_field_id( 'ytchag_player' ); ?>"><?php _e( 'Player:', 'youtube-channel-gallery' ); ?></label>
80
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_player' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_player' ); ?>">
81
+ <option value="0"<?php selected( $instance['ytchag_player'], '0' ); ?>><?php _e( 'Without player', 'youtube-channel-gallery' ); ?></option>
82
+ <option value="1"<?php selected( $instance['ytchag_player'], '1' ); ?>><?php _e( 'show player above thumbnails', 'youtube-channel-gallery' ); ?></option>
83
+ <option value="2"<?php selected( $instance['ytchag_player'], '2' ); ?>><?php _e( 'show player in Magnific Popup', 'youtube-channel-gallery' ); ?></option>
84
+ </select>
85
+ </p>
86
+
87
+ <span class="player_options">
88
+ <p>
89
+ <?php _e( 'Width:', 'youtube-channel-gallery' ); ?>
90
+ <input class="" id="<?php echo $this->get_field_id( 'ytchag_width_value' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_width_value' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_width_value); ?>" />
91
+ <select class="" id="<?php echo $this->get_field_id( 'ytchag_width_type' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_width_type' ); ?>">
92
+ <option value="%"<?php selected( $instance['ytchag_width_type'], '%' ); ?>><?php _e( '%', 'youtube-channel-gallery' ); ?></option>
93
+ <option value="px"<?php selected( $instance['ytchag_width_type'], 'px' ); ?>><?php _e( 'px', 'youtube-channel-gallery' ); ?></option>
94
+ </select>
95
+ </p>
96
+ <p>
97
+ <label for="<?php echo $this->get_field_id( 'ytchag_ratio' ); ?>"><?php _e( 'Aspect ratio:', 'youtube-channel-gallery' ); ?></label>
98
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_ratio' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_ratio' ); ?>">
99
+ <option value="4x3"<?php selected( $instance['ytchag_ratio'], '4x3' ); ?>><?php _e( 'Standard (4x3)', 'youtube-channel-gallery' ); ?></option>
100
+ <option value="16x9"<?php selected( $instance['ytchag_ratio'], '16x9' ); ?>><?php _e( 'Widescreen (16x9)', 'youtube-channel-gallery' ); ?></option>
101
+ </select>
102
+ </p>
103
+
104
+ <p>
105
+ <label for="<?php echo $this->get_field_id( 'ytchag_theme' ); ?>"><?php _e( 'Theme:', 'youtube-channel-gallery' ); ?></label>
106
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_theme' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_theme' ); ?>">
107
+ <option value="dark"<?php selected( $instance['ytchag_theme'], 'dark' ); ?>><?php _e( 'Dark', 'youtube-channel-gallery' ); ?></option>
108
+ <option value="light"<?php selected( $instance['ytchag_theme'], 'light' ); ?>><?php _e( 'Light', 'youtube-channel-gallery' ); ?></option>
109
+ </select>
110
+ </p>
111
+
112
+ <p>
113
+ <label for="<?php echo $this->get_field_id( 'ytchag_color' ); ?>"><?php _e( 'Progress bar color:', 'youtube-channel-gallery' ); ?></label>
114
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_color' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_color' ); ?>">
115
+ <option value="red"<?php selected( $instance['ytchag_color'], 'red' ); ?>><?php _e( 'Red', 'youtube-channel-gallery' ); ?></option>
116
+ <option value="white"<?php selected( $instance['ytchag_color'], 'white' ); ?>><?php _e( 'White', 'youtube-channel-gallery' ); ?></option>
117
+ </select>
118
+ </p>
119
+
120
+ <p>
121
+ <label for="<?php echo $this->get_field_id( 'ytchag_quality' ); ?>"><?php _e( 'Video quality:', 'youtube-channel-gallery' ); ?></label>
122
+ <select class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_quality' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_quality' ); ?>">
123
+ <option value="default"<?php selected( $instance['ytchag_quality'], 'default' ); ?>><?php _e( 'default', 'youtube-channel-gallery' ); ?></option>
124
+ <option value="highres"<?php selected( $instance['ytchag_quality'], 'highres' ); ?>><?php _e( 'highres', 'youtube-channel-gallery' ); ?></option>
125
+ <option value="hd1080"<?php selected( $instance['ytchag_quality'], 'hd1080' ); ?>><?php _e( 'hd1080', 'youtube-channel-gallery' ); ?></option>
126
+ <option value="hd720"<?php selected( $instance['ytchag_quality'], 'hd720' ); ?>><?php _e( 'hd720', 'youtube-channel-gallery' ); ?></option>
127
+ <option value="large"<?php selected( $instance['ytchag_quality'], 'large' ); ?>><?php _e( 'large', 'youtube-channel-gallery' ); ?></option>
128
+ <option value="medium"<?php selected( $instance['ytchag_quality'], 'medium' ); ?>><?php _e( 'medium', 'youtube-channel-gallery' ); ?></option>
129
+ <option value="small"<?php selected( $instance['ytchag_quality'], 'small' ); ?>><?php _e( 'small', 'youtube-channel-gallery' ); ?></option>
130
+ </select>
131
+ <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>
132
+ </p>
133
+
134
+ <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' ); ?>" />
135
+ <label for="<?php echo $this->get_field_id( 'ytchag_autoplay' ); ?>"><?php _e( 'Autoplay', 'youtube-channel-gallery' ); ?></label>
136
+
137
+ <br>
138
+
139
+ <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' ); ?>" />
140
+ <label for="<?php echo $this->get_field_id( 'ytchag_modestbranding' ); ?>"><?php _e( 'Show YouTube logo', 'youtube-channel-gallery' ); ?></label>
141
+ <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>
142
+
143
+ <br>
144
+
145
+ <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' ); ?>" />
146
+ <label for="<?php echo $this->get_field_id( 'ytchag_rel' ); ?>"><?php _e( 'Show related videos', 'youtube-channel-gallery' ); ?></label>
147
+ <span class="ytchag_info" title="<?php _e( 'Activate this field to show related videos when playback of the video ends.', 'youtube-channel-gallery' ); ?>">?</span>
148
+
149
+ <br>
150
+
151
+ <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' ); ?>" />
152
+ <label for="<?php echo $this->get_field_id( 'ytchag_showinfo' ); ?>"><?php _e( 'Show info', 'youtube-channel-gallery' ); ?></label>
153
+ <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>
154
+ <p class="<?php echo $this->get_field_id( 'ytchag_player_order' ); ?>">
155
+ <label for="<?php echo $this->get_field_id( 'ytchag_player_order' ); ?>"><?php _e( 'Order:', 'youtube-channel-gallery' ); ?></label>
156
+ <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_player_order' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_player_order' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_player_order); ?>" />
157
+ </p>
158
+ </span>
159
+
160
+ </div>
161
+
162
+ <?php
163
+ /*
164
+ Search Tab
165
+ --------------------
166
+ */
167
+ ?>
168
+
169
+ <div id="tabs-<?php echo $this->id; ?>-3" class="ytchgtabs-content tabs-3">
170
+
171
+ <p class="<?php echo $this->get_field_id( 'ytchag_search_input' ); ?>">
172
+ <label for="<?php echo $this->get_field_id( 'ytchag_search_input' ); ?>"><?php _e( 'Search input text:', 'youtube-channel-gallery' ); ?></label>
173
+ <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_search_input' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_search_input' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_search_input); ?>" />
174
+ </p>
175
+ <p class="<?php echo $this->get_field_id( 'ytchag_search_playlists' ); ?>">
176
+ <label for="<?php echo $this->get_field_id( 'ytchag_search_playlists' ); ?>"><?php _e( 'Restrict search to (# separated):', 'youtube-channel-gallery' ); ?></label>
177
+ <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_search_playlists' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_search_playlists' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_search_playlists); ?>" />
178
+ </p>
179
+ <p>
180
+ <?php echo _e('You must assing this tags to your videos to restrict the search:', 'youtube-channel-gallery') ?>
181
+ <br>
182
+ <?php $campos = array(); ?>
183
+ <?php if ($instance['ytchag_search_playlists']): ?>
184
+ <?php $campos = explode('#', $instance['ytchag_search_playlists']); ?>
185
+ <?php endif; ?>
186
+ <span class="restrict"><?php echo implode(',', array_map('toTag', $campos)); ?></span>
187
+ </p>
188
+ <p>
189
+ <label for="<?php echo $this->get_field_id( 'ytchag_search_restrict' ); ?>"><?php _e( 'Restrict search by default: It will overwrite results of feed tab)', 'youtube-channel-gallery' ); ?></label>
190
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_search_restrict' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_search_restrict' ); ?>">
191
+ <option value=""<?php selected( $instance['ytchag_search_restrict'], '' ); ?>><?php _e( 'None', 'youtube-channel-gallery' ); ?></option>
192
+ <?php foreach ($campos as $c): ?>
193
+ <?php $tag = toTag($c); ?>
194
+ <option value="<?php echo $tag ?>"<?php selected( $instance['ytchag_search_restrict'], $tag ); ?>><?php _e( $c, 'youtube-channel-gallery' ); ?></option>
195
+ <?php endforeach; ?>
196
+ </select>
197
+ </p>
198
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_search_input_show'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_search_input_show' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_search_input_show' ); ?>" />
199
+ <label for="<?php echo $this->get_field_id( 'ytchag_search_input_show' ); ?>"><?php _e( 'Show search box', 'youtube-channel-gallery' ); ?></label>
200
+
201
+ <br>
202
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_search_playlists_show'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_search_playlists_show' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_search_playlists_show' ); ?>" />
203
+ <label for="<?php echo $this->get_field_id( 'ytchag_search_playlists_show' ); ?>"><?php _e( 'Show select with Playlists', 'youtube-channel-gallery' ); ?></label>
204
+
205
+ <br>
206
+ <p class="<?php echo $this->get_field_id( 'ytchag_search_order' ); ?>">
207
+ <label for="<?php echo $this->get_field_id( 'ytchag_search_order' ); ?>"><?php _e( 'Order:', 'youtube-channel-gallery' ); ?></label>
208
+ <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_search_order' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_search_order' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_search_order); ?>" />
209
+ </p>
210
+ </div>
211
+ <?php
212
+ /*
213
+ Thumbnails Tab
214
+ --------------------
215
+ */
216
+ ?>
217
+ <div id="tabs-<?php echo $this->id; ?>-4" class="ytchgtabs-content tabs-4">
218
+ <p>
219
+ <label for="<?php echo $this->get_field_id( 'ytchag_maxitems' ); ?>"><?php _e( 'Number of videos to show:', 'youtube-channel-gallery' ); ?></label>
220
+ <input class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_maxitems' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_maxitems' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_maxitems ); ?>" />
221
+ <span class="ytchag_info" title="<?php _e( 'The plugin can display a maximum of 50 videos. This limitation will change in a future release.', 'youtube-channel-gallery' ); ?>">?</span>
222
+ </p>
223
+
224
+ <p>
225
+ <label for="<?php echo $this->get_field_id( 'ytchag_thumb_width' ); ?>"><?php _e( 'Thumbnail width:', 'youtube-channel-gallery' ); ?></label>
226
+ <input class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_thumb_width' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_width' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_width ); ?>" />
227
+ <span class="ytchag_info" title="<?php _e( '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', 'youtube-channel-gallery' ); ?>">?</span>
228
+ </p>
229
+
230
+ <p>
231
+
232
+ <label for="<?php echo $this->get_field_id( 'ytchag_thumb_ratio' ); ?>"><?php _e( 'Aspect ratio:', 'youtube-channel-gallery' ); ?></label>
233
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_thumb_ratio' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_ratio' ); ?>">
234
+ <option value="4x3"<?php selected( $instance['ytchag_thumb_ratio'], '4x3' ); ?>><?php _e( 'Standard (4x3)', 'youtube-channel-gallery' ); ?></option>
235
+ <option value="16x9"<?php selected( $instance['ytchag_thumb_ratio'], '16x9' ); ?>><?php _e( 'Widescreen (16x9)', 'youtube-channel-gallery' ); ?></option>
236
+ </select>
237
+ </p>
238
+
239
+ <p>
240
+ <label for="<?php echo $this->get_field_id( 'ytchag_thumb_columns' ); ?>"><?php _e( 'Thumbnail columns:', 'youtube-channel-gallery' ); ?></label>
241
+ <br>
242
+ <?php _e( 'Phones:', 'youtube-channel-gallery' ); ?>
243
+ <input size="1" class="" id="<?php echo $this->get_field_id( 'ytchag_thumb_columns_phones' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_columns_phones' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_columns_phones ); ?>" />
244
+ <?php _e( 'Tablets:', 'youtube-channel-gallery' ); ?>
245
+ <input size="1"class="" id="<?php echo $this->get_field_id( 'ytchag_thumb_columns_tablets' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_columns_tablets' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_columns_tablets ); ?>" />
246
+ <br>
247
+ <?php _e( 'Medium Desktops:', 'youtube-channel-gallery' ); ?>
248
+ <input size="1" class="" id="<?php echo $this->get_field_id( 'ytchag_thumb_columns_md' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_columns_md' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_columns_md ); ?>" />
249
+ <?php _e( 'Large Desktops:', 'youtube-channel-gallery' ); ?>
250
+ <input size="1" class="" id="<?php echo $this->get_field_id( 'ytchag_thumb_columns_ld' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_columns_ld' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_columns_ld ); ?>" />
251
+ </p>
252
+
253
+
254
+
255
+ <p>
256
+ <fieldset class="ytchg-field-tit-desc">
257
+ <legend class="ytchg-tit-desc">
258
+ <a href="#"><?php _e( 'Show title or description', 'youtube-channel-gallery' ); ?></a>
259
+ </legend>
260
+
261
+ <div class="ytchg-title-and-description ytchgtabs-content">
262
+
263
+ <p>
264
+ <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' ); ?>" />
265
+ <label for="<?php echo $this->get_field_id( 'ytchag_title' ); ?>"><?php _e( 'Show title', 'youtube-channel-gallery' ); ?></label>
266
+ </p>
267
+
268
+ <p>
269
+ <input class="checkbox ytchg-desc" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_description'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_description' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_description' ); ?>" />
270
+ <label for="<?php echo $this->get_field_id( 'ytchag_description' ); ?>"><?php _e( 'Show description', 'youtube-channel-gallery' ); ?></label>
271
+ </p>
272
+
273
+ <p>
274
+ <label for="<?php echo $this->get_field_id( 'ytchag_title_tag' ); ?>"><?php _e( 'Title tag:', 'youtube-channel-gallery' ); ?></label>
275
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_title_tag' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_title_tag' ); ?>">
276
+ <option value="h1"<?php selected( $instance['ytchag_title_tag'], 'h1' ); ?>><?php _e( 'h1', 'youtube-channel-gallery' ); ?></option>
277
+ <option value="h2"<?php selected( $instance['ytchag_title_tag'], 'h2' ); ?>><?php _e( 'h2', 'youtube-channel-gallery' ); ?></option>
278
+ <option value="h3"<?php selected( $instance['ytchag_title_tag'], 'h3' ); ?>><?php _e( 'h3', 'youtube-channel-gallery' ); ?></option>
279
+ <option value="h4"<?php selected( $instance['ytchag_title_tag'], 'h4' ); ?>><?php _e( 'h4', 'youtube-channel-gallery' ); ?></option>
280
+ <option value="h5"<?php selected( $instance['ytchag_title_tag'], 'h5' ); ?>><?php _e( 'h5', 'youtube-channel-gallery' ); ?></option>
281
+ <option value="h6"<?php selected( $instance['ytchag_title_tag'], 'h6' ); ?>><?php _e( 'h6', 'youtube-channel-gallery' ); ?></option>
282
+ </select>
283
+ </p>
284
+
285
+ <p>
286
+ <label for="<?php echo $this->get_field_id( 'ytchag_thumbnail_alignment' ); ?>"><?php _e( 'Thumbnail alignment:', 'youtube-channel-gallery' ); ?></label>
287
+ <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_thumbnail_alignment' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumbnail_alignment' ); ?>">
288
+ <option value="none"<?php selected( $instance['ytchag_thumbnail_alignment'], 'none' ); ?>><?php _e( 'none', 'youtube-channel-gallery' ); ?></option>
289
+ <option value="left"<?php selected( $instance['ytchag_thumbnail_alignment'], 'left' ); ?>><?php _e( 'Left', 'youtube-channel-gallery' ); ?></option>
290
+ <option value="right"<?php selected( $instance['ytchag_thumbnail_alignment'], 'right' ); ?>><?php _e( 'Right', 'youtube-channel-gallery' ); ?></option>
291
+ </select>
292
+ </p>
293
+
294
+ <p>
295
+ <label for="<?php echo $this->get_field_id( 'ytchag_description_words_number' ); ?>"><?php _e( 'Description words number:', 'youtube-channel-gallery' ); ?></label>
296
+ <input class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_description_words_number' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_description_words_number' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_description_words_number ); ?>" />
297
+ <span class="ytchag_info" title="<?php _e( '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.', 'youtube-channel-gallery' ); ?>">?</span>
298
+ </p>
299
+ </div>
300
+ </fieldset>
301
+
302
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_nofollow'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_nofollow' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_nofollow' ); ?>" />
303
+ <label for="<?php echo $this->get_field_id( 'ytchag_nofollow' ); ?>"><?php _e( 'Add "nofollow" attribute to links', 'youtube-channel-gallery' ); ?></label>
304
+ <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>
305
+
306
+
307
+ <span class="thumb_window">
308
+ </br>
309
+ <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' ); ?>" />
310
+ <label for="<?php echo $this->get_field_id( 'ytchag_thumb_window' ); ?>"><?php _e( 'Open in a new window or tab', 'youtube-channel-gallery' ); ?></label>
311
+ </span>
312
+ <br>
313
+ <!-- <br>
314
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_pagination_show'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_pagination_show' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_pagination_show' ); ?>" />
315
+ <label for="<?php echo $this->get_field_id( 'ytchag_pagination_show' ); ?>"><?php _e( 'Show pagination', 'youtube-channel-gallery' ); ?></label>
316
+ --> <p>
317
+ <label><?php _e( 'Order:', 'youtube-channel-gallery' ); ?></label>
318
+ <br>
319
+ <?php _e( 'Thumbnail:', 'youtube-channel-gallery' ); ?>
320
+ <input size="1" class="" id="<?php echo $this->get_field_id( 'ytchag_thumb_order_thumb' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_order_thumb' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_order_thumb); ?>" />
321
+ <?php _e( 'Title:', 'youtube-channel-gallery' ); ?>
322
+ <input size="1"class="" id="<?php echo $this->get_field_id( 'ytchag_thumb_order_title' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_order_title' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_order_title); ?>" />
323
+ <?php _e( 'Description:', 'youtube-channel-gallery' ); ?>
324
+ <input size="1" class="" id="<?php echo $this->get_field_id( 'ytchag_thumb_order_desc' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_order_desc' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_order_desc); ?>" />
325
+ </p>
326
+ </p>
327
+ <p class="<?php echo $this->get_field_id( 'ytchag_thumb_order' ); ?>">
328
+ <label for="<?php echo $this->get_field_id( 'ytchag_thumb_order' ); ?>"><?php _e( 'Order:', 'youtube-channel-gallery' ); ?></label>
329
+ <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_thumb_order' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_order' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_order); ?>" />
330
+ </p>
331
+
332
+ </div>
333
+
334
+
335
+ <?php
336
+ /*
337
+ Link Tab
338
+ --------------------
339
+ */
340
+ ?>
341
+ <div id="tabs-<?php echo $this->id; ?>-5" class="ytchgtabs-content tabs-5">
342
+
343
+ <p>
344
+ <label for="<?php echo $this->get_field_id( 'ytchag_link_tx' ); ?>"><?php _e( 'Link text:', 'youtube-channel-gallery' ); ?></label>
345
+ <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_link_tx' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_link_tx' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_link_tx ); ?>" />
346
+ </p>
347
+
348
+ <p>
349
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_link'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_link' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_link' ); ?>" />
350
+ <label for="<?php echo $this->get_field_id( 'ytchag_link' ); ?>"><?php _e( 'Show link to channel', 'youtube-channel-gallery' ); ?></label>
351
+
352
+ </br>
353
+
354
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_link_window'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_link_window' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_link_window' ); ?>" />
355
+ <label for="<?php echo $this->get_field_id( 'ytchag_link_window' ); ?>"><?php _e( 'Open in a new window or tab', 'youtube-channel-gallery' ); ?></label>
356
+ </p>
357
+
358
+ <p>
359
+ <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_promotion'], true, true ); ?> id="<?php echo $this->get_field_id( 'ytchag_promotion' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_promotion' ); ?>" />
360
+ <label for="<?php echo $this->get_field_id( 'ytchag_promotion' ); ?>"><?php _e( 'Show link to thank the developer', 'youtube-channel-gallery' ); ?></label>
361
+
362
+ </p>
363
+
364
+ <p class="<?php echo $this->get_field_id( 'ytchag_link_order' ); ?>">
365
+ <label for="<?php echo $this->get_field_id( 'ytchag_link_order' ); ?>"><?php _e( 'Order:', 'youtube-channel-gallery' ); ?></label>
366
+ <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_link_order' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_link_order' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_link_order); ?>" />
367
+ </p>
368
+
369
+ </div>
370
+ </div>
371
+
372
+
373
+
374
+ </div>
375
+
templates/desc.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <div class="ytctdescription">
2
+ <?php echo ($ytchag_description_words_number ? implode(' ', array_slice(explode(' ', $thumb->description), 0, $ytchag_description_words_number)) : $thumb->description)?>
3
+ </div>
4
+
templates/link.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ($ytchag_promotion || $ytchag_link): ?>
2
+
3
+ <div class="ytc-pslb ytc-links container-fluid">
4
+ <div class="ytc-row row">
5
+ <?php if ($ytchag_promotion): ?>
6
+ <div class="ytc-promotion <?php echo empty($ytchag_link) ? 'col-xs-12' : 'col-xs-5'; ?>">
7
+ <a href="http://poselab.com" target="_blank">
8
+ <em>
9
+ <?php echo _e('By PoseLab', 'youtube-channel-gallery')?>
10
+ </em>
11
+ </a>
12
+ </div>
13
+ <?php endif; ?>
14
+
15
+ <?php if ($ytchag_link): ?>
16
+ <div class="ytc-youtubelink <?php echo empty($ytchag_promotion) ? 'col-xs-12' : 'col-xs-7'; ?>">
17
+ <a href="https://www.youtube.com/playlist?list=<?php echo $ytchag_playlist?>" class="ytcmore" <?php echo ($ytchag_link_window ? 'target="_blank"' : '')?>>
18
+ <?php echo ($ytchag_link_tx ? $ytchag_link_tx : _e('Show more videos', 'youtube-channel-gallery'))?>
19
+ </a>
20
+ </div>
21
+ <?php endif; ?>
22
+ </div>
23
+ </div>
24
+
25
+ <?php endif; ?>
templates/player.php CHANGED
@@ -1,15 +1,6 @@
1
- <?php
2
-
3
- // Load js
4
- $this->register_scripts();
5
-
6
- //player
7
- //------------
8
-
9
- // to control the width of the
10
- $content = '<div class="ytcplayer-fixwidthwrapper">';
11
- $content .= '<div class="ytcplayer-wrapper ytc-player' . $ytchag_ratio . '">';
12
-
13
- //iframe
14
- $content .= '<iframe id="ytcplayer' . $plugincount . '" class="ytcplayer" allowfullscreen src="' . $youtube_url . '/embed/' . $youtubeid . '?version=3' . $ytchag_theme . $ytchag_color . $ytchag_autoplay. $ytchag_modestbranding . $ytchag_rel . $ytchag_showinfo .'&enablejsapi=1&wmode=transparent" frameborder="0"></iframe>';
15
- $content .= '</div></div>';
1
+ <?php $embed_responsive = $ytchag_ratio == '4x3' ? 'embed-responsive-4by3' : 'embed-responsive-16by9'; ?>
2
+ <div class="ytc-pslb ytcplayer-wrapper" style="width:<?php echo $ytchag_width_value?><?php echo $ytchag_width_type?>;">
3
+ <div class="embed-responsive <?php echo $embed_responsive?>">
4
+ <iframe id="ytcplayer<?php echo $plugincount?>" class="ytcplayer" allowfullscreen src="<?php echo $youtube_url?>/embed/<?php echo $youtubeid?>?version=3<?php echo $ytchag_theme?><?php echo $ytchag_color?><?php echo $ytchag_autoplay?><?php echo $ytchag_modestbranding?><?php echo $ytchag_rel?><?php echo $ytchag_showinfo?>&enablejsapi=1&wmode=transparent" frameborder="0"></iframe>
5
+ </div>
6
+ </div>
 
 
 
 
 
 
 
 
 
templates/search.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ($ytchag_search_input_show): ?>
2
+ <input class="search" type="search" data-cid="<?php echo $ytchag_id ?>" data-wid="<?php echo $this->number ?>" placeholder="<?php echo $ytchag_search_input?>">
3
+ <?php endif; ?>
4
+ <?php if ($ytchag_search_playlists_show): ?>
5
+ <?php $campos = array(); ?>
6
+ <?php if ($instance['ytchag_search_playlists']): ?>
7
+ <?php $campos = explode('#', $instance['ytchag_search_playlists']); ?>
8
+ <?php endif; ?>
9
+ <select class="search-select">
10
+ <option value=""><?php echo _e('None', 'youtube-channel-gallery') ?></option>
11
+ <?php foreach ($campos as $c): ?>
12
+ <?php $tag = toTag($c); ?>
13
+ <option value="<?php echo $tag ?>"<?php selected( $instance['ytchag_search_restrict'], $tag ); ?>><?php _e( $c, 'youtube-channel-gallery' ); ?></option>
14
+ <?php endforeach; ?>
15
+ </select>
16
+ <?php endif; ?>
templates/thumb.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <div class="ytcthumb-cont"<?php echo (($ytchag_thumbnail_alignment != 'none') ? 'style="width:'.$ytchag_thumb_width.'px!important;"' : '')?>>
2
+ <a class="ytcthumb <?php echo (($ytchag_player == 2) ? 'popup-youtube' : 'ytclink')?>" href="https://www.youtube.com/watch?v=<?php echo $thumb->id?>" data-playerid="ytcplayer<?php echo $plugincount?>" data-quality="<?php echo $thumb->quality?>" title="<?php echo $thumb->title?>" style="background-image:url(<?php echo $thumb->img?>);" <?php echo ($ytchag_nofollow ? 'rel="nofollow"' : '')?> <?php echo ($ytchag_thumb_window ? 'target="_blank"' : '')?>>
3
+ <div class="ytcplay"></div>
4
+ </a>
5
+ </div>
6
+
templates/thumbs.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="ytc-pslb ytc-thumbnails container-fluid ytc-thumb<?php echo $ytchag_thumb_ratio?> ytc-thumb-align-<?php echo $ytchag_thumbnail_alignment?>">
2
+
3
+ <?php $i = 0; ?>
4
+ <?php $col = 1; ?>
5
+ <?php foreach ($thumbs as $thumb): ?>
6
+ <?php if ($i % $ytchag_thumb_columns_ld === 0): ?>
7
+ <?php if ($i > 0): ?>
8
+ </div>
9
+ <?php endif; ?>
10
+
11
+ <div class="ytc-row row">
12
+ <?php $col += 1; ?>
13
+ <?php $i = 0; ?>
14
+ <?php endif; ?>
15
+ <?php $xs = $ytchag_thumb_columns_phones ? $ytchag_thumb_columns_phones : '1'; ?>
16
+ <?php $sm = $ytchag_thumb_columns_tablets ? $ytchag_thumb_columns_tablets : '2'; ?>
17
+ <?php $md = $ytchag_thumb_columns_md ? $ytchag_thumb_columns_md : '3'; ?>
18
+ <?php $lg = $ytchag_thumb_columns_ld ? $ytchag_thumb_columns_ld : '4'; ?>
19
+ <?php
20
+ $gutter = 7;
21
+ if ($ytchag_thumbnail_alignment == 'left') {
22
+ $padding = 'style="padding:0 '.$gutter.'px 0 '. ($ytchag_thumb_width + 2*$gutter) .'px!important;"';
23
+ }
24
+ if ($ytchag_thumbnail_alignment == 'right') {
25
+ $padding = 'style="padding:0 '. ($ytchag_thumb_width + 2*$gutter) .'px 0 '.$gutter.'px!important;"';
26
+ }
27
+ ?>
28
+
29
+ <div class="ytc-column col-xs-<?php echo 12/$xs?> col-sm-<?php echo 12/$sm?> col-md-<?php echo 12/$md?> col-lg-<?php echo 12/$lg?>" <?php echo $padding?>>
30
+ <?php
31
+ foreach ($thumb->modules as $module) {
32
+ if ($module === 'title' && $ytchag_title) {
33
+ include 'title.php';
34
+ }
35
+ elseif ($module === 'desc' && $ytchag_description) {
36
+ include 'desc.php';
37
+ }
38
+ elseif ($module !== 'title' && $module !== 'desc') {
39
+ include $module . '.php';
40
+ }
41
+ }
42
+ ?>
43
+ </div> <?php //end col- ?>
44
+
45
+ <?php $i += 1; ?>
46
+ <?php endforeach; ?>
47
+
48
+ </div> <?php //end row ?>
49
+
50
+ <?php //Pagination ?>
51
+ <?php if ($ytchag_pagination_show): ?>
52
+ <div class="ytc-pagination row">
53
+ <div class="col-xs-4 ytc-previous">
54
+ <?php if ($ytchag_prev_token): ?>
55
+ <a class="ytc-paginationlink ytc-previous" data-cid="<?php echo $ytchag_id ?>" data-wid="<?php echo $this->number ?>" data-playlist="<?php echo $ytchag_playlist?>" data-token="<?php echo $ytchag_prev_token?>"><?php _e( '«Previous', 'youtube-channel-gallery' );?></a>
56
+ <?php endif; ?>
57
+ </div>
58
+ <div class="col-xs-4 ytc-numeration">
59
+ <?php $total_pages = ceil( $ytchag_total_results / $ytchag_results_per_page );?>
60
+ <span class="ytc-currentpage">1</span><span class="ytc-separator">/</span><span class="ytc-totalpages"><?php echo $total_pages ?></span>
61
+ </div>
62
+ <div class="col-xs-4 ytc-next">
63
+ <?php if ($ytchag_next_token): ?>
64
+ <a class="ytc-paginationlink ytc-next" data-cid="<?php echo $ytchag_id ?>" data-wid="<?php echo $this->number ?>" data-playlist="<?php echo $ytchag_playlist?>" data-token="<?php echo $ytchag_next_token?>"><?php _e( 'Next»', 'youtube-channel-gallery' );?></a>
65
+ <?php endif; ?>
66
+ </div>
67
+ </div>
68
+ <?php endif; ?>
69
+
70
+ </div> <?php //end container ?>
71
+
templates/title.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <<?php echo $ytchag_title_tag?> class="ytctitle">
2
+ <a class="<?php echo (($ytchag_player == 2) ? 'popup-youtube' : 'ytclink')?>" href="https://www.youtube.com/watch?v=<?php echo $thumb->id?>" data-playerid="ytcplayer<?php echo $plugincount?>" data-quality="<?php echo $thumb->quality?>" alt="<?php echo $thumb->title?>" title="<?php echo $thumb->title?>" <?php echo ($ytchag_nofollow ? 'rel="nofollow"' : '')?> <?php echo ($ytchag_thumb_window ? 'target="_blank"' : '')?>><?php echo $thumb->title?></a>
3
+ </<?php echo $ytchag_title_tag?>>
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.7
9
  License: GPL2
10
 
11
  Copyright 2013 Javier Gómez Pose (email : javierpose@gmail.com)
@@ -40,6 +40,8 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
40
 
41
  //load admin scripts
42
  add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts_and_styles' ) );
 
 
43
 
44
  parent::__construct(
45
  'youtubechannelgallery_widget', // Base ID
@@ -49,9 +51,192 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
49
 
50
  array( 'width' => 260 )
51
  );
 
 
 
 
 
 
52
  }
53
 
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  /**
57
  * Front-end display of widget.
@@ -66,7 +251,9 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
66
  echo $before_title . $title . $after_title;
67
  }
68
 
69
- echo $this->ytchag_rss_markup( $instance );
 
 
70
 
71
  echo $after_widget;
72
  }
@@ -79,14 +266,20 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
79
  $instance['title'] = strip_tags( $new_instance['title'] );
80
 
81
  // Feed options
 
82
  $instance['ytchag_feed'] = strip_tags( $new_instance['ytchag_feed'] );
83
  $instance['ytchag_user'] = strip_tags( $new_instance['ytchag_user'] );
 
 
 
84
  $instance['ytchag_feed_order'] = strip_tags( $new_instance['ytchag_feed_order'] );
85
  $instance['ytchag_cache_time'] = strip_tags( $new_instance['ytchag_cache_time'] );
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'] );
@@ -95,24 +288,55 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
95
  $instance['ytchag_modestbranding'] = strip_tags( $new_instance['ytchag_modestbranding'] );
96
  $instance['ytchag_rel'] = strip_tags( $new_instance['ytchag_rel'] );
97
  $instance['ytchag_showinfo'] = strip_tags( $new_instance['ytchag_showinfo'] );
 
 
 
 
 
 
 
 
 
98
 
99
  // Thumbnail options
100
  $instance['ytchag_maxitems'] = strip_tags( $new_instance['ytchag_maxitems'] );
101
  $instance['ytchag_thumb_width'] = strip_tags( $new_instance['ytchag_thumb_width'] );
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'] );
109
  $instance['ytchag_thumbnail_alignment'] = strip_tags( $new_instance['ytchag_thumbnail_alignment'] );
 
110
  $instance['ytchag_description_words_number'] = strip_tags( $new_instance['ytchag_description_words_number'] );
111
 
112
  // Link options
113
  $instance['ytchag_link'] = $new_instance['ytchag_link'];
114
  $instance['ytchag_link_tx'] = strip_tags( $new_instance['ytchag_link_tx'] );
115
  $instance['ytchag_link_window'] = strip_tags( $new_instance['ytchag_link_window'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
  return $instance;
118
  }
@@ -125,15 +349,21 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
125
  'title' => 'Videos',
126
 
127
  // Feed options
 
128
  'ytchag_feed' => 'user',
129
  'ytchag_user' => 'youtube',
 
 
 
130
  'ytchag_feed_order' => 'asc',
131
  'ytchag_cache_time' => '24',
132
- 'ytchag_cache' => '1',
133
 
134
  // Player options
135
  'ytchag_player' => '1',
136
- 'ytchag_ratio' => '4x3',
 
 
137
  'ytchag_theme' => 'dark',
138
  'ytchag_color' => 'red',
139
  'ytchag_quality' => 'default',
@@ -141,24 +371,45 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
141
  'ytchag_modestbranding' => '',
142
  'ytchag_rel' => '',
143
  'ytchag_showinfo' => '',
 
 
 
 
 
 
 
 
 
144
 
145
  // Thumbnail options
146
- 'ytchag_maxitems' => '9',
147
- 'ytchag_thumb_width' => '90',
148
- 'ytchag_thumb_ratio' => '4x3',
149
- 'ytchag_thumb_columns' => '3',
 
 
 
150
  'ytchag_nofollow' => '',
151
  'ytchag_thumb_window' => '',
 
 
 
 
 
152
 
153
  'ytchag_title' => '',
154
  'ytchag_description' => '',
155
- 'ytchag_thumbnail_alignment' => 'top',
 
156
  'ytchag_description_words_number' => '',
157
 
158
  // Link options
159
- 'ytchag_link' => '',
160
  'ytchag_link_tx' => '',
161
  'ytchag_link_window' => '',
 
 
 
162
 
163
 
164
  );
@@ -168,287 +419,33 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
168
  // extract them for cleaner code
169
  extract( $instance, EXTR_SKIP );
170
 
171
- ?>
172
-
173
- <div class="ytchg">
174
- <p>
175
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'youtube-channel-gallery' ); ?></label>
176
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
177
- </p>
178
-
179
- <div id="tabs-<?php echo $this->id; ?>" class="ytchgtabs">
180
- <ul class="ytchgtabs-tabs">
181
- <li><a href=".tabs-1"><?php _e( 'Feed', 'youtube-channel-gallery' ); ?></a></li>
182
- <li><a href=".tabs-2"><?php _e( 'Player', 'youtube-channel-gallery' ); ?></a></li>
183
- <li><a href=".tabs-3"><?php _e( 'Thumbnails', 'youtube-channel-gallery' ); ?></a></li>
184
- <li><a href=".tabs-4"><?php _e( 'Link', 'youtube-channel-gallery' ); ?></a></li>
185
- </ul>
186
-
187
-
188
- <?php
189
- /*
190
- Feed Tab
191
- --------------------
192
- */
193
- ?>
194
- <div id="tabs-<?php echo $this->id; ?>-1" class="ytchgtabs-content tabs-1">
195
-
196
- <p>
197
- <label for="<?php echo $this->get_field_id( 'ytchag_feed' ); ?>"><?php _e( 'Video feed type:', 'youtube-channel-gallery' ); ?></label>
198
- <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_feed' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_feed' ); ?>">
199
- <option value="user"<?php selected( $instance['ytchag_feed'], 'user' ); ?>><?php _e( 'Uploaded by a user', 'youtube-channel-gallery' ); ?></option>
200
- <?php /*<option value="favorites"<?php selected( $instance['ytchag_feed'], 'favorites' ); ?>><?php _e( 'User\'s favorites', 'youtube-channel-gallery' ); ?></option>*/?>
201
- <option value="playlist"<?php selected( $instance['ytchag_feed'], 'playlist' ); ?>><?php _e( 'Playlist', 'youtube-channel-gallery' ); ?></option>
202
- </select>
203
- </p>
204
-
205
- <p>
206
- <label class="feed_user_id_label" for="<?php echo $this->get_field_id( 'ytchag_user' ); ?>"><?php _e( 'YouTube user id:', 'youtube-channel-gallery' ); ?></label>
207
- <label class="feed_playlist_id_label" for="<?php echo $this->get_field_id( 'ytchag_user' ); ?>"><?php _e( 'YouTube playlist id:', 'youtube-channel-gallery' ); ?></label>
208
- <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_user' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_user' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_user ); ?>" />
209
- </p>
210
-
211
- <p class="<?php echo $this->get_field_id( 'ytchag_feed_order' ); ?>">
212
- <label for="<?php echo $this->get_field_id( 'ytchag_feed_order' ); ?>"><?php _e( 'Playlist order:', 'youtube-channel-gallery' ); ?></label>
213
- <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_feed_order' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_feed_order' ); ?>">
214
- <option value="asc"<?php selected( $instance['ytchag_feed_order'], 'asc' ); ?>><?php _e( 'Ascending Order', 'youtube-channel-gallery' ); ?></option>
215
- <option value="desc"<?php selected( $instance['ytchag_feed_order'], 'desc' ); ?>><?php _e( 'Descending Order', 'youtube-channel-gallery' ); ?></option>
216
- </select>
217
- </p>
218
-
219
- <p class="<?php echo $this->get_field_id( 'ytchag_cache_time' ); ?>">
220
- <label for="<?php echo $this->get_field_id( 'ytchag_cache_time' ); ?>"><?php _e( 'Cache time (hours):', 'youtube-channel-gallery' ); ?></label>
221
- <input class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_cache_time' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_cache_time' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_cache_time ); ?>" />
222
- <span class="ytchag_info" title="<?php _e( '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.', 'youtube-channel-gallery' ); ?>">?</span>
223
- </p>
224
-
225
- <p class="<?php echo $this->get_field_id( 'ytchag_cache' ); ?>">
226
- <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_cache'], true, true ); ?> id="<?php echo $this->get_field_id( 'ytchag_cache' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_cache' ); ?>" />
227
- <label for="<?php echo $this->get_field_id( 'ytchag_cache' ); ?>"><?php _e( 'Activate cache', 'youtube-channel-gallery' ); ?></label>
228
- <span class="ytchag_info" title="<?php _e( '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.', 'youtube-channel-gallery' ); ?>">?</span>
229
- </p>
230
-
231
- </div>
232
-
233
-
234
- <?php
235
- /*
236
- Player Tab
237
- --------------------
238
- */
239
- ?>
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
-
313
-
314
- <?php
315
- /*
316
- Thumbnails Tab
317
- --------------------
318
- */
319
- ?>
320
- <div id="tabs-<?php echo $this->id; ?>-3" class="ytchgtabs-content tabs-3">
321
- <p>
322
- <label for="<?php echo $this->get_field_id( 'ytchag_maxitems' ); ?>"><?php _e( 'Number of videos to show:', 'youtube-channel-gallery' ); ?></label>
323
- <input class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_maxitems' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_maxitems' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_maxitems ); ?>" />
324
- <span class="ytchag_info" title="<?php _e( 'The plugin can display a maximum of 50 videos. This limitation will change in a future release.', 'youtube-channel-gallery' ); ?>">?</span>
325
- </p>
326
-
327
- <p>
328
- <label for="<?php echo $this->get_field_id( 'ytchag_thumb_width' ); ?>"><?php _e( 'Thumbnail width:', 'youtube-channel-gallery' ); ?></label>
329
- <input class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_thumb_width' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_width' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_width ); ?>" />
330
- <span class="ytchag_info" title="<?php _e( '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', 'youtube-channel-gallery' ); ?>">?</span>
331
- </p>
332
-
333
- <p>
334
-
335
- <label for="<?php echo $this->get_field_id( 'ytchag_thumb_ratio' ); ?>"><?php _e( 'Aspect ratio:', 'youtube-channel-gallery' ); ?></label>
336
- <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_thumb_ratio' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_ratio' ); ?>">
337
- <option value="4x3"<?php selected( $instance['ytchag_thumb_ratio'], '4x3' ); ?>><?php _e( 'Standard (4x3)', 'youtube-channel-gallery' ); ?></option>
338
- <option value="16x9"<?php selected( $instance['ytchag_thumb_ratio'], '16x9' ); ?>><?php _e( 'Widescreen (16x9)', 'youtube-channel-gallery' ); ?></option>
339
- </select>
340
- </p>
341
-
342
- <p>
343
- <label for="<?php echo $this->get_field_id( 'ytchag_thumb_columns' ); ?>"><?php _e( 'Thumbnail columns:', 'youtube-channel-gallery' ); ?></label>
344
- <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_thumb_columns' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumb_columns' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_thumb_columns ); ?>" />
345
- </p>
346
-
347
-
348
- <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_nofollow'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_nofollow' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_nofollow' ); ?>" />
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' ); ?>" />
369
- <label for="<?php echo $this->get_field_id( 'ytchag_title' ); ?>"><?php _e( 'Show title', 'youtube-channel-gallery' ); ?></label>
370
- </p>
371
-
372
- <p>
373
- <input class="checkbox ytchg-desc" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_description'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_description' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_description' ); ?>" />
374
- <label for="<?php echo $this->get_field_id( 'ytchag_description' ); ?>"><?php _e( 'Show description', 'youtube-channel-gallery' ); ?></label>
375
- </p>
376
-
377
- <p>
378
- <label for="<?php echo $this->get_field_id( 'ytchag_thumbnail_alignment' ); ?>"><?php _e( 'Thumbnail alignment:', 'youtube-channel-gallery' ); ?></label>
379
- <select class="widefat" id="<?php echo $this->get_field_id( 'ytchag_thumbnail_alignment' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_thumbnail_alignment' ); ?>">
380
- <option value="left"<?php selected( $instance['ytchag_thumbnail_alignment'], 'left' ); ?>><?php _e( 'Left', 'youtube-channel-gallery' ); ?></option>
381
- <option value="right"<?php selected( $instance['ytchag_thumbnail_alignment'], 'right' ); ?>><?php _e( 'Right', 'youtube-channel-gallery' ); ?></option>
382
- <option value="top"<?php selected( $instance['ytchag_thumbnail_alignment'], 'top' ); ?>><?php _e( 'Top', 'youtube-channel-gallery' ); ?></option>
383
- <option value="bottom"<?php selected( $instance['ytchag_thumbnail_alignment'], 'bottom' ); ?>><?php _e( 'Bottom', 'youtube-channel-gallery' ); ?></option>
384
- </select>
385
- </p>
386
-
387
- <p>
388
- <label for="<?php echo $this->get_field_id( 'ytchag_description_words_number' ); ?>"><?php _e( 'Description words number:', 'youtube-channel-gallery' ); ?></label>
389
- <input class="widefat wideinfo" id="<?php echo $this->get_field_id( 'ytchag_description_words_number' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_description_words_number' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_description_words_number ); ?>" />
390
- <span class="ytchag_info" title="<?php _e( '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.', 'youtube-channel-gallery' ); ?>">?</span>
391
- </p>
392
- </div>
393
- </fieldset>
394
- </p>
395
-
396
-
397
-
398
- </div>
399
-
400
-
401
- <?php
402
- /*
403
- Link Tab
404
- --------------------
405
- */
406
- ?>
407
- <div id="tabs-<?php echo $this->id; ?>-4" class="ytchgtabs-content tabs-4">
408
-
409
- <p>
410
- <label for="<?php echo $this->get_field_id( 'ytchag_link_tx' ); ?>"><?php _e( 'Link text:', 'youtube-channel-gallery' ); ?></label>
411
- <input class="widefat" id="<?php echo $this->get_field_id( 'ytchag_link_tx' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_link_tx' ); ?>" type="text" value="<?php echo esc_attr( $ytchag_link_tx ); ?>" />
412
- </p>
413
-
414
- <p>
415
- <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_link'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_link' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_link' ); ?>" />
416
- <label for="<?php echo $this->get_field_id( 'ytchag_link' ); ?>"><?php _e( 'Show link to channel', 'youtube-channel-gallery' ); ?></label>
417
-
418
- </br>
419
-
420
- <input class="checkbox" type="checkbox" value="1" <?php checked( (bool) $instance['ytchag_link_window'], true ); ?> id="<?php echo $this->get_field_id( 'ytchag_link_window' ); ?>" name="<?php echo $this->get_field_name( 'ytchag_link_window' ); ?>" />
421
- <label for="<?php echo $this->get_field_id( 'ytchag_link_window' ); ?>"><?php _e( 'Open in a new window or tab', 'youtube-channel-gallery' ); ?></label>
422
- </p>
423
-
424
- </div>
425
- </div>
426
-
427
-
428
-
429
- </div>
430
-
431
- <?php
432
  }
433
 
434
 
435
  /*--------------------------------------------------*/
436
  /* Private Functions
437
  /*--------------------------------------------------*/
438
- private function ytchag_rss_markup( $instance ) {
439
 
 
440
  //$instance variables
441
  //--------------------------------
442
 
443
  // Feed options
 
444
  $ytchag_feed = apply_filters( 'ytchag_feed', $instance['ytchag_feed'] );
445
  $ytchag_user = apply_filters( 'ytchag_user', $instance['ytchag_user'] );
 
 
 
446
  $ytchag_feed_order = apply_filters( 'ytchag_feed_order', $instance['ytchag_feed_order'] );
447
  $ytchag_cache_time = (int) apply_filters( 'ytchag_cache_time', $instance['ytchag_cache_time'] );
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'] );
@@ -457,24 +454,46 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
457
  $ytchag_modestbranding = apply_filters( 'ytchag_modestbranding', $instance['ytchag_modestbranding'] );
458
  $ytchag_rel = apply_filters( 'ytchag_rel', $instance['ytchag_rel'] );
459
  $ytchag_showinfo = apply_filters( 'ytchag_showinfo', $instance['ytchag_showinfo'] );
 
 
 
 
 
 
 
 
 
460
 
461
  // Thumbnail options
462
  $ytchag_maxitems = apply_filters( 'ytchag_maxitems', $instance['ytchag_maxitems'] );
463
  $ytchag_thumb_width = apply_filters( 'ytchag_thumb_width', $instance['ytchag_thumb_width'] );
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'] );
471
  $ytchag_thumbnail_alignment = apply_filters( 'ytchag_thumbnail_alignment', $instance['ytchag_thumbnail_alignment'] );
 
472
  $ytchag_description_words_number = apply_filters( 'ytchag_description_words_number', $instance['ytchag_description_words_number'] );
473
 
474
  // Link options
475
  $ytchag_link = apply_filters( 'ytchag_link', $instance['ytchag_link'] );
476
  $ytchag_link_tx = apply_filters( 'ytchag_link_tx', $instance['ytchag_link_tx'] );
477
  $ytchag_link_window = apply_filters( 'ytchag_link_window', $instance['ytchag_link_window'] );
 
 
 
 
478
  //--------------------------------
479
  //end $instance variables
480
 
@@ -483,11 +502,14 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
483
  //--------------------------------
484
 
485
  // Feed options
 
486
  $ytchag_feed = ( $ytchag_feed ) ? $ytchag_feed : 'user'; //default user
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
@@ -495,6 +517,15 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
495
  $ytchag_modestbranding = ( $ytchag_modestbranding ) ? '' : '&modestbranding='. $ytchag_modestbranding; //default 0
496
  $ytchag_rel = ( $ytchag_rel ) ? '&rel='. $ytchag_rel : '&rel=0'; //default 1
497
  $ytchag_showinfo = ( $ytchag_showinfo ) ? '&showinfo='. $ytchag_showinfo : '&showinfo=0'; //default 1
 
 
 
 
 
 
 
 
 
498
 
499
  // Thumbnail options
500
  $ytchag_maxitems = ( $ytchag_maxitems ) ? $ytchag_maxitems : 9;
@@ -502,342 +533,182 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
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;
511
  $ytchag_description = ( $ytchag_description ) ? $ytchag_description : 0;
512
- $ytchag_thumbnail_alignment = ( $ytchag_thumbnail_alignment ) ? $ytchag_thumbnail_alignment : 'top';
 
513
  $ytchag_description_words_number = ( $ytchag_description_words_number ) ? $ytchag_description_words_number : 10;
514
 
515
  // Link options
516
  $ytchag_link = ( $ytchag_link ) ? $ytchag_link : 0;
517
  $ytchag_link_tx = ( $ytchag_link_tx ) ? $ytchag_link_tx : __( 'Show more videos»', 'youtube-channel-gallery' );
518
  $ytchag_link_window = ( $ytchag_link_window ) ? 'target="_blank"' : '';
519
- //--------------------------------
520
- //end defaults
521
-
522
-
523
 
524
-
525
- // YouTube feed types
526
  //--------------------------------
 
527
 
528
- // only if user name inserted
529
  if ( empty( $ytchag_user ) ) {
530
  $content= '<p class="empty">' . __( 'There is no video to show.', 'youtube-channel-gallery' ) . '</p>';
531
 
532
  } else {
533
- $youtube_feed_url = 'http://gdata.youtube.com/feeds/api';
534
- $youtube_url = 'https://www.youtube.com';
535
 
536
- // links
537
- if ( $ytchag_feed == 'user' ) {
538
- $ytchag_rss_url = $youtube_feed_url . '/users/' . $ytchag_user . '/uploads?v=2&max-results='. $ytchag_maxitems;
539
- $ytchag_link_url = $youtube_url . '/user/' . $ytchag_user;
540
- }
541
- if ( $ytchag_feed == 'favorites' ) {
542
- $ytchag_rss_url = $youtube_feed_url . '/users/' . $ytchag_user . '/favorites';
543
- $ytchag_link_url = $youtube_url . '/user/' . $ytchag_user . '/favorites';
544
- }
545
- if ( $ytchag_feed == 'playlist' ) {
546
- $ytchag_rss_url = $youtube_feed_url . '/playlists/' . $ytchag_user . '?v=2&max-results=' . $ytchag_maxitems;
547
- $ytchag_link_url = $youtube_url . '/playlist?list=' . $ytchag_user;
548
- }
549
 
550
- //HTTP API
551
 
552
- $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_maxitems );
 
553
 
554
- $videos_result = $this->get_rss_data ( $ytchag_cache, $transientId, $ytchag_rss_url, $ytchag_cache_time );
 
 
 
555
 
556
- $rss = simplexml_load_string( $videos_result['body'] );
557
 
558
- $response_code = wp_remote_retrieve_response_code( $videos_result );
559
- $response_message = wp_remote_retrieve_response_message( $videos_result );
560
- $entries = $rss;
 
561
 
562
- if ( $ytchag_feed == 'playlist' && $ytchag_feed_order == 'desc' ) {
563
- $totalResults = $rss->children( 'openSearch', true )->totalResults;
 
 
 
 
564
 
565
- //get rss playlist again with the last videos. YouTube does not load in the first request, even if the orderby parameter is set.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
566
 
567
- //Youtube feed limit is 1000
568
- if ( $totalResults >= 1000 ) {
569
- $startindex = 1000 - $ytchag_maxitems + 1;
570
- } elseif ( $ytchag_maxitems >= $totalResults ) {
571
- $startindex = 1;
572
- } else {
573
- $startindex = $totalResults - $ytchag_maxitems + 1;
574
- }
575
 
576
- $ytchag_rss_url = $youtube_feed_url . '/playlists/' . $ytchag_user . '?v=2&start-index=' . $startindex . '&max-results=' . $ytchag_maxitems;// . '&orderby=reversedPosition';
 
577
 
578
- $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_feed_order . $ytchag_maxitems );
579
 
580
- $videos_result = $this->get_rss_data ( $ytchag_cache, $transientId, $ytchag_rss_url, $ytchag_cache_time );
581
- $rss = simplexml_load_string( $videos_result['body'] );
 
 
 
582
 
583
- $response_code = wp_remote_retrieve_response_code( $videos_result );
584
- $response_message = wp_remote_retrieve_response_message( $videos_result );
585
 
586
- // parameter orderby=reversedPosition of Google Data API is not working, so I will use this to reverse the order
587
- //get entries
588
 
589
- $new_rss = new stdClass();
590
- for ( $i = sizeof( $rss->entry ) - 1; $i >= 0; --$i ) {
591
- $new_rss->entry[$i] = $rss->entry[$i];
592
- }
593
- $entries = $new_rss;
594
-
595
- }
596
-
597
- }
598
-
599
-
600
-
601
- // content
602
- //--------------------------------
603
- if ( $response_code != 200 ) {
604
- $content= '<div class="vmcerror">' . sprintf( __( '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.', 'youtube-channel-gallery' ), $response_message, $ytchag_link_url, $ytchag_user, $ytchag_feed ) . '</div>';
605
- } else {
606
-
607
- //playlist descending order
608
- //get totalResults from playlist rss to order correctly videos
609
-
610
-
611
-
612
- $thumb_count = 0;
613
- $column = 0;
614
- static $plugincount = 0;
615
- $rowcount = 0;
616
- $namespaces=$rss->getNameSpaces( true ); // access all the namespaces used in the tree
617
- array_unshift( $namespaces, "" ); // add a blank at the beginning of the array to deal with the unprefixed default
618
-
619
-
620
-
621
- foreach ( $entries->entry as $entry ) {
622
- // get nodes in media: namespace for media information
623
- $media = $entry->children( 'http://search.yahoo.com/mrss/' );
624
-
625
- // get video player URL
626
- $url = $media->group->player->attributes();
627
-
628
- // get video player id
629
- $yt = $media->children( 'http://gdata.youtube.com/schemas/2007' );
630
- $youtubeid = $yt->videoid;
631
-
632
- // get video title
633
- $title = $media->group->title;
634
-
635
- // get video description
636
- $description = $media->group->description;
637
-
638
- //check if thumbnails exist (to avoid Accounts suspended)
639
- if(!isset($media->group->thumbnail[0])){
640
- continue;
641
- }
642
 
643
- //default url thumbnail
644
- $thumb_attrs = $media->group->thumbnail[0]->attributes();
645
- $thumbnail = $thumb_attrs['url'];
646
-
647
- $thumbs = $media->group->thumbnail;
648
- $thumb_attrs = array();
649
- $index = 0;
650
-
651
- // get thumbnails attributes: url | height | width
652
- //mqdefault: 320x180 (16:9)
653
- foreach ( $thumbs as $thumb ) {
654
- $attrstring="";
655
- foreach ( $namespaces as $ns ) {
656
- foreach ( $thumb->attributes( $ns ) as $attr => $value ) { // get all attributes, whatever namespace they might be in
657
- $thumb_attrs[$index][$attr] = $value;
658
- $attrstring.=$attr . ': ' . $thumb_attrs[$index][$attr] . "| ";
659
- }
660
- }
661
- $index++;
662
- }
663
-
664
-
665
- // default; w: 120; h: 90; 4x3
666
- // mqdefault; w: 320; h: 180; 16x9
667
- // hqdefault; w: 480; h: 360; 4x3
668
- // sddefault; w: 640; h: 480; 4x3
669
-
670
- // Thumbnails
671
- //--------------------------------
672
-
673
- //thumbnail height
674
- if ( $ytchag_thumb_ratio == '16x9' ) {
675
- $ytchag_thumb_height = round( ( $ytchag_thumb_width * 9 ) / 16 );
676
- } else {
677
- $ytchag_thumb_height = round( ( $ytchag_thumb_width * 3 ) / 4 );
678
- }
679
-
680
- //sort array by width
681
- foreach ( $thumb_attrs as $key => $row ) {
682
- $new_thumb_attrs[$key] = $row['width'];
683
- }
684
- array_multisort( $new_thumb_attrs, SORT_NUMERIC, $thumb_attrs );
685
- unset( $new_thumb_attrs[$key] );
686
-
687
- // get appropriate thumbnail width
688
- $thumbcorrectW = $this->get_appropriate_thumbnail( $thumb_attrs, $ytchag_thumb_width, $ytchag_thumb_height, 'defaults' );
689
- if ( !isset( $thumbcorrectW ) ) {
690
- $thumbcorrectW = $this->get_appropriate_thumbnail( $thumb_attrs, $ytchag_thumb_width, $ytchag_thumb_height, 'other' );
691
- }
692
-
693
- //index in array of thumbnail width
694
- $thumbcorrectWIndex = $this->array_search_multi( $thumb_attrs, 'width', $thumbcorrectW );
695
 
696
- //appropriate url thumbnail
697
- $thumb = $thumbcorrectWIndex[0]['url'];
698
 
 
699
 
700
- //rows and columns control
 
 
701
 
702
- $column++;
703
- $columnlastfirst = $tableclass = $columnnumber = '';
704
- if ( $ytchag_thumb_columns !=0 && $column == 1 ) {
705
- $columnlastfirst = ' ytccell-first';
706
- $rowcount++;
707
- $row_oddeven = ( $rowcount%2==1 )?' ytc-r-odd':' ytc-r-even';
708
- $tableclass = ' ytc-table';
709
- $columnnumber = ' ytc-columns'. $ytchag_thumb_columns;
710
-
711
- }
712
- if ( $ytchag_thumb_columns !=0 && $column%$ytchag_thumb_columns == 0 ) {
713
- $columnlastfirst = ' ytccell-last';
714
- }// end columns control
715
-
716
- //check if title or description
717
- $ytchag_thumbnail_fixed_witdh = '';
718
- $title_and_description_alignment_class = '';
719
 
 
720
 
721
- if ( $ytchag_title || $ytchag_description ) {
722
- $title_and_description_alignment_class = ' ytc-td-' . $ytchag_thumbnail_alignment;
723
-
724
- //fixed width for columns 0 or with alignment
725
- if ( $ytchag_thumbnail_alignment == 'left' || $ytchag_thumbnail_alignment == 'right' ) {
726
- $ytchag_thumbnail_fixed_witdh = ' style="width: ' . $ytchag_thumb_width . 'px; "';
727
- }
728
- }
729
- //fixed width for columns 0 or with alignment
730
- if ( $ytchag_thumb_columns ==0 ) {
731
- $ytchag_thumbnail_fixed_witdh = ' style="width: ' . $ytchag_thumb_width . 'px; "';
732
- }
733
 
 
 
734
 
 
 
 
735
 
736
- //The content
737
- //--------------------------------
738
 
739
- //Show me the player: iframe player
740
- if ( $thumb_count == 0 ) {
741
- //count the plugin occurrences on page
742
- $plugincount++;
743
 
744
- // Load css
745
- $this->register_styles();
 
 
746
 
747
- $content = '';
748
 
749
- //player
750
- if ( $ytchag_player == '1' ) {
751
- require 'templates/player.php';
752
- }
 
 
 
 
 
 
753
 
754
- $content.= '<ul class="ytchagallery ytccf' . $tableclass . $title_and_description_alignment_class . $columnnumber . ' ytc-thumb' . $ytchag_thumb_ratio . '">';
 
 
755
 
756
- } // if player end
757
- $thumb_count++;
758
 
 
759
 
 
760
 
761
- //title and description content
762
 
763
- if ( $ytchag_title || $ytchag_description ) {
764
- $title_and_description_content= '<div class="ytctitledesc-cont">';
765
 
766
- if ( $ytchag_title ) {
767
- $title_and_description_content.= '<h5 class="ytctitle"><a class="ytclink" href="' . $youtube_url . '/watch?v=' . $youtubeid . '" data-playerid="ytcplayer' . $plugincount . '" data-quality="' . $ytchag_quality . '" alt="' . $title . '" title="' . $title . '" ' . $ytchag_nofollow . '>' . $title . '</a></h5>';
768
- }
769
 
770
- if ( $ytchag_description ) {
771
- $description = wp_trim_words( $description, $num_words = $ytchag_description_words_number, $more = '&hellip;' );
772
- $title_and_description_content.= '<div class="ytctdescription">' . $description . '</div>';
773
- }
774
-
775
- $title_and_description_content.= '</div>';
776
- } else {
777
- $title_and_description_content = '';
778
- }
779
- //end title and description content
780
-
781
-
782
- //----
783
- if ( $ytchag_thumb_columns !=0 && $column == 1 ) {
784
- $content.= "\n\n" .'<div class="ytccf ytc-row ytc-r-' . $rowcount . $row_oddeven . ' ">' . "\n\n";
785
- }
786
 
787
- //$content.= '$column: ' + $column;
788
- $content.= "\n\n" . ' <li class="ytccell-' . $column . $columnlastfirst . '">';//style="width: ' . $ytchag_thumb_width . 'px; "
789
-
790
- $content.= '<div class="ytcliinner">';
791
-
792
- if ( $ytchag_thumbnail_alignment == 'bottom' ) {
793
- $content.= $title_and_description_content;
794
-
795
- }
796
-
797
- $content.= '<div class="ytcthumb-cont"' . $ytchag_thumbnail_fixed_witdh . '>';
798
- $content.= '<a class="ytcthumb ytclink" ' .$ytchag_thumb_window. ' href="' . $youtube_url . '/watch?v=' . $youtubeid . '" data-playerid="ytcplayer' . $plugincount . '" data-quality="' . $ytchag_quality . '" title="' . $title . '" style="background-image:url(' . $thumb . ')" ' . $ytchag_nofollow . '>';
799
- $content.= '<div class="ytcplay"></div>';
800
- $content.= '</a>';
801
- $content.= '</div>';
802
-
803
- if ( $ytchag_thumbnail_alignment != 'bottom' ) {
804
- $content.= $title_and_description_content;
805
- }
806
-
807
- $content.= '</div>';
808
-
809
- $content.= '</li>' . "\n\n";
810
-
811
- //----
812
- if ( $ytchag_thumb_columns !=0 && $column%$ytchag_thumb_columns == 0 ) {
813
- $column = 0;
814
- $columnlastfirst = ' ytccell-last';
815
- $content.= '</div>' . "\n\n\n";
816
- }
817
- if ( $thumb_count == $ytchag_maxitems ) {
818
- break;
819
- }
820
- } //foreach end
821
-
822
- //if last row
823
- if ( $ytchag_thumb_columns !=0 && $columnlastfirst != ' ytccell-last' ) {
824
- $content.= '</div>' . "\n\n\n";
825
- }
826
-
827
- $content.= '</ul>';
828
-
829
- //link to youtube.com gallery
830
- if ( $ytchag_link ) {
831
- $content.= '<a href="' . $ytchag_link_url . '" class="ytcmore" ' . $ytchag_link_window .' ' . $ytchag_nofollow .' >' . $ytchag_link_tx . '</a>';
832
- }
833
- //--}
834
- }
835
-
836
- return $content;
837
-
838
- }//ytchag_rss_markup
839
 
 
840
 
 
 
841
 
842
  function get_rss_data( $ytchag_cache, $transientId, $ytchag_rss_url, $ytchag_cache_time ) {
843
  //use cache
@@ -869,48 +740,12 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
869
  return $videos_result;
870
  }
871
 
872
-
873
- function get_appropriate_thumbnail( $thumb_attrs, $ytchag_thumb_width, $ytchag_thumb_height, $type ) {
874
- // get appropriate thumbnail width
875
-
876
- // to check only this type of thumbnails
877
- $ytchag_thumb_size_names = array( 'default', 'mqdefault', 'hqdefault', 'sddefault' );
878
-
879
- foreach ( $thumb_attrs as $row ) {
880
-
881
- if ( $type == 'defaults' ) {
882
- if ( in_array( $row['name'], $ytchag_thumb_size_names ) ) {
883
- if ( $row['width'] >= $ytchag_thumb_width && $row['height'] >= $ytchag_thumb_height ) {
884
- return $row['width'];
885
- }
886
- }
887
- } else {
888
- if ( !in_array( $row['name'], $ytchag_thumb_size_names ) ) {
889
- if ( $row['width'] >= $ytchag_thumb_width && $row['height'] >= $ytchag_thumb_height ) {
890
- return $row['width'];
891
- }
892
- }
893
- }
894
- }
895
- }
896
-
897
- function array_search_multi( $array, $key, $value ) {
898
- $results = array();
899
-
900
- if ( is_array( $array ) ) {
901
- if ( isset( $array[$key] ) && $array[$key] == $value )
902
- $results[] = $array;
903
-
904
- foreach ( $array as $subarray )
905
- $results = array_merge( $results, $this->array_search_multi( $subarray, $key, $value ) );
906
- }
907
-
908
- return $results;
909
- }
910
-
911
  // load css
912
- private function register_styles() {
913
- wp_enqueue_style( 'youtube-channel-gallery', plugins_url( '/styles.css', __FILE__ ), false, false, 'all' );
 
 
 
914
  }
915
 
916
  // load js
@@ -918,6 +753,14 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
918
  wp_enqueue_script( 'jquery' );
919
  wp_enqueue_script( 'youtube_player_api', 'https://www.youtube.com/player_api', false, false, true );
920
  wp_enqueue_script( 'youtube-channel-gallery', plugins_url( '/scripts.js', __FILE__ ), false, false, true );
 
 
 
 
 
 
 
 
921
  }
922
 
923
 
@@ -936,54 +779,87 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
936
  public function YoutubeChannelGallery_Shortcode( $atts ) {
937
 
938
  extract( shortcode_atts( array(
939
- 'user' => 'youtube',
940
-
941
- // Feed options
942
- 'feed' => 'user',
943
- 'feedorder' => 'asc',
944
- 'cache_time' => '24',
945
- 'cache' => '1',
946
-
947
- // Player options
948
- 'player' => '1',
949
- 'ratio' => '4x3',
950
- 'theme' => 'dark',
951
- 'color' => 'red',
952
- 'quality' => 'default',
953
- 'autoplay' => '',
954
- 'modestbranding' => '',
955
- 'rel' => '',
956
- 'showinfo' => '',
957
-
958
- // Thumbnail options
959
- 'maxitems' => '9',
960
- 'thumbwidth' => '90',
961
- 'thumbratio' => '4x3',
962
- 'thumbcolumns' => '3',
963
- 'nofollow' => '',
964
- 'thumb_window' => '',
965
-
966
- 'title' => '',
967
- 'description' => '',
968
- 'thumbnail_alignment' => 'top',
969
- 'descriptionwordsnumber' => '',
970
-
971
- // Link options
972
- 'link' => '',
973
- 'link_tx' => '',
974
- 'link_window' => ''
975
-
976
- ), $atts ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
977
 
978
  // Feed options
 
979
  $instance['ytchag_feed'] = $feed;
980
  $instance['ytchag_user'] = $user;
981
- $instance['ytchag_feed_order'] = $feedorder;
 
 
 
982
  $instance['ytchag_cache_time'] = $cache_time;
983
  $instance['ytchag_cache'] = $cache;
984
 
985
  // Player options
986
  $instance['ytchag_player'] = $player;
 
 
987
  $instance['ytchag_ratio'] = $ratio;
988
  $instance['ytchag_theme'] = $theme;
989
  $instance['ytchag_color'] = $color;
@@ -992,27 +868,49 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
992
  $instance['ytchag_modestbranding'] = $modestbranding;
993
  $instance['ytchag_rel'] = $rel;
994
  $instance['ytchag_showinfo'] = $showinfo;
 
 
 
 
 
 
 
 
 
995
 
996
  // Thumbnail options
997
  $instance['ytchag_maxitems'] = $maxitems;
998
- $instance['ytchag_thumb_width'] = $thumbwidth;
999
- $instance['ytchag_thumb_ratio'] = $thumbratio;
1000
- $instance['ytchag_thumb_columns'] = $thumbcolumns;
 
 
 
1001
  $instance['ytchag_nofollow'] = $nofollow;
1002
  $instance['ytchag_thumb_window'] = $thumb_window;
 
 
 
 
 
1003
 
1004
  $instance['ytchag_title'] = $title;
1005
  $instance['ytchag_description'] = $description;
1006
  $instance['ytchag_thumbnail_alignment'] = $thumbnail_alignment;
1007
- $instance['ytchag_description_words_number'] = $descriptionwordsnumber;
 
1008
 
1009
  // Link options
1010
  $instance['ytchag_link'] = $link;
1011
  $instance['ytchag_link_tx'] = $link_tx;
1012
  $instance['ytchag_link_window'] = $link_window;
 
 
 
1013
 
1014
 
1015
- return '<div class="ytcshort youtubechannelgallery ytccf">'. $this->ytchag_rss_markup( $instance ) . '</div>';
 
1016
 
1017
  } // YoutubeChannelGallery_Shortcode
1018
 
@@ -1022,4 +920,9 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
1022
  // register YoutubeChannelGallery_Widget widget
1023
  add_action( 'widgets_init', create_function( '', 'register_widget( "YoutubeChannelGallery_Widget" );' ) );
1024
 
1025
- ?>
 
 
 
 
 
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: 2.0.0
9
  License: GPL2
10
 
11
  Copyright 2013 Javier Gómez Pose (email : javierpose@gmail.com)
40
 
41
  //load admin scripts
42
  add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts_and_styles' ) );
43
+ //load font-end styles
44
+ add_action('wp_enqueue_scripts', array($this,'register_styles'));
45
 
46
  parent::__construct(
47
  'youtubechannelgallery_widget', // Base ID
51
 
52
  array( 'width' => 260 )
53
  );
54
+
55
+ add_action('wp_ajax_ytc_next', array($this, 'nextVideos'));
56
+ add_action('wp_ajax_nopriv_ytc_next', array($this, 'nextVideos'));
57
+
58
+ add_action('wp_ajax_ytc_search', array($this, 'searchVideos'));
59
+ add_action('wp_ajax_nopriv_ytc_search', array($this, 'searchVideos'));
60
  }
61
 
62
 
63
+ function nextVideos() {
64
+
65
+ $settings = $this->get_settings();
66
+ $instance = $settings[$this->number];
67
+
68
+ extract($instance);
69
+
70
+ $token = $_POST['token'];
71
+ $ytchag_playlist = $_POST['playlist'];
72
+ $ytchag_id = $_POST['cid'];
73
+
74
+ if ($ytchag_search_playlists && $ytchag_id) {
75
+ $ytchag_feed_url = 'https://www.googleapis.com/youtube/v3/search';
76
+ $ytchag_feed_url .= '?part=snippet';
77
+ $ytchag_feed_url .= '&channelId=' . $ytchag_id;
78
+ $ytchag_feed_url .= '&maxResults=' . $ytchag_maxitems;
79
+
80
+ if ($ytchag_search_restrict) {
81
+ $ytchag_feed_url .= '&q=' . $ytchag_search_restrict;
82
+ }
83
+ else {
84
+ $ytchag_feed_url .= '&q=' . implode(',', array_map('toTag', explode('#', $ytchag_search_playlists)));
85
+ }
86
+
87
+ $ytchag_feed_url .= '&type=video';
88
+ $ytchag_feed_url .= '&key=' . $ytchag_key;
89
+ $ytchag_feed_url .= '&pageToken=' . $token;
90
+
91
+ }
92
+ else {
93
+
94
+ $api = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=';
95
+ $resto = '&maxResults=' . $ytchag_maxitems . '&key=' . $ytchag_key;
96
+
97
+ $ytchag_feed_url = $api . $ytchag_playlist . $resto . '&pageToken=' . $token;
98
+ }
99
+
100
+ $transientId = 'ytc-' .md5( $ytchag_feed_url . $ytchag_user . $ytchag_maxitems . $token);
101
+
102
+ $videos_result = $this->get_rss_data ( $ytchag_cache, $transientId, $ytchag_feed_url, $ytchag_cache_time);
103
+
104
+ // Thumb order
105
+
106
+ $modules = array();
107
+
108
+ $modules[$ytchag_thumb_order_thumb . '1'] = 'thumb';
109
+ $modules[$ytchag_thumb_order_title . '2'] = 'title';
110
+ $modules[$ytchag_thumb_order_desc . '3'] = 'desc';
111
+
112
+ ksort($modules);
113
+
114
+ $json = json_decode($videos_result['body']);
115
+
116
+ $ytchag_results_per_page = $json->pageInfo->resultsPerPage;
117
+ $ytchag_total_results = $json->pageInfo->totalResults;
118
+
119
+ if (isset($json->nextPageToken)) {
120
+ $ytchag_next_token = $json->nextPageToken;
121
+ }
122
+
123
+ if (isset($json->prevPageToken)) {
124
+ $ytchag_prev_token = $json->prevPageToken;
125
+ }
126
+
127
+ $thumbs = $this->getThumbs($json->items, $modules, $ytchag_thumb_width);
128
+
129
+ include 'templates/thumbs.php';
130
+
131
+ exit();
132
+ }
133
+
134
+ function searchVideos() {
135
+
136
+ $settings = $this->get_settings();
137
+ $instance = $settings[$this->number];
138
+
139
+ extract($instance);
140
+
141
+ $q = $_POST['token'];
142
+ $ytchag_search_restrict = $_POST['tag'];
143
+ $ytchag_id = $_POST['cid'];
144
+
145
+ $ytchag_feed_url = 'https://www.googleapis.com/youtube/v3/search';
146
+ $ytchag_feed_url .= '?part=snippet';
147
+ $ytchag_feed_url .= '&channelId=' . $ytchag_id;
148
+ $ytchag_feed_url .= '&maxResults=' . $ytchag_maxitems;
149
+
150
+ if ($ytchag_search_restrict) {
151
+ $q = $ytchag_search_restrict;
152
+ }
153
+ else {
154
+ $q = implode(',', array_map('toTag', explode('#', $ytchag_search_playlists)));
155
+ }
156
+
157
+ $ytchag_feed_url .= '&q=' . $q;
158
+
159
+ $ytchag_feed_url .= '&type=video';
160
+ $ytchag_feed_url .= '&key=' . $ytchag_key;
161
+
162
+ $transientId = 'ytc-' .md5( $ytchag_feed_url . $ytchag_user . $ytchag_maxitems . $q);
163
+
164
+ $videos_result = $this->get_rss_data ( $ytchag_cache, $transientId, $ytchag_feed_url, $ytchag_cache_time);
165
+
166
+ if ($videos_result['response']['code'] != 200) {
167
+ echo '';
168
+ exit();
169
+ }
170
+
171
+ // Thumb order
172
+
173
+ $modules = array();
174
+
175
+ $modules[$ytchag_thumb_order_thumb . '1'] = 'thumb';
176
+ $modules[$ytchag_thumb_order_title . '2'] = 'title';
177
+ $modules[$ytchag_thumb_order_desc . '3'] = 'desc';
178
+
179
+ ksort($modules);
180
+
181
+ $json = json_decode($videos_result['body']);
182
+
183
+ $ytchag_results_per_page = $json->pageInfo->resultsPerPage;
184
+ $ytchag_total_results = $json->pageInfo->totalResults;
185
+
186
+ if (isset($json->nextPageToken)) {
187
+ $ytchag_next_token = $json->nextPageToken;
188
+ }
189
+
190
+ if (isset($json->prevPageToken)) {
191
+ $ytchag_prev_token = $json->prevPageToken;
192
+ }
193
+
194
+ $thumbs = $this->getThumbs($json->items, $modules, $ytchag_thumb_width);
195
+
196
+ include 'templates/thumbs.php';
197
+
198
+ exit();
199
+ }
200
+
201
+ function getThumbs($items, $modules, $thumb_width) {
202
+
203
+ $thumbs = array();
204
+
205
+ foreach ($items as $item) {
206
+
207
+ $thumb = new stdClass();
208
+
209
+ $thumb->id = $item->snippet->resourceId->videoId;
210
+ $thumb->title = $item->snippet->title;
211
+ $thumb->description = $item->snippet->description;
212
+ $thumb->modules = $modules;
213
+
214
+ if ($thumb_width <= 120) {
215
+ $thumb->img = $item->snippet->thumbnails->default->url;
216
+ $thumb->quality = 'default';
217
+ }
218
+ elseif ($thumb_width > 120 && $thumb_width <= 320) {
219
+ $thumb->img = $item->snippet->thumbnails->medium->url;
220
+ $thumb->quality = 'mqdefault';
221
+ }
222
+ elseif ($thumb_width > 320 && $thumb_width <= 480) {
223
+ $thumb->img = $item->snippet->thumbnails->high->url;
224
+ $thumb->quality = 'hqdefault';
225
+ }
226
+ elseif ($thumb_width > 480 && $thumb_width <= 640) {
227
+ $thumb->img = $item->snippet->thumbnails->standard->url;
228
+ $thumb->quality = 'sddefault';
229
+ }
230
+ else {
231
+ $thumb->img = $item->snippet->thumbnails->maxres->url;
232
+ $thumb->quality = 'maxresdefault';
233
+ }
234
+
235
+ $thumbs[] = $thumb;
236
+ }
237
+
238
+ return $thumbs;
239
+ }
240
 
241
  /**
242
  * Front-end display of widget.
251
  echo $before_title . $title . $after_title;
252
  }
253
 
254
+
255
+ //echo $this->ytchag_rss_markup( $instance );
256
+ echo $this->ytchag_json_markup( $instance );
257
 
258
  echo $after_widget;
259
  }
266
  $instance['title'] = strip_tags( $new_instance['title'] );
267
 
268
  // Feed options
269
+ $instance['ytchag_key'] = strip_tags( $new_instance['ytchag_key'] );
270
  $instance['ytchag_feed'] = strip_tags( $new_instance['ytchag_feed'] );
271
  $instance['ytchag_user'] = strip_tags( $new_instance['ytchag_user'] );
272
+ //$instance['ytchag_id'] = strip_tags( $new_instance['ytchag_id'] );
273
+ //$instance['ytchag_user_uploads'] = strip_tags( $new_instance['ytchag_user_uploads'] );
274
+ //$instance['ytchag_user_favorites'] = strip_tags( $new_instance['ytchag_user_favorites'] );
275
  $instance['ytchag_feed_order'] = strip_tags( $new_instance['ytchag_feed_order'] );
276
  $instance['ytchag_cache_time'] = strip_tags( $new_instance['ytchag_cache_time'] );
277
  $instance['ytchag_cache'] = strip_tags( $new_instance['ytchag_cache'] );
278
 
279
  // Player options
280
  $instance['ytchag_player'] = strip_tags( $new_instance['ytchag_player'] );
281
+ $instance['ytchag_width_value'] = strip_tags( $new_instance['ytchag_width_value'] );
282
+ $instance['ytchag_width_type'] = strip_tags( $new_instance['ytchag_width_type'] );
283
  $instance['ytchag_ratio'] = strip_tags( $new_instance['ytchag_ratio'] );
284
  $instance['ytchag_theme'] = strip_tags( $new_instance['ytchag_theme'] );
285
  $instance['ytchag_color'] = strip_tags( $new_instance['ytchag_color'] );
288
  $instance['ytchag_modestbranding'] = strip_tags( $new_instance['ytchag_modestbranding'] );
289
  $instance['ytchag_rel'] = strip_tags( $new_instance['ytchag_rel'] );
290
  $instance['ytchag_showinfo'] = strip_tags( $new_instance['ytchag_showinfo'] );
291
+ $instance['ytchag_player_order'] = strip_tags( $new_instance['ytchag_player_order'] );
292
+
293
+ // Search options
294
+ $instance['ytchag_search_input'] = strip_tags( $new_instance['ytchag_search_input'] );
295
+ $instance['ytchag_search_playlists'] = strip_tags( $new_instance['ytchag_search_playlists'] );
296
+ $instance['ytchag_search_restrict'] = strip_tags( $new_instance['ytchag_search_restrict'] );
297
+ $instance['ytchag_search_input_show'] = strip_tags( $new_instance['ytchag_search_input_show'] );
298
+ $instance['ytchag_search_playlists_show'] = strip_tags( $new_instance['ytchag_search_playlists_show'] );
299
+ $instance['ytchag_search_order'] = strip_tags( $new_instance['ytchag_search_order'] );
300
 
301
  // Thumbnail options
302
  $instance['ytchag_maxitems'] = strip_tags( $new_instance['ytchag_maxitems'] );
303
  $instance['ytchag_thumb_width'] = strip_tags( $new_instance['ytchag_thumb_width'] );
304
  $instance['ytchag_thumb_ratio'] = strip_tags( $new_instance['ytchag_thumb_ratio'] );
305
+ $instance['ytchag_thumb_columns_phones'] = strip_tags( $new_instance['ytchag_thumb_columns_phones'] );
306
+ $instance['ytchag_thumb_columns_tablets'] = strip_tags( $new_instance['ytchag_thumb_columns_tablets'] );
307
+ $instance['ytchag_thumb_columns_md'] = strip_tags( $new_instance['ytchag_thumb_columns_md'] );
308
+ $instance['ytchag_thumb_columns_ld'] = strip_tags( $new_instance['ytchag_thumb_columns_ld'] );
309
  $instance['ytchag_nofollow'] = strip_tags( $new_instance['ytchag_nofollow'] );
310
  $instance['ytchag_thumb_window'] = strip_tags( $new_instance['ytchag_thumb_window'] );
311
+ $instance['ytchag_pagination_show'] = strip_tags( $new_instance['ytchag_pagination_show'] );
312
+ $instance['ytchag_thumb_order_thumb'] = strip_tags( $new_instance['ytchag_thumb_order_thumb'] );
313
+ $instance['ytchag_thumb_order_title'] = strip_tags( $new_instance['ytchag_thumb_order_title'] );
314
+ $instance['ytchag_thumb_order_desc'] = strip_tags( $new_instance['ytchag_thumb_order_desc'] );
315
+ $instance['ytchag_thumb_order'] = strip_tags( $new_instance['ytchag_thumb_order'] );
316
 
317
  $instance['ytchag_title'] = strip_tags( $new_instance['ytchag_title'] );
318
  $instance['ytchag_description'] = strip_tags( $new_instance['ytchag_description'] );
319
  $instance['ytchag_thumbnail_alignment'] = strip_tags( $new_instance['ytchag_thumbnail_alignment'] );
320
+ $instance['ytchag_title_tag'] = strip_tags( $new_instance['ytchag_title_tag'] );
321
  $instance['ytchag_description_words_number'] = strip_tags( $new_instance['ytchag_description_words_number'] );
322
 
323
  // Link options
324
  $instance['ytchag_link'] = $new_instance['ytchag_link'];
325
  $instance['ytchag_link_tx'] = strip_tags( $new_instance['ytchag_link_tx'] );
326
  $instance['ytchag_link_window'] = strip_tags( $new_instance['ytchag_link_window'] );
327
+ $instance['ytchag_link_order'] = strip_tags( $new_instance['ytchag_link_order'] );
328
+
329
+ $instance['ytchag_promotion'] = $new_instance['ytchag_promotion'];
330
+
331
+ if (isset($instance['ytchag_user']) && ($new_instance['ytchag_user'] !== $old_instance['ytchag_user'] || $instance['ytchag_user_uploads'] === '')) {
332
+
333
+ $item = $this->getUserPlaylists($instance['ytchag_user'], $instance['ytchag_key'], $instance['ytchag_cache'], $instance['ytchag_cache_time']);
334
+ $playlists = $item['contentDetails']['relatedPlaylists'];
335
+
336
+ $instance['ytchag_id'] = $item['id'];
337
+ $instance['ytchag_user_uploads'] = $playlists['uploads'];
338
+ $instance['ytchag_user_favorites'] = $playlists['favorites'];
339
+ }
340
 
341
  return $instance;
342
  }
349
  'title' => 'Videos',
350
 
351
  // Feed options
352
+ 'ytchag_key' => 'AIzaSyA0IBAaDqJxfQiqeYg_i2kVKW5P9ZLheVU',
353
  'ytchag_feed' => 'user',
354
  'ytchag_user' => 'youtube',
355
+ 'ytchag_id' => 'UUBR8-60-B28hp2BmDPdntcQ',
356
+ 'ytchag_user_uploads' => 'UUBR8-60-B28hp2BmDPdntcQ',
357
+ 'ytchag_user_favorites' => '',
358
  'ytchag_feed_order' => 'asc',
359
  'ytchag_cache_time' => '24',
360
+ 'ytchag_cache' => '',
361
 
362
  // Player options
363
  'ytchag_player' => '1',
364
+ 'ytchag_width_value' => '100',
365
+ 'ytchag_width_type' => '%',
366
+ 'ytchag_ratio' => '16x9',
367
  'ytchag_theme' => 'dark',
368
  'ytchag_color' => 'red',
369
  'ytchag_quality' => 'default',
371
  'ytchag_modestbranding' => '',
372
  'ytchag_rel' => '',
373
  'ytchag_showinfo' => '',
374
+ 'ytchag_player_order' => '1',
375
+
376
+ // Search options
377
+ 'ytchag_search_input' => '',
378
+ 'ytchag_search_playlists' => '',
379
+ 'ytchag_search_restrict' => '',
380
+ 'ytchag_search_input_show' => '',
381
+ 'ytchag_search_playlists_show' => '',
382
+ 'ytchag_search_order' => '2',
383
 
384
  // Thumbnail options
385
+ 'ytchag_maxitems' => '8',
386
+ 'ytchag_thumb_width' => '480',
387
+ 'ytchag_thumb_ratio' => '16x9',
388
+ 'ytchag_thumb_columns_phones' => '2',
389
+ 'ytchag_thumb_columns_tablets' => '2',
390
+ 'ytchag_thumb_columns_md' => '2',
391
+ 'ytchag_thumb_columns_ld' => '2',
392
  'ytchag_nofollow' => '',
393
  'ytchag_thumb_window' => '',
394
+ 'ytchag_pagination_show' => '0',
395
+ 'ytchag_thumb_order_thumb' => '1',
396
+ 'ytchag_thumb_order_title' => '2',
397
+ 'ytchag_thumb_order_desc' => '3',
398
+ 'ytchag_thumb_order' => '3',
399
 
400
  'ytchag_title' => '',
401
  'ytchag_description' => '',
402
+ 'ytchag_thumbnail_alignment' => 'none',
403
+ 'ytchag_title_tag' => 'h5',
404
  'ytchag_description_words_number' => '',
405
 
406
  // Link options
407
+ 'ytchag_link' => '1',
408
  'ytchag_link_tx' => '',
409
  'ytchag_link_window' => '',
410
+ 'ytchag_link_order' => '4',
411
+
412
+ 'ytchag_promotion' => '1',
413
 
414
 
415
  );
419
  // extract them for cleaner code
420
  extract( $instance, EXTR_SKIP );
421
 
422
+ include('templates/admin_tabs.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
423
  }
424
 
425
 
426
  /*--------------------------------------------------*/
427
  /* Private Functions
428
  /*--------------------------------------------------*/
 
429
 
430
+ private function ytchag_json_markup($instance) {
431
  //$instance variables
432
  //--------------------------------
433
 
434
  // Feed options
435
+ $ytchag_key = apply_filters( 'ytchag_key', $instance['ytchag_key'] );
436
  $ytchag_feed = apply_filters( 'ytchag_feed', $instance['ytchag_feed'] );
437
  $ytchag_user = apply_filters( 'ytchag_user', $instance['ytchag_user'] );
438
+ $ytchag_id = apply_filters( 'ytchag_id', $instance['ytchag_id'] );
439
+ $ytchag_user_uploads = apply_filters( 'ytchag_user_uploads', $instance['ytchag_user_uploads'] );
440
+ $ytchag_user_favorites = apply_filters( 'ytchag_user_favorites', $instance['ytchag_user_favorites'] );
441
  $ytchag_feed_order = apply_filters( 'ytchag_feed_order', $instance['ytchag_feed_order'] );
442
  $ytchag_cache_time = (int) apply_filters( 'ytchag_cache_time', $instance['ytchag_cache_time'] );
443
  $ytchag_cache = apply_filters( 'ytchag_cache', $instance['ytchag_cache'] );
444
 
445
  // Player options
446
  $ytchag_player = apply_filters( 'ytchag_player', $instance['ytchag_player'] );
447
+ $ytchag_width_value = apply_filters( 'ytchag_width_value', $instance['ytchag_width_value'] );
448
+ $ytchag_width_type = apply_filters( 'ytchag_width_type', $instance['ytchag_width_type'] );
449
  $ytchag_ratio = apply_filters( 'ytchag_ratio', $instance['ytchag_ratio'] );
450
  $ytchag_theme = apply_filters( 'ytchag_theme', $instance['ytchag_theme'] );
451
  $ytchag_color = apply_filters( 'ytchag_color', $instance['ytchag_color'] );
454
  $ytchag_modestbranding = apply_filters( 'ytchag_modestbranding', $instance['ytchag_modestbranding'] );
455
  $ytchag_rel = apply_filters( 'ytchag_rel', $instance['ytchag_rel'] );
456
  $ytchag_showinfo = apply_filters( 'ytchag_showinfo', $instance['ytchag_showinfo'] );
457
+ $ytchag_player_order = apply_filters( 'ytchag_player_order', $instance['ytchag_player_order'] );
458
+
459
+ // Search options
460
+ $ytchag_search_input = apply_filters( 'ytchag_search_input', $instance['ytchag_search_input'] );
461
+ $ytchag_search_playlists = apply_filters( 'ytchag_search_playlists', $instance['ytchag_search_playlists'] );
462
+ $ytchag_search_restrict = apply_filters( 'ytchag_search_restrict', $instance['ytchag_search_restrict'] );
463
+ $ytchag_search_input_show = apply_filters( 'ytchag_search_input_show', $instance['ytchag_search_input_show'] );
464
+ $ytchag_search_playlists_show = apply_filters( 'ytchag_search_playlists_show', $instance['ytchag_search_playlists_show'] );
465
+ $ytchag_search_order = apply_filters( 'ytchag_search_order', $instance['ytchag_search_order'] );
466
 
467
  // Thumbnail options
468
  $ytchag_maxitems = apply_filters( 'ytchag_maxitems', $instance['ytchag_maxitems'] );
469
  $ytchag_thumb_width = apply_filters( 'ytchag_thumb_width', $instance['ytchag_thumb_width'] );
470
  $ytchag_thumb_ratio = apply_filters( 'ytchag_thumb_ratio', $instance['ytchag_thumb_ratio'] );
471
+ $ytchag_thumb_columns_phones = apply_filters( 'ytchag_thumb_columns_phones', $instance['ytchag_thumb_columns_phones'] );
472
+ $ytchag_thumb_columns_tablets = apply_filters( 'ytchag_thumb_columns_tablets', $instance['ytchag_thumb_columns_tablets'] );
473
+ $ytchag_thumb_columns_md = apply_filters( 'ytchag_thumb_columns_md', $instance['ytchag_thumb_columns_md'] );
474
+ $ytchag_thumb_columns_ld = apply_filters( 'ytchag_thumb_columns_ld', $instance['ytchag_thumb_columns_ld'] );
475
  $ytchag_nofollow = apply_filters( 'ytchag_nofollow', $instance['ytchag_nofollow'] );
476
  $ytchag_thumb_window = apply_filters( 'ytchag_thumb_window', $instance['ytchag_thumb_window'] );
477
+ $ytchag_pagination_show = apply_filters( 'ytchag_pagination_show', $instance['ytchag_pagination_show'] );
478
+ $ytchag_thumb_order_thumb = apply_filters( 'ytchag_thumb_order_thumb', $instance['ytchag_thumb_order_thumb'] );
479
+ $ytchag_thumb_order_title = apply_filters( 'ytchag_thumb_order_title', $instance['ytchag_thumb_order_title'] );
480
+ $ytchag_thumb_order_desc = apply_filters( 'ytchag_thumb_order_desc', $instance['ytchag_thumb_order_desc'] );
481
+ $ytchag_thumb_order= apply_filters( 'ytchag_thumb_order', $instance['ytchag_thumb_order'] );
482
 
483
  $ytchag_title = apply_filters( 'ytchag_title', $instance['ytchag_title'] );
484
  $ytchag_description = apply_filters( 'ytchag_description', $instance['ytchag_description'] );
485
  $ytchag_thumbnail_alignment = apply_filters( 'ytchag_thumbnail_alignment', $instance['ytchag_thumbnail_alignment'] );
486
+ $ytchag_title_tag = apply_filters( 'ytchag_title_tag', $instance['ytchag_title_tag'] );
487
  $ytchag_description_words_number = apply_filters( 'ytchag_description_words_number', $instance['ytchag_description_words_number'] );
488
 
489
  // Link options
490
  $ytchag_link = apply_filters( 'ytchag_link', $instance['ytchag_link'] );
491
  $ytchag_link_tx = apply_filters( 'ytchag_link_tx', $instance['ytchag_link_tx'] );
492
  $ytchag_link_window = apply_filters( 'ytchag_link_window', $instance['ytchag_link_window'] );
493
+ $ytchag_link_order = apply_filters( 'ytchag_link_order', $instance['ytchag_link_order'] );
494
+
495
+ $ytchag_promotion = apply_filters( 'ytchag_promotion', $instance['ytchag_promotion'] );
496
+
497
  //--------------------------------
498
  //end $instance variables
499
 
502
  //--------------------------------
503
 
504
  // Feed options
505
+ $ytchag_key = ( $ytchag_key) ? $ytchag_key: 'AIzaSyA6oW5D-ZlSIG-OHSBOR25TMd3YDRU7HdU'; //default user
506
  $ytchag_feed = ( $ytchag_feed ) ? $ytchag_feed : 'user'; //default user
507
  $ytchag_feed_order = ( $ytchag_feed_order ) ? $ytchag_feed_order : 'asc'; //default ascending
508
 
509
  // Player options
510
  $ytchag_player = isset( $ytchag_player ) ? $ytchag_player : '1'; //player?
511
+ $ytchag_width_value = isset( $ytchag_width_value) ? $ytchag_width_value : '100'; // width
512
+ $ytchag_width_type = isset( $ytchag_width_type) ? $ytchag_width_type : '%'; // width
513
  $ytchag_theme = ( $ytchag_theme ) ? '&theme='. $ytchag_theme : ''; //default dark
514
  $ytchag_color = ( $ytchag_color ) ? '&color='. $ytchag_color : ''; //default red
515
  $ytchag_quality = ( $ytchag_quality ) ? $ytchag_quality : 'default'; //default default
517
  $ytchag_modestbranding = ( $ytchag_modestbranding ) ? '' : '&modestbranding='. $ytchag_modestbranding; //default 0
518
  $ytchag_rel = ( $ytchag_rel ) ? '&rel='. $ytchag_rel : '&rel=0'; //default 1
519
  $ytchag_showinfo = ( $ytchag_showinfo ) ? '&showinfo='. $ytchag_showinfo : '&showinfo=0'; //default 1
520
+ $ytchag_player_order = isset( $ytchag_player_order ) ? $ytchag_player_order : '1'; // order
521
+
522
+ // Search options
523
+ $ytchag_search_input = isset( $ytchag_search_input) ? $ytchag_search_input: ''; // search
524
+ $ytchag_search_playlists = isset( $ytchag_search_playlists) ? $ytchag_search_playlists: ''; // search playlists
525
+ $ytchag_search_restrict = isset( $ytchag_search_restrict) ? $ytchag_search_restrict: ''; // search
526
+ $ytchag_search_input_show = isset( $ytchag_search_input_show) ? $ytchag_search_input_show : ''; // search
527
+ $ytchag_search_playlists_show = isset( $ytchag_search_playlists_show) ? $ytchag_search_playlists_show : ''; // search playlists
528
+ $ytchag_search_order = isset( $ytchag_search_order) ? $ytchag_search_order: ''; // search order
529
 
530
  // Thumbnail options
531
  $ytchag_maxitems = ( $ytchag_maxitems ) ? $ytchag_maxitems : 9;
533
  $ytchag_maxitems = 50;
534
  }
535
  $ytchag_thumb_width = ( $ytchag_thumb_width ) ? $ytchag_thumb_width : 85;
536
+ $ytchag_thumb_columns_phones = ( ( $ytchag_thumb_columns_phones ) || ( $ytchag_thumb_columns_phones != 0 ) ) ? $ytchag_thumb_columns_phones : 0;
537
+ $ytchag_thumb_columns_tablets = ( ( $ytchag_thumb_columns_tablets ) || ( $ytchag_thumb_columns_tablets != 0 ) ) ? $ytchag_thumb_columns_tablets : 0;
538
+ $ytchag_thumb_columns_md = ( ( $ytchag_thumb_columns_md ) || ( $ytchag_thumb_columns_md != 0 ) ) ? $ytchag_thumb_columns_md : 0;
539
+ $ytchag_thumb_columns_ld = ( ( $ytchag_thumb_columns_ld ) || ( $ytchag_thumb_columns_ld != 0 ) ) ? $ytchag_thumb_columns_ld : 0;
540
  $ytchag_nofollow = ( $ytchag_nofollow ) ? ' rel="nofollow"' : '';
541
  $ytchag_thumb_window = ( ( $ytchag_thumb_window ) && ( $ytchag_player == 0 ) ) ? 'target="_blank"' : '';
542
 
543
  //title and desc
544
  $ytchag_title = ( $ytchag_title ) ? $ytchag_title : 0;
545
  $ytchag_description = ( $ytchag_description ) ? $ytchag_description : 0;
546
+ $ytchag_thumbnail_alignment = ( $ytchag_thumbnail_alignment ) ? $ytchag_thumbnail_alignment : 'none';
547
+ $ytchag_title_tag = ( $ytchag_title_tag ) ? $ytchag_title_tag : 'h5';
548
  $ytchag_description_words_number = ( $ytchag_description_words_number ) ? $ytchag_description_words_number : 10;
549
 
550
  // Link options
551
  $ytchag_link = ( $ytchag_link ) ? $ytchag_link : 0;
552
  $ytchag_link_tx = ( $ytchag_link_tx ) ? $ytchag_link_tx : __( 'Show more videos»', 'youtube-channel-gallery' );
553
  $ytchag_link_window = ( $ytchag_link_window ) ? 'target="_blank"' : '';
554
+ $ytchag_link_order = ( $ytchag_link_order) ? $ytchag_link_order : '4';
 
 
 
555
 
556
+ $ytchag_promotion = ( $ytchag_promotion ) ? $ytchag_promotion : 0;
 
557
  //--------------------------------
558
+ //end defaults
559
 
 
560
  if ( empty( $ytchag_user ) ) {
561
  $content= '<p class="empty">' . __( 'There is no video to show.', 'youtube-channel-gallery' ) . '</p>';
562
 
563
  } else {
 
 
564
 
565
+ $api = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=';
566
+ $resto = '&maxResults=' . $ytchag_maxitems . '&key=' . $ytchag_key;
 
 
 
 
 
 
 
 
 
 
 
567
 
568
+ if ($ytchag_feed !== 'playlist') {
569
 
570
+ $item = $this->getUserPlaylists($ytchag_user, $ytchag_key, $ytchag_cache, $ytchag_cache_time);
571
+ $playlists = $item['contentDetails']['relatedPlaylists'];
572
 
573
+ $ytchag_id = $item['id'];
574
+ $ytchag_user_uploads = $playlists['uploads'];
575
+ $ytchag_user_favorites = $playlists['favorites'];
576
+ }
577
 
578
+ if ($ytchag_search_playlists && $ytchag_id) {
579
 
580
+ $ytchag_feed_url = 'https://www.googleapis.com/youtube/v3/search';
581
+ $ytchag_feed_url .= '?part=snippet';
582
+ $ytchag_feed_url .= '&channelId=' . $ytchag_id;
583
+ $ytchag_feed_url .= '&maxResults=' . $ytchag_maxitems;
584
 
585
+ if ($ytchag_search_restrict) {
586
+ $ytchag_feed_url .= '&q=' . $ytchag_search_restrict;
587
+ }
588
+ else {
589
+ $ytchag_feed_url .= '&q=' . implode(',', array_map('toTag', explode('#', $ytchag_search_playlists)));
590
+ }
591
 
592
+ $ytchag_feed_url .= '&type=video';
593
+ $ytchag_feed_url .= '&key=' . $ytchag_key;
594
+ }
595
+ elseif ( $ytchag_feed === 'user' ) {
596
+ $ytchag_feed_url = $api . $ytchag_user_uploads . $resto;
597
+ $ytchag_playlist = $ytchag_user_uploads;
598
+ }
599
+ elseif ($ytchag_feed === 'favorites') {
600
+ $ytchag_feed_url = $api . $ytchag_user_favorites . $resto;
601
+ $ytchag_playlist = $ytchag_user_favorites;
602
+ }
603
+ elseif ($ytchag_feed === 'playlist') {
604
+ $ytchag_feed_url = $api . $ytchag_user . $resto;
605
+ $ytchag_playlist = $ytchag_user;
606
+ }
607
 
608
+ $ytchag_link_url = 'https://www.youtube.com/channel/' . $ytchag_id;
 
 
 
 
 
 
 
609
 
610
+ $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_maxitems );
611
+ $videos_result = $this->get_rss_data ( $ytchag_cache, $transientId, $ytchag_feed_url, $ytchag_cache_time );
612
 
613
+ ob_start();
614
 
615
+ if ($videos_result['response']['code'] != 200) {
616
+ $content= '<div class="vmcerror">' . sprintf( __( '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.', 'youtube-channel-gallery' ), $response_message, $ytchag_link_url, $ytchag_user, $ytchag_feed ) . '</div>';
617
+ }
618
+ else {
619
+ $json = json_decode($videos_result['body']);
620
 
621
+ if ($json->pageInfo->totalResults > 0) {
 
622
 
623
+ $ytchag_results_per_page = $json->pageInfo->resultsPerPage;
624
+ $ytchag_total_results = $json->pageInfo->totalResults;
625
 
626
+ if (isset($json->nextPageToken)) {
627
+ $ytchag_next_token = $json->nextPageToken;
628
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
629
 
630
+ if (isset($json->prevPageToken)) {
631
+ $ytchag_prev_token = $json->prevPageToken;
632
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
633
 
634
+ // Thumb order
 
635
 
636
+ $modules = array();
637
 
638
+ $modules[$ytchag_thumb_order_thumb . '1'] = 'thumb';
639
+ $modules[$ytchag_thumb_order_title . '2'] = 'title';
640
+ $modules[$ytchag_thumb_order_desc . '3'] = 'desc';
641
 
642
+ ksort($modules);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
643
 
644
+ $thumbs = $this->getThumbs($json->items, $modules, $ytchag_thumb_width);
645
 
646
+ $content = '';
 
 
 
 
 
 
 
 
 
 
 
647
 
648
+ $youtube_url = 'https://www.youtube.com';
649
+ $youtubeid = $thumbs[0]->id;
650
 
651
+ if ($ytchag_player > 0) {
652
+ $this->register_scripts();
653
+ }
654
 
655
+ // Order
 
656
 
657
+ $modules = array();
 
 
 
658
 
659
+ $modules[$ytchag_player_order . '1'] = 'player';
660
+ $modules[$ytchag_thumb_order . '2'] = 'thumbs';
661
+ $modules[$ytchag_search_order . '3'] = 'search';
662
+ $modules[$ytchag_link_order . '4'] = 'link';
663
 
664
+ ksort($modules);
665
 
666
+ foreach ($modules as $module) {
667
+ if ($module === 'player' && $ytchag_player == 1) {
668
+ include 'templates/player.php';
669
+ }
670
+ elseif ($module !== 'player') {
671
+ include 'templates/' . $module . '.php';
672
+ }
673
+ }
674
+ }
675
+ }
676
 
677
+ $content .= ob_get_contents();
678
+ ob_end_clean();
679
+ }
680
 
681
+ return $content;
682
+ }
683
 
684
+ function getUserPlaylists($user, $key, $cache, $cache_time) {
685
 
686
+ $api = 'https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=' . $user . '&key=' . $key;
687
 
688
+ $transientId = 'ytc-' . md5($api);
689
 
690
+ if ($cache == 1) {
 
691
 
692
+ if (false === ($json_result = get_transient($transientId))) {
 
 
693
 
694
+ $resp = wp_remote_get($api);
695
+ $response_code = wp_remote_retrieve_response_code($resp);
696
+ $response_message = wp_remote_retrieve_response_message($reps);
 
 
 
 
 
 
 
 
 
 
 
 
 
697
 
698
+ if ($response_code == 200) {
699
+ set_transient($transientId, $resp, $cache_time * HOUR_IN_SECONDS);
700
+ }
701
+ }
702
+ }
703
+ else {
704
+ $resp = wp_remote_get($api);
705
+ delete_transient( $transientId );
706
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
707
 
708
+ $json = json_decode($resp['body'], true);
709
 
710
+ return $json['items'][0];
711
+ }
712
 
713
  function get_rss_data( $ytchag_cache, $transientId, $ytchag_rss_url, $ytchag_cache_time ) {
714
  //use cache
740
  return $videos_result;
741
  }
742
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
743
  // load css
744
+ public function register_styles() {
745
+ wp_register_style( 'youtube-channel-gallery', plugins_url( '/styles.css', __FILE__ ) );
746
+ wp_enqueue_style( 'youtube-channel-gallery' );
747
+ wp_register_style( 'jquery.magnific-popup', plugins_url( '/magnific-popup.css', __FILE__ ) );
748
+ wp_enqueue_style( 'jquery.magnific-popup' );
749
  }
750
 
751
  // load js
753
  wp_enqueue_script( 'jquery' );
754
  wp_enqueue_script( 'youtube_player_api', 'https://www.youtube.com/player_api', false, false, true );
755
  wp_enqueue_script( 'youtube-channel-gallery', plugins_url( '/scripts.js', __FILE__ ), false, false, true );
756
+ wp_enqueue_script( 'jquery.magnific-popup', plugins_url( '/jquery.magnific-popup.min.js', __FILE__ ), false, false, true );
757
+
758
+ $protocol = isset( $_SERVER['HTTPS'] ) ? 'https://' : 'http://';
759
+ $params = array(
760
+ 'ajaxurl' => admin_url( 'admin-ajax.php', $protocol ),
761
+ );
762
+
763
+ wp_localize_script( 'youtube-channel-gallery', 'ytcAjax', $params );
764
  }
765
 
766
 
779
  public function YoutubeChannelGallery_Shortcode( $atts ) {
780
 
781
  extract( shortcode_atts( array(
782
+
783
+ // Feed options
784
+ 'key' => 'AIzaSyA0IBAaDqJxfQiqeYg_i2kVKW5P9ZLheVU',
785
+ 'feed' => 'user',
786
+ 'user' => 'youtube',
787
+ 'id' => 'UUBR8-60-B28hp2BmDPdntcQ',
788
+ 'user_uploads' => 'UUBR8-60-B28hp2BmDPdntcQ',
789
+ 'user_favorites' => '',
790
+ 'feed_order' => 'asc',
791
+ 'cache_time' => '24',
792
+ 'cache' => '',
793
+
794
+ // Player options
795
+ 'player' => '1',
796
+ 'width_value' => '100',
797
+ 'width_type' => '%',
798
+ 'ratio' => '16x9',
799
+ 'theme' => 'dark',
800
+ 'color' => 'red',
801
+ 'quality' => 'default',
802
+ 'autoplay' => '',
803
+ 'modestbranding' => '',
804
+ 'rel' => '',
805
+ 'showinfo' => '',
806
+ 'player_order' => '1',
807
+
808
+ // Search options
809
+ 'search_input' => '',
810
+ 'search_playlists' => '',
811
+ 'search_restrict' => '',
812
+ 'search_input_show' => '',
813
+ 'search_playlists_show' => '',
814
+ 'search_order' => '2',
815
+
816
+ // Thumbnail options
817
+ 'maxitems' => '8',
818
+ 'thumb_width' => '480',
819
+ 'thumb_ratio' => '16x9',
820
+ 'thumb_columns_phones' => '2',
821
+ 'thumb_columns_tablets' => '2',
822
+ 'thumb_columns_md' => '4',
823
+ 'thumb_columns_ld' => '4',
824
+ 'nofollow' => '',
825
+ 'thumb_window' => '',
826
+ 'pagination_show' => '0',
827
+ 'thumb_order_thumb' => '1',
828
+ 'thumb_order_title' => '2',
829
+ 'thumb_order_desc' => '3',
830
+ 'thumb_order' => '3',
831
+
832
+ 'title' => '',
833
+ 'description' => '',
834
+ 'thumbnail_alignment' => 'none',
835
+ 'title_tag' => 'h5',
836
+ 'description_words_number' => '',
837
+
838
+ // Link options
839
+ 'link' => '1',
840
+ 'link_tx' => '',
841
+ 'link_window' => '',
842
+ 'link_order' => '4',
843
+
844
+ 'promotion' => '1',
845
+
846
+ ), $atts ) );
847
 
848
  // Feed options
849
+ $instance['ytchag_key'] = $key;
850
  $instance['ytchag_feed'] = $feed;
851
  $instance['ytchag_user'] = $user;
852
+ $instance['ytchag_id'] = $id;
853
+ $instance['ytchag_user_uploads'] = $user_uploads;
854
+ $instance['ytchag_user_favorites'] = $user_favorites;
855
+ $instance['ytchag_feed_order'] = $feed_order;
856
  $instance['ytchag_cache_time'] = $cache_time;
857
  $instance['ytchag_cache'] = $cache;
858
 
859
  // Player options
860
  $instance['ytchag_player'] = $player;
861
+ $instance['ytchag_width_value'] = $width_value;
862
+ $instance['ytchag_width_type'] = $width_type;
863
  $instance['ytchag_ratio'] = $ratio;
864
  $instance['ytchag_theme'] = $theme;
865
  $instance['ytchag_color'] = $color;
868
  $instance['ytchag_modestbranding'] = $modestbranding;
869
  $instance['ytchag_rel'] = $rel;
870
  $instance['ytchag_showinfo'] = $showinfo;
871
+ $instance['ytchag_player_order'] = $player_order;
872
+
873
+ // Search options
874
+ $instance['ytchag_search_input'] = $search_input;
875
+ $instance['ytchag_search_playlists'] = $search_playlists;
876
+ $instance['ytchag_search_restrict'] = $search_restrict;
877
+ $instance['ytchag_search_input_show'] = $search_input_show;
878
+ $instance['ytchag_search_playlists_show'] = $search_playlists_show;
879
+ $instance['ytchag_search_order'] = $search_order;
880
 
881
  // Thumbnail options
882
  $instance['ytchag_maxitems'] = $maxitems;
883
+ $instance['ytchag_thumb_width'] = $thumb_width;
884
+ $instance['ytchag_thumb_ratio'] = $thumb_ratio;
885
+ $instance['ytchag_thumb_columns_phones'] = $thumb_columns_phones;
886
+ $instance['ytchag_thumb_columns_tablets'] = $thumb_columns_tablets;
887
+ $instance['ytchag_thumb_columns_md'] = $thumb_columns_md;
888
+ $instance['ytchag_thumb_columns_ld'] = $thumb_columns_ld;
889
  $instance['ytchag_nofollow'] = $nofollow;
890
  $instance['ytchag_thumb_window'] = $thumb_window;
891
+ $instance['ytchag_pagination_show'] = $pagination_show;
892
+ $instance['ytchag_thumb_order_thumb'] = $thumb_order_thumb;
893
+ $instance['ytchag_thumb_order_title'] = $thumb_order_title;
894
+ $instance['ytchag_thumb_order_desc'] = $thumb_order_desc;
895
+ $instance['ytchag_thumb_order'] = $thumb_order;
896
 
897
  $instance['ytchag_title'] = $title;
898
  $instance['ytchag_description'] = $description;
899
  $instance['ytchag_thumbnail_alignment'] = $thumbnail_alignment;
900
+ $instance['ytchag_title_tag'] = $title_tag;
901
+ $instance['ytchag_description_words_number'] = $description_words_number;
902
 
903
  // Link options
904
  $instance['ytchag_link'] = $link;
905
  $instance['ytchag_link_tx'] = $link_tx;
906
  $instance['ytchag_link_window'] = $link_window;
907
+ $instance['ytchag_link_order'] = $link_order;
908
+
909
+ $instance['ytchag_promotion'] = $promotion;
910
 
911
 
912
+ //return '<div class="ytcshort youtubechannelgallery ytccf">'. $this->ytchag_rss_markup( $instance ) . '</div>';
913
+ return '<div class="ytcshort youtubechannelgallery ytccf">'. $this->ytchag_json_markup( $instance ) . '</div>';
914
 
915
  } // YoutubeChannelGallery_Shortcode
916
 
920
  // register YoutubeChannelGallery_Widget widget
921
  add_action( 'widgets_init', create_function( '', 'register_widget( "YoutubeChannelGallery_Widget" );' ) );
922
 
923
+ function toTag($s) {
924
+ return 'restrict#' . str_replace(' ', '_', strtolower($s));
925
+ }
926
+
927
+
928
+ ?>