WP Photo Album Plus - Version 8.0.07.003

Version Description

= 8.0.07 =

  • This version addresses various bug fixes and security fixes.
Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 8.0.07.003
Comparing to
See all releases

Code changes from version 8.0.06.004 to 8.0.07.003

changelog.txt CHANGED
@@ -1,5 +1,11 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
 
3
  = 8.0.06 =
4
 
5
  * New setting options to Basic settings -> Thumbnails -> II: Thumbnail display options -> Item 4: Thumbnail comcount.
@@ -8,7 +14,7 @@ Enables you to select a userrole, and show the number of comments given by usert
8
  * Fixed wrong links when photo names in urls is activated.
9
  * In case of duplicate names in 'names in urls' they will not be converted to avoid confusion.
10
  * When photo names in urls, slideshow always started at the first slide, also when a link expected a specific item. Fixed.
11
- * Fix first found in cover image selection did not work. Fixed.
12
 
13
  = 8.0.05 =
14
 
1
  WP Photo Album Plus Changelog
2
 
3
+ = 8.0.07 =
4
+
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
 
11
  * New setting options to Basic settings -> Thumbnails -> II: Thumbnail display options -> Item 4: Thumbnail comcount.
14
  * Fixed wrong links when photo names in urls is activated.
15
  * In case of duplicate names in 'names in urls' they will not be converted to avoid confusion.
16
  * When photo names in urls, slideshow always started at the first slide, also when a link expected a specific item. Fixed.
17
+ * Fix first found in cover image selection did not result in less db queries that was the objective of the feature. Fixed.
18
 
19
  = 8.0.05 =
20
 
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.04.006";function wppaPopUp(p,t,i,e,a,n,o,r,d,s){var l,c,w,u=jQuery("#wppa-thumb-area-"+p).width();document.getElementById("x-"+i+"-"+p)&&(c=(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>":""),w=jQuery(t).css("cursor"),wppaThumbTargetBlank,l=""!=r?r:'<img id="wppa-img-'+p+'" src="'+t.src+'" title="" style="border-width: 0px;" />',jQuery("#wppa-popup-"+p).html('<div class="wppa-popup" style="background-color:'+wppaBackgroundColorImage+'; text-align:center;">'+l+c+"</div>"),jQuery(".wppa-popup").on("click",function(){jQuery(t).trigger("click")}),jQuery(".wppa-popup").css({cursor:w})),r=parseInt(d),l=parseInt(s),jQuery(".wppa-popup").css({width:t.clientWidth}),c=parseInt(t.offsetLeft)-7-5,w=parseInt(t.offsetTop)-7-2,jQuery("#grid-item-"+p+"-"+i).length&&(c+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("left"))+6,w+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("top"))),d=parseInt(t.clientWidth),s=parseInt(t.clientHeight),(i=c-parseInt((r-d)/2))<0&&(i=0),u<i+r+16&&(i=u-r-16),(u=w-parseInt((l-s)/2))<0&&(u=0),jQuery("#wppa-img-"+p).css({maxWidth:r}),jQuery("#wppa-popup-"+p).css({marginLeft:c,marginTop:w}),jQuery("#wppa-img-"+p).css({marginLeft:0,marginRight:0,width:d,height:s});s=500;wppaAnimate("#wppa-popup-"+p,{marginLeft:i,marginTop:u},s,wppaEasingPopup),wppaAnimate("#wppa-img-"+p,{width:r,height:l},s,wppaEasingPopup,function(){jQuery(this).on("touchend",function(){wppaPopDown(p)}),jQuery(this).on("click",function(p){p.stopPropagation})}),wppaAnimate(".wppa-popup",{width:r},s,wppaEasingPopup),wppaAnimate(".wppa_pu_info",{width:r},s,wppaEasingPopup,function(){jQuery(".wppa_pu_info").show()}),wppaProtect()}function wppaPopDown(p){jQuery("#wppa-popup-"+p).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
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.002";function wppaPopUp(p,t,i,e,a,n,o,r,d,s){wppaPopDown();var l=jQuery("#wppa-thumb-area-"+p).width(),a=(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>":""),n=jQuery(t).css("cursor"),o=(wppaThumbTargetBlank,""!=r?r:'<img id="wppa-img-'+p+'" src="'+t.src+'" title="" style="border-width: 0px;" />');jQuery("#wppa-popup-"+p).html('<div class="wppa-popup" style="background-color:'+wppaBackgroundColorImage+';box-sizing:content-box;text-align:center;">'+o+a+"</div>"),jQuery(".wppa-popup").on("click",function(){jQuery(t).trigger("click")}),jQuery(".wppa-popup").css({cursor:n}),r=parseInt(d),o=parseInt(s),jQuery(".wppa-popup").css({width:t.clientWidth}),a=parseInt(t.offsetLeft)-7-5,n=parseInt(t.offsetTop)-7-2,jQuery("#grid-item-"+p+"-"+i).length&&(a+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("left"))+6,n+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("top"))),d=parseInt(t.clientWidth),s=parseInt(t.clientHeight),(i=a-parseInt((r-d)/2))<0&&(i=0),l<i+r+16&&(i=l-r-16),(l=n-parseInt((o-s)/2))<0&&(l=0),jQuery("#wppa-img-"+p).css({maxWidth:r}),jQuery("#wppa-popup-"+p).css({marginLeft:a,marginTop:n}),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:r,height:o},s,wppaEasingPopup,function(){jQuery(this).on("touchend",function(){wppaPopDown()}),jQuery(this).on("click",function(p){p.stopPropagation})}),wppaAnimate(".wppa-popup",{width:r},s,wppaEasingPopup),wppaAnimate(".wppa_pu_info",{width:r},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,35 +3,31 @@
3
  // Contains popup modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
- var wppaJsPopupVersion = '8.0.04.006';
7
 
8
  // Popup of thumbnail images
9
  function wppaPopUp( mocc, elm, id, name, desc, rating, ncom, videohtml, maxsizex, maxsizey ) {
10
 
 
 
 
 
11
  var topDivBig, topDivSmall, leftDivBig, leftDivSmall;
12
  var heightImgBig, heightImgSmall, widthImgBig, widthImgSmall;
13
  var imghtml;
14
- var areaWidth = jQuery( '#wppa-thumb-area-'+mocc ).width();
15
-
16
- // Give this' occurrances popup its content
17
- if ( document.getElementById( 'x-'+id+'-'+mocc ) ) {
18
-
19
- var namediv = name ? '<div id="wppa-name-'+mocc+'" style="display:none; padding:1px;" class="wppa_pu_info">'+name+'</div>' : '';
20
- var descdiv = desc ? '<div id="wppa-desc-'+mocc+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+desc+'</div>' : '';
21
- var ratediv = rating ? '<div id="wppa-rat-'+mocc+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+rating+'</div>' : '';
22
- var ncomdiv = ncom ? '<div id="wppa-ncom-'+mocc+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+ncom+'</div>' : '';
23
- var popuptext = namediv+descdiv+ratediv+ncomdiv;
24
- var elmCursor = jQuery( elm ).css('cursor');
25
- var target = '';
26
- if ( wppaThumbTargetBlank ) {
27
- target = 'target="_blank"';
28
- }
29
-
30
- imghtml = videohtml != '' ? videohtml : '<img id="wppa-img-'+mocc+'" src="'+elm.src+'" title="" style="border-width: 0px;" />';
31
- jQuery( '#wppa-popup-'+mocc ).html( '<div class="wppa-popup" style="background-color:'+wppaBackgroundColorImage+'; text-align:center;">'+imghtml+popuptext+'</div>' );
32
- jQuery( '.wppa-popup' ).on( 'click', function(){jQuery(elm).trigger('click')});
33
- jQuery( '.wppa-popup' ).css({cursor:elmCursor});
34
- }
35
 
36
  // Compute ending sizes
37
  widthImgBig = parseInt(maxsizex);
@@ -80,7 +76,7 @@ function wppaPopUp( mocc, elm, id, name, desc, rating, ncom, videohtml, maxsizex
80
  wppaAnimate( '#wppa-popup-'+mocc, {marginLeft:leftDivBig,marginTop:topDivBig}, duration, wppaEasingPopup);
81
  wppaAnimate( '#wppa-img-'+mocc, {width:widthImgBig,height:heightImgBig}, duration, wppaEasingPopup,
82
  function(){
83
- jQuery(this).on('touchend',function(){wppaPopDown(mocc)});
84
  jQuery(this).on('click',function(e){e.stopPropagation})
85
  });
86
  wppaAnimate( '.wppa-popup', {width:widthImgBig}, duration, wppaEasingPopup);
@@ -90,9 +86,9 @@ function wppaPopUp( mocc, elm, id, name, desc, rating, ncom, videohtml, maxsizex
90
  wppaProtect();
91
  }
92
 
93
- // Dismiss popup
94
- function wppaPopDown( mocc ) {
95
- jQuery( '#wppa-popup-'+mocc ).html( "" );
96
  return;
97
  }
98
 
3
  // Contains popup modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsPopupVersion = '8.0.07.002';
7
 
8
  // Popup of thumbnail images
9
  function wppaPopUp( mocc, elm, id, name, desc, rating, ncom, videohtml, maxsizex, maxsizey ) {
10
 
11
+ // Before we start, make sure old popups vanish
12
+ wppaPopDown();
13
+
14
+ // Find all we need
15
  var topDivBig, topDivSmall, leftDivBig, leftDivSmall;
16
  var heightImgBig, heightImgSmall, widthImgBig, widthImgSmall;
17
  var imghtml;
18
+ var areaWidth = jQuery( '#wppa-thumb-area-'+mocc ).width();
19
+ var namediv = name ? '<div id="wppa-name-'+mocc+'" style="display:none; padding:1px;" class="wppa_pu_info">'+name+'</div>' : '';
20
+ var descdiv = desc ? '<div id="wppa-desc-'+mocc+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+desc+'</div>' : '';
21
+ var ratediv = rating ? '<div id="wppa-rat-'+mocc+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+rating+'</div>' : '';
22
+ var ncomdiv = ncom ? '<div id="wppa-ncom-'+mocc+'" style="clear:both; display:none; padding:1px;" class="wppa_pu_info">'+ncom+'</div>' : '';
23
+ var popuptext = namediv+descdiv+ratediv+ncomdiv;
24
+ var elmCursor = jQuery( elm ).css('cursor');
25
+ var target = wppaThumbTargetBlank ? ' target="_blank"' : '';
26
+
27
+ imghtml = videohtml != '' ? videohtml : '<img id="wppa-img-'+mocc+'" src="'+elm.src+'" title="" style="border-width: 0px;" />';
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
33
  widthImgBig = parseInt(maxsizex);
76
  wppaAnimate( '#wppa-popup-'+mocc, {marginLeft:leftDivBig,marginTop:topDivBig}, duration, wppaEasingPopup);
77
  wppaAnimate( '#wppa-img-'+mocc, {width:widthImgBig,height:heightImgBig}, duration, wppaEasingPopup,
78
  function(){
79
+ jQuery(this).on('touchend',function(){wppaPopDown()});
80
  jQuery(this).on('click',function(e){e.stopPropagation})
81
  });
82
  wppaAnimate( '.wppa-popup', {width:widthImgBig}, duration, wppaEasingPopup);
86
  wppaProtect();
87
  }
88
 
89
+ // Dismiss all popups
90
+ function wppaPopDown() {
91
+ jQuery( '.wppa-popup-frame' ).html( "" );
92
  return;
93
  }
94
 
js/wppa-popup.min.js CHANGED
@@ -1 +1 @@
1
- var wppaJsPopupVersion="8.0.04.006";function wppaPopUp(p,t,i,e,a,n,o,r,d,s){var l,c,w,u=jQuery("#wppa-thumb-area-"+p).width();document.getElementById("x-"+i+"-"+p)&&(c=(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>":""),w=jQuery(t).css("cursor"),wppaThumbTargetBlank,l=""!=r?r:'<img id="wppa-img-'+p+'" src="'+t.src+'" title="" style="border-width: 0px;" />',jQuery("#wppa-popup-"+p).html('<div class="wppa-popup" style="background-color:'+wppaBackgroundColorImage+'; text-align:center;">'+l+c+"</div>"),jQuery(".wppa-popup").on("click",function(){jQuery(t).trigger("click")}),jQuery(".wppa-popup").css({cursor:w})),r=parseInt(d),l=parseInt(s),jQuery(".wppa-popup").css({width:t.clientWidth}),c=parseInt(t.offsetLeft)-7-5,w=parseInt(t.offsetTop)-7-2,jQuery("#grid-item-"+p+"-"+i).length&&(c+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("left"))+6,w+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("top"))),d=parseInt(t.clientWidth),s=parseInt(t.clientHeight),(i=c-parseInt((r-d)/2))<0&&(i=0),u<i+r+16&&(i=u-r-16),(u=w-parseInt((l-s)/2))<0&&(u=0),jQuery("#wppa-img-"+p).css({maxWidth:r}),jQuery("#wppa-popup-"+p).css({marginLeft:c,marginTop:w}),jQuery("#wppa-img-"+p).css({marginLeft:0,marginRight:0,width:d,height:s});s=500;wppaAnimate("#wppa-popup-"+p,{marginLeft:i,marginTop:u},s,wppaEasingPopup),wppaAnimate("#wppa-img-"+p,{width:r,height:l},s,wppaEasingPopup,function(){jQuery(this).on("touchend",function(){wppaPopDown(p)}),jQuery(this).on("click",function(p){p.stopPropagation})}),wppaAnimate(".wppa-popup",{width:r},s,wppaEasingPopup),wppaAnimate(".wppa_pu_info",{width:r},s,wppaEasingPopup,function(){jQuery(".wppa_pu_info").show()}),wppaProtect()}function wppaPopDown(p){jQuery("#wppa-popup-"+p).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()}
1
+ var wppaJsPopupVersion="8.0.07.002";function wppaPopUp(p,t,i,e,a,n,o,r,d,s){wppaPopDown();var l=jQuery("#wppa-thumb-area-"+p).width(),a=(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>":""),n=jQuery(t).css("cursor"),o=(wppaThumbTargetBlank,""!=r?r:'<img id="wppa-img-'+p+'" src="'+t.src+'" title="" style="border-width: 0px;" />');jQuery("#wppa-popup-"+p).html('<div class="wppa-popup" style="background-color:'+wppaBackgroundColorImage+';box-sizing:content-box;text-align:center;">'+o+a+"</div>"),jQuery(".wppa-popup").on("click",function(){jQuery(t).trigger("click")}),jQuery(".wppa-popup").css({cursor:n}),r=parseInt(d),o=parseInt(s),jQuery(".wppa-popup").css({width:t.clientWidth}),a=parseInt(t.offsetLeft)-7-5,n=parseInt(t.offsetTop)-7-2,jQuery("#grid-item-"+p+"-"+i).length&&(a+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("left"))+6,n+=parseInt(jQuery("#grid-item-"+p+"-"+i).css("top"))),d=parseInt(t.clientWidth),s=parseInt(t.clientHeight),(i=a-parseInt((r-d)/2))<0&&(i=0),l<i+r+16&&(i=l-r-16),(l=n-parseInt((o-s)/2))<0&&(l=0),jQuery("#wppa-img-"+p).css({maxWidth:r}),jQuery("#wppa-popup-"+p).css({marginLeft:a,marginTop:n}),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:r,height:o},s,wppaEasingPopup,function(){jQuery(this).on("touchend",function(){wppaPopDown()}),jQuery(this).on("click",function(p){p.stopPropagation})}),wppaAnimate(".wppa-popup",{width:r},s,wppaEasingPopup),wppaAnimate(".wppa_pu_info",{width:r},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()}
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, f
5
  Requires at least: 3.9
6
  Tested up to: 5.8
7
  Requires PHP: 5.5
8
- Stable tag: 8.0.05.004
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -134,9 +134,9 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
134
 
135
  == Upgrade Notice ==
136
 
137
- = 8.0.06 =
138
 
139
- * This version addresses various minor bug fixes and feature requests.
140
 
141
  == Screenshots ==
142
 
5
  Requires at least: 3.9
6
  Tested up to: 5.8
7
  Requires PHP: 5.5
8
+ Stable tag: 8.0.06.004
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
134
 
135
  == Upgrade Notice ==
136
 
137
+ = 8.0.07 =
138
 
139
+ * This version addresses various bug fixes and security fixes.
140
 
141
  == Screenshots ==
142
 
theme/wppa-style.css CHANGED
@@ -158,7 +158,7 @@
158
  .wppa-popup-frame {
159
  position: absolute;
160
  z-index:1000;
161
- box-sizing:content-box;
162
  }
163
 
164
  .wppa-popup {
@@ -172,6 +172,7 @@
172
  font-size: 10px;
173
  line-height: 12px;
174
  text-align: center;
 
175
  }
176
 
177
  /* Full size photo */
158
  .wppa-popup-frame {
159
  position: absolute;
160
  z-index:1000;
161
+ box-sizing:content-box !important;
162
  }
163
 
164
  .wppa-popup {
172
  font-size: 10px;
173
  line-height: 12px;
174
  text-align: center;
175
+ box-sizing: content-box;
176
  }
177
 
178
  /* Full size photo */
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 8.0.00.009
7
  *
8
  */
9
 
@@ -749,10 +749,10 @@ global $warning_given_small;
749
  $name = wppa_sanitize_photo_name( $name );
750
 
751
  // If not dups allowed and its already here, quit
752
- if ( isset( $_POST['wppa-nodups'] ) || wppa_switch( 'void_dups' ) ) {
753
  $exists = wppa_is_file_duplicate_photo( $filename, $alb );
754
  if ( $exists ) {
755
- if ( isset( $_POST['del-after-p'] ) ) {
756
  wppa_unlink( $file );
757
  $msg = __( 'Photo %s already exists in album number %s. Removed from depot.' , 'wp-photo-album-plus');
758
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 8.0.07.003
7
  *
8
  */
9
 
749
  $name = wppa_sanitize_photo_name( $name );
750
 
751
  // If not dups allowed and its already here, quit
752
+ if ( wppa_get( 'nodups' ) || wppa_switch( 'void_dups' ) ) {
753
  $exists = wppa_is_file_duplicate_photo( $filename, $alb );
754
  if ( $exists ) {
755
+ if ( wppa_get( 'del-after-p' ) ) {
756
  wppa_unlink( $file );
757
  $msg = __( 'Photo %s already exists in album number %s. Removed from depot.' , 'wp-photo-album-plus');
758
  }
wppa-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
- * Version 8.0.05.004
7
  *
8
  */
9
 
@@ -257,7 +257,7 @@ function wppa_clear_wppa_cache() {
257
  $m = floor( $a / 60 );
258
  $s = $a - $m * 60;
259
  $age = sprintf( '%2dd %2dh %2dm %2ds', $d, $h, $m, $s );
260
- if ( isset( $_REQUEST['delete'] ) ) {
261
  wppa_unlink( $file, false );
262
  }
263
  echo '
@@ -271,7 +271,7 @@ function wppa_clear_wppa_cache() {
271
  </tbody>
272
  </table>';
273
 
274
- if ( isset( $_REQUEST['delete'] ) ) {
275
  echo '<br><b>' . sprintf( __( '%d cachefiles deleted', 'wp-photo-album-plus' ), $count ) . '</br>';
276
  }
277
  else {
@@ -285,7 +285,7 @@ function wppa_clear_wppa_cache() {
285
  <input
286
  type="button"
287
  class="button-primary"
288
- onclick="document.location.href=\'' . admin_url( 'admin.php?page=wppa_clear_cache&delete' ) . '\'"
289
  value="' . __( 'Delete', 'wp-photo-album-plus' ) . '"
290
  /><br />
291
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
+ * Version 8.0.07.001
7
  *
8
  */
9
 
257
  $m = floor( $a / 60 );
258
  $s = $a - $m * 60;
259
  $age = sprintf( '%2dd %2dh %2dm %2ds', $d, $h, $m, $s );
260
+ if ( wppa_get( 'delete' ) ) {
261
  wppa_unlink( $file, false );
262
  }
263
  echo '
271
  </tbody>
272
  </table>';
273
 
274
+ if ( wppa_get( 'delete' ) ) {
275
  echo '<br><b>' . sprintf( __( '%d cachefiles deleted', 'wp-photo-album-plus' ), $count ) . '</br>';
276
  }
277
  else {
285
  <input
286
  type="button"
287
  class="button-primary"
288
+ onclick="document.location.href=\'' . admin_url( 'admin.php?page=wppa_clear_cache&delete=1' ) . '\'"
289
  value="' . __( 'Delete', 'wp-photo-album-plus' ) . '"
290
  /><br />
291
 
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 8.0.05.003
6
  *
7
  */
8
 
@@ -65,43 +65,15 @@ global $wppa;
65
  $wppa_session['page']--;
66
  $wppa_session['ajax']++;
67
 
68
- // ALTHOUGH IF WE ARE HERE AS FRONT END VISITOR, is_admin() is true.
69
- // So, $wppa_opt switches are 'yes' or 'no' and not true or false.
70
- // So, always use the function wppa_switch( $slug ) to test on a bool setting
71
-
72
- // Globally check query args to prevent php injection
73
- $wppa_args = array( 'album', 'photo', 'slide', 'cover', 'occur', 'woccur', 'searchstring', 'topten',
74
- 'lasten', 'comten', 'featen', 'single', 'photos-only', 'debug',
75
- 'relcount', 'upldr', 'owner', 'rootsearch' );
76
- foreach ( $_REQUEST as $arg ) {
77
- if ( in_array( str_replace( 'wppa-', '', $arg ), $wppa_args ) ) {
78
- if ( strpos( $arg, '<?' ) !== false ) wppa_secfail( '91' );
79
- if ( strpos( $arg, '?>' ) !== false ) wppa_secfail( '92' );
80
- }
81
- }
82
-
83
- wppa_vfy_arg( 'wppa-action', true );
84
- wppa_vfy_arg( 'photo-id' );
85
- wppa_vfy_arg( 'comment-id' );
86
- wppa_vfy_arg( 'moccur' );
87
- wppa_vfy_arg( 'comemail', true );
88
- wppa_vfy_arg( 'comname', true );
89
- wppa_vfy_arg( 'tag', true );
90
-
91
- $wppa_action = $_REQUEST['wppa-action'];
92
 
93
- if ( wppa_switch( 'log_ajax' ) ) {
94
  $args = '';
95
- $is_heartbeat = false;
96
- foreach( array_keys( $_REQUEST ) as $key ) {
97
- if ( $key == 'wppa-option' && $_REQUEST[$key] == 'heartbeat' ) {
98
- $is_heartbeat = true;
99
- }
100
- $args .= $key . '=' . $_REQUEST[$key] . ', ';
101
- }
102
- if ( ! $is_heartbeat ) {
103
- wppa_log( 'Ajx', 'Script = ' . basename( $_SERVER['SCRIPT_FILENAME'] ) . ', Args = ' . $args );
104
  }
 
105
  }
106
 
107
  // Any runtime modifyable settings?
@@ -116,18 +88,18 @@ global $wppa;
116
 
117
  switch ( $wppa_action ) {
118
  case 'log':
119
- if ( ! isset( $_GET['message'] ) ) wppa_exit();
120
- wppa_log( 'Cli', $_GET['message'] );
121
  wppa_exit();
122
  break;
123
  case 'mailinglist':
124
 
125
  // Sanitize input
126
- $nonce = isset( $_REQUEST['wppa-ntfy-nonce'] ) ? strip_tags( stripslashes( $_REQUEST['wppa-ntfy-nonce'] ) ) : '';
127
- $crypt = isset( $_REQUEST['crypt'] ) ? strip_tags( stripslashes( $_REQUEST['crypt'] ) ) : '';
128
- $list_type = isset( $_REQUEST['list'] ) ? strip_tags( stripslashes( $_REQUEST['list'] ) ) : '';
129
- $onoff = isset( $_REQUEST['onoff'] ) ? strip_tags( stripslashes( $_REQUEST['onoff'] ) ) : '';
130
- $user_id = isset( $_REQUEST['user'] ) ? strip_tags( stripslashes( $_REQUEST['user'] ) ) : '';
131
 
132
  // Check nonce or crypt
133
  if ( $nonce ) {
@@ -207,17 +179,17 @@ global $wppa;
207
  wppa_exit();
208
  break;
209
  case 'getqrcode':
210
- $nonce = $_REQUEST['wppa-qr-nonce'];
211
  if ( ! wp_verify_nonce( $nonce, 'wppa-qr-nonce' ) ) {
212
  die( 'Security check falure' );
213
  }
214
- $url = strip_tags( $_REQUEST['url'] );
215
  $result = wppa_create_qrcode_cache( $url, wppa_opt( 'qr_size' ) );
216
  echo $result . '|' . wppa_convert_to_pretty( $url );
217
  wppa_exit();
218
  break;
219
  case 'gettogo':
220
- $slug = strip_tags( $_REQUEST['slug'] );
221
  $result = wppa_get_option( $slug . '_togo', '' ) .
222
  '|' .
223
  wppa_get_option( $slug . '_status', '' );
@@ -231,19 +203,15 @@ global $wppa;
231
  $mocc = '1';
232
  $oldvalue = '';
233
 
234
- if ( isset( $_REQUEST['iptctag'] ) ) {
235
- $tag = str_replace( 'H', '#', $_REQUEST['iptctag'] );
236
- }
237
- if ( isset( $_REQUEST['moccur'] ) ) {
238
- $mocc = strval( intval( $_REQUEST['moccur'] ) );
239
- }
240
 
241
  if ( strpos( $wppa_session['supersearch'], ',' ) !== false ) {
242
  $ss_data = explode( ',', $wppa_session['supersearch'] );
243
  if ( count( $ss_data ) == '4' ) {
244
  if ( $ss_data['0'] == 'p' ) {
245
  if ( $ss_data['1'] == 'i' ) {
246
- if ( $ss_data['2'] == $_REQUEST['iptctag'] ) {
247
  $oldvalue = $ss_data['3'];
248
  }
249
  }
@@ -292,13 +260,9 @@ global $wppa;
292
  $oldvalue = '';
293
  $ss_data = array();
294
 
295
- if ( isset( $_REQUEST['exiftag'] ) ) {
296
- $tag = str_replace( 'H', '#', substr( $_REQUEST['exiftag'], 0, 6 ) );
297
- $brand = substr( $_REQUEST['exiftag'], 6 );
298
- }
299
- if ( isset( $_REQUEST['moccur'] ) ) {
300
- $mocc = strval( intval( $_REQUEST['moccur'] ) );
301
- }
302
 
303
  if ( strpos( $wppa_session['supersearch'], ',' ) !== false ) {
304
  $data = explode( ',', $wppa_session['supersearch'] );
@@ -313,7 +277,7 @@ global $wppa;
313
 
314
  if ( $ss_data['0'] == 'p' ) {
315
  if ( $ss_data['1'] == 'e' ) {
316
- if ( $ss_data['2'] == $_REQUEST['exiftag'] ) {
317
  $oldvalue = $ss_data['3'];
318
  }
319
  }
@@ -411,9 +375,10 @@ global $wppa;
411
  case 'front-edit': // Fetch the html for edit dialog
412
 
413
  // Is the call valid?
414
- if ( ! isset( $_REQUEST['photo-id'] ) ) die( 'Missing required argument' );
415
- $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
416
- $photo = strval( intval( $photo ) );
 
417
 
418
  // Is this user allowed to edit thisphoto?
419
  $ok = wppa_may_user_fe_edit( $photo );
@@ -451,32 +416,32 @@ global $wppa;
451
  case 'update-photo-new': // Do the actual edit update
452
 
453
  // Get photo id
454
- $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
455
- $photo = strval( intval( $photo ) );
456
 
457
  // Is the call valid?
458
- $nonce = $_REQUEST['wppa-nonce'];
459
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce-' . $photo ) ) {
460
  die( 'Security check falure' );
461
  }
462
- if ( ! isset( $_REQUEST['photo-id'] ) ) die( 'Missing required argument' );
 
 
463
 
464
  // Name
465
- if ( isset( $_POST['upn-name'] ) ) {
466
- $name = stripslashes( strip_tags( $_POST['upn-name'] ) );
467
  wppa_update_photo( array( 'id' => $photo, 'name' => $name ) );
468
  }
469
 
470
  // Description
471
- if ( isset( $_POST['upn-description'] ) ) {
472
- $desc = str_replace( array( '<br/>','<br>' ), '<br />', $_POST['upn-description'] );
473
- $desc = stripslashes( $desc );
474
  wppa_update_photo( array( 'id' => $photo, 'description' => $desc ) );
475
  }
476
 
477
  // Tags
478
- if ( isset( $_POST['upn-tags'] ) ) {
479
- $tags = wppa_sanitize_tags( $_POST['upn-tags'] );
480
  wppa_update_photo( array( 'id' => $photo, 'tags' => $tags ) );
481
  wppa_clear_taglist();
482
  }
@@ -490,8 +455,8 @@ global $wppa;
490
  $custom_data = array( '', '', '', '', '', '', '', '', '', '' );
491
  }
492
  for ( $i=0;$i<10;$i++ ) {
493
- if ( isset( $_POST['custom_' . $i] ) && wppa_opt( 'custom_caption_' . $i ) && wppa_switch( 'custom_edit_' . $i ) ) {
494
- $custom_data[$i] = wppa_sanitize_custom_field( $_POST['custom_' . $i] );
495
  }
496
  }
497
  $custom = serialize( $custom_data );
@@ -506,10 +471,10 @@ global $wppa;
506
  case 'do-comment':
507
 
508
  // Validate args
509
- $mocc = isset( $_REQUEST['moccur'] ) ? strval( intval( $_REQUEST['moccur'] ) ) : '0';
510
- $nonce = isset( $_REQUEST['wppa-nonce'] ) ? $_REQUEST['wppa-nonce'] : '0';
511
- $photoid = isset( $_REQUEST['photo-id'] ) ? wppa_decrypt_photo( trim( $_REQUEST['photo-id'], '/' ) ) : '0';
512
- $commentid = isset( $_REQUEST['comment-edit'] ) ? strval( intval( $_REQUEST['comment-edit'] ) ) : '0';
513
 
514
  // Security check
515
  if ( wppa_switch( 'direct_comment' ) && wppa_switch( 'use_encrypted_links' ) && wppa_switch( 'refuse_unencrypted' ) ) {
@@ -536,7 +501,7 @@ global $wppa;
536
  // If db agree required, see if it is present
537
  $doit = true;
538
  if ( wppa_switch( 'comment_need_db_agree' ) ) {
539
- if ( ! isset( $_REQUEST['db-agree'] ) ) {
540
  echo
541
  '<script type="text/javascript" >' .
542
  'alert( "' . esc_js( __( 'Your comment needs your agreement for database storage', 'wp-photo-album-plus' ) ) . '" )' .
@@ -567,8 +532,8 @@ global $wppa;
567
 
568
  case 'approve':
569
  $iret = 0;
570
- $pid = isset( $_REQUEST['photo-id'] ) ? intval( $_REQUEST['photo-id'] ) : 0;
571
- $cid = isset( $_REQUEST['comment-id'] ) ? intval( $_REQUEST['comment-id'] ) : 0;
572
 
573
  if ( ! current_user_can( 'wppa_moderate' ) && ! current_user_can( 'wppa_comments' ) ) {
574
  _e( 'You do not have the rights to moderate photos this way' , 'wp-photo-album-plus');
@@ -625,9 +590,8 @@ global $wppa;
625
 
626
  case 'remove':
627
 
628
- $pid = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
629
- $pid = strval( intval( $pid ) );
630
- $cid = isset( $_REQUEST['comment-id'] ) ? intval( $_REQUEST['comment-id'] ) : 0;
631
 
632
  // Remove photo
633
  if ( $pid ) {
@@ -685,7 +649,7 @@ global $wppa;
685
  }
686
 
687
  // Validate args
688
- $alb = wppa_decrypt_album( $_REQUEST['album-id'] );
689
 
690
  if ( is_user_logged_in() ) {
691
  $query = "SELECT * FROM $wpdb->wppa_photos
@@ -762,7 +726,7 @@ global $wppa;
762
  break;
763
 
764
  case 'getalbumzipurl':
765
- $alb = $_REQUEST['album-id'];
766
  $zipfilename = wppa_get_album_name( $alb );
767
  $zipfilename = wppa_sanitize_file_name( $zipfilename . '.zip' ); // Remove illegal chars
768
  $zipfilepath = WPPA_UPLOAD_PATH . '/temp/' . $zipfilename;
@@ -778,8 +742,7 @@ global $wppa;
778
 
779
  case 'addtozip':
780
 
781
- $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
782
- $photo = strval( intval( $photo ) );
783
  $donetoalbum = false;
784
 
785
  if ( wppa_opt( 'admins_choice_action' ) == 'album' || wppa_opt( 'admins_choice_action' ) == 'both' ) {
@@ -874,8 +837,7 @@ global $wppa;
874
  case 'removefromzip':
875
 
876
  // Check if the user is allowed to do this
877
- $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
878
- $photo = strval( intval( $photo ) );
879
  $choice = wppa_opt( 'admins_choice' );
880
  if ( ( wppa_user_is( 'administrator' ) && $choice != 'none' ) ||
881
  ( is_user_logged_in() && $choice == 'login' ) ) {
@@ -953,8 +915,7 @@ global $wppa;
953
  }
954
 
955
  // Find the photo
956
- $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
957
- $photo = strval( intval( $photo ) );
958
 
959
  // The mail content
960
  $content =
@@ -967,7 +928,7 @@ global $wppa;
967
  '<br /><br />' . __('His request specification is', 'wp-photo-album-plus') . '<br />' .
968
 
969
  '<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius: 4px;" >
970
- <em> ' . sanitize_text_field( $_GET['emailtext'] ) . '</em>
971
  </blockquote>';
972
 
973
  if ( ! function_exists( 'wppa_send_mail' ) ) {
@@ -991,10 +952,9 @@ global $wppa;
991
  break;
992
 
993
  case 'makeorigname':
994
- $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
995
- $photo = strval( intval( $photo ) );
996
 
997
- $from = $_REQUEST['from'];
998
  if ( $from == 'fsname' ) {
999
  $type = wppa_opt( 'art_monkey_link' );
1000
  }
@@ -1118,12 +1078,12 @@ global $wppa;
1118
  break;
1119
 
1120
  case 'getshortcodedrendered':
1121
- $shortcode = stripslashes( $_REQUEST['shortcode'] );
1122
  $shortcode = str_replace( '@', '#', $shortcode );
1123
 
1124
  wppa_load_theme();
1125
 
1126
- $wppa['mocc'] = strval( intval( $_REQUEST['moccur'] ) ) - '1'; // Will be inc'd back by do_shortcode content
1127
  $wppa_opt['wppa_lazy'] = 'none';
1128
  $result = do_shortcode( $shortcode );
1129
  $result = str_replace( 'href=', 'data-href=', $result );
@@ -1142,9 +1102,9 @@ global $wppa;
1142
  break;
1143
 
1144
  case 'bumpviewcount':
1145
- $nonce = $_REQUEST['wppa-nonce'];
1146
  if ( wp_verify_nonce( $nonce, 'wppa-check' ) ) {
1147
- wppa_bump_viewcount( 'photo', $_REQUEST['wppa-photo'] );
1148
  }
1149
  else {
1150
  _e( 'Security check failure' , 'wp-photo-album-plus');
@@ -1153,9 +1113,8 @@ global $wppa;
1153
  break;
1154
 
1155
  case 'bumpclickcount':
1156
- $nonce = $_REQUEST['wppa-nonce'];
1157
- $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
1158
- $photo = strval( intval( $photo ) );
1159
  if ( $photo && wp_verify_nonce( $nonce, 'wppa-check' ) ) {
1160
  wppa_bump_clickcount( $photo );
1161
  }
@@ -1167,12 +1126,11 @@ global $wppa;
1167
 
1168
  case 'rate':
1169
  // Get commandline args
1170
- $photo = wppa_decrypt_photo( $_REQUEST['wppa-rating-id'] );
1171
- $photo = strval( intval( $photo ) );
1172
- $rating = strval( intval( $_REQUEST['wppa-rating'] ) );
1173
- $occur = strval( intval( $_REQUEST['wppa-occur'] ) );
1174
- $index = isset( $_REQUEST['wppa-index'] ) ? strval( intval( $_REQUEST['wppa-index'] ) ) : '0';
1175
- $nonce = $_REQUEST['wppa-nonce'];
1176
 
1177
  // Make errortext
1178
  $errtxt = __( 'An error occurred while processing you rating request.' , 'wp-photo-album-plus');
@@ -1286,7 +1244,7 @@ global $wppa;
1286
  );
1287
 
1288
  // Do the mailing
1289
- wppa_schedule_mailinglist( 'commentnotify', 0, $photo, $com, wppa_get_post( 'returnurl' ) );
1290
  }
1291
  }
1292
 
@@ -1556,8 +1514,8 @@ global $wppa;
1556
  break;
1557
 
1558
  case 'delete-photo':
1559
- $photo = $_REQUEST['photo-id'];
1560
- $nonce = $_REQUEST['wppa-nonce'];
1561
 
1562
  // Check validity
1563
  if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
@@ -1588,8 +1546,8 @@ global $wppa;
1588
  break;
1589
 
1590
  case 'undelete-photo':
1591
- $photo = $_REQUEST['photo-id'];
1592
- $nonce = $_REQUEST['wppa-nonce'];
1593
 
1594
  // Check validity
1595
  if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
@@ -1642,10 +1600,10 @@ global $wppa;
1642
  break;
1643
 
1644
  case 'update-album':
1645
- $album = $_REQUEST['album-id'];
1646
- $nonce = $_REQUEST['wppa-nonce'];
1647
- $item = $_REQUEST['item'];
1648
- $value = $_REQUEST['value'];
1649
  $value = wppa_decode( $value );
1650
 
1651
  if ( ! current_user_can( 'unfiltered_html' ) ) {
@@ -1994,10 +1952,10 @@ global $wppa;
1994
  break;
1995
 
1996
  case 'update-comment-status':
1997
- $photo = $_REQUEST['wppa-photo-id'];
1998
- $nonce = $_REQUEST['wppa-nonce'];
1999
- $comid = $_REQUEST['wppa-comment-id'];
2000
- $comstat = $_REQUEST['wppa-comment-status'];
2001
 
2002
  // Check validity
2003
  if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
@@ -2029,8 +1987,8 @@ global $wppa;
2029
  break;
2030
 
2031
  case 'watermark-photo':
2032
- $photo = $_REQUEST['photo-id'];
2033
- $nonce = $_REQUEST['wppa-nonce'];
2034
 
2035
  // Check validity
2036
  if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
@@ -2056,11 +2014,10 @@ global $wppa;
2056
  /* START UPDATE PHOTO */
2057
 
2058
  case 'update-photo':
2059
- $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
2060
- $photo = strval( intval( $photo ) );
2061
- $nonce = $_REQUEST['wppa-nonce'];
2062
- $item = $_REQUEST['item'];
2063
- $value = isset( $_REQUEST['value'] ) ? $_REQUEST['value'] : '';
2064
  $value = wppa_decode( $value );
2065
 
2066
  if ( ! current_user_can( 'unfiltered_html' ) ) {
@@ -2996,13 +2953,12 @@ global $wppa;
2996
 
2997
  // Update iptc
2998
  case 'update-iptc':
2999
- $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
3000
- $photo = strval( intval( $photo ) );
3001
- $nonce = $_REQUEST['wppa-nonce'];
3002
- $item = $_REQUEST['item'];
3003
- $value = isset( $_REQUEST['value'] ) ? $_REQUEST['value'] : '';
3004
  $value = wppa_decode( $value );
3005
- $tag = $_REQUEST['tagname'];
3006
 
3007
  // Check validity
3008
  if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
@@ -3027,18 +2983,18 @@ global $wppa;
3027
  case 'update-option':
3028
 
3029
  // Verify that we are legally here
3030
- $nonce = $_REQUEST['wppa-nonce'];
3031
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
3032
  echo '||1||'.__( 'You do not have the rights to update settings' , 'wp-photo-album-plus');
3033
  wppa_exit(); // Nonce check failed
3034
  }
3035
 
3036
  // Initialize
3037
- $old_minisize = wppa_get_minisize(); // Remember for later, maybe we do something that requires regen
3038
- $option = 'wppa_' . $_REQUEST['wppa-option']; // The option to be processed
3039
- $value = isset( $_REQUEST['value'] ) ? wppa_decode( $_REQUEST['value'] ) : ''; // The new value, may also contain & # and +
3040
  $value = stripslashes( $value );
3041
- $value = trim( $value ); // Remaove surrounding spaces
3042
  $alert = ''; // Init the return string data
3043
  wppa( 'error', '0' ); //
3044
  $title = ''; //
@@ -3095,7 +3051,7 @@ global $wppa;
3095
 
3096
  // Dispatch on option
3097
  if ( $option == 'wppa_getspinnerpreview' ) {
3098
- if ( $_REQUEST['type'] == 'normal' ) {
3099
  echo wppa_get_spinner_svg_html( array( 'size' => 60,
3100
  'display' => 'inline',
3101
  'lightbox' => false,
@@ -3105,7 +3061,7 @@ global $wppa;
3105
  'margin' => '0',
3106
  ) );
3107
  }
3108
- elseif ( $_REQUEST['type'] == 'lightbox' ) {
3109
  echo wppa_get_spinner_svg_html( array( 'size' => 60,
3110
  'display' => 'inline',
3111
  'lightbox' => true,
@@ -3954,9 +3910,9 @@ global $wppa;
3954
  case 'maintenance':
3955
 
3956
  // Get args
3957
- $slug = $_POST['slug'];
3958
- $nonce = $_REQUEST['wppa-nonce'];
3959
- $cron = isset( $_REQUEST['wppa-cron'] );
3960
 
3961
  // Security check
3962
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
@@ -3981,8 +3937,8 @@ global $wppa;
3981
  break;
3982
 
3983
  case 'maintenancepopup':
3984
- $slug = $_REQUEST['slug'];
3985
- $nonce = $_REQUEST['wppa-nonce'];
3986
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
3987
  echo 'Security check failure||'.$slug.'||Error||0';
3988
  wppa_exit();
@@ -3992,13 +3948,12 @@ global $wppa;
3992
  break;
3993
 
3994
  case 'do-fe-upload':
3995
- // if ( is_admin() ) {
3996
- require_once 'wppa-non-admin.php';
3997
- // }
3998
  wppa_user_upload();
3999
  echo wppa( 'out' );
4000
  global $wppa_upload_succes_id;
4001
- if ( ( isset( $_GET['fromtinymce'] ) || isset( $_GET['fromgutenberg']) ) && $wppa_upload_succes_id ) {
4002
  echo '||' . $wppa_upload_succes_id . '||';
4003
  echo htmlentities( wppa_get_myphotos_selection_body_for_tinymce( $wppa_upload_succes_id ) );
4004
  }
@@ -4006,8 +3961,8 @@ global $wppa;
4006
  break;
4007
 
4008
  case 'sanitizetags':
4009
- $tags = isset( $_GET['tags'] ) ? $_GET['tags'] : '';
4010
- $album = isset( $_GET['album'] ) ? $_GET['album'] : '0';
4011
  $deftags = ( wppa_is_int( $album ) && $album > '0' ) ? wppa_get_album_item( $album, 'default_tags' ) : '';
4012
  $tags = $deftags ? $tags . ',' . $deftags : $tags;
4013
  echo wppa_sanitize_tags( $tags, false, true );
@@ -4015,12 +3970,12 @@ global $wppa;
4015
  break;
4016
 
4017
  case 'destroyalbum':
4018
- $album = isset( $_GET['album'] ) ? $_GET['album'] : '0';
4019
  if ( ! $album ) {
4020
  _e('Missing album id', 'wp-photo-album-plus');
4021
  wppa_exit();
4022
  }
4023
- $nonce = isset( $_GET['nonce'] ) ? $_GET['nonce'] : '';
4024
  if ( ! $nonce || ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$album ) ) {
4025
  echo 'Security check failure #798';
4026
  wppa_exit();
@@ -4050,7 +4005,7 @@ global $wppa;
4050
  echo '||1||'.__( 'Security check failure' , 'wp-photo-album-plus' );
4051
  wppa_exit();
4052
  }
4053
- $table = $_REQUEST['table'];
4054
  $bret = wppa_export_table( $table );
4055
  if ( $bret ) {
4056
  echo '||0||' . WPPA_UPLOAD_URL . '/temp/' . $table . '.csv';
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 8.0.07.003
6
  *
7
  */
8
 
65
  $wppa_session['page']--;
66
  $wppa_session['ajax']++;
67
 
68
+ $wppa_action = wppa_get( 'action' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
+ if ( wppa_switch( 'log_ajax' ) && wppa_get( 'action' ) != 'heartbeat' && wppa_get( 'option' ) != 'heartbeat' ) {
71
  $args = '';
72
+ $t = array_merge( $_GET, $_POST );
73
+ foreach( array_keys( $t ) as $key ) {
74
+ $args .= $key . '=' . $t[$key] . ', ';
 
 
 
 
 
 
75
  }
76
+ wppa_log( 'Ajx', 'Script = ' . basename( $_SERVER['SCRIPT_FILENAME'] ) . ', Args = ' . $args );
77
  }
78
 
79
  // Any runtime modifyable settings?
88
 
89
  switch ( $wppa_action ) {
90
  case 'log':
91
+ if ( ! wppa_get( 'message' ) ) wppa_exit();
92
+ wppa_log( 'Cli', wppa_get( 'message' ) );
93
  wppa_exit();
94
  break;
95
  case 'mailinglist':
96
 
97
  // Sanitize input
98
+ $nonce = wppa_get( 'ntfy-nonce' );
99
+ $crypt = wppa_get( 'crypt' );
100
+ $list_type = wppa_get( 'list' );
101
+ $onoff = wppa_get( 'onoff' );
102
+ $user_id = wppa_get( 'user' );
103
 
104
  // Check nonce or crypt
105
  if ( $nonce ) {
179
  wppa_exit();
180
  break;
181
  case 'getqrcode':
182
+ $nonce = wppa_get( 'qr-nonce' );
183
  if ( ! wp_verify_nonce( $nonce, 'wppa-qr-nonce' ) ) {
184
  die( 'Security check falure' );
185
  }
186
+ $url = wppa_get( 'url' );
187
  $result = wppa_create_qrcode_cache( $url, wppa_opt( 'qr_size' ) );
188
  echo $result . '|' . wppa_convert_to_pretty( $url );
189
  wppa_exit();
190
  break;
191
  case 'gettogo':
192
+ $slug = wppa_get( 'slug' );
193
  $result = wppa_get_option( $slug . '_togo', '' ) .
194
  '|' .
195
  wppa_get_option( $slug . '_status', '' );
203
  $mocc = '1';
204
  $oldvalue = '';
205
 
206
+ $tag = str_replace( 'H', '#', wppa_get( 'iptctag' ) );
207
+ $mocc = wppa_get( 'moccur' );
 
 
 
 
208
 
209
  if ( strpos( $wppa_session['supersearch'], ',' ) !== false ) {
210
  $ss_data = explode( ',', $wppa_session['supersearch'] );
211
  if ( count( $ss_data ) == '4' ) {
212
  if ( $ss_data['0'] == 'p' ) {
213
  if ( $ss_data['1'] == 'i' ) {
214
+ if ( $ss_data['2'] == wppa_get( 'iptctag' ) ) {
215
  $oldvalue = $ss_data['3'];
216
  }
217
  }
260
  $oldvalue = '';
261
  $ss_data = array();
262
 
263
+ $tag = str_replace( 'H', '#', substr( wppa_get( 'exiftag' ), 0, 6 ) );
264
+ $brand = substr( wppa_get( 'exiftag' ), 6 );
265
+ $mocc = wppa_get( 'moccur' );
 
 
 
 
266
 
267
  if ( strpos( $wppa_session['supersearch'], ',' ) !== false ) {
268
  $data = explode( ',', $wppa_session['supersearch'] );
277
 
278
  if ( $ss_data['0'] == 'p' ) {
279
  if ( $ss_data['1'] == 'e' ) {
280
+ if ( $ss_data['2'] == wppa_get( 'exiftag' ) ) {
281
  $oldvalue = $ss_data['3'];
282
  }
283
  }
375
  case 'front-edit': // Fetch the html for edit dialog
376
 
377
  // Is the call valid?
378
+ $photo = wppa_get( 'photo-id' );
379
+ if ( ! $photo ) {
380
+ die( 'Missing required argument' );
381
+ }
382
 
383
  // Is this user allowed to edit thisphoto?
384
  $ok = wppa_may_user_fe_edit( $photo );
416
  case 'update-photo-new': // Do the actual edit update
417
 
418
  // Get photo id
419
+ $photo = wppa_get( 'photo-id' );
 
420
 
421
  // Is the call valid?
422
+ $nonce = wppa_get( 'nonce' );
423
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce-' . $photo ) ) {
424
  die( 'Security check falure' );
425
  }
426
+ if ( ! $photo ) {
427
+ die( 'Missing required argument' );
428
+ }
429
 
430
  // Name
431
+ if ( wppa_get( 'upn-name' ) ) {
432
+ $name = wppa_get( 'upn-name' );
433
  wppa_update_photo( array( 'id' => $photo, 'name' => $name ) );
434
  }
435
 
436
  // Description
437
+ if ( wppa_get( 'upn-description' ) ) {
438
+ $desc = wppa_get( 'upn-description' );
 
439
  wppa_update_photo( array( 'id' => $photo, 'description' => $desc ) );
440
  }
441
 
442
  // Tags
443
+ if ( wppa_get( 'upn-tags' ) ) {
444
+ $tags = wppa_get( 'upn-tags' );
445
  wppa_update_photo( array( 'id' => $photo, 'tags' => $tags ) );
446
  wppa_clear_taglist();
447
  }
455
  $custom_data = array( '', '', '', '', '', '', '', '', '', '' );
456
  }
457
  for ( $i=0;$i<10;$i++ ) {
458
+ if ( wppa_get( 'custom_' . $i ) && wppa_opt( 'custom_caption_' . $i ) && wppa_switch( 'custom_edit_' . $i ) ) {
459
+ $custom_data[$i] = wppa_get( 'custom_' . $i );
460
  }
461
  }
462
  $custom = serialize( $custom_data );
471
  case 'do-comment':
472
 
473
  // Validate args
474
+ $mocc = wppa_get( 'moccur' );
475
+ $nonce = wppa_get( 'nonce' );
476
+ $photoid = wppa_get( 'photo-id' );
477
+ $commentid = wppa_get( 'comment-edit' );
478
 
479
  // Security check
480
  if ( wppa_switch( 'direct_comment' ) && wppa_switch( 'use_encrypted_links' ) && wppa_switch( 'refuse_unencrypted' ) ) {
501
  // If db agree required, see if it is present
502
  $doit = true;
503
  if ( wppa_switch( 'comment_need_db_agree' ) ) {
504
+ if ( wppa_get( 'db-agree' ) ) {
505
  echo
506
  '<script type="text/javascript" >' .
507
  'alert( "' . esc_js( __( 'Your comment needs your agreement for database storage', 'wp-photo-album-plus' ) ) . '" )' .
532
 
533
  case 'approve':
534
  $iret = 0;
535
+ $pid = wppa_get( 'photo-id' );
536
+ $cid = wppa_get( 'comment-id' );
537
 
538
  if ( ! current_user_can( 'wppa_moderate' ) && ! current_user_can( 'wppa_comments' ) ) {
539
  _e( 'You do not have the rights to moderate photos this way' , 'wp-photo-album-plus');
590
 
591
  case 'remove':
592
 
593
+ $pid = wppa_get( 'photo-id' );
594
+ $cid = wppa_get( 'comment-id' );
 
595
 
596
  // Remove photo
597
  if ( $pid ) {
649
  }
650
 
651
  // Validate args
652
+ $alb = wppa_get( 'album-id' );
653
 
654
  if ( is_user_logged_in() ) {
655
  $query = "SELECT * FROM $wpdb->wppa_photos
726
  break;
727
 
728
  case 'getalbumzipurl':
729
+ $alb = wppa_get( 'album-id' );
730
  $zipfilename = wppa_get_album_name( $alb );
731
  $zipfilename = wppa_sanitize_file_name( $zipfilename . '.zip' ); // Remove illegal chars
732
  $zipfilepath = WPPA_UPLOAD_PATH . '/temp/' . $zipfilename;
742
 
743
  case 'addtozip':
744
 
745
+ $photo = wppa_get( 'photo-id' );
 
746
  $donetoalbum = false;
747
 
748
  if ( wppa_opt( 'admins_choice_action' ) == 'album' || wppa_opt( 'admins_choice_action' ) == 'both' ) {
837
  case 'removefromzip':
838
 
839
  // Check if the user is allowed to do this
840
+ $photo = wppa_get( 'photo-id' );
 
841
  $choice = wppa_opt( 'admins_choice' );
842
  if ( ( wppa_user_is( 'administrator' ) && $choice != 'none' ) ||
843
  ( is_user_logged_in() && $choice == 'login' ) ) {
915
  }
916
 
917
  // Find the photo
918
+ $photo = wppa_get( 'photo-id' );
 
919
 
920
  // The mail content
921
  $content =
928
  '<br /><br />' . __('His request specification is', 'wp-photo-album-plus') . '<br />' .
929
 
930
  '<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius: 4px;" >
931
+ <em> ' . sanitize_text_field( wppa_get( 'emailtext' ) ) . '</em>
932
  </blockquote>';
933
 
934
  if ( ! function_exists( 'wppa_send_mail' ) ) {
952
  break;
953
 
954
  case 'makeorigname':
955
+ $photo = wppa_get( 'photo-id' );
 
956
 
957
+ $from = wppa_get( 'from' );
958
  if ( $from == 'fsname' ) {
959
  $type = wppa_opt( 'art_monkey_link' );
960
  }
1078
  break;
1079
 
1080
  case 'getshortcodedrendered':
1081
+ $shortcode = wppa_get( 'shortcode' );
1082
  $shortcode = str_replace( '@', '#', $shortcode );
1083
 
1084
  wppa_load_theme();
1085
 
1086
+ $wppa['mocc'] = wppa_get( 'moccur' ) - '1'; // Will be inc'd back by do_shortcode content
1087
  $wppa_opt['wppa_lazy'] = 'none';
1088
  $result = do_shortcode( $shortcode );
1089
  $result = str_replace( 'href=', 'data-href=', $result );
1102
  break;
1103
 
1104
  case 'bumpviewcount':
1105
+ $nonce = wppa_get( 'nonce' );
1106
  if ( wp_verify_nonce( $nonce, 'wppa-check' ) ) {
1107
+ wppa_bump_viewcount( 'photo', wppa_get( 'wppa-photo' ) );
1108
  }
1109
  else {
1110
  _e( 'Security check failure' , 'wp-photo-album-plus');
1113
  break;
1114
 
1115
  case 'bumpclickcount':
1116
+ $nonce = wppa_get( 'nonce' );
1117
+ $photo = wppa_get( 'photo-id' );
 
1118
  if ( $photo && wp_verify_nonce( $nonce, 'wppa-check' ) ) {
1119
  wppa_bump_clickcount( $photo );
1120
  }
1126
 
1127
  case 'rate':
1128
  // Get commandline args
1129
+ $photo = wppa_get( 'rating-id' );
1130
+ $rating = wppa_get( 'rating' );
1131
+ $occur = wppa_get( 'occur' );
1132
+ $index = wppa_get( 'index' );
1133
+ $nonce = wppa_get( 'nonce' );
 
1134
 
1135
  // Make errortext
1136
  $errtxt = __( 'An error occurred while processing you rating request.' , 'wp-photo-album-plus');
1244
  );
1245
 
1246
  // Do the mailing
1247
+ wppa_schedule_mailinglist( 'commentnotify', 0, $photo, $com, wppa_get( 'returnurl' ) );
1248
  }
1249
  }
1250
 
1514
  break;
1515
 
1516
  case 'delete-photo':
1517
+ $photo = wppa_get( 'photo-id' );
1518
+ $nonce = wppa_get( 'nonce' );
1519
 
1520
  // Check validity
1521
  if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
1546
  break;
1547
 
1548
  case 'undelete-photo':
1549
+ $photo = wppa_get( 'photo-id' );
1550
+ $nonce = wppa_get( 'nonce' );
1551
 
1552
  // Check validity
1553
  if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
1600
  break;
1601
 
1602
  case 'update-album':
1603
+ $album = wppa_get( 'album-id' );
1604
+ $nonce = wppa_get( 'nonce' );
1605
+ $item = wppa_get( 'item' );
1606
+ $value = wppa_get( 'value' );
1607
  $value = wppa_decode( $value );
1608
 
1609
  if ( ! current_user_can( 'unfiltered_html' ) ) {
1952
  break;
1953
 
1954
  case 'update-comment-status':
1955
+ $photo = wppa_get( 'photo-id' );
1956
+ $nonce = wppa_get( 'nonce' );
1957
+ $comid = wppa_get( 'comment-id' );
1958
+ $comstat = wppa_get( 'comment-status' );
1959
 
1960
  // Check validity
1961
  if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
1987
  break;
1988
 
1989
  case 'watermark-photo':
1990
+ $photo = wppa_get( 'photo-id' );
1991
+ $nonce = wppa_get( 'nonce' );
1992
 
1993
  // Check validity
1994
  if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
2014
  /* START UPDATE PHOTO */
2015
 
2016
  case 'update-photo':
2017
+ $photo = wppa_get( 'photo-id' );
2018
+ $nonce = wppa_get( 'nonce' );
2019
+ $item = wppa_get( 'item' );
2020
+ $value = wppa_get( 'value' );
 
2021
  $value = wppa_decode( $value );
2022
 
2023
  if ( ! current_user_can( 'unfiltered_html' ) ) {
2953
 
2954
  // Update iptc
2955
  case 'update-iptc':
2956
+ $photo = wppa_get( 'photo-id' );
2957
+ $nonce = wppa_get( 'nonce' );
2958
+ $item = wppa_get( 'item' );
2959
+ $value = wppa_get( 'value' );
 
2960
  $value = wppa_decode( $value );
2961
+ $tag = wppa_get( 'tagname' );
2962
 
2963
  // Check validity
2964
  if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
2983
  case 'update-option':
2984
 
2985
  // Verify that we are legally here
2986
+ $nonce = wppa_get( 'nonce' );
2987
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
2988
  echo '||1||'.__( 'You do not have the rights to update settings' , 'wp-photo-album-plus');
2989
  wppa_exit(); // Nonce check failed
2990
  }
2991
 
2992
  // Initialize
2993
+ $old_minisize = wppa_get_minisize(); // Remember for later, maybe we do something that requires regen
2994
+ $option = 'wppa_' . wppa_get( 'option' ); // The option to be processed
2995
+ $value = wppa_decode( wppa_get( 'value' ) ); // The new value, may also contain & # and +
2996
  $value = stripslashes( $value );
2997
+ $value = trim( $value ); // Remaove surrounding spaces
2998
  $alert = ''; // Init the return string data
2999
  wppa( 'error', '0' ); //
3000
  $title = ''; //
3051
 
3052
  // Dispatch on option
3053
  if ( $option == 'wppa_getspinnerpreview' ) {
3054
+ if ( wppa_get( 'type' ) == 'normal' ) {
3055
  echo wppa_get_spinner_svg_html( array( 'size' => 60,
3056
  'display' => 'inline',
3057
  'lightbox' => false,
3061
  'margin' => '0',
3062
  ) );
3063
  }
3064
+ elseif ( wppa_get( 'type' ) == 'lightbox' ) {
3065
  echo wppa_get_spinner_svg_html( array( 'size' => 60,
3066
  'display' => 'inline',
3067
  'lightbox' => true,
3910
  case 'maintenance':
3911
 
3912
  // Get args
3913
+ $slug = wppa_get( 'slug' );
3914
+ $nonce = wppa_get( 'wppa-nonce' );
3915
+ $cron = wppa_get( 'cron' );
3916
 
3917
  // Security check
3918
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
3937
  break;
3938
 
3939
  case 'maintenancepopup':
3940
+ $slug = wppa_get( 'slug' );
3941
+ $nonce = wppa_get( 'nonce' );
3942
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
3943
  echo 'Security check failure||'.$slug.'||Error||0';
3944
  wppa_exit();
3948
  break;
3949
 
3950
  case 'do-fe-upload':
3951
+ require_once 'wppa-non-admin.php';
3952
+
 
3953
  wppa_user_upload();
3954
  echo wppa( 'out' );
3955
  global $wppa_upload_succes_id;
3956
+ if ( ( wppa_get( 'fromtinymce' ) || wppa_get( 'fromgutenberg' ) ) && $wppa_upload_succes_id ) {
3957
  echo '||' . $wppa_upload_succes_id . '||';
3958
  echo htmlentities( wppa_get_myphotos_selection_body_for_tinymce( $wppa_upload_succes_id ) );
3959
  }
3961
  break;
3962
 
3963
  case 'sanitizetags':
3964
+ $tags = wppa_get( 'tags' );
3965
+ $album = wppa_get( 'album' );
3966
  $deftags = ( wppa_is_int( $album ) && $album > '0' ) ? wppa_get_album_item( $album, 'default_tags' ) : '';
3967
  $tags = $deftags ? $tags . ',' . $deftags : $tags;
3968
  echo wppa_sanitize_tags( $tags, false, true );
3970
  break;
3971
 
3972
  case 'destroyalbum':
3973
+ $album = wppa_get( 'album' );
3974
  if ( ! $album ) {
3975
  _e('Missing album id', 'wp-photo-album-plus');
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();
4005
  echo '||1||'.__( 'Security check failure' , 'wp-photo-album-plus' );
4006
  wppa_exit();
4007
  }
4008
+ $table = wppa_get( 'table' );
4009
  $bret = wppa_export_table( $table );
4010
  if ( $bret ) {
4011
  echo '||0||' . WPPA_UPLOAD_URL . '/temp/' . $table . '.csv';
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.05.002
7
  *
8
  */
9
 
@@ -1684,43 +1684,33 @@ global $wppa_revno;
1684
  // 'tab' not set. default, album manage page.
1685
  else {
1686
 
1687
- // if add form has been submitted
1688
- // if (isset($_POST['wppa-na-submit'])) {
1689
- // check_admin_referer( '$wppa_nonce', WPPA_NONCE );
1690
-
1691
- // wppa_add_album();
1692
- // }
1693
-
1694
  // if album deleted
1695
- if (isset($_POST['wppa-del-confirm'])) {
1696
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
1697
 
1698
- $album_owner = $wpdb->get_var($wpdb->prepare("SELECT owner FROM $wpdb->wppa_albums WHERE id = %s", $_POST['wppa-del-id']));
1699
- if ( ( $album_owner == '--- public ---' && ! current_user_can('administrator') ) || ! wppa_have_access($_POST['wppa-del-id']) ) {
1700
  wp_die('You do not have the rights to delete this album');
1701
  }
1702
 
1703
- if ( $_POST['wppa-del-photos'] == 'move' ) {
1704
- $move = strval( intval( $_POST['wppa-move-album'] ) );
1705
  if ( wppa_have_access( $move ) ) {
1706
- wppa_del_album( strval( intval( $_POST['wppa-del-id'] ) ), $move);
1707
  }
1708
  else {
1709
  wppa_error_message(__('Unable to move photos. Album not deleted.', 'wp-photo-album-plus'));
1710
  }
1711
  } else {
1712
- wppa_del_album( strval( intval ( $_POST['wppa-del-id'] ) ) );
1713
  }
1714
  }
1715
 
1716
- // if ( wppa_extended_access() ) {
1717
- if ( isset($_REQUEST['switchto'] ) ) {
1718
- update_option( 'wppa_album_table_'.wppa_get_user(), $_REQUEST['switchto'] );
1719
- }
1720
- $style = wppa_get_option('wppa_album_table_'.wppa_get_user(), 'flat');
1721
- // }
1722
- // else $style = 'flat';
1723
- // The Manage Album page
1724
  ?>
1725
  <div class="wrap">
1726
  <?php wppa_admin_spinner() ?>
@@ -1777,7 +1767,7 @@ global $wppa_revno;
1777
  <?php echo __( 'Filter by', 'wp-photo-album-plus' ) . ': ' .
1778
  '<select onchange="document.location.href=\''.get_admin_url().'admin.php?page=wppa_admin_menu&switchto=flat&filter=\'+this.value" >';
1779
  $opts = $wpdb->get_col( "SELECT slug FROM $wpdb->wppa_index WHERE albums <> '' ORDER BY slug" );
1780
- $f = isset( $_GET['filter'] ) ? $_GET['filter'] : '';
1781
  echo '<option value="" ></option>';
1782
  foreach( $opts as $opt ) {
1783
  echo '<option value="' . $opt . '" ' . ( $f == $opt ? 'selected="selected" ' : '' ) . '>' . $opt . '</value>';
@@ -3136,15 +3126,28 @@ global $wpdb;
3136
  function wppa_main_photo($cur, $covertype) {
3137
  global $wpdb;
3138
 
 
3139
  $a_id = strval( intval( $_REQUEST['edit_id'] ) );
3140
  $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 );
3141
 
 
 
3142
  $title = __( 'The default is set in Basic settings -> Misc -> I -> Item 3', 'wp-photo-album-plus' );
3143
- $output = '
3144
  <select
3145
  name="wppa-main" onchange="wppaAjaxUpdateAlbum('.$a_id.', \'main_photo\', this)"
3146
  title="' . esc_attr( $title ) . '"
3147
- >
 
 
 
 
 
 
 
 
 
 
3148
  <option value="0" ' . ( $cur == '0' ? 'selected="selected"' : '' ) . '>' .
3149
  __( '--- default ---', 'wp-photo-album-plus' ) . '
3150
  </option>
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.0.07.003
7
  *
8
  */
9
 
1684
  // 'tab' not set. default, album manage page.
1685
  else {
1686
 
 
 
 
 
 
 
 
1687
  // if album deleted
1688
+ if ( wppa_get( 'del-confirm' ) ) {
1689
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
1690
 
1691
+ $album_owner = $wpdb->get_var( $wpdb->prepare( "SELECT owner FROM $wpdb->wppa_albums WHERE id = %s", wppa_get( 'del-id' ) ) );
1692
+ if ( ( $album_owner == '--- public ---' && ! current_user_can('administrator') ) || ! wppa_have_access( wppa_get( 'del-id' ) ) ) {
1693
  wp_die('You do not have the rights to delete this album');
1694
  }
1695
 
1696
+ if ( wppa_get( 'del-photos' ) == 'move' ) {
1697
+ $move = wppa_get( 'move-album' );
1698
  if ( wppa_have_access( $move ) ) {
1699
+ wppa_del_album( wppa_get( 'del-id' ), $move );
1700
  }
1701
  else {
1702
  wppa_error_message(__('Unable to move photos. Album not deleted.', 'wp-photo-album-plus'));
1703
  }
1704
  } else {
1705
+ wppa_del_album( wppa_get( 'del-id' ) );
1706
  }
1707
  }
1708
 
1709
+ if ( isset($_REQUEST['switchto'] ) ) {
1710
+ update_option( 'wppa_album_table_'.wppa_get_user(), $_REQUEST['switchto'] );
1711
+ }
1712
+ $style = wppa_get_option('wppa_album_table_'.wppa_get_user(), 'flat');
1713
+
 
 
 
1714
  ?>
1715
  <div class="wrap">
1716
  <?php wppa_admin_spinner() ?>
1767
  <?php echo __( 'Filter by', 'wp-photo-album-plus' ) . ': ' .
1768
  '<select onchange="document.location.href=\''.get_admin_url().'admin.php?page=wppa_admin_menu&switchto=flat&filter=\'+this.value" >';
1769
  $opts = $wpdb->get_col( "SELECT slug FROM $wpdb->wppa_index WHERE albums <> '' ORDER BY slug" );
1770
+ $f = wppa_get( 'filter' );
1771
  echo '<option value="" ></option>';
1772
  foreach( $opts as $opt ) {
1773
  echo '<option value="' . $opt . '" ' . ( $f == $opt ? 'selected="selected" ' : '' ) . '>' . $opt . '</value>';
3126
  function wppa_main_photo($cur, $covertype) {
3127
  global $wpdb;
3128
 
3129
+ $output = '';
3130
  $a_id = strval( intval( $_REQUEST['edit_id'] ) );
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;
3134
+
3135
  $title = __( 'The default is set in Basic settings -> Misc -> I -> Item 3', 'wp-photo-album-plus' );
3136
+ $output .= '
3137
  <select
3138
  name="wppa-main" onchange="wppaAjaxUpdateAlbum('.$a_id.', \'main_photo\', this)"
3139
  title="' . esc_attr( $title ) . '"
3140
+ >';
3141
+
3142
+ if ( ! $cur_in_album ) {
3143
+ $output .= '
3144
+ <option value="' . $cur . '" >' .
3145
+ wppa_get_photo_item( $cur, 'name' ) . ' (' . wppa_get_album_item( wppa_get_photo_item( $cur, 'album' ), 'name' ) . ')' . '
3146
+ </option>
3147
+ ';
3148
+ }
3149
+
3150
+ $output .= '
3151
  <option value="0" ' . ( $cur == '0' ? 'selected="selected"' : '' ) . '>' .
3152
  __( '--- default ---', 'wp-photo-album-plus' ) . '
3153
  </option>
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.06.004
7
  *
8
  */
9
 
@@ -1424,6 +1424,7 @@ function wppa_get_coverphoto_id( $xalb = '' ) {
1424
 
1425
  if ( $save_it ) {
1426
  wppa_update_album( array( 'id' => $xalb, 'main_photo' => $result['0'] ) );
 
1427
  wppa_log( 'obs', 'Cover photo of album ' . $xalb . ' set to ' . $result['0'] );
1428
  }
1429
  return $result['0'];
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 8.0.07.001
7
  *
8
  */
9
 
1424
 
1425
  if ( $save_it ) {
1426
  wppa_update_album( array( 'id' => $xalb, 'main_photo' => $result['0'] ) );
1427
+ wppa_cache_album( 'invalidate', $xalb );
1428
  wppa_log( 'obs', 'Cover photo of album ' . $xalb . ' set to ' . $result['0'] );
1429
  }
1430
  return $result['0'];
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 8.0.06.001
7
  *
8
  */
9
 
@@ -505,11 +505,11 @@ global $wppa_session;
505
  >';
506
 
507
  $current = '';
508
- if ( wppa_get_get( 'catbox' ) ) {
509
- $current = wppa_get_get( 'catbox' );
510
  }
511
- elseif ( wppa_get_post( 'catbox' ) ) {
512
- $current = wppa_get_post( 'catbox' );
513
  }
514
  if ( $current ) {
515
  $current = trim( wppa_sanitize_cats( $current ), ',' );
@@ -533,7 +533,7 @@ global $wppa_session;
533
  for ( $sb = 0; $sb < $selboxes; $sb++ ) {
534
  $opts[$sb] = array_merge( array( '' ), explode( "\n", wppa_opt( 'search_selbox_' . $sb ) ) );
535
  $vals[$sb] = $opts[$sb];
536
- $current = wppa_get_post( 'wppa-searchselbox-' . $sb );
537
 
538
  // Item wrapper
539
  $result .= '
@@ -1430,7 +1430,7 @@ global $wppa_session;
1430
  <input
1431
  type="radio"
1432
  name="wppa-slide"
1433
- value="nil" ' .
1434
  ( $wppa_session['superview'] == 'thumbs' ? 'checked' : '' ) . '
1435
  />' .
1436
  __( 'Thumbnails', 'wp-photo-album-plus') . '
@@ -1743,16 +1743,16 @@ function wppa_get_multitag_html( $nperline = '2', $seltags = '' ) {
1743
  </script>
1744
  ';
1745
 
1746
- $qtag = wppa_get_get( 'tag' );
1747
  $andor = $or_only ? 'or' : 'and'; // default
1748
  if ( strpos( $qtag, ',' ) ) {
1749
- $querystringtags = explode( ',',wppa_get_get( 'tag' ) );
1750
  }
1751
  elseif ( strpos( $qtag, ';' ) ) {
1752
- $querystringtags = explode( ';', wppa_get_get( 'tag' ) );
1753
  $andor = 'or';
1754
  }
1755
- else $querystringtags = wppa_get_get( 'tag' );
1756
 
1757
  if ( $tags ) {
1758
 
@@ -1795,7 +1795,7 @@ function wppa_get_multitag_html( $nperline = '2', $seltags = '' ) {
1795
  class="checkbox"
1796
  name="inverse-' . $mocc . '"
1797
  id="inverse-' . $mocc . '"' .
1798
- ( wppa_get_get( 'inv' ) ? ' checked' : '' ) . '
1799
  />&nbsp;' .
1800
  __( 'Inverse selection', 'wp-photo-album-plus' ) . '
1801
  </td>
@@ -3845,13 +3845,15 @@ function wppa_user_albumedit_html( $alb, $width, $where = '', $mcr = false ) {
3845
  }
3846
  $idx++;
3847
  }
3848
- $result .= '<input' .
3849
- ' type="submit"' .
3850
- ' name="wppa-albumeditsubmit"' .
3851
- ' class="wppa-user-submit"' .
3852
- ' style="margin: 6px 0; float:right; "' .
3853
- ' value="'.__( 'Update album', 'wp-photo-album-plus' ).'"' .
3854
- ' />
 
 
3855
  </form>
3856
  </div>';
3857
  wppa_out( $result );
@@ -3874,8 +3876,8 @@ global $wpdb;
3874
  $mocc = wppa( 'mocc' );
3875
 
3876
  // Find user
3877
- if ( wppa_get_post( 'comname' ) ) wppa( 'comment_user', wppa_get_post( 'comname' ) );
3878
- if ( wppa_get_post( 'comemail' ) ) wppa( 'comment_email', wppa_get_post( 'comemail' ) );
3879
  elseif ( is_user_logged_in() ) {
3880
  $current_user = wp_get_current_user();
3881
  wppa( 'comment_user', $current_user->display_name ); //user_login;
@@ -4170,21 +4172,21 @@ global $wpdb;
4170
  // Prepare the callback url
4171
  $returnurl = wppa_get_permalink();
4172
 
4173
- $album = wppa_get_get( 'album' );
4174
  if ( $album !== false ) $returnurl .= 'wppa-album='.$album.'&';
4175
- $cover = wppa_get_get( 'cover' );
4176
  if ( $cover ) $returnurl .= 'wppa-cover='.$cover.'&';
4177
- $slide = wppa_get_get( 'slide' );
4178
  if ( $slide !== false ) $returnurl .= 'wppa-slide&';
4179
- $occur = wppa_get_get( 'occur' );
4180
  if ( $occur ) $returnurl .= 'wppa-occur='.$occur.'&';
4181
- $lasten = wppa_get_get( 'lasten' );
4182
  if ( $lasten ) $returnurl .= 'wppa-lasten='.$lasten.'&';
4183
- $topten = wppa_get_get( 'topten' );
4184
  if ( $topten ) $returnurl .= 'wppa-topten='.$topten.'&';
4185
- $comten = wppa_get_get( 'comten' );
4186
  if ( $comten ) $returnurl .= 'wppa-comten='.$comten.'&';
4187
- $tag = wppa_get_get( 'tag' );
4188
  if ( $tag ) $returnurl .= 'wppa-tag='.$tag.'&';
4189
 
4190
  $returnurl .= 'wppa-photo='.$id;
@@ -4372,7 +4374,7 @@ global $wpdb;
4372
  type="button"
4373
  name="commentbtn"
4374
  onclick="wppaAjaxComment(' . $mocc . ', /' . wppa_encrypt_photo( $id ) . '/ )"
4375
- value="' . $btn . '"
4376
  style="margin:0 4px 0 0;"
4377
  />
4378
  <img
@@ -5567,8 +5569,8 @@ function wppa_real_calendar_box() {
5567
  // The calendar container
5568
  wppa_container( 'open' );
5569
 
5570
- $year = wppa_get_get( 'calendar-year' );
5571
- $month = wppa_get_get( 'calendar-month' );
5572
  if ( ! $year && ! $month ) {
5573
  $year = wppa( 'year' );
5574
  $month = wppa( 'month' );
@@ -6462,15 +6464,15 @@ global $wppa_lang;
6462
  $al .= '&wppa-size=' . wppa_get_container_width();
6463
  $al .= '&wppa-moccur=' . $mocc;
6464
  $al .= '&wppa-occur=' . wppa( 'occur' );
6465
- if ( wppa_get_get( 'p' ) ) {
6466
- $al .= '&p=' . wppa_get_get( 'p' );
6467
  }
6468
- if ( wppa_get_get( 'page_id' ) ) {
6469
- $al .= '&page_id=' . wppa_get_get( 'page_id' );
6470
  }
6471
  $al .= '&wppa-fromp=' . wppa_get_the_ID();
6472
 
6473
- if ( wppa_get_get( 'lang' ) ) { // If lang in querystring: keep it
6474
  if ( strpos( $al, 'lang=' ) === false ) { // Not yet
6475
  $al .= '&lang=' . $wppa_lang;
6476
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 8.0.07.002
7
  *
8
  */
9
 
505
  >';
506
 
507
  $current = '';
508
+ if ( wppa_get( 'catbox' ) ) {
509
+ $current = wppa_get( 'catbox' );
510
  }
511
+ elseif ( wppa_get( 'catbox' ) ) {
512
+ $current = wppa_get( 'catbox' );
513
  }
514
  if ( $current ) {
515
  $current = trim( wppa_sanitize_cats( $current ), ',' );
533
  for ( $sb = 0; $sb < $selboxes; $sb++ ) {
534
  $opts[$sb] = array_merge( array( '' ), explode( "\n", wppa_opt( 'search_selbox_' . $sb ) ) );
535
  $vals[$sb] = $opts[$sb];
536
+ $current = wppa_get( 'wppa-searchselbox-' . $sb );
537
 
538
  // Item wrapper
539
  $result .= '
1430
  <input
1431
  type="radio"
1432
  name="wppa-slide"
1433
+ value="0" ' .
1434
  ( $wppa_session['superview'] == 'thumbs' ? 'checked' : '' ) . '
1435
  />' .
1436
  __( 'Thumbnails', 'wp-photo-album-plus') . '
1743
  </script>
1744
  ';
1745
 
1746
+ $qtag = wppa_get( 'tag' );
1747
  $andor = $or_only ? 'or' : 'and'; // default
1748
  if ( strpos( $qtag, ',' ) ) {
1749
+ $querystringtags = explode( ',',wppa_get( 'tag' ) );
1750
  }
1751
  elseif ( strpos( $qtag, ';' ) ) {
1752
+ $querystringtags = explode( ';', wppa_get( 'tag' ) );
1753
  $andor = 'or';
1754
  }
1755
+ else $querystringtags = wppa_get( 'tag' );
1756
 
1757
  if ( $tags ) {
1758
 
1795
  class="checkbox"
1796
  name="inverse-' . $mocc . '"
1797
  id="inverse-' . $mocc . '"' .
1798
+ ( wppa_get( 'inv' ) ? ' checked' : '' ) . '
1799
  />&nbsp;' .
1800
  __( 'Inverse selection', 'wp-photo-album-plus' ) . '
1801
  </td>
3845
  }
3846
  $idx++;
3847
  }
3848
+
3849
+ $result .= '
3850
+ <input
3851
+ type="submit"
3852
+ name="wppa-albumeditsubmit"
3853
+ class="wppa-user-submit"
3854
+ style="margin: 6px 0; float:right; "
3855
+ value="' . esc_attr( __( 'Update album', 'wp-photo-album-plus' ) ) . '"
3856
+ />
3857
  </form>
3858
  </div>';
3859
  wppa_out( $result );
3876
  $mocc = wppa( 'mocc' );
3877
 
3878
  // Find user
3879
+ if ( wppa_get( 'comname' ) ) wppa( 'comment_user', wppa_get( 'comname' ) );
3880
+ if ( wppa_get( 'comemail' ) ) wppa( 'comment_email', wppa_get( 'comemail' ) );
3881
  elseif ( is_user_logged_in() ) {
3882
  $current_user = wp_get_current_user();
3883
  wppa( 'comment_user', $current_user->display_name ); //user_login;
4172
  // Prepare the callback url
4173
  $returnurl = wppa_get_permalink();
4174
 
4175
+ $album = wppa_get( 'album' );
4176
  if ( $album !== false ) $returnurl .= 'wppa-album='.$album.'&';
4177
+ $cover = wppa_get( 'cover' );
4178
  if ( $cover ) $returnurl .= 'wppa-cover='.$cover.'&';
4179
+ $slide = wppa_get( 'slide' );
4180
  if ( $slide !== false ) $returnurl .= 'wppa-slide&';
4181
+ $occur = wppa_get( 'occur' );
4182
  if ( $occur ) $returnurl .= 'wppa-occur='.$occur.'&';
4183
+ $lasten = wppa_get( 'lasten' );
4184
  if ( $lasten ) $returnurl .= 'wppa-lasten='.$lasten.'&';
4185
+ $topten = wppa_get( 'topten' );
4186
  if ( $topten ) $returnurl .= 'wppa-topten='.$topten.'&';
4187
+ $comten = wppa_get( 'comten' );
4188
  if ( $comten ) $returnurl .= 'wppa-comten='.$comten.'&';
4189
+ $tag = wppa_get( 'tag' );
4190
  if ( $tag ) $returnurl .= 'wppa-tag='.$tag.'&';
4191
 
4192
  $returnurl .= 'wppa-photo='.$id;
4374
  type="button"
4375
  name="commentbtn"
4376
  onclick="wppaAjaxComment(' . $mocc . ', /' . wppa_encrypt_photo( $id ) . '/ )"
4377
+ value="' . esc_attr( $btn ) . '"
4378
  style="margin:0 4px 0 0;"
4379
  />
4380
  <img
5569
  // The calendar container
5570
  wppa_container( 'open' );
5571
 
5572
+ $year = wppa_get( 'calendar-year' );
5573
+ $month = wppa_get( 'calendar-month' );
5574
  if ( ! $year && ! $month ) {
5575
  $year = wppa( 'year' );
5576
  $month = wppa( 'month' );
6464
  $al .= '&wppa-size=' . wppa_get_container_width();
6465
  $al .= '&wppa-moccur=' . $mocc;
6466
  $al .= '&wppa-occur=' . wppa( 'occur' );
6467
+ if ( wppa_get( 'p' ) ) {
6468
+ $al .= '&p=' . wppa_get( 'p' );
6469
  }
6470
+ if ( wppa_get( 'page_id' ) ) {
6471
+ $al .= '&page_id=' . wppa_get( 'page_id' );
6472
  }
6473
  $al .= '&wppa-fromp=' . wppa_get_the_ID();
6474
 
6475
+ if ( wppa_get( 'lang' ) ) { // If lang in querystring: keep it
6476
  if ( strpos( $al, 'lang=' ) === false ) { // Not yet
6477
  $al .= '&lang=' . $wppa_lang;
6478
  }
wppa-breadcrumb.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for breadcrumbs
6
- * Version 8.0.00.019
7
  *
8
  */
9
 
@@ -484,7 +484,7 @@ global $wppa_session;
484
  if ( wppa( 'start_album' ) ) {
485
  $value .= ' ' . __( 'out of various albums' , 'wp-photo-album-plus');
486
  }
487
- if ( wppa_get_get( 'inv' ) ) {
488
  $value .= ' (' . __( 'Inverted', 'wp-photo-album-plus' ) . ')';
489
  }
490
  $thumbhref = wppa_get_permalink().'wppa-cover=0&amp;wppa-occur='.wppa( 'occur' ).'&amp;wppa-tag='.wppa( 'is_tag' ).'&amp;wppa-album='.wppa( 'start_album' );
@@ -500,7 +500,7 @@ global $wppa_session;
500
  if ( wppa( 'start_album' ) ) {
501
  $value .= ' ' . __( 'out of various albums' , 'wp-photo-album-plus');
502
  }
503
- if ( wppa_get_get( 'inv' ) ) {
504
  $value .= ' (' . __( 'Inverted', 'wp-photo-album-plus' ) . ')';
505
  }
506
  $href = '';
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for breadcrumbs
6
+ * Version 8.0.07.001
7
  *
8
  */
9
 
484
  if ( wppa( 'start_album' ) ) {
485
  $value .= ' ' . __( 'out of various albums' , 'wp-photo-album-plus');
486
  }
487
+ if ( wppa_get( 'inv' ) ) {
488
  $value .= ' (' . __( 'Inverted', 'wp-photo-album-plus' ) . ')';
489
  }
490
  $thumbhref = wppa_get_permalink().'wppa-cover=0&amp;wppa-occur='.wppa( 'occur' ).'&amp;wppa-tag='.wppa( 'is_tag' ).'&amp;wppa-album='.wppa( 'start_album' );
500
  if ( wppa( 'start_album' ) ) {
501
  $value .= ' ' . __( 'out of various albums' , 'wp-photo-album-plus');
502
  }
503
+ if ( wppa_get( 'inv' ) ) {
504
  $value .= ' (' . __( 'Inverted', 'wp-photo-album-plus' ) . ')';
505
  }
506
  $href = '';
wppa-comment-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
- * Version 7.3.03
7
  *
8
  */
9
 
@@ -23,7 +23,7 @@ class WPPA_Comment_table extends WP_List_Table {
23
 
24
  // Set parent defaults
25
  parent::__construct( array(
26
- 'singular' => 'comment',
27
  'plural' => 'comments',
28
  'ajax' => false //does this table support ajax?
29
  ) );
@@ -101,19 +101,14 @@ class WPPA_Comment_table extends WP_List_Table {
101
 
102
  function column_commenttext( $item ) {
103
 
104
- $action =
105
- '<a' .
106
- ' id="href-' . $item['id'] . '"' .
107
- ' style="display:none;"' .
108
- ' href="' .
109
- '?page=' . $_REQUEST['page'] .
110
- '&comment=' . $item['id'] .
111
- '&action=editsingle' .
112
- '&commenttext=' . urlencode( $item['comment'] ) .
113
- '"
114
  >' .
115
- __( 'Update', 'wp-photo-album-plus' ) .
116
- '</a>';
117
 
118
  $actions = array(
119
  'editsingle' => $action,
@@ -134,7 +129,7 @@ class WPPA_Comment_table extends WP_List_Table {
134
 
135
  function column_status( $item ) {
136
 
137
- $p1 = '<a href="?page=' . $_REQUEST['page'] . '&comment=' . $item['id'];
138
  $actions = array(
139
  'approvesingle' => $p1 . '&action=approvesingle" >' . __( 'Approve', 'wp-photo-album-plus' ) . '</a>',
140
  'pendingsingle' => $p1 . '&action=pendingsingle" >' . __( 'Pending', 'wp-photo-album-plus' ) . '</a>',
@@ -224,19 +219,11 @@ class WPPA_Comment_table extends WP_List_Table {
224
  function process_bulk_action() {
225
  global $wpdb;
226
 
227
- // If it is a bulk action, $_GET['comment'] holds an array of record ids
228
- // If it is a single action, $_GET['comment'] holds a single record id.
229
- $id = isset( $_GET['comment'] ) ? $_GET['comment'] : '';
230
- if ( is_array( $id ) ) {
231
- $ids = $id;
232
- }
233
- else {
234
- $ids = (array) $id;
235
- }
236
 
237
  $current_action = $this->current_action();
238
 
239
- if ( $current_action && $id ) {
240
 
241
  // Delete
242
  if ( 'delete' === $current_action || 'deletesingle' === $current_action ) {
@@ -276,8 +263,8 @@ class WPPA_Comment_table extends WP_List_Table {
276
 
277
  // Edit, exists single only
278
  if ( 'editsingle' === $current_action ) {
279
- $commenttext = $_GET['commenttext'];
280
- $id = $_GET['comment'];
281
  $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_comments SET comment = %s WHERE id = %s", $commenttext, $id ) );
282
  }
283
 
@@ -308,9 +295,8 @@ class WPPA_Comment_table extends WP_List_Table {
308
  $filter = '';
309
 
310
  // Moderate single only?
311
- $moderating = isset( $_REQUEST['commentid'] );
312
- if ( $moderating ) {
313
- $filter = "WHERE id = " . strval( intval( $_REQUEST['commentid'] ) );
314
  }
315
 
316
  // Normal use
@@ -337,10 +323,10 @@ class WPPA_Comment_table extends WP_List_Table {
337
  $data = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_comments " . $filter . " ORDER BY timestamp DESC", ARRAY_A );
338
 
339
  function usort_reorder( $a, $b ) {
340
- $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'timestamp'; //If no sort, default to title
341
- $order = ( ! empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'desc'; //If no order, default to asc
342
- $result = strcmp( $a[$orderby], $b[$orderby] ); //Determine sort order
343
- return ( $order === 'asc' ) ? $result : -$result; //Send final sort direction to usort
344
  }
345
  usort( $data, 'usort_reorder' );
346
 
@@ -371,7 +357,7 @@ function _wppa_comment_admin() {
371
  $testListTable->prepare_items();
372
 
373
  // Moderate single only?
374
- $moderating = isset( $_REQUEST['commentid'] );
375
 
376
  // Open page
377
  echo
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
+ * Version 8.0.07.001
7
  *
8
  */
9
 
23
 
24
  // Set parent defaults
25
  parent::__construct( array(
26
+ 'singular' => 'commentids',
27
  'plural' => 'comments',
28
  'ajax' => false //does this table support ajax?
29
  ) );
101
 
102
  function column_commenttext( $item ) {
103
 
104
+ $action = '
105
+ <a
106
+ id="href-' . $item['id'] . '"
107
+ style="display:none;"
108
+ href="?page=wppa_manage_comments&commentids=' . $item['id'] . '&action=editsingle&commenttext=' . urlencode( $item['comment'] ) . '"
 
 
 
 
 
109
  >' .
110
+ __( 'Update', 'wp-photo-album-plus' ) . '
111
+ </a>';
112
 
113
  $actions = array(
114
  'editsingle' => $action,
129
 
130
  function column_status( $item ) {
131
 
132
+ $p1 = '<a href="?page=wppa_manage_comments&commentids=' . $item['id'];
133
  $actions = array(
134
  'approvesingle' => $p1 . '&action=approvesingle" >' . __( 'Approve', 'wp-photo-album-plus' ) . '</a>',
135
  'pendingsingle' => $p1 . '&action=pendingsingle" >' . __( 'Pending', 'wp-photo-album-plus' ) . '</a>',
219
  function process_bulk_action() {
220
  global $wpdb;
221
 
222
+ $ids = (array) wppa_get( 'commentids' );
 
 
 
 
 
 
 
 
223
 
224
  $current_action = $this->current_action();
225
 
226
+ if ( $current_action && $ids ) {
227
 
228
  // Delete
229
  if ( 'delete' === $current_action || 'deletesingle' === $current_action ) {
263
 
264
  // Edit, exists single only
265
  if ( 'editsingle' === $current_action ) {
266
+ $commenttext = wppa_get( 'commenttext' );
267
+ $id = wppa_get( 'commentids' );
268
  $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_comments SET comment = %s WHERE id = %s", $commenttext, $id ) );
269
  }
270
 
295
  $filter = '';
296
 
297
  // Moderate single only?
298
+ if ( wppa_get( 'commentid' ) ) {
299
+ $filter = "WHERE id = " . wppa_get( 'commentid' );
 
300
  }
301
 
302
  // Normal use
323
  $data = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_comments " . $filter . " ORDER BY timestamp DESC", ARRAY_A );
324
 
325
  function usort_reorder( $a, $b ) {
326
+ $orderby = wppa_get( 'orderby' ) ? wppa_get( 'orderby' ) : 'timestamp'; // If no sort, default to title
327
+ $order = wppa_get( 'order' ) ? wppa_get( 'order' ) : 'desc'; // If no order, default to asc
328
+ $result = strcmp( $a[$orderby], $b[$orderby] ); // Determine sort order
329
+ return ( $order === 'asc' ) ? $result : -$result; // Send final sort direction to usort
330
  }
331
  usort( $data, 'usort_reorder' );
332
 
357
  $testListTable->prepare_items();
358
 
359
  // Moderate single only?
360
+ $moderating = wppa_get( 'commentid' );
361
 
362
  // Open page
363
  echo
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 8.0.05.001
6
  *
7
  */
8
 
@@ -79,11 +79,9 @@ global $wppa_defaults;
79
  }
80
 
81
  // Remember if debugging is on
82
- if ( isset( $_GET['debug'] ) && wppa_switch( 'allow_debug' ) ) {
83
- $key = $_GET['debug'] ? $_GET['debug'] : E_ALL;
84
- wppa( 'debug', $key );
85
  }
86
-
87
  }
88
 
89
  function wppa_reset_occurrance() {
@@ -113,10 +111,10 @@ global $wppa_current_shortcode_atts;
113
 
114
  // Non wppa ajax? External ajax operation, maybe from pla, called us
115
  if ( defined( 'DOING_AJAX' ) && ! defined( 'DOING_WPPA_AJAX' ) ) {
116
- if ( isset( $_GET['action'] ) && $_GET['action'] == 'pla' ) {
117
  if ( $first_pla ) {
118
- $mocc = $_GET['page'];
119
- $occ = $_GET['page'];
120
  $first_pla = false;
121
  }
122
  }
@@ -124,7 +122,7 @@ global $wppa_current_shortcode_atts;
124
 
125
  // If doing wppa ajax, get occur from query arg
126
  if ( defined( 'DOING_WPPA_AJAX' ) ) {
127
- $m = wppa_get_get( 'occur' );
128
  if ( $m ) {
129
  $mocc = $m;
130
  }
@@ -336,11 +334,11 @@ global $wppa_randseed_modified;
336
  if ( $wppa_randseed_modified ) $renew = false; // Already renewed this pageload
337
  if ( wppa( 'ajax' ) ) $renew = false; // Not during ajax call
338
  if ( strpos( $_SERVER['REQUEST_URI'], 'wp-content' ) !== false ) $renew = false; // Url to a content item needs no renew
339
- if ( isset( $_REQUEST['wppa-page'] ) ) $renew = false; // A subsequent wppa page needs the same sequence
340
  if ( isset( $wppa_session['randseedtime'] ) && $wppa_session['randseedtime'] > ( time() - 10 ) ) $renew = false; // Not within 10 seconds
341
 
342
  // Still renew if the current wp page differs from the last
343
- $wp_page = isset( $_REQUEST['wppa-fromp'] ) ? $_REQUEST['wppa-fromp'] : get_the_ID();
344
  if ( isset( $wppa_session['randpage'] ) && $wp_page && $wp_page != $wppa_session['randpage'] ) {
345
  $renew = true;
346
  }
@@ -351,13 +349,6 @@ global $wppa_randseed_modified;
351
  }
352
  }
353
 
354
- // Log (debug)
355
- if ( false && $type=='' )
356
- wppa_log( 'dbg', 'wppa_get_randseed returned {b}' . $result . '{/b}, ' .
357
- 'type= {b}' . ( $type ? $type : 'default' ) . '{/b}, ' .
358
- 'wp-page= {b}' . ( isset( $wppa_session['randpage'] ) ? $wppa_session['randpage'] : 'unknown' ) . '{/b}, ' .
359
- 'uri= ' . $_SERVER['REQUEST_URI'] );
360
-
361
  // Return the randseed
362
  return $result;
363
  }
@@ -371,7 +362,7 @@ global $wppa_randseed_modified;
371
  $result = time() % 4721;
372
  $wppa_session['randseed'] = $result;
373
  $wppa_session['randseedtime'] = time();
374
- $p = isset( $_REQUEST['wppa-fromp'] ) ? $_REQUEST['wppa-fromp'] : get_the_ID();
375
  if ( $p ) {
376
  $wppa_session['randpage'] = $p;
377
  }
@@ -1001,23 +992,18 @@ global $wppa_session;
1001
  return $str;
1002
  }
1003
 
1004
- if ( isset( $_REQUEST['wppa-searchstring'] ) ) { // wppa+ search
1005
- $str = $_REQUEST['wppa-searchstring'];
1006
  }
1007
- elseif ( isset( $_REQUEST['searchstring'] ) ) { // wppa+ search
1008
- $str = $_REQUEST['searchstring'];
1009
- }
1010
- elseif ( isset( $_REQUEST['s'] ) ) { // wp search
1011
- $str = $_REQUEST['s'];
1012
  }
1013
 
1014
  // Selection boxes present and with a value?
1015
  $t = '';
1016
  for ( $i = 0; $i < 3; $i++ ) {
1017
- if ( isset( $_REQUEST['wppa-searchselbox-' . $i] ) ) {
1018
- if ( $_REQUEST['wppa-searchselbox-' . $i] ) {
1019
- $t .= ' ' . $_REQUEST['wppa-searchselbox-' . $i];
1020
- }
1021
  }
1022
  }
1023
  if ( $t ) {
@@ -1046,7 +1032,7 @@ global $wppa_session;
1046
  $wppa['searchstring'] = $str;
1047
  if ( $wppa['searchstring'] && $wppa['occur'] == wppa_opt( 'search_oc' ) && ! wppa_in_widget() ) $wppa['src'] = true;
1048
  else $wppa['src'] = false;
1049
- if ( isset( $_REQUEST['s'] ) ) {
1050
  $wppa['src'] = true;
1051
  }
1052
  $result = $str;
@@ -1056,7 +1042,7 @@ global $wppa_session;
1056
  }
1057
 
1058
  // If it looks to be a wp search, allow this only when either is_landing, is ajax or is combined search
1059
- if ( $wppa['src'] && isset( $_REQUEST['s'] ) ) {
1060
  if ( ! $wppa['is_landing'] &&
1061
  ! $wppa['ajax'] &&
1062
  ! $wppa['is_combinedsearch']
@@ -1088,11 +1074,11 @@ global $wppa_session;
1088
  }
1089
 
1090
  if ( $wppa['src'] ) {
1091
- if ( wppa_get_get( 'catbox' ) ) {
1092
- $wppa['catbox'] = wppa_get_get( 'catbox' );
1093
  }
1094
- if ( wppa_get_post( 'catbox' ) ) {
1095
- $wppa['catbox'] = wppa_get_post( 'catbox' );
1096
  }
1097
  if ( isset ( $wppa['catbox'] ) ) {
1098
  $wppa['catbox'] = wppa_sanitize_cats( $wppa['catbox'] );
@@ -1172,7 +1158,7 @@ global $cache_path;
1172
  wppa_do_clear_cache();
1173
  }
1174
  else {
1175
- wppa_schedule_clear_cache();
1176
  }
1177
  return;
1178
  }
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 8.0.07.002
6
  *
7
  */
8
 
79
  }
80
 
81
  // Remember if debugging is on
82
+ if ( wppa_get( 'debug' ) && wppa_switch( 'allow_debug' ) ) {
83
+ wppa( 'debug', E_ALL );
 
84
  }
 
85
  }
86
 
87
  function wppa_reset_occurrance() {
111
 
112
  // Non wppa ajax? External ajax operation, maybe from pla, called us
113
  if ( defined( 'DOING_AJAX' ) && ! defined( 'DOING_WPPA_AJAX' ) ) {
114
+ if ( wppa_get( 'action' ) == 'pla' ) {
115
  if ( $first_pla ) {
116
+ $mocc = wppa_get( 'page' );
117
+ $occ = $mocc;
118
  $first_pla = false;
119
  }
120
  }
122
 
123
  // If doing wppa ajax, get occur from query arg
124
  if ( defined( 'DOING_WPPA_AJAX' ) ) {
125
+ $m = wppa_get( 'occur' );
126
  if ( $m ) {
127
  $mocc = $m;
128
  }
334
  if ( $wppa_randseed_modified ) $renew = false; // Already renewed this pageload
335
  if ( wppa( 'ajax' ) ) $renew = false; // Not during ajax call
336
  if ( strpos( $_SERVER['REQUEST_URI'], 'wp-content' ) !== false ) $renew = false; // Url to a content item needs no renew
337
+ if ( wppa_get( 'page' ) ) $renew = false; // A subsequent wppa page needs the same sequence
338
  if ( isset( $wppa_session['randseedtime'] ) && $wppa_session['randseedtime'] > ( time() - 10 ) ) $renew = false; // Not within 10 seconds
339
 
340
  // Still renew if the current wp page differs from the last
341
+ $wp_page = wppa_get( 'fromp' ) ? wppa_get( 'fromp' ) : get_the_ID();
342
  if ( isset( $wppa_session['randpage'] ) && $wp_page && $wp_page != $wppa_session['randpage'] ) {
343
  $renew = true;
344
  }
349
  }
350
  }
351
 
 
 
 
 
 
 
 
352
  // Return the randseed
353
  return $result;
354
  }
362
  $result = time() % 4721;
363
  $wppa_session['randseed'] = $result;
364
  $wppa_session['randseedtime'] = time();
365
+ $p = wppa_get( 'fromp' ) ? wppa_get( 'fromp' ) : get_the_ID();
366
  if ( $p ) {
367
  $wppa_session['randpage'] = $p;
368
  }
992
  return $str;
993
  }
994
 
995
+ if ( wppa_get( 'searchstring' ) ) { // wppa+ search
996
+ $str = wppa_get( 'searchstring' );
997
  }
998
+ elseif ( wppa_get( 's' ) ) { // wp search
999
+ $str = wppa_get( 's' );
 
 
 
1000
  }
1001
 
1002
  // Selection boxes present and with a value?
1003
  $t = '';
1004
  for ( $i = 0; $i < 3; $i++ ) {
1005
+ if ( wppa_get( 'searchselbox-' . $i ) ) {
1006
+ $t .= ' ' . wppa_get( 'searchselbox-' . $i );
 
 
1007
  }
1008
  }
1009
  if ( $t ) {
1032
  $wppa['searchstring'] = $str;
1033
  if ( $wppa['searchstring'] && $wppa['occur'] == wppa_opt( 'search_oc' ) && ! wppa_in_widget() ) $wppa['src'] = true;
1034
  else $wppa['src'] = false;
1035
+ if ( wppa_get( 's' ) ) {
1036
  $wppa['src'] = true;
1037
  }
1038
  $result = $str;
1042
  }
1043
 
1044
  // If it looks to be a wp search, allow this only when either is_landing, is ajax or is combined search
1045
+ if ( $wppa['src'] && wppa_get( 's' ) ) {
1046
  if ( ! $wppa['is_landing'] &&
1047
  ! $wppa['ajax'] &&
1048
  ! $wppa['is_combinedsearch']
1074
  }
1075
 
1076
  if ( $wppa['src'] ) {
1077
+ if ( wppa_get( 'catbox' ) ) {
1078
+ $wppa['catbox'] = wppa_get( 'catbox' );
1079
  }
1080
+ if ( wppa_get( 'catbox' ) ) {
1081
+ $wppa['catbox'] = wppa_get( 'catbox' );
1082
  }
1083
  if ( isset ( $wppa['catbox'] ) ) {
1084
  $wppa['catbox'] = wppa_sanitize_cats( $wppa['catbox'] );
1158
  wppa_do_clear_cache();
1159
  }
1160
  else {
1161
+ wppa_schedule_clear_cache( 10, 'wppa_clear_cache()' );
1162
  }
1163
  return;
1164
  }
wppa-cron.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
- * Version 8.0.04.004
7
  *
8
  *
9
  */
@@ -11,9 +11,9 @@
11
  // Are we in a cron job?
12
  function wppa_is_cron() {
13
 
14
- if ( isset( $_GET['doing_wp_cron'] ) ) {
15
- return $_GET['doing_wp_cron'];
16
- }
17
  if ( defined( 'DOING_CRON' ) ) {
18
  return DOING_CRON;
19
  }
@@ -385,7 +385,7 @@ global $wppa_endtime;
385
  // Selectively clear caches
386
  add_action( 'wppa_clear_cache', 'wppa_do_clear_cache' );
387
 
388
- function wppa_schedule_clear_cache( $time = 10 ) {
389
 
390
  // Are we temp disbled?
391
  if ( wppa_switch( 'maint_ignore_cron' ) ) {
@@ -397,7 +397,7 @@ function wppa_schedule_clear_cache( $time = 10 ) {
397
 
398
  wp_schedule_single_event( time() + $time, 'wppa_clear_cache' );
399
 
400
- wppa_log( 'Cron', '{b}wppa_clear_cache{/b} scheduled for run in ' . $time . ' sec.' );
401
  }
402
  }
403
 
@@ -510,7 +510,7 @@ global $wpdb;
510
 
511
  wppa_log( 'Cron', '{b}wppa_update_treecounts{/b} completed.' );
512
 
513
- wppa_schedule_clear_cache( 600 );
514
  }
515
 
516
  function wppa_re_animate_cron() {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
+ * Version 8.0.07.002
7
  *
8
  *
9
  */
11
  // Are we in a cron job?
12
  function wppa_is_cron() {
13
 
14
+ // if ( isset( $_GET['doing_wp_cron'] ) ) {
15
+ // return $_GET['doing_wp_cron'];
16
+ // }
17
  if ( defined( 'DOING_CRON' ) ) {
18
  return DOING_CRON;
19
  }
385
  // Selectively clear caches
386
  add_action( 'wppa_clear_cache', 'wppa_do_clear_cache' );
387
 
388
+ function wppa_schedule_clear_cache( $time = 10, $from = '' ) {
389
 
390
  // Are we temp disbled?
391
  if ( wppa_switch( 'maint_ignore_cron' ) ) {
397
 
398
  wp_schedule_single_event( time() + $time, 'wppa_clear_cache' );
399
 
400
+ wppa_log( 'Cron', '{b}wppa_clear_cache{/b} scheduled for run in ' . $time . ' sec.' . ( $from ? ' from ' . $from : '' ) );
401
  }
402
  }
403
 
510
 
511
  wppa_log( 'Cron', '{b}wppa_update_treecounts{/b} completed.' );
512
 
513
+ wppa_schedule_clear_cache( 600, 'wppa_do_update_treecounts()' );
514
  }
515
 
516
  function wppa_re_animate_cron() {
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version 8.0.05.001
7
  *
8
  */
9
 
@@ -137,7 +137,7 @@ global $wppa_current_shortcode_atts;
137
  'album' => '',
138
  'photo' => '',
139
  'photos' => '',
140
- 'size' => '',
141
  'align' => '',
142
  'taglist' => '',
143
  'cols' => '',
@@ -524,8 +524,13 @@ global $wppa_current_shortcode_atts;
524
 
525
  // Count (internally to wppa_albums)
526
 
527
- // Find size
528
- if ( $atts['size'] && is_numeric( $atts['size'] ) && $atts['size'] < 1.0 ) {
 
 
 
 
 
529
  $wppa['auto_colwidth'] = true;
530
  $wppa['fullsize'] = $atts['size'];
531
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 8.0.07.003
7
  *
8
  */
9
 
137
  'album' => '',
138
  'photo' => '',
139
  'photos' => '',
140
+ 'size' => 'auto',
141
  'align' => '',
142
  'taglist' => '',
143
  'cols' => '',
524
 
525
  // Count (internally to wppa_albums)
526
 
527
+ // Find size. Assume default responsive
528
+ if ( $atts['size'] == 'auto' ) {
529
+ $wppa['auto_colwidth'] = true;
530
+ $wppa['fullsize'] = '';
531
+ $wppa['max_width'] = '';
532
+ }
533
+ elseif ( $atts['size'] && is_numeric( $atts['size'] ) && $atts['size'] < 1.0 ) {
534
  $wppa['auto_colwidth'] = true;
535
  $wppa['fullsize'] = $atts['size'];
536
  }
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 8.0.06.004
7
  *
8
  */
9
 
@@ -23,14 +23,9 @@ global $locale;
23
  global $wppa_current_shortcode;
24
  global $wppa_current_shortcode_atts;
25
 
 
26
  wppa_occur_timer( 'init' );
27
 
28
- // Diagnostics
29
- wppa_dbg_msg( 'Entering wppa_albums' );
30
- wppa_dbg_msg( 'Lang=' . $wppa_lang . ', Locale=' . $wppa_locale . ', Ajax=' . wppa( 'ajax' ) . ', wp locale=' . $locale );
31
- wppa_dbg_msg( 'Get=' . serialize($_GET) );
32
- wppa_dbg_msg( 'Post=' . serialize($_POST) );
33
-
34
  // Process a user upload request, if any. Do it here: it may affect this occurences display
35
  wppa_user_upload();
36
 
@@ -40,29 +35,26 @@ global $wppa_current_shortcode_atts;
40
  // First calculate the occurance
41
  if ( wppa( 'ajax' ) ) {
42
 
43
- if ( wppa_get_get( 'occur' ) ) {
44
- wppa( 'mocc', wppa_get_get( 'occur' ) );
45
- if ( ! is_numeric( wppa( 'mocc' ) ) ) wp_die( 'Security check failure 1' );
46
  }
47
  else {
48
- wppa_bump_mocc(); //wppa( 'mocc', '1' );
49
  }
50
 
51
- wppa( 'fullsize', wppa_get_get( 'wppa-size', wppa_get_container_width() ) );
52
 
53
- if ( wppa_get_get( 'occur' ) ) {
54
- wppa( 'occur', wppa_get_get( 'occur' ) );
55
- if ( ! is_numeric( wppa( 'occur' ) ) ) wp_die( 'Security check failure 2' );
56
  }
57
 
58
- if ( wppa_get_get( 'woccur' ) ) {
59
- wppa( 'widget_occur', wppa_get_get( 'woccur' ) );
60
  wppa( 'in_widget', true );
61
- if ( ! is_numeric( wppa( 'widget_occur' ) ) ) wp_die( 'Security check failure 3' );
62
  }
63
  }
64
  else {
65
- wppa_bump_mocc(); //wppa( 'mocc', wppa( 'mocc' ) + '1' );
66
  if ( wppa_in_widget() ) {
67
  wppa( 'widget_occur', wppa( 'widget_occur' ) + '1' );
68
  }
@@ -90,59 +82,56 @@ global $wppa_current_shortcode_atts;
90
  // in order of priority:
91
  // 1. The given query string applies to this invocation ( occurrance )
92
  // This invocation requires the ignorance of the filter results and the interpretation of the querystring.
93
- if ( ( ( wppa_get_get( 'occur' ) || wppa_get_get( 'woccur' ) ) && // There IS a query string. For bw compat, occur is required ...
94
- ( ( wppa_in_widget() && wppa( 'widget_occur' ) == wppa_get_get( 'woccur' ) ) || // and it applies to ...
95
- ( ! wppa_in_widget() && wppa( 'occur' ) == wppa_get_get( 'occur' ) ) ) // this occurrance
96
  ) && ! wppa( 'is_autopage' ) ) {
97
 
98
  // Process query string
99
  wppa_out( wppa_dbg_msg( 'Querystring applied', 'brown', false, true ) );
100
 
101
  // Test validity of album arg
102
- wppa( 'start_album', wppa_get_get( 'album' ) );
103
 
104
- // Decode photo enumeration
105
- if ( wppa_get_get( 'photos' ) ) {
106
- wppa( 'start_photos', wppa_decrypt_photo( wppa_get_get( 'photos' ) ) );
107
- }
108
 
109
- wppa( 'is_cover', wppa_get_get( 'cover' ) );
110
 
111
- wppa( 'is_slide', wppa_get_get( 'slide' ) || ( wppa_get_get( 'album' ) !== false && ( wppa_get_get( 'photo' ) || wppa_get_get( 'photos' ) ) ) );
112
 
113
- if ( wppa_get_get( 'slideonly' ) ) {
114
  wppa( 'is_slide', true );
115
  wppa( 'is_slideonly', true );
116
  }
117
- if ( wppa_get_get( 'filmonly' ) ) {
118
  wppa( 'is_slide', true );
119
  wppa( 'is_filmonly', true );
120
  wppa( 'is_slideonly', true );
121
  wppa( 'film_on', true );
122
  }
123
  if ( wppa( 'is_slide' ) ) {
124
- wppa( 'start_photo', wppa_get_get( 'photo' ) ); // Start a slideshow here
125
-
126
  wppa( 'is_grid', false );
127
  }
128
  else {
129
- wppa( 'single_photo', wppa_get_get( 'photo' ) ); // Photo is the single photoid
130
  }
131
- wppa( 'is_single', wppa_get_get( 'single' ) ); // Is a one image slideshow
132
- wppa( 'topten_count', wppa_force_numeric_else( wppa_get_get( 'topten' ), wppa_opt( 'topten_count' ) ) );
133
  wppa( 'is_topten', wppa( 'topten_count' ) != '0' );
134
- wppa( 'lasten_count', wppa_force_numeric_else( wppa_get_get( 'lasten' ), wppa_opt( 'lasten_count' ) ) );
135
  wppa( 'is_lasten', wppa( 'lasten_count' ) != '0' );
136
- wppa( 'comten_count', wppa_force_numeric_else( wppa_get_get( 'comten' ), wppa_opt( 'comten_count' ) ) );
137
  wppa( 'is_comten', wppa( 'comten_count' ) != '0' );
138
- wppa( 'featen_count', wppa_force_numeric_else( wppa_get_get( 'featen' ), wppa_opt( 'featen_count' ) ) );
139
  wppa( 'is_featen', wppa( 'featen_count' ) != '0' );
140
- wppa( 'albums_only', wppa_get_get( 'albums-only' ) );
141
- wppa( 'photos_only', wppa_get_get( 'photos-only' ) );
142
- wppa( 'medals_only', wppa_get_get( 'medals-only' ) );
143
- wppa( 'related_count', wppa_force_numeric_else( wppa_get_get( 'relcount' ), wppa_opt( 'related_count' ) ) );
144
- wppa( 'is_related', wppa_get_get( 'rel' ) );
145
- wppa( 'is_potdhis', wppa_get_get( 'potdhis' ) );
146
 
147
  if ( wppa( 'is_related' ) == 'tags' ) {
148
  wppa( 'is_tag', wppa_get_related_data() );
@@ -151,7 +140,7 @@ global $wppa_current_shortcode_atts;
151
  }
152
  }
153
  else {
154
- wppa( 'is_tag', trim( strip_tags( wppa_get_get( 'tag' ) ), ',;' ) );
155
  }
156
 
157
  if ( wppa( 'is_related' ) == 'desc' ) {
@@ -163,17 +152,17 @@ global $wppa_current_shortcode_atts;
163
 
164
  if ( wppa( 'is_tag' ) ) wppa_dbg_msg( 'Is Tag: ' . wppa( 'is_tag' ) );
165
  else wppa_dbg_msg( 'Is NOT Tag' );
166
- wppa( 'page', wppa_get_get( 'page' ) );
167
 
168
- if ( wppa_get_get( 'superview' ) ) {
169
  $wppa_session['superview'] = wppa( 'is_slide' ) ? 'slide': 'thumbs';
170
  $wppa_session['superalbum'] = wppa( 'start_album' );
171
  wppa( 'photos_only', true );
172
  }
173
- wppa( 'is_upldr', wppa_get_get( 'upldr' ) );
174
 
175
  if ( wppa( 'is_upldr' ) ) wppa( 'photos_only', true );
176
- wppa( 'is_owner', wppa_get_get( 'owner' ) );
177
 
178
  if ( wppa( 'is_owner' ) ) {
179
  $albs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_albums
@@ -186,7 +175,7 @@ global $wppa_current_shortcode_atts;
186
  $id = rtrim( $id, '.' );
187
  wppa( 'start_album', $id );
188
  }
189
- wppa( 'supersearch', strip_tags( wppa_get_get( 'supersearch' ) ) );
190
  $wppa_session['supersearch'] = wppa( 'supersearch' );
191
 
192
  if ( wppa( 'supersearch' ) ) {
@@ -198,15 +187,15 @@ global $wppa_current_shortcode_atts;
198
  wppa( 'photos_only', true );
199
  }
200
  }
201
- wppa( 'calendar', strip_tags( wppa_get_get( 'calendar' ) ) );
202
 
203
  // New style calendar and ajax: set is_calendar
204
- if ( substr( wppa_get_get( 'calendar' ), 0, 4 ) == 'real' ) {
205
- wppa( 'calendar', wppa_get_get( 'calendar' ) );
206
  wppa( 'is_calendar', true );
207
  }
208
- wppa( 'caldate', strip_tags( wppa_get_get( 'caldate' ) ) );
209
- wppa( 'is_inverse', wppa_get_get( 'inv' ) );
210
 
211
  }
212
 
@@ -837,39 +826,37 @@ global $wppa_current_shortcode_atts;
837
  if ( wppa( 'occur' ) == wppa_opt( 'search_oc' ) &&
838
  ! wppa( 'in_widget' ) &&
839
  ( ( isset( $wppa_session['has_searchbox'] ) && $wppa_session['has_searchbox'] ) ||
840
- isset( $_REQUEST['wppa-forceroot'] )
841
  ) ) {
842
 
843
  // Is it a search now?
844
  if ( wppa( 'src' ) ) {
845
 
846
  // Is the subsearch box checked?
847
- wppa( 'is_subsearch', wppa_get_get( 'subsearch' ) || wppa_get_post( 'subsearch' ) );
848
 
849
  // Is the rootsearch box checked?
850
- wppa( 'is_rootsearch', wppa_get_get( 'rootsearch' ) || wppa_get_post( 'rootsearch' ) );
851
 
852
  // Is it even a forced root search?
853
- if ( isset( $_REQUEST['wppa-forceroot'] ) ) {
854
- $wppa_session['search_root'] = strval( intval( $_REQUEST['wppa-forceroot'] ) );
855
  wppa( 'is_rootsearch', true );
856
- wppa( 'start_album', strval( intval( $_REQUEST['wppa-forceroot'] ) ) );
857
  }
858
 
859
  // No rootsearch, forget previous root
860
  if ( ! wppa( 'is_rootsearch' ) ) {
861
  $wppa_session['search_root'] = '0';
862
  }
863
-
864
- wppa_dbg_msg( 'Forceroot='.(isset( $_REQUEST['wppa-forceroot'] )?$_REQUEST['wppa-forceroot']:'none').', is_rootsearch='.wppa('is_rootsearch').', start_album='.wppa('start_album'), 'red');
865
  }
866
 
867
  // It is not a search now
868
  else {
869
 
870
  // Find new potential searchroot
871
- if ( isset( $_REQUEST['wppa-searchroot'] ) ) {
872
- wppa( 'start_album', strval( intval( $_REQUEST['wppa-searchroot'] ) ) );
873
  }
874
 
875
  // Update session with new searchroot
@@ -1079,10 +1066,10 @@ global $wpdb;
1079
  function wppa_page( $page ) {
1080
 
1081
  if ( wppa_in_widget() ) {
1082
- $occur = wppa_get_get( 'woccur' );
1083
  }
1084
  else {
1085
- $occur = wppa_get_get( 'occur' );
1086
  }
1087
 
1088
  $ref_occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' );
@@ -2638,13 +2625,13 @@ static $user;
2638
  $alb = $thumb['album'];
2639
 
2640
  if ( ! $user ) $user = wppa_get_user( 'display' );
2641
- $photo = wppa_get_get( 'photo' );
2642
- $ratingphoto = wppa_get_get( 'rating-id' );
2643
 
2644
  if ( ! $callbackid ) $callbackid = $id;
2645
 
2646
  // Process a comment if given for this photo
2647
- $comment_request = ( wppa_get_post( 'commentbtn' ) && ( $id == $photo ) );
2648
  $comment_allowed = ! wppa_user_is_basic() && ( ! wppa_switch( 'comment_login' ) || is_user_logged_in() );
2649
  if ( wppa_switch( 'show_comments' ) && $comment_request && $comment_allowed ) {
2650
  wppa_do_comment( $id );
@@ -3072,30 +3059,47 @@ function wppa_get_distext( $discount, $myrat ) {
3072
  function wppa_do_comment( $id ) {
3073
  global $wpdb;
3074
  global $wppa_done;
3075
- //global $wppa_alert;
3076
 
 
3077
  if ( $wppa_done ) return; // Prevent multiple
3078
  $wppa_done = true;
3079
 
 
3080
  $time = time();
3081
 
3082
- $photo = isset( $_REQUEST['photo'] ) ? $_REQUEST['photo'] : '0';
3083
- if ( ! $photo ) $photo = isset( $_REQUEST['photo-id'] ) ? $_REQUEST['photo-id'] : '0';
3084
- $photo = wppa_decrypt_photo( $photo );
 
 
3085
  if ( ! $photo ) die( 'Photo id missing while processing a comment' );
3086
 
3087
- $user = isset( $_REQUEST['comname'] ) ? $_REQUEST['comname'] : 'Anonymus';
3088
- $user = htmlspecialchars( $user ); //sanitize_user( $user );
 
 
 
3089
  if ( ! $user ) die( 'Illegal attempt to enter a comment 1' );
3090
- $email = sanitize_email( wppa_get_post( 'comemail' ) );
3091
 
 
 
 
 
3092
  if ( ! $email ) {
3093
- if ( wppa_opt( 'comment_email_required' ) == 'required' ) die( 'Illegal attempt to enter a comment 2' );
3094
- else $email = wppa_get_user(); // If email not present and not required, use his IP
 
 
 
 
 
 
 
 
3095
  }
3096
 
3097
  // Retrieve and filter comment
3098
- $comment = isset( $_REQUEST['comment'] ) ? $_REQUEST['comment'] : '';
3099
  $comment = trim( $comment );
3100
  $comment = wppa_decode( $comment );
3101
  if ( ! current_user_can( 'unfiltered_html' ) ) {
@@ -3149,7 +3153,7 @@ global $wppa_done;
3149
  }
3150
 
3151
  // Editing a comment?
3152
- $cedit = wppa_get_post( 'comment-edit', '0' );
3153
  if ( ! wppa_is_int( $cedit ) ) wp_die( 'Security check falure 14' );
3154
 
3155
  // Check captcha
@@ -3263,10 +3267,10 @@ global $wppa_done;
3263
 
3264
  // SEND EMAILS
3265
  if ( $status == 'pending' ) {
3266
- wppa_schedule_mailinglist( 'moderatecomment', 0, $photo, $key, wppa_get_post( 'returnurl' ) );
3267
  }
3268
  if ( $status == 'approved' ) {
3269
- wppa_schedule_mailinglist( 'commentnotify', 0, $photo, $key, wppa_get_post( 'returnurl' ) );
3270
  }
3271
 
3272
  // Process any pending votes of this user for this photo if rating needs comment, do it anyway, feature may have been on but now off
@@ -3311,7 +3315,7 @@ function wppa_make_captcha( $id ) {
3311
 
3312
  // Check the comment security answer
3313
  function wppa_check_captcha( $id ) {
3314
- $answer = wppa_get_post( 'wppa-captcha' );
3315
  $capt = wppa_ll_captcha( $id );
3316
  return $capt['ans'] == $answer;
3317
  }
@@ -3794,16 +3798,16 @@ function wppa_get_container_style() {
3794
 
3795
  function wppa_get_curpage() {
3796
 
3797
- if ( wppa_get_get( 'page' ) ) {
3798
  if ( wppa_in_widget() ) {
3799
- $oc = wppa_get_get( 'woccur' );
3800
  if ( ! $oc ) $oc = '1';
3801
- $curpage = wppa( 'widget_occur' ) == $oc ? wppa_get_get( 'page' ) : '1';
3802
  }
3803
  else {
3804
- $oc = wppa_get_get( 'occur' );
3805
  if ( ! $oc ) $oc = '1';
3806
- $curpage = wppa( 'occur' ) == $oc ? wppa_get_get( 'page' ) : '1';
3807
  }
3808
  }
3809
  else $curpage = '1';
@@ -3887,8 +3891,8 @@ global $blog_id;
3887
 
3888
  // Nonce field check for rating security
3889
  if ( wppa( 'mocc' ) == '1' ) {
3890
- if ( wppa_get_get( 'rating' ) ) {
3891
- $nonce = wppa_get_get( 'nonce' );
3892
  $ok = wp_verify_nonce( $nonce, 'wppa-check' );
3893
  if ( $ok ) {
3894
  wppa_dbg_msg( 'Rating nonce ok' );
@@ -3899,8 +3903,8 @@ global $blog_id;
3899
 
3900
  // Nonce field check for comment security
3901
  if ( wppa( 'mocc' ) == '1' ) {
3902
- if ( wppa_get_post( 'comment' ) ) {
3903
- $nonce = wppa_get_post( 'nonce' );
3904
  $ok = wp_verify_nonce( $nonce, 'wppa-check' );
3905
  if ( $ok ) {
3906
  wppa_dbg_msg( 'Comment nonce ok' );
@@ -3925,11 +3929,12 @@ global $blog_id;
3925
 
3926
  // If size explitely given and not a fraction, it is static size
3927
  if ( wppa_is_int( wppa( 'fullsize' ) ) && wppa( 'fullsize' ) > '1' ) {
 
3928
  $auto = false;
3929
  }
3930
 
3931
  // If an ajax request, the (start)size is given. To prevent loosing responsiveness, look at resp arg
3932
- if ( wppa( 'ajax' ) && isset( $_REQUEST['resp'] ) ) {
3933
  $auto = true;
3934
  }
3935
 
@@ -4071,11 +4076,7 @@ global $blog_id;
4071
  wppa_out( '<div id="wppa-container-' . wppa( 'mocc' ) . '-end" ></div>' );
4072
 
4073
  // Scroll down to container ?
4074
- $do_scroll = wppa_switch( 'non_ajax_scroll' ) &&
4075
- (
4076
- isset( $_GET['wppa-occur'] ) && $_GET['wppa-occur'] == wppa( 'mocc' ) ||
4077
- isset( $_GET['occur'] ) && $_GET['occur'] == wppa( 'mocc' )
4078
- );
4079
 
4080
  if ( $do_scroll ) {
4081
  wppa_out(
@@ -4959,10 +4960,10 @@ global $wppa_upload_succes_id;
4959
 
4960
  // Do create
4961
  if ( $may_create ) {
4962
- if ( wppa_get_post( 'wppa-fe-create' ) ) { // Create album
4963
- $nonce = wppa_get_post( 'nonce' );
4964
- if ( wppa_get_post( 'wppa-album-name' ) ) {
4965
- $albumname = trim( strip_tags( wppa_get_post( 'wppa-album-name' ) ) );
4966
  }
4967
  if ( ! wppa_sanitize_file_name( $albumname ) ) {
4968
  $albumname = __('New Album', 'wp-photo-album-plus');
@@ -4981,12 +4982,12 @@ global $wppa_upload_succes_id;
4981
  }
4982
  }
4983
 
4984
- $parent = strval( intval( wppa_get_post( 'wppa-album-parent' ) ) );
4985
  if ( ! wppa_user_is( 'administrator' ) && wppa_switch( 'default_parent_always' ) ) {
4986
  $parent = wppa_opt( 'default_parent' );
4987
  }
4988
  $album = wppa_create_album_entry( array( 'name' => $albumname,
4989
- 'description' => strip_tags( wppa_get_post( 'wppa-album-desc' ) ),
4990
  'a_parent' => $parent,
4991
  'owner' => wppa_switch( 'frontend_album_public' ) ? '--- public ---' : wppa_get_user()
4992
  ) );
@@ -5008,14 +5009,14 @@ global $wppa_upload_succes_id;
5008
  if ( $may_upload ) {
5009
  $upload_message = '';
5010
  $blogged = false;
5011
- if ( wppa_get_post( 'wppa-upload-album' ) ) { // Upload photo
5012
- $nonce = wppa_get_post( 'nonce' );
5013
  $ok = wp_verify_nonce( $nonce, 'wppa-check' );
5014
  if ( ! $ok ) {
5015
  die( '<b>' . __( 'ERROR: Illegal attempt to upload a file.', 'wp-photo-album-plus') . '</b>');
5016
  }
5017
 
5018
- $alb = wppa_get_post( 'wppa-upload-album' );
5019
  $alb = strval( intval( $alb ) ); // Force numeric
5020
  if ( ! wppa_album_exists( $alb ) ) {
5021
  $alert = esc_js( sprintf( __( 'Album %s does not exist', 'wp-photo-album-plus' ), $alb ) );
@@ -5185,28 +5186,28 @@ global $wppa_upload_succes_id;
5185
  // Do Edit
5186
  if ( $may_edit ) {
5187
 
5188
- if ( wppa_get_post( 'wppa-albumeditsubmit' ) ) {
5189
 
5190
  // Get album id
5191
- $alb = wppa_get_post( 'wppa-albumeditid' );
5192
  if ( ! $alb || ! wppa_album_exists( $alb ) ) {
5193
  die( 'Security check failure' );
5194
  }
5195
 
5196
  // Valid request?
5197
- if ( ! wp_verify_nonce( wppa_get_post( 'wppa-albumeditnonce' ), 'wppa_nonce_'.$alb ) ) {
5198
  die( 'Security check failure' );
5199
  }
5200
 
5201
  // Name
5202
- $name = wppa_get_post( 'wppa-albumeditname' );
5203
  $name = trim( strip_tags( $name ) );
5204
  if ( ! $name ) { // Empty album name is not allowed
5205
  $name = 'Album-#'.$alb;
5206
  }
5207
 
5208
  // Description
5209
- $description = wppa_get_post( 'wppa-albumeditdesc' );
5210
 
5211
 
5212
  // Custom data
@@ -5221,7 +5222,7 @@ global $wppa_upload_succes_id;
5221
  $idx = '0';
5222
  while ( $idx < '10' ) {
5223
  if ( isset( $_POST['custom_' . $idx] ) ) {
5224
- $value = wppa_get_post( 'custom_' . $idx );
5225
  $custom_data[$idx] = wppa_sanitize_custom_field( $value );
5226
  }
5227
  $idx++;
@@ -5299,8 +5300,8 @@ global $wppa_alert;
5299
  $is_av = true;
5300
 
5301
  // Find the name
5302
- if ( wppa_get_post( 'user-name' ) ) {
5303
- $name = wppa_get_post( 'user-name' );
5304
  }
5305
  else {
5306
  $name = $file['name'];
@@ -5317,7 +5318,7 @@ global $wppa_alert;
5317
  // Add new entry
5318
  if ( ! $id ) {
5319
 
5320
- $desc = isset( $_POST['user-desc'] ) ? balanceTags( wppa_get_post( 'user-desc' ), true ) : '';
5321
  if ( ! $desc && wppa_switch( 'apply_newphoto_desc_user' ) ) {
5322
  $desc = wppa_opt( 'newphoto_description' );
5323
  }
@@ -5354,7 +5355,7 @@ global $wppa_alert;
5354
  wppa_fix_video_framesize( $id, 'av_add_front' );
5355
 
5356
  // Repair name if not standard
5357
- if ( ! wppa_get_post( 'user-name' ) ) {
5358
  wppa( 'unsanitized_filename', $file['name'] );
5359
  wppa_set_default_name( $id, $file['name'] );
5360
  }
@@ -5431,8 +5432,8 @@ global $wppa_alert;
5431
  }
5432
 
5433
  // Did the user supply a photoname?
5434
- if ( wppa_get_post( 'user-name' ) ) {
5435
- $name = wppa_get_post( 'user-name' );
5436
  }
5437
  else {
5438
  $name = $file['name'];
@@ -5440,7 +5441,7 @@ global $wppa_alert;
5440
 
5441
  // Sanitize input
5442
  $name = wppa_sanitize_photo_name( $name );
5443
- $desc = balanceTags( wppa_get_post( 'user-desc' ), true );
5444
 
5445
  // If BlogIt! and no descrption given, use name field - this is for the shortcode used: typ"mphoto"
5446
  if ( ! $desc && isset( $_POST['wppa-blogit'] ) ) {
@@ -5480,7 +5481,7 @@ global $wppa_alert;
5480
  if ( wppa_make_the_photo_files( $source_file, $id, $ext, ! wppa_switch( 'watermark_thumbs' ) ) ) {
5481
 
5482
  // Repair photoname if not standard
5483
- if ( ! wppa_get_post( 'user-name' ) ) {
5484
  wppa_set_default_name( $id );
5485
  }
5486
 
@@ -6045,8 +6046,8 @@ global $wppa_lang;
6045
  $cache_file = false;
6046
  $cache_data = false;
6047
 
6048
- if ( wppa_get_get( 'cache' ) ) {
6049
- wppa( 'cache', wppa_get_get( 'cache' ) );
6050
  }
6051
 
6052
  if ( wppa( 'cache' ) ) {
@@ -6057,12 +6058,12 @@ global $wppa_lang;
6057
  }
6058
 
6059
  // Querystring not for this occur?
6060
- elseif ( ! wppa_in_widget() && wppa( 'occur' ) != wppa_get_get( 'occur' ) ) {
6061
  $caching = true;
6062
  }
6063
 
6064
  // Ajax?
6065
- elseif ( wppa_get_get( 'cache' ) ) {
6066
  $caching = true;
6067
  }
6068
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 8.0.07.003
7
  *
8
  */
9
 
23
  global $wppa_current_shortcode;
24
  global $wppa_current_shortcode_atts;
25
 
26
+ // Init timer
27
  wppa_occur_timer( 'init' );
28
 
 
 
 
 
 
 
29
  // Process a user upload request, if any. Do it here: it may affect this occurences display
30
  wppa_user_upload();
31
 
35
  // First calculate the occurance
36
  if ( wppa( 'ajax' ) ) {
37
 
38
+ if ( wppa_get( 'occur' ) ) {
39
+ wppa( 'mocc', wppa_get( 'occur' ) );
 
40
  }
41
  else {
42
+ wppa_bump_mocc();
43
  }
44
 
45
+ // wppa( 'fullsize', wppa_get( 'size', wppa_get_container_width() ) );
46
 
47
+ if ( wppa_get( 'occur' ) ) {
48
+ wppa( 'occur', wppa_get( 'occur' ) );
 
49
  }
50
 
51
+ if ( wppa_get( 'woccur' ) ) {
52
+ wppa( 'widget_occur', wppa_get( 'woccur' ) );
53
  wppa( 'in_widget', true );
 
54
  }
55
  }
56
  else {
57
+ wppa_bump_mocc();
58
  if ( wppa_in_widget() ) {
59
  wppa( 'widget_occur', wppa( 'widget_occur' ) + '1' );
60
  }
82
  // in order of priority:
83
  // 1. The given query string applies to this invocation ( occurrance )
84
  // This invocation requires the ignorance of the filter results and the interpretation of the querystring.
85
+ if ( ( ( wppa_get( 'occur' ) || wppa_get( 'woccur' ) ) && // There IS a query string. For bw compat, occur is required ...
86
+ ( ( wppa_in_widget() && wppa( 'widget_occur' ) == wppa_get( 'woccur' ) ) || // and it applies to ...
87
+ ( ! wppa_in_widget() && wppa( 'occur' ) == wppa_get( 'occur' ) ) ) // this occurrance
88
  ) && ! wppa( 'is_autopage' ) ) {
89
 
90
  // Process query string
91
  wppa_out( wppa_dbg_msg( 'Querystring applied', 'brown', false, true ) );
92
 
93
  // Test validity of album arg
94
+ wppa( 'start_album', wppa_get( 'album' ) );
95
 
96
+ // Save photo enumeration
97
+ wppa( 'start_photos', wppa_get( 'photos' ) );
 
 
98
 
99
+ wppa( 'is_cover', wppa_get( 'cover' ) );
100
 
101
+ wppa( 'is_slide', wppa_get( 'slide' ) || ( wppa_get( 'album' ) !== false && ( wppa_get( 'photo' ) || wppa_get( 'photos' ) ) ) );
102
 
103
+ if ( wppa_get( 'slideonly' ) ) {
104
  wppa( 'is_slide', true );
105
  wppa( 'is_slideonly', true );
106
  }
107
+ if ( wppa_get( 'filmonly' ) ) {
108
  wppa( 'is_slide', true );
109
  wppa( 'is_filmonly', true );
110
  wppa( 'is_slideonly', true );
111
  wppa( 'film_on', true );
112
  }
113
  if ( wppa( 'is_slide' ) ) {
114
+ wppa( 'start_photo', wppa_get( 'photo' ) ); // Start a slideshow here
 
115
  wppa( 'is_grid', false );
116
  }
117
  else {
118
+ wppa( 'single_photo', wppa_get( 'photo' ) ); // Photo is the single photoid
119
  }
120
+ wppa( 'is_single', wppa_get( 'single' ) ); // Is a one image slideshow
121
+ wppa( 'topten_count', wppa_force_numeric_else( wppa_get( 'topten' ), wppa_opt( 'topten_count' ) ) );
122
  wppa( 'is_topten', wppa( 'topten_count' ) != '0' );
123
+ wppa( 'lasten_count', wppa_force_numeric_else( wppa_get( 'lasten' ), wppa_opt( 'lasten_count' ) ) );
124
  wppa( 'is_lasten', wppa( 'lasten_count' ) != '0' );
125
+ wppa( 'comten_count', wppa_force_numeric_else( wppa_get( 'comten' ), wppa_opt( 'comten_count' ) ) );
126
  wppa( 'is_comten', wppa( 'comten_count' ) != '0' );
127
+ wppa( 'featen_count', wppa_force_numeric_else( wppa_get( 'featen' ), wppa_opt( 'featen_count' ) ) );
128
  wppa( 'is_featen', wppa( 'featen_count' ) != '0' );
129
+ wppa( 'albums_only', wppa_get( 'albums-only' ) );
130
+ wppa( 'photos_only', wppa_get( 'photos-only' ) );
131
+ wppa( 'medals_only', wppa_get( 'medals-only' ) );
132
+ wppa( 'related_count', wppa_force_numeric_else( wppa_get( 'relcount' ), wppa_opt( 'related_count' ) ) );
133
+ wppa( 'is_related', wppa_get( 'rel' ) );
134
+ wppa( 'is_potdhis', wppa_get( 'potdhis' ) );
135
 
136
  if ( wppa( 'is_related' ) == 'tags' ) {
137
  wppa( 'is_tag', wppa_get_related_data() );
140
  }
141
  }
142
  else {
143
+ wppa( 'is_tag', trim( strip_tags( wppa_get( 'tag' ) ), ',;' ) );
144
  }
145
 
146
  if ( wppa( 'is_related' ) == 'desc' ) {
152
 
153
  if ( wppa( 'is_tag' ) ) wppa_dbg_msg( 'Is Tag: ' . wppa( 'is_tag' ) );
154
  else wppa_dbg_msg( 'Is NOT Tag' );
155
+ wppa( 'page', wppa_get( 'page' ) );
156
 
157
+ if ( wppa_get( 'superview' ) ) {
158
  $wppa_session['superview'] = wppa( 'is_slide' ) ? 'slide': 'thumbs';
159
  $wppa_session['superalbum'] = wppa( 'start_album' );
160
  wppa( 'photos_only', true );
161
  }
162
+ wppa( 'is_upldr', wppa_get( 'upldr' ) );
163
 
164
  if ( wppa( 'is_upldr' ) ) wppa( 'photos_only', true );
165
+ wppa( 'is_owner', wppa_get( 'owner' ) );
166
 
167
  if ( wppa( 'is_owner' ) ) {
168
  $albs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_albums
175
  $id = rtrim( $id, '.' );
176
  wppa( 'start_album', $id );
177
  }
178
+ wppa( 'supersearch', strip_tags( wppa_get( 'supersearch' ) ) );
179
  $wppa_session['supersearch'] = wppa( 'supersearch' );
180
 
181
  if ( wppa( 'supersearch' ) ) {
187
  wppa( 'photos_only', true );
188
  }
189
  }
190
+ wppa( 'calendar', strip_tags( wppa_get( 'calendar' ) ) );
191
 
192
  // New style calendar and ajax: set is_calendar
193
+ if ( substr( wppa_get( 'calendar' ), 0, 4 ) == 'real' ) {
194
+ wppa( 'calendar', wppa_get( 'calendar' ) );
195
  wppa( 'is_calendar', true );
196
  }
197
+ wppa( 'caldate', strip_tags( wppa_get( 'caldate' ) ) );
198
+ wppa( 'is_inverse', wppa_get( 'inv' ) );
199
 
200
  }
201
 
826
  if ( wppa( 'occur' ) == wppa_opt( 'search_oc' ) &&
827
  ! wppa( 'in_widget' ) &&
828
  ( ( isset( $wppa_session['has_searchbox'] ) && $wppa_session['has_searchbox'] ) ||
829
+ wppa_get( 'forceroot' )
830
  ) ) {
831
 
832
  // Is it a search now?
833
  if ( wppa( 'src' ) ) {
834
 
835
  // Is the subsearch box checked?
836
+ wppa( 'is_subsearch', wppa_get( 'subsearch' ) || wppa_get( 'subsearch' ) );
837
 
838
  // Is the rootsearch box checked?
839
+ wppa( 'is_rootsearch', wppa_get( 'rootsearch' ) || wppa_get( 'rootsearch' ) );
840
 
841
  // Is it even a forced root search?
842
+ if ( wppa_get( 'forceroot' ) ) {
843
+ $wppa_session['search_root'] = wppa_get( 'forceroot' );
844
  wppa( 'is_rootsearch', true );
845
+ wppa( 'start_album', wppa_get( 'forceroot' ) );
846
  }
847
 
848
  // No rootsearch, forget previous root
849
  if ( ! wppa( 'is_rootsearch' ) ) {
850
  $wppa_session['search_root'] = '0';
851
  }
 
 
852
  }
853
 
854
  // It is not a search now
855
  else {
856
 
857
  // Find new potential searchroot
858
+ if ( wppa_get( 'searchroot' ) ) {
859
+ wppa( 'start_album', wppa_get( 'searchroot' ) );
860
  }
861
 
862
  // Update session with new searchroot
1066
  function wppa_page( $page ) {
1067
 
1068
  if ( wppa_in_widget() ) {
1069
+ $occur = wppa_get( 'woccur' );
1070
  }
1071
  else {
1072
+ $occur = wppa_get( 'occur' );
1073
  }
1074
 
1075
  $ref_occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' );
2625
  $alb = $thumb['album'];
2626
 
2627
  if ( ! $user ) $user = wppa_get_user( 'display' );
2628
+ $photo = wppa_get( 'photo' );
2629
+ $ratingphoto = wppa_get( 'rating-id' );
2630
 
2631
  if ( ! $callbackid ) $callbackid = $id;
2632
 
2633
  // Process a comment if given for this photo
2634
+ $comment_request = ( wppa_get( 'commentbtn' ) && ( $id == $photo ) );
2635
  $comment_allowed = ! wppa_user_is_basic() && ( ! wppa_switch( 'comment_login' ) || is_user_logged_in() );
2636
  if ( wppa_switch( 'show_comments' ) && $comment_request && $comment_allowed ) {
2637
  wppa_do_comment( $id );
3059
  function wppa_do_comment( $id ) {
3060
  global $wpdb;
3061
  global $wppa_done;
 
3062
 
3063
+ // Been here before?
3064
  if ( $wppa_done ) return; // Prevent multiple
3065
  $wppa_done = true;
3066
 
3067
+ // Remember start time
3068
  $time = time();
3069
 
3070
+ // Find phot id
3071
+ $photo = wppa_get( 'photo', '0' );
3072
+ if ( ! $photo ) $photo = wppa_get( 'photo-id', '0' );
3073
+
3074
+ // No photo, give up
3075
  if ( ! $photo ) die( 'Photo id missing while processing a comment' );
3076
 
3077
+ // Find commenter name
3078
+ $user = wppa_get( 'comname', 'Anonymus' );
3079
+ $user = htmlspecialchars( $user );
3080
+
3081
+ // No user? give up
3082
  if ( ! $user ) die( 'Illegal attempt to enter a comment 1' );
 
3083
 
3084
+ // Find email ddress
3085
+ $email = wppa_get( 'comemail' );
3086
+
3087
+ // No email see if required
3088
  if ( ! $email ) {
3089
+
3090
+ // Missing but required?
3091
+ if ( wppa_opt( 'comment_email_required' ) == 'required' ) {
3092
+ die( 'Illegal attempt to enter a comment 2' );
3093
+ }
3094
+
3095
+ // If email no email and not required, use his IP
3096
+ else {
3097
+ $email = wppa_get_user();
3098
+ }
3099
  }
3100
 
3101
  // Retrieve and filter comment
3102
+ $comment = wppa_get( 'comment', '' );
3103
  $comment = trim( $comment );
3104
  $comment = wppa_decode( $comment );
3105
  if ( ! current_user_can( 'unfiltered_html' ) ) {
3153
  }
3154
 
3155
  // Editing a comment?
3156
+ $cedit = wppa_get( 'comment-edit', '0' );
3157
  if ( ! wppa_is_int( $cedit ) ) wp_die( 'Security check falure 14' );
3158
 
3159
  // Check captcha
3267
 
3268
  // SEND EMAILS
3269
  if ( $status == 'pending' ) {
3270
+ wppa_schedule_mailinglist( 'moderatecomment', 0, $photo, $key, wppa_get( 'returnurl' ) );
3271
  }
3272
  if ( $status == 'approved' ) {
3273
+ wppa_schedule_mailinglist( 'commentnotify', 0, $photo, $key, wppa_get( 'returnurl' ) );
3274
  }
3275
 
3276
  // Process any pending votes of this user for this photo if rating needs comment, do it anyway, feature may have been on but now off
3315
 
3316
  // Check the comment security answer
3317
  function wppa_check_captcha( $id ) {
3318
+ $answer = wppa_get( 'wppa-captcha' );
3319
  $capt = wppa_ll_captcha( $id );
3320
  return $capt['ans'] == $answer;
3321
  }
3798
 
3799
  function wppa_get_curpage() {
3800
 
3801
+ if ( wppa_get( 'page' ) ) {
3802
  if ( wppa_in_widget() ) {
3803
+ $oc = wppa_get( 'woccur' );
3804
  if ( ! $oc ) $oc = '1';
3805
+ $curpage = wppa( 'widget_occur' ) == $oc ? wppa_get( 'page' ) : '1';
3806
  }
3807
  else {
3808
+ $oc = wppa_get( 'occur' );
3809
  if ( ! $oc ) $oc = '1';
3810
+ $curpage = wppa( 'occur' ) == $oc ? wppa_get( 'page' ) : '1';
3811
  }
3812
  }
3813
  else $curpage = '1';
3891
 
3892
  // Nonce field check for rating security
3893
  if ( wppa( 'mocc' ) == '1' ) {
3894
+ if ( wppa_get( 'rating' ) ) {
3895
+ $nonce = wppa_get( 'nonce' );
3896
  $ok = wp_verify_nonce( $nonce, 'wppa-check' );
3897
  if ( $ok ) {
3898
  wppa_dbg_msg( 'Rating nonce ok' );
3903
 
3904
  // Nonce field check for comment security
3905
  if ( wppa( 'mocc' ) == '1' ) {
3906
+ if ( wppa_get( 'comment' ) ) {
3907
+ $nonce = wppa_get( 'nonce' );
3908
  $ok = wp_verify_nonce( $nonce, 'wppa-check' );
3909
  if ( $ok ) {
3910
  wppa_dbg_msg( 'Comment nonce ok' );
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
 
3936
  // If an ajax request, the (start)size is given. To prevent loosing responsiveness, look at resp arg
3937
+ if ( wppa( 'ajax' ) && wppa_get( 'resp' ) ) {
3938
  $auto = true;
3939
  }
3940
 
4076
  wppa_out( '<div id="wppa-container-' . wppa( 'mocc' ) . '-end" ></div>' );
4077
 
4078
  // Scroll down to container ?
4079
+ $do_scroll = wppa_switch( 'non_ajax_scroll' ) && wppa_get( 'occur' ) == wppa( 'mocc' );
 
 
 
 
4080
 
4081
  if ( $do_scroll ) {
4082
  wppa_out(
4960
 
4961
  // Do create
4962
  if ( $may_create ) {
4963
+ if ( wppa_get( 'fe-create' ) ) { // Create album
4964
+ $nonce = wppa_get( 'nonce' );
4965
+ if ( wppa_get( 'album-name' ) ) {
4966
+ $albumname = trim( strip_tags( wppa_get( 'wppa-album-name' ) ) );
4967
  }
4968
  if ( ! wppa_sanitize_file_name( $albumname ) ) {
4969
  $albumname = __('New Album', 'wp-photo-album-plus');
4982
  }
4983
  }
4984
 
4985
+ $parent = strval( intval( wppa_get( 'wppa-album-parent' ) ) );
4986
  if ( ! wppa_user_is( 'administrator' ) && wppa_switch( 'default_parent_always' ) ) {
4987
  $parent = wppa_opt( 'default_parent' );
4988
  }
4989
  $album = wppa_create_album_entry( array( 'name' => $albumname,
4990
+ 'description' => strip_tags( wppa_get( 'wppa-album-desc' ) ),
4991
  'a_parent' => $parent,
4992
  'owner' => wppa_switch( 'frontend_album_public' ) ? '--- public ---' : wppa_get_user()
4993
  ) );
5009
  if ( $may_upload ) {
5010
  $upload_message = '';
5011
  $blogged = false;
5012
+ if ( wppa_get( 'wppa-upload-album' ) ) { // Upload photo
5013
+ $nonce = wppa_get( 'nonce' );
5014
  $ok = wp_verify_nonce( $nonce, 'wppa-check' );
5015
  if ( ! $ok ) {
5016
  die( '<b>' . __( 'ERROR: Illegal attempt to upload a file.', 'wp-photo-album-plus') . '</b>');
5017
  }
5018
 
5019
+ $alb = wppa_get( 'wppa-upload-album' );
5020
  $alb = strval( intval( $alb ) ); // Force numeric
5021
  if ( ! wppa_album_exists( $alb ) ) {
5022
  $alert = esc_js( sprintf( __( 'Album %s does not exist', 'wp-photo-album-plus' ), $alb ) );
5186
  // Do Edit
5187
  if ( $may_edit ) {
5188
 
5189
+ if ( wppa_get( 'albumeditsubmit' ) ) {
5190
 
5191
  // Get album id
5192
+ $alb = wppa_get( 'albumeditid' );
5193
  if ( ! $alb || ! wppa_album_exists( $alb ) ) {
5194
  die( 'Security check failure' );
5195
  }
5196
 
5197
  // Valid request?
5198
+ if ( ! wp_verify_nonce( wppa_get( 'albumeditnonce' ), 'wppa_nonce_'.$alb ) ) {
5199
  die( 'Security check failure' );
5200
  }
5201
 
5202
  // Name
5203
+ $name = wppa_get( 'albumeditname' );
5204
  $name = trim( strip_tags( $name ) );
5205
  if ( ! $name ) { // Empty album name is not allowed
5206
  $name = 'Album-#'.$alb;
5207
  }
5208
 
5209
  // Description
5210
+ $description = wppa_get( 'albumeditdesc' );
5211
 
5212
 
5213
  // Custom data
5222
  $idx = '0';
5223
  while ( $idx < '10' ) {
5224
  if ( isset( $_POST['custom_' . $idx] ) ) {
5225
+ $value = wppa_get( 'custom_' . $idx );
5226
  $custom_data[$idx] = wppa_sanitize_custom_field( $value );
5227
  }
5228
  $idx++;
5300
  $is_av = true;
5301
 
5302
  // Find the name
5303
+ if ( wppa_get( 'user-name' ) ) {
5304
+ $name = wppa_get( 'user-name' );
5305
  }
5306
  else {
5307
  $name = $file['name'];
5318
  // Add new entry
5319
  if ( ! $id ) {
5320
 
5321
+ $desc = isset( $_POST['user-desc'] ) ? balanceTags( wppa_get( 'user-desc' ), true ) : '';
5322
  if ( ! $desc && wppa_switch( 'apply_newphoto_desc_user' ) ) {
5323
  $desc = wppa_opt( 'newphoto_description' );
5324
  }
5355
  wppa_fix_video_framesize( $id, 'av_add_front' );
5356
 
5357
  // Repair name if not standard
5358
+ if ( ! wppa_get( 'user-name' ) ) {
5359
  wppa( 'unsanitized_filename', $file['name'] );
5360
  wppa_set_default_name( $id, $file['name'] );
5361
  }
5432
  }
5433
 
5434
  // Did the user supply a photoname?
5435
+ if ( wppa_get( 'user-name' ) ) {
5436
+ $name = wppa_get( 'user-name' );
5437
  }
5438
  else {
5439
  $name = $file['name'];
5441
 
5442
  // Sanitize input
5443
  $name = wppa_sanitize_photo_name( $name );
5444
+ $desc = balanceTags( wppa_get( 'user-desc' ), true );
5445
 
5446
  // If BlogIt! and no descrption given, use name field - this is for the shortcode used: typ"mphoto"
5447
  if ( ! $desc && isset( $_POST['wppa-blogit'] ) ) {
5481
  if ( wppa_make_the_photo_files( $source_file, $id, $ext, ! wppa_switch( 'watermark_thumbs' ) ) ) {
5482
 
5483
  // Repair photoname if not standard
5484
+ if ( ! wppa_get( 'user-name' ) ) {
5485
  wppa_set_default_name( $id );
5486
  }
5487
 
6046
  $cache_file = false;
6047
  $cache_data = false;
6048
 
6049
+ if ( wppa_get( 'cache' ) ) {
6050
+ wppa( 'cache', wppa_get( 'cache' ) );
6051
  }
6052
 
6053
  if ( wppa( 'cache' ) ) {
6058
  }
6059
 
6060
  // Querystring not for this occur?
6061
+ elseif ( ! wppa_in_widget() && wppa( 'occur' ) != wppa_get( 'occur' ) ) {
6062
  $caching = true;
6063
  }
6064
 
6065
  // Ajax?
6066
+ elseif ( wppa_get( 'cache' ) ) {
6067
  $caching = true;
6068
  }
6069
 
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.00.016
7
  *
8
  */
9
 
@@ -29,10 +29,10 @@ global $wppa_session;
29
  if ( wppa_switch( 'watermark_on' ) && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) ) {
30
 
31
  // File
32
- if ( isset( $_POST['wppa-watermark-file'] ) ) {
33
 
34
  // Sanitize input
35
- $watermark_file = $_POST['wppa-watermark-file'];
36
  if ( stripos( $watermark_file, '.png' ) !== false ) {
37
  $watermark_file = sanitize_file_name( $watermark_file );
38
  }
@@ -47,10 +47,10 @@ global $wppa_session;
47
  }
48
 
49
  // Position
50
- if ( isset( $_POST['wppa-watermark-pos'] ) ) {
51
 
52
  // Sanitize input
53
- $watermark_pos = $_POST['wppa-watermark-pos'];
54
  if ( ! in_array( $watermark_pos, array( 'toplft', 'topcen', 'toprht', 'cenlft', 'cencen', 'cenrht', 'botlft', 'botcen', 'botrht' ) ) ) {
55
  $watermark_pos = 'nil';
56
  }
@@ -61,25 +61,25 @@ global $wppa_session;
61
  }
62
 
63
  // Update last used albums
64
- if ( isset( $_POST['wppa-photo-album'] ) ) {
65
- update_option( 'wppa-photo-album-import-'.wppa_get_user(), strval( intval( $_POST['wppa-photo-album'] ) ) );
66
  }
67
- if ( isset( $_POST['wppa-video-album'] ) ) {
68
- update_option( 'wppa-video-album-import-'.wppa_get_user(), strval( intval( $_POST['wppa-video-album'] ) ) );
69
  }
70
- if ( isset( $_POST['wppa-audio-album'] ) ) {
71
- update_option( 'wppa-audio-album-import-'.wppa_get_user(), strval( intval( $_POST['wppa-audio-album'] ) ) );
72
  }
73
- if ( isset( $_POST['wppa-document-album'] ) ) {
74
- update_option( 'wppa-document-album-import-'.wppa_get_user(), strval( intval( $_POST['wppa-document-album'] ) ) );
75
  }
76
 
77
  // Link from album admin overrules last album
78
- if ( isset( $_GET['wppa-set-album'] ) ) {
79
- update_option( 'wppa-photo-album-import-'.wppa_get_user(), strval( intval( $_GET['wppa-set-album'] ) ) );
80
- update_option( 'wppa-video-album-import-'.wppa_get_user(), strval( intval( $_GET['wppa-set-album'] ) ) );
81
- update_option( 'wppa-audio-album-import-'.wppa_get_user(), strval( intval( $_GET['wppa-set-album'] ) ) );
82
- update_option( 'wppa-document-album-import-'.wppa_get_user(), strval( intval( $_GET['wppa-set-album'] ) ) );
83
  }
84
 
85
  // Verify last albums still exist
@@ -105,39 +105,39 @@ global $wppa_session;
105
  }
106
 
107
  // Extract zip
108
- if ( isset( $_GET['zip'] ) ) {
109
- wppa_extract( $_GET['zip'], true );
110
  }
111
 
112
  // Set local / remote
113
- if ( isset( $_POST['wppa-local-remote'] ) && in_array( $_POST['wppa-local-remote'], array( 'local', 'remote' ) ) ) {
114
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
115
- update_option( 'wppa_import_source_type_'.$user, $_POST['wppa-local-remote'] );
116
  }
117
 
118
  // Set import source dir ( when local )
119
- if ( isset( $_POST['wppa-import-set-source-dir'] ) && wppa_is_dir( $_POST['wppa-source'] ) ) {
120
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
121
- if ( isset( $_POST['wppa-source'] ) ) {
122
- update_option( 'wppa_import_source_'.$user, $_POST['wppa-source'] );
123
  }
124
  }
125
 
126
  // Set import source url ( when remote )
127
- if ( isset( $_POST['wppa-import-set-source-url'] ) ) {
128
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
129
- if ( isset( $_POST['wppa-source-remote'] ) ) {
130
- update_option( 'wppa_import_source_url_'.$user, esc_url( $_POST['wppa-source-remote'] ) );
131
  update_option( 'wppa_import_source_url_found_'.$user, false );
132
- update_option( 'wppa_import_remote_max_'.$user, strval( intval( $_POST['wppa-import-remote-max'] ) ) );
133
  $wppa_session['is_wppa_tree'] = false;
134
  }
135
  }
136
 
137
  // Hit the submit button
138
- if ( isset( $_POST['wppa-import-submit'] ) ) {
139
  if ( wppa( 'ajax' ) ) {
140
- if ( ! wp_verify_nonce( $_POST['wppa-update-check'], '$wppa_nonce' ) ) {
141
  echo 'Security check failure';
142
  wppa_exit();
143
  }
@@ -145,21 +145,21 @@ global $wppa_session;
145
  else {
146
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
147
  }
148
- $delp = isset( $_POST['del-after-p'] );
149
- $delf = isset( $_POST['del-after-f'] ); // Del after failed
150
- $dela = isset( $_POST['del-after-a'] );
151
- $delz = isset( $_POST['del-after-z'] );
152
- $delv = isset( $_POST['del-after-v'] );
153
- $delu = isset( $_POST['del-after-u'] );
154
- $delc = isset( $_POST['del-after-c'] );
155
- $deld = isset( $_POST['del-after-d'] ); // document (.pdf)
156
 
157
  wppa_import_photos( $delp, $dela, $delz, $delv, $delu, $delc, $delf, $deld );
158
  }
159
 
160
  // Continue dirimport after timeout
161
- elseif ( isset( $_GET['continue'] ) ) {
162
- if ( wp_verify_nonce( $_GET['nonce'], 'dirimport' ) ) wppa_import_photos();
163
  }
164
 
165
  // If we did this by ajax, setup reporting results for it
@@ -773,7 +773,7 @@ global $wppa_session;
773
  ' type="hidden"' .
774
  ' id="wppa-nodups"' .
775
  ' name="wppa-nodups"' .
776
- ' value="true"' .
777
  ' />';
778
  }
779
  else {
@@ -1478,7 +1478,7 @@ global $wppa_session;
1478
  var wppaTimer;
1479
  function wppaDoAjaxImport() {
1480
  jQuery( '#wppa-spinner' ).css( 'display', 'none' );
1481
- // wppaImportRuns = true;
1482
  var data = '';
1483
  data += 'wppa-update-check='+jQuery( '#wppa-update-check' ).val();
1484
  data += '&wppa-photo-album='+jQuery( '#wppa-photo-album' ).val();
@@ -1488,14 +1488,14 @@ global $wppa_session;
1488
  data += '&wppa-watermark-file='+jQuery( '#wppa-watermark-file' ).val();
1489
  data += '&wppa-watermark-pos='+jQuery( '#wppa-watermark-pos' ).val();
1490
  if ( jQuery( '#cre-album' ).prop( 'checked' ) ) data += '&cre-album='+jQuery( '#cre-album' ).val();
1491
- if ( jQuery( '#use-backup' ).prop( 'checked' ) ) data += '&use-backup=on'; //+jQuery( '#use-backup' ).val();
1492
- if ( jQuery( '#wppa-update' ).prop( 'checked' ) ) data += '&wppa-update=on'; //+jQuery( '#wppa-update' ).val();
1493
- if ( jQuery( '#wppa-nodups' ).prop( 'checked' ) ) data += '&wppa-nodups=on'; //+jQuery( '#wppa-nudups' ).val();
1494
- if ( jQuery( '#del-after-p' ).prop( 'checked' ) ) data += '&del-after-p=on';
1495
- if ( jQuery( '#del-after-f' ).prop( 'checked' ) ) data += '&del-after-f=on';
1496
- if ( jQuery( '#del-after-v' ).prop( 'checked' ) ) data += '&del-after-v=on';
1497
- if ( jQuery( '#del-after-u' ).prop( 'checked' ) ) data += '&del-after-u=on';
1498
- if ( jQuery( '#del-after-d' ).prop( 'checked' ) ) data += '&del-after-d=on';
1499
  data += '&wppa-import-submit=ajax';
1500
 
1501
  var files = jQuery( ':checked' );
@@ -1639,7 +1639,7 @@ global $wppa_session;
1639
 
1640
  if ( wppa( 'continue' ) ) {
1641
  wppa_warning_message( __( 'Trying to continue...', 'wp-photo-album-plus') );
1642
- echo '<script type="text/javascript" >document.location=\''.get_admin_url().'admin.php?page=wppa_import_photos&continue&nonce='.wp_create_nonce( 'dirimport' ).'\';</script>';
1643
  }
1644
 
1645
  echo '<br /><br />';
@@ -1660,9 +1660,8 @@ global $wppa_session;
1660
  $source_type = wppa_get_option( 'wppa_import_source_type_'.$user, 'local' );
1661
  $files = array();
1662
 
1663
- // Ajax? one file
1664
- if ( isset ( $_POST['import-ajax-file'] ) ) {
1665
- $files = array( $_POST['import-ajax-file'] );
1666
  }
1667
 
1668
  // Dispatch on source type local/remote
@@ -1835,7 +1834,7 @@ global $wppa_session;
1835
  $zcount = 0;
1836
  if ( PHP_VERSION_ID >= 50207 ) {
1837
  foreach( $files as $zipfile ) {
1838
- if ( isset( $_POST['file-'.$idx] ) ) {
1839
  $ext = strtolower( substr( strrchr( $zipfile, "." ), 1 ) );
1840
 
1841
  if ( $ext == 'zip' ) {
@@ -1851,7 +1850,7 @@ global $wppa_session;
1851
  $idx='0';
1852
  $acount = 0;
1853
  foreach( $files as $album ) {
1854
- if ( isset( $_POST['file-'.$idx] ) ) {
1855
  $ext = strtolower( substr( strrchr( $album, "." ), 1 ) );
1856
  if ( $ext == 'amf' ) {
1857
  $name = '';
@@ -1944,10 +1943,10 @@ global $wppa_session;
1944
  $totpcount = '0';
1945
 
1946
  // find album id
1947
- if ( isset( $_POST['cre-album'] ) ) { // use album ngg gallery name for ngg conversion
1948
- $album = wppa_get_album_id( strip_tags( $_POST['cre-album'] ) );
1949
  if ( ! $album ) { // the album does not exist yet, create it
1950
- $name = strip_tags( $_POST['cre-album'] );
1951
  $desc = sprintf( __( 'This album has been converted from ngg gallery %s', 'wp-photo-album-plus'), $name );
1952
  $uplim = '0/0'; // Unlimited not to destroy the conversion process!!
1953
  $album = wppa_create_album_entry( array ( 'name' => $name,
@@ -1960,10 +1959,9 @@ global $wppa_session;
1960
  }
1961
  }
1962
  }
1963
- elseif ( isset( $_POST['wppa-photo-album'] ) ) {
1964
- $album = strval( intval( $_POST['wppa-photo-album'] ) );
1965
  }
1966
- else $album = '0';
1967
 
1968
  // Report starting process
1969
  wppa_ok_message( __( 'Processing files, please wait...', 'wp-photo-album-plus').' '.__( 'If the line of dots stops growing or your browser reports Ready, your server has given up. In that case: try again', 'wp-photo-album-plus').' <a href="'.wppa_dbg_url( get_admin_url().'admin.php?page=wppa_import_photos' ).'">'.__( 'here.', 'wp-photo-album-plus').'</a>' );
@@ -1973,11 +1971,11 @@ global $wppa_session;
1973
  $unsanitized_path_name = $files[$file_idx];
1974
  $file = $files[$file_idx];
1975
  wppa_is_wppa_tree( $file ); // Sets wppa( 'is_wppa_tree' )
1976
- if ( isset( $_POST['use-backup'] ) && is_file( $file.'_backup' ) ) {
1977
  $file = $file.'_backup';
1978
  }
1979
  $file = wppa_sanitize_file_name( $file );
1980
- if ( isset( $_POST['file-'.$idx] ) || wppa( 'ajax' ) ) {
1981
  if ( wppa( 'is_wppa_tree' ) ) {
1982
  if ( wppa( 'ajax' ) ) wppa( 'ajax_import_files', basename( wppa_compress_tree_path( $file ) ) );
1983
  }
@@ -2069,7 +2067,7 @@ global $wppa_session;
2069
  }
2070
 
2071
  // Update the photo ?
2072
- elseif ( isset( $_POST['wppa-update'] ) ) {
2073
 
2074
  if ( wppa( 'is_wppa_tree' ) ) {
2075
  $tmp = explode( '/wppa/', $file );
@@ -2201,7 +2199,7 @@ global $wppa_session;
2201
  $iret = true;
2202
 
2203
  foreach ( $files as $file ) {
2204
- if ( basename( $file ) != '.' && basename( $file ) != '..' && ( isset( $_POST['file-'.$idx] ) || isset( $_GET['continue'] ) ) ) {
2205
  if ( wppa_is_dir( $file ) ) {
2206
  $iret = wppa_import_dir_to_album( $file, '0' );
2207
  if ( wppa_is_time_up() ) {
@@ -2216,13 +2214,11 @@ global $wppa_session;
2216
 
2217
  // Now the video files
2218
  $videocount = '0';
2219
- $alb = isset( $_POST['wppa-video-album'] ) ? $_POST['wppa-video-album'] : '0';
2220
- // if ( wppa( 'ajax' ) && ! $alb ) {
2221
- // wppa( 'ajax_import_files_error', __( 'Unknown album v', 'wp-photo-album-plus' ) );
2222
- // }
2223
  if ( $alb ) foreach ( array_keys( $files ) as $idx ) {
2224
  $file = $files[$idx];
2225
- if ( isset( $_POST['file-'.$idx] ) || wppa( 'ajax' ) ) {
2226
  if ( wppa( 'ajax' ) ) wppa( 'ajax_import_files', wppa_sanitize_file_name( basename( $file ) ) ); /* */
2227
  $ext = strtolower( substr( strrchr( $file, "." ), 1 ) );
2228
  if ( in_array( $ext, $wppa_supported_video_extensions ) ) {
@@ -2250,13 +2246,11 @@ global $wppa_session;
2250
 
2251
  // Now the audio files
2252
  $audiocount = '0';
2253
- $alb = isset( $_POST['wppa-audio-album'] ) ? $_POST['wppa-audio-album'] : '0';
2254
- // if ( wppa( 'ajax' ) && ! $alb ) {
2255
- // wppa( 'ajax_import_files_error', __( 'Unknown album a', 'wp-photo-album-plus' ) );
2256
- // }
2257
  if ( $alb ) foreach ( array_keys( $files ) as $idx ) {
2258
  $file = $files[$idx];
2259
- if ( isset( $_POST['file-'.$idx] ) || wppa( 'ajax' ) ) {
2260
  if ( wppa( 'ajax' ) ) wppa( 'ajax_import_files', wppa_sanitize_file_name( basename( $file ) ) );
2261
  $ext = strtolower( substr( strrchr( $file, "." ), 1 ) );
2262
  if ( in_array( $ext, $wppa_supported_audio_extensions ) ) {
@@ -2284,13 +2278,11 @@ global $wppa_session;
2284
 
2285
  // Now the document files
2286
  $documentcount = '0';
2287
- $alb = isset( $_POST['wppa-document-album'] ) ? $_POST['wppa-document-album'] : '0';
2288
- // if ( wppa( 'ajax' ) && ! $alb ) {
2289
- // wppa( 'ajax_import_files_error', __( 'Unknown album d', 'wp-photo-album-plus' ) );
2290
- // }
2291
  if ( $alb ) foreach ( array_keys( $files ) as $idx ) {
2292
  $file = $files[$idx];
2293
- if ( isset( $_POST['file-'.$idx] ) || wppa( 'ajax' ) ) {
2294
  if ( wppa( 'ajax' ) ) wppa( 'ajax_import_files', wppa_sanitize_file_name( basename( $file ) ) ); /* */
2295
  $ext = strtolower( substr( strrchr( $file, "." ), 1 ) );
2296
  if ( in_array( $ext, $wppa_supported_document_extensions ) ) {
@@ -2381,7 +2373,7 @@ global $wppa_session;
2381
  foreach ( array_keys( $files ) as $idx ) {
2382
  $this_skipped = '0';
2383
  $file = $files[$idx];
2384
- if ( isset( $_POST['file-'.$idx] ) || isset( $_GET['continue'] ) ) {
2385
  $ext = strtolower( wppa_get_ext( $file ) );
2386
  if ( $ext == 'csv' ) {
2387
 
@@ -2831,7 +2823,7 @@ global $wppa_session;
2831
  if ( $dircount ) $msg .= $dircount.' '.__( 'Directory to album imports.', 'wp-photo-album-plus').' ';
2832
  if ( $photocount ) $msg .= ' '.sprintf( __( 'With total %s photos.', 'wp-photo-album-plus'), $photocount ).' ';
2833
  if ( $pcount ) {
2834
- if ( isset( $_POST['wppa-update'] ) ) {
2835
  $msg .= $pcount.' '.__( 'Photos updated', 'wp-photo-album-plus' );
2836
  if ( $totpcount != $pcount ) {
2837
  $msg .= ' '.sprintf( __( 'to %s locations', 'wp-photo-album-plus'), $totpcount );
@@ -3193,7 +3185,7 @@ global $wppa_session;
3193
  }
3194
 
3195
  // Remove empty dirs if requested
3196
- if ( isset( $_REQUEST['del-dir'] ) ) {
3197
  wppa_rmdir( $xfile, true );
3198
  }
3199
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
+ * Version 8.0.07.003
7
  *
8
  */
9
 
29
  if ( wppa_switch( 'watermark_on' ) && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) ) {
30
 
31
  // File
32
+ if ( wppa_get( 'watermark-file' ) ) {
33
 
34
  // Sanitize input
35
+ $watermark_file = wppa_get( 'watermark-file' );
36
  if ( stripos( $watermark_file, '.png' ) !== false ) {
37
  $watermark_file = sanitize_file_name( $watermark_file );
38
  }
47
  }
48
 
49
  // Position
50
+ if ( wppa_get( 'watermark-pos' ) ) {
51
 
52
  // Sanitize input
53
+ $watermark_pos = wppa_get( 'watermark-pos' );
54
  if ( ! in_array( $watermark_pos, array( 'toplft', 'topcen', 'toprht', 'cenlft', 'cencen', 'cenrht', 'botlft', 'botcen', 'botrht' ) ) ) {
55
  $watermark_pos = 'nil';
56
  }
61
  }
62
 
63
  // Update last used albums
64
+ if ( wppa_get( 'photo-album' ) ) {
65
+ update_option( 'wppa-photo-album-import-'.wppa_get_user(), wppa_get( 'photo-album' ) );
66
  }
67
+ if ( wppa_get( 'video-album' ) ) {
68
+ update_option( 'wppa-video-album-import-'.wppa_get_user(), wppa_get( 'video-album' ) );
69
  }
70
+ if ( wppa_get( 'audio-album' ) ) {
71
+ update_option( 'wppa-audio-album-import-'.wppa_get_user(), wppa_get( 'audio-album' ) );
72
  }
73
+ if ( wppa_get( 'document-album' ) ) {
74
+ update_option( 'wppa-document-album-import-'.wppa_get_user(), wppa_get( 'document-album' ) );
75
  }
76
 
77
  // Link from album admin overrules last album
78
+ if ( wppa_get( 'set-album' ) ) {
79
+ update_option( 'wppa-photo-album-import-'.wppa_get_user(), wppa_get( 'set-album' ) );
80
+ update_option( 'wppa-video-album-import-'.wppa_get_user(), wppa_get( 'set-album' ) );
81
+ update_option( 'wppa-audio-album-import-'.wppa_get_user(), wppa_get( 'set-album' ) );
82
+ update_option( 'wppa-document-album-import-'.wppa_get_user(), wppa_get( 'set-album' ) );
83
  }
84
 
85
  // Verify last albums still exist
105
  }
106
 
107
  // Extract zip
108
+ if ( wppa_get( 'zip' ) ) {
109
+ wppa_extract( wppa_get( 'zip' ), true );
110
  }
111
 
112
  // Set local / remote
113
+ if ( wppa_get( 'local-remote' ) && in_array( wppa_get( 'local-remote' ), array( 'local', 'remote' ) ) ) {
114
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
115
+ update_option( 'wppa_import_source_type_'.$user, wppa_get( 'local-remote' ) );
116
  }
117
 
118
  // Set import source dir ( when local )
119
+ if ( wppa_get( 'import-set-source-dir' ) && wppa_is_dir( wppa_get( 'source' ) ) ) {
120
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
121
+ if ( wppa_get( 'source' ) ) {
122
+ update_option( 'wppa_import_source_'.$user, wppa_get( 'source' ) );
123
  }
124
  }
125
 
126
  // Set import source url ( when remote )
127
+ if ( wppa_get( 'import-set-source-url' ) ) {
128
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
129
+ if ( wppa_get( 'source-remote' ) ) {
130
+ update_option( 'wppa_import_source_url_'.$user, esc_url( wppa_get( 'source-remote' ) ) );
131
  update_option( 'wppa_import_source_url_found_'.$user, false );
132
+ update_option( 'wppa_import_remote_max_'.$user, wppa_get( 'import-remote-max' ) );
133
  $wppa_session['is_wppa_tree'] = false;
134
  }
135
  }
136
 
137
  // Hit the submit button
138
+ if ( wppa_get( 'import-submit' ) ) {
139
  if ( wppa( 'ajax' ) ) {
140
+ if ( ! wp_verify_nonce( wppa_get( 'update-check' ), '$wppa_nonce' ) ) {
141
  echo 'Security check failure';
142
  wppa_exit();
143
  }
145
  else {
146
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
147
  }
148
+ $delp = wppa_get( 'del-after-p' );
149
+ $delf = wppa_get( 'del-after-f' ); // Del after failed
150
+ $dela = wppa_get( 'del-after-a' );
151
+ $delz = wppa_get( 'del-after-z' );
152
+ $delv = wppa_get( 'del-after-v' );
153
+ $delu = wppa_get( 'del-after-u' );
154
+ $delc = wppa_get( 'del-after-c' );
155
+ $deld = wppa_get( 'del-after-d' ); // document (.pdf)
156
 
157
  wppa_import_photos( $delp, $dela, $delz, $delv, $delu, $delc, $delf, $deld );
158
  }
159
 
160
  // Continue dirimport after timeout
161
+ elseif ( wppa_get( 'continue' ) ) {
162
+ if ( wp_verify_nonce( wppa_get( 'nonce' ), 'dirimport' ) ) wppa_import_photos();
163
  }
164
 
165
  // If we did this by ajax, setup reporting results for it
773
  ' type="hidden"' .
774
  ' id="wppa-nodups"' .
775
  ' name="wppa-nodups"' .
776
+ ' value="1"' .
777
  ' />';
778
  }
779
  else {
1478
  var wppaTimer;
1479
  function wppaDoAjaxImport() {
1480
  jQuery( '#wppa-spinner' ).css( 'display', 'none' );
1481
+
1482
  var data = '';
1483
  data += 'wppa-update-check='+jQuery( '#wppa-update-check' ).val();
1484
  data += '&wppa-photo-album='+jQuery( '#wppa-photo-album' ).val();
1488
  data += '&wppa-watermark-file='+jQuery( '#wppa-watermark-file' ).val();
1489
  data += '&wppa-watermark-pos='+jQuery( '#wppa-watermark-pos' ).val();
1490
  if ( jQuery( '#cre-album' ).prop( 'checked' ) ) data += '&cre-album='+jQuery( '#cre-album' ).val();
1491
+ if ( jQuery( '#use-backup' ).prop( 'checked' ) ) data += '&use-backup=1';
1492
+ if ( jQuery( '#wppa-update' ).prop( 'checked' ) ) data += '&wppa-update=1';
1493
+ if ( jQuery( '#wppa-nodups' ).prop( 'checked' ) ) data += '&wppa-nodups=1';
1494
+ if ( jQuery( '#del-after-p' ).prop( 'checked' ) ) data += '&del-after-p=1';
1495
+ if ( jQuery( '#del-after-f' ).prop( 'checked' ) ) data += '&del-after-f=1';
1496
+ if ( jQuery( '#del-after-v' ).prop( 'checked' ) ) data += '&del-after-v=1';
1497
+ if ( jQuery( '#del-after-u' ).prop( 'checked' ) ) data += '&del-after-u=1';
1498
+ if ( jQuery( '#del-after-d' ).prop( 'checked' ) ) data += '&del-after-d=1';
1499
  data += '&wppa-import-submit=ajax';
1500
 
1501
  var files = jQuery( ':checked' );
1639
 
1640
  if ( wppa( 'continue' ) ) {
1641
  wppa_warning_message( __( 'Trying to continue...', 'wp-photo-album-plus') );
1642
+ echo '<script type="text/javascript" >document.location=\''.get_admin_url().'admin.php?page=wppa_import_photos&continue=1&nonce='.wp_create_nonce( 'dirimport' ).'\';</script>';
1643
  }
1644
 
1645
  echo '<br /><br />';
1660
  $source_type = wppa_get_option( 'wppa_import_source_type_'.$user, 'local' );
1661
  $files = array();
1662
 
1663
+ if ( wppa_get( 'import-ajax-file' ) ) {
1664
+ $files = (array) wppa_get( 'import-ajax-file' );
 
1665
  }
1666
 
1667
  // Dispatch on source type local/remote
1834
  $zcount = 0;
1835
  if ( PHP_VERSION_ID >= 50207 ) {
1836
  foreach( $files as $zipfile ) {
1837
+ if ( wppa_get( 'file-'.$idx ) ) {
1838
  $ext = strtolower( substr( strrchr( $zipfile, "." ), 1 ) );
1839
 
1840
  if ( $ext == 'zip' ) {
1850
  $idx='0';
1851
  $acount = 0;
1852
  foreach( $files as $album ) {
1853
+ if ( wppa_get( 'file-'.$idx ) ) {
1854
  $ext = strtolower( substr( strrchr( $album, "." ), 1 ) );
1855
  if ( $ext == 'amf' ) {
1856
  $name = '';
1943
  $totpcount = '0';
1944
 
1945
  // find album id
1946
+ if ( wppa_get( 'cre-album' ) ) { // use album ngg gallery name for ngg conversion
1947
+ $album = wppa_get_album_id( wppa_get( 'cre-album' ) );
1948
  if ( ! $album ) { // the album does not exist yet, create it
1949
+ $name = wppa_get( 'cre-album' );
1950
  $desc = sprintf( __( 'This album has been converted from ngg gallery %s', 'wp-photo-album-plus'), $name );
1951
  $uplim = '0/0'; // Unlimited not to destroy the conversion process!!
1952
  $album = wppa_create_album_entry( array ( 'name' => $name,
1959
  }
1960
  }
1961
  }
1962
+ else {
1963
+ $album = wppa_get( 'photo-album' );
1964
  }
 
1965
 
1966
  // Report starting process
1967
  wppa_ok_message( __( 'Processing files, please wait...', 'wp-photo-album-plus').' '.__( 'If the line of dots stops growing or your browser reports Ready, your server has given up. In that case: try again', 'wp-photo-album-plus').' <a href="'.wppa_dbg_url( get_admin_url().'admin.php?page=wppa_import_photos' ).'">'.__( 'here.', 'wp-photo-album-plus').'</a>' );
1971
  $unsanitized_path_name = $files[$file_idx];
1972
  $file = $files[$file_idx];
1973
  wppa_is_wppa_tree( $file ); // Sets wppa( 'is_wppa_tree' )
1974
+ if ( wppa_get( 'use-backup' ) && is_file( $file.'_backup' ) ) {
1975
  $file = $file.'_backup';
1976
  }
1977
  $file = wppa_sanitize_file_name( $file );
1978
+ if ( wppa_get( 'file-'.$idx ) || wppa( 'ajax' ) ) {
1979
  if ( wppa( 'is_wppa_tree' ) ) {
1980
  if ( wppa( 'ajax' ) ) wppa( 'ajax_import_files', basename( wppa_compress_tree_path( $file ) ) );
1981
  }
2067
  }
2068
 
2069
  // Update the photo ?
2070
+ elseif ( wppa_get( 'wppa-update' ) ) {
2071
 
2072
  if ( wppa( 'is_wppa_tree' ) ) {
2073
  $tmp = explode( '/wppa/', $file );
2199
  $iret = true;
2200
 
2201
  foreach ( $files as $file ) {
2202
+ if ( basename( $file ) != '.' && basename( $file ) != '..' && ( wppa_get( 'file-'.$idx ) || wppa_get( 'continue' ) ) ) {
2203
  if ( wppa_is_dir( $file ) ) {
2204
  $iret = wppa_import_dir_to_album( $file, '0' );
2205
  if ( wppa_is_time_up() ) {
2214
 
2215
  // Now the video files
2216
  $videocount = '0';
2217
+ $alb = wppa_get( 'video-album' );
2218
+
 
 
2219
  if ( $alb ) foreach ( array_keys( $files ) as $idx ) {
2220
  $file = $files[$idx];
2221
+ if ( wppa_get( 'file-'.$idx ) || wppa( 'ajax' ) ) {
2222
  if ( wppa( 'ajax' ) ) wppa( 'ajax_import_files', wppa_sanitize_file_name( basename( $file ) ) ); /* */
2223
  $ext = strtolower( substr( strrchr( $file, "." ), 1 ) );
2224
  if ( in_array( $ext, $wppa_supported_video_extensions ) ) {
2246
 
2247
  // Now the audio files
2248
  $audiocount = '0';
2249
+ $alb = wppa_get( 'audio-album' );
2250
+
 
 
2251
  if ( $alb ) foreach ( array_keys( $files ) as $idx ) {
2252
  $file = $files[$idx];
2253
+ if ( wppa_get( 'file-'.$idx ) || wppa( 'ajax' ) ) {
2254
  if ( wppa( 'ajax' ) ) wppa( 'ajax_import_files', wppa_sanitize_file_name( basename( $file ) ) );
2255
  $ext = strtolower( substr( strrchr( $file, "." ), 1 ) );
2256
  if ( in_array( $ext, $wppa_supported_audio_extensions ) ) {
2278
 
2279
  // Now the document files
2280
  $documentcount = '0';
2281
+ $alb = wppa_get( 'document-album' );
2282
+
 
 
2283
  if ( $alb ) foreach ( array_keys( $files ) as $idx ) {
2284
  $file = $files[$idx];
2285
+ if ( wppa_get( 'file-'.$idx ) || wppa( 'ajax' ) ) {
2286
  if ( wppa( 'ajax' ) ) wppa( 'ajax_import_files', wppa_sanitize_file_name( basename( $file ) ) ); /* */
2287
  $ext = strtolower( substr( strrchr( $file, "." ), 1 ) );
2288
  if ( in_array( $ext, $wppa_supported_document_extensions ) ) {
2373
  foreach ( array_keys( $files ) as $idx ) {
2374
  $this_skipped = '0';
2375
  $file = $files[$idx];
2376
+ if ( wppa_get( 'file-'.$idx ) || wppa_get( 'continue' ) ) {
2377
  $ext = strtolower( wppa_get_ext( $file ) );
2378
  if ( $ext == 'csv' ) {
2379
 
2823
  if ( $dircount ) $msg .= $dircount.' '.__( 'Directory to album imports.', 'wp-photo-album-plus').' ';
2824
  if ( $photocount ) $msg .= ' '.sprintf( __( 'With total %s photos.', 'wp-photo-album-plus'), $photocount ).' ';
2825
  if ( $pcount ) {
2826
+ if ( wppa_get( 'update' ) ) {
2827
  $msg .= $pcount.' '.__( 'Photos updated', 'wp-photo-album-plus' );
2828
  if ( $totpcount != $pcount ) {
2829
  $msg .= ' '.sprintf( __( 'to %s locations', 'wp-photo-album-plus'), $totpcount );
3185
  }
3186
 
3187
  // Remove empty dirs if requested
3188
+ if ( wppa_get( 'del-dir' ) ) {
3189
  wppa_rmdir( $xfile, true );
3190
  }
3191
  }
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
- * Version 8.0.06.003
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
@@ -68,6 +68,7 @@ require_once 'wppa-thumbnails.php';
68
  require_once 'wppa-boxes-html.php';
69
  require_once 'wppa-slideshow.php';
70
  require_once 'wppa-picture.php';
 
71
 
72
  /* Load cloudinary if configured and php version >= 5.3 */
73
  if ( PHP_VERSION_ID >= 50300 ) require_once 'wppa-cloudinary.php';
@@ -101,8 +102,8 @@ global $wp_version;
101
  global $locale;
102
 
103
  // 'Our' usefull language info
104
- if ( wppa_get_get( 'wppalocale' ) ) {
105
- $wppa_locale = wppa_get_get( 'wppalocale' );
106
  $wppa_lang = substr( $wppa_locale, 0, 2 );
107
  $locale = $wppa_locale;
108
  }
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
+ * Version 8.0.07.001
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
68
  require_once 'wppa-boxes-html.php';
69
  require_once 'wppa-slideshow.php';
70
  require_once 'wppa-picture.php';
71
+ require_once 'wppa-input.php';
72
 
73
  /* Load cloudinary if configured and php version >= 5.3 */
74
  if ( PHP_VERSION_ID >= 50300 ) require_once 'wppa-cloudinary.php';
102
  global $locale;
103
 
104
  // 'Our' usefull language info
105
+ if ( wppa_get( 'wppalocale' ) ) {
106
+ $wppa_locale = wppa_get( 'wppalocale' );
107
  $wppa_lang = substr( $wppa_locale, 0, 2 );
108
  $locale = $wppa_locale;
109
  }
wppa-input.php ADDED
@@ -0,0 +1,599 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* wppa-input.php
3
+ * Package: wp-photo-album-plus
4
+ *
5
+ * Contains functions for sanitizing and formatting user input
6
+ * Version 8.0.07.003
7
+ *
8
+ */
9
+
10
+ /* CHECK REDIRECTION */
11
+ add_action( 'plugins_loaded', 'wppa_redirect', '1' );
12
+
13
+ function wppa_redirect() {
14
+
15
+ if ( ! isset( $_SERVER["REQUEST_URI"] ) ) return;
16
+
17
+ $uri = $_SERVER["REQUEST_URI"];
18
+ $wppapos = stripos( $uri, '/wppaspec/' );
19
+ if ( $wppapos === false ) {
20
+
21
+ $wppapos = strpos( $uri, '/-/' );
22
+ if ( wppa_get_option( 'wppa_use_pretty_links' ) != 'compressed' ) {
23
+ $wppapos = false;
24
+ }
25
+ }
26
+
27
+ if ( $wppapos !== false && wppa_get_option( 'permalink_structure' ) ) {
28
+
29
+ // old style solution, still required when qTranslate is active
30
+ $plugins = implode( ',', wppa_get_option( 'active_plugins' ) );
31
+ if ( stripos( $plugins, 'qtranslate' ) !== false ) {
32
+
33
+ $newuri = wppa_convert_from_pretty( $uri );
34
+ if ( $newuri == $uri ) return;
35
+
36
+ // Although the url is urlencoded it is damaged by wp_redirect when it contains chars like ë, so we do a header() call
37
+ header( 'Location: '.$newuri, true, 302 );
38
+ exit;
39
+ }
40
+
41
+ // New style solution
42
+ $newuri = wppa_convert_from_pretty( $uri );
43
+ if ( $newuri == $uri ) return;
44
+ $_SERVER["REQUEST_URI"] = $newuri;
45
+ wppa_convert_uri_to_get( $newuri );
46
+ }
47
+ }
48
+
49
+ /* PARSE QUERYSTRING AND SAVE IN $wppa_query_vars */
50
+ // add_action( 'plugins_loaded', 'wppa_parse_query_string', '2' );
51
+
52
+ function wppa_parse_query_string() {
53
+ global $wppa_query_vars;
54
+ global $wppa_sanitized_query_vars;
55
+ global $wpdb;
56
+
57
+ // Init
58
+ $wppa_query_vars = array_merge( $_GET, $_POST );
59
+
60
+ // Debug
61
+ $wppa_sanitized_query_vars =
62
+ array(
63
+ 'occur',
64
+ 'moccur',
65
+ 'woccur',
66
+ 'topten',
67
+ 'lasten',
68
+ 'comten',
69
+ 'featen',
70
+ 'relcount',
71
+ 'page',
72
+ 'caldate',
73
+ 'calendar-month',
74
+ 'calendar-year',
75
+ 'slug',
76
+ 'size',
77
+ 'fromp',
78
+ 'forceroot',
79
+ 'cover',
80
+ 'slide',
81
+ 'slideonly',
82
+ 'filmonly',
83
+ 'single',
84
+ 'photos-only',
85
+ 'albums-only',
86
+ 'medals-only',
87
+ 'rel',
88
+ 'rootsearch',
89
+ 'potdhis',
90
+ 'debug',
91
+ 'inv',
92
+ 'vt',
93
+ 'catbox',
94
+ 'resp',
95
+ 'searchstring',
96
+ 'supersearch',
97
+ 'lang',
98
+ 'wppalocale',
99
+ 'tag',
100
+ 'calendar',
101
+ 'upldr',
102
+ 'owner',
103
+ 'nonce',
104
+ 'photo',
105
+ 'photos',
106
+ 'hilite',
107
+ 'photo-id',
108
+ 'album',
109
+ 'value',
110
+ 'option',
111
+ 'action',
112
+ 'forceroot',
113
+ 'albumeditsubmit',
114
+ 'comment-id',
115
+ 'comemail',
116
+ 'cache',
117
+ 'commentbtn',
118
+ 'comname',
119
+ 'fe-create',
120
+ 'comment',
121
+ 'p',
122
+ 'page_id',
123
+ 'rating',
124
+ 'rating-id',
125
+ 's',
126
+ 'searchroot',
127
+ 'searchselbox-0',
128
+ 'searchselbox-1',
129
+ 'searchselbox-2',
130
+ 'superview',
131
+ 'upload-album',
132
+ 'user-name',
133
+ 'user-desc',
134
+ 'ntfy-nonce',
135
+ 'qr-nonce',
136
+ 'crypt',
137
+ 'user',
138
+ 'url',
139
+ 'index',
140
+ 'just-edit',
141
+ 'next-after',
142
+ 'filter',
143
+ 'commentid',
144
+ 'commentids',
145
+ 'commenttext',
146
+ 'orderby',
147
+ 'order',
148
+ 'quick',
149
+ 'bulk-status',
150
+ 'bulk-album',
151
+ 'bulk-owner',
152
+ 'set-album',
153
+ 'watermark-file',
154
+ 'watermark-pos',
155
+ 'photo-album',
156
+ 'video-album',
157
+ 'audio-album',
158
+ 'document-album',
159
+ 'del-after-p',
160
+ 'del-after-f',
161
+ 'del-after-a',
162
+ 'del-after-z',
163
+ 'del-after-v',
164
+ 'del-after-u',
165
+ 'del-after-c',
166
+ 'del-after-d',
167
+ 'del-dir',
168
+ 'cre-album',
169
+ 'use-backup',
170
+ 'update',
171
+ 'bulk-action',
172
+ 'import-ajax-file',
173
+ 'import-set-source-dir',
174
+ 'import-set-source-url',
175
+ 'import-submit',
176
+ 'local-remote',
177
+ 'zip',
178
+ 'superview',
179
+ 'nodups',
180
+ 'upn-name',
181
+ 'upn-description',
182
+ 'upn-tags',
183
+ 'del-confirm',
184
+ 'custom_0',
185
+ 'custom_1',
186
+ 'custom_2',
187
+ 'custom_3',
188
+ 'custom_4',
189
+ 'custom_5',
190
+ 'custom_6',
191
+ 'custom_7',
192
+ 'custom_8',
193
+ 'custom_9',
194
+ 'del-id',
195
+ 'del-photos',
196
+ 'move-album',
197
+
198
+ );
199
+
200
+ // Parse and sanitize
201
+ foreach( array_keys( $wppa_query_vars ) as $key ) {
202
+
203
+ // For ajax: Ignore 'action', only look at wppa-action
204
+ if ( $key == 'action' ) continue;
205
+
206
+ // For admin: Igbore 'page', only look at wppa-page
207
+ if ( $key == 'page' ) continue;
208
+
209
+ // Find an arg
210
+ $name = $key;
211
+ $value = $wppa_query_vars[$name];
212
+ if ( substr( $name, 0, 5 ) == 'wppa-' ) {
213
+ unset( $wppa_query_vars[$name] );
214
+ $name = substr( $name, 5 );
215
+ $wppa_query_vars[$name] = $value;
216
+ }
217
+
218
+ // Sanitize
219
+ $is_cryptic = false;
220
+ switch ( $name ) {
221
+
222
+ // Integer
223
+ case 'occur':
224
+ case 'moccur':
225
+ case 'woccur':
226
+ case 'topten':
227
+ case 'lasten':
228
+ case 'comten':
229
+ case 'featen':
230
+ case 'relcount':
231
+ case 'page':
232
+ case 'page_id':
233
+ case 'caldate':
234
+ case 'size':
235
+ case 'fromp':
236
+ case 'forceroot':
237
+ case 'comment-id':
238
+ case 'upload-album':
239
+ case 'user':
240
+ case 'rating':
241
+ case 'index':
242
+ case 'next-after':
243
+ case 'commentid':
244
+ case 'bulk-album':
245
+ case 'set-album':
246
+ case 'photo-album':
247
+ case 'video-album':
248
+ case 'audio-album':
249
+ case 'document-album':
250
+ case 'del-id':
251
+ case 'move-album':
252
+
253
+ $value = strval( intval( $value ) );
254
+ break;
255
+
256
+ // Array of integers
257
+ case 'commentids':
258
+ break;
259
+
260
+ // Boolean
261
+ case 'cover':
262
+ case 'slide':
263
+ case 'slideonly':
264
+ case 'filmonly':
265
+ case 'single':
266
+ case 'photos-only':
267
+ case 'albums-only':
268
+ case 'medals-only':
269
+ case 'rel':
270
+ case 'rootsearch':
271
+ case 'potdhis':
272
+ case 'debug':
273
+ case 'inv':
274
+ case 'vt':
275
+ case 'catbox':
276
+ case 'resp':
277
+ case 'quick':
278
+ case 'continue':
279
+ case 'del-after-p':
280
+ case 'del-after-f':
281
+ case 'del-after-a':
282
+ case 'del-after-z':
283
+ case 'del-after-v':
284
+ case 'del-after-u':
285
+ case 'del-after-c':
286
+ case 'del-after-d':
287
+ case 'del-dir':
288
+ case 'use-backup':
289
+ case 'update':
290
+ case 'superview':
291
+ case 'nodups':
292
+ if ( $value !== '0' && $value != 'nil' ) {
293
+ $value = '1';
294
+ }
295
+ else {
296
+ $value = '0';
297
+ }
298
+ break;
299
+
300
+ // Searchstring
301
+ case 'searchstring':
302
+ $value = wppa_sanitize_searchstring( $value );
303
+ break;
304
+
305
+ // Html
306
+ case 'comment':
307
+ case 'commenttext':
308
+ case 'upn-description':
309
+ if ( current_user_can( 'unfiltered_html' ) ) {
310
+ $value = force_balance_tags( $value );
311
+ }
312
+ else {
313
+ $value = strip_tags( $value );
314
+ }
315
+ break;
316
+
317
+ // Tags / Cats
318
+ case 'tag':
319
+ case 'upn-tags':
320
+ $value = wppa_sanitize_tags( $value );
321
+ break;
322
+
323
+ // Custom data
324
+ case 'custom_0':
325
+ case 'custom_1':
326
+ case 'custom_2':
327
+ case 'custom_3':
328
+ case 'custom_4':
329
+ case 'custom_5':
330
+ case 'custom_6':
331
+ case 'custom_7':
332
+ case 'custom_8':
333
+ case 'custom_9':
334
+ $value = wppa_sanitize_custom_field( $value );
335
+ break;
336
+
337
+ // Textstring expected
338
+ case 'supersearch':
339
+ case 'lang':
340
+ case 'wppalocale':
341
+ case 'calendar':
342
+ case 'upldr':
343
+ case 'owner':
344
+ case 'nonce':
345
+ case 'user-name': // Photo/video name supplied by user
346
+ case 'user-desc': // Desc by user
347
+ case 'ntfy-nonce':
348
+ case 'qr-nonce':
349
+ case 'crypt':
350
+ case 'slug':
351
+ case 'just-edit':
352
+ case 'filter':
353
+ case 'orderby':
354
+ case 'order':
355
+ case 'bulk-status':
356
+ case 'bulk-owner':
357
+ case 'watermark-file':
358
+ case 'watermark-pos':
359
+ case 'cre-album':
360
+ case 'bulk-action':
361
+ case 'action':
362
+ case 'option':
363
+ case 'local-remote':
364
+ case 'upn-name':
365
+ case 'del-confirm':
366
+ case 'del-photos':
367
+
368
+ $value = sanitize_text_field( $value );
369
+ break;
370
+
371
+ // Possibly encrypted or nemed photo(s)
372
+ case 'photo':
373
+ case 'photos':
374
+ case 'hilite':
375
+ case 'photo-id':
376
+ case 'rating-id':
377
+
378
+ // Assume enumeration if multi allowed
379
+ if ( $name == 'photos' ) {
380
+ $values = explode( '.', $value );
381
+ $multi = count( $values ) > 1;
382
+ }
383
+ elseif ( $name == 'photo-id' ) {
384
+ $values = array( trim( $value, '/' ) );
385
+ $multi = false;
386
+ }
387
+ else {
388
+ $values = array( $value );
389
+ $multi = false;
390
+ }
391
+
392
+ foreach ( array_keys( $values ) as $key ) {
393
+
394
+ // Numeric?
395
+ if ( is_numeric( $values[$key] ) ) {
396
+ // Ok
397
+ }
398
+
399
+ // Text?
400
+ else {
401
+
402
+ // Cryptic?
403
+ $val = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE crypt = %s", $values[$key] ) );
404
+ if ( $val ) {
405
+
406
+ $values[$key] = $val;
407
+ $is_cryptic = true;
408
+ }
409
+
410
+ // Name?
411
+ else {
412
+ $val = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE sname = %s", $values[$key] ) );
413
+ if ( $val ) {
414
+
415
+ $values[$key] = $val;
416
+ }
417
+ }
418
+ }
419
+ }
420
+
421
+ $value = implode( '.', $values );
422
+ if ( $multi ) {
423
+ $value = wppa_expand_enum( $value );
424
+ }
425
+ break;
426
+
427
+ // Possibly encrypted or nemed album
428
+ case 'album':
429
+
430
+ // Assume enumeration
431
+ $values = explode( '.', $value );
432
+ $multi = count( $values ) > 1;
433
+
434
+ foreach ( array_keys( $values ) as $key ) {
435
+
436
+ // Numeric?
437
+ if ( is_numeric( $values[$key] ) ) {
438
+ // Ok
439
+ }
440
+
441
+ // Text?
442
+ else {
443
+
444
+ // Cryptic?
445
+ $val = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_albums WHERE crypt = %s", $values[$key] ) );
446
+ if ( is_numeric( $val ) ) {
447
+
448
+ $values[$key] = $val;
449
+ $is_cryptic = true;
450
+ }
451
+
452
+ // Name?
453
+ else {
454
+ $val = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_albums WHERE sname = %s", $values[$key] ) );
455
+ if ( is_numeric( $val ) ) {
456
+
457
+ $values[$key] = $val;
458
+ }
459
+ }
460
+ }
461
+ }
462
+
463
+ $value = implode( '.', $values );
464
+ if ( $multi ) {
465
+ $value = wppa_expand_enum( $value );
466
+ }
467
+ break;
468
+
469
+ // Email
470
+ case 'comemail':
471
+ $value = sanitize_email( $value );
472
+ break;
473
+
474
+ // Url
475
+ case 'url':
476
+ $value = esc_url_raw( $value );
477
+ break;
478
+
479
+ // Unprocessed
480
+ case 'value':
481
+ case 'forceroot':
482
+ case 'albumeditsubmit':
483
+ case 'cache':
484
+ case 'commentbtn': // Buttontext
485
+ case 'comname': // Name of commenter
486
+ case 'fe-create': // Yes
487
+ case 'p':
488
+ case 's':
489
+ case 'searchroot':
490
+ case 'searchselbox-0':
491
+ case 'searchselbox-1':
492
+ case 'searchselbox-2':
493
+ case 'superview':
494
+ case 'calendar-month':
495
+ case 'calendar-year':
496
+ case 'import-ajax-file':
497
+ case 'import-set-source-dir':
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 ) );
504
+ }
505
+ break;
506
+
507
+ default:
508
+ // wppa_dump( 'Unfiltered querystring item found: ' . $key . ', value = ' . var_export( $value, true ) );
509
+ break;
510
+ }
511
+
512
+ // Check for refuse unencrypted
513
+ if ( $name == 'photo' || $name == 'album' ) {
514
+ if ( get_option( 'wppa_use_encrypted_links', 'no' ) == 'yes' && // Encryption enabled
515
+ get_option( 'wppa_refuse_unencrypted', 'no' ) == 'yes' && // Must be encrypted
516
+ ! wppa( 'ajax' ) && // But not needed when ajax
517
+ ! $is_cryptic ) {
518
+ $value = '';
519
+ }
520
+ }
521
+
522
+ // Save if not empty
523
+ if ( $value ) {
524
+ if ( $value == 'nil' ) {
525
+ $value = false;
526
+ }
527
+ $wppa_query_vars[$name] = $value;
528
+ }
529
+ else {
530
+ unset( $wppa_query_vars[$name] );
531
+ }
532
+ }
533
+ }
534
+
535
+ // Retrieve a get- or post- vareiable, sanitized and post-processed
536
+ function wppa_get( $xname, $default = false ) {
537
+ global $wppa_query_vars;
538
+ global $wppa_sanitized_query_vars;
539
+
540
+ // Non wppa ajax call?
541
+ if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] != 'wppa' ) {
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 );
553
+ }
554
+ else {
555
+ $name = $xname;
556
+ }
557
+
558
+ // See if set
559
+ if ( isset( $wppa_query_vars[$name] ) ) {
560
+ return $wppa_query_vars[$name];
561
+ }
562
+
563
+ // Not set
564
+ else {
565
+
566
+ // Start debug
567
+ if ( ! in_array( $name, $wppa_sanitized_query_vars ) ) {
568
+ $t = get_option( 'wppa_unfiltered_qvars', array() );
569
+ if ( ! in_array( $name, $t ) ) {
570
+ $t[] = $name;
571
+ sort( $t );
572
+ update_option( 'wppa_unfiltered_qvars', $t );
573
+ $a = array_merge( $_GET, $_POST );
574
+ if ( count( $a ) ) {
575
+ wppa_dump( $name . ' in ' . var_export( $a, true ) );
576
+ }
577
+ }
578
+ }
579
+ // End debug
580
+
581
+ return $default;
582
+ }
583
+ }
584
+
585
+ // Sanitize a searchstring
586
+ function wppa_sanitize_searchstring( $str ) {
587
+
588
+ $result = $str;
589
+ $result = strip_tags( $result );
590
+ $result = stripslashes( $result );
591
+ $result = str_replace( array( "'", '"', ':', ), '', $result );
592
+ $temp = explode( ',', $result );
593
+ foreach ( array_keys( $temp ) as $key ) {
594
+ $temp[$key] = trim( $temp[$key] );
595
+ }
596
+ $result = implode( ',', $temp );
597
+
598
+ return $result;
599
+ }
wppa-links.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Frontend links
6
 
7
- * Version 8.0.06.004
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -28,9 +28,9 @@ global $wppa_locale;
28
  }
29
  else {
30
  if ( wppa( 'ajax' ) ) {
31
- if ( wppa_get_get( 'page_id' ) ) $id = wppa_get_get( 'page_id' );
32
- elseif ( wppa_get_get( 'p' ) ) $id = wppa_get_get( 'p' );
33
- elseif ( wppa_get_get( 'fromp' ) ) $id = wppa_get_get( 'fromp' );
34
  else $id = '';
35
  $pl = get_permalink( intval( $id ) );
36
  if ( $plain ) return $pl;
@@ -54,9 +54,9 @@ global $wppa_locale;
54
  }
55
  else {
56
  if ( wppa( 'ajax' ) ) {
57
- if ( wppa_get_get( 'page_id' ) ) $id = wppa_get_get( 'page_id' );
58
- elseif ( wppa_get_get( 'p' ) ) $id = wppa_get_get( 'p' );
59
- elseif ( wppa_get_get( 'fromp' ) ) $id = wppa_get_get( 'fromp' );
60
  else $id = '';
61
  $pl = get_permalink( intval( $id ) );
62
  if ( $plain ) return $pl;
@@ -79,7 +79,7 @@ global $wppa_locale;
79
  break;
80
  }
81
 
82
- if ( wppa_get_get( 'lang' ) ) { // If lang in querystring: keep it
83
  if ( strpos( $pl, 'lang=' ) === false ) { // Not yet
84
  if ( $key == 'js' ) $pl .= 'lang=' . $wppa_lang . '&';
85
  else $pl .= 'lang=' . $wppa_lang . '&amp;';
@@ -141,16 +141,16 @@ global $wppa_runtime_settings;
141
  */
142
  // See if this call is from an ajax operation or...
143
  if ( wppa( 'ajax' ) ) {
144
- if ( wppa_get_get( 'size' ) ) $al .= '&amp;wppa-size=' . wppa_get_get( 'size' );
145
- if ( wppa_get_get( 'moccur' ) ) $al .= '&amp;wppa-moccur=' . ( wppa_get_get( 'moccur' ) + $deltamoccur );
146
  if ( is_numeric( $key ) && $key > '0' ) {
147
  $al .= '&amp;page_id='.$key;
148
  }
149
  else {
150
- if ( wppa_get_get( 'page_id' ) ) $al .= '&amp;page_id=' . wppa_get_get( 'page_id' );
151
  }
152
- if ( wppa_get_get( 'p' ) ) $al .= '&amp;p=' . wppa_get_get( 'p' );
153
- if ( wppa_get_get( 'fromp' ) ) $al .= '&amp;wppa-fromp=' . wppa_get_get( 'fromp' );
154
  }
155
  else { // directly from a page or post
156
  $al .= '&amp;wppa-size='.wppa_get_container_width();
@@ -159,13 +159,13 @@ global $wppa_runtime_settings;
159
  $al .= '&amp;page_id=' . $key;
160
  }
161
  else {
162
- if ( wppa_get_get( 'p' ) ) $al .= '&amp;p=' . wppa_get_get( 'p' );
163
- if ( wppa_get_get( 'page_id' ) ) $al .= '&amp;page_id=' . wppa_get_get( 'page_id' );
164
  }
165
  $al .= '&amp;wppa-fromp=' . wppa_get_the_ID();
166
  }
167
 
168
- if ( wppa_get_get( 'lang' ) ) { // If lang in querystring: keep it
169
  if ( strpos($al, 'lang=') === false ) { // Not yet
170
  if ( $key == 'js' ) $al .= '&lang=' . $wppa_lang;
171
  else $al .= '&amp;lang=' . $wppa_lang;
@@ -1160,19 +1160,19 @@ global $previous_page_last_id;
1160
  $ajax_url = wppa_get_ajaxlink();
1161
 
1162
  // cover
1163
- if ( wppa_get_get( 'cover' ) ) $ic = wppa_get_get( 'cover' );
1164
  else {
1165
  if ( wppa( 'is_cover' ) == '1' ) $ic = '1'; else $ic = '0';
1166
  }
1167
  $extra_url = 'wppa-cover='.$ic;
1168
 
1169
  // occur
1170
- $occur = wppa_in_widget() ? wppa_get_get('woccur') : wppa_get_get('occur');
1171
  $ref_occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' );
1172
 
1173
  // album
1174
- if ( ( $occur == $ref_occur || wppa( 'ajax' ) ) && wppa_get_get('album') ) {
1175
- $alb = wppa_get_get( 'album' );
1176
  }
1177
  elseif ( wppa( 'start_album' ) ) {
1178
  $alb = wppa( 'start_album' );
@@ -1186,8 +1186,8 @@ global $previous_page_last_id;
1186
  if ( $slide ) {
1187
  $extra_url .= '&amp;wppa-slide=1';
1188
  }
1189
- elseif ( wppa_get_get( 'photo' ) ) {
1190
- $extra_url .= '&amp;wppa-photo=' . wppa_get_get( 'photo' );
1191
  }
1192
 
1193
  // occur
@@ -1197,12 +1197,12 @@ global $previous_page_last_id;
1197
  $extra_url .= '&amp;wppa-' . $w . 'occur=' . $occur;
1198
  }
1199
  else {
1200
- if ( wppa_get_get( 'occur' ) ) {
1201
- $occur = wppa_get_get( 'occur' );
1202
  $extra_url .= '&amp;wppa-occur=' . strval( intval( $occur ) );
1203
  }
1204
- elseif ( wppa_get_get( 'woccur' ) ) {
1205
- $occur = wppa_get_get( 'woccur' );
1206
  $extra_url .= '&amp;wppa-woccur=' . strval( intval( $occur ) );
1207
  }
1208
  else {
@@ -2373,8 +2373,8 @@ global $wppa_locale;
2373
  if ( wppa( 'month' ) ) $url .= 'wppa-calendar-month=' . wppa( 'month' ) . '&';
2374
  if ( wppa( 'is_inverse' ) ) $url .= 'wppa-inv=1&';
2375
  if ( wppa( 'cache' ) ) $url .= 'wppa-cache=' . wppa( 'cache' ) . '&';
2376
- elseif ( wppa_get_get( 'cache' ) ) {
2377
- $url .= 'wppa-cache=' . wppa_get_get( 'cache' ) . '&';
2378
  }
2379
 
2380
  $url = rtrim( $url, '&' );
4
  *
5
  * Frontend links
6
 
7
+ * Version 8.0.07.001
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
28
  }
29
  else {
30
  if ( wppa( 'ajax' ) ) {
31
+ if ( wppa_get( 'page_id' ) ) $id = wppa_get( 'page_id' );
32
+ elseif ( wppa_get( 'p' ) ) $id = wppa_get( 'p' );
33
+ elseif ( wppa_get( 'fromp' ) ) $id = wppa_get( 'fromp' );
34
  else $id = '';
35
  $pl = get_permalink( intval( $id ) );
36
  if ( $plain ) return $pl;
54
  }
55
  else {
56
  if ( wppa( 'ajax' ) ) {
57
+ if ( wppa_get( 'page_id' ) ) $id = wppa_get( 'page_id' );
58
+ elseif ( wppa_get( 'p' ) ) $id = wppa_get( 'p' );
59
+ elseif ( wppa_get( 'fromp' ) ) $id = wppa_get( 'fromp' );
60
  else $id = '';
61
  $pl = get_permalink( intval( $id ) );
62
  if ( $plain ) return $pl;
79
  break;
80
  }
81
 
82
+ if ( wppa_get( 'lang' ) ) { // If lang in querystring: keep it
83
  if ( strpos( $pl, 'lang=' ) === false ) { // Not yet
84
  if ( $key == 'js' ) $pl .= 'lang=' . $wppa_lang . '&';
85
  else $pl .= 'lang=' . $wppa_lang . '&amp;';
141
  */
142
  // See if this call is from an ajax operation or...
143
  if ( wppa( 'ajax' ) ) {
144
+ if ( wppa_get( 'size' ) ) $al .= '&amp;wppa-size=' . wppa_get( 'size' );
145
+ if ( wppa_get( 'moccur' ) ) $al .= '&amp;wppa-moccur=' . ( wppa_get( 'moccur' ) + $deltamoccur );
146
  if ( is_numeric( $key ) && $key > '0' ) {
147
  $al .= '&amp;page_id='.$key;
148
  }
149
  else {
150
+ if ( wppa_get( 'page_id' ) ) $al .= '&amp;page_id=' . wppa_get( 'page_id' );
151
  }
152
+ if ( wppa_get( 'p' ) ) $al .= '&amp;p=' . wppa_get( 'p' );
153
+ if ( wppa_get( 'fromp' ) ) $al .= '&amp;wppa-fromp=' . wppa_get( 'fromp' );
154
  }
155
  else { // directly from a page or post
156
  $al .= '&amp;wppa-size='.wppa_get_container_width();
159
  $al .= '&amp;page_id=' . $key;
160
  }
161
  else {
162
+ if ( wppa_get( 'p' ) ) $al .= '&amp;p=' . wppa_get( 'p' );
163
+ if ( wppa_get( 'page_id' ) ) $al .= '&amp;page_id=' . wppa_get( 'page_id' );
164
  }
165
  $al .= '&amp;wppa-fromp=' . wppa_get_the_ID();
166
  }
167
 
168
+ if ( wppa_get( 'lang' ) ) { // If lang in querystring: keep it
169
  if ( strpos($al, 'lang=') === false ) { // Not yet
170
  if ( $key == 'js' ) $al .= '&lang=' . $wppa_lang;
171
  else $al .= '&amp;lang=' . $wppa_lang;
1160
  $ajax_url = wppa_get_ajaxlink();
1161
 
1162
  // cover
1163
+ if ( wppa_get( 'cover' ) ) $ic = wppa_get( 'cover' );
1164
  else {
1165
  if ( wppa( 'is_cover' ) == '1' ) $ic = '1'; else $ic = '0';
1166
  }
1167
  $extra_url = 'wppa-cover='.$ic;
1168
 
1169
  // occur
1170
+ $occur = wppa_in_widget() ? wppa_get('woccur') : wppa_get('occur');
1171
  $ref_occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' );
1172
 
1173
  // album
1174
+ if ( ( $occur == $ref_occur || wppa( 'ajax' ) ) && wppa_get('album') ) {
1175
+ $alb = wppa_get( 'album' );
1176
  }
1177
  elseif ( wppa( 'start_album' ) ) {
1178
  $alb = wppa( 'start_album' );
1186
  if ( $slide ) {
1187
  $extra_url .= '&amp;wppa-slide=1';
1188
  }
1189
+ elseif ( wppa_get( 'photo' ) ) {
1190
+ $extra_url .= '&amp;wppa-photo=' . wppa_get( 'photo' );
1191
  }
1192
 
1193
  // occur
1197
  $extra_url .= '&amp;wppa-' . $w . 'occur=' . $occur;
1198
  }
1199
  else {
1200
+ if ( wppa_get( 'occur' ) ) {
1201
+ $occur = wppa_get( 'occur' );
1202
  $extra_url .= '&amp;wppa-occur=' . strval( intval( $occur ) );
1203
  }
1204
+ elseif ( wppa_get( 'woccur' ) ) {
1205
+ $occur = wppa_get( 'woccur' );
1206
  $extra_url .= '&amp;wppa-woccur=' . strval( intval( $occur ) );
1207
  }
1208
  else {
2373
  if ( wppa( 'month' ) ) $url .= 'wppa-calendar-month=' . wppa( 'month' ) . '&';
2374
  if ( wppa( 'is_inverse' ) ) $url .= 'wppa-inv=1&';
2375
  if ( wppa( 'cache' ) ) $url .= 'wppa-cache=' . wppa( 'cache' ) . '&';
2376
+ elseif ( wppa_get( 'cache' ) ) {
2377
+ $url .= 'wppa-cache=' . wppa_get( 'cache' ) . '&';
2378
  }
2379
 
2380
  $url = rtrim( $url, '&' );
wppa-maintenance.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
- * Version 8.0.04.004
7
  *
8
  */
9
 
@@ -1231,6 +1231,8 @@ global $wppa_endtime;
1231
  wppa_log( 'Obs', 'Maintenance proc {b}' . $slug . '{/b} completed' );
1232
  }
1233
 
 
 
1234
  }
1235
 
1236
  if ( wppa_is_cron() ) {
@@ -1247,7 +1249,7 @@ global $wppa_endtime;
1247
  else {
1248
  return $errtxt.'||'.$slug.'||'.$status.'||'.$togo.'||'.$reload;
1249
  }
1250
- wppa_clear_cache();
1251
  wppa_exit();
1252
  }
1253
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 8.0.07.002
7
  *
8
  */
9
 
1231
  wppa_log( 'Obs', 'Maintenance proc {b}' . $slug . '{/b} completed' );
1232
  }
1233
 
1234
+ // Always clear cache after a maintenance proc ended
1235
+ wppa_clear_cache();
1236
  }
1237
 
1238
  if ( wppa_is_cron() ) {
1249
  else {
1250
  return $errtxt.'||'.$slug.'||'.$status.'||'.$togo.'||'.$reload;
1251
  }
1252
+
1253
  wppa_exit();
1254
  }
1255
 
wppa-non-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
- * Version 8.0.02.006
7
  *
8
  */
9
 
@@ -64,7 +64,7 @@ function wppa_add_metatags() {
64
  global $wpdb;
65
 
66
  // Share info for sm that uses og
67
- $id = wppa_get_get( 'photo' );
68
  if ( ! wppa_photo_exists( $id ) ) {
69
  $id = false;
70
  }
@@ -159,7 +159,7 @@ echo '
159
  // To make sure we are on a page that contains at least [wppa] we check for Get var 'wppa-album'.
160
  // This also narrows the selection of featured photos to those that exist in the current album.
161
  $done = array();
162
- $album = wppa_get_get( 'album' );
163
 
164
  if ( $album ) {
165
  if ( wppa_switch( 'meta_page' ) ) {
@@ -390,47 +390,6 @@ global $wppa_locale;
390
  }
391
  }
392
 
393
- /* CHECK REDIRECTION */
394
- add_action( 'plugins_loaded', 'wppa_redirect', '1' );
395
-
396
- function wppa_redirect() {
397
-
398
- if ( ! isset( $_SERVER["REQUEST_URI"] ) ) return;
399
-
400
- $uri = $_SERVER["REQUEST_URI"];
401
- $wppapos = stripos( $uri, '/wppaspec/' );
402
- if ( $wppapos === false ) {
403
-
404
- $wppapos = strpos( $uri, '/-/' );
405
- if ( wppa_get_option( 'wppa_use_pretty_links' ) != 'compressed' ) {
406
- $wppapos = false;
407
- }
408
- }
409
-
410
- if ( $wppapos !== false && wppa_get_option( 'permalink_structure' ) ) {
411
-
412
- // old style solution, still required when qTranslate is active
413
- $plugins = implode( ',', wppa_get_option( 'active_plugins' ) );
414
- if ( stripos( $plugins, 'qtranslate' ) !== false ) {
415
-
416
- $newuri = wppa_convert_from_pretty( $uri );
417
- if ( $newuri == $uri ) return;
418
-
419
- // Although the url is urlencoded it is damaged by wp_redirect when it contains chars like �, so we do a header() call
420
- header( 'Location: '.$newuri, true, 302 );
421
- exit;
422
- }
423
-
424
- // New style solution
425
- $newuri = wppa_convert_from_pretty( $uri );
426
- if ( $newuri == $uri ) return;
427
- $_SERVER["REQUEST_URI"] = $newuri;
428
- wppa_convert_uri_to_get( $newuri );
429
- }
430
- }
431
-
432
-
433
-
434
  /* ENABLE RENDERING */
435
  add_action( 'wp_head', 'wppa_kickoff', '100' );
436
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
+ * Version 8.0.07.001
7
  *
8
  */
9
 
64
  global $wpdb;
65
 
66
  // Share info for sm that uses og
67
+ $id = wppa_get( 'photo' );
68
  if ( ! wppa_photo_exists( $id ) ) {
69
  $id = false;
70
  }
159
  // To make sure we are on a page that contains at least [wppa] we check for Get var 'wppa-album'.
160
  // This also narrows the selection of featured photos to those that exist in the current album.
161
  $done = array();
162
+ $album = wppa_get( 'album' );
163
 
164
  if ( $album ) {
165
  if ( wppa_switch( 'meta_page' ) ) {
390
  }
391
  }
392
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
393
  /* ENABLE RENDERING */
394
  add_action( 'wp_head', 'wppa_kickoff', '100' );
395
 
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.02.006
7
  *
8
  */
9
 
@@ -16,8 +16,8 @@ function _wppa_edit_photo() {
16
  wppa_vfy_arg( 'photo' );
17
 
18
  // Edit one Photo
19
- if ( isset( $_GET['photo'] ) ) {
20
- $photo = strval( intval( $_GET['photo'] ) );
21
  $thumb = wppa_cache_thumb( $photo );
22
  if ( $thumb['owner'] == wppa_get_user() ) {
23
  echo '
@@ -48,13 +48,13 @@ function _wppa_moderate_photos() {
48
 
49
  // Check input and get photo id if any
50
  $photo = wppa_vfy_arg( 'photo' );
51
- $just_edit = isset( $_GET['just-edit'] );
52
 
53
  if ( $photo && $just_edit && wppa_user_is( 'administrator' ) ) {
54
  echo '
55
  <div class="wrap" >
56
  <h2>' . __( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>';
57
- echo htmlspecialchars( $_GET['just-edit'] );
58
  wppa_album_photos( '', $photo, '', false );
59
  echo '
60
  </div>';
@@ -78,11 +78,9 @@ function _wppa_moderate_photos() {
78
  function wppa_album_photos( $album = '', $photo = '', $owner = '', $moderate = false ) {
79
  global $wpdb;
80
 
81
- // Check input
82
- wppa_vfy_arg( 'wppa-page' );
83
-
84
  $pagesize = wppa_opt( 'photo_admin_pagesize' );
85
- $page = isset ( $_GET['wppa-page'] ) ? strval( intval( $_GET['wppa-page'] ) ) : '1';
 
86
  $skip = ( $page - '1' ) * $pagesize;
87
 
88
  // Edit the photos in a specific album
@@ -98,7 +96,7 @@ global $wpdb;
98
  '&tab=edit' .
99
  '&edit_id=' . $album .
100
  '&wppa_nonce=' . wp_create_nonce('wppa_nonce') .
101
- '&wppa-searchstring=' . wppa_sanitize_searchstring( $_REQUEST['wppa-searchstring'] )
102
  );
103
  }
104
 
@@ -118,7 +116,7 @@ global $wpdb;
118
 
119
  // A single photo
120
  elseif ( $album == 'single' ) {
121
- $p = strval( intval( $_REQUEST['photo'] ) );
122
  $count = $p ? 1 : 0;
123
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
124
  WHERE id = %d", $p ), ARRAY_A );
@@ -256,8 +254,8 @@ global $wpdb;
256
  }
257
 
258
  // Quick edit skips a few time consuming settings like copy and move to other album
259
- $quick = isset( $_REQUEST['quick'] );
260
- if ( $link && $quick ) $link .= '&quick';
261
 
262
  // In case it is a seaerch and edit, show the search statistics
263
  wppa_show_search_statistics();
@@ -280,7 +278,7 @@ global $wpdb;
280
  else {
281
 
282
  // Search
283
- if ( isset( $_REQUEST['wppa-searchstring'] ) ) {
284
  echo '
285
  <h3>' .
286
  __( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . '
@@ -593,7 +591,7 @@ function wppaToggleExif( id, count ) {
593
  'botlft' => __( 'bottom - left' , 'wp-photo-album-plus'), 'botcen' => __( 'bottom - center' , 'wp-photo-album-plus'), 'botrht' => __( 'bottom - right' , 'wp-photo-album-plus'), );
594
 
595
  // Album for moderate
596
- if ( $modalbum != $album && $album && ! isset( $_GET['just-edit'] ) && isset( $_GET['edit-id'] ) && $_GET['edit=id'] != 'trash' ) {
597
  echo '<h3>' . sprintf( __( 'Edit/Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
598
  '<i>' . sanitize_text_field( wppa_get_album_name( $album ) ) . '</i>',
599
  '<i>' . sanitize_user( wppa_get_album_item( $album, 'owner' ) ) . '</i>' ) . '</h3>';
@@ -2510,9 +2508,6 @@ function wppaToggleExif( id, count ) {
2510
  function wppa_album_photos_bulk( $album ) {
2511
  global $wpdb;
2512
 
2513
- // Check input
2514
- wppa_vfy_arg( 'wppa-page' );
2515
-
2516
  if ( $album == 'moderate' ) {
2517
  // Can i moderate?
2518
  if ( ! current_user_can( 'wppa_moderate' ) ) {
@@ -2524,10 +2519,10 @@ function wppa_album_photos_bulk( $album ) {
2524
  $count = '0';
2525
  $abort = false;
2526
 
2527
- if ( isset ( $_POST['wppa-bulk-action'] ) ) {
2528
  check_admin_referer( 'wppa-bulk', 'wppa-bulk' );
2529
- if ( isset ( $_POST['wppa-bulk-photo'] ) ) {
2530
- $ids = $_POST['wppa-bulk-photo'];
2531
  $newalb = htmlspecialchars( isset ( $_POST['wppa-bulk-album'] ) ? $_POST['wppa-bulk-album'] : '0' );
2532
  $status = htmlspecialchars( isset ( $_POST['wppa-bulk-status'] ) ? $_POST['wppa-bulk-status'] : '' );
2533
  $owner = htmlspecialchars( isset ( $_POST['wppa-bulk-owner'] ) ? $_POST['wppa-bulk-owner'] : '' );
@@ -2657,7 +2652,9 @@ function wppa_album_photos_bulk( $album ) {
2657
 
2658
  $pagesize = wppa_opt( 'photo_admin_pagesize' ) ? wppa_opt( 'photo_admin_pagesize' ) : '20';
2659
  $next_after = isset ( $_REQUEST['next-after'] ) ? strval( intval( $_REQUEST['next-after'] ) ) : '0';
2660
- $page = ( isset( $_GET['wppa-page'] ) ? max( strval( intval( $_GET['wppa-page'] ) ), '1' ) : '1' ) + ( isset( $_POST['next-after'] ) ? $_POST['next-after'] : '0' );
 
 
2661
  $skip = ( $page > '0' ? ( $page - '1' ) * $pagesize : '0' );
2662
 
2663
  if ( $album ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 8.0.07.001
7
  *
8
  */
9
 
16
  wppa_vfy_arg( 'photo' );
17
 
18
  // Edit one Photo
19
+ if ( wppa_get( 'photo' ) ) {
20
+ $photo = wppa_get( 'photo' );
21
  $thumb = wppa_cache_thumb( $photo );
22
  if ( $thumb['owner'] == wppa_get_user() ) {
23
  echo '
48
 
49
  // Check input and get photo id if any
50
  $photo = wppa_vfy_arg( 'photo' );
51
+ $just_edit = wppa_get( 'just-edit' );
52
 
53
  if ( $photo && $just_edit && wppa_user_is( 'administrator' ) ) {
54
  echo '
55
  <div class="wrap" >
56
  <h2>' . __( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>';
57
+ echo wppa_get( 'just-edit' );
58
  wppa_album_photos( '', $photo, '', false );
59
  echo '
60
  </div>';
78
  function wppa_album_photos( $album = '', $photo = '', $owner = '', $moderate = false ) {
79
  global $wpdb;
80
 
 
 
 
81
  $pagesize = wppa_opt( 'photo_admin_pagesize' );
82
+ $page = wppa_get( 'page' );
83
+ if ( ! is_numeric( $page ) ) $page = 1;
84
  $skip = ( $page - '1' ) * $pagesize;
85
 
86
  // Edit the photos in a specific album
96
  '&tab=edit' .
97
  '&edit_id=' . $album .
98
  '&wppa_nonce=' . wp_create_nonce('wppa_nonce') .
99
+ '&wppa-searchstring=' . wppa_get( 'searchstring' )
100
  );
101
  }
102
 
116
 
117
  // A single photo
118
  elseif ( $album == 'single' ) {
119
+ $p = wppa_get( 'photo' );
120
  $count = $p ? 1 : 0;
121
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
122
  WHERE id = %d", $p ), ARRAY_A );
254
  }
255
 
256
  // Quick edit skips a few time consuming settings like copy and move to other album
257
+ $quick = wppa_get( 'quick' );
258
+ if ( $link && $quick ) $link .= '&quick=1';
259
 
260
  // In case it is a seaerch and edit, show the search statistics
261
  wppa_show_search_statistics();
278
  else {
279
 
280
  // Search
281
+ if ( wppa_get( 'searchstring' ) ) {
282
  echo '
283
  <h3>' .
284
  __( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . '
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' ) && 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>';
2508
  function wppa_album_photos_bulk( $album ) {
2509
  global $wpdb;
2510
 
 
 
 
2511
  if ( $album == 'moderate' ) {
2512
  // Can i moderate?
2513
  if ( ! current_user_can( 'wppa_moderate' ) ) {
2519
  $count = '0';
2520
  $abort = false;
2521
 
2522
+ if ( wppa_get( 'bulk-action' ) ) {
2523
  check_admin_referer( 'wppa-bulk', 'wppa-bulk' );
2524
+ if ( wppa_get( 'bulk-photo' ) ) {
2525
+ $ids = wppa_get( 'bulk-photo' );
2526
  $newalb = htmlspecialchars( isset ( $_POST['wppa-bulk-album'] ) ? $_POST['wppa-bulk-album'] : '0' );
2527
  $status = htmlspecialchars( isset ( $_POST['wppa-bulk-status'] ) ? $_POST['wppa-bulk-status'] : '' );
2528
  $owner = htmlspecialchars( isset ( $_POST['wppa-bulk-owner'] ) ? $_POST['wppa-bulk-owner'] : '' );
2652
 
2653
  $pagesize = wppa_opt( 'photo_admin_pagesize' ) ? wppa_opt( 'photo_admin_pagesize' ) : '20';
2654
  $next_after = isset ( $_REQUEST['next-after'] ) ? strval( intval( $_REQUEST['next-after'] ) ) : '0';
2655
+ $p = wppa_get( 'page' );
2656
+ if ( ! is_numeric( $p ) ) $p = 0;
2657
+ $page = ( $p ? max( wppa_get( 'page' ), '1' ) : '1' ) + wppa_get( 'next-after' );
2658
  $skip = ( $page > '0' ? ( $page - '1' ) * $pagesize : '0' );
2659
 
2660
  if ( $album ) {
wppa-session.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all session routines
6
- * Version 7.5.03
7
  *
8
  * Firefox modifies data in the superglobal $_SESSION.
9
  * See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
@@ -114,8 +114,8 @@ global $wppa_session;
114
 
115
  // Get info for root and sub search
116
  if ( isset( $_REQUEST['wppa-search-submit'] ) ) {
117
- $wppa_session['rootbox'] = wppa_get_get( 'rootsearch' ) || wppa_get_post( 'rootsearch' );
118
- $wppa_session['subbox'] = wppa_get_get( 'subsearch' ) || wppa_get_post( 'subsearch' );
119
  if ( $wppa_session['subbox'] ) {
120
  if ( isset ( $wppa_session['use_searchstring'] ) ) {
121
  $t = explode( ',', $wppa_session['use_searchstring'] );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all session routines
6
+ * Version 8.0.07.001
7
  *
8
  * Firefox modifies data in the superglobal $_SESSION.
9
  * See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
114
 
115
  // Get info for root and sub search
116
  if ( isset( $_REQUEST['wppa-search-submit'] ) ) {
117
+ $wppa_session['rootbox'] = wppa_get( 'rootsearch' ) || wppa_get( 'rootsearch' );
118
+ $wppa_session['subbox'] = wppa_get( 'subsearch' ) || wppa_get( 'subsearch' );
119
  if ( $wppa_session['subbox'] ) {
120
  if ( isset ( $wppa_session['use_searchstring'] ) ) {
121
  $t = explode( ',', $wppa_session['use_searchstring'] );
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 8.0.06.001
7
  *
8
  */
9
 
@@ -2197,6 +2197,7 @@ global $wppa_subtab_names;
2197
  'optionclass' => 'potd_album',
2198
  'selected' => wppa_get_option( 'wppa_potd_album' ),
2199
  'multiple' => true,
 
2200
  ) ) .
2201
  wppa_setting_star( 'wppaRefreshAfter();' ) . '
2202
  </select>
@@ -2790,47 +2791,50 @@ global $wppa_subtab_names;
2790
  $html = wppa_checkbox($slug);
2791
  wppa_setting_new($slug, '8', $name, $desc, $html, $help, wppa_switch('enable_audio'));
2792
 
2793
- $name = __('Popup name', 'wp-photo-album-plus');
2794
- $desc = __('Display Thumbnail name on popup.', 'wp-photo-album-plus');
2795
- $help = __('Display photo name under thumbnail images on the popup.', 'wp-photo-album-plus');
2796
- $slug = 'wppa_popup_text_name';
2797
- $html = wppa_checkbox($slug);
2798
- wppa_setting_new($slug, '9', $name, $desc, $html, $help);
2799
 
2800
- $name = __('Popup (owner)', 'wp-photo-album-plus');
2801
- $desc = __('Display owner on popup.', 'wp-photo-album-plus');
2802
- $help = __('Display photo owner under thumbnail images on the popup.', 'wp-photo-album-plus');
2803
- $slug = 'wppa_popup_text_owner';
2804
- $html = wppa_checkbox($slug);
2805
- wppa_setting_new($slug, '10', $name, $desc, $html, $help);
2806
 
2807
- $name = __('Popup desc', 'wp-photo-album-plus');
2808
- $desc = __('Display Thumbnail description on popup.', 'wp-photo-album-plus');
2809
- $help = __('Display description of the photo under thumbnail images on the popup.', 'wp-photo-album-plus');
2810
- $slug = 'wppa_popup_text_desc';
2811
- $html = wppa_checkbox($slug);
2812
- wppa_setting_new($slug, '11', $name, $desc, $html, $help);
2813
 
2814
- $name = __('Popup desc no links', 'wp-photo-album-plus');
2815
- $desc = __('Strip html anchor tags from descriptions on popups', 'wp-photo-album-plus');
2816
- $help = __('Use this option to prevent the display of links that cannot be activated.', 'wp-photo-album-plus');
2817
- $slug = 'wppa_popup_text_desc_strip';
2818
- $html = wppa_checkbox($slug);
2819
- wppa_setting_new($slug, '12', $name, $desc, $html, $help);
2820
 
2821
- $name = __('Popup rating', 'wp-photo-album-plus');
2822
- $desc = __('Display Thumbnail Rating on popup.', 'wp-photo-album-plus');
2823
- $help = __('Display the rating of the photo under the thumbnail image on the popup.', 'wp-photo-album-plus');
2824
- $slug = 'wppa_popup_text_rating';
2825
- $html = wppa_checkbox($slug);
2826
- wppa_setting_new($slug, '13', $name, $desc, $html, $help, wppa_switch('rating_on'));
2827
 
2828
- $name = __('Popup comcount', 'wp-photo-album-plus');
2829
- $desc = __('Display Thumbnail Comment count on popup.', 'wp-photo-album-plus');
2830
- $help = __('Display the number of comments of the photo under the thumbnail image on the popup.', 'wp-photo-album-plus');
2831
- $slug = 'wppa_popup_text_ncomments';
2832
- $html = wppa_checkbox($slug);
2833
- wppa_setting_new($slug, '14', $name, $desc, $html, $help, wppa_switch('show_comments'));
 
 
 
 
 
 
 
 
2834
 
2835
  $name = __('Show album name on thumb area', 'wp-photo-album-plus');
2836
  $desc = __('Select if and where to display the album name on the thumbnail display.', 'wp-photo-album-plus');
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.0.07.001
7
  *
8
  */
9
 
2197
  'optionclass' => 'potd_album',
2198
  'selected' => wppa_get_option( 'wppa_potd_album' ),
2199
  'multiple' => true,
2200
+ 'sort' => true,
2201
  ) ) .
2202
  wppa_setting_star( 'wppaRefreshAfter();' ) . '
2203
  </select>
2791
  $html = wppa_checkbox($slug);
2792
  wppa_setting_new($slug, '8', $name, $desc, $html, $help, wppa_switch('enable_audio'));
2793
 
2794
+ if ( wppa_switch( 'use_thumb_popup' ) ) {
 
 
 
 
 
2795
 
2796
+ $name = __('Popup name', 'wp-photo-album-plus');
2797
+ $desc = __('Display Thumbnail name on popup.', 'wp-photo-album-plus');
2798
+ $help = __('Display photo name under thumbnail images on the popup.', 'wp-photo-album-plus');
2799
+ $slug = 'wppa_popup_text_name';
2800
+ $html = wppa_checkbox($slug);
2801
+ wppa_setting_new($slug, '9', $name, $desc, $html, $help);
2802
 
2803
+ $name = __('Popup (owner)', 'wp-photo-album-plus');
2804
+ $desc = __('Display owner on popup.', 'wp-photo-album-plus');
2805
+ $help = __('Display photo owner under thumbnail images on the popup.', 'wp-photo-album-plus');
2806
+ $slug = 'wppa_popup_text_owner';
2807
+ $html = wppa_checkbox($slug);
2808
+ wppa_setting_new($slug, '10', $name, $desc, $html, $help);
2809
 
2810
+ $name = __('Popup desc', 'wp-photo-album-plus');
2811
+ $desc = __('Display Thumbnail description on popup.', 'wp-photo-album-plus');
2812
+ $help = __('Display description of the photo under thumbnail images on the popup.', 'wp-photo-album-plus');
2813
+ $slug = 'wppa_popup_text_desc';
2814
+ $html = wppa_checkbox($slug);
2815
+ wppa_setting_new($slug, '11', $name, $desc, $html, $help);
2816
 
2817
+ $name = __('Popup desc no links', 'wp-photo-album-plus');
2818
+ $desc = __('Strip html anchor tags from descriptions on popups', 'wp-photo-album-plus');
2819
+ $help = __('Use this option to prevent the display of links that cannot be activated.', 'wp-photo-album-plus');
2820
+ $slug = 'wppa_popup_text_desc_strip';
2821
+ $html = wppa_checkbox($slug);
2822
+ wppa_setting_new($slug, '12', $name, $desc, $html, $help);
2823
 
2824
+ $name = __('Popup rating', 'wp-photo-album-plus');
2825
+ $desc = __('Display Thumbnail Rating on popup.', 'wp-photo-album-plus');
2826
+ $help = __('Display the rating of the photo under the thumbnail image on the popup.', 'wp-photo-album-plus');
2827
+ $slug = 'wppa_popup_text_rating';
2828
+ $html = wppa_checkbox($slug);
2829
+ wppa_setting_new($slug, '13', $name, $desc, $html, $help, wppa_switch('rating_on'));
2830
+
2831
+ $name = __('Popup comcount', 'wp-photo-album-plus');
2832
+ $desc = __('Display Thumbnail Comment count on popup.', 'wp-photo-album-plus');
2833
+ $help = __('Display the number of comments of the photo under the thumbnail image on the popup.', 'wp-photo-album-plus');
2834
+ $slug = 'wppa_popup_text_ncomments';
2835
+ $html = wppa_checkbox($slug);
2836
+ wppa_setting_new($slug, '14', $name, $desc, $html, $help, wppa_switch('show_comments'));
2837
+ }
2838
 
2839
  $name = __('Show album name on thumb area', 'wp-photo-album-plus');
2840
  $desc = __('Select if and where to display the album name on the thumbnail display.', 'wp-photo-album-plus');
wppa-slideshow.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
- * Version 8.0.06.004
8
  *
9
  */
10
 
@@ -171,7 +171,7 @@ global $previous_page_last_id;
171
  wppa( 'curpage', '1' );
172
 
173
  // If a page is requested, find it
174
- $pagreq = wppa_get_get( 'page' );
175
  if ( is_numeric( $pagreq ) && $pagreq > '0' ) {
176
  wppa( 'curpage', $pagreq );
177
  }
@@ -1285,7 +1285,7 @@ function wppa_slide_filmstrip( $opt = '' ) {
1285
 
1286
  $t = -microtime(true);
1287
 
1288
- $alb = wppa_get_get( 'album' );
1289
 
1290
  $thumbs = wppa_get_thumbs();
1291
  if ( ! $thumbs || count( $thumbs ) < 1 ) return;
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
+ * Version 8.0.07.001
8
  *
9
  */
10
 
171
  wppa( 'curpage', '1' );
172
 
173
  // If a page is requested, find it
174
+ $pagreq = wppa_get( 'page' );
175
  if ( is_numeric( $pagreq ) && $pagreq > '0' ) {
176
  wppa( 'curpage', $pagreq );
177
  }
1285
 
1286
  $t = -microtime(true);
1287
 
1288
+ $alb = wppa_get( 'album' );
1289
 
1290
  $thumbs = wppa_get_thumbs();
1291
  if ( ! $thumbs || count( $thumbs ) < 1 ) return;
wppa-styles.php CHANGED
@@ -3,7 +3,7 @@
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
- /* Version 8.0.05.002
7
  /*
8
  */
9
 
@@ -257,7 +257,7 @@ function wppa_get_imgstyle_a( $id, $file, $xmax_size, $xvalign = '', $type = ''
257
  case 'twthumb': // Thumbnail widget
258
  case 'ltthumb': // Lasten widget
259
  case 'albthumb': // Album widget
260
- if ( $type == 'thumb' && wppa_get_get( 'hilite' ) && wppa_decrypt_photo( wppa_get_get( 'hilite' ) ) == $id ) {
261
  $result['style'] .= ' border:3px solid orange;box-sizing:border-box;';
262
  }
263
  else {
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
+ /* Version 8.0.07.001
7
  /*
8
  */
9
 
257
  case 'twthumb': // Thumbnail widget
258
  case 'ltthumb': // Lasten widget
259
  case 'albthumb': // Album widget
260
+ if ( $type == 'thumb' && wppa_get( 'hilite' ) && wppa_decrypt_photo( wppa_get( 'hilite' ) ) == $id ) {
261
  $result['style'] .= ' border:3px solid orange;box-sizing:border-box;';
262
  }
263
  else {
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.06.001
9
  *
10
  */
11
 
@@ -1112,8 +1112,7 @@ global $wpdb;
1112
 
1113
  // Init
1114
  if ( ! $id ) {
1115
- wppa_dbg_msg('Please check file wppa-theme.php or any other php file that calls wppa_thumb_masonry(). Argument 1: photo id is missing!', 'red', 'force' );
1116
- die( 'Please check your configuration' );
1117
  }
1118
  $result = '';
1119
  $mocc = wppa( 'mocc' );
@@ -1138,31 +1137,14 @@ global $wpdb;
1138
  $has_audio = wppa_has_audio( $id );
1139
  $imgsrc = wppa_get_thumb_path( $id );
1140
  $is_pdf = wppa_is_pdf( $id );
1141
-
1142
- // if ( ! wppa_is_video( $id ) && ! is_file( $imgsrc ) ) {
1143
- // $result .= '<div' .
1144
- // ' class=""' .
1145
- // ' style="' .
1146
- // 'font-size:10px;' .
1147
- // 'color:red;' .
1148
- // 'width:' . wppa_opt( 'thumbsize' ) . 'px;' .
1149
- // 'position:static;' .
1150
- // 'float:left;' .
1151
- // '"' .
1152
- // ' >' .
1153
- // sprintf( __( 'Missing thumbnail image #%s' , 'wp-photo-album-plus'), $id ) .
1154
- // '</div>';
1155
- // return $result;
1156
- // }
1157
-
1158
- $alt = $album['alt_thumbsize'] == 'yes' ? '_alt' : '';
1159
- $imgattr_a = wppa_get_imgstyle_a( $id, $imgsrc, wppa_opt( 'thumbsize'.$alt ), 'optional', 'thumb' );
1160
 
1161
  // Verical style ?
1162
  if ( $vert ) {
1163
  $imgwidth = wppa_opt( 'thumbsize' );
1164
  $imgheight = $imgwidth * wppa_get_thumbratioyx( $id );
1165
- $imgstyle = 'width:100%; height:auto; margin:0; position:relative; box-sizing:border-box;';
1166
  $frame_h = '';
1167
  }
1168
 
@@ -1170,12 +1152,7 @@ global $wpdb;
1170
  elseif ( $hor ) {
1171
  $imgheight = wppa_opt( 'thumbsize' );
1172
  $imgwidth = $imgheight * wppa_get_thumbratioxy( $id );
1173
- $imgstyle = 'height:100%;' .
1174
- 'width:auto;' .
1175
- 'margin:0;' .
1176
- 'position:relative;' .
1177
- 'box-sizing:border-box;' .
1178
- '';
1179
  $frame_h = 'height:100%; ';
1180
  }
1181
 
@@ -1183,22 +1160,14 @@ global $wpdb;
1183
  else {
1184
  $imgwidth = wppa_get_thumbx( $id );
1185
  $imgheight = wppa_get_thumby( $id );
1186
- $imgstyle = 'width:100%;height:auto;margin:0;position:relative;box-sizing:border-box;float:left;';
1187
  $frame_h = '';
1188
  }
1189
 
1190
  // Mouseover effect?
1191
  if ( wppa_switch( 'use_thumb_opacity' ) ) {
1192
  $opac = wppa_opt( 'thumb_opacity' );
1193
- $imgstyle .= ' opacity:' . $opac/100 . '; filter:alpha( opacity=' . $opac . ' );';
1194
- }
1195
-
1196
- // Padding
1197
- if ( $plus ) {
1198
- $imgstyle .= 'padding:0;';
1199
- }
1200
- else {
1201
- $imgstyle .= ' padding:' . ( wppa_opt( 'tn_margin' ) / 2 ) . 'px;';
1202
  }
1203
 
1204
  // Cursor
@@ -1228,8 +1197,8 @@ global $wpdb;
1228
 
1229
  $imgurl = wppa_get_thumb_url( $id, true, '', $popwidth, $popheight );
1230
  $events = wppa_get_imgevents( 'thumb', $id );
1231
- $imgalt = $plus ? '' : ' alt="'.$id.'"'; // wppa_get_imgalt( $id ); // returns something like ' alt="Any text" '
1232
- $title = esc_attr( wppa_get_masonry_title( $id ) ); // esc_attr( wppa_get_photo_name( $id ) );
1233
 
1234
  // Feed ?
1235
  if ( is_feed() ) {
@@ -1292,8 +1261,7 @@ global $wpdb;
1292
  && ! wppa( 'src' ) // no search
1293
  && ! wppa( 'supersearch' ) // no supersearch
1294
  && ! wppa( 'is_potdhis' ) // not on potd history
1295
- // && ! wppa( 'calendar' )
1296
- && ( wppa_is_int( wppa( 'start_album' ) ) || wppa( 'start_album' ) == '' ) // no set of albums
1297
  )
1298
  { // Ajax possible
1299
 
@@ -1306,10 +1274,8 @@ global $wpdb;
1306
  '\', \'' .
1307
  wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_slideshow_url( wppa( 'start_album' ), '0' ) . $p ) ) .
1308
  '\' )';
1309
- // old $onclick = "wppaDoAjaxRender( ".$mocc.", '".wppa_get_slideshow_url_ajax( wppa( 'start_album' ), '0' ).'&amp;wppa-photo='.$id."', '".wppa_convert_to_pretty( wppa_get_slideshow_url( wppa( 'start_album' ), '0' )."&amp;wppa-photo=".$id )."' )";
1310
  $result .= '<a style="position:static;" class="thumb-img" id="x-'.$id.'-'.$mocc.'">';
1311
  if ( $is_video ) {
1312
- // $result .= '<video preload="metadata" onclick="'.$onclick.'" id="i-'.$id.'-'.$mocc.'" '.$imgalt.' title="'.$title.'" style="'.$imgstyle.' cursor:pointer;" '.$events.' >'.wppa_get_video_body( $id ).'</video>';
1313
  $result .= wppa_get_video_html( array(
1314
  'id' => $id,
1315
  // 'width' => $imgwidth,
@@ -1346,7 +1312,6 @@ global $wpdb;
1346
  // The a img non ajax
1347
  $result .= '<a style="position:static;" href="'.$link['url'].'" target="'.$link['target'].'" class="thumb-img" id="x-'.$xid.'-'.$mocc.'">';
1348
  if ( $is_video ) {
1349
- // $result .= '<video preload="metadata" id="i-'.$id.'-'.$mocc.'" '.$imgalt.' title="'.$title.'" width="'.$imgwidth.'" height="'.$imgheight.'" style="'.$imgstyle.' cursor:pointer;" '.$events.' >'.wppa_get_video_body( $id ).'</video>';
1350
  $result .= wppa_get_video_html( array(
1351
  'id' => $id,
1352
  // 'width' => $imgwidth,
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
+ * Version 8.0.07.003
9
  *
10
  */
11
 
1112
 
1113
  // Init
1114
  if ( ! $id ) {
1115
+ return;
 
1116
  }
1117
  $result = '';
1118
  $mocc = wppa( 'mocc' );
1137
  $has_audio = wppa_has_audio( $id );
1138
  $imgsrc = wppa_get_thumb_path( $id );
1139
  $is_pdf = wppa_is_pdf( $id );
1140
+ $alt = $album['alt_thumbsize'] == 'yes' ? '_alt' : '';
1141
+ $imgattr_a = wppa_get_imgstyle_a( $id, $imgsrc, wppa_opt( 'thumbsize'.$alt ), 'optional', 'thumb' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1142
 
1143
  // Verical style ?
1144
  if ( $vert ) {
1145
  $imgwidth = wppa_opt( 'thumbsize' );
1146
  $imgheight = $imgwidth * wppa_get_thumbratioyx( $id );
1147
+ $imgstyle = 'width:100%; height:auto; margin:0; position:relative;box-sizing:border-box;padding:' . ( wppa_opt( 'tn_margin' ) / 2 ) . 'px;';
1148
  $frame_h = '';
1149
  }
1150
 
1152
  elseif ( $hor ) {
1153
  $imgheight = wppa_opt( 'thumbsize' );
1154
  $imgwidth = $imgheight * wppa_get_thumbratioxy( $id );
1155
+ $imgstyle = 'height:100%;width:auto;margin:0;position:relative;box-sizing:border-box;padding:' . ( wppa_opt( 'tn_margin' ) / 2 ) . 'px;';
 
 
 
 
 
1156
  $frame_h = 'height:100%; ';
1157
  }
1158
 
1160
  else {
1161
  $imgwidth = wppa_get_thumbx( $id );
1162
  $imgheight = wppa_get_thumby( $id );
1163
+ $imgstyle = 'width:100%;height:auto;margin:0;position:relative;box-sizing:border-box;float:left;padding:0;';
1164
  $frame_h = '';
1165
  }
1166
 
1167
  // Mouseover effect?
1168
  if ( wppa_switch( 'use_thumb_opacity' ) ) {
1169
  $opac = wppa_opt( 'thumb_opacity' );
1170
+ $imgstyle .= 'opacity:' . $opac/100 . ';filter:alpha(opacity=' . $opac . ');';
 
 
 
 
 
 
 
 
1171
  }
1172
 
1173
  // Cursor
1197
 
1198
  $imgurl = wppa_get_thumb_url( $id, true, '', $popwidth, $popheight );
1199
  $events = wppa_get_imgevents( 'thumb', $id );
1200
+ $imgalt = $plus ? '' : ' alt="'.$id.'"';
1201
+ $title = esc_attr( wppa_get_masonry_title( $id ) );
1202
 
1203
  // Feed ?
1204
  if ( is_feed() ) {
1261
  && ! wppa( 'src' ) // no search
1262
  && ! wppa( 'supersearch' ) // no supersearch
1263
  && ! wppa( 'is_potdhis' ) // not on potd history
1264
+ // && ( wppa_is_int( wppa( 'start_album' ) ) || wppa( 'start_album' ) == '' ) // no set of albums
 
1265
  )
1266
  { // Ajax possible
1267
 
1274
  '\', \'' .
1275
  wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_slideshow_url( wppa( 'start_album' ), '0' ) . $p ) ) .
1276
  '\' )';
 
1277
  $result .= '<a style="position:static;" class="thumb-img" id="x-'.$id.'-'.$mocc.'">';
1278
  if ( $is_video ) {
 
1279
  $result .= wppa_get_video_html( array(
1280
  'id' => $id,
1281
  // 'width' => $imgwidth,
1312
  // The a img non ajax
1313
  $result .= '<a style="position:static;" href="'.$link['url'].'" target="'.$link['target'].'" class="thumb-img" id="x-'.$xid.'-'.$mocc.'">';
1314
  if ( $is_video ) {
 
1315
  $result .= wppa_get_video_html( array(
1316
  'id' => $id,
1317
  // 'width' => $imgwidth,
wppa-utils.php CHANGED
@@ -1041,20 +1041,20 @@ function wppa_txt_to_nl($text) {
1041
 
1042
  // Check query arg on tags, return value if valid
1043
  function wppa_vfy_arg( $arg, $txt = false ) {
1044
- if ( isset( $_REQUEST[$arg] ) ) {
1045
  if ( $txt ) { // Text is allowed, but without tags
1046
  $reason = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? ': ' . $arg . ' contains tags.' : '';
1047
- if ( $_REQUEST[$arg] != strip_tags( $_REQUEST[$arg] ) ) {
1048
  wp_die( 'Security check failue ' . $reason );
1049
  }
1050
- return $_REQUEST[$arg];
1051
  }
1052
  else {
1053
- $reason = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? ': ' . $arg . ' is not numeric.' : '';
1054
- $value = $_REQUEST[$arg];
1055
- if ( $arg == 'photo-id' ) {
1056
- $value = wppa_decrypt_photo( trim( $value. '/' ), false, true );
1057
- }
1058
  if ( ! is_numeric( $value ) ) {
1059
  wp_die( 'Security check failue ' . $reason );
1060
  }
@@ -1550,7 +1550,7 @@ static $repeat_count;
1550
  }
1551
 
1552
  // Do not log logdisplays being updated
1553
- if ( wppa( 'ajax' ) && isset( $_REQUEST['raw'] ) && isset( $_REQUEST['slug'] ) && $_REQUEST['slug'] == 'wppa_list_errorlog' ) {
1554
  return;
1555
  }
1556
 
@@ -1775,9 +1775,9 @@ function wppa_get_the_id() {
1775
 
1776
  $id = '0';
1777
  if ( wppa( 'ajax' ) ) {
1778
- if ( wppa_get_get( 'page_id' ) ) $id = wppa_get_get( 'page_id' );
1779
- elseif ( wppa_get_get( 'p' ) ) $id = wppa_get_get( 'p' );
1780
- elseif ( wppa_get_get( 'fromp' ) ) $id = wppa_get_get( 'fromp' );
1781
  }
1782
  if ( ! $id ) {
1783
  $id = get_the_ID();
@@ -2955,105 +2955,6 @@ global $wpdb;
2955
  return $void_photos;
2956
  }
2957
 
2958
- // Retrieve a get-vareiable, sanitized and post-processed
2959
- // Return '1' if set without value, return false when value is 'nil'
2960
- function wppa_get_get( $index ) {
2961
- static $wppa_get_get_cache;
2962
-
2963
- // Found this already?
2964
- if ( isset( $wppa_get_get_cache[$index] ) ) return $wppa_get_get_cache[$index];
2965
-
2966
- // See if set
2967
- if ( isset( $_GET['wppa-'.$index] ) ) { // New syntax first
2968
- $result = $_GET['wppa-'.$index];
2969
- }
2970
- elseif ( isset( $_GET[$index] ) ) { // Old syntax
2971
- $result = $_GET[$index];
2972
- }
2973
- else return false; // Not set
2974
-
2975
- if ( $result == 'nil' ) return false; // Nil simulates not set
2976
-
2977
- if ( ! strlen( $result ) ) $result = '1'; // Set but no value
2978
-
2979
- // Sanitize
2980
- $result = strip_tags( $result );
2981
- if ( strpos( $result, '<?' ) !== false ) die( 'Security check failure #191' );
2982
- if ( strpos( $result, '?>' ) !== false ) die( 'Security check failure #192' );
2983
-
2984
- // Post processing needed?
2985
- if ( $index == 'photo' && ( ! wppa_is_int( $result ) ) ) {
2986
-
2987
- // Encrypted?
2988
- $temp = wppa_decrypt_photo( $result );
2989
- if ( $temp ) {
2990
- $result = $temp;
2991
- }
2992
-
2993
- // By name?
2994
- else {
2995
- $result = wppa_get_photo_id_by_name( $result, wppa_get_album_id_by_name( wppa_get_get( 'album' ) ) );
2996
- }
2997
-
2998
- if ( ! $result ) return false; // Non existing photo, treat as not set
2999
- }
3000
- if ( $index == 'album' ) {
3001
-
3002
- // Encrypted?
3003
- $result = wppa_decrypt_album( $result, true, 'no_refuse' );
3004
-
3005
- if ( ! wppa_is_int( $result ) ) {
3006
- $temp = wppa_get_album_id_by_name( $result );
3007
- if ( wppa_is_int( $temp ) && $temp > '0' ) {
3008
- $result = $temp;
3009
- }
3010
- elseif ( ! wppa_series_to_array( $result ) ) {
3011
- $result = false;
3012
- }
3013
- }
3014
- }
3015
-
3016
- // Save in cache
3017
- $wppa_get_get_cache[$index] = $result;
3018
- return $result;
3019
- }
3020
-
3021
- function wppa_get_post( $index, $default = false ) {
3022
-
3023
- if ( isset( $_POST['wppa-'.$index] ) ) { // New syntax first
3024
- $result = $_POST['wppa-'.$index];
3025
- if ( strpos( $result, '<?' ) !== false ) die( 'Security check failure #291' );
3026
- if ( strpos( $result, '?>' ) !== false ) die( 'Security check failure #292' );
3027
- if ( $index == 'album' ) $result = wppa_decrypt_album( $result );
3028
- if ( $index == 'photo' ) $result = wppa_decrypt_photo( $result );
3029
- return $result;
3030
- }
3031
- if ( isset( $_POST[$index] ) ) { // Old syntax
3032
- $result = $_POST[$index];
3033
- if ( strpos( $result, '<?' ) !== false ) die( 'Security check failure #391' );
3034
- if ( strpos( $result, '?>' ) !== false ) die( 'Security check failure #392' );
3035
- if ( $index == 'album' ) $result = wppa_decrypt_album( $result );
3036
- if ( $index == 'photo' ) $result = wppa_decrypt_photo( $result );
3037
- return $result;
3038
- }
3039
- return $default;
3040
- }
3041
-
3042
- function wppa_sanitize_searchstring( $str ) {
3043
-
3044
- $result = $str;
3045
- $result = strip_tags( $result );
3046
- $result = stripslashes( $result );
3047
- $result = str_replace( array( "'", '"', ':', ), '', $result );
3048
- $temp = explode( ',', $result );
3049
- foreach ( array_keys( $temp ) as $key ) {
3050
- $temp[$key] = trim( $temp[$key] );
3051
- }
3052
- $result = implode( ',', $temp );
3053
-
3054
- return $result;
3055
- }
3056
-
3057
  // Filter for Plugin CM Tooltip Glossary
3058
  function wppa_filter_glossary( $desc ) {
3059
  static $wppa_cmt;
@@ -3168,7 +3069,7 @@ function wppa_fix_poster_ext( $fileorurl, $id ) {
3168
  else {
3169
 
3170
  // Get available ext
3171
- $poster_ext = wppa_get_poster_ext( $id );
3172
 
3173
  // If found, replace extension to ext of existing file
3174
  if ( $poster_ext ) {
@@ -3204,7 +3105,7 @@ function wppa_fix_poster_ext( $fileorurl, $id ) {
3204
  }
3205
  }
3206
 
3207
- function wppa_get_poster_ext( $id ) {
3208
  global $wppa_supported_photo_extensions;
3209
 
3210
  // Init
@@ -3380,7 +3281,7 @@ function wppa_is_virtual() {
3380
  if ( wppa( 'supersearch' ) ) return true;
3381
  if ( wppa( 'searchstring' ) ) return true;
3382
  if ( wppa( 'calendar' ) ) return true;
3383
- if ( wppa_get_get( 'vt' ) ) return true;
3384
  if ( wppa( 'is_potdhis' ) ) return true;
3385
 
3386
  return false;
@@ -3518,7 +3419,6 @@ function wppa_convert_uri_to_get( $uri ) {
3518
  }
3519
  $_GET[$arg[0]] = $arg[1];
3520
  $_REQUEST[$arg[0]] = $arg[1];
3521
- // wppa_log('dbg',$item);
3522
  }
3523
  }
3524
  }
@@ -3877,7 +3777,7 @@ function wppa_get_mime_type( $id ) {
3877
 
3878
  $ext = strtolower( wppa_get_photo_item( $id, 'ext' ) );
3879
  if ( $ext == 'xxx' ) {
3880
- $ext = wppa_get_poster_ext( $id );
3881
  }
3882
 
3883
  switch ( $ext ) {
@@ -4881,6 +4781,9 @@ function wppa_dump( $txt = '' ) {
4881
  $file = WPPA_PATH . '/wppa-dump.txt';
4882
 
4883
  if ( $txt ) {
 
 
 
4884
  wppa_put_contents( $file, $txt );
4885
  }
4886
  else {
1041
 
1042
  // Check query arg on tags, return value if valid
1043
  function wppa_vfy_arg( $arg, $txt = false ) {
1044
+ if ( wppa_get( $arg ) ) {
1045
  if ( $txt ) { // Text is allowed, but without tags
1046
  $reason = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? ': ' . $arg . ' contains tags.' : '';
1047
+ if ( wppa_get( $arg ) != strip_tags( wppa_get( $arg ) ) ) {
1048
  wp_die( 'Security check failue ' . $reason );
1049
  }
1050
+ return wppa_get( $arg );
1051
  }
1052
  else {
1053
+ $reason = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? ': ' . $arg . ' is not numeric, its '.wppa_get( $arg ) : '';
1054
+ $value = wppa_get( $arg );
1055
+ // if ( $arg == 'photo-id' ) {
1056
+ // $value = wppa_decrypt_photo( trim( $value. '/' ), false, true );
1057
+ // }
1058
  if ( ! is_numeric( $value ) ) {
1059
  wp_die( 'Security check failue ' . $reason );
1060
  }
1550
  }
1551
 
1552
  // Do not log logdisplays being updated
1553
+ if ( wppa_get( 'slug' ) == 'wppa_list_errorlog' ) {
1554
  return;
1555
  }
1556
 
1775
 
1776
  $id = '0';
1777
  if ( wppa( 'ajax' ) ) {
1778
+ if ( wppa_get( 'page_id' ) ) $id = wppa_get( 'page_id' );
1779
+ elseif ( wppa_get( 'p' ) ) $id = wppa_get( 'p' );
1780
+ elseif ( wppa_get( 'fromp' ) ) $id = wppa_get( 'fromp' );
1781
  }
1782
  if ( ! $id ) {
1783
  $id = get_the_ID();
2955
  return $void_photos;
2956
  }
2957
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2958
  // Filter for Plugin CM Tooltip Glossary
2959
  function wppa_filter_glossary( $desc ) {
2960
  static $wppa_cmt;
3069
  else {
3070
 
3071
  // Get available ext
3072
+ $poster_ext = wppa_geter_ext( $id );
3073
 
3074
  // If found, replace extension to ext of existing file
3075
  if ( $poster_ext ) {
3105
  }
3106
  }
3107
 
3108
+ function wppa_geter_ext( $id ) {
3109
  global $wppa_supported_photo_extensions;
3110
 
3111
  // Init
3281
  if ( wppa( 'supersearch' ) ) return true;
3282
  if ( wppa( 'searchstring' ) ) return true;
3283
  if ( wppa( 'calendar' ) ) return true;
3284
+ if ( wppa_get( 'vt' ) ) return true;
3285
  if ( wppa( 'is_potdhis' ) ) return true;
3286
 
3287
  return false;
3419
  }
3420
  $_GET[$arg[0]] = $arg[1];
3421
  $_REQUEST[$arg[0]] = $arg[1];
 
3422
  }
3423
  }
3424
  }
3777
 
3778
  $ext = strtolower( wppa_get_photo_item( $id, 'ext' ) );
3779
  if ( $ext == 'xxx' ) {
3780
+ $ext = wppa_geter_ext( $id );
3781
  }
3782
 
3783
  switch ( $ext ) {
4781
  $file = WPPA_PATH . '/wppa-dump.txt';
4782
 
4783
  if ( $txt ) {
4784
+ if ( wppa_is_file( $file ) ) {
4785
+ $txt = wppa_get_contents( $file ) . "\n" . $txt;
4786
+ }
4787
  wppa_put_contents( $file, $txt );
4788
  }
4789
  else {
wppa-watermark.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-watermark.php
3
  *
4
  * Functions used for the application of watermarks
5
- * Version 8.0.00.007
6
  *
7
  */
8
 
@@ -348,18 +348,18 @@ function wppa_get_water_file_and_pos( $id ) {
348
  }
349
 
350
  // User overrule?
351
- if ( wppa_switch( 'watermark_user' ) || isset( $_POST['wppa-watermark-file'] ) ) {
352
  $user = wppa_get_user();
353
- if ( isset( $_POST['wppa-watermark-file'] ) ) {
354
- $result['file'] = $_POST['wppa-watermark-file'];
355
- update_option( 'wppa_watermark_file_' . $user, $_POST['wppa-watermark-file'] );
356
  }
357
  elseif ( wppa_get_option( 'wppa_watermark_file_' . $user, 'nil' ) != 'nil' ) {
358
  $result['file'] = wppa_get_option( 'wppa_watermark_file_' . $user );
359
  }
360
- if ( isset( $_POST['wppa-watermark-pos'] ) ) {
361
- $result['pos'] = $_POST['wppa-watermark-pos'];
362
- update_option( 'wppa_watermark_pos_' . $user, $_POST['wppa-watermark-pos'] );
363
  }
364
  elseif ( wppa_get_option( 'wppa_watermark_pos_' . $user, 'nil' ) != 'nil' ) {
365
  $result['pos'] = wppa_get_option( 'wppa_watermark_pos_' . $user );
2
  /* wppa-watermark.php
3
  *
4
  * Functions used for the application of watermarks
5
+ * Version 8.0.07.003
6
  *
7
  */
8
 
348
  }
349
 
350
  // User overrule?
351
+ if ( wppa_switch( 'watermark_user' ) || wppa_get( 'wppa-watermark-file' ) ) {
352
  $user = wppa_get_user();
353
+ if ( wppa_get( 'wppa-watermark-file' ) ) {
354
+ $result['file'] = wppa_get( 'wppa-watermark-file' );
355
+ update_option( 'wppa_watermark_file_' . $user, wppa_get( 'wppa-watermark-file' ) );
356
  }
357
  elseif ( wppa_get_option( 'wppa_watermark_file_' . $user, 'nil' ) != 'nil' ) {
358
  $result['file'] = wppa_get_option( 'wppa_watermark_file_' . $user );
359
  }
360
+ if ( wppa_get( 'wppa-watermark-pos' ) ) {
361
+ $result['pos'] = wppa_get( 'wppa-watermark-pos' );
362
+ update_option( 'wppa_watermark_pos_' . $user, wppa_get( 'wppa-watermark-pos' ) );
363
  }
364
  elseif ( wppa_get_option( 'wppa_watermark_pos_' . $user, 'nil' ) != 'nil' ) {
365
  $result['pos'] = wppa_get_option( 'wppa_watermark_pos_' . $user );
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.06.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,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.0.06.004'; // WPPA software version
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.003
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.003'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30