Smart YouTube PRO - Version 4.0

Version Description

  • Major release
  • Added support for Vimeo, Metacafe, Liveleak and Facebook videos
  • New, much better, sidebar Widget support
  • Extract Video thumbnails to show in your excerpts on categories/archive pages
  • Show video in Colorbox
  • Now parses http:// and httpv:// videos just the same
  • Option to autoplay only the first video on the page
  • Plugin localization support
Download this release

Release Info

Developer freediver
Plugin Icon 128x128 Smart YouTube PRO
Version 4.0
Comparing to
See all releases

Code changes from version 3.9.1 to 4.0

Files changed (131) hide show
  1. i/icon.png +0 -0
  2. i/logo.png +0 -0
  3. img/default.jpg +0 -0
  4. javascripts/jquery.colorbox-min.js +4 -0
  5. javascripts/jquery.colorbox.js +788 -0
  6. readme.txt +47 -18
  7. screenshots/screenshot-1.jpg +0 -0
  8. screenshots/screenshot-10.jpg +0 -0
  9. screenshots/screenshot-11.jpg +0 -0
  10. screenshots/screenshot-2.jpg +0 -0
  11. screenshots/screenshot-3.jpg +0 -0
  12. screenshots/screenshot-4.jpg +0 -0
  13. screenshots/screenshot-5.jpg +0 -0
  14. screenshots/screenshot-6.jpg +0 -0
  15. screenshots/screenshot-7.jpg +0 -0
  16. screenshots/screenshot-8.jpg +0 -0
  17. screenshots/screenshot-9.jpg +0 -0
  18. smartyoutube.class.php +0 -809
  19. smartyoutube.php +1551 -10
  20. themes/theme1/colorbox.css +43 -0
  21. themes/theme1/images/border.png +0 -0
  22. themes/theme1/images/controls.png +0 -0
  23. themes/theme1/images/internet_explorer/borderBottomCenter.png +0 -0
  24. themes/theme1/images/internet_explorer/borderBottomLeft.png +0 -0
  25. themes/theme1/images/internet_explorer/borderBottomRight.png +0 -0
  26. themes/theme1/images/internet_explorer/borderMiddleLeft.png +0 -0
  27. themes/theme1/images/internet_explorer/borderMiddleRight.png +0 -0
  28. themes/theme1/images/internet_explorer/borderTopCenter.png +0 -0
  29. themes/theme1/images/internet_explorer/borderTopLeft.png +0 -0
  30. themes/theme1/images/internet_explorer/borderTopRight.png +0 -0
  31. themes/theme1/images/loading.gif +0 -0
  32. themes/theme1/images/loading_background.png +0 -0
  33. themes/theme1/images/overlay.png +0 -0
  34. themes/theme10/colorbox.css +36 -0
  35. themes/theme10/images/close.png +0 -0
  36. themes/theme10/images/loading.gif +0 -0
  37. themes/theme10/images/next.png +0 -0
  38. themes/theme10/images/prev.png +0 -0
  39. themes/theme11/colorbox.css +43 -0
  40. themes/theme11/images/border.png +0 -0
  41. themes/theme11/images/controls.png +0 -0
  42. themes/theme11/images/internet_explorer/borderBottomCenter.png +0 -0
  43. themes/theme11/images/internet_explorer/borderBottomLeft.png +0 -0
  44. themes/theme11/images/internet_explorer/borderBottomRight.png +0 -0
  45. themes/theme11/images/internet_explorer/borderMiddleLeft.png +0 -0
  46. themes/theme11/images/internet_explorer/borderMiddleRight.png +0 -0
  47. themes/theme11/images/internet_explorer/borderTopCenter.png +0 -0
  48. themes/theme11/images/internet_explorer/borderTopLeft.png +0 -0
  49. themes/theme11/images/internet_explorer/borderTopRight.png +0 -0
  50. themes/theme11/images/loading.gif +0 -0
  51. themes/theme11/images/loading_background.png +0 -0
  52. themes/theme11/images/overlay.png +0 -0
  53. themes/theme2/colorbox.css +41 -0
  54. themes/theme2/images/controls.png +0 -0
  55. themes/theme2/images/loading.gif +0 -0
  56. themes/theme3/colorbox.css +36 -0
  57. themes/theme3/images/controls.png +0 -0
  58. themes/theme3/images/loading.gif +0 -0
  59. themes/theme4/colorbox.css +40 -0
  60. themes/theme4/images/border1.png +0 -0
  61. themes/theme4/images/border2.png +0 -0
  62. themes/theme4/images/internet_explorer/borderBottomCenter.png +0 -0
  63. themes/theme4/images/internet_explorer/borderBottomLeft.png +0 -0
  64. themes/theme4/images/internet_explorer/borderBottomRight.png +0 -0
  65. themes/theme4/images/internet_explorer/borderMiddleLeft.png +0 -0
  66. themes/theme4/images/internet_explorer/borderMiddleRight.png +0 -0
  67. themes/theme4/images/internet_explorer/borderTopCenter.png +0 -0
  68. themes/theme4/images/internet_explorer/borderTopLeft.png +0 -0
  69. themes/theme4/images/internet_explorer/borderTopRight.png +0 -0
  70. themes/theme4/images/loading.gif +0 -0
  71. themes/theme5/colorbox.css +50 -0
  72. themes/theme5/images/border.png +0 -0
  73. themes/theme5/images/controls.png +0 -0
  74. themes/theme5/images/loading.gif +0 -0
  75. themes/theme5/images/loading_background.png +0 -0
  76. themes/theme6/colorbox.css +43 -0
  77. themes/theme6/images/border.png +0 -0
  78. themes/theme6/images/controls.png +0 -0
  79. themes/theme6/images/internet_explorer/borderBottomCenter.png +0 -0
  80. themes/theme6/images/internet_explorer/borderBottomLeft.png +0 -0
  81. themes/theme6/images/internet_explorer/borderBottomRight.png +0 -0
  82. themes/theme6/images/internet_explorer/borderMiddleLeft.png +0 -0
  83. themes/theme6/images/internet_explorer/borderMiddleRight.png +0 -0
  84. themes/theme6/images/internet_explorer/borderTopCenter.png +0 -0
  85. themes/theme6/images/internet_explorer/borderTopLeft.png +0 -0
  86. themes/theme6/images/internet_explorer/borderTopRight.png +0 -0
  87. themes/theme6/images/loading.gif +0 -0
  88. themes/theme6/images/loading_background.png +0 -0
  89. themes/theme6/images/overlay.png +0 -0
  90. themes/theme7/colorbox.css +43 -0
  91. themes/theme7/images/border.png +0 -0
  92. themes/theme7/images/controls.png +0 -0
  93. themes/theme7/images/internet_explorer/borderBottomCenter.png +0 -0
  94. themes/theme7/images/internet_explorer/borderBottomLeft.png +0 -0
  95. themes/theme7/images/internet_explorer/borderBottomRight.png +0 -0
  96. themes/theme7/images/internet_explorer/borderMiddleLeft.png +0 -0
  97. themes/theme7/images/internet_explorer/borderMiddleRight.png +0 -0
  98. themes/theme7/images/internet_explorer/borderTopCenter.png +0 -0
  99. themes/theme7/images/internet_explorer/borderTopLeft.png +0 -0
  100. themes/theme7/images/internet_explorer/borderTopRight.png +0 -0
  101. themes/theme7/images/loading.gif +0 -0
  102. themes/theme7/images/loading_background.png +0 -0
  103. themes/theme7/images/overlay.png +0 -0
  104. themes/theme8/colorbox.css +43 -0
  105. themes/theme8/images/border.png +0 -0
  106. themes/theme8/images/controls.png +0 -0
  107. themes/theme8/images/internet_explorer/borderBottomCenter.png +0 -0
  108. themes/theme8/images/internet_explorer/borderBottomLeft.png +0 -0
  109. themes/theme8/images/internet_explorer/borderBottomRight.png +0 -0
  110. themes/theme8/images/internet_explorer/borderMiddleLeft.png +0 -0
  111. themes/theme8/images/internet_explorer/borderMiddleRight.png +0 -0
  112. themes/theme8/images/internet_explorer/borderTopCenter.png +0 -0
  113. themes/theme8/images/internet_explorer/borderTopLeft.png +0 -0
  114. themes/theme8/images/internet_explorer/borderTopRight.png +0 -0
  115. themes/theme8/images/loading.gif +0 -0
  116. themes/theme8/images/loading_background.png +0 -0
  117. themes/theme8/images/overlay.png +0 -0
  118. themes/theme9/colorbox.css +58 -0
  119. themes/theme9/images/border1.png +0 -0
  120. themes/theme9/images/border2.png +0 -0
  121. themes/theme9/images/controls.png +0 -0
  122. themes/theme9/images/internet_explorer/borderBottomCenter.png +0 -0
  123. themes/theme9/images/internet_explorer/borderBottomLeft.png +0 -0
  124. themes/theme9/images/internet_explorer/borderBottomRight.png +0 -0
  125. themes/theme9/images/internet_explorer/borderMiddleLeft.png +0 -0
  126. themes/theme9/images/internet_explorer/borderMiddleRight.png +0 -0
  127. themes/theme9/images/internet_explorer/borderTopCenter.png +0 -0
  128. themes/theme9/images/internet_explorer/borderTopLeft.png +0 -0
  129. themes/theme9/images/internet_explorer/borderTopRight.png +0 -0
  130. themes/theme9/images/loading.gif +0 -0
  131. yt.js +26 -31
i/icon.png ADDED
Binary file
i/logo.png ADDED
Binary file
img/default.jpg ADDED
Binary file
javascripts/jquery.colorbox-min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ // ColorBox v1.3.15 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
2
+ // Copyright (c) 2010 Jack Moore - jack@colorpowered.com
3
+ // Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
4
+ (function(b,ib){var t="none",M="LoadedContent",c=false,v="resize.",o="y",q="auto",e=true,L="nofollow",m="x";function f(a,c){a=a?' id="'+i+a+'"':"";c=c?' style="'+c+'"':"";return b("<div"+a+c+"/>")}function p(a,b){b=b===m?n.width():n.height();return typeof a==="string"?Math.round(/%/.test(a)?b/100*parseInt(a,10):parseInt(a,10)):a}function U(b){return a.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(b)}function cb(a){for(var c in a)if(b.isFunction(a[c])&&c.substring(0,2)!=="on")a[c]=a[c].call(l);a.rel=a.rel||l.rel||L;a.href=a.href||b(l).attr("href");a.title=a.title||l.title;return a}function w(c,a){a&&a.call(l);b.event.trigger(c)}function jb(){var b,e=i+"Slideshow_",c="click."+i,f,k;if(a.slideshow&&h[1]){f=function(){F.text(a.slideshowStop).unbind(c).bind(V,function(){if(g<h.length-1||a.loop)b=setTimeout(d.next,a.slideshowSpeed)}).bind(W,function(){clearTimeout(b)}).one(c+" "+N,k);j.removeClass(e+"off").addClass(e+"on");b=setTimeout(d.next,a.slideshowSpeed)};k=function(){clearTimeout(b);F.text(a.slideshowStart).unbind([V,W,N,c].join(" ")).one(c,f);j.removeClass(e+"on").addClass(e+"off")};a.slideshowAuto?f():k()}}function db(c){if(!O){l=c;a=cb(b.extend({},b.data(l,r)));h=b(l);g=0;if(a.rel!==L){h=b("."+G).filter(function(){return (b.data(this,r).rel||this.rel)===a.rel});g=h.index(l);if(g===-1){h=h.add(l);g=h.length-1}}if(!u){u=D=e;j.show();if(a.returnFocus)try{l.blur();b(l).one(eb,function(){try{this.focus()}catch(a){}})}catch(f){}x.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":q}).show();a.w=p(a.initialWidth,m);a.h=p(a.initialHeight,o);d.position(0);X&&n.bind(v+P+" scroll."+P,function(){x.css({width:n.width(),height:n.height(),top:n.scrollTop(),left:n.scrollLeft()})}).trigger("scroll."+P);w(fb,a.onOpen);Y.add(H).add(I).add(F).add(Z).hide();ab.html(a.close).show()}d.load(e)}}var gb={transition:"elastic",speed:300,width:c,initialWidth:"600",innerWidth:c,maxWidth:c,height:c,initialHeight:"450",innerHeight:c,maxHeight:c,scalePhotos:e,scrolling:e,inline:c,html:c,iframe:c,photo:c,href:c,title:c,rel:c,opacity:.9,preloading:e,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:c,returnFocus:e,loop:e,slideshow:c,slideshowAuto:e,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:c,onLoad:c,onComplete:c,onCleanup:c,onClosed:c,overlayClose:e,escKey:e,arrowKey:e},r="colorbox",i="cbox",fb=i+"_open",W=i+"_load",V=i+"_complete",N=i+"_cleanup",eb=i+"_closed",Q=i+"_purge",hb=i+"_loaded",E=b.browser.msie&&!b.support.opacity,X=E&&b.browser.version<7,P=i+"_IE6",x,j,A,s,bb,T,R,S,h,n,k,J,K,Z,Y,F,I,H,ab,B,C,y,z,l,g,a,u,D,O=c,d,G=i+"Element";d=b.fn[r]=b[r]=function(c,f){var a=this,d;if(!a[0]&&a.selector)return a;c=c||{};if(f)c.onComplete=f;if(!a[0]||a.selector===undefined){a=b("<a/>");c.open=e}a.each(function(){b.data(this,r,b.extend({},b.data(this,r)||gb,c));b(this).addClass(G)});d=c.open;if(b.isFunction(d))d=d.call(a);d&&db(a[0]);return a};d.init=function(){var l="hover",m="clear:left";n=b(ib);j=f().attr({id:r,"class":E?i+"IE":""});x=f("Overlay",X?"position:absolute":"").hide();A=f("Wrapper");s=f("Content").append(k=f(M,"width:0; height:0; overflow:hidden"),K=f("LoadingOverlay").add(f("LoadingGraphic")),Z=f("Title"),Y=f("Current"),I=f("Next"),H=f("Previous"),F=f("Slideshow").bind(fb,jb),ab=f("Close"));A.append(f().append(f("TopLeft"),bb=f("TopCenter"),f("TopRight")),f(c,m).append(T=f("MiddleLeft"),s,R=f("MiddleRight")),f(c,m).append(f("BottomLeft"),S=f("BottomCenter"),f("BottomRight"))).children().children().css({"float":"left"});J=f(c,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(x,j.append(A,J));s.children().hover(function(){b(this).addClass(l)},function(){b(this).removeClass(l)}).addClass(l);B=bb.height()+S.height()+s.outerHeight(e)-s.height();C=T.width()+R.width()+s.outerWidth(e)-s.width();y=k.outerHeight(e);z=k.outerWidth(e);j.css({"padding-bottom":B,"padding-right":C}).hide();I.click(d.next);H.click(d.prev);ab.click(d.close);s.children().removeClass(l);b("."+G).live("click",function(a){if(!(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)){a.preventDefault();db(this)}});x.click(function(){a.overlayClose&&d.close()});b(document).bind("keydown",function(b){if(u&&a.escKey&&b.keyCode===27){b.preventDefault();d.close()}if(u&&a.arrowKey&&!D&&h[1])if(b.keyCode===37&&(g||a.loop)){b.preventDefault();H.click()}else if(b.keyCode===39&&(g<h.length-1||a.loop)){b.preventDefault();I.click()}})};d.remove=function(){j.add(x).remove();b("."+G).die("click").removeData(r).removeClass(G)};d.position=function(f,d){function b(a){bb[0].style.width=S[0].style.width=s[0].style.width=a.style.width;K[0].style.height=K[1].style.height=s[0].style.height=T[0].style.height=R[0].style.height=a.style.height}var e,h=Math.max(document.documentElement.clientHeight-a.h-y-B,0)/2+n.scrollTop(),g=Math.max(n.width()-a.w-z-C,0)/2+n.scrollLeft();e=j.width()===a.w+z&&j.height()===a.h+y?0:f;A[0].style.width=A[0].style.height="9999px";j.dequeue().animate({width:a.w+z,height:a.h+y,top:h,left:g},{duration:e,complete:function(){b(this);D=c;A[0].style.width=a.w+z+C+"px";A[0].style.height=a.h+y+B+"px";d&&d()},step:function(){b(this)}})};d.resize=function(b){if(u){b=b||{};if(b.width)a.w=p(b.width,m)-z-C;if(b.innerWidth)a.w=p(b.innerWidth,m);k.css({width:a.w});if(b.height)a.h=p(b.height,o)-y-B;if(b.innerHeight)a.h=p(b.innerHeight,o);if(!b.innerHeight&&!b.height){b=k.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}k.css({height:a.h});d.position(a.transition===t?0:a.speed)}};d.prep=function(m){var c="hidden";function l(s){var p,f,m,c,l=h.length,q=a.loop;d.position(s,function(){function s(){E&&j[0].style.removeAttribute("filter")}if(u){E&&o&&k.fadeIn(100);k.show();w(hb);Z.show().html(a.title);if(l>1){typeof a.current==="string"&&Y.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,l)).show();I[q||g<l-1?"show":"hide"]().html(a.next);H[q||g?"show":"hide"]().html(a.previous);p=g?h[g-1]:h[l-1];m=g<l-1?h[g+1]:h[0];a.slideshow&&F.show();if(a.preloading){c=b.data(m,r).href||m.href;f=b.data(p,r).href||p.href;c=b.isFunction(c)?c.call(m):c;f=b.isFunction(f)?f.call(p):f;if(U(c))b("<img/>")[0].src=c;if(U(f))b("<img/>")[0].src=f}}K.hide();a.transition==="fade"?j.fadeTo(e,1,function(){s()}):s();n.bind(v+i,function(){d.position(0)});w(V,a.onComplete)}})}if(u){var o,e=a.transition===t?0:a.speed;n.unbind(v+i);k.remove();k=f(M).html(m);k.hide().appendTo(J.show()).css({width:function(){a.w=a.w||k.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?q:c}).css({height:function(){a.h=a.h||k.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(s);J.hide();b("#"+i+"Photo").css({cssFloat:t,marginLeft:q,marginRight:q});X&&b("select").not(j.find("select")).filter(function(){return this.style.visibility!==c}).css({visibility:c}).one(N,function(){this.style.visibility="inherit"});a.transition==="fade"?j.fadeTo(e,0,function(){l(0)}):l(e)}};d.load=function(u){var n,c,s,q=d.prep;D=e;l=h[g];u||(a=cb(b.extend({},b.data(l,r))));w(Q);w(W,a.onLoad);a.h=a.height?p(a.height,o)-y-B:a.innerHeight&&p(a.innerHeight,o);a.w=a.width?p(a.width,m)-z-C:a.innerWidth&&p(a.innerWidth,m);a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=p(a.maxWidth,m)-z-C;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=p(a.maxHeight,o)-y-B;a.mh=a.h&&a.h<a.mh?a.h:a.mh}n=a.href;K.show();if(a.inline){f().hide().insertBefore(b(n)[0]).one(Q,function(){b(this).replaceWith(k.children())});q(b(n))}else if(a.iframe){j.one(hb,function(){var c=b("<iframe frameborder='0' style='width:100%; height:100%; border:0; display:block'/>")[0];c.name=i+ +new Date;c.src=a.href;if(!a.scrolling)c.scrolling="no";if(E)c.allowtransparency="true";b(c).appendTo(k).one(Q,function(){c.src="//about:blank"})});q(" ")}else if(a.html)q(a.html);else if(U(n)){c=new Image;c.onload=function(){var e;c.onload=null;c.id=i+"Photo";b(c).css({border:t,display:"block",cssFloat:"left"});if(a.scalePhotos){s=function(){c.height-=c.height*e;c.width-=c.width*e};if(a.mw&&c.width>a.mw){e=(c.width-a.mw)/c.width;s()}if(a.mh&&c.height>a.mh){e=(c.height-a.mh)/c.height;s()}}if(a.h)c.style.marginTop=Math.max(a.h-c.height,0)/2+"px";h[1]&&(g<h.length-1||a.loop)&&b(c).css({cursor:"pointer"}).click(d.next);if(E)c.style.msInterpolationMode="bicubic";setTimeout(function(){q(c)},1)};setTimeout(function(){c.src=n},1)}else n&&J.load(n,function(d,c,a){q(c==="error"?"Request unsuccessful: "+a.statusText:b(this).children())})};d.next=function(){if(!D){g=g<h.length-1?g+1:0;d.load()}};d.prev=function(){if(!D){g=g?g-1:h.length-1;d.load()}};d.close=function(){if(u&&!O){O=e;u=c;w(N,a.onCleanup);n.unbind("."+i+" ."+P);x.fadeTo("fast",0);j.stop().fadeTo("fast",0,function(){w(Q);k.remove();j.add(x).css({opacity:1,cursor:q}).hide();setTimeout(function(){O=c;w(eb,a.onClosed)},1)})}};d.element=function(){return b(l)};d.settings=gb;b(d.init)})(jQuery,this);
javascripts/jquery.colorbox.js ADDED
@@ -0,0 +1,788 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // ColorBox v1.3.15 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
2
+ // Copyright (c) 2010 Jack Moore - jack@colorpowered.com
3
+ // Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
4
+ (function ($, window) {
5
+
6
+ var
7
+ // ColorBox Default Settings.
8
+ // See http://colorpowered.com/colorbox for details.
9
+ defaults = {
10
+ transition: "elastic",
11
+ speed: 300,
12
+ width: false,
13
+ initialWidth: "600",
14
+ innerWidth: false,
15
+ maxWidth: false,
16
+ height: false,
17
+ initialHeight: "450",
18
+ innerHeight: false,
19
+ maxHeight: false,
20
+ scalePhotos: true,
21
+ scrolling: true,
22
+ inline: false,
23
+ html: false,
24
+ iframe: false,
25
+ photo: false,
26
+ href: false,
27
+ title: false,
28
+ rel: false,
29
+ opacity: 0.9,
30
+ preloading: true,
31
+ current: "image {current} of {total}",
32
+ previous: "previous",
33
+ next: "next",
34
+ close: "close",
35
+ open: false,
36
+ returnFocus: true,
37
+ loop: true,
38
+ slideshow: false,
39
+ slideshowAuto: true,
40
+ slideshowSpeed: 2500,
41
+ slideshowStart: "start slideshow",
42
+ slideshowStop: "stop slideshow",
43
+ onOpen: false,
44
+ onLoad: false,
45
+ onComplete: false,
46
+ onCleanup: false,
47
+ onClosed: false,
48
+ overlayClose: true,
49
+ escKey: true,
50
+ arrowKey: true
51
+ },
52
+
53
+ // Abstracting the HTML and event identifiers for easy rebranding
54
+ colorbox = 'colorbox',
55
+ prefix = 'cbox',
56
+
57
+ // Events
58
+ event_open = prefix + '_open',
59
+ event_load = prefix + '_load',
60
+ event_complete = prefix + '_complete',
61
+ event_cleanup = prefix + '_cleanup',
62
+ event_closed = prefix + '_closed',
63
+ event_purge = prefix + '_purge',
64
+ event_loaded = prefix + '_loaded',
65
+
66
+ // Special Handling for IE
67
+ isIE = $.browser.msie && !$.support.opacity, // feature detection alone gave a false positive on at least one phone browser and on some development versions of Chrome.
68
+ isIE6 = isIE && $.browser.version < 7,
69
+ event_ie6 = prefix + '_IE6',
70
+
71
+ // Cached jQuery Object Variables
72
+ $overlay,
73
+ $box,
74
+ $wrap,
75
+ $content,
76
+ $topBorder,
77
+ $leftBorder,
78
+ $rightBorder,
79
+ $bottomBorder,
80
+ $related,
81
+ $window,
82
+ $loaded,
83
+ $loadingBay,
84
+ $loadingOverlay,
85
+ $title,
86
+ $current,
87
+ $slideshow,
88
+ $next,
89
+ $prev,
90
+ $close,
91
+
92
+ // Variables for cached values or use across multiple functions
93
+ interfaceHeight,
94
+ interfaceWidth,
95
+ loadedHeight,
96
+ loadedWidth,
97
+ element,
98
+ index,
99
+ settings,
100
+ open,
101
+ active,
102
+ closing = false,
103
+
104
+ publicMethod,
105
+ boxElement = prefix + 'Element';
106
+
107
+ // ****************
108
+ // HELPER FUNCTIONS
109
+ // ****************
110
+
111
+ // jQuery object generator to reduce code size
112
+ function $div(id, css) {
113
+ id = id ? ' id="' + prefix + id + '"' : '';
114
+ css = css ? ' style="' + css + '"' : '';
115
+ return $('<div' + id + css + '/>');
116
+ }
117
+
118
+ // Convert % values to pixels
119
+ function setSize(size, dimension) {
120
+ dimension = dimension === 'x' ? $window.width() : $window.height();
121
+ return (typeof size === 'string') ? Math.round((/%/.test(size) ? (dimension / 100) * parseInt(size, 10) : parseInt(size, 10))) : size;
122
+ }
123
+
124
+ // Checks an href to see if it is a photo.
125
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by this regex.
126
+ function isImage(url) {
127
+ return settings.photo || /\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(url);
128
+ }
129
+
130
+ // Assigns function results to their respective settings. This allows functions to be used as values.
131
+ function process(settings) {
132
+ for (var i in settings) {
133
+ if ($.isFunction(settings[i]) && i.substring(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
134
+ settings[i] = settings[i].call(element);
135
+ }
136
+ }
137
+ settings.rel = settings.rel || element.rel || 'nofollow';
138
+ settings.href = settings.href || $(element).attr('href');
139
+ settings.title = settings.title || element.title;
140
+ return settings;
141
+ }
142
+
143
+ function trigger(event, callback) {
144
+ if (callback) {
145
+ callback.call(element);
146
+ }
147
+ $.event.trigger(event);
148
+ }
149
+
150
+ // Slideshow functionality
151
+ function slideshow() {
152
+ var
153
+ timeOut,
154
+ className = prefix + "Slideshow_",
155
+ click = "click." + prefix,
156
+ start,
157
+ stop,
158
+ clear;
159
+
160
+ if (settings.slideshow && $related[1]) {
161
+ start = function () {
162
+ $slideshow
163
+ .text(settings.slideshowStop)
164
+ .unbind(click)
165
+ .bind(event_complete, function () {
166
+ if (index < $related.length - 1 || settings.loop) {
167
+ timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
168
+ }
169
+ })
170
+ .bind(event_load, function () {
171
+ clearTimeout(timeOut);
172
+ })
173
+ .one(click + ' ' + event_cleanup, stop);
174
+ $box.removeClass(className + "off").addClass(className + "on");
175
+ timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
176
+ };
177
+
178
+ stop = function () {
179
+ clearTimeout(timeOut);
180
+ $slideshow
181
+ .text(settings.slideshowStart)
182
+ .unbind([event_complete, event_load, event_cleanup, click].join(' '))
183
+ .one(click, start);
184
+ $box.removeClass(className + "on").addClass(className + "off");
185
+ };
186
+
187
+ if (settings.slideshowAuto) {
188
+ start();
189
+ } else {
190
+ stop();
191
+ }
192
+ }
193
+ }
194
+
195
+ function launch(elem) {
196
+ if (!closing) {
197
+
198
+ element = elem;
199
+
200
+ settings = process($.extend({}, $.data(element, colorbox)));
201
+
202
+ $related = $(element);
203
+
204
+ index = 0;
205
+
206
+ if (settings.rel !== 'nofollow') {
207
+ $related = $('.' + boxElement).filter(function () {
208
+ var relRelated = $.data(this, colorbox).rel || this.rel;
209
+ return (relRelated === settings.rel);
210
+ });
211
+ index = $related.index(element);
212
+
213
+ // Check direct calls to ColorBox.
214
+ if (index === -1) {
215
+ $related = $related.add(element);
216
+ index = $related.length - 1;
217
+ }
218
+ }
219
+
220
+ if (!open) {
221
+ open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
222
+
223
+ $box.show();
224
+
225
+ if (settings.returnFocus) {
226
+ try {
227
+ element.blur();
228
+ $(element).one(event_closed, function () {
229
+ try {
230
+ this.focus();
231
+ } catch (e) {
232
+ // do nothing
233
+ }
234
+ });
235
+ } catch (e) {
236
+ // do nothing
237
+ }
238
+ }
239
+
240
+ // +settings.opacity avoids a problem in IE when using non-zero-prefixed-string-values, like '.5'
241
+ $overlay.css({"opacity": +settings.opacity, "cursor": settings.overlayClose ? "pointer" : "auto"}).show();
242
+
243
+ // Opens inital empty ColorBox prior to content being loaded.
244
+ settings.w = setSize(settings.initialWidth, 'x');
245
+ settings.h = setSize(settings.initialHeight, 'y');
246
+ publicMethod.position(0);
247
+
248
+ if (isIE6) {
249
+ $window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () {
250
+ $overlay.css({width: $window.width(), height: $window.height(), top: $window.scrollTop(), left: $window.scrollLeft()});
251
+ }).trigger('scroll.' + event_ie6);
252
+ }
253
+
254
+ trigger(event_open, settings.onOpen);
255
+
256
+ $current.add($prev).add($next).add($slideshow).add($title).hide();
257
+
258
+ $close.html(settings.close).show();
259
+ }
260
+
261
+ publicMethod.load(true);
262
+ }
263
+ }
264
+
265
+ // ****************
266
+ // PUBLIC FUNCTIONS
267
+ // Usage format: $.fn.colorbox.close();
268
+ // Usage from within an iframe: parent.$.fn.colorbox.close();
269
+ // ****************
270
+
271
+ publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
272
+ var $this = this, autoOpen;
273
+
274
+ if (!$this[0] && $this.selector) { // if a selector was given and it didn't match any elements, go ahead and exit.
275
+ return $this;
276
+ }
277
+
278
+ options = options || {};
279
+
280
+ if (callback) {
281
+ options.onComplete = callback;
282
+ }
283
+
284
+ if (!$this[0] || $this.selector === undefined) { // detects $.colorbox() and $.fn.colorbox()
285
+ $this = $('<a/>');
286
+ options.open = true; // assume an immediate open
287
+ }
288
+
289
+ $this.each(function () {
290
+ $.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
291
+ $(this).addClass(boxElement);
292
+ });
293
+
294
+ autoOpen = options.open;
295
+
296
+ if ($.isFunction(autoOpen)) {
297
+ autoOpen = autoOpen.call($this);
298
+ }
299
+
300
+ if (autoOpen) {
301
+ launch($this[0]);
302
+ }
303
+
304
+ return $this;
305
+ };
306
+
307
+ // Initialize ColorBox: store common calculations, preload the interface graphics, append the html.
308
+ // This preps colorbox for a speedy open when clicked, and lightens the burdon on the browser by only
309
+ // having to run once, instead of each time colorbox is opened.
310
+ publicMethod.init = function () {
311
+ // Create & Append jQuery Objects
312
+ $window = $(window);
313
+ $box = $div().attr({id: colorbox, 'class': isIE ? prefix + 'IE' : ''});
314
+ $overlay = $div("Overlay", isIE6 ? 'position:absolute' : '').hide();
315
+
316
+ $wrap = $div("Wrapper");
317
+ $content = $div("Content").append(
318
+ $loaded = $div("LoadedContent", 'width:0; height:0; overflow:hidden'),
319
+ $loadingOverlay = $div("LoadingOverlay").add($div("LoadingGraphic")),
320
+ $title = $div("Title"),
321
+ $current = $div("Current"),
322
+ $next = $div("Next"),
323
+ $prev = $div("Previous"),
324
+ $slideshow = $div("Slideshow").bind(event_open, slideshow),
325
+ $close = $div("Close")
326
+ );
327
+ $wrap.append( // The 3x3 Grid that makes up ColorBox
328
+ $div().append(
329
+ $div("TopLeft"),
330
+ $topBorder = $div("TopCenter"),
331
+ $div("TopRight")
332
+ ),
333
+ $div(false, 'clear:left').append(
334
+ $leftBorder = $div("MiddleLeft"),
335
+ $content,
336
+ $rightBorder = $div("MiddleRight")
337
+ ),
338
+ $div(false, 'clear:left').append(
339
+ $div("BottomLeft"),
340
+ $bottomBorder = $div("BottomCenter"),
341
+ $div("BottomRight")
342
+ )
343
+ ).children().children().css({'float': 'left'});
344
+
345
+ $loadingBay = $div(false, 'position:absolute; width:9999px; visibility:hidden; display:none');
346
+
347
+ $('body').prepend($overlay, $box.append($wrap, $loadingBay));
348
+
349
+ $content.children()
350
+ .hover(function () {
351
+ $(this).addClass('hover');
352
+ }, function () {
353
+ $(this).removeClass('hover');
354
+ }).addClass('hover');
355
+
356
+ // Cache values needed for size calculations
357
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
358
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
359
+ loadedHeight = $loaded.outerHeight(true);
360
+ loadedWidth = $loaded.outerWidth(true);
361
+
362
+ // Setting padding to remove the need to do size conversions during the animation step.
363
+ $box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth}).hide();
364
+
365
+ // Setup button events.
366
+ $next.click(publicMethod.next);
367
+ $prev.click(publicMethod.prev);
368
+ $close.click(publicMethod.close);
369
+
370
+ // Adding the 'hover' class allowed the browser to load the hover-state
371
+ // background graphics. The class can now can be removed.
372
+ $content.children().removeClass('hover');
373
+
374
+ $('.' + boxElement).live('click', function (e) {
375
+ // checks to see if it was a non-left mouse-click and for clicks modified with ctrl, shift, or alt.
376
+ if (!((e.button !== 0 && typeof e.button !== 'undefined') || e.ctrlKey || e.shiftKey || e.altKey)) {
377
+ e.preventDefault();
378
+ launch(this);
379
+ }
380
+ });
381
+
382
+ $overlay.click(function () {
383
+ if (settings.overlayClose) {
384
+ publicMethod.close();
385
+ }
386
+ });
387
+
388
+ // Set Navigation Key Bindings
389
+ $(document).bind("keydown", function (e) {
390
+ if (open && settings.escKey && e.keyCode === 27) {
391
+ e.preventDefault();
392
+ publicMethod.close();
393
+ }
394
+ if (open && settings.arrowKey && !active && $related[1]) {
395
+ if (e.keyCode === 37 && (index || settings.loop)) {
396
+ e.preventDefault();
397
+ $prev.click();
398
+ } else if (e.keyCode === 39 && (index < $related.length - 1 || settings.loop)) {
399
+ e.preventDefault();
400
+ $next.click();
401
+ }
402
+ }
403
+ });
404
+ };
405
+
406
+ publicMethod.remove = function () {
407
+ $box.add($overlay).remove();
408
+ $('.' + boxElement).die('click').removeData(colorbox).removeClass(boxElement);
409
+ };
410
+
411
+ publicMethod.position = function (speed, loadedCallback) {
412
+ var
413
+ animate_speed,
414
+ // keeps the top and left positions within the browser's viewport.
415
+ posTop = Math.max(document.documentElement.clientHeight - settings.h - loadedHeight - interfaceHeight, 0) / 2 + $window.scrollTop(),
416
+ posLeft = Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2 + $window.scrollLeft();
417
+
418
+ // setting the speed to 0 to reduce the delay between same-sized content.
419
+ animate_speed = ($box.width() === settings.w + loadedWidth && $box.height() === settings.h + loadedHeight) ? 0 : speed;
420
+
421
+ // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
422
+ // but it has to be shrank down around the size of div#colorbox when it's done. If not,
423
+ // it can invoke an obscure IE bug when using iframes.
424
+ $wrap[0].style.width = $wrap[0].style.height = "9999px";
425
+
426
+ function modalDimensions(that) {
427
+ // loading overlay height has to be explicitly set for IE6.
428
+ $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = that.style.width;
429
+ $loadingOverlay[0].style.height = $loadingOverlay[1].style.height = $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = that.style.height;
430
+ }
431
+
432
+ $box.dequeue().animate({width: settings.w + loadedWidth, height: settings.h + loadedHeight, top: posTop, left: posLeft}, {
433
+ duration: animate_speed,
434
+ complete: function () {
435
+ modalDimensions(this);
436
+
437
+ active = false;
438
+
439
+ // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
440
+ $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
441
+ $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
442
+
443
+ if (loadedCallback) {
444
+ loadedCallback();
445
+ }
446
+ },
447
+ step: function () {
448
+ modalDimensions(this);
449
+ }
450
+ });
451
+ };
452
+
453
+ publicMethod.resize = function (options) {
454
+ if (open) {
455
+ options = options || {};
456
+
457
+ if (options.width) {
458
+ settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
459
+ }
460
+ if (options.innerWidth) {
461
+ settings.w = setSize(options.innerWidth, 'x');
462
+ }
463
+ $loaded.css({width: settings.w});
464
+
465
+ if (options.height) {
466
+ settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
467
+ }
468
+ if (options.innerHeight) {
469
+ settings.h = setSize(options.innerHeight, 'y');
470
+ }
471
+ if (!options.innerHeight && !options.height) {
472
+ var $child = $loaded.wrapInner("<div style='overflow:auto'></div>").children(); // temporary wrapper to get an accurate estimate of just how high the total content should be.
473
+ settings.h = $child.height();
474
+ $child.replaceWith($child.children()); // ditch the temporary wrapper div used in height calculation
475
+ }
476
+ $loaded.css({height: settings.h});
477
+
478
+ publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
479
+ }
480
+ };
481
+
482
+ publicMethod.prep = function (object) {
483
+ if (!open) {
484
+ return;
485
+ }
486
+
487
+ var photo,
488
+ speed = settings.transition === "none" ? 0 : settings.speed;
489
+
490
+ $window.unbind('resize.' + prefix);
491
+ $loaded.remove();
492
+ $loaded = $div('LoadedContent').html(object);
493
+
494
+ function getWidth() {
495
+ settings.w = settings.w || $loaded.width();
496
+ settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
497
+ return settings.w;
498
+ }
499
+ function getHeight() {
500
+ settings.h = settings.h || $loaded.height();
501
+ settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
502
+ return settings.h;
503
+ }
504
+
505
+ $loaded.hide()
506
+ .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
507
+ .css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
508
+ .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
509
+ .prependTo($content);
510
+
511
+ $loadingBay.hide();
512
+
513
+ // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
514
+ $('#' + prefix + 'Photo').css({cssFloat: 'none', marginLeft: 'auto', marginRight: 'auto'});
515
+
516
+ // Hides SELECT elements in IE6 because they would otherwise sit on top of the overlay.
517
+ if (isIE6) {
518
+ $('select').not($box.find('select')).filter(function () {
519
+ return this.style.visibility !== 'hidden';
520
+ }).css({'visibility': 'hidden'}).one(event_cleanup, function () {
521
+ this.style.visibility = 'inherit';
522
+ });
523
+ }
524
+
525
+ function setPosition(s) {
526
+ var prev, prevSrc, next, nextSrc, total = $related.length, loop = settings.loop;
527
+ publicMethod.position(s, function () {
528
+ function defilter() {
529
+ if (isIE) {
530
+ //IE adds a filter when ColorBox fades in and out that can cause problems if the loaded content contains transparent pngs.
531
+ $box[0].style.removeAttribute("filter");
532
+ }
533
+ }
534
+
535
+ if (!open) {
536
+ return;
537
+ }
538
+
539
+ if (isIE) {
540
+ //This fadeIn helps the bicubic resampling to kick-in.
541
+ if (photo) {
542
+ $loaded.fadeIn(100);
543
+ }
544
+ }
545
+
546
+ $loaded.show();
547
+
548
+ trigger(event_loaded);
549
+
550
+ $title.show().html(settings.title);
551
+
552
+ if (total > 1) { // handle grouping
553
+ if (typeof settings.current === "string") {
554
+ $current.html(settings.current.replace(/\{current\}/, index + 1).replace(/\{total\}/, total)).show();
555
+ }
556
+
557
+ $next[(loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
558
+ $prev[(loop || index) ? "show" : "hide"]().html(settings.previous);
559
+
560
+ prev = index ? $related[index - 1] : $related[total - 1];
561
+ next = index < total - 1 ? $related[index + 1] : $related[0];
562
+
563
+ if (settings.slideshow) {
564
+ $slideshow.show();
565
+ }
566
+
567
+ // Preloads images within a rel group
568
+ if (settings.preloading) {
569
+ nextSrc = $.data(next, colorbox).href || next.href;
570
+ prevSrc = $.data(prev, colorbox).href || prev.href;
571
+
572
+ nextSrc = $.isFunction(nextSrc) ? nextSrc.call(next) : nextSrc;
573
+ prevSrc = $.isFunction(prevSrc) ? prevSrc.call(prev) : prevSrc;
574
+
575
+ if (isImage(nextSrc)) {
576
+ $('<img/>')[0].src = nextSrc;
577
+ }
578
+
579
+ if (isImage(prevSrc)) {
580
+ $('<img/>')[0].src = prevSrc;
581
+ }
582
+ }
583
+ }
584
+
585
+ $loadingOverlay.hide();
586
+
587
+ if (settings.transition === 'fade') {
588
+ $box.fadeTo(speed, 1, function () {
589
+ defilter();
590
+ });
591
+ } else {
592
+ defilter();
593
+ }
594
+
595
+ $window.bind('resize.' + prefix, function () {
596
+ publicMethod.position(0);
597
+ });
598
+
599
+ trigger(event_complete, settings.onComplete);
600
+ });
601
+ }
602
+
603
+ if (settings.transition === 'fade') {
604
+ $box.fadeTo(speed, 0, function () {
605
+ setPosition(0);
606
+ });
607
+ } else {
608
+ setPosition(speed);
609
+ }
610
+ };
611
+
612
+ publicMethod.load = function (launched) {
613
+ var href, img, setResize, prep = publicMethod.prep;
614
+
615
+ active = true;
616
+ element = $related[index];
617
+
618
+ if (!launched) {
619
+ settings = process($.extend({}, $.data(element, colorbox)));
620
+ }
621
+
622
+ trigger(event_purge);
623
+
624
+ trigger(event_load, settings.onLoad);
625
+
626
+ settings.h = settings.height ?
627
+ setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
628
+ settings.innerHeight && setSize(settings.innerHeight, 'y');
629
+
630
+ settings.w = settings.width ?
631
+ setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
632
+ settings.innerWidth && setSize(settings.innerWidth, 'x');
633
+
634
+ // Sets the minimum dimensions for use in image scaling
635
+ settings.mw = settings.w;
636
+ settings.mh = settings.h;
637
+
638
+ // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
639
+ // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
640
+ if (settings.maxWidth) {
641
+ settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
642
+ settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
643
+ }
644
+ if (settings.maxHeight) {
645
+ settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
646
+ settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
647
+ }
648
+
649
+ href = settings.href;
650
+
651
+ $loadingOverlay.show();
652
+
653
+ if (settings.inline) {
654
+ // Inserts an empty placeholder where inline content is being pulled from.
655
+ // An event is bound to put inline content back when ColorBox closes or loads new content.
656
+ $div().hide().insertBefore($(href)[0]).one(event_purge, function () {
657
+ $(this).replaceWith($loaded.children());
658
+ });
659
+ prep($(href));
660
+ } else if (settings.iframe) {
661
+ // IFrame element won't be added to the DOM until it is ready to be displayed,
662
+ // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
663
+ $box.one(event_loaded, function () {
664
+ var iframe = $("<iframe frameborder='0' style='width:100%; height:100%; border:0; display:block'/>")[0];
665
+ iframe.name = prefix + (+new Date());
666
+ iframe.src = settings.href;
667
+
668
+ if (!settings.scrolling) {
669
+ iframe.scrolling = "no";
670
+ }
671
+
672
+ if (isIE) {
673
+ iframe.allowtransparency = "true";
674
+ }
675
+
676
+ $(iframe).appendTo($loaded).one(event_purge, function () {
677
+ iframe.src = "//about:blank";
678
+ });
679
+ });
680
+
681
+ prep(" ");
682
+ } else if (settings.html) {
683
+ prep(settings.html);
684
+ } else if (isImage(href)) {
685
+ img = new Image();
686
+ img.onload = function () {
687
+ var percent;
688
+ img.onload = null;
689
+ img.id = prefix + 'Photo';
690
+ $(img).css({border: 'none', display: 'block', cssFloat: 'left'});
691
+ if (settings.scalePhotos) {
692
+ setResize = function () {
693
+ img.height -= img.height * percent;
694
+ img.width -= img.width * percent;
695
+ };
696
+ if (settings.mw && img.width > settings.mw) {
697
+ percent = (img.width - settings.mw) / img.width;
698
+ setResize();
699
+ }
700
+ if (settings.mh && img.height > settings.mh) {
701
+ percent = (img.height - settings.mh) / img.height;
702
+ setResize();
703
+ }
704
+ }
705
+
706
+ if (settings.h) {
707
+ img.style.marginTop = Math.max(settings.h - img.height, 0) / 2 + 'px';
708
+ }
709
+
710
+ if ($related[1] && (index < $related.length - 1 || settings.loop)) {
711
+ $(img).css({cursor: 'pointer'}).click(publicMethod.next);
712
+ }
713
+
714
+ if (isIE) {
715
+ img.style.msInterpolationMode = 'bicubic';
716
+ }
717
+
718
+ setTimeout(function () { // Chrome will sometimes report a 0 by 0 size if there isn't pause in execution
719
+ prep(img);
720
+ }, 1);
721
+ };
722
+
723
+ setTimeout(function () { // Opera 10.6+ will sometimes load the src before the onload function is set
724
+ img.src = href;
725
+ }, 1);
726
+ } else if (href) {
727
+ $loadingBay.load(href, function (data, status, xhr) {
728
+ prep(status === 'error' ? 'Request unsuccessful: ' + xhr.statusText : $(this).children());
729
+ });
730
+ }
731
+ };
732
+
733
+ // Navigates to the next page/image in a set.
734
+ publicMethod.next = function () {
735
+ if (!active) {
736
+ index = index < $related.length - 1 ? index + 1 : 0;
737
+ publicMethod.load();
738
+ }
739
+ };
740
+
741
+ publicMethod.prev = function () {
742
+ if (!active) {
743
+ index = index ? index - 1 : $related.length - 1;
744
+ publicMethod.load();
745
+ }
746
+ };
747
+
748
+ // Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close();
749
+ publicMethod.close = function () {
750
+ if (open && !closing) {
751
+ closing = true;
752
+
753
+ open = false;
754
+
755
+ trigger(event_cleanup, settings.onCleanup);
756
+
757
+ $window.unbind('.' + prefix + ' .' + event_ie6);
758
+
759
+ $overlay.fadeTo('fast', 0);
760
+
761
+ $box.stop().fadeTo('fast', 0, function () {
762
+
763
+ trigger(event_purge);
764
+
765
+ $loaded.remove();
766
+
767
+ $box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
768
+
769
+ setTimeout(function () {
770
+ closing = false;
771
+ trigger(event_closed, settings.onClosed);
772
+ }, 1);
773
+ });
774
+ }
775
+ };
776
+
777
+ // A method for fetching the current element ColorBox is referencing.
778
+ // returns a jQuery object.
779
+ publicMethod.element = function () {
780
+ return $(element);
781
+ };
782
+
783
+ publicMethod.settings = defaults;
784
+
785
+ // Initializes ColorBox when the DOM has loaded
786
+ $(publicMethod.init);
787
+
788
+ }(jQuery, this));
readme.txt CHANGED
@@ -1,42 +1,55 @@
1
- === Smart YouTube ===
2
  Contributors: freediver
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
4
- Tags: youtube, video, play, media, Post, posts, admin
5
  Requires at least: 2.0
6
  Tested up to: 3.3
7
  Stable tag: trunk
8
 
9
- Smart Youtube plugin allows you to insert full featured YouTube videos into your post, comments and in RSS feed.
10
 
11
  == Description ==
12
 
13
- Smart Youtube is a Wordpress Youtube Plugin that allows you to easily insert Youtube videos/playlists in your post, comments and in RSS feed.
14
 
15
- The main purpose of the plugin is to correctly embed youtube videos into your blog post. The video will be shown in full in your RSS feed as well.
16
-
17
- Smart youtube also supports playback of high quality videos, works on iPhone, produces xHTML valid code (unlike YouTube embed code), allows you to view videos in fullscreen, supports YouTube playlists (normal/HD) and the new outube IFRAME embed code.
18
 
19
  The plugin is designed to be small and fast and not use any external resources. It has a number of customizable options.
20
 
21
  Main Features:
22
 
23
- * Easily embeds YouTube videos (normal/HD, both youtube.com and youtu.be links)
 
24
  * Embed YouTube playlist (normal/HD)
25
- * Supports latest high quality video protocols (360p and HD quality 720p)
26
- * Allows full YouTube customization (colors, border, size, full screen...)
 
27
  * Supports video deep linking (starting at desired point with &start=time parameter)
28
- * Works on iPhone, iPad and iPod
 
29
  * Supports migrated blogs from Wordpress.com
30
  * Supports migration from other Youtube plugins such as wp-youtube
31
- * Provides a sidebar widget for videos as well
32
  * Produces xHTML valid code
33
- * Very fast and light, no extra scripts needed
34
 
35
- Plugin by Vladimir Prelovac. Looking for <a href="http://www.prelovac.com/vladimir/services">WordPress Consulting</a>?
 
 
 
 
36
 
37
 
38
  == Changelog ==
39
 
 
 
 
 
 
 
 
 
 
 
40
  = 3.9.1 =
41
  * Support for [WiziApp](http://www.wiziapp.com/ "WiziApp")
42
  * Bug fixes
@@ -140,15 +153,31 @@ Thanks.
140
  3. Use the Options page to change your options
141
  4. When you want to display Youtube video in your post, copy the video URL to your post and change http:// to httpv:// (notice the 'v' character)
142
 
143
- The video will be automatically embedded to your post in the proper way.
 
 
144
 
145
  Example: httpv://www.youtube.com/watch?v=OWfksMD4PAg
146
 
147
- If you want to post a high quality/HD video you would use httpvh:// ('vh' for video high)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
- To embed a playlist use extension 'vp'
150
 
151
- httpvp://www.youtube.com/view_play_list?p=528026B4F7B34094
152
 
153
  Additionally, you can set how do you want the video to be displayed in your RSS feed. Smart Youtube can show the preview image of the video (automatically grabbed from Youtube), the link to the video, or both. I recommend enabling only the preview image.
154
 
1
+ === Smart YouTube PRO ===
2
  Contributors: freediver
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
4
+ Tags: youtube, video, play, media, Post, posts, admin, metacafe, liveleak, vimeo, facebook, thumbnails
5
  Requires at least: 2.0
6
  Tested up to: 3.3
7
  Stable tag: trunk
8
 
9
+ Smart Youtube is a professional WordPress Video plugin that allows you to easily insert videos/playlists into your post, comments and in your RSS feed. The plugin is designed to be small and fast and not use any external resources.
10
 
11
  == Description ==
12
 
13
+ Smart Youtube is one of the most popular WordPress plugins, with more than 1,000,000 downloads to date..
14
 
15
+ From version 4.0 Smart Youtube changed the name to Smart Youtube PRO and now also supports playback of **Youtube, Vimeo, Metacafe, Liveleak and Facebook** high quality videos, **works on iPhone & iPad**, produces xHTML valid code (unlike YouTube embed code), allows you to view videos in fullscreen, has **video thumbnails support**, has robust widget support and much more.
 
 
16
 
17
  The plugin is designed to be small and fast and not use any external resources. It has a number of customizable options.
18
 
19
  Main Features:
20
 
21
+ * Easily embeds YouTube, Vimeo, Metacafe, Liveleak and Facebook videos (normal/HD mode)
22
+ * Works on iPhone, iPad and iPod
23
  * Embed YouTube playlist (normal/HD)
24
+ * Supports latest high definition video protocols
25
+ * Extract video thumbnails in your archive/category posts
26
+ * Provides a sidebar widget for videos as well
27
  * Supports video deep linking (starting at desired point with &start=time parameter)
28
+ * Autoplay videos, autoplay only the first video on the page (if multiple vidoes)
29
+ * Show video in Colorbox
30
  * Supports migrated blogs from Wordpress.com
31
  * Supports migration from other Youtube plugins such as wp-youtube
 
32
  * Produces xHTML valid code
 
33
 
34
+
35
+ Example:
36
+ http://www.youtube.com/watch?v=zlfKdbWwruY
37
+
38
+ Plugin by Vladimir Prelovac. Also check out <a href="http://managewp.com">ManageWP - WordPress management service</a>.
39
 
40
 
41
  == Changelog ==
42
 
43
+ = 4.0 =
44
+ * Major release
45
+ * Added support for Vimeo, Metacafe, Liveleak and Facebook videos
46
+ * New, much better, sidebar Widget support
47
+ * Extract Video thumbnails to show in your excerpts on categories/archive pages
48
+ * Show video in Colorbox
49
+ * Now parses http:// and httpv:// videos just the same
50
+ * Option to autoplay only the first video on the page
51
+ * Plugin localization support
52
+
53
  = 3.9.1 =
54
  * Support for [WiziApp](http://www.wiziapp.com/ "WiziApp")
55
  * Bug fixes
153
  3. Use the Options page to change your options
154
  4. When you want to display Youtube video in your post, copy the video URL to your post and change http:// to httpv:// (notice the 'v' character)
155
 
156
+ TTo use the video in your posts, paste YouTube video URL with httpv:// (notice the 'v').
157
+
158
+ Important: The URL should just be copied into your post normally and the letter 'v' added, do not create a clickable link!
159
 
160
  Example: httpv://www.youtube.com/watch?v=OWfksMD4PAg
161
 
162
+ If you want to embed High/HD Quality video use httpvh:// instead (Video High Defintion).
163
+
164
+ Vimeo Example: httpv://vimeo.com/27287078
165
+
166
+ Metacafe Example: httpvh://vww.metacafe.com/watch/7815470/harry_potter_and_the_deathly_hallows_dvd_interview/
167
+
168
+ Live Leak Example: httpv://www.liveleak.com/view?i=cad_1322822486
169
+
170
+ To embed playlists use httpvp:// (eg. httpvp://www.youtube.com/view_play_list?p=528026B4F7B34094)
171
+
172
+ Smart Youtube also supports migrated blogs from Wordpress.com using [youtube=youtubeadresss]
173
+
174
+ httpv:// - regular video
175
+ httpvh:// - high/HD quality
176
+ httpvp:// - playlist
177
+ httpvhp:// - HD playlist
178
+ [youtube=youtubeadresss] - supported for blogs migrated from wordpress.com
179
 
 
180
 
 
181
 
182
  Additionally, you can set how do you want the video to be displayed in your RSS feed. Smart Youtube can show the preview image of the video (automatically grabbed from Youtube), the link to the video, or both. I recommend enabling only the preview image.
183
 
screenshots/screenshot-1.jpg ADDED
Binary file
screenshots/screenshot-10.jpg ADDED
Binary file
screenshots/screenshot-11.jpg ADDED
Binary file
screenshots/screenshot-2.jpg ADDED
Binary file
screenshots/screenshot-3.jpg ADDED
Binary file
screenshots/screenshot-4.jpg ADDED
Binary file
screenshots/screenshot-5.jpg ADDED
Binary file
screenshots/screenshot-6.jpg ADDED
Binary file
screenshots/screenshot-7.jpg ADDED
Binary file
screenshots/screenshot-8.jpg ADDED
Binary file
screenshots/screenshot-9.jpg ADDED
Binary file
smartyoutube.class.php DELETED
@@ -1,809 +0,0 @@
1
- <?php
2
- class SmartYouTube
3
- {
4
- var $local_version;
5
- var $plugin_url;
6
- var $options;
7
- var $key;
8
-
9
- function SmartYouTube()
10
- {
11
- $this->__construct();
12
- }
13
-
14
- function __construct()
15
- {
16
- $this->local_version = '3.8.9'; // TODO: Change this number???
17
-
18
- $this->plugin_url = defined('WP_PLUGIN_URL') ?
19
- trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) :
20
- trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__));
21
-
22
- $this->key = 'smart_youtube';
23
-
24
-
25
- $this->options=$this->get_options();
26
-
27
- $this->add_filters_and_hooks();
28
- }
29
-
30
- function add_filters_and_hooks()
31
- {
32
- if ($this->options['posts'] == 'on')
33
- {
34
- add_filter('the_content', array($this, 'check'), 100);
35
- add_filter('the_excerpt', array($this, 'check'), 100);
36
- }
37
-
38
- if ($this->options['comments'] == 'on')
39
- {
40
- add_filter('comment_text', array($this, 'check'), 100);
41
- }
42
-
43
- add_action( 'plugins_loaded', array($this, 'install'));
44
- add_action( 'after_plugin_row', array($this, 'check_plugin_version'));
45
-
46
- add_action('admin_menu', array($this, 'add_menu_items'));
47
-
48
- register_activation_hook(__FILE__, array($this, 'install'));
49
- }
50
-
51
- function add_menu_items()
52
- {
53
- add_options_page('Smart Youtube options', 'Smart Youtube', 8, __FILE__, array($this, 'options_page'));
54
- }
55
-
56
- function options_page()
57
- {
58
- /* $status = $this->get_info();
59
-
60
- $the_version = $status[1];
61
- $the_message = $status[3];
62
-
63
- if ((version_compare(strval($the_version), strval($this->local_version), '>') == 1))
64
- {
65
- $msg = 'Latest version available '.' <strong>'.$the_version.'</strong><br />'.$the_message;
66
- _e('<div id="message" class="updated fade"><p>' . $msg . '</p></div>');
67
- }
68
- */
69
-
70
- // If form was submitted
71
- if (isset($_POST['submitted']))
72
- {
73
- check_admin_referer('smart-youtube');
74
-
75
- #---------------------------------------------------------------------#
76
- $this->options['img'] = !isset($_POST['disp_img']) ? 'off' : 'on';
77
- $this->options['link'] = !isset($_POST['disp_link']) ? 'off' : 'on';
78
- $this->options['valid'] = !isset($_POST['valid']) ? 'off' : 'on';
79
- $this->options['search'] = !isset($_POST['disp_search']) ? 'off' : 'on';
80
- $this->options['ann'] = !isset($_POST['disp_ann']) ? 'off' : 'on';
81
-
82
- $this->options['info'] = !isset($_POST['disp_info']) ? 'off' : 'on';
83
-
84
- $this->options['width'] = !isset($_POST['disp_width']) ? 425 : intval($_POST['disp_width']);
85
- $this->options['height'] = !isset($_POST['disp_height']) ? 344 : intval($_POST['disp_height']);
86
-
87
- $this->options['widthhq'] = !isset($_POST['disp_widthhq']) ? 480 : intval($_POST['disp_widthhq']);
88
- $this->options['heighthq'] = !isset($_POST['disp_heighthq']) ? 295 : intval($_POST['disp_heighthq']);
89
-
90
- $this->options['widthside'] = !isset($_POST['disp_widthside']) ? 150 : intval($_POST['disp_widthside']);
91
- $this->options['heightside'] = !isset($_POST['disp_heightside']) ? 125 : intval($_POST['disp_heightside']);
92
-
93
- $this->options['rel'] = !isset($_POST['embedRel']) ? 1 : $_POST['embedRel'];
94
- $this->options['autoplay'] = !isset($_POST['autoplay']) ? 0 : 1;
95
- $this->options['loop'] = !isset($_POST['loop']) ? 0 : 1;
96
- $this->options['privacy'] = !isset($_POST['disp_privacy']) ? 0 : 1;
97
-
98
- $this->options['posts'] = !isset($_POST['disp_posts']) ? 'off' : 'on';
99
- $this->options['comments'] = !isset($_POST['disp_comments']) ? 'off' : 'on';
100
- $this->options['iframe'] = !isset($_POST['iframe']) ? 'off' : 'on';
101
-
102
- $this->options['template'] = !isset($_POST['disp_template']) ?
103
- '{video}' :
104
- stripslashes(htmlspecialchars($_POST['disp_template']));;
105
- $this->options['tag'] = !isset($_POST['tag']) ? '' : $_POST['tag'];
106
- $this->options['wiziapp'] = ! isset( $_POST['wiziapp'] ) ? 'off' : 'on';
107
- $this->options['theme'] = ! isset( $_POST['theme'] ) ? '' : $_POST['theme'];
108
- $this->options['logoless'] = ! isset( $_POST['logoless'] ) ? 'off' : 'on';
109
-
110
- update_option($this->key, $this->options);
111
-
112
- $msg_status = 'Smart Youtube options saved.';
113
-
114
- // Show message
115
- _e('<div id="message" class="updated fade"><p>' . $msg_status . '</p></div>');
116
-
117
- }
118
-
119
- $disp_img = $this->options['img'] == 'on' ? 'checked="checked"' : '';
120
- $disp_link = $this->options['link'] == 'on' ? 'checked="checked"' : '';
121
- $disp_search = $this->options['search'] == 'on' ? 'checked="checked"' : '';
122
- $disp_ann = $this->options['ann'] == 'on' ? 'checked="checked"' : '';
123
- $disp_info = $this->options['info'] == 'on' ? 'checked="checked"' : '';
124
-
125
- $valid = $this->options['valid'] == 'on' ? 'checked="checked"' : '';
126
-
127
- $disp_width = $this->options['width'];
128
- $disp_height = $this->options['height'];
129
-
130
- $disp_widthhq = $this->options['widthhq'];
131
- $disp_heighthq = $this->options['heighthq'];
132
-
133
- $disp_widthside = $this->options['widthside'];
134
- $disp_heightside = $this->options['heightside'];
135
-
136
- $disp_autoplay = $this->options['autoplay'] ? 'checked="checked"' : '';
137
- $disp_loop = $this->options['loop'] ? 'checked="checked"' : '';
138
- $disp_rel = $this->options['rel'] ? 'checked="checked"' : '';
139
- $disp_rel2 = $this->options['rel'] ? '' : 'checked="checked"';
140
- $disp_posts = $this->options['posts'] == 'on' ? 'checked="checked"' : '' ;
141
- $disp_comments = $this->options['comments'] == 'on' ? 'checked="checked"' : '';
142
-
143
- $disp_privacy = $this->options['privacy'] ? 'checked="checked"' : '';
144
- $iframe = $this->options['iframe'] =='on' ? 'checked="checked"' : '';
145
-
146
- $disp_template = wp_specialchars($this->options['template']);
147
- $tag = $this->options['tag'];
148
- $wiziapp = $this->options['wiziapp'] == 'on' ? 'checked="checked"' : '';
149
- $theme = $this->options['theme'];
150
- $logoless = $this->options['logoless'] == 'on' ? 'checked="checked"' : '';
151
-
152
- if (!$disp_width)
153
- {
154
- $disp_width = 425;
155
- }
156
-
157
- if (!$disp_height)
158
- {
159
- $disp_height = 344;
160
- }
161
-
162
- global $wp_version;
163
-
164
- $theme_selector = "<select id=\"theme\" name=\"theme\" /><option value=\"dark\" " . ( ( $theme == 'dark' ) ? "selected=\"yes\"" : '' ) . ">Dark</option><option value=\"light\" " . ( ( $theme == 'light' ) ? "selected=\"yes\"" : '' ) . ">Light</option></select><br />";
165
-
166
- $embed_img = $this->plugin_url . '/img/embed_selection-vfl29294.png';
167
-
168
- echo '<script src="' . $this->plugin_url . '/yt.js" type="text/javascript"></script>
169
- <link rel="stylesheet" type="text/css" href="' . $this->plugin_url . '/styleyt.css" />';
170
-
171
- $imgpath = $this->plugin_url.'/i';
172
- $actionurl = $_SERVER['REQUEST_URI'];
173
- $nonce = wp_create_nonce( 'smart-youtube');
174
- $example = htmlentities('<div style="float:left;margin-right: 10px;">{video}</div>');
175
-
176
- // Configuration Page
177
-
178
- echo <<<END
179
- <div class="wrap smartyoutube" >
180
- <div id="icon-options-general" class="icon32"><br /></div>
181
- <h2>Smart YouTube</h2>
182
- <div id="poststuff" style="margin-top:10px;">
183
- <div id="sideblock" style="float:right;width:270px;margin-left:10px;">
184
-
185
- <iframe width=270 height=800 frameborder="0" src="http://www.prelovac.com/plugin/news.php?id=0&utm_source=plugin&utm_medium=plugin&utm_campaign=Smart%2BYoutube"></iframe>
186
-
187
- </div>
188
-
189
- <div id="mainblock" style="width:710px">
190
- <div class="dbx-content">
191
- <h2 id="usageHeader">Usage <span style="font-size:small">[<a href="#">view instructions</a>]</span></h2>
192
-
193
- <div id="usage" style="display:none">
194
- <p>To use the video in your posts, paste YouTube video URL with <strong>httpv://</strong> (notice the 'v'). </p>
195
- <p><strong>Important:</strong> The URL should just be copied into your post normally and the letter 'v' added, do not create a clickable link!</p>
196
- <p>Example: httpv://www.youtube.com/watch?v=OWfksMD4PAg</p>
197
- <p>If you want to embed High/HD Quality video use <strong>httpvh://</strong> instead (Video High Defintion).</p>
198
- <p>To embed playlists use httpvp:// (eg. httpvp://www.youtube.com/view_play_list?p=528026B4F7B34094)</p>
199
- <p>Smart Youtube also supports migrated blogs from Wordpress.com using [youtube=youtubeadresss]</p>
200
-
201
- <ul>
202
- <li>httpv:// - regular video</li>
203
- <li>httpvh:// - high/HD quality</li>
204
- <li>httpvp:// - playlist</li>
205
- <li>httpvhp:// - HD playlist</li>
206
- <li>[youtube=youtubeadresss] - supported for blogs migrated from wordpress.com</li>
207
- </ul>
208
- </div>
209
-
210
- <form name="yteform" action="$action_url" method="post">
211
- <input type="hidden" name="submitted" value="1" />
212
- <input type="hidden" id="_wpnonce" name="_wpnonce" value="$nonce" />
213
- <h2>Options</h2>
214
- <p> You can adjust the way your embeded youtube videos behave in the options below.</p>
215
-
216
- <h3>Video settings</h3>
217
- <div>
218
- <input id="check3" type="checkbox" name="disp_posts" $disp_posts />
219
- <label for="check3">Display videos in posts</label>
220
- </div>
221
- <div>
222
- <input id="check4" type="checkbox" name="disp_comments" $disp_comments />
223
- <label for="check4">Display videos in comments</label>
224
- </div>
225
- <br />
226
- <div>
227
- <input id="iframe" type="checkbox" name="iframe" $iframe />
228
- <label for="iframe">Use IFRAME embed code (recommended)</label>
229
- </div>
230
-
231
-
232
- <h3>Video Appearence</h3>
233
- <p class="instruct">Video template. Default is just {video}. <br />
234
- You can try <code>$example</code> if you want the text to wrap around video.</p>
235
- <textarea cols="50" id="disp_template" name="disp_template">$disp_template</textarea>
236
- <p class="instruct">Video width and height in normal mode (httpv://). Default is 425x344. </p>
237
- <div id="inputSizeNormal">
238
- <input class="width" name="disp_width" value="$disp_width" size="7"/>x<input class="height" name="disp_height" value="$disp_height" size="7" />
239
- </div>
240
- <div class="size-chooser" forDiv="inputSizeNormal">
241
- <a v-width="320" v-height="265" href="#">
242
- <span></span>
243
- <div class="outer">
244
- <div></div>
245
- </div>
246
- </a>
247
- <a v-width="425" v-height="344" href="#">
248
- <span></span>
249
- <div class="outer">
250
- <div></div>
251
- </div>
252
- </a>
253
- <a v-width="480" v-height="385" href="#">
254
- <span></span>
255
- <div class="outer">
256
- <div></div>
257
- </div>
258
- </a>
259
- <a v-width="640" v-height="505" href="#">
260
- <span></span>
261
- <div class="outer">
262
- <div></div>
263
- </div>
264
- </a>
265
- <a v-width="960" v-height="745" href="#">
266
- <span></span>
267
- <div class="outer">
268
- <div></div>
269
- </div>
270
- </a>
271
- <br clear="both" />
272
- </div>
273
-
274
- <p class="instruct">Video width and height in <strong>high quality</strong> mode (httpvh://). Default is 480x295. </p>
275
- <div id="inputSizeHQ">
276
- <input class="width" name="disp_widthhq" value="$disp_widthhq" size="7" />x<input class="height" name="disp_heighthq" value="$disp_heighthq" size="7" />
277
- </div>
278
- <div class="size-chooser" forDiv="inputSizeHQ">
279
- <a v-width="480" v-height="295" href="#">
280
- <span></span>
281
- <div class="outer">
282
- <div></div>
283
- </div>
284
- </a>
285
- <a v-width="560" v-height="340" href="#">
286
- <span></span>
287
- <div class="outer">
288
- <div></div>
289
- </div>
290
- </a>
291
- <a v-width="640" v-height="385" href="#">
292
- <span></span>
293
- <div class="outer">
294
- <div></div>
295
- </div>
296
- </a>
297
- <a v-width="853" v-height="505" href="#">
298
- <span></span>
299
- <div class="outer">
300
- <div></div>
301
- </div>
302
- </a>
303
- <a v-width="1280" v-height="745" href="#">
304
- <span></span>
305
- <div class="outer">
306
- <div></div>
307
- </div>
308
- </a>
309
- <br clear="both" />
310
- </div>
311
-
312
- <p class="instruct">Video width and height in <strong>sidebar</strong> mode (regardless of quality). Default is 150x125.</p>
313
- <input id="disp_widthside" name="disp_widthside" value="$disp_widthside" size="7" />x<input id="disp_heightside" name="disp_heightside" value="$disp_heightside" size="7" /><br /><br />
314
- <div id="watch-customize-embed-form">
315
- <input type="radio" $disp_rel id="embedCustomization1" name="embedRel" value="1"/>
316
- <label for="embedCustomization1">Include related videos</label><br/>
317
- <input type="radio" $disp_rel2 id="embedCustomization0" name="embedRel" value="0"/>
318
- <label for="embedCustomization0">Do not include related videos</label><br/>
319
- </div>
320
- <br/>
321
- <div style="margin: 0 0 0 4px; clear: both;">
322
- <input type="checkbox" id="autoplay_checkbox" name="autoplay" $disp_autoplay /><label for="autoplay_checkbox"> Autoplay videos</label><br />
323
- <input type="checkbox" id="loop_checkbox" name="loop" $disp_loop /><label for="loop_checkbox"> Loop videos</label><br />
324
- <input type="checkbox" id="disp_search" name="disp_search" $disp_search /><label for="disp_search"> Display search box</label><br />
325
- <input type="checkbox" id="disp_info" name="disp_info" $disp_info /><label for="disp_info"> Remove Titles & Ratings</label><br />
326
- <input type="checkbox" id="disp_ann" name="disp_ann" $disp_ann /><label for="disp_ann"> Remove Annotations</label><br />
327
- <input type="checkbox" id="privacy" name="disp_privacy" $disp_privacy /><label for="privacy"> Enable privacy-enhanced mode [<a target="_blank" href="http://www.google.com/support/youtube/bin/answer.py?answer=141046">?</a>] (videos may not work for Iphone users)</label><br />
328
- <label for="theme">Theme (YouTube only):</label>$theme_selector
329
- <input type="checkbox" id="logoless" name="logoless" $logoless /><label for="logoless">Hide YouTube Logo</label><br />
330
- </div>
331
-
332
- <h3>Custom code compatibility</h3>
333
- <p>Use this option if you have used another youtube plugin and switched over to Smart Youtube.<p>
334
- <p>For example if you used [yt]qYWWBwf2wHE[/yt] type of code, you would type yt in the box below.</p>
335
- <input id="tag" type="text" name="tag" value="$tag" />
336
- <label for="tag">Custom code</label>
337
-
338
- <h3>WiziApp support</h3>
339
- <p>WiziApp helps you publish your blog as an iPhone app. This will integrate your videos seamlessly. <a href="http://wiziapp.com">Learn more about WiziApp</a>.</p>
340
- <input id="wiziapp" type="checkbox" name="wiziapp" $wiziapp />
341
- <label for="wiziapp">Enable WiziApp support</label>
342
-
343
- <h3>xHTML validation</h3>
344
- <p class="instruct">Enabling the option below will change default YouTube code to be xHTML valid. (videos may not work for Iphone users)</p>
345
- <input id="valid" type="checkbox" name="valid" $valid />
346
- <label for="valid">Enable xHTML Validation</label>
347
-
348
- <h3>RSS feed options</h3>
349
- <p class="instruct">Some RSS feed readers like Bloglines will show embeded YouTube videos. Some will not and Smart YouTube allows you to display a video link and a video screenshot instead.</p>
350
- <p class="instruct">Smart YouTube will always embed the video but it can not know if the reader supports embeded video or not. So use these additional options at your own likening.</p>
351
-
352
- <input id="check2" type="checkbox" name="disp_link" $disp_link />
353
- <label for="check2">Display video link in RSS feed</label><br />
354
- <input id="check1" type="checkbox" name="disp_img" $disp_img />
355
- <label for="check1">Display video preview image in RSS feed</label>
356
-
357
- <div class="submit"><input type="submit" name="Submit" value="Update options" /></div>
358
- </form>
359
- </div>
360
- </div>
361
- </div>
362
- </div>
363
- <h5 class="author">Another fine WordPress plugin by <a href="http://www.prelovac.com/vladimir/">Vladimir Prelovac</a></h5>
364
- END;
365
- }
366
-
367
-
368
- /**
369
- * Looks for Smart Youtube URL(s) in the post content
370
- * and replace them with proper HTML tags
371
- *
372
- * @param mixed $the_content
373
- * @param mixed $side
374
- * @return mixed
375
- */
376
- function check($the_content, $side = 0)
377
- {
378
- if (strpos($the_content, "httpv") !== false )
379
- {
380
- $char_codes = array('&#215;', '&#8211;');
381
- $replacements = array("x", "--");
382
- $the_content = str_replace($char_codes, $replacements, $the_content);
383
-
384
-
385
- preg_match_all("/http(v|vh|vhd):\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^<\s]*)/", $the_content, $matches['youtube.com'], PREG_SET_ORDER);
386
- preg_match_all("/http(v|vh|vhd):\/\/([a-zA-Z0-9\-\_]+\.|)youtu\.be\/([a-zA-Z0-9\-\_]{11})([^<\s]*)/", $the_content, $matches['youtu.be'], PREG_SET_ORDER);
387
-
388
- if (isset($matches['youtube.com']))
389
- foreach ($matches['youtube.com'] as $match)
390
- {
391
- if ( 'on' == $this->options['wiziapp'] ) {
392
- $videos = array();
393
- $video_info['src'] = "http://www.youtube.com/watch?v={$match[4]}";
394
- array_push( $videos, $video_info );
395
- $replace_text = '';
396
- $replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
397
- $the_content = str_replace( $match[0], $replace_text, $the_content );
398
- } else
399
- $the_content = preg_replace("/http".$match[1].":\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^\s<]*)/", $this->tag($match[4], $match[1], $match[5], $side), $the_content, 1);
400
- }
401
-
402
- if (isset($matches['youtu.be']))
403
- {
404
-
405
- foreach ($matches['youtu.be'] as $match)
406
- {
407
- if ( 'on' == $this->options['wiziapp'] ) {
408
- $videos = array();
409
- $video_info['src'] = "http://www.youtube.com/watch?v={$match[3]}";
410
- array_push( $videos, $video_info );
411
- $replace_text = '';
412
- $replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
413
- $the_content = str_replace( $match[0], $replace_text, $the_content );
414
- } else
415
- $the_content = preg_replace("/http".$match[1].":\/\/([a-zA-Z0-9\-\_]+\.|)youtu\.be\/([a-zA-Z0-9\-\_]{11})([^<\s]*)/", $this->tag($match[3], $match[1], $match[4], $side), $the_content, 1);
416
- }
417
- }
418
-
419
-
420
-
421
- preg_match_all("/http(vp|vhp)?:\/\/?([a-zA-Z0-9\-\_]+\.|)?youtube\.com\/(view_play_list|playlist)(\?p\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{18})([^<\s]*)/", $the_content, $matches, PREG_SET_ORDER);
422
- foreach ($matches as $match)
423
- {
424
- if ( 'on' == $this->options['wiziapp'] ) {
425
- $videos = array();
426
- $video_info['src'] = "http://www.youtube.com/watch?v={$match[5]}";
427
- array_push( $videos, $video_info );
428
- $replace_text = '';
429
- $replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
430
- $the_content = str_replace( $match[0], $replace_text, $the_content );
431
- } else
432
- $the_content = preg_replace("/http".$match[1].":\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/(view_play_list|playlist)(\?p\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{18})([^\s<]*)/", $this->tag($match[5], $match[1], $match[6], $side), $the_content, 1);
433
- }
434
-
435
-
436
- }
437
-
438
- // to work with migrated blogs from Wordpress.com replacing [youtube=youtubeadresss]
439
- if (strpos($the_content, "[youtube") !== false )
440
- {
441
- preg_match_all("/\[youtube\=http:\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^<\s]*)\]/", $the_content, $matches, PREG_SET_ORDER);
442
- foreach ($matches as $match)
443
- {
444
- $the_content = preg_replace("/\[youtube\=http:\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^\s<]*)\]/", $this->tag($match[3], '', $match[4], $side), $the_content, 1);
445
- }
446
- }
447
- $tag=$this->options['tag'];
448
-
449
- if ($tag!='' && strpos($the_content, "[".$tag."]") !== false )
450
- {
451
- preg_match_all("/\[$tag\]([a-zA-Z0-9\-\_]{11})([^<\s]*)\[\/$tag\]/", $the_content, $matches, PREG_SET_ORDER);
452
- foreach ($matches as $match)
453
- {
454
- //print_r($matches);
455
- $the_content = preg_replace("/\[$tag\]([a-zA-Z0-9\-\_]{11})([^<\s]*)\[\/$tag\]/", $this->tag($match[1], '', '', $side), $the_content, 1);
456
- }
457
- }
458
-
459
- return $the_content;
460
- }
461
-
462
- function tag($file, $high = 'v', $time = '', $side = 0)
463
- {
464
- $playlist = 0;
465
- $disp_rel = $this->options['rel'];
466
- $autoplay = $this->options['autoplay'];
467
- $loop = $this->options['loop'];
468
- $disp_search = $this->options['search'] == 'on' ? 1 : 0;
469
- $disp_info = $this->options['info'] == 'on' ? '&showinfo=0' : '';
470
- $disp_ann = $this->options['ann'] == 'on' ? '&iv_load_policy=3' : '';
471
- $template = trim($this->options['template']) == '' ? '{video}' : $this->options['template'];
472
- $valid = $this->options['valid'];
473
- $theme = $this->options['theme'];
474
- $logoless = $this->options['logoless'];
475
-
476
- switch ($high)
477
- {
478
- case 'v':
479
- $high = '';
480
- break;
481
- case 'vh':
482
- $high = '&amp;hd=1';
483
- break;
484
- case 'vhd':
485
- $high = '&amp;hd=1';
486
- break;
487
- case 'vp':
488
- $high = '';
489
- $playlist = 1;
490
- break;
491
- case 'vhp':
492
- $high = '&amp;hd=1';
493
- $playlist = 1;
494
- break;
495
- default:
496
- $high = '';
497
- break;
498
- }
499
-
500
- $width = $side ?
501
- $this->options['widthside'] :
502
- ($high ? $this->options['widthhq'] : $this->options['width']);
503
-
504
- $height = $side ?
505
- $this->options['heightside'] :
506
- ($high ? $this->options['heighthq'] : $this->options['height']);
507
-
508
- if (!$width)
509
- {
510
- $width = !$high ? 480 : 425 ;
511
- }
512
-
513
- if (!$height)
514
- {
515
- $height = !$high ? 360 : 344;
516
- }
517
-
518
- if ($disp_border)
519
- {
520
- $height += 18;
521
- }
522
-
523
- if ( $logoless = 'on' ) {
524
- $ll = 'modestbranding=1';
525
- $disp_info = '';
526
- } else {
527
- $ll = '';
528
- }
529
-
530
- $ap = '';
531
- if ($autoplay)
532
- $ap='&autoplay=1';
533
-
534
- $root_url = $this->options['privacy'] ? 'http://www.youtube-nocookie.com' : 'http://www.youtube.com';
535
-
536
- if ($this->options['iframe']=='on')
537
- $video_url = htmlspecialchars("$root_url/embed/$file?$ll&fs=1&hl=en$ap&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel&theme=$theme", ENT_QUOTES) . $high . $time;
538
- else
539
- $video_url = htmlspecialchars("$root_url/v/$file?$ll&fs=1&hl=en$ap&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel&theme=$theme", ENT_QUOTES) . $high . $time;
540
-
541
- if ($playlist)
542
- {
543
-
544
- $video_url = htmlspecialchars( "$root_url/embed/videoseries?list=$file&fs=1&hl=en$ap$ll&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel&theme=$theme", ENT_QUOTES ) . $high . $time;
545
- $yte_tag = <<<EOT
546
- <span class="youtube">
547
- <iframe class="youtube-player" src="$video_url" width="$width" height="$height" frameborder="0" allowfullscreen></iframe>
548
- </span>
549
- EOT;
550
- }
551
- elseif ($valid == 'off' || strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')===TRUE || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod')===TRUE || strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')===TRUE)
552
- {
553
- if ($this->options['iframe']=='on')
554
- $yte_tag = <<<EOT
555
- <span class="youtube">
556
- <iframe title="YouTube video player" class="youtube-player" type="text/html" width="$width" height="$height" src="$video_url" frameborder="0" allowfullscreen></iframe>
557
- </span>
558
- EOT;
559
- else
560
- $yte_tag = <<<EOT
561
- <span class="youtube">
562
- <object width="$width" height="$height">
563
- <param name="movie" value="$video_url" />
564
- <param name="allowFullScreen" value="true" />
565
- <embed wmode="opaque" src="$video_url" type="application/x-shockwave-flash" allowfullscreen="true" width="$width" height="$height"></embed>
566
- <param name="wmode" value="opaque" />
567
- </object>
568
- </span>
569
- EOT;
570
- }
571
- else
572
- {
573
-
574
- if ($this->options['iframe']=='on')
575
- $yte_tag = <<<EOT
576
- <span class="youtube">
577
- <iframe title="YouTube video player" class="youtube-player" type="text/html" width="$width" height="$height" src="$video_url" frameborder="0" allowfullscreen></iframe>
578
- </span>
579
- EOT;
580
- else
581
- $yte_tag = <<<EOT
582
- <span class="youtube">
583
- <object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url">
584
- <param name="movie" value="$video_url" />
585
- <param name="allowFullScreen" value="true" />
586
- <param name="wmode" value="transparent" />
587
- </object>
588
- </span>
589
- EOT;
590
- }
591
-
592
- if (is_feed())
593
- {
594
-
595
- if ($high)
596
- {
597
- $high = '&fmt=18';
598
- }
599
- if ($playlist)
600
- $url='http://www.youtube.com/view_play_list?p=';
601
- else
602
- $url='http://www.youtube.com/watch?v=';
603
-
604
- if ($this->options['img'] == 'on')
605
- {
606
- $yte_tag .= '<p><a href="'.$url . $file . $high. '"><img src="http://img.youtube.com/vi/' . $file . '/default.jpg" width="130" height="97" border=0></a></p>';
607
- }
608
-
609
- if ($this->options['link'] == 'on')
610
- {
611
- $yte_tag.='<p><a href="'.$url . $file . $high . '">www.youtube.com/watch?v=' . $file . '</a></p>';
612
- }
613
- // if ($this->options['link'] == 'off' && $this->options['img'] == 'off')
614
- // $yte_tag='http://www.youtube.com/watch?v='.$file;
615
- }
616
-
617
- return str_replace('{video}', $yte_tag, html_entity_decode($template));
618
- }
619
-
620
- function install()
621
- {
622
- // register widget
623
- if (function_exists('register_sidebar_widget'))
624
- {
625
- register_sidebar_widget('Smart YouTube', array($this, 'widget'));
626
- }
627
-
628
- if (function_exists('register_widget_control'))
629
- {
630
- register_widget_control('Smart YouTube', array($this, 'widget_control'));
631
- }
632
-
633
- if (get_option($this->key)) {
634
- $this->options=$this->get_options();
635
- }
636
- /*
637
- // upgrade the options format (as all-in-one, not single entries)
638
- $this->options = array(
639
- 'posts' => 'on',
640
- 'comments' => 'off',
641
- 'img' => 'off',
642
- 'width' => 425,
643
- 'height' => 344,
644
- 'widthhq' => 480,
645
- 'heighthq' => 295,
646
- 'widthside' => 150,
647
- 'heightside' => 125,
648
- 'rel' => 1,
649
- 'link' => 'on',
650
- 'valid' => 'off',
651
- 'search' => 'off',
652
- 'info' => 'on',
653
- 'ann' => 'on',
654
- 'template' => '{video}',
655
- 'autoplay' => 0,
656
- 'privacy' => 0,
657
- 'wtext' => '',
658
- 'wtitle' => '',
659
- 'tag' => '',
660
- 'iframe' => 'on'
661
- );
662
-
663
- // migrate the old-fashion options
664
- foreach ($this->options as $key => $value)
665
- {
666
- if (false !== $old_option = get_option("smart_yt_$key"))
667
- {
668
- $this->options[$key] = $old_option;
669
- }
670
-
671
- delete_option("smart_yt_$key");
672
- }
673
-
674
- add_option($this->key, $this->options);*/
675
- }
676
-
677
- // Handle our options
678
- function get_options()
679
- {
680
-
681
- $options = array(
682
- 'posts' => 'on',
683
- 'comments' => 'off',
684
- 'img' => 'off',
685
- 'width' => 425,
686
- 'height' => 344,
687
- 'widthhq' => 480,
688
- 'heighthq' => 295,
689
- 'widthside' => 150,
690
- 'heightside' => 125,
691
- 'rel' => 1,
692
- 'link' => 'on',
693
- 'valid' => 'off',
694
- 'search' => 'off',
695
- 'info' => 'on',
696
- 'ann' => 'on',
697
- 'template' => '{video}',
698
- 'autoplay' => 0,
699
- 'privacy' => 0,
700
- 'wtext' => '',
701
- 'wtitle' => '',
702
- 'tag' => '',
703
- 'iframe' => 'on',
704
- 'theme' => 'dark',
705
- 'logoless' => 'on'
706
- );
707
-
708
- $saved = get_option($this->key);
709
-
710
- if (!empty($saved)) {
711
- foreach ($saved as $key => $option)
712
- $options[$key] = $option;
713
- }
714
-
715
- if ($saved != $options)
716
- update_option($this->key, $options);
717
-
718
-
719
-
720
-
721
-
722
- return $options;
723
- }
724
-
725
-
726
- function widget($args = array())
727
- {
728
- extract ($args);
729
- $text = apply_filters( 'widget_text', $this->check($this->options['wtext'], 1));
730
- $title = apply_filters( 'widget_title', $this->options['wtitle']);
731
- echo
732
- $before_widget,
733
- $before_title, $title, $after_title,
734
- $text,
735
- $after_widget;
736
- }
737
-
738
- function widget_control()
739
- {
740
- if ($_REQUEST['submit'])
741
- {
742
- $this->options['wtext'] = stripslashes($_REQUEST['yte_text']);
743
- $this->options['wtitle'] = stripslashes($_REQUEST['yte_title']);
744
- }
745
-
746
- update_option($this->key, $this->options);
747
-
748
- $text = wp_specialchars($this->options['wtext']);
749
- $title = wp_specialchars($this->options['wtitle']);
750
-
751
- echo <<<EOT
752
- Title:<br /><input type="text" id="yte_title" name="yte_title" value="$title" /><br />
753
- Insert HTML code below. In addition to normal text you may use httpv, httpvh and httpvhd links just like in your posts.<br />
754
- <textarea id="text" name="yte_text" rows="10" cols="16" class="widefat">$text</textarea>
755
- <input type="hidden" id="submit" name="submit" value="1" />
756
- EOT;
757
- }
758
-
759
- /**
760
- * Checks the plugin version
761
- * @param $plugin
762
- * @return unknown_type
763
- */
764
- function check_plugin_version($plugin)
765
- {
766
- global $plugindir;
767
-
768
- if (strpos($plugin, 'smartyoutube.php') === false) return;
769
-
770
- $status = $this->get_info();
771
-
772
- $the_version = $status[1];
773
- $the_message = $status[3];
774
-
775
- if ((version_compare(strval($the_version), strval($this->local_version), '>') != 1)) return;
776
-
777
- $msg = "Latest version available: <strong>$the_version</strong><br />.$the_message";
778
-
779
- echo <<<EOT
780
- <td colspan="5" class="plugin-update" style="line-height:1.2em;">
781
- Latest version available: <strong>$the_version</strong><br />$the_message
782
- </td>
783
- EOT;
784
-
785
- }
786
-
787
- /**
788
- * Gets plugin info from WordPress Codex repo
789
- * @return mixed
790
- */
791
- function get_info()
792
- {
793
- $checkfile = 'http://svn.wp-plugins.org/smart-youtube/trunk/smartyoutube.chk';
794
-
795
- $status = array();
796
-
797
- return $status; //???
798
-
799
- $vcheck = wp_remote_fopen($checkfile);
800
-
801
- if ($vcheck)
802
- {
803
- $version = $$this->local_version;
804
-
805
- $status = explode('@', $vcheck);
806
- return $status;
807
- }
808
- }
809
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
smartyoutube.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /*
3
- Plugin Name: Smart Youtube
4
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube
5
  Description: Insert YouTube videos in posts, comments and RSS feeds with ease and full customization.
6
  Author: Vladimir Prelovac
7
- Version: 3.9.1
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
 
@@ -39,19 +39,19 @@ I find this would greatly help, especiall when I help create video blogs for com
39
 
40
  Only issue is I would LOVE to add the widget into another sidebar and I do not see this possibility. Can you have multiple Smart YouTubes?
41
 
42
- - 1. Adding few possibilities for posting videos into post � I have great production of videos but before end of 2009 all was in 320 x 240 and after end of 2009 I start publishing video in 640 x 480 resolution. I have adjusted player video for 640 x 480 but now 320 x 240 videos are stretched across all of player window.
43
 
44
- For changes to be easy implemented � I suggest adding 2 or even 3 possibilities for playing videos � like this:
45
  Your original code httpv://www.youtube.com/********************
46
  Another version of httpv#1://www.youtube.com/********************
47
  Another version of httpv#2://www.youtube.com/********************
48
  Another version of httpv#3://www.youtube.com/********************
49
 
50
- Adding #1 after v will allow us to predefine what will be size of player for #1 or number #2 or number #3 � I think it is good idea
51
 
52
- If you don�t put #1, #2, #3 player will be those which is default (without number) � in my case that is 640 x 480.
53
 
54
- 2. If some video is for �personal use� which mean somebody must be log into you tube to see it, than I suggest making possibility for login for authors of those videos � If I put all my materials to be private (up to 25 people can see it) � than I cant publish them trough this way � and allowing authors to write theirs username and password will allow that those vides can be seen on my posts. That way I can protect all my archive of video on youtube, but allow those video can be visible on my blog � which can increase hits, visits and others possibility � that possibility is visible on this plug in http://tubepress.org/ where people can use its username and password for publishing all vides from if they have account on youtube
55
 
56
 
57
  - marinas javascript suggestion for hq videos
@@ -69,8 +69,1549 @@ If you don
69
 
70
 
71
 
72
- if (isset($smart_youtube)) return false;
73
 
74
- require_once(dirname(__FILE__) . '/smartyoutube.class.php');
75
 
76
- $smart_youtube = new SmartYouTube();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /*
3
+ Plugin Name: Smart Youtube PRO
4
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube
5
  Description: Insert YouTube videos in posts, comments and RSS feeds with ease and full customization.
6
  Author: Vladimir Prelovac
7
+ Version: 4.0
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
 
39
 
40
  Only issue is I would LOVE to add the widget into another sidebar and I do not see this possibility. Can you have multiple Smart YouTubes?
41
 
42
+ - 1. Adding few possibilities for posting videos into post � I have great production of videos but before end of 2009 all was in 320 x 240 and after end of 2009 I start publishing video in 640 x 480 resolution. I have adjusted player video for 640 x 480 but now 320 x 240 videos are stretched across all of player window.
43
 
44
+ For changes to be easy implemented � I suggest adding 2 or even 3 possibilities for playing videos � like this:
45
  Your original code httpv://www.youtube.com/********************
46
  Another version of httpv#1://www.youtube.com/********************
47
  Another version of httpv#2://www.youtube.com/********************
48
  Another version of httpv#3://www.youtube.com/********************
49
 
50
+ Adding #1 after v will allow us to predefine what will be size of player for #1 or number #2 or number #3 � I think it is good idea
51
 
52
+ If you don�t put #1, #2, #3 player will be those which is default (without number) � in my case that is 640 x 480.
53
 
54
+ 2. If some video is for �personal use� which mean somebody must be log into you tube to see it, than I suggest making possibility for login for authors of those videos � If I put all my materials to be private (up to 25 people can see it) � than I cant publish them trough this way � and allowing authors to write theirs username and password will allow that those vides can be seen on my posts. That way I can protect all my archive of video on youtube, but allow those video can be visible on my blog � which can increase hits, visits and others possibility � that possibility is visible on this plug in http://tubepress.org/ where people can use its username and password for publishing all vides from if they have account on youtube
55
 
56
 
57
  - marinas javascript suggestion for hq videos
69
 
70
 
71
 
72
+ if (isset($smart_youtube_pro)) return false;
73
 
74
+ $smart_youtube_pro = new SmartYouTube_PRO();
75
 
76
+ class SmartYouTube_PRO {
77
+ var $local_version;
78
+ var $plugin_url;
79
+ var $options;
80
+ var $key;
81
+ var $first;
82
+ var $first_post_on_archive;
83
+
84
+ function SmartYouTube() {
85
+ $this->__construct();
86
+ }
87
+
88
+ function __construct() {
89
+ $this->local_version = '1.0'; // TODO: Change this number???
90
+
91
+ $this->plugin_url = defined( 'WP_PLUGIN_URL' ) ?
92
+ trailingslashit( WP_PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) ) :
93
+ trailingslashit( get_bloginfo( 'wpurl' ) ) . PLUGINDIR . '/' . dirname( plugin_basename( __FILE__ ) );
94
+
95
+ $this->key = 'smart_youtube_pro';
96
+ $this->first_post_on_archive = false;
97
+
98
+ $script_path = $this->plugin_url . '/javascripts/jquery.colorbox-min.js';
99
+ wp_register_script( 'colorbox', $script_path );
100
+
101
+ $this->options = $this->get_options();
102
+
103
+ $this->add_filters_and_hooks();
104
+ }
105
+
106
+ function add_filters_and_hooks() {
107
+ if ( $this->options['posts'] == 'on' ) {
108
+ add_filter( 'the_content', array( $this, 'check' ), 100 );
109
+ add_filter( 'the_excerpt', array( $this, 'check_excerpt' ), 100 );
110
+ }
111
+
112
+ if ( $this->options['comments'] == 'on' ) {
113
+ add_filter( 'comment_text', array( $this, 'check' ), 100 );
114
+ }
115
+
116
+ add_action( 'plugins_loaded', array( $this, 'install' ) );
117
+ add_action( 'admin_menu', array( $this, 'add_menu_items' ) );
118
+ add_action( 'admin_head', array( $this, 'plugin_header' ) );
119
+ add_action( 'wp_head', array( $this, 'post_header' ) );
120
+ add_action( 'wp_print_scripts', array( $this, 'load_scripts' ) );
121
+ add_action( 'wp_print_styles', array( $this, 'load_styles' ) );
122
+ add_action( 'template_redirect', array( $this, 'mark_first_post_on_archive' ) );
123
+
124
+ register_activation_hook(__FILE__, array($this, 'install' ) );
125
+ }
126
+
127
+ function post_header() {
128
+ if ( is_singular() ) {
129
+ global $wp_query;
130
+ $the_content = $wp_query->post->post_content;
131
+ $char_codes = array( '&#215;', '&#8211;' );
132
+ $replacements = array( "x", "--" );
133
+ $the_content = str_replace( $char_codes, $replacements, $the_content );
134
+
135
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^<\s]*)/", $the_content, $matches, PREG_SET_ORDER );
136
+
137
+ if ( isset( $matches[0][5] ) )
138
+ if ( $matches[0][5] != '' )
139
+ echo '<meta property="og:image" content="http://i.ytimg.com/vi/' . $matches[0][5] . '/default.jpg" />';
140
+
141
+ if ( $this->options['colorbox'] == 'on' ) {
142
+ ?>
143
+ <script>
144
+ jQuery(document).ready(function($){
145
+ $(".colorbox_video").colorbox({iframe:true, innerWidth:<?php echo $this->options['width']; ?>, innerHeight:<?php echo $this->options['height']; ?>});
146
+ });
147
+ </script>
148
+ <?php
149
+ }
150
+ }
151
+ }
152
+
153
+ function load_scripts() {
154
+ if ( $this->options["colorbox"] == 'on' && is_singular() ) {
155
+ wp_enqueue_script( 'jquery' );
156
+ wp_enqueue_script( 'colorbox' );
157
+ }
158
+ }
159
+
160
+ function load_styles() {
161
+ $style_path = $this->plugin_url . '/themes/theme' . $this->options['colorbox_theme'] . '/colorbox.css';
162
+ wp_register_style( 'colorbox', $style_path );
163
+
164
+ if ( $this->options["colorbox"] == 'on' && is_singular() ) {
165
+ wp_enqueue_style( 'colorbox' );
166
+ }
167
+ }
168
+
169
+ function plugin_header() {
170
+ if ( ! empty( $_REQUEST['page'] ) )
171
+ $page = $_REQUEST['page'];
172
+ else
173
+ $page = '';
174
+ ?>
175
+ <style>
176
+ <?php if ( ( $page == 'syt_settings' ) || ( $page == 'syt_colorbox_options' ) || ( $page == 'syt_about' ) ) : ?>
177
+ #icon-syt_settings { background:transparent url('<?php echo $this->plugin_url .'i/logo.png';?>') no-repeat; }
178
+ <?php endif; ?>
179
+ </style>
180
+ <script>
181
+ <?php if ( $page == 'syt_settings' ) : ?>
182
+ jQuery(document).ready(function($){
183
+ if (($)('#disp_excerpt').val() == 'not')
184
+ ($)('#disp_excerpt_align_div').hide();
185
+ else
186
+ ($)('#disp_excerpt_align_div').show();
187
+ ($)('#disp_excerpt').change(function(){
188
+ if (($)(this).val() == 'not')
189
+ ($)('#disp_excerpt_align_div').hide();
190
+ else
191
+ ($)('#disp_excerpt_align_div').show();
192
+ });
193
+ });
194
+ <?php endif; ?>
195
+ <?php if ( $page == 'syt_colorbox_options' ) : ?>
196
+ jQuery(document).ready(function($){
197
+ $("#colorbox_theme").change(function() {
198
+ var src = $("option:selected", this).val();
199
+ if ( src != "" ){
200
+ var $imgTag = "<img src=\"" + "<?php echo $this->plugin_url; echo '/screenshots/screenshot-'; ?>" + src + ".jpg\" />";
201
+ $("#screenshot_image").empty().html($imgTag).fadeIn();
202
+ }
203
+ });
204
+ });
205
+ <?php endif; ?>
206
+ </script>
207
+ <?php
208
+ }
209
+
210
+ function add_menu_items() {
211
+ $image = $this->plugin_url . '/i/icon.png';
212
+ add_menu_page( __( 'Smart Youtube', 'smart-youtube' ), __( 'Smart Youtube', 'smart-youtube' ), 'manage_options', 'syt_settings', array(
213
+ &$this,
214
+ 'options_page'
215
+ ), $image);
216
+ $page_settings = add_submenu_page( 'syt_settings', __( 'Smart Youtube', 'smart-youtube' ) . __( ' Settings', 'smart-youtube' ), __( 'Settings', 'smart-youtube' ), 'manage_options', 'syt_settings', array(
217
+ &$this,
218
+ 'options_page'
219
+ ) );
220
+ $page_colorbox = add_submenu_page( 'syt_settings', __( 'Smart Youtube', 'smart-youtube' ) . __( ' Colorbox Options', 'smart-youtube' ), __( 'Colorbox Options', 'smart-youtube' ), 'manage_options', 'syt_colorbox_options', array(
221
+ &$this,
222
+ 'handle_colorbox_options'
223
+ ) );
224
+ $page_about = add_submenu_page( 'syt_settings', __( 'Smart Youtube', 'smart-youtube' ) . __( ' About', 'smart-youtube' ), __( 'About', 'smart-youtube' ), 'manage_options', 'syt_about', array(
225
+ &$this,
226
+ 'handle_about'
227
+ ) );
228
+ }
229
+
230
+ function options_page() {
231
+ // If form was submitted
232
+ if ( isset( $_POST['submitted'] ) ) {
233
+ check_admin_referer( 'smart-youtube' );
234
+
235
+ $this->options['img'] = ! isset( $_POST['disp_img'] ) ? 'off' : 'on';
236
+ $this->options['link'] = ! isset( $_POST['disp_link'] ) ? 'off' : 'on';
237
+ $this->options['valid'] = ! isset( $_POST['valid'] ) ? 'off' : 'on';
238
+ $this->options['search'] = ! isset( $_POST['disp_search'] ) ? 'off' : 'on';
239
+ $this->options['ann'] = ! isset( $_POST['disp_ann'] ) ? 'off' : 'on';
240
+
241
+ $this->options['info'] = ! isset( $_POST['disp_info'] ) ? 'off' : 'on';
242
+
243
+ $this->options['width'] = ! isset( $_POST['disp_width'] ) ? 425 : intval( $_POST['disp_width'] );
244
+ $this->options['height'] = ! isset( $_POST['disp_height'] ) ? 344 : intval( $_POST['disp_height'] );
245
+
246
+ $this->options['widthhq'] = ! isset( $_POST['disp_widthhq'] ) ? 480 : intval( $_POST['disp_widthhq'] );
247
+ $this->options['heighthq'] = ! isset( $_POST['disp_heighthq'] ) ? 295 : intval( $_POST['disp_heighthq'] );
248
+
249
+ $this->options['widthside'] = ! isset( $_POST['disp_widthside'] ) ? 150 : intval( $_POST['disp_widthside'] );
250
+ $this->options['heightside'] = ! isset( $_POST['disp_heightside'] ) ? 125 : intval( $_POST['disp_heightside'] );
251
+
252
+ $this->options['rel'] = ! isset( $_POST['embedRel'] ) ? 1 : $_POST['embedRel'];
253
+ $this->options['autoplay'] = ! isset( $_POST['autoplay'] ) ? 0 : 1;
254
+ $this->options['autoplay_first'] = ! isset( $_POST['autoplay_first'] ) ? 0 : 1;
255
+ $this->options['privacy'] = ! isset( $_POST['disp_privacy'] ) ? 0 : 1;
256
+
257
+ $this->options['posts'] = ! isset( $_POST['disp_posts'] ) ? 'off' : 'on';
258
+ $this->options['comments'] = ! isset( $_POST['disp_comments'] ) ? 'off' : 'on';
259
+ $this->options['iframe'] = ! isset( $_POST['iframe'] ) ? 'off' : 'on';
260
+ $this->options['www'] = ! isset( $_POST['www'] ) ? 'off' : 'on';
261
+ $this->options['http'] = ! isset( $_POST['http'] ) ? 'off' : 'on';
262
+
263
+ $this->options['template'] = ! isset( $_POST['disp_template'] ) ? '{video}' : stripslashes( htmlspecialchars( $_POST['disp_template'] ) );
264
+ $this->options['tag'] = ! isset( $_POST['tag'] ) ? '' : $_POST['tag'];
265
+ $this->options['wiziapp'] = ! isset( $_POST['wiziapp'] ) ? 'off' : 'on';
266
+ $this->options['loop'] = ! isset( $_POST['loop'] ) ? 0 : 1;
267
+ $this->options['thumb'] = ! isset( $_POST['thumb'] ) ? 'off' : 'on';
268
+ $this->options['colorbox'] = ! isset( $_POST['colorbox'] ) ? 'off' : 'on';
269
+ $this->options['excerpt'] = ! isset( $_POST['excerpt'] ) ? '' : $_POST['excerpt'];
270
+ $this->options['excerpt_align'] = ! isset( $_POST['excerpt_align'] ) ? '' : $_POST['excerpt_align'];
271
+ $this->options['logoless'] = ! isset( $_POST['logoless'] ) ? 'off' : 'on';
272
+ $this->options['theme'] = ! isset( $_POST['theme'] ) ? '' : $_POST['theme'];
273
+
274
+ update_option( $this->key, $this->options );
275
+
276
+ // Show message
277
+ echo '<div id="message" class="updated fade"><p>' . __( 'Smart Youtube options saved.', 'smart-youtube' ) . '</p></div>';
278
+ }
279
+
280
+ $disp_img = $this->options['img'] == 'on' ? 'checked="checked"' : '';
281
+ $disp_link = $this->options['link'] == 'on' ? 'checked="checked"' : '';
282
+ $disp_search = $this->options['search'] == 'on' ? 'checked="checked"' : '';
283
+ $disp_ann = $this->options['ann'] == 'on' ? 'checked="checked"' : '';
284
+ $disp_info = $this->options['info'] == 'on' ? 'checked="checked"' : '';
285
+
286
+ $valid = $this->options['valid'] == 'on' ? 'checked="checked"' : '';
287
+
288
+ $disp_width = $this->options['width'];
289
+ $disp_height = $this->options['height'];
290
+
291
+ $disp_widthhq = $this->options['widthhq'];
292
+ $disp_heighthq = $this->options['heighthq'];
293
+
294
+ $disp_widthside = $this->options['widthside'];
295
+ $disp_heightside = $this->options['heightside'];
296
+
297
+ $disp_autoplay = $this->options['autoplay'] ? 'checked="checked"' : '';
298
+ $disp_autoplay_first = $this->options['autoplay_first'] ? 'checked="checked"' : '';
299
+ $disp_rel = $this->options['rel'] ? 'checked="checked"' : '';
300
+ $disp_rel2 = $this->options['rel'] ? '' : 'checked="checked"';
301
+ $disp_posts = $this->options['posts'] == 'on' ? 'checked="checked"' : '' ;
302
+ $disp_comments = $this->options['comments'] == 'on' ? 'checked="checked"' : '';
303
+
304
+ $disp_privacy = $this->options['privacy'] ? 'checked="checked"' : '';
305
+ $iframe = $this->options['iframe'] =='on' ? 'checked="checked"' : '';
306
+ $www = $this->options['www'] =='on' ? 'checked="checked"' : '';
307
+ $http = $this->options['http'] =='on' ? 'checked="checked"' : '';
308
+ $disp_loop = $this->options['loop'] ? 'checked="checked"' : '';
309
+ $thumb = $this->options['thumb'] == 'on' ? 'checked="checked"' : '';
310
+ $colorbox = $this->options['colorbox'] == 'on' ? 'checked="checked"' : '';
311
+ $excerpt = isset( $this->options['excerpt'] ) ? $this->options['excerpt'] : 'not';
312
+ $excerpt_align = isset( $this->options['excerpt_align'] ) ? $this->options['excerpt_align'] : 'left';
313
+
314
+ $disp_template = esc_html( $this->options['template'] );
315
+ $tag = $this->options['tag'];
316
+ $wiziapp = $this->options['wiziapp'] == 'on' ? 'checked="checked"' : '';
317
+ $logoless = $this->options['logoless'] == 'on' ? 'checked="checked"' : '';
318
+ $theme = isset( $this->options['theme'] ) ? $this->options['theme'] : '';
319
+
320
+ if ( ! $disp_width ) {
321
+ $disp_width = 425;
322
+ }
323
+
324
+ if ( ! $disp_height ) {
325
+ $disp_height = 344;
326
+ }
327
+
328
+ global $wp_version;
329
+
330
+ $embed_img = $this->plugin_url . '/img/embed_selection-vfl29294.png';
331
+
332
+ echo '<script src="' . $this->plugin_url . '/yt.js" type="text/javascript"></script>
333
+ <link rel="stylesheet" type="text/css" href="' . $this->plugin_url . '/styleyt.css" />';
334
+
335
+ $imgpath = $this->plugin_url.'/i';
336
+ $actionurl = $_SERVER['REQUEST_URI'];
337
+ $nonce = wp_create_nonce( 'smart-youtube' );
338
+ $example = htmlentities( '<div style="float:left;margin-right: 10px;">{video}</div>' );
339
+
340
+ // Configuration Page
341
+
342
+ ?>
343
+ <div class="wrap smartyoutube" >
344
+ <?php screen_icon(); ?>
345
+ <h2><?php _e( 'Smart YouTube PRO', 'smart-youtube' ); ?></h2>
346
+ <a href="admin.php?page=syt_settings"><?php _e( 'Settings', 'smart-youtube' ); ?></a> &nbsp;|&nbsp; <a href="admin.php?page=syt_colorbox_options"><?php _e( 'Colorbox Options', 'smart-youtube' ); ?></a> &nbsp;|&nbsp; <a href="admin.php?page=syt_about"><?php _e( 'About', 'smart-youtube' ); ?></a>
347
+ <div id="poststuff" style="margin-top:10px;">
348
+ <div id="sideblock" style="float:right;width:270px;margin-left:10px;">
349
+ <iframe width=270 height=800 frameborder="0" src="http://www.prelovac.com/plugin/news.php?id=0&utm_source=plugin&utm_medium=plugin&utm_campaign=Smart%2BYoutube"></iframe>
350
+ </div>
351
+ <div id="mainblock" style="width:710px">
352
+ <div class="dbx-content">
353
+ <h2 id="usageHeader"><?php _e( 'Usage <span style="font-size:small">[<a href="#">view instructions</a>]</span>', 'smart-youtube' ); ?></h2>
354
+ <div id="usage" style="display:none">
355
+ <p><?php _e( 'To use the video in your posts, paste YouTube video URL with <strong>httpv://</strong> (notice the \'v\').', 'smart-youtube' ); ?> </p>
356
+ <p><?php _e( '<strong>Important:</strong> The URL should just be copied into your post normally and the letter \'v\' added, do not create a clickable link!', 'smart-youtube' ); ?></p>
357
+ <p><?php _e( 'Example: httpv://www.youtube.com/watch?v=OWfksMD4PAg', 'smart-youtube' ); ?></p>
358
+ <p><?php _e( 'If you want to embed High/HD Quality video use <strong>httpvh://</strong> instead (Video High Defintion).', 'smart-youtube' ); ?></p>
359
+ <p><?php _e( 'Vimeo Example: httpv://vimeo.com/27287078', 'smart-youtube' ); ?></p>
360
+ <p><?php _e( 'Metacafe Example: httpvh://vww.metacafe.com/watch/7815470/harry_potter_and_the_deathly_hallows_dvd_interview/', 'smart-youtube' ); ?></p>
361
+ <p><?php _e( 'Live Leak Example: httpv://www.liveleak.com/view?i=cad_1322822486', 'smart-youtube' ); ?></p>
362
+ <p><?php _e( 'To embed playlists use httpvp:// (eg. httpvp://www.youtube.com/view_play_list?p=528026B4F7B34094)', 'smart-youtube' ); ?></p>
363
+ <p><?php _e( 'Smart Youtube also supports migrated blogs from Wordpress.com using [youtube=youtubeadresss]', 'smart-youtube' ); ?></p>
364
+ <ul>
365
+ <li><?php _e( 'httpv:// - regular video', 'smart-youtube' ); ?></li>
366
+ <li><?php _e( 'httpvh:// - high/HD quality', 'smart-youtube' ); ?></li>
367
+ <li><?php _e( 'httpvp:// - playlist', 'smart-youtube' ); ?></li>
368
+ <li><?php _e( 'httpvhp:// - HD playlist', 'smart-youtube' ); ?></li>
369
+ <li><?php _e( '[youtube=youtubeadresss] - supported for blogs migrated from wordpress.com', 'smart-youtube' ); ?></li>
370
+ </ul>
371
+ </div>
372
+ <form name="yteform" action="<?php echo $actionurl; ?>" method="post">
373
+ <input type="hidden" name="submitted" value="1" />
374
+ <input type="hidden" id="_wpnonce" name="_wpnonce" value="<?php echo $nonce; ?>" />
375
+ <h2><?php _e( 'Options', 'smart-youtube' ); ?></h2>
376
+ <p><?php _e( 'Smart Youtube is powerful and free WordPress plugin for embeding videos into your blog. ', 'smart-youtube' ); ?></p>
377
+
378
+ <p><?php _e( 'From the same author: <a href="http://managewp.com" target="_blank">ManageWP.com</a> - Wordpress service that helps you manage all your WordPress sites from one location.', 'smart-youtube' ); ?></p>
379
+ <p><?php _e( 'You can adjust the way your embeded youtube videos behave in the options below.', 'smart-youtube' ); ?></p>
380
+ <h3><?php _e( 'Video settings', 'smart-youtube' ); ?></h3>
381
+ <div>
382
+ <input id="check3" type="checkbox" name="disp_posts" <?php echo $disp_posts; ?> />
383
+ <label for="check3"><?php _e( 'Display videos in posts', 'smart-youtube' ); ?></label>
384
+ </div>
385
+ <div>
386
+ <input id="check4" type="checkbox" name="disp_comments" <?php echo $disp_comments; ?> />
387
+ <label for="check4"><?php _e( 'Display videos in comments', 'smart-youtube' ); ?></label>
388
+ </div>
389
+ <br />
390
+ <div>
391
+ <input id="iframe" type="checkbox" name="iframe" <?php echo $iframe; ?> />
392
+ <label for="iframe"><?php _e( 'Use IFRAME embed code', 'smart-youtube' ); ?></label> [<a target="_blank" href="http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html">?</a>]
393
+ </div>
394
+ <h3><?php _e( 'Video Appearence', 'smart-youtube' ); ?></h3>
395
+ <p class="instruct">
396
+ <?php _e( 'Video template. Default is just {video}.', 'smart-youtube' ); ?><br />
397
+ <?php echo __( 'You can try <code>', 'smart-youtube' ) . $example . __( '</code> if you want the text to wrap around video.', 'smart-youtube' ); ?>
398
+ </p>
399
+ <textarea cols="50" id="disp_template" name="disp_template"><?php echo $disp_template; ?></textarea>
400
+ <br />
401
+ <input id="http" type="checkbox" name="http" <?php echo $http; ?> />
402
+ <label for="http"><?php _e( 'Parse links with http:// prefix same as httpv://', 'smart-youtube' ); ?></label>
403
+ <br />
404
+ <input id="www" type="checkbox" name="www" <?php echo $www; ?> />
405
+ <label for="www"><?php _e( 'Parse links without http:// prefix', 'smart-youtube' ); ?></label>
406
+ <p class="instruct"><?php _e( 'Video width and height in normal mode (httpv://). Default is 425x344.', 'smart-youtube' ); ?></p>
407
+ <div id="inputSizeNormal">
408
+ <input class="width" name="disp_width" value="<?php echo $disp_width; ?>" size="7"/>x<input class="height" name="disp_height" value="<?php echo $disp_height; ?>" size="7" />
409
+ </div>
410
+ <div class="size-chooser" forDiv="inputSizeNormal">
411
+ <a v-width="320" v-height="265" href="#">
412
+ <span></span>
413
+ <div class="outer">
414
+ <div></div>
415
+ </div>
416
+ </a>
417
+ <a v-width="425" v-height="344" href="#">
418
+ <span></span>
419
+ <div class="outer">
420
+ <div></div>
421
+ </div>
422
+ </a>
423
+ <a v-width="480" v-height="385" href="#">
424
+ <span></span>
425
+ <div class="outer">
426
+ <div></div>
427
+ </div>
428
+ </a>
429
+ <a v-width="640" v-height="505" href="#">
430
+ <span></span>
431
+ <div class="outer">
432
+ <div></div>
433
+ </div>
434
+ </a>
435
+ <a v-width="960" v-height="745" href="#">
436
+ <span></span>
437
+ <div class="outer">
438
+ <div></div>
439
+ </div>
440
+ </a>
441
+ <br clear="both" />
442
+ </div>
443
+ <p class="instruct"><?php _e( 'Video width and height in <strong>high quality</strong> mode (httpvh://). Default is 480x295.', 'smart-youtube' ); ?></p>
444
+ <div id="inputSizeHQ">
445
+ <input class="width" name="disp_widthhq" value="<?php echo $disp_widthhq; ?>" size="7" />x<input class="height" name="disp_heighthq" value="<?php echo $disp_heighthq; ?>" size="7" />
446
+ </div>
447
+ <div class="size-chooser" forDiv="inputSizeHQ">
448
+ <a v-width="480" v-height="295" href="#">
449
+ <span></span>
450
+ <div class="outer">
451
+ <div></div>
452
+ </div>
453
+ </a>
454
+ <a v-width="560" v-height="340" href="#">
455
+ <span></span>
456
+ <div class="outer">
457
+ <div></div>
458
+ </div>
459
+ </a>
460
+ <a v-width="640" v-height="385" href="#">
461
+ <span></span>
462
+ <div class="outer">
463
+ <div></div>
464
+ </div>
465
+ </a>
466
+ <a v-width="853" v-height="505" href="#">
467
+ <span></span>
468
+ <div class="outer">
469
+ <div></div>
470
+ </div>
471
+ </a>
472
+ <a v-width="1280" v-height="745" href="#">
473
+ <span></span>
474
+ <div class="outer">
475
+ <div></div>
476
+ </div>
477
+ </a>
478
+ <br clear="both" />
479
+ </div>
480
+ <p class="instruct"><?php _e( 'Video width and height in <strong>sidebar</strong> mode (regardless of quality). Default is 150x125.', 'smart-youtube' ); ?></p>
481
+ <input id="disp_widthside" name="disp_widthside" value="<?php echo $disp_widthside; ?>" size="7" />x<input id="disp_heightside" name="disp_heightside" value="<?php echo $disp_heightside; ?>" size="7" /><br /><br />
482
+ <div id="watch-customize-embed-form">
483
+ <input type="radio" <?php echo $disp_rel; ?> id="embedCustomization1" name="embedRel" value="1"/>
484
+ <label for="embedCustomization1"><?php _e( 'Include related videos', 'smart-youtube' ); ?></label>
485
+ <br/>
486
+ <input type="radio" <?php echo $disp_rel2; ?> id="embedCustomization0" name="embedRel" value="0"/>
487
+ <label for="embedCustomization0"><?php _e( 'Do not include related videos', 'smart-youtube' ); ?></label>
488
+ <br/>
489
+ </div>
490
+ <br/>
491
+ <div style="margin: 0 0 0 4px; clear: both;">
492
+ <input type="checkbox" id="autoplay_checkbox" name="autoplay" <?php echo $disp_autoplay; ?> /><label for="autoplay_checkbox"><?php _e( 'Autoplay videos', 'smart-youtube' ); ?></label><br />
493
+ <input type="checkbox" id="autoplay_first_checkbox" name="autoplay_first" <?php echo $disp_autoplay_first; ?> /><label for="autoplay_first_checkbox"><?php _e( 'Autoplay only first video on page', 'smart-youtube' ); ?></label><br />
494
+ <input type="checkbox" id="loop_checkbox" name="loop" <? echo $disp_loop; ?> /><label for="loop_checkbox"><?php _e( 'Loop videos', 'smart-youtube' ); ?></label><br />
495
+ <input type="checkbox" id="disp_search" name="disp_search" <?php echo $disp_search; ?> /><label for="disp_search"><?php _e( 'Display search box', 'smart-youtube' ); ?></label><br />
496
+ <input type="checkbox" id="thumb_checkbox" name="thumb" <?php echo $thumb; ?> /><label for="thumb_checkbox"><?php _e( 'Display thumbnails on home/archive pages', 'smart-youtube' ); ?></label><br />
497
+ <input type="checkbox" id="cbox_checkbox" name="colorbox" <?php echo $colorbox; ?> /><label for="cbox_checkbox"><?php _e( 'Show video in colorbox', 'smart-youtube' ); ?></label><br />
498
+ <input type="checkbox" id="disp_info" name="disp_info" <?php echo $disp_info; ?> /><label for="disp_info"><?php _e( 'Remove Titles & Ratings', 'smart-youtube' ); ?></label><br />
499
+ <input type="checkbox" id="disp_ann" name="disp_ann" <?php echo $disp_ann; ?> /><label for="disp_ann"><?php _e( 'Remove Annotations', 'smart-youtube' ); ?></label><br />
500
+ <input type="checkbox" id="logoless" name="logoless" <?php echo $logoless; ?> /><label for="logoless"><?php _e( 'Hide YouTube Logo', 'smart-youtube' ); ?></label><br />
501
+ <label for="theme"><?php _e( 'Theme (YouTube only):', 'smart-youtube' ); ?></label>
502
+ <select id="theme" name="theme" />
503
+ <option value="dark" <?php echo ( ( $theme == 'dark' ) ? 'selected="yes"' : '' ); ?>><?php _e( 'Dark', 'smart-youtube' ); ?></option>
504
+ <option value="light" <?php echo ( ( $theme == 'light' ) ? 'selected="yes"' : '' ); ?>><?php _e( 'Light', 'smart-youtube' ); ?></option>
505
+ </select><br />
506
+ <input type="checkbox" id="privacy" name="disp_privacy" <?php echo $disp_privacy; ?> /><label for="privacy"><?php _e( 'Enable privacy-enhanced mode', 'smart-youtube' ); ?> [<a target="_blank" href="http://www.google.com/support/youtube/bin/answer.py?answer=141046">?</a>] <?php _e( 'videos may not work for Iphone users)', 'smart-youtube' ); ?></label><br />
507
+ <div id="disp_excerpt_div">
508
+ <label for="disp_excerpt"><?php _e( 'Show embeds in post excerpts as', 'smart-youtube' ); ?></label>
509
+ <select id="disp_excerpt" name="excerpt">
510
+ <option value="vid" <?php echo ( ( $excerpt == 'vid' ) ? 'selected="yes"' : '' ); ?>><?php _e( 'Video', 'smart-youtube' ); ?></option>
511
+ <option value="thm" <?php echo ( ( $excerpt == 'thm' ) ? 'selected="yes"' : '' ); ?>><?php _e( 'Thumbnail', 'smart-youtube' ); ?></option>
512
+ <option value="not" <?php echo ( ( $excerpt == 'not' ) ? 'selected="yes"' : '' ); ?>><?php _e( 'Nothing', 'smart-youtube' ); ?></option>
513
+ </select>
514
+ </div>
515
+ <div id="disp_excerpt_align_div">
516
+ <label for="disp_excerpt_align"><?php _e( 'Align embeds in post excerpts to', 'smart-youtube' ); ?></label>
517
+ <select id="disp_excerpt_align" name="excerpt_align">
518
+ <option value="left" <?php echo ( ( $excerpt_align == 'left' ) ? 'selected="yes"' : '' ); ?>><?php _e( 'Left', 'smart-youtube' ); ?></option>
519
+ <option value="right" <?php echo ( ( $excerpt_align == 'right' ) ? 'selected="yes"' : '' ); ?>><?php _e( 'Right', 'smart-youtube' ); ?></option>
520
+ </select>
521
+ </div>
522
+ </div>
523
+ <h3><?php _e( 'Custom code compatibility', 'smart-youtube' ); ?></h3>
524
+ <p><?php _e( 'Use this option if you have used another youtube plugin and switched over to Smart Youtube.', 'smart-youtube' ); ?><p>
525
+ <p><?php _e( 'For example if you used [yt]qYWWBwf2wHE[/yt] type of code, you would type yt in the box below.', 'smart-youtube' ); ?></p>
526
+ <input id="tag" type="text" name="tag" value="<?php echo $tag; ?>" />
527
+ <label for="tag"><?php _e( 'Custom code', 'smart-youtube' ); ?></label>
528
+
529
+ <h3><?php _e( 'WiziApp support', 'smart-youtube' ); ?></h3>
530
+ <p><?php _e( 'WiziApp helps you to publish your blog as an iPhone app. This will integrate your video seamlessly. <a href="http://wiziapp.com">Learn more about WiziApp</a>.', 'smart-youtube' ); ?></p>
531
+ <input id="wiziapp" type="checkbox" name="wiziapp" <?php echo $wiziapp; ?> />
532
+ <label for="wiziapp"><?php _e( 'Enable WiziApp support', 'smart-youtube' ); ?></label>
533
+ <h3><?php _e( 'xHTML validation', 'smart-youtube' ); ?></h3>
534
+ <p class="instruct"><?php _e( 'Enabling the option below will change default YouTube code to be xHTML valid. (videos may not work for Iphone users)', 'smart-youtube' ); ?></p>
535
+ <input id="valid" type="checkbox" name="valid" <?php echo $valid; ?> />
536
+ <label for="valid"><?php _e( 'Enable xHTML Validation', 'smart-youtube' ); ?></label>
537
+ <h3><?php _e( 'RSS feed options', 'smart-youtube' ); ?></h3>
538
+ <p class="instruct"><?php _e( 'Some RSS feed readers like Bloglines will show embeded YouTube videos. Some will not and Smart YouTube allows you to display a video link and a video screenshot instead.', 'smart-youtube' ); ?></p>
539
+ <p class="instruct"><?php _e( 'Smart YouTube will always embed the video but it can not know if the reader supports embeded video or not. So use these additional options at your own likening.', 'smart-youtube' ); ?></p>
540
+ <input id="check2" type="checkbox" name="disp_link" <?php echo $disp_link; ?> />
541
+ <label for="check2"><?php _e( 'Display video link in RSS feed', 'smart-youtube' ); ?></label><br />
542
+ <input id="check1" type="checkbox" name="disp_img" <?php echo $disp_img; ?> />
543
+ <label for="check1"><?php _e( 'Display video preview image in RSS feed', 'smart-youtube' ); ?></label>
544
+ <div class="submit"><input type="submit" name="Submit" value="<?php _e( 'Update options', 'smart-youtube' ); ?>" /></div>
545
+ </form>
546
+ </div>
547
+ </div>
548
+ </div>
549
+ </div>
550
+ <h5 class="author"><?php _e( 'Another fine WordPress plugin by <a href="http://www.prelovac.com/vladimir/">Vladimir Prelovac', 'smart-youtube' ); ?></a></h5>
551
+ <?php
552
+ }
553
+
554
+ function handle_colorbox_options() {
555
+ if ( isset( $_POST['submitted'] ) ) {
556
+ $this->colorbox['theme'] = ( ! isset( $_POST['colorbox_theme'] ) ? '1' : $_POST['colorbox_theme'] );
557
+
558
+ $options['colorbox'] = $this->colorbox;
559
+
560
+ update_option( $this->key, $options );
561
+
562
+ $msg_status = __( 'SEO Friendly Images PRO colorbox options saved.', 'smart-youtube' );
563
+
564
+ // Show message
565
+ echo '<div id="message" class="updated fade"><p>' . $msg_status . '</p></div>';
566
+ }
567
+
568
+ $imgpath = $this->plugin_url . '/i';
569
+ $actionurl = $_SERVER['REQUEST_URI'];
570
+
571
+ ?>
572
+ <div class="wrap">
573
+ <?php screen_icon(); ?>
574
+ <h2><?php _e( 'Smart YouTube PRO', 'smart-youtube' ); echo '&nbsp;' . $this->local_version; ?></h2>
575
+ <a href="admin.php?page=syt_settings"><?php _e( 'Settings', 'smart-youtube' ); ?></a> &nbsp;|&nbsp; <a href="admin.php?page=syt_colorbox_options"><?php _e( 'Colorbox Options', 'smart-youtube' ); ?></a> &nbsp;|&nbsp; <a href="admin.php?page=syt_about"><?php _e( 'About', 'smart-youtube' ); ?></a>
576
+ <div id="poststuff" style="margin-top:10px;">
577
+ <div id="sideblock" style="float:right;width:270px;margin-left:10px;">
578
+ <iframe width=270 height=800 frameborder="0" src="http://www.prelovac.com/plugin/news.php?id=2&utm_source=plugin&utm_medium=plugin&utm_campaign=SEO%2BFriendly%2BImages%2BPRO"></iframe>
579
+ </div>
580
+ </div>
581
+ <div id="mainblock" class="submit">
582
+ <div class="dbx-content">
583
+ <h2><?php _e( 'Colorbox Options', 'smart-youtube' ); ?></h2>
584
+ <br />
585
+ <form name="sytform" action="<?php echo $actionurl; ?>" method="post">
586
+ <input type="hidden" name="submitted" value="1" />
587
+ <div>
588
+ <label for="colorbox_theme"><?php _e( 'Choose ColorBox theme:', 'smart-youtube' ); ?></label>
589
+ <select id="colorbox_theme" name="colorbox_theme">
590
+ <?php for($i = 1; $i <= 11; $i++): ?>
591
+ <option value="<?php echo $i; ?>" <?php echo ($this->options['colorbox']['theme']==$i) ? 'selected="yes"' : ''; ?>><?php echo __( 'Theme ', 'smart-youtube' ) . $i; ?></option>
592
+ <?php endfor; ?>
593
+ </select>
594
+ </div>
595
+ <div>
596
+ <label for="screenshot_image"><?php _e( 'Theme screenshot:', 'smart-youtube' ); ?></label>
597
+ <div id="screenshot_image">
598
+ <img src="<?php echo $this->plugin_url . '/screenshots/screenshot-' . $this->options['colorbox']['theme'] . '.jpg'; ?>" />
599
+ </div>
600
+ </div>
601
+ <div style="padding: 1.5em 0;margin: 5px 0;">
602
+ <input type="submit" name="Submit" value="<?php _e( 'Update options', 'smart-youtube' ); ?>" />
603
+ </div>
604
+ </form>
605
+ </div>
606
+ </div>
607
+ <h5><?php _e( 'Another fine WordPress plugin by', 'smart-youtube' ); ?> <a href="http://www.prelovac.com/vladimir/">Vladimir Prelovac</a></h5>
608
+ </div>
609
+ <?php
610
+ }
611
+
612
+ function handle_about() {
613
+ global $wp_version;
614
+
615
+ $upd_msg = "";
616
+
617
+ $actionurl = $_SERVER['REQUEST_URI'];
618
+ $nonce = wp_create_nonce( 'smart-youtube' );
619
+
620
+ $lic_msg = '<p>Welcome to ' . __( 'Smart YouTube PRO', 'smart-youtube' ) . '.</p>';
621
+ ?>
622
+ <div class="wrap">
623
+ <?php screen_icon(); ?>
624
+ <h2><?php _e( 'Smart YouTube PRO', 'smart-youtube' ); echo '&nbsp;' . $this->local_version; ?></h2>
625
+ <a href="admin.php?page=syt_settings"><?php _e( 'Settings', 'smart-youtube' ); ?></a> &nbsp;|&nbsp; <a href="admin.php?page=syt_colorbox_options"><?php _e( 'Colorbox Options', 'smart-youtube' ); ?></a> &nbsp;|&nbsp; <a href="admin.php?page=syt_about"><?php _e( 'About', 'smart-youtube' ); ?></a>
626
+ <div id="poststuff" style="margin-top:10px;">
627
+
628
+ <div id="sideblock" style="float:right;width:270px;margin-left:10px;">
629
+ <iframe width=270 height=800 frameborder="0" src="http://www.prelovac.com/plugin/news.php?id=2&utm_source=plugin&utm_medium=plugin&utm_campaign=SEO%2BFriendly%2BImages%2BPRO"></iframe>
630
+ </div>
631
+ </div>
632
+ <div id="mainblock" class="submit">
633
+ <div class="dbx-content">
634
+ <h2><?php _e( 'About', 'smart-youtube' ); ?></h2>
635
+ <br />
636
+ <form name="STY_about" action="$actionurl" method="post">
637
+ <input type="hidden" id="_wpnonce" name="_wpnonce" value="$nonce" />
638
+ <input type="hidden" name="submitted" value="1" />
639
+ <?php echo $lic_msg; ?>
640
+ <?php echo __( 'Version:', 'smart-youtube' ) . $this->local_version; ?> <?php echo $upd_msg; ?>
641
+ </form>
642
+ </div>
643
+ </div>
644
+ <h5><?php _e( 'Another fine WordPress plugin by', 'smart-youtube' ); ?> <a href="http://www.prelovac.com/vladimir/">Vladimir Prelovac</a></h5>
645
+ </div>
646
+ <?php
647
+ }
648
+
649
+ function mark_first_post_on_archive() {
650
+ if ( is_archive() || is_home() || is_front_page() ) {
651
+ $this->first_post_on_archive = true;
652
+ }
653
+ }
654
+
655
+ /**
656
+ * Looks for Smart Youtube URL(s) in the post content
657
+ * and replace them with proper HTML tags
658
+ *
659
+ * @param mixed $the_content
660
+ * @param mixed $side
661
+ * @return mixed
662
+ */
663
+ function check( $the_content, $side = 0 ) {
664
+ $char_codes = array( '&#215;', '&#8211;' );
665
+ $replacements = array( "x", "--" );
666
+ $the_content = str_replace( $char_codes, $replacements, $the_content );
667
+ $this->first = false;
668
+
669
+ $context = $side ? 'side' : 'post';
670
+
671
+ preg_match_all( "/((http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^<\s]*))|((http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtu\.be\/([a-zA-Z0-9\-\_]{11}))|((http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?metacafe\.com\/watch\/([a-zA-Z0-9\-\_]{7})\/([^<^\/\s]*)([\/])?)|((http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?vimeo\.com\/([a-zA-Z0-9\-\_]{8})([\/])?)|((http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?liveleak\.com\/view(\?i\=)([a-zA-Z0-9\-\_]*))|((http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?facebook\.com\/video\/video.php\?v\=([a-zA-Z0-9\-\_]*))|((http(vp|vhp)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtube\.com\/(view_play_list|playlist)(\?p\=|\/v\/|#!v=)([a-zA-Z0-9\-\_])([^<\s]*))/", $the_content, $matches, PREG_SET_ORDER );
672
+
673
+ foreach ( $matches as $match ) {
674
+ if ( $match[1] != '' ) {
675
+ if ( 'on' == $this->options['wiziapp'] ) {
676
+ $videos = array();
677
+ $video_info['src'] = "http://www.youtube.com/watch?v={$match[6]}";
678
+ array_push( $videos, $video_info );
679
+ $replace_text = '';
680
+ $replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
681
+ $the_content = str_replace( $match[1], $replace_text, $the_content );
682
+ } else if (/*( $match[1] == 'http://' && $this->options['http'] == 'on' ) || */( $match[2] == '' && $this->options['www'] == 'on' ) ) {
683
+ $the_content = str_replace( $match[1], $this->tag_youtube( $context, $match[6], 'v', $match[7] ), $the_content );
684
+ } else if ( $match[3] == 'v' || $match[3] == 'vh' || $match[3] == 'vhd' ) {
685
+ $the_content = str_replace( $match[1], $this->tag_youtube( $context, $match[6], $match[3], $match[7] ), $the_content );
686
+ }
687
+ } elseif ( $match[8] != '' ) {
688
+ if ( 'on' == $this->options['wiziapp'] ) {
689
+ $videos = array();
690
+ $video_info['src'] = "http://www.youtube.com/watch?v={$match[12]}";
691
+ array_push( $videos, $video_info );
692
+ $replace_text = '';
693
+ $replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
694
+ $the_content = str_replace( $match[1], $replace_text, $the_content );
695
+ } else if (/*( $match[9] == 'http://' && $this->options['http'] == 'on' ) || */( $match[9] == '' && $this->options['www'] == 'on' ) ) {
696
+ $the_content = str_replace( $match[8], $this->tag_youtube( $context, $match[12], 'v' ), $the_content );
697
+ } else if ( $match[10] == 'v' || $match[10] == 'vh' || $match[10] == 'vhd' ) {
698
+ $the_content = str_replace( $match[8], $this->tag_youtube( $context, $match[12], $match[10] ), $the_content );
699
+ }
700
+ } elseif ( $match[13] != '' ) {
701
+ if ( 'on' == $this->options['wiziapp'] ) {
702
+ $videos = array();
703
+ $video_info['src'] = "http://www.metacafe.com/watch/{$match[17]}/{$match[18]}/";
704
+ array_push( $videos, $video_info );
705
+ $replace_text = '';
706
+ $replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
707
+ $the_content = str_replace( $match[1], $replace_text, $the_content );
708
+ } else if ( ( $match[14] == 'http://' && $this->options['http'] == 'on' ) || ( $match[14] == '' && $this->options['www'] == 'on' ) ) {
709
+ $the_content = str_replace( $match[13], $this->tag_metacafe( $context, $match[17], 'v', $match[18] ), $the_content );
710
+ } else if ( $match[15] == 'v' || $match[15] == 'vh' || $match[15] == 'vhd' ) {
711
+ $the_content = str_replace( $match[13], $this->tag_metacafe( $context, $match[17], $match[15], $match[18] ), $the_content );
712
+ }
713
+ } elseif ( $match[20] != '' ) {
714
+ if ( 'on' == $this->options['wiziapp'] ) {
715
+ $videos = array();
716
+ $video_info['src'] = "http://www.vimeo.com/{$match[24]}";
717
+ array_push( $videos, $video_info );
718
+ $replace_text = '';
719
+ $replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
720
+ $the_content = str_replace( $match[1], $replace_text, $the_content );
721
+ } else if ( ( $match[21] == 'http://' && $this->options['http'] == 'on' ) || ( $match[21] == '' && $this->options['www'] == 'on' ) ) {
722
+ $the_content = str_replace( $match[20], $this->tag_vimeo( $context, $match[24], 'v' ), $the_content );
723
+ } else if ( $match[22] == 'v' || $match[22] == 'vh' || $match[22] == 'vhd' ) {
724
+ $the_content = str_replace( $match[20], $this->tag_vimeo( $context, $match[24], $match[22] ), $the_content );
725
+ }
726
+ } elseif ( $match[26] != '' ) {
727
+ if ( 'on' == $this->options['wiziapp'] ) {
728
+ $videos = array();
729
+ $video_info['src'] = "http://www.liveleak.com/view?i={$match[31]}";
730
+ array_push( $videos, $video_info );
731
+ $replace_text = '';
732
+ $replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
733
+ $the_content = str_replace( $match[1], $replace_text, $the_content );
734
+ } else if ( ( $match[27] == 'http://' && $this->options['http'] == 'on' ) || ( $match[27] == '' && $this->options['www'] == 'on' ) ) {
735
+ $the_content = str_replace( $match[26], $this->tag_liveleak( $context, $match[31], 'v' ), $the_content );
736
+ } else if ( $match[28] == 'v' || $match[28] == 'vh' || $match[28] == 'vhd' ) {
737
+ $the_content = str_replace( $match[26], $this->tag_liveleak( $context, $match[31], $match[28] ), $the_content );
738
+ }
739
+ } elseif ( $match[32] != '' ) {
740
+ if ( 'on' == $this->options['wiziapp'] ) {
741
+ $videos = array();
742
+ $video_info['src'] = "http://www.facebook.com/video/video.php?v={$match[36]}";
743
+ array_push( $videos, $video_info );
744
+ $replace_text = '';
745
+ $replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
746
+ $the_content = str_replace( $match[1], $replace_text, $the_content );
747
+ } else if ( ( $match[33] == 'http://' && $this->options['http'] == 'on' ) || ( $match[33] == '' && $this->options['www'] == 'on' ) ) {
748
+ $the_content = str_replace( $match[32], $this->tag_facebook( $context, $match[36], 'v' ), $the_content );
749
+ } else if ( $match[34] == 'v' || $match[34] == 'vh' || $match[34] == 'vhd' ) {
750
+ $the_content = str_replace( $match[32], $this->tag_facebook( $context, $match[36], $match[34] ), $the_content );
751
+ }
752
+ } elseif ( $match[37] != '' ) {
753
+ if ( 'on' == $this->options['wiziapp'] ) {
754
+ $videos = array();
755
+ $video_info['src'] = "http://www.youtube.com/playlist?p={$match[43]}";
756
+ array_push( $videos, $video_info );
757
+ $replace_text = '';
758
+ $replace_text = apply_filters( 'wiziapp_3rd_party_plugin', $replace_text, 'video', $videos );
759
+ $the_content = str_replace( $match[1], $replace_text, $the_content );
760
+ } else if ( ( $match[38] == 'http://' && $this->options['http'] == 'on' ) || ( $match[38] == '' && $this->options['www'] == 'on' ) ) {
761
+ $the_content = str_replace( $match[37], $this->tag_youtube( $context, $match[43], 'vp', $match[44] ), $the_content );
762
+ } else if ( $match[39] == 'vp' || $match[39] == 'vhp' ) {
763
+ $the_content = str_replace( $match[37], $this->tag_youtube( $context, $match[43], $match[39], $match[44] ), $the_content );
764
+ }
765
+ }
766
+ }
767
+
768
+ /*preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtu\.be\/([a-zA-Z0-9\-\_]{11})/", $the_content, $matches, PREG_SET_ORDER );
769
+ foreach ( $matches as $match ) {
770
+ if (( $match[1] == 'http://' && $this->options['http'] == 'on' ) || ( $match[1] == '' && $this->options['www'] == 'on' ) ) {
771
+ $the_content = str_replace( $match[0], $this->tag_youtube( $context, $match[4], 'v' ), $the_content );
772
+ } else if ( $match[2] == 'v' || $match[2] == 'vh' || $match[2] == 'vhd' ) {
773
+ $the_content = str_replace( $match[0], $this->tag_youtube( $context, $match[4], $match[2] ), $the_content );
774
+ }
775
+ }
776
+
777
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?metacafe\.com\/watch\/([a-zA-Z0-9\-\_]{7})\/([^<^\/\s]*)([\/])?/", $the_content, $matches, PREG_SET_ORDER );
778
+ foreach ( $matches as $match ) {
779
+ if ( ( $match[1] == 'http://' && $this->options['http'] == 'on' ) || ( $match[1] == '' && $this->options['www'] == 'on' ) ) {
780
+ $the_content = str_replace( $match[0], $this->tag_metacafe( $context, $match[4], 'v', $match[5] ), $the_content );
781
+ } else if ( $match[2] == 'v' || $match[2] == 'vh' || $match[2] == 'vhd' ) {
782
+ $the_content = str_replace( $match[0], $this->tag_metacafe( $context, $match[4], $match[2], $match[5] ), $the_content );
783
+ }
784
+ }
785
+
786
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?vimeo\.com\/([a-zA-Z0-9\-\_]{8})([\/])?/", $the_content, $matches, PREG_SET_ORDER );
787
+ foreach ( $matches as $match ) {
788
+ if ( ( $match[1] == 'http://' && $this->options['http'] == 'on' ) || ( $match[1] == '' && $this->options['www'] == 'on' ) ) {
789
+ $the_content = str_replace( $match[0], $this->tag_vimeo( $context, $match[4], 'v' ), $the_content );
790
+ } else if ( $match[2] == 'v' || $match[2] == 'vh' || $match[2] == 'vhd' ) {
791
+ $the_content = str_replace( $match[0], $this->tag_vimeo( $context, $match[4], $match[2] ), $the_content );
792
+ }
793
+ }
794
+
795
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?liveleak\.com\/view(\?i\=)([a-zA-Z0-9\-\_]*)/", $the_content, $matches, PREG_SET_ORDER );
796
+ foreach ( $matches as $match ) {
797
+ if ( ( $match[1] == 'http://' && $this->options['http'] == 'on' ) || ( $match[1] == '' && $this->options['www'] == 'on' ) ) {
798
+ $the_content = str_replace( $match[0], $this->tag_liveleak( $context, $match[5], 'v' ), $the_content );
799
+ } else if ( $match[2] == 'v' || $match[2] == 'vh' || $match[2] == 'vhd' ) {
800
+ $the_content = str_replace( $match[0], $this->tag_liveleak( $context, $match[5], $match[2] ), $the_content );
801
+ }
802
+ }
803
+
804
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?facebook\.com\/video\/video.php\?v\=([a-zA-Z0-9\-\_]*)/", $the_content, $matches, PREG_SET_ORDER );
805
+ foreach ( $matches as $match ) {
806
+ if ( ( $match[1] == 'http://' && $this->options['http'] == 'on' ) || ( $match[1] == '' && $this->options['www'] == 'on' ) ) {
807
+ $the_content = str_replace( $match[0], $this->tag_facebook( $context, $match[4], 'v' ), $the_content );
808
+ } else if ( $match[2] == 'v' || $match[2] == 'vh' || $match[2] == 'vhd' ) {
809
+ $the_content = str_replace( $match[0], $this->tag_facebook( $context, $match[4], $match[2] ), $the_content );
810
+ }
811
+ }
812
+
813
+ preg_match_all( "/(http(vp|vhp)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtube\.com\/view_play_list(\?p\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{16})([^<\s]*)/", $the_content, $matches, PREG_SET_ORDER );
814
+ foreach ( $matches as $match ) {
815
+ if ( ( $match[1] == 'http://' && $this->options['http'] == 'on' ) || ( $match[1] == '' && $this->options['www'] == 'on' ) ) {
816
+ $the_content = str_replace( $match[0], $this->tag_youtube( $context, $match[5], 'vp', $match[6] ), $the_content );
817
+ } else if ( $match[2] == 'vp' || $match[2] == 'vhp' ) {
818
+ $the_content = str_replace( $match[0], $this->tag_youtube( $context, $match[5], $match[2], $match[6] ), $the_content );
819
+ }
820
+ }*/
821
+
822
+ // to work with migrated blogs from Wordpress.com replacing [youtube=youtubeadresss]
823
+ if ( strpos($the_content, "[youtube") !== false ) {
824
+ preg_match_all( "/\[youtube\=http:\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^<\s]*)\]/", $the_content, $matches, PREG_SET_ORDER );
825
+ foreach ( $matches as $match ) {
826
+ $the_content = preg_replace( "/\[youtube\=http:\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^\s<]*)\]/", $this->tag_youtube( $context, $match[3], '', $match[4] ), $the_content, 1 );
827
+ }
828
+ }
829
+ $tag = $this->options['tag'];
830
+
831
+ if ( $tag != '' && strpos( $the_content, "[".$tag."]" ) !== false ) {
832
+ preg_match_all( "/\[$tag\]([a-zA-Z0-9\-\_]{11})([^<\s]*)\[\/$tag\]/", $the_content, $matches, PREG_SET_ORDER );
833
+ foreach ( $matches as $match ) {
834
+ $the_content = preg_replace( "/\[$tag\]([a-zA-Z0-9\-\_]{11})([^<\s]*)\[\/$tag\]/", $this->tag_youtube( $context, $match[1], '', '' ), $the_content, 1 );
835
+ }
836
+ }
837
+
838
+ if ( $this->first_post_on_archive ) {
839
+ $this->first_post_on_archive = false;
840
+ }
841
+
842
+ return $the_content;
843
+ }
844
+
845
+ function check_excerpt( $the_content ) {
846
+ $excerpt = $this->options['excerpt'];
847
+ $template = trim($this->options['template']) == '' ? '{video}' : $this->options['template'];
848
+
849
+ if ( $excerpt != 'not' ) {
850
+ global $post;
851
+ $content = $post->post_content;
852
+
853
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^<\s]*)/", $content, $matches['youtube.com'], PREG_SET_ORDER );
854
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtu\.be\/([a-zA-Z0-9\-\_]{11})/", $content, $matches['youtu.be'], PREG_SET_ORDER );
855
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?metacafe\.com\/watch\/([a-zA-Z0-9\-\_]{7})\/([^<^\/\s]*)([\/])?/", $content, $matches['metacafe.com'], PREG_SET_ORDER );
856
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?vimeo\.com\/([a-zA-Z0-9\-\_]{8})([\/])?/", $content, $matches['vimeo.com'], PREG_SET_ORDER );
857
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?liveleak\.com\/view(\?i\=)([a-zA-Z0-9\-\_]*)/", $content, $matches['liveleak.com'], PREG_SET_ORDER );
858
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?facebook\.com\/video\/video.php\?v\=([a-zA-Z0-9\-\_]*)/", $content, $matches['facebook.com'], PREG_SET_ORDER );
859
+
860
+ if ( isset( $matches['youtube.com'][0] ) ) {
861
+ if ( ( $matches['youtube.com'][0][1] == 'http://' && $this->options['http'] == 'on' ) || ( $matches['youtube.com'][0][1] == '' && $this->options['www'] == 'on' ) ) {
862
+ $matches['youtube.com'][0][0] = str_replace( $matches['youtube.com'][0][0], $this->tag_youtube( 'excerpt', $matches['youtube.com'][0][5], 'v', $matches['youtube.com'][0][6] ), $matches['youtube.com'][0][0] );
863
+ } else if ( $matches['youtube.com'][0][2] == 'v' || $matches['youtube.com'][0][2] == 'vh' || $matches['youtube.com'][0][2] == 'vhd' ) {
864
+ $matches['youtube.com'][0][0] = str_replace( $matches['youtube.com'][0][0], $this->tag_youtube( 'excerpt', $matches['youtube.com'][0][5], $matches['youtube.com'][0][2], $matches['youtube.com'][0][6] ), $matches['youtube.com'][0][0] );
865
+ }
866
+ $result = $matches['youtube.com'][0][0];
867
+ } else if ( isset( $matches['youtu.be'][0] ) ) {
868
+ if ( ( $matches['youtu.be'][0][1] == 'http://' && $this->options['http'] == 'on' ) || ( $matches['youtu.be'][0][1] == '' && $this->options['www'] == 'on' ) ) {
869
+ $matches['youtu.be'][0][0] = str_replace( $matches['youtu.be'][0][0], $this->tag_youtube( 'excerpt', $matches['youtu.be'][0][4], 'v' ), $matches['youtu.be'][0][0] );
870
+ } else if ( $matches['youtu.be'][0][2] == 'v' || $matches['youtu.be'][0][2] == 'vh' || $matches['youtu.be'][0][2] == 'vhd' ) {
871
+ $matches['youtu.be'][0][0] = str_replace( $matches['youtu.be'][0][0], $this->tag_youtube( 'excerpt', $matches['youtu.be'][0][4], $matches['youtu.be'][0][2]), $matches['youtu.be'][0][0] );
872
+ }
873
+ $result = $matches['youtu.be'][0][0];
874
+ } else if ( isset( $matches['metacafe.com'][0] ) ) {
875
+ if ( ( $matches['metacafe.com'][0][1] == 'http://' && $this->options['http'] == 'on' ) || ( $matches['metacafe.com'][0][1] == '' && $this->options['www'] == 'on' ) ) {
876
+ $matches['metacafe.com'][0][0] = str_replace( $matches['metacafe.com'][0][0], $this->tag_metacafe( 'excerpt', $matches['metacafe.com'][0][4], 'v', $matches['metacafe.com'][0][5] ), $matches['metacafe.com'][0][0] );
877
+ } else if ( $matches['metacafe.com'][0][2] == 'v' || $matches['metacafe.com'][0][2] == 'vh' || $matches['metacafe.com'][0][2] == 'vhd' ) {
878
+ $matches['metacafe.com'][0][0] = str_replace( $matches['metacafe.com'][0][0], $this->tag_metacafe( 'excerpt', $matches['metacafe.com'][0][4], $matches['metacafe.com'][0][2], $matches['metacafe.com'][0][5] ), $matches['metacafe.com'][0][0] );
879
+ }
880
+ $result = $matches['metacafe.com'][0][0];
881
+ } else if ( isset($matches['vimeo.com'][0] ) ) {
882
+ if ( ( $matches['vimeo.com'][0][1] == 'http://' && $this->options['http'] == 'on' ) || ( $matches['vimeo.com'][0][1] == '' && $this->options['www'] == 'on' ) ) {
883
+ $matches['vimeo.com'][0][0] = str_replace( $matches['vimeo.com'][0][0], $this->tag_vimeo( 'excerpt', $matches['vimeo.com'][0][4], 'v' ), $matches['vimeo.com'][0][0] );
884
+ }
885
+ else if ( $matches['vimeo.com'][0][2] == 'v' || $matches['vimeo.com'][0][2] == 'vh' || $matches['vimeo.com'][0][2] == 'vhd' ) {
886
+ $matches['vimeo.com'][0][0] = str_replace( $matches['vimeo.com'][0][0], $this->tag_vimeo( 'excerpt', $matches['vimeo.com'][0][4], $matches['vimeo.com'][0][2] ), $matches['vimeo.com'][0][0] );
887
+ }
888
+ $result = $matches['vimeo.com'][0][0];
889
+ } else if ( isset( $matches['liveleak.com'][0] ) ) {
890
+ if ( ( $matches['liveleak.com'][0][1] == 'http://' && $this->options['http'] == 'on' ) || ( $matches['liveleak.com'][0][1] == '' && $this->options['www'] == 'on' ) ) {
891
+ $matches['liveleak.com'][0][0] = str_replace( $matches['liveleak.com'][0][0], $this->tag_liveleak( 'excerpt', $matches['liveleak.com'][0][4], 'v' ), $matches['liveleak.com'][0][0] );
892
+ } else if ( $matches['liveleak.com'][0][2] == 'v' || $matches['liveleak.com'][0][2] == 'vh' || $matches['liveleak.com'][0][2] == 'vhd' ) {
893
+ $matches['liveleak.com'][0][0] = str_replace( $matches['liveleak.com'][0][0], $this->tag__liveleak( 'excerpt', $matches['liveleak.com'][0][4], $matches['liveleak.com'][0][2] ), $matches['liveleak.com'][0][0] );
894
+ }
895
+ $result = $matches['liveleak.com'][0][0];
896
+ } else if ( isset( $matches['facebook.com'][0] ) ) {
897
+ if ( ( $matches['facebook.com'][0][1] == 'http://' && $this->options['http'] == 'on' ) || ( $matches['facebook.com'][0][1] == '' && $this->options['www'] == 'on' ) ) {
898
+ $matches['facebook.com'][0][0] = str_replace( $matches['facebook.com'][0][0], $this->tag_facebook( 'excerpt', $matches['facebook.com'][0][4], 'v' ), $matches['facebook.com'][0][0] );
899
+ } else if ( $matches['facebook.com'][0][2] == 'v' || $matches['facebook.com'][0][2] == 'vh' || $matches['facebook.com'][0][2] == 'vhd' ) {
900
+ $matches['facebook.com'][0][0] = str_replace( $matches['facebook.com'][0][0], $this->tag_facebook( 'excerpt', $matches['facebook.com'][0][4], $matches['facebook.com'][0][2] ), $matches['facebook.com'][0][0] );
901
+ }
902
+ $result = $matches['facebook.com'][0][0];
903
+ } else {
904
+ $width = $this->options['widthside'];
905
+ $height = $this->options['heightside'];
906
+
907
+ $img_url = htmlspecialchars( $this->plugin_url . '/img/default.jpg' );
908
+ $post_url = get_permalink( $post->ID );
909
+ $yte_tag = <<<EOT
910
+ <a href="$post_url">
911
+ <img src="$img_url" height="$height" width="$width" />
912
+ </a>
913
+ EOT;
914
+ $result = str_replace( '{video}', $yte_tag, html_entity_decode( $template ) );
915
+ }
916
+ if ( isset( $result ) ) {
917
+ $the_content = '<div style="float:' . $this->options["excerpt_thumb"] . ';padding-' . ( $this->options["excerpt_thumb"] == 'left' ? 'right' : 'left' ) . ':10px;">' . $result . '</div>' . $the_content . '<div style="clear:both"></div>';
918
+ }
919
+ }
920
+
921
+ if ( $this->first_post_on_archive ) {
922
+ $this->first_post_on_archive = false;
923
+ }
924
+
925
+ return $the_content;
926
+ }
927
+
928
+ function tag_youtube( $context, $file, $high = 'v', $time = '' ) {
929
+ $playlist = 0;
930
+ $disp_rel = $this->options['rel'];
931
+ $autoplay = $this->options['autoplay'];
932
+ $autoplay_first = $this->options['autoplay_first'];
933
+ $disp_search = $this->options['search'] == 'on' ? 1 : 0;
934
+ $disp_info = $this->options['info'] == 'on' ? '&showinfo=0' : '';
935
+ $disp_ann = $this->options['ann'] == 'on' ? '&iv_load_policy=3' : '';
936
+ $template = trim( $this->options['template'] ) == '' ? '{video}' : $this->options['template'];
937
+ $valid = $this->options['valid'];
938
+ $loop = $this->options['loop'];
939
+ $thumb = $this->options['thumb'];
940
+ $colorbox = $this->options['colorbox'];
941
+ $logoless = $this->options['logoless'];
942
+ $theme = $this->options['theme'];
943
+ $excerpt = $this->options['excerpt'];
944
+
945
+ switch ( $high ) {
946
+ case 'v':
947
+ $high = '';
948
+ break;
949
+ case 'vh':
950
+ $high = '&amp;hd=1';
951
+ break;
952
+ case 'vhd':
953
+ $high = '&amp;hd=1';
954
+ break;
955
+ case 'vp':
956
+ $high = '';
957
+ $playlist = 1;
958
+ break;
959
+ case 'vhp':
960
+ $high = '&amp;hd=1';
961
+ $playlist = 1;
962
+ break;
963
+ default:
964
+ $high = '';
965
+ break;
966
+ }
967
+
968
+ $width = ( $context == 'excerpt' || $context == 'side' ) ?
969
+ $this->options['widthside'] :
970
+ ( $high ? $this->options['widthhq'] : $this->options['width'] );
971
+
972
+ $height = ( $context == 'excerpt' || $context == 'side' ) ?
973
+ $this->options['heightside'] :
974
+ ( $high ? $this->options['heighthq'] : $this->options['height'] );
975
+
976
+ if ( ! $width ) {
977
+ $width = ! $high ? 480 : 425 ;
978
+ }
979
+
980
+ if ( ! $height ) {
981
+ $height = ! $high ? 360 : 344;
982
+ }
983
+
984
+ if ( $disp_border ) {
985
+ $height += 18;
986
+ }
987
+
988
+ $ap = '';
989
+ if ( is_single() ) {
990
+ if ( $context == 'post' && $autoplay_first && ! $this->first ) {
991
+ $ap = '&autoplay=1';
992
+ $this->first = true;
993
+ } else if ( ( $context == 'post' && $autoplay && ! $autoplay_first ) || ( $context == 'excerpt' && $autoplay ) ) {
994
+ $ap = '&autoplay=1';
995
+ } else {
996
+ $ap = '';
997
+ }
998
+ } elseif ( $this->first_post_on_archive ) {
999
+ if ( $context == 'post' && $autoplay_first && ! $this->first ) {
1000
+ $ap = '&autoplay=1';
1001
+ $this->first = true;
1002
+ } else if ( ( $context == 'post' && $autoplay && ! $autoplay_first ) || ( $context == 'excerpt' && $autoplay ) ) {
1003
+ $ap = '&autoplay=1';
1004
+ } else {
1005
+ $ap = '';
1006
+ }
1007
+ }
1008
+
1009
+ if ( $logoless = 'on' ) {
1010
+ $ll = '&modestbranding=1';
1011
+ $disp_info = '';
1012
+ } else {
1013
+ $ll = '';
1014
+ }
1015
+
1016
+ $root_url = $this->options['privacy'] ? 'http://www.youtube-nocookie.com' : 'http://www.youtube.com';
1017
+
1018
+ if ( $excerpt == 'thm' ) {
1019
+ $img_url = htmlspecialchars( "http://img.youtube.com/vi/$file/0.jpg" );
1020
+ global $post;
1021
+ $post_url = get_permalink( $post->ID );
1022
+ $yte_tag = <<<EOT
1023
+ <a href="$post_url">
1024
+ <img src="$img_url" height="$height" width="$width" />
1025
+ </a>
1026
+ EOT;
1027
+ }
1028
+
1029
+ if ( ( ( is_home() || is_front_page() || is_archive() ) && $context == 'post' && $thumb == 'on' ) || ( $context == 'thumb' ) || ( $context == 'excerpt' && $excerpt == 'thm' ) ) {
1030
+ $img_url = htmlspecialchars( "http://img.youtube.com/vi/$file/0.jpg" );
1031
+ if ( $context == 'excerpt' && $excerpt == 'thm' ) {
1032
+ global $post;
1033
+ $post_url = get_permalink( $post->ID );
1034
+ $yte_tag = <<<EOT
1035
+ <a href="$post_url">
1036
+ <img src="$img_url" height="$height" width="$width" />
1037
+ </a>
1038
+ EOT;
1039
+ } else {
1040
+ $yte_tag = <<<EOT
1041
+ <img src="$img_url" height="$height" width="$width" />
1042
+ EOT;
1043
+ }
1044
+ } else {
1045
+ if ( $this->options['iframe'] == 'on' )
1046
+ $video_url = htmlspecialchars( "$root_url/embed/$file?fs=1&hl=en$ap$ll&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel&theme=$theme", ENT_QUOTES ) . $high . $time;
1047
+ else
1048
+ $video_url = htmlspecialchars( "$root_url/v/$file?fs=1&hl=en&$ap$ll&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel&theme=$theme", ENT_QUOTES ) . $high . $time;
1049
+
1050
+ if ( $playlist ) {
1051
+ $video_url = htmlspecialchars( "$root_url/embed/videoseries?list=$file&fs=1&hl=en$ap$ll&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel&theme=$theme", ENT_QUOTES ) . $high . $time;
1052
+ $yte_tag = <<<EOT
1053
+ <span class="youtube">
1054
+ <iframe class="youtube-player" src="$video_url" width="$width" height="$height" frameborder="0" allowfullscreen></iframe>
1055
+ </span>
1056
+ EOT;
1057
+ } elseif ( $valid == 'off' || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPhone' ) === TRUE || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPod' ) === TRUE || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPad' ) === TRUE ) {
1058
+ if ( $context == 'post' && $colorbox == 'on' && is_singular() ) {
1059
+ $img_url = htmlspecialchars( "http://img.youtube.com/vi/$file/0.jpg" );
1060
+ $yte_tag = <<<EOT
1061
+ <a class="colorbox_video" href="$video_url">
1062
+ <img width="$width" height="$height" src="$img_url" /></iframe>
1063
+ </span>
1064
+ EOT;
1065
+ } else if ( $this->options['iframe'] == 'on' )
1066
+ $yte_tag = <<<EOT
1067
+ <span class="youtube">
1068
+ <iframe title="YouTube video player" class="youtube-player" type="text/html" width="$width" height="$height" src="$video_url" frameborder="0" allowfullscreen></iframe>
1069
+ </span>
1070
+ EOT;
1071
+ else
1072
+ $yte_tag = <<<EOT
1073
+ <span class="youtube">
1074
+ <object width="$width" height="$height">
1075
+ <param name="movie" value="$video_url" />
1076
+ <param name="allowFullScreen" value="true" />
1077
+ <embed wmode="opaque" src="$video_url" type="application/x-shockwave-flash" allowfullscreen="true" width="$width" height="$height"></embed>
1078
+ <param name="wmode" value="opaque" />
1079
+ </object>
1080
+ </span>
1081
+ EOT;
1082
+ } else {
1083
+ if ( $context == 'post' && $colorbox == 'on' && is_singular() ) {
1084
+ $img_url = htmlspecialchars( "http://img.youtube.com/vi/$file/0.jpg" );
1085
+ $yte_tag = <<<EOT
1086
+ <a class="colorbox_video" href="$video_url">
1087
+ <img width="$width" height="$height" src="$img_url" /></iframe>
1088
+ </span>
1089
+ EOT;
1090
+ } else if ( $this->options['iframe'] == 'on' ) {
1091
+ $yte_tag = <<<EOT
1092
+ <span class="youtube">
1093
+ <iframe title="YouTube video player" class="youtube-player" type="text/html" width="$width" height="$height" src="$video_url" frameborder="0" allowfullscreen></iframe>
1094
+ </span>
1095
+ EOT;
1096
+ } else {
1097
+ $yte_tag = <<<EOT
1098
+ <span class="youtube">
1099
+ <object type="application/x-shockwave-flash" width="$width" height="$height" data="$video_url">
1100
+ <param name="movie" value="$video_url" />
1101
+ <param name="allowFullScreen" value="true" />
1102
+ <param name="wmode" value="transparent" />
1103
+ </object>
1104
+ </span>
1105
+ EOT;
1106
+ }
1107
+ }
1108
+ }
1109
+
1110
+ if ( is_feed() && $context == 'post' ) {
1111
+ if ( $high ) {
1112
+ $high = '&fmt=18';
1113
+ }
1114
+ if ( $playlist )
1115
+ $url='http://www.youtube.com/view_play_list?p=';
1116
+ else
1117
+ $url='http://www.youtube.com/watch?v=';
1118
+
1119
+ if ( $this->options['img'] == 'on' ) {
1120
+ $yte_tag .= '<p><a href="'.$url . $file . $high. '"><img src="http://img.youtube.com/vi/' . $file . '/default.jpg" width="130" height="97" border=0></a></p>';
1121
+ }
1122
+
1123
+ if ( $this->options['link'] == 'on' ) {
1124
+ $yte_tag.='<p><a href="'.$url . $file . $high . '">www.youtube.com/watch?v=' . $file . '</a></p>';
1125
+ }
1126
+ // if ($this->options['link'] == 'off' && $this->options['img'] == 'off')
1127
+ // $yte_tag='http://www.youtube.com/watch?v='.$file;
1128
+ }
1129
+
1130
+ return str_replace( '{video}', $yte_tag, html_entity_decode( $template ) );
1131
+ }
1132
+
1133
+ function tag_metacafe( $context, $file, $high = 'v', $name = '' ) {
1134
+ $width = ( $context == 'excerpt' || $context == 'side' ) ?
1135
+ $this->options['widthside'] :
1136
+ ( $high ? $this->options['widthhq'] : $this->options['width'] );
1137
+
1138
+ $height = ( $context == 'excerpt' || $context == 'side' ) ?
1139
+ $this->options['heightside'] :
1140
+ ( $high ? $this->options['heighthq'] : $this->options['height'] );
1141
+
1142
+ if ( ! $width ) {
1143
+ $width = ! ( $high == 'v' ) ? 480 : 425 ;
1144
+ }
1145
+
1146
+ if ( ! $height ) {
1147
+ $height = ! ( $high == 'v' ) ? 360 : 344;
1148
+ }
1149
+
1150
+ $template = trim( $this->options['template'] ) == '' ? '{video}' : $this->options['template'];
1151
+ $excerpt = $this->options['excerpt'];
1152
+ $thumb = $this->options['thumb'];
1153
+ $colorbox = $this->options['colorbox'];
1154
+ $autoplay = $this->options['autoplay'];
1155
+ $autoplay_first = $this->options['autoplay_first'];
1156
+
1157
+ $ap = 'no';
1158
+ if ( is_single() ) {
1159
+ if ( $context == 'post' && $autoplay_first && ! $this->first ) {
1160
+ $ap = 'yes';
1161
+ $this->first = true;
1162
+ } else if ( ( $context == 'post' && $autoplay && ! $autoplay_first ) || ( $context == 'excerpt' && $autoplay ) ) {
1163
+ $ap = 'yes';
1164
+ } else {
1165
+ $ap = 'no';
1166
+ }
1167
+ } elseif ( $this->first_post_on_archive ) {
1168
+ if ( $context == 'post' && $autoplay_first && ! $this->first ) {
1169
+ $ap = 'yes';
1170
+ $this->first = true;
1171
+ } else if ( ( $context == 'post' && $autoplay && ! $autoplay_first ) || ( $context == 'excerpt' && $autoplay ) ) {
1172
+ $ap = 'yes';
1173
+ } else {
1174
+ $ap = 'no';
1175
+ }
1176
+ }
1177
+
1178
+ $flash_vars = "playerVars=showStats=no|autoPlay=$ap|";
1179
+
1180
+ if ( ( ( is_home() || is_front_page() || is_archive() ) && $context == 'post' && $thumb == 'on' ) || ( $context == 'thumb' ) || ( $context == 'excerpt' && $excerpt == 'thm' ) ) {
1181
+ $img_url = htmlspecialchars( "http://www.metacafe.com/thumb/$file.jpg" );
1182
+ if ( $context == 'excerpt' && $excerpt == 'thm' ) {
1183
+ global $post;
1184
+ $post_url = get_permalink( $post->ID );
1185
+ $yte_tag = <<<EOT
1186
+ <a href="$post_url">
1187
+ <img src="$img_url" height="$height" width="$width" />
1188
+ </a>
1189
+ EOT;
1190
+ } else {
1191
+ $yte_tag = <<<EOT
1192
+ <img src="$img_url" height="$height" width="$width" />
1193
+ EOT;
1194
+ }
1195
+ } else if ( $context == 'post' && $colorbox == 'on' && is_singular() ) {
1196
+ $img_url = htmlspecialchars( "http://www.metacafe.com/thumb/$file.jpg" );
1197
+ $yte_tag = <<<EOT
1198
+ <a class="colorbox_video" href="http://www.metacafe.com/fplayer/$file/$name.swf">
1199
+ <img width="$width" height="$height" src="$img_url" /></iframe>
1200
+ </span>
1201
+ EOT;
1202
+ } else {
1203
+ $yte_tag = <<<EOT
1204
+ <embed flashVars="$flash_vars" src="http://www.metacafe.com/fplayer/$file/$name.swf" width="$width" height="$height" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_6261286" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">
1205
+ </embed>
1206
+ EOT;
1207
+ }
1208
+
1209
+ return str_replace( '{video}', $yte_tag, html_entity_decode( $template ) );
1210
+ }
1211
+
1212
+ function tag_vimeo( $context, $file, $high = 'v', $side = 0 ) {
1213
+ $width = ( $context == 'excerpt' || $context == 'side' ) ?
1214
+ $this->options['widthside'] :
1215
+ ( $high ? $this->options['widthhq'] : $this->options['width'] );
1216
+
1217
+ $height = ( $context == 'excerpt' || $context == 'side' ) ?
1218
+ $this->options['heightside'] :
1219
+ ( $high ? $this->options['heighthq'] : $this->options['height'] );
1220
+
1221
+ if ( ! $width ) {
1222
+ $width = ! ( $high == 'v' ) ? 480 : 425 ;
1223
+ }
1224
+
1225
+ if ( ! $height ) {
1226
+ $height = ! ( $high == 'v' ) ? 360 : 344;
1227
+ }
1228
+
1229
+ $template = trim( $this->options['template'] ) == '' ? '{video}' : $this->options['template'];
1230
+ $excerpt = $this->options['excerpt'];
1231
+ $thumb = $this->options['thumb'];
1232
+ $colorbox = $this->options['colorbox'];
1233
+ $autoplay = $this->options['autoplay'];
1234
+ $autoplay_first = $this->options['autoplay_first'];
1235
+ $loop = $this->options['loop'];
1236
+
1237
+ $video_url = "http://player.vimeo.com/video/$file";
1238
+
1239
+ if ( $context == 'post' && $autoplay_first && ! $this->first ) {
1240
+ if ( is_single() ) {
1241
+ $video_url .= "?autoplay=1";
1242
+ } elseif ( $this->first_post_on_archive ) {
1243
+ $video_url .= "?autoplay=1";
1244
+ }
1245
+ if ( $loop ) {
1246
+ $video_url .= "&amp;loop=1";
1247
+ }
1248
+ $this->first = true;
1249
+ } else if ( ( $context == 'post' && $autoplay && ! $autoplay_first ) || ( $context == 'excerpt' && $autoplay ) ) {
1250
+ if ( is_single() ) {
1251
+ $video_url .= "?autoplay=1";
1252
+ } elseif ( $this->first_post_on_archive ) {
1253
+ $video_url .= "?autoplay=1";
1254
+ }
1255
+ if ( $loop ) {
1256
+ $video_url .= "&amp;loop=1";
1257
+ }
1258
+ } else {
1259
+ if ( $loop ) {
1260
+ $video_url .= "?loop=1";
1261
+ }
1262
+ }
1263
+
1264
+ if ( ( ( is_home() || is_front_page() || is_archive() ) && $context == 'post' && $thumb == 'on' ) || ( $context == 'thumb' ) || ( $context == 'excerpt' && $excerpt == 'thm' ) ) {
1265
+ $thumbs = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$file.php"));
1266
+ $img_url = htmlspecialchars($thumbs[0]['thumbnail_large']);
1267
+ if ( $context == 'excerpt' && $excerpt == 'thm' ) {
1268
+ global $post;
1269
+ $post_url = get_permalink( $post->ID );
1270
+ $yte_tag = <<<EOT
1271
+ <a href="$post_url">
1272
+ <img src="$img_url" height="$height" width="$width" />
1273
+ </a>
1274
+ EOT;
1275
+ } else {
1276
+ $yte_tag = <<<EOT
1277
+ <img src="$img_url" height="$height" width="$width" />
1278
+ EOT;
1279
+ }
1280
+ }
1281
+ else if ( $context == 'post' && $colorbox == 'on' && is_singular() ) {
1282
+ $thumbs = unserialize( file_get_contents( "http://vimeo.com/api/v2/video/$file.php" ) );
1283
+ $img_url = htmlspecialchars( $thumbs[0]['thumbnail_large'] );
1284
+ $yte_tag = <<<EOT
1285
+ <a class="colorbox_video" href="$video_url">
1286
+ <img width="$width" height="$height" src="$img_url" /></iframe>
1287
+ </span>
1288
+ EOT;
1289
+ } else {
1290
+ $yte_tag = <<<EOT
1291
+ <iframe src="$video_url" width="$width" height="$height" frameborder="0"></iframe>
1292
+ EOT;
1293
+ }
1294
+
1295
+ return str_replace( '{video}', $yte_tag, html_entity_decode( $template ) );
1296
+ }
1297
+
1298
+ function tag_liveleak( $context, $file, $high = 'v', $side = 0 ) {
1299
+ $width = ( $context == 'excerpt' || $context == 'side' ) ?
1300
+ $this->options['widthside'] :
1301
+ ( $high ? $this->options['widthhq'] : $this->options['width'] );
1302
+
1303
+ $height = ( $context == 'excerpt' || $context == 'side' ) ?
1304
+ $this->options['heightside'] :
1305
+ ( $high ? $this->options['heighthq'] : $this->options['height'] );
1306
+
1307
+ if ( ! $width ) {
1308
+ $width = ! ( $high == 'v' ) ? 480 : 425 ;
1309
+ }
1310
+
1311
+ if ( ! $height ) {
1312
+ $height = ! ( $high == 'v' ) ? 360 : 344;
1313
+ }
1314
+
1315
+ $template = trim($this->options['template']) == '' ? '{video}' : $this->options['template'];
1316
+ $thumb = $this->options['thumb'];
1317
+ $colorbox = $this->options['colorbox'];
1318
+ $excerpt = $this->options['excerpt'];
1319
+
1320
+ if ( ( ( is_home() || is_front_page() || is_archive() ) && $context == 'post' && $thumb == 'on' ) || ( $context == 'thumb' ) || ( $context == 'excerpt' && $excerpt == 'thm' ) ) {
1321
+ $img_url = htmlspecialchars( $this->plugin_url . '/img/default.jpg' );
1322
+ if ( $context == 'excerpt' && $excerpt == 'thm' ) {
1323
+ global $post;
1324
+ $post_url = get_permalink( $post->ID );
1325
+ $yte_tag = <<<EOT
1326
+ <a href="$post_url">
1327
+ <img src="$img_url" height="$height" width="$width" />
1328
+ </a>
1329
+ EOT;
1330
+ } else {
1331
+ $yte_tag = <<<EOT
1332
+ <img src="$img_url" height="$height" width="$width" />
1333
+ EOT;
1334
+ }
1335
+ } else if ( $context == 'post' && $colorbox == 'on' && is_singular() ) {
1336
+ $img_url = htmlspecialchars( $this->plugin_url . '/img/default.jpg' );
1337
+ $yte_tag = <<<EOT
1338
+ <a class="colorbox_video" href="http://www.liveleak.com/e/$file">
1339
+ <img width="$width" height="$height" src="$img_url" /></iframe>
1340
+ </span>
1341
+ EOT;
1342
+ } else {
1343
+ $yte_tag = <<<EOT
1344
+ <object width="$width" height="$height">
1345
+ <param name="movie" value="http://www.liveleak.com/e/$file"></param>
1346
+ <param name="wmode" value="transparent"></param><param name="allowscriptaccess" value="always"></param>
1347
+ <embed src="http://www.liveleak.com/e/$file" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" width="$width" height="$height"></embed>
1348
+ </object>
1349
+ EOT;
1350
+ }
1351
+
1352
+ return str_replace( '{video}', $yte_tag, html_entity_decode( $template ) );
1353
+ }
1354
+
1355
+ function tag_facebook( $context, $file, $high = 'v', $side = 0 ) {
1356
+ $width = ( $context == 'excerpt' || $context == 'side' ) ?
1357
+ $this->options['widthside'] :
1358
+ ( $high ? $this->options['widthhq'] : $this->options['width'] );
1359
+
1360
+ $height = ( $context == 'excerpt' || $context == 'side' ) ?
1361
+ $this->options['heightside'] :
1362
+ ( $high ? $this->options['heighthq'] : $this->options['height'] );
1363
+
1364
+ if ( ! $width ) {
1365
+ $width = ! ( $high == 'v' ) ? 480 : 425 ;
1366
+ }
1367
+
1368
+ if ( ! $height ) {
1369
+ $height = ! ( $high == 'v' ) ? 360 : 344;
1370
+ }
1371
+
1372
+ $template = trim($this->options['template']) == '' ? '{video}' : $this->options['template'];
1373
+ $thumb = $this->options['thumb'];
1374
+ $colorbox = $this->options['colorbox'];
1375
+ $excerpt = $this->options['excerpt'];
1376
+
1377
+ if ( ( ( is_home() || is_front_page() || is_archive() ) && $context == 'post' && $thumb == 'on' ) || ( $context == 'thumb' ) || ( $context == 'excerpt' && $excerpt == 'thm' ) ) {
1378
+ $img_url = htmlspecialchars( $this->plugin_url . '/img/default.jpg' );
1379
+ if ( $context == 'excerpt' && $excerpt == 'thm' ) {
1380
+ global $post;
1381
+ $post_url = get_permalink( $post->ID );
1382
+ $yte_tag = <<<EOT
1383
+ <a href="$post_url">
1384
+ <img src="$img_url" height="$height" width="$width" />
1385
+ </a>
1386
+ EOT;
1387
+ } else {
1388
+ $yte_tag = <<<EOT
1389
+ <img src="$img_url" height="$height" width="$width" />
1390
+ EOT;
1391
+ }
1392
+ } else if ( $context == 'post' && $colorbox == 'on' && is_singular() ) {
1393
+ $img_url = htmlspecialchars( $this->plugin_url . '/img/default.jpg' );
1394
+ $yte_tag = <<<EOT
1395
+ <a class="colorbox_video" href="http://www.facebook.com/v/$file">
1396
+ <img width="$width" height="$height" src="$img_url" /></iframe>
1397
+ </span>
1398
+ EOT;
1399
+ } else {
1400
+ $yte_tag = <<<EOT
1401
+ <object width="$width" height="$height">
1402
+ <param name="allowfullscreen" value="true" />
1403
+ <param name="allowscriptaccess" value="always" />
1404
+ <param name="movie" value="http://www.facebook.com/v/$file" />
1405
+ <embed src="http://www.facebook.com/v/$file" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="$width" height="$height">
1406
+ </embed>
1407
+ </object>
1408
+ EOT;
1409
+ }
1410
+
1411
+ return str_replace( '{video}', $yte_tag, html_entity_decode( $template ) );
1412
+ }
1413
+
1414
+ function install() {
1415
+ add_action( 'widgets_init', array( $this, 'load_widgets' ) );
1416
+
1417
+ if ( get_option( $this->key ) ) {
1418
+ $this->options = $this->get_options();
1419
+ }
1420
+ }
1421
+
1422
+ // Handle our options
1423
+ function get_options() {
1424
+ $options = array(
1425
+ 'posts' => 'on',
1426
+ 'comments' => 'off',
1427
+ 'img' => 'off',
1428
+ 'width' => 425,
1429
+ 'height' => 344,
1430
+ 'widthhq' => 480,
1431
+ 'heighthq' => 295,
1432
+ 'widthside' => 150,
1433
+ 'heightside' => 125,
1434
+ 'rel' => 1,
1435
+ 'link' => 'on',
1436
+ 'valid' => 'off',
1437
+ 'search' => 'off',
1438
+ 'info' => 'on',
1439
+ 'ann' => 'on',
1440
+ 'template' => '{video}',
1441
+ 'autoplay' => 0,
1442
+ 'autoplay_first' => 0,
1443
+ 'privacy' => 0,
1444
+ 'wtext' => '',
1445
+ 'wtitle' => '',
1446
+ 'tag' => '',
1447
+ 'iframe' => 'on',
1448
+ 'http' => 'off',
1449
+ 'www' => 'off',
1450
+ 'loop' => 0,
1451
+ 'thumb' => 'off',
1452
+ 'colorbox' => 'off',
1453
+ 'colorbox_theme' => 1,
1454
+ 'excerpt' => 'thm',
1455
+ 'excerpt_thumb' => 'left',
1456
+ 'logoless' => 'on',
1457
+ 'wiziapp' => 'off',
1458
+ 'teheme' => 'dark'
1459
+ );
1460
+ $saved = get_option( $this->key );
1461
+
1462
+ if ( ! empty( $saved ) ) {
1463
+ foreach ( $saved as $key => $option ) {
1464
+ $options[$key] = $option;
1465
+ }
1466
+ }
1467
+
1468
+ if ( $saved != $options ) {
1469
+ update_option( $this->key, $options );
1470
+ }
1471
+
1472
+ return $options;
1473
+ }
1474
+
1475
+ function load_widgets() {
1476
+ register_widget( 'SmartYouTube_Widget' );
1477
+ }
1478
+
1479
+ /**
1480
+ * Gets plugin info from WordPress Codex repo
1481
+ * @return mixed
1482
+ */
1483
+ function get_info() {
1484
+ $checkfile = 'http://svn.wp-plugins.org/smart-youtube/trunk/smartyoutube.chk';
1485
+
1486
+ $status = array();
1487
+
1488
+ return $status; //???
1489
+
1490
+ $vcheck = wp_remote_fopen( $checkfile );
1491
+
1492
+ if ( $vcheck ) {
1493
+ $version = $this->local_version;
1494
+
1495
+ $status = explode( '@', $vcheck );
1496
+ return $status;
1497
+ }
1498
+ }
1499
+ }
1500
+
1501
+ class SmartYouTube_Widget extends WP_Widget {
1502
+ function SmartYouTube_Widget() {
1503
+ $widget_ops = array( 'classname' => 'smart-youtube', 'description' => 'A widget which dispalys some video from Youtube.' );
1504
+ $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'smart-youtube' );
1505
+ $this->WP_Widget( 'smart-youtube', 'Smart Youtube', $widget_ops, $control_ops );
1506
+ }
1507
+
1508
+ function widget( $args, $instance ) {
1509
+ extract( $args );
1510
+ $text = smart_youtube_check( $instance['text'], 1 );
1511
+ $title = $instance['title'];
1512
+
1513
+ echo
1514
+ $before_widget,
1515
+ $before_title, $title, $after_title,
1516
+ $text,
1517
+ $after_widget;
1518
+ }
1519
+
1520
+ function update( $new_instance, $old_instance ) {
1521
+ $instance = $old_instance;
1522
+
1523
+ $instance['text'] = strip_tags( $new_instance['text'] );
1524
+ $instance['title'] = strip_tags( $new_instance['title'] );
1525
+ return $instance;
1526
+ }
1527
+
1528
+ function form( $instance ) {
1529
+ $defaults = array( 'title' => 'Smart Youtube Widget', 'text' => '' );
1530
+ $instance = wp_parse_args( ( array )$instance, $defaults );
1531
+ ?>
1532
+ <?php _e('Title:', 'smart-youtube'); ?><br /><input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" /><br />
1533
+ <?php _e('Insert HTML code below. In addition to normal text you may use httpv, httpvh and httpvhd links just like in your posts.'); ?><br />
1534
+ <textarea id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>" rows="10" cols="16" class="widefat"><?php echo $instance['text']; ?></textarea>
1535
+ <?php
1536
+ }
1537
+ }
1538
+
1539
+ function smart_youtube_check( $the_content, $side = 0 ) {
1540
+ global $smart_youtube_pro;
1541
+ return $smart_youtube_pro->check( $the_content, $side );
1542
+ }
1543
+
1544
+ function syt_show_thumb( $post_id ) {
1545
+ $p = get_post( $post_id );
1546
+ $content = $p->post_content;
1547
+
1548
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtube\.com\/watch(\?v\=|\/v\/|#!v=)([a-zA-Z0-9\-\_]{11})([^<\s]*)/", $content, $matches['youtube.com'], PREG_SET_ORDER );
1549
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?youtu\.be\/([a-zA-Z0-9\-\_]{11})/", $content, $matches['youtu.be'], PREG_SET_ORDER );
1550
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?metacafe\.com\/watch\/([a-zA-Z0-9\-\_]{7})\/([^<^\/\s]*)([\/])?/", $content, $matches['metacafe.com'], PREG_SET_ORDER );
1551
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?vimeo\.com\/([a-zA-Z0-9\-\_]{8})([\/])?/", $content, $matches['vimeo.com'], PREG_SET_ORDER );
1552
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?liveleak\.com\/view(\?i\=)([a-zA-Z0-9\-\_]*)/", $content, $matches['liveleak.com'], PREG_SET_ORDER );
1553
+ preg_match_all( "/(http(v|vh|vhd)?:\/\/)?([a-zA-Z0-9\-\_]+\.|)?facebook\.com\/video\/video.php\?v\=([a-zA-Z0-9\-\_]*)/", $content, $matches['facebook.com'], PREG_SET_ORDER );
1554
+
1555
+ global $smart_youtube_pro;
1556
+
1557
+ if ( isset( $matches['youtube.com'][0] ) ) {
1558
+ if ( ( $matches['youtube.com'][0][1] == 'http://' && $smart_youtube_pro->options['http'] == 'on' ) || ( $matches['youtube.com'][0][1] == '' && $smart_youtube_pro->options['www'] == 'on' ) ) {
1559
+ $matches['youtube.com'][0][0] = str_replace( $matches['youtube.com'][0][0], $smart_youtube_pro->tag_youtube( 'excerpt', $matches['youtube.com'][0][5], 'v', $matches['youtube.com'][0][6] ), $matches['youtube.com'][0][0] );
1560
+ } else if ( $matches['youtube.com'][0][2] == 'v' || $matches['youtube.com'][0][2] == 'vh' || $matches['youtube.com'][0][2] == 'vhd' ) {
1561
+ $matches['youtube.com'][0][0] = str_replace( $matches['youtube.com'][0][0], $smart_youtube_pro->tag_youtube( 'excerpt', $matches['youtube.com'][0][5], $matches['youtube.com'][0][2], $matches['youtube.com'][0][6] ), $matches['youtube.com'][0][0] );
1562
+ }
1563
+ $result = $matches['youtube.com'][0][0];
1564
+ } else if ( isset( $matches['youtu.be'][0] ) ) {
1565
+ if ( ( $matches['youtu.be'][0][1] == 'http://' && $smart_youtube_pro->options['http'] == 'on' ) || ( $matches['youtu.be'][0][1] == '' && $smart_youtube_pro->options['www'] == 'on' ) ) {
1566
+ $matches['youtu.be'][0][0] = str_replace( $matches['youtu.be'][0][0], $smart_youtube_pro->tag_youtube( 'excerpt', $matches['youtu.be'][0][4], 'v' ), $matches['youtu.be'][0][0] );
1567
+ } else if ( $matches['youtu.be'][0][2] == 'v' || $matches['youtu.be'][0][2] == 'vh' || $matches['youtu.be'][0][2] == 'vhd' ) {
1568
+ $matches['youtu.be'][0][0] = str_replace( $matches['youtu.be'][0][0], $smart_youtube_pro->tag_youtube( 'excerpt', $matches['youtu.be'][0][4], $matches['youtu.be'][0][2]), $matches['youtu.be'][0][0] );
1569
+ }
1570
+ $result = $matches['youtu.be'][0][0];
1571
+ } else if ( isset( $matches['metacafe.com'][0] ) ) {
1572
+ if ( ( $matches['metacafe.com'][0][1] == 'http://' && $smart_youtube_pro->options['http'] == 'on' ) || ( $matches['metacafe.com'][0][1] == '' && $smart_youtube_pro->options['www'] == 'on' ) ) {
1573
+ $matches['metacafe.com'][0][0] = str_replace( $matches['metacafe.com'][0][0], $smart_youtube_pro->tag_metacafe( 'excerpt', $matches['metacafe.com'][0][4], 'v', $matches['metacafe.com'][0][5] ), $matches['metacafe.com'][0][0] );
1574
+ } else if ( $matches['metacafe.com'][0][2] == 'v' || $matches['metacafe.com'][0][2] == 'vh' || $matches['metacafe.com'][0][2] == 'vhd' ) {
1575
+ $matches['metacafe.com'][0][0] = str_replace( $matches['metacafe.com'][0][0], $smart_youtube_pro->tag_metacafe( 'excerpt', $matches['metacafe.com'][0][4], $matches['metacafe.com'][0][2], $matches['metacafe.com'][0][5] ), $matches['metacafe.com'][0][0] );
1576
+ }
1577
+ $result = $matches['metacafe.com'][0][0];
1578
+ } else if ( isset($matches['vimeo.com'][0] ) ) {
1579
+ if ( ( $matches['vimeo.com'][0][1] == 'http://' && $smart_youtube_pro->options['http'] == 'on' ) || ( $matches['vimeo.com'][0][1] == '' && $smart_youtube_pro->options['www'] == 'on' ) ) {
1580
+ $matches['vimeo.com'][0][0] = str_replace( $matches['vimeo.com'][0][0], $smart_youtube_pro->tag_vimeo( 'excerpt', $matches['vimeo.com'][0][4], 'v' ), $matches['vimeo.com'][0][0] );
1581
+ }
1582
+ else if ( $matches['vimeo.com'][0][2] == 'v' || $matches['vimeo.com'][0][2] == 'vh' || $matches['vimeo.com'][0][2] == 'vhd' ) {
1583
+ $matches['vimeo.com'][0][0] = str_replace( $matches['vimeo.com'][0][0], $smart_youtube_pro->tag_vimeo( 'excerpt', $matches['vimeo.com'][0][4], $matches['vimeo.com'][0][2] ), $matches['vimeo.com'][0][0] );
1584
+ }
1585
+ $result = $matches['vimeo.com'][0][0];
1586
+ } else if ( isset( $matches['liveleak.com'][0] ) ) {
1587
+ if ( ( $matches['liveleak.com'][0][1] == 'http://' && $smart_youtube_pro->options['http'] == 'on' ) || ( $matches['liveleak.com'][0][1] == '' && $smart_youtube_pro->options['www'] == 'on' ) ) {
1588
+ $matches['liveleak.com'][0][0] = str_replace( $matches['liveleak.com'][0][0], $smart_youtube_pro->tag_liveleak( 'excerpt', $matches['liveleak.com'][0][4], 'v' ), $matches['liveleak.com'][0][0] );
1589
+ } else if ( $matches['liveleak.com'][0][2] == 'v' || $matches['liveleak.com'][0][2] == 'vh' || $matches['liveleak.com'][0][2] == 'vhd' ) {
1590
+ $matches['liveleak.com'][0][0] = str_replace( $matches['liveleak.com'][0][0], $smart_youtube_pro->tag__liveleak( 'excerpt', $matches['liveleak.com'][0][4], $matches['liveleak.com'][0][2] ), $matches['liveleak.com'][0][0] );
1591
+ }
1592
+ $result = $matches['liveleak.com'][0][0];
1593
+ } else if ( isset( $matches['facebook.com'][0] ) ) {
1594
+ if ( ( $matches['facebook.com'][0][1] == 'http://' && $smart_youtube_pro->options['http'] == 'on' ) || ( $matches['facebook.com'][0][1] == '' && $smart_youtube_pro->options['www'] == 'on' ) ) {
1595
+ $matches['facebook.com'][0][0] = str_replace( $matches['facebook.com'][0][0], $smart_youtube_pro->tag_facebook( 'excerpt', $matches['facebook.com'][0][4], 'v' ), $matches['facebook.com'][0][0] );
1596
+ } else if ( $matches['facebook.com'][0][2] == 'v' || $matches['facebook.com'][0][2] == 'vh' || $matches['facebook.com'][0][2] == 'vhd' ) {
1597
+ $matches['facebook.com'][0][0] = str_replace( $matches['facebook.com'][0][0], $smart_youtube_pro->tag_facebook( 'excerpt', $matches['facebook.com'][0][4], $matches['facebook.com'][0][2] ), $matches['facebook.com'][0][0] );
1598
+ }
1599
+ $result = $matches['facebook.com'][0][0];
1600
+ } else {
1601
+ $width = $smart_youtube_pro->options['width'];
1602
+ $height = $smart_youtube_pro->options['height'];
1603
+
1604
+ $img_url = htmlspecialchars( $smart_youtube_pro->plugin_url . '/img/default.jpg' );
1605
+ $post_url = get_permalink( $post->ID );
1606
+ $yte_tag = <<<EOT
1607
+ <a href="$post_url">
1608
+ <img src="$img_url" height="$height" width="$width" />
1609
+ </a>
1610
+ EOT;
1611
+ $result = str_replace( '{video}', $yte_tag, html_entity_decode( $template ) );
1612
+ }
1613
+ if ( isset( $result ) ) {
1614
+ return $result;
1615
+ }
1616
+ }
1617
+ ?>
themes/theme1/colorbox.css ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative; overflow:hidden;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ Example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:url(images/overlay.png) 0 0 repeat;}
22
+ #colorbox{font: 12px Tahoma, Arial,sans-serif;}
23
+ #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) -100px 0 no-repeat;}
24
+ #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) -129px 0 no-repeat;}
25
+ #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) -100px -29px no-repeat;}
26
+ #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) -129px -29px no-repeat;}
27
+ #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
28
+ #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
29
+ #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
30
+ #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
31
+ #cboxContent{background:#fff;}
32
+ #cboxLoadedContent{margin-bottom:28px;}
33
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
34
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
35
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
36
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) -75px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
37
+ #cboxPrevious.hover{background-position:-75px -25px;}
38
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) -50px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
39
+ #cboxNext.hover{background-position:-50px -25px;}
40
+ #cboxLoadingOverlay{background:url(images/loading_background.png) center center no-repeat;}
41
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
42
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) -25px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
43
+ #cboxClose.hover{background-position:-25px -25px;}
themes/theme1/images/border.png ADDED
Binary file
themes/theme1/images/controls.png ADDED
Binary file
themes/theme1/images/internet_explorer/borderBottomCenter.png ADDED
Binary file
themes/theme1/images/internet_explorer/borderBottomLeft.png ADDED
Binary file
themes/theme1/images/internet_explorer/borderBottomRight.png ADDED
Binary file
themes/theme1/images/internet_explorer/borderMiddleLeft.png ADDED
Binary file
themes/theme1/images/internet_explorer/borderMiddleRight.png ADDED
Binary file
themes/theme1/images/internet_explorer/borderTopCenter.png ADDED
Binary file
themes/theme1/images/internet_explorer/borderTopLeft.png ADDED
Binary file
themes/theme1/images/internet_explorer/borderTopRight.png ADDED
Binary file
themes/theme1/images/loading.gif ADDED
Binary file
themes/theme1/images/loading_background.png ADDED
Binary file
themes/theme1/images/overlay.png ADDED
Binary file
themes/theme10/colorbox.css ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative; overflow:hidden;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ ColorBox example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:#000;}
22
+
23
+ #colorbox{font: 12px Tahoma, Arial,sans-serif;}
24
+ #cboxContent{margin-top:20px;}
25
+ #cboxLoadedContent{background:#fff; padding:10px 10px 34px; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px;}
26
+ #cboxTitle{overflow:auto; position:absolute; bottom:12px; left:10px; text-align:center; color:#555; word-wrap: break-word; font-size:0.9em; border: 1px solid #ccc; max-width:40%; background:#fff; padding:1px 7px; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; box-shadow: 1px 1px 3px #888; -moz-box-shadow: 1px 1px 3px #888; -webkit-box-shadow: 1px 1px 3px #888;}
27
+ #cboxCurrent{position:absolute; bottom:11px; right:36px; color:#333; font-weight:bold; padding:1px 7px; border: 1px solid #ccc; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; box-shadow: 1px 1px 3px #888; -moz-box-shadow: 1px 1px 3px #888; -webkit-box-shadow: 1px 1px 3px #888;}
28
+ #cboxSlideshow{position:absolute; bottom:11px; right:150px; color:#eee; overflow:visible; border: 1px solid #555; background:#666; padding:1px 7px; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; box-shadow: 1px 1px 3px #888; -moz-box-shadow: 1px 1px 3px #888; -webkit-box-shadow: 1px 1px 3px #888;}
29
+ #cboxPrevious{opacity:0.5;filter:alpha(opacity=50);position:absolute; top:36%; left:10px; margin-top:-32px; background:url(images/prev.png) no-repeat; width:64px; height:32px; text-indent:-9999px;}
30
+ #cboxPrevious.hover{opacity:1;filter:alpha(opacity=100);background-position:bottom left;}
31
+ #cboxNext{opacity:0.5;filter:alpha(opacity=50);position:absolute; top:36%; right:10px; margin-top:-32px; background:url(images/next.png) top right no-repeat; width:64px; height:32px; text-indent:-9999px;}
32
+ #cboxNext.hover{opacity:1;filter:alpha(opacity=100);}
33
+ #cboxLoadingOverlay{background:#fff; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px;}
34
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
35
+ #cboxClose{opacity:0.5;filter:alpha(opacity=50);position:absolute; bottom:10px; right:10px; display:block; background:url(images/close.png) no-repeat; width:22px; height:22px; text-indent:-9999px;}
36
+ #cboxClose.hover{opacity:1;filter:alpha(opacity=100);}
themes/theme10/images/close.png ADDED
Binary file
themes/theme10/images/loading.gif ADDED
Binary file
themes/theme10/images/next.png ADDED
Binary file
themes/theme10/images/prev.png ADDED
Binary file
themes/theme11/colorbox.css ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative; overflow:hidden;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ Example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:#fff;}
22
+ #colorbox{font: 12px Tahoma, Arial,sans-serif;}
23
+ #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) -100px 0 no-repeat;}
24
+ #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) -129px 0 no-repeat;}
25
+ #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) -100px -29px no-repeat;}
26
+ #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) -129px -29px no-repeat;}
27
+ #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
28
+ #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
29
+ #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
30
+ #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
31
+ #cboxContent{background:#fff;}
32
+ #cboxLoadedContent{margin-bottom:28px;}
33
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
34
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
35
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
36
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) -75px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
37
+ #cboxPrevious.hover{background-position:-75px -25px;}
38
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) -50px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
39
+ #cboxNext.hover{background-position:-50px -25px;}
40
+ #cboxLoadingOverlay{background:url(images/loading_background.png) center center no-repeat;}
41
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
42
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) -25px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
43
+ #cboxClose.hover{background-position:-25px -25px;}
themes/theme11/images/border.png ADDED
Binary file
themes/theme11/images/controls.png ADDED
Binary file
themes/theme11/images/internet_explorer/borderBottomCenter.png ADDED
Binary file
themes/theme11/images/internet_explorer/borderBottomLeft.png ADDED
Binary file
themes/theme11/images/internet_explorer/borderBottomRight.png ADDED
Binary file
themes/theme11/images/internet_explorer/borderMiddleLeft.png ADDED
Binary file
themes/theme11/images/internet_explorer/borderMiddleRight.png ADDED
Binary file
themes/theme11/images/internet_explorer/borderTopCenter.png ADDED
Binary file
themes/theme11/images/internet_explorer/borderTopLeft.png ADDED
Binary file
themes/theme11/images/internet_explorer/borderTopRight.png ADDED
Binary file
themes/theme11/images/loading.gif ADDED
Binary file
themes/theme11/images/loading_background.png ADDED
Binary file
themes/theme11/images/overlay.png ADDED
Binary file
themes/theme2/colorbox.css ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative; overflow:visible;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ ColorBox example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:#fff;}
22
+
23
+ #colorbox{font: 12px Tahoma, Arial,sans-serif;}
24
+ #cboxContent{margin-top:32px;}
25
+ #cboxLoadedContent{background:#000; padding:1px;}
26
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
27
+ #cboxLoadingOverlay{background:#000;}
28
+ #cboxTitle{position:absolute; top:-22px; left:0; color:#000;}
29
+ #cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;}
30
+ #cboxSlideshow, #cboxPrevious, #cboxNext, #cboxClose{text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(images/controls.png) 0 0 no-repeat;}
31
+ #cboxPrevious{background-position:0 0; right:44px;}
32
+ #cboxPrevious.hover{background-position:0 -25px;}
33
+ #cboxNext{background-position:-25px 0; right:22px;}
34
+ #cboxNext.hover{background-position:-25px -25px;}
35
+ #cboxClose{background-position:-50px 0; right:0;}
36
+ #cboxClose.hover{background-position:-50px -25px;}
37
+ .cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;}
38
+ .cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;}
39
+ .cboxSlideshow_on #cboxSlideshow.hover{background-position:-100px -25px;}
40
+ .cboxSlideshow_off #cboxSlideshow{background-position:-100px 0; right:44px;}
41
+ .cboxSlideshow_off #cboxSlideshow.hover{background-position:-75px -25px;}
themes/theme2/images/controls.png ADDED
Binary file
themes/theme2/images/loading.gif ADDED
Binary file
themes/theme3/colorbox.css ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ ColorBox example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:#000;}
22
+
23
+ #colorbox{font: 12px Tahoma, Arial,sans-serif;}
24
+ #cboxContent{margin-top:20px;}
25
+ #cboxLoadedContent{background:#000; padding:5px;}
26
+ #cboxTitle{position:absolute; top:-20px; left:0; color:#ccc;}
27
+ #cboxCurrent{position:absolute; top:-20px; right:0; color:#ccc;}
28
+ #cboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;}
29
+ #cboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(images/controls.png) top left no-repeat; width:28px; height:65px; text-indent:-9999px;}
30
+ #cboxPrevious.hover{background-position:bottom left;}
31
+ #cboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(images/controls.png) top right no-repeat; width:28px; height:65px; text-indent:-9999px;}
32
+ #cboxNext.hover{background-position:bottom right;}
33
+ #cboxLoadingOverlay{background:#000;}
34
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
35
+ #cboxClose{position:absolute; top:5px; right:5px; display:block; background:url(images/controls.png) top center no-repeat; width:38px; height:19px; text-indent:-9999px;}
36
+ #cboxClose.hover{background-position:bottom center;}
themes/theme3/images/controls.png ADDED
Binary file
themes/theme3/images/loading.gif ADDED
Binary file
themes/theme4/colorbox.css ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative; overflow:hidden;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ ColorBox example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:#fff;}
22
+
23
+ #colorBox{font: 12px Tahoma, Arial,sans-serif;}
24
+ #cboxTopLeft{width:25px; height:25px; background:url(images/border1.png) 0 0 no-repeat;}
25
+ #cboxTopCenter{height:25px; background:url(images/border1.png) 0 -50px repeat-x;}
26
+ #cboxTopRight{width:25px; height:25px; background:url(images/border1.png) -25px 0 no-repeat;}
27
+ #cboxBottomLeft{width:25px; height:25px; background:url(images/border1.png) 0 -25px no-repeat;}
28
+ #cboxBottomCenter{height:25px; background:url(images/border1.png) 0 -75px repeat-x;}
29
+ #cboxBottomRight{width:25px; height:25px; background:url(images/border1.png) -25px -25px no-repeat;}
30
+ #cboxMiddleLeft{width:25px; background:url(images/border2.png) 0 0 repeat-y;}
31
+ #cboxMiddleRight{width:25px; background:url(images/border2.png) -25px 0 repeat-y;}
32
+ #cboxContent{background:#fff;}
33
+ #cboxLoadedContent{margin-bottom:20px;}
34
+ #cboxTitle{position:absolute; bottom:0; left:0; text-align:center; width:100%; color:#999;}
35
+ #cboxCurrent{position:absolute; bottom:0; left:100px; color:#999;}
36
+ #cboxSlideshow{position:absolute; bottom:0; right:70px; color:#444;}
37
+ #cboxPrevious{position:absolute; bottom:0; left:0; color:#444;}
38
+ #cboxNext{position:absolute; bottom:0; left:63px; color:#444;}
39
+ #cboxLoadingOverlay{background:url(images/loading.gif) 5px 5px no-repeat #fff;}
40
+ #cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}
themes/theme4/images/border1.png ADDED
Binary file
themes/theme4/images/border2.png ADDED
Binary file
themes/theme4/images/internet_explorer/borderBottomCenter.png ADDED
Binary file
themes/theme4/images/internet_explorer/borderBottomLeft.png ADDED
Binary file
themes/theme4/images/internet_explorer/borderBottomRight.png ADDED
Binary file
themes/theme4/images/internet_explorer/borderMiddleLeft.png ADDED
Binary file
themes/theme4/images/internet_explorer/borderMiddleRight.png ADDED
Binary file
themes/theme4/images/internet_explorer/borderTopCenter.png ADDED
Binary file
themes/theme4/images/internet_explorer/borderTopLeft.png ADDED
Binary file
themes/theme4/images/internet_explorer/borderTopRight.png ADDED
Binary file
themes/theme4/images/loading.gif ADDED
Binary file
themes/theme5/colorbox.css ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative; overflow:visible;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ ColorBox example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:#000;}
22
+
23
+ #colorbox{font: 12px Tahoma, Arial,sans-serif;}
24
+ #cboxTopLeft{width:14px; height:14px; background:url(images/controls.png) 0 0 no-repeat;}
25
+ #cboxTopCenter{height:14px; background:url(images/border.png) top left repeat-x;}
26
+ #cboxTopRight{width:14px; height:14px; background:url(images/controls.png) -36px 0 no-repeat;}
27
+ #cboxBottomLeft{width:14px; height:43px; background:url(images/controls.png) 0 -32px no-repeat;}
28
+ #cboxBottomCenter{height:43px; background:url(images/border.png) bottom left repeat-x;}
29
+ #cboxBottomRight{width:14px; height:43px; background:url(images/controls.png) -36px -32px no-repeat;}
30
+ #cboxMiddleLeft{width:14px; background:url(images/controls.png) -175px 0 repeat-y;}
31
+ #cboxMiddleRight{width:14px; background:url(images/controls.png) -211px 0 repeat-y;}
32
+ #cboxContent{background:#fff;}
33
+ #cboxLoadedContent{margin-bottom:5px;}
34
+ #cboxLoadingOverlay{background:url(images/loading_background.png) center center no-repeat;}
35
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
36
+ #cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
37
+ #cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
38
+
39
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{position:absolute; bottom:-29px; background:url(images/controls.png) 0 0 no-repeat; width:23px; height:23px; text-indent:-9999px;}
40
+ #cboxPrevious{left:0; background-position: -51px -25px;}
41
+ #cboxPrevious.hover{background-position:-51px 0;}
42
+ #cboxNext{left:27px; background-position:-75px -25px;}
43
+ #cboxNext.hover{background-position:-75px 0;}
44
+ #cboxClose{right:0; background-position:-100px -25px;}
45
+ #cboxClose.hover{background-position:-100px 0;}
46
+
47
+ .cboxSlideshow_on #cboxSlideshow{background-position:-125px 0; right:27px;}
48
+ .cboxSlideshow_on #cboxSlideshow.hover{background-position:-150px 0;}
49
+ .cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;}
50
+ .cboxSlideshow_off #cboxSlideshow.hover{background-position:-125px 0;}
themes/theme5/images/border.png ADDED
Binary file
themes/theme5/images/controls.png ADDED
Binary file
themes/theme5/images/loading.gif ADDED
Binary file
themes/theme5/images/loading_background.png ADDED
Binary file
themes/theme6/colorbox.css ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative; overflow:hidden;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ Example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:url(images/overlay.png) 0 0 repeat;}
22
+ #colorbox{font: 12px Tahoma, Arial,sans-serif;}
23
+ #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) -100px 0 no-repeat;}
24
+ #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) -129px 0 no-repeat;}
25
+ #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) -100px -29px no-repeat;}
26
+ #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) -129px -29px no-repeat;}
27
+ #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
28
+ #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
29
+ #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
30
+ #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
31
+ #cboxContent{background:#fff;}
32
+ #cboxLoadedContent{margin-bottom:28px;}
33
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
34
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
35
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
36
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) -75px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
37
+ #cboxPrevious.hover{background-position:-75px -25px;}
38
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) -50px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
39
+ #cboxNext.hover{background-position:-50px -25px;}
40
+ #cboxLoadingOverlay{background:url(images/loading_background.png) center center no-repeat;}
41
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
42
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) -25px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
43
+ #cboxClose.hover{background-position:-25px -25px;}
themes/theme6/images/border.png ADDED
Binary file
themes/theme6/images/controls.png ADDED
Binary file
themes/theme6/images/internet_explorer/borderBottomCenter.png ADDED
Binary file
themes/theme6/images/internet_explorer/borderBottomLeft.png ADDED
Binary file
themes/theme6/images/internet_explorer/borderBottomRight.png ADDED
Binary file
themes/theme6/images/internet_explorer/borderMiddleLeft.png ADDED
Binary file
themes/theme6/images/internet_explorer/borderMiddleRight.png ADDED
Binary file
themes/theme6/images/internet_explorer/borderTopCenter.png ADDED
Binary file
themes/theme6/images/internet_explorer/borderTopLeft.png ADDED
Binary file
themes/theme6/images/internet_explorer/borderTopRight.png ADDED
Binary file
themes/theme6/images/loading.gif ADDED
Binary file
themes/theme6/images/loading_background.png ADDED
Binary file
themes/theme6/images/overlay.png ADDED
Binary file
themes/theme7/colorbox.css ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative; overflow:hidden;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ Example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:#000;}
22
+ #colorbox{font: 12px Tahoma, Arial,sans-serif;}
23
+ #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) -100px 0 no-repeat;}
24
+ #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) -129px 0 no-repeat;}
25
+ #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) -100px -29px no-repeat;}
26
+ #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) -129px -29px no-repeat;}
27
+ #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
28
+ #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
29
+ #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
30
+ #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
31
+ #cboxContent{background:#fff;}
32
+ #cboxLoadedContent{margin-bottom:28px;}
33
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
34
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
35
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
36
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) -75px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
37
+ #cboxPrevious.hover{background-position:-75px -25px;}
38
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) -50px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
39
+ #cboxNext.hover{background-position:-50px -25px;}
40
+ #cboxLoadingOverlay{background:url(images/loading_background.png) center center no-repeat;}
41
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
42
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) -25px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
43
+ #cboxClose.hover{background-position:-25px -25px;}
themes/theme7/images/border.png ADDED
Binary file
themes/theme7/images/controls.png ADDED
Binary file
themes/theme7/images/internet_explorer/borderBottomCenter.png ADDED
Binary file
themes/theme7/images/internet_explorer/borderBottomLeft.png ADDED
Binary file
themes/theme7/images/internet_explorer/borderBottomRight.png ADDED
Binary file
themes/theme7/images/internet_explorer/borderMiddleLeft.png ADDED
Binary file
themes/theme7/images/internet_explorer/borderMiddleRight.png ADDED
Binary file
themes/theme7/images/internet_explorer/borderTopCenter.png ADDED
Binary file
themes/theme7/images/internet_explorer/borderTopLeft.png ADDED
Binary file
themes/theme7/images/internet_explorer/borderTopRight.png ADDED
Binary file
themes/theme7/images/loading.gif ADDED
Binary file
themes/theme7/images/loading_background.png ADDED
Binary file
themes/theme7/images/overlay.png ADDED
Binary file
themes/theme8/colorbox.css ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative; overflow:hidden;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ Example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:#000;}
22
+ #colorbox{font: 12px Tahoma, Arial,sans-serif;}
23
+ #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) -100px 0 no-repeat;}
24
+ #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) -129px 0 no-repeat;}
25
+ #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) -100px -29px no-repeat;}
26
+ #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) -129px -29px no-repeat;}
27
+ #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
28
+ #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
29
+ #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
30
+ #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
31
+ #cboxContent{background:#fff;}
32
+ #cboxLoadedContent{margin-bottom:28px;}
33
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
34
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
35
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
36
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) -75px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
37
+ #cboxPrevious.hover{background-position:-75px -25px;}
38
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) -50px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
39
+ #cboxNext.hover{background-position:-50px -25px;}
40
+ #cboxLoadingOverlay{background:url(images/loading_background.png) center center no-repeat;}
41
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
42
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) -25px 0 no-repeat; width:25px; height:25px; text-indent:-9999px;}
43
+ #cboxClose.hover{background-position:-25px -25px;}
themes/theme8/images/border.png ADDED
Binary file
themes/theme8/images/controls.png ADDED
Binary file
themes/theme8/images/internet_explorer/borderBottomCenter.png ADDED
Binary file
themes/theme8/images/internet_explorer/borderBottomLeft.png ADDED
Binary file
themes/theme8/images/internet_explorer/borderBottomRight.png ADDED
Binary file
themes/theme8/images/internet_explorer/borderMiddleLeft.png ADDED
Binary file
themes/theme8/images/internet_explorer/borderMiddleRight.png ADDED
Binary file
themes/theme8/images/internet_explorer/borderTopCenter.png ADDED
Binary file
themes/theme8/images/internet_explorer/borderTopLeft.png ADDED
Binary file
themes/theme8/images/internet_explorer/borderTopRight.png ADDED
Binary file
themes/theme8/images/loading.gif ADDED
Binary file
themes/theme8/images/loading_background.png ADDED
Binary file
themes/theme8/images/overlay.png ADDED
Binary file
themes/theme9/colorbox.css ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style
3
+ The following rules are the styles that are consistant between themes.
4
+ Avoid changing this area to maintain compatability with future versions of ColorBox.
5
+ */
6
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative; overflow:hidden;}
10
+ #cboxLoadedContent{overflow:auto;}
11
+ #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
12
+ #cboxTitle{margin:0;}
13
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
14
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
15
+
16
+ /*
17
+ ColorBox example user style
18
+ The following rules are ordered and tabbed in a way that represents the
19
+ order/nesting of the generated HTML, so that the structure easier to understand.
20
+ */
21
+ #cboxOverlay{background:#fff;}
22
+
23
+ #colorBox{font: 12px Tahoma, Arial,sans-serif;}
24
+ #cboxTopLeft{width:25px; height:25px; background:url(images/border1.png) 0 0 no-repeat;}
25
+ #cboxTopCenter{height:25px; background:url(images/border1.png) 0 -50px repeat-x;}
26
+ #cboxTopRight{width:25px; height:25px; background:url(images/border1.png) -25px 0 no-repeat;}
27
+ #cboxBottomLeft{width:25px; height:25px; background:url(images/border1.png) 0 -25px no-repeat;}
28
+ #cboxBottomCenter{height:25px; background:url(images/border1.png) 0 -75px repeat-x;}
29
+ #cboxBottomRight{width:25px; height:25px; background:url(images/border1.png) -25px -25px no-repeat;}
30
+ #cboxMiddleLeft{width:25px; background:url(images/border2.png) 0 0 repeat-y;}
31
+ #cboxMiddleRight{width:25px; background:url(images/border2.png) -25px 0 repeat-y;}
32
+ #cboxContent{background:#fff;}
33
+ /* #cboxLoadedContent{margin-bottom:20px;}
34
+ #cboxTitle{position:absolute; bottom:0; left:0; text-align:center; width:100%; color:#999;}
35
+ #cboxCurrent{position:absolute; bottom:0; left:100px; color:#999;}
36
+ #cboxSlideshow{position:absolute; bottom:0; right:70px; color:#444;}
37
+ #cboxPrevious{position:absolute; bottom:0; left:0; color:#444;}
38
+ #cboxNext{position:absolute; bottom:0; left:63px; color:#444;}
39
+ #cboxLoadingOverlay{background:url(images/loading.gif) 5px 5px no-repeat #fff;}
40
+ #cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}*/
41
+
42
+ #cboxLoadedContent{margin-bottom:20px;}
43
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
44
+ #cboxLoadingOverlay{background:#FFF;}
45
+ #cboxTitle{position:absolute; bottom:0; left:0; text-align:left; width:100%; color:#999;}
46
+ #cboxCurrent{position:absolute; bottom:0; right:120px; color:#999;}
47
+ #cboxSlideshow, #cboxPrevious, #cboxNext, #cboxClose{text-indent:-9999px; width:20px; height:20px; position:absolute; bottom:0; background:url(images/controls.png) 0 0 no-repeat;}
48
+ #cboxPrevious{background-position:0 0; right:44px;}
49
+ #cboxPrevious.hover{background-position:0 -25px;}
50
+ #cboxNext{background-position:-25px 0; right:22px;}
51
+ #cboxNext.hover{background-position:-25px -25px;}
52
+ #cboxClose{background-position:-50px 0; right:0;}
53
+ #cboxClose.hover{background-position:-50px -25px;}
54
+ .cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;}
55
+ .cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;}
56
+ .cboxSlideshow_on #cboxSlideshow.hover{background-position:-100px -25px;}
57
+ .cboxSlideshow_off #cboxSlideshow{background-position:-100px 0; right:44px;}
58
+ .cboxSlideshow_off #cboxSlideshow.hover{background-position:-75px -25px;}
themes/theme9/images/border1.png ADDED
Binary file
themes/theme9/images/border2.png ADDED
Binary file
themes/theme9/images/controls.png ADDED
Binary file
themes/theme9/images/internet_explorer/borderBottomCenter.png ADDED
Binary file
themes/theme9/images/internet_explorer/borderBottomLeft.png ADDED
Binary file
themes/theme9/images/internet_explorer/borderBottomRight.png ADDED
Binary file
themes/theme9/images/internet_explorer/borderMiddleLeft.png ADDED
Binary file
themes/theme9/images/internet_explorer/borderMiddleRight.png ADDED
Binary file
themes/theme9/images/internet_explorer/borderTopCenter.png ADDED
Binary file
themes/theme9/images/internet_explorer/borderTopLeft.png ADDED
Binary file
themes/theme9/images/internet_explorer/borderTopRight.png ADDED
Binary file
themes/theme9/images/loading.gif ADDED
Binary file
yt.js CHANGED
@@ -1,5 +1,3 @@
1
-
2
-
3
  function toggleClass(element, className) {
4
  var e = ref(element);
5
  if (!e) return;
@@ -60,49 +58,46 @@ function findAncestorByClass(element, className) {
60
 
61
  var selectedThemeColor='blank';
62
  function onChangeColor(color){
63
- var oldTheme=document.getElementById('theme_color_'+selectedThemeColor+'_img');
64
- var newTheme=document.getElementById('theme_color_'+color+'_img');
65
 
66
- var embedColor=document.getElementById('embedColor');
67
- embedColor.value=color;
68
 
69
- removeClass(oldTheme,'radio_selected');
70
- addClass(newTheme,'radio_selected');
71
- selectedThemeColor=color;
72
- onUpdatePreviewImage();
73
- return false;
74
  }
75
 
76
  function onUpdatePreviewImage(){
77
- var previewImage=document.getElementById('watch-customize-embed-theme-preview');
78
- var showBorderCheckBox=document.getElementById('show_border_checkbox');
79
- var embedColor=document.getElementById('embedColor');
80
- var border=(!showBorderCheckBox.checked?'_nb':'');
81
- var prevUrl=document.getElementById('prevUrl');
82
 
83
- selectedThemeColor=embedColor.value;
84
- previewImage.src=prevUrl.value+'preview_embed_'+selectedThemeColor+'_sm'+border+'.gif';
85
- //previewImage.src='http://www.youtube.com/img/preview_embed_'+selectedThemeColor+'_sm'+border+'.gif';
86
  }
87
 
88
  function loaded()
89
  {
90
- var previewImage=document.getElementById('watch-customize-embed-theme-preview');
91
- var showBorderCheckBox=document.getElementById('show_border_checkbox');
92
- var embedColor=document.getElementById('embedColor');
93
- var prevUrl=document.getElementById('prevUrl');
94
- var border=(!showBorderCheckBox.checked?'_nb':'');
95
 
96
- selectedThemeColor="blank";
97
 
98
- onChangeColor(embedColor.value);
99
- previewImage.src=prevUrl.value+'preview_embed_'+selectedThemeColor+'_sm'+border+'.gif';
100
-
101
  }
102
  window.onload = loaded;
103
 
104
-
105
-
106
  jQuery(function($){
107
  $(".size-chooser a").click(function(e){
108
  e.preventDefault();
@@ -126,4 +121,4 @@ jQuery(function($){
126
  e.preventDefault();
127
  $("#usage").slideToggle("fast");
128
  });
129
- });
 
 
1
  function toggleClass(element, className) {
2
  var e = ref(element);
3
  if (!e) return;
58
 
59
  var selectedThemeColor='blank';
60
  function onChangeColor(color){
61
+ var oldTheme=document.getElementById('theme_color_'+selectedThemeColor+'_img');
62
+ var newTheme=document.getElementById('theme_color_'+color+'_img');
63
 
64
+ var embedColor=document.getElementById('embedColor');
65
+ embedColor.value=color;
66
 
67
+ removeClass(oldTheme,'radio_selected');
68
+ addClass(newTheme,'radio_selected');
69
+ selectedThemeColor=color;
70
+ onUpdatePreviewImage();
71
+ return false;
72
  }
73
 
74
  function onUpdatePreviewImage(){
75
+ var previewImage=document.getElementById('watch-customize-embed-theme-preview');
76
+ var showBorderCheckBox=document.getElementById('show_border_checkbox');
77
+ var embedColor=document.getElementById('embedColor');
78
+ var border=(!showBorderCheckBox.checked?'_nb':'');
79
+ var prevUrl=document.getElementById('prevUrl');
80
 
81
+ selectedThemeColor=embedColor.value;
82
+ previewImage.src=prevUrl.value+'preview_embed_'+selectedThemeColor+'_sm'+border+'.gif';
83
+ //previewImage.src='http://www.youtube.com/img/preview_embed_'+selectedThemeColor+'_sm'+border+'.gif';
84
  }
85
 
86
  function loaded()
87
  {
88
+ var previewImage=document.getElementById('watch-customize-embed-theme-preview');
89
+ var showBorderCheckBox=document.getElementById('show_border_checkbox');
90
+ var embedColor=document.getElementById('embedColor');
91
+ var prevUrl=document.getElementById('prevUrl');
92
+ var border=(!showBorderCheckBox.checked?'_nb':'');
93
 
94
+ selectedThemeColor="blank";
95
 
96
+ onChangeColor(embedColor.value);
97
+ previewImage.src=prevUrl.value+'preview_embed_'+selectedThemeColor+'_sm'+border+'.gif';
 
98
  }
99
  window.onload = loaded;
100
 
 
 
101
  jQuery(function($){
102
  $(".size-chooser a").click(function(e){
103
  e.preventDefault();
121
  e.preventDefault();
122
  $("#usage").slideToggle("fast");
123
  });
124
+ });