Version Description
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 6.7.07 |
Comparing to | |
See all releases |
Code changes from version 6.7.06 to 6.7.07
- cloudinary/index.php +3 -0
- fonts/index.php +3 -0
- fonts/turkije.jpg +0 -0
- img/index.php +3 -0
- js/index.php +3 -0
- js/wppa-ajax-front.js +10 -4
- js/wppa-ajax-front.min.js +1 -1
- js/wppa-tinymce-shortcodes.js +40 -19
- languages/index.php +3 -0
- readme.txt +20 -2
- watermarks/index.php +3 -0
- wppa-admin-functions.php +5 -3
- wppa-admin.php +4 -2
- wppa-ajax.php +4 -1
- wppa-album-admin-autosave.php +31 -22
- wppa-album-navigator-widget.php +57 -40
- wppa-album-widget.php +23 -8
- wppa-boxes-html.php +99 -1
- wppa-common-functions.php +296 -162
- wppa-filter.php +5 -1
- wppa-functions.php +6 -2
- wppa-non-admin.php +3 -3
- wppa-photo-admin-autosave.php +20 -9
- wppa-settings-autosave.php +21 -0
- wppa-setup.php +1 -0
- wppa-tinymce-shortcodes.php +49 -20
- wppa-upldr-widget.php +12 -5
- wppa-utils.php +67 -8
- wppa.php +3 -3
cloudinary/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
?>
|
fonts/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
?>
|
fonts/turkije.jpg
ADDED
Binary file
|
img/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
?>
|
js/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
?>
|
js/wppa-ajax-front.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
// Contains frontend ajax modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
//
|
6 |
-
var wppaJsAjaxVersion = '6.
|
7 |
|
8 |
var wppaRenderAdd = false;
|
9 |
var wppaWaitForCounter = 0;
|
@@ -23,8 +23,8 @@ function wppaDoAjaxRender( mocc, ajaxurl, newurl, add, waitfor, addHilite ) {
|
|
23 |
if ( wppaAutoColumnWidth[mocc] ) ajaxurl += '&resp=1';
|
24 |
if ( addHilite && _wppaCurIdx[mocc] && _wppaId[mocc][_wppaCurIdx[mocc]] ) ajaxurl += '&wppa-hilite=' + _wppaId[mocc][_wppaCurIdx[mocc]];
|
25 |
|
26 |
-
// Ajax possible ?
|
27 |
-
if ( wppaCanAjaxRender ) {
|
28 |
|
29 |
jQuery.ajax( { url: ajaxurl,
|
30 |
async: true,
|
@@ -46,7 +46,9 @@ function wppaDoAjaxRender( mocc, ajaxurl, newurl, add, waitfor, addHilite ) {
|
|
46 |
|
47 |
else {
|
48 |
|
49 |
-
if
|
|
|
|
|
50 |
|
51 |
// Init dialog options
|
52 |
var opt = {
|
@@ -94,8 +96,12 @@ function wppaDoAjaxRender( mocc, ajaxurl, newurl, add, waitfor, addHilite ) {
|
|
94 |
jQuery( '.ui-button' ).on( 'click', function() { _wppaStop( mocc ); } );
|
95 |
}
|
96 |
|
|
|
97 |
else {
|
98 |
jQuery( '#wppa-container-'+mocc ).html( result );
|
|
|
|
|
|
|
99 |
}
|
100 |
}
|
101 |
|
3 |
// Contains frontend ajax modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
//
|
6 |
+
var wppaJsAjaxVersion = '6.7.07';
|
7 |
|
8 |
var wppaRenderAdd = false;
|
9 |
var wppaWaitForCounter = 0;
|
23 |
if ( wppaAutoColumnWidth[mocc] ) ajaxurl += '&resp=1';
|
24 |
if ( addHilite && _wppaCurIdx[mocc] && _wppaId[mocc][_wppaCurIdx[mocc]] ) ajaxurl += '&wppa-hilite=' + _wppaId[mocc][_wppaCurIdx[mocc]];
|
25 |
|
26 |
+
// Ajax possible, or no newurl defined ?
|
27 |
+
if ( wppaCanAjaxRender || ! newurl ) {
|
28 |
|
29 |
jQuery.ajax( { url: ajaxurl,
|
30 |
async: true,
|
46 |
|
47 |
else {
|
48 |
|
49 |
+
// Do not render modal if behind button. When behind button, there is no newurl,
|
50 |
+
// so we test on the existence of newurl to see if it is behind button
|
51 |
+
if ( wppaRenderModal && newurl ) {
|
52 |
|
53 |
// Init dialog options
|
54 |
var opt = {
|
96 |
jQuery( '.ui-button' ).on( 'click', function() { _wppaStop( mocc ); } );
|
97 |
}
|
98 |
|
99 |
+
// Not modal or behind button
|
100 |
else {
|
101 |
jQuery( '#wppa-container-'+mocc ).html( result );
|
102 |
+
|
103 |
+
// If behind button: show hide buttton
|
104 |
+
jQuery( '#wppa-button-hide-'+mocc ).show();
|
105 |
}
|
106 |
}
|
107 |
|
js/wppa-ajax-front.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function wppaDoAjaxRender(a,p,e,t,o,r){parseInt(o)>0&&o!=wppaWaitForCounter?setTimeout("wppaDoAjaxRender( "+a+", '"+p+"', '"+e+"', '"+t+"', "+o+" )",100):(wppaRenderAdd=t,""!=wppaLang&&(p+="&lang="+wppaLang),wppaAutoColumnWidth[a]&&(p+="&resp=1"),r&&_wppaCurIdx[a]&&_wppaId[a][_wppaCurIdx[a]]&&(p+="&wppa-hilite="+_wppaId[a][_wppaCurIdx[a]]),wppaCanAjaxRender?jQuery.ajax({url:p,async:!0,type:"GET",timeout:6e4,beforeSend:function(p){_wppaSSRuns[a]&&_wppaStop(a),jQuery("#wppa-ajax-spin-"+a).fadeIn()},success:function(p,t,o){if(wppaRenderAdd)jQuery(wppaRenderAdd+p).insertBefore("#wppa-container-"+a+"-end");else if(wppaRenderModal){var r={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+a).html(p).dialog(r).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(a)})}else jQuery("#wppa-container-"+a).html(p);if(wppaCanPushState&&wppaUpdateAddressLine){wppaHis++;try{history.pushState({page:wppaHis,occur:a,type:"html",html:p},"",e),wppaConsoleLog("Ajax rendering: History stack pushed","force")}catch(p){try{history.replaceState({page:wppaHis,occur:a,type:"html"},"",e),wppaConsoleLog("Ajax rendering: History stack updated","force")}catch(a){wppaConsoleLog("Ajax rendering: History stack update failed","force")}}0==wppaFirstOccur&&(wppaFirstOccur=a)}wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&(wppaConsoleLog("Ajax render asked qr code for "+e,"force"),wppaQRUpdate(e)),wppaColWidth[a]=0,_wppaDoAutocol(a);var n=p.indexOf("<script"),i=p.lastIndexOf("<script");-1==n?wppaConsoleLog("Ajax render did NOT contain a script tag","force"):wppaConsoleLog("Ajax render did contain a script tag at position "+n+" last at "+i,"force")},error:function(p,t,o){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+o+", status = "+t,"force"),document.location.href=e,wppaColWidth[a]=0,_wppaDoAutocol(a)},complete:function(p,e,t){wppaWaitForCounter++,wppaRenderModal||jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+a).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery("#wppa-ajax-spin-"+a).stop().fadeOut(),setTimeout(function(){jQuery(window).trigger("resize")},250)}}):(document.location.href=e,wppaColWidth[a]=0,_wppaDoAutocol(a)))}function wppaAjaxApprovePhoto(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+a,async:!0,type:"GET",timeout:6e4,success:function(p,e,t){"OK"==p?jQuery(".wppa-approve-"+a).css("display","none"):alert(p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemovePhoto(a,p,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+p,async:!0,type:"GET",timeout:6e4,success:function(t,o,r){rtxt=t.split("||"),"OK"==rtxt[0]?e?(jQuery("#wppa-film-"+_wppaCurIdx[a]+"-"+a).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[a]+"-"+a).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[a]+"-"+a).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[a]+"-"+a).attr("alt","removed"),wppaNext(a)):(jQuery(".wppa-approve-"+p).css("display","none"),jQuery(".thumbnail-frame-photo-"+p).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+p).css("text-decoration","line-through")):alert(t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxApproveComment(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+a,async:!0,type:"GET",timeout:6e4,success:function(p,e,t){"OK"==p?jQuery(".wppa-approve-"+a).css("display","none"):alert(p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemoveComment(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+a,async:!0,type:"GET",timeout:6e4,success:function(p,e,t){"OK"==p.split("||")[0]?(jQuery(".wppa-approve-"+a).css("display","none"),jQuery(".wppa-comment-"+a).css("display","none")):alert(p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxAddPhotoToZip(a,p,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+p,async:!0,type:"GET",timeout:6e4,success:function(t,o,r){var n=t.split("||");"OK"==n[0]?(jQuery("#admin-choice-"+p+"-"+a).html(n[1]),jQuery("#admin-choice-"+p+"-"+a).val(n[1]),jQuery("#admin-choice-"+p+"-"+a).prop("disabled",!0)):alert(t),e&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,p,e){document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+e+", status = "+p,"force")}})}function wppaEditPhoto(a,p){var e=String(p),t="Edit Photo "+e,o=wppaEditPhotoWidth;screen.availWidth<o&&(o=screen.availWidth);var r;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+e+"&moccur="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){if("classic"==wppaUploadEdit){(r=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+o+", height=512",!0)).document.write("<! DOCTYPE html>"),r.document.write("<html>"),r.document.write("<head>");var p='<meta name="viewport" content="width='+o+'" ><link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+"/wppa-admin-styles.css?ver="+wppaVersion+'" type="text/css" media="all" /><link rel="stylesheet" id="theme_style" href="'+wppaThemeStyles+'" type="text/css" media="all" /><style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style><script type="text/javascript" src="'+wppaIncludeUrl+"/js/jquery/jquery.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-utils.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-admin-scripts.js?ver="+wppaVersion+'"><\/script><title>'+t+'</title><script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";<\/script>';r.document.write(p),r.document.write("</head>"),r.document.write("<body>")}},success:function(p,e,t){if("classic"==wppaUploadEdit&&r.document.write(p),"new"==wppaUploadEdit){var o={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+a).html(p).dialog(o).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close")}},error:function(a,p,e){"classic"==wppaUploadEdit&&r.document.write(p+" "+e),wppaConsoleLog("wppaEditPhoto failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,t){"classic"==wppaUploadEdit&&(r.document.write('<script>wppaPhotoStatusChange( "'+e+'" )<\/script>'),r.document.write("</body>"),r.document.write("</html>"))}})}function wppaPrevTags(a,p,e,t){for(var o=jQuery("."+a),r=[],n="",i=jQuery("#"+e).val(),c=0,u=0,s="";c<o.length;)o[c].selected&&(r[u]=o[c].value,u++),c++;""!=(n=jQuery("#"+p).val())&&(r[u]=n),s=r.join(),""==n&&""==e||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+s+"&album="+i,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,p,e){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,p,e){jQuery("#"+t).html('<span style="color:red" >'+e+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDestroyAlbum(a,p){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+p,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+e+", status = "+p,"force")}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,p,e){wppaConsoleLog("_bumpClickCount success.")},error:function(a,p,e){wppaConsoleLog("_bumpClickCount failed. Error = "+e+", status = "+p,"force")}})}function _bumpViewCount(a){wppaBumpViewCount&&(wppaPhotoView[a]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(p,e,t){wppaPhotoView[a]=!0},error:function(a,p,e){wppaConsoleLog("_bumpViewCount failed. Error = "+e+", status = "+p,"force")}}))}function wppaVoteThumb(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+p+"&wppa-occur="+a+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(e,t,o){jQuery("#wppa-vote-button-"+a+"-"+p).val(wppaVotedForMe)},error:function(a,p,e){wppaConsoleLog("wppaVoteThumb failed. Error = "+e+", status = "+p,"force")}})}function _wppaRateIt(a,p){if(0!=p&&!_wppaSSRuns[a]){var e=_wppaId[a][_wppaCurIdx[a]],t=_wppaMyr[a][_wppaCurIdx[a]],o=_wppaWaitTexts[a][_wppaCurIdx[a]];o.length>0?alert(o):0!=t&&wppaRatingOnce||t<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+e+"&wppa-occur="+a+"&wppa-index="+_wppaCurIdx[a]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(e){jQuery("#wppa-rate-"+a+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+a+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+a).attr("src",wppaImageDirectory+"spinner.gif")},success:function(p,e,t){var o=p.split("||");if(0==o[0])900==o[1]?(alert(o[2]),_wppaSetRatingDisplay(a)):alert("Error Code="+o[1]+"\n\n"+o[2]);else{if(o[7]&&"likes"==o[7]){var r=o[4].split("|");jQuery("#wppa-like-"+a).attr("title",r[0]),jQuery("#wppa-liketext-"+a).html(r[1]),"1"==o[3]?jQuery("#wppa-like-"+a).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+a).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[o[0]][o[2]]=o[3],_wppaAvg[o[0]][o[2]]=o[4]}else _wppaMyr[o[0]][o[2]]=o[3],_wppaAvg[o[0]][o[2]]=o[4],_wppaDisc[o[0]][o[2]]=o[5],_wppaSetRatingDisplay(a),wppaCommentRequiredAfterVote&&0==o[6]&&alert(o[7]);wppaNextOnCallback&&_wppaNextOnCallback(a)}},error:function(a,p,e){wppaConsoleLog("_wppaRateIt failed. Error = "+e+", status = "+p,"force")}}))}}function _wppaOvlRateIt(a,p,e,t){0!=p&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+a+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(t){jQuery(".wppa-rate-"+e+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+e+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+a+"-"+e).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(o,r,n){wppaConsoleLog(o,"force");var i=o.split("||");if(0==i[0])900==i[1]?alert(i[2]):alert("Error Code="+i[1]+"\n\n"+i[2]),jQuery(".wppa-rate-"+e+"-"+p).attr("src",wppaImageDirectory+"cross.png");else{if(i[7]&&"likes"==i[7]){var c=i[4].split("|");return jQuery("#wppa-like-0").attr("title",c[0]),jQuery("#wppa-liketext-0").html(c[1]),"1"==i[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+a+"-"+e).attr("title",c[0]),jQuery("#wppa-liketext-"+a+"-"+e).html(c[1]),void("1"==i[3]?jQuery("#wppa-like-"+a+"-"+e).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+a+"-"+e).attr("src",wppaImageDirectory+"thumbup.png"))}if(_wppaSetRd(e,i[4],".wppa-avg-"),_wppaSetRd(e,i[3],".wppa-rate-"),t)return;wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,p,e){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxMakeOrigName(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+p+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){var t=a.split("||");"0"==t[1]?wppaIsSafari?("file"==wppaArtMonkyLink&&(wppaWindowReference.location=t[2]),"zip"==wppaArtMonkyLink&&(document.location=t[2])):("file"==wppaArtMonkyLink&&window.open(t[2]),"zip"==wppaArtMonkyLink&&(document.location=t[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+t[1]+"\n\n"+t[2]))},error:function(a,p,e){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}function wppaAjaxDownloadAlbum(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+p,async:!0,type:"GET",timeout:6e4,beforeSend:function(e){jQuery("#dwnspin-"+a+"-"+p).css("display","")},success:function(a,p,e){var t=a.split("||"),o=t[0],r=t[1],n=t[2];3==t.length&&""!=n&&alert("Attention:\n\n"+n),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,p,e){alert("An error occurred:\n"+e+"\nPlease try again")},complete:function(e,t,o){jQuery("#dwnspin-"+a+"-"+p).css("display","none")}})}function wppaAjaxComment(a,p){if(_wppaValidateComment(a,p)){var e="action=wppa&wppa-action=do-comment&photo-id="+p+"&comname="+jQuery("#wppa-comname-"+a).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+a).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+a).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val()+"&moccur="+a;void 0!==jQuery("#wppa-comemail-"+a).val()&&(e+="&comemail="+jQuery("#wppa-comemail-"+a).val()),void 0!==jQuery("#wppa-comment-edit-"+a).val()&&(e+="&comment-edit="+jQuery("#wppa-comment-edit-"+a).val()),void 0!==jQuery("#wppa-returnurl-"+a).val()&&(e+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+a).val())),jQuery.ajax({url:wppaAjaxUrl,data:e,async:!0,type:"POST",timeout:6e4,beforeSend:function(p){jQuery("#wppa-comment-spin-"+a).css("display","inline")},success:function(p,e,t){p=p.replace(/\\/g,""),jQuery("#wppa-comments-"+a).html(p),_wppaCurIdx[a]&&(_wppaCommentHtml[a][_wppaCurIdx[a]]=p),wppaOpenComments(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxComment failed. Error = "+e+", status = "+p,"force")},complete:function(p,e,t){jQuery("#wppa-comment-spin-"+a).css("display","none")}})}}function wppaUpdatePhotoNew(a){for(var p=["name","description","tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],e="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),t=0;t<p.length;)void 0!==jQuery("#"+p[t]).val()&&(e+="&"+p[t]+"="+jQuery("#"+p[t]).val()),t++;jQuery.ajax({url:wppaAjaxUrl,data:e,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,p,e){a.length>0&&alert(a)},error:function(a,p,e){alert(result),wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}function wppaAjaxSetQrCodeSrc(a,p){if(wppaLastQrcodeUrl!=a){wppaLastQrcodeUrl=a;var e="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a);jQuery.ajax({url:wppaAjaxUrl,data:e,async:!0,type:"POST",timeout:1e4,success:function(a,e,t){document.getElementById(p).src=a,wppaConsoleLog("wppaAjaxSetQrCodeSrc put "+a+" into "+p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+e+", status = "+p,"force")}})}}var wppaJsAjaxVersion="6.6.31",wppaRenderAdd=!1,wppaWaitForCounter=0,wppaLastQrcodeUrl="";wppaConsoleLog("wppa-ajax-front.js version "+wppaJsAjaxVersion+" loaded.","force");
|
1 |
+
function wppaDoAjaxRender(a,p,e,t,o,r){parseInt(o)>0&&o!=wppaWaitForCounter?setTimeout("wppaDoAjaxRender( "+a+", '"+p+"', '"+e+"', '"+t+"', "+o+" )",100):(wppaRenderAdd=t,""!=wppaLang&&(p+="&lang="+wppaLang),wppaAutoColumnWidth[a]&&(p+="&resp=1"),r&&_wppaCurIdx[a]&&_wppaId[a][_wppaCurIdx[a]]&&(p+="&wppa-hilite="+_wppaId[a][_wppaCurIdx[a]]),wppaCanAjaxRender||!e?jQuery.ajax({url:p,async:!0,type:"GET",timeout:6e4,beforeSend:function(p){_wppaSSRuns[a]&&_wppaStop(a),jQuery("#wppa-ajax-spin-"+a).fadeIn()},success:function(p,t,o){if(wppaRenderAdd)jQuery(wppaRenderAdd+p).insertBefore("#wppa-container-"+a+"-end");else if(wppaRenderModal&&e){var r={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+a).html(p).dialog(r).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(a)})}else jQuery("#wppa-container-"+a).html(p),jQuery("#wppa-button-hide-"+a).show();if(wppaCanPushState&&wppaUpdateAddressLine){wppaHis++;try{history.pushState({page:wppaHis,occur:a,type:"html",html:p},"",e),wppaConsoleLog("Ajax rendering: History stack pushed","force")}catch(p){try{history.replaceState({page:wppaHis,occur:a,type:"html"},"",e),wppaConsoleLog("Ajax rendering: History stack updated","force")}catch(a){wppaConsoleLog("Ajax rendering: History stack update failed","force")}}0==wppaFirstOccur&&(wppaFirstOccur=a)}wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&(wppaConsoleLog("Ajax render asked qr code for "+e,"force"),wppaQRUpdate(e)),wppaColWidth[a]=0,_wppaDoAutocol(a);var n=p.indexOf("<script"),i=p.lastIndexOf("<script");-1==n?wppaConsoleLog("Ajax render did NOT contain a script tag","force"):wppaConsoleLog("Ajax render did contain a script tag at position "+n+" last at "+i,"force")},error:function(p,t,o){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+o+", status = "+t,"force"),document.location.href=e,wppaColWidth[a]=0,_wppaDoAutocol(a)},complete:function(p,e,t){wppaWaitForCounter++,wppaRenderModal||jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+a).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery("#wppa-ajax-spin-"+a).stop().fadeOut(),setTimeout(function(){jQuery(window).trigger("resize")},250)}}):(document.location.href=e,wppaColWidth[a]=0,_wppaDoAutocol(a)))}function wppaAjaxApprovePhoto(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+a,async:!0,type:"GET",timeout:6e4,success:function(p,e,t){"OK"==p?jQuery(".wppa-approve-"+a).css("display","none"):alert(p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemovePhoto(a,p,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+p,async:!0,type:"GET",timeout:6e4,success:function(t,o,r){rtxt=t.split("||"),"OK"==rtxt[0]?e?(jQuery("#wppa-film-"+_wppaCurIdx[a]+"-"+a).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[a]+"-"+a).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[a]+"-"+a).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[a]+"-"+a).attr("alt","removed"),wppaNext(a)):(jQuery(".wppa-approve-"+p).css("display","none"),jQuery(".thumbnail-frame-photo-"+p).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+p).css("text-decoration","line-through")):alert(t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxApproveComment(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+a,async:!0,type:"GET",timeout:6e4,success:function(p,e,t){"OK"==p?jQuery(".wppa-approve-"+a).css("display","none"):alert(p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemoveComment(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+a,async:!0,type:"GET",timeout:6e4,success:function(p,e,t){"OK"==p.split("||")[0]?(jQuery(".wppa-approve-"+a).css("display","none"),jQuery(".wppa-comment-"+a).css("display","none")):alert(p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxAddPhotoToZip(a,p,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+p,async:!0,type:"GET",timeout:6e4,success:function(t,o,r){var n=t.split("||");"OK"==n[0]?(jQuery("#admin-choice-"+p+"-"+a).html(n[1]),jQuery("#admin-choice-"+p+"-"+a).val(n[1]),jQuery("#admin-choice-"+p+"-"+a).prop("disabled",!0)):alert(t),e&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,p,e){document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+e+", status = "+p,"force")}})}function wppaEditPhoto(a,p){var e=String(p),t="Edit Photo "+e,o=wppaEditPhotoWidth;screen.availWidth<o&&(o=screen.availWidth);var r;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+e+"&moccur="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){if("classic"==wppaUploadEdit){(r=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+o+", height=512",!0)).document.write("<! DOCTYPE html>"),r.document.write("<html>"),r.document.write("<head>");var p='<meta name="viewport" content="width='+o+'" ><link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+"/wppa-admin-styles.css?ver="+wppaVersion+'" type="text/css" media="all" /><link rel="stylesheet" id="theme_style" href="'+wppaThemeStyles+'" type="text/css" media="all" /><style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style><script type="text/javascript" src="'+wppaIncludeUrl+"/js/jquery/jquery.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-utils.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-admin-scripts.js?ver="+wppaVersion+'"><\/script><title>'+t+'</title><script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";<\/script>';r.document.write(p),r.document.write("</head>"),r.document.write("<body>")}},success:function(p,e,t){if("classic"==wppaUploadEdit&&r.document.write(p),"new"==wppaUploadEdit){var o={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+a).html(p).dialog(o).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close")}},error:function(a,p,e){"classic"==wppaUploadEdit&&r.document.write(p+" "+e),wppaConsoleLog("wppaEditPhoto failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,t){"classic"==wppaUploadEdit&&(r.document.write('<script>wppaPhotoStatusChange( "'+e+'" )<\/script>'),r.document.write("</body>"),r.document.write("</html>"))}})}function wppaPrevTags(a,p,e,t){for(var o=jQuery("."+a),r=[],n="",i=jQuery("#"+e).val(),c=0,u=0,s="";c<o.length;)o[c].selected&&(r[u]=o[c].value,u++),c++;""!=(n=jQuery("#"+p).val())&&(r[u]=n),s=r.join(),""==n&&""==e||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+s+"&album="+i,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,p,e){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,p,e){jQuery("#"+t).html('<span style="color:red" >'+e+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDestroyAlbum(a,p){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+p,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+e+", status = "+p,"force")}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,p,e){wppaConsoleLog("_bumpClickCount success.")},error:function(a,p,e){wppaConsoleLog("_bumpClickCount failed. Error = "+e+", status = "+p,"force")}})}function _bumpViewCount(a){wppaBumpViewCount&&(wppaPhotoView[a]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(p,e,t){wppaPhotoView[a]=!0},error:function(a,p,e){wppaConsoleLog("_bumpViewCount failed. Error = "+e+", status = "+p,"force")}}))}function wppaVoteThumb(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+p+"&wppa-occur="+a+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(e,t,o){jQuery("#wppa-vote-button-"+a+"-"+p).val(wppaVotedForMe)},error:function(a,p,e){wppaConsoleLog("wppaVoteThumb failed. Error = "+e+", status = "+p,"force")}})}function _wppaRateIt(a,p){if(0!=p&&!_wppaSSRuns[a]){var e=_wppaId[a][_wppaCurIdx[a]],t=_wppaMyr[a][_wppaCurIdx[a]],o=_wppaWaitTexts[a][_wppaCurIdx[a]];o.length>0?alert(o):0!=t&&wppaRatingOnce||t<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+e+"&wppa-occur="+a+"&wppa-index="+_wppaCurIdx[a]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(e){jQuery("#wppa-rate-"+a+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+a+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+a).attr("src",wppaImageDirectory+"spinner.gif")},success:function(p,e,t){var o=p.split("||");if(0==o[0])900==o[1]?(alert(o[2]),_wppaSetRatingDisplay(a)):alert("Error Code="+o[1]+"\n\n"+o[2]);else{if(o[7]&&"likes"==o[7]){var r=o[4].split("|");jQuery("#wppa-like-"+a).attr("title",r[0]),jQuery("#wppa-liketext-"+a).html(r[1]),"1"==o[3]?jQuery("#wppa-like-"+a).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+a).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[o[0]][o[2]]=o[3],_wppaAvg[o[0]][o[2]]=o[4]}else _wppaMyr[o[0]][o[2]]=o[3],_wppaAvg[o[0]][o[2]]=o[4],_wppaDisc[o[0]][o[2]]=o[5],_wppaSetRatingDisplay(a),wppaCommentRequiredAfterVote&&0==o[6]&&alert(o[7]);wppaNextOnCallback&&_wppaNextOnCallback(a)}},error:function(a,p,e){wppaConsoleLog("_wppaRateIt failed. Error = "+e+", status = "+p,"force")}}))}}function _wppaOvlRateIt(a,p,e,t){0!=p&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+a+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(t){jQuery(".wppa-rate-"+e+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+e+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+a+"-"+e).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(o,r,n){wppaConsoleLog(o,"force");var i=o.split("||");if(0==i[0])900==i[1]?alert(i[2]):alert("Error Code="+i[1]+"\n\n"+i[2]),jQuery(".wppa-rate-"+e+"-"+p).attr("src",wppaImageDirectory+"cross.png");else{if(i[7]&&"likes"==i[7]){var c=i[4].split("|");return jQuery("#wppa-like-0").attr("title",c[0]),jQuery("#wppa-liketext-0").html(c[1]),"1"==i[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+a+"-"+e).attr("title",c[0]),jQuery("#wppa-liketext-"+a+"-"+e).html(c[1]),void("1"==i[3]?jQuery("#wppa-like-"+a+"-"+e).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+a+"-"+e).attr("src",wppaImageDirectory+"thumbup.png"))}if(_wppaSetRd(e,i[4],".wppa-avg-"),_wppaSetRd(e,i[3],".wppa-rate-"),t)return;wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,p,e){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxMakeOrigName(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+p+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){var t=a.split("||");"0"==t[1]?wppaIsSafari?("file"==wppaArtMonkyLink&&(wppaWindowReference.location=t[2]),"zip"==wppaArtMonkyLink&&(document.location=t[2])):("file"==wppaArtMonkyLink&&window.open(t[2]),"zip"==wppaArtMonkyLink&&(document.location=t[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+t[1]+"\n\n"+t[2]))},error:function(a,p,e){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}function wppaAjaxDownloadAlbum(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+p,async:!0,type:"GET",timeout:6e4,beforeSend:function(e){jQuery("#dwnspin-"+a+"-"+p).css("display","")},success:function(a,p,e){var t=a.split("||"),o=t[0],r=t[1],n=t[2];3==t.length&&""!=n&&alert("Attention:\n\n"+n),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,p,e){alert("An error occurred:\n"+e+"\nPlease try again")},complete:function(e,t,o){jQuery("#dwnspin-"+a+"-"+p).css("display","none")}})}function wppaAjaxComment(a,p){if(_wppaValidateComment(a,p)){var e="action=wppa&wppa-action=do-comment&photo-id="+p+"&comname="+jQuery("#wppa-comname-"+a).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+a).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+a).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val()+"&moccur="+a;void 0!==jQuery("#wppa-comemail-"+a).val()&&(e+="&comemail="+jQuery("#wppa-comemail-"+a).val()),void 0!==jQuery("#wppa-comment-edit-"+a).val()&&(e+="&comment-edit="+jQuery("#wppa-comment-edit-"+a).val()),void 0!==jQuery("#wppa-returnurl-"+a).val()&&(e+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+a).val())),jQuery.ajax({url:wppaAjaxUrl,data:e,async:!0,type:"POST",timeout:6e4,beforeSend:function(p){jQuery("#wppa-comment-spin-"+a).css("display","inline")},success:function(p,e,t){p=p.replace(/\\/g,""),jQuery("#wppa-comments-"+a).html(p),_wppaCurIdx[a]&&(_wppaCommentHtml[a][_wppaCurIdx[a]]=p),wppaOpenComments(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxComment failed. Error = "+e+", status = "+p,"force")},complete:function(p,e,t){jQuery("#wppa-comment-spin-"+a).css("display","none")}})}}function wppaUpdatePhotoNew(a){for(var p=["name","description","tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],e="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),t=0;t<p.length;)void 0!==jQuery("#"+p[t]).val()&&(e+="&"+p[t]+"="+jQuery("#"+p[t]).val()),t++;jQuery.ajax({url:wppaAjaxUrl,data:e,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,p,e){a.length>0&&alert(a)},error:function(a,p,e){alert(result),wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}function wppaAjaxSetQrCodeSrc(a,p){if(wppaLastQrcodeUrl!=a){wppaLastQrcodeUrl=a;var e="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a);jQuery.ajax({url:wppaAjaxUrl,data:e,async:!0,type:"POST",timeout:1e4,success:function(a,e,t){document.getElementById(p).src=a,wppaConsoleLog("wppaAjaxSetQrCodeSrc put "+a+" into "+p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+e+", status = "+p,"force")}})}}var wppaJsAjaxVersion="6.7.07",wppaRenderAdd=!1,wppaWaitForCounter=0,wppaLastQrcodeUrl="";wppaConsoleLog("wppa-ajax-front.js version "+wppaJsAjaxVersion+" loaded.","force");
|
js/wppa-tinymce-shortcodes.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Pachkage: wp-photo-album-plus
|
3 |
*
|
4 |
*
|
5 |
-
* Version 6.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -274,7 +274,7 @@ function wppaGalleryEvaluate() {
|
|
274 |
default:
|
275 |
jQuery('#wppagallery-top-type').css('color', '#700');
|
276 |
}
|
277 |
-
if ( type != '' ) {
|
278 |
shortcode += ' type="'+type+'"';
|
279 |
}
|
280 |
else {
|
@@ -287,28 +287,39 @@ function wppaGalleryEvaluate() {
|
|
287 |
case 'real':
|
288 |
jQuery('#wppagallery-album-real-tr').show();
|
289 |
jQuery('#wppagallery-album-real-search-tr').show();
|
290 |
-
|
291 |
-
if (
|
292 |
-
|
293 |
-
if (
|
294 |
-
|
295 |
-
|
296 |
-
var
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
|
|
|
|
|
|
|
|
303 |
}
|
304 |
-
i++;
|
305 |
}
|
306 |
}
|
|
|
|
|
|
|
|
|
307 |
}
|
|
|
308 |
else {
|
309 |
-
jQuery('
|
|
|
|
|
|
|
|
|
310 |
}
|
311 |
-
album = wppaGetSelectionEnumByClass('.wppagallery-album-r');
|
312 |
if ( album != '' ) {
|
313 |
jQuery('#wppagallery-album-type').css('color', '#070');
|
314 |
}
|
@@ -337,7 +348,17 @@ function wppaGalleryEvaluate() {
|
|
337 |
jQuery('#wppagallery-album-realopt-tr').show();
|
338 |
|
339 |
// We use parent here for optional album(s), because album is already used for virtual album type
|
340 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
if ( parent == '' ) parent = '0';
|
342 |
jQuery('#wppagallery-photo-count-tr').show();
|
343 |
count = jQuery('#wppagallery-photo-count').val();
|
2 |
* Pachkage: wp-photo-album-plus
|
3 |
*
|
4 |
*
|
5 |
+
* Version 6.7.07
|
6 |
*
|
7 |
*/
|
8 |
|
274 |
default:
|
275 |
jQuery('#wppagallery-top-type').css('color', '#700');
|
276 |
}
|
277 |
+
if ( type != null && type != '' ) {
|
278 |
shortcode += ' type="'+type+'"';
|
279 |
}
|
280 |
else {
|
287 |
case 'real':
|
288 |
jQuery('#wppagallery-album-real-tr').show();
|
289 |
jQuery('#wppagallery-album-real-search-tr').show();
|
290 |
+
// Not many albums
|
291 |
+
if ( jQuery('#wppagallery-album-real-search').val() ) {
|
292 |
+
var s = jQuery('#wppagallery-album-real-search').val().toLowerCase();
|
293 |
+
if ( s != '' ) {
|
294 |
+
albums = jQuery('.wppagallery-album-r');
|
295 |
+
if ( albums.length > 0 ) {
|
296 |
+
var i = 0;
|
297 |
+
while ( i < albums.length ) {
|
298 |
+
var a = albums[i].innerHTML.toLowerCase();
|
299 |
+
if ( a.search( s ) == -1 ) {
|
300 |
+
jQuery( albums[i] ).removeAttr( 'selected' );
|
301 |
+
jQuery( albums[i] ).hide();
|
302 |
+
}
|
303 |
+
else {
|
304 |
+
jQuery( albums[i] ).show();
|
305 |
+
}
|
306 |
+
i++;
|
307 |
}
|
|
|
308 |
}
|
309 |
}
|
310 |
+
else {
|
311 |
+
jQuery('.wppagallery-album-r').show();
|
312 |
+
}
|
313 |
+
album = wppaGetSelectionEnumByClass('.wppagallery-album-r');
|
314 |
}
|
315 |
+
// Many albums
|
316 |
else {
|
317 |
+
album = jQuery('#wppagallery-album-real').val();
|
318 |
+
if ( album.indexOf(',') != -1 ) {
|
319 |
+
parr = album.split(',');
|
320 |
+
album = wppaArrayToEnum( parr, '.' );
|
321 |
+
}
|
322 |
}
|
|
|
323 |
if ( album != '' ) {
|
324 |
jQuery('#wppagallery-album-type').css('color', '#070');
|
325 |
}
|
348 |
jQuery('#wppagallery-album-realopt-tr').show();
|
349 |
|
350 |
// We use parent here for optional album(s), because album is already used for virtual album type
|
351 |
+
// Not many albums
|
352 |
+
if ( jQuery('.wppagallery-album-ropt').length > 0 ) {
|
353 |
+
parent = wppaGetSelectionEnumByClass('.wppagallery-album-ropt');
|
354 |
+
}
|
355 |
+
else {
|
356 |
+
parent = jQuery('#wppagallery-album-realopt').val();
|
357 |
+
if ( parent.indexOf(',') != -1 ) {
|
358 |
+
parr = parent.split(',');
|
359 |
+
parent = wppaArrayToEnum( parr, '.' );
|
360 |
+
}
|
361 |
+
}
|
362 |
if ( parent == '' ) parent = '0';
|
363 |
jQuery('#wppagallery-photo-count-tr').show();
|
364 |
count = jQuery('#wppagallery-photo-count').val();
|
languages/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
?>
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
-
Version: 6.7.
|
6 |
-
Stable tag: 6.7.
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -127,6 +127,24 @@ If this happens, make sure (ask your hosting provider) that you have all the rig
|
|
127 |
|
128 |
See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
= 6.7.06 =
|
131 |
|
132 |
= Bug Fixes =
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
+
Version: 6.7.07
|
6 |
+
Stable tag: 6.7.06
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
127 |
|
128 |
See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
129 |
|
130 |
+
= 6.7.07 =
|
131 |
+
|
132 |
+
= Bug Fixes =
|
133 |
+
|
134 |
+
* Fixed a spurious missing switch to flat/collapsible table button on the Album Admin page.
|
135 |
+
* Fixed a spurious error on local host systems.
|
136 |
+
* Fixed a problem displaying the widget admin page and customize screen when the system has many albums ( >> 1000 ).
|
137 |
+
|
138 |
+
= New Features =
|
139 |
+
|
140 |
+
* New shortcode attribute button for type="slide" only. Example: [wppa type="slide" album="13" button="Show me the slideshow"][/wppa]
|
141 |
+
This will hide the slideshow behind a button. Clicking the button will download the slideshow code to the browser. This is to reduce and speedup loading pages with slideshow(s).
|
142 |
+
* You can now restrict frontend uploads to one or more user roles. See Table II-H2.1
|
143 |
+
|
144 |
+
= Other Changes =
|
145 |
+
|
146 |
+
* Added a dummy index.php to all subfolders and to folders creted by wppa.
|
147 |
+
|
148 |
= 6.7.06 =
|
149 |
|
150 |
= Bug Fixes =
|
watermarks/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
?>
|
wppa-admin-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* gp admin functions
|
6 |
-
* Version 6.7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -514,8 +514,10 @@ global $wppa_supported_audio_extensions;
|
|
514 |
if ( is_file( $file ) ) {
|
515 |
$ext = strtolower( substr( strrchr( $file, "." ), 1 ) );
|
516 |
if ( ! in_array( $ext, $allowed_types ) ) {
|
517 |
-
|
518 |
-
|
|
|
|
|
519 |
$count++;
|
520 |
}
|
521 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* gp admin functions
|
6 |
+
* Version 6.7.07
|
7 |
*
|
8 |
*/
|
9 |
|
514 |
if ( is_file( $file ) ) {
|
515 |
$ext = strtolower( substr( strrchr( $file, "." ), 1 ) );
|
516 |
if ( ! in_array( $ext, $allowed_types ) ) {
|
517 |
+
if ( basename( $file ) != 'index.php' ) {
|
518 |
+
unlink( $file );
|
519 |
+
wppa_error_message( sprintf( __( 'File %s is of an unsupported filetype and has been removed.' , 'wp-photo-album-plus'), basename( wppa_sanitize_file_name( $file ) ) ) );
|
520 |
+
}
|
521 |
$count++;
|
522 |
}
|
523 |
|
wppa-admin.php
CHANGED
@@ -236,8 +236,10 @@ global $wpdb;
|
|
236 |
'</td>' .
|
237 |
'<td>';
|
238 |
$usr = wppa_get_user_by( 'login', $photo['owner'] );
|
239 |
-
|
240 |
-
|
|
|
|
|
241 |
$usr = $photo['owner'];
|
242 |
}
|
243 |
echo
|
236 |
'</td>' .
|
237 |
'<td>';
|
238 |
$usr = wppa_get_user_by( 'login', $photo['owner'] );
|
239 |
+
if ( $usr ) {
|
240 |
+
$usr = $usr -> display_name;
|
241 |
+
}
|
242 |
+
else {
|
243 |
$usr = $photo['owner'];
|
244 |
}
|
245 |
echo
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 6.7.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -1190,6 +1190,9 @@ global $wppa_log_file;
|
|
1190 |
break;
|
1191 |
case 'a_parent':
|
1192 |
$itemname = __( 'Parent album' , 'wp-photo-album-plus');
|
|
|
|
|
|
|
1193 |
wppa_invalidate_treecounts( $album ); // Myself and my parents
|
1194 |
wppa_invalidate_treecounts( $value ); // My new parent
|
1195 |
break;
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 6.7.07
|
6 |
*
|
7 |
*/
|
8 |
|
1190 |
break;
|
1191 |
case 'a_parent':
|
1192 |
$itemname = __( 'Parent album' , 'wp-photo-album-plus');
|
1193 |
+
if ( $album == $value ) {
|
1194 |
+
$value = '-1';
|
1195 |
+
}
|
1196 |
wppa_invalidate_treecounts( $album ); // Myself and my parents
|
1197 |
wppa_invalidate_treecounts( $value ); // My new parent
|
1198 |
break;
|
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 6.7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -444,23 +444,32 @@ function wppaTryScheduleAll( id ) {
|
|
444 |
__( 'Parent album:', 'wp-photo-album-plus' ) . ' ';
|
445 |
if ( wppa_extended_access() ) {
|
446 |
echo
|
447 |
-
'<select' .
|
448 |
-
' id="wppa-parsel"' .
|
449 |
-
' style="max-width:500px;"' .
|
450 |
-
' onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'a_parent\', this )"' .
|
451 |
-
' >' .
|
452 |
-
wppa_album_select_a( array( 'checkaccess'
|
453 |
-
'exclude'
|
454 |
-
'selected'
|
455 |
-
'addselected'
|
456 |
-
'addnone'
|
457 |
-
'addseparate'
|
458 |
-
'disableancestors'
|
459 |
-
'path'
|
460 |
-
'sort'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
)
|
462 |
-
)
|
463 |
-
|
|
|
464 |
}
|
465 |
else {
|
466 |
echo
|
@@ -1210,10 +1219,10 @@ function wppaTryScheduleAll( id ) {
|
|
1210 |
<input type="radio" name="wppa-del-photos" value="delete" checked="checked" /> <?php _e('Delete', 'wp-photo-album-plus'); ?><br />
|
1211 |
<input type="radio" name="wppa-del-photos" value="move" /> <?php _e('Move to:', 'wp-photo-album-plus'); ?>
|
1212 |
<select name="wppa-move-album">
|
1213 |
-
<?php echo wppa_album_select_a( array( 'checkaccess' => true,
|
1214 |
-
'path' => wppa_switch( 'hier_albsel'),
|
1215 |
-
'selected' => '0',
|
1216 |
-
'exclude' => $_REQUEST['edit_id'],
|
1217 |
'addpleaseselect' => true,
|
1218 |
'sort' => true,
|
1219 |
) )
|
@@ -1290,7 +1299,7 @@ function wppaTryScheduleAll( id ) {
|
|
1290 |
if ( $style == 'flat' ) { ?>
|
1291 |
<input type="button" class="button-secundary" onclick="document.location='<?php echo wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&switchto=collapsible') ?>'" value="<?php _e('Switch to Collapsable table', 'wp-photo-album-plus'); ?>" />
|
1292 |
<?php }
|
1293 |
-
if ( $style == 'collapsible' ) { ?>
|
1294 |
<input type="button" class="button-secundary" onclick="document.location='<?php echo wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&switchto=flat') ?>'" value="<?php _e('Switch to Flat table', 'wp-photo-album-plus'); ?>" />
|
1295 |
<input
|
1296 |
type="button"
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* create, edit and delete albums
|
6 |
+
* Version 6.7.07
|
7 |
*
|
8 |
*/
|
9 |
|
444 |
__( 'Parent album:', 'wp-photo-album-plus' ) . ' ';
|
445 |
if ( wppa_extended_access() ) {
|
446 |
echo
|
447 |
+
// '<select' .
|
448 |
+
// ' id="wppa-parsel"' .
|
449 |
+
// ' style="max-width:500px;"' .
|
450 |
+
// ' onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'a_parent\', this )"' .
|
451 |
+
// ' >' .
|
452 |
+
wppa_album_select_a( array( 'checkaccess' => true,
|
453 |
+
'exclude' => $id,
|
454 |
+
'selected' => $a_parent,
|
455 |
+
'addselected' => true,
|
456 |
+
'addnone' => true,
|
457 |
+
'addseparate' => true,
|
458 |
+
'disableancestors' => true,
|
459 |
+
'path' => wppa_switch( 'hier_albsel' ),
|
460 |
+
'sort' => true,
|
461 |
+
'tagopen' => '<select' .
|
462 |
+
' id="wppa-parsel"' .
|
463 |
+
' style="max-width:300px;"' .
|
464 |
+
' onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'a_parent\', this )"' .
|
465 |
+
' >',
|
466 |
+
'tagid' => 'wppa-parsel',
|
467 |
+
'tagonchange' => 'wppaAjaxUpdateAlbum( ' . $id . ', \'a_parent\', this )',
|
468 |
+
'tagstyle' => 'font-size:13px;height:20px;cursor:pointer;',
|
469 |
)
|
470 |
+
);
|
471 |
+
// .
|
472 |
+
// '</select>';
|
473 |
}
|
474 |
else {
|
475 |
echo
|
1219 |
<input type="radio" name="wppa-del-photos" value="delete" checked="checked" /> <?php _e('Delete', 'wp-photo-album-plus'); ?><br />
|
1220 |
<input type="radio" name="wppa-del-photos" value="move" /> <?php _e('Move to:', 'wp-photo-album-plus'); ?>
|
1221 |
<select name="wppa-move-album">
|
1222 |
+
<?php echo wppa_album_select_a( array( 'checkaccess' => true,
|
1223 |
+
'path' => wppa_switch( 'hier_albsel'),
|
1224 |
+
'selected' => '0',
|
1225 |
+
'exclude' => $_REQUEST['edit_id'],
|
1226 |
'addpleaseselect' => true,
|
1227 |
'sort' => true,
|
1228 |
) )
|
1299 |
if ( $style == 'flat' ) { ?>
|
1300 |
<input type="button" class="button-secundary" onclick="document.location='<?php echo wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&switchto=collapsible') ?>'" value="<?php _e('Switch to Collapsable table', 'wp-photo-album-plus'); ?>" />
|
1301 |
<?php }
|
1302 |
+
else /* if ( $style == 'collapsible' ) */ { ?>
|
1303 |
<input type="button" class="button-secundary" onclick="document.location='<?php echo wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&switchto=flat') ?>'" value="<?php _e('Switch to Flat table', 'wp-photo-album-plus'); ?>" />
|
1304 |
<input
|
1305 |
type="button"
|
wppa-album-navigator-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display album names linking to content
|
6 |
-
* Version 6.7.
|
7 |
*/
|
8 |
|
9 |
class AlbumNavigatorWidget extends WP_Widget {
|
@@ -43,27 +43,35 @@ class AlbumNavigatorWidget extends WP_Widget {
|
|
43 |
$parent = $instance['parent'];
|
44 |
$skip = wppa_checked( $instance['skip'] );
|
45 |
|
46 |
-
|
47 |
$widget_content = "\n".'<!-- WPPA+ Album Navigator Widget start -->';
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
$widget_content .=
|
52 |
-
}
|
53 |
-
elseif ( $parent == 'owner' ) {
|
54 |
-
$widget_content .= $this->do_album_navigator( '0', $page, $skip, '', " AND ( `owner` = '--- public ---' OR `owner` = '".wppa_get_user()."' ) " );
|
55 |
-
$widget_content .= $this->do_album_navigator( '-1', $page, $skip, '', " AND ( `owner` = '--- public ---' OR `owner` = '".wppa_get_user()."' ) " );
|
56 |
}
|
57 |
else {
|
58 |
-
$widget_content .=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
-
$widget_content .= '</div>';
|
61 |
-
$widget_content .= '<div style="clear:both"></div>';
|
62 |
|
|
|
63 |
$widget_content .= "\n".'<!-- WPPA+ Album Navigator Widget end -->';
|
64 |
|
65 |
echo "\n" . $before_widget;
|
66 |
-
if ( !empty( $widget_title ) ) { echo $before_title . $widget_title . $after_title; }
|
67 |
echo $widget_content . $after_widget;
|
68 |
|
69 |
wppa( 'in_widget', false );
|
@@ -97,34 +105,43 @@ class AlbumNavigatorWidget extends WP_Widget {
|
|
97 |
echo
|
98 |
wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
|
99 |
|
100 |
-
//
|
101 |
-
|
102 |
-
|
103 |
-
__( '--- all separate albums ---', 'wp-photo-album-plus' ),
|
104 |
-
__( '--- owner/public ---', 'wp-photo-album-plus' ),
|
105 |
-
);
|
106 |
-
$values = array( 'all',
|
107 |
-
'0',
|
108 |
-
'-1',
|
109 |
-
'owner',
|
110 |
-
);
|
111 |
-
$disabled = array( false,
|
112 |
-
false,
|
113 |
-
false,
|
114 |
-
false,
|
115 |
-
);
|
116 |
-
$albs = $wpdb->get_results( "SELECT * FROM `" . WPPA_ALBUMS . "` ORDER BY `name`", ARRAY_A );
|
117 |
-
if ( $albs ) foreach( $albs as $alb ) {
|
118 |
-
$options[] = __( stripslashes( $alb['name'] ) );
|
119 |
-
$values[] = $alb['id'];
|
120 |
-
$disabled[] = false;//! wppa_has_children( $alb['id'] );
|
121 |
}
|
122 |
-
echo
|
123 |
-
wppa_widget_selection( $this, 'parent', $instance['parent'], __( 'Album selection or Parent album', 'wp-photo-album-plus' ), $options, $values, $disabled );
|
124 |
|
125 |
-
//
|
126 |
-
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
}
|
130 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display album names linking to content
|
6 |
+
* Version 6.7.07
|
7 |
*/
|
8 |
|
9 |
class AlbumNavigatorWidget extends WP_Widget {
|
43 |
$parent = $instance['parent'];
|
44 |
$skip = wppa_checked( $instance['skip'] );
|
45 |
|
46 |
+
// Start widget content
|
47 |
$widget_content = "\n".'<!-- WPPA+ Album Navigator Widget start -->';
|
48 |
+
|
49 |
+
// Body
|
50 |
+
if ( wppa_has_many_albums() ) {
|
51 |
+
$widget_content .= __( 'There are too many albums in the system for this widget', 'wp-photo-album-plus' );
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
else {
|
54 |
+
$widget_content .= '<div style="width:100%; overflow:hidden; position:relative; left: -12px;" >';
|
55 |
+
if ( $parent == 'all' ) {
|
56 |
+
$widget_content .= $this->do_album_navigator( '0', $page, $skip, '' );
|
57 |
+
$widget_content .= $this->do_album_navigator( '-1', $page, $skip, '' );
|
58 |
+
}
|
59 |
+
elseif ( $parent == 'owner' ) {
|
60 |
+
$widget_content .= $this->do_album_navigator( '0', $page, $skip, '', " AND ( `owner` = '--- public ---' OR `owner` = '".wppa_get_user()."' ) " );
|
61 |
+
$widget_content .= $this->do_album_navigator( '-1', $page, $skip, '', " AND ( `owner` = '--- public ---' OR `owner` = '".wppa_get_user()."' ) " );
|
62 |
+
}
|
63 |
+
else {
|
64 |
+
$widget_content .= $this->do_album_navigator( $parent, $page, $skip, '' );
|
65 |
+
}
|
66 |
+
$widget_content .= '</div>';
|
67 |
+
$widget_content .= '<div style="clear:both"></div>';
|
68 |
}
|
|
|
|
|
69 |
|
70 |
+
// End widget content
|
71 |
$widget_content .= "\n".'<!-- WPPA+ Album Navigator Widget end -->';
|
72 |
|
73 |
echo "\n" . $before_widget;
|
74 |
+
if ( ! empty( $widget_title ) ) { echo $before_title . $widget_title . $after_title; }
|
75 |
echo $widget_content . $after_widget;
|
76 |
|
77 |
wppa( 'in_widget', false );
|
105 |
echo
|
106 |
wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
|
107 |
|
108 |
+
// This widget can not be used when there are too many albums
|
109 |
+
if ( wppa_has_many_albums() ) {
|
110 |
+
echo __( 'There are too many albums in the system for this widget', 'wp-photo-album-plus' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
|
|
|
|
112 |
|
113 |
+
// Parent
|
114 |
+
else {
|
115 |
+
$options = array( __( '--- all albums ---', 'wp-photo-album-plus' ),
|
116 |
+
__( '--- all generic albums ---', 'wp-photo-album-plus' ),
|
117 |
+
__( '--- all separate albums ---', 'wp-photo-album-plus' ),
|
118 |
+
__( '--- owner/public ---', 'wp-photo-album-plus' ),
|
119 |
+
);
|
120 |
+
$values = array( 'all',
|
121 |
+
'0',
|
122 |
+
'-1',
|
123 |
+
'owner',
|
124 |
+
);
|
125 |
+
$disabled = array( false,
|
126 |
+
false,
|
127 |
+
false,
|
128 |
+
false,
|
129 |
+
);
|
130 |
+
$albs = $wpdb->get_results( "SELECT `name`, `id` FROM `" . WPPA_ALBUMS . "` ORDER BY `name`", ARRAY_A );
|
131 |
+
|
132 |
+
if ( $albs ) foreach( $albs as $alb ) {
|
133 |
+
$options[] = __( stripslashes( $alb['name'] ) );
|
134 |
+
$values[] = $alb['id'];
|
135 |
+
$disabled[] = false;//! wppa_has_children( $alb['id'] );
|
136 |
+
}
|
137 |
+
|
138 |
+
echo
|
139 |
+
wppa_widget_selection( $this, 'parent', $instance['parent'], __( 'Album selection or Parent album', 'wp-photo-album-plus' ), $options, $values, $disabled );
|
140 |
+
|
141 |
+
// Skip empty
|
142 |
+
echo
|
143 |
+
wppa_widget_checkbox( $this, 'skip', $instance['skip'], __( 'Skip "empty" albums', 'wp-photo-album-plus' ) );
|
144 |
+
}
|
145 |
|
146 |
}
|
147 |
|
wppa-album-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display thumbnail albums
|
6 |
-
* Version 6.7.
|
7 |
*/
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
@@ -56,10 +56,20 @@ class AlbumWidget extends WP_Widget {
|
|
56 |
|
57 |
switch ( $parent ) {
|
58 |
case 'all':
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
60 |
break;
|
61 |
case 'last':
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
63 |
break;
|
64 |
default:
|
65 |
$albums = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM `' . WPPA_ALBUMS . '` WHERE `a_parent` = %s ' . wppa_get_album_order( $parent ), $parent ), ARRAY_A );
|
@@ -68,7 +78,10 @@ class AlbumWidget extends WP_Widget {
|
|
68 |
$widget_content = "\n".'<!-- WPPA+ album Widget start -->';
|
69 |
|
70 |
$count = 0;
|
71 |
-
if (
|
|
|
|
|
|
|
72 |
|
73 |
if ( $count < $max ) {
|
74 |
|
@@ -353,10 +366,12 @@ class AlbumWidget extends WP_Widget {
|
|
353 |
false,
|
354 |
);
|
355 |
|
356 |
-
if ( $albs )
|
357 |
-
$
|
358 |
-
|
359 |
-
|
|
|
|
|
360 |
}
|
361 |
|
362 |
echo
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display thumbnail albums
|
6 |
+
* Version 6.7.07
|
7 |
*/
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
56 |
|
57 |
switch ( $parent ) {
|
58 |
case 'all':
|
59 |
+
if ( wppa_has_many_albums() ) {
|
60 |
+
$albums = array();
|
61 |
+
}
|
62 |
+
else {
|
63 |
+
$albums = $wpdb->get_results( 'SELECT * FROM `' . WPPA_ALBUMS . '` ' . wppa_get_album_order(), ARRAY_A );
|
64 |
+
}
|
65 |
break;
|
66 |
case 'last':
|
67 |
+
if ( wppa_has_many_albums() ) {
|
68 |
+
$albums = array();
|
69 |
+
}
|
70 |
+
else {
|
71 |
+
$albums = $wpdb->get_results( 'SELECT * FROM `' . WPPA_ALBUMS . '` ORDER BY `timestamp` DESC', ARRAY_A );
|
72 |
+
}
|
73 |
break;
|
74 |
default:
|
75 |
$albums = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM `' . WPPA_ALBUMS . '` WHERE `a_parent` = %s ' . wppa_get_album_order( $parent ), $parent ), ARRAY_A );
|
78 |
$widget_content = "\n".'<!-- WPPA+ album Widget start -->';
|
79 |
|
80 |
$count = 0;
|
81 |
+
if ( wppa_has_many_albums() && in_array( $parent, array( 'all', 'last' ) ) ) {
|
82 |
+
$widget_content .= __( 'There are too many albums for this widget', 'wp-photo-album-plus' );
|
83 |
+
}
|
84 |
+
elseif ( $albums ) foreach ( $albums as $album ) {
|
85 |
|
86 |
if ( $count < $max ) {
|
87 |
|
366 |
false,
|
367 |
);
|
368 |
|
369 |
+
if ( count( $albs ) <= wppa_opt( 'photo_admin_max_albums' ) ) {
|
370 |
+
if ( $albs ) foreach( $albs as $alb ) {
|
371 |
+
$options[] = $alb['name'];
|
372 |
+
$values[] = $alb['id'];
|
373 |
+
$disabled[] = ! wppa_has_children( $alb['id'] );
|
374 |
+
}
|
375 |
}
|
376 |
|
377 |
echo
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 6.7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1946,6 +1946,11 @@ function wppa_upload_box() {
|
|
1946 |
if ( wppa_switch( 'user_upload_login' ) ) {
|
1947 |
if ( ! is_user_logged_in() ) return;
|
1948 |
}
|
|
|
|
|
|
|
|
|
|
|
1949 |
|
1950 |
// Have i access?
|
1951 |
if ( $alb && ! wppa_is_enum( $alb ) ) {
|
@@ -2299,6 +2304,11 @@ static $albums_granted;
|
|
2299 |
}
|
2300 |
}
|
2301 |
|
|
|
|
|
|
|
|
|
|
|
2302 |
// Login not required, but there are no public albums while user not logged in?
|
2303 |
elseif ( ! is_user_logged_in() ) {
|
2304 |
$public_exist = $wpdb->get_var( "SELECT COUNT(*) " .
|
@@ -4661,3 +4671,91 @@ function wppa_get_responsive_widget_js_html( $mocc ) {
|
|
4661 |
return $result;
|
4662 |
}
|
4663 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 6.7.07
|
7 |
*
|
8 |
*/
|
9 |
|
1946 |
if ( wppa_switch( 'user_upload_login' ) ) {
|
1947 |
if ( ! is_user_logged_in() ) return;
|
1948 |
}
|
1949 |
+
|
1950 |
+
// Are roles specified and do i have one?
|
1951 |
+
if ( ! wppa_check_user_upload_role() ) {
|
1952 |
+
return;
|
1953 |
+
}
|
1954 |
|
1955 |
// Have i access?
|
1956 |
if ( $alb && ! wppa_is_enum( $alb ) ) {
|
2304 |
}
|
2305 |
}
|
2306 |
|
2307 |
+
// Are roles specified and do i have one?
|
2308 |
+
if ( ! wppa_check_user_upload_role() ) {
|
2309 |
+
return;
|
2310 |
+
}
|
2311 |
+
|
2312 |
// Login not required, but there are no public albums while user not logged in?
|
2313 |
elseif ( ! is_user_logged_in() ) {
|
2314 |
$public_exist = $wpdb->get_var( "SELECT COUNT(*) " .
|
4671 |
return $result;
|
4672 |
}
|
4673 |
|
4674 |
+
// The shortcode is hidden behind an Ajax activating button
|
4675 |
+
// Currently implemented for:
|
4676 |
+
// type="slide"
|
4677 |
+
function wppa_button_box() {
|
4678 |
+
global $wppa_lang;
|
4679 |
+
|
4680 |
+
// No button box on feeds
|
4681 |
+
if ( is_feed() ) return;
|
4682 |
+
|
4683 |
+
// Open container
|
4684 |
+
wppa_container( 'open' );
|
4685 |
+
|
4686 |
+
// Init
|
4687 |
+
$mocc = wppa( 'mocc' );
|
4688 |
+
$result = '';
|
4689 |
+
|
4690 |
+
// The standard Ajax link
|
4691 |
+
if ( wppa_switch( 'ajax_non_admin' ) ) {
|
4692 |
+
$al = WPPA_URL.'/wppa-ajax-front.php?action=wppa&wppa-action=render';
|
4693 |
+
}
|
4694 |
+
else {
|
4695 |
+
$al = admin_url( 'admin-ajax.php' ).'?action=wppa&wppa-action=render';
|
4696 |
+
}
|
4697 |
+
$al .= '&wppa-size=' . wppa_get_container_width();
|
4698 |
+
$al .= '&wppa-moccur=' . $mocc;
|
4699 |
+
$al .= '&wppa-occur=' . wppa( 'occur' );
|
4700 |
+
if ( wppa_get_get( 'p' ) ) {
|
4701 |
+
$al .= '&p=' . wppa_get_get( 'p' );
|
4702 |
+
}
|
4703 |
+
if ( wppa_get_get( 'page_id' ) ) {
|
4704 |
+
$al .= '&page_id=' . wppa_get_get( 'page_id' );
|
4705 |
+
}
|
4706 |
+
$al .= '&wppa-fromp=' . get_the_ID();
|
4707 |
+
|
4708 |
+
if ( wppa_get_get( 'lang' ) ) { // If lang in querystring: keep it
|
4709 |
+
if ( strpos( $al, 'lang=' ) === false ) { // Not yet
|
4710 |
+
$al .= '&lang=' . $wppa_lang;
|
4711 |
+
}
|
4712 |
+
}
|
4713 |
+
|
4714 |
+
// The shortcode type specific args
|
4715 |
+
if ( wppa( 'is_slide' ) ) {
|
4716 |
+
$al .= '&wppa-slide&wppa-album=' . wppa( 'start_album' );
|
4717 |
+
if ( wppa( 'start_photo' ) ) {
|
4718 |
+
$al .= '&wppa-photo=' . wppa( 'start_photo' );
|
4719 |
+
}
|
4720 |
+
}
|
4721 |
+
|
4722 |
+
|
4723 |
+
// The container content
|
4724 |
+
$result .=
|
4725 |
+
'<input' .
|
4726 |
+
' id="wppa-button-initial-' . $mocc . '"' .
|
4727 |
+
' type="button"' .
|
4728 |
+
' value="' . wppa( 'is_button' ) . '"' .
|
4729 |
+
' onclick="wppaDoAjaxRender( ' . $mocc . ', \'' . $al . '\' )"' .
|
4730 |
+
' />';
|
4731 |
+
|
4732 |
+
// Output
|
4733 |
+
wppa_out( $result );
|
4734 |
+
|
4735 |
+
// Close container
|
4736 |
+
wppa_container( 'close' );
|
4737 |
+
|
4738 |
+
// The Hide and show buttons
|
4739 |
+
$result =
|
4740 |
+
'<input' .
|
4741 |
+
' id="wppa-button-show-' . $mocc . '"' .
|
4742 |
+
' type="button"' .
|
4743 |
+
' value="' . wppa( 'is_button' ) . '"' .
|
4744 |
+
' onclick="jQuery( \'#wppa-container-' . $mocc . '\' ).show();' .
|
4745 |
+
'jQuery( \'#wppa-button-hide-' . $mocc . '\' ).show();' .
|
4746 |
+
'jQuery( this ).hide();' .
|
4747 |
+
'"' .
|
4748 |
+
' style="display:none;"' .
|
4749 |
+
' />' .
|
4750 |
+
'<input' .
|
4751 |
+
' id="wppa-button-hide-' . $mocc . '"' .
|
4752 |
+
' type="button"' .
|
4753 |
+
' value="' . esc_attr( __( 'Hide', 'wp-photo-album-plus' ) ) . '"' .
|
4754 |
+
' onclick="jQuery( \'#wppa-container-' . $mocc . '\' ).hide();' .
|
4755 |
+
'jQuery( \'#wppa-button-show-' . $mocc . '\' ).show();' .
|
4756 |
+
'jQuery( this ).hide();' .
|
4757 |
+
'"' .
|
4758 |
+
' style="display:none;"' .
|
4759 |
+
' />';
|
4760 |
+
wppa_out( $result );
|
4761 |
+
}
|
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 6.7.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -214,6 +214,7 @@ global $thumbs;
|
|
214 |
'no_ver' => false,
|
215 |
'catbox' => '',
|
216 |
'is_pdf' => false,
|
|
|
217 |
|
218 |
);
|
219 |
}
|
@@ -1642,8 +1643,22 @@ global $wpdb;
|
|
1642 |
'checkarray' => false,
|
1643 |
'array' => array(),
|
1644 |
'optionclass' => '',
|
|
|
|
|
|
|
|
|
|
|
|
|
1645 |
) );
|
1646 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1647 |
// Provide default selection if no selected given
|
1648 |
if ( $args['selected'] === '' ) {
|
1649 |
$args['selected'] = wppa_get_last_album();
|
@@ -1657,190 +1672,309 @@ global $wpdb;
|
|
1657 |
$args['selected'] = '0';
|
1658 |
}
|
1659 |
|
1660 |
-
//
|
|
|
1661 |
if ( $args['checkarray'] && ! empty( $args['array'] ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1662 |
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1681 |
}
|
1682 |
}
|
|
|
|
|
1683 |
else {
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1690 |
|
1691 |
-
|
1692 |
-
// $args['sort'] = true;
|
1693 |
-
|
1694 |
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1715 |
}
|
1716 |
-
|
1717 |
-
|
|
|
1718 |
foreach ( array_keys( $albums ) as $albidx ) {
|
1719 |
-
if (
|
1720 |
}
|
1721 |
-
break;
|
1722 |
}
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
foreach ( array_keys( $albums ) as $albidx ) {
|
1727 |
-
if ( wppa_get_photo_count( $albums[$albidx]['id'] ) <= wppa_get_mincount() ) unset ( $albums[$albidx] );
|
1728 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1729 |
}
|
1730 |
-
// Add paths
|
1731 |
-
if ( $args['path'] ) {
|
1732 |
-
$albums = wppa_add_paths( $albums );
|
1733 |
-
}
|
1734 |
-
// Or just translate
|
1735 |
-
else foreach ( array_keys( $albums ) as $index ) {
|
1736 |
-
$albums[$index]['name'] = __( stripslashes( $albums[$index]['name'] ) );
|
1737 |
-
}
|
1738 |
-
// Sort
|
1739 |
-
if ( $args['sort'] ) $albums = wppa_array_sort( $albums, 'name' );
|
1740 |
-
}
|
1741 |
-
|
1742 |
-
// Output
|
1743 |
-
$result = '';
|
1744 |
-
|
1745 |
-
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1746 |
-
if ( $args['addpleaseselect'] ) $result .=
|
1747 |
-
'<option value="0" disabled="disabled" '.$selected.' >' .
|
1748 |
-
__( '- select an album -' , 'wp-photo-album-plus' ) .
|
1749 |
-
'</option>';
|
1750 |
-
|
1751 |
-
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1752 |
-
if ( $args['addnone'] ) $result .=
|
1753 |
-
'<option value="0"'.$selected.' >' .
|
1754 |
-
__( '--- none ---' , 'wp-photo-album-plus' ) .
|
1755 |
-
'</option>';
|
1756 |
-
|
1757 |
-
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1758 |
-
if ( $args['addall'] ) $result .=
|
1759 |
-
'<option value="0"'.$selected.' >' .
|
1760 |
-
__( '--- all ---' , 'wp-photo-album-plus' ) .
|
1761 |
-
'</option>';
|
1762 |
-
|
1763 |
-
$selected = $args['selected'] == '-2' ? ' selected="selected"' : '';
|
1764 |
-
if ( $args['addall'] ) $result .=
|
1765 |
-
'<option value="-2"'.$selected.' >' .
|
1766 |
-
__( '--- generic ---' , 'wp-photo-album-plus' ) .
|
1767 |
-
'</option>';
|
1768 |
-
|
1769 |
-
$selected = $args['selected'] == '-3' ? ' selected="selected"' : '';
|
1770 |
-
if ( $args['addowner'] ) $result .=
|
1771 |
-
'<option value="-3"'.$selected.' >' .
|
1772 |
-
__( '--- owner/public ---' , 'wp-photo-album-plus' ) .
|
1773 |
-
'</option>';
|
1774 |
-
|
1775 |
-
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1776 |
-
if ( $args['addblank'] ) $result .=
|
1777 |
-
'<option value="0"'.$selected.' >' .
|
1778 |
-
'</option>';
|
1779 |
-
|
1780 |
-
$selected = $args['selected'] == '-99' ? ' selected="selected"' : '';
|
1781 |
-
if ( $args['addmultiple'] ) $result .=
|
1782 |
-
'<option value="-99"'.$selected.' >' .
|
1783 |
-
__( '--- multiple see below ---' , 'wp-photo-album-plus' ) .
|
1784 |
-
'</option>';
|
1785 |
-
|
1786 |
-
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1787 |
-
if ( $args['addselbox'] ) $result .=
|
1788 |
-
'<option value="0"'.$selected.' >' .
|
1789 |
-
__( '--- a selection box ---' , 'wp-photo-album-plus' ) .
|
1790 |
-
'</option>';
|
1791 |
-
|
1792 |
-
// In case multiple
|
1793 |
-
if ( strpos( $args['selected'], ',' ) !== false ) {
|
1794 |
-
$selarr = explode( ',', $args['selected'] );
|
1795 |
-
}
|
1796 |
-
else {
|
1797 |
-
$selarr = array( $args['selected'] );
|
1798 |
-
}
|
1799 |
-
|
1800 |
-
if ( $albums ) foreach ( $albums as $album ) {
|
1801 |
-
if ( ( $args['disabled'] == $album['id'] ) ||
|
1802 |
-
( $args['exclude'] == $album['id'] ) ||
|
1803 |
-
( $args['checkupload'] && ! wppa_allow_uploads( $album['id'] ) ) ||
|
1804 |
-
( $args['disableancestors'] && wppa_is_ancestor( $args['exclude'], $album['id'] ) )
|
1805 |
-
) $disabled = ' disabled="disabled"'; else $disabled = '';
|
1806 |
-
if ( in_array( $album['id'], $selarr, true ) && ! $disabled ) $selected = ' selected="selected"'; else $selected = '';
|
1807 |
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1811 |
}
|
1812 |
-
|
1813 |
-
if ( $
|
1814 |
-
if ( $
|
1815 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1816 |
$ok = false;
|
1817 |
}
|
1818 |
}
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
if (
|
1824 |
-
$
|
|
|
1825 |
}
|
1826 |
}
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
|
|
|
|
|
|
1834 |
}
|
|
|
|
|
1835 |
}
|
1836 |
-
|
1837 |
-
$selected = $args['selected'] == '-1' ? ' selected="selected"' : '';
|
1838 |
-
if ( $args['addseparate'] ) $result .=
|
1839 |
-
'<option value="-1"' . $selected . '>' .
|
1840 |
-
__( '--- separate ---' , 'wp-photo-album-plus' ) .
|
1841 |
-
'</option>';
|
1842 |
-
|
1843 |
-
return $result;
|
1844 |
}
|
1845 |
|
1846 |
function wppa_delete_obsolete_tempfiles() {
|
2 |
/* wppa-common-functions.php
|
3 |
*
|
4 |
* Functions used in admin and in themes
|
5 |
+
* Version 6.7.07
|
6 |
*
|
7 |
*/
|
8 |
|
214 |
'no_ver' => false,
|
215 |
'catbox' => '',
|
216 |
'is_pdf' => false,
|
217 |
+
'is_button' => '',
|
218 |
|
219 |
);
|
220 |
}
|
1643 |
'checkarray' => false,
|
1644 |
'array' => array(),
|
1645 |
'optionclass' => '',
|
1646 |
+
'tagopen' => '',
|
1647 |
+
'tagname' => '',
|
1648 |
+
'tagid' => '',
|
1649 |
+
'tagonchange' => '',
|
1650 |
+
'multiple' => false,
|
1651 |
+
'tagstyle' => '',
|
1652 |
) );
|
1653 |
|
1654 |
+
// See if new format is used
|
1655 |
+
if ( $args['tagopen'] ) {
|
1656 |
+
$is_newformat = true;
|
1657 |
+
}
|
1658 |
+
else {
|
1659 |
+
$is_newformat = false;
|
1660 |
+
}
|
1661 |
+
|
1662 |
// Provide default selection if no selected given
|
1663 |
if ( $args['selected'] === '' ) {
|
1664 |
$args['selected'] = wppa_get_last_album();
|
1672 |
$args['selected'] = '0';
|
1673 |
}
|
1674 |
|
1675 |
+
// Calculate roughly the expected number of albums to be in the selection and decide if the number is 'many'
|
1676 |
+
$is_many = false;
|
1677 |
if ( $args['checkarray'] && ! empty( $args['array'] ) ) {
|
1678 |
+
$c = count( $args['array'] );
|
1679 |
+
if ( wppa_opt( 'photo_admin_max_albums' ) && $c > wppa_opt( 'photo_admin_max_albums' ) ) {
|
1680 |
+
$is_many = true;
|
1681 |
+
}
|
1682 |
+
}
|
1683 |
+
elseif ( wppa_has_many_albums() ) {
|
1684 |
+
$is_many = true;
|
1685 |
+
}
|
1686 |
+
|
1687 |
+
|
1688 |
+
// Process the many case
|
1689 |
+
if ( $is_many ) {
|
1690 |
+
|
1691 |
+
// Many newformat
|
1692 |
+
if ( $is_newformat ) {
|
1693 |
+
|
1694 |
+
$result =
|
1695 |
+
'<input' .
|
1696 |
+
' name="' . $args['tagname'] . '"' .
|
1697 |
+
( $args['tagid'] ? ' id="' . $args['tagid'] . '"' : '' ) .
|
1698 |
+
( $args['multiple'] ? '' : ' type="number"' ) .
|
1699 |
+
' value="' . $args['selected'] . '"' .
|
1700 |
+
' onchange="' . $args['tagonchange'] . '"' .
|
1701 |
+
' style="' . $args['tagstyle'] . '"' .
|
1702 |
+
' title="' .
|
1703 |
+
esc_attr( __( 'Enter album number', 'wp-photo-album-plus' ) );
|
1704 |
+
|
1705 |
+
if ( $args['addnone'] ) $result .= esc_attr( "\n" . __( '0 for --- none ---' , 'wp-photo-album-plus' ) );
|
1706 |
+
if ( $args['addall'] ) $result .= esc_attr( "\n" . __( '0 for --- all ---' , 'wp-photo-album-plus' ) );
|
1707 |
+
if ( $args['addall'] ) $result .= esc_attr( "\n" . __( '-2 for --- generic ---' , 'wp-photo-album-plus' ) );
|
1708 |
+
if ( $args['addowner'] ) $result .= esc_attr( "\n" . __( '-3 for --- owner/public ---' , 'wp-photo-album-plus' ) );
|
1709 |
+
if ( $args['addmultiple'] ) $result .= esc_attr( "\n" . __( '-99 for --- multiple see below ---' , 'wp-photo-album-plus' ) );
|
1710 |
+
if ( $args['addselbox'] ) $result .= esc_attr( "\n" . __( '0 for --- a selection box ---' , 'wp-photo-album-plus' ) );
|
1711 |
+
if ( $args['addseparate'] ) $result .= esc_attr( "\n" . __( '-1 for --- separate ---' , 'wp-photo-album-plus' ) );
|
1712 |
+
|
1713 |
+
$result .=
|
1714 |
+
'"' .
|
1715 |
+
' />' ;
|
1716 |
+
|
1717 |
+
return $result;
|
1718 |
+
}
|
1719 |
+
|
1720 |
+
// Many old format
|
1721 |
+
else {
|
1722 |
+
$result = '';
|
1723 |
|
1724 |
+
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1725 |
+
if ( $args['addpleaseselect'] ) $result .=
|
1726 |
+
'<option value="0" disabled="disabled" '.$selected.' >' .
|
1727 |
+
__( '- select an album -' , 'wp-photo-album-plus' ) .
|
1728 |
+
'</option>';
|
1729 |
+
|
1730 |
+
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1731 |
+
if ( $args['addnone'] ) $result .=
|
1732 |
+
'<option value="0"'.$selected.' >' .
|
1733 |
+
__( '--- none ---' , 'wp-photo-album-plus' ) .
|
1734 |
+
'</option>';
|
1735 |
+
|
1736 |
+
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1737 |
+
if ( $args['addall'] ) $result .=
|
1738 |
+
'<option value="0"'.$selected.' >' .
|
1739 |
+
__( '--- all ---' , 'wp-photo-album-plus' ) .
|
1740 |
+
'</option>';
|
1741 |
+
|
1742 |
+
$selected = $args['selected'] == '-2' ? ' selected="selected"' : '';
|
1743 |
+
if ( $args['addall'] ) $result .=
|
1744 |
+
'<option value="-2"'.$selected.' >' .
|
1745 |
+
__( '--- generic ---' , 'wp-photo-album-plus' ) .
|
1746 |
+
'</option>';
|
1747 |
+
|
1748 |
+
$selected = $args['selected'] == '-3' ? ' selected="selected"' : '';
|
1749 |
+
if ( $args['addowner'] ) $result .=
|
1750 |
+
'<option value="-3"'.$selected.' >' .
|
1751 |
+
__( '--- owner/public ---' , 'wp-photo-album-plus' ) .
|
1752 |
+
'</option>';
|
1753 |
+
|
1754 |
+
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1755 |
+
if ( $args['addblank'] ) $result .=
|
1756 |
+
'<option value="0"'.$selected.' >' .
|
1757 |
+
'</option>';
|
1758 |
+
|
1759 |
+
$selected = $args['selected'] == '-99' ? ' selected="selected"' : '';
|
1760 |
+
if ( $args['addmultiple'] ) $result .=
|
1761 |
+
'<option value="-99"'.$selected.' >' .
|
1762 |
+
__( '--- multiple see below ---' , 'wp-photo-album-plus' ) .
|
1763 |
+
'</option>';
|
1764 |
+
|
1765 |
+
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1766 |
+
if ( $args['addselbox'] ) $result .=
|
1767 |
+
'<option value="0"'.$selected.' >' .
|
1768 |
+
__( '--- a selection box ---' , 'wp-photo-album-plus' ) .
|
1769 |
+
'</option>';
|
1770 |
+
$selected = $args['selected'] == '-1' ? ' selected="selected"' : '';
|
1771 |
+
if ( $args['addseparate'] ) $result .=
|
1772 |
+
'<option value="-1"' . $selected . '>' .
|
1773 |
+
__( '--- separate ---' , 'wp-photo-album-plus' ) .
|
1774 |
+
'</option>';
|
1775 |
+
|
1776 |
+
return $result;
|
1777 |
}
|
1778 |
}
|
1779 |
+
|
1780 |
+
// Continue processing Not many albums
|
1781 |
else {
|
1782 |
+
|
1783 |
+
// Get roughly the albums that might be in the selection
|
1784 |
+
if ( $args['checkarray'] && ! empty( $args['array'] ) ) {
|
1785 |
+
|
1786 |
+
// $albums = $args['array'];
|
1787 |
+
$albums = array();
|
1788 |
+
|
1789 |
+
$temp = $wpdb->get_results( "SELECT `id`, `name` " .
|
1790 |
+
"FROM `" . WPPA_ALBUMS . "` " .
|
1791 |
+
"WHERE `id` IN (" . implode( ',', $args['array'] ) . ") " .
|
1792 |
+
( $args['checkowner'] && wppa_switch( 'upload_owner_only' ) && ! wppa_user_is( 'administrator' ) ? "AND `owner` IN ( '--- public ---', '" . wppa_get_user() . "' ) " : "" ) .
|
1793 |
+
wppa_get_album_order( $args['root'] ),
|
1794 |
+
ARRAY_A
|
1795 |
+
);
|
1796 |
+
|
1797 |
+
// To keep the preciously created sequence intact when an array is given, copy the data from $temp in the sequence of $args['array']
|
1798 |
+
foreach( $args['array'] as $id ) {
|
1799 |
+
foreach( $temp as $item ) {
|
1800 |
+
if ( $item['id'] == $id ) {
|
1801 |
+
$albums[] = $item;
|
1802 |
+
}
|
1803 |
+
}
|
1804 |
+
}
|
1805 |
+
}
|
1806 |
+
else {
|
1807 |
+
$albums = $wpdb->get_results( "SELECT `id`, `name` " .
|
1808 |
+
"FROM `" . WPPA_ALBUMS . "` " .
|
1809 |
+
( $args['checkowner'] && wppa_switch( 'upload_owner_only' ) && ! wppa_user_is( 'administrator' ) ? "WHERE `owner` IN ( '--- public ---', '" . wppa_get_user() . "' ) " : "" ) .
|
1810 |
+
wppa_get_album_order( $args['root'] ),
|
1811 |
+
ARRAY_A
|
1812 |
+
);
|
1813 |
|
1814 |
+
// Must be sorted now...
|
1815 |
+
// $args['sort'] = true;
|
1816 |
+
}
|
1817 |
|
1818 |
+
/* Can not add to cache because only "SELECT * " can be added
|
1819 |
+
// Add to secondary cache
|
1820 |
+
if ( $albums ) {
|
1821 |
+
wppa_cache_album( 'add', $albums );
|
1822 |
+
}
|
1823 |
+
*/
|
1824 |
|
1825 |
+
if ( $albums ) {
|
1826 |
+
// Filter for root
|
1827 |
+
if ( $args['root'] ) {
|
1828 |
+
$root = $args['root'];
|
1829 |
+
switch ( $root ) { // case '0': all, will be skipped as it returns false in 'if ( $args['root'] )'
|
1830 |
+
case '-2': // Generic only
|
1831 |
+
foreach ( array_keys( $albums ) as $albidx ) {
|
1832 |
+
if ( wppa_is_separate( $albums[$albidx]['id'] ) ) unset ( $albums[$albidx] );
|
1833 |
+
}
|
1834 |
+
break;
|
1835 |
+
case '-1': // Separate only
|
1836 |
+
foreach ( array_keys( $albums ) as $albidx ) {
|
1837 |
+
if ( ! wppa_is_separate( $albums[$albidx]['id'] ) ) unset ( $albums[$albidx] );
|
1838 |
+
}
|
1839 |
+
break;
|
1840 |
+
default:
|
1841 |
+
foreach ( array_keys( $albums ) as $albidx ) {
|
1842 |
+
if ( ! wppa_is_ancestor( $root, $albums[$albidx]['id'] ) ) unset ( $albums[$albidx] );
|
1843 |
+
}
|
1844 |
+
break;
|
1845 |
}
|
1846 |
+
}
|
1847 |
+
// Filter for must have content
|
1848 |
+
if ( $args['content'] ) {
|
1849 |
foreach ( array_keys( $albums ) as $albidx ) {
|
1850 |
+
if ( wppa_get_photo_count( $albums[$albidx]['id'] ) <= wppa_get_mincount() ) unset ( $albums[$albidx] );
|
1851 |
}
|
|
|
1852 |
}
|
1853 |
+
// Add paths
|
1854 |
+
if ( $args['path'] ) {
|
1855 |
+
$albums = wppa_add_paths( $albums );
|
|
|
|
|
1856 |
}
|
1857 |
+
// Or just translate
|
1858 |
+
else foreach ( array_keys( $albums ) as $index ) {
|
1859 |
+
$albums[$index]['name'] = __( stripslashes( $albums[$index]['name'] ) );
|
1860 |
+
}
|
1861 |
+
// Sort
|
1862 |
+
if ( $args['sort'] ) $albums = wppa_array_sort( $albums, 'name' );
|
1863 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1864 |
|
1865 |
+
// Output
|
1866 |
+
$result = '';
|
1867 |
+
|
1868 |
+
// New format
|
1869 |
+
if ( $is_newformat ) {
|
1870 |
+
$result .= $args['tagopen'];
|
1871 |
+
}
|
1872 |
+
|
1873 |
+
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1874 |
+
if ( $args['addpleaseselect'] ) $result .=
|
1875 |
+
'<option value="0" disabled="disabled" '.$selected.' >' .
|
1876 |
+
__( '- select an album -' , 'wp-photo-album-plus' ) .
|
1877 |
+
'</option>';
|
1878 |
+
|
1879 |
+
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1880 |
+
if ( $args['addnone'] ) $result .=
|
1881 |
+
'<option value="0"'.$selected.' >' .
|
1882 |
+
__( '--- none ---' , 'wp-photo-album-plus' ) .
|
1883 |
+
'</option>';
|
1884 |
+
|
1885 |
+
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1886 |
+
if ( $args['addall'] ) $result .=
|
1887 |
+
'<option value="0"'.$selected.' >' .
|
1888 |
+
__( '--- all ---' , 'wp-photo-album-plus' ) .
|
1889 |
+
'</option>';
|
1890 |
+
|
1891 |
+
$selected = $args['selected'] == '-2' ? ' selected="selected"' : '';
|
1892 |
+
if ( $args['addall'] ) $result .=
|
1893 |
+
'<option value="-2"'.$selected.' >' .
|
1894 |
+
__( '--- generic ---' , 'wp-photo-album-plus' ) .
|
1895 |
+
'</option>';
|
1896 |
+
|
1897 |
+
$selected = $args['selected'] == '-3' ? ' selected="selected"' : '';
|
1898 |
+
if ( $args['addowner'] ) $result .=
|
1899 |
+
'<option value="-3"'.$selected.' >' .
|
1900 |
+
__( '--- owner/public ---' , 'wp-photo-album-plus' ) .
|
1901 |
+
'</option>';
|
1902 |
+
|
1903 |
+
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1904 |
+
if ( $args['addblank'] ) $result .=
|
1905 |
+
'<option value="0"'.$selected.' >' .
|
1906 |
+
'</option>';
|
1907 |
+
|
1908 |
+
$selected = $args['selected'] == '-99' ? ' selected="selected"' : '';
|
1909 |
+
if ( $args['addmultiple'] ) $result .=
|
1910 |
+
'<option value="-99"'.$selected.' >' .
|
1911 |
+
__( '--- multiple see below ---' , 'wp-photo-album-plus' ) .
|
1912 |
+
'</option>';
|
1913 |
+
|
1914 |
+
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
1915 |
+
if ( $args['addselbox'] ) $result .=
|
1916 |
+
'<option value="0"'.$selected.' >' .
|
1917 |
+
__( '--- a selection box ---' , 'wp-photo-album-plus' ) .
|
1918 |
+
'</option>';
|
1919 |
+
|
1920 |
+
// In case multiple
|
1921 |
+
if ( strpos( $args['selected'], ',' ) !== false ) {
|
1922 |
+
$selarr = explode( ',', $args['selected'] );
|
1923 |
+
}
|
1924 |
+
else {
|
1925 |
+
$selarr = array( $args['selected'] );
|
1926 |
}
|
1927 |
+
|
1928 |
+
if ( $albums ) foreach ( $albums as $album ) {
|
1929 |
+
if ( ( $args['disabled'] == $album['id'] ) ||
|
1930 |
+
( $args['exclude'] == $album['id'] ) ||
|
1931 |
+
( $args['checkupload'] && ! wppa_allow_uploads( $album['id'] ) ) ||
|
1932 |
+
( $args['disableancestors'] && wppa_is_ancestor( $args['exclude'], $album['id'] ) )
|
1933 |
+
) $disabled = ' disabled="disabled"'; else $disabled = '';
|
1934 |
+
if ( in_array( $album['id'], $selarr, true ) && ! $disabled ) $selected = ' selected="selected"'; else $selected = '';
|
1935 |
+
|
1936 |
+
$ok = true; // Assume this will be in the list
|
1937 |
+
if ( $args['checkaccess'] && ! wppa_have_access( $album['id'] ) ) {
|
1938 |
+
$ok = false;
|
1939 |
+
}
|
1940 |
+
/* This is in the query now
|
1941 |
+
if ( $args['checkowner'] && wppa_switch( 'upload_owner_only' ) ) { // Need to check
|
1942 |
+
if ( $album['owner'] != wppa_get_user() && $album['owner'] != '--- public ---' ) { // Not 'mine'
|
1943 |
+
if ( ! wppa_user_is( 'administrator' ) ) { // No admin
|
1944 |
+
$ok = false;
|
1945 |
+
}
|
1946 |
+
}
|
1947 |
+
}
|
1948 |
+
*/
|
1949 |
+
/* This is in the query now
|
1950 |
+
if ( $args['checkarray'] ) {
|
1951 |
+
if ( ! in_array( $album['id'], $args['array'] ) ) {
|
1952 |
$ok = false;
|
1953 |
}
|
1954 |
}
|
1955 |
+
*/
|
1956 |
+
if ( $selected && $args['addselected'] ) {
|
1957 |
+
$ok = true;
|
1958 |
+
}
|
1959 |
+
if ( $ok ) {
|
1960 |
+
if ( $args['addnumbers'] ) $number = ' ( '.$album['id'].' )'; else $number = '';
|
1961 |
+
$result .= '<option class="' . $args['optionclass']. '" value="' . $album['id'] . '" ' . $selected . $disabled . '>' . $album['name'] . $number . '</option>';
|
1962 |
}
|
1963 |
}
|
1964 |
+
|
1965 |
+
$selected = $args['selected'] == '-1' ? ' selected="selected"' : '';
|
1966 |
+
if ( $args['addseparate'] ) $result .=
|
1967 |
+
'<option value="-1"' . $selected . '>' .
|
1968 |
+
__( '--- separate ---' , 'wp-photo-album-plus' ) .
|
1969 |
+
'</option>';
|
1970 |
+
|
1971 |
+
// New format
|
1972 |
+
if ( $is_newformat ) {
|
1973 |
+
$result .= '</select>';
|
1974 |
}
|
1975 |
+
|
1976 |
+
return $result;
|
1977 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1978 |
}
|
1979 |
|
1980 |
function wppa_delete_obsolete_tempfiles() {
|
wppa-filter.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
-
* Version 6.7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -57,6 +57,7 @@ global $wppa_revno;
|
|
57 |
'parent' => '',
|
58 |
'alt' => '',
|
59 |
'timeout' => '',
|
|
|
60 |
), $xatts );
|
61 |
|
62 |
// Init
|
@@ -114,6 +115,9 @@ global $wppa_revno;
|
|
114 |
if ( $atts['timeout'] ) {
|
115 |
$wppa['in_widget_timeout'] = ( $atts['timeout'] == 'random' ? 'random' : strval( abs( intval( $atts['timeout'] ) ) ) );
|
116 |
}
|
|
|
|
|
|
|
117 |
break;
|
118 |
case 'slideonly':
|
119 |
$wppa['start_album'] = $atts['album'];
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
+
* Version 6.7.07
|
7 |
*
|
8 |
*/
|
9 |
|
57 |
'parent' => '',
|
58 |
'alt' => '',
|
59 |
'timeout' => '',
|
60 |
+
'button' => '',
|
61 |
), $xatts );
|
62 |
|
63 |
// Init
|
115 |
if ( $atts['timeout'] ) {
|
116 |
$wppa['in_widget_timeout'] = ( $atts['timeout'] == 'random' ? 'random' : strval( abs( intval( $atts['timeout'] ) ) ) );
|
117 |
}
|
118 |
+
if ( $atts['button'] ) {
|
119 |
+
$wppa['is_button'] = esc_attr( __( $atts['button'] ) );
|
120 |
+
}
|
121 |
break;
|
122 |
case 'slideonly':
|
123 |
$wppa['start_album'] = $atts['album'];
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
-
* Version 6.7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -754,8 +754,12 @@ global $wppa_session;
|
|
754 |
}
|
755 |
}
|
756 |
|
|
|
|
|
|
|
|
|
757 |
// Is it url?
|
758 |
-
|
759 |
if ( wppa_photo_exists( wppa( 'single_photo' ) ) ) {
|
760 |
wppa_out( wppa_get_hires_url( wppa( 'single_photo' ) ) );
|
761 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
+
* Version 6.7.07
|
7 |
*
|
8 |
*/
|
9 |
|
754 |
}
|
755 |
}
|
756 |
|
757 |
+
// Is it hidden behind an Ajax activating button?
|
758 |
+
if ( wppa( 'is_button' ) ) {
|
759 |
+
wppa_button_box();
|
760 |
+
}
|
761 |
// Is it url?
|
762 |
+
elseif ( wppa( 'is_url' ) ) {
|
763 |
if ( wppa_photo_exists( wppa( 'single_photo' ) ) ) {
|
764 |
wppa_out( wppa_get_hires_url( wppa( 'single_photo' ) ) );
|
765 |
}
|
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 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -257,17 +257,17 @@ global $wppa_opt;
|
|
257 |
if ( ! is_dir( $tempdir ) ) @ wppa_mktree( $tempdir );
|
258 |
wppa_delete_obsolete_tempfiles();
|
259 |
|
260 |
-
$wppa_js_page_data_file = WPPA_UPLOAD_PATH.'/temp/wppa.'
|
261 |
$handle = fopen ( $wppa_js_page_data_file, 'wb' );
|
262 |
|
263 |
if ( $handle ) {
|
264 |
fwrite( $handle, '/* WPPA+ Generated Page dependant javascript */'."\n" );
|
|
|
265 |
}
|
266 |
else {
|
267 |
$wppa_js_page_data_file = '';
|
268 |
$footer = false;
|
269 |
}
|
270 |
-
fclose ( $handle );
|
271 |
}
|
272 |
|
273 |
// WPPA+ Javascript files.
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
+
* Version 6.7.07
|
7 |
*
|
8 |
*/
|
9 |
|
257 |
if ( ! is_dir( $tempdir ) ) @ wppa_mktree( $tempdir );
|
258 |
wppa_delete_obsolete_tempfiles();
|
259 |
|
260 |
+
$wppa_js_page_data_file = WPPA_UPLOAD_PATH . '/temp/wppa.' . sanitize_file_name( $_SERVER['REMOTE_ADDR'] ) . '.js';
|
261 |
$handle = fopen ( $wppa_js_page_data_file, 'wb' );
|
262 |
|
263 |
if ( $handle ) {
|
264 |
fwrite( $handle, '/* WPPA+ Generated Page dependant javascript */'."\n" );
|
265 |
+
fclose ( $handle );
|
266 |
}
|
267 |
else {
|
268 |
$wppa_js_page_data_file = '';
|
269 |
$footer = false;
|
270 |
}
|
|
|
271 |
}
|
272 |
|
273 |
// WPPA+ Javascript files.
|
wppa-photo-admin-autosave.php
CHANGED
@@ -2435,15 +2435,26 @@ function wppaSetConfirmMove( id ) {
|
|
2435 |
<option value="wppa-bulk-owner" ><?php _e( 'Set owner to' , 'wp-photo-album-plus') ?></option>
|
2436 |
<?php } ?>
|
2437 |
</select>
|
2438 |
-
|
2439 |
-
|
2440 |
-
|
2441 |
-
|
2442 |
-
|
2443 |
-
|
2444 |
-
|
2445 |
-
|
2446 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2447 |
<select name="wppa-bulk-status" id="wppa-bulk-status" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_status',this.value,365 );" >
|
2448 |
<option value="" ><?php _e( '- select a status -' , 'wp-photo-album-plus') ?></option>
|
2449 |
<option value="pending" ><?php _e( 'Pending' , 'wp-photo-album-plus') ?></option>
|
2435 |
<option value="wppa-bulk-owner" ><?php _e( 'Set owner to' , 'wp-photo-album-plus') ?></option>
|
2436 |
<?php } ?>
|
2437 |
</select>
|
2438 |
+
<?php
|
2439 |
+
// <select name="wppa-bulk-album" id="wppa-bulk-album" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_album',this.value,365 );" >
|
2440 |
+
echo wppa_album_select_a( array( 'checkaccess' => true,
|
2441 |
+
'path' => wppa_switch( 'hier_albsel' ),
|
2442 |
+
'exclude' => $album,
|
2443 |
+
'selected' => '0',
|
2444 |
+
'addpleaseselect' => true,
|
2445 |
+
'sort' => true,
|
2446 |
+
'tagopen' => '<select' .
|
2447 |
+
' name="wppa-bulk-album"' .
|
2448 |
+
' id="wppa-bulk-album"' .
|
2449 |
+
' style="display:none;"' .
|
2450 |
+
' onchange="wppa_setCookie( \'wppa_bulk_album\',this.value,365 );"' .
|
2451 |
+
' >',
|
2452 |
+
'tagname' => 'wppa-bulk-album',
|
2453 |
+
'tagid' => 'wppa-bulk-album',
|
2454 |
+
'tagonchange' => 'wppa_setCookie( \'wppa_bulk_album\',this.value,365 );',
|
2455 |
+
'tagstyle' => 'display:none;cursor:pointer;',
|
2456 |
+
) );
|
2457 |
+
?>
|
2458 |
<select name="wppa-bulk-status" id="wppa-bulk-status" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_status',this.value,365 );" >
|
2459 |
<option value="" ><?php _e( '- select a status -' , 'wp-photo-album-plus') ?></option>
|
2460 |
<option value="pending" ><?php _e( 'Pending' , 'wp-photo-album-plus') ?></option>
|
wppa-settings-autosave.php
CHANGED
@@ -2742,6 +2742,27 @@ global $wp_version;
|
|
2742 |
$clas = 'wppa_feup';
|
2743 |
$tags = 'access,upload';
|
2744 |
wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2745 |
|
2746 |
$name = __('User upload Ajax', 'wp-photo-album-plus');
|
2747 |
$desc = __('Shows the upload progression bar.', 'wp-photo-album-plus');
|
2742 |
$clas = 'wppa_feup';
|
2743 |
$tags = 'access,upload';
|
2744 |
wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
|
2745 |
+
|
2746 |
+
$name = __('User upload roles', 'wp-photo-album-plus');
|
2747 |
+
$desc = __('Optionally limit access to selected userroles', 'wp-photo-album-plus');
|
2748 |
+
$help = esc_js(__('This selection only applies when the previous item is ticked', 'wp-photo-album-plus'));
|
2749 |
+
$slug = 'wppa_user_opload_roles';
|
2750 |
+
$roles = $wp_roles->roles;
|
2751 |
+
$opts = array();
|
2752 |
+
$vals = array();
|
2753 |
+
$opts[] = '-- '.__('Not limited', 'wp-photo-album-plus').' --';
|
2754 |
+
$vals[] = '';
|
2755 |
+
foreach (array_keys($roles) as $key) {
|
2756 |
+
$role = $roles[$key];
|
2757 |
+
$rolename = translate_user_role( $role['name'] );
|
2758 |
+
$opts[] = $rolename;
|
2759 |
+
$vals[] = $key;
|
2760 |
+
}
|
2761 |
+
$onch = '';
|
2762 |
+
$html = wppa_select_m($slug, $opts, $vals, $onch, '', false, '', '220' );
|
2763 |
+
$clas = 'wppa_feup';
|
2764 |
+
$tags = 'access,upload';
|
2765 |
+
wppa_setting($slug, '2.1', $name, $desc, $html, $help, $clas, $tags);
|
2766 |
|
2767 |
$name = __('User upload Ajax', 'wp-photo-album-plus');
|
2768 |
$desc = __('Shows the upload progression bar.', 'wp-photo-album-plus');
|
wppa-setup.php
CHANGED
@@ -966,6 +966,7 @@ Hide Camera info
|
|
966 |
'wppa_user_upload_video_on' => 'no',
|
967 |
'wppa_user_upload_audio_on' => 'no',
|
968 |
'wppa_user_upload_login' => 'yes',
|
|
|
969 |
'wppa_ajax_upload' => 'yes',
|
970 |
'wppa_copyright_on' => 'yes', // 19
|
971 |
'wppa_copyright_notice' => __('<span style="color:red" >Warning: Do not upload copyrighted material!</span>', 'wp-photo-album-plus'), // 20
|
966 |
'wppa_user_upload_video_on' => 'no',
|
967 |
'wppa_user_upload_audio_on' => 'no',
|
968 |
'wppa_user_upload_login' => 'yes',
|
969 |
+
'wppa_user_opload_roles' => '',
|
970 |
'wppa_ajax_upload' => 'yes',
|
971 |
'wppa_copyright_on' => 'yes', // 19
|
972 |
'wppa_copyright_notice' => __('<span style="color:red" >Warning: Do not upload copyrighted material!</span>', 'wp-photo-album-plus'), // 20
|
wppa-tinymce-shortcodes.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
*
|
6 |
-
* Version 6.7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -70,10 +70,15 @@ function wppa_make_tinymce_dialog() {
|
|
70 |
global $wpdb;
|
71 |
|
72 |
// Prepare albuminfo
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
// Prepare photoinfo
|
@@ -280,7 +285,15 @@ global $wpdb;
|
|
280 |
// Real albums
|
281 |
'<tr id="wppagallery-album-real-tr" style="display:none;" >'.
|
282 |
'<th><label for="wppagallery-album-real">'.__('The Album(s) to be used:', 'wp-photo-album-plus').'</label></th>'.
|
283 |
-
'<td>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
'<select id="wppagallery-album-real" style="max-width:400px;" name="album" multiple="multiple" onchange="wppaGalleryEvaluate()">';
|
285 |
if ( $albums ) {
|
286 |
|
@@ -296,24 +309,38 @@ global $wpdb;
|
|
296 |
else {
|
297 |
$result .= '<option value="0" >' . __('There are no albums yet', 'wp-photo-album-plus') . '</option>';
|
298 |
}
|
299 |
-
$result .= '</select>'
|
|
|
|
|
300 |
'</td>'.
|
301 |
-
'</tr>'
|
302 |
-
|
303 |
-
|
304 |
-
'<
|
305 |
-
'<
|
306 |
-
'<
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
|
|
|
|
|
|
312 |
|
313 |
// Real albums optional
|
|
|
314 |
'<tr id="wppagallery-album-realopt-tr" style="display:none;" >'.
|
315 |
'<th><label for="wppagallery-album-realopt">'.__('The Album(s) to be used:', 'wp-photo-album-plus').'</label></th>'.
|
316 |
-
'<td>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
'<select id="wppagallery-album-realopt" style="max-width:400px;" name="album" multiple="multiple" onchange="wppaGalleryEvaluate()">';
|
318 |
if ( $albums ) {
|
319 |
|
@@ -329,7 +356,9 @@ global $wpdb;
|
|
329 |
else {
|
330 |
$result .= '<option value="0" >' . __('There are no albums yet', 'wp-photo-album-plus') . '</option>';
|
331 |
}
|
332 |
-
$result .= '</select>'
|
|
|
|
|
333 |
'</td>'.
|
334 |
'</tr>'.
|
335 |
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
*
|
6 |
+
* Version 6.7.07
|
7 |
*
|
8 |
*/
|
9 |
|
70 |
global $wpdb;
|
71 |
|
72 |
// Prepare albuminfo
|
73 |
+
if ( wppa_has_many_albums() ) {
|
74 |
+
$albums = null;
|
75 |
+
}
|
76 |
+
else {
|
77 |
+
$albums = $wpdb->get_results( "SELECT `id`, `name` FROM `".WPPA_ALBUMS."` ORDER BY `timestamp` DESC", ARRAY_A );
|
78 |
+
if ( wppa_switch( 'hier_albsel' ) ) {
|
79 |
+
$albums = wppa_add_paths( $albums );
|
80 |
+
$albums = wppa_array_sort( $albums, 'name' );
|
81 |
+
}
|
82 |
}
|
83 |
|
84 |
// Prepare photoinfo
|
285 |
// Real albums
|
286 |
'<tr id="wppagallery-album-real-tr" style="display:none;" >'.
|
287 |
'<th><label for="wppagallery-album-real">'.__('The Album(s) to be used:', 'wp-photo-album-plus').'</label></th>'.
|
288 |
+
'<td>';
|
289 |
+
if ( wppa_has_many_albums() ) {
|
290 |
+
$result .=
|
291 |
+
'<input id="wppagallery-album-real" style="max-width:400px;" name="album" onchange="wppaGalleryEvaluate()" />'.
|
292 |
+
'<br />'.
|
293 |
+
__('Enter one or more album numbers, seperated by commas', 'wp-photo-album-plus');
|
294 |
+
}
|
295 |
+
else {
|
296 |
+
$result .=
|
297 |
'<select id="wppagallery-album-real" style="max-width:400px;" name="album" multiple="multiple" onchange="wppaGalleryEvaluate()">';
|
298 |
if ( $albums ) {
|
299 |
|
309 |
else {
|
310 |
$result .= '<option value="0" >' . __('There are no albums yet', 'wp-photo-album-plus') . '</option>';
|
311 |
}
|
312 |
+
$result .= '</select>';
|
313 |
+
}
|
314 |
+
$result .=
|
315 |
'</td>'.
|
316 |
+
'</tr>';
|
317 |
+
if ( ! wppa_has_many_albums() ) {
|
318 |
+
$result .=
|
319 |
+
'<tr id="wppagallery-album-real-search-tr" style="display:none;" >' .
|
320 |
+
'<th><label for="">'.__('Filter album:', 'wp-photo-album-plus').'</label></th>'.
|
321 |
+
'<td>'.
|
322 |
+
'<input id="wppagallery-album-real-search" type="text" onkeyup="wppaGalleryEvaluate()" />'.
|
323 |
+
'<br />'.
|
324 |
+
'<small>'.
|
325 |
+
__('Enter a (part of) the album name to limit the options in the selection box above.', 'wp-photo-album-plus').' '.
|
326 |
+
'</small>'.
|
327 |
+
'</td>'.
|
328 |
+
'</tr>';
|
329 |
+
}
|
330 |
|
331 |
// Real albums optional
|
332 |
+
$result .=
|
333 |
'<tr id="wppagallery-album-realopt-tr" style="display:none;" >'.
|
334 |
'<th><label for="wppagallery-album-realopt">'.__('The Album(s) to be used:', 'wp-photo-album-plus').'</label></th>'.
|
335 |
+
'<td>';
|
336 |
+
if ( wppa_has_many_albums() ) {
|
337 |
+
$result .=
|
338 |
+
'<input id="wppagallery-album-realopt" style="max-width:400px;" name="album" onchange="wppaGalleryEvaluate()" value="0" />'.
|
339 |
+
'<br />'.
|
340 |
+
__('Optinally enter one or more album numbers, seperated by commas, or 0 for all albums', 'wp-photo-album-plus');
|
341 |
+
}
|
342 |
+
else {
|
343 |
+
$result .=
|
344 |
'<select id="wppagallery-album-realopt" style="max-width:400px;" name="album" multiple="multiple" onchange="wppaGalleryEvaluate()">';
|
345 |
if ( $albums ) {
|
346 |
|
356 |
else {
|
357 |
$result .= '<option value="0" >' . __('There are no albums yet', 'wp-photo-album-plus') . '</option>';
|
358 |
}
|
359 |
+
$result .= '</select>';
|
360 |
+
}
|
361 |
+
$result .=
|
362 |
'</td>'.
|
363 |
'</tr>'.
|
364 |
|
wppa-upldr-widget.php
CHANGED
@@ -226,14 +226,21 @@ class UpldrWidget extends WP_Widget {
|
|
226 |
<select class="widefat" multiple="multiple" onchange="wppaGetSelEnumToId( 'parentalbums-<?php echo $this->get_widget_id() ?>', '<?php echo $this->get_field_id('parent') ?>' )" id="<?php echo $this->get_field_id('parent-list'); ?>" name="<?php echo $this->get_field_name('parent-list'); ?>" >
|
227 |
<?php
|
228 |
// Prepare albuminfo
|
229 |
-
|
230 |
-
|
231 |
-
$albums = wppa_add_paths( $albums );
|
232 |
}
|
233 |
else {
|
234 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
}
|
236 |
-
$albums = wppa_array_sort( $albums, 'name' );
|
237 |
|
238 |
// Please select
|
239 |
$sel = $instance['parent'] ? '' : 'selected="selected" ';
|
226 |
<select class="widefat" multiple="multiple" onchange="wppaGetSelEnumToId( 'parentalbums-<?php echo $this->get_widget_id() ?>', '<?php echo $this->get_field_id('parent') ?>' )" id="<?php echo $this->get_field_id('parent-list'); ?>" name="<?php echo $this->get_field_name('parent-list'); ?>" >
|
227 |
<?php
|
228 |
// Prepare albuminfo
|
229 |
+
if ( wppa_has_many_albums() ) {
|
230 |
+
$albums = array();
|
|
|
231 |
}
|
232 |
else {
|
233 |
+
$albums = $wpdb->get_results( "SELECT `id`, `name` FROM `" . WPPA_ALBUMS . "`", ARRAY_A );
|
234 |
+
}
|
235 |
+
if ( ! empty( $albums ) ) {
|
236 |
+
if ( wppa_switch( 'hier_albsel' ) ) {
|
237 |
+
$albums = wppa_add_paths( $albums );
|
238 |
+
}
|
239 |
+
else {
|
240 |
+
foreach ( array_keys( $albums ) as $index ) $albums[$index]['name'] = __( stripslashes( $albums[$index]['name'] ) );
|
241 |
+
}
|
242 |
+
$albums = wppa_array_sort( $albums, 'name' );
|
243 |
}
|
|
|
244 |
|
245 |
// Please select
|
246 |
$sel = $instance['parent'] ? '' : 'selected="selected" ';
|
wppa-utils.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
-
* Version 6.7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -3602,17 +3602,19 @@ function wppa_is_safari() {
|
|
3602 |
|
3603 |
function wppa_chmod( $fso ) {
|
3604 |
|
|
|
|
|
3605 |
$perms = fileperms( $fso ) & 0777;
|
3606 |
-
|
3607 |
if ( is_dir( $fso ) ) {
|
3608 |
-
|
3609 |
// Check file permissions
|
3610 |
if ( 0755 !== ( $perms & 0755 ) ) {
|
3611 |
-
|
3612 |
// If not sufficient, try to change
|
3613 |
@ chmod( $fso, 0755 );
|
3614 |
clearstatcache();
|
3615 |
-
|
3616 |
// If still no luck
|
3617 |
if ( 0755 !== ( fileperms( $fso ) & 0755 ) ) {
|
3618 |
wppa_log( 'Fso', sprintf( 'Unable to set filepermissions on %s from %o to 0755', $fso, $perms ) );
|
@@ -3621,17 +3623,28 @@ function wppa_chmod( $fso ) {
|
|
3621 |
wppa_log( 'Fso', sprintf( 'Successfully set filepermissions on %s from %o to 0755', $fso, $perms ) );
|
3622 |
}
|
3623 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3624 |
}
|
3625 |
|
3626 |
if ( is_file( $fso ) ) {
|
3627 |
-
|
3628 |
// Check file permissions
|
3629 |
if ( 0644 !== ( fileperms( $fso ) & 0644 ) ) {
|
3630 |
-
|
3631 |
// If not sufficient, try to change
|
3632 |
@ chmod( $fso, 0644 );
|
3633 |
clearstatcache();
|
3634 |
-
|
3635 |
// If still no luck
|
3636 |
if ( 0644 !== ( fileperms( $fso ) & 0644 ) ) {
|
3637 |
wppa_log( 'Fso', sprintf( 'Unable to set filepermissions on %s from %o to 0644', $fso, $perms ) );
|
@@ -4055,3 +4068,49 @@ function wppa_pdf_postprocess( $id ) {
|
|
4055 |
wppa( 'is_pdf', false );
|
4056 |
}
|
4057 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
+
* Version 6.7.07
|
7 |
*
|
8 |
*/
|
9 |
|
3602 |
|
3603 |
function wppa_chmod( $fso ) {
|
3604 |
|
3605 |
+
$fso = rtrim( $fso, '/' );
|
3606 |
+
|
3607 |
$perms = fileperms( $fso ) & 0777;
|
3608 |
+
|
3609 |
if ( is_dir( $fso ) ) {
|
3610 |
+
|
3611 |
// Check file permissions
|
3612 |
if ( 0755 !== ( $perms & 0755 ) ) {
|
3613 |
+
|
3614 |
// If not sufficient, try to change
|
3615 |
@ chmod( $fso, 0755 );
|
3616 |
clearstatcache();
|
3617 |
+
|
3618 |
// If still no luck
|
3619 |
if ( 0755 !== ( fileperms( $fso ) & 0755 ) ) {
|
3620 |
wppa_log( 'Fso', sprintf( 'Unable to set filepermissions on %s from %o to 0755', $fso, $perms ) );
|
3623 |
wppa_log( 'Fso', sprintf( 'Successfully set filepermissions on %s from %o to 0755', $fso, $perms ) );
|
3624 |
}
|
3625 |
}
|
3626 |
+
|
3627 |
+
// Verify existance of index.php
|
3628 |
+
if ( ! is_file( $fso . '/index.php' ) ) {
|
3629 |
+
@ copy( WPPA_PATH . '/index.php', $fso . '/index.php' );
|
3630 |
+
if ( is_file( $fso . '/index.php' ) ) {
|
3631 |
+
wppa_log( 'fso', 'Added: ' . $fso . '/index.php' );
|
3632 |
+
}
|
3633 |
+
else {
|
3634 |
+
wppa_log( 'fso', 'Could not add ' . $fso . '/index.php' );
|
3635 |
+
}
|
3636 |
+
}
|
3637 |
}
|
3638 |
|
3639 |
if ( is_file( $fso ) ) {
|
3640 |
+
|
3641 |
// Check file permissions
|
3642 |
if ( 0644 !== ( fileperms( $fso ) & 0644 ) ) {
|
3643 |
+
|
3644 |
// If not sufficient, try to change
|
3645 |
@ chmod( $fso, 0644 );
|
3646 |
clearstatcache();
|
3647 |
+
|
3648 |
// If still no luck
|
3649 |
if ( 0644 !== ( fileperms( $fso ) & 0644 ) ) {
|
3650 |
wppa_log( 'Fso', sprintf( 'Unable to set filepermissions on %s from %o to 0644', $fso, $perms ) );
|
4068 |
wppa( 'is_pdf', false );
|
4069 |
}
|
4070 |
|
4071 |
+
// Has the system 'many' albums?
|
4072 |
+
function wppa_has_many_albums() {
|
4073 |
+
global $wpdb;
|
4074 |
+
static $n_albums;
|
4075 |
+
|
4076 |
+
// Max specified? If not, return false
|
4077 |
+
if ( ! wppa_opt( 'photo_admin_max_albums' ) ) {
|
4078 |
+
return false;
|
4079 |
+
}
|
4080 |
+
|
4081 |
+
// Find total number of albums, if not done before
|
4082 |
+
if ( ! $n_albums ) {
|
4083 |
+
$n_albums = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_ALBUMS . "`" );
|
4084 |
+
}
|
4085 |
+
|
4086 |
+
// Decide if many
|
4087 |
+
if ( $n_albums > wppa_opt( 'photo_admin_max_albums' ) ) {
|
4088 |
+
return true;
|
4089 |
+
}
|
4090 |
+
return false;
|
4091 |
+
}
|
4092 |
+
|
4093 |
+
// Return false if user is logged in, upload roles are specified and i do not have one of them
|
4094 |
+
function wppa_check_user_upload_role() {
|
4095 |
+
|
4096 |
+
// Not logged in, ok
|
4097 |
+
if ( ! is_user_logged_in() ) {
|
4098 |
+
return true;
|
4099 |
+
}
|
4100 |
+
|
4101 |
+
// No roles specified: ok
|
4102 |
+
if ( ! wppa_opt( 'user_opload_roles' ) ) {
|
4103 |
+
return true;
|
4104 |
+
}
|
4105 |
+
|
4106 |
+
// Roles specified
|
4107 |
+
$roles = explode( ',', wppa_opt( 'user_opload_roles' ) );
|
4108 |
+
foreach ( $roles as $role ) {
|
4109 |
+
if ( current_user_can( $role ) ) {
|
4110 |
+
return true;
|
4111 |
+
}
|
4112 |
+
}
|
4113 |
+
|
4114 |
+
// No matching role
|
4115 |
+
return false;
|
4116 |
+
}
|
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: 6.7.
|
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/
|
@@ -22,8 +22,8 @@ global $wpdb;
|
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
-
global $wppa_revno; $wppa_revno = '
|
26 |
-
global $wppa_api_version; $wppa_api_version = '6-7-
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|
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: 6.7.07
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
+
global $wppa_revno; $wppa_revno = '6707'; // WPPA db version
|
26 |
+
global $wppa_api_version; $wppa_api_version = '6-7-07-006'; // WPPA software version
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|