WP Video Lightbox - Version 1.6.2

Version Description

  • Created a settings menu for the plugin
  • Updated the prettyPhoto library to 3.1.5
Download this release

Release Info

Developer wptipsntricks
Plugin Icon 128x128 WP Video Lightbox
Version 1.6.2
Comparing to
See all releases

Code changes from version 1.6.1 to 1.6.2

class-prettyphoto.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class WP_Video_Lightbox_prettyPhoto
3
+ {
4
+ var $animation_speed;
5
+ var $slideshow;
6
+ var $autoplay_slideshow;
7
+ var $opacity;
8
+ var $show_title;
9
+ var $allow_resize;
10
+ var $allow_expand;
11
+ var $default_width;
12
+ var $default_height;
13
+ var $counter_separator_label;
14
+ var $theme;
15
+ var $horizontal_padding;
16
+ var $hideflash;
17
+ var $wmode;
18
+ var $autoplay;
19
+ var $modal;
20
+ var $deeplinking;
21
+ var $overlay_gallery;
22
+ var $overlay_gallery_max;
23
+ var $keyboard_shortcuts;
24
+ var $ie6_fallback;
25
+
26
+ function WP_Video_Lightbox_prettyPhoto()
27
+ {
28
+ $this->animation_speed = 'fast';
29
+ $this->slideshow = '5000';
30
+ $this->autoplay_slideshow = 'false';
31
+ $this->opacity = '0.80';
32
+ $this->show_title = 'true';
33
+ $this->allow_resize = 'true';
34
+ $this->allow_expand = 'true';
35
+ $this->default_width = '640';
36
+ $this->default_height = '480';
37
+ $this->counter_separator_label = '/';
38
+ $this->theme = 'pp_default';
39
+ $this->horizontal_padding = '20';
40
+ $this->hideflash = 'false';
41
+ $this->wmode = 'opaque';
42
+ $this->autoplay = 'false';
43
+ $this->modal = 'false';
44
+ $this->deeplinking = 'false';
45
+ $this->overlay_gallery = 'true';
46
+ $this->overlay_gallery_max = '30';
47
+ $this->keyboard_shortcuts = 'true';
48
+ $this->ie6_fallback = 'true';
49
+ }
50
+
51
+ static function save_object($obj_to_save)
52
+ {
53
+ update_option('wpvl_prettyphoto_options', $obj_to_save);
54
+ }
55
+
56
+ static function get_instance()
57
+ {
58
+ $obj = get_option('wpvl_prettyphoto_options');
59
+ if($obj){
60
+ return $obj;
61
+ }else{
62
+ return new WP_Video_Lightbox_prettyPhoto();
63
+ }
64
+ }
65
+ }
images/backgrounds/Thumbs.db DELETED
Binary file
images/backgrounds/bodyBackground.jpg DELETED
Binary file
images/backgrounds/checkmark.gif DELETED
Binary file
images/fullscreen/1.jpg ADDED
Binary file
images/fullscreen/2.jpg ADDED
Binary file
images/fullscreen/3.jpg ADDED
Binary file
images/fullscreen/4.jpg ADDED
Binary file
images/fullscreen/5.jpg ADDED
Binary file
images/fullscreen/6.jpg ADDED
Binary file
images/fullscreen/high.gif ADDED
Binary file
images/fullscreen/huge.gif ADDED
Binary file
images/fullscreen/wide.gif ADDED
Binary file
js/jquery.prettyPhoto.js CHANGED
@@ -2,82 +2,6 @@
2
  Class: prettyPhoto
3
  Use: Lightbox clone for jQuery
4
  Author: Stephane Caron (http://www.no-margin-for-errors.com)
5
- Version: 3.1.4
6
  ------------------------------------------------------------------------- */
7
-
8
- (function($){$.prettyPhoto={version:'3.1.4'};$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend({hook:'rel',animation_speed:'fast',ajaxcallback:function(){},slideshow:5000,autoplay_slideshow:false,opacity:0.80,show_title:true,allow_resize:true,allow_expand:true,default_width:500,default_height:344,counter_separator_label:'/',theme:'pp_default',horizontal_padding:20,hideflash:false,wmode:'opaque',autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,overlay_gallery_max:30,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:'<div class="pp_pic_holder"> \
9
- <div class="ppt">&nbsp;</div> \
10
- <div class="pp_top"> \
11
- <div class="pp_left"></div> \
12
- <div class="pp_middle"></div> \
13
- <div class="pp_right"></div> \
14
- </div> \
15
- <div class="pp_content_container"> \
16
- <div class="pp_left"> \
17
- <div class="pp_right"> \
18
- <div class="pp_content"> \
19
- <div class="pp_loaderIcon"></div> \
20
- <div class="pp_fade"> \
21
- <a href="#" class="pp_expand" title="Expand the image">Expand</a> \
22
- <div class="pp_hoverContainer"> \
23
- <a class="pp_next" href="#">next</a> \
24
- <a class="pp_previous" href="#">previous</a> \
25
- </div> \
26
- <div id="pp_full_res"></div> \
27
- <div class="pp_details"> \
28
- <div class="pp_nav"> \
29
- <a href="#" class="pp_arrow_previous">Previous</a> \
30
- <p class="currentTextHolder">0/0</p> \
31
- <a href="#" class="pp_arrow_next">Next</a> \
32
- </div> \
33
- <p class="pp_description"></p> \
34
- <div class="pp_social">{pp_social}</div> \
35
- <a class="pp_close" href="#">Close</a> \
36
- </div> \
37
- </div> \
38
- </div> \
39
- </div> \
40
- </div> \
41
- </div> \
42
- <div class="pp_bottom"> \
43
- <div class="pp_left"></div> \
44
- <div class="pp_middle"></div> \
45
- <div class="pp_right"></div> \
46
- </div> \
47
- </div> \
48
- <div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> \
49
- <a href="#" class="pp_arrow_previous">Previous</a> \
50
- <div> \
51
- <ul> \
52
- {gallery} \
53
- </ul> \
54
- </div> \
55
- <a href="#" class="pp_arrow_next">Next</a> \
56
- </div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:'',social_tools:'<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'},pp_settings);var matchedObjects=this,percentBased=false,pp_dimensions,pp_open,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),pp_slideshow;doresize=true,scroll_pos=_get_scroll();$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){_center_overlay();_resize_overlay();});if(pp_settings.keyboard_shortcuts){$(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){if(typeof $pp_pic_holder!='undefined'){if($pp_pic_holder.is(':visible')){switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');e.preventDefault();break;case 39:$.prettyPhoto.changePage('next');e.preventDefault();break;case 27:if(!settings.modal)
57
- $.prettyPhoto.close();e.preventDefault();break;};};};});};$.prettyPhoto.initialize=function(){settings=pp_settings;if(settings.theme=='pp_default')settings.horizontal_padding=16;if(settings.ie6_fallback&&$.browser.msie&&parseInt($.browser.version)==6)settings.theme="light_square";theRel=$(this).attr(settings.hook);galleryRegExp=/\[(?:.*)\]/;isSet=(galleryRegExp.exec(theRel))?true:false;pp_images=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr(settings.hook).indexOf(theRel)!=-1)return $(n).attr('href');}):$.makeArray($(this).attr('href'));pp_titles=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr(settings.hook).indexOf(theRel)!=-1)return($(n).find('img').attr('alt'))?$(n).find('img').attr('alt'):"";}):$.makeArray($(this).find('img').attr('alt'));pp_descriptions=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr(settings.hook).indexOf(theRel)!=-1)return($(n).attr('title'))?$(n).attr('title'):"";}):$.makeArray($(this).attr('title'));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jQuery.inArray($(this).attr('href'),pp_images);rel_index=(isSet)?set_position:$("a["+settings.hook+"^='"+theRel+"']").index($(this));_build_overlay(this);if(settings.allow_resize)
58
- $(window).bind('scroll.prettyphoto',function(){_center_overlay();});$.prettyPhoto.open();return false;}
59
- $.prettyPhoto.open=function(event){if(typeof settings=="undefined"){settings=pp_settings;if($.browser.msie&&$.browser.version==6)settings.theme="light_square";pp_images=$.makeArray(arguments[0]);pp_titles=(arguments[1])?$.makeArray(arguments[1]):$.makeArray("");pp_descriptions=(arguments[2])?$.makeArray(arguments[2]):$.makeArray("");isSet=(pp_images.length>1)?true:false;set_position=(arguments[3])?arguments[3]:0;_build_overlay(event.target);}
60
- if($.browser.msie&&$.browser.version==6)$('select').css('visibility','hidden');if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden');_checkPosition($(pp_images).size());$('.pp_loaderIcon').show();if(settings.deeplinking)
61
- setHashtag();if(settings.social_tools){facebook_like_link=settings.social_tools.replace('{location_href}',encodeURIComponent(location.href));$pp_pic_holder.find('.pp_social').html(facebook_like_link);}
62
- if($ppt.is(':hidden'))$ppt.css('opacity',0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((set_position+1)+settings.counter_separator_label+$(pp_images).size());if(typeof pp_descriptions[set_position]!='undefined'&&pp_descriptions[set_position]!=""){$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));}else{$pp_pic_holder.find('.pp_description').hide();}
63
- movie_width=(parseFloat(getParam('width',pp_images[set_position])))?getParam('width',pp_images[set_position]):settings.default_width.toString();movie_height=(parseFloat(getParam('height',pp_images[set_position])))?getParam('height',pp_images[set_position]):settings.default_height.toString();percentBased=false;if(movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-150);percentBased=true;}
64
- if(movie_width.indexOf('%')!=-1){movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-150);percentBased=true;}
65
- $pp_pic_holder.fadeIn(function(){(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined")?$ppt.html(unescape(pp_titles[set_position])):$ppt.html('&nbsp;');imgPreloader="";skipInjection=false;switch(_getFileType(pp_images[set_position])){case'image':imgPreloader=new Image();nextImage=new Image();if(isSet&&set_position<$(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image();if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=pp_images[set_position];break;case'youtube':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=getParam('v',pp_images[set_position]);if(movie_id==""){movie_id=pp_images[set_position].split('youtu.be/');movie_id=movie_id[1];if(movie_id.indexOf('?')>0)
66
- movie_id=movie_id.substr(0,movie_id.indexOf('?'));if(movie_id.indexOf('&')>0)
67
- movie_id=movie_id.substr(0,movie_id.indexOf('&'));}
68
- movie='http://www.youtube.com/embed/'+movie_id;(getParam('rel',pp_images[set_position]))?movie+="?rel="+getParam('rel',pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'vimeo':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=pp_images[set_position];var regExp=/http:\/\/(www\.)?vimeo.com\/(\d+)/;var match=movie_id.match(regExp);movie='http://player.vimeo.com/video/'+match[2]+'?title=0&amp;byline=0&amp;portrait=0';if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=pp_dimensions['width']+'/embed/?moog_width='+pp_dimensions['width'];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);break;case'quicktime':pp_dimensions=_fitToViewport(movie_width,movie_height);pp_dimensions['height']+=15;pp_dimensions['contentHeight']+=15;pp_dimensions['containerHeight']+=15;toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':pp_dimensions=_fitToViewport(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars')+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':pp_dimensions=_fitToViewport(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);break;case'ajax':doresize=false;pp_dimensions=_fitToViewport(movie_width,movie_height);doresize=true;skipInjection=true;$.get(pp_images[set_position],function(responseHTML){toInject=settings.inline_markup.replace(/{content}/g,responseHTML);$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();});break;case'custom':pp_dimensions=_fitToViewport(movie_width,movie_height);toInject=settings.custom_markup;break;case'inline':myClone=$(pp_images[set_position]).clone().append('<br clear="all" />').css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo($('body')).show();doresize=false;pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height());doresize=true;$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());break;};if(!imgPreloader&&!skipInjection){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});return false;};$.prettyPhoto.changePage=function(direction){currentGalleryPage=0;if(direction=='previous'){set_position--;if(set_position<0)set_position=$(pp_images).size()-1;}else if(direction=='next'){set_position++;if(set_position>$(pp_images).size()-1)set_position=0;}else{set_position=direction;};rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');}
69
- _hideContent(function(){$.prettyPhoto.open();});};$.prettyPhoto.changeGalleryPage=function(direction){if(direction=='next'){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0;}else if(direction=='previous'){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage;}else{currentGalleryPage=direction;};slide_speed=(direction=='next'||direction=='previous')?settings.animation_speed:0;slide_to=currentGalleryPage*(itemsPerPage*itemWidth);$pp_gallery.find('ul').animate({left:-slide_to},slide_speed);};$.prettyPhoto.startSlideshow=function(){if(typeof pp_slideshow=='undefined'){$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){$.prettyPhoto.stopSlideshow();return false;});pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);}else{$.prettyPhoto.changePage('next');};}
70
- $.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});clearInterval(pp_slideshow);pp_slideshow=undefined;}
71
- $.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;$.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){$(this).remove();});$pp_overlay.fadeOut(settings.animation_speed,function(){if($.browser.msie&&$.browser.version==6)$('select').css('visibility','visible');if(settings.hideflash)$('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible');$(this).remove();$(window).unbind('scroll.prettyphoto');clearHashtag();settings.callback();doresize=true;pp_open=false;delete settings;});};function _showContent(){$('.pp_loaderIcon').hide();projectedTop=scroll_pos['scrollTop']+((windowHeight/2)-(pp_dimensions['containerHeight']/2));if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find('.pp_content').animate({height:pp_dimensions['contentHeight'],width:pp_dimensions['contentWidth']},settings.animation_speed);$pp_pic_holder.animate({'top':projectedTop,'left':((windowWidth/2)-(pp_dimensions['containerWidth']/2)<0)?0:(windowWidth/2)-(pp_dimensions['containerWidth']/2),width:pp_dimensions['containerWidth']},settings.animation_speed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);if(isSet&&_getFileType(pp_images[set_position])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
72
- if(settings.allow_expand){if(pp_dimensions['resized']){$('a.pp_expand,a.pp_contract').show();}else{$('a.pp_expand').hide();}}
73
- if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open)$.prettyPhoto.startSlideshow();settings.changepicturecallback();pp_open=true;});_insert_gallery();pp_settings.ajaxcallback();};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){$('.pp_loaderIcon').show();callback();});};function _checkPosition(setCount){(setCount>1)?$('.pp_nav').show():$('.pp_nav').hide();};function _fitToViewport(width,height){resized=false;_getDimensions(width,height);imageWidth=width,imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allow_resize&&!percentBased){resized=true,fitting=false;while(!fitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{fitting=true;};pp_containerHeight=imageHeight,pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);if((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight)){_fitToViewport(pp_containerWidth,pp_containerHeight)};};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+(settings.horizontal_padding*2),contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:resized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;if($.browser.msie&&$.browser.version==7)detailsHeight+=8;$pp_details.remove();$pp_title=$pp_pic_holder.find('.ppt');$pp_title.width(width);titleHeight=parseFloat($pp_title.css('marginTop'))+parseFloat($pp_title.css('marginBottom'));$pp_title=$pp_title.clone().appendTo($('body')).css({'position':'absolute','top':-10000});titleHeight+=$pp_title.height();$pp_title.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+titleHeight+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;}
74
- function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)||itemSrc.match(/youtu\.be/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.match(/\b.mov\b/i)){return'quicktime';}else if(itemSrc.match(/\b.swf\b/i)){return'flash';}else if(itemSrc.match(/\biframe=true\b/i)){return'iframe';}else if(itemSrc.match(/\bajax=true\b/i)){return'ajax';}else if(itemSrc.match(/\bcustom=true\b/i)){return'custom';}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _center_overlay(){if(doresize&&typeof $pp_pic_holder!='undefined'){scroll_pos=_get_scroll();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scroll_pos['scrollTop']-(contentHeight/2);if(projectedTop<0)projectedTop=0;if(contentHeight>windowHeight)
75
- return;$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scroll_pos['scrollLeft']-(contentwidth/2)});};};function _get_scroll(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};};function _resize_overlay(){windowHeight=$(window).height(),windowWidth=$(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height($(document).height()).width(windowWidth);};function _insert_gallery(){if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"&&(settings.ie6_fallback&&!($.browser.msie&&parseInt($.browser.version)==6))){itemWidth=52+5;navWidth=(settings.theme=="facebook"||settings.theme=="pp_default")?50:30;itemsPerPage=Math.floor((pp_dimensions['containerWidth']-100-navWidth)/itemWidth);itemsPerPage=(itemsPerPage<pp_images.length)?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').hide();}else{$pp_gallery.find('.pp_arrow_next,.pp_arrow_previous').show();};galleryWidth=itemsPerPage*itemWidth;fullGalleryWidth=pp_images.length*itemWidth;$pp_gallery.css('margin-left',-((galleryWidth/2)+(navWidth/2))).find('div:first').width(galleryWidth+5).find('ul').width(fullGalleryWidth).find('li.selected').removeClass('selected');goToPage=(Math.floor(set_position/itemsPerPage)<totalPage)?Math.floor(set_position/itemsPerPage):totalPage;$.prettyPhoto.changeGalleryPage(goToPage);$pp_gallery_li.filter(':eq('+set_position+')').addClass('selected');}else{$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');}}
76
- function _build_overlay(caller){if(settings.social_tools)
77
- facebook_like_link=settings.social_tools.replace('{location_href}',encodeURIComponent(location.href));settings.markup=settings.markup.replace('{pp_social}','');$('body').append(settings.markup);$pp_pic_holder=$('.pp_pic_holder'),$ppt=$('.ppt'),$pp_overlay=$('div.pp_overlay');if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var i=0;i<pp_images.length;i++){if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){classname='default';img_src='';}else{classname='';img_src=pp_images[i];}
78
- toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>";};toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find('#pp_full_res').after(toInject);$pp_gallery=$('.pp_pic_holder .pp_gallery'),$pp_gallery_li=$pp_gallery.find('li');$pp_gallery.find('.pp_arrow_next').click(function(){$.prettyPhoto.changeGalleryPage('next');$.prettyPhoto.stopSlideshow();return false;});$pp_gallery.find('.pp_arrow_previous').click(function(){$.prettyPhoto.changeGalleryPage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_content').hover(function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();},function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();});itemWidth=52+5;$pp_gallery_li.each(function(i){$(this).find('a').click(function(){$.prettyPhoto.changePage(i);$.prettyPhoto.stopSlideshow();return false;});});};if(settings.slideshow){$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
79
- $pp_pic_holder.find('.pp_nav .pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});}
80
- $pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height(),'width':$(window).width()}).bind('click',function(){if(!settings.modal)$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});if(settings.allow_expand){$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});}
81
- $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};if(!pp_alreadyInitialized&&getHashtag()){pp_alreadyInitialized=true;hashIndex=getHashtag();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf('/'));setTimeout(function(){$("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click');},50);}
82
- return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);};function getHashtag(){url=location.href;hashtag=(url.indexOf('#prettyPhoto')!==-1)?decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)):false;return hashtag;};function setHashtag(){if(typeof theRel=='undefined')return;location.hash=theRel+'/'+rel_index+'/';};function clearHashtag(){if(location.href.indexOf('#prettyPhoto')!==-1)location.hash="prettyPhoto";}
83
- function getParam(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery);var pp_alreadyInitialized=false;
2
  Class: prettyPhoto
3
  Use: Lightbox clone for jQuery
4
  Author: Stephane Caron (http://www.no-margin-for-errors.com)
5
+ Version: 3.1.5
6
  ------------------------------------------------------------------------- */
7
+ (function(e){function t(){var e=location.href;hashtag=e.indexOf("#prettyPhoto")!==-1?decodeURI(e.substring(e.indexOf("#prettyPhoto")+1,e.length)):false;return hashtag}function n(){if(typeof theRel=="undefined")return;location.hash=theRel+"/"+rel_index+"/"}function r(){if(location.href.indexOf("#prettyPhoto")!==-1)location.hash="prettyPhoto"}function i(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+e+"=([^&#]*)";var r=new RegExp(n);var i=r.exec(t);return i==null?"":i[1]}e.prettyPhoto={version:"3.1.5"};e.fn.prettyPhoto=function(s){function g(){e(".pp_loaderIcon").hide();projectedTop=scroll_pos["scrollTop"]+(d/2-a["containerHeight"]/2);if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find(".pp_content").animate({height:a["contentHeight"],width:a["contentWidth"]},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:v/2-a["containerWidth"]/2<0?0:v/2-a["containerWidth"]/2,width:a["containerWidth"]},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(a["height"]).width(a["width"]);$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);if(isSet&&S(pp_images[set_position])=="image"){$pp_pic_holder.find(".pp_hoverContainer").show()}else{$pp_pic_holder.find(".pp_hoverContainer").hide()}if(settings.allow_expand){if(a["resized"]){e("a.pp_expand,a.pp_contract").show()}else{e("a.pp_expand").hide()}}if(settings.autoplay_slideshow&&!m&&!f)e.prettyPhoto.startSlideshow();settings.changepicturecallback();f=true});C();s.ajaxcallback()}function y(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){e(".pp_loaderIcon").show();t()})}function b(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function w(e,t){resized=false;E(e,t);imageWidth=e,imageHeight=t;if((p>v||h>d)&&doresize&&settings.allow_resize&&!u){resized=true,fitting=false;while(!fitting){if(p>v){imageWidth=v-200;imageHeight=t/e*imageWidth}else if(h>d){imageHeight=d-200;imageWidth=e/t*imageHeight}else{fitting=true}h=imageHeight,p=imageWidth}if(p>v||h>d){w(p,h)}E(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(h),containerWidth:Math.floor(p)+settings.horizontal_padding*2,contentHeight:Math.floor(l),contentWidth:Math.floor(c),resized:resized}}function E(t,n){t=parseFloat(t);n=parseFloat(n);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(t);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(t);titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom"));$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4});titleHeight+=$pp_title.height();$pp_title.remove();l=n+detailsHeight;c=t;h=l+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();p=t}function S(e){if(e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)){return"youtube"}else if(e.match(/vimeo\.com/i)){return"vimeo"}else if(e.match(/\b.mov\b/i)){return"quicktime"}else if(e.match(/\b.swf\b/i)){return"flash"}else if(e.match(/\biframe=true\b/i)){return"iframe"}else if(e.match(/\bajax=true\b/i)){return"ajax"}else if(e.match(/\bcustom=true\b/i)){return"custom"}else if(e.substr(0,1)=="#"){return"inline"}else{return"image"}}function x(){if(doresize&&typeof $pp_pic_holder!="undefined"){scroll_pos=T();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=d/2+scroll_pos["scrollTop"]-contentHeight/2;if(projectedTop<0)projectedTop=0;if(contentHeight>d)return;$pp_pic_holder.css({top:projectedTop,left:v/2+scroll_pos["scrollLeft"]-contentwidth/2})}}function T(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}}function N(){d=e(window).height(),v=e(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height(e(document).height()).width(v)}function C(){if(isSet&&settings.overlay_gallery&&S(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30;itemsPerPage=Math.floor((a["containerWidth"]-100-navWidth)/itemWidth);itemsPerPage=itemsPerPage<pp_images.length?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide()}else{$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show()}galleryWidth=itemsPerPage*itemWidth;fullGalleryWidth=pp_images.length*itemWidth;$pp_gallery.css("margin-left",-(galleryWidth/2+navWidth/2)).find("div:first").width(galleryWidth+5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected");goToPage=Math.floor(set_position/itemsPerPage)<totalPage?Math.floor(set_position/itemsPerPage):totalPage;e.prettyPhoto.changeGalleryPage(goToPage);$pp_gallery_li.filter(":eq("+set_position+")").addClass("selected")}else{$pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave")}}function k(t){if(settings.social_tools)facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));settings.markup=settings.markup.replace("{pp_social}","");e("body").append(settings.markup);$pp_pic_holder=e(".pp_pic_holder"),$ppt=e(".ppt"),$pp_overlay=e("div.pp_overlay");if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var n=0;n<pp_images.length;n++){if(!pp_images[n].match(/\b(jpg|jpeg|png|gif)\b/gi)){classname="default";img_src=""}else{classname="";img_src=pp_images[n]}toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>"}toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find("#pp_full_res").after(toInject);$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){e.prettyPhoto.changeGalleryPage("next");e.prettyPhoto.stopSlideshow();return false});$pp_gallery.find(".pp_arrow_previous").click(function(){e.prettyPhoto.changeGalleryPage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()});itemWidth=52+5;$pp_gallery_li.each(function(t){e(this).find("a").click(function(){e.prettyPhoto.changePage(t);e.prettyPhoto.stopSlideshow();return false})})}if(settings.slideshow){$pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>');$pp_pic_holder.find(".pp_nav .pp_play").click(function(){e.prettyPhoto.startSlideshow();return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){if(!settings.modal)e.prettyPhoto.close()});e("a.pp_close").bind("click",function(){e.prettyPhoto.close();return false});if(settings.allow_expand){e("a.pp_expand").bind("click",function(t){if(e(this).hasClass("pp_expand")){e(this).removeClass("pp_expand").addClass("pp_contract");doresize=false}else{e(this).removeClass("pp_contract").addClass("pp_expand");doresize=true}y(function(){e.prettyPhoto.open()});return false})}$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){e.prettyPhoto.changePage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){e.prettyPhoto.changePage("next");e.prettyPhoto.stopSlideshow();return false});x()}s=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:false,opacity:.8,show_title:true,allow_resize:true,allow_expand:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,overlay_gallery_max:30,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:'<div class="pp_pic_holder"> <div class="ppt"> </div> <div class="pp_top"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> <div class="pp_content_container"> <div class="pp_left"> <div class="pp_right"> <div class="pp_content"> <div class="pp_loaderIcon"></div> <div class="pp_fade"> <a href="#" class="pp_expand" title="Expand the image">Expand</a> <div class="pp_hoverContainer"> <a class="pp_next" href="#">next</a> <a class="pp_previous" href="#">previous</a> </div> <div id="pp_full_res"></div> <div class="pp_details"> <div class="pp_nav"> <a href="#" class="pp_arrow_previous">Previous</a> <p class="currentTextHolder">0/0</p> <a href="#" class="pp_arrow_next">Next</a> </div> <p class="pp_description"></p> <div class="pp_social">{pp_social}</div> <a class="pp_close" href="#">Close</a> </div> </div> </div> </div> </div> </div> <div class="pp_bottom"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> </div> <div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> <a href="#" class="pp_arrow_previous">Previous</a> <div> <ul> {gallery} </ul> </div> <a href="#" class="pp_arrow_next">Next</a> </div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:"",social_tools:'<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'},s);var o=this,u=false,a,f,l,c,h,p,d=e(window).height(),v=e(window).width(),m;doresize=true,scroll_pos=T();e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){x();N()});if(s.keyboard_shortcuts){e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if(typeof $pp_pic_holder!="undefined"){if($pp_pic_holder.is(":visible")){switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous");t.preventDefault();break;case 39:e.prettyPhoto.changePage("next");t.preventDefault();break;case 27:if(!settings.modal)e.prettyPhoto.close();t.preventDefault();break}}}})}e.prettyPhoto.initialize=function(){settings=s;if(settings.theme=="pp_default")settings.horizontal_padding=16;theRel=e(this).attr(settings.hook);galleryRegExp=/\[(?:.*)\]/;isSet=galleryRegExp.exec(theRel)?true:false;pp_images=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("href")}):e.makeArray(e(this).attr("href"));pp_titles=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):""}):e.makeArray(e(this).find("img").attr("alt"));pp_descriptions=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("title")?e(t).attr("title"):""}):e.makeArray(e(this).attr("title"));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jQuery.inArray(e(this).attr("href"),pp_images);rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this));k(this);if(settings.allow_resize)e(window).bind("scroll.prettyphoto",function(){x()});e.prettyPhoto.open();return false};e.prettyPhoto.open=function(t){if(typeof settings=="undefined"){settings=s;pp_images=e.makeArray(arguments[0]);pp_titles=arguments[1]?e.makeArray(arguments[1]):e.makeArray("");pp_descriptions=arguments[2]?e.makeArray(arguments[2]):e.makeArray("");isSet=pp_images.length>1?true:false;set_position=arguments[3]?arguments[3]:0;k(t.target)}if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden");b(e(pp_images).size());e(".pp_loaderIcon").show();if(settings.deeplinking)n();if(settings.social_tools){facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));$pp_pic_holder.find(".pp_social").html(facebook_like_link)}if($ppt.is(":hidden"))$ppt.css("opacity",0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+e(pp_images).size());if(typeof pp_descriptions[set_position]!="undefined"&&pp_descriptions[set_position]!=""){$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))}else{$pp_pic_holder.find(".pp_description").hide()}movie_width=parseFloat(i("width",pp_images[set_position]))?i("width",pp_images[set_position]):settings.default_width.toString();movie_height=parseFloat(i("height",pp_images[set_position]))?i("height",pp_images[set_position]):settings.default_height.toString();u=false;if(movie_height.indexOf("%")!=-1){movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150);u=true}if(movie_width.indexOf("%")!=-1){movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150);u=true}$pp_pic_holder.fadeIn(function(){settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined"?$ppt.html(unescape(pp_titles[set_position])):$ppt.html(" ");imgPreloader="";skipInjection=false;switch(S(pp_images[set_position])){case"image":imgPreloader=new Image;nextImage=new Image;if(isSet&&set_position<e(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image;if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find("#pp_full_res")[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){a=w(imgPreloader.width,imgPreloader.height);g()};imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist.");e.prettyPhoto.close()};imgPreloader.src=pp_images[set_position];break;case"youtube":a=w(movie_width,movie_height);movie_id=i("v",pp_images[set_position]);if(movie_id==""){movie_id=pp_images[set_position].split("youtu.be/");movie_id=movie_id[1];if(movie_id.indexOf("?")>0)movie_id=movie_id.substr(0,movie_id.indexOf("?"));if(movie_id.indexOf("&")>0)movie_id=movie_id.substr(0,movie_id.indexOf("&"))}movie="http://www.youtube.com/embed/"+movie_id;i("rel",pp_images[set_position])?movie+="?rel="+i("rel",pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":a=w(movie_width,movie_height);movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;var n=movie_id.match(t);movie="http://player.vimeo.com/video/"+n[3]+"?title=0&byline=0&portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=a["width"]+"/embed/?moog_width="+a["width"];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,a["height"]).replace(/{path}/g,movie);break;case"quicktime":a=w(movie_width,movie_height);a["height"]+=15;a["contentHeight"]+=15;a["containerHeight"]+=15;toInject=settings.quicktime_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":a=w(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf("?"));toInject=settings.flash_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":a=w(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{path}/g,frame_url);break;case"ajax":doresize=false;a=w(movie_width,movie_height);doresize=true;skipInjection=true;e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e);$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()});break;case"custom":a=w(movie_width,movie_height);toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('<br clear="all" />').css({width:settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(e("body")).show();doresize=false;a=w(e(myClone).width(),e(myClone).height());doresize=true;e(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html());break}if(!imgPreloader&&!skipInjection){$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()}});return false};e.prettyPhoto.changePage=function(t){currentGalleryPage=0;if(t=="previous"){set_position--;if(set_position<0)set_position=e(pp_images).size()-1}else if(t=="next"){set_position++;if(set_position>e(pp_images).size()-1)set_position=0}else{set_position=t}rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){e(".pp_contract").removeClass("pp_contract").addClass("pp_expand")}y(function(){e.prettyPhoto.open()})};e.prettyPhoto.changeGalleryPage=function(e){if(e=="next"){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0}else if(e=="previous"){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage}else{currentGalleryPage=e}slide_speed=e=="next"||e=="previous"?settings.animation_speed:0;slide_to=currentGalleryPage*itemsPerPage*itemWidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};e.prettyPhoto.startSlideshow=function(){if(typeof m=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){e.prettyPhoto.stopSlideshow();return false});m=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)}else{e.prettyPhoto.changePage("next")}};e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){e.prettyPhoto.startSlideshow();return false});clearInterval(m);m=undefined};e.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;e.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");e(this).remove();e(window).unbind("scroll.prettyphoto");r();settings.callback();doresize=true;f=false;delete settings})};if(!pp_alreadyInitialized&&t()){pp_alreadyInitialized=true;hashIndex=t();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf("/"));setTimeout(function(){e("a["+s.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)}return this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)};})(jQuery);var pp_alreadyInitialized=false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/video-lightbox.js CHANGED
@@ -1,27 +1,31 @@
1
  jQuery(document).ready(function($) {
2
- //WP Video Lightbox Pluign - http://www.tipsandtricks-hq.com/?p=2700
3
- $("a[rel^='wp-video-lightbox']").prettyPhoto({
4
- animation_speed: 'fast',
5
- slideshow: 5000,
6
- autoplay_slideshow: false,
7
- opacity: 0.80,
8
- show_title: true,
9
- allow_resize: true,
10
- default_width: 640,
11
- default_height: 480,
12
- counter_separator_label: '/',
13
- theme: 'pp_default',
14
- horizontal_padding: 20,
15
- hideflash: false,
16
- wmode: 'opaque',
17
- autoplay: false,
18
- modal: false,
19
- deeplinking: false,
20
- overlay_gallery: true,
21
- keyboard_shortcuts: true,
 
 
 
 
22
  changepicturecallback: function(){},
23
  callback: function(){},
24
- ie6_fallback: true,
25
  markup: '<div class="pp_pic_holder"> \
26
  <div class="ppt">&nbsp;</div> \
27
  <div class="pp_top"> \
1
  jQuery(document).ready(function($) {
2
+ //WP Video Lightbox Plugin - http://www.tipsandtricks-hq.com/?p=2700
3
+ $("a[rel^="+vlpp_vars.prettyPhoto_rel+"]").prettyPhoto({
4
+ hook: "rel",
5
+ animation_speed: vlpp_vars.animation_speed,
6
+ ajaxcallback: function () {},
7
+ slideshow: (vlpp_vars.slideshow=="false") ? false : vlpp_vars.slideshow,
8
+ autoplay_slideshow: (vlpp_vars.autoplay_slideshow=="true") ? true : false,
9
+ opacity: vlpp_vars.opacity,
10
+ show_title: (vlpp_vars.show_title=="true") ? true : false,
11
+ allow_resize: (vlpp_vars.allow_resize=="true") ? true : false,
12
+ allow_expand: (vlpp_vars.allow_expand=="true") ? true : false,
13
+ default_width: vlpp_vars.default_width,
14
+ default_height: vlpp_vars.default_height,
15
+ counter_separator_label: vlpp_vars.counter_separator_label,
16
+ theme: vlpp_vars.theme,
17
+ horizontal_padding: vlpp_vars.horizontal_padding,
18
+ hideflash: (vlpp_vars.hideflash=="true") ? true : false,
19
+ wmode: vlpp_vars.wmode,
20
+ autoplay: (vlpp_vars.autoplay=="true") ? true : false,
21
+ modal: (vlpp_vars.modal=="true") ? true : false,
22
+ deeplinking: (vlpp_vars.deeplinking=="true") ? true : false,
23
+ overlay_gallery: (vlpp_vars.overlay_gallery=="true") ? true : false,
24
+ overlay_gallery_max: vlpp_vars.overlay_gallery_max,
25
+ keyboard_shortcuts: (vlpp_vars.keyboard_shortcuts=="true") ? true : false,
26
  changepicturecallback: function(){},
27
  callback: function(){},
28
+ ie6_fallback: (vlpp_vars.ie6_fallback=="true") ? true : false,
29
  markup: '<div class="pp_pic_holder"> \
30
  <div class="ppt">&nbsp;</div> \
31
  <div class="pp_top"> \
misc_functions.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_shortcode('video_lightbox_vimeo5', 'wp_vid_lightbox_vimeo5_handler');
3
+ add_shortcode('video_lightbox_youtube', 'wp_vid_lightbox_youtube_handler');
4
+
5
+ function wp_vid_lightbox_vimeo5_handler($atts)
6
+ {
7
+ extract(shortcode_atts(array(
8
+ 'video_id' => '',
9
+ 'width' => '',
10
+ 'height' => '',
11
+ 'anchor' => '',
12
+ 'auto_thumb' => '',
13
+ ), $atts));
14
+ if(empty($video_id) || empty($width) || empty($height)){
15
+ return "<p>Error! You must specify a value for the Video ID, Width, Height and Anchor parameters to use this shortcode!</p>";
16
+ }
17
+ if(empty($auto_thumb) && empty($anchor)){
18
+ return "<p>Error! You must specify an anchor parameter if you are not using the auto_thumb option.</p>";
19
+ }
20
+
21
+ $atts['vid_type'] = "vimeo";
22
+ if (preg_match("/http/", $anchor)){ // Use the image as the anchor
23
+ $anchor_replacement = '<img src="'.$anchor.'" class="video_lightbox_anchor_image" alt="" />';
24
+ }
25
+ else if($auto_thumb == "1")
26
+ {
27
+ $anchor_replacement = wp_vid_lightbox_get_auto_thumb($atts);
28
+ }
29
+ else {
30
+ $anchor_replacement = $anchor;
31
+ }
32
+ $href_content = 'http://vimeo.com/'.$video_id.'?width='.$width.'&amp;height='.$height;
33
+ $output = "";
34
+ $output .= '<a rel="'.WPVL_PRETTYPHOTO_REL.'" href="'.$href_content.'" title="">'.$anchor_replacement.'</a>';
35
+ return $output;
36
+ }
37
+
38
+ function wp_vid_lightbox_youtube_handler($atts)
39
+ {
40
+ extract(shortcode_atts(array(
41
+ 'video_id' => '',
42
+ 'width' => '',
43
+ 'height' => '',
44
+ 'anchor' => '',
45
+ 'auto_thumb' => '',
46
+ ), $atts));
47
+ if(empty($video_id) || empty($width) || empty($height)){
48
+ return "<p>Error! You must specify a value for the Video ID, Width, Height parameters to use this shortcode!</p>";
49
+ }
50
+ if(empty($auto_thumb) && empty($anchor)){
51
+ return "<p>Error! You must specify an anchor parameter if you are not using the auto_thumb option.</p>";
52
+ }
53
+
54
+ $atts['vid_type'] = "youtube";
55
+ if(preg_match("/http/", $anchor)){ // Use the image as the anchor
56
+ $anchor_replacement = '<img src="'.$anchor.'" class="video_lightbox_anchor_image" alt="" />';
57
+ }
58
+ else if($auto_thumb == "1")
59
+ {
60
+ $anchor_replacement = wp_vid_lightbox_get_auto_thumb($atts);
61
+ }
62
+ else{
63
+ $anchor_replacement = $anchor;
64
+ }
65
+ $href_content = 'https://www.youtube.com/watch?v='.$video_id.'&amp;width='.$width.'&amp;height='.$height;
66
+ $output = '<a rel="'.WPVL_PRETTYPHOTO_REL.'" href="'.$href_content.'" title="">'.$anchor_replacement.'</a>';
67
+ return $output;
68
+ }
69
+
70
+ function wp_vid_lightbox_get_auto_thumb($atts)
71
+ {
72
+ $video_id = $atts['video_id'];
73
+ $pieces = explode("&", $video_id);
74
+ $video_id = $pieces[0];
75
+
76
+ $anchor_replacement = "";
77
+ if($atts['vid_type']=="youtube")
78
+ {
79
+ $anchor_replacement = '<div class="wpvl_auto_thumb_box_wrapper"><div class="wpvl_auto_thumb_box">';
80
+ $anchor_replacement .= '<img src="https://img.youtube.com/vi/'.$video_id.'/0.jpg" class="video_lightbox_auto_anchor_image" alt="" />';
81
+ $anchor_replacement .= '<div class="wpvl_auto_thumb_play"><img src="'.WP_VID_LIGHTBOX_URL.'/images/play.png" class="wpvl_playbutton" /></div>';
82
+ $anchor_replacement .= '</div></div>';
83
+ }
84
+ else if($atts['vid_type']=="vimeo")
85
+ {
86
+ $VideoInfo = wp_vid_lightbox_getVimeoInfo($video_id);
87
+ $thumb = $VideoInfo['thumbnail_medium'];
88
+ //print_r($VideoInfo);
89
+ $anchor_replacement = '<div class="wpvl_auto_thumb_box_wrapper"><div class="wpvl_auto_thumb_box">';
90
+ $anchor_replacement .= '<img src="'.$thumb.'" class="video_lightbox_auto_anchor_image" alt="" />';
91
+ $anchor_replacement .= '<div class="wpvl_auto_thumb_play"><img src="'.WP_VID_LIGHTBOX_URL.'/images/play.png" class="wpvl_playbutton" /></div>';
92
+ $anchor_replacement .= '</div></div>';
93
+ }
94
+ else
95
+ {
96
+ wp_die("<p>no video type specified</p>");
97
+ }
98
+ return $anchor_replacement;
99
+ }
100
+
101
+ function wp_vid_lightbox_getVimeoInfo($id)
102
+ {
103
+ if (!function_exists('curl_init')) die('CURL is not installed!');
104
+ $ch = curl_init();
105
+ curl_setopt($ch, CURLOPT_URL, "http://vimeo.com/api/v2/video/$id.php");
106
+ curl_setopt($ch, CURLOPT_HEADER, 0);
107
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
108
+ curl_setopt($ch, CURLOPT_TIMEOUT, 10);
109
+ $output = unserialize(curl_exec($ch));
110
+ $output = $output[0];
111
+ curl_close($ch);
112
+ return $output;
113
+ }
114
+
115
+ function wp_vid_lightbox_enqueue_script()
116
+ {
117
+ if(get_option('wpvl_enable_jquery')=='1')
118
+ {
119
+ wp_enqueue_script('jquery');
120
+ }
121
+ if(get_option('wpvl_enable_prettyPhoto')=='1')
122
+ {
123
+ $wpvl_prettyPhoto = WP_Video_Lightbox_prettyPhoto::get_instance();
124
+ wp_register_script('jquery.prettyphoto', WP_VID_LIGHTBOX_URL.'/js/jquery.prettyPhoto.js', array('jquery'), WPVL_PRETTYPHOTO_VERSION);
125
+ wp_enqueue_script('jquery.prettyphoto');
126
+ wp_register_script('video-lightbox', WP_VID_LIGHTBOX_URL.'/js/video-lightbox.js', array('jquery'), WPVL_PRETTYPHOTO_VERSION);
127
+ wp_enqueue_script('video-lightbox');
128
+ wp_register_style('jquery.prettyphoto', WP_VID_LIGHTBOX_URL.'/css/prettyPhoto.css');
129
+ wp_enqueue_style('jquery.prettyphoto');
130
+ wp_register_style('video-lightbox', WP_VID_LIGHTBOX_URL.'/wp-video-lightbox.css');
131
+ wp_enqueue_style('video-lightbox');
132
+
133
+ wp_localize_script('video-lightbox', 'vlpp_vars', array(
134
+ 'prettyPhoto_rel' => WPVL_PRETTYPHOTO_REL,
135
+ 'animation_speed' => $wpvl_prettyPhoto->animation_speed,
136
+ 'slideshow' => $wpvl_prettyPhoto->slideshow,
137
+ 'autoplay_slideshow' => $wpvl_prettyPhoto->autoplay_slideshow,
138
+ 'opacity' => $wpvl_prettyPhoto->opacity,
139
+ 'show_title' => $wpvl_prettyPhoto->show_title,
140
+ 'allow_resize' => $wpvl_prettyPhoto->allow_resize,
141
+ 'allow_expand' => $wpvl_prettyPhoto->allow_expand,
142
+ 'default_width' => $wpvl_prettyPhoto->default_width,
143
+ 'default_height' => $wpvl_prettyPhoto->default_height,
144
+ 'counter_separator_label' => $wpvl_prettyPhoto->counter_separator_label,
145
+ 'theme' => $wpvl_prettyPhoto->theme,
146
+ 'horizontal_padding' => $wpvl_prettyPhoto->horizontal_padding,
147
+ 'hideflash' => $wpvl_prettyPhoto->hideflash,
148
+ 'wmode' => $wpvl_prettyPhoto->wmode,
149
+ 'autoplay' => $wpvl_prettyPhoto->autoplay,
150
+ 'modal' => $wpvl_prettyPhoto->modal,
151
+ 'deeplinking' => $wpvl_prettyPhoto->deeplinking,
152
+ 'overlay_gallery' => $wpvl_prettyPhoto->overlay_gallery,
153
+ 'overlay_gallery_max' => $wpvl_prettyPhoto->overlay_gallery_max,
154
+ 'keyboard_shortcuts' => $wpvl_prettyPhoto->keyboard_shortcuts,
155
+ 'ie6_fallback' => $wpvl_prettyPhoto->ie6_fallback
156
+ )
157
+ );
158
+ }
159
+ }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WP Video Lightbox ===
2
  Contributors: Tips and Tricks HQ, Ruhul Amin
3
  Donate link: http://www.tipsandtricks-hq.com/
4
- Tags: wordpress lightbox, wordpress video lightbox, video lightbox, wp video lightbox, wordpress video embed, add video to wordpress, gallery, image, images, lightbox, lightview, overlay, photo, photos, picture, video
5
  Requires at least: 3.0
6
- Tested up to: 3.6
7
- Stable tag: 1.6.1
8
  License: GPLv2 or later
9
 
10
  Very easy to use WordPress lightbox plugin to display YouTube and Vimeo videos in an elegant lightbox overlay.
@@ -15,7 +15,51 @@ The WordPress Video Lightbox plugin allows you to embed videos on a page using l
15
 
16
  This plugin can be used to display images, flash, YouTube, Vimeo, iFrame etc in a lightbox overlay. The embedded videos can be viewed on iPhone and iPad too.
17
 
18
- For video tutorial, screenshots, detailed documentation, support and updates, please visit: [WP Video Lightbox plugin page](http://www.tipsandtricks-hq.com/?p=2700)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  == Usage ==
21
 
@@ -38,21 +82,35 @@ Yes
38
  = Can this plugin be used to do lightbox on images? =
39
  Yes
40
 
41
- = Can this plugin automatically create a thumbnail/anchor image from the YouTube video?
42
  Yes
43
 
44
  == Screenshots ==
45
 
46
  Please see this page for screenshots:
47
- http://www.tipsandtricks-hq.com/?p=2700
48
 
49
  == Upgrade Notice ==
50
 
51
  None
52
 
53
  == Changelog ==
54
- 1.6.1 - Added https support for YouTube video.
55
- 1.6 - Added an option to automatically create and use the thumbnail of the YouTube or Vimeo video as the anchor image.
56
- 1.5 - Made some improvements as to how the JavaScript code is loaded in the plugin. WordPress 3.6 compatibility.
57
- 1.4 - added a feature in the shortcode to turn off the related video display after the playback
58
- 1.3 - First commit to the wordpress repository
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  === WP Video Lightbox ===
2
  Contributors: Tips and Tricks HQ, Ruhul Amin
3
  Donate link: http://www.tipsandtricks-hq.com/
4
+ Tags: wordpress lightbox, wordpress video lightbox, video lightbox, wp video lightbox, wordpress video embed, add video to wordpress, gallery, image, images, lightbox, lightview, overlay, photo, photos, picture, video
5
  Requires at least: 3.0
6
+ Tested up to: 3.7
7
+ Stable tag: 1.6.2
8
  License: GPLv2 or later
9
 
10
  Very easy to use WordPress lightbox plugin to display YouTube and Vimeo videos in an elegant lightbox overlay.
15
 
16
  This plugin can be used to display images, flash, YouTube, Vimeo, iFrame etc in a lightbox overlay. The embedded videos can be viewed on iPhone and iPad too.
17
 
18
+ = Embedding Vimeo Video =
19
+
20
+ You can embed a vimeo video using the following shortcode in a WordPress post or page:
21
+
22
+ `[video_lightbox_vimeo5 video_id="13562192" width="640" height="480" anchor="click here to open vimeo video"]`
23
+ `[video_lightbox_vimeo5 video_id="13562192" width="640" height="480" anchor="http://www.example.com/images/vimeo-thumb.jpg"]`
24
+
25
+ You need to replace the value of "video_id" with your actual vimeo video ID. When a user clicks on the anchor text/image your vimeo video will pop up in lightbox.
26
+
27
+ = Embedding YouTube Video =
28
+
29
+ You can embed a YouTube video using the following shortcode in a WordPress post or page:
30
+
31
+ `[video_lightbox_youtube video_id="G7z74BvLWUg" width="640" height="480" anchor="click here to open YouTube video"]`
32
+ `[video_lightbox_youtube video_id="G7z74BvLWUg" width="640" height="480" anchor="http://www.example.com/images/youtube-thumb.jpg"]`
33
+
34
+ You need to replace the value of "video_id" with your actual YouTube video ID. You can also control the size of the lightbox window by customizing the width and height parameters.
35
+
36
+ = Features/Settings Configuration =
37
+
38
+ Once you have installed the plugin you can configure some options to customize the popup. The settings menu can be accessed from "Settings->Video Lightbox->prettyPhoto".
39
+
40
+ * Enable prettyPhoto: Check this option if you want to use the prettyPhoto library
41
+ * Animation speed: fast / slow / normal [default: fast]
42
+ * Autoplay slideshow: true / false [default: false]
43
+ * Opacity: Value between 0 and 1 [default: 0.8]
44
+ * Show title: true / false [default: true]
45
+ * Allow resize: Resize the photos bigger than viewport. true / false [default: true]
46
+ * Allow expand: Allow the user to expand a resized image. true / false [default: true]
47
+ * Default width: default width of the lightbox window [default: 640, you can override it using the width parameter in the shortcode]
48
+ * Default height: default height of the lightbox window [default: 480, you can override it using the height parameter in the shortcode]
49
+ * Counter separator label: The separator for the gallery counter in lightbox [default: /]
50
+ * Theme: theme for the lightbox window - Default, Light Rounded, Dark Rounded, Light Square, Dark Square, Facebook
51
+ * Horizontal padding: The padding on each side of the lightbox window [default: 20]
52
+ * Hide Flash: Hides all the flash objects on a page, set to true if flash appears over prettyPhoto [default: false]
53
+ * wmode: the flash wmode attribute [default: opaque]
54
+ * Autoplay: Automatically start videos: true / false [default: true]
55
+ * Modal: If set to true, only the close button will close the window [default: false]
56
+ * Deeplinking: Allow prettyPhoto to update the url to enable deeplinking. [default: true]
57
+ * Overlay gallery: If this enabled, a gallery will overlay the fullscreen image on mouse over [default: true]
58
+ * Overlay gallery max: Maximum number of pictures in the overlay gallery [default: 30]
59
+ * Keyboard shortcuts: Set to false if you open forms inside prettyPhoto [default: true]
60
+ * IE6 fallback: compatibility fallback for IE6 [default: true]
61
+
62
+ For video tutorial, screenshots, detailed documentation, support and updates, please visit: [WP Video Lightbox plugin page](http://www.tipsandtricks-hq.com/wordpress-video-lightbox-plugin-display-videos-in-a-fancy-lightbox-overlay-2700)
63
 
64
  == Usage ==
65
 
82
  = Can this plugin be used to do lightbox on images? =
83
  Yes
84
 
85
+ = Can this plugin automatically create a thumbnail/anchor image from the YouTube video? =
86
  Yes
87
 
88
  == Screenshots ==
89
 
90
  Please see this page for screenshots:
91
+ http://www.tipsandtricks-hq.com/wordpress-video-lightbox-plugin-display-videos-in-a-fancy-lightbox-overlay-2700
92
 
93
  == Upgrade Notice ==
94
 
95
  None
96
 
97
  == Changelog ==
98
+
99
+ = 1.6.2 =
100
+ * Created a settings menu for the plugin
101
+ * Updated the prettyPhoto library to 3.1.5
102
+
103
+ = 1.6.1 =
104
+ * Added https support for YouTube video.
105
+
106
+ = 1.6 =
107
+ * Added an option to automatically create and use the thumbnail of the YouTube or Vimeo video as the anchor image.
108
+
109
+ = 1.5 =
110
+ * Made some improvements as to how the JavaScript code is loaded in the plugin. WordPress 3.6 compatibility.
111
+
112
+ = 1.4 =
113
+ * added a feature in the shortcode to turn off the related video display after the playback
114
+
115
+ = 1.3 =
116
+ * First commit to the wordpress repository
settings.php ADDED
@@ -0,0 +1,365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Video_Lightbox_Settings_Page
3
+ {
4
+
5
+ function __construct() {
6
+ //add_action( 'init', array( &$this, 'load_settings' ) );
7
+ add_action( 'admin_menu', array( &$this, 'add_options_menu' ) );
8
+ }
9
+
10
+ function add_options_menu(){
11
+ add_options_page('Video Lightbox Settings', 'Video Lightbox', 'manage_options', 'wp_video_lightbox', array(&$this, 'display_settings_page'));
12
+ }
13
+
14
+ function display_settings_page()
15
+ {
16
+ $wpvl_plugin_tabs = array(
17
+ 'wp_video_lightbox' => 'General',
18
+ 'wp_video_lightbox&action=prettyPhoto' => 'prettyPhoto'
19
+ );
20
+ echo '<div class="wrap">'.screen_icon().'<h2>WP Video Lightbox v'.WP_VIDEO_LIGHTBOX_VERSION.'</h2>';;
21
+ echo '<div id="poststuff"><div id="post-body">';
22
+
23
+ if(isset($_GET['page'])){
24
+ $current = $_GET['page'];
25
+ if(isset($_GET['action'])){
26
+ $current .= "&action=".$_GET['action'];
27
+ }
28
+ }
29
+ $content = '';
30
+ $content .= '<h2 class="nav-tab-wrapper">';
31
+ foreach($wpvl_plugin_tabs as $location => $tabname)
32
+ {
33
+ if($current == $location){
34
+ $class = ' nav-tab-active';
35
+ } else{
36
+ $class = '';
37
+ }
38
+ $content .= '<a class="nav-tab'.$class.'" href="?page='.$location.'">'.$tabname.'</a>';
39
+ }
40
+ $content .= '</h2>';
41
+ echo $content;
42
+
43
+ switch ($_GET['action'])
44
+ {
45
+ case 'prettyPhoto':
46
+ $this->prettyPhoto_settings_section();
47
+ break;
48
+ default:
49
+ $this->general_settings_section();
50
+ break;
51
+ }
52
+
53
+ echo '</div></div>';
54
+ echo '</div>';
55
+ }
56
+
57
+ function general_settings_section()
58
+ {
59
+ if (isset($_POST['wpvl_general_settings_update']))
60
+ {
61
+ $nonce = $_REQUEST['_wpnonce'];
62
+ if ( !wp_verify_nonce($nonce, 'wpvl_general_settings')){
63
+ wp_die('Error! Nonce Security Check Failed! Go back to general menu and save the settings again.');
64
+ }
65
+
66
+ update_option('wpvl_enable_jquery', ($_POST["enable_jquery"]=='1')?'1':'');
67
+
68
+ echo '<div id="message" class="updated fade"><p><strong>';
69
+ echo 'prettyPhoto Settings Updated!';
70
+ echo '</strong></p></div>';
71
+ }
72
+ ?>
73
+
74
+ <div style="background: none repeat scroll 0 0 #FFF6D5;border: 1px solid #D1B655;color: #3F2502;margin: 10px 0;padding: 5px 5px 5px 10px;text-shadow: 1px 1px #FFFFFF;">
75
+ <p><?php _e("For more information, updates, detailed documentation and video tutorial, please visit:", "WPVL"); ?><br />
76
+ <a href="http://www.tipsandtricks-hq.com/wordpress-video-lightbox-plugin-display-videos-in-a-fancy-lightbox-overlay-2700" target="_blank"><?php _e("WP Video Lightbox Homepage", "WPVL"); ?></a></p>
77
+ </div>
78
+
79
+ <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
80
+ <?php wp_nonce_field('wpvl_general_settings'); ?>
81
+
82
+ <table class="form-table">
83
+
84
+ <tbody>
85
+
86
+ <tr valign="top">
87
+ <th scope="row">Enable jQuery</th>
88
+ <td> <fieldset><legend class="screen-reader-text"><span>Enable jQuery</span></legend><label for="enable_jquery">
89
+ <input name="enable_jquery" type="checkbox" id="enable_jquery" <?php if(get_option('wpvl_enable_jquery')== '1') echo ' checked="checked"';?> value="1">
90
+ Check this option if you want to enable jQuery library</label>
91
+ </fieldset></td>
92
+ </tr>
93
+
94
+ </tbody>
95
+
96
+ </table>
97
+
98
+ <p class="submit"><input type="submit" name="wpvl_general_settings_update" id="wpvl_general_settings_update" class="button button-primary" value="Save Changes"></p></form>
99
+
100
+ <?php
101
+ }
102
+
103
+ function prettyPhoto_settings_section()
104
+ {
105
+ if (isset($_POST['wpvl_prettyPhoto_update_settings']))
106
+ {
107
+ $nonce = $_REQUEST['_wpnonce'];
108
+ if ( !wp_verify_nonce($nonce, 'wpvl_prettyPhoto_settings')){
109
+ wp_die('Error! Nonce Security Check Failed! Go back to prettyPhoto menu and save the settings again.');
110
+ }
111
+ $wpvl_prettyPhoto = WP_Video_Lightbox_prettyPhoto::get_instance();
112
+ update_option('wpvl_enable_prettyPhoto', ($_POST["enable_prettyPhoto"]=='1')?'1':'');
113
+ $wpvl_prettyPhoto->animation_speed = trim($_POST["animation_speed"]);
114
+ $wpvl_prettyPhoto->slideshow = trim($_POST["slideshow"]);
115
+ $wpvl_prettyPhoto->autoplay_slideshow = ($_POST["autoplay_slideshow"]=='1')?'true':'false';
116
+ $wpvl_prettyPhoto->opacity = trim($_POST["opacity"]);
117
+ $wpvl_prettyPhoto->show_title = ($_POST["show_title"]=='1')?'true':'false';
118
+ $wpvl_prettyPhoto->allow_resize = ($_POST["allow_resize"]=='1')?'true':'false';
119
+ $wpvl_prettyPhoto->allow_expand = ($_POST["allow_expand"]=='1')?'true':'false';
120
+ $wpvl_prettyPhoto->default_width = trim($_POST["default_width"]);
121
+ $wpvl_prettyPhoto->default_height = trim($_POST["default_height"]);
122
+ $wpvl_prettyPhoto->counter_separator_label = trim($_POST["counter_separator_label"]);
123
+ $wpvl_prettyPhoto->theme = trim($_POST["theme"]);
124
+ $wpvl_prettyPhoto->horizontal_padding = trim($_POST["horizontal_padding"]);
125
+ $wpvl_prettyPhoto->hideflash = ($_POST["hideflash"]=='1')?'true':'false';
126
+ $wpvl_prettyPhoto->wmode = trim($_POST["wmode"]);
127
+ $wpvl_prettyPhoto->autoplay = ($_POST["autoplay"]=='1')?'true':'false';
128
+ $wpvl_prettyPhoto->modal = ($_POST["modal"]=='1')?'true':'false';
129
+ $wpvl_prettyPhoto->deeplinking = ($_POST["deeplinking"]=='1')?'true':'false';
130
+ $wpvl_prettyPhoto->overlay_gallery = ($_POST["overlay_gallery"]=='1')?'true':'false';
131
+ $wpvl_prettyPhoto->overlay_gallery_max = trim($_POST["overlay_gallery_max"]);
132
+ $wpvl_prettyPhoto->keyboard_shortcuts = ($_POST["keyboard_shortcuts"]=='1')?'true':'false';
133
+ $wpvl_prettyPhoto->ie6_fallback = ($_POST["ie6_fallback"]=='1')?'true':'false';
134
+
135
+ WP_Video_Lightbox_prettyPhoto::save_object($wpvl_prettyPhoto);
136
+
137
+ echo '<div id="message" class="updated fade"><p><strong>';
138
+ echo 'prettyPhoto Settings Updated!';
139
+ echo '</strong></p></div>';
140
+ }
141
+ $wpvl_prettyPhoto = WP_Video_Lightbox_prettyPhoto::get_instance();
142
+ ?>
143
+
144
+ <div style="background: none repeat scroll 0 0 #FFF6D5;border: 1px solid #D1B655;color: #3F2502;margin: 10px 0;padding: 5px 5px 5px 10px;text-shadow: 1px 1px #FFFFFF;">
145
+ <p><?php _e("For more information, updates, detailed documentation and video tutorial, please visit:", "WPVL"); ?><br />
146
+ <a href="http://www.tipsandtricks-hq.com/wordpress-video-lightbox-plugin-display-videos-in-a-fancy-lightbox-overlay-2700" target="_blank"><?php _e("WP Video Lightbox Homepage", "WPVL"); ?></a></p>
147
+ </div>
148
+
149
+ <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
150
+ <?php wp_nonce_field('wpvl_prettyPhoto_settings'); ?>
151
+
152
+ <table class="form-table">
153
+
154
+ <tbody>
155
+
156
+ <tr valign="top">
157
+ <th scope="row">Enable prettyPhoto</th>
158
+ <td> <fieldset><legend class="screen-reader-text"><span>Enable prettyPhoto</span></legend><label for="enable_prettyPhoto">
159
+ <input name="enable_prettyPhoto" type="checkbox" id="enable_prettyPhoto" <?php if(get_option('wpvl_enable_prettyPhoto')=='1') echo ' checked="checked"';?> value="1">
160
+ Check this option if you want to enable prettyPhoto library</label>
161
+ </fieldset></td>
162
+ </tr>
163
+
164
+ <tr valign="top">
165
+ <th scope="row"><label for="animation_speed">Animation speed</label></th>
166
+ <td>
167
+ <select name="animation_speed" id="animation_speed">
168
+ <option <?php echo ($wpvl_prettyPhoto->animation_speed==='fast')?'selected="selected"':'';?> value="fast">Fast</option>
169
+ <option <?php echo ($wpvl_prettyPhoto->animation_speed==='slow')?'selected="selected"':'';?> value="slow">Slow</option>
170
+ <option <?php echo ($wpvl_prettyPhoto->animation_speed==='normal')?'selected="selected"':'';?> value="normal">Normal</option>
171
+ </select>
172
+ <!-- <span id="utc-time"><abbr title="Coordinated Universal Time">UTC</abbr> time is <code>2013-11-01 3:56:07</code></span> -->
173
+ <p class="description">fast / slow / normal [default: fast]</p>
174
+ </td>
175
+ </tr>
176
+
177
+ <tr valign="top">
178
+ <th scope="row"><label for="slideshow">Slideshow</label></th>
179
+ <td><input name="slideshow" type="text" id="slideshow" value="<?php echo $wpvl_prettyPhoto->slideshow; ?>" class="regular-text">
180
+ <p class="description">false OR interval time in ms [default: 5000]</p></td>
181
+ </tr>
182
+
183
+ <tr valign="top">
184
+ <th scope="row">Autoplay slideshow</th>
185
+ <td> <fieldset><legend class="screen-reader-text"><span>Autoplay slideshow</span></legend><label for="autoplay_slideshow">
186
+ <input name="autoplay_slideshow" type="checkbox" id="autoplay_slideshow" <?php if($wpvl_prettyPhoto->autoplay_slideshow == 'true') echo ' checked="checked"';?> value="1">
187
+ true / false [default: false]</label>
188
+ </fieldset></td>
189
+ </tr>
190
+
191
+ <tr valign="top">
192
+ <th scope="row"><label for="opacity">Opacity</label></th>
193
+ <td><input name="opacity" type="text" id="opacity" value="<?php echo $wpvl_prettyPhoto->opacity; ?>" class="regular-text">
194
+ <p class="description">Value between 0 and 1 [default: 0.8]</p></td>
195
+ </tr>
196
+
197
+ <tr valign="top">
198
+ <th scope="row">Show title</th>
199
+ <td> <fieldset><legend class="screen-reader-text"><span>Show title</span></legend><label for="show_title">
200
+ <input name="show_title" type="checkbox" id="show_title" <?php if($wpvl_prettyPhoto->show_title == 'true') echo ' checked="checked"';?> value="1">
201
+ true / false [default: true]</label>
202
+ </fieldset></td>
203
+ </tr>
204
+
205
+ <tr valign="top">
206
+ <th scope="row">Allow resize</th>
207
+ <td> <fieldset><legend class="screen-reader-text"><span>Allow resize</span></legend><label for="allow_resize">
208
+ <input name="allow_resize" type="checkbox" id="allow_resize" <?php if($wpvl_prettyPhoto->allow_resize == 'true') echo ' checked="checked"';?> value="1">
209
+ Resize the photos bigger than viewport. true / false [default: true]</label>
210
+ </fieldset></td>
211
+ </tr>
212
+
213
+ <tr valign="top">
214
+ <th scope="row">Allow expand</th>
215
+ <td> <fieldset><legend class="screen-reader-text"><span>Allow expand</span></legend><label for="allow_expand">
216
+ <input name="allow_expand" type="checkbox" id="allow_expand" <?php if($wpvl_prettyPhoto->allow_resize == 'true') echo ' checked="checked"';?> value="1">
217
+ Allow the user to expand a resized image. true / false [default: true]</label>
218
+ </fieldset></td>
219
+ </tr>
220
+
221
+ <tr valign="top">
222
+ <th scope="row"><label for="opacity">Default width</label></th>
223
+ <td><input name="default_width" type="text" id="default_width" value="<?php echo $wpvl_prettyPhoto->default_width; ?>" class="regular-text">
224
+ <p class="description">[default: 640]</p></td>
225
+ </tr>
226
+
227
+ <tr valign="top">
228
+ <th scope="row"><label for="opacity">Default height</label></th>
229
+ <td><input name="default_height" type="text" id="default_height" value="<?php echo $wpvl_prettyPhoto->default_height; ?>" class="regular-text">
230
+ <p class="description">[default: 480]</p></td>
231
+ </tr>
232
+
233
+ <tr valign="top">
234
+ <th scope="row"><label for="opacity">Counter separator label</label></th>
235
+ <td><input name="counter_separator_label" type="text" id="counter_separator_label" value="<?php echo $wpvl_prettyPhoto->counter_separator_label; ?>" class="regular-text">
236
+ <p class="description">The separator for the gallery counter 1 "of" 2 [default: /]</p></td>
237
+ </tr>
238
+
239
+ <tr valign="top">
240
+ <th scope="row"><label for="theme">Theme</label></th>
241
+ <td>
242
+ <select name="theme" id="theme">
243
+ <option selected="selected" value="pp_default">Default</option>
244
+ <option <?php echo ($wpvl_prettyPhoto->theme==='light_rounded')?'selected="selected"':'';?> value="light_rounded">Light Rounded</option>
245
+ <option <?php echo ($wpvl_prettyPhoto->theme==='dark_rounded')?'selected="selected"':'';?> value="dark_rounded">Dark Rounded</option>
246
+ <option <?php echo ($wpvl_prettyPhoto->theme==='light_square')?'selected="selected"':'';?> value="light_square">Light Square</option>
247
+ <option <?php echo ($wpvl_prettyPhoto->theme==='dark_square')?'selected="selected"':'';?> value="dark_square">Dark Square</option>
248
+ <option <?php echo ($wpvl_prettyPhoto->theme==='facebook')?'selected="selected"':'';?> value="facebook">Facebook</option>
249
+ </select>
250
+ <!-- <span id="utc-time"><abbr title="Coordinated Universal Time">UTC</abbr> time is <code>2013-11-01 3:56:07</code></span> -->
251
+ <p class="description">Select a theme for the lightbox window</p>
252
+ </td>
253
+ </tr>
254
+
255
+ <tr valign="top">
256
+ <th scope="row"><label for="opacity">Horizontal padding</label></th>
257
+ <td><input name="horizontal_padding" type="text" id="horizontal_padding" value="<?php echo $wpvl_prettyPhoto->horizontal_padding; ?>" class="regular-text">
258
+ <p class="description">The padding on each side of the picture [default: 20]</p></td>
259
+ </tr>
260
+
261
+ <tr valign="top">
262
+ <th scope="row">Hide Flash</th>
263
+ <td> <fieldset><legend class="screen-reader-text"><span>Hide Flash</span></legend><label for="hideflash">
264
+ <input name="hideflash" type="checkbox" id="hideflash" <?php if($wpvl_prettyPhoto->hideflash == 'true') echo ' checked="checked"';?> value="1">
265
+ Hides all the flash objects on a page, set to TRUE if flash appears over prettyPhoto [default: false]</label>
266
+ </fieldset></td>
267
+ </tr>
268
+
269
+ <tr valign="top">
270
+ <th scope="row"><label for="animation_speed">wmode</label></th>
271
+ <td>
272
+ <select name="wmode" id="wmode">
273
+ <option selected="selected" value="opaque">opaque</option>
274
+ </select>
275
+ <!-- <span id="utc-time"><abbr title="Coordinated Universal Time">UTC</abbr> time is <code>2013-11-01 3:56:07</code></span> -->
276
+ <p class="description">Set the flash wmode attribute [default: opaque]</p>
277
+ </td>
278
+ </tr>
279
+
280
+ <tr valign="top">
281
+ <th scope="row">Autoplay</th>
282
+ <td> <fieldset><legend class="screen-reader-text"><span>Autoplay</span></legend><label for="autoplay">
283
+ <input name="autoplay" type="checkbox" id="autoplay" <?php if($wpvl_prettyPhoto->autoplay == 'true') echo ' checked="checked"';?> value="1">
284
+ Automatically start videos: true / false [default: true]</label>
285
+ </fieldset></td>
286
+ </tr>
287
+
288
+ <tr valign="top">
289
+ <th scope="row">Modal</th>
290
+ <td> <fieldset><legend class="screen-reader-text"><span>Modal</span></legend><label for="modal">
291
+ <input name="modal" type="checkbox" id="modal" <?php if($wpvl_prettyPhoto->modal == 'true') echo ' checked="checked"';?> value="1">
292
+ If set to true, only the close button will close the window [default: false]</label>
293
+ </fieldset></td>
294
+ </tr>
295
+
296
+ <tr valign="top">
297
+ <th scope="row">Deeplinking</th>
298
+ <td> <fieldset><legend class="screen-reader-text"><span>Deeplinking</span></legend><label for="deeplinking">
299
+ <input name="deeplinking" type="checkbox" id="deeplinking" <?php if($wpvl_prettyPhoto->deeplinking == 'true') echo ' checked="checked"';?> value="1">
300
+ Allow prettyPhoto to update the url to enable deeplinking. [default: true]</label>
301
+ </fieldset></td>
302
+ </tr>
303
+
304
+ <tr valign="top">
305
+ <th scope="row">Overlay gallery</th>
306
+ <td> <fieldset><legend class="screen-reader-text"><span>Overlay gallery</span></legend><label for="overlay_gallery">
307
+ <input name="overlay_gallery" type="checkbox" id="overlay_gallery" <?php if($wpvl_prettyPhoto->overlay_gallery == 'true') echo ' checked="checked"';?> value="1">
308
+ If set to true, a gallery will overlay the fullscreen image on mouse over [default: true]</label>
309
+ </fieldset></td>
310
+ </tr>
311
+
312
+ <tr valign="top">
313
+ <th scope="row"><label for="opacity">Overlay gallery max</label></th>
314
+ <td><input name="overlay_gallery_max" type="text" id="overlay_gallery_max" value="<?php echo $wpvl_prettyPhoto->overlay_gallery_max; ?>" class="regular-text">
315
+ <p class="description">Maximum number of pictures in the overlay gallery [default: 30]</p></td>
316
+ </tr>
317
+
318
+ <tr valign="top">
319
+ <th scope="row">Keyboard shortcuts</th>
320
+ <td> <fieldset><legend class="screen-reader-text"><span>Keyboard shortcuts</span></legend><label for="keyboard_shortcuts">
321
+ <input name="keyboard_shortcuts" type="checkbox" id="keyboard_shortcuts" <?php if($wpvl_prettyPhoto->keyboard_shortcuts == 'true') echo ' checked="checked"';?> value="1">
322
+ Set to false if you open forms inside prettyPhoto [default: true]</label>
323
+ </fieldset></td>
324
+ </tr>
325
+
326
+ <tr valign="top">
327
+ <th scope="row">IE6 fallback</th>
328
+ <td> <fieldset><legend class="screen-reader-text"><span>IE6 fallback</span></legend><label for="ie6_fallback">
329
+ <input name="ie6_fallback" type="checkbox" id="ie6_fallback" <?php if($wpvl_prettyPhoto->ie6_fallback == 'true') echo ' checked="checked"';?> value="1">
330
+ compatibility fallback for IE6 [default: true]</label>
331
+ </fieldset></td>
332
+ </tr>
333
+
334
+ </tbody>
335
+
336
+ </table>
337
+
338
+ <p class="submit"><input type="submit" name="wpvl_prettyPhoto_update_settings" id="wpvl_prettyPhoto_update_settings" class="button button-primary" value="Save Changes"></p></form>
339
+
340
+ <?php
341
+ }
342
+
343
+ function current_tab() {
344
+ $tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->plugin_settings_page_key;
345
+ return $tab;
346
+ }
347
+
348
+ /*
349
+ * Renders our tabs in the plugin options page,
350
+ * walks through the object's tabs array and prints
351
+ * them one by one. Provides the heading for the
352
+ * plugin_options_page method.
353
+ */
354
+ function plugin_options_tabs()
355
+ {
356
+ $current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->plugin_settings_page_key;
357
+ echo '<h2 class="nav-tab-wrapper">';
358
+ foreach ( $this->plugin_settings_tabs as $tab_key => $tab_caption )
359
+ {
360
+ $active = $current_tab == $tab_key ? 'nav-tab-active' : '';
361
+ echo '<a class="nav-tab ' . $active . '" href="?page=' . $this->plugin_options_key . '&tab=' . $tab_key . '">' . $tab_caption . '</a>';
362
+ }
363
+ echo '</h2>';
364
+ }
365
+ } //end class
wp-video-lightbox.php CHANGED
@@ -1,142 +1,107 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Video Lightbox
4
- Version: 1.6.1
5
  Plugin URI: http://www.tipsandtricks-hq.com/?p=2700
6
  Author: Tips and Tricks HQ, Ruhul Amin
7
  Author URI: http://www.tipsandtricks-hq.com/
8
  Description: Simple video lightbox plugin to display videos in a nice overlay popup. It also supports images, flash, YouTube, iFrame.
9
  */
10
- define('WP_LICENSE_MANAGER_VERSION', "1.6.1");
11
- define('WP_VID_LIGHTBOX_URL', plugins_url('',__FILE__));
12
 
13
- add_shortcode('video_lightbox_vimeo5', 'wp_vid_lightbox_vimeo5_handler');
14
- add_shortcode('video_lightbox_youtube', 'wp_vid_lightbox_youtube_handler');
15
-
16
- function wp_vid_lightbox_vimeo5_handler($atts)
17
  {
18
- extract(shortcode_atts(array(
19
- 'video_id' => '',
20
- 'width' => '',
21
- 'height' => '',
22
- 'anchor' => '',
23
- 'auto_thumb' => '',
24
- ), $atts));
25
- if(empty($video_id) || empty($width) || empty($height)){
26
- return "<p>Error! You must specify a value for the Video ID, Width, Height and Anchor parameters to use this shortcode!</p>";
27
- }
28
- if(empty($auto_thumb) && empty($anchor)){
29
- return "<p>Error! You must specify an anchor parameter if you are not using the auto_thumb option.</p>";
30
- }
31
-
32
- $atts['vid_type'] = "vimeo";
33
- if (preg_match("/http/", $anchor)){ // Use the image as the anchor
34
- $anchor_replacement = '<img src="'.$anchor.'" class="video_lightbox_anchor_image" alt="" />';
35
- }
36
- else if($auto_thumb == "1")
37
  {
38
- $anchor_replacement = wp_vid_lightbox_get_auto_thumb($atts);
39
- }
40
- else {
41
- $anchor_replacement = $anchor;
42
- }
43
- $href_content = 'http://vimeo.com/'.$video_id.'?width='.$width.'&amp;height='.$height;
44
- $output = "";
45
- $output .= '<a rel="wp-video-lightbox" href="'.$href_content.'" title="">'.$anchor_replacement.'</a>';
46
- return $output;
47
- }
48
-
49
- function wp_vid_lightbox_youtube_handler($atts)
50
- {
51
- extract(shortcode_atts(array(
52
- 'video_id' => '',
53
- 'width' => '',
54
- 'height' => '',
55
- 'anchor' => '',
56
- 'auto_thumb' => '',
57
- ), $atts));
58
- if(empty($video_id) || empty($width) || empty($height)){
59
- return "<p>Error! You must specify a value for the Video ID, Width, Height parameters to use this shortcode!</p>";
60
- }
61
- if(empty($auto_thumb) && empty($anchor)){
62
- return "<p>Error! You must specify an anchor parameter if you are not using the auto_thumb option.</p>";
63
- }
64
-
65
- $atts['vid_type'] = "youtube";
66
- if(preg_match("/http/", $anchor)){ // Use the image as the anchor
67
- $anchor_replacement = '<img src="'.$anchor.'" class="video_lightbox_anchor_image" alt="" />';
68
- }
69
- else if($auto_thumb == "1")
70
- {
71
- $anchor_replacement = wp_vid_lightbox_get_auto_thumb($atts);
72
- }
73
- else{
74
- $anchor_replacement = $anchor;
75
- }
76
- $href_content = 'https://www.youtube.com/watch?v='.$video_id.'&amp;width='.$width.'&amp;height='.$height;
77
- $output = '<a rel="wp-video-lightbox" href="'.$href_content.'" title="">'.$anchor_replacement.'</a>';
78
- return $output;
79
- }
80
 
81
- function wp_vid_lightbox_get_auto_thumb($atts)
82
- {
83
- $video_id = $atts['video_id'];
84
- $pieces = explode("&", $video_id);
85
- $video_id = $pieces[0];
 
86
 
87
- $anchor_replacement = "";
88
- if($atts['vid_type']=="youtube")
89
- {
90
- $anchor_replacement = '<div class="wpvl_auto_thumb_box_wrapper"><div class="wpvl_auto_thumb_box">';
91
- $anchor_replacement .= '<img src="https://img.youtube.com/vi/'.$video_id.'/0.jpg" class="video_lightbox_auto_anchor_image" alt="" />';
92
- $anchor_replacement .= '<div class="wpvl_auto_thumb_play"><img src="'.WP_VID_LIGHTBOX_URL.'/images/play.png" class="wpvl_playbutton" /></div>';
93
- $anchor_replacement .= '</div></div>';
94
- }
95
- else if($atts['vid_type']=="vimeo")
96
- {
97
- $VideoInfo = wp_vid_lightbox_getVimeoInfo($video_id);
98
- $thumb = $VideoInfo['thumbnail_medium'];
99
- //print_r($VideoInfo);
100
- $anchor_replacement = '<div class="wpvl_auto_thumb_box_wrapper"><div class="wpvl_auto_thumb_box">';
101
- $anchor_replacement .= '<img src="'.$thumb.'" class="video_lightbox_auto_anchor_image" alt="" />';
102
- $anchor_replacement .= '<div class="wpvl_auto_thumb_play"><img src="'.WP_VID_LIGHTBOX_URL.'/images/play.png" class="wpvl_playbutton" /></div>';
103
- $anchor_replacement .= '</div></div>';
104
- }
105
- else
106
- {
107
- wp_die("<p>no video type specified</p>");
108
- }
109
- return $anchor_replacement;
110
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
- function wp_vid_lightbox_getVimeoInfo($id)
113
- {
114
- if (!function_exists('curl_init')) die('CURL is not installed!');
115
- $ch = curl_init();
116
- curl_setopt($ch, CURLOPT_URL, "http://vimeo.com/api/v2/video/$id.php");
117
- curl_setopt($ch, CURLOPT_HEADER, 0);
118
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
119
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
120
- $output = unserialize(curl_exec($ch));
121
- $output = $output[0];
122
- curl_close($ch);
123
- return $output;
124
- }
125
-
126
- function wp_vid_lightbox_init()
127
- {
128
- if (!is_admin())
129
- {
130
- wp_enqueue_script('jquery');
131
- wp_register_script('jquery.prettyphoto', WP_VID_LIGHTBOX_URL.'/js/jquery.prettyPhoto.js', array('jquery'), '3.1.4');
132
- wp_enqueue_script('jquery.prettyphoto');
133
- wp_register_script('video-lightbox', WP_VID_LIGHTBOX_URL.'/js/video-lightbox.js', array('jquery'), '3.1.4');
134
- wp_enqueue_script('video-lightbox');
135
- wp_register_style('jquery.prettyphoto', WP_VID_LIGHTBOX_URL.'/css/prettyPhoto.css');
136
- wp_enqueue_style('jquery.prettyphoto');
137
- wp_register_style('video-lightbox', WP_VID_LIGHTBOX_URL.'/wp-video-lightbox.css');
138
- wp_enqueue_style('video-lightbox');
139
  }
140
- }
141
 
142
- add_action('init', 'wp_vid_lightbox_init');
 
 
1
  <?php
2
  /*
3
  Plugin Name: WP Video Lightbox
4
+ Version: 1.6.2
5
  Plugin URI: http://www.tipsandtricks-hq.com/?p=2700
6
  Author: Tips and Tricks HQ, Ruhul Amin
7
  Author URI: http://www.tipsandtricks-hq.com/
8
  Description: Simple video lightbox plugin to display videos in a nice overlay popup. It also supports images, flash, YouTube, iFrame.
9
  */
10
+ if (!defined('ABSPATH')) exit;
 
11
 
12
+ if (!class_exists('WP_Video_Lightbox'))
 
 
 
13
  {
14
+ class WP_Video_Lightbox
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  {
16
+ var $version = '1.6.2';
17
+ var $db_version = '1.0';
18
+ var $plugin_url;
19
+ var $plugin_path;
20
+ var $settings_obj;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
+ function __construct()
23
+ {
24
+ $this->define_constants();
25
+ $this->includes();
26
+ $this->loader_operations();
27
+ //Handle any db install and upgrade task
28
 
29
+ add_action( 'init', array( &$this, 'plugin_init' ), 0 );
30
+ add_action( 'wp_enqueue_scripts', array( &$this, 'plugin_scripts' ), 0 );
31
+ add_action( 'wp_footer', array( &$this, 'plugin_footer' ), 0 );
32
+ }
33
+
34
+ function define_constants(){
35
+ define('WP_VIDEO_LIGHTBOX_VERSION', $this->version);
36
+ define('WP_VID_LIGHTBOX_URL', $this->plugin_url());
37
+ define('WP_VIDEO_LIGHTBOX_PATH', $this->plugin_path());
38
+ define('WP_VIDEO_LIGHTBOX_DB_VERSION', $this->db_version);
39
+ define('WPVL_PRETTYPHOTO_REL', 'wp-video-lightbox');
40
+ define('WPVL_PRETTYPHOTO_VERSION', '3.1.5');
41
+ }
42
+
43
+ function includes() {
44
+ include_once('class-prettyphoto.php');
45
+ include_once('settings.php');
46
+ include_once('misc_functions.php');
47
+ }
48
+
49
+ function loader_operations(){
50
+ register_activation_hook( __FILE__, array(&$this, 'activate_handler') ); //activation hook
51
+ add_action('plugins_loaded',array(&$this, 'plugins_loaded_handler')); //plugins loaded hook
52
+ }
53
+
54
+ function plugins_loaded_handler() //Runs when plugins_loaded action gets fired
55
+ {
56
+ $this->do_db_upgrade_check();
57
+ $this->settings_obj = new Video_Lightbox_Settings_Page(); //Initialize settins menus
58
+ }
59
+
60
+ function activate_handler(){//Will run when the plugin activates only
61
+ //initialize settings
62
+ add_option('wpvl_enable_jquery', '1');
63
+ add_option('wpvl_enable_prettyPhoto', '1');
64
+ $wpvl_prettyPhoto = WP_Video_Lightbox_prettyPhoto::get_instance();
65
+ WP_Video_Lightbox_prettyPhoto::save_object($wpvl_prettyPhoto);
66
+ }
67
+
68
+ function do_db_upgrade_check(){
69
+ //NOP
70
+ }
71
+
72
+ function plugin_init(){
73
+ //add_filter('ngg_render_template',array(&$this, 'ngg_render_template_handler'),10,2);
74
+ if(!is_admin())
75
+ {
76
+
77
+ }
78
+ }
79
+
80
+ function plugin_scripts()
81
+ {
82
+ if (!is_admin())
83
+ {
84
+ wp_vid_lightbox_enqueue_script();
85
+ }
86
+ }
87
+
88
+ function plugin_footer()
89
+ {
90
+
91
+ }
92
+
93
+ function plugin_url(){
94
+ if ( $this->plugin_url ) return $this->plugin_url;
95
+ return $this->plugin_url = plugins_url( basename( plugin_dir_path(__FILE__) ), basename( __FILE__ ) );
96
+ }
97
+
98
+ function plugin_path(){
99
+ if ( $this->plugin_path ) return $this->plugin_path;
100
+ return $this->plugin_path = untrailingslashit( plugin_dir_path( __FILE__ ) );
101
+ }
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
 
104
 
105
+ }//End of class not exists check
106
+
107
+ $GLOBALS['wp_video_lightbox'] = new WP_Video_Lightbox();