WP Photo Album Plus - Version 8.1.07.003

Version Description

= 8.1.06 =

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

Release Info

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

Code changes from version 8.1.07.002 to 8.1.07.003

changelog.txt CHANGED
@@ -3,10 +3,12 @@ WP Photo Album Plus Changelog
3
  = 8.1.07 =
4
 
5
  * Maintenance release
6
- * Clicking the 'back to thumbnails' button in the slideshow breadcrumb now always returns to the right page,
7
  hilgliting the right item, regardless of either page size.
8
  * Fixed a possible conflict with wp customizer.
9
  * Fixed a db warning at initial installation.
 
 
10
 
11
  = 8.1.06 =
12
 
@@ -16,7 +18,7 @@ hilgliting the right item, regardless of either page size.
16
  * Improved behaviour of pan buttons on zoomable images. Improved touch moving of zoomed images.
17
  * Improved stability of displaying panorama and zoomable images.
18
  * Extra checkbox on Ajax method selection ( Advanced settings -> System -> I -> Item 5: Ajax method ) to use home url rather than site url.
19
-
20
  = 8.1.05 =
21
 
22
  * Fixed a js error when no nicescroller active.
3
  = 8.1.07 =
4
 
5
  * Maintenance release
6
+ * Clicking the 'back to thumbnails' button in the slideshow breadcrumb now always returns to the right page,
7
  hilgliting the right item, regardless of either page size.
8
  * Fixed a possible conflict with wp customizer.
9
  * Fixed a db warning at initial installation.
10
+ * You can now also specify a default description for 'granted' albums in Advanced settings -> New -> I -> Item 19a: Grant album description.
11
+ You can use $user as placeholder for the user name as defined in Item 19, as well as all existing album description keywords.
12
 
13
  = 8.1.06 =
14
 
18
  * Improved behaviour of pan buttons on zoomable images. Improved touch moving of zoomed images.
19
  * Improved stability of displaying panorama and zoomable images.
20
  * Extra checkbox on Ajax method selection ( Advanced settings -> System -> I -> Item 5: Ajax method ) to use home url rather than site url.
21
+
22
  = 8.1.05 =
23
 
24
  * Fixed a js error when no nicescroller active.
js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 8.1.05.003
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -1913,6 +1913,7 @@ function wppaBulkDoitOnClick() {
1913
  return false;
1914
  break;
1915
  case 'wppa-bulk-delete':
 
1916
  break;
1917
  case 'wppa-bulk-move-to':
1918
  case 'wppa-bulk-copy-to':
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 8.1.07.003
5
  /* Various js routines used in admin pages
6
  */
7
 
1913
  return false;
1914
  break;
1915
  case 'wppa-bulk-delete':
1916
+ case 'wppa-bulk-delete-immediate':
1917
  break;
1918
  case 'wppa-bulk-move-to':
1919
  case 'wppa-bulk-copy-to':
js/wppa-admin-scripts.min.js CHANGED
@@ -1 +1 @@
1
- function checkjQueryRev(e,t,a){var p=parseFloat(jQuery.fn.jquery);t.checked&&p<a&&(alert(e+"\nThe version of your jQuery library: "+p+" is too low for this feature. It requires version "+a),t.checked="")}function wppaReUpload(e,o,t,r){document.getElementById("wppa-re-up-form-"+o);var a=document.getElementById("wppa-re-up-file-"+o),u=document.getElementById("wppa-re-up-butn-"+o);e.preventDefault();a=a.files[0];if(a.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+a.name);else if(a.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+o).css("display","none");u.value="Uploading...",u.style.color="black";t=new FormData;t.append("photo",a,a.name);var l=new XMLHttpRequest,a="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;l.open("POST",wppaAjaxUrl+a,!0),l.onload=function(){if(200===l.status){var e=wppaTrim(l.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":var t,a,p,n=JSON.parse(e[2]);for(t in n)switch(p=n[t],t){case"remark":p=(p=(p=p.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),a="0"!=e[1]?'<span style="color:red;" >'+p+"</span>":'<span style="color:green;" >'+p+"</span>",r&&(a+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+o).html(a);break;case"photourl":wppaCropper[o]?wppaCropper[o].replace(p):jQuery("#photourl-"+o).attr("src",p),jQuery("#thumba-"+o).attr("href",p);break;case"thumburl":jQuery("#thumburl-"+o).attr("src",p);break;case"magickstack":jQuery("#magickstack-"+o).html(p),0<p.length?jQuery("#imstackbutton-"+o).css("display","inline"):jQuery("#imstackbutton-"+o).css("display","none");break;default:jQuery("#"+t+"-"+o).html(p)}u.value="Upload",jQuery("#re-up-"+o).css("display","none");break;case"99":document.getElementById("photoitem-"+o).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+o).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",u.value="Error occured",u.style.color="red"}}else alert("An error occurred!")},l.send(t)}else alert("File is not an image file!")}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",function(){wppaMakeLazyVisible("windowon")}),wppaMakeLazyVisible("docready")});var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaCheckWidgetMethod(){var e,t,a;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(a=jQuery("#wppa-wp").val())||"day-of-month"==a||"day-of-year"==a?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,a){var p="",n="",p=e||'<div style="padding-left:5px;" >';a?n=a:aftrer="</div>",wppaFeAjaxLog("in");var o=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;a+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,o.open("GET",a,!0),o.send(),o.onreadystatechange=function(){switch(o.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==o.status?("ER"==(e=wppaTrim(o.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=p+e[2]+n,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=p+'<span style="color:red;" >Comm error '+o.status+": "+o.statusText+"</span>"+n}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var a=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,a.open("GET",e,!0),a.send(),a.onreadystatechange=function(){switch(a.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==a.status?("ER"==(e=wppaTrim(a.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,a){wppaFeAjaxLog("in");var p=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),a&&(n+="&wppa-watermark-pos="+a),p.open("POST",wppaAjaxUrl,!0),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(n),p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>")}}function wppaAjaxUpdateIptc(l,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+l+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+l).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+l).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+l).html(bef+'<span style="color:red">'+p[2]+"</span>"+aft);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",jQuery("#remark-"+l).html(o);break;case"photourl":wppaCropper[l]?wppaCropper[l].replace(r):jQuery("#photourl-"+l).attr("src",r),jQuery("#thumba-"+l).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+l).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+l).html(r),0<r.length?jQuery("#imstackbutton-"+l).css("display","inline"):jQuery("#imstackbutton-"+l).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+l).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(l,i,e,s,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+l+"&item="+i+"&wppa-nonce="+document.getElementById("photo-nonce-"+l).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==i&&jQuery("#wppa-photo-spin-"+l).css({visibility:"visible"}),jQuery("#remark-"+l).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+l).html(c+'<span style="color:red">'+p[2]+"</span>"+d);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",s&&(o+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+l).html(o);break;case"photourl":wppaCropper[l]?wppaCropper[l].replace(r):jQuery("#photourl-"+l).attr("src",r),jQuery("#thumba-"+l).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+l).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+l).html(r),0<r.length?jQuery("#imstackbutton-"+l).css("display","inline"):jQuery("#imstackbutton-"+l).css("display","none");break;default:jQuery("#"+n+"-"+l).html(r)}}"description"==i&&jQuery("#wppa-photo-spin-"+l).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+l).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){var p=(p=document.location.href).replace(/&pano-val=./,"");s?setTimeout(function(){document.location.href=p},300):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,a,p){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var o=wppaAlbumUpdateMatrix.length,r=0,u=!1,l=-1;r<o;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=!0,l=r),r++;u||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,p],l=o),wppaAlbumUpdateMatrix[l][3]="number"==typeof a?a:a.value,wppaAlbumUpdateMatrix[l][5]=p,wppaAjaxUpdateAlbumMonitor(n)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,a=0;a<t;)wppaAlbumUpdateMatrix[a][2]==wppaAlbumUpdateMatrix[a][3]||wppaAlbumUpdateMatrix[a][4]||(wppaAlbumUpdateMatrix[a][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[a][0],wppaAlbumUpdateMatrix[a][1],wppaAlbumUpdateMatrix[a][3],e,wppaAlbumUpdateMatrix[a][5])),a++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(r,u,l,i,s){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+r+"&item="+u+"&wppa-nonce="+document.getElementById("album-nonce-"+r).value+"&value="+wppaEncode(l),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==u&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,a){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+r).html(e[2]):jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+r).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),s&&"0"==e[1])return jQuery("#albumstatus-"+r).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==u&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var p=0,n=-1,o=wppaAlbumUpdateMatrix.length;p<o;)wppaAlbumUpdateMatrix[p][0]==r&&wppaAlbumUpdateMatrix[p][1]==u&&(n=p),p++;wppaAlbumUpdateMatrix[n][2]=l||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(i)},error:function(e,t,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+r).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,a,e){var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+a+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+a).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"))},p.open("GET",e,!0),p.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var a=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;p+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?p+="&value=yes":p+="&value=no",a.onreadystatechange=function(){switch(a.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(a.responseText).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=a.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+a.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+a.status)),wppaCheckInconsistencies()}},a.open("GET",p,!0),a.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(p,e,r){if(!r&&!e&&"yes"==document.getElementById(p+"_continue").value)return document.getElementById(p+"_continue").value="no",document.getElementById(p+"_button").value="Start!",void(0<jQuery("#"+p+"_togo").html()&&(jQuery("#"+p+"_status").html("Pausing..."),jQuery("#"+p+"_button").css("display","none")));r||(document.getElementById(p+"_continue").value="yes",document.getElementById(p+"_button").value="Stop!",""==jQuery("#"+p+"_status").html()&&jQuery("#"+p+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+p+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(r?"&wppa-cron=1":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("||"),n=p[1],o=!1;return n?(10<p[0].length&&(alert("An error occurred:\n"+p[0]),o=!0),jQuery("#"+n+"_status").html(p[2]),jQuery("#"+n+"_togo").html(p[3]),jQuery("#"+n+"_button").css("display",""),o||"0"==p[3]?"reload"==p[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void(document.getElementById(n+"_continue")&&"yes"==document.getElementById(n+"_continue").value?setTimeout("wppaMaintenanceProc('"+n+"', true)",20):(r||jQuery("#"+n+"_status").html("Pending"),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+p+", Error = "+a+", status = "+t,"force"),jQuery("#"+p+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==p&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==p&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==p&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+p+"', true)",2e3))},complete:function(e,t,a){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),a=wppaGetXmlHttp(),p=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,a.open("POST",p,!1),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(e),4==a.readyState&&200==a.status&&(a=(e=wppaEntityDecode(a.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"50px"}),jQuery(".ui-dialog-title").html("<h2>"+a+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),setTimeout(function(){jQuery("#wppa-maintenance-list").niceScroll&&jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{})},1e3))}function wppaAjaxUpdateOptionValue(l,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(l)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+l,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+l.replace("#","H")).attr("title",e[2]),e[4])for(var p,n,o,r=e[4].split(";"),u=0;u<r.length;)p=r[u].split(":"),n=jQuery("#"+p[0]).html(),o=p[1],""!=n&&""==o&&(o='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+p[0]).html(o),u++},error:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+l.replace("#","H")).attr("title","Communication error")},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=l&&"icon_corner_style"!=l||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=l&&"svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=l&&"ovl_svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(p=(p=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,p="";a<t.length;)p+=t[a],++a<t.length&&(p+="||PLUS||");return p}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),elm=document.getElementById("status-"+e),elm){if("pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var a=0;a<t.length;)"jpg"!=t[a]&&"JPG"!=t[a]||jQuery("#psdesc-"+e).css({display:""}),a++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var a,p="",n=-1,o=-2,r=0,u=!1,l=0;l<e.length;)0!=(a=e[l].valueOf())&&(r=n,a==++r?u=!0:u?(p+=n==o?t+n+t+a:t+t+n+t+a,u=!1):p+=t+a,u||(o=a,o++),n=a),l++;for(u&&(p+=".."+n);"."==p.substr(0,1);)p=p.substr(1);for(;p.substr(0,1)==t;)p=p.substr(1);return p}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var a,p=[],n=0,o=0;for(t=t||".",a=jQuery(e),o=n=0;n<a.length;)a[n].selected&&(p[o]=a[n].value,o++),n++;return wppaArrayToEnum(p,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+p,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+p+"-spin").css("display","inline")},success:function(e,t,a){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[2])},error:function(e,t,a){alert("Export Db Table "+p+" failed. Error = "+a+", status = "+t)},complete:function(e,t,a){jQuery("#"+p+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){wppaConsoleLog("Requesting togo for slug "+n,"force")},success:function(e,t,a){var p=e.split("|");jQuery("#"+n+"_togo").html(p[0]);e=jQuery("#"+n+"_status").html(),p=p[1];""!=e&&""==p&&(p='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(p),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){e=e.split("|");jQuery("#"+p).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var a=0,p=0;function n(e){(e=e||window.event).preventDefault(),a=p-e.clientY,p=e.clientY,t.style.top=t.offsetTop-a+"px"}function o(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,p=e.clientY,document.onmouseup=o,document.onmousemove=n}}function wppaBulkActionChange(e,t){wppa_setCookie("wppa_bulk_action",e.value,365),"wppa-bulk-move-to"==e.value||"wppa-bulk-copy-to"==e.value?jQuery("#wppa-bulk-album").css("display","inline"):jQuery("#wppa-bulk-album").css("display","none"),"wppa-bulk-status"==e.value?jQuery("#wppa-bulk-status").css("display","inline"):jQuery("#wppa-bulk-status").css("display","none"),"wppa-bulk-owner"==e.value?jQuery("#wppa-bulk-owner").css("display","inline"):jQuery("#wppa-bulk-owner").css("display","none")}function wppaBulkDoitOnClick(){var e=jQuery(".wppa-bulk-photo"),t=0;for(i=0;i<e.length;i++)e[i].checked&&t++;if(0==t)return alert("No photos selected"),!1;var a=document.getElementById("wppa-bulk-action").value;switch(a){case"":return alert("No action selected"),!1;case"wppa-bulk-delete":break;case"wppa-bulk-move-to":case"wppa-bulk-copy-to":if(0==document.getElementById("wppa-bulk-album").value)return alert("No album selected"),!1;break;case"wppa-bulk-status":if(0==document.getElementById("wppa-bulk-status").value)return alert("No status selected"),!1;break;case"wppa-bulk-owner":if(0==documnet.getElementById("wppa-bulk-owner").value)return alert("No new owner selected"),!1;break;default:return alert("Unimplemented action requested: "+a),!1}return!0}function wppaSetThumbsize(e){e=e.value;wppa_setCookie("wppa_bulk_thumbsize",e,365),jQuery(".wppa-bulk-thumb").css("max-width",e+"px"),jQuery(".wppa-bulk-thumb").css("max-height",e/2+"px"),jQuery(".wppa-bulk-dec").css("height",e/2+"px")}function wppaToggleConfirmDelete(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmDelete","checked",365):wppa_setCookie("wppaConfirmDelete","unchecked",365)}function wppaToggleConfirmMove(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmMove","checked",365):wppa_setCookie("wppaConfirmMove","unchecked",365)}function wppaSetConfirmDelete(e){"checked"==wppa_getCookie("wppaConfirmDelete")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaSetConfirmMove(e){"checked"==wppa_getCookie("wppaConfirmMove")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,a){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}function wppaTestAdminReady(){"complete"===document.readyState?jQuery("#wppa-admin-spinner").fadeOut():setTimeout("wppaTestAdminReady()",200)}function wppaCommentAdminUpdateHref(e){var t=encodeURIComponent(jQuery("#commenttext-"+e).val()),a=jQuery("#href-"+e).attr("href"),p=a.split("commenttext=");p[1]=t,a=p[0]+"commenttext="+p[1],jQuery("#href-"+e).attr("href",a),jQuery("#href-"+e).css("display","inline")}jQuery(document).ready(function(){var e;document.getElementById("wppa-bulk-action")&&(e=wppa_getCookie("wppa_bulk_action"),"wppa-bulk-move-to"!=(document.getElementById("wppa-bulk-action").value=e)&&"wppa-bulk-copy-to"!=e||(jQuery("#wppa-bulk-album").css("display","inline"),document.getElementById("wppa-bulk-album").value=wppa_getCookie("wppa_bulk_album")),"wppa-bulk-status"==e&&(jQuery("#wppa-bulk-status").css("display","inline"),document.getElementById("wppa-bulk-status").value=wppa_getCookie("wppa_bulk_status")),"wppa-bulk-owner"==e&&(jQuery("#wppa-bulk-owner").css("display","inline"),document.getElementById("wppa-bulk-owner").value=wppa_getCookie("wppa_bulk_owner")))}),jQuery(document).ready(function(){setTimeout("wppaTestAdminReady()",200)});
1
+ function checkjQueryRev(e,t,a){var p=parseFloat(jQuery.fn.jquery);t.checked&&p<a&&(alert(e+"\nThe version of your jQuery library: "+p+" is too low for this feature. It requires version "+a),t.checked="")}function wppaReUpload(e,o,t,r){document.getElementById("wppa-re-up-form-"+o);var a=document.getElementById("wppa-re-up-file-"+o),u=document.getElementById("wppa-re-up-butn-"+o);e.preventDefault();a=a.files[0];if(a.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+a.name);else if(a.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+o).css("display","none");u.value="Uploading...",u.style.color="black";t=new FormData;t.append("photo",a,a.name);var l=new XMLHttpRequest,a="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;l.open("POST",wppaAjaxUrl+a,!0),l.onload=function(){if(200===l.status){var e=wppaTrim(l.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":var t,a,p,n=JSON.parse(e[2]);for(t in n)switch(p=n[t],t){case"remark":p=(p=(p=p.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),a="0"!=e[1]?'<span style="color:red;" >'+p+"</span>":'<span style="color:green;" >'+p+"</span>",r&&(a+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+o).html(a);break;case"photourl":wppaCropper[o]?wppaCropper[o].replace(p):jQuery("#photourl-"+o).attr("src",p),jQuery("#thumba-"+o).attr("href",p);break;case"thumburl":jQuery("#thumburl-"+o).attr("src",p);break;case"magickstack":jQuery("#magickstack-"+o).html(p),0<p.length?jQuery("#imstackbutton-"+o).css("display","inline"):jQuery("#imstackbutton-"+o).css("display","none");break;default:jQuery("#"+t+"-"+o).html(p)}u.value="Upload",jQuery("#re-up-"+o).css("display","none");break;case"99":document.getElementById("photoitem-"+o).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+o).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",u.value="Error occured",u.style.color="red"}}else alert("An error occurred!")},l.send(t)}else alert("File is not an image file!")}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",function(){wppaMakeLazyVisible("windowon")}),wppaMakeLazyVisible("docready")});var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaCheckWidgetMethod(){var e,t,a;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(a=jQuery("#wppa-wp").val())||"day-of-month"==a||"day-of-year"==a?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,a){var p="",n="",p=e||'<div style="padding-left:5px;" >';a?n=a:aftrer="</div>",wppaFeAjaxLog("in");var o=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;a+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,o.open("GET",a,!0),o.send(),o.onreadystatechange=function(){switch(o.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==o.status?("ER"==(e=wppaTrim(o.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=p+e[2]+n,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=p+'<span style="color:red;" >Comm error '+o.status+": "+o.statusText+"</span>"+n}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var a=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,a.open("GET",e,!0),a.send(),a.onreadystatechange=function(){switch(a.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==a.status?("ER"==(e=wppaTrim(a.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,a){wppaFeAjaxLog("in");var p=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),a&&(n+="&wppa-watermark-pos="+a),p.open("POST",wppaAjaxUrl,!0),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(n),p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>")}}function wppaAjaxUpdateIptc(l,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+l+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+l).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+l).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+l).html(bef+'<span style="color:red">'+p[2]+"</span>"+aft);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",jQuery("#remark-"+l).html(o);break;case"photourl":wppaCropper[l]?wppaCropper[l].replace(r):jQuery("#photourl-"+l).attr("src",r),jQuery("#thumba-"+l).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+l).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+l).html(r),0<r.length?jQuery("#imstackbutton-"+l).css("display","inline"):jQuery("#imstackbutton-"+l).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+l).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(l,i,e,s,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+l+"&item="+i+"&wppa-nonce="+document.getElementById("photo-nonce-"+l).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==i&&jQuery("#wppa-photo-spin-"+l).css({visibility:"visible"}),jQuery("#remark-"+l).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+l).html(c+'<span style="color:red">'+p[2]+"</span>"+d);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",s&&(o+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+l).html(o);break;case"photourl":wppaCropper[l]?wppaCropper[l].replace(r):jQuery("#photourl-"+l).attr("src",r),jQuery("#thumba-"+l).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+l).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+l).html(r),0<r.length?jQuery("#imstackbutton-"+l).css("display","inline"):jQuery("#imstackbutton-"+l).css("display","none");break;default:jQuery("#"+n+"-"+l).html(r)}}"description"==i&&jQuery("#wppa-photo-spin-"+l).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+l).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){var p=(p=document.location.href).replace(/&pano-val=./,"");s?setTimeout(function(){document.location.href=p},300):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,a,p){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var o=wppaAlbumUpdateMatrix.length,r=0,u=!1,l=-1;r<o;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=!0,l=r),r++;u||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,p],l=o),wppaAlbumUpdateMatrix[l][3]="number"==typeof a?a:a.value,wppaAlbumUpdateMatrix[l][5]=p,wppaAjaxUpdateAlbumMonitor(n)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,a=0;a<t;)wppaAlbumUpdateMatrix[a][2]==wppaAlbumUpdateMatrix[a][3]||wppaAlbumUpdateMatrix[a][4]||(wppaAlbumUpdateMatrix[a][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[a][0],wppaAlbumUpdateMatrix[a][1],wppaAlbumUpdateMatrix[a][3],e,wppaAlbumUpdateMatrix[a][5])),a++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(r,u,l,i,s){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+r+"&item="+u+"&wppa-nonce="+document.getElementById("album-nonce-"+r).value+"&value="+wppaEncode(l),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==u&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,a){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+r).html(e[2]):jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+r).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),s&&"0"==e[1])return jQuery("#albumstatus-"+r).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==u&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var p=0,n=-1,o=wppaAlbumUpdateMatrix.length;p<o;)wppaAlbumUpdateMatrix[p][0]==r&&wppaAlbumUpdateMatrix[p][1]==u&&(n=p),p++;wppaAlbumUpdateMatrix[n][2]=l||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(i)},error:function(e,t,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+r).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,a,e){var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+a+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+a).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"))},p.open("GET",e,!0),p.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var a=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;p+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?p+="&value=yes":p+="&value=no",a.onreadystatechange=function(){switch(a.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(a.responseText).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=a.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+a.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+a.status)),wppaCheckInconsistencies()}},a.open("GET",p,!0),a.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(p,e,r){if(!r&&!e&&"yes"==document.getElementById(p+"_continue").value)return document.getElementById(p+"_continue").value="no",document.getElementById(p+"_button").value="Start!",void(0<jQuery("#"+p+"_togo").html()&&(jQuery("#"+p+"_status").html("Pausing..."),jQuery("#"+p+"_button").css("display","none")));r||(document.getElementById(p+"_continue").value="yes",document.getElementById(p+"_button").value="Stop!",""==jQuery("#"+p+"_status").html()&&jQuery("#"+p+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+p+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(r?"&wppa-cron=1":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("||"),n=p[1],o=!1;return n?(10<p[0].length&&(alert("An error occurred:\n"+p[0]),o=!0),jQuery("#"+n+"_status").html(p[2]),jQuery("#"+n+"_togo").html(p[3]),jQuery("#"+n+"_button").css("display",""),o||"0"==p[3]?"reload"==p[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void(document.getElementById(n+"_continue")&&"yes"==document.getElementById(n+"_continue").value?setTimeout("wppaMaintenanceProc('"+n+"', true)",20):(r||jQuery("#"+n+"_status").html("Pending"),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+p+", Error = "+a+", status = "+t,"force"),jQuery("#"+p+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==p&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==p&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==p&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+p+"', true)",2e3))},complete:function(e,t,a){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),a=wppaGetXmlHttp(),p=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,a.open("POST",p,!1),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(e),4==a.readyState&&200==a.status&&(a=(e=wppaEntityDecode(a.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"50px"}),jQuery(".ui-dialog-title").html("<h2>"+a+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),setTimeout(function(){jQuery("#wppa-maintenance-list").niceScroll&&jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{})},1e3))}function wppaAjaxUpdateOptionValue(l,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(l)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+l,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+l.replace("#","H")).attr("title",e[2]),e[4])for(var p,n,o,r=e[4].split(";"),u=0;u<r.length;)p=r[u].split(":"),n=jQuery("#"+p[0]).html(),o=p[1],""!=n&&""==o&&(o='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+p[0]).html(o),u++},error:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+l.replace("#","H")).attr("title","Communication error")},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=l&&"icon_corner_style"!=l||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=l&&"svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=l&&"ovl_svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(p=(p=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,p="";a<t.length;)p+=t[a],++a<t.length&&(p+="||PLUS||");return p}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),elm=document.getElementById("status-"+e),elm){if("pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var a=0;a<t.length;)"jpg"!=t[a]&&"JPG"!=t[a]||jQuery("#psdesc-"+e).css({display:""}),a++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var a,p="",n=-1,o=-2,r=0,u=!1,l=0;l<e.length;)0!=(a=e[l].valueOf())&&(r=n,a==++r?u=!0:u?(p+=n==o?t+n+t+a:t+t+n+t+a,u=!1):p+=t+a,u||(o=a,o++),n=a),l++;for(u&&(p+=".."+n);"."==p.substr(0,1);)p=p.substr(1);for(;p.substr(0,1)==t;)p=p.substr(1);return p}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var a,p=[],n=0,o=0;for(t=t||".",a=jQuery(e),o=n=0;n<a.length;)a[n].selected&&(p[o]=a[n].value,o++),n++;return wppaArrayToEnum(p,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+p,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+p+"-spin").css("display","inline")},success:function(e,t,a){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[2])},error:function(e,t,a){alert("Export Db Table "+p+" failed. Error = "+a+", status = "+t)},complete:function(e,t,a){jQuery("#"+p+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){wppaConsoleLog("Requesting togo for slug "+n,"force")},success:function(e,t,a){var p=e.split("|");jQuery("#"+n+"_togo").html(p[0]);e=jQuery("#"+n+"_status").html(),p=p[1];""!=e&&""==p&&(p='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(p),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){e=e.split("|");jQuery("#"+p).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var a=0,p=0;function n(e){(e=e||window.event).preventDefault(),a=p-e.clientY,p=e.clientY,t.style.top=t.offsetTop-a+"px"}function o(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,p=e.clientY,document.onmouseup=o,document.onmousemove=n}}function wppaBulkActionChange(e,t){wppa_setCookie("wppa_bulk_action",e.value,365),"wppa-bulk-move-to"==e.value||"wppa-bulk-copy-to"==e.value?jQuery("#wppa-bulk-album").css("display","inline"):jQuery("#wppa-bulk-album").css("display","none"),"wppa-bulk-status"==e.value?jQuery("#wppa-bulk-status").css("display","inline"):jQuery("#wppa-bulk-status").css("display","none"),"wppa-bulk-owner"==e.value?jQuery("#wppa-bulk-owner").css("display","inline"):jQuery("#wppa-bulk-owner").css("display","none")}function wppaBulkDoitOnClick(){var e=jQuery(".wppa-bulk-photo"),t=0;for(i=0;i<e.length;i++)e[i].checked&&t++;if(0==t)return alert("No photos selected"),!1;var a=document.getElementById("wppa-bulk-action").value;switch(a){case"":return alert("No action selected"),!1;case"wppa-bulk-delete":case"wppa-bulk-delete-immediate":break;case"wppa-bulk-move-to":case"wppa-bulk-copy-to":if(0==document.getElementById("wppa-bulk-album").value)return alert("No album selected"),!1;break;case"wppa-bulk-status":if(0==document.getElementById("wppa-bulk-status").value)return alert("No status selected"),!1;break;case"wppa-bulk-owner":if(0==documnet.getElementById("wppa-bulk-owner").value)return alert("No new owner selected"),!1;break;default:return alert("Unimplemented action requested: "+a),!1}return!0}function wppaSetThumbsize(e){e=e.value;wppa_setCookie("wppa_bulk_thumbsize",e,365),jQuery(".wppa-bulk-thumb").css("max-width",e+"px"),jQuery(".wppa-bulk-thumb").css("max-height",e/2+"px"),jQuery(".wppa-bulk-dec").css("height",e/2+"px")}function wppaToggleConfirmDelete(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmDelete","checked",365):wppa_setCookie("wppaConfirmDelete","unchecked",365)}function wppaToggleConfirmMove(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmMove","checked",365):wppa_setCookie("wppaConfirmMove","unchecked",365)}function wppaSetConfirmDelete(e){"checked"==wppa_getCookie("wppaConfirmDelete")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaSetConfirmMove(e){"checked"==wppa_getCookie("wppaConfirmMove")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,a){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}function wppaTestAdminReady(){"complete"===document.readyState?jQuery("#wppa-admin-spinner").fadeOut():setTimeout("wppaTestAdminReady()",200)}function wppaCommentAdminUpdateHref(e){var t=encodeURIComponent(jQuery("#commenttext-"+e).val()),a=jQuery("#href-"+e).attr("href"),p=a.split("commenttext=");p[1]=t,a=p[0]+"commenttext="+p[1],jQuery("#href-"+e).attr("href",a),jQuery("#href-"+e).css("display","inline")}jQuery(document).ready(function(){var e;document.getElementById("wppa-bulk-action")&&(e=wppa_getCookie("wppa_bulk_action"),"wppa-bulk-move-to"!=(document.getElementById("wppa-bulk-action").value=e)&&"wppa-bulk-copy-to"!=e||(jQuery("#wppa-bulk-album").css("display","inline"),document.getElementById("wppa-bulk-album").value=wppa_getCookie("wppa_bulk_album")),"wppa-bulk-status"==e&&(jQuery("#wppa-bulk-status").css("display","inline"),document.getElementById("wppa-bulk-status").value=wppa_getCookie("wppa_bulk_status")),"wppa-bulk-owner"==e&&(jQuery("#wppa-bulk-owner").css("display","inline"),document.getElementById("wppa-bulk-owner").value=wppa_getCookie("wppa_bulk_owner")))}),jQuery(document).ready(function(){setTimeout("wppaTestAdminReady()",200)});
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 8.1.05.001
7
  *
8
  */
9
 
@@ -153,7 +153,12 @@ global $wppa_revno;
153
  $h2 = __( 'Manage Trashed Photos', 'wp-photo-album-plus' );
154
  $task = __( 'Edit photo information', 'wp-photo-album-plus' );
155
  wppa_echo( '<div class="wrap"><h2>' . $h2 . ' - <small><i>' . $task . '</i></small></h2>' );
156
- wppa_album_photos( $ei );
 
 
 
 
 
157
  wppa_echo( '</div>' );
158
 
159
  return;
@@ -2524,11 +2529,16 @@ global $wpdb;
2524
  </a>
2525
  </td>
2526
  <td>
2527
- <a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '&amp;quick' . '\' );">
2528
  <span style="font-weight:bold">' . __( 'Quick', 'wp-photo-album-plus' ) . '</span>
2529
  </a>
2530
  </td>
2531
- <td colspan="4"></td>' .
 
 
 
 
 
2532
  ( current_user_can( 'wppa_upload' ) ? '<td></td>' : '' ) .
2533
  ( current_user_can( 'wppa_import' ) ? '<td></td>' : '' ) .
2534
  ( wppa_can_create_album() ? '<td></td>' : '' ) . '
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.1.07.003
7
  *
8
  */
9
 
153
  $h2 = __( 'Manage Trashed Photos', 'wp-photo-album-plus' );
154
  $task = __( 'Edit photo information', 'wp-photo-album-plus' );
155
  wppa_echo( '<div class="wrap"><h2>' . $h2 . ' - <small><i>' . $task . '</i></small></h2>' );
156
+ if ( wppa_get( 'bulk' ) ) {
157
+ wppa_album_photos_bulk( $ei );
158
+ }
159
+ else {
160
+ wppa_album_photos( $ei );
161
+ }
162
  wppa_echo( '</div>' );
163
 
164
  return;
2529
  </a>
2530
  </td>
2531
  <td>
2532
+ <a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '&amp;quick=1' . '\' );">
2533
  <span style="font-weight:bold">' . __( 'Quick', 'wp-photo-album-plus' ) . '</span>
2534
  </a>
2535
  </td>
2536
+ <td>
2537
+ <a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '&amp;bulk=1' . '\' );">
2538
+ <span style="font-weight:bold">' . __( 'Bulk', 'wp-photo-album-plus' ) . '</span>
2539
+ </a>
2540
+ </td>
2541
+ <td colspan="3"></td>' .
2542
  ( current_user_can( 'wppa_upload' ) ? '<td></td>' : '' ) .
2543
  ( current_user_can( 'wppa_import' ) ? '<td></td>' : '' ) .
2544
  ( wppa_can_create_album() ? '<td></td>' : '' ) . '
wppa-defaults.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
- * Version 8.1.06.006
7
  *
8
  */
9
 
@@ -1005,6 +1005,7 @@ horizrailenabled:false,";
1005
  'wppa_upload_limit_time' => '0', // IX-D6b
1006
  'wppa_grant_an_album' => 'no',
1007
  'wppa_grant_name' => 'display',
 
1008
  'wppa_grant_parent_sel_method' => 'selectionbox',
1009
  'wppa_grant_parent' => '-1',
1010
  'wppa_grant_cats' => '',
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
+ * Version 8.1.07.003
7
  *
8
  */
9
 
1005
  'wppa_upload_limit_time' => '0', // IX-D6b
1006
  'wppa_grant_an_album' => 'no',
1007
  'wppa_grant_name' => 'display',
1008
+ 'wppa_grant_desc' => __( 'Default photo album for $user', 'wp-photo-album-plus' ),
1009
  'wppa_grant_parent_sel_method' => 'selectionbox',
1010
  'wppa_grant_parent' => '-1',
1011
  'wppa_grant_cats' => '',
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 8.1.06.003
7
  *
8
  */
9
 
@@ -2376,6 +2376,9 @@ function wppa_album_photos_bulk( $album ) {
2376
  case 'wppa-bulk-delete':
2377
  wppa_delete_photo( $id );
2378
  break;
 
 
 
2379
  case 'wppa-bulk-move-to':
2380
  if ( $newalb ) {
2381
  $photo = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos WHERE id = %s", $id ), ARRAY_A );
@@ -2469,22 +2472,25 @@ function wppa_album_photos_bulk( $album ) {
2469
  if ( $count && ! $abort ) {
2470
  switch ( wppa_get( 'bulk-action' ) ) {
2471
  case 'wppa-bulk-delete':
2472
- $message = sprintf( __( '%d photos deleted.' , 'wp-photo-album-plus'), $count );
 
 
 
2473
  break;
2474
  case 'wppa-bulk-move-to':
2475
- $message = sprintf( __( '%1$s photos moved to album %2$s.' , 'wp-photo-album-plus'), $count, $newalb.': ' . wppa_get_album_name( $newalb ) );
2476
  break;
2477
  case 'wppa-bulk-copy-to':
2478
- $message = sprintf( __( '%1$s photos copied to album %2$s.' , 'wp-photo-album-plus'), $count, $newalb.': ' . wppa_get_album_name( $newalb ) );
2479
  break;
2480
  case 'wppa-bulk-status':
2481
- $message = sprintf( __( 'Changed status to %1$s on %2$s photos.' , 'wp-photo-album-plus'), $status, $count );
2482
  break;
2483
  case 'wppa-bulk-owner':
2484
- $message = sprintf( __( 'Changed owner to %1$s on %2$s photos.' , 'wp-photo-album-plus'), $owner, $count );
2485
  break;
2486
  default:
2487
- $message = sprintf( __( '%d photos processed.' , 'wp-photo-album-plus'), $count );
2488
  break;
2489
  }
2490
  wppa_ok_message( $message );
@@ -2515,6 +2521,18 @@ function wppa_album_photos_bulk( $album ) {
2515
  $link = wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id='.$album.'&wppa-searchstring='.wppa_get( 'searchstring' ).'&bulk=1'.'&wppa-nonce=' . wp_create_nonce('wppa-nonce') );
2516
  wppa_show_search_statistics();
2517
  }
 
 
 
 
 
 
 
 
 
 
 
 
2518
  else {
2519
  $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos
2520
  WHERE album = %s", $album ) );
@@ -2567,43 +2585,56 @@ function wppaTryMove( id, video ) {
2567
 
2568
  wppa_add_inline_script( 'wppa-admin', $the_js );
2569
 
2570
- ?>
2571
- <form action="<?php wppa_echo( $link.'&wppa-page='.$page.'#manage-photos', 'post' ) ?>" method="post">
2572
- <?php wp_nonce_field( 'wppa-bulk','wppa-bulk' ) ?>
2573
- <h3>
2574
- <span style="font-weight:bold"><?php _e( 'Bulk action:' , 'wp-photo-album-plus') ?></span>
2575
- <select id="wppa-bulk-action" name="wppa-bulk-action" onchange="wppaBulkActionChange( this, 'bulk-album' )">
2576
- <option value=""></option>
2577
- <option value="wppa-bulk-delete"><?php _e( 'Delete' , 'wp-photo-album-plus') ?></option>
2578
- <option value="wppa-bulk-move-to"><?php _e( 'Move to' , 'wp-photo-album-plus') ?></option>
2579
- <option value="wppa-bulk-copy-to"><?php _e( 'Copy to' , 'wp-photo-album-plus') ?></option>
2580
- <?php if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) { ?>
2581
- <option value="wppa-bulk-status"><?php _e( 'Set status to' , 'wp-photo-album-plus') ?></option>
2582
- <?php } ?>
2583
- <?php if ( wppa_user_is( 'administrator' ) && wppa_switch( 'photo_owner_change' ) ) { ?>
2584
- <option value="wppa-bulk-owner"><?php _e( 'Set owner to' , 'wp-photo-album-plus') ?></option>
2585
- <?php } ?>
2586
- </select>
2587
- <?php
2588
- // <select name="wppa-bulk-album" id="wppa-bulk-album" style="display:none" onchange="wppa_setCookie( 'wppa_bulk_album',this.value,365 )">
2589
- wppa_echo( wppa_album_select_a( array( 'checkaccess' => true,
2590
- 'path' => true,
2591
- 'exclude' => $album,
2592
- 'selected' => '0',
2593
- 'addpleaseselect' => true,
2594
- 'sort' => true,
2595
- 'tagopen' => '<select' .
2596
- ' name="wppa-bulk-album"' .
2597
- ' id="wppa-bulk-album"' .
2598
- ' style="display:none"' .
2599
- ' onchange="wppa_setCookie( \'wppa_bulk_album\',this.value,365 )"' .
2600
- ' >',
2601
- 'tagname' => 'wppa-bulk-album',
2602
- 'tagid' => 'wppa-bulk-album',
2603
- 'tagonchange' => 'wppa_setCookie( \'wppa_bulk_album\',this.value,365 );',
2604
- 'tagstyle' => 'display:none;cursor:pointer;',
2605
- ) ) );
2606
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
2607
  <select name="wppa-bulk-status" id="wppa-bulk-status" style="display:none" onchange="wppa_setCookie( 'wppa_bulk_status',this.value,365 )">
2608
  <option value=""><?php _e( '- select a status -' , 'wp-photo-album-plus') ?></option>
2609
  <option value="pending"><?php _e( 'Pending' , 'wp-photo-album-plus') ?></option>
@@ -2743,7 +2774,7 @@ function wppaTryMove( id, video ) {
2743
  <a
2744
  href="' . esc_url( str_replace( '.jpg', '.mp4', wppa_get_photo_url( $id ) ) ) . '"
2745
  target="_blank"
2746
- title="' . esc_attr( __('Click to see fullsize video', 'wp-photo-album-plus') ) . '"
2747
  >' );
2748
  }
2749
 
@@ -2885,18 +2916,21 @@ function wppaTryMove( id, video ) {
2885
  else {
2886
  if ( $page == '1' ) {
2887
  if ( wppa_get( 'searchstring' ) ) {
2888
- wppa_echo( '<h3>'.__( 'No photos matching your search criteria.' , 'wp-photo-album-plus').'</h3>', 'post' );
2889
  }
2890
  elseif ( $album == 'moderate' ) {
2891
- wppa_echo( '<h3>'.__( 'No photos to moderate', 'wp-photo-album-plus' ) . '</h3>', 'post' );
 
 
 
2892
  }
2893
  else {
2894
- wppa_echo( '<h3>'.__( 'No photos yet in this album.' , 'wp-photo-album-plus' ).'</h3>', 'post' );
2895
  }
2896
  }
2897
  else {
2898
  $page_1 = $page - '1';
2899
- wppa_echo( sprintf( __( 'Page %d is empty, try <a href="%s">page %d</a>.' , 'wp-photo-album-plus'), $page, $link.'&wppa-page='.$page_1.'#manage-photos', $page_1 ), 'post' );
2900
  }
2901
  }
2902
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 8.1.07.003
7
  *
8
  */
9
 
2376
  case 'wppa-bulk-delete':
2377
  wppa_delete_photo( $id );
2378
  break;
2379
+ case 'wppa-bulk-delete-immediate':
2380
+ wppa_delete_photo( $id, true );
2381
+ break;
2382
  case 'wppa-bulk-move-to':
2383
  if ( $newalb ) {
2384
  $photo = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos WHERE id = %s", $id ), ARRAY_A );
2472
  if ( $count && ! $abort ) {
2473
  switch ( wppa_get( 'bulk-action' ) ) {
2474
  case 'wppa-bulk-delete':
2475
+ $message = sprintf( __( '%d photos deleted.', 'wp-photo-album-plus' ), $count );
2476
+ break;
2477
+ case 'wppa-bulk-delete-immediate':
2478
+ $message = sprintf( __( '%d photos permanently removed from system.', 'wp-photo-album-plus' ), $count );
2479
  break;
2480
  case 'wppa-bulk-move-to':
2481
+ $message = sprintf( __( '%1$s photos moved to album %2$s.', 'wp-photo-album-plus' ), $count, $newalb.': ' . wppa_get_album_name( $newalb ) );
2482
  break;
2483
  case 'wppa-bulk-copy-to':
2484
+ $message = sprintf( __( '%1$s photos copied to album %2$s.', 'wp-photo-album-plus' ), $count, $newalb.': ' . wppa_get_album_name( $newalb ) );
2485
  break;
2486
  case 'wppa-bulk-status':
2487
+ $message = sprintf( __( 'Changed status to %1$s on %2$s photos.', 'wp-photo-album-plus' ), $status, $count );
2488
  break;
2489
  case 'wppa-bulk-owner':
2490
+ $message = sprintf( __( 'Changed owner to %1$s on %2$s photos.', 'wp-photo-album-plus' ), $owner, $count );
2491
  break;
2492
  default:
2493
+ $message = sprintf( __( '%d photos processed.', 'wp-photo-album-plus' ), $count );
2494
  break;
2495
  }
2496
  wppa_ok_message( $message );
2521
  $link = wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu&tab=edit&edit-id='.$album.'&wppa-searchstring='.wppa_get( 'searchstring' ).'&bulk=1'.'&wppa-nonce=' . wp_create_nonce('wppa-nonce') );
2522
  wppa_show_search_statistics();
2523
  }
2524
+ elseif ( $album == 'trash' ) {
2525
+ $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
2526
+ WHERE album < '0' ORDER BY modified DESC
2527
+ LIMIT %d, %d", $skip, $pagesize ), ARRAY_A );
2528
+ $count = is_array( $photos ) ? count( $photos ) : 0;
2529
+ $link = wppa_dbg_url( get_admin_url() . 'admin.php' .
2530
+ '?page=wppa_admin_menu' .
2531
+ '&tab=edit' .
2532
+ '&edit-id=trash' .
2533
+ '&wppa-nonce=' . wp_create_nonce('wppa-nonce')
2534
+ );
2535
+ }
2536
  else {
2537
  $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos
2538
  WHERE album = %s", $album ) );
2585
 
2586
  wppa_add_inline_script( 'wppa-admin', $the_js );
2587
 
2588
+ $result = '
2589
+ <form action="' . $link . '&wppa-page=' . $page . '#manage-photos" method="post">' .
2590
+ wp_nonce_field( 'wppa-bulk', 'wppa-bulk' ) . '
2591
+ <h3>
2592
+ <span style="font-weight:bold">' . __( 'Bulk action:', 'wp-photo-album-plus' ) . '</span>
2593
+ <select id="wppa-bulk-action" name="wppa-bulk-action" onchange="wppaBulkActionChange( this, \'bulk-album\' )">
2594
+ <option value=""></option>';
2595
+ if ( $album == 'trash' ) {
2596
+ $result .= '
2597
+ <option value="wppa-bulk-delete-immediate">' . __( 'Remove permanently', 'wp-photo-album-plus' ) . '</option>';
2598
+ }
2599
+ else {
2600
+ $result .= '
2601
+ <option value="wppa-bulk-delete">' . __( 'Delete', 'wp-photo-album-plus' ) . '</option>';
2602
+ }
2603
+ $result .= '
2604
+ <option value="wppa-bulk-move-to">' . __( 'Move to', 'wp-photo-album-plus' ) . '</option>
2605
+ <option value="wppa-bulk-copy-to">' . __( 'Copy to', 'wp-photo-album-plus' ) . '</option>';
2606
+
2607
+ if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) {
2608
+ $result .= '
2609
+ <option value="wppa-bulk-status">' . __( 'Set status to', 'wp-photo-album-plus' ) . '</option>';
2610
+ }
2611
+ if ( wppa_user_is( 'administrator' ) && wppa_switch( 'photo_owner_change' ) ) {
2612
+ $result .= '
2613
+ <option value="wppa-bulk-owner">' . __( 'Set owner to', 'wp-photo-album-plus' ) . '</option>';
2614
+ }
2615
+ $result .= '
2616
+ </select>' .
2617
+
2618
+ wppa_album_select_a( array( 'checkaccess' => true,
2619
+ 'path' => true,
2620
+ 'exclude' => $album,
2621
+ 'selected' => '0',
2622
+ 'addpleaseselect' => true,
2623
+ 'sort' => true,
2624
+ 'tagopen' => '<select' .
2625
+ ' name="wppa-bulk-album"' .
2626
+ ' id="wppa-bulk-album"' .
2627
+ ' style="display:none"' .
2628
+ ' onchange="wppa_setCookie( \'wppa_bulk_album\',this.value,365 )"' .
2629
+ ' >',
2630
+ 'tagname' => 'wppa-bulk-album',
2631
+ 'tagid' => 'wppa-bulk-album',
2632
+ 'tagonchange' => 'wppa_setCookie( \'wppa_bulk_album\',this.value,365 );',
2633
+ 'tagstyle' => 'display:none;cursor:pointer;',
2634
+ ) );
2635
+
2636
+ wppa_echo( $result );
2637
+ ?>
2638
  <select name="wppa-bulk-status" id="wppa-bulk-status" style="display:none" onchange="wppa_setCookie( 'wppa_bulk_status',this.value,365 )">
2639
  <option value=""><?php _e( '- select a status -' , 'wp-photo-album-plus') ?></option>
2640
  <option value="pending"><?php _e( 'Pending' , 'wp-photo-album-plus') ?></option>
2774
  <a
2775
  href="' . esc_url( str_replace( '.jpg', '.mp4', wppa_get_photo_url( $id ) ) ) . '"
2776
  target="_blank"
2777
+ title="' . esc_attr( __( 'Click to see fullsize video', 'wp-photo-album-plus' ) ) . '"
2778
  >' );
2779
  }
2780
 
2916
  else {
2917
  if ( $page == '1' ) {
2918
  if ( wppa_get( 'searchstring' ) ) {
2919
+ wppa_echo( '<h3>' . __( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . '</h3>' );
2920
  }
2921
  elseif ( $album == 'moderate' ) {
2922
+ wppa_echo( '<h3>' . __( 'No photos to moderate', 'wp-photo-album-plus' ) . '</h3>' );
2923
+ }
2924
+ elseif ( $album == 'trash' ) {
2925
+ wppa_echo( '<h3>' . __( 'No photos left', 'wp-photo-album-plus' ) . '</h3>' );
2926
  }
2927
  else {
2928
+ wppa_echo( '<h3>' . __( 'No photos yet in this album.', 'wp-photo-album-plus' ) . '</h3>' );
2929
  }
2930
  }
2931
  else {
2932
  $page_1 = $page - '1';
2933
+ wppa_echo( sprintf( __( 'Page %d is empty, try <a href="%s">page %d</a>.', 'wp-photo-album-plus' ), $page, $link . '&wppa-page=' . $page_1 . '#manage-photos', $page_1 ) );
2934
  }
2935
  }
2936
  }
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 8.1.06.006
7
  *
8
  */
9
 
@@ -7007,6 +7007,13 @@ global $wppa_subtab_names;
7007
  $html = wppa_select($slug, $opts, $vals);
7008
  wppa_setting_new($slug, '19', $name, $desc, $html, $help);
7009
 
 
 
 
 
 
 
 
7010
  $name = __('Grant parent selection method', 'wp-photo-album-plus');
7011
  $desc = __('The way the grant parents are defined.', 'wp-photo-album-plus');
7012
  $help = '';
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.1.07.003
7
  *
8
  */
9
 
7007
  $html = wppa_select($slug, $opts, $vals);
7008
  wppa_setting_new($slug, '19', $name, $desc, $html, $help);
7009
 
7010
+ $name = __('Grant alnum description', 'wp-photo-album-plus' );
7011
+ $desc = __('The description to be used for the album.', 'wp-photo-album-plus');
7012
+ $help = __('You can use "$user" as placeholder for the name; it will be replaced by the name of the album', 'wp-photo-album-plus');
7013
+ $slug = 'wppa_grant_desc';
7014
+ $html = wppa_input($slug, '400px;');
7015
+ wppa_setting_new($slug, '19a', $name, $desc, $html, $help);
7016
+
7017
  $name = __('Grant parent selection method', 'wp-photo-album-plus');
7018
  $desc = __('The way the grant parents are defined.', 'wp-photo-album-plus');
7019
  $help = '';
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 8.1.07.002
7
  *
8
  */
9
 
@@ -650,7 +650,8 @@ static $user;
650
 
651
  // Parent independant album data
652
  $name = $user;
653
- $desc = __( 'Default photo album for', 'wp-photo-album-plus' ) . ' ' . $user;
 
654
 
655
  // May be multiple granted parents. Check for all parents.
656
  foreach( $parents as $parent ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 8.1.07.003
7
  *
8
  */
9
 
650
 
651
  // Parent independant album data
652
  $name = $user;
653
+ // $desc = __( 'Default photo album for', 'wp-photo-album-plus' ) . ' ' . $user;
654
+ $desc = str_replace( '$user', $user, wppa_opt( 'grant_desc' ) );
655
 
656
  // May be multiple granted parents. Check for all parents.
657
  foreach( $parents as $parent ) {
wppa-upload.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
- * Version 8.1.05.001
7
  *
8
  */
9
 
@@ -85,9 +85,9 @@ global $upload_album;
85
  }
86
 
87
  // Open the form
88
- echo
89
- '<div class="wrap">' .
90
- '<h2>' . __( 'Upload Photos', 'wp-photo-album-plus' ) . '</h2>';
91
 
92
  // Get some req'd data
93
  $max_files = ini_get( 'max_file_uploads' );
@@ -114,25 +114,27 @@ global $upload_album;
114
  // User can create
115
  if ( current_user_can( 'wppa_admin' ) ) {
116
  $url = wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu' );
117
- echo
118
- '<p>' .
119
- __( 'No albums exist. You must' , 'wp-photo-album-plus') .
120
- ' <a href="' . $url . '" >' .
121
- __( 'create one' , 'wp-photo-album-plus') .
122
- '</a> ' .
123
- __( 'before you can upload your photos.', 'wp-photo-album-plus' ) .
124
- '</p>' . '</div>';
 
125
  return;
126
  }
127
 
128
  // User can not create
129
  else {
130
- echo
131
- '<p>' .
132
- __( 'There are no albums where you are allowed to upload photos to.', 'wp-photo-album-plus' ) .
133
- '<br>' .
134
- __( 'Ask your administrator to create at least one album that is accessible for you to upload to, or ask him to give you album admin rights.', 'wp-photo-album-plus' ) .
135
- '</p>';
 
136
  return;
137
  }
138
  }
@@ -140,7 +142,7 @@ global $upload_album;
140
  // The information box
141
  $multi = wppa_user_is( 'administrator' ) || ! wppa_switch( 'upload_one_only' );
142
  if ( $multi ) {
143
- echo '
144
  <div
145
  style="
146
  border:1px solid #ccc;
@@ -151,18 +153,16 @@ global $upload_album;
151
  border-color:#e6db55;
152
  "
153
  >' .
154
- sprintf( __( '<b>Notice:</b> your server allows you to upload <b>%s</b> files of maximum <b>%s</b> bytes each and total <b>%s</b> bytes and allows <b>%s</b> seconds to complete.' , 'wp-photo-album-plus' ), $max_files_txt, $max_size, $max_tot_size, $max_time ) .
155
- ' ' .
156
- __( 'If your request exceeds these limitations, it will fail, probably without an errormessage.' , 'wp-photo-album-plus' ) .
157
- ' ' .
158
- __( 'Additionally your hosting provider may have set other limitations on uploading files.' , 'wp-photo-album-plus' ) .
159
- '<br>' .
160
- wppa_check_memory_limit() .
161
- '</div>';
162
  }
163
 
164
  // The Upload box
165
- echo '
166
  <div
167
  style="
168
  border:1px solid #ccc;
@@ -209,64 +209,71 @@ global $upload_album;
209
  __( 'Selected File:' , 'wp-photo-album-plus' )
210
  ) . '
211
  </h3>
212
- </div>
213
- <script type="text/javascript" >
214
- function showit() {
215
- var canUpload = true;
216
- var maxsize = parseInt( \'' . $max_tot_size_mbytes . '\' ) * 1024 * 1024;' .
217
- 'var maxcount = parseInt( \'' . $max_files_txt . '\' );' .
218
- 'var totsize = 0;' .
219
- 'var files = document.getElementById( \'my_files\' ).files;' .
220
- 'var tekst = "<h3>' . __( 'Selected Files:' , 'wp-photo-album-plus' ) . '</h3>";' .
221
- 'tekst += "<table><thead><tr>";' .
222
- 'tekst += "<td>' . __( 'Name' , 'wp-photo-album-plus' ) . '</td>";' .
223
- 'tekst += "<td>' . __( 'Size' , 'wp-photo-album-plus' ) . '</td>";' .
224
- 'tekst += "<td>' . __( 'Type' , 'wp-photo-album-plus' ) . '</td>";' .
225
- 'tekst += "</tr></thead>";' .
226
- 'tekst += "<tbody>";' .
227
- 'tekst += "<tr><td><hr /></td><td><hr /></td><td><hr /></td></tr>";' .
228
- 'for ( var i=0;i<files.length;i++ ) {' .
229
- 'tekst += "<tr>";' .
230
- 'tekst += "<td>" + files[i].name + "</td>";' .
231
- 'tekst += "<td id=\'file"+i+"size\' >" + files[i].size + "</td>";' .
232
- 'totsize += files[i].size;' .
233
- 'tekst += "<td>" + ( files[i].size > ' . $max_size_bytes . ' ? "<span style=\'color:red\' >' . __( 'Too big!' , 'wp-photo-album-plus') . '</span>" : files[i].type ) + "</td>";' .
234
- 'tekst += "</tr>";' .
235
- '}' .
236
- 'tekst += "<tr><td><hr /></td><td><hr /></td><td><hr /></td></tr>";' .
237
- 'var style1 = "";' .
238
- 'var style2 = "";' .
239
- 'var style3 = "";' .
240
- 'var warn1 = "";' .
241
- 'var warn2 = "";' .
242
- 'var warn3 = "";' .
243
- 'if ( maxcount > 0 && files.length > maxcount ) {' .
244
- 'style1 = "color:red";' .
245
- 'warn1 = "' . __( 'Too many!' , 'wp-photo-album-plus' ) . '";
246
- }' .
247
- 'if ( maxsize > 0 && totsize > maxsize ) {' .
248
- 'style2 = "color:red";' .
249
- 'warn2 = "' . __( 'Too big!' , 'wp-photo-album-plus') . '";' .
250
- '}' .
251
- 'if ( warn1 || warn2 ) {' .
252
- 'style3 = "color:green";' .
253
- 'warn3 = "' . __( 'Try again!' , 'wp-photo-album-plus' ) . '";
 
 
254
  canUpload = false;
255
- }' .
256
- 'tekst += "<tr><td style="+style1+" >' . __( 'Total' , 'wp-photo-album-plus' ) . ': "+files.length+" "+warn1+"</td><td style="+style2+" >"+totsize+" "+warn2+"</td><td style="+style3+" >"+warn3+"</td></tr>";' .
257
- 'tekst += "</tbody>";' .
258
- 'tekst += "</table>";' .
259
- 'jQuery( "#files_list2" ).html( tekst );
260
- if ( canUpload ) {
261
- jQuery( "#wppa-upload-submit" ).prop( "disabled", false );
262
- }
263
- else {
264
- jQuery( "#wppa-upload-submit" ).prop( "disabled", true );
265
- }
266
- }' .
267
- '</script>' .
268
- '<p>' .
269
- '<label for="wppa-album">' . __( 'Album:' , 'wp-photo-album-plus' ) . '</label>' .
 
 
 
 
 
270
  wppa_album_select_a( array( 'path' => true,
271
  'addpleaseselect' => true,
272
  'checkowner' => true,
@@ -277,26 +284,26 @@ global $upload_album;
277
  'tagid' => 'wppa-album-s',
278
  'tagname' => 'wppa-album',
279
  'tagstyle' => 'max-width:100%;',
280
- ) ) .
281
- '</p>';
282
 
283
  // Watermark?
284
  if ( wppa_switch( 'watermark_on' ) && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) ) {
285
- echo
286
- '<p>' .
287
- __( 'Apply watermark file:' , 'wp-photo-album-plus' ) .
288
- '<select name="wppa-watermark-file" id="wppa-watermark-file" >' .
289
- wppa_watermark_file_select( 'user' ) .
290
- '</select>' .
291
- __( 'Position:' , 'wp-photo-album-plus' ) .
292
- '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' .
293
- wppa_watermark_pos_select( 'user' ) .
294
- '</select>' .
295
- '</p>';
296
  }
297
 
298
  // Submit section
299
- echo '
300
  <input
301
  id="wppa-upload-submit"
302
  type="submit"
@@ -305,31 +312,31 @@ global $upload_album;
305
  disabled="disabled"
306
  value="' . __( 'Upload now', 'wp-photo-album-plus' ) . '"
307
  onclick="if ( document.getElementById( \'wppa-album-s\' ).value == 0 ) { alert( \'' . __( 'Please select an album' , 'wp-photo-album-plus' ) . '\' ); return false; }"
308
- />' .
309
- ' ';
310
  if ( current_user_can( 'wppa_admin' ) || wppa_opt( 'upload_edit' ) != 'none' ) {
311
- echo
312
- '<input' .
313
- ' type="checkbox"' .
314
- ' id="wppa-go-edit-multiple"' .
315
- ' name="wppa-go-edit-multiple"' .
316
- ' onchange="wppaCookieCheckbox( this, \'wppa-go-edit-multiple\' )"' .
317
- ' />' .
318
- '<script type="text/javascript" >' .
319
- 'if ( wppa_getCookie( \'wppa-go-edit-multiple\' ) == \'on\' ) document.getElementById( \'wppa-go-edit-multiple\' ).checked = \'checked\';' .
320
- '</script>';
321
  }
322
 
323
  if ( current_user_can( 'wppa_admin' ) ) {
324
- _e( 'After upload: Go to the <b>Edit Album</b> page.', 'wp-photo-album-plus');
325
  }
326
  elseif ( wppa_opt( 'upload_edit' ) != 'none' ) {
327
- _e( 'After upload: Go to the <b>Edit Photos</b> page.', 'wp-photo-album-plus');
328
  }
329
- echo '
330
  </form>
331
  </div>
332
  </div>';
 
 
333
  }
334
 
335
  // Upload multiple photos
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
+ * Version 8.1.07.003
7
  *
8
  */
9
 
85
  }
86
 
87
  // Open the form
88
+ $result = '
89
+ <div class="wrap">
90
+ <h2>' . __( 'Upload Photos', 'wp-photo-album-plus' ) . '</h2>';
91
 
92
  // Get some req'd data
93
  $max_files = ini_get( 'max_file_uploads' );
114
  // User can create
115
  if ( current_user_can( 'wppa_admin' ) ) {
116
  $url = wppa_dbg_url( get_admin_url().'admin.php?page=wppa_admin_menu' );
117
+ $result .= '
118
+ <p>' .
119
+ __( 'No albums exist. You must', 'wp-photo-album-plus' ) . '
120
+ &nbsp;<a href="' . $url . '" >' .
121
+ __( 'create one', 'wp-photo-album-plus' ) . '
122
+ </a> ' .
123
+ __( 'before you can upload your photos.', 'wp-photo-album-plus' ) . '
124
+ </p></div>';
125
+ wppa_echo( $result );
126
  return;
127
  }
128
 
129
  // User can not create
130
  else {
131
+ $result .= '
132
+ <p>' .
133
+ __( 'There are no albums where you are allowed to upload photos to.', 'wp-photo-album-plus' ) . '
134
+ <br>' .
135
+ __( 'Ask your administrator to create at least one album that is accessible for you to upload to, or ask him to give you album admin rights.', 'wp-photo-album-plus' ) . '
136
+ </p>';
137
+ wppa_echo( $result );
138
  return;
139
  }
140
  }
142
  // The information box
143
  $multi = wppa_user_is( 'administrator' ) || ! wppa_switch( 'upload_one_only' );
144
  if ( $multi ) {
145
+ $result .= '
146
  <div
147
  style="
148
  border:1px solid #ccc;
153
  border-color:#e6db55;
154
  "
155
  >' .
156
+ sprintf( __( '<b>Notice:</b> your server allows you to upload <b>%s</b> files of maximum <b>%s</b> bytes each and total <b>%s</b> bytes and allows <b>%s</b> seconds to complete.', 'wp-photo-album-plus' ), $max_files_txt, $max_size, $max_tot_size, $max_time ) . ' ' .
157
+ __( 'If your request exceeds these limitations, it will fail, probably without an errormessage.', 'wp-photo-album-plus' ) . ' ' .
158
+ __( 'Additionally your hosting provider may have set other limitations on uploading files.' , 'wp-photo-album-plus' ) . '
159
+ <br>' .
160
+ wppa_check_memory_limit() . '
161
+ </div>';
 
 
162
  }
163
 
164
  // The Upload box
165
+ $result .= '
166
  <div
167
  style="
168
  border:1px solid #ccc;
209
  __( 'Selected File:' , 'wp-photo-album-plus' )
210
  ) . '
211
  </h3>
212
+ </div>';
213
+
214
+ $the_js = '
215
+ function showit() {
216
+ var canUpload = true;
217
+ var maxsize = parseInt( \'' . $max_tot_size_mbytes . '\' ) * 1024 * 1024;
218
+ var maxcount = parseInt( \'' . $max_files_txt . '\' );
219
+ var totsize = 0;
220
+ var files = document.getElementById( \'my_files\' ).files;
221
+ var tekst =
222
+ "<h3>' . __( 'Selected Files:', 'wp-photo-album-plus' ) . '</h3>" +
223
+ "<table><thead><tr>" +
224
+ "<td>' . __( 'Name' , 'wp-photo-album-plus' ) . '</td>" +
225
+ "<td>' . __( 'Size' , 'wp-photo-album-plus' ) . '</td>" +
226
+ "<td>' . __( 'Type' , 'wp-photo-album-plus' ) . '</td>" +
227
+ "</tr></thead>" +
228
+ "<tbody>" +
229
+ "<tr><td><hr /></td><td><hr /></td><td><hr /></td></tr>";
230
+ for ( var i=0;i<files.length;i++ ) {
231
+ tekst += "<tr>" +
232
+ "<td>" + files[i].name + "</td>" +
233
+ "<td id=\'file"+i+"size\' >" + files[i].size + "</td>";
234
+ totsize += files[i].size;
235
+ tekst += "<td>" + ( files[i].size > ' . $max_size_bytes . ' ? "<span style=\'color:red\' >' . __( 'Too big!' , 'wp-photo-album-plus') . '</span>" : files[i].type ) + "</td>" +
236
+ "</tr>";
237
+ }
238
+ tekst += "<tr><td><hr /></td><td><hr /></td><td><hr /></td></tr>";
239
+ var style1 = "";
240
+ var style2 = "";
241
+ var style3 = "";
242
+ var warn1 = "";
243
+ var warn2 = "";
244
+ var warn3 = "";
245
+ if ( maxcount > 0 && files.length > maxcount ) {
246
+ style1 = "color:red";
247
+ warn1 = "' . __( 'Too many!', 'wp-photo-album-plus' ) . '";
248
+ }
249
+ if ( maxsize > 0 && totsize > maxsize ) {
250
+ style2 = "color:red";
251
+ warn2 = "' . __( 'Too big!', 'wp-photo-album-plus' ) . '";
252
+ }
253
+ if ( warn1 || warn2 ) {
254
+ style3 = "color:green";
255
+ warn3 = "' . __( 'Try again!', 'wp-photo-album-plus' ) . '";
256
  canUpload = false;
257
+ }
258
+ tekst += "<tr><td style="+style1+" >' . __( 'Total' , 'wp-photo-album-plus' ) . ': "+files.length+" "+warn1+"</td><td style="+style2+" >"+totsize+" "+warn2+"</td><td style="+style3+" >"+warn3+"</td></tr>";
259
+ tekst +=
260
+ "</tbody>";
261
+ tekst +=
262
+ "</table>";
263
+ jQuery( "#files_list2" ).html( tekst );
264
+ if ( canUpload ) {
265
+ jQuery( "#wppa-upload-submit" ).prop( "disabled", false );
266
+ }
267
+ else {
268
+ jQuery( "#wppa-upload-submit" ).prop( "disabled", true );
269
+ }
270
+ }';
271
+
272
+ wppa_add_inline_script( 'wppa-admin', $the_js );
273
+
274
+ $result .= '
275
+ <p>
276
+ <label for="wppa-album">' . __( 'Album:' , 'wp-photo-album-plus' ) . '</label>' .
277
  wppa_album_select_a( array( 'path' => true,
278
  'addpleaseselect' => true,
279
  'checkowner' => true,
284
  'tagid' => 'wppa-album-s',
285
  'tagname' => 'wppa-album',
286
  'tagstyle' => 'max-width:100%;',
287
+ ) ) . '
288
+ </p>';
289
 
290
  // Watermark?
291
  if ( wppa_switch( 'watermark_on' ) && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) ) {
292
+ $result .= '
293
+ <p>' .
294
+ __( 'Apply watermark file:', 'wp-photo-album-plus' ) . '
295
+ <select name="wppa-watermark-file" id="wppa-watermark-file" >' .
296
+ wppa_watermark_file_select( 'user' ) . '
297
+ </select>' .
298
+ __( 'Position:', 'wp-photo-album-plus' ) . '
299
+ <select name="wppa-watermark-pos" id="wppa-watermark-pos" >' .
300
+ wppa_watermark_pos_select( 'user' ) . '
301
+ </select>
302
+ </p>';
303
  }
304
 
305
  // Submit section
306
+ $result .= '
307
  <input
308
  id="wppa-upload-submit"
309
  type="submit"
312
  disabled="disabled"
313
  value="' . __( 'Upload now', 'wp-photo-album-plus' ) . '"
314
  onclick="if ( document.getElementById( \'wppa-album-s\' ).value == 0 ) { alert( \'' . __( 'Please select an album' , 'wp-photo-album-plus' ) . '\' ); return false; }"
315
+ /> ';
316
+
317
  if ( current_user_can( 'wppa_admin' ) || wppa_opt( 'upload_edit' ) != 'none' ) {
318
+ $result .= '
319
+ <input
320
+ type="checkbox"
321
+ id="wppa-go-edit-multiple"
322
+ name="wppa-go-edit-multiple"
323
+ onchange="wppaCookieCheckbox( this, \'wppa-go-edit-multiple\' )"' .
324
+ ( wppa_get_cookie( 'wppa-go-edit-multiple' ) == 'on' ? ' checked' : '' ) . '
325
+ />';
 
 
326
  }
327
 
328
  if ( current_user_can( 'wppa_admin' ) ) {
329
+ $result .= __( 'After upload: Go to the <b>Edit Album</b> page.', 'wp-photo-album-plus' );
330
  }
331
  elseif ( wppa_opt( 'upload_edit' ) != 'none' ) {
332
+ $result .= __( 'After upload: Go to the <b>Edit Photos</b> page.', 'wp-photo-album-plus' );
333
  }
334
+ $result .= '
335
  </form>
336
  </div>
337
  </div>';
338
+
339
+ wppa_echo( $result );
340
  }
341
 
342
  // Upload multiple photos
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 8.1.05.001
7
  *
8
  */
9
 
@@ -1208,7 +1208,7 @@ global $wpdb;
1208
  }
1209
 
1210
  // Delete a photo and all its attrs by id
1211
- function wppa_delete_photo( $photo ) {
1212
  global $wppa_supported_audio_extensions;
1213
  global $wppa_supported_video_extensions;
1214
  global $wpdb;
@@ -1241,7 +1241,7 @@ global $wpdb;
1241
  $album = $photoinfo['album'];
1242
 
1243
  // Really delete only as cron job
1244
- if ( ! wppa_is_cron() ) {
1245
  if ( $album > '0' ) {
1246
  $newalb = - ( $album + '9' );
1247
  wppa_update_photo( array( 'id' => $photo, 'album' => $newalb, 'modified' => time() ) );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 8.1.07.003
7
  *
8
  */
9
 
1208
  }
1209
 
1210
  // Delete a photo and all its attrs by id
1211
+ function wppa_delete_photo( $photo, $immediate = false ) {
1212
  global $wppa_supported_audio_extensions;
1213
  global $wppa_supported_video_extensions;
1214
  global $wpdb;
1241
  $album = $photoinfo['album'];
1242
 
1243
  // Really delete only as cron job
1244
+ if ( ! wppa_is_cron() && ! $immediate ) {
1245
  if ( $album > '0' ) {
1246
  $newalb = - ( $album + '9' );
1247
  wppa_update_photo( array( 'id' => $photo, 'album' => $newalb, 'modified' => time() ) );
wppa-wrappers.php CHANGED
@@ -5,7 +5,7 @@
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
- * Version 8.1.05.001
9
  *
10
  */
11
 
@@ -761,6 +761,7 @@ static $allowed_tags;
761
  'name' => true,
762
  'action' => true,
763
  'method' => true,
 
764
  ),
765
  'h1' => array(),
766
  'h2' => array(),
@@ -795,6 +796,7 @@ static $allowed_tags;
795
  'name' => true,
796
  'checked' => true,
797
  'min' => true,
 
798
  ),
799
  'option' => array(
800
  'class' => true,
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 8.1.07.003
9
  *
10
  */
11
 
761
  'name' => true,
762
  'action' => true,
763
  'method' => true,
764
+ 'enctype' => true,
765
  ),
766
  'h1' => array(),
767
  'h2' => array(),
796
  'name' => true,
797
  'checked' => true,
798
  'min' => true,
799
+ 'multiple' => true,
800
  ),
801
  'option' => array(
802
  'class' => true,
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 8.1.07.002
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.1.07.002'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 8.1.07.003
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.1.07.003'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30