Version Description
= 8.1.08 =
- This version addresses various bug fixes, feature requests and security fixes.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 8.2.05.001 |
Comparing to | |
See all releases |
Code changes from version 8.2.04.009 to 8.2.05.001
- changelog.txt +7 -1
- js/wppa-all.js +1 -1
- js/wppa-zoom.js +4 -5
- js/wppa-zoom.min.js +1 -1
- wppa-admin-functions.php +6 -9
- wppa-admin.php +3 -3
- wppa-adminbar.php +1 -1
- wppa-ajax.php +1 -13
- wppa-album-admin-autosave.php +92 -78
- wppa-album-covers.php +2 -6
- wppa-audio.php +1 -3
- wppa-boxes-html.php +7 -19
- wppa-breadcrumb.php +2 -20
- wppa-cache.php +3 -10
- wppa-cart.php +2 -2
- wppa-common-functions.php +7 -54
- wppa-dashboard-widgets.php +5 -5
- wppa-encrypt.php +3 -3
- wppa-exif-iptc-common.php +2 -9
- wppa-export.php +2 -2
- wppa-filter.php +3 -9
- wppa-functions.php +33 -133
- wppa-gutenberg-wppa.php +2 -2
- wppa-import.php +6 -9
- wppa-index.php +1 -2
- wppa-init.php +3 -15
- wppa-input.php +1 -2
- wppa-items.php +2 -17
- wppa-links.php +14 -17
- wppa-mailing.php +2 -2
- wppa-maintenance.php +1 -2
- wppa-non-admin.php +4 -4
- wppa-photo-admin-autosave.php +68 -37
- wppa-photo-files.php +3 -8
- wppa-picture.php +5 -5
- wppa-privacy-policy.php +1 -13
- wppa-scripts.php +5 -6
- wppa-session.php +1 -5
- wppa-setting-functions.php +25 -7
- wppa-settings-autosave.php +3 -3
- wppa-setup.php +4 -34
- wppa-slideshow.php +1 -6
- wppa-statistics.php +5 -11
- theme/wppa-style.css → wppa-style.css +1 -1
- theme/wppa-theme.php → wppa-theme.php +2 -3
- wppa-thumbnails.php +4 -5
- wppa-tinymce-shortcodes.php +3 -3
- wppa-upload-common.php +2 -3
- wppa-upload.php +4 -4
- wppa-users.php +24 -7
- wppa-utils.php +9 -22
- wppa-video.php +1 -3
- wppa-watermark.php +2 -2
- wppa-widget-functions.php +1 -2
- wppa-wpdb-insert.php +1 -2
- wppa-wrappers.php +1 -2
- wppa.php +4 -10
changelog.txt
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 8.2.04 =
|
4 |
|
5 |
* The width and height of portrait oriented mp4 videos is now properly recorded.
|
@@ -1147,7 +1153,7 @@ Names must be equal except the file-extension. .jpg and .png files are supported
|
|
1147 |
|
1148 |
= Bug Fixes =
|
1149 |
|
1150 |
-
* Front-end uploaddialog: when admin, multiple uploads should be possible even when one only was activated. Fixed. ($one_only = wppa_switch( 'upload_one_only' ) && !
|
1151 |
* Front-end uploaddialog: very long filenames distorted layout. Fixed. (onclick="wppaSetMaxWidthToParentWidth(this);" on the visual button)
|
1152 |
* Link on thumbnail to lightbox did not work when the photo has audio. Fixed. (wppa_fix_poster_ext() now also works on versioned urls)
|
1153 |
* Automatic cache clearing stopped working, fixed. (WPPA_UPLOAD_PATH . '/cache' is now a safe root)
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
3 |
+
= 8.2.05 =
|
4 |
+
|
5 |
+
* Switching language e.g. by qTranslate plugin, did no longer load the right language files. Fixed. Also retro-fixed in 8.2.04.009 on aug 08 2022.
|
6 |
+
* Fixed an errormessage that might show up when there are no photos in the system and shortcode [photo ...] was enabled.. Also retro-fixed in 8.2.04.009 on aug 11 2022.
|
7 |
+
* Some cosmetic changes to album and photo admin pages with respect to upload limits and owner fields.
|
8 |
+
|
9 |
= 8.2.04 =
|
10 |
|
11 |
* The width and height of portrait oriented mp4 videos is now properly recorded.
|
1153 |
|
1154 |
= Bug Fixes =
|
1155 |
|
1156 |
+
* Front-end uploaddialog: when admin, multiple uploads should be possible even when one only was activated. Fixed. ($one_only = wppa_switch( 'upload_one_only' ) && ! wppa_user_is_admin();)
|
1157 |
* Front-end uploaddialog: very long filenames distorted layout. Fixed. (onclick="wppaSetMaxWidthToParentWidth(this);" on the visual button)
|
1158 |
* Link on thumbnail to lightbox did not work when the photo has audio. Fixed. (wppa_fix_poster_ext() now also works on versioned urls)
|
1159 |
* Automatic cache clearing stopped working, fixed. (WPPA_UPLOAD_PATH . '/cache' is now a safe root)
|
js/wppa-all.js
CHANGED
@@ -13,7 +13,7 @@ var wppaJsPopupVersion="8.0.07.004";function wppaPopUp(p,t,i,e,a,n,o,r,d,s){wppa
|
|
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
|
16 |
-
var wppaJsZoomVersion="8.2.
|
17 |
// wppa-spheric
|
18 |
var wppaJsSphericVersion="8.2.01.005";function wppaDoSphericPan(t,n){var s=jQuery;n&&(wppaSphericData[t]=n);var w=f(t,w);function l(n){var e=f(n);!e.manCtrl&&b()<e.time+25||(f(n,{time:b()}),e.isLightbox&&(!wppaOvlOpen||wppaOvlActivePanorama!=e.id||wppaGlobalOvlPanoramaId>e.uId)&&(abort=!0),e.abort||((e.butDown||e.manCtrl)&&e.autorun&&(e.autorun=!1,e.dX=0),0==e.dX&&0==e.dY&&0==e.dFov&&(e.pause=!0),e.butDown&&(e.pause=!1),e.fov+=e.dFov,e.fov=Math.max(20,Math.min(120,e.fov)),e.wppaCamera=new THREE.PerspectiveCamera(e.fov,e.aspect,1,1e3),e.wppaCamera.target=new THREE.Vector3(0,0,0),e.lon+=e.dX,e.lat+=e.dY,e.lat=Math.max(-85,Math.min(85,e.lat)),e.wppaCamera.target.x=500*Math.sin(THREE.Math.degToRad(90-e.lat))*Math.cos(THREE.Math.degToRad(e.lon)),e.wppaCamera.target.y=500*Math.cos(THREE.Math.degToRad(90-e.lat)),e.wppaCamera.target.z=500*Math.sin(THREE.Math.degToRad(90-e.lat))*Math.sin(THREE.Math.degToRad(e.lon)),e.wppaCamera.lookAt(e.wppaCamera.target),e.wppaRenderer&&e.wppaRenderer.render(e.wppaScene,e.wppaCamera),wppaAdjustControlbar(),s("#wppa-ovl-spin").hide(),e.manCtrl,(e.autorun||!e.pause&&(e.manCtrl||e.butDown))&&e.wppaRenderer&&(e.timer=setTimeout(function(){l(n)},25)),f(n,e)))}function e(n,e){var t=!wppaIsFs();if(w=f(n)){if(w.isLightbox){if(!wppaOvlOpen)return;s("#wppa-overlay-pc").show(),s("#wppa-overlay-pc").css("width","");var a,o,p=(t=!wppaIsFs())?(o=window.innerWidth||screen.width,window.innerHeight||screen.height):(o=screen.width,screen.height),i=8,r=8+(w.controls?w.icsize+10:0)+30;t&&(i+=2*w.borderWidth,r+=2*w.borderWidth),a=(o-i)/2+r<p,r=t?a?(p-(c=(u=o-i)/2)-r)/2+20:(u=2*(c=p-r),20):(u=screen.width,c=screen.height,0),w.aspect=u/c,s("#wppa-ovl-sphericpan-container").css({top:r}),s("#wppa-overlay-pc").css({top:0}),t?(s("#wppa-ovl-sphericpan-container").css({backgroundColor:w.backgroundColor,padding:w.padding+"px",borderRadius:w.borderRadius+"px",width:u}),a?s("#wppa-overlay-pc").css({left:4}):s("#wppa-overlay-pc").css({left:(o-u)/2})):s("#wppa-ovl-sphericpan-container").css({backgroundColor:"transparent",padding:0,borderRadius:"0px",width:u,left:(o-u)/2}),w.wppaRenderer.setSize(u,c)}else{if("force"!=e&&0<w.width&&w.width==u&&w.height==c)return;var u=s(w.div).parent().width(),c=parseInt(u/2);if(!w.wppaRenderer)return;w.wppaRenderer.setSize(u,c)}w.width=u,w.height=c,f(n,w),w.timer=setTimeout(function(){l(n)},250)}}function a(n,e){e.preventDefault(),e.stopPropagation(),w=f(n,{manCtrl:!0,butDown:!1,autorun:!1,dX:0}),e.touches?f(n,{sX:e.touches[0].clientX,sY:e.touches[0].clientY}):f(n,{sX:e.clientX,sY:e.clientY}),f(n,{sLon:w.lon,sLat:w.lat}),l(n)}function o(n,e){e.preventDefault(),e.stopPropagation(),(w=f(n)).manCtrl&&(e.touches?f(n,{lon:.1*(w.sX-e.touches[0].clientX)+w.sLon,lat:.1*(e.touches[0].clientY-w.sY)+w.sLat,pause:!1}):f(n,{lon:.1*(w.sX-e.clientX)+w.sLon,lat:.1*(e.clientY-w.sY)+w.sLat,pause:!1}),l(n))}function p(n){f(n,{manCtrl:!1})}function i(n){w=f(n),f(n,{dFov:-.4*w.mFakt,butDown:!0}),l(n)}function r(n){w=f(n),f(n,{dFov:.4*w.mFakt,butDown:!0}),l(n)}function u(n){w=f(n),f(n,{dX:.2*w.mFakt,butDown:!0}),l(n)}function c(n){w=f(n),f(n,{dX:-.2*w.mFakt,butDown:!0}),l(n)}function h(n){w=f(n),f(n,{dY:.2*w.mFakt,butDown:!0}),l(n)}function m(n){w=f(n),f(n,{dY:-.2*w.mFakt,butDown:!0}),l(n)}function v(n){w=f(n),f(n,{dX:0,dY:0,dFov:0,butDown:!1,manCtrl:!1})}function f(n,e){if(!wppaSphericData[n])return!1;if(e)for(var t in e)wppaSphericData[n][t]=e[t];return wppaSphericData[n]}function b(){return d=new Date,d.getTime()}w.initialized||w.abort||w.isLightbox&&!wppaOvlOpen||(w.wppaRenderer&&(w.wppaRenderer.state.reset(),w.wppaSphere.dispose(),w.wppaSphereMaterial.dispose(),w.texture.dispose()),w.isLightbox&&wppaOvlOpen&&(s("#wppa-ovl-spin").show(),s("#wppa-overlay-ic").html("")),w.manCtrl=!1,w.butDown=!1,w.lon=180,w.lat=0,w.dFov=0,w.abort=!1,w.aspect=2,w.div=s("#wppa-pan-div-"+t),w.left=s("#wppa-pctl-left-"+t),w.right=s("#wppa-pctl-right-"+t),w.up=s("#wppa-pctl-up-"+t),w.down=s("#wppa-pctl-down-"+t),w.zoomin=s("#wppa-pctl-zoomin-"+t),w.zoomout=s("#wppa-pctl-zoomout-"+t),w.prev=s("#wppa-pctl-prev-"+t),w.next=s("#wppa-pctl-next-"+t),w.pause=!1,w.mFakt=wppaIsMobile?"2":"1",w.time=0,w.isLightbox&&(wppaGlobalOvlPanoramaId++,w.uId=wppaGlobalOvlPanoramaId),s(w.div).html(""),w.wppaRenderer||(w.wppaRenderer=new THREE.WebGLRenderer),w.wppaRenderer.setSize(w.width,w.height),s(w.div).append(w.wppaRenderer.domElement),w.wppaScene=new THREE.Scene,w.wppaSphere=new THREE.SphereGeometry(100,100,40),w.wppaSphere.applyMatrix4((new THREE.Matrix4).makeScale(-1,1,1)),w.texture=(new THREE.TextureLoader).load(w.url),w.wppaSphereMaterial=new THREE.MeshBasicMaterial({map:w.texture}),w.wppaSphereMesh=new THREE.Mesh(w.wppaSphere,w.wppaSphereMaterial),w.wppaScene.add(w.wppaSphereMesh),w.right.on("touchstart",function(n){u(t)}),w.right.on("touchend",function(n){v(t)}),w.left.on("touchstart",function(n){c(t)}),w.left.on("touchend",function(n){v(t)}),w.up.on("touchstart",function(n){h(t)}),w.up.on("touchend",function(n){v(t)}),w.down.on("touchstart",function(n){m(t)}),w.down.on("touchend",function(n){v(t)}),w.zoomin.on("touchstart",function(n){i(t)}),w.zoomin.on("touchend",function(n){v(t)}),w.zoomout.on("touchstart",function(n){r(t)}),w.zoomout.on("touchend",function(n){v(t)}),w.enableManual&&0<s("#wppa-pan-div-"+t+" canvas").length&&(s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchstart",function(n){a(t,n)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchmove",function(n){o(t,n)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchend",function(n){p(t)})),w.right.on("mousedown",function(n){u(t)}),w.right.on("mouseup",function(n){v(t)}),w.left.on("mousedown",function(n){c(t)}),w.left.on("mouseup",function(n){v(t)}),w.up.on("mousedown",function(n){h(t)}),w.up.on("mouseup",function(n){v(t)}),w.down.on("mousedown",function(n){m(t)}),w.down.on("mouseup",function(n){v(t)}),w.zoomin.off("mousedown"),w.zoomin.on("mousedown",function(n){i(t)}),w.zoomin.off("mouseup"),w.zoomin.on("mouseup",function(n){v(t)}),w.zoomout.on("mousedown",function(n){r(t)}),w.zoomout.on("mouseup",function(n){v(t)}),w.enableManual&&0<s("#wppa-pan-div-"+t+" canvas").length&&(s("#wppa-pan-div-"+t+" canvas").on("mousedown",function(n){a(t,n)}),s("#wppa-pan-div-"+t+" canvas").on("mousemove",function(n){o(t,n)}),s("#wppa-pan-div-"+t+" canvas").on("mouseup",function(n){p(t)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("wheel",function(n){var e;e=t,(n=n).preventDefault(),n.stopPropagation(),w=f(e),f(e,{manCtrl:!1,butDown:!1,autorun:!1,dX:0,dFov:-n.deltaY*w.zoomsensitivity/60}),l(e),setTimeout(function(){f(e,{dFov:0})},25)})),w.isLightbox&&(s("body").on("quitimage",function(n){var e;w=f(e=t,{abort:!0,autorun:!1}),clearTimeout(w.timer),clearInterval(w.intervalTimer),s("#wppa-pan-div-"+e+" canvas").hide(),s("#wppa-pctl-div-"+e).hide(),s("#wppa-overlay-pc").hide()}),s("#wppa-pctl-div-"+t).on("click",function(n){wppaKillEvent(n)})),f(t,w),s(window).on("wpparesizeend",function(n){e(t,n)}),wppaProtect(),s(document).on("tabbychange",function(n){var e;e=t,w.wppaRenderer.state.reset(),w=f(e,{initialized:!1,abort:!0}),setTimeout(function(){f(e,{abort:!1}),wppaDoSphericPan(e)},200)}),e(t,"force"))}
|
19 |
// wppa-flatpan
|
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
|
16 |
+
var wppaJsZoomVersion="8.2.05.001";function wppaDoZoomPan(n,t){var p=jQuery;wppaZoomData[n]=t;var o=l(n,{image:document.getElementById("wppa-"+t.itemId)});function h(t){var a,n,o,e,i,s=l(t);s.canvas&&(Y()<s.time+10||(l(t,{time:Y()}),(s.isLightbox&&!wppaOvlOpen||!s.isLightbox&&wppaOvlOpen)&&(s=l(0,{abort:!0})),s.abort?l(t,{manual:!1,buttondown:!1,pause:!1,ctx:null}):s.busy||(e=(s=l(t,{busy:!0})).fromX,i=s.fromY,s.manual||(s.fromX+=s.deltaX,s.fromY+=s.deltaY,a=s.fromHeight/s.deltaFactor,n=s.fromWidth/s.deltaFactor,50<a&&(wppaIsFs()||a<=s.image.height)?(s.fromX-=(n-s.fromWidth)/2,s.fromY-=(a-s.fromHeight)/2,s.fromWidth=n,s.fromHeight=a):s.buttondown=!1),s.fromX=Math.max(0,Math.min(s.image.width-s.fromWidth,s.fromX)),s.fromY=Math.max(0,Math.min(s.image.height-s.fromHeight,s.fromY)),e==s.fromX&&i==s.fromY&&1==s.deltaFactor&&(s.buttondown=!1),o=screen.width/screen.height,e=(1-s.image.width/s.fromWidth)*s.canvas.width/2,i=(1-s.image.height/s.fromHeight)*s.canvas.height/2,s.ctx=s.canvas.getContext("2d"),o>s.imageRatio&&a>s.image.height&&wppaIsFs()||o<=s.imageRatio&&n>s.image.width&&wppaIsFs()?(s.enableManual=!1,s.ctx.clearRect(0,0,s.canvas.width,s.canvas.height),s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,e,i,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"default"})):(s.enableManual=!0,s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,0,0,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"grab"})),wppaIsFs()?(s.fsMaskTop=i-(s.canvas.height-screen.height)/2,s.fsMaskLeft=e-(s.canvas.width-screen.width)/2,s.fsMaskBottom=screen.height-s.fsMaskTop,s.fsMaskRight=screen.width-s.fsMaskLeft):(s.fsMaskTop=0,s.fsMaskLeft=0,s.fsMaskBottom=0,s.fsMaskRight=0),s.ctrlbarUpdate&&(wppaAdjustControlbar(),s.ctrlbarUpdate=!1),s.busy=!1,wppaIsElementInViewport(s.canvas)||(s.buttondown=!1),l(t,s),s.pause||!s.manual&&!s.buttondown||setTimeout(function(){h(t)},10),s.pause&&l(t,{pause:!1}))))}function a(t,a){var n,o=l(t);if(o){if(o.isLightbox){p("#wppa-overlay-zpc").css("display","");var e,i,s,r=!wppaIsFs(),c=r?(e=window.innerWidth||screen.width,window.innerHeight||screen.height):(e=screen.width,screen.height),d=0,u=8,m=8+(o.controls?o.icsize+10:0)+10;r?(u+=2*o.borderWidth,m+=2*o.borderWidth):u=40,n=r?c-m>(e-u)/o.imageRatio:(screenRatio=screen.width/screen.height,screenRatio<o.imageRatio),r&&n&&(d=(c-(s=(i=e-u)/o.imageRatio)-m)/2+20),r&&!n&&(s=(i=o.imageRatio*(c-(o.controls?o.icsize:0)-48))/o.imageRatio,d=20),!r&&n&&(i=(s=screen.height)*o.imageRatio,d=0),r||n||(s=(i=screen.width)/o.imageRatio,d=(screen.height-s)/2),p("#wppa-ovl-zoom-container").css({top:d}),p("#wppa-overlay-zpc").css({top:0,left:0}),o.canvasWidth=i,o.canvasHeight=s,o.canvas.width=o.canvasWidth,o.canvas.height=o.canvasHeight,r?(p("#wppa-ovl-zoom-container").css({backgroundColor:o.backgroundColor,padding:o.padding,borderRadius:o.borderRadius+"px",borderWidth:o.borderWidth+"px",width:i,marginLeft:0}),n?p("#wppa-overlay-zpc").css({left:4}):p("#wppa-overlay-zpc").css({left:(e-i)/2})):(p("#wppa-overlay-zpc").css({marginLeft:0}),p("#wppa-ovl-zoom-container").css({backgroundColor:"transparent",padding:0,borderRadius:"0px",borderWidth:"0px",width:i,left:(e-i)/2,position:"fixed"})),o.ctrlbarUpdate=!0}else{if("force"!=a&&o.canvasWidth==p(o.div).parent().width())return;o.canvasWidth=p(o.div).parent().width(),o.canvasHeight=o.canvasWidth/o.imageRatio,o.canvas.width=o.canvasWidth,o.canvas.height=o.canvasHeight,o.ctrlbarUpdate=!0}l(t,o),setTimeout(function(){h(t)},1),p("#wppa-ovl-zoom-container").show()}}function e(t){var a=l(t),a=a.image.naturalWidth/a.canvas.width;a<1.5&&(a=1.5),l(t,{deltaX:a*=1.5,buttondown:!0,manual:!1}),h(t)}function i(t){var a=l(t),a=a.image.naturalWidth/a.canvas.width;a<1.5&&(a=1.5),l(t,{deltaX:-(a*=1.5),buttondown:!0,manual:!1}),h(t)}function s(t){var a=l(t),a=a.image.naturalHeight/a.canvas.height;a<1.5&&(a=1.5),l(t,{deltaY:-(a*=1.5),buttondown:!0,manual:!1}),h(t)}function r(t){var a=l(t),a=a.image.naturalHeight/a.canvas.height;a<1.5&&(a=1.5),l(t,{deltaY:a*=1.5,buttondown:!0,manual:!1}),h(t)}function c(t){l(t,{deltaFactor:1.005,buttondown:!0,manual:!1}),h(t)}function u(t){l(t,{deltaFactor:.995,buttondown:!0,manual:!1}),h(t)}function m(t){l(t,{deltaX:0,deltaY:0,deltaFactor:1,buttondown:!1})}function f(t,a){var n=l(t),o=g(a).X,e=g(a).Y;if(wppaIsFs()&&n.isLightbox&&(o<n.fsMaskLeft||o>n.fsMaskRight||e<n.fsMaskTop||e>n.fsMaskBottom))return l(0,{abort:!0}),void jQuery("#wppa-overlay-bg").trigger("click");n.enableManual&&(l(t,{manual:!0,savedCanvasX:o=b(t,a).X,savedCanvasY:e=b(t,a).Y,buttondown:!1}),h(t))}function w(t,a){a.preventDefault(),a.stopPropagation();var n,o=l(t),e=b(t,a).X,i=b(t,a).Y;o.manual&&(n=o.canvas.width/o.fromWidth,a=(o.savedCanvasX-e)/n+o.fromX,n=(o.savedCanvasY-i)/n+o.fromY,0<a&&0<n&&a+o.fromWidth<o.image.width&&n+o.fromHeight<o.image.height&&l(t,{fromX:a,fromY:n,savedCanvasX:e,savedCanvasY:i}))}function v(t){l(t,{manual:!1})}function l(t,a){if(!wppaZoomData[t])return!1;if(a)for(var n in a)wppaZoomData[t][n]=a[n];return wppaZoomData[t]}function g(t){var a;return t=t.touches?(a=t.touches[0].screenX,t.touches[0].screenY):(a=t.screenX,t.screenY),{X:a,Y:t}}function b(t,a){var n;return a=a.touches?(t=l(t),n=a.touches[0].screenX-t.fsMaskLeft,a.touches[0].screenY-t.fsMaskTop):(n=a.offsetX,a.offsetY),{X:n,Y:a}}function Y(){return d=new Date,d.getTime()}o.manual=!1,o.deltaX=0,o.deltaY=0,o.deltaFactor=1,o.busy=!1,o.div=p("#wppa-pan-div-"+o.itemId),o.canvas=document.getElementById("wppa-pan-canvas-"+o.itemId),o.left=p("#wppa-pctl-left-"+o.itemId),o.right=p("#wppa-pctl-right-"+o.itemId),o.up=p("#wppa-pctl-up-"+o.itemId),o.down=p("#wppa-pctl-down-"+o.itemId),o.zoomin=p("#wppa-pctl-zoomin-"+o.itemId),o.zoomout=p("#wppa-pctl-zoomout-"+o.itemId),o.prev=p("#wppa-pctl-prev-"+o.itemId),o.next=p("#wppa-pctl-next-"+o.itemId),o.exit=p("#wppa-exit-btn-2"),o.canvasWidth=o.width,o.canvasHeight=o.height,o.savedCanvasX=0,o.savedCanvasY=0,o.fromHeight=o.image.height,o.fromWidth=o.image.width,o.imageRatio=o.image.width/o.image.height,o.fromX=0,o.fromY=0,o.centerX=o.fromX+o.fromWidth/2,o.centerY=o.fromY+o.fromHeight/2,o.ctx=null,o.buttondown=!1,o.enableManual=!0,o.ctrlbarUpdate=!0,o.pause=!1,o.time=0,o.right.on("touchstart",function(t){e(n)}),o.right.on("touchend",function(t){m(n)}),o.left.on("touchstart",function(t){i(n)}),o.left.on("touchend",function(t){m(n)}),o.up.on("touchstart",function(t){s(n)}),o.up.on("touchend",function(t){m(n)}),o.down.on("touchstart",function(t){r(n)}),o.down.on("touchend",function(t){m(n)}),o.zoomin.on("touchstart",function(t){c(n)}),o.zoomin.on("touchend",function(t){m(n)}),o.zoomout.on("touchstart",function(t){u(n)}),o.zoomout.on("touchend",function(t){m(n)}),o.canvas.addEventListener("touchstart",function(t){f(n,t)}),o.canvas.addEventListener("touchmove",function(t){w(n,t)}),o.canvas.addEventListener("touchend",function(t){v(n)}),o.canvas.addEventListener("mousedown",function(t){f(n,t)}),o.canvas.addEventListener("mousemove",function(t){w(n,t)}),o.canvas.addEventListener("mouseup",function(t){v(n)}),o.canvas.addEventListener("mouseleave",function(t){(o=l(n)).manual&&l(n,{pause:!0})}),o.canvas.addEventListener("mouseenter",function(t){var a;l(a=n,{pause:!1}).manual&&h(a)}),document.getElementById("wppa-pan-canvas-"+o.itemId).addEventListener("wheel",function(t){var a;a=n,(t=t).preventDefault(),t.stopPropagation(),o=l(a),l(a,{deltaFactor:1+t.deltaY*o.zoomsensitivity/1e4,manual:!1,burrondown:!1}),h(a),setTimeout(function(){l(a,{deltaFactor:1})},25)}),o.right.on("mousedown",function(t){e(n)}),o.right.on("mouseup",function(t){m(n)}),o.left.on("mousedown",function(t){i(n)}),o.left.on("mouseup",function(t){m(n)}),o.up.on("mousedown",function(t){s(n)}),o.up.on("mouseup",function(t){m(n)}),o.down.on("mousedown",function(t){r(n)}),o.down.on("mouseup",function(t){m(n)}),o.zoomin.off("mousedown"),o.zoomin.on("mousedown",function(t){c(n)}),o.zoomin.off("mouseup"),o.zoomin.on("mouseup",function(t){m(n)}),o.zoomout.on("mousedown",function(t){u(n)}),o.zoomout.on("mouseup",function(t){m(n)}),o.isLightbox&&(p("body").on("quitimage",function(t){o=l(n,{abort:!0}),p(o.canvas).hide(),p("#wppa-pctl-div-"+o.itemId).hide(),p("#wppa-ovl-zoom-container").hide()}),p("#wppa-pctl-div-"+o.itemId).on("click",function(t){wppaKillEvent(t)})),o.isLightbox?(p(window).off("resize",wppaOvlShowSame),p(window).on("resize",wppaOvlShowSame)):p(window).on("wpparesizeend",function(t){a(n,t)}),a(n,"force"),o.initialized=!0,l(n,o),p("#wppa-ovl-spin").hide(),wppaProtect()}
|
17 |
// wppa-spheric
|
18 |
var wppaJsSphericVersion="8.2.01.005";function wppaDoSphericPan(t,n){var s=jQuery;n&&(wppaSphericData[t]=n);var w=f(t,w);function l(n){var e=f(n);!e.manCtrl&&b()<e.time+25||(f(n,{time:b()}),e.isLightbox&&(!wppaOvlOpen||wppaOvlActivePanorama!=e.id||wppaGlobalOvlPanoramaId>e.uId)&&(abort=!0),e.abort||((e.butDown||e.manCtrl)&&e.autorun&&(e.autorun=!1,e.dX=0),0==e.dX&&0==e.dY&&0==e.dFov&&(e.pause=!0),e.butDown&&(e.pause=!1),e.fov+=e.dFov,e.fov=Math.max(20,Math.min(120,e.fov)),e.wppaCamera=new THREE.PerspectiveCamera(e.fov,e.aspect,1,1e3),e.wppaCamera.target=new THREE.Vector3(0,0,0),e.lon+=e.dX,e.lat+=e.dY,e.lat=Math.max(-85,Math.min(85,e.lat)),e.wppaCamera.target.x=500*Math.sin(THREE.Math.degToRad(90-e.lat))*Math.cos(THREE.Math.degToRad(e.lon)),e.wppaCamera.target.y=500*Math.cos(THREE.Math.degToRad(90-e.lat)),e.wppaCamera.target.z=500*Math.sin(THREE.Math.degToRad(90-e.lat))*Math.sin(THREE.Math.degToRad(e.lon)),e.wppaCamera.lookAt(e.wppaCamera.target),e.wppaRenderer&&e.wppaRenderer.render(e.wppaScene,e.wppaCamera),wppaAdjustControlbar(),s("#wppa-ovl-spin").hide(),e.manCtrl,(e.autorun||!e.pause&&(e.manCtrl||e.butDown))&&e.wppaRenderer&&(e.timer=setTimeout(function(){l(n)},25)),f(n,e)))}function e(n,e){var t=!wppaIsFs();if(w=f(n)){if(w.isLightbox){if(!wppaOvlOpen)return;s("#wppa-overlay-pc").show(),s("#wppa-overlay-pc").css("width","");var a,o,p=(t=!wppaIsFs())?(o=window.innerWidth||screen.width,window.innerHeight||screen.height):(o=screen.width,screen.height),i=8,r=8+(w.controls?w.icsize+10:0)+30;t&&(i+=2*w.borderWidth,r+=2*w.borderWidth),a=(o-i)/2+r<p,r=t?a?(p-(c=(u=o-i)/2)-r)/2+20:(u=2*(c=p-r),20):(u=screen.width,c=screen.height,0),w.aspect=u/c,s("#wppa-ovl-sphericpan-container").css({top:r}),s("#wppa-overlay-pc").css({top:0}),t?(s("#wppa-ovl-sphericpan-container").css({backgroundColor:w.backgroundColor,padding:w.padding+"px",borderRadius:w.borderRadius+"px",width:u}),a?s("#wppa-overlay-pc").css({left:4}):s("#wppa-overlay-pc").css({left:(o-u)/2})):s("#wppa-ovl-sphericpan-container").css({backgroundColor:"transparent",padding:0,borderRadius:"0px",width:u,left:(o-u)/2}),w.wppaRenderer.setSize(u,c)}else{if("force"!=e&&0<w.width&&w.width==u&&w.height==c)return;var u=s(w.div).parent().width(),c=parseInt(u/2);if(!w.wppaRenderer)return;w.wppaRenderer.setSize(u,c)}w.width=u,w.height=c,f(n,w),w.timer=setTimeout(function(){l(n)},250)}}function a(n,e){e.preventDefault(),e.stopPropagation(),w=f(n,{manCtrl:!0,butDown:!1,autorun:!1,dX:0}),e.touches?f(n,{sX:e.touches[0].clientX,sY:e.touches[0].clientY}):f(n,{sX:e.clientX,sY:e.clientY}),f(n,{sLon:w.lon,sLat:w.lat}),l(n)}function o(n,e){e.preventDefault(),e.stopPropagation(),(w=f(n)).manCtrl&&(e.touches?f(n,{lon:.1*(w.sX-e.touches[0].clientX)+w.sLon,lat:.1*(e.touches[0].clientY-w.sY)+w.sLat,pause:!1}):f(n,{lon:.1*(w.sX-e.clientX)+w.sLon,lat:.1*(e.clientY-w.sY)+w.sLat,pause:!1}),l(n))}function p(n){f(n,{manCtrl:!1})}function i(n){w=f(n),f(n,{dFov:-.4*w.mFakt,butDown:!0}),l(n)}function r(n){w=f(n),f(n,{dFov:.4*w.mFakt,butDown:!0}),l(n)}function u(n){w=f(n),f(n,{dX:.2*w.mFakt,butDown:!0}),l(n)}function c(n){w=f(n),f(n,{dX:-.2*w.mFakt,butDown:!0}),l(n)}function h(n){w=f(n),f(n,{dY:.2*w.mFakt,butDown:!0}),l(n)}function m(n){w=f(n),f(n,{dY:-.2*w.mFakt,butDown:!0}),l(n)}function v(n){w=f(n),f(n,{dX:0,dY:0,dFov:0,butDown:!1,manCtrl:!1})}function f(n,e){if(!wppaSphericData[n])return!1;if(e)for(var t in e)wppaSphericData[n][t]=e[t];return wppaSphericData[n]}function b(){return d=new Date,d.getTime()}w.initialized||w.abort||w.isLightbox&&!wppaOvlOpen||(w.wppaRenderer&&(w.wppaRenderer.state.reset(),w.wppaSphere.dispose(),w.wppaSphereMaterial.dispose(),w.texture.dispose()),w.isLightbox&&wppaOvlOpen&&(s("#wppa-ovl-spin").show(),s("#wppa-overlay-ic").html("")),w.manCtrl=!1,w.butDown=!1,w.lon=180,w.lat=0,w.dFov=0,w.abort=!1,w.aspect=2,w.div=s("#wppa-pan-div-"+t),w.left=s("#wppa-pctl-left-"+t),w.right=s("#wppa-pctl-right-"+t),w.up=s("#wppa-pctl-up-"+t),w.down=s("#wppa-pctl-down-"+t),w.zoomin=s("#wppa-pctl-zoomin-"+t),w.zoomout=s("#wppa-pctl-zoomout-"+t),w.prev=s("#wppa-pctl-prev-"+t),w.next=s("#wppa-pctl-next-"+t),w.pause=!1,w.mFakt=wppaIsMobile?"2":"1",w.time=0,w.isLightbox&&(wppaGlobalOvlPanoramaId++,w.uId=wppaGlobalOvlPanoramaId),s(w.div).html(""),w.wppaRenderer||(w.wppaRenderer=new THREE.WebGLRenderer),w.wppaRenderer.setSize(w.width,w.height),s(w.div).append(w.wppaRenderer.domElement),w.wppaScene=new THREE.Scene,w.wppaSphere=new THREE.SphereGeometry(100,100,40),w.wppaSphere.applyMatrix4((new THREE.Matrix4).makeScale(-1,1,1)),w.texture=(new THREE.TextureLoader).load(w.url),w.wppaSphereMaterial=new THREE.MeshBasicMaterial({map:w.texture}),w.wppaSphereMesh=new THREE.Mesh(w.wppaSphere,w.wppaSphereMaterial),w.wppaScene.add(w.wppaSphereMesh),w.right.on("touchstart",function(n){u(t)}),w.right.on("touchend",function(n){v(t)}),w.left.on("touchstart",function(n){c(t)}),w.left.on("touchend",function(n){v(t)}),w.up.on("touchstart",function(n){h(t)}),w.up.on("touchend",function(n){v(t)}),w.down.on("touchstart",function(n){m(t)}),w.down.on("touchend",function(n){v(t)}),w.zoomin.on("touchstart",function(n){i(t)}),w.zoomin.on("touchend",function(n){v(t)}),w.zoomout.on("touchstart",function(n){r(t)}),w.zoomout.on("touchend",function(n){v(t)}),w.enableManual&&0<s("#wppa-pan-div-"+t+" canvas").length&&(s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchstart",function(n){a(t,n)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchmove",function(n){o(t,n)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("touchend",function(n){p(t)})),w.right.on("mousedown",function(n){u(t)}),w.right.on("mouseup",function(n){v(t)}),w.left.on("mousedown",function(n){c(t)}),w.left.on("mouseup",function(n){v(t)}),w.up.on("mousedown",function(n){h(t)}),w.up.on("mouseup",function(n){v(t)}),w.down.on("mousedown",function(n){m(t)}),w.down.on("mouseup",function(n){v(t)}),w.zoomin.off("mousedown"),w.zoomin.on("mousedown",function(n){i(t)}),w.zoomin.off("mouseup"),w.zoomin.on("mouseup",function(n){v(t)}),w.zoomout.on("mousedown",function(n){r(t)}),w.zoomout.on("mouseup",function(n){v(t)}),w.enableManual&&0<s("#wppa-pan-div-"+t+" canvas").length&&(s("#wppa-pan-div-"+t+" canvas").on("mousedown",function(n){a(t,n)}),s("#wppa-pan-div-"+t+" canvas").on("mousemove",function(n){o(t,n)}),s("#wppa-pan-div-"+t+" canvas").on("mouseup",function(n){p(t)}),s("#wppa-pan-div-"+t+" canvas")[0].addEventListener("wheel",function(n){var e;e=t,(n=n).preventDefault(),n.stopPropagation(),w=f(e),f(e,{manCtrl:!1,butDown:!1,autorun:!1,dX:0,dFov:-n.deltaY*w.zoomsensitivity/60}),l(e),setTimeout(function(){f(e,{dFov:0})},25)})),w.isLightbox&&(s("body").on("quitimage",function(n){var e;w=f(e=t,{abort:!0,autorun:!1}),clearTimeout(w.timer),clearInterval(w.intervalTimer),s("#wppa-pan-div-"+e+" canvas").hide(),s("#wppa-pctl-div-"+e).hide(),s("#wppa-overlay-pc").hide()}),s("#wppa-pctl-div-"+t).on("click",function(n){wppaKillEvent(n)})),f(t,w),s(window).on("wpparesizeend",function(n){e(t,n)}),wppaProtect(),s(document).on("tabbychange",function(n){var e;e=t,w.wppaRenderer.state.reset(),w=f(e,{initialized:!1,abort:!0}),setTimeout(function(){f(e,{abort:!1}),wppaDoSphericPan(e)},200)}),e(t,"force"))}
|
19 |
// wppa-flatpan
|
js/wppa-zoom.js
CHANGED
@@ -2,20 +2,20 @@
|
|
2 |
//
|
3 |
// contains wppa functions for simple zoomable photos
|
4 |
//
|
5 |
-
var wppaJsZoomVersion = '8.2.
|
6 |
|
7 |
// The main proccedure
|
8 |
function wppaDoZoomPan(mocc, xdata) {
|
9 |
|
10 |
// Handy shorthand
|
11 |
var $ = jQuery;
|
12 |
-
|
13 |
// Store the data
|
14 |
wppaZoomData[mocc] = xdata;
|
15 |
|
16 |
// Update data with image
|
17 |
var data = update(mocc,{image:document.getElementById( "wppa-" + xdata.itemId )});
|
18 |
-
|
19 |
// Find additional data
|
20 |
data.manual = false;
|
21 |
data.deltaX = 0;
|
@@ -64,7 +64,7 @@ function wppaDoZoomPan(mocc, xdata) {
|
|
64 |
data.zoomin.on("touchend", function(e){buttonUp(mocc, e)});
|
65 |
data.zoomout.on("touchstart", function(e){minDown(mocc, e)});
|
66 |
data.zoomout.on("touchend", function(e){buttonUp(mocc, e)});
|
67 |
-
|
68 |
data.canvas.addEventListener("touchstart", function(e){canvasDown(mocc, e)});
|
69 |
data.canvas.addEventListener("touchmove", function(e){canvasMove(mocc, e)});
|
70 |
data.canvas.addEventListener("touchend", function(e){canvasUp(mocc,e)});
|
@@ -153,7 +153,6 @@ function wppaDoZoomPan(mocc, xdata) {
|
|
153 |
}
|
154 |
|
155 |
// Finally decides to do the rendering
|
156 |
-
wppaDebugCounter++;
|
157 |
|
158 |
data = update(mocc,{busy:true});
|
159 |
|
2 |
//
|
3 |
// contains wppa functions for simple zoomable photos
|
4 |
//
|
5 |
+
var wppaJsZoomVersion = '8.2.05.001';
|
6 |
|
7 |
// The main proccedure
|
8 |
function wppaDoZoomPan(mocc, xdata) {
|
9 |
|
10 |
// Handy shorthand
|
11 |
var $ = jQuery;
|
12 |
+
|
13 |
// Store the data
|
14 |
wppaZoomData[mocc] = xdata;
|
15 |
|
16 |
// Update data with image
|
17 |
var data = update(mocc,{image:document.getElementById( "wppa-" + xdata.itemId )});
|
18 |
+
|
19 |
// Find additional data
|
20 |
data.manual = false;
|
21 |
data.deltaX = 0;
|
64 |
data.zoomin.on("touchend", function(e){buttonUp(mocc, e)});
|
65 |
data.zoomout.on("touchstart", function(e){minDown(mocc, e)});
|
66 |
data.zoomout.on("touchend", function(e){buttonUp(mocc, e)});
|
67 |
+
|
68 |
data.canvas.addEventListener("touchstart", function(e){canvasDown(mocc, e)});
|
69 |
data.canvas.addEventListener("touchmove", function(e){canvasMove(mocc, e)});
|
70 |
data.canvas.addEventListener("touchend", function(e){canvasUp(mocc,e)});
|
153 |
}
|
154 |
|
155 |
// Finally decides to do the rendering
|
|
|
156 |
|
157 |
data = update(mocc,{busy:true});
|
158 |
|
js/wppa-zoom.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wppaJsZoomVersion="8.2.
|
1 |
+
var wppaJsZoomVersion="8.2.05.001";function wppaDoZoomPan(n,t){var p=jQuery;wppaZoomData[n]=t;var o=l(n,{image:document.getElementById("wppa-"+t.itemId)});function h(t){var a,n,o,e,i,s=l(t);s.canvas&&(Y()<s.time+10||(l(t,{time:Y()}),(s.isLightbox&&!wppaOvlOpen||!s.isLightbox&&wppaOvlOpen)&&(s=l(0,{abort:!0})),s.abort?l(t,{manual:!1,buttondown:!1,pause:!1,ctx:null}):s.busy||(e=(s=l(t,{busy:!0})).fromX,i=s.fromY,s.manual||(s.fromX+=s.deltaX,s.fromY+=s.deltaY,a=s.fromHeight/s.deltaFactor,n=s.fromWidth/s.deltaFactor,50<a&&(wppaIsFs()||a<=s.image.height)?(s.fromX-=(n-s.fromWidth)/2,s.fromY-=(a-s.fromHeight)/2,s.fromWidth=n,s.fromHeight=a):s.buttondown=!1),s.fromX=Math.max(0,Math.min(s.image.width-s.fromWidth,s.fromX)),s.fromY=Math.max(0,Math.min(s.image.height-s.fromHeight,s.fromY)),e==s.fromX&&i==s.fromY&&1==s.deltaFactor&&(s.buttondown=!1),o=screen.width/screen.height,e=(1-s.image.width/s.fromWidth)*s.canvas.width/2,i=(1-s.image.height/s.fromHeight)*s.canvas.height/2,s.ctx=s.canvas.getContext("2d"),o>s.imageRatio&&a>s.image.height&&wppaIsFs()||o<=s.imageRatio&&n>s.image.width&&wppaIsFs()?(s.enableManual=!1,s.ctx.clearRect(0,0,s.canvas.width,s.canvas.height),s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,e,i,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"default"})):(s.enableManual=!0,s.ctx.drawImage(s.image,s.fromX,s.fromY,s.fromWidth,s.fromHeight,0,0,s.canvas.width,s.canvas.height),jQuery(s.canvas).css({cursor:"grab"})),wppaIsFs()?(s.fsMaskTop=i-(s.canvas.height-screen.height)/2,s.fsMaskLeft=e-(s.canvas.width-screen.width)/2,s.fsMaskBottom=screen.height-s.fsMaskTop,s.fsMaskRight=screen.width-s.fsMaskLeft):(s.fsMaskTop=0,s.fsMaskLeft=0,s.fsMaskBottom=0,s.fsMaskRight=0),s.ctrlbarUpdate&&(wppaAdjustControlbar(),s.ctrlbarUpdate=!1),s.busy=!1,wppaIsElementInViewport(s.canvas)||(s.buttondown=!1),l(t,s),s.pause||!s.manual&&!s.buttondown||setTimeout(function(){h(t)},10),s.pause&&l(t,{pause:!1}))))}function a(t,a){var n,o=l(t);if(o){if(o.isLightbox){p("#wppa-overlay-zpc").css("display","");var e,i,s,r=!wppaIsFs(),c=r?(e=window.innerWidth||screen.width,window.innerHeight||screen.height):(e=screen.width,screen.height),d=0,u=8,m=8+(o.controls?o.icsize+10:0)+10;r?(u+=2*o.borderWidth,m+=2*o.borderWidth):u=40,n=r?c-m>(e-u)/o.imageRatio:(screenRatio=screen.width/screen.height,screenRatio<o.imageRatio),r&&n&&(d=(c-(s=(i=e-u)/o.imageRatio)-m)/2+20),r&&!n&&(s=(i=o.imageRatio*(c-(o.controls?o.icsize:0)-48))/o.imageRatio,d=20),!r&&n&&(i=(s=screen.height)*o.imageRatio,d=0),r||n||(s=(i=screen.width)/o.imageRatio,d=(screen.height-s)/2),p("#wppa-ovl-zoom-container").css({top:d}),p("#wppa-overlay-zpc").css({top:0,left:0}),o.canvasWidth=i,o.canvasHeight=s,o.canvas.width=o.canvasWidth,o.canvas.height=o.canvasHeight,r?(p("#wppa-ovl-zoom-container").css({backgroundColor:o.backgroundColor,padding:o.padding,borderRadius:o.borderRadius+"px",borderWidth:o.borderWidth+"px",width:i,marginLeft:0}),n?p("#wppa-overlay-zpc").css({left:4}):p("#wppa-overlay-zpc").css({left:(e-i)/2})):(p("#wppa-overlay-zpc").css({marginLeft:0}),p("#wppa-ovl-zoom-container").css({backgroundColor:"transparent",padding:0,borderRadius:"0px",borderWidth:"0px",width:i,left:(e-i)/2,position:"fixed"})),o.ctrlbarUpdate=!0}else{if("force"!=a&&o.canvasWidth==p(o.div).parent().width())return;o.canvasWidth=p(o.div).parent().width(),o.canvasHeight=o.canvasWidth/o.imageRatio,o.canvas.width=o.canvasWidth,o.canvas.height=o.canvasHeight,o.ctrlbarUpdate=!0}l(t,o),setTimeout(function(){h(t)},1),p("#wppa-ovl-zoom-container").show()}}function e(t){var a=l(t),a=a.image.naturalWidth/a.canvas.width;a<1.5&&(a=1.5),l(t,{deltaX:a*=1.5,buttondown:!0,manual:!1}),h(t)}function i(t){var a=l(t),a=a.image.naturalWidth/a.canvas.width;a<1.5&&(a=1.5),l(t,{deltaX:-(a*=1.5),buttondown:!0,manual:!1}),h(t)}function s(t){var a=l(t),a=a.image.naturalHeight/a.canvas.height;a<1.5&&(a=1.5),l(t,{deltaY:-(a*=1.5),buttondown:!0,manual:!1}),h(t)}function r(t){var a=l(t),a=a.image.naturalHeight/a.canvas.height;a<1.5&&(a=1.5),l(t,{deltaY:a*=1.5,buttondown:!0,manual:!1}),h(t)}function c(t){l(t,{deltaFactor:1.005,buttondown:!0,manual:!1}),h(t)}function u(t){l(t,{deltaFactor:.995,buttondown:!0,manual:!1}),h(t)}function m(t){l(t,{deltaX:0,deltaY:0,deltaFactor:1,buttondown:!1})}function f(t,a){var n=l(t),o=g(a).X,e=g(a).Y;if(wppaIsFs()&&n.isLightbox&&(o<n.fsMaskLeft||o>n.fsMaskRight||e<n.fsMaskTop||e>n.fsMaskBottom))return l(0,{abort:!0}),void jQuery("#wppa-overlay-bg").trigger("click");n.enableManual&&(l(t,{manual:!0,savedCanvasX:o=b(t,a).X,savedCanvasY:e=b(t,a).Y,buttondown:!1}),h(t))}function w(t,a){a.preventDefault(),a.stopPropagation();var n,o=l(t),e=b(t,a).X,i=b(t,a).Y;o.manual&&(n=o.canvas.width/o.fromWidth,a=(o.savedCanvasX-e)/n+o.fromX,n=(o.savedCanvasY-i)/n+o.fromY,0<a&&0<n&&a+o.fromWidth<o.image.width&&n+o.fromHeight<o.image.height&&l(t,{fromX:a,fromY:n,savedCanvasX:e,savedCanvasY:i}))}function v(t){l(t,{manual:!1})}function l(t,a){if(!wppaZoomData[t])return!1;if(a)for(var n in a)wppaZoomData[t][n]=a[n];return wppaZoomData[t]}function g(t){var a;return t=t.touches?(a=t.touches[0].screenX,t.touches[0].screenY):(a=t.screenX,t.screenY),{X:a,Y:t}}function b(t,a){var n;return a=a.touches?(t=l(t),n=a.touches[0].screenX-t.fsMaskLeft,a.touches[0].screenY-t.fsMaskTop):(n=a.offsetX,a.offsetY),{X:n,Y:a}}function Y(){return d=new Date,d.getTime()}o.manual=!1,o.deltaX=0,o.deltaY=0,o.deltaFactor=1,o.busy=!1,o.div=p("#wppa-pan-div-"+o.itemId),o.canvas=document.getElementById("wppa-pan-canvas-"+o.itemId),o.left=p("#wppa-pctl-left-"+o.itemId),o.right=p("#wppa-pctl-right-"+o.itemId),o.up=p("#wppa-pctl-up-"+o.itemId),o.down=p("#wppa-pctl-down-"+o.itemId),o.zoomin=p("#wppa-pctl-zoomin-"+o.itemId),o.zoomout=p("#wppa-pctl-zoomout-"+o.itemId),o.prev=p("#wppa-pctl-prev-"+o.itemId),o.next=p("#wppa-pctl-next-"+o.itemId),o.exit=p("#wppa-exit-btn-2"),o.canvasWidth=o.width,o.canvasHeight=o.height,o.savedCanvasX=0,o.savedCanvasY=0,o.fromHeight=o.image.height,o.fromWidth=o.image.width,o.imageRatio=o.image.width/o.image.height,o.fromX=0,o.fromY=0,o.centerX=o.fromX+o.fromWidth/2,o.centerY=o.fromY+o.fromHeight/2,o.ctx=null,o.buttondown=!1,o.enableManual=!0,o.ctrlbarUpdate=!0,o.pause=!1,o.time=0,o.right.on("touchstart",function(t){e(n)}),o.right.on("touchend",function(t){m(n)}),o.left.on("touchstart",function(t){i(n)}),o.left.on("touchend",function(t){m(n)}),o.up.on("touchstart",function(t){s(n)}),o.up.on("touchend",function(t){m(n)}),o.down.on("touchstart",function(t){r(n)}),o.down.on("touchend",function(t){m(n)}),o.zoomin.on("touchstart",function(t){c(n)}),o.zoomin.on("touchend",function(t){m(n)}),o.zoomout.on("touchstart",function(t){u(n)}),o.zoomout.on("touchend",function(t){m(n)}),o.canvas.addEventListener("touchstart",function(t){f(n,t)}),o.canvas.addEventListener("touchmove",function(t){w(n,t)}),o.canvas.addEventListener("touchend",function(t){v(n)}),o.canvas.addEventListener("mousedown",function(t){f(n,t)}),o.canvas.addEventListener("mousemove",function(t){w(n,t)}),o.canvas.addEventListener("mouseup",function(t){v(n)}),o.canvas.addEventListener("mouseleave",function(t){(o=l(n)).manual&&l(n,{pause:!0})}),o.canvas.addEventListener("mouseenter",function(t){var a;l(a=n,{pause:!1}).manual&&h(a)}),document.getElementById("wppa-pan-canvas-"+o.itemId).addEventListener("wheel",function(t){var a;a=n,(t=t).preventDefault(),t.stopPropagation(),o=l(a),l(a,{deltaFactor:1+t.deltaY*o.zoomsensitivity/1e4,manual:!1,burrondown:!1}),h(a),setTimeout(function(){l(a,{deltaFactor:1})},25)}),o.right.on("mousedown",function(t){e(n)}),o.right.on("mouseup",function(t){m(n)}),o.left.on("mousedown",function(t){i(n)}),o.left.on("mouseup",function(t){m(n)}),o.up.on("mousedown",function(t){s(n)}),o.up.on("mouseup",function(t){m(n)}),o.down.on("mousedown",function(t){r(n)}),o.down.on("mouseup",function(t){m(n)}),o.zoomin.off("mousedown"),o.zoomin.on("mousedown",function(t){c(n)}),o.zoomin.off("mouseup"),o.zoomin.on("mouseup",function(t){m(n)}),o.zoomout.on("mousedown",function(t){u(n)}),o.zoomout.on("mouseup",function(t){m(n)}),o.isLightbox&&(p("body").on("quitimage",function(t){o=l(n,{abort:!0}),p(o.canvas).hide(),p("#wppa-pctl-div-"+o.itemId).hide(),p("#wppa-ovl-zoom-container").hide()}),p("#wppa-pctl-div-"+o.itemId).on("click",function(t){wppaKillEvent(t)})),o.isLightbox?(p(window).off("resize",wppaOvlShowSame),p(window).on("resize",wppaOvlShowSame)):p(window).on("wpparesizeend",function(t){a(n,t)}),a(n,"force"),o.initialized=!0,l(n,o),p("#wppa-ovl-spin").hide(),wppaProtect()}
|
wppa-admin-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* gp admin functions
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -51,7 +51,6 @@ global $wppa_opt;
|
|
51 |
|
52 |
function wppa_restore_settings( $fname, $type = '' ) {
|
53 |
|
54 |
-
if ( wppa( 'debug' ) ) wppa_dbg_msg( 'Restoring from: '.$fname );
|
55 |
if ( $type == 'skin' ) {
|
56 |
$void_these = array(
|
57 |
'wppa_revision',
|
@@ -108,9 +107,7 @@ function wppa_restore_settings( $fname, $type = '' ) {
|
|
108 |
$value = substr( $buffer, $cpos+1, $delta_l );
|
109 |
$value = str_replace( '\n', "\n", $value ); // Replace substr '\n' by nl char value
|
110 |
$value = stripslashes( $value );
|
111 |
-
//wppa_dbg_msg( 'Doing|'.$slug.'|'.$value );
|
112 |
if ( ! in_array( $slug, $void_these ) ) wppa_update_option( $slug, $value );
|
113 |
-
else wppa_dbg_msg( $slug.' skipped' );
|
114 |
}
|
115 |
}
|
116 |
}
|
@@ -519,7 +516,7 @@ function wppa_sanitize_files() {
|
|
519 |
function _wppa_sanitze_files( $root ) {
|
520 |
|
521 |
$allowed_types = wppa_get_supported_extensions();
|
522 |
-
if (
|
523 |
$allowed_types = array_merge( $allowed_types, array( 'amf', 'pmf', 'csv' ) );
|
524 |
}
|
525 |
if ( current_user_can( 'wppa_settings' ) ) {
|
@@ -638,7 +635,7 @@ global $wpdb;
|
|
638 |
|
639 |
// Update modified timestamp
|
640 |
wppa_update_modified( $id );
|
641 |
-
|
642 |
}
|
643 |
|
644 |
function wppa_update_photo_files( $file, $xname ) {
|
@@ -1022,11 +1019,11 @@ global $wpdb;
|
|
1022 |
}
|
1023 |
|
1024 |
// edit album url
|
1025 |
-
function wppa_ea_url($edit_id, $tab = 'edit') {
|
1026 |
|
1027 |
-
$nonce = wp_create_nonce('wppa-nonce');
|
1028 |
|
1029 |
-
return
|
1030 |
}
|
1031 |
|
1032 |
// Convert a non 360 deg spheric panorama photo to 360 deg by padding
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* gp admin functions
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
51 |
|
52 |
function wppa_restore_settings( $fname, $type = '' ) {
|
53 |
|
|
|
54 |
if ( $type == 'skin' ) {
|
55 |
$void_these = array(
|
56 |
'wppa_revision',
|
107 |
$value = substr( $buffer, $cpos+1, $delta_l );
|
108 |
$value = str_replace( '\n', "\n", $value ); // Replace substr '\n' by nl char value
|
109 |
$value = stripslashes( $value );
|
|
|
110 |
if ( ! in_array( $slug, $void_these ) ) wppa_update_option( $slug, $value );
|
|
|
111 |
}
|
112 |
}
|
113 |
}
|
516 |
function _wppa_sanitze_files( $root ) {
|
517 |
|
518 |
$allowed_types = wppa_get_supported_extensions();
|
519 |
+
if ( wppa_user_is_admin() ) {
|
520 |
$allowed_types = array_merge( $allowed_types, array( 'amf', 'pmf', 'csv' ) );
|
521 |
}
|
522 |
if ( current_user_can( 'wppa_settings' ) ) {
|
635 |
|
636 |
// Update modified timestamp
|
637 |
wppa_update_modified( $id );
|
638 |
+
|
639 |
}
|
640 |
|
641 |
function wppa_update_photo_files( $file, $xname ) {
|
1019 |
}
|
1020 |
|
1021 |
// edit album url
|
1022 |
+
function wppa_ea_url( $edit_id, $tab = 'edit' ) {
|
1023 |
|
1024 |
+
$nonce = wp_create_nonce( 'wppa-nonce' );
|
1025 |
|
1026 |
+
return get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=' . $tab . '&edit-id=' . $edit_id . '&wppa-nonce=' . $nonce;
|
1027 |
}
|
1028 |
|
1029 |
// Convert a non 360 deg spheric panorama photo to 360 deg by padding
|
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.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -21,7 +21,7 @@ function wppa_add_admin() {
|
|
21 |
global $wpdb;
|
22 |
|
23 |
// Make sure admin has access rights
|
24 |
-
if (
|
25 |
$wp_roles->add_cap( 'administrator', 'wppa_admin' );
|
26 |
$wp_roles->add_cap( 'administrator', 'wppa_upload' );
|
27 |
$wp_roles->add_cap( 'administrator', 'wppa_import' );
|
@@ -107,7 +107,7 @@ global $wppa_api_version;
|
|
107 |
}
|
108 |
|
109 |
// Standard wppa frontend styles
|
110 |
-
wp_register_style('wppa_style', WPPA_URL.'/
|
111 |
wp_enqueue_style('wppa_style');
|
112 |
|
113 |
$the_css = wppa_create_wppa_dynamic_css();
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
21 |
global $wpdb;
|
22 |
|
23 |
// Make sure admin has access rights
|
24 |
+
if ( wppa_user_is_admin() ) {
|
25 |
$wp_roles->add_cap( 'administrator', 'wppa_admin' );
|
26 |
$wp_roles->add_cap( 'administrator', 'wppa_upload' );
|
27 |
$wp_roles->add_cap( 'administrator', 'wppa_import' );
|
107 |
}
|
108 |
|
109 |
// Standard wppa frontend styles
|
110 |
+
wp_register_style('wppa_style', WPPA_URL.'/wppa-style.css', array(), $wppa_api_version);
|
111 |
wp_enqueue_style('wppa_style');
|
112 |
|
113 |
$the_css = wppa_create_wppa_dynamic_css();
|
wppa-adminbar.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* enhances the admin bar with wppa+ menu
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*/
|
9 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* enhances the admin bar with wppa+ menu
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*/
|
9 |
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 8.2.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -2371,7 +2371,6 @@ global $wppa;
|
|
2371 |
/* */
|
2372 |
break;
|
2373 |
default:
|
2374 |
-
wppa_dbg_msg( 'Missing upload instructions for '.$cdn, 'red', 'force' );
|
2375 |
}
|
2376 |
}
|
2377 |
|
@@ -2605,9 +2604,6 @@ global $wppa;
|
|
2605 |
if ( is_wp_error( $thumb_id ) ) {
|
2606 |
wppa_log( 'err', $thumb_id->get_error_message() );
|
2607 |
}
|
2608 |
-
else {
|
2609 |
-
// wppa_log( 'obs', 'Attachment id = ' . ( $thumb_id ? $thumb_id : 'none' ) );
|
2610 |
-
}
|
2611 |
}
|
2612 |
}
|
2613 |
}
|
@@ -2642,23 +2638,16 @@ global $wppa;
|
|
2642 |
if ( is_wp_error( $thumb_id ) ) {
|
2643 |
wppa_log( 'err', $thumb_id->get_error_message() );
|
2644 |
}
|
2645 |
-
else {
|
2646 |
-
// wppa_log( 'obs', 'Attachment id = ' . ( $thumb_id ? $thumb_id : 'none' ) );
|
2647 |
-
}
|
2648 |
}
|
2649 |
}
|
2650 |
|
2651 |
// A photo
|
2652 |
else {
|
2653 |
-
// wppa_log( 'OBS', 'Trying to add to WP media: '.wppa_get_hires_url( $photo ) );
|
2654 |
$thumb_id = media_sideload_image( wppa_get_hires_url( $photo ), 0, wppa_get_photo_desc( $photo ) );
|
2655 |
|
2656 |
if ( is_wp_error( $thumb_id ) ) {
|
2657 |
wppa_log( 'err', $thumb_id->get_error_message() );
|
2658 |
}
|
2659 |
-
else {
|
2660 |
-
// wppa_log( 'obs', 'Attachment id = ' . ( $thumb_id ? $thumb_id : 'none' ) );
|
2661 |
-
}
|
2662 |
}
|
2663 |
}
|
2664 |
if ( $iret !== false ) {
|
@@ -4096,7 +4085,6 @@ function wppa_json_photo_update( $id, $txt, $err = '0', $thumbmod = false, $phot
|
|
4096 |
wppa_cdn_delete( $id );
|
4097 |
break;
|
4098 |
default:
|
4099 |
-
wppa_dbg_msg( 'Missing upload instructions for '.$cdn, 'red', 'force' );
|
4100 |
}
|
4101 |
}
|
4102 |
}
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 8.2.05.001
|
6 |
*
|
7 |
*/
|
8 |
|
2371 |
/* */
|
2372 |
break;
|
2373 |
default:
|
|
|
2374 |
}
|
2375 |
}
|
2376 |
|
2604 |
if ( is_wp_error( $thumb_id ) ) {
|
2605 |
wppa_log( 'err', $thumb_id->get_error_message() );
|
2606 |
}
|
|
|
|
|
|
|
2607 |
}
|
2608 |
}
|
2609 |
}
|
2638 |
if ( is_wp_error( $thumb_id ) ) {
|
2639 |
wppa_log( 'err', $thumb_id->get_error_message() );
|
2640 |
}
|
|
|
|
|
|
|
2641 |
}
|
2642 |
}
|
2643 |
|
2644 |
// A photo
|
2645 |
else {
|
|
|
2646 |
$thumb_id = media_sideload_image( wppa_get_hires_url( $photo ), 0, wppa_get_photo_desc( $photo ) );
|
2647 |
|
2648 |
if ( is_wp_error( $thumb_id ) ) {
|
2649 |
wppa_log( 'err', $thumb_id->get_error_message() );
|
2650 |
}
|
|
|
|
|
|
|
2651 |
}
|
2652 |
}
|
2653 |
if ( $iret !== false ) {
|
4085 |
wppa_cdn_delete( $id );
|
4086 |
break;
|
4087 |
default:
|
|
|
4088 |
}
|
4089 |
}
|
4090 |
}
|
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.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -503,7 +503,7 @@ global $wppa_revno;
|
|
503 |
function wppaTrySetAllPanorama( id ) {
|
504 |
var panoval = jQuery( "#pano-opt" ).val();
|
505 |
if ( panoval == 0 || panoval == 1 || panoval == 2 ) {
|
506 |
-
var url = "' .
|
507 |
document.location = url;
|
508 |
}
|
509 |
else {
|
@@ -571,7 +571,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
571 |
|
572 |
$onc = ( $full ?
|
573 |
'alert(\''.__( 'Change the upload limit or remove photos to enable new uploads.', 'wp-photo-album-plus' ).'\')' :
|
574 |
-
'document.location = \''.
|
575 |
);
|
576 |
$val = ( $full ?
|
577 |
__( 'Album is full', 'wp-photo-album-plus' ) :
|
@@ -590,7 +590,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
590 |
// Goto Import
|
591 |
if ( current_user_can( 'wppa_import' ) && ! $full ) {
|
592 |
|
593 |
-
$onc = 'document.location = \''.
|
594 |
$val = __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' );
|
595 |
|
596 |
wppa_echo( '
|
@@ -605,7 +605,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
605 |
</div>' ); // end action-container-left
|
606 |
|
607 |
// Download album
|
608 |
-
if ( wppa_switch( 'allow_download_album' ) && ( ! wppa_switch( 'download_album_is_restricted' ) ||
|
609 |
wppa_echo( '
|
610 |
<div id="wppa-action-container-right">
|
611 |
<input
|
@@ -694,7 +694,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
694 |
__( 'Unchangeable items', 'wp-photo-album-plus' ) . '
|
695 |
</legend>' );
|
696 |
|
697 |
-
// Album number, crypt, timestamp
|
698 |
wppa_echo( '
|
699 |
<div class="left">
|
700 |
<label>' .
|
@@ -721,6 +721,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
721 |
</div>
|
722 |
</div>' );
|
723 |
|
|
|
724 |
wppa_echo( '
|
725 |
<div class="left">
|
726 |
<label>' .
|
@@ -737,6 +738,25 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
737 |
</div>
|
738 |
</div>' );
|
739 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
740 |
// Views
|
741 |
if ( wppa_switch( 'track_viewcounts' ) ) {
|
742 |
wppa_echo( '
|
@@ -801,7 +821,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
801 |
</legend>' );
|
802 |
|
803 |
// Owner
|
804 |
-
{
|
805 |
$result = '
|
806 |
<div class="left">
|
807 |
<label
|
@@ -809,47 +829,38 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
809 |
__( 'Owned by', 'wp-photo-album-plus' ) . '
|
810 |
</label><br>';
|
811 |
|
812 |
-
if (
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
|
|
819 |
}
|
820 |
else {
|
821 |
-
if (
|
822 |
-
$
|
823 |
-
|
824 |
-
id="albumowner"
|
825 |
-
type="text"
|
826 |
-
value="' . esc_attr( $owner ) . '"
|
827 |
-
onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
|
828 |
-
/>';
|
829 |
-
}
|
830 |
-
else {
|
831 |
-
if ( wppa_switch( 'user_upload_on' ) ) {
|
832 |
-
if ( $owner == '--- public ---' ) {
|
833 |
-
$title = __( 'Frontend upload to this album is open to visitors', 'wp-photo-album-plus' );
|
834 |
-
}
|
835 |
-
else {
|
836 |
-
$title = __( 'Frontend upload to this album is open for the owner and the admin', 'wp-photo-album-plus' );
|
837 |
-
}
|
838 |
}
|
839 |
else {
|
840 |
-
$title = '';
|
841 |
}
|
842 |
-
$result .= '
|
843 |
-
<select
|
844 |
-
id="albumowner"
|
845 |
-
onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
|
846 |
-
style="max-width:200px;"
|
847 |
-
title="' . esc_attr( $title ) . '"
|
848 |
-
>' .
|
849 |
-
wppa_get_user_select( $owner ) . '
|
850 |
-
</select>';
|
851 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
852 |
}
|
|
|
853 |
$result .= '
|
854 |
</div>';
|
855 |
wppa_echo( $result );
|
@@ -959,7 +970,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
959 |
}
|
960 |
|
961 |
// P-order-by
|
962 |
-
if ( ! wppa_switch( 'porder_restricted' ) ||
|
963 |
$result = '
|
964 |
<div class="left"
|
965 |
style="max-width: 200px;margin-right: 4px;">
|
@@ -1028,7 +1039,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1028 |
}
|
1029 |
|
1030 |
// Alternative thumbnail size
|
1031 |
-
if ( ! wppa_switch( 'alt_is_restricted' ) ||
|
1032 |
$title = sprintf( __( 'The alternate thumbnail size is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'thumbs', 1, 2 ), wppa_opt( 'thumbsize_alt' ) );
|
1033 |
|
1034 |
$sel = ' selected';
|
@@ -1098,7 +1109,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1098 |
if ( ! is_array( $lims ) ) {
|
1099 |
$lims = array( '0', '0' );
|
1100 |
}
|
1101 |
-
if (
|
1102 |
$sel = ' selected';
|
1103 |
$title = __( 'Set the upload limit (0 means unlimited).', 'wp-photo-album-plus' );
|
1104 |
$result .= '
|
@@ -1122,6 +1133,8 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1122 |
</select>';
|
1123 |
}
|
1124 |
else {
|
|
|
|
|
1125 |
if ( $lims[0] == '0' ) {
|
1126 |
$result .= __( 'Unlimited', 'wp-photo-album-plus' );
|
1127 |
}
|
@@ -1136,7 +1149,8 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1136 |
default: $result .= sprintf( 'per %d seconds', $lims[1] );
|
1137 |
}
|
1138 |
}
|
1139 |
-
$result .= '.
|
|
|
1140 |
}
|
1141 |
$result .= '
|
1142 |
</div>';
|
@@ -1414,14 +1428,14 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1414 |
// Create sibling
|
1415 |
if ( $albuminfo['a_parent'] > '0' && wppa_can_create_album() ||
|
1416 |
$albuminfo['a_parent'] < '1' && wppa_can_create_top_album() ) {
|
1417 |
-
$url =
|
1418 |
'admin.php' .
|
1419 |
'?page=wppa_admin_menu' .
|
1420 |
'&tab=edit' .
|
1421 |
'&edit-id=new' .
|
1422 |
'&parent_id=' . $albuminfo['a_parent'] .
|
1423 |
'&is-sibling-of=' . $albuminfo['id'] .
|
1424 |
-
'&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' )
|
1425 |
$onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
|
1426 |
|
1427 |
wppa_echo( '
|
@@ -1435,7 +1449,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1435 |
|
1436 |
// Edit parent
|
1437 |
if ( $albuminfo['a_parent'] > '0' && wppa_album_exists( $albuminfo['a_parent'] ) && wppa_have_access( $albuminfo['a_parent'] ) ) {
|
1438 |
-
$url =
|
1439 |
$onc = 'document.location=\''.$url.'\';';
|
1440 |
wppa_echo( '
|
1441 |
<input
|
@@ -1637,7 +1651,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1637 |
}
|
1638 |
|
1639 |
// Remake all
|
1640 |
-
if (
|
1641 |
$onc = 'if ( confirm(\'Are you sure you want to remake the files for all photos in this album?\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&remakealbum=1\'';
|
1642 |
wppa_echo( '
|
1643 |
<div>
|
@@ -1652,8 +1666,8 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1652 |
}
|
1653 |
|
1654 |
// Schedule for delete
|
1655 |
-
if (
|
1656 |
-
$may_change =
|
1657 |
|
1658 |
wppa_echo( '
|
1659 |
<div style="flex-basis: 30em; ">
|
@@ -1703,7 +1717,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1703 |
wppa_echo( '<div class="wppa-flex">' );
|
1704 |
|
1705 |
// Cover type
|
1706 |
-
if ( ! wppa_switch( 'covertype_is_restricted' ) ||
|
1707 |
$sel = ' selected';
|
1708 |
$title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'covers', 3, 4 ), wppa_opt( 'cover_type' ) );
|
1709 |
|
@@ -1793,7 +1807,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1793 |
}
|
1794 |
|
1795 |
// Manually entered link
|
1796 |
-
if ( ! wppa_switch( 'link_is_restricted' ) ||
|
1797 |
$result = '
|
1798 |
<div
|
1799 |
id="link-url-tr"
|
@@ -1817,7 +1831,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1817 |
}
|
1818 |
|
1819 |
// Link page
|
1820 |
-
if ( ! wppa_switch( 'link_is_restricted' ) ||
|
1821 |
$result = '
|
1822 |
<div
|
1823 |
id="-link-url-tr"
|
@@ -2162,7 +2176,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2162 |
<p>' . __( 'Are you sure you want to delete this album?', 'wp-photo-album-plus' ) . '<br>' .
|
2163 |
__( 'Press Delete to continue, and Cancel to go back.', 'wp-photo-album-plus' ) . '
|
2164 |
</p>
|
2165 |
-
<form name="wppa-del-form" action="' . esc_url(
|
2166 |
wp_nonce_field( 'wppa-nonce', 'wppa-nonce' ) . '
|
2167 |
<h2>' .
|
2168 |
__( 'What would you like to do with photos currently in the album?', 'wp-photo-album-plus' ) . '<br>
|
@@ -2274,7 +2288,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2274 |
<input
|
2275 |
type="button"
|
2276 |
class="button"
|
2277 |
-
onclick="document.location=\'' .
|
2278 |
value="' . esc_attr__( 'Switch to Collapsable table', 'wp-photo-album-plus' ) . '"
|
2279 |
/>' );
|
2280 |
}
|
@@ -2283,7 +2297,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2283 |
<input
|
2284 |
type="button"
|
2285 |
class="button"
|
2286 |
-
onclick="document.location=\'' .
|
2287 |
value="' . esc_attr__( 'Switch to Flat table', 'wp-photo-album-plus' ) . '"
|
2288 |
/>' );
|
2289 |
}
|
@@ -2335,7 +2349,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2335 |
}
|
2336 |
else {
|
2337 |
$albids = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums ORDER BY id" );
|
2338 |
-
if ( !
|
2339 |
if ( ! wppa_have_access( $albids[$key] ) ) {
|
2340 |
unset( $albids[$key] );
|
2341 |
}
|
@@ -2585,7 +2599,7 @@ global $wpdb;
|
|
2585 |
title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
|
2586 |
esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
|
2587 |
>
|
2588 |
-
<a href="' .
|
2589 |
( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
|
2590 |
( $order == 'id' ? $useimg : '' ) . '
|
2591 |
</a>
|
@@ -2593,13 +2607,13 @@ global $wpdb;
|
|
2593 |
<td
|
2594 |
style="min-width: 120px;"
|
2595 |
>
|
2596 |
-
<a href="' .
|
2597 |
__( 'Name', 'wp-photo-album-plus' ) .
|
2598 |
( $order == 'name' ? $useimg : '' ) . '
|
2599 |
</a>
|
2600 |
</td>
|
2601 |
<td>
|
2602 |
-
<a href="' .
|
2603 |
__( 'Description', 'wp-photo-album-plus' ) .
|
2604 |
( $order == 'description' ? $useimg : '' ) . '
|
2605 |
</a>
|
@@ -2607,7 +2621,7 @@ global $wpdb;
|
|
2607 |
if ( current_user_can( 'administrator' ) ) {
|
2608 |
$thead_body .= '
|
2609 |
<td style="min-width: 100px;">
|
2610 |
-
<a href="' .
|
2611 |
__( 'Owner', 'wp-photo-album-plus' ) .
|
2612 |
( $order == 'owner' ? $useimg : '' ) . '
|
2613 |
</a>
|
@@ -2617,7 +2631,7 @@ global $wpdb;
|
|
2617 |
<td
|
2618 |
style="min-width: 100px;"
|
2619 |
>
|
2620 |
-
<a href="' .
|
2621 |
__( 'Order', 'wp-photo-album-plus' ) .
|
2622 |
( $order == 'a_order' ? $useimg : '' ) . '
|
2623 |
</a>
|
@@ -2625,7 +2639,7 @@ global $wpdb;
|
|
2625 |
<td
|
2626 |
style="width: 120px;"
|
2627 |
>
|
2628 |
-
<a href="' .
|
2629 |
__( 'Parent', 'wp-photo-album-plus' ) .
|
2630 |
( $order == 'a_parent' ? $useimg : '' ) . '
|
2631 |
</a>
|
@@ -2638,7 +2652,7 @@ global $wpdb;
|
|
2638 |
<td>' . __( 'Edit', 'wp-photo-album-plus' ) . '</td>
|
2639 |
<td>' . __( 'Quick', 'wp-photo-album-plus' ) . '</td>
|
2640 |
<td>' . __( 'Bulk', 'wp-photo-album-plus' ) . '</td>
|
2641 |
-
<td>' . ( ! wppa_switch( 'porder_restricted' ) ||
|
2642 |
<td>' . __( 'CovImg', 'wp-photo-album-plus' ) . '</td>' .
|
2643 |
( current_user_can( 'wppa_upload' ) ? '<td>' . __( 'Upload', 'wp-photo-album-plus' ) . '</td>' : '' ) .
|
2644 |
( current_user_can( 'wppa_import' ) ? '<td>' . __( 'Import', 'wp-photo-album-plus' ) . '</td>' : '' ) . '
|
@@ -2655,13 +2669,13 @@ global $wpdb;
|
|
2655 |
$alt = ' class="alternate" ';
|
2656 |
$idx = '0';
|
2657 |
$result = '<tbody>';
|
2658 |
-
$mayseq = ! wppa_switch( 'porder_restricted' ) ||
|
2659 |
|
2660 |
foreach ( array_keys( $seq ) as $s ) {
|
2661 |
$album = $albums[$s];
|
2662 |
$id = $album['id'];
|
2663 |
$counts = wppa_get_treecounts_a( $id, true );
|
2664 |
-
$url =
|
2665 |
$na = $counts['selfalbums'];
|
2666 |
$np = $counts['selfphotos'];
|
2667 |
$nm = $counts['pendselfphotos'];
|
@@ -2911,7 +2925,7 @@ global $wpdb;
|
|
2911 |
title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
|
2912 |
esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
|
2913 |
>
|
2914 |
-
<a href="' .
|
2915 |
( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
|
2916 |
( $order == 'id' ? $useimg : '' ) . '
|
2917 |
</a>
|
@@ -2919,13 +2933,13 @@ global $wpdb;
|
|
2919 |
<td
|
2920 |
style="min-width: 120px;"
|
2921 |
>
|
2922 |
-
<a href="' .
|
2923 |
__( 'Name', 'wp-photo-album-plus' ) .
|
2924 |
( $order == 'name' ? $useimg : '' ) . '
|
2925 |
</a>
|
2926 |
</td>
|
2927 |
<td>
|
2928 |
-
<a href="' .
|
2929 |
__( 'Description', 'wp-photo-album-plus' ) .
|
2930 |
( $order == 'description' ? $useimg : '' ) . '
|
2931 |
</a>
|
@@ -2933,7 +2947,7 @@ global $wpdb;
|
|
2933 |
if ( current_user_can( 'administrator' ) ) {
|
2934 |
$thead_body .= '
|
2935 |
<td style="min-width: 100px;">
|
2936 |
-
<a href="' .
|
2937 |
__( 'Owner', 'wp-photo-album-plus' ) .
|
2938 |
( $order == 'owner' ? $useimg : '' ) . '
|
2939 |
</a>
|
@@ -2943,7 +2957,7 @@ global $wpdb;
|
|
2943 |
<td
|
2944 |
style="min-width: 100px;"
|
2945 |
>
|
2946 |
-
<a href="' .
|
2947 |
__( 'Sequence', 'wp-photo-album-plus' ) .
|
2948 |
( $order == 'a_order' ? $useimg : '' ) . '
|
2949 |
</a>
|
@@ -2951,7 +2965,7 @@ global $wpdb;
|
|
2951 |
<td
|
2952 |
style="width: 120px;"
|
2953 |
>
|
2954 |
-
<a href="' .
|
2955 |
__( 'Parent', 'wp-photo-album-plus' ) .
|
2956 |
( $order == 'a_parent' ? $useimg : '' ) . '
|
2957 |
</a>
|
@@ -2964,7 +2978,7 @@ global $wpdb;
|
|
2964 |
<td>' . __( 'Edit', 'wp-photo-album-plus' ) . '</td>
|
2965 |
<td>' . __( 'Quick', 'wp-photo-album-plus' ) . '</td>
|
2966 |
<td>' . __( 'Bulk', 'wp-photo-album-plus' ) . '</td>
|
2967 |
-
<td>' . ( ! wppa_switch( 'porder_restricted' ) ||
|
2968 |
<td>' . __( 'CovImg', 'wp-photo-album-plus' ) . '</td>' .
|
2969 |
( current_user_can( 'wppa_upload' ) ? '<td>' . __( 'Upload', 'wp-photo-album-plus' ) . '</td>' : '' ) .
|
2970 |
( current_user_can( 'wppa_import' ) ? '<td>' . __( 'Import', 'wp-photo-album-plus' ) . '</td>' : '' ) . '
|
@@ -3109,7 +3123,7 @@ function wppa_trash_edit( $collapsible = false ) {
|
|
3109 |
global $wpdb;
|
3110 |
|
3111 |
$doit = false;
|
3112 |
-
if (
|
3113 |
|
3114 |
$trashed = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE album < '0'" );
|
3115 |
|
@@ -3346,7 +3360,7 @@ global $wpdb;
|
|
3346 |
<td><a href="' . $url . '&quick=1" class="wppaedit">' . __( 'Quick', 'wp-photo-album-plus' ) . '</a></td>
|
3347 |
<td><a href="' . $url . '&bulk=1#manage-photos" class="wppaedit">' . __( 'Bulk', 'wp-photo-album-plus' ) . '</a></td>';
|
3348 |
|
3349 |
-
if ( ! wppa_switch( 'porder_restricted' ) ||
|
3350 |
$result .= '
|
3351 |
<td><a href="' . $url . '&seq=1" class="wppaedit">' . __( 'Seq', 'wp-photo-album-plus' ) . '</a></td>';
|
3352 |
}
|
@@ -3368,7 +3382,7 @@ global $wpdb;
|
|
3368 |
if ( current_user_can( 'wppa_import' ) ) {
|
3369 |
$result .= '<td><a href="' . get_admin_url() . '/admin.php?page=wppa_import_photos&wppa-set-album=' . $id . '" class="wppaedit" >' . __( 'Import', 'wp-photo-album-plus' ) . '</a></td>';
|
3370 |
}
|
3371 |
-
if (
|
3372 |
$url = wppa_ea_url( $id, 'del' );
|
3373 |
$result .= '<td><a href="' . $url . '" class="wppadelete" >' . __( 'Delete', 'wp-photo-album-plus' ) . '</a></td>';
|
3374 |
}
|
@@ -3421,7 +3435,7 @@ global $wpdb;
|
|
3421 |
return false;
|
3422 |
}
|
3423 |
|
3424 |
-
if ( !
|
3425 |
wppa_error_message( sprintf( __( 'You do not have sufficient rights to delete album %s. Album not deleted.', 'wp-photo-album-plus' ), $id ) );
|
3426 |
return false;
|
3427 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* create, edit and delete albums
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
503 |
function wppaTrySetAllPanorama( id ) {
|
504 |
var panoval = jQuery( "#pano-opt" ).val();
|
505 |
if ( panoval == 0 || panoval == 1 || panoval == 2 ) {
|
506 |
+
var url = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id="+id+"&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&pano-val="+panoval;
|
507 |
document.location = url;
|
508 |
}
|
509 |
else {
|
571 |
|
572 |
$onc = ( $full ?
|
573 |
'alert(\''.__( 'Change the upload limit or remove photos to enable new uploads.', 'wp-photo-album-plus' ).'\')' :
|
574 |
+
'document.location = \''.get_admin_url().'/admin.php?page=wppa_upload_photos&wppa-set-album='.$id.'\''
|
575 |
);
|
576 |
$val = ( $full ?
|
577 |
__( 'Album is full', 'wp-photo-album-plus' ) :
|
590 |
// Goto Import
|
591 |
if ( current_user_can( 'wppa_import' ) && ! $full ) {
|
592 |
|
593 |
+
$onc = 'document.location = \''.get_admin_url().'admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\'';
|
594 |
$val = __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' );
|
595 |
|
596 |
wppa_echo( '
|
605 |
</div>' ); // end action-container-left
|
606 |
|
607 |
// Download album
|
608 |
+
if ( wppa_switch( 'allow_download_album' ) && ( ! wppa_switch( 'download_album_is_restricted' ) || wppa_user_is_admin() ) ) {
|
609 |
wppa_echo( '
|
610 |
<div id="wppa-action-container-right">
|
611 |
<input
|
694 |
__( 'Unchangeable items', 'wp-photo-album-plus' ) . '
|
695 |
</legend>' );
|
696 |
|
697 |
+
// Album number, crypt, timestamp
|
698 |
wppa_echo( '
|
699 |
<div class="left">
|
700 |
<label>' .
|
721 |
</div>
|
722 |
</div>' );
|
723 |
|
724 |
+
// Modified
|
725 |
wppa_echo( '
|
726 |
<div class="left">
|
727 |
<label>' .
|
738 |
</div>
|
739 |
</div>' );
|
740 |
|
741 |
+
// Owner
|
742 |
+
if ( ! wppa_user_is_admin() ) {
|
743 |
+
wppa_echo( '
|
744 |
+
<div class="left">
|
745 |
+
<label>' .
|
746 |
+
__( 'Owned by', 'wp-photo-album-plus' ) . '
|
747 |
+
</label><br>
|
748 |
+
<div class="wppa-ldi">' );
|
749 |
+
if ( $owner == '--- public ---' ) {
|
750 |
+
wppa_echo( __( '--- public ---', 'wp-photo-album-plus' ) );
|
751 |
+
}
|
752 |
+
else {
|
753 |
+
wppa_echo( wppa_get_owner_display( $owner ) );
|
754 |
+
}
|
755 |
+
wppa_echo( '
|
756 |
+
</div>
|
757 |
+
</div>' );
|
758 |
+
}
|
759 |
+
|
760 |
// Views
|
761 |
if ( wppa_switch( 'track_viewcounts' ) ) {
|
762 |
wppa_echo( '
|
821 |
</legend>' );
|
822 |
|
823 |
// Owner
|
824 |
+
if ( wppa_user_is_admin() ) {
|
825 |
$result = '
|
826 |
<div class="left">
|
827 |
<label
|
829 |
__( 'Owned by', 'wp-photo-album-plus' ) . '
|
830 |
</label><br>';
|
831 |
|
832 |
+
if ( wppa_get_user_count() > wppa_opt( 'max_users' ) ) {
|
833 |
+
$result .= '
|
834 |
+
<input
|
835 |
+
id="albumowner"
|
836 |
+
type="text"
|
837 |
+
value="' . esc_attr( $owner ) . '"
|
838 |
+
onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
|
839 |
+
/>';
|
840 |
}
|
841 |
else {
|
842 |
+
if ( wppa_switch( 'user_upload_on' ) ) {
|
843 |
+
if ( $owner == '--- public ---' ) {
|
844 |
+
$title = __( 'Frontend upload to this album is open to visitors', 'wp-photo-album-plus' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
845 |
}
|
846 |
else {
|
847 |
+
$title = __( 'Frontend upload to this album is open for the owner and the admin', 'wp-photo-album-plus' );
|
848 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
849 |
}
|
850 |
+
else {
|
851 |
+
$title = '';
|
852 |
+
}
|
853 |
+
$result .= '
|
854 |
+
<select
|
855 |
+
id="albumowner"
|
856 |
+
onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
|
857 |
+
style="max-width:200px;"
|
858 |
+
title="' . esc_attr( $title ) . '"
|
859 |
+
>' .
|
860 |
+
wppa_get_user_select( $owner ) . '
|
861 |
+
</select>';
|
862 |
}
|
863 |
+
|
864 |
$result .= '
|
865 |
</div>';
|
866 |
wppa_echo( $result );
|
970 |
}
|
971 |
|
972 |
// P-order-by
|
973 |
+
if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is_admin() ) {
|
974 |
$result = '
|
975 |
<div class="left"
|
976 |
style="max-width: 200px;margin-right: 4px;">
|
1039 |
}
|
1040 |
|
1041 |
// Alternative thumbnail size
|
1042 |
+
if ( ! wppa_switch( 'alt_is_restricted' ) || wppa_user_is_admin() ) {
|
1043 |
$title = sprintf( __( 'The alternate thumbnail size is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'thumbs', 1, 2 ), wppa_opt( 'thumbsize_alt' ) );
|
1044 |
|
1045 |
$sel = ' selected';
|
1109 |
if ( ! is_array( $lims ) ) {
|
1110 |
$lims = array( '0', '0' );
|
1111 |
}
|
1112 |
+
if ( wppa_user_is_admin() ) {
|
1113 |
$sel = ' selected';
|
1114 |
$title = __( 'Set the upload limit (0 means unlimited).', 'wp-photo-album-plus' );
|
1115 |
$result .= '
|
1133 |
</select>';
|
1134 |
}
|
1135 |
else {
|
1136 |
+
$result .= '
|
1137 |
+
<div class="wppa-ldi">';
|
1138 |
if ( $lims[0] == '0' ) {
|
1139 |
$result .= __( 'Unlimited', 'wp-photo-album-plus' );
|
1140 |
}
|
1149 |
default: $result .= sprintf( 'per %d seconds', $lims[1] );
|
1150 |
}
|
1151 |
}
|
1152 |
+
$result .= '.
|
1153 |
+
</div>';
|
1154 |
}
|
1155 |
$result .= '
|
1156 |
</div>';
|
1428 |
// Create sibling
|
1429 |
if ( $albuminfo['a_parent'] > '0' && wppa_can_create_album() ||
|
1430 |
$albuminfo['a_parent'] < '1' && wppa_can_create_top_album() ) {
|
1431 |
+
$url = get_admin_url() .
|
1432 |
'admin.php' .
|
1433 |
'?page=wppa_admin_menu' .
|
1434 |
'&tab=edit' .
|
1435 |
'&edit-id=new' .
|
1436 |
'&parent_id=' . $albuminfo['a_parent'] .
|
1437 |
'&is-sibling-of=' . $albuminfo['id'] .
|
1438 |
+
'&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
|
1439 |
$onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
|
1440 |
|
1441 |
wppa_echo( '
|
1449 |
|
1450 |
// Edit parent
|
1451 |
if ( $albuminfo['a_parent'] > '0' && wppa_album_exists( $albuminfo['a_parent'] ) && wppa_have_access( $albuminfo['a_parent'] ) ) {
|
1452 |
+
$url = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=' . $albuminfo['a_parent'] . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
|
1453 |
$onc = 'document.location=\''.$url.'\';';
|
1454 |
wppa_echo( '
|
1455 |
<input
|
1651 |
}
|
1652 |
|
1653 |
// Remake all
|
1654 |
+
if ( wppa_user_is_admin() ) {
|
1655 |
$onc = 'if ( confirm(\'Are you sure you want to remake the files for all photos in this album?\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&remakealbum=1\'';
|
1656 |
wppa_echo( '
|
1657 |
<div>
|
1666 |
}
|
1667 |
|
1668 |
// Schedule for delete
|
1669 |
+
if ( wppa_user_is_admin() || $owner == wppa_get_user() ) {
|
1670 |
+
$may_change = wppa_user_is_admin() || current_user_can( 'wppa_moderate' );
|
1671 |
|
1672 |
wppa_echo( '
|
1673 |
<div style="flex-basis: 30em; ">
|
1717 |
wppa_echo( '<div class="wppa-flex">' );
|
1718 |
|
1719 |
// Cover type
|
1720 |
+
if ( ! wppa_switch( 'covertype_is_restricted' ) || wppa_user_is_admin() ) {
|
1721 |
$sel = ' selected';
|
1722 |
$title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'covers', 3, 4 ), wppa_opt( 'cover_type' ) );
|
1723 |
|
1807 |
}
|
1808 |
|
1809 |
// Manually entered link
|
1810 |
+
if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is_admin() ) {
|
1811 |
$result = '
|
1812 |
<div
|
1813 |
id="link-url-tr"
|
1831 |
}
|
1832 |
|
1833 |
// Link page
|
1834 |
+
if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is_admin() ) {
|
1835 |
$result = '
|
1836 |
<div
|
1837 |
id="-link-url-tr"
|
2176 |
<p>' . __( 'Are you sure you want to delete this album?', 'wp-photo-album-plus' ) . '<br>' .
|
2177 |
__( 'Press Delete to continue, and Cancel to go back.', 'wp-photo-album-plus' ) . '
|
2178 |
</p>
|
2179 |
+
<form name="wppa-del-form" action="' . esc_url( get_admin_url() . 'admin.php?page=wppa_admin_menu' ) . '" method="post">' .
|
2180 |
wp_nonce_field( 'wppa-nonce', 'wppa-nonce' ) . '
|
2181 |
<h2>' .
|
2182 |
__( 'What would you like to do with photos currently in the album?', 'wp-photo-album-plus' ) . '<br>
|
2288 |
<input
|
2289 |
type="button"
|
2290 |
class="button"
|
2291 |
+
onclick="document.location=\'' . get_admin_url() . 'admin.php?page=wppa_admin_menu&switchto=collapsible\'"
|
2292 |
value="' . esc_attr__( 'Switch to Collapsable table', 'wp-photo-album-plus' ) . '"
|
2293 |
/>' );
|
2294 |
}
|
2297 |
<input
|
2298 |
type="button"
|
2299 |
class="button"
|
2300 |
+
onclick="document.location=\'' . get_admin_url() . 'admin.php?page=wppa_admin_menu&switchto=flat\'"
|
2301 |
value="' . esc_attr__( 'Switch to Flat table', 'wp-photo-album-plus' ) . '"
|
2302 |
/>' );
|
2303 |
}
|
2349 |
}
|
2350 |
else {
|
2351 |
$albids = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums ORDER BY id" );
|
2352 |
+
if ( ! wppa_user_is_admin() ) foreach( array_keys( $albids ) as $key ) {
|
2353 |
if ( ! wppa_have_access( $albids[$key] ) ) {
|
2354 |
unset( $albids[$key] );
|
2355 |
}
|
2599 |
title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
|
2600 |
esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
|
2601 |
>
|
2602 |
+
<a href="' . $url . 'id">' .
|
2603 |
( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
|
2604 |
( $order == 'id' ? $useimg : '' ) . '
|
2605 |
</a>
|
2607 |
<td
|
2608 |
style="min-width: 120px;"
|
2609 |
>
|
2610 |
+
<a href="' . $url . 'name">' .
|
2611 |
__( 'Name', 'wp-photo-album-plus' ) .
|
2612 |
( $order == 'name' ? $useimg : '' ) . '
|
2613 |
</a>
|
2614 |
</td>
|
2615 |
<td>
|
2616 |
+
<a href="' . $url . 'description">' .
|
2617 |
__( 'Description', 'wp-photo-album-plus' ) .
|
2618 |
( $order == 'description' ? $useimg : '' ) . '
|
2619 |
</a>
|
2621 |
if ( current_user_can( 'administrator' ) ) {
|
2622 |
$thead_body .= '
|
2623 |
<td style="min-width: 100px;">
|
2624 |
+
<a href="' . $url . 'owner">' .
|
2625 |
__( 'Owner', 'wp-photo-album-plus' ) .
|
2626 |
( $order == 'owner' ? $useimg : '' ) . '
|
2627 |
</a>
|
2631 |
<td
|
2632 |
style="min-width: 100px;"
|
2633 |
>
|
2634 |
+
<a href="' . $url . 'a_order">' .
|
2635 |
__( 'Order', 'wp-photo-album-plus' ) .
|
2636 |
( $order == 'a_order' ? $useimg : '' ) . '
|
2637 |
</a>
|
2639 |
<td
|
2640 |
style="width: 120px;"
|
2641 |
>
|
2642 |
+
<a href="' . $url . 'a_parent">' .
|
2643 |
__( 'Parent', 'wp-photo-album-plus' ) .
|
2644 |
( $order == 'a_parent' ? $useimg : '' ) . '
|
2645 |
</a>
|
2652 |
<td>' . __( 'Edit', 'wp-photo-album-plus' ) . '</td>
|
2653 |
<td>' . __( 'Quick', 'wp-photo-album-plus' ) . '</td>
|
2654 |
<td>' . __( 'Bulk', 'wp-photo-album-plus' ) . '</td>
|
2655 |
+
<td>' . ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is_admin() ? __( 'Seq', 'wp-photo-album-plus' ) : '' ) . '</td>
|
2656 |
<td>' . __( 'CovImg', 'wp-photo-album-plus' ) . '</td>' .
|
2657 |
( current_user_can( 'wppa_upload' ) ? '<td>' . __( 'Upload', 'wp-photo-album-plus' ) . '</td>' : '' ) .
|
2658 |
( current_user_can( 'wppa_import' ) ? '<td>' . __( 'Import', 'wp-photo-album-plus' ) . '</td>' : '' ) . '
|
2669 |
$alt = ' class="alternate" ';
|
2670 |
$idx = '0';
|
2671 |
$result = '<tbody>';
|
2672 |
+
$mayseq = ! wppa_switch( 'porder_restricted' ) || wppa_user_is_admin();
|
2673 |
|
2674 |
foreach ( array_keys( $seq ) as $s ) {
|
2675 |
$album = $albums[$s];
|
2676 |
$id = $album['id'];
|
2677 |
$counts = wppa_get_treecounts_a( $id, true );
|
2678 |
+
$url = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=' . $id;
|
2679 |
$na = $counts['selfalbums'];
|
2680 |
$np = $counts['selfphotos'];
|
2681 |
$nm = $counts['pendselfphotos'];
|
2925 |
title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
|
2926 |
esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
|
2927 |
>
|
2928 |
+
<a href="' . $url . 'id">' .
|
2929 |
( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
|
2930 |
( $order == 'id' ? $useimg : '' ) . '
|
2931 |
</a>
|
2933 |
<td
|
2934 |
style="min-width: 120px;"
|
2935 |
>
|
2936 |
+
<a href="' . $url . 'name">' .
|
2937 |
__( 'Name', 'wp-photo-album-plus' ) .
|
2938 |
( $order == 'name' ? $useimg : '' ) . '
|
2939 |
</a>
|
2940 |
</td>
|
2941 |
<td>
|
2942 |
+
<a href="' . $url . 'description">' .
|
2943 |
__( 'Description', 'wp-photo-album-plus' ) .
|
2944 |
( $order == 'description' ? $useimg : '' ) . '
|
2945 |
</a>
|
2947 |
if ( current_user_can( 'administrator' ) ) {
|
2948 |
$thead_body .= '
|
2949 |
<td style="min-width: 100px;">
|
2950 |
+
<a href="' . $url . 'owner">' .
|
2951 |
__( 'Owner', 'wp-photo-album-plus' ) .
|
2952 |
( $order == 'owner' ? $useimg : '' ) . '
|
2953 |
</a>
|
2957 |
<td
|
2958 |
style="min-width: 100px;"
|
2959 |
>
|
2960 |
+
<a href="' . $url . 'a_order">' .
|
2961 |
__( 'Sequence', 'wp-photo-album-plus' ) .
|
2962 |
( $order == 'a_order' ? $useimg : '' ) . '
|
2963 |
</a>
|
2965 |
<td
|
2966 |
style="width: 120px;"
|
2967 |
>
|
2968 |
+
<a href="' . $url . 'a_parent">' .
|
2969 |
__( 'Parent', 'wp-photo-album-plus' ) .
|
2970 |
( $order == 'a_parent' ? $useimg : '' ) . '
|
2971 |
</a>
|
2978 |
<td>' . __( 'Edit', 'wp-photo-album-plus' ) . '</td>
|
2979 |
<td>' . __( 'Quick', 'wp-photo-album-plus' ) . '</td>
|
2980 |
<td>' . __( 'Bulk', 'wp-photo-album-plus' ) . '</td>
|
2981 |
+
<td>' . ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is_admin() ? __( 'Seq', 'wp-photo-album-plus' ) : '' ) . '</td>
|
2982 |
<td>' . __( 'CovImg', 'wp-photo-album-plus' ) . '</td>' .
|
2983 |
( current_user_can( 'wppa_upload' ) ? '<td>' . __( 'Upload', 'wp-photo-album-plus' ) . '</td>' : '' ) .
|
2984 |
( current_user_can( 'wppa_import' ) ? '<td>' . __( 'Import', 'wp-photo-album-plus' ) . '</td>' : '' ) . '
|
3123 |
global $wpdb;
|
3124 |
|
3125 |
$doit = false;
|
3126 |
+
if ( wppa_user_is_admin() ) $doit = true;
|
3127 |
|
3128 |
$trashed = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE album < '0'" );
|
3129 |
|
3360 |
<td><a href="' . $url . '&quick=1" class="wppaedit">' . __( 'Quick', 'wp-photo-album-plus' ) . '</a></td>
|
3361 |
<td><a href="' . $url . '&bulk=1#manage-photos" class="wppaedit">' . __( 'Bulk', 'wp-photo-album-plus' ) . '</a></td>';
|
3362 |
|
3363 |
+
if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is_admin() ) {
|
3364 |
$result .= '
|
3365 |
<td><a href="' . $url . '&seq=1" class="wppaedit">' . __( 'Seq', 'wp-photo-album-plus' ) . '</a></td>';
|
3366 |
}
|
3382 |
if ( current_user_can( 'wppa_import' ) ) {
|
3383 |
$result .= '<td><a href="' . get_admin_url() . '/admin.php?page=wppa_import_photos&wppa-set-album=' . $id . '" class="wppaedit" >' . __( 'Import', 'wp-photo-album-plus' ) . '</a></td>';
|
3384 |
}
|
3385 |
+
if ( wppa_user_is_admin() || wppa_get_user() == $album['owner'] ) {
|
3386 |
$url = wppa_ea_url( $id, 'del' );
|
3387 |
$result .= '<td><a href="' . $url . '" class="wppadelete" >' . __( 'Delete', 'wp-photo-album-plus' ) . '</a></td>';
|
3388 |
}
|
3435 |
return false;
|
3436 |
}
|
3437 |
|
3438 |
+
if ( ! wppa_user_is_admin() && ! wppa_get_album_item( $id, 'owner' ) == wppa_get_user() ) {
|
3439 |
wppa_error_message( sprintf( __( 'You do not have sufficient rights to delete album %s. Album not deleted.', 'wp-photo-album-plus' ), $id ) );
|
3440 |
return false;
|
3441 |
}
|
wppa-album-covers.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for album covers
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -78,7 +78,6 @@ function wppa_album_cover( $id ) {
|
|
78 |
break;
|
79 |
default:
|
80 |
$err = 'Unimplemented covertype: ' . $cover_type;
|
81 |
-
wppa_dbg_msg( $err );
|
82 |
wppa_log( 'Err', $err );
|
83 |
}
|
84 |
}
|
@@ -942,7 +941,6 @@ global $wpdb;
|
|
942 |
break;
|
943 |
default:
|
944 |
$photoframestyle = '';
|
945 |
-
wppa_dbg_msg( 'Illegal $photo_pos in wppa_the_coverphoto' );
|
946 |
}
|
947 |
}
|
948 |
else {
|
@@ -967,7 +965,6 @@ global $wpdb;
|
|
967 |
break;
|
968 |
default:
|
969 |
$photoframestyle = '';
|
970 |
-
wppa_dbg_msg( 'Illegal $photo_pos in wppa_the_coverphoto' );
|
971 |
}
|
972 |
}
|
973 |
}
|
@@ -1377,7 +1374,6 @@ function wppa_get_coverphoto_id( $xalb = '' ) {
|
|
1377 |
if ( ! in_array( $status,['scheduled','private','pending'] ) ) {
|
1378 |
wppa_update_album( array( 'id' => $xalb, 'main_photo' => $result['0'] ) );
|
1379 |
wppa_cache_album( 'invalidate', $xalb );
|
1380 |
-
// wppa_log( 'obs', 'Cover photo of album ' . $xalb . ' set to ' . $result['0'] );
|
1381 |
}
|
1382 |
}
|
1383 |
return $result['0'];
|
@@ -1416,7 +1412,7 @@ static $cached_cover_photo_ids;
|
|
1416 |
}
|
1417 |
|
1418 |
// Make the private clause
|
1419 |
-
if (
|
1420 |
$non_private = '';
|
1421 |
}
|
1422 |
elseif ( is_user_logged_in() ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for album covers
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
78 |
break;
|
79 |
default:
|
80 |
$err = 'Unimplemented covertype: ' . $cover_type;
|
|
|
81 |
wppa_log( 'Err', $err );
|
82 |
}
|
83 |
}
|
941 |
break;
|
942 |
default:
|
943 |
$photoframestyle = '';
|
|
|
944 |
}
|
945 |
}
|
946 |
else {
|
965 |
break;
|
966 |
default:
|
967 |
$photoframestyle = '';
|
|
|
968 |
}
|
969 |
}
|
970 |
}
|
1374 |
if ( ! in_array( $status,['scheduled','private','pending'] ) ) {
|
1375 |
wppa_update_album( array( 'id' => $xalb, 'main_photo' => $result['0'] ) );
|
1376 |
wppa_cache_album( 'invalidate', $xalb );
|
|
|
1377 |
}
|
1378 |
}
|
1379 |
return $result['0'];
|
1412 |
}
|
1413 |
|
1414 |
// Make the private clause
|
1415 |
+
if ( wppa_user_is_admin() ) {
|
1416 |
$non_private = '';
|
1417 |
}
|
1418 |
elseif ( is_user_logged_in() ) {
|
wppa-audio.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all audio routines
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -171,8 +171,6 @@ function wppa_get_audio_body( $id, $for_lb = false, $w = '0', $h = '0' ) {
|
|
171 |
$is_safari = false;
|
172 |
}
|
173 |
|
174 |
-
wppa_dbg_msg('Mp3:'.$mp3.', Opera:'.$is_opera.', Ie:'.$is_ie.', Saf:'.$is_safari);
|
175 |
-
|
176 |
// Assume the browser supports html5
|
177 |
$ext = '';
|
178 |
if ( $is_ie ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all audio routines
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*/
|
9 |
|
171 |
$is_safari = false;
|
172 |
}
|
173 |
|
|
|
|
|
174 |
// Assume the browser supports html5
|
175 |
$ext = '';
|
176 |
if ( $is_ie ) {
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -359,7 +359,7 @@ global $wpdb;
|
|
359 |
function wppa_contest_display_comment( $photoid, $userid ) {
|
360 |
|
361 |
// Admin sees everything independant of policy
|
362 |
-
if (
|
363 |
return true;
|
364 |
}
|
365 |
|
@@ -442,7 +442,7 @@ global $wppa_session;
|
|
442 |
__( 'Photo search results', 'wp-photo-album-plus' )
|
443 |
);
|
444 |
}
|
445 |
-
$pagelink =
|
446 |
$cansubsearch = $sub && $wppa_session['use_searchstring'];
|
447 |
$value = $cansubsearch ? '' : wppa_test_for_search( true );
|
448 |
$root = $wppa_session['search_root'];
|
@@ -470,8 +470,6 @@ global $wppa_session;
|
|
470 |
}
|
471 |
}
|
472 |
|
473 |
-
wppa_dbg_msg( 'Root=' . $root . ': ' . ( wppa_is_int( $root ) ? wppa_get_album_name( $root ) : $root ) );
|
474 |
-
|
475 |
// Open the form
|
476 |
$result = '
|
477 |
<form
|
@@ -772,7 +770,7 @@ global $photos_used;
|
|
772 |
$page = wppa_get_the_landing_page( 'supersearch_linkpage',
|
773 |
__( 'Photo search results' ,'wp-photo-album-plus' )
|
774 |
);
|
775 |
-
$pagelink =
|
776 |
$fontsize = wppa_in_widget() ? 'font-size: 9px;' : '';
|
777 |
$query = "SELECT id, name, owner FROM $wpdb->wppa_albums
|
778 |
ORDER BY name";
|
@@ -857,7 +855,7 @@ global $photos_used;
|
|
857 |
$albumowner = $albums[$albumkey]['owner'];
|
858 |
$treecount = wppa_get_treecounts_a( $albums[$albumkey]['id'] );
|
859 |
$photocount = $treecount['treephotos'];
|
860 |
-
if ( ! $photocount && !
|
861 |
unset( $albums[$albumkey] );
|
862 |
}
|
863 |
}
|
@@ -2532,7 +2530,7 @@ function wppa_get_user_create_html( $alb, $width, $where = '', $mcr = false ) {
|
|
2532 |
}
|
2533 |
|
2534 |
// If roles specified and i am not an admin, see if i have one
|
2535 |
-
if ( wppa_opt( 'user_create_roles' ) && !
|
2536 |
|
2537 |
// Allowed roles
|
2538 |
$allowed_roles = explode( ',', wppa_opt( 'user_create_roles' ) );
|
@@ -3041,7 +3039,7 @@ static $albums_granted;
|
|
3041 |
// Album select
|
3042 |
$result .= wppa_get_dlg_item( $head, $body, $big );
|
3043 |
|
3044 |
-
$one_only = wppa_switch( 'upload_one_only' ) && !
|
3045 |
$multiple = ! $one_only;
|
3046 |
$on_camera = wppa_switch( 'camera_connect' );
|
3047 |
$may_video = wppa_switch( 'user_upload_video_on' );
|
@@ -4894,16 +4892,6 @@ global $other_deps;
|
|
4894 |
// Make args into seperate vars
|
4895 |
extract ( $args );
|
4896 |
|
4897 |
-
// Validate args
|
4898 |
-
if ( ! in_array( $sortby, array ( 'maxratingcount', 'meanrating', 'ratingcount', 'totvalue' ) ) ) {
|
4899 |
-
wppa_dbg_msg ( 'Invalid arg sortby "'.$sortby.'" must be "maxratingcount", "meanrating", "ratingcount" or "totvalue"', 'red', 'force' );
|
4900 |
-
}
|
4901 |
-
if ( ! in_array( $display, array ( 'photo', 'owner' ) ) ) {
|
4902 |
-
wppa_dbg_msg ( 'Invalid arg display "'.$display.'" must be "photo" or "owner"', 'red', 'force' );
|
4903 |
-
}
|
4904 |
-
if ( ! in_array( $period, array ( 'lastweek', 'thisweek', 'lastmonth', 'thismonth', 'lastyear', 'thisyear' ) ) ) {
|
4905 |
-
wppa_dbg_msg ( 'Invalid arg period "'.$period.'" must be "lastweek", "thisweek", "lastmonth", "thismonth", "lastyear" or "thisyear"', 'red', 'force' );
|
4906 |
-
}
|
4907 |
if ( ! $widget ) {
|
4908 |
$size = $height;
|
4909 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
359 |
function wppa_contest_display_comment( $photoid, $userid ) {
|
360 |
|
361 |
// Admin sees everything independant of policy
|
362 |
+
if ( wppa_user_is_admin() ) {
|
363 |
return true;
|
364 |
}
|
365 |
|
442 |
__( 'Photo search results', 'wp-photo-album-plus' )
|
443 |
);
|
444 |
}
|
445 |
+
$pagelink = get_page_link( $page );
|
446 |
$cansubsearch = $sub && $wppa_session['use_searchstring'];
|
447 |
$value = $cansubsearch ? '' : wppa_test_for_search( true );
|
448 |
$root = $wppa_session['search_root'];
|
470 |
}
|
471 |
}
|
472 |
|
|
|
|
|
473 |
// Open the form
|
474 |
$result = '
|
475 |
<form
|
770 |
$page = wppa_get_the_landing_page( 'supersearch_linkpage',
|
771 |
__( 'Photo search results' ,'wp-photo-album-plus' )
|
772 |
);
|
773 |
+
$pagelink = get_page_link( $page );
|
774 |
$fontsize = wppa_in_widget() ? 'font-size: 9px;' : '';
|
775 |
$query = "SELECT id, name, owner FROM $wpdb->wppa_albums
|
776 |
ORDER BY name";
|
855 |
$albumowner = $albums[$albumkey]['owner'];
|
856 |
$treecount = wppa_get_treecounts_a( $albums[$albumkey]['id'] );
|
857 |
$photocount = $treecount['treephotos'];
|
858 |
+
if ( ! $photocount && ! wppa_user_is_admin() && $user != $albumowner ) {
|
859 |
unset( $albums[$albumkey] );
|
860 |
}
|
861 |
}
|
2530 |
}
|
2531 |
|
2532 |
// If roles specified and i am not an admin, see if i have one
|
2533 |
+
if ( wppa_opt( 'user_create_roles' ) && ! wppa_user_is_admin() ) {
|
2534 |
|
2535 |
// Allowed roles
|
2536 |
$allowed_roles = explode( ',', wppa_opt( 'user_create_roles' ) );
|
3039 |
// Album select
|
3040 |
$result .= wppa_get_dlg_item( $head, $body, $big );
|
3041 |
|
3042 |
+
$one_only = wppa_switch( 'upload_one_only' ) && ! wppa_user_is_admin();
|
3043 |
$multiple = ! $one_only;
|
3044 |
$on_camera = wppa_switch( 'camera_connect' );
|
3045 |
$may_video = wppa_switch( 'user_upload_video_on' );
|
4892 |
// Make args into seperate vars
|
4893 |
extract ( $args );
|
4894 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4895 |
if ( ! $widget ) {
|
4896 |
$size = $height;
|
4897 |
}
|
wppa-breadcrumb.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for breadcrumbs
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -54,18 +54,12 @@ global $wppa_session;
|
|
54 |
|
55 |
$is_albenum = strlen( wppa( 'start_album' ) ) > '0' && ! wppa_is_int( wppa( 'start_album' ) );
|
56 |
|
57 |
-
wppa_dbg_msg( 'alb=' . $alb . ', albenum=' . $is_albenum, 'green' );
|
58 |
-
|
59 |
$virtual = wppa_is_virtual() || wppa( 'last_albums' );
|
60 |
|
61 |
if ( wppa( 'last_albums' ) ) {
|
62 |
$alb = wppa( 'last_albums_parent' );
|
63 |
}
|
64 |
|
65 |
-
wppa_dbg_msg(
|
66 |
-
'alb='.$alb.', albenum='.$is_albenum.', l_a='.wppa( 'last_albums' ).
|
67 |
-
', l_a_p='.wppa( 'last_albums_parent' ), 'green' );
|
68 |
-
|
69 |
// See if the album is a 'stand alone' album
|
70 |
$separate = wppa_is_separate( $alb );
|
71 |
|
@@ -78,10 +72,6 @@ global $wppa_session;
|
|
78 |
// Photo number?
|
79 |
$photo = wppa( 'start_photo' );
|
80 |
|
81 |
-
wppa_dbg_msg(
|
82 |
-
'pid='.$pid.', type='.$type.', alb='.$alb.', sep='.$separate.
|
83 |
-
', slide='.$slide.', t_c=0, ph='.$photo, 'green' );
|
84 |
-
|
85 |
// Open the breadcrumb box
|
86 |
wppa_out( '<div' .
|
87 |
' id="wppa-bc-'.wppa( 'mocc' ) . '"' .
|
@@ -89,18 +79,10 @@ global $wppa_session;
|
|
89 |
' style="' .
|
90 |
'" >' );
|
91 |
|
92 |
-
/* diagnostic
|
93 |
-
|
94 |
-
if ( defined( 'DOING_AJAX' ) ) wppa_out('A');
|
95 |
-
if ( defined( 'DOING_WPPA_AJAX' ) ) wppa_out('W');
|
96 |
-
if ( wppa( 'ajax') ) wppa_out('a');
|
97 |
-
|
98 |
-
/* end diagnostic */
|
99 |
-
|
100 |
// Do we need Home?
|
101 |
if ( wppa_switch( 'show_home' ) ) {
|
102 |
$value = __( wppa_opt( 'home_text' ) );
|
103 |
-
$href =
|
104 |
$title = get_bloginfo( 'title' );
|
105 |
wppa_bcitem( $value, $href, $title, 'b1' );
|
106 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for breadcrumbs
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*/
|
9 |
|
54 |
|
55 |
$is_albenum = strlen( wppa( 'start_album' ) ) > '0' && ! wppa_is_int( wppa( 'start_album' ) );
|
56 |
|
|
|
|
|
57 |
$virtual = wppa_is_virtual() || wppa( 'last_albums' );
|
58 |
|
59 |
if ( wppa( 'last_albums' ) ) {
|
60 |
$alb = wppa( 'last_albums_parent' );
|
61 |
}
|
62 |
|
|
|
|
|
|
|
|
|
63 |
// See if the album is a 'stand alone' album
|
64 |
$separate = wppa_is_separate( $alb );
|
65 |
|
72 |
// Photo number?
|
73 |
$photo = wppa( 'start_photo' );
|
74 |
|
|
|
|
|
|
|
|
|
75 |
// Open the breadcrumb box
|
76 |
wppa_out( '<div' .
|
77 |
' id="wppa-bc-'.wppa( 'mocc' ) . '"' .
|
79 |
' style="' .
|
80 |
'" >' );
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
// Do we need Home?
|
83 |
if ( wppa_switch( 'show_home' ) ) {
|
84 |
$value = __( wppa_opt( 'home_text' ) );
|
85 |
+
$href = get_bloginfo( 'url' );
|
86 |
$title = get_bloginfo( 'title' );
|
87 |
wppa_bcitem( $value, $href, $title, 'b1' );
|
88 |
}
|
wppa-cache.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
/* Contains all wppa smart cache functions
|
5 |
/*
|
6 |
-
/* Version 8.2.
|
7 |
*/
|
8 |
|
9 |
// Test for caching
|
@@ -64,7 +64,7 @@ global $wppa_lang;
|
|
64 |
}
|
65 |
|
66 |
$roles = '';
|
67 |
-
if (
|
68 |
$user = wp_get_current_user();
|
69 |
$roles = implode( '-', $user->roles ) . '-';
|
70 |
}
|
@@ -222,8 +222,6 @@ function wppa_clear_cache( $args = array() ) {
|
|
222 |
global $cache_path;
|
223 |
global $wpdb;
|
224 |
|
225 |
-
// wppa_log( 'obs', 'Clear cache called with args ' . var_export( $args, true ) );
|
226 |
-
|
227 |
// Fill in default args
|
228 |
$defaults = array( 'album' => '',
|
229 |
'photo' => '',
|
@@ -381,13 +379,11 @@ global $wpdb;
|
|
381 |
if ( function_exists( 'prune_super_cache' ) ) {
|
382 |
prune_super_cache( $cache_path . 'supercache/', true );
|
383 |
prune_super_cache( $cache_path, true );
|
384 |
-
// wppa_log('obs', 'Super cache cleared');
|
385 |
}
|
386 |
|
387 |
// W3 Total cache
|
388 |
if ( function_exists( 'w3tc_pgcache_flush' ) ) {
|
389 |
w3tc_pgcache_flush();
|
390 |
-
// wppa_log('obs', 'w3tc pgcache cleared');
|
391 |
}
|
392 |
|
393 |
// SG_CachePress
|
@@ -395,20 +391,17 @@ global $wpdb;
|
|
395 |
$c = new SG_CachePress_Supercacher();
|
396 |
if ( $c->purge_cache ) {
|
397 |
$c->purge_cache();
|
398 |
-
// wppa_log('obs', 'SG CachePress Supercacher cache cleared');
|
399 |
}
|
400 |
}
|
401 |
|
402 |
// Quick cache
|
403 |
if ( isset($GLOBALS['quick_cache']) ) {
|
404 |
$GLOBALS['quick_cache']->clear_cache();
|
405 |
-
// wppa_log('obs', 'Quick cache cleared');
|
406 |
}
|
407 |
|
408 |
// Comet cache
|
409 |
if ( class_exists( 'comet_cache' ) ) {
|
410 |
comet_cache::clear();
|
411 |
-
// wppa_log('obs', 'Comet cache cleared');
|
412 |
}
|
413 |
|
414 |
wppa_log( 'fso', 'All non wppa caches cleared' );
|
@@ -431,7 +424,7 @@ global $wppa_lang;
|
|
431 |
}
|
432 |
|
433 |
$roles = '';
|
434 |
-
if (
|
435 |
$user = wp_get_current_user();
|
436 |
$roles = implode( '-', $user->roles ) . '-';
|
437 |
}
|
3 |
/*
|
4 |
/* Contains all wppa smart cache functions
|
5 |
/*
|
6 |
+
/* Version 8.2.05.001
|
7 |
*/
|
8 |
|
9 |
// Test for caching
|
64 |
}
|
65 |
|
66 |
$roles = '';
|
67 |
+
if ( wppa_user_is_admin() || ( is_user_logged_in() && wppa_switch( 'user_create_on' ) ) ) {
|
68 |
$user = wp_get_current_user();
|
69 |
$roles = implode( '-', $user->roles ) . '-';
|
70 |
}
|
222 |
global $cache_path;
|
223 |
global $wpdb;
|
224 |
|
|
|
|
|
225 |
// Fill in default args
|
226 |
$defaults = array( 'album' => '',
|
227 |
'photo' => '',
|
379 |
if ( function_exists( 'prune_super_cache' ) ) {
|
380 |
prune_super_cache( $cache_path . 'supercache/', true );
|
381 |
prune_super_cache( $cache_path, true );
|
|
|
382 |
}
|
383 |
|
384 |
// W3 Total cache
|
385 |
if ( function_exists( 'w3tc_pgcache_flush' ) ) {
|
386 |
w3tc_pgcache_flush();
|
|
|
387 |
}
|
388 |
|
389 |
// SG_CachePress
|
391 |
$c = new SG_CachePress_Supercacher();
|
392 |
if ( $c->purge_cache ) {
|
393 |
$c->purge_cache();
|
|
|
394 |
}
|
395 |
}
|
396 |
|
397 |
// Quick cache
|
398 |
if ( isset($GLOBALS['quick_cache']) ) {
|
399 |
$GLOBALS['quick_cache']->clear_cache();
|
|
|
400 |
}
|
401 |
|
402 |
// Comet cache
|
403 |
if ( class_exists( 'comet_cache' ) ) {
|
404 |
comet_cache::clear();
|
|
|
405 |
}
|
406 |
|
407 |
wppa_log( 'fso', 'All non wppa caches cleared' );
|
424 |
}
|
425 |
|
426 |
$roles = '';
|
427 |
+
if ( wppa_user_is_admin() || ( is_user_logged_in() && wppa_switch( 'user_create_on' ) ) ) {
|
428 |
$user = wp_get_current_user();
|
429 |
$roles = implode( '-', $user->roles ) . '-';
|
430 |
}
|
wppa-cart.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the interface to SCABN
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -18,7 +18,7 @@ global $post;
|
|
18 |
global $wppa_session;
|
19 |
|
20 |
if ( ! class_exists( 'wfCart' ) ) {
|
21 |
-
|
22 |
return '';
|
23 |
}
|
24 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the interface to SCABN
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*/
|
9 |
|
18 |
global $wppa_session;
|
19 |
|
20 |
if ( ! class_exists( 'wfCart' ) ) {
|
21 |
+
wppa_echo( __( 'Plugin <i>Simple Cart and BuyNow</i> must be activated to use this featue.', 'wp-photo-album-plus' ) );
|
22 |
return '';
|
23 |
}
|
24 |
|
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.2.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -466,7 +466,6 @@ global $wppa;
|
|
466 |
$result = 'ORDER BY timestamp DESC';
|
467 |
break;
|
468 |
default:
|
469 |
-
wppa_dbg_msg( 'Unimplemented album order: '.$order, 'red' );
|
470 |
}
|
471 |
|
472 |
return $result;
|
@@ -608,8 +607,7 @@ global $wppa;
|
|
608 |
break;
|
609 |
|
610 |
default:
|
611 |
-
|
612 |
-
$result = '';
|
613 |
}
|
614 |
|
615 |
return $result;
|
@@ -749,51 +747,6 @@ function wppa_qtrans_enabled() {
|
|
749 |
return ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) );
|
750 |
}
|
751 |
|
752 |
-
// Output debug message
|
753 |
-
function wppa_dbg_msg( $txt = '', $color = 'blue', $force = false, $return = false ) {
|
754 |
-
|
755 |
-
if ( wppa( 'debug' ) || $force || ( is_admin() && WPPA_DEBUG ) || ( WPPA_DEBUG && $color == 'red' ) ) {
|
756 |
-
|
757 |
-
$stack = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 5 );
|
758 |
-
$from = 'From : '.basename( $stack[0]['file'] ).' line: '.$stack[0]['line'].' in function '.$stack[1]['function'].
|
759 |
-
' - '.$stack[2]['function'].' - '.$stack[3]['function'].' - '.$stack[4]['function'];
|
760 |
-
$txt .= ' '.$from;
|
761 |
-
|
762 |
-
if ( $force ) {
|
763 |
-
wppa_log( 'Err', 'Forced debug message: ' . sanitize_text_field( $txt ), true );
|
764 |
-
}
|
765 |
-
$result = '<span>' .
|
766 |
-
'<small style="color:' . sanitize_text_field( $color ) . '">' .
|
767 |
-
'[WPPA+ dbg msg: ' . sanitize_text_field( $txt ) . ']' .
|
768 |
-
'<br />' .
|
769 |
-
'</small>' .
|
770 |
-
'</span>';
|
771 |
-
|
772 |
-
if ( $return ) {
|
773 |
-
return $result;
|
774 |
-
}
|
775 |
-
else {
|
776 |
-
wppa_echo( $result );
|
777 |
-
}
|
778 |
-
}
|
779 |
-
}
|
780 |
-
|
781 |
-
// Append debug value to link
|
782 |
-
function wppa_dbg_url( $link, $js = '' ) {
|
783 |
-
|
784 |
-
$result = $link;
|
785 |
-
|
786 |
-
if ( wppa( 'debug' ) ) {
|
787 |
-
if ( strpos( $result, '?' ) ) {
|
788 |
-
if ( $js == 'js' ) $result .= '&';
|
789 |
-
else $result .= '&';
|
790 |
-
}
|
791 |
-
else $result .= '?';
|
792 |
-
$result .= 'debug=' . wppa( 'debug' );
|
793 |
-
}
|
794 |
-
|
795 |
-
return $result;
|
796 |
-
}
|
797 |
|
798 |
function wppa_get_time_since( $oldtime ) {
|
799 |
|
@@ -838,7 +791,7 @@ global $current_user;
|
|
838 |
if ( ! $alb ) { // == 'any' ) {
|
839 |
|
840 |
// Administrator has always access OR If all albums are public
|
841 |
-
if (
|
842 |
$albs = $wpdb->get_results( "SELECT id FROM $wpdb->wppa_albums" );
|
843 |
if ( $albs ) return true;
|
844 |
else return false; // No albums in system
|
@@ -870,10 +823,10 @@ global $current_user;
|
|
870 |
else {
|
871 |
|
872 |
// Administrator has always access
|
873 |
-
if (
|
874 |
|
875 |
// Limited to separate for non admin/super?
|
876 |
-
if ( wppa_switch( 'admin_separate' ) && !
|
877 |
|
878 |
if ( is_array( $alb ) ) {
|
879 |
$id = $alb['id'];
|
@@ -1679,7 +1632,7 @@ global $wpdb;
|
|
1679 |
$temp = $wpdb->get_results( "SELECT id, name, max_children " .
|
1680 |
"FROM $wpdb->wppa_albums " .
|
1681 |
"WHERE id IN (" . implode( ',', $args['array'] ) . ") " .
|
1682 |
-
( $args['checkowner'] && !
|
1683 |
wppa_get_album_order( $args['root'] ),
|
1684 |
ARRAY_A
|
1685 |
);
|
@@ -1696,7 +1649,7 @@ global $wpdb;
|
|
1696 |
else {
|
1697 |
$albums = $wpdb->get_results( "SELECT id, name, max_children " .
|
1698 |
"FROM $wpdb->wppa_albums " .
|
1699 |
-
( $args['checkowner'] && !
|
1700 |
wppa_get_album_order( $args['root'] ),
|
1701 |
ARRAY_A
|
1702 |
);
|
2 |
/* wppa-common-functions.php
|
3 |
*
|
4 |
* Functions used in admin and in themes
|
5 |
+
* Version 8.2.05.001
|
6 |
*
|
7 |
*/
|
8 |
|
466 |
$result = 'ORDER BY timestamp DESC';
|
467 |
break;
|
468 |
default:
|
|
|
469 |
}
|
470 |
|
471 |
return $result;
|
607 |
break;
|
608 |
|
609 |
default:
|
610 |
+
$result = '';
|
|
|
611 |
}
|
612 |
|
613 |
return $result;
|
747 |
return ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) );
|
748 |
}
|
749 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
750 |
|
751 |
function wppa_get_time_since( $oldtime ) {
|
752 |
|
791 |
if ( ! $alb ) { // == 'any' ) {
|
792 |
|
793 |
// Administrator has always access OR If all albums are public
|
794 |
+
if ( wppa_user_is_admin() ) {
|
795 |
$albs = $wpdb->get_results( "SELECT id FROM $wpdb->wppa_albums" );
|
796 |
if ( $albs ) return true;
|
797 |
else return false; // No albums in system
|
823 |
else {
|
824 |
|
825 |
// Administrator has always access
|
826 |
+
if ( wppa_user_is_admin() ) return true; // Do NOT change this into 'wppa_admin', it will enable access to all albums at backend while owners only
|
827 |
|
828 |
// Limited to separate for non admin/super?
|
829 |
+
if ( wppa_switch( 'admin_separate' ) && ! wppa_user_is_admin() ) {
|
830 |
|
831 |
if ( is_array( $alb ) ) {
|
832 |
$id = $alb['id'];
|
1632 |
$temp = $wpdb->get_results( "SELECT id, name, max_children " .
|
1633 |
"FROM $wpdb->wppa_albums " .
|
1634 |
"WHERE id IN (" . implode( ',', $args['array'] ) . ") " .
|
1635 |
+
( $args['checkowner'] && ! wppa_user_is_admin() ? "AND owner IN ( '--- public ---', '" . wppa_get_user() . "' ) " : "" ) .
|
1636 |
wppa_get_album_order( $args['root'] ),
|
1637 |
ARRAY_A
|
1638 |
);
|
1649 |
else {
|
1650 |
$albums = $wpdb->get_results( "SELECT id, name, max_children " .
|
1651 |
"FROM $wpdb->wppa_albums " .
|
1652 |
+
( $args['checkowner'] && ! wppa_user_is_admin() ? "WHERE owner IN ( '--- public ---', '" . wppa_get_user() . "' ) " : "" ) .
|
1653 |
wppa_get_album_order( $args['root'] ),
|
1654 |
ARRAY_A
|
1655 |
);
|
wppa-dashboard-widgets.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Contains dashboard widgets code
|
6 |
*
|
7 |
-
* Version 8.2.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -131,7 +131,7 @@ function wppa_show_email_subscription() {
|
|
131 |
class="wppa-notify-label"
|
132 |
style="float:left;padding-left:4px;width:90%;margin-top:-3px;"
|
133 |
> ' .
|
134 |
-
( ( wppa_switch( 'commentnotify_limit' ) && !
|
135 |
__( 'A comment on my photo is given', 'wp-photo-album-plus' ) :
|
136 |
__( 'A comment on any photo is given', 'wp-photo-album-plus' ) ) . '
|
137 |
</label>
|
@@ -280,7 +280,7 @@ global $wpdb;
|
|
280 |
|
281 |
$id = $photo['id'];
|
282 |
if ( wppa_is_photo_visible( $id ) ) {
|
283 |
-
if (
|
284 |
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo=' . $photo['id'] . '&nonce=' . wp_create_nonce( 'wppa-nonce' );
|
285 |
}
|
286 |
else {
|
@@ -350,7 +350,7 @@ global $wpdb;
|
|
350 |
wppa_echo( '<table>' );
|
351 |
foreach( $comments as $comment ) {
|
352 |
$photo = wppa_cache_photo( $comment['photo'] );
|
353 |
-
if (
|
354 |
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo=' . $photo['id'] . '&nonce=' . wp_create_nonce( 'wppa-nonce' );
|
355 |
}
|
356 |
else {
|
@@ -413,7 +413,7 @@ function wppa_show_potd_log() {
|
|
413 |
if ( wppa_photo_exists( $item['id'] ) ) {
|
414 |
$photo = wppa_cache_photo( $item['id'] );
|
415 |
$time = $item['tm'];
|
416 |
-
if (
|
417 |
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo=' . $photo['id'] . '&nonce=' . wp_create_nonce( 'wppa-nonce' );
|
418 |
}
|
419 |
else {
|
4 |
*
|
5 |
* Contains dashboard widgets code
|
6 |
*
|
7 |
+
* Version 8.2.05.001
|
8 |
*
|
9 |
*/
|
10 |
|
131 |
class="wppa-notify-label"
|
132 |
style="float:left;padding-left:4px;width:90%;margin-top:-3px;"
|
133 |
> ' .
|
134 |
+
( ( wppa_switch( 'commentnotify_limit' ) && ! wppa_user_is_admin() ) ?
|
135 |
__( 'A comment on my photo is given', 'wp-photo-album-plus' ) :
|
136 |
__( 'A comment on any photo is given', 'wp-photo-album-plus' ) ) . '
|
137 |
</label>
|
280 |
|
281 |
$id = $photo['id'];
|
282 |
if ( wppa_is_photo_visible( $id ) ) {
|
283 |
+
if ( wppa_user_is_admin() ) {
|
284 |
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo=' . $photo['id'] . '&nonce=' . wp_create_nonce( 'wppa-nonce' );
|
285 |
}
|
286 |
else {
|
350 |
wppa_echo( '<table>' );
|
351 |
foreach( $comments as $comment ) {
|
352 |
$photo = wppa_cache_photo( $comment['photo'] );
|
353 |
+
if ( wppa_user_is_admin() ) {
|
354 |
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo=' . $photo['id'] . '&nonce=' . wp_create_nonce( 'wppa-nonce' );
|
355 |
}
|
356 |
else {
|
413 |
if ( wppa_photo_exists( $item['id'] ) ) {
|
414 |
$photo = wppa_cache_photo( $item['id'] );
|
415 |
$time = $item['tm'];
|
416 |
+
if ( wppa_user_is_admin() ) {
|
417 |
$href = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=single&photo=' . $photo['id'] . '&nonce=' . wp_create_nonce( 'wppa-nonce' );
|
418 |
}
|
419 |
else {
|
wppa-encrypt.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all ecryption/decryption logic
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -400,7 +400,7 @@ function wppa_encrypt_url( $url ) {
|
|
400 |
if ( ! $t['1'] ) $t['1'] = '0';
|
401 |
$t['1'] = wppa_encrypt_album( $t['1'] );
|
402 |
if ( $t['1'] === false ) {
|
403 |
-
|
404 |
exit;
|
405 |
}
|
406 |
break;
|
@@ -409,7 +409,7 @@ function wppa_encrypt_url( $url ) {
|
|
409 |
case 'photo':
|
410 |
$t['1'] = wppa_encrypt_photo( $t['1'] );
|
411 |
if ( $t['1'] === false ) {
|
412 |
-
|
413 |
exit;
|
414 |
}
|
415 |
break;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all ecryption/decryption logic
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*/
|
9 |
|
400 |
if ( ! $t['1'] ) $t['1'] = '0';
|
401 |
$t['1'] = wppa_encrypt_album( $t['1'] );
|
402 |
if ( $t['1'] === false ) {
|
403 |
+
wppa_log( 'Err', 'Illegal album specification: ' . $item . ' (wppa_encrypt_url)' );
|
404 |
exit;
|
405 |
}
|
406 |
break;
|
409 |
case 'photo':
|
410 |
$t['1'] = wppa_encrypt_photo( $t['1'] );
|
411 |
if ( $t['1'] === false ) {
|
412 |
+
wppa_err( 'Err', 'Illegal photo specification: ' . $item . ' (wppa_encrypt_url)' );
|
413 |
exit;
|
414 |
}
|
415 |
break;
|
wppa-exif-iptc-common.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* exif and iptc common functions
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*
|
9 |
*/
|
@@ -2967,13 +2967,9 @@ static $labels;
|
|
2967 |
if ( substr( wppa_opt( 'newphoto_name_method' ), 0, 2 ) == '2#' ) $doit = true;
|
2968 |
if ( ! $doit ) return;
|
2969 |
|
2970 |
-
wppa_dbg_msg( 'wppa_import_iptc called for id='.$id );
|
2971 |
-
wppa_dbg_msg( 'array is'.( is_array( $info ) ? ' ' : ' NOT ' ).'available' );
|
2972 |
-
wppa_dbg_msg( 'APP13 is '.( isset( $info['APP13'] ) ? 'set' : 'NOT set' ) );
|
2973 |
-
|
2974 |
// Is iptc data present?
|
2975 |
if ( !isset( $info['APP13'] ) ) return false; // No iptc data avail
|
2976 |
-
|
2977 |
// Parse
|
2978 |
$iptc = iptcparse( $info['APP13'] );
|
2979 |
if ( ! is_array( $iptc ) ) return false; // No data avail
|
@@ -3005,9 +3001,6 @@ static $labels;
|
|
3005 |
$c = count ( $iptc[$s] );
|
3006 |
for ( $i=0; $i <$c; $i++ ) {
|
3007 |
|
3008 |
-
// Process item
|
3009 |
-
wppa_dbg_msg( 'IPTC '.$s.' = '.$iptc[$s][$i] );
|
3010 |
-
|
3011 |
// Check labels first
|
3012 |
if ( ! in_array( $s, $labels ) ) {
|
3013 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* exif and iptc common functions
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*
|
9 |
*/
|
2967 |
if ( substr( wppa_opt( 'newphoto_name_method' ), 0, 2 ) == '2#' ) $doit = true;
|
2968 |
if ( ! $doit ) return;
|
2969 |
|
|
|
|
|
|
|
|
|
2970 |
// Is iptc data present?
|
2971 |
if ( !isset( $info['APP13'] ) ) return false; // No iptc data avail
|
2972 |
+
|
2973 |
// Parse
|
2974 |
$iptc = iptcparse( $info['APP13'] );
|
2975 |
if ( ! is_array( $iptc ) ) return false; // No data avail
|
3001 |
$c = count ( $iptc[$s] );
|
3002 |
for ( $i=0; $i <$c; $i++ ) {
|
3003 |
|
|
|
|
|
|
|
3004 |
// Check labels first
|
3005 |
if ( ! in_array( $s, $labels ) ) {
|
3006 |
|
wppa-export.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the export functions
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -31,7 +31,7 @@ global $wpdb;
|
|
31 |
|
32 |
<h2><?php _e('Export Photos', 'wp-photo-album-plus' ); ?></h2><br>
|
33 |
|
34 |
-
<form action="<?php echo(
|
35 |
<?php wp_nonce_field('$wppa_nonce', WPPA_NONCE); ?>
|
36 |
<?php echo(sprintf(__('Photos will be exported to: <b>%s</b>.', 'wp-photo-album-plus' ), WPPA_DEPOT)) ?>
|
37 |
<h2><?php _e('Export photos from album <span style="font-size:12px;">(Including Album information)</span>:', 'wp-photo-album-plus' ); ?></h2>
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the export functions
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*/
|
9 |
|
31 |
|
32 |
<h2><?php _e('Export Photos', 'wp-photo-album-plus' ); ?></h2><br>
|
33 |
|
34 |
+
<form action="<?php echo(get_admin_url().'admin.php?page=wppa_export_photos') ?>" method="post">
|
35 |
<?php wp_nonce_field('$wppa_nonce', WPPA_NONCE); ?>
|
36 |
<?php echo(sprintf(__('Photos will be exported to: <b>%s</b>.', 'wp-photo-album-plus' ), WPPA_DEPOT)) ?>
|
37 |
<h2><?php _e('Export photos from album <span style="font-size:12px;">(Including Album information)</span>:', 'wp-photo-album-plus' ); ?></h2>
|
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.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -173,7 +173,7 @@ global $other_deps;
|
|
173 |
wppa_bump_mocc();
|
174 |
return '';
|
175 |
}
|
176 |
-
if ( $atts['login'] == 'admin' && !
|
177 |
wppa_bump_mocc();
|
178 |
return '';
|
179 |
}
|
@@ -623,7 +623,7 @@ global $other_deps;
|
|
623 |
break;
|
624 |
|
625 |
default:
|
626 |
-
|
627 |
return '';
|
628 |
}
|
629 |
|
@@ -734,18 +734,12 @@ global $wppa_runtime_settings;
|
|
734 |
$wppa_opt[$atts['name']] = $atts['value'];
|
735 |
$wppa_runtime_settings[$atts['name']] = $atts['value'];
|
736 |
}
|
737 |
-
else {
|
738 |
-
wppa_dbg_msg( $atts['name'] . ' is not an option value.', 'red', 'force' );
|
739 |
-
}
|
740 |
}
|
741 |
else {
|
742 |
if ( isset( $wppa[$atts['name']] ) ) {
|
743 |
$wppa[$atts['name']] = $atts['value'];
|
744 |
$wppa_runtime_settings[$atts['name']] = $atts['value'];
|
745 |
}
|
746 |
-
else {
|
747 |
-
wppa_dbg_msg( $atts['name'] . ' is not a runtime value.', 'red', 'force' );
|
748 |
-
}
|
749 |
}
|
750 |
}
|
751 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
+
* Version: 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
173 |
wppa_bump_mocc();
|
174 |
return '';
|
175 |
}
|
176 |
+
if ( $atts['login'] == 'admin' && ! wppa_user_is_admin() ) {
|
177 |
wppa_bump_mocc();
|
178 |
return '';
|
179 |
}
|
623 |
break;
|
624 |
|
625 |
default:
|
626 |
+
wppa_log( 'Err', 'Invalid type: ' . htmlentities( $atts['type'] ) . ' in wppa shortcode ' . $wppa_current_shortcode );
|
627 |
return '';
|
628 |
}
|
629 |
|
734 |
$wppa_opt[$atts['name']] = $atts['value'];
|
735 |
$wppa_runtime_settings[$atts['name']] = $atts['value'];
|
736 |
}
|
|
|
|
|
|
|
737 |
}
|
738 |
else {
|
739 |
if ( isset( $wppa[$atts['name']] ) ) {
|
740 |
$wppa[$atts['name']] = $atts['value'];
|
741 |
$wppa_runtime_settings[$atts['name']] = $atts['value'];
|
742 |
}
|
|
|
|
|
|
|
743 |
}
|
744 |
}
|
745 |
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -72,9 +72,6 @@ global $other_deps;
|
|
72 |
global $wppa_gutenberg_preview;
|
73 |
if ( ( wppa_get( 'occur' ) && wppa_get( 'occur' ) == wppa( 'mocc' ) ) && ! wppa( 'is_autopage' ) && ! $wppa_gutenberg_preview ) {
|
74 |
|
75 |
-
// Process query string
|
76 |
-
wppa_out( wppa_dbg_msg( 'Querystring applied', 'brown', false, true ) );
|
77 |
-
|
78 |
// Test validity of album arg
|
79 |
wppa( 'start_album', wppa_get( 'album' ) );
|
80 |
|
@@ -135,8 +132,6 @@ global $other_deps;
|
|
135 |
wppa( 'photos_only', true );
|
136 |
}
|
137 |
|
138 |
-
if ( wppa( 'is_tag' ) ) wppa_dbg_msg( 'Is Tag: ' . wppa( 'is_tag' ) );
|
139 |
-
else wppa_dbg_msg( 'Is NOT Tag' );
|
140 |
wppa( 'page', wppa_get( 'wppa-page', '1' ) );
|
141 |
|
142 |
if ( wppa_get( 'superview' ) ) {
|
@@ -298,7 +293,6 @@ global $other_deps;
|
|
298 |
return $out;
|
299 |
}
|
300 |
elseif ( wppa( 'is_landing' ) && ! wppa( 'src' ) ) {
|
301 |
-
wppa_dbg_msg( 'Nothing to do...' );
|
302 |
wppa_reset_occurrance();
|
303 |
return ''; // Do nothing on a landing page without a querystring while it is also not a search operation
|
304 |
}
|
@@ -308,7 +302,6 @@ global $other_deps;
|
|
308 |
LIMIT 1", wppa_get_the_id() ) );
|
309 |
wppa( 'single_photo', $photo );
|
310 |
if ( ! wppa( 'single_photo' ) ) {
|
311 |
-
wppa_dbg_msg( 'No photo found for page '.wppa_get_the_id(), 'red', 'force' );
|
312 |
wppa_reset_occurrance();
|
313 |
return ''; // Give up
|
314 |
}
|
@@ -328,7 +321,6 @@ global $other_deps;
|
|
328 |
wppa( 'is_single', true );
|
329 |
break;
|
330 |
default:
|
331 |
-
wppa_dbg_msg( 'Unimplemented type autopage display: '.$type, 'red', 'force' );
|
332 |
}
|
333 |
}
|
334 |
}
|
@@ -402,7 +394,6 @@ global $other_deps;
|
|
402 |
wppa( 'topten_count', $cnt );
|
403 |
wppa( 'is_topten', true );
|
404 |
if ( wppa( 'is_cover' ) ) {
|
405 |
-
wppa_dbg_msg( 'A topten album has no cover. ' . wppa( 'start_album' ), 'red', 'force' );
|
406 |
wppa_reset_occurrance();
|
407 |
return; // Give up this occurence
|
408 |
}
|
@@ -424,7 +415,6 @@ global $other_deps;
|
|
424 |
}
|
425 |
|
426 |
if ( wppa( 'is_cover' ) ) {
|
427 |
-
wppa_dbg_msg( 'A lasten album has no cover. ' . wppa( 'start_album' ), 'red', 'force' );
|
428 |
wppa_reset_occurrance();
|
429 |
return; // Give up this occurence
|
430 |
}
|
@@ -435,7 +425,6 @@ global $other_deps;
|
|
435 |
wppa( 'comten_count', isset( $temp[2] ) ? $temp[2] : wppa_opt( 'comten_count' ) );
|
436 |
wppa( 'is_comten', true );
|
437 |
if ( wppa( 'is_cover' ) ) {
|
438 |
-
wppa_dbg_msg( 'A comten album has no cover. ' . wppa( 'start_album' ), 'red', 'force' );
|
439 |
wppa_reset_occurrance();
|
440 |
return; // Give up this occurence
|
441 |
}
|
@@ -446,7 +435,6 @@ global $other_deps;
|
|
446 |
wppa( 'featen_count', isset( $temp[2] ) ? $temp[2] : wppa_opt( 'featen_count' ) );
|
447 |
wppa( 'is_featen', true );
|
448 |
if ( wppa( 'is_cover' ) ) {
|
449 |
-
wppa_dbg_msg( 'A featen album has no cover. ' . wppa( 'start_album' ), 'red', 'force' );
|
450 |
wppa_reset_occurrance();
|
451 |
return; // Give up this occurence
|
452 |
}
|
@@ -474,7 +462,7 @@ global $other_deps;
|
|
474 |
// See if they did not use the #cat / #tags combination in wrong sequence order
|
475 |
$seppos = strpos( wppa( 'start_album' ), '|' );
|
476 |
if ( $seppos !== false ) {
|
477 |
-
|
478 |
wppa_reset_occurrance();
|
479 |
return;
|
480 |
}
|
@@ -490,7 +478,7 @@ global $other_deps;
|
|
490 |
|
491 |
// Yes, process the second part, the #tags clause
|
492 |
if ( substr( wppa( 'start_album' ), $seppos, 7 ) != '|#tags,' ) {
|
493 |
-
|
494 |
wppa_reset_occurrance();
|
495 |
return; // Forget this occurrance
|
496 |
}
|
@@ -505,7 +493,7 @@ global $other_deps;
|
|
505 |
wppa( 'is_cat', $cats );
|
506 |
|
507 |
if ( ! $cats ) {
|
508 |
-
|
509 |
wppa_reset_occurrance();
|
510 |
return; // Forget this occurrance
|
511 |
}
|
@@ -592,7 +580,7 @@ global $other_deps;
|
|
592 |
}
|
593 |
}
|
594 |
if ( ! $owner ) {
|
595 |
-
|
596 |
wppa_reset_occurrance();
|
597 |
return; // Forget this occurrance
|
598 |
}
|
@@ -638,7 +626,7 @@ global $other_deps;
|
|
638 |
}
|
639 |
}
|
640 |
if ( ! $owner ) {
|
641 |
-
|
642 |
wppa_reset_occurrance();
|
643 |
return; // Forget this occurrance
|
644 |
}
|
@@ -666,7 +654,7 @@ global $other_deps;
|
|
666 |
$id = '-2';
|
667 |
break;
|
668 |
default:
|
669 |
-
|
670 |
wppa_reset_occurrance();
|
671 |
return; // Forget this occurrance
|
672 |
}
|
@@ -730,7 +718,7 @@ global $other_deps;
|
|
730 |
wppa( 'start_photo', $id );
|
731 |
}
|
732 |
else {
|
733 |
-
|
734 |
wppa_reset_occurrance();
|
735 |
return; // Forget this occurrance
|
736 |
}
|
@@ -753,7 +741,7 @@ global $other_deps;
|
|
753 |
wppa( 'start_photo', $id );
|
754 |
break;
|
755 |
default:
|
756 |
-
|
757 |
wppa_reset_occurrance();
|
758 |
return; // Forget this occurrance
|
759 |
}
|
@@ -773,7 +761,7 @@ global $other_deps;
|
|
773 |
wppa( 'single_photo', $id );
|
774 |
}
|
775 |
else {
|
776 |
-
|
777 |
wppa_reset_occurrance();
|
778 |
return; // Forget this occurrance
|
779 |
}
|
@@ -868,7 +856,7 @@ global $other_deps;
|
|
868 |
wppa_out( wppa_get_hires_url( wppa( 'single_photo' ) ) );
|
869 |
}
|
870 |
else {
|
871 |
-
|
872 |
}
|
873 |
}
|
874 |
// Is is a stereo settings box?
|
@@ -941,29 +929,12 @@ global $other_deps;
|
|
941 |
}
|
942 |
// The normal case
|
943 |
else {
|
944 |
-
if (
|
945 |
-
|
946 |
-
|
947 |
-
if ( wppa( 'is_autopage' ) ) wppa_auto_page_links( 'bottom' );
|
948 |
-
}
|
949 |
-
else wppa_out( '<span style="color:red">ERROR: Missing function wppa_theme(), check the installation of WPPA+. Remove customized wppa_theme.php</span>' );
|
950 |
-
global $wppa_version;
|
951 |
-
$expected_version = '8.2.04.008';
|
952 |
-
if ( $wppa_version != $expected_version ) {
|
953 |
-
wppa_dbg_msg( 'WARNING: customized wppa-theme.php is out of rev. Expected version: ' . $expected_version . ' found: ' . $wppa_version, 'red' );
|
954 |
-
}
|
955 |
}
|
956 |
|
957 |
-
//
|
958 |
-
global $wppa_empty_content;
|
959 |
-
if ( $wppa_empty_content &&
|
960 |
-
( ( ! wppa( 'src' ) && ! wppa( 'is_tag' ) && ! wppa( 'supersearch' ) ) ||
|
961 |
-
( ! wppa_switch( 'show_empty_search' ) )
|
962 |
-
)
|
963 |
-
) {
|
964 |
-
$wppa_empty_content = false;
|
965 |
-
wppa( 'out', '<!-- Nothing to display, occ = ' . wppa( 'mocc' ) . ' -->' );
|
966 |
-
}
|
967 |
$out = str_replace( 'w#location', wppa( 'geo' ), wppa( 'out' ) );
|
968 |
|
969 |
// Cache?
|
@@ -971,14 +942,15 @@ global $other_deps;
|
|
971 |
wppa_save_cache_file( ['file' => $cache_file, 'data' => $out] );
|
972 |
}
|
973 |
|
974 |
-
// Reset
|
975 |
$timer = wppa_occur_timer( 'show', $_SERVER['REQUEST_URI'] . ' oc ' . wppa( 'mocc' ) );
|
976 |
wppa_reset_occurrance();
|
977 |
|
|
|
978 |
return $out . $timer;
|
979 |
}
|
980 |
|
981 |
-
|
982 |
function wppa_album_name_to_number( $xalb, $return_dups = false ) {
|
983 |
|
984 |
// Sanitize
|
@@ -1002,12 +974,12 @@ function wppa_album_name_to_number( $xalb, $return_dups = false ) {
|
|
1002 |
|
1003 |
// Handle exceptions
|
1004 |
elseif ( $id < '0' ) {
|
1005 |
-
|
1006 |
wppa_reset_occurrance();
|
1007 |
return false; // Forget this occurrance
|
1008 |
}
|
1009 |
else {
|
1010 |
-
|
1011 |
wppa_reset_occurrance();
|
1012 |
return false; // Forget this occurrance
|
1013 |
}
|
@@ -1178,7 +1150,6 @@ global $albums_used;
|
|
1178 |
if ( ! wppa_is_ancestor( $root, $albums[$idx]['id'] ) ) unset ( $albums[$idx] );
|
1179 |
}
|
1180 |
$c2=count( $albums );
|
1181 |
-
wppa_dbg_msg( 'Rootsearch albums:'.$c1.' -> '.$c2 );
|
1182 |
}
|
1183 |
}
|
1184 |
|
@@ -1244,29 +1215,14 @@ global $albums_used;
|
|
1244 |
$q = "SELECT * FROM $wpdb->wppa_albums
|
1245 |
WHERE a_parent = " . implode( " OR a_parent = ", $ids ) . " " . wppa_get_album_order();
|
1246 |
}
|
1247 |
-
wppa_dbg_msg( $q, 'red' );
|
1248 |
$albums = $wpdb->get_results( $q, ARRAY_A );
|
1249 |
}
|
1250 |
else $albums = false;
|
1251 |
}
|
1252 |
-
/*
|
1253 |
-
// Check for empty albums
|
1254 |
-
if ( wppa_switch( 'skip_empty_albums' ) ) {
|
1255 |
-
$user = wppa_get_user();
|
1256 |
-
if ( is_array( $albums ) ) foreach ( array_keys( $albums ) as $albumkey ) {
|
1257 |
-
$albumid = $albums[$albumkey]['id'];
|
1258 |
-
$albumowner = $albums[$albumkey]['owner'];
|
1259 |
-
$treecount = wppa_get_treecounts_a( $albums[$albumkey]['id'] );
|
1260 |
-
$photocount = $treecount['treephotos'];
|
1261 |
-
if ( ! $photocount && ! wppa_user_is( 'administrator' ) && $user != $albumowner ) unset( $albums[$albumkey] );
|
1262 |
-
}
|
1263 |
-
}
|
1264 |
-
*/
|
1265 |
-
//if (wppa_get('album')=='344') wppa_log('obs', ' Aantal 2 = '. count($albums));
|
1266 |
|
1267 |
// Check for album status
|
1268 |
$albums = wppa_strip_void_albums( $albums );
|
1269 |
-
|
1270 |
// Copy data into secondary cache
|
1271 |
if ( $albums ) {
|
1272 |
wppa_cache_album( 'add', $albums );
|
@@ -1289,13 +1245,11 @@ global $wppa_session;
|
|
1289 |
|
1290 |
// A cover -> no thumbs
|
1291 |
if ( wppa( 'is_cover' ) ) {
|
1292 |
-
wppa_dbg_msg( 'Its cover, leave get_thumbs' );
|
1293 |
return false;
|
1294 |
}
|
1295 |
|
1296 |
// Albums only -> no thumbs
|
1297 |
if ( wppa( 'albums_only' ) ) {
|
1298 |
-
wppa_dbg_msg( 'Albums only, leave get_thumbs' );
|
1299 |
return false;
|
1300 |
}
|
1301 |
|
@@ -1532,10 +1486,7 @@ global $wppa_session;
|
|
1532 |
wppa( 'any', ! empty ( $thumbs ) );
|
1533 |
wppa( 'thumb_count', empty( $thumbs ) ? '0' : count( $thumbs ) );
|
1534 |
$time += microtime( true );
|
1535 |
-
|
1536 |
-
'Found: ' . wppa( 'thumb_count' ) . ' items. ' .
|
1537 |
-
'Mem used=' . ceil( memory_get_peak_usage( true ) / ( 1024*1024 ) ) . ' Mb.'
|
1538 |
-
);
|
1539 |
return $thumbs;
|
1540 |
}
|
1541 |
|
@@ -1977,8 +1928,6 @@ global $wppa_session;
|
|
1977 |
if ( strpos( wppa( 'start_album' ), '.' ) !== false ) $allalb = wppa_series_to_array( wppa( 'start_album' ) );
|
1978 |
else $allalb = false;
|
1979 |
|
1980 |
-
wppa_dbg_msg( 'Startalbum = ' . wppa( 'start_album' ) );
|
1981 |
-
|
1982 |
// All albums ?
|
1983 |
if ( wppa( 'start_album' ) == -2 ) {
|
1984 |
|
@@ -2193,7 +2142,6 @@ global $photos_used;
|
|
2193 |
if ( ! $query ) {
|
2194 |
wppa( 'thumb_count', '0' );
|
2195 |
wppa( 'any', false );
|
2196 |
-
wppa_dbg_msg( 'Empty query photos', 'red' );
|
2197 |
return false;
|
2198 |
}
|
2199 |
|
@@ -2261,11 +2209,10 @@ global $photos_used;
|
|
2261 |
if ( strlen( $query ) > 25000 ) {
|
2262 |
wppa_log( 'war', 'Long query: ' . strlen($query) . ' chars. ' . substr( htmlspecialchars( $query ), 0, 100 ) . '...' , true );
|
2263 |
}
|
2264 |
-
|
2265 |
// Remove items because of status album
|
2266 |
$thumbs = wppa_strip_void_photos( $thumbs );
|
2267 |
-
|
2268 |
-
//wppa_log('obs', "Trimmed from $c1 tp $c2");
|
2269 |
// Process extended duplicate removal
|
2270 |
if ( $exduprem ) {
|
2271 |
wppa_extended_duplicate_remove( $thumbs );
|
@@ -2274,11 +2221,7 @@ $c2 = count( $thumbs );
|
|
2274 |
// Postprocess
|
2275 |
wppa( 'thumb_count', $count );
|
2276 |
$time += microtime( true );
|
2277 |
-
|
2278 |
-
'Found: ' . $count . ' items. ' .
|
2279 |
-
'Mem used=' . ceil( memory_get_peak_usage( true ) / ( 1024*1024 ) ) . ' Mb. ' .
|
2280 |
-
'Caching: ' . ( $caching ? 'yes' : 'no' )
|
2281 |
-
);
|
2282 |
if ( $caching ) {
|
2283 |
wppa_cache_photo( 'add', $thumbs );
|
2284 |
}
|
@@ -2798,7 +2741,7 @@ static $user;
|
|
2798 |
}
|
2799 |
$choice = wppa_opt( 'admins_choice' );
|
2800 |
if ( current_user_can( 'wppa_admin' ) || wppa_opt( 'admins_choice_action' ) != 'album' ) {
|
2801 |
-
if ( (
|
2802 |
( is_user_logged_in() && $choice == 'login' ) ) {
|
2803 |
|
2804 |
if ( wppa_is_photo_in_zip( $thumb['id'] ) ) {
|
@@ -3623,7 +3566,7 @@ global $wppa;
|
|
3623 |
$area = wppa_get_box_width() + $tfw; // Area for n+1 thumbs
|
3624 |
$n_1 = floor( $area / ( $tfw + $mgl ) );
|
3625 |
if ( $n_1 == '0' ) {
|
3626 |
-
if ( ! $wppaerrmsgxxx )
|
3627 |
$n_1 = '1';
|
3628 |
$wppaerrmsgxxx = true; // err msg given
|
3629 |
}
|
@@ -3777,10 +3720,6 @@ function wppa_get_curpage() {
|
|
3777 |
|
3778 |
function wppa_container( $action ) {
|
3779 |
global $wppa_version; // The theme version ( wppa_theme.php )
|
3780 |
-
global $wppa_microtime;
|
3781 |
-
global $wppa_microtime_cum;
|
3782 |
-
global $wppa_err_displayed;
|
3783 |
-
static $wppa_numqueries;
|
3784 |
static $auto;
|
3785 |
global $blog_id;
|
3786 |
|
@@ -3795,8 +3734,6 @@ global $blog_id;
|
|
3795 |
// Open request?
|
3796 |
if ( $action == 'open' ) {
|
3797 |
|
3798 |
-
$wppa_numqueries = get_num_queries();
|
3799 |
-
|
3800 |
// Open the container
|
3801 |
if ( ! defined( 'DOING_WPPA_AJAX' ) ) {
|
3802 |
|
@@ -3834,23 +3771,14 @@ global $blog_id;
|
|
3834 |
) ) );
|
3835 |
}
|
3836 |
|
3837 |
-
// Start timer if in debug mode
|
3838 |
-
if ( wppa( 'debug' ) ) {
|
3839 |
-
$wppa_microtime = - microtime( true );
|
3840 |
-
}
|
3841 |
-
if ( wppa( 'mocc' ) == '1' ) {
|
3842 |
-
wppa_dbg_msg( 'Num queries before wppa :'.get_num_queries() );
|
3843 |
-
}
|
3844 |
-
|
3845 |
// Nonce field check for rating security
|
3846 |
if ( wppa( 'mocc' ) == '1' ) {
|
3847 |
if ( wppa_get( 'rating' ) ) {
|
3848 |
$nonce = wppa_get( 'nonce' );
|
3849 |
$ok = wp_verify_nonce( $nonce, 'wppa-check' );
|
3850 |
-
if ( $ok ) {
|
3851 |
-
|
3852 |
}
|
3853 |
-
else wp_die( '<b>' . __( 'ERROR: Illegal attempt to enter a rating.', 'wp-photo-album-plus' ) . '</b>' );
|
3854 |
}
|
3855 |
}
|
3856 |
|
@@ -3859,10 +3787,9 @@ global $blog_id;
|
|
3859 |
if ( wppa_get( 'comment' ) ) {
|
3860 |
$nonce = wppa_get( 'nonce' );
|
3861 |
$ok = wp_verify_nonce( $nonce, 'wppa-check' );
|
3862 |
-
if ( $ok ) {
|
3863 |
-
|
3864 |
}
|
3865 |
-
else wp_die( '<b>' . __( 'ERROR: Illegal attempt to enter a comment.', 'wp-photo-album-plus' ) . '</b>' );
|
3866 |
}
|
3867 |
}
|
3868 |
|
@@ -4037,15 +3964,6 @@ global $blog_id;
|
|
4037 |
// Static max in responsive? close wrapper
|
4038 |
wppa_container_wrapper( 'close' );
|
4039 |
}
|
4040 |
-
|
4041 |
-
if ( wppa( 'debug' ) ) {
|
4042 |
-
$laptim = $wppa_microtime + microtime( true );
|
4043 |
-
$wppa_numqueries = get_num_queries() - $wppa_numqueries;
|
4044 |
-
if ( !is_numeric( $wppa_microtime_cum ) ) $wppa_mcrotime_cum = '0';
|
4045 |
-
$wppa_microtime_cum += $laptim;
|
4046 |
-
wppa_dbg_msg( 'Time elapsed occ '.wppa( 'mocc' ).':'.substr( $laptim, 0, 5 ).'s. Tot:'.substr( $wppa_microtime_cum, 0, 5 ).'s.' );
|
4047 |
-
wppa_dbg_msg( 'Number of queries occ '.wppa( 'mocc' ).':' . $wppa_numqueries, 'green' );
|
4048 |
-
}
|
4049 |
}
|
4050 |
|
4051 |
// Unimplemented request
|
@@ -4076,7 +3994,6 @@ function wppa_container_wrapper( $key ) {
|
|
4076 |
wppa_out( '</div>' );
|
4077 |
break;
|
4078 |
default:
|
4079 |
-
wppa_dbg_msg( 'Missing or wrong arg in wppa_container_wrapper()', 'red', 'force' );
|
4080 |
}
|
4081 |
}
|
4082 |
|
@@ -4207,7 +4124,6 @@ function wppa_popup() {
|
|
4207 |
function wppa_run_slidecontainer( $thumbs ) {
|
4208 |
|
4209 |
$c = is_array( $thumbs ) ? count( $thumbs ) : '0';
|
4210 |
-
wppa_dbg_msg( 'Running slidecontainer with '.$c.' elements in thumbs, is_single=' . wppa( 'is_single' ) );
|
4211 |
|
4212 |
if ( wppa( 'is_single' ) && is_feed() ) { // process feed for single image slideshow here, normal slideshow uses filmthumbs
|
4213 |
$style_a = wppa_get_fullimgstyle_a( wppa( 'start_photo' ) );
|
@@ -4435,7 +4351,6 @@ function wppa_get_text_frame_style( $photo_left, $type ) {
|
|
4435 |
$result = '';
|
4436 |
break;
|
4437 |
default:
|
4438 |
-
wppa_dbg_msg( 'Illegal $photo_pos in wppa_get_text_frame_style', 'red' );
|
4439 |
}
|
4440 |
}
|
4441 |
else {
|
@@ -4453,11 +4368,9 @@ function wppa_get_text_frame_style( $photo_left, $type ) {
|
|
4453 |
$result = '';
|
4454 |
break;
|
4455 |
default:
|
4456 |
-
wppa_dbg_msg( 'Illegal $photo_pos in wppa_get_text_frame_style', 'red' );
|
4457 |
}
|
4458 |
}
|
4459 |
}
|
4460 |
-
else wppa_dbg_msg( 'Illegal $type in wppa_get_text_frame_style', 'red' );
|
4461 |
}
|
4462 |
return $result;
|
4463 |
}
|
@@ -4856,11 +4769,9 @@ global $allalbums;
|
|
4856 |
|
4857 |
if ( $albs ) {
|
4858 |
if ( count( $albs ) == 1 ) {
|
4859 |
-
wppa_dbg_msg( 'Alb '.$albs[0]['id'],' found for '.$xname );
|
4860 |
$aid = $albs[0]['id'];
|
4861 |
}
|
4862 |
else {
|
4863 |
-
wppa_dbg_msg( 'Dups found for '.$xname );
|
4864 |
if ( $report_dups == 'report_dups' ) {
|
4865 |
$aid = false;
|
4866 |
}
|
@@ -4880,7 +4791,6 @@ global $allalbums;
|
|
4880 |
$aname = str_replace( '\'', '%', $aname ); // A trick for single quotes
|
4881 |
$aname = str_replace( '"', '%', $aname ); // A trick for double quotes
|
4882 |
$aname = stripslashes( $aname );
|
4883 |
-
wppa_dbg_msg( 'Testing '.$aname.' for '.$name.' (get_album_id_by_name)' );
|
4884 |
if ( strcasecmp( $aname, $name ) == 0 ) {
|
4885 |
$aid = $alb['id'];
|
4886 |
}
|
@@ -4897,12 +4807,6 @@ global $allalbums;
|
|
4897 |
$aid = false;
|
4898 |
}
|
4899 |
|
4900 |
-
if ( $aid ) {
|
4901 |
-
wppa_dbg_msg( 'Aid ' . $aid . ' found for ' . $name );
|
4902 |
-
}
|
4903 |
-
else {
|
4904 |
-
wppa_dbg_msg( 'No aid found for ' . $name );
|
4905 |
-
}
|
4906 |
return $aid;
|
4907 |
}
|
4908 |
|
@@ -4914,8 +4818,6 @@ static $done;
|
|
4914 |
global $wppa_alert;
|
4915 |
global $wppa_upload_succes_id;
|
4916 |
|
4917 |
-
wppa_dbg_msg( 'Usr_upl entered' );
|
4918 |
-
|
4919 |
if ( $done ) return; // Already done
|
4920 |
$done = true; // Mark as done
|
4921 |
$wppa_alert = '';
|
@@ -4931,12 +4833,12 @@ global $wppa_upload_succes_id;
|
|
4931 |
|
4932 |
// Find the parent
|
4933 |
$parent = strval( intval( wppa_get( 'album-parent' ) ) );
|
4934 |
-
if ( !
|
4935 |
$parent = wppa_opt( 'default_parent' );
|
4936 |
}
|
4937 |
|
4938 |
// If roles specified and i am not an admin, see if i have one
|
4939 |
-
if ( wppa_opt( 'user_create_roles' ) && !
|
4940 |
|
4941 |
// Allowed roles
|
4942 |
$allowed_roles = explode( ',', wppa_opt( 'user_create_roles' ) );
|
@@ -5733,8 +5635,6 @@ global $wpdb;
|
|
5733 |
// Get the title to be used for lightbox links == text under the lightbox image
|
5734 |
function wppa_get_lbtitle( $type, $id ) {
|
5735 |
|
5736 |
-
if ( ! is_numeric( $id ) || $id < '1' ) wppa_dbg_msg( 'Invalid arg wppa_get_lbtitle( '.$id.' )', 'red' );
|
5737 |
-
|
5738 |
$thumb = wppa_cache_photo( $id );
|
5739 |
$alb = $thumb['album'];
|
5740 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
72 |
global $wppa_gutenberg_preview;
|
73 |
if ( ( wppa_get( 'occur' ) && wppa_get( 'occur' ) == wppa( 'mocc' ) ) && ! wppa( 'is_autopage' ) && ! $wppa_gutenberg_preview ) {
|
74 |
|
|
|
|
|
|
|
75 |
// Test validity of album arg
|
76 |
wppa( 'start_album', wppa_get( 'album' ) );
|
77 |
|
132 |
wppa( 'photos_only', true );
|
133 |
}
|
134 |
|
|
|
|
|
135 |
wppa( 'page', wppa_get( 'wppa-page', '1' ) );
|
136 |
|
137 |
if ( wppa_get( 'superview' ) ) {
|
293 |
return $out;
|
294 |
}
|
295 |
elseif ( wppa( 'is_landing' ) && ! wppa( 'src' ) ) {
|
|
|
296 |
wppa_reset_occurrance();
|
297 |
return ''; // Do nothing on a landing page without a querystring while it is also not a search operation
|
298 |
}
|
302 |
LIMIT 1", wppa_get_the_id() ) );
|
303 |
wppa( 'single_photo', $photo );
|
304 |
if ( ! wppa( 'single_photo' ) ) {
|
|
|
305 |
wppa_reset_occurrance();
|
306 |
return ''; // Give up
|
307 |
}
|
321 |
wppa( 'is_single', true );
|
322 |
break;
|
323 |
default:
|
|
|
324 |
}
|
325 |
}
|
326 |
}
|
394 |
wppa( 'topten_count', $cnt );
|
395 |
wppa( 'is_topten', true );
|
396 |
if ( wppa( 'is_cover' ) ) {
|
|
|
397 |
wppa_reset_occurrance();
|
398 |
return; // Give up this occurence
|
399 |
}
|
415 |
}
|
416 |
|
417 |
if ( wppa( 'is_cover' ) ) {
|
|
|
418 |
wppa_reset_occurrance();
|
419 |
return; // Give up this occurence
|
420 |
}
|
425 |
wppa( 'comten_count', isset( $temp[2] ) ? $temp[2] : wppa_opt( 'comten_count' ) );
|
426 |
wppa( 'is_comten', true );
|
427 |
if ( wppa( 'is_cover' ) ) {
|
|
|
428 |
wppa_reset_occurrance();
|
429 |
return; // Give up this occurence
|
430 |
}
|
435 |
wppa( 'featen_count', isset( $temp[2] ) ? $temp[2] : wppa_opt( 'featen_count' ) );
|
436 |
wppa( 'is_featen', true );
|
437 |
if ( wppa( 'is_cover' ) ) {
|
|
|
438 |
wppa_reset_occurrance();
|
439 |
return; // Give up this occurence
|
440 |
}
|
462 |
// See if they did not use the #cat / #tags combination in wrong sequence order
|
463 |
$seppos = strpos( wppa( 'start_album' ), '|' );
|
464 |
if ( $seppos !== false ) {
|
465 |
+
wppa_out( 'Syntax error in shortcode attribute album=. Expected: album="#cat,...|#tags,...", seen: album="' . wppa( 'start_album' ) . '"' );
|
466 |
wppa_reset_occurrance();
|
467 |
return;
|
468 |
}
|
478 |
|
479 |
// Yes, process the second part, the #tags clause
|
480 |
if ( substr( wppa( 'start_album' ), $seppos, 7 ) != '|#tags,' ) {
|
481 |
+
wppa_out( 'Syntax error in shortcode attribute album=. Expected: album="#cat,...|#tags,...", seen: album="' . wppa( 'start_album' ) . '"' );
|
482 |
wppa_reset_occurrance();
|
483 |
return; // Forget this occurrance
|
484 |
}
|
493 |
wppa( 'is_cat', $cats );
|
494 |
|
495 |
if ( ! $cats ) {
|
496 |
+
wppa_out( 'Missing cat #cat album spec: ' . wppa( 'start_album' ) );
|
497 |
wppa_reset_occurrance();
|
498 |
return; // Forget this occurrance
|
499 |
}
|
580 |
}
|
581 |
}
|
582 |
if ( ! $owner ) {
|
583 |
+
wppa_out( 'Missing owner in #owner album spec: ' . wppa( 'start_album' ) );
|
584 |
wppa_reset_occurrance();
|
585 |
return; // Forget this occurrance
|
586 |
}
|
626 |
}
|
627 |
}
|
628 |
if ( ! $owner ) {
|
629 |
+
wppa_out( 'Missing owner in #upldr album spec: ' . wppa( 'start_album' ) );
|
630 |
wppa_reset_occurrance();
|
631 |
return; // Forget this occurrance
|
632 |
}
|
654 |
$id = '-2';
|
655 |
break;
|
656 |
default:
|
657 |
+
wppa_out( 'Unrecognized album keyword found: ' . wppa( 'start_album' ) );
|
658 |
wppa_reset_occurrance();
|
659 |
return; // Forget this occurrance
|
660 |
}
|
718 |
wppa( 'start_photo', $id );
|
719 |
}
|
720 |
else {
|
721 |
+
wppa_out( 'Photo of the day not found' );
|
722 |
wppa_reset_occurrance();
|
723 |
return; // Forget this occurrance
|
724 |
}
|
741 |
wppa( 'start_photo', $id );
|
742 |
break;
|
743 |
default:
|
744 |
+
wppa_out( 'Unrecognized photo keyword found: ' . wppa( 'single_photo' ) );
|
745 |
wppa_reset_occurrance();
|
746 |
return; // Forget this occurrance
|
747 |
}
|
761 |
wppa( 'single_photo', $id );
|
762 |
}
|
763 |
else {
|
764 |
+
wppa_out( 'Photo name not found: ' . wppa( 'single_photo' ) );
|
765 |
wppa_reset_occurrance();
|
766 |
return; // Forget this occurrance
|
767 |
}
|
856 |
wppa_out( wppa_get_hires_url( wppa( 'single_photo' ) ) );
|
857 |
}
|
858 |
else {
|
859 |
+
wppa_out( sprintf( 'Photo %s not found', wppa( 'single_photo' ) ) );
|
860 |
}
|
861 |
}
|
862 |
// Is is a stereo settings box?
|
929 |
}
|
930 |
// The normal case
|
931 |
else {
|
932 |
+
if ( wppa( 'is_autopage' ) ) wppa_auto_page_links( 'top' );
|
933 |
+
wppa_theme(); // Call the theme module
|
934 |
+
if ( wppa( 'is_autopage' ) ) wppa_auto_page_links( 'bottom' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
935 |
}
|
936 |
|
937 |
+
// Insert geo data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
938 |
$out = str_replace( 'w#location', wppa( 'geo' ), wppa( 'out' ) );
|
939 |
|
940 |
// Cache?
|
942 |
wppa_save_cache_file( ['file' => $cache_file, 'data' => $out] );
|
943 |
}
|
944 |
|
945 |
+
// Reset timer and occurrance
|
946 |
$timer = wppa_occur_timer( 'show', $_SERVER['REQUEST_URI'] . ' oc ' . wppa( 'mocc' ) );
|
947 |
wppa_reset_occurrance();
|
948 |
|
949 |
+
// Return our valuable ouput
|
950 |
return $out . $timer;
|
951 |
}
|
952 |
|
953 |
+
// Convert album name ti id
|
954 |
function wppa_album_name_to_number( $xalb, $return_dups = false ) {
|
955 |
|
956 |
// Sanitize
|
974 |
|
975 |
// Handle exceptions
|
976 |
elseif ( $id < '0' ) {
|
977 |
+
wppa_out( 'Duplicate album names found: '.$xalb );
|
978 |
wppa_reset_occurrance();
|
979 |
return false; // Forget this occurrance
|
980 |
}
|
981 |
else {
|
982 |
+
wppa_out( 'Album name not found: '.$xalb );
|
983 |
wppa_reset_occurrance();
|
984 |
return false; // Forget this occurrance
|
985 |
}
|
1150 |
if ( ! wppa_is_ancestor( $root, $albums[$idx]['id'] ) ) unset ( $albums[$idx] );
|
1151 |
}
|
1152 |
$c2=count( $albums );
|
|
|
1153 |
}
|
1154 |
}
|
1155 |
|
1215 |
$q = "SELECT * FROM $wpdb->wppa_albums
|
1216 |
WHERE a_parent = " . implode( " OR a_parent = ", $ids ) . " " . wppa_get_album_order();
|
1217 |
}
|
|
|
1218 |
$albums = $wpdb->get_results( $q, ARRAY_A );
|
1219 |
}
|
1220 |
else $albums = false;
|
1221 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1222 |
|
1223 |
// Check for album status
|
1224 |
$albums = wppa_strip_void_albums( $albums );
|
1225 |
+
|
1226 |
// Copy data into secondary cache
|
1227 |
if ( $albums ) {
|
1228 |
wppa_cache_album( 'add', $albums );
|
1245 |
|
1246 |
// A cover -> no thumbs
|
1247 |
if ( wppa( 'is_cover' ) ) {
|
|
|
1248 |
return false;
|
1249 |
}
|
1250 |
|
1251 |
// Albums only -> no thumbs
|
1252 |
if ( wppa( 'albums_only' ) ) {
|
|
|
1253 |
return false;
|
1254 |
}
|
1255 |
|
1486 |
wppa( 'any', ! empty ( $thumbs ) );
|
1487 |
wppa( 'thumb_count', empty( $thumbs ) ? '0' : count( $thumbs ) );
|
1488 |
$time += microtime( true );
|
1489 |
+
|
|
|
|
|
|
|
1490 |
return $thumbs;
|
1491 |
}
|
1492 |
|
1928 |
if ( strpos( wppa( 'start_album' ), '.' ) !== false ) $allalb = wppa_series_to_array( wppa( 'start_album' ) );
|
1929 |
else $allalb = false;
|
1930 |
|
|
|
|
|
1931 |
// All albums ?
|
1932 |
if ( wppa( 'start_album' ) == -2 ) {
|
1933 |
|
2142 |
if ( ! $query ) {
|
2143 |
wppa( 'thumb_count', '0' );
|
2144 |
wppa( 'any', false );
|
|
|
2145 |
return false;
|
2146 |
}
|
2147 |
|
2209 |
if ( strlen( $query ) > 25000 ) {
|
2210 |
wppa_log( 'war', 'Long query: ' . strlen($query) . ' chars. ' . substr( htmlspecialchars( $query ), 0, 100 ) . '...' , true );
|
2211 |
}
|
2212 |
+
|
2213 |
// Remove items because of status album
|
2214 |
$thumbs = wppa_strip_void_photos( $thumbs );
|
2215 |
+
|
|
|
2216 |
// Process extended duplicate removal
|
2217 |
if ( $exduprem ) {
|
2218 |
wppa_extended_duplicate_remove( $thumbs );
|
2221 |
// Postprocess
|
2222 |
wppa( 'thumb_count', $count );
|
2223 |
$time += microtime( true );
|
2224 |
+
|
|
|
|
|
|
|
|
|
2225 |
if ( $caching ) {
|
2226 |
wppa_cache_photo( 'add', $thumbs );
|
2227 |
}
|
2741 |
}
|
2742 |
$choice = wppa_opt( 'admins_choice' );
|
2743 |
if ( current_user_can( 'wppa_admin' ) || wppa_opt( 'admins_choice_action' ) != 'album' ) {
|
2744 |
+
if ( ( wppa_user_is_admin() && $choice != 'none' ) ||
|
2745 |
( is_user_logged_in() && $choice == 'login' ) ) {
|
2746 |
|
2747 |
if ( wppa_is_photo_in_zip( $thumb['id'] ) ) {
|
3566 |
$area = wppa_get_box_width() + $tfw; // Area for n+1 thumbs
|
3567 |
$n_1 = floor( $area / ( $tfw + $mgl ) );
|
3568 |
if ( $n_1 == '0' ) {
|
3569 |
+
if ( ! $wppaerrmsgxxx ) wppa_out( 'Misconfig. thumbnail area too small. Areasize = '.wppa_get_box_width().' tfwidth = '.$tfw.' marg= '.$mgl );
|
3570 |
$n_1 = '1';
|
3571 |
$wppaerrmsgxxx = true; // err msg given
|
3572 |
}
|
3720 |
|
3721 |
function wppa_container( $action ) {
|
3722 |
global $wppa_version; // The theme version ( wppa_theme.php )
|
|
|
|
|
|
|
|
|
3723 |
static $auto;
|
3724 |
global $blog_id;
|
3725 |
|
3734 |
// Open request?
|
3735 |
if ( $action == 'open' ) {
|
3736 |
|
|
|
|
|
3737 |
// Open the container
|
3738 |
if ( ! defined( 'DOING_WPPA_AJAX' ) ) {
|
3739 |
|
3771 |
) ) );
|
3772 |
}
|
3773 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3774 |
// Nonce field check for rating security
|
3775 |
if ( wppa( 'mocc' ) == '1' ) {
|
3776 |
if ( wppa_get( 'rating' ) ) {
|
3777 |
$nonce = wppa_get( 'nonce' );
|
3778 |
$ok = wp_verify_nonce( $nonce, 'wppa-check' );
|
3779 |
+
if ( ! $ok ) {
|
3780 |
+
wp_die( '<b>' . __( 'ERROR: Illegal attempt to enter a rating.', 'wp-photo-album-plus' ) . '</b>' );
|
3781 |
}
|
|
|
3782 |
}
|
3783 |
}
|
3784 |
|
3787 |
if ( wppa_get( 'comment' ) ) {
|
3788 |
$nonce = wppa_get( 'nonce' );
|
3789 |
$ok = wp_verify_nonce( $nonce, 'wppa-check' );
|
3790 |
+
if ( ! $ok ) {
|
3791 |
+
wp_die( '<b>' . __( 'ERROR: Illegal attempt to enter a comment.', 'wp-photo-album-plus' ) . '</b>' );
|
3792 |
}
|
|
|
3793 |
}
|
3794 |
}
|
3795 |
|
3964 |
// Static max in responsive? close wrapper
|
3965 |
wppa_container_wrapper( 'close' );
|
3966 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3967 |
}
|
3968 |
|
3969 |
// Unimplemented request
|
3994 |
wppa_out( '</div>' );
|
3995 |
break;
|
3996 |
default:
|
|
|
3997 |
}
|
3998 |
}
|
3999 |
|
4124 |
function wppa_run_slidecontainer( $thumbs ) {
|
4125 |
|
4126 |
$c = is_array( $thumbs ) ? count( $thumbs ) : '0';
|
|
|
4127 |
|
4128 |
if ( wppa( 'is_single' ) && is_feed() ) { // process feed for single image slideshow here, normal slideshow uses filmthumbs
|
4129 |
$style_a = wppa_get_fullimgstyle_a( wppa( 'start_photo' ) );
|
4351 |
$result = '';
|
4352 |
break;
|
4353 |
default:
|
|
|
4354 |
}
|
4355 |
}
|
4356 |
else {
|
4368 |
$result = '';
|
4369 |
break;
|
4370 |
default:
|
|
|
4371 |
}
|
4372 |
}
|
4373 |
}
|
|
|
4374 |
}
|
4375 |
return $result;
|
4376 |
}
|
4769 |
|
4770 |
if ( $albs ) {
|
4771 |
if ( count( $albs ) == 1 ) {
|
|
|
4772 |
$aid = $albs[0]['id'];
|
4773 |
}
|
4774 |
else {
|
|
|
4775 |
if ( $report_dups == 'report_dups' ) {
|
4776 |
$aid = false;
|
4777 |
}
|
4791 |
$aname = str_replace( '\'', '%', $aname ); // A trick for single quotes
|
4792 |
$aname = str_replace( '"', '%', $aname ); // A trick for double quotes
|
4793 |
$aname = stripslashes( $aname );
|
|
|
4794 |
if ( strcasecmp( $aname, $name ) == 0 ) {
|
4795 |
$aid = $alb['id'];
|
4796 |
}
|
4807 |
$aid = false;
|
4808 |
}
|
4809 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4810 |
return $aid;
|
4811 |
}
|
4812 |
|
4818 |
global $wppa_alert;
|
4819 |
global $wppa_upload_succes_id;
|
4820 |
|
|
|
|
|
4821 |
if ( $done ) return; // Already done
|
4822 |
$done = true; // Mark as done
|
4823 |
$wppa_alert = '';
|
4833 |
|
4834 |
// Find the parent
|
4835 |
$parent = strval( intval( wppa_get( 'album-parent' ) ) );
|
4836 |
+
if ( ! wppa_user_is_admin() && wppa_switch( 'default_parent_always' ) ) {
|
4837 |
$parent = wppa_opt( 'default_parent' );
|
4838 |
}
|
4839 |
|
4840 |
// If roles specified and i am not an admin, see if i have one
|
4841 |
+
if ( wppa_opt( 'user_create_roles' ) && ! wppa_user_is_admin() ) {
|
4842 |
|
4843 |
// Allowed roles
|
4844 |
$allowed_roles = explode( ',', wppa_opt( 'user_create_roles' ) );
|
5635 |
// Get the title to be used for lightbox links == text under the lightbox image
|
5636 |
function wppa_get_lbtitle( $type, $id ) {
|
5637 |
|
|
|
|
|
5638 |
$thumb = wppa_cache_photo( $id );
|
5639 |
$alb = $thumb['album'];
|
5640 |
|
wppa-gutenberg-wppa.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-gutenberg-wppa.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
-
* Version 8.
|
6 |
*/
|
7 |
|
8 |
function wppa_gutenberg_wppa_block() {
|
@@ -65,7 +65,7 @@ global $wpdb;
|
|
65 |
|
66 |
$admins = array();
|
67 |
|
68 |
-
if (
|
69 |
$admins = get_users( array( 'role' => 'administrator' ) );
|
70 |
}
|
71 |
|
2 |
/* wppa-gutenberg-wppa.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
+
* Version 8.2.05.001
|
6 |
*/
|
7 |
|
8 |
function wppa_gutenberg_wppa_block() {
|
65 |
|
66 |
$admins = array();
|
67 |
|
68 |
+
if ( wppa_user_is_admin() ) {
|
69 |
$admins = get_users( array( 'role' => 'administrator' ) );
|
70 |
}
|
71 |
|
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.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -251,12 +251,12 @@ global $wppa_session;
|
|
251 |
wppa_echo( '
|
252 |
<form
|
253 |
id="wppa-import-form"
|
254 |
-
action="' .
|
255 |
method="post"
|
256 |
>' );
|
257 |
|
258 |
// Admin and superuser can change import source, other users only if change source not is restricted
|
259 |
-
if (
|
260 |
|
261 |
// Local / Remote
|
262 |
wppa_echo( '
|
@@ -364,7 +364,7 @@ global $wppa_session;
|
|
364 |
|
365 |
// check if albums exist or will be made before allowing upload
|
366 |
if ( ! wppa_has_albums() && ! $albumcount && ! $dircount && ! $csvcount ) {
|
367 |
-
$url =
|
368 |
wppa_echo( '
|
369 |
<p>' .
|
370 |
__( 'No albums exist. You must', 'wp-photo-album-plus' ) . '
|
@@ -382,7 +382,7 @@ global $wppa_session;
|
|
382 |
// Open the form
|
383 |
wppa_echo( '
|
384 |
<form
|
385 |
-
action="' .
|
386 |
method="post"
|
387 |
>' .
|
388 |
wp_nonce_field( '$wppa_nonce', WPPA_NONCE, true, false ) );
|
@@ -1919,7 +1919,7 @@ global $wppa_session;
|
|
1919 |
}
|
1920 |
|
1921 |
// Report starting process
|
1922 |
-
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="'.
|
1923 |
|
1924 |
// Do them all
|
1925 |
foreach ( array_keys( $files ) as $file_idx ) {
|
@@ -2438,8 +2438,6 @@ global $wppa_session;
|
|
2438 |
$id = trim( current( $data_arr ) );
|
2439 |
if ( wppa_is_int( $id ) && $id > '0' ) {
|
2440 |
|
2441 |
-
wppa_dbg_msg( 'Processing id '.$id );
|
2442 |
-
|
2443 |
$existing_data = $wpdb->get_row( "SELECT * FROM " . $is_db_table . " WHERE id = $id", ARRAY_A );
|
2444 |
|
2445 |
// If entry exists:
|
@@ -3151,7 +3149,6 @@ global $wppa_session;
|
|
3151 |
}
|
3152 |
}
|
3153 |
else {
|
3154 |
-
wppa_dbg_msg( 'Invalid file in wppa_import_dir_to_album(): '.$file );
|
3155 |
return false;
|
3156 |
}
|
3157 |
return true;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the import pages and functions
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
251 |
wppa_echo( '
|
252 |
<form
|
253 |
id="wppa-import-form"
|
254 |
+
action="' . get_admin_url() . 'admin.php?page=wppa_import_photos"
|
255 |
method="post"
|
256 |
>' );
|
257 |
|
258 |
// Admin and superuser can change import source, other users only if change source not is restricted
|
259 |
+
if ( wppa_user_is_admin() || ! wppa_switch( 'chgsrc_is_restricted' ) ) {
|
260 |
|
261 |
// Local / Remote
|
262 |
wppa_echo( '
|
364 |
|
365 |
// check if albums exist or will be made before allowing upload
|
366 |
if ( ! wppa_has_albums() && ! $albumcount && ! $dircount && ! $csvcount ) {
|
367 |
+
$url = get_admin_url() . 'admin.php?page=wppa_admin_menu';
|
368 |
wppa_echo( '
|
369 |
<p>' .
|
370 |
__( 'No albums exist. You must', 'wp-photo-album-plus' ) . '
|
382 |
// Open the form
|
383 |
wppa_echo( '
|
384 |
<form
|
385 |
+
action="' . get_admin_url() . 'admin.php?page=wppa_import_photos"
|
386 |
method="post"
|
387 |
>' .
|
388 |
wp_nonce_field( '$wppa_nonce', WPPA_NONCE, true, false ) );
|
1919 |
}
|
1920 |
|
1921 |
// Report starting process
|
1922 |
+
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="'. get_admin_url().'admin.php?page=wppa_import_photos">'.__( 'here.', 'wp-photo-album-plus' ).'</a>' );
|
1923 |
|
1924 |
// Do them all
|
1925 |
foreach ( array_keys( $files ) as $file_idx ) {
|
2438 |
$id = trim( current( $data_arr ) );
|
2439 |
if ( wppa_is_int( $id ) && $id > '0' ) {
|
2440 |
|
|
|
|
|
2441 |
$existing_data = $wpdb->get_row( "SELECT * FROM " . $is_db_table . " WHERE id = $id", ARRAY_A );
|
2442 |
|
2443 |
// If entry exists:
|
3149 |
}
|
3150 |
}
|
3151 |
else {
|
|
|
3152 |
return false;
|
3153 |
}
|
3154 |
return true;
|
wppa-index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all indexing functions
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*
|
9 |
*/
|
@@ -462,7 +462,6 @@ global $wpdb;
|
|
462 |
}
|
463 |
}
|
464 |
}
|
465 |
-
else wppa_dbg_msg('Error, unimplemented type in wppa_index_remove().', 'red', 'force');
|
466 |
|
467 |
$wpdb->query( "DELETE FROM $wpdb->wppa_index WHERE albums = '' AND photos = ''" ); // Cleanup empty entries
|
468 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all indexing functions
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*
|
9 |
*/
|
462 |
}
|
463 |
}
|
464 |
}
|
|
|
465 |
|
466 |
$wpdb->query( "DELETE FROM $wpdb->wppa_index WHERE albums = '' AND photos = ''" ); // Cleanup empty entries
|
467 |
}
|
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.2.
|
8 |
*/
|
9 |
|
10 |
/* LOAD SIDEBAR WIDGETS */
|
@@ -125,10 +125,7 @@ global $locale;
|
|
125 |
$wppa_lang = substr( $wppa_locale, 0, 2 );
|
126 |
}
|
127 |
|
128 |
-
|
129 |
-
// if ( $wp_version < '4.6' || is_file( dirname( __FILE__ ) . '/languages/wp-photo-album-plus-' . $wppa_locale . '.mo' ) ) {
|
130 |
-
load_plugin_textdomain( 'wp-photo-album-plus', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
|
131 |
-
// }
|
132 |
}
|
133 |
|
134 |
// Compute all non-trivial constants and create required directories
|
@@ -386,7 +383,7 @@ global $wpdb;
|
|
386 |
// Check upload logout for moderate
|
387 |
function wppa_check_upload_logout() {
|
388 |
|
389 |
-
if ( wppa_switch( 'upload_logout' ) && ! wppa_switch( 'upload_moderate' ) &&
|
390 |
$text = __( 'Warning: Non logged in users can upload photos while uploads do not need to be moderated. This can lead to unwanted content on this website!', 'wp-photo-album-plus' ) .
|
391 |
'<br>' . wppa_see_also( 'users', '1', '32' ) . ' ' . __( 'and', 'wp-photo-album-plus' ) . ' ' . wppa_see_also( 'admin', '2', '12' );
|
392 |
wppa_warning_message( $text );
|
@@ -573,15 +570,6 @@ function wppa_fix_aioseo() {
|
|
573 |
global $wppa;
|
574 |
|
575 |
if ( $wppa['mocc'] ) {
|
576 |
-
// wppa_log( 'obs', 'AIOSEO tampered mocc to ' . $wppa['mocc'] );
|
577 |
-
$wppa['mocc'] = '0';
|
578 |
-
}
|
579 |
-
if ( $wppa['mocc'] ) {
|
580 |
-
// wppa_log( 'obs', 'AIOSEO tampered occur to ' . $wppa['mocc'] );
|
581 |
-
$wppa['mocc'] = '0';
|
582 |
-
}
|
583 |
-
if ( $wppa['mocc'] ) {
|
584 |
-
// wppa_log( 'obs', 'AIOSEO tampered widget_occur to ' . $wppa['mocc'] );
|
585 |
$wppa['mocc'] = '0';
|
586 |
}
|
587 |
}
|
4 |
*
|
5 |
* This file loads required php files and contains all functions used in init actions.
|
6 |
*
|
7 |
+
* Version 8.2.05.001
|
8 |
*/
|
9 |
|
10 |
/* LOAD SIDEBAR WIDGETS */
|
125 |
$wppa_lang = substr( $wppa_locale, 0, 2 );
|
126 |
}
|
127 |
|
128 |
+
$bret = load_plugin_textdomain( 'wp-photo-album-plus', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
|
|
|
|
|
|
129 |
}
|
130 |
|
131 |
// Compute all non-trivial constants and create required directories
|
383 |
// Check upload logout for moderate
|
384 |
function wppa_check_upload_logout() {
|
385 |
|
386 |
+
if ( wppa_switch( 'upload_logout' ) && ! wppa_switch( 'upload_moderate' ) && wppa_user_is_admin() ) {
|
387 |
$text = __( 'Warning: Non logged in users can upload photos while uploads do not need to be moderated. This can lead to unwanted content on this website!', 'wp-photo-album-plus' ) .
|
388 |
'<br>' . wppa_see_also( 'users', '1', '32' ) . ' ' . __( 'and', 'wp-photo-album-plus' ) . ' ' . wppa_see_also( 'admin', '2', '12' );
|
389 |
wppa_warning_message( $text );
|
570 |
global $wppa;
|
571 |
|
572 |
if ( $wppa['mocc'] ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
573 |
$wppa['mocc'] = '0';
|
574 |
}
|
575 |
}
|
wppa-input.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions for sanitizing and formatting user input
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -473,6 +473,5 @@ function wppa_get_cookie( $name, $default = '' ) {
|
|
473 |
$result = $default;
|
474 |
}
|
475 |
|
476 |
-
// wppa_log('obs', 'Cookie '.$name.' value '.$result);
|
477 |
return $result;
|
478 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions for sanitizing and formatting user input
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
473 |
$result = $default;
|
474 |
}
|
475 |
|
|
|
476 |
return $result;
|
477 |
}
|
wppa-items.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions to retrieve album and photo items
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -37,8 +37,6 @@ static $cache;
|
|
37 |
$cache[$album['id']] = $album;
|
38 |
}
|
39 |
}
|
40 |
-
|
41 |
-
// wppa_log('obs', 'Count in album cache is now '.count($cache));
|
42 |
}
|
43 |
|
44 |
// Action?
|
@@ -46,7 +44,6 @@ static $cache;
|
|
46 |
if ( $data ) {
|
47 |
if ( isset( $cache[$data] ) ) {
|
48 |
unset( $cache[$data] );
|
49 |
-
// wppa_log('obs', "Cache invalidate in wppa_cache_album $data");
|
50 |
}
|
51 |
return false;
|
52 |
}
|
@@ -91,7 +88,6 @@ static $cache;
|
|
91 |
return $cache[$id];
|
92 |
}
|
93 |
else {
|
94 |
-
// wppa_log( 'dbg', 'Album '.$id.' does not exist (cache album)', true );
|
95 |
return false;
|
96 |
}
|
97 |
}
|
@@ -124,7 +120,6 @@ static $cache;
|
|
124 |
$cache[$photo['id']] = $photo;
|
125 |
}
|
126 |
}
|
127 |
-
// wppa_log('obs', 'Count in photo cache is now '.count($cache));
|
128 |
}
|
129 |
|
130 |
// Invalidate ?
|
@@ -132,7 +127,6 @@ static $cache;
|
|
132 |
if ( $data ) {
|
133 |
if ( isset( $cache[$data] ) ) {
|
134 |
unset( $cache[$data] );
|
135 |
-
// wppa_log('obs', "Cache invalidate in wppa_cache_photo $data");
|
136 |
}
|
137 |
return false;
|
138 |
}
|
@@ -167,9 +161,6 @@ static $cache;
|
|
167 |
// In cache?
|
168 |
if ( isset( $cache[$id] ) ) {
|
169 |
wppa( 'current_photo', $cache[$id] );
|
170 |
-
// $stack = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 4 );
|
171 |
-
// $f = $stack[1]['function'] . ' - ' . $stack[2]['function'] . ' - ' . $stack[3]['function'];
|
172 |
-
// wppa_log('obs', "Cache hit in wppa_cache_photo $id from $f");
|
173 |
return $cache[$id];
|
174 |
}
|
175 |
|
@@ -177,15 +168,11 @@ static $cache;
|
|
177 |
$cache[$id] = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos WHERE id = %s", $id ), ARRAY_A );
|
178 |
if ( $cache[$id] ) {
|
179 |
wppa( 'current_photo', $cache[$id] );
|
180 |
-
// $stack = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 4 );
|
181 |
-
// $f = $stack[1]['function'] . ' - ' . $stack[2]['function'] . ' - ' . $stack[3]['function'];
|
182 |
-
// wppa_log('obs', "Cache miss in wppa_cache_photo $id from $f");
|
183 |
return $cache[$id];
|
184 |
}
|
185 |
else {
|
186 |
unset( $cache[$id] );
|
187 |
wppa( 'current_photo', false );
|
188 |
-
// wppa_log( 'war', 'Photo '.$id.' does not exist (wppa_cache_photo)' );
|
189 |
return false;
|
190 |
}
|
191 |
}
|
@@ -1024,13 +1011,11 @@ static $cache;
|
|
1024 |
foreach( $albs as $alb ) {
|
1025 |
if ( _wppa_is_item_displayable( $alb, $item, $default_slug ) ) {
|
1026 |
$cache[$xalb . $item . $default_slug] = true;
|
1027 |
-
// wppa_log( 'obs', "Function called: wppa_is_item_displayable( $xalb, $item, $default_slug ) returned true" );
|
1028 |
return true;
|
1029 |
}
|
1030 |
}
|
1031 |
}
|
1032 |
$cache[$xalb . $item . $default_slug] = false;
|
1033 |
-
// wppa_log( 'obs', "Function called: wppa_is_item_displayable( $xalb, $item, $default_slug ) returned false" );
|
1034 |
return false;
|
1035 |
}
|
1036 |
function _wppa_is_item_displayable( $alb, $item, $default_slug ) {
|
@@ -1066,7 +1051,7 @@ function _wppa_is_item_displayable( $alb, $item, $default_slug ) {
|
|
1066 |
}
|
1067 |
}
|
1068 |
|
1069 |
-
//
|
1070 |
$indexes = array( 'name' => 0, 'description' => 1, 'rating' => 2, 'comments' => 3 );
|
1071 |
|
1072 |
// $opts[$indexes[item]] can have 3 values: -1 = no, 0 = use default, 1 = yes
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions to retrieve album and photo items
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
37 |
$cache[$album['id']] = $album;
|
38 |
}
|
39 |
}
|
|
|
|
|
40 |
}
|
41 |
|
42 |
// Action?
|
44 |
if ( $data ) {
|
45 |
if ( isset( $cache[$data] ) ) {
|
46 |
unset( $cache[$data] );
|
|
|
47 |
}
|
48 |
return false;
|
49 |
}
|
88 |
return $cache[$id];
|
89 |
}
|
90 |
else {
|
|
|
91 |
return false;
|
92 |
}
|
93 |
}
|
120 |
$cache[$photo['id']] = $photo;
|
121 |
}
|
122 |
}
|
|
|
123 |
}
|
124 |
|
125 |
// Invalidate ?
|
127 |
if ( $data ) {
|
128 |
if ( isset( $cache[$data] ) ) {
|
129 |
unset( $cache[$data] );
|
|
|
130 |
}
|
131 |
return false;
|
132 |
}
|
161 |
// In cache?
|
162 |
if ( isset( $cache[$id] ) ) {
|
163 |
wppa( 'current_photo', $cache[$id] );
|
|
|
|
|
|
|
164 |
return $cache[$id];
|
165 |
}
|
166 |
|
168 |
$cache[$id] = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos WHERE id = %s", $id ), ARRAY_A );
|
169 |
if ( $cache[$id] ) {
|
170 |
wppa( 'current_photo', $cache[$id] );
|
|
|
|
|
|
|
171 |
return $cache[$id];
|
172 |
}
|
173 |
else {
|
174 |
unset( $cache[$id] );
|
175 |
wppa( 'current_photo', false );
|
|
|
176 |
return false;
|
177 |
}
|
178 |
}
|
1011 |
foreach( $albs as $alb ) {
|
1012 |
if ( _wppa_is_item_displayable( $alb, $item, $default_slug ) ) {
|
1013 |
$cache[$xalb . $item . $default_slug] = true;
|
|
|
1014 |
return true;
|
1015 |
}
|
1016 |
}
|
1017 |
}
|
1018 |
$cache[$xalb . $item . $default_slug] = false;
|
|
|
1019 |
return false;
|
1020 |
}
|
1021 |
function _wppa_is_item_displayable( $alb, $item, $default_slug ) {
|
1051 |
}
|
1052 |
}
|
1053 |
|
1054 |
+
// Translate itemname to index in $opts array
|
1055 |
$indexes = array( 'name' => 0, 'description' => 1, 'rating' => 2, 'comments' => 3 );
|
1056 |
|
1057 |
// $opts[$indexes[item]] can have 3 values: -1 = no, 0 = use default, 1 = yes
|
wppa-links.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Frontend links
|
6 |
-
|
7 |
-
* Version 8.2.
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
@@ -72,11 +72,9 @@ global $wppa_locale;
|
|
72 |
}
|
73 |
break;
|
74 |
default: // pagelink
|
75 |
-
$pl = $key ? get_permalink($key) : get_permalink();
|
76 |
-
// if ( $key == '-1' ) wppa_log('obs', 'Key='.$key, true);
|
77 |
-
// else wppa_log('obs', 'Key='.$key);
|
78 |
if ( $plain ) return $pl;
|
79 |
-
if (strpos($pl, '?')) $pl .= '&';
|
80 |
else $pl .= '?';
|
81 |
break;
|
82 |
}
|
@@ -206,7 +204,9 @@ global $wppa_runtime_settings;
|
|
206 |
// get page url of current album image
|
207 |
function wppa_get_image_page_url_by_id( $id, $single = false, $alb = false, $page = null ) {
|
208 |
|
209 |
-
if ( !
|
|
|
|
|
210 |
|
211 |
$thumb = wppa_cache_photo( $id );
|
212 |
|
@@ -228,7 +228,9 @@ function wppa_get_image_page_url_by_id( $id, $single = false, $alb = false, $pag
|
|
228 |
// get page url of current album image, ajax version
|
229 |
function wppa_get_image_url_ajax_by_id($id) {
|
230 |
|
231 |
-
if ( !
|
|
|
|
|
232 |
|
233 |
$thumb = wppa_cache_photo( $id );
|
234 |
|
@@ -718,8 +720,6 @@ function wppa_numbers_to_names_in_uri( $xuri ) {
|
|
718 |
function wppa_convert_item_number_to_name_in_uri( $xuri, $what ) {
|
719 |
global $wpdb;
|
720 |
|
721 |
-
// wppa_dbg_msg($xuri);
|
722 |
-
|
723 |
$uri = $xuri;
|
724 |
|
725 |
// Init $what specific
|
@@ -813,9 +813,6 @@ global $wpdb;
|
|
813 |
// All ok, do it
|
814 |
$uri = $before . $sname . $after;
|
815 |
}
|
816 |
-
else {
|
817 |
-
// wppa_log( 'obs', 'Uri conversion skipped due to not unique name ' . $sname );
|
818 |
-
}
|
819 |
}
|
820 |
|
821 |
return $uri;
|
@@ -827,7 +824,7 @@ function wppa_moderate_links( $type, $id, $comid = '' ) {
|
|
827 |
$thumb = wppa_cache_photo( $id );
|
828 |
$result = '';
|
829 |
|
830 |
-
if (
|
831 |
switch ( $type ) {
|
832 |
case 'thumb':
|
833 |
$app = __('App', 'wp-photo-album-plus' );
|
@@ -1316,7 +1313,7 @@ global $previous_page_last_id;
|
|
1316 |
function wppa_album_download_link( $albumid ) {
|
1317 |
|
1318 |
if ( ! wppa_switch( 'allow_download_album' ) ) return; // Not enabled
|
1319 |
-
if ( wppa_switch( 'download_album_is_restricted' ) && !
|
1320 |
|
1321 |
$mocc = wppa( 'mocc' );
|
1322 |
|
@@ -1926,7 +1923,7 @@ global $wpdb;
|
|
1926 |
break;
|
1927 |
case 'autopage':
|
1928 |
if ( ! wppa_switch( 'auto_page' ) ) {
|
1929 |
-
|
1930 |
$result['url'] = '';
|
1931 |
}
|
1932 |
else {
|
@@ -1944,7 +1941,7 @@ global $wpdb;
|
|
1944 |
return $result;
|
1945 |
break;
|
1946 |
default:
|
1947 |
-
|
1948 |
return false;
|
1949 |
break;
|
1950 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Frontend links
|
6 |
+
*
|
7 |
+
* Version 8.2.05.001
|
8 |
*/
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
72 |
}
|
73 |
break;
|
74 |
default: // pagelink
|
75 |
+
$pl = $key > '0' ? get_permalink( $key ) : get_permalink();
|
|
|
|
|
76 |
if ( $plain ) return $pl;
|
77 |
+
if ( strpos( $pl, '?' ) ) $pl .= '&';
|
78 |
else $pl .= '?';
|
79 |
break;
|
80 |
}
|
204 |
// get page url of current album image
|
205 |
function wppa_get_image_page_url_by_id( $id, $single = false, $alb = false, $page = null ) {
|
206 |
|
207 |
+
if ( ! wppa_is_int( $id ) || $id < '1' ) {
|
208 |
+
return '';
|
209 |
+
}
|
210 |
|
211 |
$thumb = wppa_cache_photo( $id );
|
212 |
|
228 |
// get page url of current album image, ajax version
|
229 |
function wppa_get_image_url_ajax_by_id($id) {
|
230 |
|
231 |
+
if ( ! wppa_is_int($id) || $id < '1' ) {
|
232 |
+
return '';
|
233 |
+
}
|
234 |
|
235 |
$thumb = wppa_cache_photo( $id );
|
236 |
|
720 |
function wppa_convert_item_number_to_name_in_uri( $xuri, $what ) {
|
721 |
global $wpdb;
|
722 |
|
|
|
|
|
723 |
$uri = $xuri;
|
724 |
|
725 |
// Init $what specific
|
813 |
// All ok, do it
|
814 |
$uri = $before . $sname . $after;
|
815 |
}
|
|
|
|
|
|
|
816 |
}
|
817 |
|
818 |
return $uri;
|
824 |
$thumb = wppa_cache_photo( $id );
|
825 |
$result = '';
|
826 |
|
827 |
+
if ( wppa_user_is_admin() || current_user_can('wppa_moderate') || ( current_user_can('wppa_comments') && $type == 'comment' ) ) {
|
828 |
switch ( $type ) {
|
829 |
case 'thumb':
|
830 |
$app = __('App', 'wp-photo-album-plus' );
|
1313 |
function wppa_album_download_link( $albumid ) {
|
1314 |
|
1315 |
if ( ! wppa_switch( 'allow_download_album' ) ) return; // Not enabled
|
1316 |
+
if ( wppa_switch( 'download_album_is_restricted' ) && ! wppa_user_is_admin() ) return; // restricted to admin
|
1317 |
|
1318 |
$mocc = wppa( 'mocc' );
|
1319 |
|
1923 |
break;
|
1924 |
case 'autopage':
|
1925 |
if ( ! wppa_switch( 'auto_page' ) ) {
|
1926 |
+
wppa_log('err', 'Auto page has been switched off, but there are still links to it (' . $wich . ')' );
|
1927 |
$result['url'] = '';
|
1928 |
}
|
1929 |
else {
|
1941 |
return $result;
|
1942 |
break;
|
1943 |
default:
|
1944 |
+
wppa_log( 'Err', 'Wrong type: ' . $type . ' in wppa_get_imglink_a' );
|
1945 |
return false;
|
1946 |
break;
|
1947 |
}
|
wppa-mailing.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Contains mailing functions
|
6 |
*
|
7 |
-
* Version 8.2.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -29,7 +29,7 @@ function wppa_schedule_mailinglist( $type, $alb = 0, $pho = 0, $com = 0, $url =
|
|
29 |
$log_args = " Args: $alb, $pho, $com, $url, $start.";
|
30 |
|
31 |
// If user is an admin and void_admin is active, do nothing
|
32 |
-
if (
|
33 |
if ( in_array( $type, array( 'newalbumnotify', 'feuploadnotify', 'commentnotify' ) ) ) {
|
34 |
wppa_log( 'Eml', "Admin email $type skipped." );
|
35 |
return;
|
4 |
*
|
5 |
* Contains mailing functions
|
6 |
*
|
7 |
+
* Version 8.2.05.001
|
8 |
*
|
9 |
*/
|
10 |
|
29 |
$log_args = " Args: $alb, $pho, $com, $url, $start.";
|
30 |
|
31 |
// If user is an admin and void_admin is active, do nothing
|
32 |
+
if ( wppa_user_is_admin() && wppa_switch( 'void_admin_email' ) ) {
|
33 |
if ( in_array( $type, array( 'newalbumnotify', 'feuploadnotify', 'commentnotify' ) ) ) {
|
34 |
wppa_log( 'Eml', "Admin email $type skipped." );
|
35 |
return;
|
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.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1248,7 +1248,6 @@ global $wpdb;
|
|
1248 |
update_option( $slug.'_status', 'Working' );
|
1249 |
}
|
1250 |
}
|
1251 |
-
// wppa_log( 'obs', "Maint did $lastid for $slug" );
|
1252 |
}
|
1253 |
|
1254 |
function wppa_do_maintenance_popup( $slug ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains (not yet, but in the future maybe) all the maintenance routines
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
1248 |
update_option( $slug.'_status', 'Working' );
|
1249 |
}
|
1250 |
}
|
|
|
1251 |
}
|
1252 |
|
1253 |
function wppa_do_maintenance_popup( $slug ) {
|
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.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -47,14 +47,14 @@ global $wppa_api_version;
|
|
47 |
}
|
48 |
|
49 |
// Use standard
|
50 |
-
$style_file = dirname( __FILE__ ) . '/
|
51 |
if ( wppa_is_file( $style_file ) ) {
|
52 |
$ver = date( "ymd-Gis", filemtime( $style_file ) );
|
53 |
}
|
54 |
else {
|
55 |
$ver = $wppa_api_version;
|
56 |
}
|
57 |
-
wp_register_style('wppa_style', WPPA_URL.'/
|
58 |
wp_enqueue_style('wppa_style');
|
59 |
|
60 |
$the_css = wppa_create_wppa_dynamic_css();
|
@@ -238,7 +238,7 @@ function wppa_load_theme() {
|
|
238 |
return;
|
239 |
}
|
240 |
}
|
241 |
-
require_once '
|
242 |
}
|
243 |
|
244 |
/* LOAD FOOTER REQD DATA */
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*/
|
9 |
|
47 |
}
|
48 |
|
49 |
// Use standard
|
50 |
+
$style_file = dirname( __FILE__ ) . '/wppa-style.css';
|
51 |
if ( wppa_is_file( $style_file ) ) {
|
52 |
$ver = date( "ymd-Gis", filemtime( $style_file ) );
|
53 |
}
|
54 |
else {
|
55 |
$ver = $wppa_api_version;
|
56 |
}
|
57 |
+
wp_register_style('wppa_style', WPPA_URL.'/wppa-style.css', array(), $ver);
|
58 |
wp_enqueue_style('wppa_style');
|
59 |
|
60 |
$the_css = wppa_create_wppa_dynamic_css();
|
238 |
return;
|
239 |
}
|
240 |
}
|
241 |
+
require_once 'wppa-theme.php';
|
242 |
}
|
243 |
|
244 |
/* LOAD FOOTER REQD DATA */
|
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.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -44,7 +44,7 @@ function _wppa_moderate_photos() {
|
|
44 |
$photo = wppa_vfy_arg( 'photo' );
|
45 |
$just_edit = wppa_get( 'just-edit' );
|
46 |
|
47 |
-
if ( $photo && $just_edit &&
|
48 |
wppa_echo( '<div class="wrap"><h2>' . esc_html__( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>' . wppa_get( 'just-edit' ) );
|
49 |
wppa_album_photos( '', $photo, '', false );
|
50 |
wppa_echo( '</div>' );
|
@@ -193,7 +193,7 @@ global $wpdb;
|
|
193 |
}
|
194 |
|
195 |
// If i am admin, i can edit all photos here, sorted by timestamp desc
|
196 |
-
if (
|
197 |
wppa_echo( '<h1>' . esc_html__( 'Manage all photos by timestamp', 'wp-photo-album-plus' ) . '</h1>' );
|
198 |
|
199 |
$photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
|
@@ -211,9 +211,9 @@ global $wpdb;
|
|
211 |
}
|
212 |
}
|
213 |
|
214 |
-
// If not one of the cases above apply,
|
215 |
else {
|
216 |
-
|
217 |
return;
|
218 |
}
|
219 |
|
@@ -515,7 +515,7 @@ function wppaTryScheduledel( id ) {
|
|
515 |
$br = wppa_is_phone() ? '<br>' : ' ';
|
516 |
|
517 |
// Various usefull vars
|
518 |
-
$owner_editable = wppa_switch( 'photo_owner_change' ) &&
|
519 |
switch ( wppa_get_album_item( $album, 'p_order_by' ) ) {
|
520 |
case '0':
|
521 |
$temp = wppa_opt( 'list_photos_by' );
|
@@ -551,7 +551,7 @@ function wppaTryScheduledel( id ) {
|
|
551 |
|
552 |
// May user change status?
|
553 |
if ( ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) ) {
|
554 |
-
if ( wppa_switch( 'ext_status_restricted' ) && !
|
555 |
$may_edit_status = false;
|
556 |
}
|
557 |
else {
|
@@ -563,10 +563,10 @@ function wppaTryScheduledel( id ) {
|
|
563 |
}
|
564 |
|
565 |
// May user change planned delete item?
|
566 |
-
$may_change_delete =
|
567 |
|
568 |
// May user change photo sequence no?
|
569 |
-
$may_change_porder =
|
570 |
|
571 |
// Is there exif data?
|
572 |
$exifs = $quick ? array() : $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_exif
|
@@ -934,13 +934,14 @@ function wppaTryScheduledel( id ) {
|
|
934 |
|
935 |
// Owner
|
936 |
if ( ! $owner_editable ) {
|
|
|
937 |
wppa_echo( '
|
938 |
<div class="left">
|
939 |
<label>' .
|
940 |
__( 'Owner', 'wp-photo-album-plus' ) . '
|
941 |
</label><br>
|
942 |
<div class="wppa-ldi">' .
|
943 |
-
|
944 |
</div>
|
945 |
</div>' );
|
946 |
}
|
@@ -981,7 +982,7 @@ function wppaTryScheduledel( id ) {
|
|
981 |
}
|
982 |
|
983 |
// Exif
|
984 |
-
if ( !
|
985 |
wppa_echo( '
|
986 |
<div class="left">
|
987 |
<label>' .
|
@@ -1043,7 +1044,7 @@ function wppaTryScheduledel( id ) {
|
|
1043 |
}
|
1044 |
|
1045 |
// Schedule for delete
|
1046 |
-
if ( !
|
1047 |
if ( $scheduledel ) {
|
1048 |
wppa_echo( '
|
1049 |
<div class="left">
|
@@ -1097,6 +1098,7 @@ function wppaTryScheduledel( id ) {
|
|
1097 |
|
1098 |
// Owner
|
1099 |
if ( $owner_editable ) {
|
|
|
1100 |
wppa_echo( '
|
1101 |
<div class="left">
|
1102 |
<label
|
@@ -1111,10 +1113,43 @@ function wppaTryScheduledel( id ) {
|
|
1111 |
value="' . esc_attr( $owner ) . '"
|
1112 |
/>
|
1113 |
</div>' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1114 |
}
|
1115 |
|
1116 |
// Exif date-time
|
1117 |
-
if (
|
1118 |
wppa_echo( '
|
1119 |
<div class="left">
|
1120 |
<label
|
@@ -1185,7 +1220,7 @@ function wppaTryScheduledel( id ) {
|
|
1185 |
// Status
|
1186 |
if ( $may_edit_status ) {
|
1187 |
$sel = ' selected';
|
1188 |
-
if ( wppa_switch( 'ext_status_restricted' ) && !
|
1189 |
$dis = ' disabled';
|
1190 |
}
|
1191 |
else {
|
@@ -1362,7 +1397,7 @@ function wppaTryScheduledel( id ) {
|
|
1362 |
}
|
1363 |
|
1364 |
// Schedule for delete
|
1365 |
-
if (
|
1366 |
if ( $may_change_delete ) {
|
1367 |
wppa_echo( '
|
1368 |
<div class="left" style="max-width: 500px;">
|
@@ -1531,7 +1566,7 @@ function wppaTryScheduledel( id ) {
|
|
1531 |
}
|
1532 |
|
1533 |
// Delete
|
1534 |
-
if (
|
1535 |
if ( ! wppa( 'front_edit' ) ) {
|
1536 |
wppa_echo( '
|
1537 |
<div class="left">
|
@@ -1568,7 +1603,7 @@ function wppaTryScheduledel( id ) {
|
|
1568 |
}
|
1569 |
|
1570 |
// Re-upload
|
1571 |
-
if (
|
1572 |
wppa_echo( '
|
1573 |
<div class="left" style="max-width:500px;">
|
1574 |
<label>
|
@@ -1630,7 +1665,7 @@ function wppaTryScheduledel( id ) {
|
|
1630 |
</fieldset>' );
|
1631 |
|
1632 |
// Description editable
|
1633 |
-
if ( ! wppa_switch( 'desc_is_restricted' ) ||
|
1634 |
wppa_echo( '
|
1635 |
<fieldset class="wppa-fieldset">
|
1636 |
<legend class="wppa-legend">' .
|
@@ -1700,7 +1735,7 @@ function wppaTryScheduledel( id ) {
|
|
1700 |
|
1701 |
// Tags
|
1702 |
{
|
1703 |
-
$allowed = ! wppa_switch( 'newtags_is_restricted' ) ||
|
1704 |
wppa_echo( '
|
1705 |
<fieldset class="wppa-fieldset">
|
1706 |
<legend class="wppa-legend">' .
|
@@ -1825,7 +1860,7 @@ function wppaTryScheduledel( id ) {
|
|
1825 |
}
|
1826 |
|
1827 |
// -- Photo specific link --
|
1828 |
-
if ( ! wppa_switch( 'link_is_restricted' ) ||
|
1829 |
|
1830 |
// -- Link url --
|
1831 |
wppa_echo( '
|
@@ -2942,7 +2977,7 @@ function wppa_album_photos_bulk( $album ) {
|
|
2942 |
$status = 'publish';
|
2943 |
}
|
2944 |
if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) {
|
2945 |
-
if ( $status == 'publish' || $status == 'pending' ||
|
2946 |
$oldstatus = $wpdb->get_var( $wpdb->prepare( "SELECT status FROM $wpdb->wppa_photos WHERE id = %d", $id ) );
|
2947 |
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos SET status = %s WHERE id = %d", $status, $id ) );
|
2948 |
if ( $oldstatus == 'pending' && $status == 'publish' ) {
|
@@ -2955,7 +2990,7 @@ function wppa_album_photos_bulk( $album ) {
|
|
2955 |
else wp_die( 'Security check failure 3' );
|
2956 |
break;
|
2957 |
case 'wppa-bulk-owner':
|
2958 |
-
if (
|
2959 |
if ( $owner ) {
|
2960 |
$owner = sanitize_user( $owner );
|
2961 |
$exists = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->users." WHERE user_login = '".$owner."'" );
|
@@ -3030,13 +3065,13 @@ function wppa_album_photos_bulk( $album ) {
|
|
3030 |
ORDER BY album DESC, timestamp DESC
|
3031 |
LIMIT %d, %d", $skip, $pagesize ), ARRAY_A );
|
3032 |
|
3033 |
-
$link =
|
3034 |
}
|
3035 |
elseif ( $album == 'search' ) {
|
3036 |
$count = wppa_get_edit_search_photos( '', '', 'count_only' );
|
3037 |
$photos = wppa_get_edit_search_photos( $skip, $pagesize );
|
3038 |
|
3039 |
-
$link =
|
3040 |
wppa_show_search_statistics();
|
3041 |
}
|
3042 |
elseif ( $album == 'trash' ) {
|
@@ -3044,12 +3079,11 @@ function wppa_album_photos_bulk( $album ) {
|
|
3044 |
WHERE album < '0' ORDER BY modified DESC
|
3045 |
LIMIT %d, %d", $skip, $pagesize ), ARRAY_A );
|
3046 |
$count = is_array( $photos ) ? count( $photos ) : 0;
|
3047 |
-
$link =
|
3048 |
'?page=wppa_admin_menu' .
|
3049 |
'&tab=edit' .
|
3050 |
'&edit-id=trash' .
|
3051 |
-
'&wppa-nonce=' . wp_create_nonce('wppa-nonce')
|
3052 |
-
);
|
3053 |
}
|
3054 |
else {
|
3055 |
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos
|
@@ -3060,7 +3094,7 @@ function wppa_album_photos_bulk( $album ) {
|
|
3060 |
" . wppa_get_photo_order( $album ) . "
|
3061 |
LIMIT %d, %d", $album, $skip, $pagesize ), ARRAY_A );
|
3062 |
|
3063 |
-
$link =
|
3064 |
}
|
3065 |
|
3066 |
if ( $photos ) {
|
@@ -3127,7 +3161,7 @@ function wppaTryMove( id, video ) {
|
|
3127 |
$result .= '
|
3128 |
<option value="wppa-bulk-status">' . __( 'Set status to', 'wp-photo-album-plus' ) . '</option>';
|
3129 |
}
|
3130 |
-
if (
|
3131 |
$result .= '
|
3132 |
<option value="wppa-bulk-owner">' . __( 'Set owner to', 'wp-photo-album-plus' ) . '</option>';
|
3133 |
}
|
@@ -3158,7 +3192,7 @@ function wppaTryMove( id, video ) {
|
|
3158 |
<option value=""><?php _e( '- select a status -' , 'wp-photo-album-plus' ) ?></option>
|
3159 |
<option value="pending"><?php _e( 'Pending' , 'wp-photo-album-plus' ) ?></option>
|
3160 |
<option value="publish"><?php _e( 'Publish' , 'wp-photo-album-plus' ) ?></option>
|
3161 |
-
<?php if ( wppa_switch( 'ext_status_restricted' ) && !
|
3162 |
<option value="featured"<?php wppa_echo( $dis )?> ><?php _e( 'Featured' , 'wp-photo-album-plus' ) ?></option>
|
3163 |
<option value="gold" <?php wppa_echo( $dis )?> ><?php _e( 'Gold' , 'wp-photo-album-plus' ) ?></option>
|
3164 |
<option value="silver" <?php wppa_echo( $dis )?> ><?php _e( 'Silver' , 'wp-photo-album-plus' ) ?></option>
|
@@ -3385,7 +3419,7 @@ function wppaTryMove( id, video ) {
|
|
3385 |
<select id="status-<?php wppa_echo( $photo['id'] ) ?>" onchange="wppaAjaxUpdatePhoto( <?php wppa_echo( $photo['id'] ) ?>, 'status', this.value); wppaPhotoStatusChange( <?php wppa_echo( $photo['id'] ) ?> ); ">
|
3386 |
<option value="pending" <?php if ( $photo['status']=='pending' ) wppa_echo( 'selected' )?> ><?php _e( 'Pending' , 'wp-photo-album-plus' ) ?></option>
|
3387 |
<option value="publish" <?php if ( $photo['status']=='publish' ) wppa_echo( 'selected' )?> ><?php _e( 'Publish' , 'wp-photo-album-plus' ) ?></option>
|
3388 |
-
<?php if ( wppa_switch( 'ext_status_restricted' ) && !
|
3389 |
<option value="featured" <?php if ( $photo['status']=='featured' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Featured' , 'wp-photo-album-plus' ) ?></option>
|
3390 |
<option value="gold" <?php if ( $photo['status'] == 'gold' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Gold' , 'wp-photo-album-plus' ) ?></option>
|
3391 |
<option value="silver" <?php if ( $photo['status'] == 'silver' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Silver' , 'wp-photo-album-plus' ) ?></option>
|
@@ -3453,9 +3487,6 @@ function wppaTryMove( id, video ) {
|
|
3453 |
}
|
3454 |
}
|
3455 |
}
|
3456 |
-
else {
|
3457 |
-
wppa_dbg_msg( 'Missing required argument in wppa_album_photos() 2', 'red', 'force' );
|
3458 |
-
}
|
3459 |
}
|
3460 |
|
3461 |
function wppa_album_photos_sequence( $album ) {
|
@@ -3469,7 +3500,7 @@ global $wpdb;
|
|
3469 |
$photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
|
3470 |
WHERE album = %s" . $photoorder, $album ), ARRAY_A );
|
3471 |
|
3472 |
-
$link =
|
3473 |
$size = '180';
|
3474 |
|
3475 |
if ( $photos ) {
|
@@ -3623,7 +3654,7 @@ global $wpdb;
|
|
3623 |
}
|
3624 |
}
|
3625 |
else {
|
3626 |
-
|
3627 |
}
|
3628 |
}
|
3629 |
|
@@ -3646,7 +3677,7 @@ global $wppa_search_stats;
|
|
3646 |
$photo_array = array();
|
3647 |
|
3648 |
// First find the id if numeric
|
3649 |
-
if (
|
3650 |
foreach ( $words as $word ) {
|
3651 |
if ( wppa_is_int( $word ) ) {
|
3652 |
if ( wppa_photo_exists( $word ) ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
44 |
$photo = wppa_vfy_arg( 'photo' );
|
45 |
$just_edit = wppa_get( 'just-edit' );
|
46 |
|
47 |
+
if ( $photo && $just_edit && wppa_user_is_admin() ) {
|
48 |
wppa_echo( '<div class="wrap"><h2>' . esc_html__( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>' . wppa_get( 'just-edit' ) );
|
49 |
wppa_album_photos( '', $photo, '', false );
|
50 |
wppa_echo( '</div>' );
|
193 |
}
|
194 |
|
195 |
// If i am admin, i can edit all photos here, sorted by timestamp desc
|
196 |
+
if ( wppa_user_is_admin() ) {
|
197 |
wppa_echo( '<h1>' . esc_html__( 'Manage all photos by timestamp', 'wp-photo-album-plus' ) . '</h1>' );
|
198 |
|
199 |
$photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
|
211 |
}
|
212 |
}
|
213 |
|
214 |
+
// If not one of the cases above apply, log error and quit
|
215 |
else {
|
216 |
+
wppa_log( 'Err', 'Missing required argument in wppa_album_photos() 1' );
|
217 |
return;
|
218 |
}
|
219 |
|
515 |
$br = wppa_is_phone() ? '<br>' : ' ';
|
516 |
|
517 |
// Various usefull vars
|
518 |
+
$owner_editable = wppa_switch( 'photo_owner_change' ) && wppa_user_is_admin();
|
519 |
switch ( wppa_get_album_item( $album, 'p_order_by' ) ) {
|
520 |
case '0':
|
521 |
$temp = wppa_opt( 'list_photos_by' );
|
551 |
|
552 |
// May user change status?
|
553 |
if ( ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) ) {
|
554 |
+
if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is_admin() ) {
|
555 |
$may_edit_status = false;
|
556 |
}
|
557 |
else {
|
563 |
}
|
564 |
|
565 |
// May user change planned delete item?
|
566 |
+
$may_change_delete = wppa_user_is_admin() || current_user_can( 'wppa_moderate' );
|
567 |
|
568 |
// May user change photo sequence no?
|
569 |
+
$may_change_porder = wppa_user_is_admin() || ! wppa_switch( 'porder_restricted' );
|
570 |
|
571 |
// Is there exif data?
|
572 |
$exifs = $quick ? array() : $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_exif
|
934 |
|
935 |
// Owner
|
936 |
if ( ! $owner_editable ) {
|
937 |
+
|
938 |
wppa_echo( '
|
939 |
<div class="left">
|
940 |
<label>' .
|
941 |
__( 'Owner', 'wp-photo-album-plus' ) . '
|
942 |
</label><br>
|
943 |
<div class="wppa-ldi">' .
|
944 |
+
wppa_get_owner_display( $owner ) . '
|
945 |
</div>
|
946 |
</div>' );
|
947 |
}
|
982 |
}
|
983 |
|
984 |
// Exif
|
985 |
+
if ( ! wppa_user_is_admin() ) {
|
986 |
wppa_echo( '
|
987 |
<div class="left">
|
988 |
<label>' .
|
1044 |
}
|
1045 |
|
1046 |
// Schedule for delete
|
1047 |
+
if ( ! wppa_user_is_admin() && $owner != wppa_get_user() ) {
|
1048 |
if ( $scheduledel ) {
|
1049 |
wppa_echo( '
|
1050 |
<div class="left">
|
1098 |
|
1099 |
// Owner
|
1100 |
if ( $owner_editable ) {
|
1101 |
+
/*
|
1102 |
wppa_echo( '
|
1103 |
<div class="left">
|
1104 |
<label
|
1113 |
value="' . esc_attr( $owner ) . '"
|
1114 |
/>
|
1115 |
</div>' );
|
1116 |
+
*/
|
1117 |
+
if ( wppa_get_user_count() > wppa_opt( 'max_users' ) ) {
|
1118 |
+
wppa_echo( '
|
1119 |
+
<div class="left">
|
1120 |
+
<label
|
1121 |
+
for="owner-' . $id . '">' .
|
1122 |
+
__( 'Owned by', 'wp-photo-album-plus' ) . '
|
1123 |
+
</label><br>
|
1124 |
+
<input
|
1125 |
+
style="max-width:150px"
|
1126 |
+
id="owner-' . $id . '"
|
1127 |
+
type="text"
|
1128 |
+
onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'owner\', this.value )"
|
1129 |
+
value="' . esc_attr( $owner ) . '"
|
1130 |
+
/>
|
1131 |
+
</div>' );
|
1132 |
+
}
|
1133 |
+
else {
|
1134 |
+
wppa_echo( '
|
1135 |
+
<div class="left">
|
1136 |
+
<label
|
1137 |
+
for="owner-' . $id . '">' .
|
1138 |
+
__( 'Owned by', 'wp-photo-album-plus' ) . '
|
1139 |
+
</label><br>
|
1140 |
+
<select
|
1141 |
+
id="owner-' . $id . '"
|
1142 |
+
onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'owner\', this.value )"
|
1143 |
+
style="max-width:200px;"
|
1144 |
+
>' .
|
1145 |
+
wppa_get_user_select( $owner ) . '
|
1146 |
+
</select>
|
1147 |
+
</div>' );
|
1148 |
+
}
|
1149 |
}
|
1150 |
|
1151 |
// Exif date-time
|
1152 |
+
if ( wppa_user_is_admin() ) { // Admin may edit exif date
|
1153 |
wppa_echo( '
|
1154 |
<div class="left">
|
1155 |
<label
|
1220 |
// Status
|
1221 |
if ( $may_edit_status ) {
|
1222 |
$sel = ' selected';
|
1223 |
+
if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is_admin() ) {
|
1224 |
$dis = ' disabled';
|
1225 |
}
|
1226 |
else {
|
1397 |
}
|
1398 |
|
1399 |
// Schedule for delete
|
1400 |
+
if ( wppa_user_is_admin() || $owner == wppa_get_user() ) {
|
1401 |
if ( $may_change_delete ) {
|
1402 |
wppa_echo( '
|
1403 |
<div class="left" style="max-width: 500px;">
|
1566 |
}
|
1567 |
|
1568 |
// Delete
|
1569 |
+
if ( wppa_user_is_admin() || wppa_get_photo_item( $id, 'owner' ) == wppa_get_user() ) {
|
1570 |
if ( ! wppa( 'front_edit' ) ) {
|
1571 |
wppa_echo( '
|
1572 |
<div class="left">
|
1603 |
}
|
1604 |
|
1605 |
// Re-upload
|
1606 |
+
if ( wppa_user_is_admin() || ! wppa_switch( 'reup_is_restricted' ) ) {
|
1607 |
wppa_echo( '
|
1608 |
<div class="left" style="max-width:500px;">
|
1609 |
<label>
|
1665 |
</fieldset>' );
|
1666 |
|
1667 |
// Description editable
|
1668 |
+
if ( ! wppa_switch( 'desc_is_restricted' ) || wppa_user_is_admin() ) {
|
1669 |
wppa_echo( '
|
1670 |
<fieldset class="wppa-fieldset">
|
1671 |
<legend class="wppa-legend">' .
|
1735 |
|
1736 |
// Tags
|
1737 |
{
|
1738 |
+
$allowed = ! wppa_switch( 'newtags_is_restricted' ) || wppa_user_is_admin();
|
1739 |
wppa_echo( '
|
1740 |
<fieldset class="wppa-fieldset">
|
1741 |
<legend class="wppa-legend">' .
|
1860 |
}
|
1861 |
|
1862 |
// -- Photo specific link --
|
1863 |
+
if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is_admin() ) {
|
1864 |
|
1865 |
// -- Link url --
|
1866 |
wppa_echo( '
|
2977 |
$status = 'publish';
|
2978 |
}
|
2979 |
if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) {
|
2980 |
+
if ( $status == 'publish' || $status == 'pending' || wppa_user_is_admin() || ! wppa_switch( 'ext_status_restricted' ) ) {
|
2981 |
$oldstatus = $wpdb->get_var( $wpdb->prepare( "SELECT status FROM $wpdb->wppa_photos WHERE id = %d", $id ) );
|
2982 |
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos SET status = %s WHERE id = %d", $status, $id ) );
|
2983 |
if ( $oldstatus == 'pending' && $status == 'publish' ) {
|
2990 |
else wp_die( 'Security check failure 3' );
|
2991 |
break;
|
2992 |
case 'wppa-bulk-owner':
|
2993 |
+
if ( wppa_user_is_admin() && wppa_switch( 'photo_owner_change' ) ) {
|
2994 |
if ( $owner ) {
|
2995 |
$owner = sanitize_user( $owner );
|
2996 |
$exists = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->users." WHERE user_login = '".$owner."'" );
|
3065 |
ORDER BY album DESC, timestamp DESC
|
3066 |
LIMIT %d, %d", $skip, $pagesize ), ARRAY_A );
|
3067 |
|
3068 |
+
$link = get_admin_url().'admin.php?page=wppa_moderate_photos';
|
3069 |
}
|
3070 |
elseif ( $album == 'search' ) {
|
3071 |
$count = wppa_get_edit_search_photos( '', '', 'count_only' );
|
3072 |
$photos = wppa_get_edit_search_photos( $skip, $pagesize );
|
3073 |
|
3074 |
+
$link = get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id='.$album.'&wppa-searchstring='.wppa_get( 'searchstring' ).'&bulk=1'.'&wppa-nonce=' . wp_create_nonce('wppa-nonce');
|
3075 |
wppa_show_search_statistics();
|
3076 |
}
|
3077 |
elseif ( $album == 'trash' ) {
|
3079 |
WHERE album < '0' ORDER BY modified DESC
|
3080 |
LIMIT %d, %d", $skip, $pagesize ), ARRAY_A );
|
3081 |
$count = is_array( $photos ) ? count( $photos ) : 0;
|
3082 |
+
$link = get_admin_url() . 'admin.php' .
|
3083 |
'?page=wppa_admin_menu' .
|
3084 |
'&tab=edit' .
|
3085 |
'&edit-id=trash' .
|
3086 |
+
'&wppa-nonce=' . wp_create_nonce('wppa-nonce');
|
|
|
3087 |
}
|
3088 |
else {
|
3089 |
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos
|
3094 |
" . wppa_get_photo_order( $album ) . "
|
3095 |
LIMIT %d, %d", $album, $skip, $pagesize ), ARRAY_A );
|
3096 |
|
3097 |
+
$link = get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id='.$album.'&bulk=1'.'&wppa-nonce=' . wp_create_nonce('wppa-nonce');
|
3098 |
}
|
3099 |
|
3100 |
if ( $photos ) {
|
3161 |
$result .= '
|
3162 |
<option value="wppa-bulk-status">' . __( 'Set status to', 'wp-photo-album-plus' ) . '</option>';
|
3163 |
}
|
3164 |
+
if ( wppa_user_is_admin() && wppa_switch( 'photo_owner_change' ) ) {
|
3165 |
$result .= '
|
3166 |
<option value="wppa-bulk-owner">' . __( 'Set owner to', 'wp-photo-album-plus' ) . '</option>';
|
3167 |
}
|
3192 |
<option value=""><?php _e( '- select a status -' , 'wp-photo-album-plus' ) ?></option>
|
3193 |
<option value="pending"><?php _e( 'Pending' , 'wp-photo-album-plus' ) ?></option>
|
3194 |
<option value="publish"><?php _e( 'Publish' , 'wp-photo-album-plus' ) ?></option>
|
3195 |
+
<?php if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is_admin() ) $dis = ' disabled'; else $dis = ''; ?>
|
3196 |
<option value="featured"<?php wppa_echo( $dis )?> ><?php _e( 'Featured' , 'wp-photo-album-plus' ) ?></option>
|
3197 |
<option value="gold" <?php wppa_echo( $dis )?> ><?php _e( 'Gold' , 'wp-photo-album-plus' ) ?></option>
|
3198 |
<option value="silver" <?php wppa_echo( $dis )?> ><?php _e( 'Silver' , 'wp-photo-album-plus' ) ?></option>
|
3419 |
<select id="status-<?php wppa_echo( $photo['id'] ) ?>" onchange="wppaAjaxUpdatePhoto( <?php wppa_echo( $photo['id'] ) ?>, 'status', this.value); wppaPhotoStatusChange( <?php wppa_echo( $photo['id'] ) ?> ); ">
|
3420 |
<option value="pending" <?php if ( $photo['status']=='pending' ) wppa_echo( 'selected' )?> ><?php _e( 'Pending' , 'wp-photo-album-plus' ) ?></option>
|
3421 |
<option value="publish" <?php if ( $photo['status']=='publish' ) wppa_echo( 'selected' )?> ><?php _e( 'Publish' , 'wp-photo-album-plus' ) ?></option>
|
3422 |
+
<?php if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is_admin() ) $dis = ' disabled'; else $dis = ''; ?>
|
3423 |
<option value="featured" <?php if ( $photo['status']=='featured' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Featured' , 'wp-photo-album-plus' ) ?></option>
|
3424 |
<option value="gold" <?php if ( $photo['status'] == 'gold' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Gold' , 'wp-photo-album-plus' ) ?></option>
|
3425 |
<option value="silver" <?php if ( $photo['status'] == 'silver' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Silver' , 'wp-photo-album-plus' ) ?></option>
|
3487 |
}
|
3488 |
}
|
3489 |
}
|
|
|
|
|
|
|
3490 |
}
|
3491 |
|
3492 |
function wppa_album_photos_sequence( $album ) {
|
3500 |
$photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
|
3501 |
WHERE album = %s" . $photoorder, $album ), ARRAY_A );
|
3502 |
|
3503 |
+
$link = get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id='.$album.'&bulk=1'.'&wppa-nonce=' . wp_create_nonce('wppa-nonce');
|
3504 |
$size = '180';
|
3505 |
|
3506 |
if ( $photos ) {
|
3654 |
}
|
3655 |
}
|
3656 |
else {
|
3657 |
+
wppa_log( 'Err', 'Missing required argument in wppa_album_photos() 3' );
|
3658 |
}
|
3659 |
}
|
3660 |
|
3677 |
$photo_array = array();
|
3678 |
|
3679 |
// First find the id if numeric
|
3680 |
+
if ( wppa_user_is_admin() ) {
|
3681 |
foreach ( $words as $word ) {
|
3682 |
if ( wppa_is_int( $word ) ) {
|
3683 |
if ( wppa_photo_exists( $word ) ) {
|
wppa-photo-files.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-photo-files.php
|
3 |
*
|
4 |
* Functions used to create/manipulate photofiles
|
5 |
-
* Version 8.2.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -179,7 +179,7 @@ global $wpdb;
|
|
179 |
$name = '';
|
180 |
break;
|
181 |
}
|
182 |
-
|
183 |
wppa_update_photo( array( 'id' => $id,
|
184 |
'ext' => 'jpg',
|
185 |
'name' => $name
|
@@ -445,7 +445,7 @@ global $wpdb;
|
|
445 |
wppa_cdn_delete( $id ); // Remove existing local cdn files. They will be re-created automatically
|
446 |
break;
|
447 |
default:
|
448 |
-
|
449 |
}
|
450 |
}
|
451 |
|
@@ -832,9 +832,6 @@ function wppa_image_magick( $command ) {
|
|
832 |
$logcom = str_replace( wppa_opt( 'image_magick' ), '...', $logcom );
|
833 |
|
834 |
wppa_log( 'Fso', 'Exec ' . $logcom . ' return status: ' . $err . ', last output line: ' . $run );
|
835 |
-
foreach( $out as $line ) {
|
836 |
-
// wppa_log( 'OBS', $line );
|
837 |
-
}
|
838 |
|
839 |
if ( $err == '46' ) $err = '0';
|
840 |
return $err;
|
@@ -900,8 +897,6 @@ global $wpdb;
|
|
900 |
// Update DB
|
901 |
$wpdb->query( "UPDATE $wpdb->wppa_photos SET ext = '$new_ext', filename = '$new_filename' WHERE id = $id" );
|
902 |
|
903 |
-
// Done!
|
904 |
-
wppa_log( 'obs', 'Converted possible .png files from item ' . $id . ' to .jpg' );
|
905 |
}
|
906 |
|
907 |
// Nothing to convert
|
2 |
/* wppa-photo-files.php
|
3 |
*
|
4 |
* Functions used to create/manipulate photofiles
|
5 |
+
* Version 8.2.05.001
|
6 |
*
|
7 |
*/
|
8 |
|
179 |
$name = '';
|
180 |
break;
|
181 |
}
|
182 |
+
|
183 |
wppa_update_photo( array( 'id' => $id,
|
184 |
'ext' => 'jpg',
|
185 |
'name' => $name
|
445 |
wppa_cdn_delete( $id ); // Remove existing local cdn files. They will be re-created automatically
|
446 |
break;
|
447 |
default:
|
448 |
+
wppa_log( 'Err', 'Missing upload instructions for '.$cdn );
|
449 |
}
|
450 |
}
|
451 |
|
832 |
$logcom = str_replace( wppa_opt( 'image_magick' ), '...', $logcom );
|
833 |
|
834 |
wppa_log( 'Fso', 'Exec ' . $logcom . ' return status: ' . $err . ', last output line: ' . $run );
|
|
|
|
|
|
|
835 |
|
836 |
if ( $err == '46' ) $err = '0';
|
837 |
return $err;
|
897 |
// Update DB
|
898 |
$wpdb->query( "UPDATE $wpdb->wppa_photos SET ext = '$new_ext', filename = '$new_filename' WHERE id = $id" );
|
899 |
|
|
|
|
|
900 |
}
|
901 |
|
902 |
// Nothing to convert
|
wppa-picture.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Make the picture html
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -41,7 +41,7 @@ function wppa_get_picture_html( $args ) {
|
|
41 |
|
42 |
// Does the photo exist?
|
43 |
if ( ! wppa_photo_exists( $id ) ) {
|
44 |
-
|
45 |
return false;
|
46 |
}
|
47 |
|
@@ -65,7 +65,7 @@ function wppa_get_picture_html( $args ) {
|
|
65 |
// Check existance of required args
|
66 |
foreach( array( 'id', 'type' ) as $item ) {
|
67 |
if ( ! $args[$item] ) {
|
68 |
-
|
69 |
return false;
|
70 |
}
|
71 |
}
|
@@ -85,7 +85,7 @@ function wppa_get_picture_html( $args ) {
|
|
85 |
);
|
86 |
|
87 |
if ( ! in_array( $type, $types ) ) {
|
88 |
-
|
89 |
return false;
|
90 |
}
|
91 |
|
@@ -158,7 +158,7 @@ function wppa_get_picture_html( $args ) {
|
|
158 |
$style = 'width:100%;margin:0;padding:0;border:none;';
|
159 |
break;
|
160 |
default:
|
161 |
-
|
162 |
return false;
|
163 |
}
|
164 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Make the picture html
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*/
|
9 |
|
41 |
|
42 |
// Does the photo exist?
|
43 |
if ( ! wppa_photo_exists( $id ) ) {
|
44 |
+
wppa_log( 'Err', 'Photo ' . $id . ' does not exist in call to wppa_get_picture_html(). Type = ' . $type );
|
45 |
return false;
|
46 |
}
|
47 |
|
65 |
// Check existance of required args
|
66 |
foreach( array( 'id', 'type' ) as $item ) {
|
67 |
if ( ! $args[$item] ) {
|
68 |
+
wppa_log( 'Err', 'Missing ' . $item . ' in call to wppa_get_picture_html()' );
|
69 |
return false;
|
70 |
}
|
71 |
}
|
85 |
);
|
86 |
|
87 |
if ( ! in_array( $type, $types ) ) {
|
88 |
+
wppa_log( 'Err', 'Unimplemented type ' . $type . ' in call to wppa_get_picture_html()' );
|
89 |
return false;
|
90 |
}
|
91 |
|
158 |
$style = 'width:100%;margin:0;padding:0;border:none;';
|
159 |
break;
|
160 |
default:
|
161 |
+
wppa_log( 'Err', 'Style for type ' . $type . ' is not implemented yet in wppa_get_picture_html()' );
|
162 |
return false;
|
163 |
}
|
164 |
|
wppa-privacy-policy.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* This file contains all procedures related to the privacy policy.
|
6 |
*
|
7 |
-
* Version 8.2.
|
8 |
*/
|
9 |
|
10 |
function wppa_comment_exporter( $email_address, $page = 1 ) {
|
@@ -23,8 +23,6 @@ global $wpdb;
|
|
23 |
"LIMIT %d,%d", $email_address, ( $page - 1 ) * $number, $number
|
24 |
), ARRAY_A );
|
25 |
|
26 |
-
// wppa_log( 'obs', count($comments) .' comments found to export' );
|
27 |
-
|
28 |
foreach ( (array) $comments as $comment ) {
|
29 |
|
30 |
$item_id = "wppa-comment-{$comment['id']}";
|
@@ -85,8 +83,6 @@ global $wpdb;
|
|
85 |
"DELETE FROM $wpdb->wppa_comments " .
|
86 |
"WHERE email = %s ", $email_address ) );
|
87 |
|
88 |
-
// wppa_log( 'obs', $count . ' comments found to remove' );
|
89 |
-
|
90 |
return array( 'items_removed' => true,
|
91 |
'items_retained' => false,
|
92 |
'messages' => array( sprintf( _n( '%d comment on photos removed',
|
@@ -131,8 +127,6 @@ global $wpdb;
|
|
131 |
LIMIT %d,%d", $owner, $owner_display, ( $page - 1 ) * $number, $number
|
132 |
), ARRAY_A );
|
133 |
|
134 |
-
// wppa_log( 'obs', count($ratings) .' ratings found to export' );
|
135 |
-
|
136 |
foreach ( (array) $ratings as $rating ) {
|
137 |
|
138 |
$item_id = "wppa-rating-{$rating['id']}";
|
@@ -196,8 +190,6 @@ global $wpdb;
|
|
196 |
WHERE user = %s
|
197 |
OR user = %s", $owner, $owner_display ) );
|
198 |
|
199 |
-
// wppa_log( 'obs', $count . ' ratings found to remove' );
|
200 |
-
|
201 |
// Need recalc when ratings are removed
|
202 |
if ( $count ) {
|
203 |
wppa_schedule_maintenance_proc( 'wppa_rerate' );
|
@@ -549,10 +541,6 @@ function wppa_zip_addfile( $zip, $wppa_media_file, $wppa_media_name ) {
|
|
549 |
$error = __( 'Unable to add data to export file.' ) . ' ' . $wppa_media_file . ' as ' . $wppa_media_name;
|
550 |
wppa_log( 'err', $error );
|
551 |
}
|
552 |
-
else {
|
553 |
-
// wppa_log('obs', $wppa_media_file.' added as '. $wppa_media_name);
|
554 |
-
}
|
555 |
-
|
556 |
}
|
557 |
else {
|
558 |
wppa_log('err', $wppa_media_file . ' does not exist' );
|
4 |
*
|
5 |
* This file contains all procedures related to the privacy policy.
|
6 |
*
|
7 |
+
* Version 8.2.05.001
|
8 |
*/
|
9 |
|
10 |
function wppa_comment_exporter( $email_address, $page = 1 ) {
|
23 |
"LIMIT %d,%d", $email_address, ( $page - 1 ) * $number, $number
|
24 |
), ARRAY_A );
|
25 |
|
|
|
|
|
26 |
foreach ( (array) $comments as $comment ) {
|
27 |
|
28 |
$item_id = "wppa-comment-{$comment['id']}";
|
83 |
"DELETE FROM $wpdb->wppa_comments " .
|
84 |
"WHERE email = %s ", $email_address ) );
|
85 |
|
|
|
|
|
86 |
return array( 'items_removed' => true,
|
87 |
'items_retained' => false,
|
88 |
'messages' => array( sprintf( _n( '%d comment on photos removed',
|
127 |
LIMIT %d,%d", $owner, $owner_display, ( $page - 1 ) * $number, $number
|
128 |
), ARRAY_A );
|
129 |
|
|
|
|
|
130 |
foreach ( (array) $ratings as $rating ) {
|
131 |
|
132 |
$item_id = "wppa-rating-{$rating['id']}";
|
190 |
WHERE user = %s
|
191 |
OR user = %s", $owner, $owner_display ) );
|
192 |
|
|
|
|
|
193 |
// Need recalc when ratings are removed
|
194 |
if ( $count ) {
|
195 |
wppa_schedule_maintenance_proc( 'wppa_rerate' );
|
541 |
$error = __( 'Unable to add data to export file.' ) . ' ' . $wppa_media_file . ' as ' . $wppa_media_name;
|
542 |
wppa_log( 'err', $error );
|
543 |
}
|
|
|
|
|
|
|
|
|
544 |
}
|
545 |
else {
|
546 |
wppa_log('err', $wppa_media_file . ' does not exist' );
|
wppa-scripts.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* This file contains all functions for activating javascript
|
6 |
*
|
7 |
-
* Version 8.2.
|
8 |
*/
|
9 |
|
10 |
// Place all wppa related js declarations in the header, both admin and frontend
|
@@ -14,9 +14,8 @@ global $wppa_lang;
|
|
14 |
global $wppa_session;
|
15 |
global $wpdb;
|
16 |
|
17 |
-
/*
|
18 |
-
$result = '
|
19 |
-
wppaDebugCounter = 0,';
|
20 |
|
21 |
/* wppa.js */
|
22 |
$result .= '
|
@@ -493,14 +492,14 @@ global $wpdb;
|
|
493 |
wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
|
494 |
wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";';
|
495 |
}
|
496 |
-
|
497 |
// No, nothing yet
|
498 |
else {
|
499 |
$result .= 'var
|
500 |
wppaShortcodeTemplate = "";
|
501 |
wppaShortcodeTemplateId = "";';
|
502 |
}
|
503 |
-
|
504 |
// Reset faked widget
|
505 |
wppa( 'in_widget', false );
|
506 |
}
|
4 |
*
|
5 |
* This file contains all functions for activating javascript
|
6 |
*
|
7 |
+
* Version 8.2.05.001
|
8 |
*/
|
9 |
|
10 |
// Place all wppa related js declarations in the header, both admin and frontend
|
14 |
global $wppa_session;
|
15 |
global $wpdb;
|
16 |
|
17 |
+
/* Init */
|
18 |
+
$result = '';
|
|
|
19 |
|
20 |
/* wppa.js */
|
21 |
$result .= '
|
492 |
wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
|
493 |
wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";';
|
494 |
}
|
495 |
+
|
496 |
// No, nothing yet
|
497 |
else {
|
498 |
$result .= 'var
|
499 |
wppaShortcodeTemplate = "";
|
500 |
wppaShortcodeTemplateId = "";';
|
501 |
}
|
502 |
+
|
503 |
// Reset faked widget
|
504 |
wppa( 'in_widget', false );
|
505 |
}
|
wppa-session.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
@@ -92,9 +92,6 @@ global $wppa_session;
|
|
92 |
// Give up
|
93 |
return false;
|
94 |
}
|
95 |
-
else {
|
96 |
-
// wppa_log( 'Obs', 'Session ' . $iret . ' created after 1 retry for user ' . wppa_get_user() );
|
97 |
-
}
|
98 |
}
|
99 |
|
100 |
$wppa_session = array();
|
@@ -191,7 +188,6 @@ global $wppa_session;
|
|
191 |
// May have logged in now
|
192 |
$wppa_session['user'] = wppa_get_user();
|
193 |
wppa_save_session();
|
194 |
-
// wppa_log( 'obs', 'Session ended' );
|
195 |
}
|
196 |
|
197 |
// Save the session data
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
92 |
// Give up
|
93 |
return false;
|
94 |
}
|
|
|
|
|
|
|
95 |
}
|
96 |
|
97 |
$wppa_session = array();
|
188 |
// May have logged in now
|
189 |
$wppa_session['user'] = wppa_get_user();
|
190 |
wppa_save_session();
|
|
|
191 |
}
|
192 |
|
193 |
// Save the session data
|
wppa-setting-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -189,6 +189,7 @@ function wppa_checkbox_e($xslug, $curval, $onchange = '', $class = '', $enabled
|
|
189 |
|
190 |
function wppa_select($xslug, $opts, $vals, $onchange = '', $class = '', $first_disable = false, $postaction = '', $max_width = '300' ) {
|
191 |
global $wppa_opt;
|
|
|
192 |
|
193 |
$slug = substr( $xslug, 5 );
|
194 |
|
@@ -200,15 +201,30 @@ global $wppa_opt;
|
|
200 |
$tit = __('Slug =', 'wp-photo-album-plus' ).' '.$xslug."\n".__('Values = ', 'wp-photo-album-plus' );
|
201 |
foreach( $vals as $val ) $tit.= $val.', ';
|
202 |
$tit = trim( $tit, ', ');
|
203 |
-
$title = wppa_switch( 'enable_shortcode_wppa_set' ) ?
|
204 |
|
205 |
-
$
|
206 |
-
$
|
207 |
|
208 |
-
|
209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
|
211 |
-
$val = wppa_get_option( $xslug );
|
212 |
$idx = 0;
|
213 |
$cnt = count($opts);
|
214 |
while ($idx < $cnt) {
|
@@ -218,6 +234,8 @@ global $wppa_opt;
|
|
218 |
if ($idx == 0 && $first_disable) $dis = true;
|
219 |
$opt = trim($opts[$idx], '|');
|
220 |
if ($opt != $opts[$idx]) $dis = true;
|
|
|
|
|
221 |
if ($val == $vals[$idx]) $html .= ' selected';
|
222 |
if ($dis) $html .= ' disabled';
|
223 |
$html .= '>'.$opt.'</option>';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
189 |
|
190 |
function wppa_select($xslug, $opts, $vals, $onchange = '', $class = '', $first_disable = false, $postaction = '', $max_width = '300' ) {
|
191 |
global $wppa_opt;
|
192 |
+
global $wppa_defaults;
|
193 |
|
194 |
$slug = substr( $xslug, 5 );
|
195 |
|
201 |
$tit = __('Slug =', 'wp-photo-album-plus' ).' '.$xslug."\n".__('Values = ', 'wp-photo-album-plus' );
|
202 |
foreach( $vals as $val ) $tit.= $val.', ';
|
203 |
$tit = trim( $tit, ', ');
|
204 |
+
$title = wppa_switch( 'enable_shortcode_wppa_set' ) ? $tit : '';
|
205 |
|
206 |
+
$dflt = isset( $wppa_defaults[$xslug] ) ? $wppa_defaults[$xslug] : null;
|
207 |
+
$val = wppa_get_option( $xslug );
|
208 |
|
209 |
+
$html = '
|
210 |
+
<select
|
211 |
+
id="' . $slug . '"
|
212 |
+
style="
|
213 |
+
float:left;
|
214 |
+
font-size:11px;
|
215 |
+
height:20px;
|
216 |
+
margin:0px;
|
217 |
+
padding:0px;
|
218 |
+
max-width:' . $max_width . 'px;
|
219 |
+
font-style:' . ( $dflt === $val ? 'italic':'normal' ) . ';"
|
220 |
+
title="' . $title . '"
|
221 |
+
class="' . $class . '"
|
222 |
+
onchange="' . esc_attr( $onchange . ';
|
223 |
+
wppaAjaxUpdateOptionValue(\'' . $slug . '\', this);' .
|
224 |
+
$postaction . ';
|
225 |
+
if (jQuery(this).val() == \'' . $dflt . '\') {jQuery(this).css({fontStyle:\'italic\'})} else {jQuery(this).css({fontStyle:\'normal\'})};' ) . '"
|
226 |
+
>';
|
227 |
|
|
|
228 |
$idx = 0;
|
229 |
$cnt = count($opts);
|
230 |
while ($idx < $cnt) {
|
234 |
if ($idx == 0 && $first_disable) $dis = true;
|
235 |
$opt = trim($opts[$idx], '|');
|
236 |
if ($opt != $opts[$idx]) $dis = true;
|
237 |
+
$ital = $dflt !== null && $vals[$idx] == $dflt;
|
238 |
+
$html .= ' style="font-style:'.($ital?'italic':'normal').'"';
|
239 |
if ($val == $vals[$idx]) $html .= ' selected';
|
240 |
if ($dis) $html .= ' disabled';
|
241 |
$html .= '>'.$opt.'</option>';
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -6695,7 +6695,7 @@ global $wppa_subtab_names;
|
|
6695 |
$desc = __('Initially loads album data in internal cache to reduce db queries', 'wp-photo-album-plus');
|
6696 |
$help = __('The higher the better, but be carefull to avoid out of memeory errors', 'wp-photo-album-plus');
|
6697 |
$slug = 'wppa_pre_cache_albums';
|
6698 |
-
$opts = array('20', '50', '100', '200', '500', '1000');
|
6699 |
$html = wppa_select($slug, $opts, $opts);
|
6700 |
wppa_setting_new($slug, '46', $name, $desc, $html, $help);
|
6701 |
|
@@ -6703,7 +6703,7 @@ global $wppa_subtab_names;
|
|
6703 |
$desc = __('Initially loads photo data in internal cache to reduce db queries', 'wp-photo-album-plus');
|
6704 |
$help = __('The higher the better, but be carefull to avoid out of memeory errors', 'wp-photo-album-plus');
|
6705 |
$slug = 'wppa_pre_cache_photos';
|
6706 |
-
$opts = array('200', '500', '1000', '2000', '5000', '10000');
|
6707 |
$html = wppa_select($slug, $opts, $opts);
|
6708 |
wppa_setting_new($slug, '47', $name, $desc, $html, $help);
|
6709 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
6695 |
$desc = __('Initially loads album data in internal cache to reduce db queries', 'wp-photo-album-plus');
|
6696 |
$help = __('The higher the better, but be carefull to avoid out of memeory errors', 'wp-photo-album-plus');
|
6697 |
$slug = 'wppa_pre_cache_albums';
|
6698 |
+
$opts = array('10', '20', '50', '100', '200', '500', '1000');
|
6699 |
$html = wppa_select($slug, $opts, $opts);
|
6700 |
wppa_setting_new($slug, '46', $name, $desc, $html, $help);
|
6701 |
|
6703 |
$desc = __('Initially loads photo data in internal cache to reduce db queries', 'wp-photo-album-plus');
|
6704 |
$help = __('The higher the better, but be carefull to avoid out of memeory errors', 'wp-photo-album-plus');
|
6705 |
$slug = 'wppa_pre_cache_photos';
|
6706 |
+
$opts = array('100', '200', '500', '1000', '2000', '5000', '10000');
|
6707 |
$html = wppa_select($slug, $opts, $opts);
|
6708 |
wppa_setting_new($slug, '47', $name, $desc, $html, $help);
|
6709 |
|
wppa-setup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -224,16 +224,12 @@ global $wppa_error;
|
|
224 |
}
|
225 |
|
226 |
// Add missing tables
|
227 |
-
//
|
228 |
$idx = 0;
|
229 |
while ( $idx < 9 ) {
|
230 |
if ( ! in_array( $tn[$idx], $existing_tables ) ) {
|
231 |
-
// wppa_log( 'obs', 'Attempting to create ' . $tn[$idx] );
|
232 |
$bret = $wpdb->query( $tc[$idx] );
|
233 |
-
if ( $bret ) {
|
234 |
-
// wppa_log( 'obs', $tn[$idx] . ' successfully created' );
|
235 |
-
}
|
236 |
-
else {
|
237 |
wppa_log( 'err', 'Failed to create ' . $tn[$idx] );
|
238 |
}
|
239 |
}
|
@@ -400,32 +396,6 @@ global $wppa_error;
|
|
400 |
wppa_copy( $from, $to );
|
401 |
}
|
402 |
|
403 |
-
// Check if this update comes with a new wppa-theme.php and/or a new wppa-style.css
|
404 |
-
// If so, produce message
|
405 |
-
$key = '0';
|
406 |
-
if ( $old_rev < '5400' ) { // theme changed since...
|
407 |
-
$usertheme = get_theme_root().'/'.wppa_get_option('template').'/wppa-theme.php';
|
408 |
-
if ( is_file( $usertheme ) ) $key += '2';
|
409 |
-
}
|
410 |
-
if ( $old_rev < '5211' ) { // css changed since...
|
411 |
-
$userstyle = get_theme_root().'/'.wppa_get_option('stylesheet').'/wppa-style.css';
|
412 |
-
if ( is_file( $userstyle ) ) {
|
413 |
-
$key += '1';
|
414 |
-
}
|
415 |
-
else {
|
416 |
-
$userstyle = get_theme_root().'/'.wppa_get_option('template').'/wppa-style.css';
|
417 |
-
if ( is_file( $userstyle ) ) {
|
418 |
-
$key += '1';
|
419 |
-
}
|
420 |
-
}
|
421 |
-
}
|
422 |
-
if ( $key ) {
|
423 |
-
$msg = '<center>' . __('IMPORTANT UPGRADE NOTICE', 'wp-photo-album-plus' ) . '</center><br/>';
|
424 |
-
if ($key == '1' || $key == '3') $msg .= '<br/>' . __('Please CHECK your customized WPPA-STYLE.CSS file against the newly supplied one. You may wish to add or modify some attributes. Be aware of the fact that most settings can now be set in the admin settings page.', 'wp-photo-album-plus' );
|
425 |
-
if ($key == '2' || $key == '3') $msg .= '<br/>' . __('Please REPLACE your customized WPPA-THEME.PHP file by the newly supplied one, or just remove it from your theme directory. You may modify it later if you wish. Your current customized version is NOT compatible with this version of the plugin software.', 'wp-photo-album-plus' );
|
426 |
-
wppa_ok_message($msg);
|
427 |
-
}
|
428 |
-
|
429 |
// Remove dynamic files
|
430 |
$files = wppa_glob( WPPA_UPLOAD_PATH.'/dynamic/wppa-init.*.js' );
|
431 |
if ( $files ) {
|
@@ -677,7 +647,7 @@ static $user;
|
|
677 |
$deftags = wppa_opt( 'grant_tags' );
|
678 |
$id = wppa_create_album_entry( array ( 'name' => $name, 'description' => $desc, 'a_parent' => $parent, 'cats' => $cats, 'default_tags' => $deftags ) );
|
679 |
if ( $id ) {
|
680 |
-
|
681 |
$albums_created[] = $id;
|
682 |
|
683 |
// Add this parent to the array of my albums parents
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
224 |
}
|
225 |
|
226 |
// Add missing tables
|
227 |
+
// We do this here because dbDelta() generates an error when a new table is created
|
228 |
$idx = 0;
|
229 |
while ( $idx < 9 ) {
|
230 |
if ( ! in_array( $tn[$idx], $existing_tables ) ) {
|
|
|
231 |
$bret = $wpdb->query( $tc[$idx] );
|
232 |
+
if ( ! $bret ) {
|
|
|
|
|
|
|
233 |
wppa_log( 'err', 'Failed to create ' . $tn[$idx] );
|
234 |
}
|
235 |
}
|
396 |
wppa_copy( $from, $to );
|
397 |
}
|
398 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
// Remove dynamic files
|
400 |
$files = wppa_glob( WPPA_UPLOAD_PATH.'/dynamic/wppa-init.*.js' );
|
401 |
if ( $files ) {
|
647 |
$deftags = wppa_opt( 'grant_tags' );
|
648 |
$id = wppa_create_album_entry( array ( 'name' => $name, 'description' => $desc, 'a_parent' => $parent, 'cats' => $cats, 'default_tags' => $deftags ) );
|
649 |
if ( $id ) {
|
650 |
+
|
651 |
$albums_created[] = $id;
|
652 |
|
653 |
// Add this parent to the array of my albums parents
|
wppa-slideshow.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Contains all the slideshow high level functions
|
6 |
*
|
7 |
-
* Version 8.2.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -194,7 +194,6 @@ global $previous_page_last_id;
|
|
194 |
// Filmstrip assumes array $thumbs to start at index 0.
|
195 |
// We shift the req'd part down to the beginning and unset the rest
|
196 |
$skips = ( wppa( 'curpage' ) - '1' ) * $pagsiz;
|
197 |
-
wppa_dbg_msg('Skips = '.$skips);
|
198 |
foreach ( array_keys( $thumbs ) as $key ) {
|
199 |
if ( $key < $pagsiz ) {
|
200 |
if ( isset( $thumbs[$key + $skips] ) ) {
|
@@ -1287,8 +1286,6 @@ function wppa_slide_filmstrip( $opt = '' ) {
|
|
1287 |
}
|
1288 |
if ( ! $do_it ) return; // Don't do it
|
1289 |
|
1290 |
-
$t = -microtime(true);
|
1291 |
-
|
1292 |
$alb = wppa_get( 'album' );
|
1293 |
|
1294 |
$thumbs = wppa_get_photos();
|
@@ -1427,8 +1424,6 @@ function wppa_slide_filmstrip( $opt = '' ) {
|
|
1427 |
wppa_out( '</div>' );
|
1428 |
}
|
1429 |
|
1430 |
-
$t += microtime(true);
|
1431 |
-
wppa_dbg_msg( 'Filmstrip took '.$t.' seconds.' );
|
1432 |
}
|
1433 |
|
1434 |
function wppa_startstop_icons() {
|
4 |
*
|
5 |
* Contains all the slideshow high level functions
|
6 |
*
|
7 |
+
* Version 8.2.05.000
|
8 |
*
|
9 |
*/
|
10 |
|
194 |
// Filmstrip assumes array $thumbs to start at index 0.
|
195 |
// We shift the req'd part down to the beginning and unset the rest
|
196 |
$skips = ( wppa( 'curpage' ) - '1' ) * $pagsiz;
|
|
|
197 |
foreach ( array_keys( $thumbs ) as $key ) {
|
198 |
if ( $key < $pagsiz ) {
|
199 |
if ( isset( $thumbs[$key + $skips] ) ) {
|
1286 |
}
|
1287 |
if ( ! $do_it ) return; // Don't do it
|
1288 |
|
|
|
|
|
1289 |
$alb = wppa_get( 'album' );
|
1290 |
|
1291 |
$thumbs = wppa_get_photos();
|
1424 |
wppa_out( '</div>' );
|
1425 |
}
|
1426 |
|
|
|
|
|
1427 |
}
|
1428 |
|
1429 |
function wppa_startstop_icons() {
|
wppa-statistics.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Functions for counts etc
|
6 |
* Common use front and admin
|
7 |
-
* Version 8.2.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -61,7 +61,7 @@ global $wpdb;
|
|
61 |
}
|
62 |
|
63 |
// Admin, do not look to owner
|
64 |
-
if (
|
65 |
$result = $wpdb->get_var( "SELECT COUNT(*) " .
|
66 |
"FROM $wpdb->wppa_albums " .
|
67 |
( $where ? "WHERE " . $where : "" )
|
@@ -261,7 +261,6 @@ function wppa_flush_upldr_cache( $key = '', $id = '' ) {
|
|
261 |
break;
|
262 |
|
263 |
default:
|
264 |
-
wppa_dbg_msg('Missing key in wppa_flush_upldr_cache()', 'red');
|
265 |
break;
|
266 |
}
|
267 |
}
|
@@ -619,7 +618,6 @@ static $login;
|
|
619 |
|
620 |
// Validate arg
|
621 |
if ( ! wppa_is_int( $id ) || $id < '1' || ! wppa_cache_album( $id ) ) {
|
622 |
-
wppa_log( 'err', 'Invalid arg in wppa_is_album_visible: '.serialize($id) );
|
623 |
return false;
|
624 |
}
|
625 |
|
@@ -627,7 +625,7 @@ static $login;
|
|
627 |
$status = wppa_get_album_item( $id, 'status' );
|
628 |
$owner = wppa_get_album_item( $id, 'owner' );
|
629 |
if ( $user === NULL ) $user = wppa_get_user();
|
630 |
-
if ( $admin === NULL ) $admin =
|
631 |
if ( $login === NULL ) $login = is_user_logged_in();
|
632 |
|
633 |
// Always visible for admin and owner
|
@@ -706,7 +704,6 @@ static $cache;
|
|
706 |
if ( ! is_array( $cache ) ) $cache = array();
|
707 |
if ( isset( $cache[$id] ) ) {
|
708 |
return $cache[$id];
|
709 |
-
// wppa_log( 'obs', 'Cache hit wppa_get_visible_subtree_album_count( '.$id.' )');
|
710 |
}
|
711 |
$result = '0';
|
712 |
|
@@ -740,7 +737,7 @@ static $login;
|
|
740 |
$status = wppa_get_photo_item( $id, 'status' );
|
741 |
$owner = wppa_get_photo_item( $id, 'owner' );
|
742 |
if ( $user === NULL ) $user = wppa_get_user();
|
743 |
-
if ( $admin === NULL ) $admin =
|
744 |
if ( $login === NULL ) $login = is_user_logged_in();
|
745 |
|
746 |
// Dispatch on photo status
|
@@ -777,7 +774,6 @@ static $cache;
|
|
777 |
|
778 |
if ( ! is_array( $cache ) ) $cache = array();
|
779 |
if ( isset( $cache[$id] ) ) {
|
780 |
-
// wppa_log( 'obs', 'Cache hit wppa_get_visible_photo_count( '.$id.' )');
|
781 |
return $cache[$id];
|
782 |
}
|
783 |
|
@@ -785,7 +781,7 @@ static $cache;
|
|
785 |
return '0';
|
786 |
}
|
787 |
|
788 |
-
if (
|
789 |
$result = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE album = %s", $id ) );
|
790 |
}
|
791 |
elseif ( is_user_logged_in() ) {
|
@@ -804,7 +800,6 @@ static $cache;
|
|
804 |
|
805 |
if ( ! is_array( $cache ) ) $cache = array();
|
806 |
if ( isset( $cache[$id] ) ) {
|
807 |
-
// wppa_log( 'obs', 'Cache hit wppa_get_visible_subtree_photo_count( '.$id.' )');
|
808 |
return $cache[$id];
|
809 |
}
|
810 |
$result = '0';
|
@@ -830,7 +825,6 @@ static $cache;
|
|
830 |
|
831 |
if ( ! is_array( $cache ) ) $cache = array();
|
832 |
if ( isset( $cache[$id] ) ) {
|
833 |
-
// wppa_log( 'obs', 'Cache hit wppa_get_sub_album_ids( '.$id.' )');
|
834 |
return $cache[$id];
|
835 |
}
|
836 |
|
4 |
*
|
5 |
* Functions for counts etc
|
6 |
* Common use front and admin
|
7 |
+
* Version 8.2.05.001
|
8 |
*
|
9 |
*/
|
10 |
|
61 |
}
|
62 |
|
63 |
// Admin, do not look to owner
|
64 |
+
if ( wppa_user_is_admin() ) {
|
65 |
$result = $wpdb->get_var( "SELECT COUNT(*) " .
|
66 |
"FROM $wpdb->wppa_albums " .
|
67 |
( $where ? "WHERE " . $where : "" )
|
261 |
break;
|
262 |
|
263 |
default:
|
|
|
264 |
break;
|
265 |
}
|
266 |
}
|
618 |
|
619 |
// Validate arg
|
620 |
if ( ! wppa_is_int( $id ) || $id < '1' || ! wppa_cache_album( $id ) ) {
|
|
|
621 |
return false;
|
622 |
}
|
623 |
|
625 |
$status = wppa_get_album_item( $id, 'status' );
|
626 |
$owner = wppa_get_album_item( $id, 'owner' );
|
627 |
if ( $user === NULL ) $user = wppa_get_user();
|
628 |
+
if ( $admin === NULL ) $admin = wppa_user_is_admin();
|
629 |
if ( $login === NULL ) $login = is_user_logged_in();
|
630 |
|
631 |
// Always visible for admin and owner
|
704 |
if ( ! is_array( $cache ) ) $cache = array();
|
705 |
if ( isset( $cache[$id] ) ) {
|
706 |
return $cache[$id];
|
|
|
707 |
}
|
708 |
$result = '0';
|
709 |
|
737 |
$status = wppa_get_photo_item( $id, 'status' );
|
738 |
$owner = wppa_get_photo_item( $id, 'owner' );
|
739 |
if ( $user === NULL ) $user = wppa_get_user();
|
740 |
+
if ( $admin === NULL ) $admin = wppa_user_is_admin();
|
741 |
if ( $login === NULL ) $login = is_user_logged_in();
|
742 |
|
743 |
// Dispatch on photo status
|
774 |
|
775 |
if ( ! is_array( $cache ) ) $cache = array();
|
776 |
if ( isset( $cache[$id] ) ) {
|
|
|
777 |
return $cache[$id];
|
778 |
}
|
779 |
|
781 |
return '0';
|
782 |
}
|
783 |
|
784 |
+
if ( wppa_user_is_admin() ) {
|
785 |
$result = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE album = %s", $id ) );
|
786 |
}
|
787 |
elseif ( is_user_logged_in() ) {
|
800 |
|
801 |
if ( ! is_array( $cache ) ) $cache = array();
|
802 |
if ( isset( $cache[$id] ) ) {
|
|
|
803 |
return $cache[$id];
|
804 |
}
|
805 |
$result = '0';
|
825 |
|
826 |
if ( ! is_array( $cache ) ) $cache = array();
|
827 |
if ( isset( $cache[$id] ) ) {
|
|
|
828 |
return $cache[$id];
|
829 |
}
|
830 |
|
theme/wppa-style.css → wppa-style.css
RENAMED
@@ -3,7 +3,7 @@
|
|
3 |
/* It is strongly recommended not to modify this file because it will be overwritten by an update
|
4 |
/* Any modifications to styles that are not configurable on the settings page should be made in the standard wp customizer css tab
|
5 |
/*
|
6 |
-
/* This is version 8.
|
7 |
*/
|
8 |
|
9 |
.wppa-container, .wppa-cover-box, .wppa-thumb-area {
|
3 |
/* It is strongly recommended not to modify this file because it will be overwritten by an update
|
4 |
/* Any modifications to styles that are not configurable on the settings page should be made in the standard wp customizer css tab
|
5 |
/*
|
6 |
+
/* This is version 8.2.05.000
|
7 |
*/
|
8 |
|
9 |
.wppa-container, .wppa-cover-box, .wppa-thumb-area {
|
theme/wppa-theme.php → wppa-theme.php
RENAMED
@@ -3,11 +3,11 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the albums/photos/slideshow in a page or post
|
6 |
-
* Version 8.2.
|
7 |
*/
|
8 |
function wppa_theme() {
|
9 |
|
10 |
-
global $wppa_version; $wppa_version = '8.2.
|
11 |
global $wppa;
|
12 |
global $wppa_show_statistics; // Can be set to true by a custom page template
|
13 |
global $wppa_empty_content;
|
@@ -412,7 +412,6 @@ global $wppa_empty_content;
|
|
412 |
|
413 |
elseif ( wppa_page( 'slide' ) || wppa_page( 'single' ) ) { // Page 'Slideshow' or 'Single' in browsemode requested
|
414 |
$thumbs = wppa_get_photos();
|
415 |
-
wppa_dbg_msg( 'From theme: #thumbs='.( $thumbs ? count( $thumbs ) : '0' ) );
|
416 |
if ( $thumbs ) {
|
417 |
wppa_the_slideshow( $thumbs ); // Producs all the html required for the slideshow
|
418 |
wppa_run_slidecontainer( $thumbs ); // Fill in the photo array and display it.
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the albums/photos/slideshow in a page or post
|
6 |
+
* Version 8.2.05.000
|
7 |
*/
|
8 |
function wppa_theme() {
|
9 |
|
10 |
+
global $wppa_version; $wppa_version = '8.2.05.000'; // The version number of this file
|
11 |
global $wppa;
|
12 |
global $wppa_show_statistics; // Can be set to true by a custom page template
|
13 |
global $wppa_empty_content;
|
412 |
|
413 |
elseif ( wppa_page( 'slide' ) || wppa_page( 'single' ) ) { // Page 'Slideshow' or 'Single' in browsemode requested
|
414 |
$thumbs = wppa_get_photos();
|
|
|
415 |
if ( $thumbs ) {
|
416 |
wppa_the_slideshow( $thumbs ); // Producs all the html required for the slideshow
|
417 |
wppa_run_slidecontainer( $thumbs ); // Fill in the photo array and display it.
|
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.2.
|
9 |
*
|
10 |
*/
|
11 |
|
@@ -21,8 +21,7 @@ global $wpdb;
|
|
21 |
|
22 |
// Validate args
|
23 |
if ( ! wppa_is_int( $id ) || $id < '0' ) {
|
24 |
-
|
25 |
-
die( 'Please check your configuration' );
|
26 |
}
|
27 |
|
28 |
// Initialize
|
@@ -645,7 +644,7 @@ global $wpdb;
|
|
645 |
if ( wppa_is_photo( $thumb['id'] ) ) {
|
646 |
$choice = wppa_opt( 'admins_choice' );
|
647 |
if ( current_user_can( 'wppa_admin' ) || wppa_opt( 'admins_choice_action' ) != 'album' ) {
|
648 |
-
if ( (
|
649 |
( is_user_logged_in() && $choice == 'login' ) ) {
|
650 |
|
651 |
$result .=
|
@@ -856,7 +855,7 @@ global $thlinkmsggiven;
|
|
856 |
}
|
857 |
|
858 |
if ( ! $link['is_url'] ) {
|
859 |
-
if ( ! $thlinkmsggiven )
|
860 |
$href = '';
|
861 |
$title = '';
|
862 |
$thlinkmsggiven = true;
|
5 |
* Various funcions to display a thumbnail image
|
6 |
* Contains all possible frontend thumbnail types
|
7 |
*
|
8 |
+
* Version 8.2.05.001
|
9 |
*
|
10 |
*/
|
11 |
|
21 |
|
22 |
// Validate args
|
23 |
if ( ! wppa_is_int( $id ) || $id < '0' ) {
|
24 |
+
return '';
|
|
|
25 |
}
|
26 |
|
27 |
// Initialize
|
644 |
if ( wppa_is_photo( $thumb['id'] ) ) {
|
645 |
$choice = wppa_opt( 'admins_choice' );
|
646 |
if ( current_user_can( 'wppa_admin' ) || wppa_opt( 'admins_choice_action' ) != 'album' ) {
|
647 |
+
if ( ( wppa_user_is_admin() && $choice != 'none' ) ||
|
648 |
( is_user_logged_in() && $choice == 'login' ) ) {
|
649 |
|
650 |
$result .=
|
855 |
}
|
856 |
|
857 |
if ( ! $link['is_url'] ) {
|
858 |
+
if ( ! $thlinkmsggiven ) wppa_lor( 'Err', 'Title link may not be an event in thumbs as covers.' );
|
859 |
$href = '';
|
860 |
$title = '';
|
861 |
$thlinkmsggiven = true;
|
wppa-tinymce-shortcodes.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-tinymce-shortcodes.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
-
* Version 8.2.
|
6 |
*/
|
7 |
|
8 |
if ( ! defined( 'ABSPATH' ) )
|
@@ -14,7 +14,7 @@ function wppa_tinymce_gallery_action_init() {
|
|
14 |
|
15 |
// only hook up these filters if we're in the admin panel, and the current user has permission
|
16 |
// to edit posts or pages, and the feature is enabled
|
17 |
-
if (
|
18 |
|
19 |
add_filter( 'mce_buttons', 'wppa_filter_mce_gallery_button' );
|
20 |
add_filter( 'mce_external_plugins', 'wppa_filter_mce_gallery_plugin' );
|
@@ -79,7 +79,7 @@ global $wpdb;
|
|
79 |
|
80 |
$admins = array();
|
81 |
|
82 |
-
if (
|
83 |
$admins = get_users( array( 'role' => 'administrator' ) );
|
84 |
}
|
85 |
|
2 |
/* wppa-tinymce-shortcodes.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
+
* Version 8.2.05.001
|
6 |
*/
|
7 |
|
8 |
if ( ! defined( 'ABSPATH' ) )
|
14 |
|
15 |
// only hook up these filters if we're in the admin panel, and the current user has permission
|
16 |
// to edit posts or pages, and the feature is enabled
|
17 |
+
if ( wppa_user_is_admin() || ( wppa_switch( 'enable_generator' ) && ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) ) ) {
|
18 |
|
19 |
add_filter( 'mce_buttons', 'wppa_filter_mce_gallery_button' );
|
20 |
add_filter( 'mce_external_plugins', 'wppa_filter_mce_gallery_plugin' );
|
79 |
|
80 |
$admins = array();
|
81 |
|
82 |
+
if ( wppa_user_is_admin() ) {
|
83 |
$admins = get_users( array( 'role' => 'administrator' ) );
|
84 |
}
|
85 |
|
wppa-upload-common.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains common upload functions
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -372,7 +372,7 @@ global $wppa_supported_document_extensions;
|
|
372 |
}
|
373 |
if ( class_exists( 'ZipArchive' ) &&
|
374 |
(
|
375 |
-
|
376 |
! wppa_switch( 'upload_one_only' )
|
377 |
)
|
378 |
) {
|
@@ -487,7 +487,6 @@ function wppa_fix_video_metadata( $id, $where ) {
|
|
487 |
}
|
488 |
else {
|
489 |
$rot = 0;
|
490 |
-
wppa_log('obs', 'No rotate info avail');
|
491 |
}
|
492 |
|
493 |
// Update item
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains common upload functions
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
372 |
}
|
373 |
if ( class_exists( 'ZipArchive' ) &&
|
374 |
(
|
375 |
+
wppa_user_is_admin() ||
|
376 |
! wppa_switch( 'upload_one_only' )
|
377 |
)
|
378 |
) {
|
487 |
}
|
488 |
else {
|
489 |
$rot = 0;
|
|
|
490 |
}
|
491 |
|
492 |
// Update item
|
wppa-upload.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the upload pages and functions
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -121,7 +121,7 @@ global $upload_album;
|
|
121 |
|
122 |
// User can create
|
123 |
if ( current_user_can( 'wppa_admin' ) ) {
|
124 |
-
$url =
|
125 |
$result .= '
|
126 |
<p>' .
|
127 |
__( 'No albums exist. You must', 'wp-photo-album-plus' ) . '
|
@@ -148,7 +148,7 @@ global $upload_album;
|
|
148 |
}
|
149 |
|
150 |
// The information box
|
151 |
-
$multi =
|
152 |
if ( $multi ) {
|
153 |
$result .= '
|
154 |
<div
|
@@ -199,7 +199,7 @@ global $upload_album;
|
|
199 |
) . '
|
200 |
<form
|
201 |
enctype="multipart/form-data"
|
202 |
-
action="' .
|
203 |
method="post"
|
204 |
>' .
|
205 |
wp_nonce_field( '$wppa_nonce', WPPA_NONCE, true, false ) . '
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the upload pages and functions
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
121 |
|
122 |
// User can create
|
123 |
if ( current_user_can( 'wppa_admin' ) ) {
|
124 |
+
$url = get_admin_url().'admin.php?page=wppa_admin_menu';
|
125 |
$result .= '
|
126 |
<p>' .
|
127 |
__( 'No albums exist. You must', 'wp-photo-album-plus' ) . '
|
148 |
}
|
149 |
|
150 |
// The information box
|
151 |
+
$multi = wppa_user_is_admin() || ! wppa_switch( 'upload_one_only' );
|
152 |
if ( $multi ) {
|
153 |
$result .= '
|
154 |
<div
|
199 |
) . '
|
200 |
<form
|
201 |
enctype="multipart/form-data"
|
202 |
+
action="' . get_admin_url() . 'admin.php?page=wppa_upload_photos"
|
203 |
method="post"
|
204 |
>' .
|
205 |
wp_nonce_field( '$wppa_nonce', WPPA_NONCE, true, false ) . '
|
wppa-users.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains user and capabilities related routines
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -103,7 +103,6 @@ static $current_user;
|
|
103 |
return $current_user->user_firstname.' '.$current_user->user_lastname;
|
104 |
break;
|
105 |
default:
|
106 |
-
wppa_dbg_msg( 'Un-implemented type: '.$type.' in wppa_get_user()', 'red', 'force' );
|
107 |
return '';
|
108 |
}
|
109 |
}
|
@@ -112,6 +111,19 @@ static $current_user;
|
|
112 |
}
|
113 |
}
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
// Test if a given user has a given role.
|
116 |
// @1: str role
|
117 |
// @2: int user id, default current user
|
@@ -134,14 +146,19 @@ function wppa_user_is( $role, $user_id = null ) {
|
|
134 |
}
|
135 |
|
136 |
function wppa_user_is_admin() {
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
138 |
}
|
139 |
|
140 |
// Test if current user has extended access
|
141 |
// returns bool
|
142 |
function wppa_extended_access() {
|
143 |
|
144 |
-
if (
|
145 |
return true;
|
146 |
}
|
147 |
|
@@ -160,7 +177,7 @@ global $wp_roles;
|
|
160 |
}
|
161 |
|
162 |
// Admin can do everything
|
163 |
-
if (
|
164 |
return true;
|
165 |
}
|
166 |
|
@@ -202,7 +219,7 @@ global $wp_roles;
|
|
202 |
// returns bool
|
203 |
function wppa_can_create_top_album() {
|
204 |
|
205 |
-
if (
|
206 |
return true;
|
207 |
}
|
208 |
if ( ! wppa_can_create_album() ) {
|
@@ -536,7 +553,7 @@ function wppa_user_is_basic() {
|
|
536 |
global $wp_roles;
|
537 |
|
538 |
// Admin and super can not be basic
|
539 |
-
if (
|
540 |
return false;
|
541 |
}
|
542 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains user and capabilities related routines
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
103 |
return $current_user->user_firstname.' '.$current_user->user_lastname;
|
104 |
break;
|
105 |
default:
|
|
|
106 |
return '';
|
107 |
}
|
108 |
}
|
111 |
}
|
112 |
}
|
113 |
|
114 |
+
// Get display name of owner
|
115 |
+
function wppa_get_owner_display( $owner ) {
|
116 |
+
|
117 |
+
$usr = get_user_by( 'login', $owner );
|
118 |
+
|
119 |
+
// If user does not exist, probably ip address, return untranslated
|
120 |
+
if ( ! $usr ) {
|
121 |
+
return $owner;
|
122 |
+
}
|
123 |
+
|
124 |
+
return $usr->display_name;
|
125 |
+
}
|
126 |
+
|
127 |
// Test if a given user has a given role.
|
128 |
// @1: str role
|
129 |
// @2: int user id, default current user
|
146 |
}
|
147 |
|
148 |
function wppa_user_is_admin() {
|
149 |
+
static $bret;
|
150 |
+
|
151 |
+
if ( $bret === NULL ) {
|
152 |
+
$bret = wppa_user_is( 'administrator' );
|
153 |
+
}
|
154 |
+
return $bret;
|
155 |
}
|
156 |
|
157 |
// Test if current user has extended access
|
158 |
// returns bool
|
159 |
function wppa_extended_access() {
|
160 |
|
161 |
+
if ( wppa_user_is_admin() ) {
|
162 |
return true;
|
163 |
}
|
164 |
|
177 |
}
|
178 |
|
179 |
// Admin can do everything
|
180 |
+
if ( wppa_user_is_admin() ) {
|
181 |
return true;
|
182 |
}
|
183 |
|
219 |
// returns bool
|
220 |
function wppa_can_create_top_album() {
|
221 |
|
222 |
+
if ( wppa_user_is_admin() ) {
|
223 |
return true;
|
224 |
}
|
225 |
if ( ! wppa_can_create_album() ) {
|
553 |
global $wp_roles;
|
554 |
|
555 |
// Admin and super can not be basic
|
556 |
+
if ( wppa_user_is_admin() ) {
|
557 |
return false;
|
558 |
}
|
559 |
|
wppa-utils.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -379,14 +379,14 @@ function wppa_html( $str ) {
|
|
379 |
// get a photos album id
|
380 |
function wppa_get_album_id_by_photo_id( $id ) {
|
381 |
|
382 |
-
if ( !
|
383 |
$thumb = wppa_cache_photo($id);
|
384 |
return $thumb['album'];
|
385 |
}
|
386 |
|
387 |
function wppa_get_rating_count_by_id($id) {
|
388 |
|
389 |
-
if ( !
|
390 |
$thumb = wppa_cache_photo($id);
|
391 |
return $thumb['rating_count'];
|
392 |
}
|
@@ -394,7 +394,7 @@ function wppa_get_rating_count_by_id($id) {
|
|
394 |
function wppa_get_rating_by_id($id, $opt = '') {
|
395 |
global $wpdb;
|
396 |
|
397 |
-
if ( !
|
398 |
$thumb = wppa_cache_photo( $id );
|
399 |
$rating = $thumb['mean_rating'];
|
400 |
if ( $rating ) {
|
@@ -411,7 +411,7 @@ global $wpdb;
|
|
411 |
function wppa_get_rating_total_by_id($id) {
|
412 |
global $wpdb;
|
413 |
|
414 |
-
if ( !
|
415 |
|
416 |
$result = $wpdb->get_var( $wpdb->prepare( "SELECT SUM(value) FROM $wpdb->wppa_rating WHERE photo = %d", $id ) );
|
417 |
return $result;
|
@@ -420,7 +420,7 @@ global $wpdb;
|
|
420 |
function wppa_get_my_rating_by_id($id, $opt = '') {
|
421 |
global $wpdb;
|
422 |
|
423 |
-
if ( !
|
424 |
|
425 |
$my_ratings = $wpdb->get_results( $wpdb->prepare( "SELECT value FROM $wpdb->wppa_rating WHERE photo = %d AND user = %s", $id, wppa_get_user() ), ARRAY_A );
|
426 |
if ( $my_ratings ) {
|
@@ -1328,7 +1328,7 @@ global $wpdb;
|
|
1328 |
|
1329 |
// Check if album exists, otherwise recreate it
|
1330 |
if ( ! wppa_album_exists( $real_alb ) ) {
|
1331 |
-
|
1332 |
$iret =
|
1333 |
wppa_create_album_entry(
|
1334 |
array( 'id' => $real_alb,
|
@@ -1359,19 +1359,6 @@ global $wpdb;
|
|
1359 |
wppa_clear_taglist();
|
1360 |
}
|
1361 |
|
1362 |
-
function wppa_microtime($txt = '') {
|
1363 |
-
static $old;
|
1364 |
-
|
1365 |
-
$new = microtime(true);
|
1366 |
-
if ( $old ) {
|
1367 |
-
$delta = $new - $old;
|
1368 |
-
$old = $new;
|
1369 |
-
$msg = sprintf('%s took %7.3f s.', $txt, $delta);
|
1370 |
-
wppa_dbg_msg($msg, 'green', true);
|
1371 |
-
}
|
1372 |
-
else $old = $new;
|
1373 |
-
}
|
1374 |
-
|
1375 |
function wppa_sanitize_cats( $value ) {
|
1376 |
return wppa_sanitize_tags( $value );
|
1377 |
}
|
@@ -2042,12 +2029,12 @@ function wppa_cdn( $side ) {
|
|
2042 |
}
|
2043 |
}
|
2044 |
else {
|
2045 |
-
|
2046 |
$cdn = false;
|
2047 |
}
|
2048 |
}
|
2049 |
else {
|
2050 |
-
|
2051 |
$cdn = false; // Incomplete configuration
|
2052 |
}
|
2053 |
break;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
+
* Version 8.2.05.001
|
7 |
*
|
8 |
*/
|
9 |
|
379 |
// get a photos album id
|
380 |
function wppa_get_album_id_by_photo_id( $id ) {
|
381 |
|
382 |
+
if ( ! wppa_is_int($id) || $id < '1' ) return '';
|
383 |
$thumb = wppa_cache_photo($id);
|
384 |
return $thumb['album'];
|
385 |
}
|
386 |
|
387 |
function wppa_get_rating_count_by_id($id) {
|
388 |
|
389 |
+
if ( ! wppa_is_int($id) || $id < '1' ) return '';
|
390 |
$thumb = wppa_cache_photo($id);
|
391 |
return $thumb['rating_count'];
|
392 |
}
|
394 |
function wppa_get_rating_by_id($id, $opt = '') {
|
395 |
global $wpdb;
|
396 |
|
397 |
+
if ( ! wppa_is_int($id) || $id < '1' ) return '';
|
398 |
$thumb = wppa_cache_photo( $id );
|
399 |
$rating = $thumb['mean_rating'];
|
400 |
if ( $rating ) {
|
411 |
function wppa_get_rating_total_by_id($id) {
|
412 |
global $wpdb;
|
413 |
|
414 |
+
if ( ! wppa_is_int($id) || $id < '1' ) return '';
|
415 |
|
416 |
$result = $wpdb->get_var( $wpdb->prepare( "SELECT SUM(value) FROM $wpdb->wppa_rating WHERE photo = %d", $id ) );
|
417 |
return $result;
|
420 |
function wppa_get_my_rating_by_id($id, $opt = '') {
|
421 |
global $wpdb;
|
422 |
|
423 |
+
if ( ! wppa_is_int($id) || $id < '1' ) return '';
|
424 |
|
425 |
$my_ratings = $wpdb->get_results( $wpdb->prepare( "SELECT value FROM $wpdb->wppa_rating WHERE photo = %d AND user = %s", $id, wppa_get_user() ), ARRAY_A );
|
426 |
if ( $my_ratings ) {
|
1328 |
|
1329 |
// Check if album exists, otherwise recreate it
|
1330 |
if ( ! wppa_album_exists( $real_alb ) ) {
|
1331 |
+
|
1332 |
$iret =
|
1333 |
wppa_create_album_entry(
|
1334 |
array( 'id' => $real_alb,
|
1359 |
wppa_clear_taglist();
|
1360 |
}
|
1361 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1362 |
function wppa_sanitize_cats( $value ) {
|
1363 |
return wppa_sanitize_tags( $value );
|
1364 |
}
|
2029 |
}
|
2030 |
}
|
2031 |
else {
|
2032 |
+
wppa_log( 'dbg', 'Wrong arg:'.$side.' in wppa_cdn()' );
|
2033 |
$cdn = false;
|
2034 |
}
|
2035 |
}
|
2036 |
else {
|
2037 |
+
wppa_log( 'err', 'Incomplete configuration of Cloudinary' );
|
2038 |
$cdn = false; // Incomplete configuration
|
2039 |
}
|
2040 |
break;
|
wppa-video.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all video routines
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -163,8 +163,6 @@ function wppa_get_video_body( $id, $for_lb = false, $w = '0', $h = '0' ) {
|
|
163 |
$is_safari = false;
|
164 |
}
|
165 |
|
166 |
-
wppa_dbg_msg('Mp4:'.$mp4.', Opera:'.$is_opera.', Ie:'.$is_ie.', Saf:'.$is_safari);
|
167 |
-
|
168 |
// Assume the browser supports html5
|
169 |
$ext = '';
|
170 |
if ( $is_opera ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all video routines
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*/
|
9 |
|
163 |
$is_safari = false;
|
164 |
}
|
165 |
|
|
|
|
|
166 |
// Assume the browser supports html5
|
167 |
$ext = '';
|
168 |
if ( $is_opera ) {
|
wppa-watermark.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-watermark.php
|
3 |
*
|
4 |
* Functions used for the application of watermarks
|
5 |
-
* Version 8.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -425,7 +425,7 @@ function wppa_add_watermark( $id ) {
|
|
425 |
if ( ! is_array( $watersize ) ) return false; // Not a valid picture file
|
426 |
$waterimage = wppa_imagecreatefrompng( $waterfile );
|
427 |
if ( empty( $waterimage ) or ( !$waterimage ) ) {
|
428 |
-
|
429 |
return false; // No image
|
430 |
}
|
431 |
imagealphablending( $waterimage, false );
|
2 |
/* wppa-watermark.php
|
3 |
*
|
4 |
* Functions used for the application of watermarks
|
5 |
+
* Version 8.2.05.000
|
6 |
*
|
7 |
*/
|
8 |
|
425 |
if ( ! is_array( $watersize ) ) return false; // Not a valid picture file
|
426 |
$waterimage = wppa_imagecreatefrompng( $waterfile );
|
427 |
if ( empty( $waterimage ) or ( !$waterimage ) ) {
|
428 |
+
wppa_log( 'Err', 'Watermark file '.$waterfile.' not found or corrupt' );
|
429 |
return false; // No image
|
430 |
}
|
431 |
imagealphablending( $waterimage, false );
|
wppa-widget-functions.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-widget-functions.php
|
3 |
/* Package: wp-photo-album-plus
|
4 |
/*
|
5 |
-
/* Version 8.2.
|
6 |
/*
|
7 |
*/
|
8 |
|
@@ -159,7 +159,6 @@ global $wpdb;
|
|
159 |
// Do the query
|
160 |
if ( $query ) {
|
161 |
$photos = $wpdb->get_results( $query, ARRAY_A );
|
162 |
-
wppa_dbg_msg( 'Potd query: '.$query );
|
163 |
|
164 |
// Strip void photos
|
165 |
$photos = wppa_strip_void_photos( $photos );
|
2 |
/* wppa-widget-functions.php
|
3 |
/* Package: wp-photo-album-plus
|
4 |
/*
|
5 |
+
/* Version 8.2.05.000
|
6 |
/*
|
7 |
*/
|
8 |
|
159 |
// Do the query
|
160 |
if ( $query ) {
|
161 |
$photos = $wpdb->get_results( $query, ARRAY_A );
|
|
|
162 |
|
163 |
// Strip void photos
|
164 |
$photos = wppa_strip_void_photos( $photos );
|
wppa-wpdb-insert.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that add new records
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -618,7 +618,6 @@ global $wpdb;
|
|
618 |
}
|
619 |
update_option( $name, $lastkey );
|
620 |
}
|
621 |
-
// wppa_dbg_msg( 'Lastkey in ' . $table . ' = ' . $lastkey );
|
622 |
|
623 |
$result = $lastkey + '1';
|
624 |
while ( ! wppa_is_id_free( $table, $result ) ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that add new records
|
6 |
+
* Version 8.2.05.000
|
7 |
*
|
8 |
*/
|
9 |
|
618 |
}
|
619 |
update_option( $name, $lastkey );
|
620 |
}
|
|
|
621 |
|
622 |
$result = $lastkey + '1';
|
623 |
while ( ! wppa_is_id_free( $table, $result ) ) {
|
wppa-wrappers.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Contains wrappers for standard php functions
|
6 |
* For security and bug reasons
|
7 |
*
|
8 |
-
* Version 8.2.
|
9 |
*
|
10 |
*/
|
11 |
|
@@ -222,7 +222,6 @@ function wppa_glob( $pattern, $flags = 0, $wp_content = false ) {
|
|
222 |
}
|
223 |
|
224 |
// Get dirlist
|
225 |
-
// wppa_log('obs', 'Flags = '.$flags.', filtered = '.intval($flags) and 0xFBFF);
|
226 |
$dirlist = glob( $pattern, intval($flags) and 0xFBFF );
|
227 |
|
228 |
// Init result;
|
5 |
* Contains wrappers for standard php functions
|
6 |
* For security and bug reasons
|
7 |
*
|
8 |
+
* Version 8.2.05.001
|
9 |
*
|
10 |
*/
|
11 |
|
222 |
}
|
223 |
|
224 |
// Get dirlist
|
|
|
225 |
$dirlist = glob( $pattern, intval($flags) and 0xFBFF );
|
226 |
|
227 |
// Init result;
|
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.2.
|
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.2.
|
28 |
global $wppa_revno;
|
29 |
$wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
|
30 |
|
@@ -149,21 +149,15 @@ define( 'WPPA_DEBUG', false );
|
|
149 |
|
150 |
/* Declare init actions */
|
151 |
|
152 |
-
/*
|
153 |
add_action( 'init', 'wppa_begin_session', 1 );
|
154 |
add_action( 'admin_init', 'wppa_begin_session', 1 );
|
155 |
|
156 |
/* Init path and url constants */
|
157 |
add_action( 'init', 'wppa_init_path_and_url_constants', 1 );
|
158 |
|
159 |
-
/* Load language */
|
160 |
-
// add_action( 'plugins_loaded', 'wppa_load_plugin_textdomain' );
|
161 |
-
|
162 |
/* May not be there yet, so try again */
|
163 |
-
add_action( 'init', 'wppa_load_plugin_textdomain'
|
164 |
-
|
165 |
-
/* SET UP array $wppa, array $wppa_opt. Must be done after language has been set */
|
166 |
-
//add_action( 'init', 'wppa_initialize_runtime', 11 );
|
167 |
|
168 |
/* Load adminbar menu if required, after translations loaded */
|
169 |
add_action( 'init', 'wppa_admin_bar_init', 12);
|
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.2.05.001
|
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.2.05.001'; // WPPA software version
|
28 |
global $wppa_revno;
|
29 |
$wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
|
30 |
|
149 |
|
150 |
/* Declare init actions */
|
151 |
|
152 |
+
/* Start session */
|
153 |
add_action( 'init', 'wppa_begin_session', 1 );
|
154 |
add_action( 'admin_init', 'wppa_begin_session', 1 );
|
155 |
|
156 |
/* Init path and url constants */
|
157 |
add_action( 'init', 'wppa_init_path_and_url_constants', 1 );
|
158 |
|
|
|
|
|
|
|
159 |
/* May not be there yet, so try again */
|
160 |
+
add_action( 'init', 'wppa_load_plugin_textdomain' );
|
|
|
|
|
|
|
161 |
|
162 |
/* Load adminbar menu if required, after translations loaded */
|
163 |
add_action( 'init', 'wppa_admin_bar_init', 12);
|