Version Description
= 8.0.07 =
- This version addresses various bug fixes and security fixes.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 8.0.07.004 |
Comparing to | |
See all releases |
Code changes from version 8.0.07.003 to 8.0.07.004
- changelog.txt +1 -0
- js/wppa-all.js +1 -1
- js/wppa-popup.js +7 -3
- js/wppa-popup.min.js +1 -1
- wppa-admin-functions.php +3 -3
- wppa-adminbar.php +2 -2
- wppa-admins-choice-widget.php +2 -2
- wppa-ajax.php +9 -9
- wppa-album-admin-autosave.php +38 -45
- wppa-album-covers.php +57 -60
- wppa-boxes-html.php +3 -3
- wppa-breadcrumb.php +6 -2
- wppa-dashboard-widgets.php +4 -4
- wppa-defaults.php +3 -1
- wppa-functions.php +2 -3
- wppa-import.php +2 -2
- wppa-input.php +55 -22
- wppa-links.php +65 -45
- wppa-photo-admin-autosave.php +17 -17
- wppa-potd-widget.php +9 -3
- wppa-thumbnails.php +53 -36
- wppa-topten-widget.php +5 -2
- wppa-upload.php +2 -2
- wppa-utils.php +20 -7
- wppa.php +2 -2
changelog.txt
CHANGED
@@ -5,6 +5,7 @@ WP Photo Album Plus Changelog
|
|
5 |
* Security release. All querystring args are now processed and sanitized in one function wppa_get() in wppa-input.php
|
6 |
* Role specific upload limits did no longer work. Fixed.
|
7 |
* Popups on masonry thumbnails did not work when links on thumbnails differ from lightbox.
|
|
|
8 |
|
9 |
= 8.0.06 =
|
10 |
|
5 |
* Security release. All querystring args are now processed and sanitized in one function wppa_get() in wppa-input.php
|
6 |
* Role specific upload limits did no longer work. Fixed.
|
7 |
* Popups on masonry thumbnails did not work when links on thumbnails differ from lightbox.
|
8 |
+
* Rightclick on thumbnail or thumbnail popup allows you to open the link in a new tab, if No rightclick is not on.
|
9 |
|
10 |
= 8.0.06 =
|
11 |
|
js/wppa-all.js
CHANGED
@@ -9,7 +9,7 @@ var wppaJsAjaxVersion="8.0.03.001";function wppaDoAjaxRender(o,a,r,p,e,t){0<pars
|
|
9 |
// wppa-lightbox
|
10 |
var wppaJsLightboxVersion="8.0.04.003";function wppaOvlKeyboardHandler(p){var a,t=(a=(null==p?event:p).keyCode,27),p=String.fromCharCode(a).toLowerCase();switch(a){case t:wppaStopVideo(0),wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext()}switch(p){case"p":wppaOvlShowPrev();break;case"n":wppaOvlShowNext();break;case"s":wppaOvlStartStop();break;case"f":wppaFsOn();break;case"q":case"x":wppaStopVideo(0),wppaOvlHide()}return!1}function wppaOvlShow(p){var a,t,e=jQuery;if(wppaOvlActivePanorama,e("#wppa-overlay-bg").css({display:"inline"}),wppaOvlFirst&&(e("#weaver-final").removeClass("wvr-hide-bang"),wppaKbHandlerInstalled||(e(document).on("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!0),e(window).trigger("wppalightboxstart")),"object"==typeof p){wppaOvlIds=[],wppaOvlUrls=[],wppaOvlTitles=[],wppaOvlAlts=[],wppaOvlTypes=[],wppaOvlVideoHtmls=[],wppaOvlAudioHtmls=[],wppaOvlPdfHtmls=[],wppaOvlVideoNaturalWidths=[],wppaOvlVideoNaturalHeights=[],wppaOvlImgs=[],wppaOvlIdx=0,wppaOvlPanoramaHtml=[],wppaOvlPanoramaIds=[],wppaOvlHasPanoramas=!1;var l=(p.rel||!!e(p).attr("data-rel")&&e(p).attr("data-rel")).split("[");if(l[1])for(var o,i=l[1],w=e("a"),n=0,r=0;r<w.length;r++)1<(l=!!e(o=w[r]).attr("data-rel")&&e(o).attr("data-rel").split("[")).length&&"wppa"==l[0]&&l[1]==i&&(wppaOvlUrls[n]=o.href,e(o).attr("data-lbtitle")?wppaOvlTitles[n]=wppaRepairScriptTags(e(o).attr("data-lbtitle")):wppaOvlTitles[n]=wppaRepairScriptTags(o.title),wppaOvlIds[n]=e(o).attr("data-id")?e(o).attr("data-id"):"0",wppaOvlAlts[n]=e(o).attr("data-alt")?e(o).attr("data-alt"):"",wppaOvlVideoHtmls[n]=e(o).attr("data-videohtml")?decodeURI(e(o).attr("data-videohtml")):"",wppaOvlPdfHtmls[n]=e(o).attr("data-pdfhtml")?decodeURI(e(o).attr("data-pdfhtml")):"",wppaOvlAudioHtmls[n]=e(o).attr("data-audiohtml")?decodeURI(e(o).attr("data-audiohtml")):"",wppaOvlVideoNaturalWidths[n]=e(o).attr("data-videonatwidth")?e(o).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[n]=e(o).attr("data-videonatheight")?e(o).attr("data-videonatheight"):"",a=e(o).attr("data-panorama")?e(o).attr("data-panorama"):"",panType=e(o).attr("data-pantype")?e(o).attr("data-pantype"):"",0<a.length?(wppaOvlHasPanoramas=!0,t=a.indexOf("."),wppaOvlPanoramaHtml[n]=a.substr(t+1),wppaOvlPanoramaIds[n]=a.substr(0,t),wppaOvlTypes[n]=panType):(wppaOvlPanoramaHtml[n]="",wppaOvlPanoramaIds[n]=0,wppaOvlTypes[n]=""),0<wppaOvlPdfHtmls[n].length&&(wppaOvlTypes[n]="document"),decodeURI(e(o).attr("data-pdfhtml"))==decodeURI(e(p).attr("data-pdfhtml"))&&decodeURI(e(o).attr("data-videohtml"))==decodeURI(e(p).attr("data-videohtml"))&&decodeURI(e(o).attr("data-audiohtml"))==decodeURI(e(p).attr("data-audiohtml"))&&o.href==p.href&&(wppaOvlIdx=n),n++);else wppaOvlUrls[0]=p.href,e(p).attr("data-lbtitle")?wppaOvlTitles[0]=wppaRepairScriptTags(e(p).attr("data-lbtitle")):wppaOvlTitles[0]=wppaRepairScriptTags(p.title),wppaOvlIds[0]=e(p).attr("data-id")?e(p).attr("data-id"):"0",wppaOvlAlts[0]=e(p).attr("data-alt")?e(p).attr("data-alt"):"",wppaOvlVideoHtmls[0]=e(p).attr("data-videohtml")?decodeURI(e(p).attr("data-videohtml")):"",wppaOvlAudioHtmls[0]=e(p).attr("data-audiohtml")?decodeURI(e(p).attr("data-audiohtml")):"",wppaOvlPdfHtmls[0]=e(p).attr("data-pdfhtml")?decodeURI(e(p).attr("data-pdfhtml")):"",wppaOvlVideoNaturalWidths[0]=e(p).attr("data-videonatwidth")?e(p).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[0]=e(p).attr("data-videonatheight")?e(p).attr("data-videonatheight"):"",a=e(p).attr("data-panorama")?e(p).attr("data-panorama"):"",panType=e(p).attr("data-pantype")?e(p).attr("data-pantype"):"",0<a.length?(wppaOvlHasPanoramas=!0,t=a.indexOf("."),wppaOvlPanoramaHtml[0]=a.substr(t+1),wppaOvlPanoramaIds[0]=a.substr(0,t),wppaOvlTypes[0]=panType):(wppaOvlPanoramaHtml[0]="",wppaOvlPanoramaIds[0]=0,wppaOvlTypes[0]=""),0<wppaOvlPdfHtmls[0].length&&(wppaOvlTypes[0]="document"),wppaOvlIdx=0}else wppaOvlIdx=p;wppaOvlOpen=!0,e("body").trigger("quitimage"),setTimeout(function(){_wppaOvlShow(wppaOvlIdx)},100)}function _wppaOvlShow(p){var a=jQuery;a("#wppa-overlay-ic").html("").hide(),a("#wppa-overlay-pc").html("").hide(),a("#wppa-overlay-fpc").html("").hide(),a("#wppa-overlay-zpc").html("").hide(),wppaOvlCurIdx=p,wppaOvlFirst&&a("#wppa-ovl-spin").show(),wppaIsVideo=""!=wppaOvlVideoHtmls[p],wppaHasAudio=""!=wppaOvlAudioHtmls[p],wppaOvlIsPdf=""!=wppaOvlPdfHtmls[p];var t=wppaOvlIdx==wppaOvlUrls.length-1?0:wppaOvlIdx+1,e=0==wppaOvlIdx?wppaOvlUrls.length-1:wppaOvlIdx-1;if(""==wppaOvlTypes[t]&&""==wppaOvlVideoHtmls[t]&&wppaOvlOpen&&(document.getElementById("wppa-pre-next").src=wppaOvlUrls[t]),""==wppaOvlTypes[e]&&""==wppaOvlVideoHtmls[e]&&wppaOvlOpen&&(document.getElementById("wppa-pre-prev").src=wppaOvlUrls[e]),_bumpViewCount(wppaOvlIds[p]),wppaOvlIsSingle=1==wppaOvlUrls.length,wppaOvlActivePanorama=wppaOvlPanoramaIds[p],wppaOvlActivePanorama,wppaIsFs()||wppaOvlActivePanorama){if(wppaOvlActivePanorama?l=wppaOvlPanoramaHtml[p]:wppaIsVideo?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><video id="wppa-overlay-img" controls preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video></div>":wppaOvlIsPdf?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><iframe id="wppa-overlay-img" '+wppaOvlPdfHtmls[p]+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" ></iframe></div>':(l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><img id="wppa-overlay-img" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[p]+'" style="border:none; width:'+screen.width+'px; visibility:hidden; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata"'+(wppaOvlAudioStart?" autoplay":"")+' onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;left:0px;bottom:0px;padding:0;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),l+="</div>"),!wppaIsVideo&&!wppaHasAudio||wppaOvlFsPhotoId!=wppaPhotoId||0==wppaPhotoId)if(wppaStopVideo(0),wppaStopAudio(),0<wppaOvlActivePanorama)switch(wppaOvlTypes[p]){case"spheric":a("#wppa-overlay-pc").html(l).show();break;case"flat":a("#wppa-overlay-fpc").html(l).show();break;case"zoom":a("#wppa-overlay-zpc").html(l).show()}else a("#wppa-overlay-ic").html(l).show();return 0<wppaOvlPanoramaIds[p]&&wppaOvlIsSingle&&a(".wppa-pan-prevnext").hide(),wppaProtect(),wppaOvlIsVideo=wppaIsVideo,setTimeout(wppaOvlFormatFull,10),wppaIsVideo||wppaHasAudio?setTimeout(function(){wppaOvlFsPhotoId=wppaPhotoId},20):wppaOvlFsPhotoId=0,wppaOvlFirst=!1,""==wppaOvlTypes[p]&&a("#wppa-overlay-ic").show(),wppaFsShow(),wppaProtect(),!1}wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaStopVideo(0);t="black"==wppaOvlTheme?"#a7a7a7":"#272727";wppaOvlFontColor&&(t=wppaOvlFontColor);wppaOvlUrls.length;0==wppaOvlActivePanorama&&a("#wppa-overlay-ic").css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop});var l="";l+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >',wppaIsVideo?(l+='<video id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" controls style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video>",wppaOvlIsVideo=!0):wppaOvlIsPdf?l+="<iframe "+wppaOvlPdfHtmls[p]+' id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" ></iframe>':(l+='<img id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[p]+'" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata" onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;box-shadow:none;left:0;bottom:0;padding:0 '+wppaOvlBorderWidth+'px;margin:0;background-color:transparent;box-sizing:border-box;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),wppaOvlIsVideo=!1),l+="</div>";e=!wppaOvlIsSingle&&wppaOvlShowCounter;return l+='<div id="wppa-overlay-txt-container" style="position:relative;padding:10px;background-color:'+wppaOvlTheme+";color:"+t+";text-align:center;font-family:"+wppaOvlFontFamily+";font-size:"+wppaOvlFontSize+"px;font-weight:"+wppaOvlFontWeight+";line-height:"+wppaOvlLineHeight+"px;box-shadow:none;border-bottom-left-radius:"+wppaOvlRadius+"px;border-bottom-right-radius:"+wppaOvlRadius+'px;" ><div id="wppa-overlay-txt" style="text-align:center;min-height:36px;width:100%;'+("auto"==wppaOvlTxtHeight?"max-height:200px;":"max-height:"+wppaOvlTxtHeight+"px;")+'overflow:auto;box-shadow:none;" >',l+=wppaOvlNavBar(),l+=(e?wppaOvlIdx+1+"/"+wppaOvlUrls.length+"<br />":"")+wppaOvlTitles[p],l+="</div>",l+="</div>",(0==wppaOvlActivePanorama?a("#wppa-overlay-ic"):a("#wppa-overlay-pc")).html(l),""!=wppaOvlTypes[p]&&"document"!=wppaOvlTypes[p]||a("#wppa-overlay-ic").show(),wppaFsShow(),a("#wppa-overlay-img").bind("contextmenu",function(p){return!1}),0==wppaOvlPanoramaIds[p]&&wppaOvlResize(),wppaFsShow(),wppaAdjustControlbar(),!1}function wppaOvlSize(p){var a=jQuery;if(!wppaOvlActivePanorama){var t=document.getElementById("wppa-overlay-img"),e=document.getElementById("wppa-overlay-txt");if(t&&e&&"none"!=a("#wppa-overlay-bg").css("display")){if(!wppaIsFs()){var l,o=wppaWindowWidth(),i=wppaWindowHeight(),w=wppaOvlIsVideo?(t.clientWidth,l=wppaOvlVideoNaturalWidths[wppaOvlCurIdx],wppaOvlVideoNaturalHeights[wppaOvlCurIdx]):wppaOvlIsPdf?(wppaWindowWidth(),l=.9*wppaWindowWidth(),.9*wppaWindowHeight()):(t.clientWidth,l=t.naturalWidth,t.naturalHeight);void 0===l&&(l=t.clientWidth,w=t.clientHeight),(t=(e=(o-3*wppaOvlBorderWidth)/l)<(t=i/w)?e:t)<1&&(l=parseInt(l*t),w=parseInt(w*t));var t=a("#wppa-overlay-txt").height(),t="auto"==wppaOvlTxtHeight?(0==t&&(t=20+2*wppaOvlBorderWidth),i-t-20-2*wppaOvlBorderWidth):i-wppaOvlTxtHeight-20-2*wppaOvlBorderWidth,i=parseInt(t*l/w),i=(wppaOvlPadTop,parseInt((o-i)/2),i);w<t&&(wppaOvlPadTop,parseInt((o-l)/2),i=l);o=wppaSavedImageWidth-i<3&&i-wppaSavedImageWidth<3;return i<=10&&(w=180,o=!(l=i=240)),i=parseInt(i),wppaSavedImageWidth=parseInt(i),wppaSavedImageHeight=parseInt(i*w/l),wppaSavedMarginLeft=-parseInt(i/2+wppaOvlBorderWidth),wppaSavedContainerWidth=parseInt(i+2*wppaOvlBorderWidth),wppaSavedContainerHeight=parseInt(wppaSavedImageHeight+wppaOvlBorderWidth+a("#wppa-overlay-txt-container").height()+20),wppaSavedMarginTop=-parseInt(wppaSavedContainerHeight/2),wppaAnimate("#wppa-overlay-img",{width:wppaSavedImageWidth,height:wppaSavedImageHeight},p,wppaEasingLightbox),wppaAnimate("#wppa-overlay-ic",{width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop},p,wppaEasingLightbox),o?(a("#wppa-ovl-spin").hide(),wppaOvlFirst=!1):setTimeout(function(){wppaOvlSize(wppaOvlAnimSpeed)},p+10),!0}wppaOvlFormatFull()}}}function wppaOvlFormatFull(){var p,a=jQuery;if(wppaOvlOpen&&!(0<wppaOvlActivePanorama)){if(wppaOvlIsVideo)p=document.getElementById("wppa-overlay-img"),o=wppaOvlVideoNaturalWidths[wppaOvlIdx],i=wppaOvlVideoNaturalHeights[wppaOvlIdx];else if(wppaOvlIsPdf)p=document.getElementById("wppa-overlay-img"),o=screen.width,i=screen.height;else{if(p=document.getElementById("wppa-overlay-img"),!(wppaIsIe||p&&p.complete))return void setTimeout(wppaOvlFormatFull,200);o=p.naturalWidth,i=p.naturalHeight}var t=o/i,e=0,l=0,o=0,i=0,i=t<screen.width/screen.height?(e=(screen.width-screen.height*t)/2,l=0,o=screen.height,screen.height*t):(e=0,l=(screen.height-screen.width/t)/2,o=screen.width/t,screen.width),e=parseInt(e),l=parseInt(l),o=parseInt(o);return i=parseInt(i),a(p).css({height:o,width:i,marginLeft:e,marginTop:l,left:0,top:0,maxWidth:1e4}),a(p).css({visibility:"visible"}),a("#wppa-ovl-full-bg").css({overflow:"hidden"}),a("#wppa-ovl-full-bg").scrollTop(0),a("#wppa-ovl-full-bg").scrollLeft(0),a("#wppa-ovl-spin").hide(),a("#wppa-ovl-full-bg").css({visibility:"hidden"}),html=a("#wppa-overlay-ic").html(),html+='<div style="position:fixed;bottom:0;left:0;right:0;" >'+wppaOvlNavBar()+"</div>",a("#wppa-overlay-ic").html(html),wppaFsShow(),!0}}function wppaOvlStartAudio(){var p=document.getElementById("wppa-overlay-audio");p&&"function"==typeof p.play&&p.play()}function wppaOvlStartStop(){var p=jQuery;wppaOvlRunning?(wppaOvlRunning=!1,-1!=wppaOvlIdx&&(0!=wppaOvlIdx&&p("#wppa-ovl-prev-btn").css("visibility","visible"),wppaOvlIdx!=wppaOvlUrls.length-1&&p("#wppa-ovl-next-btn").css("visibility","visible")),p("#wppa-ovl-stop-btn").hide(),p("#wppa-ovl-start-btn").show()):(wppaOvlRunning=!0,wppaOvlRun(),p("#wppa-ovl-stop-btn").show(),p("#wppa-ovl-start-btn").hide())}function wppaOvlRun(){if(wppaOvlRunning)if(wppaOvlVideoPlaying||wppaOvlAudioPlaying)setTimeout(wppaOvlRun,50);else{if(!wppaIsVideo&&!wppaOvlIsPdf){var p=document.getElementById("wppa-overlay-img");if(p&&!wppaIsIe&&!p.complete)return void setTimeout(wppaOvlRun,200)}wppaOvlShowNext(),wppaOvlTimer=setTimeout(wppaOvlRun,wppaOvlSlideSpeed)}}function wppaOvlShowPrev(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var p=wppaOvlCurIdx-1;p<0&&(p=wppaOvlUrls.length-1);var a=document.getElementById("wppa-pre-prev");return""!=wppaOvlVideoHtmls[p]||wppaIsIe||a.complete||!wppaOvlOpen?wppaOvlShow(p):setTimeout(wppaOvlShowPrev,200),!1}function wppaOvlShowNext(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var p=wppaOvlCurIdx+1;p>wppaOvlUrls.length-1&&(p=0);var a=document.getElementById("wppa-pre-next");return""!=wppaOvlVideoHtmls[p]||wppaIsIe||a.complete||!wppaOvlOpen?wppaOvlShow(p):setTimeout(wppaOvlShowNext,200),!1}function wppaOvlShowSame(){var p,a;wppaOvlOpen&&(p=wppaOvlCurIdx,a=wppaOvlRunning,wppaOvlHide(!0),jQuery("#wppa-ovl-spin").show(),setTimeout(function(){wppaOvlShow(p),a&&setTimeout(wppaOvlStartStop(),wppaOvlSlideSpeed)},1e3))}function wppaOvlHide(p){var a=jQuery;wppaOvlOpen=!1,wppaOvlClosing=!wppaOvlClosing,wppaStopAudio(),p||"lightbox"!=wppaFsPolicy||wppaIsFs()&&wppaFsOff(),a("#wppa-overlay-ic").html("").hide(),a("#wppa-overlay-pc").html("").hide(),a("#wppa-overlay-fpc").html("").hide(),a("#wppa-overlay-zpc").html("").hide(),a(document).off("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!1,wppaOvlFirst=!0,wppaOvlRunning=!1,clearTimeout(wppaOvlTimer),a("#wppa-ovl-spin").hide(),wppaOvlActivePanorama=0,a("body").trigger("quitimage"),document.onLbquitMocc&&(wppaStartStop(document.onLbquitMocc),document.onLbquitMocc=null,document.onLbquitIdx=null),a(window).trigger("wppalightboxend"),a(window).trigger("resize"),wppaOvlClosing&&wppaIsMobile?setTimeout(function(){wppaOvlHide(p)},250):(wppaOvlClosing=!1,p||setTimeout(function(){a("#wppa-overlay-bg").hide(),a("#wppa-ovl-spin").hide()},500))}function wppaOvlOnclick(p){switch(wppaOvlOnclickType){case"none":break;case"close":wppaOvlHide();break;case"browse":var a=p.screenX-window.screenX;48<p.clientY&&(a<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}return!0}function wppaInitOverlay(){var e=jQuery;e(".wp-caption").each(function(){var p=e(this),a=p.find("IMG[alt]").attr("alt")||"",t=p.find(".wp-caption-text").html()||"",p=p.find("a"),t=a+"<br>"+t;p.attr("data-lbtitle")||p.attr("data-lbtitle",t)});var p,a,t=e("a"),l=[];for(wppaOvlFsPhotoId=0,wppaPhotoId=0,(wppaOvlActivePanorama=0)==wppaSavedContainerWidth&&(wppaSavedContainerWidth=240+2*wppaOvlBorderWidth,wppaSavedContainerHeight=180+3*wppaOvlBorderWidth+20+("auto"==wppaOvlTxtHeight?50:wppaOvlTxtHeight),wppaSavedMarginLeft=-(120+wppaOvlBorderWidth),wppaSavedMarginTop=-(90+wppaOvlBorderWidth+10+("auto"==wppaOvlTxtHeight?25:wppaOvlTxtHeight/2)),wppaSavedImageWidth=240,wppaSavedImageHeight=180+wppaOvlBorderWidth),a=0;a<t.length;a++)if(p=t[a],e(p).attr("data-rel")?l=e(p).attr("data-rel").split("["):p.rel?l=p.rel.split("["):l[0]="","wppa"==l[0])switch(wppaWppaOverlayActivated=!0,e(p).on("click",function(p){wppaOvlShow(this),p.preventDefault()}),wppaMagnifierCursor){case"pointer":e(p).css("cursor","pointer");break;case"":e(p).css("cursor","default");break;default:e(p).css("cursor","url( "+wppaImageDirectory+wppaMagnifierCursor+" ),auto")}e(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaAdjustControlbar)}function wppaOvlResize(){0<wppaOvlActivePanorama||(setTimeout("wppaOvlSize( "+wppaOvlAnimSpeed+" )",10),wppaOvlAudioStart&&!wppaOvlAudioPlaying&&setTimeout(wppaOvlStartAudio,100))}function wppaOvlImgClick(p){wppaOvlBrowseOnClick&&!wppaOvlIsSingle&&(p.screenX<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}function wppaOvlNavBar(){var p="";return wppaOvlIsSingle||(p+='<span id="wppa-ovl-prev-btn" style="margin:0 2px 0 0;float:left;display:block;" onclick="wppaOvlShowPrev()" >'+wppaSvgHtml("Prev-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-start-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"none":"block")+';" title="Start" onclick="wppaOvlStartStop()" >'+wppaSvgHtml("Play-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-stop-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"block":"none")+';" title="Stop" onclick="wppaOvlStartStop()" >'+wppaSvgHtml("Pause-Button",wppaOvlIconSize,!0,!0)+"</span>",p+='<span id="wppa-ovl-next-btn" style="margin:0 2px;float:right;display:block;" onclick="wppaOvlShowNext()" >'+wppaSvgHtml("Next-Button",wppaOvlIconSize,!0,!0)+"</span>"),p+='<span id="wppa-exit-btn-2" style="margin:0 2px;float:right;display:block;" title="Exit" onclick="wppaOvlHide()" >'+wppaSvgHtml("Exit-2",wppaOvlIconSize,!0,!0)+"</span>","lightbox"!=wppaFsPolicy||wppaIsSafari||wppaIsIpad||(p+='<span id="wppa-fulls-btn-2" class="wppa-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen-2",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-exit-fulls-btn-2" class="wppa-exit-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen-2",wppaOvlIconSize,!0,!0)+"</span>"),p}jQuery(document).ready(function(p){wppaInitOverlay()}),jQuery(window).on("resize",function(){wppaOvlResize()});
|
11 |
// wppa-popup
|
12 |
-
var wppaJsPopupVersion="8.0.07.
|
13 |
// wppa-touch
|
14 |
var wppaJsTouchVersion="8.0.01006";function wppaStartTime(){var p=(new Date).getTime();return wppaMobileTimeStart=p,!0}function wppaInTime(){return(new Date).getTime()-wppaMobileTimeStart<250}function wppaTapLink(p,e){wppaInTime()&&(_bumpClickCount(p),document.location.href=e)}function wppaTouchStart(p,e,a){-1==(wppaSwipeMocc=a)&&(wppaSwipeOnLightbox=!0,p.preventDefault()),wppaFingerCount=p.touches.length,1==wppaFingerCount?(wppaStartX=p.touches[0].pageX,wppaStartY=p.touches[0].pageY,wppaTriggerElementID=e):wppaTouchCancel()}function wppaTouchMove(p){wppaSwipeOnLightbox&&p.preventDefault(),1==p.touches.length?(wppaCurX=p.touches[0].pageX,wppaCurY=p.touches[0].pageY):wppaTouchCancel()}function wppaTouchEnd(p){wppaSwipeOnLightbox&&p.preventDefault(),1==wppaFingerCount&&0!=wppaCurX&&(wppaSwipeLength=Math.round(Math.sqrt(Math.pow(wppaCurX-wppaStartX,2)+Math.pow(wppaCurY-wppaStartY,2))),wppaSwipeLength>=wppaMinLength&&(wppaCalculateAngle(),wppaDetermineSwipeDirection(),wppaProcessingRoutine())),wppaTouchCancel()}function wppaTouchCancel(){wppaFingerCount=0,wppaStartX=0,wppaStartY=0,wppaCurX=0,wppaCurY=0,wppaDeltaX=0,wppaDeltaY=0,wppaHorzDiff=0,wppaVertDiff=0,wppaSwipeLength=0,wppaSwipeAngle=null,wppaSwipeDirection=null,wppaTriggerElementID=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=0}function wppaCalculateAngle(){var p=wppaStartX-wppaCurX,e=wppaCurY-wppaStartY,p=(Math.round(Math.sqrt(Math.pow(p,2)+Math.pow(e,2))),Math.atan2(e,p));wppaSwipeAngle=Math.round(180*p/Math.PI),wppaSwipeAngle<0&&(wppaSwipeAngle=360-Math.abs(wppaSwipeAngle))}function wppaDetermineSwipeDirection(){wppaSwipeDirection=wppaSwipeAngle<=45&&0<=wppaSwipeAngle||wppaSwipeAngle<=360&&315<=wppaSwipeAngle?"left":135<=wppaSwipeAngle&&wppaSwipeAngle<=225?"right":45<wppaSwipeAngle&&wppaSwipeAngle<135?"down":"up"}function wppaProcessingRoutine(){document.getElementById(wppaTriggerElementID);if(wppaSwipeOnLightbox)"left"==wppaSwipeDirection?wppaOvlShowNext():"right"==wppaSwipeDirection&&wppaOvlShowPrev();else{if("right"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]-1,idx<0){if(!wppaSlideWrap)return;idx=_wppaSlides[wppaSwipeMocc].length-1}wppaGotoKeepState(wppaSwipeMocc,idx)}if("left"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]+1,idx==_wppaSlides[wppaSwipeMocc].length){if(!wppaSlideWrap)return;idx=0}wppaGotoKeepState(wppaSwipeMocc,idx)}else"up"==wppaSwipeDirection||wppaSwipeDirection}wppaTouchCancel()}
|
15 |
// wppa-zoom
|
9 |
// wppa-lightbox
|
10 |
var wppaJsLightboxVersion="8.0.04.003";function wppaOvlKeyboardHandler(p){var a,t=(a=(null==p?event:p).keyCode,27),p=String.fromCharCode(a).toLowerCase();switch(a){case t:wppaStopVideo(0),wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext()}switch(p){case"p":wppaOvlShowPrev();break;case"n":wppaOvlShowNext();break;case"s":wppaOvlStartStop();break;case"f":wppaFsOn();break;case"q":case"x":wppaStopVideo(0),wppaOvlHide()}return!1}function wppaOvlShow(p){var a,t,e=jQuery;if(wppaOvlActivePanorama,e("#wppa-overlay-bg").css({display:"inline"}),wppaOvlFirst&&(e("#weaver-final").removeClass("wvr-hide-bang"),wppaKbHandlerInstalled||(e(document).on("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!0),e(window).trigger("wppalightboxstart")),"object"==typeof p){wppaOvlIds=[],wppaOvlUrls=[],wppaOvlTitles=[],wppaOvlAlts=[],wppaOvlTypes=[],wppaOvlVideoHtmls=[],wppaOvlAudioHtmls=[],wppaOvlPdfHtmls=[],wppaOvlVideoNaturalWidths=[],wppaOvlVideoNaturalHeights=[],wppaOvlImgs=[],wppaOvlIdx=0,wppaOvlPanoramaHtml=[],wppaOvlPanoramaIds=[],wppaOvlHasPanoramas=!1;var l=(p.rel||!!e(p).attr("data-rel")&&e(p).attr("data-rel")).split("[");if(l[1])for(var o,i=l[1],w=e("a"),n=0,r=0;r<w.length;r++)1<(l=!!e(o=w[r]).attr("data-rel")&&e(o).attr("data-rel").split("[")).length&&"wppa"==l[0]&&l[1]==i&&(wppaOvlUrls[n]=o.href,e(o).attr("data-lbtitle")?wppaOvlTitles[n]=wppaRepairScriptTags(e(o).attr("data-lbtitle")):wppaOvlTitles[n]=wppaRepairScriptTags(o.title),wppaOvlIds[n]=e(o).attr("data-id")?e(o).attr("data-id"):"0",wppaOvlAlts[n]=e(o).attr("data-alt")?e(o).attr("data-alt"):"",wppaOvlVideoHtmls[n]=e(o).attr("data-videohtml")?decodeURI(e(o).attr("data-videohtml")):"",wppaOvlPdfHtmls[n]=e(o).attr("data-pdfhtml")?decodeURI(e(o).attr("data-pdfhtml")):"",wppaOvlAudioHtmls[n]=e(o).attr("data-audiohtml")?decodeURI(e(o).attr("data-audiohtml")):"",wppaOvlVideoNaturalWidths[n]=e(o).attr("data-videonatwidth")?e(o).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[n]=e(o).attr("data-videonatheight")?e(o).attr("data-videonatheight"):"",a=e(o).attr("data-panorama")?e(o).attr("data-panorama"):"",panType=e(o).attr("data-pantype")?e(o).attr("data-pantype"):"",0<a.length?(wppaOvlHasPanoramas=!0,t=a.indexOf("."),wppaOvlPanoramaHtml[n]=a.substr(t+1),wppaOvlPanoramaIds[n]=a.substr(0,t),wppaOvlTypes[n]=panType):(wppaOvlPanoramaHtml[n]="",wppaOvlPanoramaIds[n]=0,wppaOvlTypes[n]=""),0<wppaOvlPdfHtmls[n].length&&(wppaOvlTypes[n]="document"),decodeURI(e(o).attr("data-pdfhtml"))==decodeURI(e(p).attr("data-pdfhtml"))&&decodeURI(e(o).attr("data-videohtml"))==decodeURI(e(p).attr("data-videohtml"))&&decodeURI(e(o).attr("data-audiohtml"))==decodeURI(e(p).attr("data-audiohtml"))&&o.href==p.href&&(wppaOvlIdx=n),n++);else wppaOvlUrls[0]=p.href,e(p).attr("data-lbtitle")?wppaOvlTitles[0]=wppaRepairScriptTags(e(p).attr("data-lbtitle")):wppaOvlTitles[0]=wppaRepairScriptTags(p.title),wppaOvlIds[0]=e(p).attr("data-id")?e(p).attr("data-id"):"0",wppaOvlAlts[0]=e(p).attr("data-alt")?e(p).attr("data-alt"):"",wppaOvlVideoHtmls[0]=e(p).attr("data-videohtml")?decodeURI(e(p).attr("data-videohtml")):"",wppaOvlAudioHtmls[0]=e(p).attr("data-audiohtml")?decodeURI(e(p).attr("data-audiohtml")):"",wppaOvlPdfHtmls[0]=e(p).attr("data-pdfhtml")?decodeURI(e(p).attr("data-pdfhtml")):"",wppaOvlVideoNaturalWidths[0]=e(p).attr("data-videonatwidth")?e(p).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[0]=e(p).attr("data-videonatheight")?e(p).attr("data-videonatheight"):"",a=e(p).attr("data-panorama")?e(p).attr("data-panorama"):"",panType=e(p).attr("data-pantype")?e(p).attr("data-pantype"):"",0<a.length?(wppaOvlHasPanoramas=!0,t=a.indexOf("."),wppaOvlPanoramaHtml[0]=a.substr(t+1),wppaOvlPanoramaIds[0]=a.substr(0,t),wppaOvlTypes[0]=panType):(wppaOvlPanoramaHtml[0]="",wppaOvlPanoramaIds[0]=0,wppaOvlTypes[0]=""),0<wppaOvlPdfHtmls[0].length&&(wppaOvlTypes[0]="document"),wppaOvlIdx=0}else wppaOvlIdx=p;wppaOvlOpen=!0,e("body").trigger("quitimage"),setTimeout(function(){_wppaOvlShow(wppaOvlIdx)},100)}function _wppaOvlShow(p){var a=jQuery;a("#wppa-overlay-ic").html("").hide(),a("#wppa-overlay-pc").html("").hide(),a("#wppa-overlay-fpc").html("").hide(),a("#wppa-overlay-zpc").html("").hide(),wppaOvlCurIdx=p,wppaOvlFirst&&a("#wppa-ovl-spin").show(),wppaIsVideo=""!=wppaOvlVideoHtmls[p],wppaHasAudio=""!=wppaOvlAudioHtmls[p],wppaOvlIsPdf=""!=wppaOvlPdfHtmls[p];var t=wppaOvlIdx==wppaOvlUrls.length-1?0:wppaOvlIdx+1,e=0==wppaOvlIdx?wppaOvlUrls.length-1:wppaOvlIdx-1;if(""==wppaOvlTypes[t]&&""==wppaOvlVideoHtmls[t]&&wppaOvlOpen&&(document.getElementById("wppa-pre-next").src=wppaOvlUrls[t]),""==wppaOvlTypes[e]&&""==wppaOvlVideoHtmls[e]&&wppaOvlOpen&&(document.getElementById("wppa-pre-prev").src=wppaOvlUrls[e]),_bumpViewCount(wppaOvlIds[p]),wppaOvlIsSingle=1==wppaOvlUrls.length,wppaOvlActivePanorama=wppaOvlPanoramaIds[p],wppaOvlActivePanorama,wppaIsFs()||wppaOvlActivePanorama){if(wppaOvlActivePanorama?l=wppaOvlPanoramaHtml[p]:wppaIsVideo?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><video id="wppa-overlay-img" controls preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video></div>":wppaOvlIsPdf?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><iframe id="wppa-overlay-img" '+wppaOvlPdfHtmls[p]+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" ></iframe></div>':(l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><img id="wppa-overlay-img" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[p]+'" style="border:none; width:'+screen.width+'px; visibility:hidden; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata"'+(wppaOvlAudioStart?" autoplay":"")+' onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;left:0px;bottom:0px;padding:0;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),l+="</div>"),!wppaIsVideo&&!wppaHasAudio||wppaOvlFsPhotoId!=wppaPhotoId||0==wppaPhotoId)if(wppaStopVideo(0),wppaStopAudio(),0<wppaOvlActivePanorama)switch(wppaOvlTypes[p]){case"spheric":a("#wppa-overlay-pc").html(l).show();break;case"flat":a("#wppa-overlay-fpc").html(l).show();break;case"zoom":a("#wppa-overlay-zpc").html(l).show()}else a("#wppa-overlay-ic").html(l).show();return 0<wppaOvlPanoramaIds[p]&&wppaOvlIsSingle&&a(".wppa-pan-prevnext").hide(),wppaProtect(),wppaOvlIsVideo=wppaIsVideo,setTimeout(wppaOvlFormatFull,10),wppaIsVideo||wppaHasAudio?setTimeout(function(){wppaOvlFsPhotoId=wppaPhotoId},20):wppaOvlFsPhotoId=0,wppaOvlFirst=!1,""==wppaOvlTypes[p]&&a("#wppa-overlay-ic").show(),wppaFsShow(),wppaProtect(),!1}wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaStopVideo(0);t="black"==wppaOvlTheme?"#a7a7a7":"#272727";wppaOvlFontColor&&(t=wppaOvlFontColor);wppaOvlUrls.length;0==wppaOvlActivePanorama&&a("#wppa-overlay-ic").css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop});var l="";l+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >',wppaIsVideo?(l+='<video id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" controls style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video>",wppaOvlIsVideo=!0):wppaOvlIsPdf?l+="<iframe "+wppaOvlPdfHtmls[p]+' id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" ></iframe>':(l+='<img id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[p]+'" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata" onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;box-shadow:none;left:0;bottom:0;padding:0 '+wppaOvlBorderWidth+'px;margin:0;background-color:transparent;box-sizing:border-box;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),wppaOvlIsVideo=!1),l+="</div>";e=!wppaOvlIsSingle&&wppaOvlShowCounter;return l+='<div id="wppa-overlay-txt-container" style="position:relative;padding:10px;background-color:'+wppaOvlTheme+";color:"+t+";text-align:center;font-family:"+wppaOvlFontFamily+";font-size:"+wppaOvlFontSize+"px;font-weight:"+wppaOvlFontWeight+";line-height:"+wppaOvlLineHeight+"px;box-shadow:none;border-bottom-left-radius:"+wppaOvlRadius+"px;border-bottom-right-radius:"+wppaOvlRadius+'px;" ><div id="wppa-overlay-txt" style="text-align:center;min-height:36px;width:100%;'+("auto"==wppaOvlTxtHeight?"max-height:200px;":"max-height:"+wppaOvlTxtHeight+"px;")+'overflow:auto;box-shadow:none;" >',l+=wppaOvlNavBar(),l+=(e?wppaOvlIdx+1+"/"+wppaOvlUrls.length+"<br />":"")+wppaOvlTitles[p],l+="</div>",l+="</div>",(0==wppaOvlActivePanorama?a("#wppa-overlay-ic"):a("#wppa-overlay-pc")).html(l),""!=wppaOvlTypes[p]&&"document"!=wppaOvlTypes[p]||a("#wppa-overlay-ic").show(),wppaFsShow(),a("#wppa-overlay-img").bind("contextmenu",function(p){return!1}),0==wppaOvlPanoramaIds[p]&&wppaOvlResize(),wppaFsShow(),wppaAdjustControlbar(),!1}function wppaOvlSize(p){var a=jQuery;if(!wppaOvlActivePanorama){var t=document.getElementById("wppa-overlay-img"),e=document.getElementById("wppa-overlay-txt");if(t&&e&&"none"!=a("#wppa-overlay-bg").css("display")){if(!wppaIsFs()){var l,o=wppaWindowWidth(),i=wppaWindowHeight(),w=wppaOvlIsVideo?(t.clientWidth,l=wppaOvlVideoNaturalWidths[wppaOvlCurIdx],wppaOvlVideoNaturalHeights[wppaOvlCurIdx]):wppaOvlIsPdf?(wppaWindowWidth(),l=.9*wppaWindowWidth(),.9*wppaWindowHeight()):(t.clientWidth,l=t.naturalWidth,t.naturalHeight);void 0===l&&(l=t.clientWidth,w=t.clientHeight),(t=(e=(o-3*wppaOvlBorderWidth)/l)<(t=i/w)?e:t)<1&&(l=parseInt(l*t),w=parseInt(w*t));var t=a("#wppa-overlay-txt").height(),t="auto"==wppaOvlTxtHeight?(0==t&&(t=20+2*wppaOvlBorderWidth),i-t-20-2*wppaOvlBorderWidth):i-wppaOvlTxtHeight-20-2*wppaOvlBorderWidth,i=parseInt(t*l/w),i=(wppaOvlPadTop,parseInt((o-i)/2),i);w<t&&(wppaOvlPadTop,parseInt((o-l)/2),i=l);o=wppaSavedImageWidth-i<3&&i-wppaSavedImageWidth<3;return i<=10&&(w=180,o=!(l=i=240)),i=parseInt(i),wppaSavedImageWidth=parseInt(i),wppaSavedImageHeight=parseInt(i*w/l),wppaSavedMarginLeft=-parseInt(i/2+wppaOvlBorderWidth),wppaSavedContainerWidth=parseInt(i+2*wppaOvlBorderWidth),wppaSavedContainerHeight=parseInt(wppaSavedImageHeight+wppaOvlBorderWidth+a("#wppa-overlay-txt-container").height()+20),wppaSavedMarginTop=-parseInt(wppaSavedContainerHeight/2),wppaAnimate("#wppa-overlay-img",{width:wppaSavedImageWidth,height:wppaSavedImageHeight},p,wppaEasingLightbox),wppaAnimate("#wppa-overlay-ic",{width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop},p,wppaEasingLightbox),o?(a("#wppa-ovl-spin").hide(),wppaOvlFirst=!1):setTimeout(function(){wppaOvlSize(wppaOvlAnimSpeed)},p+10),!0}wppaOvlFormatFull()}}}function wppaOvlFormatFull(){var p,a=jQuery;if(wppaOvlOpen&&!(0<wppaOvlActivePanorama)){if(wppaOvlIsVideo)p=document.getElementById("wppa-overlay-img"),o=wppaOvlVideoNaturalWidths[wppaOvlIdx],i=wppaOvlVideoNaturalHeights[wppaOvlIdx];else if(wppaOvlIsPdf)p=document.getElementById("wppa-overlay-img"),o=screen.width,i=screen.height;else{if(p=document.getElementById("wppa-overlay-img"),!(wppaIsIe||p&&p.complete))return void setTimeout(wppaOvlFormatFull,200);o=p.naturalWidth,i=p.naturalHeight}var t=o/i,e=0,l=0,o=0,i=0,i=t<screen.width/screen.height?(e=(screen.width-screen.height*t)/2,l=0,o=screen.height,screen.height*t):(e=0,l=(screen.height-screen.width/t)/2,o=screen.width/t,screen.width),e=parseInt(e),l=parseInt(l),o=parseInt(o);return i=parseInt(i),a(p).css({height:o,width:i,marginLeft:e,marginTop:l,left:0,top:0,maxWidth:1e4}),a(p).css({visibility:"visible"}),a("#wppa-ovl-full-bg").css({overflow:"hidden"}),a("#wppa-ovl-full-bg").scrollTop(0),a("#wppa-ovl-full-bg").scrollLeft(0),a("#wppa-ovl-spin").hide(),a("#wppa-ovl-full-bg").css({visibility:"hidden"}),html=a("#wppa-overlay-ic").html(),html+='<div style="position:fixed;bottom:0;left:0;right:0;" >'+wppaOvlNavBar()+"</div>",a("#wppa-overlay-ic").html(html),wppaFsShow(),!0}}function wppaOvlStartAudio(){var p=document.getElementById("wppa-overlay-audio");p&&"function"==typeof p.play&&p.play()}function wppaOvlStartStop(){var p=jQuery;wppaOvlRunning?(wppaOvlRunning=!1,-1!=wppaOvlIdx&&(0!=wppaOvlIdx&&p("#wppa-ovl-prev-btn").css("visibility","visible"),wppaOvlIdx!=wppaOvlUrls.length-1&&p("#wppa-ovl-next-btn").css("visibility","visible")),p("#wppa-ovl-stop-btn").hide(),p("#wppa-ovl-start-btn").show()):(wppaOvlRunning=!0,wppaOvlRun(),p("#wppa-ovl-stop-btn").show(),p("#wppa-ovl-start-btn").hide())}function wppaOvlRun(){if(wppaOvlRunning)if(wppaOvlVideoPlaying||wppaOvlAudioPlaying)setTimeout(wppaOvlRun,50);else{if(!wppaIsVideo&&!wppaOvlIsPdf){var p=document.getElementById("wppa-overlay-img");if(p&&!wppaIsIe&&!p.complete)return void setTimeout(wppaOvlRun,200)}wppaOvlShowNext(),wppaOvlTimer=setTimeout(wppaOvlRun,wppaOvlSlideSpeed)}}function wppaOvlShowPrev(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var p=wppaOvlCurIdx-1;p<0&&(p=wppaOvlUrls.length-1);var a=document.getElementById("wppa-pre-prev");return""!=wppaOvlVideoHtmls[p]||wppaIsIe||a.complete||!wppaOvlOpen?wppaOvlShow(p):setTimeout(wppaOvlShowPrev,200),!1}function wppaOvlShowNext(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var p=wppaOvlCurIdx+1;p>wppaOvlUrls.length-1&&(p=0);var a=document.getElementById("wppa-pre-next");return""!=wppaOvlVideoHtmls[p]||wppaIsIe||a.complete||!wppaOvlOpen?wppaOvlShow(p):setTimeout(wppaOvlShowNext,200),!1}function wppaOvlShowSame(){var p,a;wppaOvlOpen&&(p=wppaOvlCurIdx,a=wppaOvlRunning,wppaOvlHide(!0),jQuery("#wppa-ovl-spin").show(),setTimeout(function(){wppaOvlShow(p),a&&setTimeout(wppaOvlStartStop(),wppaOvlSlideSpeed)},1e3))}function wppaOvlHide(p){var a=jQuery;wppaOvlOpen=!1,wppaOvlClosing=!wppaOvlClosing,wppaStopAudio(),p||"lightbox"!=wppaFsPolicy||wppaIsFs()&&wppaFsOff(),a("#wppa-overlay-ic").html("").hide(),a("#wppa-overlay-pc").html("").hide(),a("#wppa-overlay-fpc").html("").hide(),a("#wppa-overlay-zpc").html("").hide(),a(document).off("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!1,wppaOvlFirst=!0,wppaOvlRunning=!1,clearTimeout(wppaOvlTimer),a("#wppa-ovl-spin").hide(),wppaOvlActivePanorama=0,a("body").trigger("quitimage"),document.onLbquitMocc&&(wppaStartStop(document.onLbquitMocc),document.onLbquitMocc=null,document.onLbquitIdx=null),a(window).trigger("wppalightboxend"),a(window).trigger("resize"),wppaOvlClosing&&wppaIsMobile?setTimeout(function(){wppaOvlHide(p)},250):(wppaOvlClosing=!1,p||setTimeout(function(){a("#wppa-overlay-bg").hide(),a("#wppa-ovl-spin").hide()},500))}function wppaOvlOnclick(p){switch(wppaOvlOnclickType){case"none":break;case"close":wppaOvlHide();break;case"browse":var a=p.screenX-window.screenX;48<p.clientY&&(a<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}return!0}function wppaInitOverlay(){var e=jQuery;e(".wp-caption").each(function(){var p=e(this),a=p.find("IMG[alt]").attr("alt")||"",t=p.find(".wp-caption-text").html()||"",p=p.find("a"),t=a+"<br>"+t;p.attr("data-lbtitle")||p.attr("data-lbtitle",t)});var p,a,t=e("a"),l=[];for(wppaOvlFsPhotoId=0,wppaPhotoId=0,(wppaOvlActivePanorama=0)==wppaSavedContainerWidth&&(wppaSavedContainerWidth=240+2*wppaOvlBorderWidth,wppaSavedContainerHeight=180+3*wppaOvlBorderWidth+20+("auto"==wppaOvlTxtHeight?50:wppaOvlTxtHeight),wppaSavedMarginLeft=-(120+wppaOvlBorderWidth),wppaSavedMarginTop=-(90+wppaOvlBorderWidth+10+("auto"==wppaOvlTxtHeight?25:wppaOvlTxtHeight/2)),wppaSavedImageWidth=240,wppaSavedImageHeight=180+wppaOvlBorderWidth),a=0;a<t.length;a++)if(p=t[a],e(p).attr("data-rel")?l=e(p).attr("data-rel").split("["):p.rel?l=p.rel.split("["):l[0]="","wppa"==l[0])switch(wppaWppaOverlayActivated=!0,e(p).on("click",function(p){wppaOvlShow(this),p.preventDefault()}),wppaMagnifierCursor){case"pointer":e(p).css("cursor","pointer");break;case"":e(p).css("cursor","default");break;default:e(p).css("cursor","url( "+wppaImageDirectory+wppaMagnifierCursor+" ),auto")}e(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaAdjustControlbar)}function wppaOvlResize(){0<wppaOvlActivePanorama||(setTimeout("wppaOvlSize( "+wppaOvlAnimSpeed+" )",10),wppaOvlAudioStart&&!wppaOvlAudioPlaying&&setTimeout(wppaOvlStartAudio,100))}function wppaOvlImgClick(p){wppaOvlBrowseOnClick&&!wppaOvlIsSingle&&(p.screenX<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}function wppaOvlNavBar(){var p="";return wppaOvlIsSingle||(p+='<span id="wppa-ovl-prev-btn" style="margin:0 2px 0 0;float:left;display:block;" onclick="wppaOvlShowPrev()" >'+wppaSvgHtml("Prev-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-start-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"none":"block")+';" title="Start" onclick="wppaOvlStartStop()" >'+wppaSvgHtml("Play-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-stop-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"block":"none")+';" title="Stop" onclick="wppaOvlStartStop()" >'+wppaSvgHtml("Pause-Button",wppaOvlIconSize,!0,!0)+"</span>",p+='<span id="wppa-ovl-next-btn" style="margin:0 2px;float:right;display:block;" onclick="wppaOvlShowNext()" >'+wppaSvgHtml("Next-Button",wppaOvlIconSize,!0,!0)+"</span>"),p+='<span id="wppa-exit-btn-2" style="margin:0 2px;float:right;display:block;" title="Exit" onclick="wppaOvlHide()" >'+wppaSvgHtml("Exit-2",wppaOvlIconSize,!0,!0)+"</span>","lightbox"!=wppaFsPolicy||wppaIsSafari||wppaIsIpad||(p+='<span id="wppa-fulls-btn-2" class="wppa-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen-2",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-exit-fulls-btn-2" class="wppa-exit-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen-2",wppaOvlIconSize,!0,!0)+"</span>"),p}jQuery(document).ready(function(p){wppaInitOverlay()}),jQuery(window).on("resize",function(){wppaOvlResize()});
|
11 |
// wppa-popup
|
12 |
+
var wppaJsPopupVersion="8.0.07.004";function wppaPopUp(p,t,i,e,a,n,o,r,d,s){wppaPopDown();var l=jQuery("#wppa-thumb-area-"+p).width(),e=(e?'<div id="wppa-name-'+p+'" style="display:none; padding:1px;" class="wppa_pu_info">'+e+"</div>":"")+(a?'<div id="wppa-desc-'+p+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+a+"</div>":"")+(n?'<div id="wppa-rat-'+p+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+n+"</div>":"")+(o?'<div id="wppa-ncom-'+p+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+o+"</div>":""),a=jQuery(t).css("cursor"),n=(wppaThumbTargetBlank,jQuery(t).parent().attr("href")),o=n?'<a href="'+n+'" >':"";o+=""!=r?r:'<img id="wppa-img-'+p+'" src="'+t.src+'" title="" style="border-width: 0px;" />',o+=n?"</a>":"",jQuery("#wppa-popup-"+p).html('<div class="wppa-popup" style="background-color:'+wppaBackgroundColorImage+';box-sizing:content-box;text-align:center;">'+o+e+"</div>"),jQuery(".wppa-popup").on("click",function(){return jQuery(t).trigger("click"),!1}),jQuery(".wppa-popup").css({cursor:a}),n=parseInt(d),o=parseInt(s),jQuery(".wppa-popup").css({width:t.clientWidth}),e=parseInt(t.offsetLeft)-7-5,a=parseInt(t.offsetTop)-7-2,jQuery("#grid-item-"+p+"-"+i).length&&(e+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("left"))+6,a+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("top"))),d=parseInt(t.clientWidth),s=parseInt(t.clientHeight),(i=e-parseInt((n-d)/2))<0&&(i=0),l<i+n+16&&(i=l-n-16),(l=a-parseInt((o-s)/2))<0&&(l=0),jQuery("#wppa-img-"+p).css({maxWidth:n}),jQuery("#wppa-popup-"+p).css({marginLeft:e,marginTop:a}),jQuery("#wppa-img-"+p).css({marginLeft:0,marginRight:0,width:d,height:s});s=500;wppaAnimate("#wppa-popup-"+p,{marginLeft:i,marginTop:l},s,wppaEasingPopup),wppaAnimate("#wppa-img-"+p,{width:n,height:o},s,wppaEasingPopup,function(){jQuery(this).on("touchend",function(){wppaPopDown()}),jQuery(this).on("click",function(p){p.stopPropagation})}),wppaAnimate(".wppa-popup",{width:n},s,wppaEasingPopup),wppaAnimate(".wppa_pu_info",{width:n},s,wppaEasingPopup,function(){jQuery(".wppa_pu_info").show()}),wppaProtect()}function wppaPopDown(){jQuery(".wppa-popup-frame").html("")}function wppaFullPopUp(p,t,i,e,a,n){var o=screen.width/(e+14),r=screen.height/(a+80),d=.9*Math.min(o,r);d<1&&(e*=d,a*=d);o=a+80,r=e+14,d="",p=document.getElementById("i-"+t+"-"+p);p&&(d=p.alt,p.title);p=".pdf"==i.substr(i.length-4,i.length),r=window.open("","Print","width="+r+", height="+o+", location=no, resizable=no, menubar=yes "),d="<html><head><style>body{margin:0;padding:6px;background-color:"+wppaBackgroundColorImage+";text-align:center;}</style><title>"+d+'</title><script>function wppa_print() {document.getElementById( "wppa_printer" ).style.visibility="hidden";document.getElementById( "wppa_download" ).style.visibility="hidden";window.print();}<\/script></head><body><div style="width:'+e+'px;" >';d+=p?'<iframe src="'+i+'" style="padding-bottom:6px;width:100%;height:'+(o-60)+'px;" ></iframe><br />':'<img src="'+i+'" style="width:'+e+"px;height:"+a+'px;padding-bottom:6px;" /><br />',d+='<div style="text-align:center">'+n+"</div>",p||(d+='<a href="'+i+'" download="'+n+'" ><img src="'+wppaImageDirectory+'download.png" id="wppa_download" title="Download" style="position:absolute; top:6px; left:'+(e-66)+"px; background-color:"+wppaBackgroundColorImage+'; padding: 2px; cursor:pointer;" /></a><img src="'+wppaImageDirectory+'printer.png" id="wppa_printer" title="Print" style="position:absolute; top:6px; left:'+(e-30)+"px; background-color:"+wppaBackgroundColorImage+'; padding: 2px; cursor:pointer;" onclick="wppa_print();" />'),d+="</div></body></html>",r.document.write(d),wppaProtect()}
|
13 |
// wppa-touch
|
14 |
var wppaJsTouchVersion="8.0.01006";function wppaStartTime(){var p=(new Date).getTime();return wppaMobileTimeStart=p,!0}function wppaInTime(){return(new Date).getTime()-wppaMobileTimeStart<250}function wppaTapLink(p,e){wppaInTime()&&(_bumpClickCount(p),document.location.href=e)}function wppaTouchStart(p,e,a){-1==(wppaSwipeMocc=a)&&(wppaSwipeOnLightbox=!0,p.preventDefault()),wppaFingerCount=p.touches.length,1==wppaFingerCount?(wppaStartX=p.touches[0].pageX,wppaStartY=p.touches[0].pageY,wppaTriggerElementID=e):wppaTouchCancel()}function wppaTouchMove(p){wppaSwipeOnLightbox&&p.preventDefault(),1==p.touches.length?(wppaCurX=p.touches[0].pageX,wppaCurY=p.touches[0].pageY):wppaTouchCancel()}function wppaTouchEnd(p){wppaSwipeOnLightbox&&p.preventDefault(),1==wppaFingerCount&&0!=wppaCurX&&(wppaSwipeLength=Math.round(Math.sqrt(Math.pow(wppaCurX-wppaStartX,2)+Math.pow(wppaCurY-wppaStartY,2))),wppaSwipeLength>=wppaMinLength&&(wppaCalculateAngle(),wppaDetermineSwipeDirection(),wppaProcessingRoutine())),wppaTouchCancel()}function wppaTouchCancel(){wppaFingerCount=0,wppaStartX=0,wppaStartY=0,wppaCurX=0,wppaCurY=0,wppaDeltaX=0,wppaDeltaY=0,wppaHorzDiff=0,wppaVertDiff=0,wppaSwipeLength=0,wppaSwipeAngle=null,wppaSwipeDirection=null,wppaTriggerElementID=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=0}function wppaCalculateAngle(){var p=wppaStartX-wppaCurX,e=wppaCurY-wppaStartY,p=(Math.round(Math.sqrt(Math.pow(p,2)+Math.pow(e,2))),Math.atan2(e,p));wppaSwipeAngle=Math.round(180*p/Math.PI),wppaSwipeAngle<0&&(wppaSwipeAngle=360-Math.abs(wppaSwipeAngle))}function wppaDetermineSwipeDirection(){wppaSwipeDirection=wppaSwipeAngle<=45&&0<=wppaSwipeAngle||wppaSwipeAngle<=360&&315<=wppaSwipeAngle?"left":135<=wppaSwipeAngle&&wppaSwipeAngle<=225?"right":45<wppaSwipeAngle&&wppaSwipeAngle<135?"down":"up"}function wppaProcessingRoutine(){document.getElementById(wppaTriggerElementID);if(wppaSwipeOnLightbox)"left"==wppaSwipeDirection?wppaOvlShowNext():"right"==wppaSwipeDirection&&wppaOvlShowPrev();else{if("right"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]-1,idx<0){if(!wppaSlideWrap)return;idx=_wppaSlides[wppaSwipeMocc].length-1}wppaGotoKeepState(wppaSwipeMocc,idx)}if("left"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]+1,idx==_wppaSlides[wppaSwipeMocc].length){if(!wppaSlideWrap)return;idx=0}wppaGotoKeepState(wppaSwipeMocc,idx)}else"up"==wppaSwipeDirection||wppaSwipeDirection}wppaTouchCancel()}
|
15 |
// wppa-zoom
|
js/wppa-popup.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
// Contains popup modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
//
|
6 |
-
var wppaJsPopupVersion = '8.0.07.
|
7 |
|
8 |
// Popup of thumbnail images
|
9 |
function wppaPopUp( mocc, elm, id, name, desc, rating, ncom, videohtml, maxsizex, maxsizey ) {
|
@@ -24,9 +24,13 @@ function wppaPopUp( mocc, elm, id, name, desc, rating, ncom, videohtml, maxsizex
|
|
24 |
var elmCursor = jQuery( elm ).css('cursor');
|
25 |
var target = wppaThumbTargetBlank ? ' target="_blank"' : '';
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
28 |
jQuery( '#wppa-popup-'+mocc ).html( '<div class="wppa-popup" style="background-color:'+wppaBackgroundColorImage+';box-sizing:content-box;text-align:center;">'+imghtml+popuptext+'</div>' );
|
29 |
-
jQuery( '.wppa-popup' ).on( 'click', function(){jQuery(elm).trigger('click')});
|
30 |
jQuery( '.wppa-popup' ).css({cursor:elmCursor});
|
31 |
|
32 |
// Compute ending sizes
|
3 |
// Contains popup modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
//
|
6 |
+
var wppaJsPopupVersion = '8.0.07.004';
|
7 |
|
8 |
// Popup of thumbnail images
|
9 |
function wppaPopUp( mocc, elm, id, name, desc, rating, ncom, videohtml, maxsizex, maxsizey ) {
|
24 |
var elmCursor = jQuery( elm ).css('cursor');
|
25 |
var target = wppaThumbTargetBlank ? ' target="_blank"' : '';
|
26 |
|
27 |
+
var href = jQuery(elm).parent().attr('href');
|
28 |
+
|
29 |
+
imghtml = href ? '<a href="'+href+'" >' : '';
|
30 |
+
imghtml += videohtml != '' ? videohtml : '<img id="wppa-img-'+mocc+'" src="'+elm.src+'" title="" style="border-width: 0px;" />';
|
31 |
+
imghtml += href ? '</a>' : '';
|
32 |
jQuery( '#wppa-popup-'+mocc ).html( '<div class="wppa-popup" style="background-color:'+wppaBackgroundColorImage+';box-sizing:content-box;text-align:center;">'+imghtml+popuptext+'</div>' );
|
33 |
+
jQuery( '.wppa-popup' ).on( 'click', function(){jQuery(elm).trigger('click');return false;});
|
34 |
jQuery( '.wppa-popup' ).css({cursor:elmCursor});
|
35 |
|
36 |
// Compute ending sizes
|
js/wppa-popup.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wppaJsPopupVersion="8.0.07.
|
1 |
+
var wppaJsPopupVersion="8.0.07.004";function wppaPopUp(p,t,i,e,a,n,o,r,d,s){wppaPopDown();var l=jQuery("#wppa-thumb-area-"+p).width(),e=(e?'<div id="wppa-name-'+p+'" style="display:none; padding:1px;" class="wppa_pu_info">'+e+"</div>":"")+(a?'<div id="wppa-desc-'+p+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+a+"</div>":"")+(n?'<div id="wppa-rat-'+p+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+n+"</div>":"")+(o?'<div id="wppa-ncom-'+p+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+o+"</div>":""),a=jQuery(t).css("cursor"),n=(wppaThumbTargetBlank,jQuery(t).parent().attr("href")),o=n?'<a href="'+n+'" >':"";o+=""!=r?r:'<img id="wppa-img-'+p+'" src="'+t.src+'" title="" style="border-width: 0px;" />',o+=n?"</a>":"",jQuery("#wppa-popup-"+p).html('<div class="wppa-popup" style="background-color:'+wppaBackgroundColorImage+';box-sizing:content-box;text-align:center;">'+o+e+"</div>"),jQuery(".wppa-popup").on("click",function(){return jQuery(t).trigger("click"),!1}),jQuery(".wppa-popup").css({cursor:a}),n=parseInt(d),o=parseInt(s),jQuery(".wppa-popup").css({width:t.clientWidth}),e=parseInt(t.offsetLeft)-7-5,a=parseInt(t.offsetTop)-7-2,jQuery("#grid-item-"+p+"-"+i).length&&(e+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("left"))+6,a+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("top"))),d=parseInt(t.clientWidth),s=parseInt(t.clientHeight),(i=e-parseInt((n-d)/2))<0&&(i=0),l<i+n+16&&(i=l-n-16),(l=a-parseInt((o-s)/2))<0&&(l=0),jQuery("#wppa-img-"+p).css({maxWidth:n}),jQuery("#wppa-popup-"+p).css({marginLeft:e,marginTop:a}),jQuery("#wppa-img-"+p).css({marginLeft:0,marginRight:0,width:d,height:s});s=500;wppaAnimate("#wppa-popup-"+p,{marginLeft:i,marginTop:l},s,wppaEasingPopup),wppaAnimate("#wppa-img-"+p,{width:n,height:o},s,wppaEasingPopup,function(){jQuery(this).on("touchend",function(){wppaPopDown()}),jQuery(this).on("click",function(p){p.stopPropagation})}),wppaAnimate(".wppa-popup",{width:n},s,wppaEasingPopup),wppaAnimate(".wppa_pu_info",{width:n},s,wppaEasingPopup,function(){jQuery(".wppa_pu_info").show()}),wppaProtect()}function wppaPopDown(){jQuery(".wppa-popup-frame").html("")}function wppaFullPopUp(p,t,i,e,a,n){var o=screen.width/(e+14),r=screen.height/(a+80),d=.9*Math.min(o,r);d<1&&(e*=d,a*=d);o=a+80,r=e+14,d="",p=document.getElementById("i-"+t+"-"+p);p&&(d=p.alt,p.title);p=".pdf"==i.substr(i.length-4,i.length),r=window.open("","Print","width="+r+", height="+o+", location=no, resizable=no, menubar=yes "),d="<html><head><style>body{margin:0;padding:6px;background-color:"+wppaBackgroundColorImage+";text-align:center;}</style><title>"+d+'</title><script>function wppa_print() {document.getElementById( "wppa_printer" ).style.visibility="hidden";document.getElementById( "wppa_download" ).style.visibility="hidden";window.print();}<\/script></head><body><div style="width:'+e+'px;" >';d+=p?'<iframe src="'+i+'" style="padding-bottom:6px;width:100%;height:'+(o-60)+'px;" ></iframe><br />':'<img src="'+i+'" style="width:'+e+"px;height:"+a+'px;padding-bottom:6px;" /><br />',d+='<div style="text-align:center">'+n+"</div>",p||(d+='<a href="'+i+'" download="'+n+'" ><img src="'+wppaImageDirectory+'download.png" id="wppa_download" title="Download" style="position:absolute; top:6px; left:'+(e-66)+"px; background-color:"+wppaBackgroundColorImage+'; padding: 2px; cursor:pointer;" /></a><img src="'+wppaImageDirectory+'printer.png" id="wppa_printer" title="Print" style="position:absolute; top:6px; left:'+(e-30)+"px; background-color:"+wppaBackgroundColorImage+'; padding: 2px; cursor:pointer;" onclick="wppa_print();" />'),d+="</div></body></html>",r.document.write(d),wppaProtect()}
|
wppa-admin-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* gp admin functions
|
6 |
-
* Version 8.0.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1060,9 +1060,9 @@ global $wpdb;
|
|
1060 |
// edit album url
|
1061 |
function wppa_ea_url($edit_id, $tab = 'edit') {
|
1062 |
|
1063 |
-
$nonce = wp_create_nonce('
|
1064 |
|
1065 |
-
return wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab='.$tab.'&
|
1066 |
}
|
1067 |
|
1068 |
// Convert a non 360 deg spheric panorama photo to 360 deg by padding
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* gp admin functions
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
1060 |
// edit album url
|
1061 |
function wppa_ea_url($edit_id, $tab = 'edit') {
|
1062 |
|
1063 |
+
$nonce = wp_create_nonce('wppa-nonce');
|
1064 |
|
1065 |
+
return wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab='.$tab.'&edit-id='.$edit_id.'&wppa-nonce='.$nonce);
|
1066 |
}
|
1067 |
|
1068 |
// Convert a non 360 deg spheric panorama photo to 360 deg by padding
|
wppa-adminbar.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* enhances the admin bar with wppa+ menu
|
6 |
-
* Version 8.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -149,7 +149,7 @@ function wppa_admin_bar_menu() {
|
|
149 |
$menu_item = array( 'id' => 'wppa-album-new',
|
150 |
'parent' => 'new-content-default',
|
151 |
'title' => __( 'Album', 'wp-photo-album-plus' ),
|
152 |
-
'href' => admin_url( 'admin.php?page=wppa_admin_menu&tab=edit&
|
153 |
);
|
154 |
// Add item
|
155 |
$wp_admin_bar->add_menu( $menu_item );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* enhances the admin bar with wppa+ menu
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
149 |
$menu_item = array( 'id' => 'wppa-album-new',
|
150 |
'parent' => 'new-content-default',
|
151 |
'title' => __( 'Album', 'wp-photo-album-plus' ),
|
152 |
+
'href' => admin_url( 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) ),
|
153 |
);
|
154 |
// Add item
|
155 |
$wp_admin_bar->add_menu( $menu_item );
|
wppa-admins-choice-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the admins-choice widget
|
6 |
-
* Version 8.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -111,7 +111,7 @@ class AdminsChoice extends WP_Widget {
|
|
111 |
if ( wppa_opt( 'admins_choice' ) == 'none' ) {
|
112 |
echo
|
113 |
'<p style="color:red;" >' .
|
114 |
-
__( 'Please enable this feature
|
115 |
'</p>';
|
116 |
}
|
117 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the admins-choice widget
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
111 |
if ( wppa_opt( 'admins_choice' ) == 'none' ) {
|
112 |
echo
|
113 |
'<p style="color:red;" >' .
|
114 |
+
__( 'Please enable this feature', 'wp-photo-album-plus' ) . ' ' . wppa_see_also( 'system', '1', '28' );
|
115 |
'</p>';
|
116 |
}
|
117 |
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 8.0.07.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -1518,7 +1518,7 @@ global $wppa;
|
|
1518 |
$nonce = wppa_get( 'nonce' );
|
1519 |
|
1520 |
// Check validity
|
1521 |
-
if ( ! wp_verify_nonce( $nonce, '
|
1522 |
echo '||0||'.__( 'You do not have the rights to delete a photo' , 'wp-photo-album-plus');
|
1523 |
wppa_exit(); // Nonce check failed
|
1524 |
}
|
@@ -1550,7 +1550,7 @@ global $wppa;
|
|
1550 |
$nonce = wppa_get( 'nonce' );
|
1551 |
|
1552 |
// Check validity
|
1553 |
-
if ( ! wp_verify_nonce( $nonce, '
|
1554 |
echo '||0||'.__( 'You do not have the rights to undelete a photo' , 'wp-photo-album-plus');
|
1555 |
wppa_exit(); // Nonce check failed
|
1556 |
}
|
@@ -1614,7 +1614,7 @@ global $wppa;
|
|
1614 |
}
|
1615 |
|
1616 |
// Check validity
|
1617 |
-
if ( ! wp_verify_nonce( $nonce, '
|
1618 |
echo '||0||'.__( 'You do not have the rights to update album information' , 'wp-photo-album-plus').$nonce;
|
1619 |
wppa_exit(); // Nonce check failed
|
1620 |
}
|
@@ -1958,7 +1958,7 @@ global $wppa;
|
|
1958 |
$comstat = wppa_get( 'comment-status' );
|
1959 |
|
1960 |
// Check validity
|
1961 |
-
if ( ! wp_verify_nonce( $nonce, '
|
1962 |
echo '||0||'.__( 'You do not have the rights to update comment status' , 'wp-photo-album-plus').$nonce;
|
1963 |
wppa_exit(); // Nonce check failed
|
1964 |
}
|
@@ -1991,7 +1991,7 @@ global $wppa;
|
|
1991 |
$nonce = wppa_get( 'nonce' );
|
1992 |
|
1993 |
// Check validity
|
1994 |
-
if ( ! wp_verify_nonce( $nonce, '
|
1995 |
echo '||1||'.__( 'You do not have the rights to change photos' , 'wp-photo-album-plus');
|
1996 |
wppa_exit(); // Nonce check failed
|
1997 |
}
|
@@ -2028,7 +2028,7 @@ global $wppa;
|
|
2028 |
}
|
2029 |
|
2030 |
// Check validity
|
2031 |
-
if ( ! wp_verify_nonce( $nonce, '
|
2032 |
$txt = __( 'You do not have the rights to update photo information' , 'wp-photo-album-plus');
|
2033 |
wppa_json_photo_update( $photo, $txt, '1' ); // Nonce check failed
|
2034 |
}
|
@@ -2961,7 +2961,7 @@ global $wppa;
|
|
2961 |
$tag = wppa_get( 'tagname' );
|
2962 |
|
2963 |
// Check validity
|
2964 |
-
if ( ! wp_verify_nonce( $nonce, '
|
2965 |
$txt = __( 'You do not have the rights to update photo information' , 'wp-photo-album-plus');
|
2966 |
wppa_json_photo_update( $photo, $txt, '1' );
|
2967 |
}
|
@@ -3976,7 +3976,7 @@ global $wppa;
|
|
3976 |
wppa_exit();
|
3977 |
}
|
3978 |
$nonce = wppa_get( 'nonce' );
|
3979 |
-
if ( ! $nonce || ! wp_verify_nonce( $nonce, '
|
3980 |
echo 'Security check failure #798';
|
3981 |
wppa_exit();
|
3982 |
}
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 8.0.07.004
|
6 |
*
|
7 |
*/
|
8 |
|
1518 |
$nonce = wppa_get( 'nonce' );
|
1519 |
|
1520 |
// Check validity
|
1521 |
+
if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
|
1522 |
echo '||0||'.__( 'You do not have the rights to delete a photo' , 'wp-photo-album-plus');
|
1523 |
wppa_exit(); // Nonce check failed
|
1524 |
}
|
1550 |
$nonce = wppa_get( 'nonce' );
|
1551 |
|
1552 |
// Check validity
|
1553 |
+
if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
|
1554 |
echo '||0||'.__( 'You do not have the rights to undelete a photo' , 'wp-photo-album-plus');
|
1555 |
wppa_exit(); // Nonce check failed
|
1556 |
}
|
1614 |
}
|
1615 |
|
1616 |
// Check validity
|
1617 |
+
if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$album ) ) {
|
1618 |
echo '||0||'.__( 'You do not have the rights to update album information' , 'wp-photo-album-plus').$nonce;
|
1619 |
wppa_exit(); // Nonce check failed
|
1620 |
}
|
1958 |
$comstat = wppa_get( 'comment-status' );
|
1959 |
|
1960 |
// Check validity
|
1961 |
+
if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
|
1962 |
echo '||0||'.__( 'You do not have the rights to update comment status' , 'wp-photo-album-plus').$nonce;
|
1963 |
wppa_exit(); // Nonce check failed
|
1964 |
}
|
1991 |
$nonce = wppa_get( 'nonce' );
|
1992 |
|
1993 |
// Check validity
|
1994 |
+
if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
|
1995 |
echo '||1||'.__( 'You do not have the rights to change photos' , 'wp-photo-album-plus');
|
1996 |
wppa_exit(); // Nonce check failed
|
1997 |
}
|
2028 |
}
|
2029 |
|
2030 |
// Check validity
|
2031 |
+
if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
|
2032 |
$txt = __( 'You do not have the rights to update photo information' , 'wp-photo-album-plus');
|
2033 |
wppa_json_photo_update( $photo, $txt, '1' ); // Nonce check failed
|
2034 |
}
|
2961 |
$tag = wppa_get( 'tagname' );
|
2962 |
|
2963 |
// Check validity
|
2964 |
+
if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
|
2965 |
$txt = __( 'You do not have the rights to update photo information' , 'wp-photo-album-plus');
|
2966 |
wppa_json_photo_update( $photo, $txt, '1' );
|
2967 |
}
|
3976 |
wppa_exit();
|
3977 |
}
|
3978 |
$nonce = wppa_get( 'nonce' );
|
3979 |
+
if ( ! $nonce || ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$album ) ) {
|
3980 |
echo 'Security check failure #798';
|
3981 |
wppa_exit();
|
3982 |
}
|
wppa-album-admin-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* create, edit and delete albums
|
6 |
-
* Version 8.0.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -56,19 +56,19 @@ global $wppa_revno;
|
|
56 |
}
|
57 |
}
|
58 |
|
59 |
-
if (
|
60 |
|
61 |
// album edit page
|
62 |
-
if (
|
63 |
|
64 |
-
if (
|
65 |
|
66 |
-
$ei =
|
67 |
if ( $ei != 'new' && $ei != 'search' && $ei != 'trash' && $ei != 'single' && ! is_numeric( $ei ) ) {
|
68 |
wppa_error_message( sprintf( __( 'Album edit id %s is not implemented', 'wp-photo-album-plus' ), $ei ) );
|
69 |
return;
|
70 |
}
|
71 |
-
if ( ! wp_verify_nonce(
|
72 |
wp_die('Security check failure');
|
73 |
}
|
74 |
if ( is_numeric( $ei ) ) {
|
@@ -83,16 +83,9 @@ global $wppa_revno;
|
|
83 |
}
|
84 |
}
|
85 |
|
86 |
-
if (
|
87 |
|
88 |
-
|
89 |
-
$txt = $_REQUEST['just-edit'];
|
90 |
-
}
|
91 |
-
else $txt = '';
|
92 |
-
|
93 |
-
if ( ! $txt ) {
|
94 |
-
$txt = __( 'Edit Single Photo', 'wp-photo-album-plus' );
|
95 |
-
}
|
96 |
|
97 |
echo '<div class="wrap" >
|
98 |
<h2>' . htmlspecialchars( $txt ) . '</h2>';
|
@@ -101,7 +94,7 @@ global $wppa_revno;
|
|
101 |
return;
|
102 |
}
|
103 |
|
104 |
-
if ( $_REQUEST['
|
105 |
|
106 |
$back_url = get_admin_url() . 'admin.php?page=wppa_admin_menu';
|
107 |
if ( isset ( $_REQUEST['wppa-searchstring'] ) ) {
|
@@ -159,7 +152,7 @@ global $wppa_revno;
|
|
159 |
return;
|
160 |
}
|
161 |
|
162 |
-
if ( $_REQUEST['
|
163 |
|
164 |
echo '
|
165 |
<div class="wrap">
|
@@ -173,7 +166,7 @@ global $wppa_revno;
|
|
173 |
return;
|
174 |
}
|
175 |
|
176 |
-
if ( $_REQUEST['
|
177 |
|
178 |
if ( ! wppa_can_create_album() ) {
|
179 |
wp_die( __( 'You have insufficient rights to create an album', 'wp-photo-album-plus' ) );
|
@@ -241,7 +234,7 @@ global $wppa_revno;
|
|
241 |
}
|
242 |
}
|
243 |
else {
|
244 |
-
$edit_id = strval( intval( $_REQUEST['
|
245 |
}
|
246 |
|
247 |
// See if this user may edit this album
|
@@ -252,7 +245,7 @@ global $wppa_revno;
|
|
252 |
|
253 |
// Apply new desc
|
254 |
if ( isset( $_REQUEST['applynewdesc'] ) ) {
|
255 |
-
if ( ! wp_verify_nonce( $_REQUEST['
|
256 |
wp_die( __( 'You do not have the rights to do this', 'wp-photo-album-plus' ) );
|
257 |
}
|
258 |
$iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
|
@@ -263,7 +256,7 @@ global $wppa_revno;
|
|
263 |
|
264 |
// Remake album
|
265 |
if ( isset( $_REQUEST['remakealbum'] ) ) {
|
266 |
-
if ( ! wp_verify_nonce( $_REQUEST['
|
267 |
wp_die( __( 'You do not have the rights to do this', 'wp-photo-album-plus' ) );
|
268 |
}
|
269 |
|
@@ -490,7 +483,7 @@ global $wppa_revno;
|
|
490 |
function wppaTrySetAllPanorama( id ) {
|
491 |
var panoval = jQuery( "#pano-opt" ).val();
|
492 |
if ( panoval == 0 || panoval == 1 || panoval == 2 ) {
|
493 |
-
var url = "' . wppa_dbg_url(get_admin_url()) . 'admin.php?page=wppa_admin_menu&tab=edit&
|
494 |
document.location = url;
|
495 |
}
|
496 |
else {
|
@@ -514,7 +507,7 @@ global $wppa_revno;
|
|
514 |
<input
|
515 |
type="hidden"
|
516 |
id="album-nonce-' . $id . '"
|
517 |
-
value="' . wp_create_nonce( '
|
518 |
/>';
|
519 |
|
520 |
// The edit albuminfo panel
|
@@ -1438,7 +1431,7 @@ global $wppa_revno;
|
|
1438 |
|
1439 |
// Create subalbum
|
1440 |
if ( wppa_can_create_album() ) {
|
1441 |
-
$url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&
|
1442 |
$onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
|
1443 |
|
1444 |
echo
|
@@ -1456,10 +1449,10 @@ global $wppa_revno;
|
|
1456 |
'admin.php' .
|
1457 |
'?page=wppa_admin_menu' .
|
1458 |
'&tab=edit' .
|
1459 |
-
'&
|
1460 |
'&parent_id=' . $albuminfo['a_parent'] .
|
1461 |
'&is_sibling_of=' . $albuminfo['id'] .
|
1462 |
-
'&
|
1463 |
$onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
|
1464 |
|
1465 |
echo
|
@@ -1472,7 +1465,7 @@ global $wppa_revno;
|
|
1472 |
|
1473 |
// Edit parent
|
1474 |
if ( $albuminfo['a_parent'] > '0' && wppa_album_exists( $albuminfo['a_parent'] ) && wppa_have_access( $albuminfo['a_parent'] ) ) {
|
1475 |
-
$url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&
|
1476 |
$onc = 'document.location=\''.$url.'\';';
|
1477 |
echo
|
1478 |
'<input' .
|
@@ -1637,8 +1630,8 @@ global $wppa_revno;
|
|
1637 |
// album delete confirm page
|
1638 |
else if ($_REQUEST['tab'] == 'del') {
|
1639 |
|
1640 |
-
$album_owner = $wpdb->get_var($wpdb->prepare( "SELECT owner FROM $wpdb->wppa_albums WHERE id = %s", $_REQUEST['
|
1641 |
-
if ( ( $album_owner == '--- public ---' && ! current_user_can('administrator') ) || ! wppa_have_access($_REQUEST['
|
1642 |
wp_die('You do not have the rights to delete this album');
|
1643 |
}
|
1644 |
?>
|
@@ -1646,7 +1639,7 @@ global $wppa_revno;
|
|
1646 |
<img src="<?php echo WPPA_URL.'/img/albumdel32.png' ?>" />
|
1647 |
<h1 style="display:inline;" ><?php _e('Delete Album', 'wp-photo-album-plus'); ?></h1>
|
1648 |
|
1649 |
-
<p><?php _e('Album:', 'wp-photo-album-plus'); ?> <b><?php echo htmlspecialchars( wppa_get_album_name($_REQUEST['
|
1650 |
<p><?php _e('Are you sure you want to delete this album?', 'wp-photo-album-plus'); ?><br />
|
1651 |
<?php _e('Press Delete to continue, and Cancel to go back.', 'wp-photo-album-plus'); ?>
|
1652 |
</p>
|
@@ -1660,7 +1653,7 @@ global $wppa_revno;
|
|
1660 |
<?php echo wppa_album_select_a( array( 'checkaccess' => true,
|
1661 |
'path' => true,
|
1662 |
'selected' => '0',
|
1663 |
-
'exclude' => strval( intval( $_REQUEST['
|
1664 |
'addpleaseselect' => true,
|
1665 |
'sort' => true,
|
1666 |
) )
|
@@ -1668,7 +1661,7 @@ global $wppa_revno;
|
|
1668 |
</select>
|
1669 |
</p>
|
1670 |
|
1671 |
-
<input type="hidden" name="wppa-del-id" value="<?php echo strval( intval( $_REQUEST['
|
1672 |
<input type="button" class="button-primary" value="<?php _e('Cancel', 'wp-photo-album-plus'); ?>" onclick="parent.history.back()" />
|
1673 |
<input type="submit" class="button-primary" style="color: red" name="wppa-del-confirm" value="<?php _e('Delete', 'wp-photo-album-plus'); ?>" />
|
1674 |
</form>
|
@@ -1720,11 +1713,11 @@ global $wppa_revno;
|
|
1720 |
<?php
|
1721 |
// The Create new album button
|
1722 |
if ( wppa_can_create_top_album() ) {
|
1723 |
-
$url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
1724 |
$vfy = __('Are you sure you want to create a new album?', 'wp-photo-album-plus');
|
1725 |
-
echo '<form method="post" action="'.get_admin_url().'admin.php?page=wppa_admin_menu&
|
1726 |
echo '<input type="hidden" name="tab" value="edit" />';
|
1727 |
-
echo '<input type="hidden" name="
|
1728 |
$onc = 'onclick="return confirm(\''.$vfy.'\');"';
|
1729 |
echo '<input type="submit" class="button-primary" '.$onc.' value="'.__('Create New Empty Album', 'wp-photo-album-plus').'" style="height:28px;" />';
|
1730 |
echo '</form>';
|
@@ -1790,8 +1783,8 @@ global $wppa_revno;
|
|
1790 |
<script>
|
1791 |
function wppaGoEditAlbNo() {
|
1792 |
var id = document.getElementById("wppa-edit-albid").value;
|
1793 |
-
var nonce = "' . wp_create_nonce( '
|
1794 |
-
var href = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&
|
1795 |
document.location.href=href;
|
1796 |
}
|
1797 |
</script>
|
@@ -2104,7 +2097,7 @@ global $wpdb;
|
|
2104 |
<?php } ?>
|
2105 |
<td><?php echo($album['a_order']) ?></td>
|
2106 |
<td><?php echo sanitize_text_field( wppa_get_album_name( $album['a_parent'], array( 'extended' => true ))) ?></td>
|
2107 |
-
<?php $url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
2108 |
<?php $na = $counts['selfalbums']; ?>
|
2109 |
<?php $np = $counts['selfphotos']; ?>
|
2110 |
<?php $nm = $counts['pendselfphotos']; ?>
|
@@ -2128,7 +2121,7 @@ global $wpdb;
|
|
2128 |
<?php
|
2129 |
$covid = max( $album['main_photo'], '0' );
|
2130 |
if ( $covid ) {
|
2131 |
-
$curl = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
2132 |
echo '<td><a href="'.$curl.'" class="wppaedit">'.__('CovImg', 'wp-photo-album-plus').'</a></td>';
|
2133 |
}
|
2134 |
else {
|
@@ -2147,7 +2140,7 @@ global $wpdb;
|
|
2147 |
<?php $url = wppa_ea_url($album['id'], 'del') ?>
|
2148 |
<td><a href="<?php echo($url) ?>" class="wppadelete"><?php _e('Delete', 'wp-photo-album-plus'); ?></a></td>
|
2149 |
<?php if ( wppa_can_create_album() ) {
|
2150 |
-
$url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
2151 |
$onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
|
2152 |
echo '<td><a onclick="'.$onc.'" class="wppacreate">'.__('Create', 'wp-photo-album-plus').'</a></td>';
|
2153 |
}
|
@@ -2981,7 +2974,7 @@ global $wpdb;
|
|
2981 |
<?php } ?>
|
2982 |
<td><?php echo($album['a_order']) ?></td>
|
2983 |
<td><?php echo sanitize_text_field(wppa_get_album_name($album['a_parent'], array( 'extended' => true ))) ?></td>
|
2984 |
-
<?php $url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
2985 |
<?php $na = $counts['selfalbums']; ?>
|
2986 |
<?php $np = $counts['selfphotos']; ?>
|
2987 |
<?php $nm = $counts['pendselfphotos']; ?>
|
@@ -3006,7 +2999,7 @@ global $wpdb;
|
|
3006 |
<?php
|
3007 |
$covid = max( $album['main_photo'], '0' );
|
3008 |
if ( $covid ) {
|
3009 |
-
$curl = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
3010 |
echo '<td><a href="'.$curl.'" class="wppaedit">'.__('CovImg', 'wp-photo-album-plus').'</a></td>';
|
3011 |
}
|
3012 |
else {
|
@@ -3027,7 +3020,7 @@ global $wpdb;
|
|
3027 |
?>
|
3028 |
</td>
|
3029 |
<?php if ( wppa_can_create_album() ) {
|
3030 |
-
$url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
3031 |
$onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
|
3032 |
echo '<td><a onclick="'.$onc.'" class="wppacreate">'.__('Create', 'wp-photo-album-plus').'</a></td>';
|
3033 |
}
|
@@ -3127,7 +3120,7 @@ function wppa_main_photo($cur, $covertype) {
|
|
3127 |
global $wpdb;
|
3128 |
|
3129 |
$output = '';
|
3130 |
-
$a_id = strval( intval( $_REQUEST['
|
3131 |
$photos = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->wppa_photos WHERE album = %s " . wppa_get_photo_order( $a_id ) . " LIMIT 1000", $a_id ), ARRAY_A );
|
3132 |
|
3133 |
$cur_in_album = wppa_get_photo_item( $cur, 'album' ) == $a_id;
|
@@ -3606,7 +3599,7 @@ global $wpdb;
|
|
3606 |
'<br />' .
|
3607 |
'<a href="' . esc_url( wppa_ea_url( $albid ) ) . '" style="position:absolute;bottom:0;" >' . __( 'Edit', 'wp-photo-album-plus' ) . '</a>' .
|
3608 |
'</div>' .
|
3609 |
-
'<input type="hidden" id="album-nonce-' . $albid . '" value="' . wp_create_nonce( '
|
3610 |
'<input type="hidden" class="wppa-sort-item-albums" value="' . $albid . '" />' .
|
3611 |
'<input type="hidden" class="wppa-sort-seqn-albums" id="wppa-sort-seqn-albums-' . $albid . '" value="' . $album['a_order'] . '" />' .
|
3612 |
'</div>';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* create, edit and delete albums
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
56 |
}
|
57 |
}
|
58 |
|
59 |
+
if ( wppa_get( 'tab' ) ) {
|
60 |
|
61 |
// album edit page
|
62 |
+
if ( wppa_get( 'tab' ) == 'edit' ) {
|
63 |
|
64 |
+
if ( wppa_get( 'edit-id' ) ) {
|
65 |
|
66 |
+
$ei = wppa_get( 'edit-id' );
|
67 |
if ( $ei != 'new' && $ei != 'search' && $ei != 'trash' && $ei != 'single' && ! is_numeric( $ei ) ) {
|
68 |
wppa_error_message( sprintf( __( 'Album edit id %s is not implemented', 'wp-photo-album-plus' ), $ei ) );
|
69 |
return;
|
70 |
}
|
71 |
+
if ( ! wp_verify_nonce( wppa_get( 'nonce' ), 'wppa-nonce' ) ) {
|
72 |
wp_die('Security check failure');
|
73 |
}
|
74 |
if ( is_numeric( $ei ) ) {
|
83 |
}
|
84 |
}
|
85 |
|
86 |
+
if ( wppa_get( 'edit-id' ) == 'single' ) {
|
87 |
|
88 |
+
$txt = wppa_get( 'just-edit', __( 'Edit Single Photo', 'wp-photo-album-plus' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
echo '<div class="wrap" >
|
91 |
<h2>' . htmlspecialchars( $txt ) . '</h2>';
|
94 |
return;
|
95 |
}
|
96 |
|
97 |
+
if ( $_REQUEST['edit-id'] == 'search' ) {
|
98 |
|
99 |
$back_url = get_admin_url() . 'admin.php?page=wppa_admin_menu';
|
100 |
if ( isset ( $_REQUEST['wppa-searchstring'] ) ) {
|
152 |
return;
|
153 |
}
|
154 |
|
155 |
+
if ( $_REQUEST['edit-id'] == 'trash' ) {
|
156 |
|
157 |
echo '
|
158 |
<div class="wrap">
|
166 |
return;
|
167 |
}
|
168 |
|
169 |
+
if ( $_REQUEST['edit-id'] == 'new' ) {
|
170 |
|
171 |
if ( ! wppa_can_create_album() ) {
|
172 |
wp_die( __( 'You have insufficient rights to create an album', 'wp-photo-album-plus' ) );
|
234 |
}
|
235 |
}
|
236 |
else {
|
237 |
+
$edit_id = strval( intval( $_REQUEST['edit-id'] ) );
|
238 |
}
|
239 |
|
240 |
// See if this user may edit this album
|
245 |
|
246 |
// Apply new desc
|
247 |
if ( isset( $_REQUEST['applynewdesc'] ) ) {
|
248 |
+
if ( ! wp_verify_nonce( $_REQUEST['wppa-nonce'], 'wppa-nonce') ) {
|
249 |
wp_die( __( 'You do not have the rights to do this', 'wp-photo-album-plus' ) );
|
250 |
}
|
251 |
$iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
|
256 |
|
257 |
// Remake album
|
258 |
if ( isset( $_REQUEST['remakealbum'] ) ) {
|
259 |
+
if ( ! wp_verify_nonce( $_REQUEST['wppa-nonce'], 'wppa-nonce' ) ) {
|
260 |
wp_die( __( 'You do not have the rights to do this', 'wp-photo-album-plus' ) );
|
261 |
}
|
262 |
|
483 |
function wppaTrySetAllPanorama( id ) {
|
484 |
var panoval = jQuery( "#pano-opt" ).val();
|
485 |
if ( panoval == 0 || panoval == 1 || panoval == 2 ) {
|
486 |
+
var url = "' . wppa_dbg_url(get_admin_url()) . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id="+id+"&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&pano-val="+panoval;
|
487 |
document.location = url;
|
488 |
}
|
489 |
else {
|
507 |
<input
|
508 |
type="hidden"
|
509 |
id="album-nonce-' . $id . '"
|
510 |
+
value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '"
|
511 |
/>';
|
512 |
|
513 |
// The edit albuminfo panel
|
1431 |
|
1432 |
// Create subalbum
|
1433 |
if ( wppa_can_create_album() ) {
|
1434 |
+
$url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&parent_id=' . $albuminfo['id'] . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
|
1435 |
$onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
|
1436 |
|
1437 |
echo
|
1449 |
'admin.php' .
|
1450 |
'?page=wppa_admin_menu' .
|
1451 |
'&tab=edit' .
|
1452 |
+
'&edit-id=new' .
|
1453 |
'&parent_id=' . $albuminfo['a_parent'] .
|
1454 |
'&is_sibling_of=' . $albuminfo['id'] .
|
1455 |
+
'&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
|
1456 |
$onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
|
1457 |
|
1458 |
echo
|
1465 |
|
1466 |
// Edit parent
|
1467 |
if ( $albuminfo['a_parent'] > '0' && wppa_album_exists( $albuminfo['a_parent'] ) && wppa_have_access( $albuminfo['a_parent'] ) ) {
|
1468 |
+
$url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=' . $albuminfo['a_parent'] . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
|
1469 |
$onc = 'document.location=\''.$url.'\';';
|
1470 |
echo
|
1471 |
'<input' .
|
1630 |
// album delete confirm page
|
1631 |
else if ($_REQUEST['tab'] == 'del') {
|
1632 |
|
1633 |
+
$album_owner = $wpdb->get_var($wpdb->prepare( "SELECT owner FROM $wpdb->wppa_albums WHERE id = %s", $_REQUEST['edit-id']));
|
1634 |
+
if ( ( $album_owner == '--- public ---' && ! current_user_can('administrator') ) || ! wppa_have_access($_REQUEST['edit-id']) ) {
|
1635 |
wp_die('You do not have the rights to delete this album');
|
1636 |
}
|
1637 |
?>
|
1639 |
<img src="<?php echo WPPA_URL.'/img/albumdel32.png' ?>" />
|
1640 |
<h1 style="display:inline;" ><?php _e('Delete Album', 'wp-photo-album-plus'); ?></h1>
|
1641 |
|
1642 |
+
<p><?php _e('Album:', 'wp-photo-album-plus'); ?> <b><?php echo htmlspecialchars( wppa_get_album_name($_REQUEST['edit-id']) ); ?>.</b></p>
|
1643 |
<p><?php _e('Are you sure you want to delete this album?', 'wp-photo-album-plus'); ?><br />
|
1644 |
<?php _e('Press Delete to continue, and Cancel to go back.', 'wp-photo-album-plus'); ?>
|
1645 |
</p>
|
1653 |
<?php echo wppa_album_select_a( array( 'checkaccess' => true,
|
1654 |
'path' => true,
|
1655 |
'selected' => '0',
|
1656 |
+
'exclude' => strval( intval( $_REQUEST['edit-id'] ) ),
|
1657 |
'addpleaseselect' => true,
|
1658 |
'sort' => true,
|
1659 |
) )
|
1661 |
</select>
|
1662 |
</p>
|
1663 |
|
1664 |
+
<input type="hidden" name="wppa-del-id" value="<?php echo strval( intval( $_REQUEST['edit-id'] ) ) ?>" />
|
1665 |
<input type="button" class="button-primary" value="<?php _e('Cancel', 'wp-photo-album-plus'); ?>" onclick="parent.history.back()" />
|
1666 |
<input type="submit" class="button-primary" style="color: red" name="wppa-del-confirm" value="<?php _e('Delete', 'wp-photo-album-plus'); ?>" />
|
1667 |
</form>
|
1713 |
<?php
|
1714 |
// The Create new album button
|
1715 |
if ( wppa_can_create_top_album() ) {
|
1716 |
+
$url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&wppa-nonce='.wp_create_nonce('wppa-nonce'));
|
1717 |
$vfy = __('Are you sure you want to create a new album?', 'wp-photo-album-plus');
|
1718 |
+
echo '<form method="post" action="'.get_admin_url().'admin.php?page=wppa_admin_menu&wppa-nonce='.wp_create_nonce('wppa-nonce').'" style="float:left; margin-right:12px;" >';
|
1719 |
echo '<input type="hidden" name="tab" value="edit" />';
|
1720 |
+
echo '<input type="hidden" name="edit-id" value="new" />';
|
1721 |
$onc = 'onclick="return confirm(\''.$vfy.'\');"';
|
1722 |
echo '<input type="submit" class="button-primary" '.$onc.' value="'.__('Create New Empty Album', 'wp-photo-album-plus').'" style="height:28px;" />';
|
1723 |
echo '</form>';
|
1783 |
<script>
|
1784 |
function wppaGoEditAlbNo() {
|
1785 |
var id = document.getElementById("wppa-edit-albid").value;
|
1786 |
+
var nonce = "' . wp_create_nonce( 'wppa-nonce' ) .'";
|
1787 |
+
var href = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&wppa-nonce="+nonce+"&tab=edit&edit-id="+id;
|
1788 |
document.location.href=href;
|
1789 |
}
|
1790 |
</script>
|
2097 |
<?php } ?>
|
2098 |
<td><?php echo($album['a_order']) ?></td>
|
2099 |
<td><?php echo sanitize_text_field( wppa_get_album_name( $album['a_parent'], array( 'extended' => true ))) ?></td>
|
2100 |
+
<?php $url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id='.$album['id']); ?>
|
2101 |
<?php $na = $counts['selfalbums']; ?>
|
2102 |
<?php $np = $counts['selfphotos']; ?>
|
2103 |
<?php $nm = $counts['pendselfphotos']; ?>
|
2121 |
<?php
|
2122 |
$covid = max( $album['main_photo'], '0' );
|
2123 |
if ( $covid ) {
|
2124 |
+
$curl = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo='.$covid.'&wppa-nonce='.wp_create_nonce('wppa-nonce').'&just-edit='.__('Edit cover image', 'wp-photo-album-plus'));
|
2125 |
echo '<td><a href="'.$curl.'" class="wppaedit">'.__('CovImg', 'wp-photo-album-plus').'</a></td>';
|
2126 |
}
|
2127 |
else {
|
2140 |
<?php $url = wppa_ea_url($album['id'], 'del') ?>
|
2141 |
<td><a href="<?php echo($url) ?>" class="wppadelete"><?php _e('Delete', 'wp-photo-album-plus'); ?></a></td>
|
2142 |
<?php if ( wppa_can_create_album() ) {
|
2143 |
+
$url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&parent_id='.$album['id'].'&wppa-nonce='.wp_create_nonce('wppa-nonce'));
|
2144 |
$onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
|
2145 |
echo '<td><a onclick="'.$onc.'" class="wppacreate">'.__('Create', 'wp-photo-album-plus').'</a></td>';
|
2146 |
}
|
2974 |
<?php } ?>
|
2975 |
<td><?php echo($album['a_order']) ?></td>
|
2976 |
<td><?php echo sanitize_text_field(wppa_get_album_name($album['a_parent'], array( 'extended' => true ))) ?></td>
|
2977 |
+
<?php $url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id='.$id); ?>
|
2978 |
<?php $na = $counts['selfalbums']; ?>
|
2979 |
<?php $np = $counts['selfphotos']; ?>
|
2980 |
<?php $nm = $counts['pendselfphotos']; ?>
|
2999 |
<?php
|
3000 |
$covid = max( $album['main_photo'], '0' );
|
3001 |
if ( $covid ) {
|
3002 |
+
$curl = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo='.$covid.'&wppa-nonce='.wp_create_nonce('wppa-nonce').'&just-edit='.__('Edit cover image', 'wp-photo-album-plus'));
|
3003 |
echo '<td><a href="'.$curl.'" class="wppaedit">'.__('CovImg', 'wp-photo-album-plus').'</a></td>';
|
3004 |
}
|
3005 |
else {
|
3020 |
?>
|
3021 |
</td>
|
3022 |
<?php if ( wppa_can_create_album() ) {
|
3023 |
+
$url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&parent_id='.$id.'&wppa-nonce='.wp_create_nonce('wppa-nonce'));
|
3024 |
$onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
|
3025 |
echo '<td><a onclick="'.$onc.'" class="wppacreate">'.__('Create', 'wp-photo-album-plus').'</a></td>';
|
3026 |
}
|
3120 |
global $wpdb;
|
3121 |
|
3122 |
$output = '';
|
3123 |
+
$a_id = strval( intval( $_REQUEST['edit-id'] ) );
|
3124 |
$photos = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->wppa_photos WHERE album = %s " . wppa_get_photo_order( $a_id ) . " LIMIT 1000", $a_id ), ARRAY_A );
|
3125 |
|
3126 |
$cur_in_album = wppa_get_photo_item( $cur, 'album' ) == $a_id;
|
3599 |
'<br />' .
|
3600 |
'<a href="' . esc_url( wppa_ea_url( $albid ) ) . '" style="position:absolute;bottom:0;" >' . __( 'Edit', 'wp-photo-album-plus' ) . '</a>' .
|
3601 |
'</div>' .
|
3602 |
+
'<input type="hidden" id="album-nonce-' . $albid . '" value="' . wp_create_nonce( 'wppa-nonce_' . $albid ) . '" />' .
|
3603 |
'<input type="hidden" class="wppa-sort-item-albums" value="' . $albid . '" />' .
|
3604 |
'<input type="hidden" class="wppa-sort-seqn-albums" id="wppa-sort-seqn-albums-' . $albid . '" value="' . $album['a_order'] . '" />' .
|
3605 |
'</div>';
|
wppa-album-covers.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for album covers
|
6 |
-
* Version 8.0.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -137,20 +137,20 @@ global $wpdb;
|
|
137 |
$title = $title_attr['title'];
|
138 |
|
139 |
// Find the slideshow link and onclick
|
140 |
-
$href_slideshow =
|
|
|
|
|
|
|
141 |
if ( ! $linkpage ) {
|
142 |
-
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
143 |
-
wppa_encrypt_url( wppa_get_slideshow_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
144 |
-
wppa_convert_to_pretty( $href_slideshow ) . "' )";
|
145 |
$href_slideshow = "#";
|
146 |
}
|
147 |
|
148 |
// Find the content 'View' link
|
149 |
-
$href_content =
|
|
|
150 |
if ( ! $linkpage ) {
|
151 |
-
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
152 |
-
wppa_encrypt_url( wppa_get_album_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
153 |
-
wppa_convert_to_pretty( $href_content ) . "' )";
|
154 |
$href_content = "#";
|
155 |
}
|
156 |
|
@@ -468,20 +468,18 @@ global $wpdb;
|
|
468 |
}
|
469 |
|
470 |
// Find the slideshow link and onclick
|
471 |
-
$href_slideshow =
|
|
|
472 |
if ( ! $linkpage ) {
|
473 |
-
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
474 |
-
wppa_encrypt_url( wppa_get_slideshow_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
475 |
-
wppa_convert_to_pretty( $href_slideshow ) . "' )";
|
476 |
$href_slideshow = "#";
|
477 |
}
|
478 |
|
479 |
// Find the content 'View' link
|
480 |
-
$href_content =
|
|
|
481 |
if ( ! $linkpage ) {
|
482 |
-
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
483 |
-
wppa_encrypt_url( wppa_get_album_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
484 |
-
wppa_convert_to_pretty( $href_content ) . "' )";
|
485 |
$href_content = "#";
|
486 |
}
|
487 |
|
@@ -642,20 +640,18 @@ global $wpdb;
|
|
642 |
$title = $title_attr['title'];
|
643 |
|
644 |
// Find the slideshow link and onclick
|
645 |
-
$href_slideshow =
|
|
|
646 |
if ( ! $linkpage ) {
|
647 |
-
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
648 |
-
wppa_encrypt_url( wppa_get_slideshow_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
649 |
-
wppa_convert_to_pretty( $href_slideshow ) . "' )";
|
650 |
$href_slideshow = "#";
|
651 |
}
|
652 |
|
653 |
// Find the content 'View' link
|
654 |
-
$href_content =
|
|
|
655 |
if ( ! $linkpage ) {
|
656 |
-
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
657 |
-
wppa_encrypt_url( wppa_get_album_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
658 |
-
wppa_convert_to_pretty( $href_content ) . "' )";
|
659 |
$href_content = "#";
|
660 |
}
|
661 |
|
@@ -1596,7 +1592,9 @@ function wppa_get_album_title_attr_a( $albumid, $linktype, $linkpage, $has_conte
|
|
1596 |
case 'thumbs':
|
1597 |
case 'albums':
|
1598 |
if ( $has_content ) {
|
1599 |
-
$href_title = wppa_get_album_url( $albumid,
|
|
|
|
|
1600 |
}
|
1601 |
else {
|
1602 |
$href_title = get_page_link( $album['cover_linkpage'] );
|
@@ -1604,7 +1602,8 @@ function wppa_get_album_title_attr_a( $albumid, $linktype, $linkpage, $has_conte
|
|
1604 |
break;
|
1605 |
case 'slide':
|
1606 |
if ( $has_content ) {
|
1607 |
-
$href_title = wppa_get_slideshow_url( $albumid,
|
|
|
1608 |
}
|
1609 |
else {
|
1610 |
$href_title = get_page_link( $album['cover_linkpage'] );
|
@@ -1628,20 +1627,24 @@ function wppa_get_album_title_attr_a( $albumid, $linktype, $linkpage, $has_conte
|
|
1628 |
case 'content':
|
1629 |
case 'thumbs':
|
1630 |
case 'albums':
|
1631 |
-
$href_title =
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
|
|
|
|
|
|
|
|
1635 |
$href_title = "#";
|
1636 |
-
|
1637 |
break;
|
1638 |
case 'slide':
|
1639 |
-
$href_title =
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
$href_title = "#";
|
1644 |
|
|
|
|
|
1645 |
break;
|
1646 |
case 'none':
|
1647 |
break;
|
@@ -1889,7 +1892,7 @@ function wppa_the_album_title( $alb, $href_title, $onclick_title, $title, $targe
|
|
1889 |
$edit = wppa_have_access( $alb ) && current_user_can( 'wppa_admin' );
|
1890 |
if ( $show == 'all' || ( $show == 'access' && $edit ) ) {
|
1891 |
if ( wppa_switch( 'fe_albid_edit' ) && $edit ) {
|
1892 |
-
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&
|
1893 |
$album_id = '
|
1894 |
<a
|
1895 |
href="' . $href . '"
|
@@ -2052,32 +2055,26 @@ global $wpdb;
|
|
2052 |
// Thumbnails and covers, show sub-album covers
|
2053 |
// in case slideshow is requested on an empty album
|
2054 |
if ( wppa_opt( 'cover_sublinks' ) == 'content' || ! $photocount ) {
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
$onclick_content = '';
|
2064 |
-
}
|
2065 |
-
$title = esc_attr( __( 'View the album', 'wp-photo-album-plus' ) . ': ' . wppa_get_album_name( $album['id'] ) );
|
2066 |
}
|
2067 |
|
2068 |
// Slideshow
|
2069 |
elseif ( wppa_opt( 'cover_sublinks' ) == 'slide' ) {
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
$onclick_content = '';
|
2079 |
-
}
|
2080 |
-
$title = esc_attr( __( 'View the album', 'wp-photo-album-plus' ) . ': ' . wppa_get_album_name( $album['id'] ) );
|
2081 |
}
|
2082 |
|
2083 |
// Subalbum title link
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for album covers
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
137 |
$title = $title_attr['title'];
|
138 |
|
139 |
// Find the slideshow link and onclick
|
140 |
+
$href_slideshow = wppa_get_slideshow_url( array( 'album' => $albumid,
|
141 |
+
'page' => $linkpage ) );
|
142 |
+
$ajax_slideshow = wppa_get_slideshow_url_ajax( array( 'album' => $albumid,
|
143 |
+
'page' => $linkpage ) );
|
144 |
if ( ! $linkpage ) {
|
145 |
+
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $ajax_slideshow . "', '" . $href_slideshow . "' )";
|
|
|
|
|
146 |
$href_slideshow = "#";
|
147 |
}
|
148 |
|
149 |
// Find the content 'View' link
|
150 |
+
$href_content = wppa_get_album_url( array( 'album' => $albumid, 'page' => $linkpage ) );
|
151 |
+
$ajax_content = wppa_get_album_url_ajax( array( 'album' => $albumid, 'page' => $linkpage ) );
|
152 |
if ( ! $linkpage ) {
|
153 |
+
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $ajax_content . "', '" . $href_content . "' )";
|
|
|
|
|
154 |
$href_content = "#";
|
155 |
}
|
156 |
|
468 |
}
|
469 |
|
470 |
// Find the slideshow link and onclick
|
471 |
+
$href_slideshow = wppa_get_slideshow_url( array( 'album' => $albumid,
|
472 |
+
'page' => $linkpage ) );
|
473 |
if ( ! $linkpage ) {
|
474 |
+
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $ajax_slideshow . "', '" . $href_slideshow . "' )";
|
|
|
|
|
475 |
$href_slideshow = "#";
|
476 |
}
|
477 |
|
478 |
// Find the content 'View' link
|
479 |
+
$href_content = wppa_get_album_url( array( 'album' => $albumid, 'page' => $linkpage ) );
|
480 |
+
$ajax_content = wppa_get_album_url_ajax( array( 'album' => $albumid, 'page' => $linkpage ) );
|
481 |
if ( ! $linkpage ) {
|
482 |
+
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $ajax_content . "', '" . $href_content . "' )";
|
|
|
|
|
483 |
$href_content = "#";
|
484 |
}
|
485 |
|
640 |
$title = $title_attr['title'];
|
641 |
|
642 |
// Find the slideshow link and onclick
|
643 |
+
$href_slideshow = wppa_get_slideshow_url( array( 'album' => $albumid,
|
644 |
+
'page' => $linkpage ) );
|
645 |
if ( ! $linkpage ) {
|
646 |
+
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $ajax_slideshow . "', '" . $href_slideshow . "' )";
|
|
|
|
|
647 |
$href_slideshow = "#";
|
648 |
}
|
649 |
|
650 |
// Find the content 'View' link
|
651 |
+
$href_content = wppa_get_album_url( array( 'album' => $albumid, 'page' => $linkpage ) );
|
652 |
+
$ajax_content = wppa_get_album_url_ajax( array( 'album' => $albumid, 'page' => $linkpage ) );
|
653 |
if ( ! $linkpage ) {
|
654 |
+
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $ajax_content . "', '" . $href_content . "' )";
|
|
|
|
|
655 |
$href_content = "#";
|
656 |
}
|
657 |
|
1592 |
case 'thumbs':
|
1593 |
case 'albums':
|
1594 |
if ( $has_content ) {
|
1595 |
+
$href_title = wppa_get_album_url( array( 'album' => $albumid,
|
1596 |
+
'page' => $linkpage,
|
1597 |
+
'type' => $linktype ) );
|
1598 |
}
|
1599 |
else {
|
1600 |
$href_title = get_page_link( $album['cover_linkpage'] );
|
1602 |
break;
|
1603 |
case 'slide':
|
1604 |
if ( $has_content ) {
|
1605 |
+
$href_title = wppa_get_slideshow_url( array( 'album' => $albumid,
|
1606 |
+
'page' => $linkpage ) );
|
1607 |
}
|
1608 |
else {
|
1609 |
$href_title = get_page_link( $album['cover_linkpage'] );
|
1627 |
case 'content':
|
1628 |
case 'thumbs':
|
1629 |
case 'albums':
|
1630 |
+
$href_title = wppa_get_album_url( array( 'album' => $albumid,
|
1631 |
+
'page' => $linkpage,
|
1632 |
+
'type' => $linktype ) );
|
1633 |
+
$ajax_title = wppa_get_album_url_ajax( array( 'album' => $albumid,
|
1634 |
+
'page' => $linkpage,
|
1635 |
+
'type' => $linktype ) );
|
1636 |
+
|
1637 |
+
$onclick_title = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $ajax_title . "', '" . $href_title . "' )";
|
1638 |
$href_title = "#";
|
|
|
1639 |
break;
|
1640 |
case 'slide':
|
1641 |
+
$href_title = wppa_get_slideshow_url( array( 'album' => $albumid,
|
1642 |
+
'page' => $linkpage ) );
|
1643 |
+
$ajax_title = wppa_get_slideshow_url_ajax( array( 'album' => $albumid,
|
1644 |
+
'page' => $linkpage, ) );
|
|
|
1645 |
|
1646 |
+
$onclick_title = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $ajax_title . "', '" . $href_title . "' )";
|
1647 |
+
$href_title = "#";
|
1648 |
break;
|
1649 |
case 'none':
|
1650 |
break;
|
1892 |
$edit = wppa_have_access( $alb ) && current_user_can( 'wppa_admin' );
|
1893 |
if ( $show == 'all' || ( $show == 'access' && $edit ) ) {
|
1894 |
if ( wppa_switch( 'fe_albid_edit' ) && $edit ) {
|
1895 |
+
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&tab=edit&edit-id=' . $alb;
|
1896 |
$album_id = '
|
1897 |
<a
|
1898 |
href="' . $href . '"
|
2055 |
// Thumbnails and covers, show sub-album covers
|
2056 |
// in case slideshow is requested on an empty album
|
2057 |
if ( wppa_opt( 'cover_sublinks' ) == 'content' || ! $photocount ) {
|
2058 |
+
$href_content = wppa_get_album_url( array( 'album' => $albumid,
|
2059 |
+
'page' => $linkpage ) );
|
2060 |
+
$ajax_content = wppa_get_album_url_ajax( array( 'album' => $albumid,
|
2061 |
+
'page' => $linkpage ) );
|
2062 |
+
|
2063 |
+
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $ajax_content . "', '" . $href_content . "' )";
|
2064 |
+
|
2065 |
+
$title = esc_attr( __( 'View the album', 'wp-photo-album-plus' ) . ': ' . wppa_get_album_name( $albumid ) );
|
|
|
|
|
|
|
2066 |
}
|
2067 |
|
2068 |
// Slideshow
|
2069 |
elseif ( wppa_opt( 'cover_sublinks' ) == 'slide' ) {
|
2070 |
+
$href_content = wppa_get_slideshow_url( array( 'album' => $albumid,
|
2071 |
+
'page' => $linkpage ) );
|
2072 |
+
$ajax_content = wppa_get_slideshow_url_ajax( array( 'album' => $albumid,
|
2073 |
+
'page' => $linkpage ) );
|
2074 |
+
|
2075 |
+
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $alax_content . "', '" . $href_content . "' )";
|
2076 |
+
|
2077 |
+
$title = esc_attr( __( 'View the album', 'wp-photo-album-plus' ) . ': ' . wppa_get_album_name( $albumid ) );
|
|
|
|
|
|
|
2078 |
}
|
2079 |
|
2080 |
// Subalbum title link
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 8.0.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -2488,7 +2488,7 @@ function wppa_user_destroy_html( $alb, $width, $where, $rsp ) {
|
|
2488 |
style="float:left; cursor:pointer;"
|
2489 |
onclick="
|
2490 |
jQuery(this).html(\'' . __( 'Working...', 'wp-photo-album-plus' ) . '\');
|
2491 |
-
wppaAjaxDestroyAlbum(' . $alb . ',\'' . wp_create_nonce( '
|
2492 |
jQuery(this).html(\'' . __( 'Delete Album', 'wp-photo-album-plus' ) . '\');
|
2493 |
"
|
2494 |
>' .
|
@@ -3763,7 +3763,7 @@ function wppa_user_albumedit_html( $alb, $width, $where = '', $mcr = false ) {
|
|
3763 |
' type="hidden"' .
|
3764 |
' name="wppa-albumeditnonce"' .
|
3765 |
' id="album-nonce-'.wppa( 'mocc' ).'-'.$alb.'"' .
|
3766 |
-
' value="'.wp_create_nonce( '
|
3767 |
' />
|
3768 |
<input' .
|
3769 |
' type="hidden"' .
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
2488 |
style="float:left; cursor:pointer;"
|
2489 |
onclick="
|
2490 |
jQuery(this).html(\'' . __( 'Working...', 'wp-photo-album-plus' ) . '\');
|
2491 |
+
wppaAjaxDestroyAlbum(' . $alb . ',\'' . wp_create_nonce( 'wppa-nonce_' . $alb ) . '\');
|
2492 |
jQuery(this).html(\'' . __( 'Delete Album', 'wp-photo-album-plus' ) . '\');
|
2493 |
"
|
2494 |
>' .
|
3763 |
' type="hidden"' .
|
3764 |
' name="wppa-albumeditnonce"' .
|
3765 |
' id="album-nonce-'.wppa( 'mocc' ).'-'.$alb.'"' .
|
3766 |
+
' value="'.wp_create_nonce( 'wppa-nonce_'.$alb ).'"' .
|
3767 |
' />
|
3768 |
<input' .
|
3769 |
' type="hidden"' .
|
wppa-breadcrumb.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for breadcrumbs
|
6 |
-
* Version 8.0.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -585,7 +585,11 @@ global $wppa_session;
|
|
585 |
}
|
586 |
else {
|
587 |
$s = wppa( 'src' ) ? '&wppa-searchstring='.urlencode( wppa( 'searchstring' ) ) : '';
|
588 |
-
$
|
|
|
|
|
|
|
|
|
589 |
|
590 |
wppa_out( '<span' .
|
591 |
' title="' . __( 'Thumbnail view', 'wp-photo-album-plus' ) . '"' .
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for breadcrumbs
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
585 |
}
|
586 |
else {
|
587 |
$s = wppa( 'src' ) ? '&wppa-searchstring='.urlencode( wppa( 'searchstring' ) ) : '';
|
588 |
+
$ajax_url = wppa_get_album_url_ajax( array( 'album' => wppa( 'start_album' ),
|
589 |
+
'type' => 'thumbs' ) );
|
590 |
+
$href_url = wppa_get_album_url( array( 'album' => wppa( 'start_album' ),
|
591 |
+
'type' => 'thumbs' ) );
|
592 |
+
$onclick = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" . $ajax_url . $s . "'+wppaPageArg, '" . $href_url . $s . $pg . "', '', '', true )";
|
593 |
|
594 |
wppa_out( '<span' .
|
595 |
' title="' . __( 'Thumbnail view', 'wp-photo-album-plus' ) . '"' .
|
wppa-dashboard-widgets.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Contains dashboard widgets code
|
6 |
*
|
7 |
-
* Version 8.0.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -290,7 +290,7 @@ global $wpdb;
|
|
290 |
foreach( $photos as $photo ) {
|
291 |
$id = $photo['id'];
|
292 |
if ( wppa_user_is( 'administrator' ) ) {
|
293 |
-
$href = get_admin_url() . 'admin.php?page=
|
294 |
}
|
295 |
else {
|
296 |
$href = wppa_get_photo_url( $id );
|
@@ -362,7 +362,7 @@ global $wpdb;
|
|
362 |
foreach( $comments as $comment ) {
|
363 |
$photo = wppa_cache_photo( $comment['photo'] );
|
364 |
if ( wppa_user_is( 'administrator' ) ) {
|
365 |
-
$href = get_admin_url() . 'admin.php?page=
|
366 |
}
|
367 |
else {
|
368 |
$href = wppa_get_photo_url( $photo['id'] );
|
@@ -427,7 +427,7 @@ function wppa_show_potd_log() {
|
|
427 |
$photo = wppa_cache_photo( $item['id'] );
|
428 |
$time = $item['tm'];
|
429 |
if ( wppa_user_is( 'administrator' ) ) {
|
430 |
-
$href = get_admin_url() . 'admin.php?page=
|
431 |
}
|
432 |
else {
|
433 |
$href = wppa_get_photo_url( $photo['id'] );
|
4 |
*
|
5 |
* Contains dashboard widgets code
|
6 |
*
|
7 |
+
* Version 8.0.07.004
|
8 |
*
|
9 |
*/
|
10 |
|
290 |
foreach( $photos as $photo ) {
|
291 |
$id = $photo['id'];
|
292 |
if ( wppa_user_is( 'administrator' ) ) {
|
293 |
+
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo=' . $photo['id'] . '&nonce=' . wp_create_nonce( 'wppa-nonce' );
|
294 |
}
|
295 |
else {
|
296 |
$href = wppa_get_photo_url( $id );
|
362 |
foreach( $comments as $comment ) {
|
363 |
$photo = wppa_cache_photo( $comment['photo'] );
|
364 |
if ( wppa_user_is( 'administrator' ) ) {
|
365 |
+
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo=' . $photo['id'] . '&nonce=' . wp_create_nonce( 'wppa-nonce' );
|
366 |
}
|
367 |
else {
|
368 |
$href = wppa_get_photo_url( $photo['id'] );
|
427 |
$photo = wppa_cache_photo( $item['id'] );
|
428 |
$time = $item['tm'];
|
429 |
if ( wppa_user_is( 'administrator' ) ) {
|
430 |
+
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo=' . $photo['id'] . '&nonce=' . wp_create_nonce( 'wppa-nonce' );
|
431 |
}
|
432 |
else {
|
433 |
$href = wppa_get_photo_url( $photo['id'] );
|
wppa-defaults.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains default settings
|
6 |
-
* Version 8.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -17,6 +17,8 @@ global $wppa_defaults;
|
|
17 |
// Test for too early
|
18 |
if ( ! defined('WPPA_UPLOAD') ) {
|
19 |
wppa_log( 'err', 'WPPA_UPLOAD not defined in wppa_set_defaults().', true );
|
|
|
|
|
20 |
}
|
21 |
|
22 |
$npd = '
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains default settings
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
17 |
// Test for too early
|
18 |
if ( ! defined('WPPA_UPLOAD') ) {
|
19 |
wppa_log( 'err', 'WPPA_UPLOAD not defined in wppa_set_defaults().', true );
|
20 |
+
// wppa_init_path_and_url_constants();
|
21 |
+
// return;
|
22 |
}
|
23 |
|
24 |
$npd = '
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
-
* Version 8.0.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -3929,7 +3929,6 @@ global $blog_id;
|
|
3929 |
|
3930 |
// If size explitely given and not a fraction, it is static size
|
3931 |
if ( wppa_is_int( wppa( 'fullsize' ) ) && wppa( 'fullsize' ) > '1' ) {
|
3932 |
-
wppa_log('Obs', 'HIER '.wppa( 'mocc' ));
|
3933 |
$auto = false;
|
3934 |
}
|
3935 |
|
@@ -5195,7 +5194,7 @@ global $wppa_upload_succes_id;
|
|
5195 |
}
|
5196 |
|
5197 |
// Valid request?
|
5198 |
-
if ( ! wp_verify_nonce( wppa_get( 'albumeditnonce' ), '
|
5199 |
die( 'Security check failure' );
|
5200 |
}
|
5201 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
3929 |
|
3930 |
// If size explitely given and not a fraction, it is static size
|
3931 |
if ( wppa_is_int( wppa( 'fullsize' ) ) && wppa( 'fullsize' ) > '1' ) {
|
|
|
3932 |
$auto = false;
|
3933 |
}
|
3934 |
|
5194 |
}
|
5195 |
|
5196 |
// Valid request?
|
5197 |
+
if ( ! wp_verify_nonce( wppa_get( 'albumeditnonce' ), 'wppa-nonce_'.$alb ) ) {
|
5198 |
die( 'Security check failure' );
|
5199 |
}
|
5200 |
|
wppa-import.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the import pages and functions
|
6 |
-
* Version 8.0.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -431,7 +431,7 @@ global $wppa_session;
|
|
431 |
}
|
432 |
else {
|
433 |
alert("Connecting to album #" + albId);
|
434 |
-
document.location = "' . wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&
|
435 |
}
|
436 |
}
|
437 |
</script>';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the import pages and functions
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
431 |
}
|
432 |
else {
|
433 |
alert("Connecting to album #" + albId);
|
434 |
+
document.location = "' . wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id="+albId+"&wppa-nonce=' . wp_create_nonce( 'wppa-nonce', 'wppa-nonce' ), 'js' ) . '";
|
435 |
}
|
436 |
}
|
437 |
</script>';
|
wppa-input.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions for sanitizing and formatting user input
|
6 |
-
* Version 8.0.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -194,6 +194,9 @@ global $wpdb;
|
|
194 |
'del-id',
|
195 |
'del-photos',
|
196 |
'move-album',
|
|
|
|
|
|
|
197 |
|
198 |
);
|
199 |
|
@@ -364,6 +367,8 @@ global $wpdb;
|
|
364 |
case 'upn-name':
|
365 |
case 'del-confirm':
|
366 |
case 'del-photos':
|
|
|
|
|
367 |
|
368 |
$value = sanitize_text_field( $value );
|
369 |
break;
|
@@ -441,20 +446,45 @@ global $wpdb;
|
|
441 |
// Text?
|
442 |
else {
|
443 |
|
444 |
-
//
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
449 |
$is_cryptic = true;
|
450 |
}
|
451 |
|
452 |
-
// Name?
|
453 |
else {
|
454 |
-
|
|
|
|
|
455 |
if ( is_numeric( $val ) ) {
|
456 |
|
457 |
$values[$key] = $val;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
}
|
459 |
}
|
460 |
}
|
@@ -498,6 +528,7 @@ global $wpdb;
|
|
498 |
case 'import-set-source-url':
|
499 |
case 'import-submit':
|
500 |
case 'zip':
|
|
|
501 |
|
502 |
if ( $name != 'value' || ! is_numeric( $value ) ) {
|
503 |
// wppa_dump( 'Unprocessed querystring item found: ' . $key . ', value = ' . var_export( $value, true ) );
|
@@ -532,7 +563,7 @@ global $wpdb;
|
|
532 |
}
|
533 |
}
|
534 |
|
535 |
-
// Retrieve a get- or post-
|
536 |
function wppa_get( $xname, $default = false ) {
|
537 |
global $wppa_query_vars;
|
538 |
global $wppa_sanitized_query_vars;
|
@@ -542,11 +573,6 @@ global $wppa_sanitized_query_vars;
|
|
542 |
return $default;
|
543 |
}
|
544 |
|
545 |
-
// Init
|
546 |
-
if ( ! is_array( $wppa_query_vars ) ) {
|
547 |
-
wppa_parse_query_string();
|
548 |
-
}
|
549 |
-
|
550 |
// Normalize $name
|
551 |
if ( substr( $xname, 0, 5 ) == 'wppa-' ) {
|
552 |
$name = substr( $xname, 5 );
|
@@ -555,6 +581,11 @@ global $wppa_sanitized_query_vars;
|
|
555 |
$name = $xname;
|
556 |
}
|
557 |
|
|
|
|
|
|
|
|
|
|
|
558 |
// See if set
|
559 |
if ( isset( $wppa_query_vars[$name] ) ) {
|
560 |
return $wppa_query_vars[$name];
|
@@ -565,14 +596,16 @@ global $wppa_sanitized_query_vars;
|
|
565 |
|
566 |
// Start debug
|
567 |
if ( ! in_array( $name, $wppa_sanitized_query_vars ) ) {
|
568 |
-
|
569 |
-
|
570 |
-
$t
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
|
|
|
|
576 |
}
|
577 |
}
|
578 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions for sanitizing and formatting user input
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
194 |
'del-id',
|
195 |
'del-photos',
|
196 |
'move-album',
|
197 |
+
'edit-id',
|
198 |
+
'cron',
|
199 |
+
'tab',
|
200 |
|
201 |
);
|
202 |
|
367 |
case 'upn-name':
|
368 |
case 'del-confirm':
|
369 |
case 'del-photos':
|
370 |
+
case 'tab':
|
371 |
+
case 'edit-id':
|
372 |
|
373 |
$value = sanitize_text_field( $value );
|
374 |
break;
|
446 |
// Text?
|
447 |
else {
|
448 |
|
449 |
+
// Special album?
|
450 |
+
if ( $values[$key] == wppa_get_option( 'wppa_album_crypt_9', false ) ) {
|
451 |
+
$values[$key] = '999999';
|
452 |
+
$is_cryptic = true;
|
453 |
+
}
|
454 |
+
elseif ( $values[$key] == wppa_get_option( 'wppa_album_crypt_0', false ) ) {
|
455 |
+
$values[$key] = '0';
|
456 |
+
$is_cryptic = true;
|
457 |
+
}
|
458 |
+
elseif ( $values[$key] == wppa_get_option( 'wppa_album_crypt_1', false ) ) {
|
459 |
+
$values[$key] = '-1';
|
460 |
+
$is_cryptic = true;
|
461 |
+
}
|
462 |
+
elseif ( $values[$key] == wppa_get_option( 'wppa_album_crypt_2', false ) ) {
|
463 |
+
$values[$key] = '-2';
|
464 |
+
$is_cryptic = true;
|
465 |
+
}
|
466 |
+
elseif ( $values[$key] == wppa_get_option( 'wppa_album_crypt_3', false ) ) {
|
467 |
+
$values[$key] = '-3';
|
468 |
$is_cryptic = true;
|
469 |
}
|
470 |
|
|
|
471 |
else {
|
472 |
+
|
473 |
+
// Cryptic?
|
474 |
+
$val = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_albums WHERE crypt = %s", $values[$key] ) );
|
475 |
if ( is_numeric( $val ) ) {
|
476 |
|
477 |
$values[$key] = $val;
|
478 |
+
$is_cryptic = true;
|
479 |
+
}
|
480 |
+
|
481 |
+
// Name?
|
482 |
+
else {
|
483 |
+
$val = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_albums WHERE sname = %s", $values[$key] ) );
|
484 |
+
if ( is_numeric( $val ) ) {
|
485 |
+
|
486 |
+
$values[$key] = $val;
|
487 |
+
}
|
488 |
}
|
489 |
}
|
490 |
}
|
528 |
case 'import-set-source-url':
|
529 |
case 'import-submit':
|
530 |
case 'zip':
|
531 |
+
case 'cron':
|
532 |
|
533 |
if ( $name != 'value' || ! is_numeric( $value ) ) {
|
534 |
// wppa_dump( 'Unprocessed querystring item found: ' . $key . ', value = ' . var_export( $value, true ) );
|
563 |
}
|
564 |
}
|
565 |
|
566 |
+
// Retrieve a get- or post- variable, sanitized and post-processed
|
567 |
function wppa_get( $xname, $default = false ) {
|
568 |
global $wppa_query_vars;
|
569 |
global $wppa_sanitized_query_vars;
|
573 |
return $default;
|
574 |
}
|
575 |
|
|
|
|
|
|
|
|
|
|
|
576 |
// Normalize $name
|
577 |
if ( substr( $xname, 0, 5 ) == 'wppa-' ) {
|
578 |
$name = substr( $xname, 5 );
|
581 |
$name = $xname;
|
582 |
}
|
583 |
|
584 |
+
// Init required?
|
585 |
+
if ( ! is_array( $wppa_query_vars ) ) {
|
586 |
+
wppa_parse_query_string();
|
587 |
+
}
|
588 |
+
|
589 |
// See if set
|
590 |
if ( isset( $wppa_query_vars[$name] ) ) {
|
591 |
return $wppa_query_vars[$name];
|
596 |
|
597 |
// Start debug
|
598 |
if ( ! in_array( $name, $wppa_sanitized_query_vars ) ) {
|
599 |
+
if ( substr( $name, 0, 5 ) != 'file-' || ! is_numeric( substr( $name, 5 ) ) ) {
|
600 |
+
$t = get_option( 'wppa_unfiltered_qvars', array() );
|
601 |
+
if ( ! in_array( $name, $t ) ) {
|
602 |
+
$t[] = $name;
|
603 |
+
sort( $t );
|
604 |
+
update_option( 'wppa_unfiltered_qvars', $t );
|
605 |
+
$a = array_merge( $_GET, $_POST );
|
606 |
+
if ( count( $a ) ) {
|
607 |
+
wppa_dump( $name . ' in ' . var_export( $a, true ) );
|
608 |
+
}
|
609 |
}
|
610 |
}
|
611 |
}
|
wppa-links.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Frontend links
|
6 |
|
7 |
-
* Version 8.0.07.
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
@@ -231,42 +231,48 @@ function wppa_get_image_url_ajax_by_id($id) {
|
|
231 |
}
|
232 |
|
233 |
// get link to album by id or in loop
|
234 |
-
function wppa_get_album_url( $id, $pag = '', $type = 'content', $occur = '0' ) {
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
$w = wppa_in_widget() ? 'w' : '';
|
243 |
-
}
|
244 |
|
245 |
-
|
246 |
-
|
247 |
-
|
|
|
|
|
248 |
$link .= '&wppa-photos-only=1';
|
249 |
}
|
250 |
-
if ( $type == 'albums' ) {
|
251 |
$link .= '&wppa-albums-only=1';
|
252 |
}
|
253 |
}
|
254 |
else $link = '';
|
255 |
-
return wppa_encrypt_url( $link );
|
256 |
}
|
257 |
|
258 |
// get link to album by id or in loop ajax version
|
259 |
-
function wppa_get_album_url_ajax( $id, $pag = '', $type = 'content' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
|
261 |
-
$occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'mocc' );
|
262 |
$w = wppa_in_widget() ? 'w' : '';
|
263 |
|
264 |
-
if ( $
|
265 |
-
$link = wppa_get_ajaxlink($
|
266 |
-
if ( $type == 'thumbs' ) {
|
267 |
$link .= '&wppa-photos-only=1';
|
268 |
}
|
269 |
-
if ( $type == 'albums' ) {
|
270 |
$link .= '&wppa-albums-only=1';
|
271 |
}
|
272 |
}
|
@@ -275,44 +281,54 @@ function wppa_get_album_url_ajax( $id, $pag = '', $type = 'content' ) {
|
|
275 |
}
|
276 |
|
277 |
// get link to slideshow (in loop)
|
278 |
-
function wppa_get_slideshow_url( $id, $page = '', $pid = '', $occ = '' ) {
|
279 |
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
$
|
290 |
-
|
|
|
|
|
291 |
if ( wppa( 'is_upldr' ) ) $link .= '&wppa-upldr=' . wppa( 'is_upldr' );
|
292 |
// can be extended for other special cases, see wppa_thumb_default() in wppa-functions.php
|
293 |
}
|
294 |
-
elseif (wppa( 'calendar') ) {
|
295 |
-
$link = wppa_get_permalink( $page );
|
296 |
}
|
297 |
else {
|
298 |
$link = '';
|
299 |
}
|
300 |
|
301 |
-
return wppa_encrypt_url( $link );
|
302 |
}
|
303 |
|
304 |
// get link to slideshow (in loop) ajax version
|
305 |
-
function wppa_get_slideshow_url_ajax(
|
306 |
|
307 |
-
|
308 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
$w = wppa_in_widget() ? 'w' : '';
|
310 |
-
|
|
|
|
|
311 |
if ( wppa( 'is_upldr' ) ) $link .= '&wppa-upldr='.wppa( 'is_upldr' );
|
312 |
// can be extended for other special cases, see wppa_thumb_default() in wppa-functions.php
|
313 |
}
|
314 |
-
elseif ( wppa( 'calendar') ) {
|
315 |
-
$link = wppa_get_ajaxlink( $page ) .
|
316 |
'&wppa-calendar=' . wppa( 'calendar' ) .
|
317 |
'&wppa-caldate=' . wppa( 'caldate' ) .
|
318 |
'&wppa-slide=1' .
|
@@ -320,7 +336,7 @@ function wppa_get_slideshow_url_ajax($id, $page = '') {
|
|
320 |
'&wppa-occur=' . wppa( 'mocc' );
|
321 |
}
|
322 |
elseif ( wppa( 'is_potdhis' ) ) {
|
323 |
-
$link = wppa_get_ajaxlink( $page ) .
|
324 |
'&wppa-potdhis=1' .
|
325 |
'&wppa-occur=' . wppa( 'mocc' );
|
326 |
}
|
@@ -1708,7 +1724,9 @@ global $wpdb;
|
|
1708 |
if ( $page == '0' ) $page = '-1';
|
1709 |
if ( wppa_switch( 'coverimg_blank' ) ) $result['target'] = '_blank';
|
1710 |
if ( $type == 'slideshowstartatimage' ) {
|
1711 |
-
$result['url'] = wppa_get_slideshow_url(
|
|
|
|
|
1712 |
$result['is_url'] = true;
|
1713 |
$result['is_lightbox'] = false;
|
1714 |
return $result;
|
@@ -1742,7 +1760,9 @@ global $wpdb;
|
|
1742 |
if ( $page != '0' ) {
|
1743 |
wppa( 'occur', '1' );
|
1744 |
}
|
1745 |
-
$result['url'] =
|
|
|
|
|
1746 |
wppa( 'occur', $t );
|
1747 |
$result['title'] = __('View fullsize slideshow', 'wp-photo-album-plus');
|
1748 |
$result['is_url'] = true;
|
4 |
*
|
5 |
* Frontend links
|
6 |
|
7 |
+
* Version 8.0.07.004
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
231 |
}
|
232 |
|
233 |
// get link to album by id or in loop
|
234 |
+
function wppa_get_album_url( $args ) { //$id, $pag = '', $type = 'content', $occur = '0' ) {
|
235 |
|
236 |
+
$defaults = array( 'album' => '',
|
237 |
+
'page' => '',
|
238 |
+
'type' => 'content',
|
239 |
+
'occur' => wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' ),
|
240 |
+
);
|
241 |
+
$args = wppa_parse_args( $args, $defaults );
|
|
|
|
|
242 |
|
243 |
+
$w = wppa_in_widget() ? 'w' : '';
|
244 |
+
|
245 |
+
if ( $args['album'] ) {
|
246 |
+
$link = wppa_get_permalink( $args['page'] ) . 'wppa-album=' . $args['album'] . '&wppa-cover=0&wppa-' . $w . 'occur=' . $args['occur'];
|
247 |
+
if ( $args['type'] == 'thumbs' ) {
|
248 |
$link .= '&wppa-photos-only=1';
|
249 |
}
|
250 |
+
if ( $args['type'] == 'albums' ) {
|
251 |
$link .= '&wppa-albums-only=1';
|
252 |
}
|
253 |
}
|
254 |
else $link = '';
|
255 |
+
return wppa_convert_to_pretty( wppa_encrypt_url( $link ) );
|
256 |
}
|
257 |
|
258 |
// get link to album by id or in loop ajax version
|
259 |
+
function wppa_get_album_url_ajax( $args ) { //$id, $pag = '', $type = 'content' ) {
|
260 |
+
|
261 |
+
$defaults = array( 'album' => '',
|
262 |
+
'page' => '',
|
263 |
+
'type' => 'content',
|
264 |
+
'occur' => wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' ),
|
265 |
+
);
|
266 |
+
$args = wppa_parse_args( $args, $defaults );
|
267 |
|
|
|
268 |
$w = wppa_in_widget() ? 'w' : '';
|
269 |
|
270 |
+
if ( $args['album'] ) {
|
271 |
+
$link = wppa_get_ajaxlink( $args['page'] ) . 'wppa-album=' . $args['album'] . '&wppa-cover=0&wppa-' . $w . 'occur=' . $args['occur'];
|
272 |
+
if ( $args['type'] == 'thumbs' ) {
|
273 |
$link .= '&wppa-photos-only=1';
|
274 |
}
|
275 |
+
if ( $args['type'] == 'albums' ) {
|
276 |
$link .= '&wppa-albums-only=1';
|
277 |
}
|
278 |
}
|
281 |
}
|
282 |
|
283 |
// get link to slideshow (in loop)
|
284 |
+
function wppa_get_slideshow_url( $args ) { //$id, $page = '', $pid = '', $occ = '' ) {
|
285 |
|
286 |
+
$defaults = array(
|
287 |
+
'album' => '',
|
288 |
+
'page' => '',
|
289 |
+
'photo' => '',
|
290 |
+
'occur' => wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' ),
|
291 |
+
);
|
292 |
+
$args = wppa_parse_args( $args, $defaults );
|
293 |
+
|
294 |
+
if ( $args['album'] ) {
|
295 |
+
$w = wppa_in_widget() ? 'w' : '';
|
296 |
+
|
297 |
+
$link = wppa_get_permalink( $args['page'] ) . 'wppa-album=' . $args['album'] . '&wppa-slide=1&wppa-' . $w . 'occur=' . $args['occur'];
|
298 |
+
if ( $args['photo'] ) $link .= '&wppa-photo=' . $args['photo'];
|
299 |
if ( wppa( 'is_upldr' ) ) $link .= '&wppa-upldr=' . wppa( 'is_upldr' );
|
300 |
// can be extended for other special cases, see wppa_thumb_default() in wppa-functions.php
|
301 |
}
|
302 |
+
elseif ( wppa( 'calendar' ) ) {
|
303 |
+
$link = wppa_get_permalink( $args['page'] );
|
304 |
}
|
305 |
else {
|
306 |
$link = '';
|
307 |
}
|
308 |
|
309 |
+
return wppa_convert_to_pretty( wppa_encrypt_url( $link ) );
|
310 |
}
|
311 |
|
312 |
// get link to slideshow (in loop) ajax version
|
313 |
+
function wppa_get_slideshow_url_ajax( $args ) {
|
314 |
|
315 |
+
$defaults = array( 'album' => '',
|
316 |
+
'page' => '',
|
317 |
+
'photo' => '',
|
318 |
+
'occur' => wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' ),
|
319 |
+
);
|
320 |
+
$args = wppa_parse_args( $args, $defaults );
|
321 |
+
|
322 |
+
if ( $args[ 'album' ] ) {
|
323 |
$w = wppa_in_widget() ? 'w' : '';
|
324 |
+
|
325 |
+
$link = wppa_get_ajaxlink( $args['page'] ) . 'wppa-album=' . $args['album'] . '&wppa-slide=1&wppa-' . $w . 'occur=' . $args['occur'];
|
326 |
+
if ( $args['photo'] ) $link .= '&wppa-photo=' . $args['photo'];
|
327 |
if ( wppa( 'is_upldr' ) ) $link .= '&wppa-upldr='.wppa( 'is_upldr' );
|
328 |
// can be extended for other special cases, see wppa_thumb_default() in wppa-functions.php
|
329 |
}
|
330 |
+
elseif ( wppa( 'calendar' ) ) {
|
331 |
+
$link = wppa_get_ajaxlink( $args['page'] ) .
|
332 |
'&wppa-calendar=' . wppa( 'calendar' ) .
|
333 |
'&wppa-caldate=' . wppa( 'caldate' ) .
|
334 |
'&wppa-slide=1' .
|
336 |
'&wppa-occur=' . wppa( 'mocc' );
|
337 |
}
|
338 |
elseif ( wppa( 'is_potdhis' ) ) {
|
339 |
+
$link = wppa_get_ajaxlink( $args['page'] ) .
|
340 |
'&wppa-potdhis=1' .
|
341 |
'&wppa-occur=' . wppa( 'mocc' );
|
342 |
}
|
1724 |
if ( $page == '0' ) $page = '-1';
|
1725 |
if ( wppa_switch( 'coverimg_blank' ) ) $result['target'] = '_blank';
|
1726 |
if ( $type == 'slideshowstartatimage' ) {
|
1727 |
+
$result['url'] = wppa_get_slideshow_url( array( 'album' => $album,
|
1728 |
+
'page' => $page,
|
1729 |
+
'photo' => $id ) );
|
1730 |
$result['is_url'] = true;
|
1731 |
$result['is_lightbox'] = false;
|
1732 |
return $result;
|
1760 |
if ( $page != '0' ) {
|
1761 |
wppa( 'occur', '1' );
|
1762 |
}
|
1763 |
+
$result['url'] = wppa_get_slideshow_url( array( 'album' => wppa( 'start_album' ),
|
1764 |
+
'page' => $page,
|
1765 |
+
'photo' => $id ) );
|
1766 |
wppa( 'occur', $t );
|
1767 |
$result['title'] = __('View fullsize slideshow', 'wp-photo-album-plus');
|
1768 |
$result['is_url'] = true;
|
wppa-photo-admin-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
-
* Version 8.0.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -94,8 +94,8 @@ global $wpdb;
|
|
94 |
$link = wppa_dbg_url( get_admin_url() . 'admin.php' .
|
95 |
'?page=wppa_admin_menu' .
|
96 |
'&tab=edit' .
|
97 |
-
'&
|
98 |
-
'&
|
99 |
'&wppa-searchstring=' . wppa_get( 'searchstring' )
|
100 |
);
|
101 |
}
|
@@ -109,8 +109,8 @@ global $wpdb;
|
|
109 |
$link = wppa_dbg_url( get_admin_url() . 'admin.php' .
|
110 |
'?page=wppa_admin_menu' .
|
111 |
'&tab=edit' .
|
112 |
-
'&
|
113 |
-
'&
|
114 |
);
|
115 |
}
|
116 |
|
@@ -136,8 +136,8 @@ global $wpdb;
|
|
136 |
$link = wppa_dbg_url( get_admin_url() . 'admin.php' .
|
137 |
'?page=wppa_admin_menu' .
|
138 |
'&tab=edit' .
|
139 |
-
'&
|
140 |
-
'&
|
141 |
);
|
142 |
}
|
143 |
}
|
@@ -157,7 +157,7 @@ global $wpdb;
|
|
157 |
ORDER BY timestamp DESC
|
158 |
LIMIT %d, %d", $owner, $skip, $pagesize ), ARRAY_A );
|
159 |
$count = is_array( $photos ) ? count( $photos ) : 0;
|
160 |
-
$link = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_edit_photo&
|
161 |
}
|
162 |
|
163 |
// Moderate photos
|
@@ -194,7 +194,7 @@ global $wpdb;
|
|
194 |
}
|
195 |
$count = count( $photos );
|
196 |
}
|
197 |
-
$link = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_moderate_photos&
|
198 |
}
|
199 |
|
200 |
// Are there photos to moderate?
|
@@ -237,7 +237,7 @@ global $wpdb;
|
|
237 |
LIMIT %d, %d", $skip, $pagesize ), ARRAY_A );
|
238 |
|
239 |
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos" );
|
240 |
-
$link = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_moderate_photos&
|
241 |
}
|
242 |
|
243 |
// Nothing to do
|
@@ -591,7 +591,7 @@ function wppaToggleExif( id, count ) {
|
|
591 |
'botlft' => __( 'bottom - left' , 'wp-photo-album-plus'), 'botcen' => __( 'bottom - center' , 'wp-photo-album-plus'), 'botrht' => __( 'bottom - right' , 'wp-photo-album-plus'), );
|
592 |
|
593 |
// Album for moderate
|
594 |
-
if ( $modalbum != $album && $album && ! wppa_get( 'just-edit' ) && wppa_get( 'edit-id' )
|
595 |
echo '<h3>' . sprintf( __( 'Edit/Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
|
596 |
'<i>' . sanitize_text_field( wppa_get_album_name( $album ) ) . '</i>',
|
597 |
'<i>' . sanitize_user( wppa_get_album_item( $album, 'owner' ) ) . '</i>' ) . '</h3>';
|
@@ -614,7 +614,7 @@ function wppaToggleExif( id, count ) {
|
|
614 |
<input
|
615 |
type="hidden"
|
616 |
id="photo-nonce-' . $id . '"
|
617 |
-
value="' . wp_create_nonce( '
|
618 |
/>';
|
619 |
|
620 |
// Section 1
|
@@ -2672,7 +2672,7 @@ function wppa_album_photos_bulk( $album ) {
|
|
2672 |
$count = wppa_get_edit_search_photos( '', '', 'count_only' );
|
2673 |
$photos = wppa_get_edit_search_photos( $skip, $pagesize );
|
2674 |
|
2675 |
-
$link = wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
2676 |
wppa_show_search_statistics();
|
2677 |
}
|
2678 |
else {
|
@@ -2684,7 +2684,7 @@ function wppa_album_photos_bulk( $album ) {
|
|
2684 |
" . wppa_get_photo_order( $album ) . "
|
2685 |
LIMIT %d, %d", $album, $skip, $pagesize ), ARRAY_A );
|
2686 |
|
2687 |
-
$link = wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
2688 |
}
|
2689 |
|
2690 |
if ( $photos ) {
|
@@ -2981,7 +2981,7 @@ function wppaSetConfirmMove( id ) {
|
|
2981 |
<tr id="photoitem-<?php echo $photo['id'] ?>" >
|
2982 |
<!-- Checkbox -->
|
2983 |
<td>
|
2984 |
-
<input type="hidden" id="photo-nonce-<?php echo $photo['id'] ?>" value="<?php echo wp_create_nonce( '
|
2985 |
<input type="checkbox" name="wppa-bulk-photo[<?php echo $photo['id'] ?>]" class="wppa-bulk-photo" />
|
2986 |
</td>
|
2987 |
<!-- ID and delete link -->
|
@@ -3194,7 +3194,7 @@ global $wpdb;
|
|
3194 |
$photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
|
3195 |
WHERE album = %s" . $photoorder, $album ), ARRAY_A );
|
3196 |
|
3197 |
-
$link = wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
3198 |
$size = '180';
|
3199 |
|
3200 |
if ( $photos ) {
|
@@ -3378,7 +3378,7 @@ global $wpdb;
|
|
3378 |
<?php if ( wppa_has_audio( $photo['id'] ) ) _e('Audio', 'wp-photo-album-plus'); ?>
|
3379 |
<span style="float:right; margin-right:15px;"><?php echo __( 'Ord: ' , 'wp-photo-album-plus').'<span id="wppa-seqno-'.$photo['id'].'" >'.$photo['p_order'] ?></span>
|
3380 |
</div>
|
3381 |
-
<input type="hidden" id="photo-nonce-<?php echo $photo['id'] ?>" value="<?php echo wp_create_nonce( '
|
3382 |
<input type="hidden" class="wppa-sort-item" value="<?php echo $photo['id'] ?>" />
|
3383 |
<input type="hidden" class="wppa-sort-seqn" id="wppa-sort-seqn-<?php echo $photo['id'] ?>" value="<?php echo $photo['p_order'] ?>" />
|
3384 |
</div>
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
94 |
$link = wppa_dbg_url( get_admin_url() . 'admin.php' .
|
95 |
'?page=wppa_admin_menu' .
|
96 |
'&tab=edit' .
|
97 |
+
'&edit-id=' . $album .
|
98 |
+
'&wppa-nonce=' . wp_create_nonce('wppa-nonce') .
|
99 |
'&wppa-searchstring=' . wppa_get( 'searchstring' )
|
100 |
);
|
101 |
}
|
109 |
$link = wppa_dbg_url( get_admin_url() . 'admin.php' .
|
110 |
'?page=wppa_admin_menu' .
|
111 |
'&tab=edit' .
|
112 |
+
'&edit-id=trash' .
|
113 |
+
'&wppa-nonce=' . wp_create_nonce('wppa-nonce')
|
114 |
);
|
115 |
}
|
116 |
|
136 |
$link = wppa_dbg_url( get_admin_url() . 'admin.php' .
|
137 |
'?page=wppa_admin_menu' .
|
138 |
'&tab=edit' .
|
139 |
+
'&edit-id=' . $album .
|
140 |
+
'&wppa-nonce=' . wp_create_nonce('wppa-nonce')
|
141 |
);
|
142 |
}
|
143 |
}
|
157 |
ORDER BY timestamp DESC
|
158 |
LIMIT %d, %d", $owner, $skip, $pagesize ), ARRAY_A );
|
159 |
$count = is_array( $photos ) ? count( $photos ) : 0;
|
160 |
+
$link = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_edit_photo&wppa-nonce=' . wp_create_nonce('wppa-nonce') );
|
161 |
}
|
162 |
|
163 |
// Moderate photos
|
194 |
}
|
195 |
$count = count( $photos );
|
196 |
}
|
197 |
+
$link = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_moderate_photos&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
|
198 |
}
|
199 |
|
200 |
// Are there photos to moderate?
|
237 |
LIMIT %d, %d", $skip, $pagesize ), ARRAY_A );
|
238 |
|
239 |
$count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos" );
|
240 |
+
$link = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_moderate_photos&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
|
241 |
}
|
242 |
|
243 |
// Nothing to do
|
591 |
'botlft' => __( 'bottom - left' , 'wp-photo-album-plus'), 'botcen' => __( 'bottom - center' , 'wp-photo-album-plus'), 'botrht' => __( 'bottom - right' , 'wp-photo-album-plus'), );
|
592 |
|
593 |
// Album for moderate
|
594 |
+
if ( $modalbum != $album && $album && ! wppa_get( 'just-edit' ) && wppa_get( 'edit-id' ) != 'trash' ) {
|
595 |
echo '<h3>' . sprintf( __( 'Edit/Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
|
596 |
'<i>' . sanitize_text_field( wppa_get_album_name( $album ) ) . '</i>',
|
597 |
'<i>' . sanitize_user( wppa_get_album_item( $album, 'owner' ) ) . '</i>' ) . '</h3>';
|
614 |
<input
|
615 |
type="hidden"
|
616 |
id="photo-nonce-' . $id . '"
|
617 |
+
value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '"
|
618 |
/>';
|
619 |
|
620 |
// Section 1
|
2672 |
$count = wppa_get_edit_search_photos( '', '', 'count_only' );
|
2673 |
$photos = wppa_get_edit_search_photos( $skip, $pagesize );
|
2674 |
|
2675 |
+
$link = wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id='.$album.'&wppa-searchstring='.wppa_sanitize_searchstring($_REQUEST['wppa-searchstring']).'&bulk'.'&wppa-nonce=' . wp_create_nonce('wppa-nonce') );
|
2676 |
wppa_show_search_statistics();
|
2677 |
}
|
2678 |
else {
|
2684 |
" . wppa_get_photo_order( $album ) . "
|
2685 |
LIMIT %d, %d", $album, $skip, $pagesize ), ARRAY_A );
|
2686 |
|
2687 |
+
$link = wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id='.$album.'&bulk'.'&wppa-nonce=' . wp_create_nonce('wppa-nonce') );
|
2688 |
}
|
2689 |
|
2690 |
if ( $photos ) {
|
2981 |
<tr id="photoitem-<?php echo $photo['id'] ?>" >
|
2982 |
<!-- Checkbox -->
|
2983 |
<td>
|
2984 |
+
<input type="hidden" id="photo-nonce-<?php echo $photo['id'] ?>" value="<?php echo wp_create_nonce( 'wppa-nonce_'.$photo['id'] ); ?>" />
|
2985 |
<input type="checkbox" name="wppa-bulk-photo[<?php echo $photo['id'] ?>]" class="wppa-bulk-photo" />
|
2986 |
</td>
|
2987 |
<!-- ID and delete link -->
|
3194 |
$photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
|
3195 |
WHERE album = %s" . $photoorder, $album ), ARRAY_A );
|
3196 |
|
3197 |
+
$link = wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id='.$album.'&bulk'.'&wppa-nonce=' . wp_create_nonce('wppa-nonce') );
|
3198 |
$size = '180';
|
3199 |
|
3200 |
if ( $photos ) {
|
3378 |
<?php if ( wppa_has_audio( $photo['id'] ) ) _e('Audio', 'wp-photo-album-plus'); ?>
|
3379 |
<span style="float:right; margin-right:15px;"><?php echo __( 'Ord: ' , 'wp-photo-album-plus').'<span id="wppa-seqno-'.$photo['id'].'" >'.$photo['p_order'] ?></span>
|
3380 |
</div>
|
3381 |
+
<input type="hidden" id="photo-nonce-<?php echo $photo['id'] ?>" value="<?php echo wp_create_nonce( 'wppa-nonce_'.$photo['id'] ); ?>" />
|
3382 |
<input type="hidden" class="wppa-sort-item" value="<?php echo $photo['id'] ?>" />
|
3383 |
<input type="hidden" class="wppa-sort-seqn" id="wppa-sort-seqn-<?php echo $photo['id'] ?>" value="<?php echo $photo['p_order'] ?>" />
|
3384 |
</div>
|
wppa-potd-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the photo of the day widget
|
6 |
-
* Version 8.0.
|
7 |
*/
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
@@ -142,10 +142,16 @@ class PhotoOfTheDay extends WP_Widget {
|
|
142 |
$c = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE album = " . $alb ) - 1;
|
143 |
if ( $c > 0 ) {
|
144 |
if ( wppa_opt( 'potd_counter_link' ) == 'thumbs' ) {
|
145 |
-
$lnk = wppa_get_album_url(
|
|
|
|
|
|
|
146 |
}
|
147 |
elseif ( wppa_opt( 'potd_counter_link' ) == 'slide' ) {
|
148 |
-
$lnk = wppa_get_slideshow_url(
|
|
|
|
|
|
|
149 |
}
|
150 |
elseif ( wppa_opt( 'potd_counter_link' ) == 'single' ) {
|
151 |
$lnk = wppa_encrypt_url( get_permalink( $page ) . '?occur=1&photo=' . $id );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the photo of the day widget
|
6 |
+
* Version 8.0.07.004
|
7 |
*/
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
142 |
$c = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE album = " . $alb ) - 1;
|
143 |
if ( $c > 0 ) {
|
144 |
if ( wppa_opt( 'potd_counter_link' ) == 'thumbs' ) {
|
145 |
+
$lnk = wppa_get_album_url( array( 'album' => $alb,
|
146 |
+
'page' => $page,
|
147 |
+
'type' => 'thumbs',
|
148 |
+
'occur' => '1' ) );
|
149 |
}
|
150 |
elseif ( wppa_opt( 'potd_counter_link' ) == 'slide' ) {
|
151 |
+
$lnk = wppa_get_slideshow_url( array( 'album' => $alb,
|
152 |
+
'page' => $page,
|
153 |
+
'photo' => $id,
|
154 |
+
'occur' => '1' ) );
|
155 |
}
|
156 |
elseif ( wppa_opt( 'potd_counter_link' ) == 'single' ) {
|
157 |
$lnk = wppa_encrypt_url( get_permalink( $page ) . '?occur=1&photo=' . $id );
|
wppa-thumbnails.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Various funcions to display a thumbnail image
|
6 |
* Contains all possible frontend thumbnail types
|
7 |
*
|
8 |
-
* Version 8.0.07.
|
9 |
*
|
10 |
*/
|
11 |
|
@@ -214,16 +214,23 @@ global $wpdb;
|
|
214 |
{ // Ajax possible
|
215 |
|
216 |
// The a img ajax
|
217 |
-
$p = wppa( 'calendar') ? '' :
|
218 |
-
$onclick = 'wppaDoAjaxRender( ' .
|
219 |
-
$mocc . ', \'' .
|
220 |
-
wppa_encrypt_url( wppa_get_slideshow_url_ajax( wppa( 'start_album' ), '0' ) ) .
|
221 |
-
'&wppa-photo=' . $xid .
|
222 |
-
'\', \'' .
|
223 |
-
wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_slideshow_url( wppa( 'start_album' ), '0' ) . $p ) ) .
|
224 |
-
'\' )';
|
225 |
|
226 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
|
228 |
// Video?
|
229 |
if ( $is_video ) {
|
@@ -235,31 +242,32 @@ global $wpdb;
|
|
235 |
'controls' => wppa_switch( 'thumb_video' ),
|
236 |
'margin_top' => '0',
|
237 |
'margin_bottom' => '0',
|
238 |
-
'tagid' => 'i-'.$
|
239 |
'cursor' => 'cursor:pointer;',
|
240 |
'events' => $events,
|
241 |
'title' => $title,
|
242 |
'preload' => 'metadata',
|
243 |
-
|
244 |
'lb' => false,
|
245 |
'class' => '',
|
246 |
'style' => $imgstyle
|
247 |
));
|
248 |
}
|
249 |
|
250 |
-
// No video
|
251 |
else {
|
252 |
-
$result .= '
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
|
|
263 |
}
|
264 |
|
265 |
// Close the a img ajax
|
@@ -619,7 +627,7 @@ global $wpdb;
|
|
619 |
' class="wppa-thumb-text"' .
|
620 |
' >' .
|
621 |
'<a' .
|
622 |
-
' href="' . wppa_get_album_url( $thumb['album'] ) . '"' .
|
623 |
' >' .
|
624 |
'<span class="wppa-tnpar" >(</span>' .
|
625 |
stripslashes( __( wppa_get_album_name( $thumb['album'] ) , 'wp-photo-album-plus') ) .
|
@@ -1266,15 +1274,24 @@ global $wpdb;
|
|
1266 |
{ // Ajax possible
|
1267 |
|
1268 |
// The a img ajax
|
1269 |
-
$p = wppa( 'calendar') ? '' :
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1278 |
if ( $is_video ) {
|
1279 |
$result .= wppa_get_video_html( array(
|
1280 |
'id' => $id,
|
@@ -1288,7 +1305,7 @@ global $wpdb;
|
|
1288 |
'events' => $events,
|
1289 |
'title' => $title,
|
1290 |
'preload' => 'metadata',
|
1291 |
-
|
1292 |
'lb' => false,
|
1293 |
'class' => '',
|
1294 |
'style' => $imgstyle,
|
@@ -1297,7 +1314,7 @@ global $wpdb;
|
|
1297 |
}
|
1298 |
else {
|
1299 |
$result .= '<img' .
|
1300 |
-
|
1301 |
' id="i-' . $xid . '-' . $mocc . '"' .
|
1302 |
' ' . ( wppa_lazy() ? 'data-' : '' ) . 'src="' . $imgurl . '"' .
|
1303 |
' ' . $imgalt .
|
5 |
* Various funcions to display a thumbnail image
|
6 |
* Contains all possible frontend thumbnail types
|
7 |
*
|
8 |
+
* Version 8.0.07.004
|
9 |
*
|
10 |
*/
|
11 |
|
214 |
{ // Ajax possible
|
215 |
|
216 |
// The a img ajax
|
217 |
+
$p = wppa( 'calendar' ) ? '' : $xid;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
|
219 |
+
$ajax_url = wppa_get_slideshow_url_ajax( array( 'album' => wppa( 'start_album' ),
|
220 |
+
'photo' => $p ) );
|
221 |
+
$href_url = wppa_get_slideshow_url( array( 'album' => wppa( 'start_album' ),
|
222 |
+
'photo' => $p ) );
|
223 |
+
|
224 |
+
$onclick = 'wppaDoAjaxRender( ' . $mocc . ', \'' . $ajax_url . '\', \'' . $href_url . '\' );return false;';
|
225 |
+
|
226 |
+
$result .= '
|
227 |
+
<a
|
228 |
+
style="position:static;"
|
229 |
+
class="thumb-img"
|
230 |
+
id="x-'.$xid.'-'.$mocc.'"
|
231 |
+
href="' . $href_url . '"
|
232 |
+
onclick="'.$onclick.'"
|
233 |
+
>';
|
234 |
|
235 |
// Video?
|
236 |
if ( $is_video ) {
|
242 |
'controls' => wppa_switch( 'thumb_video' ),
|
243 |
'margin_top' => '0',
|
244 |
'margin_bottom' => '0',
|
245 |
+
'tagid' => 'i-'.$xid.'-'.$mocc,
|
246 |
'cursor' => 'cursor:pointer;',
|
247 |
'events' => $events,
|
248 |
'title' => $title,
|
249 |
'preload' => 'metadata',
|
250 |
+
// 'onclick' => $onclick,
|
251 |
'lb' => false,
|
252 |
'class' => '',
|
253 |
'style' => $imgstyle
|
254 |
));
|
255 |
}
|
256 |
|
257 |
+
// No video /* onclick="' . $onclick . '" */
|
258 |
else {
|
259 |
+
$result .= '
|
260 |
+
<img
|
261 |
+
|
262 |
+
id="i-' . $xid . '-'.$mocc . '" ' .
|
263 |
+
( wppa_lazy() ? 'data-' : '' ) . 'src="' . $imgurl . '"' .
|
264 |
+
$imgalt .
|
265 |
+
( $title ? ' title="' . $title . '"' : '' ) . '
|
266 |
+
width="' . $imgwidth . '"
|
267 |
+
height="' . $imgheight . '"
|
268 |
+
style="' . $imgstyle . ' cursor:pointer;"' .
|
269 |
+
$events . '
|
270 |
+
/>';
|
271 |
}
|
272 |
|
273 |
// Close the a img ajax
|
627 |
' class="wppa-thumb-text"' .
|
628 |
' >' .
|
629 |
'<a' .
|
630 |
+
' href="' . wppa_get_album_url( array( 'album' => $thumb['album'] ) ) . '"' .
|
631 |
' >' .
|
632 |
'<span class="wppa-tnpar" >(</span>' .
|
633 |
stripslashes( __( wppa_get_album_name( $thumb['album'] ) , 'wp-photo-album-plus') ) .
|
1274 |
{ // Ajax possible
|
1275 |
|
1276 |
// The a img ajax
|
1277 |
+
$p = wppa( 'calendar') ? '' : $xid;
|
1278 |
+
|
1279 |
+
$ajax_url = wppa_get_slideshow_url_ajax( array( 'album' => wppa( 'start_album' ),
|
1280 |
+
'photo' => $p ) );
|
1281 |
+
|
1282 |
+
$href_url = wppa_get_slideshow_url( array( 'album' => wppa( 'start_album' ),
|
1283 |
+
'photo' => $p ) );
|
1284 |
+
|
1285 |
+
$onclick = 'wppaDoAjaxRender( ' . $mocc . ', \'' . $ajax_url . '\', \'' . $href_url . '\' ); return false;';
|
1286 |
+
|
1287 |
+
$result .= '
|
1288 |
+
<a
|
1289 |
+
style="position:static;"
|
1290 |
+
class="thumb-img"
|
1291 |
+
id="x-'.$id.'-'.$mocc.'"
|
1292 |
+
href="' . $href_url . '"
|
1293 |
+
onclick="' . $onclick . '" >';
|
1294 |
+
|
1295 |
if ( $is_video ) {
|
1296 |
$result .= wppa_get_video_html( array(
|
1297 |
'id' => $id,
|
1305 |
'events' => $events,
|
1306 |
'title' => $title,
|
1307 |
'preload' => 'metadata',
|
1308 |
+
// 'onclick' => $onclick,
|
1309 |
'lb' => false,
|
1310 |
'class' => '',
|
1311 |
'style' => $imgstyle,
|
1314 |
}
|
1315 |
else {
|
1316 |
$result .= '<img' .
|
1317 |
+
// ' onclick="' . $onclick . '"' .
|
1318 |
' id="i-' . $xid . '-' . $mocc . '"' .
|
1319 |
' ' . ( wppa_lazy() ? 'data-' : '' ) . 'src="' . $imgurl . '"' .
|
1320 |
' ' . $imgalt .
|
wppa-topten-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the top rated photos
|
6 |
-
* Version 8.0.
|
7 |
*/
|
8 |
|
9 |
class TopTenWidget extends WP_Widget {
|
@@ -369,7 +369,10 @@ class TopTenWidget extends WP_Widget {
|
|
369 |
|
370 |
// Display (album) ?
|
371 |
if ( $showalbum ) {
|
372 |
-
$href =
|
|
|
|
|
|
|
373 |
$widget_content .= '<div>(<a href="' . $href . '" >' . wppa_get_album_name( $image['album'] ) . '</a>)</div>';
|
374 |
}
|
375 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the top rated photos
|
6 |
+
* Version 8.0.07.004
|
7 |
*/
|
8 |
|
9 |
class TopTenWidget extends WP_Widget {
|
369 |
|
370 |
// Display (album) ?
|
371 |
if ( $showalbum ) {
|
372 |
+
$href = wppa_get_album_url( array( 'album' => $image['album'],
|
373 |
+
'page' => $albumlinkpage,
|
374 |
+
'type' => 'content',
|
375 |
+
'occur' => '1' ) );
|
376 |
$widget_content .= '<div>(<a href="' . $href . '" >' . wppa_get_album_name( $image['album'] ) . '</a>)</div>';
|
377 |
}
|
378 |
|
wppa-upload.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the upload pages and functions
|
6 |
-
* Version 8.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -81,7 +81,7 @@ global $upload_album;
|
|
81 |
if ( current_user_can( 'wppa_admin' ) ) {
|
82 |
wppa_ok_message( __( 'Connecting to edit album...' , 'wp-photo-album-plus' ) ); ?>
|
83 |
<script type="text/javascript" >
|
84 |
-
document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&
|
85 |
</script>
|
86 |
<?php }
|
87 |
elseif ( wppa_opt( 'upload_edit' ) != '-none-' ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the upload pages and functions
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
81 |
if ( current_user_can( 'wppa_admin' ) ) {
|
82 |
wppa_ok_message( __( 'Connecting to edit album...' , 'wp-photo-album-plus' ) ); ?>
|
83 |
<script type="text/javascript" >
|
84 |
+
document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id=' . $upload_album . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce', 'wppa-nonce' ), 'js' ) ) ?>';
|
85 |
</script>
|
86 |
<?php }
|
87 |
elseif ( wppa_opt( 'upload_edit' ) != '-none-' ) {
|
wppa-utils.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
-
* Version 8.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -453,7 +453,12 @@ global $wppa_opt;
|
|
453 |
|
454 |
// Are we initialized?
|
455 |
if ( ! isset( $wppa_opt[$xkey] ) ) {
|
456 |
-
|
|
|
|
|
|
|
|
|
|
|
457 |
}
|
458 |
|
459 |
// Old style?
|
@@ -482,7 +487,12 @@ global $wppa_opt;
|
|
482 |
|
483 |
// Are we initialized?
|
484 |
if ( ! isset( $wppa_opt[$xkey] ) ) {
|
485 |
-
|
|
|
|
|
|
|
|
|
|
|
486 |
}
|
487 |
|
488 |
// Old style?
|
@@ -1329,10 +1339,10 @@ static $old;
|
|
1329 |
else $old = $new;
|
1330 |
}
|
1331 |
|
1332 |
-
function wppa_sanitize_cats($value) {
|
1333 |
-
return wppa_sanitize_tags($value);
|
1334 |
}
|
1335 |
-
function wppa_sanitize_tags($value, $keepsemi = false, $keephash = false ) {
|
1336 |
|
1337 |
// Sanitize
|
1338 |
$value = sanitize_text_field( $value );
|
@@ -1376,7 +1386,9 @@ function wppa_sanitize_tags($value, $keepsemi = false, $keephash = false ) {
|
|
1376 |
}
|
1377 |
|
1378 |
// Capitalize single words within tags
|
1379 |
-
|
|
|
|
|
1380 |
foreach ( array_keys($temp) as $idx ) {
|
1381 |
if ( strlen( $temp[$idx] ) > '1' ) {
|
1382 |
$words = explode( ' ', $temp[$idx] );
|
@@ -1490,6 +1502,7 @@ function wppa_series_to_array($xtxt) {
|
|
1490 |
}
|
1491 |
function wppa_stx_err($msg) {
|
1492 |
echo 'Syntax error in album specification. '.$msg;
|
|
|
1493 |
}
|
1494 |
|
1495 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
+
* Version 8.0.07.004
|
7 |
*
|
8 |
*/
|
9 |
|
453 |
|
454 |
// Are we initialized?
|
455 |
if ( ! isset( $wppa_opt[$xkey] ) ) {
|
456 |
+
if ( ! defined( 'WPPA_UPLOAD' ) ) {
|
457 |
+
wppa_dump( 'wppa_switch('.$xkey.') requested before init constants' );
|
458 |
+
}
|
459 |
+
else {
|
460 |
+
wppa_initialize_runtime();
|
461 |
+
}
|
462 |
}
|
463 |
|
464 |
// Old style?
|
487 |
|
488 |
// Are we initialized?
|
489 |
if ( ! isset( $wppa_opt[$xkey] ) ) {
|
490 |
+
if ( ! defined( 'WPPA_UPLOAD' ) ) {
|
491 |
+
wppa_dump( 'wppa_opt('.$xkey.') requested before init constants' );
|
492 |
+
}
|
493 |
+
else {
|
494 |
+
wppa_initialize_runtime();
|
495 |
+
}
|
496 |
}
|
497 |
|
498 |
// Old style?
|
1339 |
else $old = $new;
|
1340 |
}
|
1341 |
|
1342 |
+
function wppa_sanitize_cats( $value ) {
|
1343 |
+
return wppa_sanitize_tags( $value );
|
1344 |
}
|
1345 |
+
function wppa_sanitize_tags( $value, $keepsemi = false, $keephash = false ) {
|
1346 |
|
1347 |
// Sanitize
|
1348 |
$value = sanitize_text_field( $value );
|
1386 |
}
|
1387 |
|
1388 |
// Capitalize single words within tags
|
1389 |
+
// Can not use wppa_switch because its used in wppa_get()
|
1390 |
+
// if ( wppa_switch( 'capitalize_tags' ) ) {
|
1391 |
+
if ( get_option( 'wppa_capitalize_tags', 'yes' ) == 'yes' ) {
|
1392 |
foreach ( array_keys($temp) as $idx ) {
|
1393 |
if ( strlen( $temp[$idx] ) > '1' ) {
|
1394 |
$words = explode( ' ', $temp[$idx] );
|
1502 |
}
|
1503 |
function wppa_stx_err($msg) {
|
1504 |
echo 'Syntax error in album specification. '.$msg;
|
1505 |
+
wppa_log( 'err', $msg, true );
|
1506 |
}
|
1507 |
|
1508 |
|
wppa.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
-
* Version: 8.0.07.
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
@@ -24,7 +24,7 @@ global $wp_version;
|
|
24 |
|
25 |
/* WPPA GLOBALS */
|
26 |
global $wppa_api_version;
|
27 |
-
$wppa_api_version = '8.0.07.
|
28 |
global $wppa_revno;
|
29 |
$wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
|
30 |
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
+
* Version: 8.0.07.004
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
24 |
|
25 |
/* WPPA GLOBALS */
|
26 |
global $wppa_api_version;
|
27 |
+
$wppa_api_version = '8.0.07.004'; // WPPA software version
|
28 |
global $wppa_revno;
|
29 |
$wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
|
30 |
|