WP Photo Album Plus - Version 8.2.02.010

Version Description

= 8.1.08 =

  • 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.2.02.010
Comparing to
See all releases

Code changes from version 8.2.03.003 to 8.2.02.010

js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 8.2.03.002
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -883,11 +883,6 @@ function _wppaAjaxUpdateAlbum( album, actionslug, value, isTmce, refresh ) {
883
  // Done?
884
  if ( wppaAjaxAlbumCount == 0 ) {
885
  jQuery( '#albumstatus-' + album ).html( ArrValues[2] );
886
- if ( wppaGetCoverPreview ) {
887
- wppaConsoleLog('doing cover', 'force');
888
- wppaGetCoverPreview( album, 'cover-preview-'+album );
889
-
890
- }
891
  }
892
  // Not done yet
893
  else {
@@ -923,11 +918,9 @@ function _wppaAjaxUpdateAlbum( album, actionslug, value, isTmce, refresh ) {
923
  if ( actionslug == 'cover_linktype' ) {
924
  if ( value == 'manual' ) {
925
  jQuery( '#link-url-tr' ).show();
926
- jQuery( '#-link-url-tr' ).hide();
927
  }
928
  else {
929
  jQuery( '#link-url-tr' ).hide();
930
- jQuery( '#-link-url-tr' ).show();
931
  }
932
  }
933
 
@@ -957,7 +950,6 @@ function _wppaAjaxUpdateAlbum( album, actionslug, value, isTmce, refresh ) {
957
  // Update monitor
958
  wppaAjaxUpdateAlbumMonitor( isTmce ); // Check for more to do
959
 
960
-
961
  },
962
  error: function( xhr, status, error ) {
963
 
@@ -1147,9 +1139,7 @@ function wppaMaintenanceProc(slug, intern, asCronJob ) {
1147
 
1148
  // Check for recoverable error
1149
  if ( resparr[0].length > 10 ) {
1150
- var errtxt = resparr[0];
1151
- errtxt = errtxt.replace(/>/g,'>');
1152
- alert('An error occurred:\n'+errtxt);
1153
  error = true;
1154
  }
1155
 
@@ -1395,10 +1385,11 @@ function wppaAjaxUpdateOptionValue(slug, elem, multisel) {
1395
 
1396
  function wppaEncode(xtext) {
1397
 
1398
- if ( typeof(xtext) != 'string' ) return xtext;
1399
-
1400
  var text, result;
1401
 
 
 
 
1402
  text = xtext;
1403
  result = text.replace(/#/g, '||HASH||');
1404
  text = result;
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 8.2.02.008
5
  /* Various js routines used in admin pages
6
  */
7
 
883
  // Done?
884
  if ( wppaAjaxAlbumCount == 0 ) {
885
  jQuery( '#albumstatus-' + album ).html( ArrValues[2] );
 
 
 
 
 
886
  }
887
  // Not done yet
888
  else {
918
  if ( actionslug == 'cover_linktype' ) {
919
  if ( value == 'manual' ) {
920
  jQuery( '#link-url-tr' ).show();
 
921
  }
922
  else {
923
  jQuery( '#link-url-tr' ).hide();
 
924
  }
925
  }
926
 
950
  // Update monitor
951
  wppaAjaxUpdateAlbumMonitor( isTmce ); // Check for more to do
952
 
 
953
  },
954
  error: function( xhr, status, error ) {
955
 
1139
 
1140
  // Check for recoverable error
1141
  if ( resparr[0].length > 10 ) {
1142
+ alert('An error occurred:\n'+resparr[0]);
 
 
1143
  error = true;
1144
  }
1145
 
1385
 
1386
  function wppaEncode(xtext) {
1387
 
 
 
1388
  var text, result;
1389
 
1390
+ if (typeof(xtext)=='undefined') return;
1391
+ if (typeof(xtext)=='number') return xtext;
1392
+
1393
  text = xtext;
1394
  result = text.replace(/#/g, '||HASH||');
1395
  text = result;
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 i=new XMLHttpRequest,a="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;i.open("POST",wppaAjaxUrl+a,!0),i.onload=function(){if(200===i.status){var e=wppaTrim(i.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!")},i.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,p){wppaConsoleLog("imm="+p,"force");var n="",o="",n=e||'<div style="padding-left:5px;" >';a?o=a:aftrer="</div>",wppaFeAjaxLog("in");var r=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;a+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p&&(a+="&wppa-immediate=1"),r.open("GET",a,!0),r.send(),r.onreadystatechange=function(){switch(r.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==r.status?("ER"==(e=wppaTrim(r.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=n+e[2]+o,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=n+'<span style="color:red;" >Comm error '+r.status+": "+r.statusText+"</span>"+o}}}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(i,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+i+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+i).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-"+i).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-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).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(i,l,e,s,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+i+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"visible"}),jQuery("#remark-"+i).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-"+i).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-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+n+"-"+i).html(r)}}"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).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,i=-1;r<o;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=!0,i=r),r++;u||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,p],i=o),a=a.value||a,wppaAlbumUpdateMatrix[i][3]=a,wppaAlbumUpdateMatrix[i][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,i,l,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(i),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]),wppaGetCoverPreview&&(wppaConsoleLog("doing cover","force"),wppaGetCoverPreview(r,"cover-preview-"+r))):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);"cover_linktype"==u&&("manual"==i?(jQuery("#link-url-tr").show(),jQuery("#-link-url-tr").hide()):(jQuery("#link-url-tr").hide(),jQuery("#-link-url-tr").show())),"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]=i||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(l)},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,u){if(!u&&!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")));u||(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()+(u?"&wppa-cron=1":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p,n=e.split("||"),o=n[1],r=!1;return o?(10<n[0].length&&(p=(p=n[0]).replace(/&gt;/g,">"),alert("An error occurred:\n"+p),r=!0),jQuery("#"+o+"_status").html(n[2]),jQuery("#"+o+"_togo").html(n[3]),jQuery("#"+o+"_button").css("display",""),r||"0"==n[3]?"reload"==n[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+o+"', false)",20):void(document.getElementById(o+"_continue")&&"yes"==document.getElementById(o+"_continue").value?setTimeout("wppaMaintenanceProc('"+o+"', true)",20):(u||jQuery("#"+o+"_status").html("Pending"),setTimeout(function(){wppaAjaxUpdateTogo(o)},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(i,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(i)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+i,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+i.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_"+i.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+i.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_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+i.replace("#","H")).attr("title","Communication error")},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=i&&"icon_corner_style"!=i||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=i&&"svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=i&&"ovl_svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if("string"!=typeof e)return e;var e=e,t=e.replace(/#/g,"||HASH||"),a=(e=t=(e=t).replace(/&/g,"||AMP||")).split("+"),p=0;for(t="";p<a.length;)t+=a[p],++p<a.length&&(t+="||PLUS||");return t}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,i=0;i<e.length;)0!=(a=e[i].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),i++;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":case"wppa-bulk-undelete":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")}function wppaGetTinyMceContent(e){return"none"!=jQuery("#"+e).css("display")?jQuery("#"+e).val():tinymce.get(e).getContent()}function wppaInitMagick(t){var e,a,p;wppaCropper[t]||(e=document.querySelector("#fs-img-"+t),a=document.getElementById("button-"+t),p="ratio"==wppaImageMagickDefaultAspect?e.naturalWidth/e.naturalHeight:"NaN"==wppaImageMagickDefaultAspect?"":wppaImageMagickDefaultAspect,wppaCropper[t]=new Cropper(e,{zoomable:!1,viewMode:2,background:!1,dragMode:"move",responsive:!0,movable:!1,aspectRatio:p}),a.onclick=function(){var e=wppaCropper[t].getData(!0),e=e.width+"x"+e.height+(e.x<0?"-":"+")+e.x+(e.y<0?"-":"+")+e.y;wppaTryMagick(t,"crop",e)})}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 i=new XMLHttpRequest,a="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;i.open("POST",wppaAjaxUrl+a,!0),i.onload=function(){if(200===i.status){var e=wppaTrim(i.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!")},i.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,p){wppaConsoleLog("imm="+p,"force");var n="",o="",n=e||'<div style="padding-left:5px;" >';a?o=a:aftrer="</div>",wppaFeAjaxLog("in");var r=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;a+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p&&(a+="&wppa-immediate=1"),r.open("GET",a,!0),r.send(),r.onreadystatechange=function(){switch(r.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==r.status?("ER"==(e=wppaTrim(r.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=n+e[2]+o,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=n+'<span style="color:red;" >Comm error '+r.status+": "+r.statusText+"</span>"+o}}}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(i,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+i+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+i).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-"+i).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-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).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(i,l,e,s,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+i+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"visible"}),jQuery("#remark-"+i).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-"+i).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-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+n+"-"+i).html(r)}}"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).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,i=-1;r<o;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=!0,i=r),r++;u||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,p],i=o),a=a.value||a,wppaAlbumUpdateMatrix[i][3]=a,wppaAlbumUpdateMatrix[i][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,i,l,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(i),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);"cover_linktype"==u&&("manual"==i?jQuery("#link-url-tr").show():jQuery("#link-url-tr").hide()),"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]=i||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(l)},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(i,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(i)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+i,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+i.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_"+i.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+i.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_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+i.replace("#","H")).attr("title","Communication error")},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=i&&"icon_corner_style"!=i||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=i&&"svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=i&&"ovl_svg_bg_color"!=i||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,i=0;i<e.length;)0!=(a=e[i].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),i++;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":case"wppa-bulk-undelete":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")}function wppaGetTinyMceContent(e){return"none"!=jQuery("#"+e).css("display")?jQuery("#"+e).val():tinymce.get(e).getContent()}function wppaInitMagick(t){var e,a,p;wppaCropper[t]||(e=document.querySelector("#fs-img-"+t),a=document.getElementById("button-"+t),p="ratio"==wppaImageMagickDefaultAspect?e.naturalWidth/e.naturalHeight:"NaN"==wppaImageMagickDefaultAspect?"":wppaImageMagickDefaultAspect,wppaCropper[t]=new Cropper(e,{zoomable:!1,viewMode:2,background:!1,dragMode:"move",responsive:!0,movable:!1,aspectRatio:p}),a.onclick=function(){var e=wppaCropper[t].getData(!0),e=e.width+"x"+e.height+(e.x<0?"-":"+")+e.x+(e.y<0?"-":"+")+e.y;wppaTryMagick(t,"crop",e)})}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)});
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, f
5
  Requires at least: 3.9
6
  Tested up to: 6.0
7
  Requires PHP: 5.5
8
- Stable tag: 8.2.02.010
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
5
  Requires at least: 3.9
6
  Tested up to: 6.0
7
  Requires PHP: 5.5
8
+ Stable tag: 8.2.01.008
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
wppa-admin-styles.css CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
- * version 8.2.03.002
5
  */
6
  #files_list, #files_list2
7
  {
@@ -659,7 +659,3 @@ details.hidden {
659
  #wppa-action-container-right select:first-of-type {
660
  margin-left: 0;
661
  }
662
-
663
- .wppa-tabcontent {
664
- min-height: 530px;
665
- }
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
+ * version 8.2.02.010
5
  */
6
  #files_list, #files_list2
7
  {
659
  #wppa-action-container-right select:first-of-type {
660
  margin-left: 0;
661
  }
 
 
 
 
wppa-admin.php CHANGED
@@ -266,10 +266,10 @@ function wppa_edit_sequence() {
266
  // General purpose admin functions
267
  require_once 'wppa-admin-functions.php';
268
 
269
- if ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] != 'wppa_options' && $_REQUEST['page'] != 'wppa_admin_menu' ) {
270
  require_once 'wppa-tinymce-shortcodes.php';
271
  require_once 'wppa-tinymce-photo.php';
272
- }
273
 
274
  if ( strpos( $_SERVER['REQUEST_URI'], 'widgets' ) === false ) {
275
  require_once 'wppa-gutenberg-photo.php';
266
  // General purpose admin functions
267
  require_once 'wppa-admin-functions.php';
268
 
269
+ // if ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] != 'wppa_options' && $_REQUEST['page'] != 'wppa_admin_menu' ) {
270
  require_once 'wppa-tinymce-shortcodes.php';
271
  require_once 'wppa-tinymce-photo.php';
272
+ // }
273
 
274
  if ( strpos( $_SERVER['REQUEST_URI'], 'widgets' ) === false ) {
275
  require_once 'wppa-gutenberg-photo.php';
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 8.2.03.003
6
  *
7
  */
8
 
@@ -3717,8 +3717,7 @@ global $wppa;
3717
  if ( $ca ) update_option ( 'wppa_crypt_albums_status', 'Required' );
3718
  if ( $cp ) update_option ( 'wppa_crypt_photos_status', 'Required' );
3719
  wppa( 'error', '4711' );
3720
- $alert .= sprintf( __( 'You have to renew Album and Photo crypt codes first before you can switch to encrypted urls. See %s.', 'wp-photo-album-plus' ), wppa_setting_path( 'a', 'maintenance', '1', ['18','19'] ) );
3721
- // Maintenance I, items 18 and 20
3722
  }
3723
  if ( wppa_switch( 'use_photo_names_in_urls' ) ) {
3724
  $alert .= ' ' . __( 'Photo names in urls will be switched off.', 'wp-photo-album-plus' );
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 8.2.02.010
6
  *
7
  */
8
 
3717
  if ( $ca ) update_option ( 'wppa_crypt_albums_status', 'Required' );
3718
  if ( $cp ) update_option ( 'wppa_crypt_photos_status', 'Required' );
3719
  wppa( 'error', '4711' );
3720
+ $alert .= __( 'You renew Album and Photo crypt codes first before you can switch to encrypted urls. See Maintenance I, items 18 and 20.', 'wp-photo-album-plus' );
 
3721
  }
3722
  if ( wppa_switch( 'use_photo_names_in_urls' ) ) {
3723
  $alert .= ' ' . __( 'Photo names in urls will be switched off.', 'wp-photo-album-plus' );
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 8.2.03.002
7
  *
8
  */
9
 
@@ -495,38 +495,7 @@ global $wppa_revno;
495
  else {
496
  alert("' . __( 'Please select a valid panorama mode', 'wp-photo-album-plus' ) . '");
497
  }
498
- }
499
-
500
- function wppaGetCoverPreview( albumId, divId ) {
501
-
502
- jQuery.ajax( {
503
-
504
- url: wppaAjaxUrl,
505
- data: "action=wppa" +
506
- "&wppa-action=getshortcodedrendered" +
507
- "&shortcode=[wppa type=\"cover\" album=\""+albumId+"\"]",
508
- async: true,
509
- type: "GET",
510
- timeout: 10000,
511
- beforeSend: function( xhr ) {
512
- },
513
- success: function( result, status, xhr ) {
514
- result = result.replace(/\[script/g, "<script");
515
- result = result.replace(/\[\/script/g, "</script");
516
- result = result.replace(/&gt;/g, ">");
517
- jQuery( "#" + divId ).html( result );
518
- },
519
- error: function( xhr, status, error ) {
520
- wppaConsoleLog( "wppaGetCoverPreview failed. Error = " + error + ", status = " + status, "force" );
521
- },
522
- complete: function( xhr, status, newurl ) {
523
-
524
- }
525
- } );
526
- }
527
-
528
- jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"+'.$id.' )});
529
- ';
530
 
531
  wppa_add_inline_script( 'wppa-admin', $the_js );
532
  }
@@ -610,7 +579,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
610
  </div>'); // end action-container
611
  /* End header */
612
 
613
- /* Main body album admin */
614
  wppa_echo( '
615
  <details class="wppa-toplevel-details">
616
  <summary class="toplevel wppa-summary-toplevel"> ' .
@@ -625,26 +594,13 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
625
  <br>' . __( 'The <b style="color:#070" >Remark</b> fields keep you informed on the actions taken at the background.', 'wp-photo-album-plus' ) . '
626
  </h2>' );
627
 
628
- // Status - Remark - field
629
- wppa_echo( '
630
- <h3 style="margin-left:1em">' .
631
- esc_html__( 'Remark', 'wp-photo-album-plus' ) . ':&nbsp;
632
- <span
633
- id="albumstatus-' . $id . '"
634
- style="font-weight:bold;color:#00AA00">' .
635
- esc_html( $remark ) . '
636
- </span>
637
- </h3>' );
638
-
639
  // The tabs
640
  wppa_echo('
641
  <div id="tabs" style="margin-bottom:23px">
642
  <ul class="widefat wppa-setting-tabs">
643
- <li class="wppa-albumadmin-tab active" onclick="wppaChangeAlbumAdminTab(this,\'#albumitem-' . $id . '\');">' . __( 'Album', 'wp-photo-album-plus' ) . '</li>
644
- <li class="wppa-albumadmin-tab" onclick="wppaChangeAlbumAdminTab(this,\'#subalbumitem-' . $id . '\');">' . __( 'Related', 'wp-photo-album-plus' ) . '</li>
645
- <li class="wppa-albumadmin-tab" onclick="wppaChangeAlbumAdminTab(this,\'#albumactions-' . $id . '\');">' . __( 'Content', 'wp-photo-album-plus' ) . '</li>
646
- <li class="wppa-albumadmin-tab" onclick="wppaChangeAlbumAdminTab(this,\'#albumcovers-' . $id . '\');">' . __( 'Cover', 'wp-photo-album-plus' ) . '</li>
647
- <li class="wppa-albumadmin-tab" onclick="wppaChangeAlbumAdminTab(this,\'#itemdisplay-' . $id . '\');">' . __( 'Display', 'wp-photo-album-plus' ) . '</li>
648
  </ul>
649
  <div style="clear:both"></div>
650
  </div>');
@@ -664,7 +620,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
664
  <div
665
  id="albumitem-' . $id . '"
666
  class="wppa-table-wrap wppa-tabcontent"
667
- style="position:relative;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
668
  >' );
669
 
670
  // Section 0: More or less static data
@@ -996,6 +952,52 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
996
  wppa_echo( $result );
997
  }
998
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
999
  // Alternative thumbnail size
1000
  if ( ! wppa_switch( 'alt_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1001
  $title = sprintf( __( 'The alternate thumbnail size is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'thumbs', 1, 2 ), wppa_opt( 'thumbsize_alt' ) );
@@ -1023,6 +1025,60 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1023
  </div>' );
1024
  }
1025
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1026
  // Upload limit
1027
  {
1028
  $result = '
@@ -1102,6 +1158,144 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1102
  </div>' );
1103
  }
1104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1105
  // Watermark
1106
  if ( wppa_switch( 'watermark_on' ) ) {
1107
 
@@ -1134,11 +1328,52 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1134
  </div>' );
1135
  }
1136
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1137
  wppa_echo( '</div>' );
1138
  }
1139
  // End Section 1: Short settable items, wppa-flex div
1140
 
1141
- // Section 2: name, description, custom
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1142
  {
1143
  wppa_echo( '
1144
  <!-- Album Section 2 -->
@@ -1271,6 +1506,31 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1271
  wppa_echo( $result );
1272
  }
1273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1274
  // Custom
1275
  if ( wppa_switch( 'album_custom_fields' ) ) {
1276
  $result = '';
@@ -1311,6 +1571,158 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1311
  wppa_echo( $result );
1312
  }
1313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1314
  // End Section 2
1315
  wppa_echo( '
1316
  </tbody>
@@ -1322,11 +1734,11 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1322
  </div>' ); // Tab 1
1323
 
1324
 
1325
- // Tab 2: Related albums
1326
  wppa_echo( '
1327
  <div id="subalbumitem-' . $id . '"
1328
  class="wppa-table-wrap wppa-tabcontent"
1329
- style="position:relative;display:none;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
1330
  >' );
1331
 
1332
  // Explanation
@@ -1376,612 +1788,147 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1376
  $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $albuminfo['a_parent'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1377
  $onc = 'document.location=\''.$url.'\';';
1378
  wppa_echo( '
1379
- <input
1380
- type="button"
1381
- class="wppa-admin-button button"
1382
- onclick="' . $onc . '"
1383
- value="' . esc_attr( __( 'Edit parent', 'wp-photo-album-plus' ) ) . '"
1384
- />' );
1385
- }
1386
-
1387
- // Inherit cats
1388
- if ( $has_children ) {
1389
- wppa_echo( '
1390
- <input
1391
- type="button"
1392
- class="wppa-admin-button button"
1393
- title="' . esc_attr( __( 'Apply categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1394
- onclick="wppaTryInheritCats( ' . $id . ' )"
1395
- value="' . esc_attr( __( 'Apply Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1396
- />
1397
- <input
1398
- type="button"
1399
- class="wppa-admin-button button"
1400
- title="' . esc_attr( __( 'Add categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1401
- onclick="wppaTryAddCats( ' . $id . ' )"
1402
- value="' . esc_attr( __( 'Add Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1403
- />' );
1404
- }
1405
-
1406
- // Subalbums sequence
1407
- if ( $has_children ) {
1408
- wppa_album_sequence( $edit_id );
1409
- }
1410
-
1411
- // End Tab 2
1412
- wppa_echo( '
1413
- </div>' );
1414
-
1415
-
1416
- // Tab 3: Album Actions
1417
- wppa_echo( '
1418
- <div
1419
- id="albumactions-' . $id . '"
1420
- class="wppa-table-wrap wppa-tabcontent"
1421
- style="position:relative;display:none;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
1422
- >' );
1423
-
1424
- // Explanation
1425
- wppa_echo( '
1426
- <h2 class="description" style="margin:1em">' .
1427
- __( 'The following buttons perform actions onto all items in this album', 'wp-photo-album-plus' ) . '
1428
- </h2>' );
1429
-
1430
- wppa_echo( '<div class="wppa-flex">' );
1431
-
1432
- // Default photo tags
1433
- {
1434
- wppa_echo( '
1435
- <div>
1436
- <label>' .
1437
- __( 'Default photo tags:', 'wp-photo-album-plus' ) . '
1438
- </label><br>
1439
- <input
1440
- type="text"
1441
- id="default_tags"
1442
- value="' . esc_attr( $default_tags ) . '"
1443
- style="width:100%"
1444
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'default_tags\', this )"
1445
- />
1446
- <br>
1447
- <span class="description">' .
1448
- __( 'Enter the tags that you want to be assigned to new photos in this album.', 'wp-photo-album-plus' ) . '
1449
- </span>
1450
- </div>' );
1451
- }
1452
-
1453
- // Apply default tags
1454
- {
1455
- wppa_echo( '
1456
- <div>
1457
- <label>&nbsp;</label><br>
1458
- <input
1459
- type="button"
1460
- class="wppa-admin-button button"
1461
- title="' . esc_attr( __( 'Tag all photos in this album with the default tags.', 'wp-photo-album-plus' ) ) . '"
1462
- onclick="wppaTryApplyDeftags( ' . $id . ' )"
1463
- value="' . esc_attr( __( 'Apply default tags', 'wp-photo-album-plus' ) ) . '"
1464
- />
1465
- <input
1466
- type="button"
1467
- class="wppa-admin-button button"
1468
- title="' . esc_attr( __( 'Add the default tags to all photos in this album.', 'wp-photo-album-plus' ) ) . '"
1469
- onclick="wppaTryAddDeftags( ' . $id . ' )"
1470
- value="' . esc_attr( __( 'Add default tags', 'wp-photo-album-plus' ) ) . '"
1471
- />
1472
- </div>' );
1473
- }
1474
-
1475
- // Apply New photo desc
1476
- if ( wppa_switch( 'apply_newphoto_desc') ) {
1477
- $onc = 'if ( confirm(\'Are you sure you want to set the description of all photos to \n\n'.esc_js(wppa_opt( 'newphoto_description')).'\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&applynewdesc=1\'';
1478
- wppa_echo( '
1479
- <div>
1480
- <label>&nbsp;</label><br>
1481
- <input
1482
- type="button"
1483
- class="wppa-admin-button button"
1484
- onclick="' . $onc . '"
1485
- value="' . esc_attr( __( 'Apply new photo desc', 'wp-photo-album-plus' ) ) . '"
1486
- />
1487
- </div>' );
1488
- }
1489
-
1490
- // Set all to pano
1491
- if ( wppa_switch( 'enable_panorama' ) ) {
1492
-
1493
- wppa_echo( '
1494
- <div>
1495
- <label>&nbsp;</label><br>
1496
- <input
1497
- type="button"
1498
- class="wppa-admin-button button"
1499
- onclick="wppaTrySetAllPanorama(' . $albuminfo['id'] . ')"
1500
- value="' . esc_attr( __( 'Set all to panorama', 'wp-photo-album-plus' ) ).':"
1501
- />
1502
- <select id="pano-opt"
1503
- style="">
1504
- <option value="9" disabled selected>' . __( 'Select a mode', 'wp-photo-album-plus' ) . '</option>
1505
- <option value="0">' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1506
- <option value="1">' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1507
- <option value="2">' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1508
- </select>
1509
- </div>' );
1510
- }
1511
-
1512
- // End wppa-flex div
1513
- wppa_echo( '</div>' );
1514
-
1515
- // Second line
1516
- wppa_echo( '<div class="wppa-flex">' );
1517
-
1518
- // Schedule
1519
- {
1520
- wppa_echo( '
1521
- <div>
1522
- <label>' .
1523
- __( 'Schedule:', 'wp-photo-album-plus' ) . '
1524
- </label><br>
1525
- <input
1526
- type="checkbox"
1527
- id="schedule-box"' .
1528
- ( $albuminfo['scheduledtm'] ? ' checked="checked"' : '' ) . '
1529
- onchange="wppaChangeScheduleAlbum(' . $id . ', this );"
1530
- />
1531
- <input type="hidden" value="" id="wppa-dummy" />
1532
- <span
1533
- class="wppa-datetime-' . $id . '"' .
1534
- ( $albuminfo['scheduledtm'] ? '' : ' style="display:none"' ) . '
1535
- >' .
1536
- wppa_get_date_time_select_html( 'album', $id, true ) . '
1537
- </span>
1538
- <br>
1539
- <span class="description" >' .
1540
- __( 'New photos will be published on the date/time specified here.', 'wp-photo-album-plus' ) . '
1541
- </span>
1542
- </div>' );
1543
- }
1544
-
1545
- // Schedule all
1546
- {
1547
- wppa_echo( '
1548
- <div>
1549
- <label>&nbsp;</label><br>
1550
- <input
1551
- type="button"
1552
- class="wppa-admin-button button"
1553
- title="' . esc_attr( __( 'Schedule all photos in this album for later publishing.', 'wp-photo-album-plus' ) ) . '"
1554
- onclick="wppaTryScheduleAll( ' . $id . ' )"
1555
- value="' . esc_attr( __( 'Schedule all', 'wp-photo-album-plus' ) ) . '"
1556
- />
1557
- </div>' );
1558
- }
1559
-
1560
- // Reset Ratings
1561
- if ( wppa_switch( 'rating_on') ) {
1562
- $onc = 'if (confirm(\'' . esc_js( __( 'Are you sure you want to clear the ratings in this album?', 'wp-photo-album-plus' ) ) . '\')) { wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'clear_ratings\', 0 ); }';
1563
- wppa_echo( '
1564
- <div>
1565
- <label>&nbsp;</label><br>
1566
- <input
1567
- type="button"
1568
- class="wppa-admin-button button"
1569
- onclick="' . $onc . '"
1570
- value="' . esc_attr( __( 'Reset ratings', 'wp-photo-album-plus' ) ) . '"
1571
- />
1572
- </div>' );
1573
- }
1574
-
1575
- // Remake all
1576
- if ( wppa_user_is( 'administrator' ) ) {
1577
- $onc = 'if ( confirm(\'Are you sure you want to remake the files for all photos in this album?\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&remakealbum=1\'';
1578
- wppa_echo( '
1579
- <div>
1580
- <label>&nbsp;</label><br>
1581
- <input
1582
- type="button"
1583
- class="wppa-admin-button button"
1584
- onclick="' . $onc . '"
1585
- value="' . esc_attr( __( 'Remake all', 'wp-photo-album-plus' ) ) . '"
1586
- />
1587
- </div>' );
1588
- }
1589
-
1590
- // Schedule for delete
1591
- if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
1592
- $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
1593
-
1594
- wppa_echo( '
1595
- <div
1596
- style="max-width: 500px;margin-right: 4px;">
1597
- <label
1598
- for="scheduledel">' .
1599
- __( 'Delete at', 'wp-photo-album-plus' ) . '
1600
- </label><br>
1601
- <input
1602
- type="checkbox"
1603
- id="scheduledel"' .
1604
- ( $scheduledel ? ' checked="checked"' : '' ) .
1605
- ( $may_change ? '' : ' disabled' ) . '
1606
- onchange="wppaChangeScheduleDelAlbum( ' . $id . ', this );"
1607
- />
1608
- <input type="hidden" value="" id="wppa-dummy-del" />
1609
- <span
1610
- class="wppa-datetimedel-' . $id . '"' .
1611
- ( $albuminfo['scheduledel'] ? '' : ' style="display:none"' ) . '
1612
- >' .
1613
- wppa_get_date_time_select_html( 'delalbum', $id, $may_change ) . '
1614
- </span>
1615
- </div>' );
1616
- }
1617
-
1618
-
1619
- // End wppa-flex div
1620
- wppa_echo( '</div>' );
1621
-
1622
- // End Tab 3
1623
- wppa_echo( '
1624
- </div>' );
1625
-
1626
- // Tab 4 ALbum cover settings
1627
- wppa_echo( '
1628
- <div
1629
- id="albumcovers-' . $id . '"
1630
- class="wppa-table-wrap wppa-tabcontent"
1631
- style="position:relative;display:none;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
1632
- >' );
1633
-
1634
- // Explanation
1635
- wppa_echo( '
1636
- <h2 class="description" style="margin:1em">' .
1637
- __( 'The following settings apply to the album cover', 'wp-photo-album-plus' ) . '
1638
- </h2>' );
1639
-
1640
- wppa_echo( '<div class="wppa-flex">' );
1641
-
1642
- // Cover type
1643
- if ( ! wppa_switch( 'covertype_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1644
- $sel = ' selected';
1645
- $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'covers', 3, 4 ), wppa_opt( 'cover_type' ) );
1646
-
1647
- wppa_echo( '
1648
- <div
1649
- style="max-width: 200px;margin-right: 4px;">
1650
- <label
1651
- for="covertype">' .
1652
- __( 'Cover&nbsp;Type', 'wp-photo-album-plus' ) . '
1653
- </label><br>
1654
- <select
1655
- id="covertype"
1656
- style="max-width:200px;"
1657
- onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_type\', this.value )"
1658
- title="' . esc_attr( $title ) . '"
1659
- >
1660
- <option value=""' . ( $cover_type == '' ? $sel : '' ) . ' >' .
1661
- __( '--- default ---', 'wp-photo-album-plus' ) . '
1662
- </option>
1663
- <option value="default"' . ( $cover_type == 'default' ? $sel : '' ) . ' >' .
1664
- __( 'Standard', 'wp-photo-album-plus' ) . '
1665
- </option>
1666
- <option value="longdesc"' . ( $cover_type == 'longdesc' ? $sel : '' ) . ' >' .
1667
- __( 'Long Descriptions', 'wp-photo-album-plus' ) . '
1668
- </option>
1669
- <option value="imagefactory"' . ( $cover_type == 'imagefactory' ? $sel : '' ) . ' >' .
1670
- __( 'Image Factory', 'wp-photo-album-plus' ) . '
1671
- </option>
1672
- <option value="default-mcr"' . ( $cover_type == 'default-mcr' ? $sel : '' ) . ' >' .
1673
- __( 'Standard mcr', 'wp-photo-album-plus' ) . '
1674
- </option>
1675
- <option value="longdesc-mcr"' . ( $cover_type == 'longdesc-mcr' ? $sel : '' ) . ' >' .
1676
- __( 'Long Descriptions mcr', 'wp-photo-album-plus' ) . '
1677
- </option>
1678
- <option value="imagefactory-mcr"' . ( $cover_type == 'imagefactory-mcr' ? $sel : '' ) . ' >' .
1679
- __( 'Image Factory mcr', 'wp-photo-album-plus' ) . '
1680
- </option>
1681
- </select>
1682
- </div>' );
1683
- }
1684
-
1685
- // Cover photo
1686
- {
1687
- wppa_echo( '
1688
- <div>
1689
- <label>' .
1690
- __( 'Cover&nbsp;Photo:', 'wp-photo-album-plus' ) . '
1691
- </label><br>' .
1692
- wppa_main_photo( $main_photo, $cover_type ) . '
1693
- </div>' );
1694
- }
1695
-
1696
- // Link type
1697
- {
1698
- $result = '
1699
- <div>
1700
- <label>' .
1701
- __( 'Link type:', 'wp-photo-album-plus' ) . '
1702
- </label><br>';
1703
- $sel = ' selected';
1704
- $lt = $cover_linktype;
1705
- if ( wppa_switch( 'auto_page' ) ) {
1706
- $title = __( 'If you select "the link page with a clean url", select an Auto Page of one of the photos in this album.', 'wp-photo-album-plus' );
1707
- }
1708
- else {
1709
- $title = __( 'If you select "the link page with a clean url", make sure you enter the correct shortcode on the target page.', 'wp-photo-album-plus' );
1710
- }
1711
- $result .= '
1712
- <select
1713
- title="' . esc_attr( $title ) . '"
1714
- onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_linktype\', this )" >
1715
- <option value="content"' . ( $lt == 'content' ? $sel : '' ) . ' >' . __( 'the subalbums and thumbnails', 'wp-photo-album-plus' ) . '</option>
1716
- <option value="albums"' . ( $lt == 'albums' ? $sel : '' ) . ' >' . __( 'the subalbums', 'wp-photo-album-plus' ) . '</option>
1717
- <option value="thumbs"' . ( $lt == 'thumbs' ? $sel : '' ) . ' >' . __( 'the thumbnails', 'wp-photo-album-plus' ) . '</option>
1718
- <option value="slide"' . ( $lt == 'slide' ? $sel : '' ) . ' >' . __( 'the album photos as slideshow', 'wp-photo-album-plus' ) . '</option>
1719
- <option value="page"' . ( $lt == 'page' ? $sel : '' ) . ' >' . __( 'the link page with a clean url', 'wp-photo-album-plus' ) . '</option>
1720
- <option value="none"' . ( $lt == 'none' ? $sel : '' ) . ' >' . __( 'no link at all', 'wp-photo-album-plus' ) . '</option>
1721
- <option value="manual"' . ( $lt == 'manual' ? $sel : '' ) . ' >' . __( 'manually entered', 'wp-photo-album-plus' ) . '</option>
1722
- </select>
1723
- <br>
1724
- <span class="description">';
1725
-
1726
- $result .= '
1727
- </span>
1728
- </div>';
1729
- wppa_echo( $result );
1730
- }
1731
-
1732
- // Manually entered link
1733
- if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1734
- $result = '
1735
- <div
1736
- id="link-url-tr"
1737
- style="' . ( $cover_linktype == 'manual' ? '' : 'display:none' ) . '"
1738
- >
1739
- <label>' .
1740
- __( 'Link target (url):', 'wp-photo-album-plus' ) . '
1741
- </label><br>';
1742
- $title = __( 'Enter the url you want the title to link to when you selected Link type manually entered.', 'wp-photo-album-plus' );
1743
- $result .= '
1744
- <input
1745
- type="text"
1746
- title="' . $title . '"
1747
- id="cover_link"
1748
- value="' . esc_attr( $cover_link ) . '"
1749
- style="width:100%"
1750
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'cover_link\', this )"
1751
- />
1752
- </div>';
1753
- wppa_echo( $result );
1754
- }
1755
-
1756
- // Link page
1757
- if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1758
- $result = '
1759
- <div
1760
- id="-link-url-tr"
1761
- style="' . ( $cover_linktype != 'manual' ? '' : 'display:none' ) . '"
1762
- >
1763
- <label>' .
1764
- __( 'Link to:', 'wp-photo-album-plus' ) . '
1765
- </label><br>';
1766
- $query = "SELECT ID, post_type, post_title, post_date FROM $wpdb->posts
1767
- WHERE ( post_type = 'page' OR post_type = 'post' )
1768
- AND post_status = 'publish'
1769
- ORDER BY post_title ASC";
1770
- $pages = $wpdb->get_results( $query, ARRAY_A );
1771
- if ( empty( $pages ) ) {
1772
- $result .= __( 'There are no posts/pages (yet) to link to.', 'wp-photo-album-plus' );
1773
- }
1774
- else {
1775
- $linkpage = $albuminfo['cover_linkpage'];
1776
- if ( ! is_numeric( $linkpage ) ) {
1777
- $linkpage = '0';
1778
- }
1779
- $title = __( 'If you want, you can link the title to a WP page or post instead of the album\'s content. If so, select the page the title links to.', 'wp-photo-album-plus' ) .
1780
-
1781
- $result .= '
1782
- <select
1783
- onchange="wppaAjaxUpdateAlbum( '. $id . ' , \'cover_linkpage\', this )"
1784
- title="' . esc_attr( $title ) . '"
1785
- style="max-width:100%;"
1786
- >
1787
- <option value="0"' . ( $linkpage == '0' ? $sel : '' ) . ' >' .
1788
- __( '--- the same page or post ---', 'wp-photo-album-plus' ) .
1789
- '</option>';
1790
- foreach ( $pages as $page ) {
1791
- $result .= '
1792
- <option
1793
- value="' . $page['ID'] . '"' .
1794
- ( $linkpage == $page['ID'] ? ' selected' : '' ) . '>' .
1795
- __( htmlspecialchars( $page['post_title'] ) ) .
1796
- ( $page['post_type'] == 'post' ? ' (' . htmlspecialchars( $page['post_date'] ) . ')' : '' ) .
1797
- '</option>';
1798
- }
1799
- $result .= '
1800
- </select>';
1801
-
1802
-
1803
-
1804
- }
1805
- $result .= '
1806
- </div>';
1807
-
1808
- wppa_echo( $result );
1809
  }
1810
 
1811
- // End wppa-flex div
1812
- wppa_echo( '</div>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1813
 
1814
- // wppaGetCoverPreview( albumId, divId )
1815
- // Preview album cover
1816
- wppa_echo( '<div id="cover-preview-'.$id.'" style="margin-top:12px;clear:both;max-width:600px"></div>' );
 
1817
 
1818
- // End Tab 4
1819
  wppa_echo( '
1820
  </div>' );
1821
 
1822
- // Tab 5 Display
 
1823
  wppa_echo( '
1824
  <div
1825
- id="itemdisplay-' . $id . '"
1826
  class="wppa-table-wrap wppa-tabcontent"
1827
- style="position:relative;display:none;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
1828
  >' );
1829
 
1830
  // Explanation
1831
  wppa_echo( '
1832
  <h2 class="description" style="margin:1em">' .
1833
- __( 'The following settings can overrule systemwide settings on a per album basis', 'wp-photo-album-plus' ) . '
1834
  </h2>' );
1835
 
1836
- wppa_echo( '<div class="wppa-flex">' );
1837
-
1838
- // Need this the next 5 items
1839
- {
1840
- $yes = __( 'yes', 'wp-photo-album-plus' );
1841
- $no = __( 'no', 'wp-photo-album-plus' );
1842
- $def = __( 'default', 'wp-photo-album-plus' );
1843
- }
1844
-
1845
- // Zoomable
1846
- {
1847
- $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
1848
- sprintf( __( 'The default is set in %s and is currently %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'photos', 1, 4 ), ( wppa_switch( 'zoom_on' ) ? $yes : $no ) );
1849
-
1850
- wppa_echo( '
1851
- <div>
1852
- <label
1853
- for="zoomable">' .
1854
- __( 'Photos are zoomable:', 'wp-photo-album-plus' ) . '
1855
- </label><br>
1856
- <select
1857
- id="zoomable"
1858
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'zoomable\', this )"
1859
- title="' . esc_attr( $title ) . '" >
1860
- <option value=""'.($zoomable==''?' selected': '').'>' . $def . '</option>
1861
- <option value="on"'.($zoomable=='on'?' selected': '').'>' . $yes . '</option>
1862
- <option value="off"'.($zoomable=='off'?' selected': '').'>' . $no . '</option>
1863
- </select>
1864
- </div>' );
1865
- }
1866
-
1867
- // Overrulable display options / next 4 items
1868
- {
1869
- if ( $displayopts ) {
1870
- $disp_opt = explode( ',', $displayopts );
1871
- }
1872
- for ( $i = 0; $i < 4; $i++ ) {
1873
- if ( ! isset( $disp_opt[$i] ) ) {
1874
- $disp_opt[$i] = '0';
1875
- }
1876
- }
1877
- $title_head = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . '&#013;' .
1878
- __( 'The defaults are set in', 'wp-photo-album-plus' ). ':&#013;';
1879
- }
1880
-
1881
- // Display name
1882
- {
1883
- $title = $title_head .
1884
- wppa_setting_path( 'b', 'slide', 1, 17, wppa_switch( 'show_full_name' ) ? $yes : $no ) . ',&#013;' .
1885
- wppa_setting_path( 'b', 'thumbs', 2, 1, wppa_switch( 'thumb_text_name' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1886
- wppa_setting_path( 'b', 'lightbox', 1, 3, wppa_switch( 'ovl_name' ) ? $yes : $no ) . '.';
1887
-
1888
- wppa_echo( '
1889
- <div>
1890
- <label
1891
- for="showname">' .
1892
- __( 'Show names:', 'wp-photo-album-plus' ) . '
1893
- </label><br>
1894
- <select
1895
- id="showname"
1896
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt0\', this )"
1897
- title="' . esc_attr( $title ) . '">
1898
- <option value="0"'.($disp_opt[0]=='0'?' selected': '').'>' . $def . '</option>
1899
- <option value="1"'.($disp_opt[0]=='1'?' selected': '').'>' . $yes . '</option>
1900
- <option value="-1"'.($disp_opt[0]=='-1'?' selected': '').'>' . $no . '</option>
1901
- </select>
1902
- </div>' );
1903
- }
1904
-
1905
- // Display description
1906
- {
1907
- $title = $title_head .
1908
- wppa_setting_path( 'b', 'slide', 1, 20, wppa_switch( 'show_full_desc' ) ? $yes : $no ) . ',&#013;' .
1909
- wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_desc' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1910
- wppa_setting_path( 'b', 'lightbox', 1, 4, wppa_switch( 'ovl_desc' ) ? $yes : $no ) . '.';
1911
-
1912
- wppa_echo( '
1913
- <div>
1914
- <label
1915
- for="showdesc">' .
1916
- __( 'Show descriptions:', 'wp-photo-album-plus' ) . '
1917
- </label><br>
1918
- <select
1919
- id="showdesc"
1920
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt1\', this )"
1921
- title="' . esc_attr( $title ) . '" >
1922
- <option value="0"'.($disp_opt[1]=='0'?' selected': '').'>' . $def . '</option>
1923
- <option value="1"'.($disp_opt[1]=='1'?' selected': '').'>' . $yes . '</option>
1924
- <option value="-1"'.($disp_opt[1]=='-1'?' selected': '').'>' . $no . '</option>
1925
- </select>
1926
- </div>' );
1927
- }
1928
 
1929
- // Display rating
1930
- {
1931
- $title = $title_head .
1932
- wppa_setting_path( 'b', 'general', 1, 5, wppa_switch( 'rating_on' ) ? $yes : $no ) . ',&#013;' .
1933
- wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_rating' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1934
- wppa_setting_path( 'b', 'lightbox', 1, 5, wppa_switch( 'ovl_rating' ) ? $yes : $no ) . '.';
 
 
 
 
 
1935
 
1936
- wppa_echo( '
1937
- <div>
1938
- <label
1939
- for="showrating">' .
1940
- __( 'Show rating:', 'wp-photo-album-plus' ) . '
1941
- </label><br>
1942
- <select
1943
- id="showrating"
1944
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt2\', this )"
1945
- title="' . esc_attr( $title ) . '" >
1946
- <option value="0"'.($disp_opt[2]=='0'?' selected': '').'>' . $def . '</option>
1947
- <option value="1"'.($disp_opt[2]=='1'?' selected': '').'>' . $yes . '</option>
1948
- <option value="-1"'.($disp_opt[2]=='-1'?' selected': '').'>' . $no . '</option>
1949
- </select>
1950
- </div>' );
1951
- }
1952
 
1953
- // Display comments
1954
- {
1955
- $title = $title_head .
1956
- wppa_setting_path( 'b', 'general', 1, 4, wppa_switch( 'show_comments' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1957
- wppa_setting_path( 'b', 'thumbs', 2, 4, wppa_switch( 'thumb_text_comcount' ) ? $yes : $no ) . '.';
 
 
 
 
 
 
1958
 
1959
- wppa_echo( '
1960
- <div>
1961
- <label
1962
- for="showcomments">' .
1963
- __( 'Show comments:', 'wp-photo-album-plus' ) . '
1964
- </label><br>
1965
- <select
1966
- id="showcomments"
1967
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt3\', this )"
1968
- title="' . esc_attr( $title ) . '" >
1969
- <option value="0"'.($disp_opt[3]=='0'?' selected': '').'>' . $def . '</option>
1970
- <option value="1"'.($disp_opt[3]=='1'?' selected': '').'>' . $yes . '</option>
1971
- <option value="-1"'.($disp_opt[3]=='-1'?' selected': '').'>' . $no . '</option>
1972
- </select>
1973
- </div>' );
1974
- }
1975
 
 
 
1976
 
1977
- // End wppa-flex div
1978
- wppa_echo( '</div>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
1979
 
1980
- // End Tab 5
1981
  wppa_echo( '
1982
  </div>' );
1983
 
1984
-
1985
  // End of outer details block
1986
  wppa_echo( '
1987
  </details>' );
@@ -3547,60 +3494,6 @@ global $wpdb;
3547
  }
3548
  }
3549
 
3550
- // Subalbum order
3551
- {
3552
- $sel = ' selected';
3553
- $opts = array(
3554
- __( '--- default ---', 'wp-photo-album-plus' ),
3555
- __( 'Random', 'wp-photo-album-plus' ),
3556
- __( 'Order #', 'wp-photo-album-plus' ),
3557
- __( 'Order # reverse', 'wp-photo-album-plus' ),
3558
- __( 'Name', 'wp-photo-album-plus' ),
3559
- __( 'Name reverse', 'wp-photo-album-plus' ),
3560
- __( 'Timestamp', 'wp-photo-album-plus' ),
3561
- __( 'Timestamp reverse', 'wp-photo-album-plus' ),
3562
- );
3563
- $vals = array( '0', '3', '1', '-1', '2', '-2', '5', '-5' );
3564
-
3565
- $df = wppa_opt( 'list_albums_by' );
3566
- if ( $df == '0' ) $dflt = __( 'not specified', 'wp-photo-album-plus' );
3567
- else foreach( array_keys( $vals ) as $key ) {
3568
- if ( $df == $vals[$key] ) {
3569
- $dflt = $opts[$key];
3570
- }
3571
- }
3572
- }
3573
- $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'misc', 1, 1 ), $dflt );
3574
- $suba_order_by = wppa_get_album_item( $parent, 'suba_order_by' );
3575
- $result = '
3576
- <div style="margin-left:6px">
3577
- <label
3578
- for="subalbumorder">' .
3579
- __( 'Subalbum sort order', 'wp-photo-album-plus' ) . '
3580
- </label><br>
3581
- <select
3582
- id="subalbumorder"
3583
- style="max-width:200px;"
3584
- onchange="
3585
- wppaAjaxUpdateAlbum( ' . $parent . ', \'suba_order_by\', this );
3586
- var ord=Math.abs(jQuery(this).val());
3587
- var dft=Math.abs(' . wppa_opt('wppa_list_albums_by') . ');
3588
- if (ord == 1 || (ord == 0 && dft == 1)) {
3589
- jQuery(\'#wppa-album-sequence\').show();
3590
- }
3591
- else {
3592
- jQuery(\'#wppa-album-sequence\').hide();
3593
- }"
3594
- title="' . esc_attr( $title ) . '"
3595
- >';
3596
- for ( $i = 0; $i < 7; $i++ ) {
3597
- $result .= '<option value="' . esc_attr( $vals[$i] ) . '" ' . ( $suba_order_by == $vals[$i] ? $sel : '' ) . ' >' . $opts[$i] . '</option>';
3598
- }
3599
- $result .= '
3600
- </select>
3601
- </div>';
3602
- wppa_echo( $result );
3603
-
3604
  // Check album order
3605
  if ( $albumorder_col != 'a_order' ) {
3606
  if ( $parent == '0') {
@@ -3616,16 +3509,10 @@ global $wpdb;
3616
  $result .= '<br>';
3617
 
3618
  wppa_echo( $result );
3619
- // return;
3620
  }
3621
 
3622
-
3623
-
3624
  $result = '
3625
- <div
3626
- style="' . ( $albumorder_col != 'a_order' ? 'display:none' : '' ) . '"
3627
- id="wppa-album-sequence"
3628
- >
3629
  <h2 style="margin:1em">' .
3630
  __( 'Manage album order', 'wp-photo-album-plus' ) . '
3631
  -
@@ -3682,8 +3569,7 @@ global $wpdb;
3682
  </td>
3683
  </tr>
3684
  </tbody>
3685
- </table>
3686
- ';
3687
  wppa_echo( $result );
3688
 
3689
 
@@ -3945,7 +3831,6 @@ global $wpdb;
3945
  $result .= '
3946
  </div>
3947
  <div style="clear:both;"></div>
3948
- </div>
3949
  </div>';
3950
 
3951
  wppa_echo( $result );
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.2.02.010
7
  *
8
  */
9
 
495
  else {
496
  alert("' . __( 'Please select a valid panorama mode', 'wp-photo-album-plus' ) . '");
497
  }
498
+ }';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
 
500
  wppa_add_inline_script( 'wppa-admin', $the_js );
501
  }
579
  </div>'); // end action-container
580
  /* End header */
581
 
582
+ /* Main nody album admin */
583
  wppa_echo( '
584
  <details class="wppa-toplevel-details">
585
  <summary class="toplevel wppa-summary-toplevel"> ' .
594
  <br>' . __( 'The <b style="color:#070" >Remark</b> fields keep you informed on the actions taken at the background.', 'wp-photo-album-plus' ) . '
595
  </h2>' );
596
 
 
 
 
 
 
 
 
 
 
 
 
597
  // The tabs
598
  wppa_echo('
599
  <div id="tabs" style="margin-bottom:23px">
600
  <ul class="widefat wppa-setting-tabs">
601
+ <li class="wppa-albumadmin-tab active" onclick="wppaChangeAlbumAdminTab(this,\'#albumitem-' . $id . '\');">' . __( 'General Album Settings', 'wp-photo-album-plus' ) . '</li>
602
+ <li class="wppa-albumadmin-tab" onclick="wppaChangeAlbumAdminTab(this,\'#subalbumitem-' . $id . '\');">' . __( 'Subalbums', 'wp-photo-album-plus' ) . '</li>
603
+ <li class="wppa-albumadmin-tab" onclick="wppaChangeAlbumAdminTab(this,\'#albumactions-' . $id . '\');">' . __( 'Album actions', 'wp-photo-album-plus' ) . '</li>
 
 
604
  </ul>
605
  <div style="clear:both"></div>
606
  </div>');
620
  <div
621
  id="albumitem-' . $id . '"
622
  class="wppa-table-wrap wppa-tabcontent"
623
+ style="width:100%;position:relative;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
624
  >' );
625
 
626
  // Section 0: More or less static data
952
  wppa_echo( $result );
953
  }
954
 
955
+ // Subalbum order
956
+ {
957
+ $sel = ' selected';
958
+ $opts = array(
959
+ __( '--- default ---', 'wp-photo-album-plus' ),
960
+ __( 'Random', 'wp-photo-album-plus' ),
961
+ __( 'Order #', 'wp-photo-album-plus' ),
962
+ __( 'Order # reverse', 'wp-photo-album-plus' ),
963
+ __( 'Name', 'wp-photo-album-plus' ),
964
+ __( 'Name reverse', 'wp-photo-album-plus' ),
965
+ __( 'Timestamp', 'wp-photo-album-plus' ),
966
+ __( 'Timestamp reverse', 'wp-photo-album-plus' ),
967
+ );
968
+ $vals = array( '0', '3', '1', '-1', '2', '-2', '5', '-5' );
969
+
970
+ $df = wppa_opt( 'list_albums_by' );
971
+ if ( $df == '0' ) $dflt = __( 'not specified', 'wp-photo-album-plus' );
972
+ else foreach( array_keys( $vals ) as $key ) {
973
+ if ( $df == $vals[$key] ) {
974
+ $dflt = $opts[$key];
975
+ }
976
+ }
977
+
978
+ $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'misc', 1, 1 ), $dflt );
979
+
980
+ $result = '
981
+ <div>
982
+ <label
983
+ for="subalbumorder">' .
984
+ __( 'Subalbum sort order', 'wp-photo-album-plus' ) . '
985
+ </label><br>
986
+ <select
987
+ id="subalbumorder"
988
+ style="max-width:200px;"
989
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'suba_order_by\', this )"
990
+ title="' . esc_attr( $title ) . '"
991
+ >';
992
+ for ( $i = 0; $i < 7; $i++ ) {
993
+ $result .= '<option value="' . esc_attr( $vals[$i] ) . '" ' . ( $suba_order_by == $vals[$i] ? $sel : '' ) . ' >' . $opts[$i] . '</option>';
994
+ }
995
+ $result .= '
996
+ </select>
997
+ </div>';
998
+ wppa_echo( $result );
999
+ }
1000
+
1001
  // Alternative thumbnail size
1002
  if ( ! wppa_switch( 'alt_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1003
  $title = sprintf( __( 'The alternate thumbnail size is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'thumbs', 1, 2 ), wppa_opt( 'thumbsize_alt' ) );
1025
  </div>' );
1026
  }
1027
 
1028
+ // Cover type
1029
+ if ( ! wppa_switch( 'covertype_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1030
+ $sel = ' selected';
1031
+ $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'covers', 3, 4 ), wppa_opt( 'cover_type' ) );
1032
+
1033
+ wppa_echo( '
1034
+ <div
1035
+ style="max-width: 200px;margin-right: 4px;">
1036
+ <label
1037
+ for="covertype">' .
1038
+ __( 'Cover&nbsp;Type', 'wp-photo-album-plus' ) . '
1039
+ </label><br>
1040
+ <select
1041
+ id="covertype"
1042
+ style="max-width:200px;"
1043
+ onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_type\', this )"
1044
+ title="' . esc_attr( $title ) . '"
1045
+ >
1046
+ <option value=""' . ( $cover_type == '' ? $sel : '' ) . ' >' .
1047
+ __( '--- default ---', 'wp-photo-album-plus' ) . '
1048
+ </option>
1049
+ <option value="default"' . ( $cover_type == 'default' ? $sel : '' ) . ' >' .
1050
+ __( 'Standard', 'wp-photo-album-plus' ) . '
1051
+ </option>
1052
+ <option value="longdesc"' . ( $cover_type == 'longdesc' ? $sel : '' ) . ' >' .
1053
+ __( 'Long Descriptions', 'wp-photo-album-plus' ) . '
1054
+ </option>
1055
+ <option value="imagefactory"' . ( $cover_type == 'imagefactory' ? $sel : '' ) . ' >' .
1056
+ __( 'Image Factory', 'wp-photo-album-plus' ) . '
1057
+ </option>
1058
+ <option value="default-mcr"' . ( $cover_type == 'default-mcr' ? $sel : '' ) . ' >' .
1059
+ __( 'Standard mcr', 'wp-photo-album-plus' ) . '
1060
+ </option>
1061
+ <option value="longdesc-mcr"' . ( $cover_type == 'longdesc-mcr' ? $sel : '' ) . ' >' .
1062
+ __( 'Long Descriptions mcr', 'wp-photo-album-plus' ) . '
1063
+ </option>
1064
+ <option value="imagefactory-mcr"' . ( $cover_type == 'imagefactory-mcr' ? $sel : '' ) . ' >' .
1065
+ __( 'Image Factory mcr', 'wp-photo-album-plus' ) . '
1066
+ </option>
1067
+ </select>
1068
+ </div>' );
1069
+ }
1070
+
1071
+ // Cover photo
1072
+ {
1073
+ wppa_echo( '
1074
+ <div>
1075
+ <label>' .
1076
+ __( 'Cover&nbsp;Photo:', 'wp-photo-album-plus' ) . '
1077
+ </label><br>' .
1078
+ wppa_main_photo( $main_photo, $cover_type ) . '
1079
+ </div>' );
1080
+ }
1081
+
1082
  // Upload limit
1083
  {
1084
  $result = '
1158
  </div>' );
1159
  }
1160
 
1161
+ // Need this the next 5 items
1162
+ {
1163
+ $yes = __( 'yes', 'wp-photo-album-plus' );
1164
+ $no = __( 'no', 'wp-photo-album-plus' );
1165
+ $def = __( 'default', 'wp-photo-album-plus' );
1166
+ }
1167
+
1168
+ // Zoomable
1169
+ {
1170
+ $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
1171
+ sprintf( __( 'The default is set in %s and is currently %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'photos', 1, 4 ), ( wppa_switch( 'zoom_on' ) ? $yes : $no ) );
1172
+
1173
+ wppa_echo( '
1174
+ <div>
1175
+ <label
1176
+ for="zoomable">' .
1177
+ __( 'Photos are zoomable:', 'wp-photo-album-plus' ) . '
1178
+ </label><br>
1179
+ <select
1180
+ id="zoomable"
1181
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'zoomable\', this )"
1182
+ title="' . esc_attr( $title ) . '" >
1183
+ <option value=""'.($zoomable==''?' selected': '').'>' . $def . '</option>
1184
+ <option value="on"'.($zoomable=='on'?' selected': '').'>' . $yes . '</option>
1185
+ <option value="off"'.($zoomable=='off'?' selected': '').'>' . $no . '</option>
1186
+ </select>
1187
+ </div>' );
1188
+ }
1189
+
1190
+ // Overrulable display options / next 4 items
1191
+ {
1192
+ if ( $displayopts ) {
1193
+ $disp_opt = explode( ',', $displayopts );
1194
+ }
1195
+ for ( $i = 0; $i < 4; $i++ ) {
1196
+ if ( ! isset( $disp_opt[$i] ) ) {
1197
+ $disp_opt[$i] = '0';
1198
+ }
1199
+ }
1200
+ $title_head = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . '&#013;' .
1201
+ __( 'The defaults are set in', 'wp-photo-album-plus' ). ':&#013;';
1202
+ }
1203
+
1204
+ // Display name
1205
+ {
1206
+ $title = $title_head .
1207
+ wppa_setting_path( 'b', 'slide', 1, 17, wppa_switch( 'show_full_name' ) ? $yes : $no ) . ',&#013;' .
1208
+ wppa_setting_path( 'b', 'thumbs', 2, 1, wppa_switch( 'thumb_text_name' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1209
+ wppa_setting_path( 'b', 'lightbox', 1, 3, wppa_switch( 'ovl_name' ) ? $yes : $no ) . '.';
1210
+
1211
+ wppa_echo( '
1212
+ <div>
1213
+ <label
1214
+ for="showname">' .
1215
+ __( 'Show names:', 'wp-photo-album-plus' ) . '
1216
+ </label><br>
1217
+ <select
1218
+ id="showname"
1219
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt0\', this )"
1220
+ title="' . esc_attr( $title ) . '">
1221
+ <option value="0"'.($disp_opt[0]=='0'?' selected': '').'>' . $def . '</option>
1222
+ <option value="1"'.($disp_opt[0]=='1'?' selected': '').'>' . $yes . '</option>
1223
+ <option value="-1"'.($disp_opt[0]=='-1'?' selected': '').'>' . $no . '</option>
1224
+ </select>
1225
+ </div>' );
1226
+ }
1227
+
1228
+ // Display description
1229
+ {
1230
+ $title = $title_head .
1231
+ wppa_setting_path( 'b', 'slide', 1, 20, wppa_switch( 'show_full_desc' ) ? $yes : $no ) . ',&#013;' .
1232
+ wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_desc' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1233
+ wppa_setting_path( 'b', 'lightbox', 1, 4, wppa_switch( 'ovl_desc' ) ? $yes : $no ) . '.';
1234
+
1235
+ wppa_echo( '
1236
+ <div>
1237
+ <label
1238
+ for="showdesc">' .
1239
+ __( 'Show descriptions:', 'wp-photo-album-plus' ) . '
1240
+ </label><br>
1241
+ <select
1242
+ id="showdesc"
1243
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt1\', this )"
1244
+ title="' . esc_attr( $title ) . '" >
1245
+ <option value="0"'.($disp_opt[1]=='0'?' selected': '').'>' . $def . '</option>
1246
+ <option value="1"'.($disp_opt[1]=='1'?' selected': '').'>' . $yes . '</option>
1247
+ <option value="-1"'.($disp_opt[1]=='-1'?' selected': '').'>' . $no . '</option>
1248
+ </select>
1249
+ </div>' );
1250
+ }
1251
+
1252
+ // Display rating
1253
+ {
1254
+ $title = $title_head .
1255
+ wppa_setting_path( 'b', 'general', 1, 5, wppa_switch( 'rating_on' ) ? $yes : $no ) . ',&#013;' .
1256
+ wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_rating' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1257
+ wppa_setting_path( 'b', 'lightbox', 1, 5, wppa_switch( 'ovl_rating' ) ? $yes : $no ) . '.';
1258
+
1259
+ wppa_echo( '
1260
+ <div>
1261
+ <label
1262
+ for="showrating">' .
1263
+ __( 'Show rating:', 'wp-photo-album-plus' ) . '
1264
+ </label><br>
1265
+ <select
1266
+ id="showrating"
1267
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt2\', this )"
1268
+ title="' . esc_attr( $title ) . '" >
1269
+ <option value="0"'.($disp_opt[2]=='0'?' selected': '').'>' . $def . '</option>
1270
+ <option value="1"'.($disp_opt[2]=='1'?' selected': '').'>' . $yes . '</option>
1271
+ <option value="-1"'.($disp_opt[2]=='-1'?' selected': '').'>' . $no . '</option>
1272
+ </select>
1273
+ </div>' );
1274
+ }
1275
+
1276
+ // Display comments
1277
+ {
1278
+ $title = $title_head .
1279
+ wppa_setting_path( 'b', 'general', 1, 4, wppa_switch( 'show_comments' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1280
+ wppa_setting_path( 'b', 'thumbs', 2, 4, wppa_switch( 'thumb_text_comcount' ) ? $yes : $no ) . '.';
1281
+
1282
+ wppa_echo( '
1283
+ <div>
1284
+ <label
1285
+ for="showcomments">' .
1286
+ __( 'Show comments:', 'wp-photo-album-plus' ) . '
1287
+ </label><br>
1288
+ <select
1289
+ id="showcomments"
1290
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt3\', this )"
1291
+ title="' . esc_attr( $title ) . '" >
1292
+ <option value="0"'.($disp_opt[3]=='0'?' selected': '').'>' . $def . '</option>
1293
+ <option value="1"'.($disp_opt[3]=='1'?' selected': '').'>' . $yes . '</option>
1294
+ <option value="-1"'.($disp_opt[3]=='-1'?' selected': '').'>' . $no . '</option>
1295
+ </select>
1296
+ </div>' );
1297
+ }
1298
+
1299
  // Watermark
1300
  if ( wppa_switch( 'watermark_on' ) ) {
1301
 
1328
  </div>' );
1329
  }
1330
 
1331
+ // Schedule for delete
1332
+ if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
1333
+ $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
1334
+
1335
+ wppa_echo( '
1336
+ <div
1337
+ style="max-width: 500px;margin-right: 4px;">
1338
+ <label
1339
+ for="scheduledel">' .
1340
+ __( 'Delete at', 'wp-photo-album-plus' ) . '
1341
+ </label><br>
1342
+ <input
1343
+ type="checkbox"
1344
+ id="scheduledel"' .
1345
+ ( $scheduledel ? ' checked="checked"' : '' ) .
1346
+ ( $may_change ? '' : ' disabled' ) . '
1347
+ onchange="wppaChangeScheduleDelAlbum( ' . $id . ', this );"
1348
+ />
1349
+ <input type="hidden" value="" id="wppa-dummy-del" />
1350
+ <span
1351
+ class="wppa-datetimedel-' . $id . '"' .
1352
+ ( $albuminfo['scheduledel'] ? '' : ' style="display:none"' ) . '
1353
+ >' .
1354
+ wppa_get_date_time_select_html( 'delalbum', $id, $may_change ) . '
1355
+ </span>
1356
+ </div>' );
1357
+ }
1358
  wppa_echo( '</div>' );
1359
  }
1360
  // End Section 1: Short settable items, wppa-flex div
1361
 
1362
+
1363
+ // Status - Remark - field
1364
+ {
1365
+ wppa_echo( '
1366
+ <h3 style="margin-left:1em">' .
1367
+ esc_html__( 'Remark', 'wp-photo-album-plus' ) . ':&nbsp;
1368
+ <span
1369
+ id="albumstatus-' . $id . '"
1370
+ style="font-weight:bold;color:#00AA00">' .
1371
+ esc_html( $remark ) . '
1372
+ </span>
1373
+ </h3>' );
1374
+ }
1375
+
1376
+ // Section 2: name, description, custom, links
1377
  {
1378
  wppa_echo( '
1379
  <!-- Album Section 2 -->
1506
  wppa_echo( $result );
1507
  }
1508
 
1509
+ // Default photo tags
1510
+ {
1511
+ wppa_echo( '
1512
+ <tr>
1513
+ <td>
1514
+ ' . __( 'Default photo tags:', 'wp-photo-album-plus' ) . '
1515
+ </td>
1516
+ <td>
1517
+ <input
1518
+ type="text"
1519
+ id="default_tags"
1520
+ value="' . esc_attr( $default_tags ) . '"
1521
+ style="width:100%"
1522
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'default_tags\', this )"
1523
+ />
1524
+ <br>
1525
+ <span class="description">' .
1526
+ __( 'Enter the tags that you want to be assigned to new photos in this album.', 'wp-photo-album-plus' ) . '
1527
+ </span>
1528
+ </td>
1529
+ <td>
1530
+ </td>
1531
+ </tr>' );
1532
+ }
1533
+
1534
  // Custom
1535
  if ( wppa_switch( 'album_custom_fields' ) ) {
1536
  $result = '';
1571
  wppa_echo( $result );
1572
  }
1573
 
1574
+ // Link type
1575
+ {
1576
+ $result = '
1577
+ <tr>
1578
+ <td>
1579
+ ' . __( 'Link type:', 'wp-photo-album-plus' ) . '
1580
+ </td>
1581
+ <td>';
1582
+ $sel = ' selected';
1583
+ $lt = $cover_linktype;
1584
+ $result .= '
1585
+ <select onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_linktype\', this )" >
1586
+ <option value="content"' . ( $lt == 'content' ? $sel : '' ) . ' >' . __( 'the subalbums and thumbnails', 'wp-photo-album-plus' ) . '</option>
1587
+ <option value="albums"' . ( $lt == 'albums' ? $sel : '' ) . ' >' . __( 'the subalbums', 'wp-photo-album-plus' ) . '</option>
1588
+ <option value="thumbs"' . ( $lt == 'thumbs' ? $sel : '' ) . ' >' . __( 'the thumbnails', 'wp-photo-album-plus' ) . '</option>
1589
+ <option value="slide"' . ( $lt == 'slide' ? $sel : '' ) . ' >' . __( 'the album photos as slideshow', 'wp-photo-album-plus' ) . '</option>
1590
+ <option value="page"' . ( $lt == 'page' ? $sel : '' ) . ' >' . __( 'the link page with a clean url', 'wp-photo-album-plus' ) . '</option>
1591
+ <option value="none"' . ( $lt == 'none' ? $sel : '' ) . ' >' . __( 'no link at all', 'wp-photo-album-plus' ) . '</option>
1592
+ <option value="manual"' . ( $lt == 'manual' ? $sel : '' ) . ' >' . __( 'manually entered', 'wp-photo-album-plus' ) . '</option>
1593
+ </select>
1594
+ <br>
1595
+ <span class="description">';
1596
+ if ( wppa_switch( 'auto_page' ) ) {
1597
+ $result .= __( 'If you select "the link page with a clean url", select an Auto Page of one of the photos in this album.', 'wp-photo-album-plus' );
1598
+ }
1599
+ else {
1600
+ $result .= __( 'If you select "the link page with a clean url", make sure you enter the correct shortcode on the target page.', 'wp-photo-album-plus' );
1601
+ }
1602
+ $result .= '
1603
+ </span>
1604
+ </td>
1605
+ <td>
1606
+ </td>
1607
+ </tr>';
1608
+ wppa_echo( $result );
1609
+ }
1610
+
1611
+ // Manually entered link
1612
+ if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1613
+ $result = '
1614
+ <tr
1615
+ id="link-url-tr"
1616
+ style="' . ( $cover_linktype == 'manual' ? '' : 'display:none' ) . '"
1617
+ >
1618
+ <td>
1619
+ ' . __( 'Link target (url):', 'wp-photo-album-plus' ) . '
1620
+ </td>
1621
+ <td>
1622
+ <input
1623
+ type="text"
1624
+ id="cover_link"
1625
+ value="' . esc_attr( $cover_link ) . '"
1626
+ style="width:100%"
1627
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'cover_link\', this )"
1628
+ />
1629
+ <br>
1630
+ <span class="description">' .
1631
+ __( 'Enter the url you want the title to link to when you selected Link type manually entered.', 'wp-photo-album-plus' ) . '
1632
+ </span>
1633
+ </td>
1634
+ <td>
1635
+ </td>
1636
+ </tr>';
1637
+ wppa_echo( $result );
1638
+ }
1639
+
1640
+ // Link page
1641
+ if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1642
+ $result = '
1643
+ <tr>
1644
+ <td>
1645
+ ' . __( 'Link to:', 'wp-photo-album-plus' ) . '
1646
+ </td>
1647
+ <td>';
1648
+ $query = "SELECT ID, post_type, post_title, post_date FROM $wpdb->posts
1649
+ WHERE ( post_type = 'page' OR post_type = 'post' )
1650
+ AND post_status = 'publish'
1651
+ ORDER BY post_title ASC";
1652
+ $pages = $wpdb->get_results( $query, ARRAY_A );
1653
+ if ( empty( $pages ) ) {
1654
+ _e( 'There are no posts/pages (yet) to link to.', 'wp-photo-album-plus' );
1655
+ }
1656
+ else {
1657
+ $linkpage = $albuminfo['cover_linkpage'];
1658
+ if ( ! is_numeric( $linkpage ) ) {
1659
+ $linkpage = '0';
1660
+ }
1661
+
1662
+ $result .= '
1663
+ <select
1664
+ onchange="wppaAjaxUpdateAlbum( '. $id . ' , \'cover_linkpage\', this )"
1665
+ style="max-width:100%;"
1666
+ >
1667
+ <option value="0"' . ( $linkpage == '0' ? $sel : '' ) . ' >' .
1668
+ __( '--- the same page or post ---', 'wp-photo-album-plus' ) .
1669
+ '</option>';
1670
+ foreach ( $pages as $page ) {
1671
+ $result .= '
1672
+ <option
1673
+ value="' . $page['ID'] . '"' .
1674
+ ( $linkpage == $page['ID'] ? ' selected' : '' ) . '>' .
1675
+ __( htmlspecialchars( $page['post_title'] ) ) .
1676
+ ( $page['post_type'] == 'post' ? ' (' . htmlspecialchars( $page['post_date'] ) . ')' : '' ) .
1677
+ '</option>';
1678
+ }
1679
+ $result .= '
1680
+ </select>
1681
+ <br>
1682
+ <span class="description" >' .
1683
+ __( 'If you want, you can link the title to a WP page or post instead of the album\'s content. If so, select the page the title links to.', 'wp-photo-album-plus' ) .
1684
+ '</span>';
1685
+ }
1686
+ $result .= '
1687
+ </td>
1688
+ <td>
1689
+ </td>
1690
+ </tr>';
1691
+ wppa_echo( $result );
1692
+ }
1693
+
1694
+ // Schedule
1695
+ {
1696
+ $result = '
1697
+ <tr>
1698
+ <td>' .
1699
+ __( 'Schedule:', 'wp-photo-album-plus' ) . ' ' .
1700
+ '<input
1701
+ type="checkbox"
1702
+ id="schedule-box"' .
1703
+ ( $albuminfo['scheduledtm'] ? ' checked="checked"' : '' ) . '
1704
+ onchange="wppaChangeScheduleAlbum(' . $id . ', this );"
1705
+ />
1706
+ </td>
1707
+ <td>
1708
+ <input type="hidden" value="" id="wppa-dummy" />
1709
+ <span
1710
+ class="wppa-datetime-' . $id . '"' .
1711
+ ( $albuminfo['scheduledtm'] ? '' : ' style="display:none"' ) .
1712
+ ' >' .
1713
+ wppa_get_date_time_select_html( 'album', $id, true ) .
1714
+ '</span>
1715
+ <br>
1716
+ <span class="description" >' .
1717
+ __( 'If enabled, new photos will have their status set scheduled for publication on the date/time specified here.', 'wp-photo-album-plus' ) .
1718
+ '</span>
1719
+ </td>
1720
+ <td>
1721
+ </td>
1722
+ </tr>';
1723
+ wppa_echo( $result );
1724
+ }
1725
+
1726
  // End Section 2
1727
  wppa_echo( '
1728
  </tbody>
1734
  </div>' ); // Tab 1
1735
 
1736
 
1737
+ // Tab 2: Subalbums
1738
  wppa_echo( '
1739
  <div id="subalbumitem-' . $id . '"
1740
  class="wppa-table-wrap wppa-tabcontent"
1741
+ style="width:100%;position:relative;display:none;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
1742
  >' );
1743
 
1744
  // Explanation
1788
  $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $albuminfo['a_parent'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1789
  $onc = 'document.location=\''.$url.'\';';
1790
  wppa_echo( '
1791
+ <input
1792
+ type="button"
1793
+ class="wppa-admin-button button"
1794
+ onclick="' . $onc . '"
1795
+ value="' . esc_attr( __( 'Edit parent', 'wp-photo-album-plus' ) ) . '"
1796
+ />' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1797
  }
1798
 
1799
+ // Inherit cats
1800
+ if ( $has_children ) {
1801
+ wppa_echo( '
1802
+ <input
1803
+ type="button"
1804
+ class="wppa-admin-button button"
1805
+ title="' . esc_attr( __( 'Apply categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1806
+ onclick="wppaTryInheritCats( ' . $id . ' )"
1807
+ value="' . esc_attr( __( 'Apply Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1808
+ />
1809
+ <input
1810
+ type="button"
1811
+ class="wppa-admin-button button"
1812
+ title="' . esc_attr( __( 'Add categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1813
+ onclick="wppaTryAddCats( ' . $id . ' )"
1814
+ value="' . esc_attr( __( 'Add Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1815
+ />' );
1816
+ }
1817
 
1818
+ // Subalbums sequence
1819
+ if ( $has_children ) {
1820
+ wppa_album_sequence( $edit_id );
1821
+ }
1822
 
1823
+ // End Tab 2
1824
  wppa_echo( '
1825
  </div>' );
1826
 
1827
+
1828
+ // Tab 3: Album Actions
1829
  wppa_echo( '
1830
  <div
1831
+ id="albumactions-' . $id . '"
1832
  class="wppa-table-wrap wppa-tabcontent"
1833
+ style="width:100%;position:relative;display:none;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
1834
  >' );
1835
 
1836
  // Explanation
1837
  wppa_echo( '
1838
  <h2 class="description" style="margin:1em">' .
1839
+ __( 'The following buttons perform actions onto all items in this album', 'wp-photo-album-plus' ) . '
1840
  </h2>' );
1841
 
1842
+ // Apply default tags
1843
+ {
1844
+ wppa_echo( '
1845
+ <input
1846
+ type="button"
1847
+ class="wppa-admin-button button"
1848
+ title="' . esc_attr( __( 'Tag all photos in this album with the default tags.', 'wp-photo-album-plus' ) ) . '"
1849
+ onclick="wppaTryApplyDeftags( ' . $id . ' )"
1850
+ value="' . esc_attr( __( 'Apply default tags', 'wp-photo-album-plus' ) ) . '"
1851
+ />
1852
+ <input
1853
+ type="button"
1854
+ class="wppa-admin-button button"
1855
+ title="' . esc_attr( __( 'Add the default tags to all photos in this album.', 'wp-photo-album-plus' ) ) . '"
1856
+ onclick="wppaTryAddDeftags( ' . $id . ' )"
1857
+ value="' . esc_attr( __( 'Add default tags', 'wp-photo-album-plus' ) ) . '"
1858
+ />' );
1859
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1860
 
1861
+ // Schedule all
1862
+ {
1863
+ wppa_echo( '
1864
+ <input
1865
+ type="button"
1866
+ class="wppa-admin-button button"
1867
+ title="' . esc_attr( __( 'Schedule all photos in this album for later publishing.', 'wp-photo-album-plus' ) ) . '"
1868
+ onclick="wppaTryScheduleAll( ' . $id . ' )"
1869
+ value="' . esc_attr( __( 'Schedule all', 'wp-photo-album-plus' ) ) . '"
1870
+ />' );
1871
+ }
1872
 
1873
+ // Reset Ratings
1874
+ if ( wppa_switch( 'rating_on') ) {
1875
+ $onc = 'if (confirm(\'' . esc_js( __( 'Are you sure you want to clear the ratings in this album?', 'wp-photo-album-plus' ) ) . '\')) { wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'clear_ratings\', 0 ); }';
1876
+ wppa_echo( '
1877
+ <input
1878
+ type="button"
1879
+ class="wppa-admin-button button"
1880
+ onclick="' . $onc . '"
1881
+ value="' . esc_attr( __( 'Reset ratings', 'wp-photo-album-plus' ) ) . '"
1882
+ />' );
1883
+ }
 
 
 
 
 
1884
 
1885
+ // Apply New photo desc
1886
+ if ( wppa_switch( 'apply_newphoto_desc') ) {
1887
+ $onc = 'if ( confirm(\'Are you sure you want to set the description of all photos to \n\n'.esc_js(wppa_opt( 'newphoto_description')).'\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&applynewdesc=1\'';
1888
+ wppa_echo( '
1889
+ <input
1890
+ type="button"
1891
+ class="wppa-admin-button button"
1892
+ onclick="' . $onc . '"
1893
+ value="' . esc_attr( __( 'Apply new photo desc', 'wp-photo-album-plus' ) ) . '"
1894
+ />' );
1895
+ }
1896
 
1897
+ // Remake all
1898
+ if ( wppa_user_is( 'administrator' ) ) {
1899
+ $onc = 'if ( confirm(\'Are you sure you want to remake the files for all photos in this album?\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&remakealbum=1\'';
1900
+ wppa_echo( '
1901
+ <input
1902
+ type="button"
1903
+ class="wppa-admin-button button"
1904
+ onclick="' . $onc . '"
1905
+ value="' . esc_attr( __( 'Remake all', 'wp-photo-album-plus' ) ) . '"
1906
+ />' );
1907
+ }
 
 
 
 
 
1908
 
1909
+ // Set all to pano
1910
+ if ( wppa_switch( 'enable_panorama' ) ) {
1911
 
1912
+ wppa_echo( '
1913
+ <input
1914
+ type="button"
1915
+ class="wppa-admin-button button"
1916
+ onclick="wppaTrySetAllPanorama(' . $albuminfo['id'] . ')"
1917
+ value="' . esc_attr( __( 'Set all to panorama', 'wp-photo-album-plus' ) ).':"
1918
+ />
1919
+ <select id="pano-opt"
1920
+ style="">
1921
+ <option value="9" disabled selected>' . __( 'Select a mode', 'wp-photo-album-plus' ) . '</option>
1922
+ <option value="0">' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1923
+ <option value="1">' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1924
+ <option value="2">' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1925
+ </select>' );
1926
+ }
1927
 
1928
+ // End Tab 3
1929
  wppa_echo( '
1930
  </div>' );
1931
 
 
1932
  // End of outer details block
1933
  wppa_echo( '
1934
  </details>' );
3494
  }
3495
  }
3496
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3497
  // Check album order
3498
  if ( $albumorder_col != 'a_order' ) {
3499
  if ( $parent == '0') {
3509
  $result .= '<br>';
3510
 
3511
  wppa_echo( $result );
3512
+ return;
3513
  }
3514
 
 
 
3515
  $result = '
 
 
 
 
3516
  <h2 style="margin:1em">' .
3517
  __( 'Manage album order', 'wp-photo-album-plus' ) . '
3518
  -
3569
  </td>
3570
  </tr>
3571
  </tbody>
3572
+ </table>';
 
3573
  wppa_echo( $result );
3574
 
3575
 
3831
  $result .= '
3832
  </div>
3833
  <div style="clear:both;"></div>
 
3834
  </div>';
3835
 
3836
  wppa_echo( $result );
wppa-album-covers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
- * Version 8.2.03.002
7
  *
8
  */
9
 
@@ -15,7 +15,7 @@ function wppa_album_cover( $id ) {
15
 
16
  // Find the album specific cover type
17
  $cover_type = wppa_get_album_item( $id, 'cover_type' );
18
- wppa_log('obs', 'album covertype='.$cover_type);
19
  // No type specified (0), use default
20
  if ( ! $cover_type ) {
21
  $cover_type = wppa_opt( 'cover_type' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 8.2.02.002
7
  *
8
  */
9
 
15
 
16
  // Find the album specific cover type
17
  $cover_type = wppa_get_album_item( $id, 'cover_type' );
18
+
19
  // No type specified (0), use default
20
  if ( ! $cover_type ) {
21
  $cover_type = wppa_opt( 'cover_type' );
wppa-cache.php CHANGED
@@ -493,7 +493,7 @@ global $wpdb;
493
  <thead style="font-weight:bold">
494
  <tr>
495
  <td colspan="3" ><h3 style="margin:0.1em">' . __( 'File data', 'wp-photo-album-plus' ) . '</h3></td>
496
- <td colspan="4" style="border-left:1px solid #c3c4c7"><h3 style="margin:0.1em">' . __( 'Dependencies', 'wp-photo-album-plus' ) . '</h3></td>
497
  </tr>
498
  <tr>
499
  <td><b>' . __( 'Name', 'wp-photo-album-plus' ) . '</b></td>
493
  <thead style="font-weight:bold">
494
  <tr>
495
  <td colspan="3" ><h3 style="margin:0.1em">' . __( 'File data', 'wp-photo-album-plus' ) . '</h3></td>
496
+ <td colspan="4" style="border-left:1px solid #c3c4c7"><h3 style="margin:0.1em">' . __( 'Dependancies', 'wp-photo-album-plus' ) . '</h3></td>
497
  </tr>
498
  <tr>
499
  <td><b>' . __( 'Name', 'wp-photo-album-plus' ) . '</b></td>
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version: 8.2.03.003
7
  *
8
  */
9
 
@@ -902,7 +902,6 @@ global $photos_used;
902
  function wppa_you_can_not( $xaction, $xtype, $useless = true ) {
903
  $action = __( $xaction, 'wp-photo-album-plus' );
904
  $type = __( $xtype, 'wp-photo-album-plus' );
905
- /* translators: Example: You can not delay a single image shortcode display */
906
  $result = sprintf( __( 'You can not %1s a %2s shortcode display.', 'wp-photo-album-plus' ), $action, $type ) .
907
  ( $useless ? ' ' . __( 'It is useless anyway.', 'wp-photo-album-plus' ) : '' );
908
  wppa_log( 'dbg', $result );
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version: 8.2.02.003
7
  *
8
  */
9
 
902
  function wppa_you_can_not( $xaction, $xtype, $useless = true ) {
903
  $action = __( $xaction, 'wp-photo-album-plus' );
904
  $type = __( $xtype, 'wp-photo-album-plus' );
 
905
  $result = sprintf( __( 'You can not %1s a %2s shortcode display.', 'wp-photo-album-plus' ), $action, $type ) .
906
  ( $useless ? ' ' . __( 'It is useless anyway.', 'wp-photo-album-plus' ) : '' );
907
  wppa_log( 'dbg', $result );
wppa-functions.php CHANGED
@@ -3047,20 +3047,32 @@ function wppa_get_slide_desc( $id ) {
3047
 
3048
  function wppa_get_slide_name_a( $id ) {
3049
 
3050
- $name = '&nbsp;';
3051
- $fullname = '&nbsp;';
3052
  $alb = wppa_get_photo_item( $id, 'album' );
3053
  $disp = wppa_is_item_displayable( $alb, 'name', 'show_full_name' );
3054
 
3055
  if ( $disp && ( ! wppa( 'is_slideonly' ) || wppa( 'name_on' ) ) && ! wppa( 'is_filmonly' ) ) {
3056
  $name = esc_js( wppa_get_photo_name( $id ) );
3057
- $fullname = wppa_get_photo_name( $id, array( 'addowner' => wppa_switch( 'show_full_owner' ),
3058
- 'addmedal' => true,
3059
- 'escjs' => true,
3060
- 'showname' => true,
3061
- 'nobpdomain' => ( wppa_opt( 'art_monkey_link' ) != 'none' ),
3062
- ) );
 
 
 
 
 
 
 
 
 
 
 
3063
  }
 
3064
 
3065
  return array( 'name' => $name, 'fullname' => $fullname );
3066
  }
3047
 
3048
  function wppa_get_slide_name_a( $id ) {
3049
 
3050
+ $name = '';
3051
+ $fullname = '';
3052
  $alb = wppa_get_photo_item( $id, 'album' );
3053
  $disp = wppa_is_item_displayable( $alb, 'name', 'show_full_name' );
3054
 
3055
  if ( $disp && ( ! wppa( 'is_slideonly' ) || wppa( 'name_on' ) ) && ! wppa( 'is_filmonly' ) ) {
3056
  $name = esc_js( wppa_get_photo_name( $id ) );
3057
+ if ( ! $name ) {
3058
+ $name = '&nbsp;';
3059
+ }
3060
+ else {
3061
+ $fullname = wppa_get_photo_name( $id, array( 'addowner' => wppa_switch( 'show_full_owner' ),
3062
+ 'addmedal' => true,
3063
+ 'escjs' => true,
3064
+ 'showname' => true,
3065
+ 'nobpdomain' => ( wppa_opt( 'art_monkey_link' ) != 'none' ),
3066
+ ) );
3067
+ }
3068
+ if ( ! $fullname ) {
3069
+ $fullname = '&nbsp;';
3070
+ }
3071
+ }
3072
+ else {
3073
+ $fullname = 'void';
3074
  }
3075
+ $name;
3076
 
3077
  return array( 'name' => $name, 'fullname' => $fullname );
3078
  }
wppa-init.php CHANGED
@@ -333,7 +333,7 @@ global $wpdb;
333
  }
334
 
335
  function wppa_tag_message() {
336
- wppa_error_message( sprintf( __('The tags system needs to be converted. Please run <i>Photo Albums -> Settings -> %s</i>' , 'wp-photo-album-plus' ), wppa_setting_path( 'a', 'maintenance', '2', '22' ) ) );
337
  }
338
 
339
  function wppa_check_cat_system() {
@@ -356,7 +356,7 @@ global $wpdb;
356
  }
357
 
358
  function wppa_cat_message() {
359
- wppa_error_message( sprintf( __('The cats system needs to be converted. Please run <i>Photo Albums -> Settings -> %s</i>' , 'wp-photo-album-plus' ), wppa_setting_path( 'a', 'maintenance', '2', '23' ) ) );
360
  }
361
 
362
  // Print admin messages on config conflicts
333
  }
334
 
335
  function wppa_tag_message() {
336
+ wppa_error_message( __('The tags system needs to be converted. Please run <i>Photo Albums -> Settings -> Advanced settings -> Maintenance -> II -> Item 22</i>' , 'wp-photo-album-plus' ) );
337
  }
338
 
339
  function wppa_check_cat_system() {
356
  }
357
 
358
  function wppa_cat_message() {
359
+ wppa_error_message( __('The cats system needs to be converted. Please run <i>Photo Albums -> Settings -> Advanced settings -> Maintenance -> II -> Item 23</i>' , 'wp-photo-album-plus' ) );
360
  }
361
 
362
  // Print admin messages on config conflicts
wppa-maintenance.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
- * Version 8.2.03.002
7
  *
8
  */
9
 
@@ -227,7 +227,7 @@ global $wppa_endtime;
227
  break;
228
  case 'wppa_owner_to_name_proc':
229
  if ( ! wppa_switch( 'owner_to_name' ) ) {
230
- wppa_echo( __( 'Feature must be enabled in', 'wp-photo-album-plus' ) . ' ' . wppa_setting_path( 'a', 'system', 1, 32 ).'||'.$slug.'||||||' );
231
  wppa_exit();
232
  }
233
  break;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 8.2.02.005
7
  *
8
  */
9
 
227
  break;
228
  case 'wppa_owner_to_name_proc':
229
  if ( ! wppa_switch( 'owner_to_name' ) ) {
230
+ wppa_echo( __( 'Feature must be enabled in Advanced settings -> System -> I -> Item 32 Make owner like photoname first', 'wp-photo-album-plus' ).'||'.$slug.'||||||' );
231
  wppa_exit();
232
  }
233
  break;
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 8.2.03.002
7
  *
8
  */
9
 
@@ -69,7 +69,6 @@ global $wpdb;
69
  $page = wppa_get( 'wppa-page', '1' );
70
  if ( ! is_numeric( $page ) ) $page = 1;
71
  $skip = ( $page - '1' ) * $pagesize;
72
- $album_is_obvious = false;
73
 
74
  // Edit the photos in a specific album
75
  if ( $album ) {
@@ -103,7 +102,6 @@ global $wpdb;
103
 
104
  // A physical album
105
  else {
106
- $album_is_obvious = true;
107
  $counts = wppa_get_treecounts_a( $album, true );
108
  $count = $counts['selfphotos'] + $counts['pendselfphotos'] + $counts['scheduledselfphotos'];
109
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
@@ -259,7 +257,6 @@ global $wpdb;
259
  else {
260
 
261
  // Local js functions
262
- {
263
  $the_js = "
264
  function wppaTryMove( id, video ) {
265
 
@@ -444,10 +441,32 @@ function wppaTryScheduledel( id ) {
444
  wppaAjaxUpdatePhoto( id, 'removescheduledel', 0 );
445
  }
446
  }
447
- ";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
448
 
449
  wppa_add_inline_script( 'wppa-admin', $the_js );
450
- }
451
 
452
  $mvt = esc_attr( __( 'Move video', 'wp-photo-album-plus' ) );
453
  $mpt = esc_attr( __( 'Move photo', 'wp-photo-album-plus' ) );
@@ -566,20 +585,6 @@ function wppaTryScheduledel( id ) {
566
  // May user change photo sequence no?
567
  $may_change_porder = wppa_user_is( 'administrator' ) || ! wppa_switch( 'porder_restricted' );
568
 
569
- // Is there exif data?
570
- $exifs = $quick ? array() : $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_exif
571
- WHERE photo = %s
572
- ORDER BY tag, id", $id ), ARRAY_A );
573
-
574
- // Is there iptc data?
575
- $iptcs = $quick ? array() : $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_iptc
576
- WHERE photo = %s
577
- ORDER BY tag, id", $id ), ARRAY_A );
578
-
579
- // Are there comments?
580
- $comments = $quick ? array() : $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments
581
- WHERE photo = %s
582
- ORDER BY timestamp DESC ", $id ), ARRAY_A );
583
 
584
  // Anchor for scroll to
585
  wppa_echo( '<a id="photo_' . $id . '"></a>' );
@@ -600,7 +605,9 @@ function wppaTryScheduledel( id ) {
600
  value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '"
601
  />' );
602
 
603
- // Section 1: Preview thumbnail, photo name and stats
 
 
604
  {
605
  wppa_echo( '
606
  <div>' );
@@ -608,8 +615,7 @@ function wppaTryScheduledel( id ) {
608
  reset( $is_video );
609
  $big = str_replace( 'xxx', current( $is_video ), $big );
610
  wppa_echo( '
611
- <div style="float:left; margin-right: 20px;">
612
- <a
613
  href="' . esc_attr( $big ) . '"
614
  target="_blank"
615
  title="' . esc_attr( __( 'Preview fullsize video' , 'wp-photo-album-plus' ) ) . '"
@@ -621,8 +627,7 @@ function wppaTryScheduledel( id ) {
621
  'controls' => false,
622
  'use_thumb' => true
623
  ) ) . '
624
- </a>
625
- </div>' );
626
  }
627
  else {
628
  if ( $has_audio ) {
@@ -630,21 +635,19 @@ function wppaTryScheduledel( id ) {
630
  $big = wppa_get_photo_url( $id );
631
  }
632
  wppa_echo( '
633
- <div style="float:left; margin-right: 20px;">
634
- <a
635
- id="thumba-' . $id . '"
636
- href="' . esc_attr( $big ) . '"
637
- target="_blank"
638
- title="' . esc_attr( __( 'Preview fullsize photo', 'wp-photo-album-plus' ) ) . '"
639
- >
640
- <img
641
- id="thumburl-' . $id . '"' .
642
- ( wppa_lazy() && $count > '1' ? ' data-' : ' ' ) . 'src="' . esc_url( $src ) . '"
643
- alt="' . esc_attr( $name ) . '"
644
- style="max-width:160px;vertical-align:middle"
645
- />
646
- </a>
647
- </div>' );
648
 
649
  if ( $has_audio ) {
650
  $audio = wppa_get_audio_html( array( 'id' => $id,
@@ -660,693 +663,866 @@ function wppaTryScheduledel( id ) {
660
  '</span>' ) );
661
  }
662
  }
663
- wppa_echo( '<h1 style="display:inline;vertical-align:bottom;">' . wppa_get_photo_name( $id ) . '</h1>' );
 
 
 
664
 
665
- // Get the clicks, views and downloads stats
666
- {
667
- $th_1 = array();
668
- $td_1 = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
669
 
670
- // Clicks
671
- if ( wppa_switch( 'track_clickcounts' ) ) {
672
- $th_1[] = __( 'Clicks', 'wp-photo-album-plus' );
673
- $td_1[] = strval( intval( $clicks ) );
674
- }
 
 
 
 
 
 
 
675
 
676
- // Views
677
- if ( wppa_switch( 'track_viewcounts' ) ) {
678
- $th_1[] = __( 'Views', 'wp-photo-album-plus' );
679
- $td_1[] = strval( intval( $views ) );
 
 
680
  }
 
 
 
 
 
 
 
 
 
 
681
 
682
- // Downloads. Only photos are downloadable
683
- if ( ! wppa_is_multi( $id ) ) {
684
- $th_1[] = __( 'Downloads', 'wp-photo-album-plus' );
685
- $td_1[] = strval( intval( $dlcount ) );
686
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
687
  }
688
 
689
- // Get the rating stats
690
  {
691
- $th_2 = array();
692
- $td_2 = array();
693
-
694
- // Rating
695
- $entries = wppa_get_rating_count_by_id( $id );
696
- if ( $entries ) {
697
- if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
698
- $label = __( 'Likes', 'wp-photo-album-plus' );
699
- $value = strval( intval( $entries ) );
700
- }
701
- else {
702
- $label = __( 'Rating (#, avg)', 'wp-photo-album-plus' );
703
- $value = wppa_get_rating_by_id( $id, 'nolabel' );
704
- }
705
  }
706
  else {
707
- $label = __( 'Rating', 'wp-photo-album-plus' );
708
- $value = __( 'None', 'wp-photo-album-plus' );
709
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
710
 
711
- $th_2[] = $label;
712
- $td_2[] = $value;
 
 
 
 
 
 
 
 
 
 
 
713
 
714
- // Dislikes
715
- $dislikes = wppa_dislike_get( $id );
716
- if ( $dislikes ) {
717
- $th_2[] = __( 'Dislikes', 'wp-photo-album-plus' );
718
- $td_2[] = strval( intval( $dislikes ) );
719
- }
 
 
 
 
 
 
720
 
721
- // Pending votes
722
- $pending = wppa_pendrat_get( $id );
723
- if ( $pending ) {
724
- $th_2[] = __( 'Pending votes', 'wp-photo-album-plus' );
725
- $td_2[] = strval( intval( $pending ) );
726
- }
 
 
 
 
 
727
  }
728
 
729
- // Display the stats
730
  {
731
- $table = '<table>';
732
- $header = array(1 => array(), 2 => array());
733
- $rows = array(1 => array(), 2 => array());
734
-
735
- for($i=0, $limit = max(count($th_1), count($th_2)); $i < $limit; $i++) {
 
 
 
 
 
736
 
737
- $header[1][] .= isset($th_1[$i]) ? $th_1[$i] : '';
738
- $header[2][] .= isset($th_2[$i]) ? $th_2[$i] : '';
739
- $rows[1][] .= isset($td_1[$i]) ? $td_1[$i] : '';
740
- $rows[2][] .= isset($td_2[$i]) ? $td_2[$i] : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
741
 
 
 
 
 
 
 
 
 
 
 
 
 
742
  }
743
-
744
- $table .= '<thead><tr><th style="min-width: 100px; text-align: left;">' . implode('</th><th style="min-width: 100px; text-align: left;">', $header[1]) . '</th></tr></thead>';
745
- $table .= '<tbody><tr><td>' . implode('</td><td>', $rows[1]) . '</td></tr></tbody>';
746
- $table .= '<thead><tr><th style="text-align: left;">' . implode('</th><th style="text-align: left;">', $header[2]) . '</th></tr></thead>';
747
- $table .= '<tbody><tr><td>' . implode('</td><td>', $rows[2]) . '</td></tr></tbody>';
748
-
749
- $table .= '</table>';
750
-
751
- wppa_echo( $table );
752
  }
753
 
754
- wppa_echo( '
755
  </div>' );
756
  }
757
- // End Thumbnail area
758
-
759
- $details = __( 'Photo Details', 'wp-photo-album-plus' );
760
- if ( wppa_is_video( $id ) ) $details = __( 'Video Details', 'wp-photo-album-plus' );
761
- if ( wppa_is_pdf( $id ) ) $details = __( 'Document Details', 'wp-photo-album-plus' );
762
-
763
- // Open the details area
764
- wppa_echo( '
765
- <details class="wppa-toplevel-details">
766
- <summary class="toplevel wppa-summary-sublevel"> ' .
767
- $details . '
768
- </summary>' );
769
 
770
- // Update status field
771
  {
772
  wppa_echo( '
773
- <h3 style="margin-left:1em">' .
774
- __( 'Remark:', 'wp-photo-album-plus' ) . '
775
- <span
776
- id="remark-' . $id . '"
777
- style="font-weight:bold;color:#00AA00">' .
778
- ( $is_video ? sprintf( __( 'Video %s is not modified yet', 'wp-photo-album-plus' ), $id ) :
779
- sprintf( __( 'Photo %s is not modified yet', 'wp-photo-album-plus' ), $id ) ) . '
780
- </span>
781
- </h3>' );
782
- }
783
 
784
- // The tabs
785
- $ptitle = __( 'Photo', 'wp-photo-album-plus' );
786
- if ( wppa_is_video( $id ) ) $ptitle = __( 'Video', 'wp-photo-album-plus' );
787
- if ( wppa_is_pdf( $id ) ) $ptitle = __( 'Document', 'wp-photo-album-plus' );
788
- $result = '
789
- <div id="tabs" style="margin-bottom:23px">
790
- <ul class="widefat wppa-setting-tabs">
791
- <li class="wppa-photoadmin-tab-'.$id.' active" onclick="wppaChangePhotoAdminTab(this,\'#photogeneral-'.$id.'\','.$id.');">' . $ptitle . '</li>
792
- <li class="wppa-photoadmin-tab-'.$id.'" onclick="wppaChangePhotoAdminTab(this,\'#photofiles-'.$id.'\','.$id.');">' . __( 'Files', 'wp-photo-album-plus' ) . '</li>';
793
- if ( wppa_can_admin_magick( $id ) && ! $quick ) {
794
- $result .= '
795
- <li
796
- class="wppa-photoadmin-tab-'.$id.'"
797
- onclick="wppaChangePhotoAdminTab(this,\'#photomagic-'.$id.'\','.$id.');wppaInitMagick(\''.$id.'\');">' .
798
- __( 'ImageMagic', 'wp-photo-album-plus' ) . '
799
- </li>';
800
- }
801
- if ( ! $quick && ! empty( $exifs ) ) {
802
- $result .= '
803
- <li class="wppa-photoadmin-tab-'.$id.'" onclick="wppaChangePhotoAdminTab(this,\'#photoexif-'.$id.'\','.$id.');">' . __( 'EXIF', 'wp-photo-album-plus' ) . '</li>';
804
- }
805
- if ( ! $quick && ! empty( $iptcs ) ) {
806
- $result .= '
807
- <li class="wppa-photoadmin-tab-'.$id.'" onclick="wppaChangePhotoAdminTab(this,\'#photoiptc-'.$id.'\','.$id.');">' . __( 'IPTC', 'wp-photo-album-plus' ) . '</li>';
808
- }
809
- if ( ! $quick && ! empty( $comments ) ) {
810
- $result .= '
811
- <li class="wppa-photoadmin-tab-'.$id.'" onclick="wppaChangePhotoAdminTab(this,\'#photocomment-'.$id.'\','.$id.');">' . __( 'Comments', 'wp-photo-album-plus' ) . '</li>';
812
- }
813
- $result .= '
814
- </ul>
815
- <div style="clear:both"></div>
816
- </div>';
817
- wppa_echo( $result );
818
-
819
- // The script for the tabs to operate, we need this only once
820
- global $did_add_cpat;
821
- if ( ! $did_add_cpat ) {
822
- $the_js = '
823
- function wppaChangePhotoAdminTab(elm,tabId,itemId) {
824
- jQuery(".wppa-photoadmin-tab-"+itemId).removeClass(\'active\');
825
- jQuery(elm).addClass(\'active\');
826
- jQuery(".wppa-tabcontent-"+itemId).hide();
827
- jQuery(tabId).show();
828
- }';
829
- wppa_add_inline_script( 'wppa-admin', $the_js );
830
- $did_add_cpat = true;
831
- }
832
 
833
- // Tab 1 Photo general
834
- wppa_echo( '
835
- <div
836
- id="photogeneral-' . $id . '"
837
- class="wppa-table-wrap wppa-tabcontent-'.$id.'"
838
- style="position:relative;padding-bottom:12px;padding-left:12px;"
839
- >' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
840
 
841
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
842
  wppa_echo( '
843
- <div class="wppa-flex">' .
 
 
 
 
 
 
 
844
 
845
- // ID
846
- '<div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
847
  <label>' .
848
- __( 'Id', 'wp-photo-album-plus' ) . '
849
  </label><br>
850
  <div class="wppa-ldi">' .
851
- strval( intval( $id ) ) . '
852
  </div>
853
- </div>' .
 
854
 
855
- // Crypt
856
- '<div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
857
  <label>' .
858
- __( 'Crypt', 'wp-photo-album-plus' ) . '
859
  </label><br>
860
  <div class="wppa-ldi">' .
861
- htmlspecialchars( $crypt ) . '
862
  </div>
863
- </div>' .
 
864
 
865
- // Filename
866
- '<div style="max-width: 500px;">
 
 
 
 
867
  <label>' .
868
- __( 'Filename', 'wp-photo-album-plus' ) . '
869
  </label><br>
870
- <div class="wppa-ldi">' .
871
- htmlspecialchars( $filename ) . '
872
- </div>
873
- </div>' .
874
-
 
 
 
875
 
876
- // Upload
877
- '<div>
 
878
  <label>' .
879
- __( 'Upload', 'wp-photo-album-plus' ) . '
880
  </label><br>
881
- <div class="wppa-ldi">' .
882
- htmlspecialchars( wppa_local_date( '', $timestamp ) ) . '
883
- </div>
 
 
 
 
884
  </div>' );
885
 
886
- // Owner
887
- if ( ! $owner_editable ) {
 
 
 
 
 
 
 
 
 
 
888
  wppa_echo( '
889
  <div>
890
  <label>' .
891
- __( 'Owner', 'wp-photo-album-plus' ) . '
892
  </label><br>
893
  <div class="wppa-ldi">' .
894
- htmlspecialchars( $owner ) . '
895
  </div>
896
  </div>' );
897
  }
898
 
899
- $deleted = false;
900
- if ( $album <= '-9' ) {
901
- $album = - ( $album + '9' );
902
- $deleted = true;
903
  }
 
 
 
 
 
 
 
 
 
 
904
 
905
- // Album. Show album only when it is not evident
906
- if ( ! $album_is_obvious ) {
907
- wppa_echo( '
908
- <div style="max-width: 500px;margin-right: 4px;">
909
- <label>' .
910
- __( 'Album', 'wp-photo-album-plus' ) . '
911
- </label><br>
912
- <div class="wppa-ldi">' .
913
- htmlspecialchars( wppa_get_album_name( $album ) ) . '(' . strval( intval( $album ) ) . ')
914
- </div>
915
- </div>' );
916
  }
 
 
 
 
 
 
 
 
 
 
917
 
918
- // Modified
919
- {
920
- $txt = wppa_local_date( '', $modified );
921
- if ( $deleted ) $txt = __( 'Trashed', 'wp-photo-album-plus' );
922
- if ( $timestamp >= $modified ) $txt = __( 'Not modified', 'wp-photo-album-plus' );
923
- wppa_echo( '
924
- <div>
925
- <label>' .
926
- __( 'Modified', 'wp-photo-album-plus' ) . '
927
- </label><br>
928
- <div class="wppa-ldi">' .
929
- $txt . '
930
- </div>
931
- </div>' );
932
- }
933
 
934
- // Exif
935
- if ( ! wppa_user_is( 'administrator' ) ) {
936
- wppa_echo( '
937
- <div>
938
- <label>' .
939
- __( 'EXIF Date', 'wp-photo-album-plus' ) . '
940
- </label><br>
941
- <div class="wppa-ldi">' .
942
- esc_html( $exifdtm ) . '
943
- </div>
944
- </div>' );
945
- }
 
946
 
947
- // Location
948
- if ( $photo['location'] && ! wppa_switch( 'geo_edit' ) ) {
949
- $loc = $location ? $location : '///';
950
- $geo = explode( '/', $loc );
951
- wppa_echo( '
952
- <div>
953
- <label>' .
954
- __( 'Location:' , 'wp-photo-album-plus' ) . '
955
- </label>
956
- <div class="wppa-ldi">' .
957
- esc_html( $geo['0'].' '.$geo['1'].'. ' ) . '
958
- </div>
959
- </div>' );
960
- }
961
 
962
- // P_order
963
- if ( $sortby_orderno && ! $may_change_porder ) {
964
- wppa_echo( '
965
- <div>
966
- <label>' .
967
- __( 'Photo sort order #:', 'wp-photo-album-plus' ) . '
968
- </label>
969
- <div class="wppa-ldi">' .
970
- $p_order . '
971
- </div>
972
- </div>' );
973
- }
974
 
975
- // Status
976
- if ( ! $may_edit_status ) {
977
- if ( $status == 'pending' ) $s = __( 'Pending', 'wp-photo-album-plus' );
978
- elseif ( $status == 'publish' ) $s = __( 'Publish', 'wp-photo-album-plus' );
979
- elseif ( $status == 'featured' ) $s = __( 'Featured', 'wp-photo-album-plus' );
980
- elseif ( $status == 'gold' ) $s = __( 'Gold', 'wp-photo-album-plus' );
981
- elseif ( $status == 'silver' ) $s = __( 'Silver', 'wp-photo-album-plus' );
982
- elseif ( $status == 'bronze' ) $s = __( 'Bronze', 'wp-photo-album-plus' );
983
- elseif ( $status == 'scheduled' ) $s = __( 'Scheduled', 'wp-photo-album-plus' );
984
- elseif ( $status == 'private' ) $s = __( 'Private', 'wp-photo-album-plus' );
985
- wppa_echo( '
986
- <div>
987
- <label>' .
988
- __( 'Status', 'wp-photo-album-plus' ) . '
989
- </label>
990
- <div class="wppa-ldi">' .
991
- $s . '
992
- </div>
993
- </div>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
994
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
995
 
996
- // Schedule for delete
997
- if ( ! wppa_user_is( 'administrator' ) && $owner != wppa_get_user() ) {
998
- if ( $scheduledel ) {
 
 
 
 
999
  wppa_echo( '
1000
- <div>
1001
- <label>' .
1002
- __( 'Delete at', 'wp-photo-album-plus' ) . '
1003
- </label>
1004
- <div class="wppa-ldi">' .
1005
- wppa_get_date_time_select_html( 'delphoto', $id, false ) . '
1006
- </div>
1007
- </div>' );
 
 
1008
  }
1009
  }
1010
-
1011
- // End flex div
1012
- wppa_echo( '</div>' );
1013
  }
1014
 
1015
- // Tab 1 Section 2
1016
- wppa_echo( '
1017
- <div class="wppa-flex">' );
1018
-
1019
- // Owner
1020
- if ( $owner_editable ) {
1021
  wppa_echo( '
1022
  <div>
1023
  <label
1024
- for="owner-' . $id . '">' .
1025
- __( 'Owned by:', 'wp-photo-album-plus' ) . '
1026
  </label><br>
1027
- <input
1028
- id="owner-' . $id . '"
1029
- type="text"
1030
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'owner\', this.value )"
1031
- value="' . esc_attr( $owner ) . '"
1032
- />
 
1033
  </div>' );
1034
- }
1035
 
1036
- // Exif date-time
1037
- if ( wppa_user_is( 'administrator' ) ) { // Admin may edit exif date
1038
- wppa_echo( '
1039
- <div>
1040
- <label
1041
- for="exifdtm-' . $id . '">' .
1042
- __( 'EXIF Date:', 'wp-photo-album-plus' ) . '
1043
- </label><br>
1044
- <input
1045
- id="exifdtm-' . $id . '"
1046
- type="text"
1047
- style="width:125px"
1048
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'exifdtm\', this.value)"
1049
- value="' . esc_attr( $exifdtm ) . '"
1050
- />
1051
- </div>' );
 
 
 
 
 
 
 
 
 
 
1052
  }
 
1053
 
1054
- // Location
1055
- if ( wppa_switch( 'geo_edit' ) ) {
1056
- $loc = $location ? $location : '///';
1057
- $geo = explode( '/', $loc );
 
 
 
 
 
 
 
 
1058
  wppa_echo( '
1059
- <div>
1060
  <label
1061
- for="lat-' . $id . '">' .
1062
- __( 'Location Lat:' , 'wp-photo-album-plus' ) . esc_html( $geo['0'] ) . '
1063
  </label><br>
1064
- <input
1065
- id="lat-' . $id . '"
1066
- type="text"
1067
- style="width:100px"
1068
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lat\', this.value)"
1069
- value="' . esc_attr( $geo['2'] ) . '"
1070
- />
1071
  </div>
1072
  <div>
1073
  <label
1074
- for="lon-' . $id . '">' .
1075
- __( 'Location Lon:' , 'wp-photo-album-plus' ) . esc_html( $geo['1'] ) . '
1076
  </label><br>
1077
- <input
1078
- id="lon-' . $id . '"
1079
- type="text"
1080
- style="width:100px"
1081
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lon\', this.value)"
1082
- value="' . esc_attr( $geo['3'] ) . '"
1083
- />
1084
- </div>' );
1085
- }
1086
-
1087
- // Changeable p_order
1088
- if ( $sortby_orderno && $may_change_porder ) {
1089
- wppa_echo( '
1090
  <div>
1091
- <label
1092
- for="porder-' . $id . '">' .
1093
- __( 'Photo sort order #:', 'wp-photo-album-plus' ) . '
1094
  </label><br>
1095
  <input
1096
- type="text"
1097
- id="porder-' . $id . '"
1098
- value="' . esc_attr( $p_order ) . '"
1099
- style="width:100px"
1100
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'p_order\', this.value)"
 
 
 
 
 
1101
  />
1102
  </div>' );
1103
  }
1104
-
1105
- // Status
1106
- if ( $may_edit_status ) {
1107
- $sel = ' selected';
1108
- if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) {
1109
- $dis = ' disabled';
1110
- }
1111
- else {
1112
- $dis = '';
1113
- }
1114
- wppa_echo( '
1115
- <div>
1116
- <label
1117
- for="status-' . $id . '">' .
1118
- __( 'Status' , 'wp-photo-album-plus' ) . '
1119
- </label><br>
1120
- <select
1121
- id="status-' . $id . '"
1122
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'status\', this.value); wppaPhotoStatusChange( ' . $id . ' )">
1123
- <option value="pending"' . ( $status == 'pending' ? $sel : '' ) . ' >' .
1124
- __( 'Pending', 'wp-photo-album-plus' ) . '
1125
- </option>
1126
- <option value="publish"' . ( $status =='publish' ? $sel : '' ) . ' >' .
1127
- __( 'Publish', 'wp-photo-album-plus' ) . '
1128
- </option>
1129
- <option value="featured"' . ( $status == 'featured' ? $sel : '' ) . $dis . ' >' .
1130
- __( 'Featured', 'wp-photo-album-plus' ) . '
1131
- </option>
1132
- <option value="gold"' . ( $status == 'gold' ? $sel : '' ) . $dis . ' >' .
1133
- __( 'Gold', 'wp-photo-album-plus' ) . '
1134
- </option>
1135
- <option value="silver"' . ( $status == 'silver' ? $sel : '' ) . $dis . ' >' .
1136
- __( 'Silver', 'wp-photo-album-plus' ) . '
1137
- </option>
1138
- <option value="bronze"' . ( $status == 'bronze' ? $sel : '' ) . $dis . ' >' .
1139
- __( 'Bronze', 'wp-photo-album-plus' ) . '
1140
- </option>
1141
- <option value="scheduled"' . ( $status == 'scheduled' ? $sel : '' ) . $dis . ' >' .
1142
- __( 'Scheduled', 'wp-photo-album-plus' ) . '
1143
- </option>
1144
- <option value="private"' . ( $status == 'private' ? $sel : '' ) . $dis . ' >' .
1145
- __( 'Private', 'wp-photo-album-plus' ) . '
1146
- </option>
1147
- </select>' .
1148
- wppa_get_date_time_select_html( 'photo', $id, true ) . '
1149
-
1150
- </div>' );
1151
  }
 
 
1152
 
1153
- // Stereo
1154
- if ( wppa_switch( 'enable_stereo' ) && ! $is_multi ) {
 
1155
  wppa_echo( '
1156
- <div style="max-width:250px;">
1157
  <label
1158
- for="stereo-' . $id . '">' .
1159
- __( 'Stereophoto', 'wp-photo-album-plus' ) . '
1160
  </label><br>
1161
- <select
1162
- id="stereo-' . $id . '"
1163
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'stereo\', this.value, true)"
1164
- >
1165
- <option value="0"' . ( $stereo == '0' ? ' selected' : '' ) . '>' .
1166
- __( 'No stereo image', 'wp-photo-album-plus' ) . '
1167
- </option>
1168
- <option value="1"' . ( $stereo == '1' ? ' selected' : '' ) . '>' .
1169
- __( 'Left - right stereo image', 'wp-photo-album-plus' ) . '
1170
- </option>
1171
- <option value="-1"' . ( $stereo == '-1' ? ' selected' : '' ) . '>' .
1172
- __( 'Right - left stereo image', 'wp-photo-album-plus' ) . '
1173
- </option>
1174
- </select>
1175
  </div>' );
1176
-
1177
- /*
1178
- __( 'Images:', 'wp-photo-album-plus' ) . ' ' );
1179
-
1180
- $files = wppa_glob( WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*' );
1181
-
1182
- if ( empty( $files ) ) {
1183
- wppa_echo( __( 'None', 'wp-photo-album-plus' ) . '. ' );
1184
- }
1185
- else {
1186
- sort( $files );
1187
- $c = 0;
1188
- foreach ( $files as $file ) {
1189
- wppa_echo( '
1190
- <a href="' . str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $file ) . '" target="_blank">' .
1191
- basename( $file ) . '
1192
- </a>' );
1193
- $c++;
1194
- if ( $c == count( $files ) ) {
1195
- wppa_echo( '. ' );
1196
- }
1197
- else {
1198
- wppa_echo( ', ' );
1199
- }
1200
- }
1201
- }
1202
- wppa_echo( $br );
1203
- */
1204
- }
1205
-
1206
- // Panorama
1207
- if ( wppa_switch( 'enable_panorama' ) && ! $b_is_video ) {
1208
- $can_panorama = $photoy && $photox / $photoy >= 1.999;
1209
- if ( $can_panorama ) {
1210
- wppa_echo( '
1211
- <div>
1212
- <label
1213
- for="panorama-' . $id . '">' .
1214
- __( 'Panorama', 'wp-photo-album-plus' ) . '
1215
- </label><br>
1216
- <select
1217
- id="panorama-' . $id . '"
1218
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'panorama\', this.value, true )">
1219
- <option value="0"' . ( $panorama == '0' ? ' selected' : '' ) . '>' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1220
- <option value="1"' . ( $panorama == '1' ? ' selected' : '' ) . '>' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1221
- <option value="2"' . ( $panorama == '2' ? ' selected' : '' ) . '>' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1222
- </select>
1223
- </div>' );
1224
-
1225
- $source_file = wppa_get_source_path( $id );
1226
- if ( wppa_is_file( $source_file ) ) {
1227
- $source_file_sizes = wppa_getimagesize( $source_file );
1228
-
1229
- if ( $panorama == '1' && $source_file_sizes[0] / $source_file_sizes[1] > 2.001 ) {
1230
- $t = array( 120, 150, 180, 210, 240, 270, 300, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450 );
1231
- wppa_echo( '
1232
- <div>
1233
- <label
1234
- for="make360-' . $id . '">' .
1235
- __( 'Make 360 from', 'wp-photo-album-plus' ) . '
1236
- </label><br>
1237
- <select
1238
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'make360\', this.value, true)"
1239
- id="make360-' . $id . '"
1240
- title="' . esc_attr( __( 'Select the closest angle you originally made the panorama', 'wp-photo-album-plus' ) ) . '">
1241
- <option value="">'.__('Select', 'wp-photo-album-plus' ).'</option>' );
1242
- foreach( $t as $v ) {
1243
- wppa_echo( '<option value="'.$v.'" '.($v==$angle?'selected':'').'>'.$v.'&deg;</option>' );
1244
- }
1245
- wppa_echo( '
1246
- <option value="0">' . __( 'Undo', 'wp-photo-album-plus' ) . '</option>
1247
- </select>
1248
- </div>' );
1249
- }
1250
- }
1251
- }
1252
- }
1253
-
1254
- // Watermark
1255
- if ( wppa_switch( 'watermark_on' ) ) {
1256
-
1257
- // Get the current watermark file settings
1258
- $temp = wppa_get_water_file_and_pos( $id );
1259
- $wmfile = isset( $temp['file'] ) ? $temp['file'] : '';
1260
- $wmpos = isset( $temp['pos'] ) && isset ( $wms[$temp['pos']] ) ? $wms[$temp['pos']] : '';
1261
-
1262
- $user = wppa_get_user();
1263
- $has_source = wppa_is_file( wppa_get_source_path( $id ) );
1264
- $can_remove = ( wppa_opt( 'watermark_file' ) == '--- none ---' ) ? '1' : '0';
1265
- if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) {
1266
- wppa_echo( '
1267
- <div style="max-width:250px;">
1268
- <label
1269
- for="wmfsel_' . $id . '">' .
1270
- __( 'Watermark', 'wp-photo-album-plus' ) . '
1271
- </label><br>
1272
- <select
1273
- id="wmfsel_' . $id . '"
1274
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_file_' . $user . '\', this.value)"
1275
- >' .
1276
- wppa_watermark_file_select( 'user', $album ) . '
1277
- </select>
1278
- </div>
1279
- <div>
1280
- <label
1281
- for="wmpsel_' . $id . '">' .
1282
- __( 'Position', 'wp-photo-album-plus' ) . '
1283
- </label><br>
1284
- <select
1285
- id="wmpsel_' . $id . '"
1286
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_pos_' . $user . '\', this.value)"
1287
- >' .
1288
- wppa_watermark_pos_select( 'user', $album ) . '
1289
- </select>
1290
- </div>
1291
- <div>
1292
- <label>
1293
- &nbsp;
1294
- </label><br>
1295
- <input
1296
- type="button"
1297
- class="button wppa-admin-button"
1298
- value="' . esc_attr( __( 'Apply watermark', 'wp-photo-album-plus' ) ) . '"
1299
- onclick="wppaTryWatermark( ' . $id . ', ' . $has_source . ', ' . $can_remove . ' )"
1300
- />
1301
- <img
1302
- id="wppa-water-spin-' . $id . '"
1303
- src="' . wppa_get_imgdir() . 'spinner.gif"
1304
- alt="Spin"
1305
- style="visibility:hidden"
1306
- />
1307
- </div>' );
1308
- }
1309
- /*
1310
- elseif ( basename( $wmfile ) != '--- none ---' ) {
1311
- wppa_echo(
1312
- __( 'Watermark:', 'wp-photo-album-plus' ) . ' ' .
1313
- __( 'File:', 'wp-photo-album-plus' ) . ' ' . strip_tags( basename( $wmfile ) ) . ' ' .
1314
- __( 'Pos:', 'wp-photo-album-plus' ) . ' ' . strip_tags( $wmpos ) );
1315
- }
1316
- */
1317
  }
 
1318
 
1319
- // Schedule for delete
1320
- if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
1321
- if ( $may_change_delete ) {
1322
- wppa_echo( '
1323
- <div style="max-width: 500px;">
1324
- <label
1325
- for="scheduledel-' . $id . '">' .
1326
- __( 'Delete at', 'wp-photo-album-plus' ) . '
1327
- </label><br>
1328
- <input
1329
- type="checkbox"
1330
- id="scheduledel-' . $id . '"' .
1331
- ( $scheduledel ? ' checked' : '' ) .
1332
- ( $may_change_delete ? '' : ' disabled' ) . '
1333
- onchange="wppaTryScheduledel( ' . $id . ' )"
1334
- /> ' .
1335
- wppa_get_date_time_select_html( 'delphoto', $id, true ) . '
1336
- </div>' );
1337
- }
1338
- }
1339
-
1340
-
1341
-
1342
- // End Tab1 Section 2
1343
- wppa_echo( '</div>' );
1344
-
1345
- wppa_echo( '<span id="psdesc-' . $id . '" class="description" style="margin-left:12px;display:none">' .
1346
- __( 'Note: Featured photos should have a descriptive name; a name a search engine will look for!', 'wp-photo-album-plus' ) . '
1347
- </span>' );
1348
-
1349
-
1350
 
1351
  wppa_echo( '
1352
  <!-- Section 3, Actions -->
@@ -1479,15 +1655,49 @@ function wppaTryScheduledel( id ) {
1479
  }
1480
  }
1481
 
1482
- // Delete
1483
- if ( wppa_user_is( 'administrator' ) || wppa_get_photo_item( $id, 'owner' ) == wppa_get_user() ) {
1484
- if ( ! wppa( 'front_edit' ) ) {
1485
- wppa_echo( '
1486
- <div>
1487
- <label>
1488
- &nbsp;
1489
- </label><br>
1490
- <input
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1491
  type="button"
1492
  class="wppa-admin-button button"
1493
  style="color:' . ( $deleted ? 'green' : 'red' ) . '"
@@ -1550,15 +1760,364 @@ function wppaTryScheduledel( id ) {
1550
  </div>' );
1551
  }
1552
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1553
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1554
 
 
 
1555
 
1556
  // Section 4
1557
  wppa_echo( '
1558
  <!-- Section 4 -->
1559
  <table
1560
  class="wppa-table wppa-photo-table"
1561
- style="width:100%;margin-top:20px"
1562
  >
1563
  <tbody>' );
1564
 
@@ -1953,721 +2512,78 @@ function wppaTryScheduledel( id ) {
1953
  </tbody>
1954
  </table>' );
1955
 
 
1956
 
1957
- wppa_echo( '
1958
- </div>' );
1959
-
1960
-
1961
-
1962
- // End Tab 1
1963
- wppa_echo( '</div>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1964
 
1965
- // Tab 2 Files
1966
- {
1967
- wppa_echo( '
1968
- <div
1969
- id="photofiles-' . $id . '"
1970
- class="wppa-table-wrap wppa-tabcontent-'.$id.'"
1971
- style="position:relative;padding-bottom:12px;padding-left:12px;display:none"
1972
- >' );
1973
 
1974
- {
1975
- wppa_echo( '
1976
- <div class="wppa-flex">' );
 
 
 
 
 
 
 
 
 
 
 
1977
 
1978
- // Pdf
1979
- if ( wppa_is_pdf( $id ) ) {
1980
- $sp = wppa_get_source_path( $id );
1981
- $fs = wppa_get_filesize( $sp );
1982
  wppa_echo( '
1983
- <div>
1984
- <label>' .
1985
- __( 'Document file', 'wp-photo-album-plus' ) . '
1986
- </label><br>
1987
- <div class="wppa-ldi">' .
1988
- $fs . '
1989
- </div>
1990
- </div>' );
1991
- }
1992
-
1993
- // Source
1994
- $sp = wppa_get_o1_source_path( $id );
1995
- if ( ! wppa_is_file( $sp ) ) {
1996
- $sp = wppa_get_source_path( $id );
1997
- }
1998
- if ( wppa_is_pdf( $id ) ) {
1999
- $sp = wppa_strip_ext( $sp ) . '.jpg';
2000
- if ( ! wppa_is_file( $sp ) ) {
2001
- $sp = wppa_strip_ext( $sp ) . '.png';
2002
- }
2003
- }
2004
- if ( is_file( $sp ) ) {
2005
- $ima = getimagesize( $sp );
2006
- $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $sp ) . '.' . $br;
2007
- }
2008
- else {
2009
- $txt = __( 'Unavailable', 'wp-photo-album-plus' );
2010
- }
2011
- wppa_echo( '
2012
- <div style="max-width:300px">
2013
- <label>' .
2014
- __( 'Source file', 'wp-photo-album-plus' ) . '
2015
- </label><br>
2016
- <div class="wppa-ldi">' .
2017
- $txt . '
2018
- </div>
2019
- </div>' );
2020
-
2021
- // Display
2022
- if ( $is_video || $has_audio ) {
2023
- $lbl = __( 'Poster file', 'wp-photo-album-plus' );
2024
- }
2025
- else {
2026
- $lbl = __( 'Display file', 'wp-photo-album-plus' );
2027
- }
2028
- $dp = wppa_get_photo_path( $id );
2029
- if ( is_file( $dp ) ) {
2030
- $txt = '
2031
- <span id="photox-' . $id . '">' . wppa_get_photox( $id ) . '</span> x
2032
- <span id="photoy-' . $id . '">' . wppa_get_photoy( $id ) . '</span>:
2033
- (<span id="photofilesize-' . $id . '">' . wppa_get_filesize( $dp ) . '</span>)';
2034
- }
2035
- else {
2036
- $txt = '
2037
- <span style="color:red">' .
2038
- __( 'Unavailable', 'wp-photo-album-plus' ) . '
2039
- </span>';
2040
- }
2041
- wppa_echo( '
2042
- <div style="max-width:300px">
2043
- <label>' .
2044
- $lbl . '
2045
- </label><br>
2046
- <div class="wppa-ldi">' .
2047
- $txt . '
2048
- </div>
2049
- </div>' );
2050
-
2051
- // Thumbnail
2052
- if ( ! $is_video ) {
2053
- $lbl = __( 'Thumbnail file', 'wp-photo-album-plus' );
2054
- $tp = wppa_get_thumb_path( $id );
2055
- if ( is_file( $tp ) ) {
2056
- $txt = '
2057
- <span id="thumbx-' . $id . '">' . wppa_get_thumbx( $id ) . '</span> x
2058
- <span id="thumby-' . $id . '">' . wppa_get_thumby( $id ) . '</span>:
2059
- (<span id="thumbfilesize-' . $id . '">' . wppa_get_filesize( $tp ) . '</span>)
2060
- &nbsp;
2061
- <input
2062
- type="checkbox"' .
2063
- ( $thumblock ? ' checked' : '' ) . '
2064
- onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'thumblock\', jQuery(this).prop(\'checked\') ? 1 : 0 )" /> ' .
2065
- __( 'Locked', 'wp-photo-album-plus' );
2066
- }
2067
- else {
2068
- $txt = '
2069
- <span style="color:red">' .
2070
- __( 'Unavailable', 'wp-photo-album-plus' ) . '.
2071
- </span>';
2072
- }
2073
- wppa_echo( '
2074
- <div style="max-width:300px">
2075
- <label>' .
2076
- $lbl . '
2077
- </label><br>
2078
- <div class="wppa-ldi">' .
2079
- $txt . '
2080
- </div>
2081
- </div>' );
2082
- }
2083
-
2084
- // Local CDN
2085
- if ( wppa_cdn( 'admin' ) == 'local' ) {
2086
- $lbl = __( 'Local CDN files', 'wp-photo-album-plus' );
2087
- $txt = '<span id="cdnfiles-' . $id . '">';
2088
-
2089
- $files = wppa_cdn_files( $id );
2090
- if ( !empty( $files ) ) {
2091
- foreach( $files as $file ) {
2092
- if ( basename( $file ) != 'index.php' ) {
2093
- $t = explode( '.', basename( $file ) );
2094
- $t = explode( '-', $t[0] );
2095
- $x = $t[0];
2096
- $y = $t[1];
2097
- $size = filesize( $file );
2098
- $txt .= '
2099
- <a
2100
- href="' . wppa_cdn_url( $id, $x, $y ) . '"
2101
- target="_blank"
2102
- >' .
2103
- basename( $file ) .
2104
- '</a> ' .
2105
- sprintf( '%4.2fkB', $size / 1024 ) . '<br>';
2106
- }
2107
- }
2108
- }
2109
- else {
2110
- $txt .= __( 'None', 'wp-photo-album-plus' );
2111
- }
2112
- $txt .= '</span>';
2113
- wppa_echo( '
2114
- <div>
2115
- <label>' .
2116
- $lbl . '
2117
- </label><br>
2118
- <div class="wppa-ldi">' .
2119
- $txt . '
2120
- </div>
2121
- </div>' );
2122
- }
2123
-
2124
- // Video
2125
- if ( $b_is_video ) {
2126
-
2127
- // Width
2128
- wppa_echo( '
2129
- <div>
2130
- <label>' .
2131
- __( 'Video width', 'wp-photo-album-plus' ) . '
2132
- </label><br>
2133
- <input
2134
- type="text"
2135
- style="width:50px;margin:0 4px"
2136
- onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videox\', this.value)"
2137
- value="' . esc_attr( $videox ) . '"
2138
- />px
2139
- <br>' . sprintf( __( '(0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_width' ) ) . '
2140
- </div>' );
2141
-
2142
- // Height
2143
- wppa_echo( '
2144
- <div>
2145
- <label>' .
2146
- __( 'Video height', 'wp-photo-album-plus' ) . '
2147
- </label><br>
2148
- <input
2149
- type="text"
2150
- style="width:50px;margin:0 4px"
2151
- onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videoy\', this.value)"
2152
- value="' . esc_attr( $videoy ) . '"
2153
- />px
2154
- <br>' . sprintf( __( '(0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_height' ) ) . '
2155
- </div>' );
2156
-
2157
- // Duratiuon
2158
- if ( $duration ) {
2159
- $lbl = __( 'Duration', 'wp-photo-album-plus' );
2160
- $duration = intval( $duration * 100 ) / 100;
2161
- if ( $duration < 120.0 ) {
2162
- $txt = sprintf( __( '%s seconds', 'wp-photo-album-plus' ) ,$duration );
2163
- }
2164
- else {
2165
- $txt = sprintf( __( '%s minutes and %s seconds', 'wp-photo-album-plus' ),
2166
- sprintf( '%d', floor( $duration / 60 ) ),
2167
- sprintf( '%4.2f', $duration % 60 ) );
2168
- }
2169
- wppa_echo( '
2170
- <div>
2171
- <label>' .
2172
- $lbl . '
2173
- </label><br>
2174
- <div class="wppa-ldi">' .
2175
- $txt . '
2176
- </div>
2177
- </div>' );
2178
- }
2179
-
2180
- // Formats
2181
- $txt = '';
2182
- foreach ( $is_video as $fmt ) {
2183
- $txt .= $fmt . ' (' . wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . ')<br>';
2184
- }
2185
- wppa_echo( '
2186
- <div>
2187
- <label>' .
2188
- __( 'Formats', 'wp-photo-album-plus' ) . '
2189
- </label><br>
2190
- <div class="wppa-ldi">' .
2191
- $txt . '
2192
- </div>
2193
- </div>' );
2194
- }
2195
-
2196
- // Audio
2197
- if ( $b_has_audio ) {
2198
- $txt = '';
2199
- foreach ( $has_audio as $fmt ) {
2200
- $txt .= $fmt . ' (' . wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . ')<br>';
2201
- }
2202
- wppa_echo( '
2203
- <div>
2204
- <label>' .
2205
- __( 'Formats', 'wp-photo-album-plus' ) . '
2206
- </label><br>
2207
- <div class="wppa-ldi">' .
2208
- $txt . '
2209
- </div>
2210
- </div>' );
2211
- }
2212
-
2213
- // End flex div
2214
- wppa_echo( '</div>' );
2215
-
2216
- wppa_echo( '<div class="wppa-flex">' );
2217
-
2218
- // Remake displayfiles
2219
- if ( ! $is_video ) {
2220
- wppa_echo( '
2221
- <div>
2222
- <label>
2223
- &nbsp;
2224
- </label><br>
2225
- <input
2226
- type="button"
2227
- class="wppa-admin-button button"
2228
- title="' . esc_attr( __( 'Remake display file and thumbnail file', 'wp-photo-album-plus' ) ) . '"
2229
- onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remake\', 0 )"
2230
- value="' . esc_attr( __( 'Remake files', 'wp-photo-album-plus' ) ) . '"
2231
- />
2232
- </div>' );
2233
- }
2234
-
2235
- // Remake thumbnail
2236
- if ( ! $is_video ) {
2237
- wppa_echo( '
2238
- <div style="max-width:500px;">
2239
- <label>
2240
- &nbsp;
2241
- </label><br>
2242
- <input
2243
- type="button"
2244
- class="wppa-admin-button button"
2245
- title="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
2246
- onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remakethumb\', 0 )"
2247
- value="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
2248
- />
2249
- </div>' );
2250
- }
2251
-
2252
- // End flex div
2253
- wppa_echo( '</div>' );
2254
-
2255
- // End Tab 2
2256
- wppa_echo( '</div>' );
2257
- }
2258
- }
2259
-
2260
- // Tab 3 ImageMagick
2261
- if ( wppa_can_admin_magick( $id ) && ! $quick ) {
2262
- wppa_echo( '
2263
- <div
2264
- id="photomagic-' . $id . '"
2265
- class="wppa-table-wrap wppa-tabcontent-'.$id.'"
2266
- style="position:relative;padding-bottom:12px;padding-left:12px;display:none"
2267
- >' );
2268
-
2269
- {
2270
-
2271
- // Explanation
2272
- wppa_echo( '
2273
- <h2 class="description" style="margin:1em">' .
2274
- __( 'The operations are executed upon the display file.', 'wp-photo-album-plus' ) . ' ' .
2275
- __( 'A new thumbnail image will be created from the display file.', 'wp-photo-album-plus' ) . '
2276
- </h2>' );
2277
-
2278
- // --- Actions ---
2279
- wppa_echo( '
2280
- <div class="wppa-flex">' );
2281
-
2282
- {
2283
- // Rotate left
2284
- wppa_echo( '
2285
- <input
2286
- type="button"
2287
- class="wppa-admin-button button"
2288
- onclick="wppaTryMagick( ' . $id . ', \'magickrotleft\' )"
2289
- value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus' ) ) . '"
2290
- />' );
2291
-
2292
- // Rotat 180
2293
- wppa_echo( '
2294
- <input
2295
- type="button"
2296
- class="wppa-admin-button button"
2297
- onclick="wppaTryMagick( ' . $id . ', \'magickrot180\' )"
2298
- value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus' ) ) . '"
2299
- />' );
2300
-
2301
- // Rotate right
2302
- wppa_echo( '
2303
- <input
2304
- type="button"
2305
- class="wppa-admin-button button"
2306
- onclick="wppaTryMagick( ' . $id . ', \'magickrotright\' )"
2307
- value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus' ) ) . '"
2308
- />' );
2309
-
2310
- // Flip
2311
- wppa_echo( '
2312
- <input
2313
- type="button"
2314
- class="wppa-admin-button button"
2315
- onclick="wppaTryMagick( ' . $id . ', \'magickflip\' )"
2316
- value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus' ) ) . '&thinsp;&#8212;"
2317
- title="-flip"
2318
- />' );
2319
-
2320
- // Flop
2321
- wppa_echo( '
2322
- <input
2323
- type="button"
2324
- class="wppa-admin-button button"
2325
- onclick="wppaTryMagick( ' . $id . ', \'magickflop\' )"
2326
- value="' . esc_attr( __( 'Flop', 'wp-photo-album-plus' ) ) . ' |"
2327
- title="-flop"
2328
- />' );
2329
-
2330
- // Enhance
2331
- wppa_echo( '
2332
- <input
2333
- type="button"
2334
- class="wppa-admin-button button"
2335
- onclick="wppaTryMagick( ' . $id . ', \'enhance\' )"
2336
- value="' . esc_attr( __( 'Enhance', 'wp-photo-album-plus' ) ) . '"
2337
- title="-enhance"
2338
- />' );
2339
-
2340
- // Sharpen
2341
- wppa_echo( '
2342
- <input
2343
- type="button"
2344
- class="wppa-admin-button button"
2345
- onclick="wppaTryMagick( ' . $id . ', \'sharpen\' )"
2346
- value="' . esc_attr( __( 'Sharpen', 'wp-photo-album-plus' ) ) . '"
2347
- title="-sharpen 0x1"
2348
- />' );
2349
-
2350
- // Blur
2351
- wppa_echo( '
2352
- <input
2353
- type="button"
2354
- class="wppa-admin-button button"
2355
- onclick="wppaTryMagick( ' . $id . ', \'blur\' )"
2356
- value="' . esc_attr( __( 'Blur', 'wp-photo-album-plus' ) ) . '"
2357
- title="-blur 0x1"
2358
- />' );
2359
-
2360
- // Auto gamma
2361
- wppa_echo( '
2362
- <input
2363
- type="button"
2364
- class="wppa-admin-button button"
2365
- onclick="wppaTryMagick( ' . $id . ', \'auto-gamma\' )"
2366
- value="' . esc_attr( __( 'Auto Gamma', 'wp-photo-album-plus' ) ) . '"
2367
- title="-auto-gamma"
2368
- />' );
2369
-
2370
- // Auto level
2371
- wppa_echo( '
2372
- <input
2373
- type="button"
2374
- class="wppa-admin-button button"
2375
- onclick="wppaTryMagick( ' . $id . ', \'auto-level\' )"
2376
- value="' . esc_attr( __( 'Auto Level', 'wp-photo-album-plus' ) ) . '"
2377
- title="-auto-level"
2378
- />' );
2379
-
2380
- // Contrast+
2381
- wppa_echo( '
2382
- <input
2383
- type="button"
2384
- class="wppa-admin-button button"
2385
- onclick="wppaTryMagick( ' . $id . ', \'contrast-p\' )"
2386
- value="' . esc_attr( __( 'Contrast+', 'wp-photo-album-plus' ) ) . '"
2387
- title="-brightness-contrast 0x5"
2388
- />' );
2389
-
2390
- // Contrast-
2391
- wppa_echo( '
2392
- <input
2393
- type="button"
2394
- class="wppa-admin-button button"
2395
- onclick="wppaTryMagick( ' . $id . ', \'contrast-m\' )"
2396
- value="' . esc_attr( __( 'Contrast-', 'wp-photo-album-plus' ) ) . '"
2397
- title="-brightness-contrast 0x-5"
2398
- />' );
2399
-
2400
- // Brightness+
2401
- wppa_echo( '
2402
- <input
2403
- type="button"
2404
- class="wppa-admin-button button"
2405
- onclick="wppaTryMagick( ' . $id . ', \'brightness-p\' )"
2406
- value="' . esc_attr( __( 'Brightness+', 'wp-photo-album-plus' ) ) . '"
2407
- title="-brightness-contrast 5"
2408
- />' );
2409
-
2410
- // Brightness-
2411
- wppa_echo( '
2412
- <input
2413
- type="button"
2414
- class="wppa-admin-button button"
2415
- onclick="wppaTryMagick( ' . $id . ', \'brightness-m\' )"
2416
- value="' . esc_attr( __( 'Brightness-', 'wp-photo-album-plus' ) ) . '"
2417
- title="-brightness-contrast -5"
2418
- />' );
2419
-
2420
- // Despeckle
2421
- wppa_echo( '
2422
- <input
2423
- type="button"
2424
- class="wppa-admin-button button"
2425
- onclick="wppaTryMagick( ' . $id . ', \'despeckle\' )"
2426
- value="' . esc_attr( __( 'Despeckle', 'wp-photo-album-plus' ) ) . '"
2427
- title="-despeckle"
2428
- />' );
2429
-
2430
- // Lenear gray
2431
- wppa_echo( '
2432
- <input
2433
- type="button"
2434
- class="wppa-admin-button button"
2435
- onclick="wppaTryMagick( ' . $id . ', \'lineargray\' )"
2436
- value="' . esc_attr( __( 'Linear gray', 'wp-photo-album-plus' ) ) . '"
2437
- title="-colorspace gray"
2438
- />' );
2439
-
2440
- // Non-linear gray
2441
- wppa_echo( '
2442
- <input
2443
- type="button"
2444
- class="wppa-admin-button button"
2445
- onclick="wppaTryMagick( ' . $id . ', \'nonlineargray\' )"
2446
- value="' . esc_attr( __( 'Non-linear gray', 'wp-photo-album-plus' ) ) . '"
2447
- title="-grayscale Rec709Luma"
2448
- />' );
2449
-
2450
- // Charcoal
2451
- wppa_echo( '
2452
- <input
2453
- type="button"
2454
- class="wppa-admin-button button"
2455
- onclick="wppaTryMagick( ' . $id . ', \'charcoal\' )"
2456
- value="' . esc_attr( __( 'Charcoal', 'wp-photo-album-plus' ) ) . '"
2457
- title="-charcoal"
2458
- />' );
2459
-
2460
- // Paint
2461
- wppa_echo( '
2462
- <input
2463
- type="button"
2464
- class="wppa-admin-button button"
2465
- onclick="wppaTryMagick( ' . $id . ', \'paint\' )"
2466
- value="' . esc_attr( __( 'Paint', 'wp-photo-album-plus' ) ) . '"
2467
- title="-paint"
2468
- />' );
2469
-
2470
- // Sepia
2471
- wppa_echo( '
2472
- <input
2473
- type="button"
2474
- class="wppa-admin-button button"
2475
- onclick="wppaTryMagick( ' . $id . ', \'sepia\' )"
2476
- value="' . esc_attr( __( 'Sepia', 'wp-photo-album-plus' ) ) . '"
2477
- title="-sepia-tone 80%"
2478
- />' );
2479
-
2480
- // Show/hide wppa-horizon
2481
- wppa_echo( '
2482
- <input
2483
- type="button"
2484
- class="wppa-admin-button button"
2485
- onclick="wppaToggleHorizon()"
2486
- value="' . esc_attr( 'Show/hide horizon', 'wp-photo-album-plus' ) . '"
2487
- title="' . esc_attr( 'Toggle horizon reference line on/off', 'wp-photo-album-plus' ) . '"
2488
- />' );
2489
-
2490
- // Anticlock 0.5 deg
2491
- wppa_echo( '
2492
- <input
2493
- type="button"
2494
- class="wppa-admin-button button"
2495
- onclick="wppaTryMagick( ' . $id . ', \'skyleft\' )"
2496
- value="' . esc_attr( '0.5&deg;', 'wp-photo-album-plus' ) . '"
2497
- title="' . esc_attr( 'Rotate image by 0.5&deg; anticlockwise', 'wp-photo-album-plus' ) . '"
2498
- />' );
2499
-
2500
- // Clockwise 0.5 deg
2501
- wppa_echo( '
2502
- <input
2503
- type="button"
2504
- class="wppa-admin-button button"
2505
- onclick="wppaTryMagick( ' . $id . ', \'skyright\' )"
2506
- value="' . esc_attr( '-0.5&deg;', 'wp-photo-album-plus' ) . '"
2507
- title="' . esc_attr( 'Rotate image by 0.5&deg; clockwise', 'wp-photo-album-plus' ) . '"
2508
- />' );
2509
-
2510
- // Crop
2511
- wppa_echo( '
2512
- <input
2513
- type="button"
2514
- class="wppa-admin-button button"
2515
- id="button-' . $id . '"
2516
- value="Crop"
2517
- title=""
2518
- />' );
2519
-
2520
- // Set cropbox aspect ratio
2521
- $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
2522
- $dflt = wppa_opt( 'image_magick_ratio' );
2523
-
2524
- wppa_echo( '
2525
- <select
2526
- onchange="wppaCropper[' . $id . '].setAspectRatio(this.value)"
2527
- title="' . __( 'Aspect ratio of cropped image', 'wp-photo-album-plus' ) . '"
2528
- >
2529
- <option value="NaN"' . ( $dflt == 'NaN' ? ' selected' : '' ) . '>' . __( 'free', 'wp-photo-album-plus' ) . '</option>
2530
- <option value="' . $ratio . '"' . ( $dflt == 'ratio' ? ' selected' : '' ) . '>' . __( 'original', 'wp-photo-album-plus' ) . '</option>
2531
- <option value="1"' . ( $dflt == '1' ? ' selected' : '' ) . '>' . __( 'square', 'wp-photo-album-plus' ) . '</option>
2532
- <option value="1.25"' . ( $dflt == '1.25' ? ' selected' : '' ) . '>4:5 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2533
- <option value="1.33333"' . ( $dflt == '1.33333' ? ' selected' : '' ) . '>3:4 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2534
- <option value="1.5"' . ( $dflt == '1.5' ? ' selected' : '' ) . '>2:3 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2535
- <option value="1.6"' . ( $dflt == '1.6' ? ' selected' : '' ) . '>5:8 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2536
- <option value="1.77777"' . ( $dflt == '1.77777' ? ' selected' : '' ) . '>9:16 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2537
- <option value="2"' . ( $dflt == '2' ? ' selected' : '' ) . '>1:2 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2538
- <option value="0.8"' . ( $dflt == '0.8' ? ' selected' : '' ) . '>4:5 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2539
- <option value="0.75"' . ( $dflt == '0.75' ? ' selected' : '' ) . '>3:4 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2540
- <option value="0.66667"' . ( $dflt == '0.66667' ? ' selected' : '' ) . '>2:3 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2541
- <option value="0.625"' . ( $dflt == '0.625' ? ' selected' : '' ) . '>5:8 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2542
- <option value="0.5625"' . ( $dflt == '0.5625' ? ' selected' : '' ) . '>9:16 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2543
- <option value="0.5"' . ( $dflt == '0.5' ? ' selected' : '' ) . '>1:2 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2544
- </select>' . $br );
2545
-
2546
- if ( $dflt == 'ratio' ) {
2547
- $value = $ratio;
2548
- }
2549
- elseif ( $dflt == 'free' ) {
2550
- $value = '';
2551
- }
2552
- else {
2553
- $value = $dflt;
2554
- }
2555
-
2556
- // $the_js = 'jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});';
2557
- // wppa_add_inline_script( 'wppa-admin', $the_js );
2558
- }
2559
-
2560
- // End flex div
2561
- wppa_echo( '</div>' );
2562
-
2563
- // Command stack
2564
- wppa_echo( '
2565
- <h2 class="description" style="margin:1em">' .
2566
- __( '<b>ImageMagick</b> command stack', 'wp-photo-album-plus' ) . ':
2567
- <span
2568
- id="magickstack-' . strval( intval( $id ) ). '"
2569
- style="color:blue"
2570
- >' .
2571
- sanitize_text_field( $magickstack ) . '
2572
- </span>
2573
- <input
2574
- type="button"
2575
- class="wppa-admin-button button"
2576
- id="imstackbutton-' . strval( intval( $id ) ) . '"
2577
- onclick="wppaTryMagick( ' . strval( intval( $id ) ) . ', \'magickundo\' )"
2578
- value="' . esc_attr( __( 'Undo', 'wp-photo-album-plus' ) ) . '"
2579
- title="' . esc_attr( __( 'Undo last Magick command', 'wp-photo-album-plus' ) ) . '"
2580
- style="margin-left:4px;' . ( $magickstack ? 'display:inline;' : 'display:none;' ) . '"
2581
- />
2582
- </h2>' );
2583
-
2584
- // Cropper container
2585
- // Fake 'for social media' to use the local file here, not cloudinary. Files from cloudinary do not reload, even with ?ver=...
2586
- wppa( 'for_sm', true );
2587
- wppa_echo( '
2588
- <div
2589
- class="wppa-cropper-container-wrapper">
2590
- <img
2591
- id="fs-img-' . $id . '"
2592
- src="' . esc_url( wppa_get_photo_url( $id ) ) . '"
2593
- style="float:left;max-width:100%"
2594
- />
2595
- </div>' );
2596
-
2597
- // Reset switch
2598
- wppa( 'for_sm', false );
2599
- }
2600
-
2601
- // End Tab 3
2602
- wppa_echo( '</div>' );
2603
- }
2604
-
2605
-
2606
-
2607
-
2608
- // Tab 5 Photo IPTC
2609
- if ( ! $quick && ! empty( $iptcs ) ) {
2610
-
2611
- wppa_echo( '
2612
- <div
2613
- id="photoiptc-' . $id . '"
2614
- class="wppa-table-wrap wppa-tabcontent-'.$id.'"
2615
- style="position:relative;padding-bottom:12px;padding-left:12px;display:none"
2616
- >' );
2617
-
2618
- wppa_echo( '
2619
- <table
2620
- id="wppa-iptc-' . $id . '"
2621
- class="wppa-table wppa-photo-table"
2622
- style="clear:both;width:99%;"
2623
- >
2624
- <thead>
2625
- <tr style="font-weight:bold">
2626
- <td style="padding:0 4px">' . __( 'IPTC tag', 'wp-photo-album-plus' ) . '</td>
2627
- <td style="padding:0 4px">' . __( 'Description', 'wp-photo-album-plus' ) . '</td>
2628
- <td style="padding:0 4px">' . __( 'Value', 'wp-photo-album-plus' ) . '</td>
2629
- </tr>
2630
- </thead>
2631
- <tbody>' );
2632
-
2633
- foreach ( $iptcs as $iptc ) {
2634
- wppa_echo( '
2635
- <tr id="iptc-tr-' . $iptc['id'] . '">
2636
- <td style="padding:0 4px">' . $iptc['tag'] . '</td>
2637
- <td style="padding:0 4px">' . esc_html( wppa_iptc_tagname( $iptc['tag'] ) ) . ':</td>
2638
- <td style="padding:0 4px">
2639
- <input
2640
- type="text"
2641
- style="width:500px"
2642
- value="' . esc_attr( $iptc['description'] ) . '"
2643
- onchange="wppaAjaxUpdateIptc(\'' . $id . '\', \'' . $iptc['id'] . '\', this.value, \'' . $iptc['tag'] . '\')"
2644
- />
2645
- </td>
2646
- </tr>' );
2647
- }
2648
-
2649
- wppa_echo( '
2650
- </tbody>
2651
- </table>' );
2652
- wppa_echo( '</div>' ); // End tab 5 IPTC
2653
- }
2654
-
2655
- // Tab 4 Photo EXIF
2656
- if ( ! $quick && ! empty( $exifs ) ) {
2657
-
2658
- wppa_echo( '
2659
- <div
2660
- id="photoexif-' . $id . '"
2661
- class="wppa-table-wrap wppa-tabcontent-'.$id.'"
2662
- style="position:relative;padding-bottom:12px;padding-left:12px;display:none"
2663
- >' );
2664
 
 
 
 
 
 
 
2665
  $brand = wppa_get_camera_brand( $id );
2666
  wppa_echo( '
 
 
 
 
 
 
 
2667
  <table
2668
  id="wppa-exif-' . $id . '"
2669
  class="wppa-table wppa-photo-table"
2670
- style="clear:both;width:99%;"
2671
  >
2672
  <thead>
2673
  <tr style="font-weight:bold">
@@ -2680,57 +2596,55 @@ function wppaTryScheduledel( id ) {
2680
  </thead>
2681
  <tbody>' );
2682
 
2683
- foreach ( $exifs as $exif ) {
2684
- $desc = $exif['description'];
2685
- if ( is_serialized( $desc ) ) {
2686
- $desc = 'Array(' . count( wppa_unserialize( $desc ) ) . ')';
2687
- }
2688
- wppa_echo( '
2689
- <tr id="exif-tr-' . $exif['id'] . '">
2690
- <td style="padding:0 4px">'.$exif['tag'].'</td>' );
2691
-
2692
- if ( $brand && $exif['brand'] ) {
2693
- wppa_echo( '
2694
- <td style="padding:0 4px">' . $brand . '</td>
2695
- <td style="padding:0 4px">' . wppa_exif_tagname( $exif['tag'], $brand, 'brandonly' ) . ':</td>' );
2696
  }
2697
- else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2698
  wppa_echo( '
2699
- <td style="padding:0 4px"></td>
2700
- <td style="padding:0 4px">' . wppa_exif_tagname( $exif['tag'] ) . ':</td>' );
2701
- }
2702
 
2703
- $raw_value = wp_kses( $desc, 'post' );
2704
- if ( strlen( $raw_value ) > 50 ) {
2705
- $raw_value = substr( $raw_value, 0, 47 ) . '...';
2706
- }
2707
- $formatted_value = wp_kses( wppa_format_exif( $exif['tag'], $exif['description'], $brand ), 'post' );
2708
- if ( strlen( $formatted_value ) > 50 ) {
2709
- $formatted_value = substr( $formatted_value, 0, 47 ) . '...';
2710
- }
2711
- wppa_echo( '
2712
- <td style="padding:0 4px">' . $raw_value . '</td>
2713
- <td style="padding:0 4px">' . $formatted_value . '</td>
2714
- </tr>' );
2715
- }
2716
 
2717
  wppa_echo( '
2718
  </tbody>
2719
- </table><div style="clear:both"></div>' );
2720
- wppa_echo( '</div>' );
2721
  }
2722
 
 
2723
 
2724
  // Comments
2725
- if ( ! $quick && ! empty( $comments ) ) {
2726
-
2727
- wppa_echo( '
2728
- <div
2729
- id="photocomment-' . $id . '"
2730
- class="wppa-table-wrap wppa-tabcontent-'.$id.'"
2731
- style="position:relative;padding-bottom:12px;padding-left:12px;display:none"
2732
- >' );
2733
-
2734
  wppa_echo( '
2735
  <table
2736
  class="wppa-table wppa-photo-table"
@@ -2786,21 +2700,19 @@ function wppaTryScheduledel( id ) {
2786
 
2787
  wppa_echo( '
2788
  </tbody>
2789
- </table>
2790
- <div class="clear"></div>
2791
- </div>' );
2792
  }
2793
- // }
2794
 
2795
  wppa_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange('.$id.');' );
2796
 
2797
  wppa_echo( '
2798
- <div class="clear"></div>
2799
  </div>
2800
- <div class="clear" style="margin-top:7px"></div>' );
2801
  }
2802
  /* End the actual display area for the photo settings */
2803
- wppa_echo( '</details>');
2804
  } /* foreach photo */
2805
 
2806
  wppa_admin_page_links( $page, $pagesize, $count, $link );
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 8.2.02.010
7
  *
8
  */
9
 
69
  $page = wppa_get( 'wppa-page', '1' );
70
  if ( ! is_numeric( $page ) ) $page = 1;
71
  $skip = ( $page - '1' ) * $pagesize;
 
72
 
73
  // Edit the photos in a specific album
74
  if ( $album ) {
102
 
103
  // A physical album
104
  else {
 
105
  $counts = wppa_get_treecounts_a( $album, true );
106
  $count = $counts['selfphotos'] + $counts['pendselfphotos'] + $counts['scheduledselfphotos'];
107
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
257
  else {
258
 
259
  // Local js functions
 
260
  $the_js = "
261
  function wppaTryMove( id, video ) {
262
 
441
  wppaAjaxUpdatePhoto( id, 'removescheduledel', 0 );
442
  }
443
  }
444
+
445
+ function wppaToggleIptc( id, count ) {
446
+
447
+ if ( jQuery( '#wppa-iptc-' + id ).css( 'display' ) == 'none' ) {
448
+ jQuery( '#wppa-iptc-' + id ).show();
449
+ jQuery( '#wppa-iptc-button-' + id ).val( '" . esc_js( __( 'Hide', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'IPTC items', 'wp-photo-album-plus' ) ) . "' );
450
+ }
451
+ else {
452
+ jQuery( '#wppa-iptc-' + id ).hide();
453
+ jQuery( '#wppa-iptc-button-' + id ).val( '" . esc_js( __( 'Show', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'IPTC items', 'wp-photo-album-plus' ) ) . "' );
454
+ }
455
+ }
456
+
457
+ function wppaToggleExif( id, count ) {
458
+
459
+ if ( jQuery( '#wppa-exif-' + id ).css( 'display' ) == 'none' ) {
460
+ jQuery( '#wppa-exif-' + id ).show();
461
+ jQuery( '#wppa-exif-button-' + id ).val( '" . esc_js( __( 'Hide', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'EXIF items', 'wp-photo-album-plus' ) ) . "' );
462
+ }
463
+ else {
464
+ jQuery( '#wppa-exif-' + id ).hide();
465
+ jQuery( '#wppa-exif-button-' + id ).val( '" . esc_js( __( 'Show', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'EXIF items', 'wp-photo-album-plus' ) ) . "' );
466
+ }
467
+ }";
468
 
469
  wppa_add_inline_script( 'wppa-admin', $the_js );
 
470
 
471
  $mvt = esc_attr( __( 'Move video', 'wp-photo-album-plus' ) );
472
  $mpt = esc_attr( __( 'Move photo', 'wp-photo-album-plus' ) );
585
  // May user change photo sequence no?
586
  $may_change_porder = wppa_user_is( 'administrator' ) || ! wppa_switch( 'porder_restricted' );
587
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
588
 
589
  // Anchor for scroll to
590
  wppa_echo( '<a id="photo_' . $id . '"></a>' );
605
  value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '"
606
  />' );
607
 
608
+ // Section 1
609
+
610
+ // -- Preview thumbnail and photo name ---
611
  {
612
  wppa_echo( '
613
  <div>' );
615
  reset( $is_video );
616
  $big = str_replace( 'xxx', current( $is_video ), $big );
617
  wppa_echo( '
618
+ <a
 
619
  href="' . esc_attr( $big ) . '"
620
  target="_blank"
621
  title="' . esc_attr( __( 'Preview fullsize video' , 'wp-photo-album-plus' ) ) . '"
627
  'controls' => false,
628
  'use_thumb' => true
629
  ) ) . '
630
+ </a>' );
 
631
  }
632
  else {
633
  if ( $has_audio ) {
635
  $big = wppa_get_photo_url( $id );
636
  }
637
  wppa_echo( '
638
+ <a
639
+ id="thumba-' . $id . '"
640
+ href="' . esc_attr( $big ) . '"
641
+ target="_blank"
642
+ title="' . esc_attr( __( 'Preview fullsize photo', 'wp-photo-album-plus' ) ) . '"
643
+ >
644
+ <img
645
+ id="thumburl-' . $id . '"' .
646
+ ( wppa_lazy() && $count > '1' ? ' data-' : ' ' ) . 'src="' . esc_url( $src ) . '"
647
+ alt="' . esc_attr( $name ) . '"
648
+ style="max-width:160px;vertical-align:middle"
649
+ />
650
+ </a>' );
 
 
651
 
652
  if ( $has_audio ) {
653
  $audio = wppa_get_audio_html( array( 'id' => $id,
663
  '</span>' ) );
664
  }
665
  }
666
+ wppa_echo( '<h1 style="display:inline;margin-left:20px;vertical-align:bottom;">' . wppa_get_photo_name( $id ) . '</h1>' );
667
+ wppa_echo( '
668
+ </div>' );
669
+ }
670
 
671
+ // --- More or less static data ---
672
+ {
673
+ wppa_echo( '
674
+ <div class="wppa-flex">' .
675
+
676
+ // ID
677
+ '<div>
678
+ <label>' .
679
+ __( 'Id', 'wp-photo-album-plus' ) . '
680
+ </label><br>
681
+ <div class="wppa-ldi">' .
682
+ strval( intval( $id ) ) . '
683
+ </div>
684
+ </div>' .
685
+
686
+ // Crypt
687
+ '<div>
688
+ <label>' .
689
+ __( 'Crypt', 'wp-photo-album-plus' ) . '
690
+ </label><br>
691
+ <div class="wppa-ldi">' .
692
+ htmlspecialchars( $crypt ) . '
693
+ </div>
694
+ </div>' .
695
+
696
+ // Filename
697
+ '<div style="max-width: 500px;">
698
+ <label>' .
699
+ __( 'Filename', 'wp-photo-album-plus' ) . '
700
+ </label><br>
701
+ <div class="wppa-ldi">' .
702
+ htmlspecialchars( $filename ) . '
703
+ </div>
704
+ </div>' .
705
+
706
+ // Upload
707
+ '<div>
708
+ <label>' .
709
+ __( 'Upload', 'wp-photo-album-plus' ) . '
710
+ </label><br>
711
+ <div class="wppa-ldi">' .
712
+ htmlspecialchars( wppa_local_date( '', $timestamp ) ) . '
713
+ </div>
714
+ </div>' );
715
 
716
+ // Owner
717
+ if ( ! $owner_editable ) {
718
+ wppa_echo( '
719
+ <div>
720
+ <label>' .
721
+ __( 'Owner', 'wp-photo-album-plus' ) . '
722
+ </label><br>
723
+ <div class="wppa-ldi">' .
724
+ htmlspecialchars( $owner ) . '
725
+ </div>
726
+ </div>' );
727
+ }
728
 
729
+ // Album
730
+ {
731
+ $deleted = false;
732
+ if ( $album <= '-9' ) {
733
+ $album = - ( $album + '9' );
734
+ $deleted = true;
735
  }
736
+ wppa_echo( '
737
+ <div style="max-width: 500px;margin-right: 4px;">
738
+ <label>' .
739
+ __( 'Album', 'wp-photo-album-plus' ) . '
740
+ </label><br>
741
+ <div class="wppa-ldi">' .
742
+ htmlspecialchars( wppa_get_album_name( $album ) ) . '(' . strval( intval( $album ) ) . ')
743
+ </div>
744
+ </div>' );
745
+ }
746
 
747
+ // Modified
748
+ {
749
+ $txt = wppa_local_date( '', $modified );
750
+ if ( $deleted ) $txt = __( 'Trashed', 'wp-photo-album-plus' );
751
+ if ( $timestamp >= $modified ) $txt = __( 'Not modified', 'wp-photo-album-plus' );
752
+ wppa_echo( '
753
+ <div>
754
+ <label>' .
755
+ __( 'Modified', 'wp-photo-album-plus' ) . '
756
+ </label><br>
757
+ <div class="wppa-ldi">' .
758
+ $txt . '
759
+ </div>
760
+ </div>' );
761
+ }
762
+
763
+ // Exif
764
+ if ( ! wppa_user_is( 'administrator' ) ) {
765
+ wppa_echo( '
766
+ <div>
767
+ <label>' .
768
+ __( 'EXIF Date', 'wp-photo-album-plus' ) . '
769
+ </label><br>
770
+ <div class="wppa-ldi">' .
771
+ esc_html( $exifdtm ) . '
772
+ </div>
773
+ </div>' );
774
+ }
775
+
776
+ // Location
777
+ if ( $photo['location'] && ! wppa_switch( 'geo_edit' ) ) {
778
+ $loc = $location ? $location : '///';
779
+ $geo = explode( '/', $loc );
780
+ wppa_echo( '
781
+ <div>
782
+ <label>' .
783
+ __( 'Location:' , 'wp-photo-album-plus' ) . '
784
+ </label>
785
+ <div class="wppa-ldi">' .
786
+ esc_html( $geo['0'].' '.$geo['1'].'. ' ) . '
787
+ </div>
788
+ </div>' );
789
+ }
790
+
791
+ // P_order
792
+ if ( $sortby_orderno && ! $may_change_porder ) {
793
+ wppa_echo( '
794
+ <div>
795
+ <label>' .
796
+ __( 'Photo sort order #:', 'wp-photo-album-plus' ) . '
797
+ </label>
798
+ <div class="wppa-ldi">' .
799
+ $p_order . '
800
+ </div>
801
+ </div>' );
802
  }
803
 
804
+ // Rating
805
  {
806
+ $entries = wppa_get_rating_count_by_id( $id );
807
+ if ( $entries ) {
808
+ if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
809
+ $label = __( 'Likes', 'wp-photo-album-plus' );
810
+ $value = strval( intval( $entries ) );
 
 
 
 
 
 
 
 
 
811
  }
812
  else {
813
+ $label = __( 'Rating (#, avg)', 'wp-photo-album-plus' );
814
+ $value = wppa_get_rating_by_id( $id, 'nolabel' );
815
  }
816
+ }
817
+ else {
818
+ $label = __( 'Rating', 'wp-photo-album-plus' );
819
+ $value = __( 'None', 'wp-photo-album-plus' );
820
+ }
821
+ wppa_echo( '
822
+ <div>
823
+ <label>' .
824
+ $label . '
825
+ </label>
826
+ <div class="wppa-ldi">' .
827
+ $value . '
828
+ </div>
829
+ </div>' );
830
+ }
831
+
832
+ // Dislikes
833
+ $dislikes = wppa_dislike_get( $id );
834
+ if ( $dislikes ) {
835
+ wppa_echo( '
836
+ <div>
837
+ <label>' .
838
+ __( 'Dislikes', 'wp-photo-album-plus' ) . '
839
+ </label>
840
+ <div class="wppa-ldi">' .
841
+ strval( intval( $dislikes ) ) . '
842
+ </div>
843
+ </div>' );
844
+ }
845
 
846
+ // Pending votes
847
+ $pending = wppa_pendrat_get( $id );
848
+ if ( $pending ) {
849
+ wppa_echo( '
850
+ <div>
851
+ <label>' .
852
+ __( 'Pending votes', 'wp-photo-album-plus' ) . '
853
+ </label>
854
+ <div class="wppa-ldi">' .
855
+ strval( intval( $pending ) ) . '
856
+ </div>
857
+ </div>' );
858
+ }
859
 
860
+ // Views
861
+ if ( wppa_switch( 'track_viewcounts' ) ) {
862
+ wppa_echo( '
863
+ <div>
864
+ <label>' .
865
+ __( 'Views', 'wp-photo-album-plus' ) . '
866
+ </label>
867
+ <div class="wppa-ldi">' .
868
+ strval( intval( $views ) ) . '
869
+ </div>
870
+ </div>' );
871
+ }
872
 
873
+ // Clicks
874
+ if ( wppa_switch( 'track_clickcounts' ) ) {
875
+ wppa_echo( '
876
+ <div>
877
+ <label>' .
878
+ __( 'Clicks', 'wp-photo-album-plus' ) . '
879
+ </label>
880
+ <div class="wppa-ldi">' .
881
+ strval( intval( $clicks ) ) . '
882
+ </div>
883
+ </div>' );
884
  }
885
 
886
+ // Downloads
887
  {
888
+ wppa_echo( '
889
+ <div>
890
+ <label>' .
891
+ __( 'Downloads', 'wp-photo-album-plus' ) . '
892
+ </label>
893
+ <div class="wppa-ldi">' .
894
+ strval( intval( $dlcount ) ) . '
895
+ </div>
896
+ </div>' );
897
+ }
898
 
899
+ // Status
900
+ if ( ! $may_edit_status ) {
901
+ if ( $status == 'pending' ) $s = __( 'Pending', 'wp-photo-album-plus' );
902
+ elseif ( $status == 'publish' ) $s = __( 'Publish', 'wp-photo-album-plus' );
903
+ elseif ( $status == 'featured' ) $s = __( 'Featured', 'wp-photo-album-plus' );
904
+ elseif ( $status == 'gold' ) $s = __( 'Gold', 'wp-photo-album-plus' );
905
+ elseif ( $status == 'silver' ) $s = __( 'Silver', 'wp-photo-album-plus' );
906
+ elseif ( $status == 'bronze' ) $s = __( 'Bronze', 'wp-photo-album-plus' );
907
+ elseif ( $status == 'scheduled' ) $s = __( 'Scheduled', 'wp-photo-album-plus' );
908
+ elseif ( $status == 'private' ) $s = __( 'Private', 'wp-photo-album-plus' );
909
+ wppa_echo( '
910
+ <div>
911
+ <label>' .
912
+ __( 'Status', 'wp-photo-album-plus' ) . '
913
+ </label>
914
+ <div class="wppa-ldi">' .
915
+ $s . '
916
+ </div>
917
+ </div>' );
918
+ }
919
 
920
+ // Schedule for delete
921
+ if ( ! wppa_user_is( 'administrator' ) && $owner != wppa_get_user() ) {
922
+ if ( $scheduledel ) {
923
+ wppa_echo( '
924
+ <div>
925
+ <label>' .
926
+ __( 'Delete at', 'wp-photo-album-plus' ) . '
927
+ </label>
928
+ <div class="wppa-ldi">' .
929
+ wppa_get_date_time_select_html( 'delphoto', $id, false ) . '
930
+ </div>
931
+ </div>' );
932
  }
 
 
 
 
 
 
 
 
 
933
  }
934
 
935
+ wppa_echo( '
936
  </div>' );
937
  }
 
 
 
 
 
 
 
 
 
 
 
 
938
 
939
+ // --- Available files ---
940
  {
941
  wppa_echo( '
942
+ <div class="wppa-flex">' );
 
 
 
 
 
 
 
 
 
943
 
944
+ // Pdf
945
+ if ( wppa_is_pdf( $id ) ) {
946
+ $sp = wppa_get_source_path( $id );
947
+ $fs = wppa_get_filesize( $sp );
948
+ wppa_echo( '
949
+ <div>
950
+ <label>' .
951
+ __( 'Document file', 'wp-photo-album-plus' ) . '
952
+ </label><br>
953
+ <div class="wppa-ldi">' .
954
+ $fs . '
955
+ </div>
956
+ </div>' );
957
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
958
 
959
+ // Source
960
+ $sp = wppa_get_o1_source_path( $id );
961
+ if ( ! wppa_is_file( $sp ) ) {
962
+ $sp = wppa_get_source_path( $id );
963
+ }
964
+ if ( wppa_is_pdf( $id ) ) {
965
+ $sp = wppa_strip_ext( $sp ) . '.jpg';
966
+ if ( ! wppa_is_file( $sp ) ) {
967
+ $sp = wppa_strip_ext( $sp ) . '.png';
968
+ }
969
+ }
970
+ if ( is_file( $sp ) ) {
971
+ $ima = getimagesize( $sp );
972
+ $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $sp ) . '.' . $br;
973
+ }
974
+ else {
975
+ $txt = __( 'Unavailable', 'wp-photo-album-plus' );
976
+ }
977
+ wppa_echo( '
978
+ <div style="max-width:300px">
979
+ <label>' .
980
+ __( 'Source file', 'wp-photo-album-plus' ) . '
981
+ </label><br>
982
+ <div class="wppa-ldi">' .
983
+ $txt . '
984
+ </div>
985
+ </div>' );
986
 
987
+ // Display
988
+ if ( $is_video || $has_audio ) {
989
+ $lbl = __( 'Poster file', 'wp-photo-album-plus' );
990
+ }
991
+ else {
992
+ $lbl = __( 'Display file', 'wp-photo-album-plus' );
993
+ }
994
+ $dp = wppa_get_photo_path( $id );
995
+ if ( is_file( $dp ) ) {
996
+ $txt = '
997
+ <span id="photox-' . $id . '">' . wppa_get_photox( $id ) . '</span> x
998
+ <span id="photoy-' . $id . '">' . wppa_get_photoy( $id ) . '</span>:
999
+ (<span id="photofilesize-' . $id . '">' . wppa_get_filesize( $dp ) . '</span>)';
1000
+ }
1001
+ else {
1002
+ $txt = '
1003
+ <span style="color:red">' .
1004
+ __( 'Unavailable', 'wp-photo-album-plus' ) . '
1005
+ </span>';
1006
+ }
1007
  wppa_echo( '
1008
+ <div style="max-width:300px">
1009
+ <label>' .
1010
+ $lbl . '
1011
+ </label><br>
1012
+ <div class="wppa-ldi">' .
1013
+ $txt . '
1014
+ </div>
1015
+ </div>' );
1016
 
1017
+ // Thumbnail
1018
+ if ( ! $is_video ) {
1019
+ $lbl = __( 'Thumbnail file', 'wp-photo-album-plus' );
1020
+ $tp = wppa_get_thumb_path( $id );
1021
+ if ( is_file( $tp ) ) {
1022
+ $txt = '
1023
+ <span id="thumbx-' . $id . '">' . wppa_get_thumbx( $id ) . '</span> x
1024
+ <span id="thumby-' . $id . '">' . wppa_get_thumby( $id ) . '</span>:
1025
+ (<span id="thumbfilesize-' . $id . '">' . wppa_get_filesize( $tp ) . '</span>)
1026
+ &nbsp;
1027
+ <input
1028
+ type="checkbox"' .
1029
+ ( $thumblock ? ' checked' : '' ) . '
1030
+ onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'thumblock\', jQuery(this).prop(\'checked\') ? 1 : 0 )" /> ' .
1031
+ __( 'Locked', 'wp-photo-album-plus' );
1032
+ }
1033
+ else {
1034
+ $txt = '
1035
+ <span style="color:red">' .
1036
+ __( 'Unavailable', 'wp-photo-album-plus' ) . '.
1037
+ </span>';
1038
+ }
1039
+ wppa_echo( '
1040
+ <div style="max-width:300px">
1041
  <label>' .
1042
+ $lbl . '
1043
  </label><br>
1044
  <div class="wppa-ldi">' .
1045
+ $txt . '
1046
  </div>
1047
+ </div>' );
1048
+ }
1049
 
1050
+ // Local CDN
1051
+ if ( wppa_cdn( 'admin' ) == 'local' ) {
1052
+ $lbl = __( 'Local CDN files', 'wp-photo-album-plus' );
1053
+ $txt = '<span id="cdnfiles-' . $id . '">';
1054
+
1055
+ $files = wppa_cdn_files( $id );
1056
+ if ( !empty( $files ) ) {
1057
+ foreach( $files as $file ) {
1058
+ if ( basename( $file ) != 'index.php' ) {
1059
+ $t = explode( '.', basename( $file ) );
1060
+ $t = explode( '-', $t[0] );
1061
+ $x = $t[0];
1062
+ $y = $t[1];
1063
+ $size = filesize( $file );
1064
+ $txt .= '
1065
+ <a
1066
+ href="' . wppa_cdn_url( $id, $x, $y ) . '"
1067
+ target="_blank"
1068
+ >' .
1069
+ basename( $file ) .
1070
+ '</a> ' .
1071
+ sprintf( '%4.2fkB', $size / 1024 ) . '<br>';
1072
+ }
1073
+ }
1074
+ }
1075
+ else {
1076
+ $txt .= __( 'None', 'wp-photo-album-plus' );
1077
+ }
1078
+ $txt .= '</span>';
1079
+ wppa_echo( '
1080
+ <div>
1081
  <label>' .
1082
+ $lbl . '
1083
  </label><br>
1084
  <div class="wppa-ldi">' .
1085
+ $txt . '
1086
  </div>
1087
+ </div>' );
1088
+ }
1089
 
1090
+ // Video
1091
+ if ( $b_is_video ) {
1092
+
1093
+ // Width
1094
+ wppa_echo( '
1095
+ <div>
1096
  <label>' .
1097
+ __( 'Video width', 'wp-photo-album-plus' ) . '
1098
  </label><br>
1099
+ <input
1100
+ type="text"
1101
+ style="width:50px;margin:0 4px"
1102
+ onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videox\', this.value)"
1103
+ value="' . esc_attr( $videox ) . '"
1104
+ />px
1105
+ <br>' . sprintf( __( '(0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_width' ) ) . '
1106
+ </div>' );
1107
 
1108
+ // Height
1109
+ wppa_echo( '
1110
+ <div>
1111
  <label>' .
1112
+ __( 'Video height', 'wp-photo-album-plus' ) . '
1113
  </label><br>
1114
+ <input
1115
+ type="text"
1116
+ style="width:50px;margin:0 4px"
1117
+ onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videoy\', this.value)"
1118
+ value="' . esc_attr( $videoy ) . '"
1119
+ />px
1120
+ <br>' . sprintf( __( '(0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_height' ) ) . '
1121
  </div>' );
1122
 
1123
+ // Duratiuon
1124
+ if ( $duration ) {
1125
+ $lbl = __( 'Duration', 'wp-photo-album-plus' );
1126
+ $duration = intval( $duration * 100 ) / 100;
1127
+ if ( $duration < 120.0 ) {
1128
+ $txt = sprintf( __( '%s seconds', 'wp-photo-album-plus' ) ,$duration );
1129
+ }
1130
+ else {
1131
+ $txt = sprintf( __( '%s minutes and %s seconds', 'wp-photo-album-plus' ),
1132
+ sprintf( '%d', floor( $duration / 60 ) ),
1133
+ sprintf( '%4.2f', $duration % 60 ) );
1134
+ }
1135
  wppa_echo( '
1136
  <div>
1137
  <label>' .
1138
+ $lbl . '
1139
  </label><br>
1140
  <div class="wppa-ldi">' .
1141
+ $txt . '
1142
  </div>
1143
  </div>' );
1144
  }
1145
 
1146
+ // Formats
1147
+ $txt = '';
1148
+ foreach ( $is_video as $fmt ) {
1149
+ $txt .= $fmt . ' (' . wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . ')<br>';
1150
  }
1151
+ wppa_echo( '
1152
+ <div>
1153
+ <label>' .
1154
+ __( 'Formats', 'wp-photo-album-plus' ) . '
1155
+ </label><br>
1156
+ <div class="wppa-ldi">' .
1157
+ $txt . '
1158
+ </div>
1159
+ </div>' );
1160
+ }
1161
 
1162
+ // Audio
1163
+ if ( $b_has_audio ) {
1164
+ $txt = '';
1165
+ foreach ( $has_audio as $fmt ) {
1166
+ $txt .= $fmt . ' (' . wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . ')<br>';
 
 
 
 
 
 
1167
  }
1168
+ wppa_echo( '
1169
+ <div>
1170
+ <label>' .
1171
+ __( 'Formats', 'wp-photo-album-plus' ) . '
1172
+ </label><br>
1173
+ <div class="wppa-ldi">' .
1174
+ $txt . '
1175
+ </div>
1176
+ </div>' );
1177
+ }
1178
 
1179
+ wppa_echo( '</div>' );
1180
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
1181
 
1182
+ // Update status field
1183
+ {
1184
+ wppa_echo( '
1185
+ <h3 style="margin-left:1em">' .
1186
+ __( 'Remark:', 'wp-photo-album-plus' ) . '
1187
+ <span
1188
+ id="remark-' . $id . '"
1189
+ style="font-weight:bold;color:#00AA00">' .
1190
+ ( $is_video ? sprintf( __( 'Video %s is not modified yet', 'wp-photo-album-plus' ), $id ) :
1191
+ sprintf( __( 'Photo %s is not modified yet', 'wp-photo-album-plus' ), $id ) ) . '
1192
+ </span>
1193
+ </h3>' );
1194
+ }
1195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1196
 
1197
+ wppa_echo( '<!-- Section 2 simple settings -->
1198
+ <div class="wppa-flex">' );
 
 
 
 
 
 
 
 
 
 
1199
 
1200
+ // Owner
1201
+ if ( $owner_editable ) {
1202
+ wppa_echo( '
1203
+ <div>
1204
+ <label
1205
+ for="owner-' . $id . '">' .
1206
+ __( 'Owned by:', 'wp-photo-album-plus' ) . '
1207
+ </label><br>
1208
+ <input
1209
+ id="owner-' . $id . '"
1210
+ type="text"
1211
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'owner\', this.value )"
1212
+ value="' . esc_attr( $owner ) . '"
1213
+ />
1214
+ </div>' );
1215
+ }
1216
+
1217
+ // Exif date-time
1218
+ if ( wppa_user_is( 'administrator' ) ) { // Admin may edit exif date
1219
+ wppa_echo( '
1220
+ <div>
1221
+ <label
1222
+ for="exifdtm-' . $id . '">' .
1223
+ __( 'EXIF Date:', 'wp-photo-album-plus' ) . '
1224
+ </label><br>
1225
+ <input
1226
+ id="exifdtm-' . $id . '"
1227
+ type="text"
1228
+ style="width:125px"
1229
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'exifdtm\', this.value)"
1230
+ value="' . esc_attr( $exifdtm ) . '"
1231
+ />
1232
+ </div>' );
1233
+ }
1234
+
1235
+ // Location
1236
+ if ( wppa_switch( 'geo_edit' ) ) {
1237
+ $loc = $location ? $location : '///';
1238
+ $geo = explode( '/', $loc );
1239
+ wppa_echo( '
1240
+ <div>
1241
+ <label
1242
+ for="lat-' . $id . '">' .
1243
+ __( 'Location Lat:' , 'wp-photo-album-plus' ) . esc_html( $geo['0'] ) . '
1244
+ </label><br>
1245
+ <input
1246
+ id="lat-' . $id . '"
1247
+ type="text"
1248
+ style="width:100px"
1249
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lat\', this.value)"
1250
+ value="' . esc_attr( $geo['2'] ) . '"
1251
+ />
1252
+ </div>
1253
+ <div>
1254
+ <label
1255
+ for="lon-' . $id . '">' .
1256
+ __( 'Location Lon:' , 'wp-photo-album-plus' ) . esc_html( $geo['1'] ) . '
1257
+ </label><br>
1258
+ <input
1259
+ id="lon-' . $id . '"
1260
+ type="text"
1261
+ style="width:100px"
1262
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lon\', this.value)"
1263
+ value="' . esc_attr( $geo['3'] ) . '"
1264
+ />
1265
+ </div>' );
1266
+ }
1267
+
1268
+ // Changeable p_order
1269
+ if ( $sortby_orderno && $may_change_porder ) {
1270
+ wppa_echo( '
1271
+ <div>
1272
+ <label
1273
+ for="porder-' . $id . '">' .
1274
+ __( 'Photo sort order #:', 'wp-photo-album-plus' ) . '
1275
+ </label><br>
1276
+ <input
1277
+ type="text"
1278
+ id="porder-' . $id . '"
1279
+ value="' . esc_attr( $p_order ) . '"
1280
+ style="width:100px"
1281
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'p_order\', this.value)"
1282
+ />
1283
+ </div>' );
1284
+ }
1285
+
1286
+ // Status
1287
+ if ( $may_edit_status ) {
1288
+ $sel = ' selected';
1289
+ if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) {
1290
+ $dis = ' disabled';
1291
  }
1292
+ else {
1293
+ $dis = '';
1294
+ }
1295
+ wppa_echo( '
1296
+ <div>
1297
+ <label
1298
+ for="status-' . $id . '">' .
1299
+ __( 'Status' , 'wp-photo-album-plus' ) . '
1300
+ </label><br>
1301
+ <select
1302
+ id="status-' . $id . '"
1303
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'status\', this.value); wppaPhotoStatusChange( ' . $id . ' )">
1304
+ <option value="pending"' . ( $status == 'pending' ? $sel : '' ) . ' >' .
1305
+ __( 'Pending', 'wp-photo-album-plus' ) . '
1306
+ </option>
1307
+ <option value="publish"' . ( $status =='publish' ? $sel : '' ) . ' >' .
1308
+ __( 'Publish', 'wp-photo-album-plus' ) . '
1309
+ </option>
1310
+ <option value="featured"' . ( $status == 'featured' ? $sel : '' ) . $dis . ' >' .
1311
+ __( 'Featured', 'wp-photo-album-plus' ) . '
1312
+ </option>
1313
+ <option value="gold"' . ( $status == 'gold' ? $sel : '' ) . $dis . ' >' .
1314
+ __( 'Gold', 'wp-photo-album-plus' ) . '
1315
+ </option>
1316
+ <option value="silver"' . ( $status == 'silver' ? $sel : '' ) . $dis . ' >' .
1317
+ __( 'Silver', 'wp-photo-album-plus' ) . '
1318
+ </option>
1319
+ <option value="bronze"' . ( $status == 'bronze' ? $sel : '' ) . $dis . ' >' .
1320
+ __( 'Bronze', 'wp-photo-album-plus' ) . '
1321
+ </option>
1322
+ <option value="scheduled"' . ( $status == 'scheduled' ? $sel : '' ) . $dis . ' >' .
1323
+ __( 'Scheduled', 'wp-photo-album-plus' ) . '
1324
+ </option>
1325
+ <option value="private"' . ( $status == 'private' ? $sel : '' ) . $dis . ' >' .
1326
+ __( 'Private', 'wp-photo-album-plus' ) . '
1327
+ </option>
1328
+ </select>' .
1329
+ wppa_get_date_time_select_html( 'photo', $id, true ) . '
1330
+ <span id="psdesc-' . $id . '" class="description" style="display:none">' .
1331
+ __( 'Note: Featured photos should have a descriptive name; a name a search engine will look for!', 'wp-photo-album-plus' ) . '
1332
+ </span>
1333
+ </div>' );
1334
+ }
1335
+
1336
+ // Stereo
1337
+ if ( wppa_switch( 'enable_stereo' ) && ! $is_multi ) {
1338
+ wppa_echo( '
1339
+ <div style="max-width:250px;">
1340
+ <label
1341
+ for="stereo-' . $id . '">' .
1342
+ __( 'Stereophoto', 'wp-photo-album-plus' ) . '
1343
+ </label><br>
1344
+ <select
1345
+ id="stereo-' . $id . '"
1346
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'stereo\', this.value, true)"
1347
+ >
1348
+ <option value="0"' . ( $stereo == '0' ? ' selected' : '' ) . '>' .
1349
+ __( 'No stereo image', 'wp-photo-album-plus' ) . '
1350
+ </option>
1351
+ <option value="1"' . ( $stereo == '1' ? ' selected' : '' ) . '>' .
1352
+ __( 'Left - right stereo image', 'wp-photo-album-plus' ) . '
1353
+ </option>
1354
+ <option value="-1"' . ( $stereo == '-1' ? ' selected' : '' ) . '>' .
1355
+ __( 'Right - left stereo image', 'wp-photo-album-plus' ) . '
1356
+ </option>
1357
+ </select>
1358
+ </div>' );
1359
+
1360
+ /*
1361
+ __( 'Images:', 'wp-photo-album-plus' ) . ' ' );
1362
+
1363
+ $files = wppa_glob( WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*' );
1364
 
1365
+ if ( empty( $files ) ) {
1366
+ wppa_echo( __( 'None', 'wp-photo-album-plus' ) . '. ' );
1367
+ }
1368
+ else {
1369
+ sort( $files );
1370
+ $c = 0;
1371
+ foreach ( $files as $file ) {
1372
  wppa_echo( '
1373
+ <a href="' . str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $file ) . '" target="_blank">' .
1374
+ basename( $file ) . '
1375
+ </a>' );
1376
+ $c++;
1377
+ if ( $c == count( $files ) ) {
1378
+ wppa_echo( '. ' );
1379
+ }
1380
+ else {
1381
+ wppa_echo( ', ' );
1382
+ }
1383
  }
1384
  }
1385
+ wppa_echo( $br );
1386
+ */
 
1387
  }
1388
 
1389
+ // Panorama
1390
+ if ( wppa_switch( 'enable_panorama' ) && ! $b_is_video ) {
1391
+ $can_panorama = $photoy && $photox / $photoy >= 1.999;
1392
+ if ( $can_panorama ) {
 
 
1393
  wppa_echo( '
1394
  <div>
1395
  <label
1396
+ for="panorama-' . $id . '">' .
1397
+ __( 'Panorama', 'wp-photo-album-plus' ) . '
1398
  </label><br>
1399
+ <select
1400
+ id="panorama-' . $id . '"
1401
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'panorama\', this.value, true )">
1402
+ <option value="0"' . ( $panorama == '0' ? ' selected' : '' ) . '>' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1403
+ <option value="1"' . ( $panorama == '1' ? ' selected' : '' ) . '>' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1404
+ <option value="2"' . ( $panorama == '2' ? ' selected' : '' ) . '>' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1405
+ </select>
1406
  </div>' );
 
1407
 
1408
+ $source_file = wppa_get_source_path( $id );
1409
+ if ( wppa_is_file( $source_file ) ) {
1410
+ $source_file_sizes = wppa_getimagesize( $source_file );
1411
+
1412
+ if ( $panorama == '1' && $source_file_sizes[0] / $source_file_sizes[1] > 2.001 ) {
1413
+ $t = array( 120, 150, 180, 210, 240, 270, 300, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450 );
1414
+ wppa_echo( '
1415
+ <div>
1416
+ <label
1417
+ for="make360-' . $id . '">' .
1418
+ __( 'Make 360 from', 'wp-photo-album-plus' ) . '
1419
+ </label><br>
1420
+ <select
1421
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'make360\', this.value, true)"
1422
+ id="make360-' . $id . '"
1423
+ title="' . esc_attr( __( 'Select the closest angle you originally made the panorama', 'wp-photo-album-plus' ) ) . '">
1424
+ <option value="">'.__('Select', 'wp-photo-album-plus' ).'</option>' );
1425
+ foreach( $t as $v ) {
1426
+ wppa_echo( '<option value="'.$v.'" '.($v==$angle?'selected':'').'>'.$v.'&deg;</option>' );
1427
+ }
1428
+ wppa_echo( '
1429
+ <option value="0">' . __( 'Undo', 'wp-photo-album-plus' ) . '</option>
1430
+ </select>
1431
+ </div>' );
1432
+ }
1433
+ }
1434
  }
1435
+ }
1436
 
1437
+ // Watermark
1438
+ if ( wppa_switch( 'watermark_on' ) ) {
1439
+
1440
+ // Get the current watermark file settings
1441
+ $temp = wppa_get_water_file_and_pos( $id );
1442
+ $wmfile = isset( $temp['file'] ) ? $temp['file'] : '';
1443
+ $wmpos = isset( $temp['pos'] ) && isset ( $wms[$temp['pos']] ) ? $wms[$temp['pos']] : '';
1444
+
1445
+ $user = wppa_get_user();
1446
+ $has_source = wppa_is_file( wppa_get_source_path( $id ) );
1447
+ $can_remove = ( wppa_opt( 'watermark_file' ) == '--- none ---' ) ? '1' : '0';
1448
+ if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) {
1449
  wppa_echo( '
1450
+ <div style="max-width:250px;">
1451
  <label
1452
+ for="wmfsel_' . $id . '">' .
1453
+ __( 'Watermark', 'wp-photo-album-plus' ) . '
1454
  </label><br>
1455
+ <select
1456
+ id="wmfsel_' . $id . '"
1457
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_file_' . $user . '\', this.value)"
1458
+ >' .
1459
+ wppa_watermark_file_select( 'user', $album ) . '
1460
+ </select>
 
1461
  </div>
1462
  <div>
1463
  <label
1464
+ for="wmpsel_' . $id . '">' .
1465
+ __( 'Position', 'wp-photo-album-plus' ) . '
1466
  </label><br>
1467
+ <select
1468
+ id="wmpsel_' . $id . '"
1469
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_pos_' . $user . '\', this.value)"
1470
+ >' .
1471
+ wppa_watermark_pos_select( 'user', $album ) . '
1472
+ </select>
1473
+ </div>
 
 
 
 
 
 
1474
  <div>
1475
+ <label>
1476
+ &nbsp;
 
1477
  </label><br>
1478
  <input
1479
+ type="button"
1480
+ class="button wppa-admin-button"
1481
+ value="' . esc_attr( __( 'Apply watermark', 'wp-photo-album-plus' ) ) . '"
1482
+ onclick="wppaTryWatermark( ' . $id . ', ' . $has_source . ', ' . $can_remove . ' )"
1483
+ />
1484
+ <img
1485
+ id="wppa-water-spin-' . $id . '"
1486
+ src="' . wppa_get_imgdir() . 'spinner.gif"
1487
+ alt="Spin"
1488
+ style="visibility:hidden"
1489
  />
1490
  </div>' );
1491
  }
1492
+ /*
1493
+ elseif ( basename( $wmfile ) != '--- none ---' ) {
1494
+ wppa_echo(
1495
+ __( 'Watermark:', 'wp-photo-album-plus' ) . ' ' .
1496
+ __( 'File:', 'wp-photo-album-plus' ) . ' ' . strip_tags( basename( $wmfile ) ) . ' ' .
1497
+ __( 'Pos:', 'wp-photo-album-plus' ) . ' ' . strip_tags( $wmpos ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1498
  }
1499
+ */
1500
+ }
1501
 
1502
+ // Schedule for delete
1503
+ if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
1504
+ if ( $may_change_delete ) {
1505
  wppa_echo( '
1506
+ <div style="max-width: 500px;">
1507
  <label
1508
+ for="scheduledel-' . $id . '">' .
1509
+ __( 'Delete at', 'wp-photo-album-plus' ) . '
1510
  </label><br>
1511
+ <input
1512
+ type="checkbox"
1513
+ id="scheduledel-' . $id . '"' .
1514
+ ( $scheduledel ? ' checked' : '' ) .
1515
+ ( $may_change_delete ? '' : ' disabled' ) . '
1516
+ onchange="wppaTryScheduledel( ' . $id . ' )"
1517
+ /> ' .
1518
+ wppa_get_date_time_select_html( 'delphoto', $id, true ) . '
 
 
 
 
 
 
1519
  </div>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1520
  }
1521
+ }
1522
 
1523
+ wppa_echo( '
1524
+ </div>
1525
+ <!-- End section 2 simple settings -->' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1526
 
1527
  wppa_echo( '
1528
  <!-- Section 3, Actions -->
1655
  }
1656
  }
1657
 
1658
+ // Remake displayfiles
1659
+ if ( ! $is_video ) {
1660
+ wppa_echo( '
1661
+ <div>
1662
+ <label>
1663
+ &nbsp;
1664
+ </label><br>
1665
+ <input
1666
+ type="button"
1667
+ class="wppa-admin-button button"
1668
+ title="' . esc_attr( __( 'Remake display file and thumbnail file', 'wp-photo-album-plus' ) ) . '"
1669
+ onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remake\', 0 )"
1670
+ value="' . esc_attr( __( 'Remake files', 'wp-photo-album-plus' ) ) . '"
1671
+ />
1672
+ </div>' );
1673
+ }
1674
+
1675
+ // Remake thumbnail
1676
+ if ( ! $is_video ) {
1677
+ wppa_echo( '
1678
+ <div style="max-width:500px;">
1679
+ <label>
1680
+ &nbsp;
1681
+ </label><br>
1682
+ <input
1683
+ type="button"
1684
+ class="wppa-admin-button button"
1685
+ title="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
1686
+ onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remakethumb\', 0 )"
1687
+ value="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
1688
+ />
1689
+ </div>' );
1690
+ }
1691
+
1692
+ // Delete
1693
+ if ( wppa_user_is( 'administrator' ) || wppa_get_photo_item( $id, 'owner' ) == wppa_get_user() ) {
1694
+ if ( ! wppa( 'front_edit' ) ) {
1695
+ wppa_echo( '
1696
+ <div>
1697
+ <label>
1698
+ &nbsp;
1699
+ </label><br>
1700
+ <input
1701
  type="button"
1702
  class="wppa-admin-button button"
1703
  style="color:' . ( $deleted ? 'green' : 'red' ) . '"
1760
  </div>' );
1761
  }
1762
 
1763
+ wppa_echo( '
1764
+ </div>' );
1765
+
1766
+ // Section 3a ImageMagick editing commands
1767
+ if ( wppa_can_admin_magick( $id ) && ! $quick ) {
1768
+
1769
+ wppa_echo( '<div style="padding:0 20px;">
1770
+ <details class="wppa-sublevel-details">
1771
+ <summary class="toplevel wppa-summary-sublevel" onclick="if(!jQuery(this).parent().prop(\'open\'))wppaInitMagick(\''.$id.'\')"> '.
1772
+ __( 'ImageMagick commands', 'wp-photo-album-plus' ) . '
1773
+ </summary>
1774
+
1775
+ <table
1776
+ class="wppa-table wppa-photo-table"
1777
+ style="border:1px solid lightgray;margin:2px 20px 20px 0;background-color:#ccc;"
1778
+ >
1779
+ <tbody>
1780
+ <tr>
1781
+ <td>' .
1782
+ __( 'The operations are executed upon the display file.', 'wp-photo-album-plus' ) . ' ' .
1783
+ __( 'A new thumbnail image will be created from the display file.', 'wp-photo-album-plus' ) . '
1784
+ </td>
1785
+ </tr>
1786
+ <tr>
1787
+ <td>' );
1788
+
1789
+ // --- Actions ---
1790
+ {
1791
+ // Rotate left
1792
+ wppa_echo( '
1793
+ <input
1794
+ type="button"
1795
+ class="wppa-admin-button button"
1796
+ onclick="wppaTryMagick( ' . $id . ', \'magickrotleft\' )"
1797
+ value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus' ) ) . '"
1798
+ />' );
1799
+
1800
+ // Rotat 180
1801
+ wppa_echo( '
1802
+ <input
1803
+ type="button"
1804
+ class="wppa-admin-button button"
1805
+ onclick="wppaTryMagick( ' . $id . ', \'magickrot180\' )"
1806
+ value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus' ) ) . '"
1807
+ />' );
1808
+
1809
+ // Rotate right
1810
+ wppa_echo( '
1811
+ <input
1812
+ type="button"
1813
+ class="wppa-admin-button button"
1814
+ onclick="wppaTryMagick( ' . $id . ', \'magickrotright\' )"
1815
+ value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus' ) ) . '"
1816
+ />' );
1817
+
1818
+ // Flip
1819
+ wppa_echo( '
1820
+ <input
1821
+ type="button"
1822
+ class="wppa-admin-button button"
1823
+ onclick="wppaTryMagick( ' . $id . ', \'magickflip\' )"
1824
+ value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus' ) ) . '&thinsp;&#8212;"
1825
+ title="-flip"
1826
+ />' );
1827
+
1828
+ // Flop
1829
+ wppa_echo( '
1830
+ <input
1831
+ type="button"
1832
+ class="wppa-admin-button button"
1833
+ onclick="wppaTryMagick( ' . $id . ', \'magickflop\' )"
1834
+ value="' . esc_attr( __( 'Flop', 'wp-photo-album-plus' ) ) . ' |"
1835
+ title="-flop"
1836
+ />' );
1837
+
1838
+ // Enhance
1839
+ wppa_echo( '
1840
+ <input
1841
+ type="button"
1842
+ class="wppa-admin-button button"
1843
+ onclick="wppaTryMagick( ' . $id . ', \'enhance\' )"
1844
+ value="' . esc_attr( __( 'Enhance', 'wp-photo-album-plus' ) ) . '"
1845
+ title="-enhance"
1846
+ />' );
1847
+
1848
+ // Sharpen
1849
+ wppa_echo( '
1850
+ <input
1851
+ type="button"
1852
+ class="wppa-admin-button button"
1853
+ onclick="wppaTryMagick( ' . $id . ', \'sharpen\' )"
1854
+ value="' . esc_attr( __( 'Sharpen', 'wp-photo-album-plus' ) ) . '"
1855
+ title="-sharpen 0x1"
1856
+ />' );
1857
+
1858
+ // Blur
1859
+ wppa_echo( '
1860
+ <input
1861
+ type="button"
1862
+ class="wppa-admin-button button"
1863
+ onclick="wppaTryMagick( ' . $id . ', \'blur\' )"
1864
+ value="' . esc_attr( __( 'Blur', 'wp-photo-album-plus' ) ) . '"
1865
+ title="-blur 0x1"
1866
+ />' );
1867
+
1868
+ // Auto gamma
1869
+ wppa_echo( '
1870
+ <input
1871
+ type="button"
1872
+ class="wppa-admin-button button"
1873
+ onclick="wppaTryMagick( ' . $id . ', \'auto-gamma\' )"
1874
+ value="' . esc_attr( __( 'Auto Gamma', 'wp-photo-album-plus' ) ) . '"
1875
+ title="-auto-gamma"
1876
+ />' );
1877
+
1878
+ // Auto level
1879
+ wppa_echo( '
1880
+ <input
1881
+ type="button"
1882
+ class="wppa-admin-button button"
1883
+ onclick="wppaTryMagick( ' . $id . ', \'auto-level\' )"
1884
+ value="' . esc_attr( __( 'Auto Level', 'wp-photo-album-plus' ) ) . '"
1885
+ title="-auto-level"
1886
+ />' );
1887
+
1888
+ // Contrast+
1889
+ wppa_echo( '
1890
+ <input
1891
+ type="button"
1892
+ class="wppa-admin-button button"
1893
+ onclick="wppaTryMagick( ' . $id . ', \'contrast-p\' )"
1894
+ value="' . esc_attr( __( 'Contrast+', 'wp-photo-album-plus' ) ) . '"
1895
+ title="-brightness-contrast 0x5"
1896
+ />' );
1897
+
1898
+ // Contrast-
1899
+ wppa_echo( '
1900
+ <input
1901
+ type="button"
1902
+ class="wppa-admin-button button"
1903
+ onclick="wppaTryMagick( ' . $id . ', \'contrast-m\' )"
1904
+ value="' . esc_attr( __( 'Contrast-', 'wp-photo-album-plus' ) ) . '"
1905
+ title="-brightness-contrast 0x-5"
1906
+ />' );
1907
+
1908
+ // Brightness+
1909
+ wppa_echo( '
1910
+ <input
1911
+ type="button"
1912
+ class="wppa-admin-button button"
1913
+ onclick="wppaTryMagick( ' . $id . ', \'brightness-p\' )"
1914
+ value="' . esc_attr( __( 'Brightness+', 'wp-photo-album-plus' ) ) . '"
1915
+ title="-brightness-contrast 5"
1916
+ />' );
1917
+
1918
+ // Brightness-
1919
+ wppa_echo( '
1920
+ <input
1921
+ type="button"
1922
+ class="wppa-admin-button button"
1923
+ onclick="wppaTryMagick( ' . $id . ', \'brightness-m\' )"
1924
+ value="' . esc_attr( __( 'Brightness-', 'wp-photo-album-plus' ) ) . '"
1925
+ title="-brightness-contrast -5"
1926
+ />' );
1927
+
1928
+ // Despeckle
1929
+ wppa_echo( '
1930
+ <input
1931
+ type="button"
1932
+ class="wppa-admin-button button"
1933
+ onclick="wppaTryMagick( ' . $id . ', \'despeckle\' )"
1934
+ value="' . esc_attr( __( 'Despeckle', 'wp-photo-album-plus' ) ) . '"
1935
+ title="-despeckle"
1936
+ />' );
1937
+
1938
+ // Lenear gray
1939
+ wppa_echo( '
1940
+ <input
1941
+ type="button"
1942
+ class="wppa-admin-button button"
1943
+ onclick="wppaTryMagick( ' . $id . ', \'lineargray\' )"
1944
+ value="' . esc_attr( __( 'Linear gray', 'wp-photo-album-plus' ) ) . '"
1945
+ title="-colorspace gray"
1946
+ />' );
1947
+
1948
+ // Non-linear gray
1949
+ wppa_echo( '
1950
+ <input
1951
+ type="button"
1952
+ class="wppa-admin-button button"
1953
+ onclick="wppaTryMagick( ' . $id . ', \'nonlineargray\' )"
1954
+ value="' . esc_attr( __( 'Non-linear gray', 'wp-photo-album-plus' ) ) . '"
1955
+ title="-grayscale Rec709Luma"
1956
+ />' );
1957
+
1958
+ // Charcoal
1959
+ wppa_echo( '
1960
+ <input
1961
+ type="button"
1962
+ class="wppa-admin-button button"
1963
+ onclick="wppaTryMagick( ' . $id . ', \'charcoal\' )"
1964
+ value="' . esc_attr( __( 'Charcoal', 'wp-photo-album-plus' ) ) . '"
1965
+ title="-charcoal"
1966
+ />' );
1967
+
1968
+ // Paint
1969
+ wppa_echo( '
1970
+ <input
1971
+ type="button"
1972
+ class="wppa-admin-button button"
1973
+ onclick="wppaTryMagick( ' . $id . ', \'paint\' )"
1974
+ value="' . esc_attr( __( 'Paint', 'wp-photo-album-plus' ) ) . '"
1975
+ title="-paint"
1976
+ />' );
1977
+
1978
+ // Sepia
1979
+ wppa_echo( '
1980
+ <input
1981
+ type="button"
1982
+ class="wppa-admin-button button"
1983
+ onclick="wppaTryMagick( ' . $id . ', \'sepia\' )"
1984
+ value="' . esc_attr( __( 'Sepia', 'wp-photo-album-plus' ) ) . '"
1985
+ title="-sepia-tone 80%"
1986
+ />' );
1987
+
1988
+ // Show/hide wppa-horizon
1989
+ wppa_echo( '
1990
+ <input
1991
+ type="button"
1992
+ class="wppa-admin-button button"
1993
+ onclick="wppaToggleHorizon()"
1994
+ value="' . esc_attr( 'Show/hide horizon', 'wp-photo-album-plus' ) . '"
1995
+ title="' . esc_attr( 'Toggle horizon reference line on/off', 'wp-photo-album-plus' ) . '"
1996
+ />' );
1997
+
1998
+ // Anticlock 0.5 deg
1999
+ wppa_echo( '
2000
+ <input
2001
+ type="button"
2002
+ class="wppa-admin-button button"
2003
+ onclick="wppaTryMagick( ' . $id . ', \'skyleft\' )"
2004
+ value="' . esc_attr( '0.5&deg;', 'wp-photo-album-plus' ) . '"
2005
+ title="' . esc_attr( 'Rotate image by 0.5&deg; anticlockwise', 'wp-photo-album-plus' ) . '"
2006
+ />' );
2007
+
2008
+ // Clockwise 0.5 deg
2009
+ wppa_echo( '
2010
+ <input
2011
+ type="button"
2012
+ class="wppa-admin-button button"
2013
+ onclick="wppaTryMagick( ' . $id . ', \'skyright\' )"
2014
+ value="' . esc_attr( '-0.5&deg;', 'wp-photo-album-plus' ) . '"
2015
+ title="' . esc_attr( 'Rotate image by 0.5&deg; clockwise', 'wp-photo-album-plus' ) . '"
2016
+ />' );
2017
+
2018
+ // Crop
2019
+ wppa_echo( '
2020
+ <input
2021
+ type="button"
2022
+ class="wppa-admin-button button"
2023
+ id="button-' . $id . '"
2024
+ value="Crop"
2025
+ title=""
2026
+ />' );
2027
+
2028
+ // Set cropbox aspect ratio
2029
+ $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
2030
+ $dflt = wppa_opt( 'image_magick_ratio' );
2031
+
2032
+ wppa_echo( '
2033
+ <select
2034
+ onchange="wppaCropper[' . $id . '].setAspectRatio(this.value)"
2035
+ title="' . __( 'Aspect ratio of cropped image', 'wp-photo-album-plus' ) . '"
2036
+ >
2037
+ <option value="NaN"' . ( $dflt == 'NaN' ? ' selected' : '' ) . '>' . __( 'free', 'wp-photo-album-plus' ) . '</option>
2038
+ <option value="' . $ratio . '"' . ( $dflt == 'ratio' ? ' selected' : '' ) . '>' . __( 'original', 'wp-photo-album-plus' ) . '</option>
2039
+ <option value="1"' . ( $dflt == '1' ? ' selected' : '' ) . '>' . __( 'square', 'wp-photo-album-plus' ) . '</option>
2040
+ <option value="1.25"' . ( $dflt == '1.25' ? ' selected' : '' ) . '>4:5 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2041
+ <option value="1.33333"' . ( $dflt == '1.33333' ? ' selected' : '' ) . '>3:4 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2042
+ <option value="1.5"' . ( $dflt == '1.5' ? ' selected' : '' ) . '>2:3 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2043
+ <option value="1.6"' . ( $dflt == '1.6' ? ' selected' : '' ) . '>5:8 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2044
+ <option value="1.77777"' . ( $dflt == '1.77777' ? ' selected' : '' ) . '>9:16 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2045
+ <option value="2"' . ( $dflt == '2' ? ' selected' : '' ) . '>1:2 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2046
+ <option value="0.8"' . ( $dflt == '0.8' ? ' selected' : '' ) . '>4:5 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2047
+ <option value="0.75"' . ( $dflt == '0.75' ? ' selected' : '' ) . '>3:4 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2048
+ <option value="0.66667"' . ( $dflt == '0.66667' ? ' selected' : '' ) . '>2:3 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2049
+ <option value="0.625"' . ( $dflt == '0.625' ? ' selected' : '' ) . '>5:8 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2050
+ <option value="0.5625"' . ( $dflt == '0.5625' ? ' selected' : '' ) . '>9:16 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2051
+ <option value="0.5"' . ( $dflt == '0.5' ? ' selected' : '' ) . '>1:2 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2052
+ </select>' . $br );
2053
+
2054
+ if ( $dflt == 'ratio' ) {
2055
+ $value = $ratio;
2056
+ }
2057
+ elseif ( $dflt == 'free' ) {
2058
+ $value = '';
2059
+ }
2060
+ else {
2061
+ $value = $dflt;
2062
+ }
2063
+
2064
+ // $the_js = 'jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});';
2065
+ // wppa_add_inline_script( 'wppa-admin', $the_js );
2066
+ }
2067
+
2068
+ wppa_echo( '
2069
+ </td>
2070
+ </tr>
2071
+ <tr>
2072
+ <td>' .
2073
+ __( '<b>ImageMagick</b> command stack', 'wp-photo-album-plus' ) . ':
2074
+ <span
2075
+ id="magickstack-' . strval( intval( $id ) ). '"
2076
+ style="color:blue"
2077
+ >' .
2078
+ sanitize_text_field( $magickstack ) . '
2079
+ </span>
2080
+ <input
2081
+ type="button"
2082
+ class="wppa-admin-button button"
2083
+ id="imstackbutton-' . strval( intval( $id ) ) . '"
2084
+ onclick="wppaTryMagick( ' . strval( intval( $id ) ) . ', \'magickundo\' )"
2085
+ value="' . esc_attr( __( 'Undo', 'wp-photo-album-plus' ) ) . '"
2086
+ title="' . esc_attr( __( 'Undo last Magick command', 'wp-photo-album-plus' ) ) . '"
2087
+ style="margin-left:4px;' . ( $magickstack ? 'display:inline;' : 'display:none;' ) . '"
2088
+ />
2089
+ </td>
2090
+ </tr>' );
2091
 
2092
+ // Fake 'for social media' to use the local file here, not cloudinary. Files from cloudinary do not reload, even with ?ver=...
2093
+ wppa( 'for_sm', true );
2094
+ wppa_echo( '
2095
+ <tr>
2096
+ <td>
2097
+ <div
2098
+ class="wppa-cropper-container-wrapper">
2099
+ <img
2100
+ id="fs-img-' . $id . '"
2101
+ src="' . esc_url( wppa_get_photo_url( $id ) ) . '"
2102
+ style="float:left;max-width:100%"
2103
+ />
2104
+ </div>
2105
+ </td>
2106
+ </tr>
2107
+ </tbody>
2108
+ </table>
2109
+ </details></div>' );
2110
+ }
2111
 
2112
+ // Reset switch
2113
+ wppa( 'for_sm', false );
2114
 
2115
  // Section 4
2116
  wppa_echo( '
2117
  <!-- Section 4 -->
2118
  <table
2119
  class="wppa-table wppa-photo-table"
2120
+ style="width:100%"
2121
  >
2122
  <tbody>' );
2123
 
2512
  </tbody>
2513
  </table>' );
2514
 
2515
+ wppa_echo( '<!-- Section 5 -->' );
2516
 
2517
+ // IPTC
2518
+ if ( ! $quick ) {
2519
+ $iptcs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_iptc
2520
+ WHERE photo = %s
2521
+ ORDER BY tag, id", $id ), ARRAY_A );
2522
+ if ( ! empty( $iptcs ) ) {
2523
+ wppa_echo( '
2524
+ <table><tbody><tr><td><input
2525
+ type="button"
2526
+ id="wppa-iptc-button-' . $id . '"
2527
+ class="button button-secundary"
2528
+ value="' . esc_attr( sprintf( __( 'Show %d IPTC items', 'wp-photo-album-plus' ), count( $iptcs ) ) ) . '"
2529
+ onclick="wppaToggleIptc( ' . $id . ', ' . count( $iptcs ) . ' )"
2530
+ /></td></tr></tbody></table>
2531
+ <table
2532
+ id="wppa-iptc-' . $id . '"
2533
+ class="wppa-table wppa-photo-table"
2534
+ style="clear:both;width:99%;display:none"
2535
+ >
2536
+ <thead>
2537
+ <tr style="font-weight:bold">
2538
+ <td style="padding:0 4px">' . __( 'IPTC tag', 'wp-photo-album-plus' ) . '</td>
2539
+ <td style="padding:0 4px">' . __( 'Description', 'wp-photo-album-plus' ) . '</td>
2540
+ <td style="padding:0 4px">' . __( 'Value', 'wp-photo-album-plus' ) . '</td>
2541
+ </tr>
2542
+ </thead>
2543
+ <tbody>' );
2544
 
2545
+ foreach ( $iptcs as $iptc ) {
 
 
 
 
 
 
 
2546
 
2547
+ wppa_echo( '
2548
+ <tr id="iptc-tr-' . $iptc['id'] . '">
2549
+ <td style="padding:0 4px">' . $iptc['tag'] . '</td>
2550
+ <td style="padding:0 4px">' . esc_html( wppa_iptc_tagname( $iptc['tag'] ) ) . ':</td>
2551
+ <td style="padding:0 4px">
2552
+ <input
2553
+ type="text"
2554
+ style="width:500px"
2555
+ value="' . esc_attr( $iptc['description'] ) . '"
2556
+ onchange="wppaAjaxUpdateIptc(\'' . $id . '\', \'' . $iptc['id'] . '\', this.value, \'' . $iptc['tag'] . '\')"
2557
+ />
2558
+ </td>
2559
+ </tr>' );
2560
+ }
2561
 
 
 
 
 
2562
  wppa_echo( '
2563
+ </tbody>
2564
+ </table>' );
2565
+ }
2566
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2567
 
2568
+ // Exif
2569
+ if ( ! $quick ) {
2570
+ $exifs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_exif
2571
+ WHERE photo = %s
2572
+ ORDER BY tag, id", $id ), ARRAY_A );
2573
+ if ( ! empty( $exifs ) ) {
2574
  $brand = wppa_get_camera_brand( $id );
2575
  wppa_echo( '
2576
+ <table><tbody><tr><td><input
2577
+ type="button"
2578
+ id="wppa-exif-button-' . $id . '"
2579
+ class="button button-secundary"
2580
+ value="' . esc_attr( sprintf( __( 'Show %d EXIF items', 'wp-photo-album-plus' ), count( $exifs ) ) ) . '"
2581
+ onclick="wppaToggleExif( ' . $id . ', ' . count( $exifs ) . ' )"
2582
+ /></td></tr></tbody></table>
2583
  <table
2584
  id="wppa-exif-' . $id . '"
2585
  class="wppa-table wppa-photo-table"
2586
+ style="clear:both;width:99%;display:none"
2587
  >
2588
  <thead>
2589
  <tr style="font-weight:bold">
2596
  </thead>
2597
  <tbody>' );
2598
 
2599
+ foreach ( $exifs as $exif ) {
2600
+ $desc = $exif['description'];
2601
+ if ( is_serialized( $desc ) ) {
2602
+ $desc = 'Array(' . count( wppa_unserialize( $desc ) ) . ')';
 
 
 
 
 
 
 
 
 
2603
  }
2604
+ wppa_echo( '
2605
+ <tr id="exif-tr-' . $exif['id'] . '">
2606
+ <td style="padding:0 4px">'.$exif['tag'].'</td>' );
2607
+
2608
+ if ( $brand && $exif['brand'] ) {
2609
+ wppa_echo( '
2610
+ <td style="padding:0 4px">' . $brand . '</td>
2611
+ <td style="padding:0 4px">' . wppa_exif_tagname( $exif['tag'], $brand, 'brandonly' ) . ':</td>' );
2612
+ }
2613
+ else {
2614
+ wppa_echo( '
2615
+ <td style="padding:0 4px"></td>
2616
+ <td style="padding:0 4px">' . wppa_exif_tagname( $exif['tag'] ) . ':</td>' );
2617
+ }
2618
+
2619
+ $raw_value = wp_kses( $desc, 'post' );
2620
+ if ( strlen( $raw_value ) > 50 ) {
2621
+ $raw_value = substr( $raw_value, 0, 47 ) . '...';
2622
+ }
2623
+ $formatted_value = wp_kses( wppa_format_exif( $exif['tag'], $exif['description'], $brand ), 'post' );
2624
+ if ( strlen( $formatted_value ) > 50 ) {
2625
+ $formatted_value = substr( $formatted_value, 0, 47 ) . '...';
2626
+ }
2627
  wppa_echo( '
2628
+ <td style="padding:0 4px">' . $raw_value . '</td>
2629
+ <td style="padding:0 4px">' . $formatted_value . '</td>
2630
+ </tr>' );
2631
 
2632
+ }
 
 
 
 
 
 
 
 
 
 
 
 
2633
 
2634
  wppa_echo( '
2635
  </tbody>
2636
+ </table>' );
2637
+ }
2638
  }
2639
 
2640
+ wppa_echo( '<!-- Section 6 -->' );
2641
 
2642
  // Comments
2643
+ if ( ! $quick ) {
2644
+ $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments
2645
+ WHERE photo = %s
2646
+ ORDER BY timestamp DESC ", $id ), ARRAY_A );
2647
+ if ( ! empty( $comments ) ) {
 
 
 
 
2648
  wppa_echo( '
2649
  <table
2650
  class="wppa-table wppa-photo-table"
2700
 
2701
  wppa_echo( '
2702
  </tbody>
2703
+ </table>' );
2704
+ }
 
2705
  }
 
2706
 
2707
  wppa_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange('.$id.');' );
2708
 
2709
  wppa_echo( '
2710
+ <div style="clear:both"></div>
2711
  </div>
2712
+ <div style="clear:both;margin-top:7px"></div>' );
2713
  }
2714
  /* End the actual display area for the photo settings */
2715
+
2716
  } /* foreach photo */
2717
 
2718
  wppa_admin_page_links( $page, $pagesize, $count, $link );
wppa-scripts.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
- * Version 8.2.03.002
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
@@ -510,7 +510,7 @@ global $wpdb;
510
  // }
511
 
512
  // if ( wp_add_inline_script( 'jquery-core', $result ) ) return;
513
-
514
  echo( '<script>' . $result . '</script>' );
515
 
516
  }
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
+ * Version 8.2.02.010
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
510
  // }
511
 
512
  // if ( wp_add_inline_script( 'jquery-core', $result ) ) return;
513
+
514
  echo( '<script>' . $result . '</script>' );
515
 
516
  }
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 8.2.03.003
7
  *
8
  */
9
 
@@ -7336,7 +7336,7 @@ global $wppa_subtab_names;
7336
  $help = __('The maximum number of albums a user can create when he is not admin', 'wp-photo-album-plus' );
7337
  $help .= '<br>'.__('A number of 0 means No limit', 'wp-photo-album-plus' );
7338
  $slug = 'wppa_max_albums';
7339
- $html1 = wppa_input( $slug, '50px', '', __( 'albums', 'wp-photo-album-plus' ) );
7340
  $html2 = '';
7341
  $html = array( $html1, $html2 );
7342
  wppa_setting_new($slug, '3', $name, $desc, $html, $help, wppa_switch( 'user_create_on' ));
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.2.02.002
7
  *
8
  */
9
 
7336
  $help = __('The maximum number of albums a user can create when he is not admin', 'wp-photo-album-plus' );
7337
  $help .= '<br>'.__('A number of 0 means No limit', 'wp-photo-album-plus' );
7338
  $slug = 'wppa_max_albums';
7339
+ $html1 = wppa_input($slug, '50px', '', 'albums');
7340
  $html2 = '';
7341
  $html = array( $html1, $html2 );
7342
  wppa_setting_new($slug, '3', $name, $desc, $html, $help, wppa_switch( 'user_create_on' ));
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 8.2.03.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,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.2.03.003'; // 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.2.02.010
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.2.02.010'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30