WP Photo Album Plus - Version 8.3.01.006

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

Code changes from version 8.2.09.103 to 8.3.01.006

Files changed (61) hide show
  1. blocks/slideshow/index.php +1 -1
  2. blocks/upload/index.php +1 -1
  3. changelog.txt +15 -7
  4. js/wppa-admin-scripts.js +7 -5
  5. js/wppa-admin-scripts.min.js +1 -1
  6. js/wppa-ajax-front.js +129 -124
  7. js/wppa-ajax-front.min.js +1 -1
  8. js/wppa-all.js +1 -1
  9. js/wppa-slideshow.js +13 -20
  10. wppa-admin-functions.php +429 -82
  11. wppa-admin-local-js.php +470 -0
  12. wppa-admin-styles.css +29 -33
  13. wppa-admin.php +143 -27
  14. wppa-adminbar.php +24 -24
  15. wppa-ajax.php +4 -5
  16. wppa-album-admin-autosave.php +386 -665
  17. wppa-album-covers.php +293 -261
  18. wppa-album-widget.php +4 -4
  19. wppa-boxes-html.php +10 -10
  20. wppa-breadcrumb.php +4 -4
  21. wppa-cache.php +3 -4
  22. wppa-comment-admin.php +22 -11
  23. wppa-common-functions.php +2 -2
  24. wppa-defaults.php +1 -5
  25. wppa-edit-email.php +31 -224
  26. wppa-edit-sequence.php +3 -7
  27. wppa-edit-tags.php +15 -22
  28. wppa-export.php +4 -4
  29. wppa-functions.php +38 -20
  30. wppa-gutenberg-wppa.php +2 -2
  31. wppa-help.php +4 -2
  32. wppa-import.php +6 -2
  33. wppa-init.php +3 -3
  34. wppa-input.php +3 -18
  35. wppa-lasten-widget.php +3 -3
  36. wppa-links.php +13 -13
  37. wppa-listtable.php +1320 -0
  38. wppa-maintenance.php +5 -5
  39. wppa-photo-admin-autosave.php +1320 -1371
  40. wppa-picture.php +2 -2
  41. wppa-scripts.php +61 -12
  42. wppa-search-widget.php +2 -2
  43. wppa-setting-see-also.php +2 -2
  44. wppa-settings-autosave.php +43 -75
  45. wppa-setup.php +2 -2
  46. wppa-slideshow-widget.php +4 -4
  47. wppa-slideshow.php +2 -2
  48. wppa-statistics.php +7 -7
  49. wppa-thumbnails.php +1 -12
  50. wppa-tinymce-shortcodes.php +2 -2
  51. wppa-topten-widget.php +4 -4
  52. wppa-upldr-widget.php +2 -2
  53. wppa-upload-common.php +2 -2
  54. wppa-upload-widget.php +3 -3
  55. wppa-upload.php +4 -2
  56. wppa-users.php +16 -1
  57. wppa-utils.php +2 -2
  58. wppa-widget-functions.php +2 -2
  59. wppa-wpdb-update.php +6 -1
  60. wppa-wrappers.php +8 -4
  61. wppa.php +2 -2
blocks/slideshow/index.php CHANGED
@@ -66,7 +66,7 @@ global $wppa_albumlist_created;
66
  }
67
  $the_js .= ']';
68
 
69
- wp_add_inline_script( 'wppa-admin', $the_js );
70
 
71
  $been_here = true;
72
  $wppa_albumlist_created = true;
66
  }
67
  $the_js .= ']';
68
 
69
+ wppa_add_inline_script( 'wppa-admin', $the_js, true );
70
 
71
  $been_here = true;
72
  $wppa_albumlist_created = true;
blocks/upload/index.php CHANGED
@@ -66,7 +66,7 @@ global $wppa_albumlist_created;
66
  }
67
  $the_js .= ']';
68
 
69
- wp_add_inline_script( 'wppa-admin', $the_js );
70
 
71
  $been_here = true;
72
 
66
  }
67
  $the_js .= ']';
68
 
69
+ wppa_add_inline_script( 'wppa-admin', $the_js, true );
70
 
71
  $been_here = true;
72
 
changelog.txt CHANGED
@@ -1,5 +1,13 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
 
 
 
3
  = 8.2.09 =
4
 
5
  * New admin page: Email admin. Enables adding/removing subscribers from the various wppa email lists as well as enabling, disabling and clearing lists.
@@ -60,12 +68,12 @@ depends upon their own status when they are explicitly requested e.g. by a short
60
 
61
  * The display of the album and photo admin page has been restructured. Phase II
62
  * You can now enter exif dates ending in 00 min and 00 sec.
63
- * New album setting: Max subalbums. This setting only limits the creation of sub albums at the frontend and looks at direct subalbums only.
64
 
65
  = 8.2.02 =
66
 
67
  * Introduction of native blocks: Photo of the day, upload and simple slideshow. Usable for posts/pages and widgets.
68
- * Textual corrections. The use of 'subalbum' is now consistent.
69
  * Emai callback urls did not work when refuse unencrypted is enabled. Fixed.
70
  * The display of the album and photo admin page has been restructured.
71
 
@@ -453,7 +461,7 @@ Alternatively you can supply attribute parent="<parent id>" where parent id may
453
  = 7.6.07 =
454
 
455
  * Speeded up by caching the list of sub(sub...)albums of any album.
456
- This reduces the number of db queries in certain circumstances e.g. when the coverimage selection method is set to random or most recent from subalbums.
457
  * The new photo description as defined in Table IX-D5 is now applied to all media types, if not overruled by the user and required by Table IX-D3.
458
  * Fixed a layout issue in masonry thumbnails while using Tabby.
459
  * The number of colums on mobile devices when thumbnail type is Masonry Columns is now half the number on pc.
@@ -673,7 +681,7 @@ In this case one should not cache the widget.
673
  This type is like masonry style vertical, but is fully mobile friendly.
674
  2. Masonry style mix. Uses Masonry style vert on pc and plus on mobile. Best of two worlds.
675
  * Some minor fixes.
676
- * New setting: Table VII-B1.0: Max nesting level. Limits the ability to create subalbums at the frontend to the indicated level.
677
  The album nesting level is displayed in parenthesis on the album admin page next to the id.
678
 
679
  = 7.3.10 =
@@ -721,7 +729,7 @@ Setting this for an administrator or a superuser has no effect.
721
  = 7.3.06 =
722
 
723
  * Table VI-C8: Album navigator Link has been moved to Table VI-A3.1 and the options are extended.
724
- * To Table VI-C11: Album cover subalbums link, added option "Subalbum title link". This also supports the otpion "the link page with a clean url" when set on the album admin page.
725
  * Added cache and delay checkboxes to shortcode generators.
726
  * Wppa cache is now also automatically cleard when a page or post is saved that contains a wppa shortcode.
727
  * Fixed a layout issue when Table IX-L3 (size of [photo] shortcode photo) was set to a fraction i.e. a positive value < 1.0;
@@ -818,7 +826,7 @@ If an update comes with a changed default value, and the setting had been set to
818
  The parent attribute overrules a possible album attribute.
819
  The parent attribute may be an enumeration of parent ids.
820
  Note that parent="0" means: all non separate albums, and parent="-1" means: all separate albums.
821
- * The most recent status of the 'opened' lists of subalbums of the album table on the album admin page is now remembered like the open tables of the settings page.
822
  * New setting: Table IX-E23. In case of conflicts you can set the form method for search to 'get' as opposed to 'post'.
823
 
824
  = 7.2.14 =
@@ -967,7 +975,7 @@ It will now be updated immediately when update is pending and the value is reque
967
  * Changed defaults for Table IX-D19 and IX-D20 as this seems to be the most convenient.
968
  * The mailing of frontload upload notifications will now combine multiple photos in one notification email for photos that have the same owner and are in the same album,
969
  and the uploads have been done during a period of max 5 minutes.
970
- * For users who can create (sub) albums, the uplaod widget and the box created by [wppa type="upload"] will now show a selectionbox of parents where the user can create a subalbum.
971
  The selectionbox may contain --- none --- and --- separate --- if the user can create toplevel albums.
972
  * The number of downloads as enabled in Table VI-C1.x is now registered.
973
  * Added w#dlcount as photo description keyword to display the download count.
1
  WP Photo Album Plus Changelog
2
 
3
+ = 8.3.01 =
4
+
5
+ * Maintenance release
6
+ * It is now properly detected when an album owner no longer exists.
7
+ * Many textual corrections.
8
+ * Pagination of admin pages made like the wp style, with the addition of page size selection at the top.
9
+ Admin page sizes are no longer in the settings page, but user individually remembered by transient options.
10
+
11
  = 8.2.09 =
12
 
13
  * New admin page: Email admin. Enables adding/removing subscribers from the various wppa email lists as well as enabling, disabling and clearing lists.
68
 
69
  * The display of the album and photo admin page has been restructured. Phase II
70
  * You can now enter exif dates ending in 00 min and 00 sec.
71
+ * New album setting: Max sub albums. This setting only limits the creation of sub albums at the frontend and looks at direct sub albums only.
72
 
73
  = 8.2.02 =
74
 
75
  * Introduction of native blocks: Photo of the day, upload and simple slideshow. Usable for posts/pages and widgets.
76
+ * Textual corrections. The use of 'sub album' is now consistent.
77
  * Emai callback urls did not work when refuse unencrypted is enabled. Fixed.
78
  * The display of the album and photo admin page has been restructured.
79
 
461
  = 7.6.07 =
462
 
463
  * Speeded up by caching the list of sub(sub...)albums of any album.
464
+ This reduces the number of db queries in certain circumstances e.g. when the coverimage selection method is set to random or most recent from sub albums.
465
  * The new photo description as defined in Table IX-D5 is now applied to all media types, if not overruled by the user and required by Table IX-D3.
466
  * Fixed a layout issue in masonry thumbnails while using Tabby.
467
  * The number of colums on mobile devices when thumbnail type is Masonry Columns is now half the number on pc.
681
  This type is like masonry style vertical, but is fully mobile friendly.
682
  2. Masonry style mix. Uses Masonry style vert on pc and plus on mobile. Best of two worlds.
683
  * Some minor fixes.
684
+ * New setting: Table VII-B1.0: Max nesting level. Limits the ability to create sub albums at the frontend to the indicated level.
685
  The album nesting level is displayed in parenthesis on the album admin page next to the id.
686
 
687
  = 7.3.10 =
729
  = 7.3.06 =
730
 
731
  * Table VI-C8: Album navigator Link has been moved to Table VI-A3.1 and the options are extended.
732
+ * To Table VI-C11: Album cover sub albums link, added option "Sub album title link". This also supports the otpion "the link page with a clean url" when set on the album admin page.
733
  * Added cache and delay checkboxes to shortcode generators.
734
  * Wppa cache is now also automatically cleard when a page or post is saved that contains a wppa shortcode.
735
  * Fixed a layout issue when Table IX-L3 (size of [photo] shortcode photo) was set to a fraction i.e. a positive value < 1.0;
826
  The parent attribute overrules a possible album attribute.
827
  The parent attribute may be an enumeration of parent ids.
828
  Note that parent="0" means: all non separate albums, and parent="-1" means: all separate albums.
829
+ * The most recent status of the 'opened' lists of sub albums of the album table on the album admin page is now remembered like the open tables of the settings page.
830
  * New setting: Table IX-E23. In case of conflicts you can set the form method for search to 'get' as opposed to 'post'.
831
 
832
  = 7.2.14 =
975
  * Changed defaults for Table IX-D19 and IX-D20 as this seems to be the most convenient.
976
  * The mailing of frontload upload notifications will now combine multiple photos in one notification email for photos that have the same owner and are in the same album,
977
  and the uploads have been done during a period of max 5 minutes.
978
+ * For users who can create (sub) albums, the uplaod widget and the box created by [wppa type="upload"] will now show a selectionbox of parents where the user can create a sub album.
979
  The selectionbox may contain --- none --- and --- separate --- if the user can create toplevel albums.
980
  * The number of downloads as enabled in Table VI-C1.x is now registered.
981
  * Added w#dlcount as photo description keyword to display the download count.
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.09.001
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -1053,7 +1053,7 @@ function wppaAjaxUpdateOptionCheckBox(slug, elm) {
1053
  '&wppa-nonce='+document.getElementById('wppa-nonce').value;
1054
  if (elm.checked) myData += '&value=yes';
1055
  else myData += '&value=no';
1056
-
1057
  // jQuery('#img_'+slug).attr('src',wppaImageDirectory+'spinner.gif');
1058
 
1059
  jQuery.ajax( { url: wppaAjaxUrl,
@@ -1071,7 +1071,7 @@ function wppaAjaxUpdateOptionCheckBox(slug, elm) {
1071
  if (ArrValues[0] != '') {
1072
  alert('The server returned unexpected output:\n'+ArrValues[0]);
1073
  }
1074
-
1075
  switch (ArrValues[1]) {
1076
  case '0': // No error
1077
  jQuery('#img_'+slug).attr('src',wppaImageDirectory+'tick.png');
@@ -2064,7 +2064,9 @@ function wppaSetThumbsize( elm ) {
2064
  jQuery(document).ready( function() {
2065
  if ( !document.getElementById( 'wppa-bulk-action' ) ) return;
2066
  var action = wppa_getCookie( 'wppa_bulk_action' );
2067
- document.getElementById( 'wppa-bulk-action' ).value = action;
 
 
2068
  if ( action == 'wppa-bulk-move-to' || action == 'wppa-bulk-copy-to' ) {
2069
  jQuery( '#wppa-bulk-album' ).css( 'display','inline' );
2070
  document.getElementById( 'wppa-bulk-album' ).value = wppa_getCookie( 'wppa_bulk_album' );
@@ -2134,7 +2136,7 @@ function wppaAjaxReplaceLog() {
2134
  },
2135
  success: function( result, status, xhr ) {
2136
  result = wppaEntityDecode(result);
2137
- jQuery( "#wppa-logbody" ).html( result );
2138
  jQuery( "#wppa-spinner" ).hide();
2139
  }
2140
  });
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 8.3.01.001
5
  /* Various js routines used in admin pages
6
  */
7
 
1053
  '&wppa-nonce='+document.getElementById('wppa-nonce').value;
1054
  if (elm.checked) myData += '&value=yes';
1055
  else myData += '&value=no';
1056
+
1057
  // jQuery('#img_'+slug).attr('src',wppaImageDirectory+'spinner.gif');
1058
 
1059
  jQuery.ajax( { url: wppaAjaxUrl,
1071
  if (ArrValues[0] != '') {
1072
  alert('The server returned unexpected output:\n'+ArrValues[0]);
1073
  }
1074
+
1075
  switch (ArrValues[1]) {
1076
  case '0': // No error
1077
  jQuery('#img_'+slug).attr('src',wppaImageDirectory+'tick.png');
2064
  jQuery(document).ready( function() {
2065
  if ( !document.getElementById( 'wppa-bulk-action' ) ) return;
2066
  var action = wppa_getCookie( 'wppa_bulk_action' );
2067
+ if ( action != '' ) {
2068
+ document.getElementById( 'wppa-bulk-action' ).value = action;
2069
+ }
2070
  if ( action == 'wppa-bulk-move-to' || action == 'wppa-bulk-copy-to' ) {
2071
  jQuery( '#wppa-bulk-album' ).css( 'display','inline' );
2072
  document.getElementById( 'wppa-bulk-album' ).value = wppa_getCookie( 'wppa_bulk_album' );
2136
  },
2137
  success: function( result, status, xhr ) {
2138
  result = wppaEntityDecode(result);
2139
+ jQuery( "#wppa-logbody" ).html( result.substr( 1 ));
2140
  jQuery( "#wppa-spinner" ).hide();
2141
  }
2142
  });
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){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 wppaAjaxDeleteExportZips(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delexportzips",async:!1,type:"GET",timeout:6e4,success:function(e,t,a){document.location.reload(!0)},error:function(e,t,a){wppaConsoleLog("wppaAjaxDeleteExportZips failed. Error = "+a+", status = "+t)}})}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)},complete:function(e,t,a){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(i,l,e,c,s,d){s=s||"",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(s+'<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>",c&&(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)},complete:function(e,t,a){var p=(p=document.location.href).replace(/&pano-val=./,"");c?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,c){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&&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]),c&&"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)},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(p,e){var t="action=wppa&wppa-action=update-option&wppa-option="+p+"&wppa-nonce="+document.getElementById("wppa-nonce").value;e.checked?t+="&value=yes":t+="&value=no",jQuery.ajax({url:wppaAjaxUrl,data:t,async:!0,type:"POST",timeout:1e4,beforeSend:function(e,t){jQuery("#img_"+p).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){e=wppaTrim(e).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(jQuery("#img_"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+p).attr("title",e[2])):(jQuery("#img_"+p).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+p).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+xmlhttp.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))},error:function(e,t,a){jQuery("#img_"+p).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+p).attr("title","Communication error, status = "+xmlhttp.status)},complete:function(){wppaCheckInconsistencies()}})}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),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;if(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){e=wppaEntityDecode(a.responseText).split("|"),a=e[0];e[0]="";e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};try{jQuery("#wppa-modal-container").dialog("destroy")}catch{jQuery("#wppa-modal-container").html("")}jQuery("#wppa-modal-container").html(e),jQuery("#wppa-modal-container").dialog(t),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"}),"private"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"transparent",borderColor:"#cccccc"}),"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){},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 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){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 wppaAjaxDeleteExportZips(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delexportzips",async:!1,type:"GET",timeout:6e4,success:function(e,t,a){document.location.reload(!0)},error:function(e,t,a){wppaConsoleLog("wppaAjaxDeleteExportZips failed. Error = "+a+", status = "+t)}})}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)},complete:function(e,t,a){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(i,l,e,c,s,d){s=s||"",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(s+'<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>",c&&(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)},complete:function(e,t,a){var p=(p=document.location.href).replace(/&pano-val=./,"");c?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,c){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&&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]),c&&"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)},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(p,e){var t="action=wppa&wppa-action=update-option&wppa-option="+p+"&wppa-nonce="+document.getElementById("wppa-nonce").value;e.checked?t+="&value=yes":t+="&value=no",jQuery.ajax({url:wppaAjaxUrl,data:t,async:!0,type:"POST",timeout:1e4,beforeSend:function(e,t){jQuery("#img_"+p).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){e=wppaTrim(e).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(jQuery("#img_"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+p).attr("title",e[2])):(jQuery("#img_"+p).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+p).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+xmlhttp.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))},error:function(e,t,a){jQuery("#img_"+p).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+p).attr("title","Communication error, status = "+xmlhttp.status)},complete:function(){wppaCheckInconsistencies()}})}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),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;if(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){e=wppaEntityDecode(a.responseText).split("|"),a=e[0];e[0]="";e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};try{jQuery("#wppa-modal-container").dialog("destroy")}catch{jQuery("#wppa-modal-container").html("")}jQuery("#wppa-modal-container").html(e),jQuery("#wppa-modal-container").dialog(t),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"}),"private"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"transparent",borderColor:"#cccccc"}),"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){},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.substr(1)),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 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"))&&(document.getElementById("wppa-bulk-action").value=e),"wppa-bulk-move-to"!=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)});
js/wppa-ajax-front.js CHANGED
@@ -3,7 +3,7 @@
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
- var wppaJsAjaxVersion = '8.2.09.001';
7
 
8
  // The new AJAX rendering routine Async
9
  function wppaDoAjaxRender( mocc, ajaxurl, newurl, addHilite ) {
@@ -30,148 +30,153 @@ function wppaDoAjaxRender( mocc, ajaxurl, newurl, addHilite ) {
30
  },
31
  success: function( xresult, status, xhr ) {
32
 
33
- // wppaConsoleLog( 'Ajax render result starts with ' + xresult.substr(0,100), 'force');
34
- var theResult = JSON.parse(xresult);
35
- var result = theResult.html + '<script>' + theResult.js + '</script>';
36
-
37
- // Do not render modal if behind button. When behind button, there is no newurl,
38
- // so we test on the existence of newurl to see if it is behind button
39
- if ( wppaRenderModal && newurl ) {
40
-
41
- // Init dialog options
42
- var opt = {
43
- modal: true,
44
- resizable: true,
45
- width: wppaGetContainerWidth( mocc ),
46
- show: {
47
- effect: "fadeIn",
48
- duration: 400
49
- },
50
- closeText: "",
51
- classes: "wppa-dialog",
52
- };
53
-
54
- // Open modal dialog
55
- wppaPrepareModal(mocc);
56
- jQuery( '#wppa-modal-container-'+mocc ).html( result );
57
- jQuery( '#wppa-modal-container-'+mocc ).dialog( opt );
58
-
59
- var isSlide = result.indexOf('slide-frame') != -1;
60
- var theTop;
61
- if (isSlide) {
62
- if (wppaAreaMaxFracSlide == 1) {
63
- theTop = wppaWindowHeight() / 20;
64
- }
65
- else {
66
- theTop = ((wppaWindowHeight() - wppaWindowHeight() * wppaAreaMaxFracSlide)/2);
67
- }
68
- }
69
- else {
70
- if (wppaAreaMaxFrac == 1) {
71
- theTop = wppaWindowHeight() / 20;
72
  }
73
  else {
74
- theTop = ((wppaWindowHeight() - wppaWindowHeight() * wppaAreaMaxFrac)/2);
 
 
 
 
 
75
  }
76
- }
77
 
78
- // Adjust styles
79
- jQuery( '.ui-dialog' ).css( {
80
- boxShadow: '0px 0px 5px 5px #aaaaaa',
81
- borderRadius: wppaBoxRadius+'px',
82
- padding: '8px',
83
- backgroundColor: wppaModalBgColor,
84
- boxSizing: 'content-box',
85
- zIndex: 100000,
86
- margin: 'auto',
87
- overflow: 'hidden',
88
- position: 'fixed',
89
- left: ((wppaWindowWidth() - wppaGetContainerWidth(mocc))/2)+'px',
90
- top: theTop+'px',
91
- });
92
- jQuery( '.ui-dialog-titlebar' ).css(
93
- {
94
- lineHeight: '0px',
95
- height: '32px',
96
- }
97
- );
98
- jQuery( '.ui-button' ).css(
99
- {
100
- backgroundImage: wppaModalQuitImg,
101
- padding: 0,
102
- position: 'absolute',
103
- right: '8px',
104
- top: '8px',
105
- width: '16px',
106
- height: '16px',
107
- });
108
- jQuery( '.ui-button' ).attr( 'title', 'Close' );
109
-
110
- // Stop a possible slideshow
111
- jQuery( '.ui-button' ).on( 'click', function() { _wppaStop( mocc ); } );
112
-
113
- // Remove spinner
114
- jQuery( '.wppa-ajax-spin' ).stop().fadeOut();
115
-
116
- // Adjust modal container max height
117
- // jQuery("#wppa-modal-container-"+mocc).css({maxHeight:wppaWindowHeight()});
118
-
119
- // Add nicescroller optionally
120
- setTimeout(function() {
121
- if (jQuery().niceScroll) {
122
- jQuery(".wppa-albumlist-"+mocc).niceScroll(".wppa-nicewrap",{});
123
- jQuery(".wppa-slidelist-"+mocc).niceScroll(".wppa-nicewrap",{});
124
- };
125
- }, 1000);
126
- jQuery(document).trigger('resize');
127
 
128
- }
129
 
130
- // Not modal or behind button
131
- else {
132
- jQuery( '#wppa-container-'+mocc ).html( result );
133
 
134
- // If behind button: show hide buttton
135
- jQuery( '#wppa-button-hide-'+mocc ).show();
136
- }
137
 
138
 
139
- // Push the stack
140
- if ( wppaCanPushState && wppaUpdateAddressLine && newurl ) {
141
 
142
- wppaHis++;
143
 
144
- newurl = newurl.split('&amp;').join('&');
145
- jQuery(document).ready(function(){
146
- setTimeout(function(){
147
- try {
148
- history.pushState( {page: wppaHis, occur: mocc, type: 'html', html: result}, "", newurl );
149
- }
150
- catch( err ) {
151
  try {
152
- history.replaceState( {page: wppaHis, occur: mocc, type: 'html'}, "", newurl );
153
  }
154
  catch( err ) {
155
- wppaConsoleLog( 'Ajax rendering: History stack update and replace failed' );
 
 
 
 
 
156
  }
157
- }
158
- }, 1000);
159
- });
160
 
161
- if ( wppaFirstOccur == 0 ) wppaFirstOccur = mocc;
162
- }
163
 
164
- // If lightbox is on board, refresh the imagelist. It has just changed, you know!
165
- wppaUpdateLightboxes();
166
 
167
- // Update qrcode
168
- if ( typeof( wppaQRUpdate ) != 'undefined' ) {
169
- wppaQRUpdate( newurl );
170
- }
171
 
172
- // Run Autocol?
173
- wppaColWidth[mocc] = 0;
174
- _wppaDoAutocol( mocc, 'ajax' );
 
175
  },
176
  error: function( xhr, status, error ) {
177
  wppaConsoleLog( 'wppaDoAjaxRender failed. Error = ' + error + ', status = ' + status );
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsAjaxVersion = '8.3.01.006';
7
 
8
  // The new AJAX rendering routine Async
9
  function wppaDoAjaxRender( mocc, ajaxurl, newurl, addHilite ) {
30
  },
31
  success: function( xresult, status, xhr ) {
32
 
33
+ if ( xresult.substr( 0, 1 ) != '{' ) {
34
+ wppaConsoleLog( 'Ajax render result starts with ' + xresult.substr(0,100), 'force');
35
+ alert( 'Unexpected output: '+xresult.substr(0,100)+'...' );
36
+ }
37
+ else {
38
+ var theResult = JSON.parse(xresult);
39
+ var result = theResult.html + '<script>' + theResult.js + '</script>';
40
+
41
+ // Do not render modal if behind button. When behind button, there is no newurl,
42
+ // so we test on the existence of newurl to see if it is behind button
43
+ if ( wppaRenderModal && newurl ) {
44
+
45
+ // Init dialog options
46
+ var opt = {
47
+ modal: true,
48
+ resizable: true,
49
+ width: wppaGetContainerWidth( mocc ),
50
+ show: {
51
+ effect: "fadeIn",
52
+ duration: 400
53
+ },
54
+ closeText: "",
55
+ classes: "wppa-dialog",
56
+ };
57
+
58
+ // Open modal dialog
59
+ wppaPrepareModal(mocc);
60
+ jQuery( '#wppa-modal-container-'+mocc ).html( result );
61
+ jQuery( '#wppa-modal-container-'+mocc ).dialog( opt );
62
+
63
+ var isSlide = result.indexOf('slide-frame') != -1;
64
+ var theTop;
65
+ if (isSlide) {
66
+ if (wppaAreaMaxFracSlide == 1) {
67
+ theTop = wppaWindowHeight() / 20;
68
+ }
69
+ else {
70
+ theTop = ((wppaWindowHeight() - wppaWindowHeight() * wppaAreaMaxFracSlide)/2);
71
+ }
72
  }
73
  else {
74
+ if (wppaAreaMaxFrac == 1) {
75
+ theTop = wppaWindowHeight() / 20;
76
+ }
77
+ else {
78
+ theTop = ((wppaWindowHeight() - wppaWindowHeight() * wppaAreaMaxFrac)/2);
79
+ }
80
  }
 
81
 
82
+ // Adjust styles
83
+ jQuery( '.ui-dialog' ).css( {
84
+ boxShadow: '0px 0px 5px 5px #aaaaaa',
85
+ borderRadius: wppaBoxRadius+'px',
86
+ padding: '8px',
87
+ backgroundColor: wppaModalBgColor,
88
+ boxSizing: 'content-box',
89
+ zIndex: 100000,
90
+ margin: 'auto',
91
+ overflow: 'hidden',
92
+ position: 'fixed',
93
+ left: ((wppaWindowWidth() - wppaGetContainerWidth(mocc))/2)+'px',
94
+ top: theTop+'px',
95
+ });
96
+ jQuery( '.ui-dialog-titlebar' ).css(
97
+ {
98
+ lineHeight: '0px',
99
+ height: '32px',
100
+ }
101
+ );
102
+ jQuery( '.ui-button' ).css(
103
+ {
104
+ backgroundImage: wppaModalQuitImg,
105
+ padding: 0,
106
+ position: 'absolute',
107
+ right: '8px',
108
+ top: '8px',
109
+ width: '16px',
110
+ height: '16px',
111
+ });
112
+ jQuery( '.ui-button' ).attr( 'title', 'Close' );
113
+
114
+ // Stop a possible slideshow
115
+ jQuery( '.ui-button' ).on( 'click', function() { _wppaStop( mocc ); } );
116
+
117
+ // Remove spinner
118
+ jQuery( '.wppa-ajax-spin' ).stop().fadeOut();
119
+
120
+ // Adjust modal container max height
121
+ // jQuery("#wppa-modal-container-"+mocc).css({maxHeight:wppaWindowHeight()});
122
+
123
+ // Add nicescroller optionally
124
+ setTimeout(function() {
125
+ if (jQuery().niceScroll) {
126
+ jQuery(".wppa-albumlist-"+mocc).niceScroll(".wppa-nicewrap",{});
127
+ jQuery(".wppa-slidelist-"+mocc).niceScroll(".wppa-nicewrap",{});
128
+ };
129
+ }, 1000);
130
+ jQuery(document).trigger('resize');
131
 
132
+ }
133
 
134
+ // Not modal or behind button
135
+ else {
136
+ jQuery( '#wppa-container-'+mocc ).html( result );
137
 
138
+ // If behind button: show hide buttton
139
+ jQuery( '#wppa-button-hide-'+mocc ).show();
140
+ }
141
 
142
 
143
+ // Push the stack
144
+ if ( wppaCanPushState && wppaUpdateAddressLine && newurl ) {
145
 
146
+ wppaHis++;
147
 
148
+ newurl = newurl.split('&amp;').join('&');
149
+ jQuery(document).ready(function(){
150
+ setTimeout(function(){
 
 
 
 
151
  try {
152
+ history.pushState( {page: wppaHis, occur: mocc, type: 'html', html: result}, "", newurl );
153
  }
154
  catch( err ) {
155
+ try {
156
+ history.replaceState( {page: wppaHis, occur: mocc, type: 'html'}, "", newurl );
157
+ }
158
+ catch( err ) {
159
+ wppaConsoleLog( 'Ajax rendering: History stack update and replace failed' );
160
+ }
161
  }
162
+ }, 1000);
163
+ });
 
164
 
165
+ if ( wppaFirstOccur == 0 ) wppaFirstOccur = mocc;
166
+ }
167
 
168
+ // If lightbox is on board, refresh the imagelist. It has just changed, you know!
169
+ wppaUpdateLightboxes();
170
 
171
+ // Update qrcode
172
+ if ( typeof( wppaQRUpdate ) != 'undefined' ) {
173
+ wppaQRUpdate( newurl );
174
+ }
175
 
176
+ // Run Autocol?
177
+ wppaColWidth[mocc] = 0;
178
+ _wppaDoAutocol( mocc, 'ajax' );
179
+ }
180
  },
181
  error: function( xhr, status, error ) {
182
  wppaConsoleLog( 'wppaDoAjaxRender failed. Error = ' + error + ', status = ' + status );
js/wppa-ajax-front.min.js CHANGED
@@ -1 +1 @@
1
- var wppaJsAjaxVersion="8.2.09.001";function wppaDoAjaxRender(o,a,r,p){""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[o]&&(a+="&resp=1"),p&&_wppaCurIdx[o]&&_wppaId[o][_wppaCurIdx[o]]&&(a+="&wppa-hilite="+_wppaId[o][_wppaCurIdx[o]]),wppaCanAjaxRender||!r?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[o]&&_wppaStop(o),jQuery("#wppa-ajax-spin-"+o).fadeIn()},success:function(a,p,e){var a=JSON.parse(a),t=a.html+"<script>"+a.js+"<\/script>";wppaRenderModal&&r?(a={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"},wppaPrepareModal(o),jQuery("#wppa-modal-container-"+o).html(t),jQuery("#wppa-modal-container-"+o).dialog(a),a=-1!=t.indexOf("slide-frame")?1==wppaAreaMaxFracSlide?wppaWindowHeight()/20:(wppaWindowHeight()-wppaWindowHeight()*wppaAreaMaxFracSlide)/2:1==wppaAreaMaxFrac?wppaWindowHeight()/20:(wppaWindowHeight()-wppaWindowHeight()*wppaAreaMaxFrac)/2,jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,margin:"auto",overflow:"hidden",position:"fixed",left:(wppaWindowWidth()-wppaGetContainerWidth(o))/2+"px",top:a+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(o)}),jQuery(".wppa-ajax-spin").stop().fadeOut(),setTimeout(function(){jQuery().niceScroll&&(jQuery(".wppa-albumlist-"+o).niceScroll(".wppa-nicewrap",{}),jQuery(".wppa-slidelist-"+o).niceScroll(".wppa-nicewrap",{}))},1e3),jQuery(document).trigger("resize")):(jQuery("#wppa-container-"+o).html(t),jQuery("#wppa-button-hide-"+o).show()),wppaCanPushState&&wppaUpdateAddressLine&&r&&(wppaHis++,r=r.split("&amp;").join("&"),jQuery(document).ready(function(){setTimeout(function(){try{history.pushState({page:wppaHis,occur:o,type:"html",html:t},"",r)}catch(a){try{history.replaceState({page:wppaHis,occur:o,type:"html"},"",r)}catch(a){wppaConsoleLog("Ajax rendering: History stack update and replace failed")}}},1e3)}),0==wppaFirstOccur&&(wppaFirstOccur=o)),wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(r),wppaColWidth[o]=0,_wppaDoAutocol(o,"ajax")},error:function(a,p,e){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+e+", status = "+p),r?document.location.href=r:document.location.reload(!0)},complete:function(a,p,e){!wppaRenderModal&&wppaAjaxScroll&&jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+o).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery(".wppa-ajax-spin").stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=r,wppaColWidth[o]=0,_wppaDoAutocol(o,"nonajax"))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+e+", status = "+p)}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+e+", status = "+p)}})}function wppaAjaxAddPhotoToZip(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){a=a.split("||");"OK"==a[0]&&(jQuery("#admin-choice-"+o+"-"+t).html(a[2]),jQuery("#admin-choice-"+o+"-"+t).val(a[2]),jQuery("#admin-choice-"+o+"-"+t).prop("disabled",!0)),alert(a[1]),r&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemovePhotoFromZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=removefromzip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-rem-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-rem-"+r+"-"+o).prop("disabled",!0),jQuery("#admin-choice-rem-"+r+"-"+o).css("text-decoration","")):alert(a),n&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhotoFromZip failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,p,e){document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+e+", status = "+p)}})}function wppaAjaxRequestInfo(a,p,e){dialogHtml='<div class="wppa-modal"><h3>'+wppaRequestInfoDialogText+'</h3><textarea id="wppa-request-info-text-'+a+'" style="width:98%;" ></textarea><div style="clear:both;" ></div><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Send" onclick="wppaAjaxRequestInfoSend( '+a+", "+p+", "+e+' )" /><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Cancel" onclick="jQuery( \'#wppa-modal-container-'+a+"' ).dialog( 'close' );\" /><div style=\"clear:both;\" ></div></div>";e={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"};wppaPrepareModal(a),jQuery("#wppa-modal-container-"+a).html(dialogHtml),jQuery("#wppa-modal-container-"+a).dialog(e),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,position:"fixed",top:wppaWindowHeight()/10+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(document).trigger("resize")}function wppaAjaxRequestInfoSend(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=requestinfo&photo-id="+r+"&emailtext="+jQuery("#wppa-request-info-text-"+o).val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#request-info-"+r+"-"+o).val(t[1]),jQuery("#request-info-"+r+"-"+o).prop("disabled",!0)):alert(a),n?document.location.reload(!0):(jQuery("#wppa-modal-container-"+o).dialog("close"),jQuery("#wppa-modal-container-"+o).html(""))},error:function(a,p,e){wppaConsoleLog("wppaAjaxRequestInfoSend failed. Error = "+e+", status = "+p)}})}function wppaEditPhoto(o,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+a+"&occur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){var t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"};wppaPrepareModal(o),jQuery("#wppa-modal-container-"+o).html(a),jQuery("#wppa-modal-container-"+o).dialog(t),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,position:"fixed",top:wppaWindowHeight()/10+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(document).trigger("resize"),jQuery(".ui-dialog").on("scroll wheel",function(a){a.stopPropagation()})},error:function(a,p,e){wppaConsoleLog("wppaEditPhoto failed. Error = "+e+", status = "+p)},complete:function(a,p,e){}})}function wppaPrevTags(a,p,e,t){for(var o,r=jQuery("."+a),n=[],i=jQuery("#"+e).val(),u=0,c=0,a="";u<r.length;)r[u].selected&&(n[c]=r[u].value,c++),u++;""!=(o=jQuery("#"+p).val())&&(n[c]=o),a=n.join(),""==o&&""==e||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+a+"&album="+i,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,p,e){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,p,e){jQuery("#"+t).html('<span style="color:red" >'+e+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+e+", status = "+p)}})}function wppaAjaxDestroyAlbum(a,p){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+p,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+e+", status = "+p)}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,p,e){},error:function(a,p,e){wppaConsoleLog("_bumpClickCount failed. Error = "+e+", status = "+p)}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){wppaPhotoView[t]=!0},error:function(a,p,e){wppaConsoleLog("_bumpViewCount failed. Error = "+e+", status = "+p)}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,p,e){wppaConsoleLog("wppaVoteThumb failed. Error = "+e+", status = "+p)}})}function _wppaRateIt(o,p){var a,e,t;0!=p&&(_wppaSSRuns[o]||(a=_wppaId[o][_wppaCurIdx[o]],e=_wppaMyr[o][_wppaCurIdx[o]],0<(t=_wppaWaitTexts[o][_wppaCurIdx[o]]).length?alert(t):0!=e&&wppaRatingOnce||e<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+a+"&wppa-occur="+o+"&wppa-index="+_wppaCurIdx[o]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+o+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+o+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");0==t[0]?900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(o)):alert("Error Code="+t[1]+"\n\n"+t[2]):(t[7]&&"likes"==t[7]?(a=t[4].split("|"),jQuery("#wppa-like-"+o).attr("title",a[0]),jQuery("#wppa-liketext-"+o).html(a[1]),"1"==t[3]?jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]):(_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(o),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7])),wppaNextOnCallback&&_wppaNextOnCallback(o))},error:function(a,p,e){wppaConsoleLog("_wppaRateIt failed. Error = "+e+", status = "+p)}}))))}function _wppaOvlRateIt(o,r,n,i){0!=r&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+r+"&wppa-rating-id="+o+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+n+"-"+r).stop().fadeTo(100,1),jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){a=t[4].split("|");return jQuery("#wppa-like-0").attr("title",a[0]),jQuery("#wppa-liketext-0").html(a[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+o+"-"+n).attr("title",a[0]),jQuery("#wppa-liketext-"+o+"-"+n).html(a[1]),void("1"==t[3]?jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbup.png"))}_wppaSetRd(n,t[4],".wppa-avg-"),_wppaSetRd(n,t[3],".wppa-rate-"),i||wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,p,e){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+e+", status = "+p)}})}function wppaAjaxMakeOrigName(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+p+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){a=a.split("||");"0"==a[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=a[2]):"file"==wppaArtMonkyLink&&window.open(a[2]),"zip"==wppaArtMonkyLink&&(document.location=a[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+a[1]+"\n\n"+a[2]))},error:function(a,p,e){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+e+", status = "+p)},complete:function(a,p,e){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,p,e){var t=a.split("||"),o=t[0],r=t[1],a=t[2];3==t.length&&""!=a&&alert("Attention:\n\n"+a),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,p,e){alert("An error occurred:\n"+e+"\nPlease try again")},complete:function(a,p,e){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){_wppaValidateComment(t,a)&&(a="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&occur="+t,void 0!==jQuery("#wppa-comemail-"+t).val()&&(a+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(a+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(a+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(a+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,p,e){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxComment failed. Error = "+e+", status = "+p)},complete:function(a,p,e){jQuery("#wppa-comment-spin-"+t).css("display","none")}}))}function wppaUpdatePhotoNew(a,r){for(var p,e=["upn-name","upn-description","upn-tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],t="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),o=0;o<e.length;)void 0!==jQuery("#"+e[o]).val()&&(t+="&"+e[o]+"="+jQuery("#"+e[o]).val()),void 0!==(p=wppaGetTinyMceContent(e[o]))&&(t+="&"+e[o]+"="+p),o++;jQuery("#upn-reload").prop("checked")&&(t+="&upn-reload=on"),jQuery.ajax({url:wppaAjaxUrl,data:t,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,p,e){var t=a.split("||");try{var o=JSON.parse(t[2]);jQuery(".sdd-"+r).html(o.desc),jQuery(".sdn-"+r).html(o.name),jQuery(".sdf-"+r).html(o.fullname),_wppaNames[r]&&(_wppaNames[r][_wppaCurIdx[r]]=wppaFixHtml(o.name),_wppaFullNames[r][_wppaCurIdx[r]]=wppaFixHtml(o.fullname),_wppaDsc[r][_wppaCurIdx[r]]=wppaFixHtml(o.desc),jQuery("#imagetitle-"+r).html(wppaMakeNameHtml(r)))}catch{wppaConsoleLog("Failed to report updates","force")}},error:function(a,p,e){wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+e+", status = "+p)},complete:function(a,p,e){jQuery("#upn-reload").prop("checked")?document.location.reload(!0):(jQuery("#wppa-modal-container-"+r).dialog("close"),jQuery("#wppa-modal-container-"+r).html(""))}})}function wppaFixHtml(a){return a=(a=(a=(a=a.replace(/\[/g,"<")).replace(/\]/g,">")).replace(/&quot;/g,'"')).replace(/\\n/g," ")}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){0!=jQuery(t).length&&wppaLastQrcodeUrl!=a&&(wppaLastQrcodeUrl=a,a="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,p,e){a=a.split("|");jQuery(t).attr("src",a[0]),jQuery(t).attr("title",a[1])},error:function(a,p,e){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+e+", status = "+p)}}))}function wppaAjaxNotify(a,t,o){a=jQuery(a).prop("checked")?"on":"off",a="action=wppa&wppa-action=mailinglist&wppa-ntfy-nonce="+jQuery("#wppa-ntfy-nonce").val()+"&list="+t+"&onoff="+a;o&&(a+="&wppa-user="+o),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,beforeSend:function(){o&&jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){o?(wppaConsoleLog(a,"force"),jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"tick.png")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxNotify failed. Error = "+e+", status = "+p),jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"cross.png")}})}function wppaAjaxGetSsIptcList(a,p,e,t){wppaAjaxGetSsIptcExifList(a,p,e,t,"iptc")}function wppaAjaxGetSsExifList(a,p,e,t){wppaAjaxGetSsIptcExifList(a,p,e,t,"exif")}function wppaAjaxGetSsIptcExifList(t,o,r,n,i){ajaxurl=wppaAjaxUrl,ajaxurl+="?action=wppa&wppa-action=getss"+i+"list&"+i+"tag="+o+"&occur="+t,jQuery.ajax({url:ajaxurl,async:!0,type:"GET",timeout:1e4,beforeSend:function(a){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(a,p,e){jQuery("#"+r).html(a),jQuery("#wppa-ss-"+i+"opts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-'+i+"list-"+t+'", "#'+r+'" )',10),n&&wppaConsoleLog("wppaAjaxGetSs"+i+"List success after retry.")},error:function(a,p,e){wppaConsoleLog("wppaAjaxGetSs"+i+"List failed. Error = "+e+", status = "+p),n||wppaAjaxGetSsIptcExifList(t,o,r,!0,i)},complete:function(a,p,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaPrepareModal(a){try{jQuery("#wppa-modal-container-"+a).dialog("destroy"),jQuery("#wppa-modal-container-"+a).html("")}catch{jQuery("#wppa-modal-container-"+a).html("")}}
1
+ var wppaJsAjaxVersion="8.3.01.006";function wppaDoAjaxRender(o,a,r,p){""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[o]&&(a+="&resp=1"),p&&_wppaCurIdx[o]&&_wppaId[o][_wppaCurIdx[o]]&&(a+="&wppa-hilite="+_wppaId[o][_wppaCurIdx[o]]),wppaCanAjaxRender||!r?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[o]&&_wppaStop(o),jQuery("#wppa-ajax-spin-"+o).fadeIn()},success:function(a,p,e){var t;"{"!=a.substr(0,1)?(wppaConsoleLog("Ajax render result starts with "+a.substr(0,100),"force"),alert("Unexpected output: "+a.substr(0,100)+"...")):(a=JSON.parse(a),t=a.html+"<script>"+a.js+"<\/script>",wppaRenderModal&&r?(a={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"},wppaPrepareModal(o),jQuery("#wppa-modal-container-"+o).html(t),jQuery("#wppa-modal-container-"+o).dialog(a),a=-1!=t.indexOf("slide-frame")?1==wppaAreaMaxFracSlide?wppaWindowHeight()/20:(wppaWindowHeight()-wppaWindowHeight()*wppaAreaMaxFracSlide)/2:1==wppaAreaMaxFrac?wppaWindowHeight()/20:(wppaWindowHeight()-wppaWindowHeight()*wppaAreaMaxFrac)/2,jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,margin:"auto",overflow:"hidden",position:"fixed",left:(wppaWindowWidth()-wppaGetContainerWidth(o))/2+"px",top:a+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(o)}),jQuery(".wppa-ajax-spin").stop().fadeOut(),setTimeout(function(){jQuery().niceScroll&&(jQuery(".wppa-albumlist-"+o).niceScroll(".wppa-nicewrap",{}),jQuery(".wppa-slidelist-"+o).niceScroll(".wppa-nicewrap",{}))},1e3),jQuery(document).trigger("resize")):(jQuery("#wppa-container-"+o).html(t),jQuery("#wppa-button-hide-"+o).show()),wppaCanPushState&&wppaUpdateAddressLine&&r&&(wppaHis++,r=r.split("&amp;").join("&"),jQuery(document).ready(function(){setTimeout(function(){try{history.pushState({page:wppaHis,occur:o,type:"html",html:t},"",r)}catch(a){try{history.replaceState({page:wppaHis,occur:o,type:"html"},"",r)}catch(a){wppaConsoleLog("Ajax rendering: History stack update and replace failed")}}},1e3)}),0==wppaFirstOccur&&(wppaFirstOccur=o)),wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(r),wppaColWidth[o]=0,_wppaDoAutocol(o,"ajax"))},error:function(a,p,e){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+e+", status = "+p),r?document.location.href=r:document.location.reload(!0)},complete:function(a,p,e){!wppaRenderModal&&wppaAjaxScroll&&jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+o).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery(".wppa-ajax-spin").stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=r,wppaColWidth[o]=0,_wppaDoAutocol(o,"nonajax"))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+e+", status = "+p)}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+e+", status = "+p)}})}function wppaAjaxAddPhotoToZip(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){a=a.split("||");"OK"==a[0]&&(jQuery("#admin-choice-"+o+"-"+t).html(a[2]),jQuery("#admin-choice-"+o+"-"+t).val(a[2]),jQuery("#admin-choice-"+o+"-"+t).prop("disabled",!0)),alert(a[1]),r&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemovePhotoFromZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=removefromzip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-rem-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-rem-"+r+"-"+o).prop("disabled",!0),jQuery("#admin-choice-rem-"+r+"-"+o).css("text-decoration","")):alert(a),n&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhotoFromZip failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,p,e){document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+e+", status = "+p)}})}function wppaAjaxRequestInfo(a,p,e){dialogHtml='<div class="wppa-modal"><h3>'+wppaRequestInfoDialogText+'</h3><textarea id="wppa-request-info-text-'+a+'" style="width:98%;" ></textarea><div style="clear:both;" ></div><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Send" onclick="wppaAjaxRequestInfoSend( '+a+", "+p+", "+e+' )" /><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Cancel" onclick="jQuery( \'#wppa-modal-container-'+a+"' ).dialog( 'close' );\" /><div style=\"clear:both;\" ></div></div>";e={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"};wppaPrepareModal(a),jQuery("#wppa-modal-container-"+a).html(dialogHtml),jQuery("#wppa-modal-container-"+a).dialog(e),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,position:"fixed",top:wppaWindowHeight()/10+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(document).trigger("resize")}function wppaAjaxRequestInfoSend(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=requestinfo&photo-id="+r+"&emailtext="+jQuery("#wppa-request-info-text-"+o).val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#request-info-"+r+"-"+o).val(t[1]),jQuery("#request-info-"+r+"-"+o).prop("disabled",!0)):alert(a),n?document.location.reload(!0):(jQuery("#wppa-modal-container-"+o).dialog("close"),jQuery("#wppa-modal-container-"+o).html(""))},error:function(a,p,e){wppaConsoleLog("wppaAjaxRequestInfoSend failed. Error = "+e+", status = "+p)}})}function wppaEditPhoto(o,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+a+"&occur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){var t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"};wppaPrepareModal(o),jQuery("#wppa-modal-container-"+o).html(a),jQuery("#wppa-modal-container-"+o).dialog(t),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,position:"fixed",top:wppaWindowHeight()/10+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(document).trigger("resize"),jQuery(".ui-dialog").on("scroll wheel",function(a){a.stopPropagation()})},error:function(a,p,e){wppaConsoleLog("wppaEditPhoto failed. Error = "+e+", status = "+p)},complete:function(a,p,e){}})}function wppaPrevTags(a,p,e,t){for(var o,r=jQuery("."+a),n=[],i=jQuery("#"+e).val(),u=0,c=0,a="";u<r.length;)r[u].selected&&(n[c]=r[u].value,c++),u++;""!=(o=jQuery("#"+p).val())&&(n[c]=o),a=n.join(),""==o&&""==e||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+a+"&album="+i,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,p,e){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,p,e){jQuery("#"+t).html('<span style="color:red" >'+e+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+e+", status = "+p)}})}function wppaAjaxDestroyAlbum(a,p){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+p,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+e+", status = "+p)}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,p,e){},error:function(a,p,e){wppaConsoleLog("_bumpClickCount failed. Error = "+e+", status = "+p)}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){wppaPhotoView[t]=!0},error:function(a,p,e){wppaConsoleLog("_bumpViewCount failed. Error = "+e+", status = "+p)}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,p,e){wppaConsoleLog("wppaVoteThumb failed. Error = "+e+", status = "+p)}})}function _wppaRateIt(o,p){var a,e,t;0!=p&&(_wppaSSRuns[o]||(a=_wppaId[o][_wppaCurIdx[o]],e=_wppaMyr[o][_wppaCurIdx[o]],0<(t=_wppaWaitTexts[o][_wppaCurIdx[o]]).length?alert(t):0!=e&&wppaRatingOnce||e<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+a+"&wppa-occur="+o+"&wppa-index="+_wppaCurIdx[o]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+o+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+o+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");0==t[0]?900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(o)):alert("Error Code="+t[1]+"\n\n"+t[2]):(t[7]&&"likes"==t[7]?(a=t[4].split("|"),jQuery("#wppa-like-"+o).attr("title",a[0]),jQuery("#wppa-liketext-"+o).html(a[1]),"1"==t[3]?jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]):(_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(o),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7])),wppaNextOnCallback&&_wppaNextOnCallback(o))},error:function(a,p,e){wppaConsoleLog("_wppaRateIt failed. Error = "+e+", status = "+p)}}))))}function _wppaOvlRateIt(o,r,n,i){0!=r&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+r+"&wppa-rating-id="+o+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+n+"-"+r).stop().fadeTo(100,1),jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){a=t[4].split("|");return jQuery("#wppa-like-0").attr("title",a[0]),jQuery("#wppa-liketext-0").html(a[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+o+"-"+n).attr("title",a[0]),jQuery("#wppa-liketext-"+o+"-"+n).html(a[1]),void("1"==t[3]?jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbup.png"))}_wppaSetRd(n,t[4],".wppa-avg-"),_wppaSetRd(n,t[3],".wppa-rate-"),i||wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,p,e){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+e+", status = "+p)}})}function wppaAjaxMakeOrigName(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+p+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){a=a.split("||");"0"==a[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=a[2]):"file"==wppaArtMonkyLink&&window.open(a[2]),"zip"==wppaArtMonkyLink&&(document.location=a[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+a[1]+"\n\n"+a[2]))},error:function(a,p,e){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+e+", status = "+p)},complete:function(a,p,e){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,p,e){var t=a.split("||"),o=t[0],r=t[1],a=t[2];3==t.length&&""!=a&&alert("Attention:\n\n"+a),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,p,e){alert("An error occurred:\n"+e+"\nPlease try again")},complete:function(a,p,e){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){_wppaValidateComment(t,a)&&(a="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&occur="+t,void 0!==jQuery("#wppa-comemail-"+t).val()&&(a+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(a+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(a+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(a+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,p,e){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxComment failed. Error = "+e+", status = "+p)},complete:function(a,p,e){jQuery("#wppa-comment-spin-"+t).css("display","none")}}))}function wppaUpdatePhotoNew(a,r){for(var p,e=["upn-name","upn-description","upn-tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],t="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),o=0;o<e.length;)void 0!==jQuery("#"+e[o]).val()&&(t+="&"+e[o]+"="+jQuery("#"+e[o]).val()),void 0!==(p=wppaGetTinyMceContent(e[o]))&&(t+="&"+e[o]+"="+p),o++;jQuery("#upn-reload").prop("checked")&&(t+="&upn-reload=on"),jQuery.ajax({url:wppaAjaxUrl,data:t,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,p,e){var t=a.split("||");try{var o=JSON.parse(t[2]);jQuery(".sdd-"+r).html(o.desc),jQuery(".sdn-"+r).html(o.name),jQuery(".sdf-"+r).html(o.fullname),_wppaNames[r]&&(_wppaNames[r][_wppaCurIdx[r]]=wppaFixHtml(o.name),_wppaFullNames[r][_wppaCurIdx[r]]=wppaFixHtml(o.fullname),_wppaDsc[r][_wppaCurIdx[r]]=wppaFixHtml(o.desc),jQuery("#imagetitle-"+r).html(wppaMakeNameHtml(r)))}catch{wppaConsoleLog("Failed to report updates","force")}},error:function(a,p,e){wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+e+", status = "+p)},complete:function(a,p,e){jQuery("#upn-reload").prop("checked")?document.location.reload(!0):(jQuery("#wppa-modal-container-"+r).dialog("close"),jQuery("#wppa-modal-container-"+r).html(""))}})}function wppaFixHtml(a){return a=(a=(a=(a=a.replace(/\[/g,"<")).replace(/\]/g,">")).replace(/&quot;/g,'"')).replace(/\\n/g," ")}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){0!=jQuery(t).length&&wppaLastQrcodeUrl!=a&&(wppaLastQrcodeUrl=a,a="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,p,e){a=a.split("|");jQuery(t).attr("src",a[0]),jQuery(t).attr("title",a[1])},error:function(a,p,e){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+e+", status = "+p)}}))}function wppaAjaxNotify(a,t,o){a=jQuery(a).prop("checked")?"on":"off",a="action=wppa&wppa-action=mailinglist&wppa-ntfy-nonce="+jQuery("#wppa-ntfy-nonce").val()+"&list="+t+"&onoff="+a;o&&(a+="&wppa-user="+o),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,beforeSend:function(){o&&jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){o?(wppaConsoleLog(a,"force"),jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"tick.png")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxNotify failed. Error = "+e+", status = "+p),jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"cross.png")}})}function wppaAjaxGetSsIptcList(a,p,e,t){wppaAjaxGetSsIptcExifList(a,p,e,t,"iptc")}function wppaAjaxGetSsExifList(a,p,e,t){wppaAjaxGetSsIptcExifList(a,p,e,t,"exif")}function wppaAjaxGetSsIptcExifList(t,o,r,n,i){ajaxurl=wppaAjaxUrl,ajaxurl+="?action=wppa&wppa-action=getss"+i+"list&"+i+"tag="+o+"&occur="+t,jQuery.ajax({url:ajaxurl,async:!0,type:"GET",timeout:1e4,beforeSend:function(a){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(a,p,e){jQuery("#"+r).html(a),jQuery("#wppa-ss-"+i+"opts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-'+i+"list-"+t+'", "#'+r+'" )',10),n&&wppaConsoleLog("wppaAjaxGetSs"+i+"List success after retry.")},error:function(a,p,e){wppaConsoleLog("wppaAjaxGetSs"+i+"List failed. Error = "+e+", status = "+p),n||wppaAjaxGetSsIptcExifList(t,o,r,!0,i)},complete:function(a,p,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaPrepareModal(a){try{jQuery("#wppa-modal-container-"+a).dialog("destroy"),jQuery("#wppa-modal-container-"+a).html("")}catch{jQuery("#wppa-modal-container-"+a).html("")}}
js/wppa-all.js CHANGED
@@ -5,7 +5,7 @@ function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trig
5
  // wppa-slideshow
6
  var wppaJsSlideshowVersion="8.2.08.005";function wppaStoreSlideInfo(p,a,e,t,i,w,r,n,o,l,s,d,u,_,m,c,h,y,S,g,f,x,I,j,Q,b,v,T,N,C,k,R,F){o=wppaRepairScriptTags(o),_wppaSlides[p]&&"0"!=a||(_wppaSlides[p]=[],_wppaNames[p]=[],_wppaFilmThumbTitles[p]=[],_wppaFullNames[p]=[],_wppaDsc[p]=[],_wppaOgDsc[p]=[],_wppaCurIdx[p]=-1,_wppaNxtIdx[p]=0,"random"==S?_wppaTimeOut[p]="random":0<parseInt(S)?_wppaTimeOut[p]=parseInt(S):_wppaTimeOut[p]=wppaSlideShowTimeOut,_wppaSSRuns[p]=!1,_wppaTP[p]=-2,_wppaFg[p]=0,_wppaIsBusy[p]=!1,_wppaFirst[p]=!0,_wppaId[p]=[],_wppaRealId[p]=[],_wppaAvg[p]=[],_wppaDisc[p]=[],_wppaMyr[p]=[],_wppaVRU[p]=[],_wppaLinkUrl[p]=[],_wppaLinkTitle[p]=[],_wppaLinkTarget[p]=[],_wppaCommentHtml[p]=[],_wppaIptcHtml[p]=[],_wppaExifHtml[p]=[],_wppaUrl[p]=[],_wppaSkipRated[p]=!1,_wppaLbTitle[p]=[],_wppaDidGoto[p]=!1,wppaSlidePause[p]=!1,_wppaShareUrl[p]=[],_wppaShareHtml[p]=[],_wppaFilmNoMove[p]=!1,_wppaHiresUrl[p]=[],_wppaIsVideo[p]=[],_wppaVideoHtml[p]=[],_wppaAudioHtml[p]=[],_wppaVideoNatWidth[p]=[],_wppaVideoNatHeight[p]=[],wppaVideoPlaying[p]=!1,wppaAudioPlaying[p]=!1,_wppaWaitTexts[p]=[],_wppaImageAlt[p]=[],_wppaFilename[p]=[]),S="default",""!=c?S="pointer":""!=wppaLightBox[p]&&(S="url( "+wppaImageDirectory+wppaMagnifierCursor+" ),pointer"),_wppaIsVideo[p][a]=""!=T,_wppaIsVideo[p][a]?(_wppaSlides[p][a]=' alt="'+k+'" class="theimg theimg-'+p+' big" ',wppaSlideVideoStart&&""==wppaLightBox[p]&&(_wppaSlides[p][a]+=" autoplay "),0<R.length&&(_wppaSlides[p][a]+=' poster="'+R+'" ')):_wppaSlides[p][a]=' src="'+e+'" alt="'+k+'" class="theimg theimg-'+p+' big stereo" ',wppaSlideSwipe&&(_wppaSlides[p][a]+=' ontouchstart="wppaTouchStart( event, this.id, '+p+' );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" '),wppaAutoColumnWidth[p]||(_wppaSlides[p][a]+='width="'+i+'" height="'+w+'" '),_wppaIsVideo[p][a]?(R="wppa"==wppaLightBox[p]?"":"controls",_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none;" '+R+">"+T+"</video>"):_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none; vertical-align:middle;">',_wppaFullNames[p][a]='<span class="sdf-'+p+'" >'+wppaRepairBrTags(r)+"</span>",_wppaNames[p][a]='<span class="sdn-'+p+'" >'+n+"</span>",_wppaFilmThumbTitles[p][a]=n,_wppaDsc[p][a]=o,_wppaOgDsc[p][a]=b,_wppaId[p][a]=l,_wppaRealId[p][a]=s,_wppaAvg[p][a]=d,_wppaDisc[p][a]=u,_wppaMyr[p][a]=_,_wppaVRU[p][a]=m,_wppaLinkUrl[p][a]=c,_wppaLinkTitle[p][a]=h,""!=y?_wppaLinkTarget[p][a]=y:wppaSlideBlank[p]?_wppaLinkTarget[p][a]="_blank":_wppaLinkTarget[p][a]="_self",_wppaCommentHtml[p][a]=g,_wppaIptcHtml[p][a]=f,_wppaExifHtml[p][a]=x,_wppaUrl[p][a]=e,_wppaLbTitle[p][a]=wppaRepairScriptTags(I),_wppaShareUrl[p][a]=j,_wppaShareHtml[p][a]=wppaRepairScriptTags(Q),_wppaHiresUrl[p][a]=v,_wppaVideoHtml[p][a]=T,_wppaAudioHtml[p][a]=N,_wppaVideoNatWidth[p][a]=i,_wppaVideoNatHeight[p][a]=w,_wppaWaitTexts[p][a]=C,_wppaImageAlt[p][a]=k,_wppaFilename[p][a]=F}function wppaSpeed(p,a){_wppaSSRuns[p]&&_wppaSpeed(p,a)}function wppaStopShow(p){_wppaSSRuns[p]&&_wppaStop(p)}function wppaStartStop(p,a){wppaSlideInitRunning[p]&&("start"==wppaSlideInitRunning[p]?a=-1:"stopprev"==wppaSlideInitRunning[p]?a=_wppaSlides[p].length-1:"stopnext"==wppaSlideInitRunning[p]&&(a=0),wppaSlideInitRunning[p]=""),_wppaIsBusy[p]&&(_wppaTP[p]=a),_wppaSSRuns[p]?_wppaStop(p):_wppaStart(p,a),wppaIsMobile&&(jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(10,1).fadeTo(3e3,0),jQuery(".ubb-"+p).stop().fadeTo(10,1).fadeTo(3e3,0))}function wppaBbb(p,a,e){_wppaSSRuns[p]||_wppaBbb(p,a,e)}function wppaUbb(p,a,e){_wppaUbb(p,a,e)}function wppaRateIt(p,a){_wppaRateIt(p,a)}function wppaOvlRateIt(p,a,e,t){_wppaOvlRateIt(p,a,e,t)}function wppaPrev(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrev(p)}function wppaPrevN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrevN(p,a)}function wppaFirst(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,0)}function wppaNext(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNext(p)}function wppaNextN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNextN(p,a)}function wppaLast(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,_wppaSlides[p].length-1)}function wppaFollowMe(p,a){_wppaSSRuns[p]||_wppaFollowMe(p,a)}function wppaLeaveMe(p,a){_wppaSSRuns[p]||_wppaLeaveMe(p,a)}function wppaGoto(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,a)}function wppaGotoFilmNoMove(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||(_wppaFilmNoMove[p]=!0,_wppaGoto(p,a))}function wppaGotoKeepState(p,a){_wppaNxtIdx[p]!=a&&(_wppaDidGoto[p]=!0,_wppaGotoKeepState(p,a))}function _wppaGotoKeepState(p,a){(_wppaSSRuns[p]?_wppaGotoRunning:_wppaGoto)(p,a)}function wppaGotoRunning(p,a){_wppaDidGoto[p]=!0,_wppaGotoRunning(p,a)}function wppaValidateComment(p){return _wppaValidateComment(p)}function _wppaNextSlide(p,a){var e=!document.getElementById("slide_frame-"+p);if(_wppaStopping[p])_wppaStopping[p]=0;else{if(!e&&!wppaIsSlidshowVisible(p))return wppaFilmInit[p]=!1,void setTimeout(function(){_wppaNextSlide(p,a)},400);if(_wppaLastIdx[p]=_wppaCurIdx[p],!document.getElementById("slide_frame-"+p)&&document.getElementById("filmwindow-"+p)&&wppaFilmonlyContinuous)return _wppaSSRuns[p]?(_wppaCurIdx[p]++,_wppaCurIdx[p]==_wppaSlides[p].length&&(_wppaCurIdx[p]=0),_wppaAdjustFilmstrip(p,"linear"),_wppaNxtIdx[p]=_wppaCurIdx[p],void setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",wppaAnimationSpeed)):(_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFilmInit[p]=!1,void _wppaAdjustFilmstrip(p,"linear"));if(document.getElementById("slide_frame-"+p)||document.getElementById("filmwindow-"+p)){var t=_wppaFg[p],e=1-t;if((wppaVideoPlaying[p]||wppaAudioPlaying[p])&&_wppaSSRuns[p])setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",500);else{if(wppaStopVideo(p),wppaStopAudio(p),"auto"==a){if(wppaSlidePause[p])return jQuery("#theimg"+t+"-"+p).attr("title",wppaSlidePause[p]),jQuery("#slide_frame-"+p).attr("title",wppaSlidePause[p]),void setTimeout("_wppaNextSlide( "+p+', "auto" )',250)}else jQuery("#slide_frame-"+p).removeAttr("title");if((_wppaSSRuns[p]||"auto"!=a)&&_wppaSlides[p]&&(!(_wppaSlides[p].length<2)||_wppaFirst[p])){if(_wppaSSRuns[p]||"reset"!=a||(_wppaSSRuns[p]=!0,__wppaOverruleRun=!1),_wppaVoteInProgress=!1,_wppaIsBusy[p]=!0,_wppaSSRuns[p]&&_wppaShowMetaData(p,"hide"),_wppaSSRuns[p]&&(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0)),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaCurIdx[p]]).css({display:"none"}),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaNxtIdx[p]]).css({display:""}),"undefined"!=typeof _wppaLat&&_wppaLat[p]?(n=_wppaRealId[p],_wppaLat[p][n[_wppaNxtIdx[p]]]?(jQuery("#map-canvas-"+p).css("display",""),wppaGeoInit(p,_wppaLat[p][n[_wppaNxtIdx[p]]],_wppaLon[p][n[_wppaNxtIdx[p]]])):jQuery("#map-canvas-"+p).css("display","none")):jQuery("#map-canvas-"+p).css("display","none"),jQuery("[id^=wppa-numbar-"+p+"-]").css({backgroundColor:wppaBGcolorNumbar,borderColor:wppaBcolorNumbar,fontFamily:wppaFontFamilyNumbar,fontSize:wppaFontSizeNumbar,color:wppaFontColorNumbar,fontWeight:wppaFontWeightNumbar}),jQuery("#wppa-numbar-"+p+"-"+_wppaNxtIdx[p]).css({backgroundColor:wppaBGcolorNumbarActive,borderColor:wppaBcolorNumbarActive,fontFamily:wppaFontFamilyNumbarActive,fontSize:wppaFontSizeNumbarActive,color:wppaFontColorNumbarActive,fontWeight:wppaFontWeightNumbarActive}),_wppaSlides[p].length>wppaNumbarMax){var i,w,r=_wppaSlides[p].length-1,n=_wppaNxtIdx[p],o=(wppaNumbarMax-1)/2;n<o?(i=0,w=wppaNumbarMax-1-1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-o<n?(i=(w=r)-wppaNumbarMax+1+1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(w=n+o+.5-1,(i=n-o+1)<2?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-1<w?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})));for(var l=0;l<_wppaSlides[p].length;)0!=l&&l!=r&&(l<i||w<l)?jQuery("#wppa-numbar-"+p+"-"+l).css({display:"none"}):jQuery("#wppa-numbar-"+p+"-"+l).css({display:"block"}),l++}_wppaFirst[p]?(-1!=_wppaCurIdx[p]&&wppaMakeTheSlideHtml(p,"0",_wppaCurIdx[p]),wppaMakeTheSlideHtml(p,"1",_wppaNxtIdx[p]),jQuery("#imagedesc-"+p).html(_wppaDsc[p][_wppaCurIdx[p]]),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),"icons"==wppaSlideshowNavigationType?(o=wppaIconSize(p,"1.5em",!1),jQuery("#prev-arrow-"+p).html(wppaSvgHtml("Prev-Button",o,!1,!0)),jQuery("#next-arrow-"+p).html(wppaSvgHtml("Next-Button",o,!1,!0))):wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPrevP),jQuery("#next-arrow-"+p).html(wppaNextP+"&nbsp;&raquo;")):(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPreviousPhoto),jQuery("#next-arrow-"+p).html(wppaNextPhoto+"&nbsp;&raquo;")),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating))):wppaMakeTheSlideHtml(p,e,_wppaNxtIdx[p]),_wppaLoadSpinner(p),_wppaFirst[p]=!1,_wppaCheckRewind(p),setTimeout("_wppaNextSlide_2( "+p+" )",10)}}}}}function _wppaNextSlide_2(p){var a=_wppaFg[p],e=1-a,t=document.getElementById("theimg"+e+"-"+p);!t||1!=t.nodeType||"IMG"!=t.nodeName||t.complete?(wppaUpdateLightboxes(),_wppaUnloadSpinner(p),-1!=_wppaSSRuns[p]&&(_wppaToTheSame||_wppaShowMetaData(p,"hide")),_wppaFg[p]=1-_wppaFg[p],_wppaFg[p],setTimeout("_wppaNextSlide_3( "+p+" )",10)):setTimeout("_wppaNextSlide_2( "+p+" )",200)}function _wppaNextSlide_3(p){var a=_wppaFg[p],e=1-a,t=_wppaCurIdx[p],i=_wppaNxtIdx[p],w="#theslide"+e+"-"+p,r="#theslide"+a+"-"+p,n="#theimg"+e+"-"+p,o="#theimg"+a+"-"+p,l=parseInt(jQuery(w).css("width")),s=t==i+1?"right":t==i-1?"left":t==i?"none":"nil";switch(t==_wppaSlides[p].length-1&&0==i&&wppaSlideWrap[p]&&(s="left"),0==t&&i==_wppaSlides[p].length-1&&wppaSlideWrap[p]&&(s="right"),"nil"==s&&(s=t<i?"left":"right"),jQuery(w).css({marginLeft:0,width:l}),jQuery(r).css({marginLeft:0,width:l}),wppaFormatSlide(p),wppaAnimationType){case"fadeafter":wppaFadeOut(n,wppaAnimationSpeed),setTimeout(wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p)),wppaAnimationSpeed);break;case"swipe":switch(s){case"left":wppaAnimate(w,{marginLeft:-l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"right":wppaAnimate(w,{marginLeft:l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:-l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"none":wppaFadeIn(o,10),setTimeout("_wppaNextSlide_4( "+p+" )",10)}break;default:wppaFadeOut(n,wppaAnimationSpeed),wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p))}}function _wppaNextSlide_4(p){var a=_wppaFg[p],e="#theslide"+a+"-"+p;jQuery("#theslide"+(1-a)+"-"+p).css({zIndex:80}),jQuery(e).css({zIndex:81}),_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFormatSlide(p),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length):jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length),jQuery("#bc-pname-modal-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),jQuery("#bc-pname-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),_wppaAdjustFilmstrip(p,wppaEasingSlide),_wppaSetRatingDisplay(p),setTimeout("_wppaNextSlide_5( "+p+" )",_wppaTextDelay)}function _wppaNextSlide_5(p){var a,e,t;if(_wppaToTheSame||(a=_wppaDsc[p][_wppaCurIdx[p]],jQuery("#imagedesc-"+p).html(a),wppaHideWhenEmpty&&(""==(a=_wppaDsc[p][_wppaCurIdx[p]])||"&nbsp;"==a?jQuery("#descbox-"+p).css("display","none"):jQuery("#descbox-"+p).css("display","")),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),jQuery("#wppa-share-"+p).html(_wppaShareHtml[p][_wppaCurIdx[p]])),_wppaToTheSame=!1,wppaThumbPageSize?wppaThumbPage[p]=parseInt(((0|wppaSlideOffset[p])+_wppaCurIdx[p])/wppaThumbPageSize)+1:wppaThumbPage[p]=1,_wppaSSRuns[p]&&!wppaSlideWrap[p]&&_wppaCurIdx[p]+1==_wppaSlides[p].length)return _wppaIsBusy[p]=!1,void _wppaStop(p);if(_wppaShowMetaData(p,"show"),-2!=_wppaTP[p]){var i=_wppaTP[p];return _wppaTP[p]=-2,_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),_wppaDoAutocol(p,"next_5"),void wppaStartStop(p,i)}wppaUpdateLightboxes(),wppaIsMini[p]||(i=_wppaShareUrl[p][_wppaCurIdx[p]],"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(_wppaShareUrl[p][_wppaCurIdx[p]]),1<_wppaSlides[p].length&&wppaPushStateSlide(p,_wppaCurIdx[p],i)),_wppaSSRuns[p]?_wppaCurIdx[p]+1==_wppaSlides[p].length?(t=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<t.length&&"hidden"!=jQuery(t).css("visibility")?setTimeout(function(){wppaSlideInitRunning[p]="start",jQuery("#wppa-next-pagelink-"+p).trigger("click")},wppaGetSlideshowTimeout(p)):0<e.length?setTimeout(function(){jQuery(e).trigger("click")},wppaGetSlideshowTimeout(p)):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p))):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p)):_wppaStopping[p]=!1,jQuery(document).trigger("glossaryTooltipReady"),_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),wppaStopAudio(p),!wppaSlideAudioStart||0<(t=jQuery(".wppa-audio-"+_wppaId[p][_wppaCurIdx[p]]+"-"+p)).length&&((t=t[t.length-1])&&(wppaAudioPlaying[p]||t.play())),wppaProtect(),jQuery(window).trigger("resize")}function wppaFormatSlide(p){var a="theimg"+_wppaFg[p]+"-"+p,e=document.getElementById(a);if(e){var t="theslide"+_wppaFg[p]+"-"+p,i="slide_frame-"+p,w=jQuery("#wppa-container-"+p).width();wppaColWidth[p]=w;var r=jQuery(".wppa-audio-"+p),n=e.naturalWidth;void 0===n&&(n=parseInt(e.style.maxWidth));var o=e.naturalHeight;void 0===o&&(o=parseInt(e.style.maxHeight));var l=wppaAspectRatio[p],s=wppaFullSize[p],d=wppaFullFrameDelta[p],u=wppaPortraitOnly[p],_=wppaFullValign[p];void 0===_&&(_="none");var m=wppaFullHalign[p];void 0===m&&(m="none");var c,h,y,S,g,f,x,I,e=wppaStretch;if(u)c=w-d,S=y=0,x=g=w,I=f=(h=parseInt(c*o/n))+d,jQuery("#"+i).css({width:x,height:I}),jQuery("#"+t).css({width:g,height:f}),jQuery("#"+a).css({width:c,height:h});else{if(s<(x=w)&&(x=s),g=x,f=I=parseInt(x*l),e||x-d<=n||I-d<=o?l<(o+d)/(n+d)?(h=I-d,c=parseInt(h*n/o)):(c=x-d,h=parseInt(c*o/n)):(c=n,h=o),"default"!=_&&"none"!=_){switch(_){case"top":S=0;break;case"center":S=parseInt((I-(h+d))/2);break;case"bottom":S=I-(h+d);break;case"fit":S=0,f=I=h+d}jQuery("#"+a).css({marginTop:S,marginBottom:0})}if(jQuery("#"+i).css({width:x,height:I}),jQuery("#"+t).css({width:g,height:f}),jQuery("#"+a).css({width:c,height:h}),"default"!=_&&"none"!=_&&"none"!=m&&"default"!=m){switch(m){case"left":y=0;break;case"center":y=parseInt((w-x)/2);break;case"right":y=w-x}y<0&&(y=0),jQuery("#"+a).css({marginLeft:"auto",marginRight:"auto"}),jQuery("#"+i).css({marginLeft:y})}var i=jQuery(r).height(),j=(x-c)/2;i&&0<i&&(wppaAudioHeight=i,jQuery(r).css({height:wppaAudioHeight,width:c,left:j}))}j=_wppaHiresUrl[p][_wppaCurIdx[p]]||"";".pdf"==j.substr(j.length-4,j.length)&&jQuery("#"+t).css({width:"100%",height:"100%"});j=parseInt(x/3),t=2*j,r=0<r.length?I-wppaAudioHeight-wppaSlideBorderWidth-S:I;jQuery("#bbb-"+p+"-l").css({height:r,width:j,left:0}),jQuery("#bbb-"+p+"-r").css({height:r,width:j,left:t})}}function wppaMakeNameHtml(p){var a,e,t="";if(_wppaCurIdx[p]<0)return"";if("void"==_wppaFullNames[p][_wppaCurIdx[p]])return jQuery("#namebox-"+p).hide(),"";if(jQuery("#namebox-"+p).show(),wppaIsMini[p]||_wppaIsVideo[p][_wppaCurIdx[p]])t=_wppaFullNames[p][_wppaCurIdx[p]];else switch(wppaArtMonkyLink){case"file":case"zip":t=wppaArtMonkeyButton?_wppaFullNames[p][_wppaCurIdx[p]]?(a=-1!=_wppaFullNames[p][_wppaCurIdx[p]].indexOf("plus.png"),e=_wppaFullNames[p][_wppaCurIdx[p]].replace(/(<([^>]+)>)/gi,""),e=a?e.replace(" )"," +)"):e.replace(" )",")"),'<input type="button" title="Download" style="cursor:pointer;margin-bottom:0px;max-width:'+(wppaGetContainerWidth(p)-24)+'px;" class="wppa-download-button" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+'\' );" value="'+wppaDownLoad+": "+e+'" />'):"":wppaArtmonkeyFileNotSource?'<a href="'+_wppaUrl[p][_wppaCurIdx[p]]+'" title="Download" style="cursor:pointer;" download="'+_wppaFilename[p][_wppaCurIdx[p]]+'" >'+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>":'<a title="Download" style="cursor:pointer;" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+"' );\" >"+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>";break;case"none":case"new":t=_wppaFullNames[p][_wppaCurIdx[p]];break;default:t=""}return t=wppaRepairBrTags(t)}function wppaMakeTheSlideHtml(p,a,e){var t,i,w=_wppaIsVideo[p][e]?"video":"img",r="title";"wppa"==wppaLightBox[p]&&(r="data-lbtitle");var n=""==wppaLightBox[p]?' onpause="wppaVideoPlaying['+p+'] = false;" onplay="wppaVideoPlaying['+p+'] = true;"':"",o=_wppaHiresUrl[p][e]||"",l=".pdf"==o.substr(o.length-4,o.length);if(""!=_wppaLinkUrl[p][e])t=wppaSlideToFullpopup?'<a onclick="wppaStopAudio();wppaStopShow('+p+");"+_wppaLinkUrl[p][e]+'" target="'+_wppaLinkTarget[p][e]+'" title="'+_wppaLinkTitle[p][e]+'">'+(l?"<iframe "+n+' src="'+o+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+n+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>":"<a onclick=\"_bumpClickCount('"+_wppaId[p][e]+"');wppaStopAudio();wppaStopShow("+p+");window.open('"+_wppaLinkUrl[p][e]+"', '"+_wppaLinkTarget[p][e]+'\');" title="'+_wppaLinkTitle[p][e]+'">'+(l?"<iframe "+n+' src="'+o+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+n+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>";else if(""==wppaLightBox[p])t=l?"<iframe "+n+' src="'+o+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+n+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e];else{for(var s="",d=0,u=wppaLightboxSingle[p]?"":"[slide-"+p+"-"+a+"]";d<e;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),l=".pdf"==(o=_wppaHiresUrl[p][d]||"").substr(o.length-4,o.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(l?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+"></a>",d++;for(i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][e]:wppaMakeFullsizeUrl(_wppaUrl[p][e]),l=".pdf"==(o=_wppaHiresUrl[p][e]).substr(o.length-4,o.length),s+='<a href="'+i+'"'+(wppaSlideLinkEqual?' onclick="wppaStopAudio();wppaStopShow('+p+");jQuery('#wppa-film-"+e+"-"+p+"').trigger('click');return false;\"":' onclick="wppaStopAudio();wppaStopShow('+p+');"')+' style="cursor:pointer;" target="'+_wppaLinkTarget[p][e]+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][e]+'" data-videonatheight="'+_wppaVideoNatHeight[p][e]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][e])+'"':"")+(l?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][e])+'"':"")+" "+r+'="'+_wppaLbTitle[p][e]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+">"+(l?"<iframe "+n+' src="'+o+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+n+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>",d=e+1;d<_wppaUrl[p].length;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),l=".pdf"==(o=_wppaHiresUrl[p][d]).substr(o.length-4,o.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(l?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+"></a>",d++;t=s}""!=_wppaAudioHtml[p][e]&&(t+='<audio controls id="wppa-audio-'+_wppaId[p][e]+"-"+p+'" class="wppa-audio-'+p+" wppa-audio-"+_wppaId[p][e]+"-"+p+'" data-from="wppa" onplay="wppaAudioPlaying['+p+'] = true;" onpause="wppaAudioPlaying['+p+'] = false" style="position:relative;top:-'+(wppaAudioHeight+wppaSlideBorderWidth)+"px;z-index:10;width:"+_wppaVideoNatWidth[p][e]+'px;padding:0;box-sizing:border-box;" >'+_wppaAudioHtml[p][e]+"</audio>"),t=t.replace(/title=""/g,""),jQuery("#theslide"+a+"-"+p).html(t)}function wppaAdjustAllFilmstrips(p){jQuery(".wppa-filmstrip").each(function(){_wppaAdjustFilmstrip(jQuery(this).attr("id").substr(15),p)})}var wppaLastAnimFilmLoc=[];function _wppaAdjustFilmstrip(p,a){if("linear"!=a&&(a=wppaEasingSlide),document.getElementById("wppa-filmstrip-"+p)&&_wppaSlides[p]){var e,t,i,w,r=!document.getElementById("slide_frame-"+p);if(wppaLastAnimFilmLoc[p]||(wppaLastAnimFilmLoc[p]=0),r){var n=jQuery("#wppa-filmstrip-"+p);if(!wppaIsElementInViewport(n))return}if(r||jQuery(".wppa-film-"+p).removeClass("wppa-filmthumb-active"),_wppaFilmNoMove[p]&&wppaFilmInit[p]?_wppaFilmNoMove[p]=!1:(e=wppaFilmStripLength[p]/2-(_wppaCurIdx[p]+.5+wppaPreambule[p])*wppaThumbnailPitch[p]-wppaFilmStripMargin[p],wppaFilmShowGlue&&(e-=2*wppaFilmStripMargin[p]+2),i=e+wppaThumbnailPitch[p],w=e-wppaThumbnailPitch[p],t=wppaAnimationSpeed,wppaFilmInit[p]||(t=1),0==_wppaCurIdx[p]&&_wppaLastIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):0==_wppaLastIdx[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:w}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):(n=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),i=parseInt(e),w=wppaThumbnailPitch[p],_wppaSSRuns[p]?(n<i?2:i<n-2*w?1:0)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+w}):(i<n-1.5*w||n+1.5*w<i)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i}),wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e,wppaFilmInit[p]=!0),_wppaLastIdx[p]=_wppaCurIdx[p]),wppaMakeLazyVisible("filmstripmocc="+p),!r&&-1!=_wppaCurIdx[p]){_wppaCurIdx[p];_wppaCurIdx[p]+10>_wppaSlides[p].length&&_wppaSlides[p].length;for(var o=0;o<_wppaSlides[p].length;)jQuery("#film_wppatnf_"+_wppaId[p][o]+"_"+p).html()&&(""!=jQuery("#wppa-film-"+o+"-"+p).attr("data-title")?(jQuery("#wppa-film-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title")),jQuery("#wppa-pre-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title"))):""!=wppaFilmThumbTitle&&_wppaCurIdx[p]==o?(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaFilmThumbTitle),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaFilmThumbTitle)):(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]))),o++}r||jQuery("#wppa-film-"+_wppaCurIdx[p]+"-"+p).addClass("wppa-filmthumb-active")}}function _wppaNext(p){var a,e;!wppaSlideWrap[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1||(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length?(a=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<a.length&&"hidden"!=jQuery(a).css("visibility")?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery("#wppa-next-pagelink-"+p).trigger("click")):0<e.length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery(e).trigger("click")):_wppaNextSlide(p,_wppaNxtIdx[p]=0)):_wppaNextSlide(p,0))}function _wppaNextN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]>=_wppaSlides[p].length-a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]+a;_wppaNxtIdx[p]>=_wppaSlides[p].length;)_wppaNxtIdx[p]-=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaNextOnCallback(p){if(wppaSlideWrap[p]||_wppaCurIdx[p]!=_wppaSlides[p].length-1){if(_wppaSkipRated[p]){var a=_wppaCurIdx[p]+1;a==_wppaSlides[p].length&&(a=0);var e=a;if(0!=_wppaMyr[p][e]){for(++a==_wppaSlides[p].length&&(a=0);a!=e&&0!=_wppaMyr[p][a];)++a==_wppaSlides[p].length&&(a=0);e=a}_wppaNxtIdx[p]=e}else _wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0);_wppaNextSlide(p,0)}}function _wppaPrev(p){!wppaSlideWrap[p]&&0==_wppaCurIdx[p]||(_wppaNxtIdx[p]=_wppaCurIdx[p]-1,_wppaNxtIdx[p]<0?jQuery("#wppa-prev-page-last-item-"+p).length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopprev",jQuery("#wppa-prev-page-last-item-"+p).trigger("click")):(_wppaNxtIdx[p]+=_wppaSlides[p].length,_wppaNextSlide(p,0)):_wppaNextSlide(p,0))}function _wppaPrevN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]<a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]-a;_wppaNxtIdx[p]<0;)_wppaNxtIdx[p]+=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaGoto(p,a){_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,_wppaNextSlide(p,0)}function _wppaGotoRunning(p,a){_wppaIsBusy[p]?setTimeout("_wppaGotoRunning( "+p+","+a+" )",10):(_wppaSSRuns[p]=!1,_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,__wppaOverruleRun=!0,_wppaNextSlide(p,"manual"),_wppaGotoContinue(p))}function _wppaGotoContinue(p){_wppaIsBusy[p]?setTimeout("_wppaGotoContinue( "+p+" )",10):setTimeout("_wppaNextSlide( "+p+', "reset" )',wppaGetSlideshowTimeout(p)+10)}function _wppaStart(p,a){if(_wppaStopping[p])return _wppaStopping[p]--,void setTimeout(function(){_wppaStart(p,a)},(wppaAnimationSpeed+wppaGetSlideshowTimeout(p))/10);_wppaSSRuns[p]||(("icons"==wppaSlideshowNavigationType?_wppaStartIcons:_wppaStartText)(p,a),jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Pause-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50")))}function _wppaStartIcons(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}var t=wppaIconSize(p,"1.5em",!1);-1<a?(jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaSvgHtml("Pause-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).show(),jQuery("#speed1-"+p).show(),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStartText(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}-1<a?(jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaStop),jQuery("#speed0-"+p).css("display","inline"),jQuery("#speed1-"+p).css("display","inline"),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStop(p){_wppaStopping[p]=12,("icons"==wppaSlideshowNavigationType?_wppaStopIcons:_wppaStopText)(p),jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))}function _wppaStopIcons(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"1.5em",!1),!1,!0)),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaStopText(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaSpeed(p,a){"random"!=_wppaTimeOut[p]&&(a?500<_wppaTimeOut[p]&&(_wppaTimeOut[p]/=1.5):_wppaTimeOut[p]<6e4&&(_wppaTimeOut[p]*=1.5))}function _wppaLoadSpinner(p){}function _wppaUnloadSpinner(p){jQuery("#wppa-slide-spin-"+p).stop().fadeOut(),setTimeout(function(){jQuery("#wppa-slide-spin-"+p).stop().fadeOut()},1e3)}function _wppaCheckRewind(p){var a,e;document.getElementById("wppa-filmstrip-"+p)&&((e=Math.abs(_wppaCurIdx[p]-_wppaNxtIdx[p]))<=wppaFilmPageSize[p]||(1+wppaFilmStripLength[p]/wppaThumbnailPitch[p])/2<=e&&(a=wppaThumbnailPitch[p]*_wppaSlides[p].length,wppaFilmShowGlue&&(a+=2+2*wppaFilmStripMargin[p]),e=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),_wppaNxtIdx[p]>_wppaCurIdx[p]?e-=a:e+=a,jQuery("#wppa-filmstrip-"+p).css("margin-left",e+"px")))}function _wppaSetRatingDisplay(p){if(document.getElementById("wppa-rating-"+p)){var a,e,t=_wppaAvg[p][_wppaCurIdx[p]];if(void 0!==t){if("likes"==wppaRatingDisplayType){"void"==(e=_wppaMyr[p][_wppaCurIdx[p]])?(jQuery("#wppa-dislike-imgdiv-"+p).hide(),jQuery("#wppa-like-imgdiv-"+p).hide()):(jQuery("#wppa-dislike-imgdiv-"+p).show(),jQuery("#wppa-like-imgdiv-"+p).show());var w=t.split("|");return jQuery("#wppa-like-"+p).attr("title",w[0]),jQuery("#wppa-liketext-"+p).html(w[1]),void("1"==_wppaMyr[p][_wppaCurIdx[p]]?jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbup.png"))}if(t=(a=t.split("|"))[0],w=a[1],a=_wppaDisc[p][_wppaCurIdx[p]],e=_wppaMyr[p][_wppaCurIdx[p]],"void"==a)jQuery("#wppa-rating-"+p).hide();else{if(jQuery("#wppa-rating-"+p).show(),"graphic"==wppaRatingDisplayType)_wppaSetRd(p,t,"#wppa-avg-"),_wppaSetRd(p,e,"#wppa-rate-"),0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),document.getElementById("wppa-dislike-"+p)&&jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).stop().fadeTo(100,wppaStarOpacity),jQuery("#wppa-filler-"+p).attr("title",a));else{if(jQuery("#wppa-numrate-avg-"+p).html(t+" ( "+w+" ) "),jQuery(".wppa-my-rat-"+p).show(),"void"==e)jQuery("#wppa-numrate-mine-"+p).html(""),jQuery(".wppa-my-rat-"+p).hide();else if(wppaRatingOnce&&0<e)jQuery("#wppa-numrate-mine-"+p).html(e);else if(e<0)jQuery("#wppa-numrate-mine-"+p).html(" dislike");else{var r="";for(i=1;i<=wppaRatingMax;i++)e==i?r+='<span class="wppa-rating-numeric-mine" style="cursor:pointer; font-weight:bold;" onclick="_wppaRateIt( '+p+", "+i+' )">&nbsp;'+i+"&nbsp;</span>":(e>i-1&&e<i&&(r+="&nbsp;( "+e+" )&nbsp;"),r+='<span class="wppa-rating-numeric" style="cursor:pointer;" onclick="_wppaRateIt( '+p+", "+i+' )" onmouseover="this.style.fontWeight=\'bold\'" onmouseout="this.style.fontWeight=\'normal\'" >&nbsp;'+i+"&nbsp;</span>");jQuery("#wppa-numrate-mine-"+p).html(r)}0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline")),jQuery("#wppa-discount-"+p).html(a+"&bull; "),jQuery("#wppa-filler-"+p).css("display","none")}0==e?jQuery("#wppa-vote-button-"+p).val(wppaVoteForMe):jQuery("#wppa-vote-button-"+p).val(wppaVotedForMe),jQuery("#wppa-vote-count-"+p).html(w)}}}}function wppaGetDislikeText(p,a,e){return p}function _wppaSetRd(p,a,e){var t=parseInt(a),i=t+1,w=wppaStarOpacity+(a-t)*(1-wppaStarOpacity),r=wppaRatingMax;if("void"==a)jQuery("#wppa-my-rat-"+p).hide(),jQuery(".wppa-my-rat-"+p).hide(),jQuery(".wppa-rate-"+p).hide(),jQuery(".wppa-ratingthumb").hide(),jQuery("#wppa-numrate-mine-"+p).hide();else for(jQuery("#wppa-my-rat-"+p).show(),jQuery(".wppa-my-rat-"+p).show(),jQuery(".wppa-rate-"+p).show(),jQuery(".wppa-ratingthumb").show(),jQuery("#wppa-numrate-mine-"+p).show(),idx=1;idx<=r;idx++)"#wppa-rate-"!=e&&".wppa-rate-"!=e||jQuery(e+p+"-"+idx).attr("src")!=wppaImageDirectory+"star.ico"&&jQuery(e+p+"-"+idx).attr("src",wppaImageDirectory+"star.ico"),idx<=t?jQuery(e+p+"-"+idx).stop().fadeTo(100,1):idx==i?jQuery(e+p+"-"+idx).stop().fadeTo(100,w):jQuery(e+p+"-"+idx).stop().fadeTo(100,wppaStarOpacity)}function _wppaFollowMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,a,"#wppa-rate-")}function wppaOvlFollowMe(p,a,e){e||_wppaSetRd(p,a,".wppa-rate-")}function _wppaLeaveMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,_wppaMyr[p][_wppaCurIdx[p]],"#wppa-rate-")}function wppaOvlLeaveMe(p,a,e){_wppaSetRd(p,e,".wppa-rate-")}function _wppaValidateComment(p,a){if(a=a||_wppaId[p][_wppaCurIdx[p]],jQuery("#wppa-comname-"+p).val().length<1)return alert(wppaPleaseName),!1;if("required"==wppaEmailRequired||"optional"==wppaEmailRequired){var e=jQuery("#wppa-comemail-"+p).val();if("optional"==wppaEmailRequired&&0==e.length)return!0;var t=e.indexOf("@"),a=e.lastIndexOf(".");if(t<1||a<t+2||a+2>=e.length)return alert(wppaPleaseEmail),!1}return!(jQuery("#wppa-comment-"+p).val().length<1)||(alert(wppaPleaseComment),!1)}function _wppaGo(p){document.location=p}function _wppaBbb(p,a,e){if(!_wppaSSRuns[p]){var t="#bbb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".bbb-"+p).css("cursor","pointer");break;case"hide":jQuery(".bbb-"+p).removeAttr("title"),jQuery(".bbb-"+p).css("cursor","default");break;case"click":"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}}function _wppaUbb(p,a,e){var t="#ubb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".ubb-"+p).css("cursor","pointer"),jQuery(".ubb-"+p).stop().fadeTo(200,.8),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,.8);break;case"hide":jQuery(".ubb-"+p).removeAttr("title"),jQuery(".ubb-"+p).css("cursor","default"),wppaIsMobile?jQuery(".ubb-"+p).stop().fadeTo(200,.1):jQuery(".ubb-"+p).stop().fadeTo(200,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,0);break;case"click":wppaIsMobile&&(jQuery(".ubb-"+p).stop().fadeTo(200,1).fadeTo(1e3,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,1).fadeTo(1e3,0)),"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}function wppaOpenComments(p){_wppaSSRuns[p]&&_wppaStop(p),jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none"),wppaColWidth[p]=0,setTimeout("_wppaDoAutocol( "+p+" )",100)}function _wppaShowMetaData(p,a){_wppaSlides[p]&&(_wppaSSRuns[p]||__wppaOverruleRun?"show"==a?wppaFotomotoHideWhenRunning||wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]]):wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display","none"):"show"==a?(wppaAutoOpenComments&&(jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none")),0!=_wppaCurIdx[p]&&jQuery(".wppa-first-"+p).show(),_wppaCurIdx[p]!=_wppaSlides[p].length-1&&jQuery(".wppa-last-"+p).show(),wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display",""),wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]])):(jQuery("#wppa-comtable-wrap-"+p).css("display","none"),jQuery("#wppa-comform-wrap-"+p).css("display","none"),jQuery("#wppa-comfooter-wrap-"+p).css("display","block"),wppaFotomotoHide(p)),"show"==a?(jQuery("#imagedesc-"+p).css("visibility","visible"),jQuery("#imagetitle-"+p).css("visibility","visible"),jQuery("#counter-"+p).css("visibility","visible"),jQuery("#iptccontent-"+p).css("visibility","visible"),jQuery("#exifcontent-"+p).css("visibility","visible")):(jQuery("#counter-"+p).css("visibility","hidden"),jQuery(".wppa-first-"+p).hide(),jQuery(".wppa-last-"+p).hide(),jQuery("#iptccontent-"+p).css("visibility","hidden"),jQuery("#exifcontent-"+p).css("visibility","hidden")))}function wppaGetSlideshowTimeout(p){var a,e;return"random"==_wppaTimeOut[p]?(a=2*wppaAnimationSpeed,e=7*wppaAnimationSpeed,Math.floor(Math.random()*(e-a+1))+a):_wppaTimeOut[p]}function wppaIsSlidshowVisible(p){for(var a,e=["slide_frame-"+p,"filmwindow-"+p],t=e.length,i=0;i<t;i++)if(a=document.getElementById(e[i]),a&&(a.getBoundingClientRect(),wppaIsElementInViewport(a)))return!0;return wppaFilmInit[p]=!1}
7
  // wppa-ajax-front
8
- var wppaJsAjaxVersion="8.2.09.001";function wppaDoAjaxRender(o,a,r,p){""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[o]&&(a+="&resp=1"),p&&_wppaCurIdx[o]&&_wppaId[o][_wppaCurIdx[o]]&&(a+="&wppa-hilite="+_wppaId[o][_wppaCurIdx[o]]),wppaCanAjaxRender||!r?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[o]&&_wppaStop(o),jQuery("#wppa-ajax-spin-"+o).fadeIn()},success:function(a,p,e){var a=JSON.parse(a),t=a.html+"<script>"+a.js+"<\/script>";wppaRenderModal&&r?(a={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"},wppaPrepareModal(o),jQuery("#wppa-modal-container-"+o).html(t),jQuery("#wppa-modal-container-"+o).dialog(a),a=-1!=t.indexOf("slide-frame")?1==wppaAreaMaxFracSlide?wppaWindowHeight()/20:(wppaWindowHeight()-wppaWindowHeight()*wppaAreaMaxFracSlide)/2:1==wppaAreaMaxFrac?wppaWindowHeight()/20:(wppaWindowHeight()-wppaWindowHeight()*wppaAreaMaxFrac)/2,jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,margin:"auto",overflow:"hidden",position:"fixed",left:(wppaWindowWidth()-wppaGetContainerWidth(o))/2+"px",top:a+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(o)}),jQuery(".wppa-ajax-spin").stop().fadeOut(),setTimeout(function(){jQuery().niceScroll&&(jQuery(".wppa-albumlist-"+o).niceScroll(".wppa-nicewrap",{}),jQuery(".wppa-slidelist-"+o).niceScroll(".wppa-nicewrap",{}))},1e3),jQuery(document).trigger("resize")):(jQuery("#wppa-container-"+o).html(t),jQuery("#wppa-button-hide-"+o).show()),wppaCanPushState&&wppaUpdateAddressLine&&r&&(wppaHis++,r=r.split("&amp;").join("&"),jQuery(document).ready(function(){setTimeout(function(){try{history.pushState({page:wppaHis,occur:o,type:"html",html:t},"",r)}catch(a){try{history.replaceState({page:wppaHis,occur:o,type:"html"},"",r)}catch(a){wppaConsoleLog("Ajax rendering: History stack update and replace failed")}}},1e3)}),0==wppaFirstOccur&&(wppaFirstOccur=o)),wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(r),wppaColWidth[o]=0,_wppaDoAutocol(o,"ajax")},error:function(a,p,e){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+e+", status = "+p),r?document.location.href=r:document.location.reload(!0)},complete:function(a,p,e){!wppaRenderModal&&wppaAjaxScroll&&jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+o).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery(".wppa-ajax-spin").stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=r,wppaColWidth[o]=0,_wppaDoAutocol(o,"nonajax"))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+e+", status = "+p)}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+e+", status = "+p)}})}function wppaAjaxAddPhotoToZip(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){a=a.split("||");"OK"==a[0]&&(jQuery("#admin-choice-"+o+"-"+t).html(a[2]),jQuery("#admin-choice-"+o+"-"+t).val(a[2]),jQuery("#admin-choice-"+o+"-"+t).prop("disabled",!0)),alert(a[1]),r&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemovePhotoFromZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=removefromzip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-rem-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-rem-"+r+"-"+o).prop("disabled",!0),jQuery("#admin-choice-rem-"+r+"-"+o).css("text-decoration","")):alert(a),n&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhotoFromZip failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,p,e){document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+e+", status = "+p)}})}function wppaAjaxRequestInfo(a,p,e){dialogHtml='<div class="wppa-modal"><h3>'+wppaRequestInfoDialogText+'</h3><textarea id="wppa-request-info-text-'+a+'" style="width:98%;" ></textarea><div style="clear:both;" ></div><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Send" onclick="wppaAjaxRequestInfoSend( '+a+", "+p+", "+e+' )" /><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Cancel" onclick="jQuery( \'#wppa-modal-container-'+a+"' ).dialog( 'close' );\" /><div style=\"clear:both;\" ></div></div>";e={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"};wppaPrepareModal(a),jQuery("#wppa-modal-container-"+a).html(dialogHtml),jQuery("#wppa-modal-container-"+a).dialog(e),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,position:"fixed",top:wppaWindowHeight()/10+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(document).trigger("resize")}function wppaAjaxRequestInfoSend(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=requestinfo&photo-id="+r+"&emailtext="+jQuery("#wppa-request-info-text-"+o).val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#request-info-"+r+"-"+o).val(t[1]),jQuery("#request-info-"+r+"-"+o).prop("disabled",!0)):alert(a),n?document.location.reload(!0):(jQuery("#wppa-modal-container-"+o).dialog("close"),jQuery("#wppa-modal-container-"+o).html(""))},error:function(a,p,e){wppaConsoleLog("wppaAjaxRequestInfoSend failed. Error = "+e+", status = "+p)}})}function wppaEditPhoto(o,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+a+"&occur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){var t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"};wppaPrepareModal(o),jQuery("#wppa-modal-container-"+o).html(a),jQuery("#wppa-modal-container-"+o).dialog(t),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,position:"fixed",top:wppaWindowHeight()/10+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(document).trigger("resize"),jQuery(".ui-dialog").on("scroll wheel",function(a){a.stopPropagation()})},error:function(a,p,e){wppaConsoleLog("wppaEditPhoto failed. Error = "+e+", status = "+p)},complete:function(a,p,e){}})}function wppaPrevTags(a,p,e,t){for(var o,r=jQuery("."+a),n=[],i=jQuery("#"+e).val(),u=0,c=0,a="";u<r.length;)r[u].selected&&(n[c]=r[u].value,c++),u++;""!=(o=jQuery("#"+p).val())&&(n[c]=o),a=n.join(),""==o&&""==e||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+a+"&album="+i,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,p,e){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,p,e){jQuery("#"+t).html('<span style="color:red" >'+e+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+e+", status = "+p)}})}function wppaAjaxDestroyAlbum(a,p){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+p,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+e+", status = "+p)}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,p,e){},error:function(a,p,e){wppaConsoleLog("_bumpClickCount failed. Error = "+e+", status = "+p)}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){wppaPhotoView[t]=!0},error:function(a,p,e){wppaConsoleLog("_bumpViewCount failed. Error = "+e+", status = "+p)}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,p,e){wppaConsoleLog("wppaVoteThumb failed. Error = "+e+", status = "+p)}})}function _wppaRateIt(o,p){var a,e,t;0!=p&&(_wppaSSRuns[o]||(a=_wppaId[o][_wppaCurIdx[o]],e=_wppaMyr[o][_wppaCurIdx[o]],0<(t=_wppaWaitTexts[o][_wppaCurIdx[o]]).length?alert(t):0!=e&&wppaRatingOnce||e<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+a+"&wppa-occur="+o+"&wppa-index="+_wppaCurIdx[o]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+o+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+o+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");0==t[0]?900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(o)):alert("Error Code="+t[1]+"\n\n"+t[2]):(t[7]&&"likes"==t[7]?(a=t[4].split("|"),jQuery("#wppa-like-"+o).attr("title",a[0]),jQuery("#wppa-liketext-"+o).html(a[1]),"1"==t[3]?jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]):(_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(o),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7])),wppaNextOnCallback&&_wppaNextOnCallback(o))},error:function(a,p,e){wppaConsoleLog("_wppaRateIt failed. Error = "+e+", status = "+p)}}))))}function _wppaOvlRateIt(o,r,n,i){0!=r&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+r+"&wppa-rating-id="+o+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+n+"-"+r).stop().fadeTo(100,1),jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){a=t[4].split("|");return jQuery("#wppa-like-0").attr("title",a[0]),jQuery("#wppa-liketext-0").html(a[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+o+"-"+n).attr("title",a[0]),jQuery("#wppa-liketext-"+o+"-"+n).html(a[1]),void("1"==t[3]?jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbup.png"))}_wppaSetRd(n,t[4],".wppa-avg-"),_wppaSetRd(n,t[3],".wppa-rate-"),i||wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,p,e){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+e+", status = "+p)}})}function wppaAjaxMakeOrigName(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+p+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){a=a.split("||");"0"==a[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=a[2]):"file"==wppaArtMonkyLink&&window.open(a[2]),"zip"==wppaArtMonkyLink&&(document.location=a[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+a[1]+"\n\n"+a[2]))},error:function(a,p,e){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+e+", status = "+p)},complete:function(a,p,e){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,p,e){var t=a.split("||"),o=t[0],r=t[1],a=t[2];3==t.length&&""!=a&&alert("Attention:\n\n"+a),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,p,e){alert("An error occurred:\n"+e+"\nPlease try again")},complete:function(a,p,e){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){_wppaValidateComment(t,a)&&(a="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&occur="+t,void 0!==jQuery("#wppa-comemail-"+t).val()&&(a+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(a+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(a+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(a+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,p,e){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxComment failed. Error = "+e+", status = "+p)},complete:function(a,p,e){jQuery("#wppa-comment-spin-"+t).css("display","none")}}))}function wppaUpdatePhotoNew(a,r){for(var p,e=["upn-name","upn-description","upn-tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],t="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),o=0;o<e.length;)void 0!==jQuery("#"+e[o]).val()&&(t+="&"+e[o]+"="+jQuery("#"+e[o]).val()),void 0!==(p=wppaGetTinyMceContent(e[o]))&&(t+="&"+e[o]+"="+p),o++;jQuery("#upn-reload").prop("checked")&&(t+="&upn-reload=on"),jQuery.ajax({url:wppaAjaxUrl,data:t,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,p,e){var t=a.split("||");try{var o=JSON.parse(t[2]);jQuery(".sdd-"+r).html(o.desc),jQuery(".sdn-"+r).html(o.name),jQuery(".sdf-"+r).html(o.fullname),_wppaNames[r]&&(_wppaNames[r][_wppaCurIdx[r]]=wppaFixHtml(o.name),_wppaFullNames[r][_wppaCurIdx[r]]=wppaFixHtml(o.fullname),_wppaDsc[r][_wppaCurIdx[r]]=wppaFixHtml(o.desc),jQuery("#imagetitle-"+r).html(wppaMakeNameHtml(r)))}catch{wppaConsoleLog("Failed to report updates","force")}},error:function(a,p,e){wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+e+", status = "+p)},complete:function(a,p,e){jQuery("#upn-reload").prop("checked")?document.location.reload(!0):(jQuery("#wppa-modal-container-"+r).dialog("close"),jQuery("#wppa-modal-container-"+r).html(""))}})}function wppaFixHtml(a){return a=(a=(a=(a=a.replace(/\[/g,"<")).replace(/\]/g,">")).replace(/&quot;/g,'"')).replace(/\\n/g," ")}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){0!=jQuery(t).length&&wppaLastQrcodeUrl!=a&&(wppaLastQrcodeUrl=a,a="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,p,e){a=a.split("|");jQuery(t).attr("src",a[0]),jQuery(t).attr("title",a[1])},error:function(a,p,e){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+e+", status = "+p)}}))}function wppaAjaxNotify(a,t,o){a=jQuery(a).prop("checked")?"on":"off",a="action=wppa&wppa-action=mailinglist&wppa-ntfy-nonce="+jQuery("#wppa-ntfy-nonce").val()+"&list="+t+"&onoff="+a;o&&(a+="&wppa-user="+o),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,beforeSend:function(){o&&jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){o?(wppaConsoleLog(a,"force"),jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"tick.png")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxNotify failed. Error = "+e+", status = "+p),jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"cross.png")}})}function wppaAjaxGetSsIptcList(a,p,e,t){wppaAjaxGetSsIptcExifList(a,p,e,t,"iptc")}function wppaAjaxGetSsExifList(a,p,e,t){wppaAjaxGetSsIptcExifList(a,p,e,t,"exif")}function wppaAjaxGetSsIptcExifList(t,o,r,n,i){ajaxurl=wppaAjaxUrl,ajaxurl+="?action=wppa&wppa-action=getss"+i+"list&"+i+"tag="+o+"&occur="+t,jQuery.ajax({url:ajaxurl,async:!0,type:"GET",timeout:1e4,beforeSend:function(a){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(a,p,e){jQuery("#"+r).html(a),jQuery("#wppa-ss-"+i+"opts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-'+i+"list-"+t+'", "#'+r+'" )',10),n&&wppaConsoleLog("wppaAjaxGetSs"+i+"List success after retry.")},error:function(a,p,e){wppaConsoleLog("wppaAjaxGetSs"+i+"List failed. Error = "+e+", status = "+p),n||wppaAjaxGetSsIptcExifList(t,o,r,!0,i)},complete:function(a,p,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaPrepareModal(a){try{jQuery("#wppa-modal-container-"+a).dialog("destroy"),jQuery("#wppa-modal-container-"+a).html("")}catch{jQuery("#wppa-modal-container-"+a).html("")}}
9
  // wppa-lightbox
10
  var wppaJsLightboxVersion="8.2.05.002";function wppaOvlKeyboardHandler(p){var a,t=(a=(null==p?event:p).keyCode,27),p=String.fromCharCode(a).toLowerCase();switch(a){case t:wppaStopVideo(0),wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext()}switch(p){case"p":wppaOvlShowPrev();break;case"n":wppaOvlShowNext();break;case"s":wppaOvlStartStop();break;case"f":wppaFsOn();break;case"q":case"x":wppaStopVideo(0),wppaOvlHide()}return!1}function wppaOvlShow(p){var a,t,e=jQuery;if(wppaOvlActivePanorama,e("#wppa-overlay-bg").css({display:"inline"}),wppaOvlFirst&&(e("#weaver-final").removeClass("wvr-hide-bang"),wppaKbHandlerInstalled||(e(document).on("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!0),e(window).trigger("wppalightboxstart")),"object"==typeof p){wppaOvlIds=[],wppaOvlUrls=[],wppaOvlTitles=[],wppaOvlAlts=[],wppaOvlTypes=[],wppaOvlVideoHtmls=[],wppaOvlAudioHtmls=[],wppaOvlPdfHtmls=[],wppaOvlVideoNaturalWidths=[],wppaOvlVideoNaturalHeights=[],wppaOvlImgs=[],wppaOvlIdx=0,wppaOvlPanoramaHtml=[],wppaOvlPanoramaIds=[],wppaOvlHasPanoramas=!1;var l=(p.rel||!!e(p).attr("data-rel")&&e(p).attr("data-rel")).split("[");if(l[1])for(var o,i=l[1],n=e("a"),w=0,r=0;r<n.length;r++)1<(l=!!e(o=n[r]).attr("data-rel")&&e(o).attr("data-rel").split("[")).length&&"wppa"==l[0]&&l[1]==i&&(wppaOvlUrls[w]=o.href,e(o).attr("data-lbtitle")?wppaOvlTitles[w]=wppaRepairScriptTags(e(o).attr("data-lbtitle")):wppaOvlTitles[w]=wppaRepairScriptTags(o.title),wppaOvlIds[w]=e(o).attr("data-id")?e(o).attr("data-id"):"0",wppaOvlAlts[w]=e(o).attr("data-alt")?e(o).attr("data-alt"):"",wppaOvlVideoHtmls[w]=e(o).attr("data-videohtml")?decodeURI(e(o).attr("data-videohtml")):"",wppaOvlPdfHtmls[w]=e(o).attr("data-pdfhtml")?decodeURI(e(o).attr("data-pdfhtml")):"",wppaOvlAudioHtmls[w]=e(o).attr("data-audiohtml")?decodeURI(e(o).attr("data-audiohtml")):"",wppaOvlVideoNaturalWidths[w]=e(o).attr("data-videonatwidth")?e(o).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[w]=e(o).attr("data-videonatheight")?e(o).attr("data-videonatheight"):"",a=e(o).attr("data-panorama")?e(o).attr("data-panorama"):"",panType=e(o).attr("data-pantype")?e(o).attr("data-pantype"):"",0<a.length?(wppaOvlHasPanoramas=!0,t=a.indexOf("."),wppaOvlPanoramaHtml[w]=a.substr(t+1),wppaOvlPanoramaIds[w]=a.substr(0,t),wppaOvlTypes[w]=panType):(wppaOvlPanoramaHtml[w]="",wppaOvlPanoramaIds[w]=0,wppaOvlTypes[w]=""),0<wppaOvlPdfHtmls[w].length&&(wppaOvlTypes[w]="document"),decodeURI(e(o).attr("data-pdfhtml"))==decodeURI(e(p).attr("data-pdfhtml"))&&decodeURI(e(o).attr("data-videohtml"))==decodeURI(e(p).attr("data-videohtml"))&&decodeURI(e(o).attr("data-audiohtml"))==decodeURI(e(p).attr("data-audiohtml"))&&o.href==p.href&&(wppaOvlIdx=w),w++);else wppaOvlUrls[0]=p.href,e(p).attr("data-lbtitle")?wppaOvlTitles[0]=wppaRepairScriptTags(e(p).attr("data-lbtitle")):wppaOvlTitles[0]=wppaRepairScriptTags(p.title),wppaOvlIds[0]=e(p).attr("data-id")?e(p).attr("data-id"):"0",wppaOvlAlts[0]=e(p).attr("data-alt")?e(p).attr("data-alt"):"",wppaOvlVideoHtmls[0]=e(p).attr("data-videohtml")?decodeURI(e(p).attr("data-videohtml")):"",wppaOvlAudioHtmls[0]=e(p).attr("data-audiohtml")?decodeURI(e(p).attr("data-audiohtml")):"",wppaOvlPdfHtmls[0]=e(p).attr("data-pdfhtml")?decodeURI(e(p).attr("data-pdfhtml")):"",wppaOvlVideoNaturalWidths[0]=e(p).attr("data-videonatwidth")?e(p).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[0]=e(p).attr("data-videonatheight")?e(p).attr("data-videonatheight"):"",a=e(p).attr("data-panorama")?e(p).attr("data-panorama"):"",panType=e(p).attr("data-pantype")?e(p).attr("data-pantype"):"",0<a.length?(wppaOvlHasPanoramas=!0,t=a.indexOf("."),wppaOvlPanoramaHtml[0]=a.substr(t+1),wppaOvlPanoramaIds[0]=a.substr(0,t),wppaOvlTypes[0]=panType):(wppaOvlPanoramaHtml[0]="",wppaOvlPanoramaIds[0]=0,wppaOvlTypes[0]=""),0<wppaOvlPdfHtmls[0].length&&(wppaOvlTypes[0]="document"),wppaOvlIdx=0}else wppaOvlIdx=p;wppaOvlOpen=!0,e("body").trigger("quitimage"),setTimeout(function(){_wppaOvlShow(wppaOvlIdx)},100)}function _wppaOvlShow(p){var a=jQuery;a("#wppa-overlay-ic").html("").hide(),a("#wppa-overlay-pc").html("").hide(),a("#wppa-overlay-fpc").html("").hide(),a("#wppa-overlay-zpc").html("").hide(),wppaOvlCurIdx=p,a("#wppa-ovl-spin").show(),wppaIsVideo=""!=wppaOvlVideoHtmls[p],wppaHasAudio=""!=wppaOvlAudioHtmls[p],wppaOvlIsPdf=""!=wppaOvlPdfHtmls[p];var t=wppaOvlIdx==wppaOvlUrls.length-1?0:wppaOvlIdx+1,e=0==wppaOvlIdx?wppaOvlUrls.length-1:wppaOvlIdx-1;if(""==wppaOvlTypes[t]&&""==wppaOvlVideoHtmls[t]&&wppaOvlOpen&&(document.getElementById("wppa-pre-next").src=wppaOvlUrls[t]),""==wppaOvlTypes[e]&&""==wppaOvlVideoHtmls[e]&&wppaOvlOpen&&(document.getElementById("wppa-pre-prev").src=wppaOvlUrls[e]),_bumpViewCount(wppaOvlIds[p]),wppaOvlIsSingle=1==wppaOvlUrls.length,wppaOvlActivePanorama=wppaOvlPanoramaIds[p],wppaOvlActivePanorama,wppaIsFs()||wppaOvlActivePanorama){if(wppaOvlActivePanorama?l=wppaOvlPanoramaHtml[p]:wppaIsVideo?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><video id="wppa-overlay-img" controls preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video></div>":wppaOvlIsPdf?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><iframe id="wppa-overlay-img" '+wppaOvlPdfHtmls[p]+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" ></iframe></div>':(l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><img id="wppa-overlay-img" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[p]+'" style="border:none; width:'+screen.width+'px; visibility:hidden; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata"'+(wppaOvlAudioStart?" autoplay":"")+' onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;left:0px;bottom:0px;padding:0;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),l+="</div>"),!wppaIsVideo&&!wppaHasAudio||wppaOvlFsPhotoId!=wppaPhotoId||0==wppaPhotoId)if(wppaStopVideo(0),wppaStopAudio(),0<wppaOvlActivePanorama)switch(wppaOvlTypes[p]){case"spheric":a("#wppa-overlay-pc").html(l).show();break;case"flat":a("#wppa-overlay-fpc").html(l).show();break;case"zoom":a("#wppa-overlay-zpc").html(l).show()}else a("#wppa-overlay-ic").html(l).show();return 0<wppaOvlPanoramaIds[p]&&wppaOvlIsSingle&&a(".wppa-pan-prevnext").hide(),wppaProtect(),wppaOvlIsVideo=wppaIsVideo,setTimeout(wppaOvlFormatFull,10),wppaIsVideo||wppaHasAudio?setTimeout(function(){wppaOvlFsPhotoId=wppaPhotoId},20):wppaOvlFsPhotoId=0,wppaOvlFirst=!1,""==wppaOvlTypes[p]&&a("#wppa-overlay-ic").show(),wppaFsShow(),wppaProtect(),!1}wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaStopVideo(0);t="black"==wppaOvlTheme?"#a7a7a7":"#272727";wppaOvlFontColor&&(t=wppaOvlFontColor);wppaOvlUrls.length;0==wppaOvlActivePanorama&&a("#wppa-overlay-ic").css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop});var l="";l+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >',wppaIsVideo?(l+='<video id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" controls style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video>",wppaOvlIsVideo=!0):wppaOvlIsPdf?l+="<iframe "+wppaOvlPdfHtmls[p]+' id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" ></iframe>':(l+='<img id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[p]+'" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata" onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;box-shadow:none;left:0;bottom:0;padding:0 '+wppaOvlBorderWidth+'px;margin:0;background-color:transparent;box-sizing:border-box;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),wppaOvlIsVideo=!1),l+="</div>";e=!wppaOvlIsSingle&&wppaOvlShowCounter;return l+='<div id="wppa-overlay-txt-container" style="position:relative;padding:10px;background-color:'+wppaOvlTheme+";color:"+t+";text-align:center;font-family:"+wppaOvlFontFamily+";font-size:"+wppaOvlFontSize+"px;font-weight:"+wppaOvlFontWeight+";line-height:"+wppaOvlLineHeight+"px;box-shadow:none;border-bottom-left-radius:"+wppaOvlRadius+"px;border-bottom-right-radius:"+wppaOvlRadius+'px;" ><div id="wppa-overlay-txt" style="text-align:center;min-height:36px;width:100%;'+("auto"==wppaOvlTxtHeight?"max-height:200px;":"max-height:"+wppaOvlTxtHeight+"px;")+'overflow:auto;box-shadow:none;" >',l+=wppaOvlNavBar(),l+=(e?wppaOvlIdx+1+"/"+wppaOvlUrls.length+"<br />":"")+wppaOvlTitles[p],l+="</div>",l+="</div>",(0==wppaOvlActivePanorama?a("#wppa-overlay-ic"):a("#wppa-overlay-pc")).html(l),""!=wppaOvlTypes[p]&&"document"!=wppaOvlTypes[p]||a("#wppa-overlay-ic").show(),wppaFsShow(),a("#wppa-overlay-img").bind("contextmenu",function(p){return!1}),0==wppaOvlPanoramaIds[p]&&wppaOvlResize(),wppaFsShow(),wppaAdjustControlbar(),!1}function wppaOvlSize(p){var a=jQuery;if(!wppaOvlActivePanorama){var t=document.getElementById("wppa-overlay-img"),e=document.getElementById("wppa-overlay-txt");if(t&&e&&"none"!=a("#wppa-overlay-bg").css("display")){if(!wppaIsFs()){var l,o=wppaWindowWidth(),i=wppaWindowHeight(),n=wppaOvlIsVideo?(t.clientWidth,l=wppaOvlVideoNaturalWidths[wppaOvlCurIdx],wppaOvlVideoNaturalHeights[wppaOvlCurIdx]):wppaOvlIsPdf?(wppaWindowWidth(),l=.9*wppaWindowWidth(),.9*wppaWindowHeight()):(t.clientWidth,l=t.naturalWidth,t.naturalHeight);void 0===l&&(l=t.clientWidth,n=t.clientHeight),(t=(e=(o-3*wppaOvlBorderWidth)/l)<(t=i/n)?e:t)<1&&(l=parseInt(l*t),n=parseInt(n*t));var t=a("#wppa-overlay-txt").height(),t="auto"==wppaOvlTxtHeight?(0==t&&(t=20+2*wppaOvlBorderWidth),i-t-20-2*wppaOvlBorderWidth):i-wppaOvlTxtHeight-20-2*wppaOvlBorderWidth,i=parseInt(t*l/n),i=(wppaOvlPadTop,parseInt((o-i)/2),i);n<t&&(wppaOvlPadTop,parseInt((o-l)/2),i=l);o=wppaSavedImageWidth-i<3&&i-wppaSavedImageWidth<3;return i<=10&&(n=180,o=!(l=i=240)),i=parseInt(i),wppaSavedImageWidth=parseInt(i),wppaSavedImageHeight=parseInt(i*n/l),wppaSavedMarginLeft=-parseInt(i/2+wppaOvlBorderWidth),wppaSavedContainerWidth=parseInt(i+2*wppaOvlBorderWidth),wppaSavedContainerHeight=parseInt(wppaSavedImageHeight+wppaOvlBorderWidth+a("#wppa-overlay-txt-container").height()+20),wppaSavedMarginTop=-parseInt(wppaSavedContainerHeight/2),wppaAnimate("#wppa-overlay-img",{width:wppaSavedImageWidth,height:wppaSavedImageHeight},p,wppaEasingLightbox),wppaAnimate("#wppa-overlay-ic",{width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop},p,wppaEasingLightbox),o?(a("#wppa-ovl-spin").hide(),wppaOvlFirst=!1):setTimeout(function(){wppaOvlSize(wppaOvlAnimSpeed)},p+10),!0}wppaOvlFormatFull()}}}function wppaOvlFormatFull(){var p,a=jQuery;if(wppaOvlOpen&&!(0<wppaOvlActivePanorama)){if(wppaOvlIsVideo)p=document.getElementById("wppa-overlay-img"),o=wppaOvlVideoNaturalWidths[wppaOvlIdx],i=wppaOvlVideoNaturalHeights[wppaOvlIdx];else if(wppaOvlIsPdf)p=document.getElementById("wppa-overlay-img"),o=screen.width,i=screen.height;else{if(p=document.getElementById("wppa-overlay-img"),!(wppaIsIe||p&&p.complete))return void setTimeout(wppaOvlFormatFull,200);o=p.naturalWidth,i=p.naturalHeight}var t=o/i,e=0,l=0,o=0,i=0,i=t<screen.width/screen.height?(e=(screen.width-screen.height*t)/2,l=0,o=screen.height,screen.height*t):(e=0,l=(screen.height-screen.width/t)/2,o=screen.width/t,screen.width),e=parseInt(e),l=parseInt(l),o=parseInt(o);return i=parseInt(i),a(p).css({height:o,width:i,marginLeft:e,marginTop:l,left:0,top:0,maxWidth:1e4}),a(p).css({visibility:"visible"}),a("#wppa-ovl-full-bg").css({overflow:"hidden"}),a("#wppa-ovl-full-bg").scrollTop(0),a("#wppa-ovl-full-bg").scrollLeft(0),a("#wppa-ovl-spin").hide(),a("#wppa-ovl-full-bg").css({visibility:"hidden"}),html=a("#wppa-overlay-ic").html(),html+='<div style="position:fixed;bottom:0;left:0;right:0;" >'+wppaOvlNavBar()+"</div>",a("#wppa-overlay-ic").html(html),wppaFsShow(),!0}}function wppaOvlStartAudio(){var p=document.getElementById("wppa-overlay-audio");p&&"function"==typeof p.play&&p.play()}function wppaOvlStartStop(){var p=jQuery;wppaOvlRunning?(wppaOvlRunning=!1,-1!=wppaOvlIdx&&(0!=wppaOvlIdx&&p("#wppa-ovl-prev-btn").css("visibility","visible"),wppaOvlIdx!=wppaOvlUrls.length-1&&p("#wppa-ovl-next-btn").css("visibility","visible")),p("#wppa-ovl-stop-btn").hide(),p("#wppa-ovl-start-btn").show()):(wppaOvlRunning=!0,wppaOvlRun(),p("#wppa-ovl-stop-btn").show(),p("#wppa-ovl-start-btn").hide())}function wppaOvlRun(){if(wppaOvlRunning)if(wppaOvlVideoPlaying||wppaOvlAudioPlaying)setTimeout(wppaOvlRun,50);else{if(!wppaIsVideo&&!wppaOvlIsPdf){var p=document.getElementById("wppa-overlay-img");if(p&&!wppaIsIe&&!p.complete)return void setTimeout(wppaOvlRun,200)}wppaOvlShowNext(),wppaOvlTimer=setTimeout(wppaOvlRun,wppaOvlSlideSpeed)}}function wppaOvlShowPrev(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var p=wppaOvlCurIdx-1;p<0&&(p=wppaOvlUrls.length-1);var a=document.getElementById("wppa-pre-prev");return""!=wppaOvlVideoHtmls[p]||wppaIsIe||a.complete||!wppaOvlOpen?wppaOvlShow(p):setTimeout(wppaOvlShowPrev,200),!1}function wppaOvlShowNext(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var p=wppaOvlCurIdx+1;p>wppaOvlUrls.length-1&&(p=0);var a=document.getElementById("wppa-pre-next");return""!=wppaOvlVideoHtmls[p]||wppaIsIe||a.complete||!wppaOvlOpen?wppaOvlShow(p):setTimeout(wppaOvlShowNext,200),!1}function wppaOvlShowSame(){var p,a;wppaOvlOpen&&(p=wppaOvlCurIdx,a=wppaOvlRunning,wppaOvlHide(!0),jQuery("#wppa-ovl-spin").show(),setTimeout(function(){wppaOvlShow(p),a&&setTimeout(wppaOvlStartStop(),wppaOvlSlideSpeed)},1e3))}function wppaOvlHide(p){var a=jQuery;wppaOvlOpen=!1,wppaOvlClosing=!wppaOvlClosing,wppaStopAudio(),p||"lightbox"!=wppaFsPolicy||wppaIsFs()&&wppaFsOff(),a("#wppa-overlay-ic").html("").hide(),a("#wppa-overlay-pc").html("").hide(),a("#wppa-overlay-fpc").html("").hide(),a("#wppa-overlay-zpc").html("").hide(),a(document).off("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!1,wppaOvlFirst=!0,wppaOvlRunning=!1,clearTimeout(wppaOvlTimer),a("#wppa-ovl-spin").hide(),wppaOvlActivePanorama=0,a("body").trigger("quitimage"),document.onLbquitMocc&&(wppaStartStop(document.onLbquitMocc),document.onLbquitMocc=null,document.onLbquitIdx=null),a(window).trigger("wppalightboxend"),a(window).trigger("resize"),wppaOvlClosing&&wppaIsMobile?setTimeout(function(){wppaOvlHide(p)},250):(wppaOvlClosing=!1,p||setTimeout(function(){a("#wppa-overlay-bg").hide(),a("#wppa-ovl-spin").hide()},500))}function wppaOvlOnclick(p){switch(wppaOvlOnclickType){case"none":break;case"close":wppaOvlHide();break;case"browse":var a=p.screenX-window.screenX;48<p.clientY&&(a<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}return!0}function wppaInitOverlay(){var e=jQuery;e(".wp-caption").each(function(){var p=e(this),a=p.find("IMG[alt]").attr("alt")||"",t=p.find(".wp-caption-text").html()||"",p=p.find("a"),t=a+"<br>"+t;p.attr("data-lbtitle")||p.attr("data-lbtitle",t)});var p,a,t=e("a"),l=[];for(wppaOvlFsPhotoId=0,wppaPhotoId=0,(wppaOvlActivePanorama=0)==wppaSavedContainerWidth&&(wppaSavedContainerWidth=240+2*wppaOvlBorderWidth,wppaSavedContainerHeight=180+3*wppaOvlBorderWidth+20+("auto"==wppaOvlTxtHeight?50:wppaOvlTxtHeight),wppaSavedMarginLeft=-(120+wppaOvlBorderWidth),wppaSavedMarginTop=-(90+wppaOvlBorderWidth+10+("auto"==wppaOvlTxtHeight?25:wppaOvlTxtHeight/2)),wppaSavedImageWidth=240,wppaSavedImageHeight=180+wppaOvlBorderWidth),a=0;a<t.length;a++)if(p=t[a],e(p).attr("data-rel")?l=e(p).attr("data-rel").split("["):p.rel?l=p.rel.split("["):l[0]="","wppa"==l[0])switch(wppaWppaOverlayActivated=!0,e(p).on("click",function(p){wppaOvlShow(this),p.preventDefault()}),wppaMagnifierCursor){case"pointer":e(p).css("cursor","pointer");break;case"":e(p).css("cursor","default");break;default:e(p).css("cursor","url( "+wppaImageDirectory+wppaMagnifierCursor+" ),auto")}e(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaAdjustControlbar)}function wppaOvlResize(){0<wppaOvlActivePanorama||(setTimeout("wppaOvlSize( "+wppaOvlAnimSpeed+" )",10),wppaOvlAudioStart&&!wppaOvlAudioPlaying&&setTimeout(wppaOvlStartAudio,100))}function wppaOvlImgClick(p){wppaOvlBrowseOnClick&&!wppaOvlIsSingle&&(p.screenX<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}function wppaOvlNavBar(){var p="";return wppaOvlIsSingle||(p+='<span id="wppa-ovl-prev-btn" style="margin:0 2px 0 0;float:left;display:block;" onclick="wppaOvlShowPrev()" >'+wppaSvgHtml("Prev-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-start-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"none":"block")+';" title="Start" onclick="wppaOvlStartStop()" >'+wppaSvgHtml("Play-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-stop-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"block":"none")+';" title="Stop" onclick="wppaOvlStartStop()" >'+wppaSvgHtml("Pause-Button",wppaOvlIconSize,!0,!0)+"</span>",p+='<span id="wppa-ovl-next-btn" style="margin:0 2px;float:right;display:block;" onclick="wppaOvlShowNext()" >'+wppaSvgHtml("Next-Button",wppaOvlIconSize,!0,!0)+"</span>"),p+='<span id="wppa-exit-btn-2" style="margin:0 2px;float:right;display:block;" title="Exit" onclick="wppaOvlHide()" >'+wppaSvgHtml("Exit-2",wppaOvlIconSize,!0,!0)+"</span>","lightbox"!=wppaFsPolicy||wppaIsSafari||wppaIsIpad||(p+='<span id="wppa-fulls-btn-2" class="wppa-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen-2",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-exit-fulls-btn-2" class="wppa-exit-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen-2",wppaOvlIconSize,!0,!0)+"</span>"),p}jQuery(document).ready(function(p){wppaInitOverlay()}),jQuery(window).on("resize",function(){wppaOvlResize()});
11
  // wppa-popup
5
  // wppa-slideshow
6
  var wppaJsSlideshowVersion="8.2.08.005";function wppaStoreSlideInfo(p,a,e,t,i,w,r,n,o,l,s,d,u,_,m,c,h,y,S,g,f,x,I,j,Q,b,v,T,N,C,k,R,F){o=wppaRepairScriptTags(o),_wppaSlides[p]&&"0"!=a||(_wppaSlides[p]=[],_wppaNames[p]=[],_wppaFilmThumbTitles[p]=[],_wppaFullNames[p]=[],_wppaDsc[p]=[],_wppaOgDsc[p]=[],_wppaCurIdx[p]=-1,_wppaNxtIdx[p]=0,"random"==S?_wppaTimeOut[p]="random":0<parseInt(S)?_wppaTimeOut[p]=parseInt(S):_wppaTimeOut[p]=wppaSlideShowTimeOut,_wppaSSRuns[p]=!1,_wppaTP[p]=-2,_wppaFg[p]=0,_wppaIsBusy[p]=!1,_wppaFirst[p]=!0,_wppaId[p]=[],_wppaRealId[p]=[],_wppaAvg[p]=[],_wppaDisc[p]=[],_wppaMyr[p]=[],_wppaVRU[p]=[],_wppaLinkUrl[p]=[],_wppaLinkTitle[p]=[],_wppaLinkTarget[p]=[],_wppaCommentHtml[p]=[],_wppaIptcHtml[p]=[],_wppaExifHtml[p]=[],_wppaUrl[p]=[],_wppaSkipRated[p]=!1,_wppaLbTitle[p]=[],_wppaDidGoto[p]=!1,wppaSlidePause[p]=!1,_wppaShareUrl[p]=[],_wppaShareHtml[p]=[],_wppaFilmNoMove[p]=!1,_wppaHiresUrl[p]=[],_wppaIsVideo[p]=[],_wppaVideoHtml[p]=[],_wppaAudioHtml[p]=[],_wppaVideoNatWidth[p]=[],_wppaVideoNatHeight[p]=[],wppaVideoPlaying[p]=!1,wppaAudioPlaying[p]=!1,_wppaWaitTexts[p]=[],_wppaImageAlt[p]=[],_wppaFilename[p]=[]),S="default",""!=c?S="pointer":""!=wppaLightBox[p]&&(S="url( "+wppaImageDirectory+wppaMagnifierCursor+" ),pointer"),_wppaIsVideo[p][a]=""!=T,_wppaIsVideo[p][a]?(_wppaSlides[p][a]=' alt="'+k+'" class="theimg theimg-'+p+' big" ',wppaSlideVideoStart&&""==wppaLightBox[p]&&(_wppaSlides[p][a]+=" autoplay "),0<R.length&&(_wppaSlides[p][a]+=' poster="'+R+'" ')):_wppaSlides[p][a]=' src="'+e+'" alt="'+k+'" class="theimg theimg-'+p+' big stereo" ',wppaSlideSwipe&&(_wppaSlides[p][a]+=' ontouchstart="wppaTouchStart( event, this.id, '+p+' );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" '),wppaAutoColumnWidth[p]||(_wppaSlides[p][a]+='width="'+i+'" height="'+w+'" '),_wppaIsVideo[p][a]?(R="wppa"==wppaLightBox[p]?"":"controls",_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none;" '+R+">"+T+"</video>"):_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none; vertical-align:middle;">',_wppaFullNames[p][a]='<span class="sdf-'+p+'" >'+wppaRepairBrTags(r)+"</span>",_wppaNames[p][a]='<span class="sdn-'+p+'" >'+n+"</span>",_wppaFilmThumbTitles[p][a]=n,_wppaDsc[p][a]=o,_wppaOgDsc[p][a]=b,_wppaId[p][a]=l,_wppaRealId[p][a]=s,_wppaAvg[p][a]=d,_wppaDisc[p][a]=u,_wppaMyr[p][a]=_,_wppaVRU[p][a]=m,_wppaLinkUrl[p][a]=c,_wppaLinkTitle[p][a]=h,""!=y?_wppaLinkTarget[p][a]=y:wppaSlideBlank[p]?_wppaLinkTarget[p][a]="_blank":_wppaLinkTarget[p][a]="_self",_wppaCommentHtml[p][a]=g,_wppaIptcHtml[p][a]=f,_wppaExifHtml[p][a]=x,_wppaUrl[p][a]=e,_wppaLbTitle[p][a]=wppaRepairScriptTags(I),_wppaShareUrl[p][a]=j,_wppaShareHtml[p][a]=wppaRepairScriptTags(Q),_wppaHiresUrl[p][a]=v,_wppaVideoHtml[p][a]=T,_wppaAudioHtml[p][a]=N,_wppaVideoNatWidth[p][a]=i,_wppaVideoNatHeight[p][a]=w,_wppaWaitTexts[p][a]=C,_wppaImageAlt[p][a]=k,_wppaFilename[p][a]=F}function wppaSpeed(p,a){_wppaSSRuns[p]&&_wppaSpeed(p,a)}function wppaStopShow(p){_wppaSSRuns[p]&&_wppaStop(p)}function wppaStartStop(p,a){wppaSlideInitRunning[p]&&("start"==wppaSlideInitRunning[p]?a=-1:"stopprev"==wppaSlideInitRunning[p]?a=_wppaSlides[p].length-1:"stopnext"==wppaSlideInitRunning[p]&&(a=0),wppaSlideInitRunning[p]=""),_wppaIsBusy[p]&&(_wppaTP[p]=a),_wppaSSRuns[p]?_wppaStop(p):_wppaStart(p,a),wppaIsMobile&&(jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(10,1).fadeTo(3e3,0),jQuery(".ubb-"+p).stop().fadeTo(10,1).fadeTo(3e3,0))}function wppaBbb(p,a,e){_wppaSSRuns[p]||_wppaBbb(p,a,e)}function wppaUbb(p,a,e){_wppaUbb(p,a,e)}function wppaRateIt(p,a){_wppaRateIt(p,a)}function wppaOvlRateIt(p,a,e,t){_wppaOvlRateIt(p,a,e,t)}function wppaPrev(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrev(p)}function wppaPrevN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrevN(p,a)}function wppaFirst(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,0)}function wppaNext(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNext(p)}function wppaNextN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNextN(p,a)}function wppaLast(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,_wppaSlides[p].length-1)}function wppaFollowMe(p,a){_wppaSSRuns[p]||_wppaFollowMe(p,a)}function wppaLeaveMe(p,a){_wppaSSRuns[p]||_wppaLeaveMe(p,a)}function wppaGoto(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,a)}function wppaGotoFilmNoMove(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||(_wppaFilmNoMove[p]=!0,_wppaGoto(p,a))}function wppaGotoKeepState(p,a){_wppaNxtIdx[p]!=a&&(_wppaDidGoto[p]=!0,_wppaGotoKeepState(p,a))}function _wppaGotoKeepState(p,a){(_wppaSSRuns[p]?_wppaGotoRunning:_wppaGoto)(p,a)}function wppaGotoRunning(p,a){_wppaDidGoto[p]=!0,_wppaGotoRunning(p,a)}function wppaValidateComment(p){return _wppaValidateComment(p)}function _wppaNextSlide(p,a){var e=!document.getElementById("slide_frame-"+p);if(_wppaStopping[p])_wppaStopping[p]=0;else{if(!e&&!wppaIsSlidshowVisible(p))return wppaFilmInit[p]=!1,void setTimeout(function(){_wppaNextSlide(p,a)},400);if(_wppaLastIdx[p]=_wppaCurIdx[p],!document.getElementById("slide_frame-"+p)&&document.getElementById("filmwindow-"+p)&&wppaFilmonlyContinuous)return _wppaSSRuns[p]?(_wppaCurIdx[p]++,_wppaCurIdx[p]==_wppaSlides[p].length&&(_wppaCurIdx[p]=0),_wppaAdjustFilmstrip(p,"linear"),_wppaNxtIdx[p]=_wppaCurIdx[p],void setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",wppaAnimationSpeed)):(_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFilmInit[p]=!1,void _wppaAdjustFilmstrip(p,"linear"));if(document.getElementById("slide_frame-"+p)||document.getElementById("filmwindow-"+p)){var t=_wppaFg[p],e=1-t;if((wppaVideoPlaying[p]||wppaAudioPlaying[p])&&_wppaSSRuns[p])setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",500);else{if(wppaStopVideo(p),wppaStopAudio(p),"auto"==a){if(wppaSlidePause[p])return jQuery("#theimg"+t+"-"+p).attr("title",wppaSlidePause[p]),jQuery("#slide_frame-"+p).attr("title",wppaSlidePause[p]),void setTimeout("_wppaNextSlide( "+p+', "auto" )',250)}else jQuery("#slide_frame-"+p).removeAttr("title");if((_wppaSSRuns[p]||"auto"!=a)&&_wppaSlides[p]&&(!(_wppaSlides[p].length<2)||_wppaFirst[p])){if(_wppaSSRuns[p]||"reset"!=a||(_wppaSSRuns[p]=!0,__wppaOverruleRun=!1),_wppaVoteInProgress=!1,_wppaIsBusy[p]=!0,_wppaSSRuns[p]&&_wppaShowMetaData(p,"hide"),_wppaSSRuns[p]&&(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0)),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaCurIdx[p]]).css({display:"none"}),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaNxtIdx[p]]).css({display:""}),"undefined"!=typeof _wppaLat&&_wppaLat[p]?(n=_wppaRealId[p],_wppaLat[p][n[_wppaNxtIdx[p]]]?(jQuery("#map-canvas-"+p).css("display",""),wppaGeoInit(p,_wppaLat[p][n[_wppaNxtIdx[p]]],_wppaLon[p][n[_wppaNxtIdx[p]]])):jQuery("#map-canvas-"+p).css("display","none")):jQuery("#map-canvas-"+p).css("display","none"),jQuery("[id^=wppa-numbar-"+p+"-]").css({backgroundColor:wppaBGcolorNumbar,borderColor:wppaBcolorNumbar,fontFamily:wppaFontFamilyNumbar,fontSize:wppaFontSizeNumbar,color:wppaFontColorNumbar,fontWeight:wppaFontWeightNumbar}),jQuery("#wppa-numbar-"+p+"-"+_wppaNxtIdx[p]).css({backgroundColor:wppaBGcolorNumbarActive,borderColor:wppaBcolorNumbarActive,fontFamily:wppaFontFamilyNumbarActive,fontSize:wppaFontSizeNumbarActive,color:wppaFontColorNumbarActive,fontWeight:wppaFontWeightNumbarActive}),_wppaSlides[p].length>wppaNumbarMax){var i,w,r=_wppaSlides[p].length-1,n=_wppaNxtIdx[p],o=(wppaNumbarMax-1)/2;n<o?(i=0,w=wppaNumbarMax-1-1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-o<n?(i=(w=r)-wppaNumbarMax+1+1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(w=n+o+.5-1,(i=n-o+1)<2?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-1<w?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})));for(var l=0;l<_wppaSlides[p].length;)0!=l&&l!=r&&(l<i||w<l)?jQuery("#wppa-numbar-"+p+"-"+l).css({display:"none"}):jQuery("#wppa-numbar-"+p+"-"+l).css({display:"block"}),l++}_wppaFirst[p]?(-1!=_wppaCurIdx[p]&&wppaMakeTheSlideHtml(p,"0",_wppaCurIdx[p]),wppaMakeTheSlideHtml(p,"1",_wppaNxtIdx[p]),jQuery("#imagedesc-"+p).html(_wppaDsc[p][_wppaCurIdx[p]]),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),"icons"==wppaSlideshowNavigationType?(o=wppaIconSize(p,"1.5em",!1),jQuery("#prev-arrow-"+p).html(wppaSvgHtml("Prev-Button",o,!1,!0)),jQuery("#next-arrow-"+p).html(wppaSvgHtml("Next-Button",o,!1,!0))):wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPrevP),jQuery("#next-arrow-"+p).html(wppaNextP+"&nbsp;&raquo;")):(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPreviousPhoto),jQuery("#next-arrow-"+p).html(wppaNextPhoto+"&nbsp;&raquo;")),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating))):wppaMakeTheSlideHtml(p,e,_wppaNxtIdx[p]),_wppaLoadSpinner(p),_wppaFirst[p]=!1,_wppaCheckRewind(p),setTimeout("_wppaNextSlide_2( "+p+" )",10)}}}}}function _wppaNextSlide_2(p){var a=_wppaFg[p],e=1-a,t=document.getElementById("theimg"+e+"-"+p);!t||1!=t.nodeType||"IMG"!=t.nodeName||t.complete?(wppaUpdateLightboxes(),_wppaUnloadSpinner(p),-1!=_wppaSSRuns[p]&&(_wppaToTheSame||_wppaShowMetaData(p,"hide")),_wppaFg[p]=1-_wppaFg[p],_wppaFg[p],setTimeout("_wppaNextSlide_3( "+p+" )",10)):setTimeout("_wppaNextSlide_2( "+p+" )",200)}function _wppaNextSlide_3(p){var a=_wppaFg[p],e=1-a,t=_wppaCurIdx[p],i=_wppaNxtIdx[p],w="#theslide"+e+"-"+p,r="#theslide"+a+"-"+p,n="#theimg"+e+"-"+p,o="#theimg"+a+"-"+p,l=parseInt(jQuery(w).css("width")),s=t==i+1?"right":t==i-1?"left":t==i?"none":"nil";switch(t==_wppaSlides[p].length-1&&0==i&&wppaSlideWrap[p]&&(s="left"),0==t&&i==_wppaSlides[p].length-1&&wppaSlideWrap[p]&&(s="right"),"nil"==s&&(s=t<i?"left":"right"),jQuery(w).css({marginLeft:0,width:l}),jQuery(r).css({marginLeft:0,width:l}),wppaFormatSlide(p),wppaAnimationType){case"fadeafter":wppaFadeOut(n,wppaAnimationSpeed),setTimeout(wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p)),wppaAnimationSpeed);break;case"swipe":switch(s){case"left":wppaAnimate(w,{marginLeft:-l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"right":wppaAnimate(w,{marginLeft:l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:-l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"none":wppaFadeIn(o,10),setTimeout("_wppaNextSlide_4( "+p+" )",10)}break;default:wppaFadeOut(n,wppaAnimationSpeed),wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p))}}function _wppaNextSlide_4(p){var a=_wppaFg[p],e="#theslide"+a+"-"+p;jQuery("#theslide"+(1-a)+"-"+p).css({zIndex:80}),jQuery(e).css({zIndex:81}),_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFormatSlide(p),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length):jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length),jQuery("#bc-pname-modal-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),jQuery("#bc-pname-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),_wppaAdjustFilmstrip(p,wppaEasingSlide),_wppaSetRatingDisplay(p),setTimeout("_wppaNextSlide_5( "+p+" )",_wppaTextDelay)}function _wppaNextSlide_5(p){var a,e,t;if(_wppaToTheSame||(a=_wppaDsc[p][_wppaCurIdx[p]],jQuery("#imagedesc-"+p).html(a),wppaHideWhenEmpty&&(""==(a=_wppaDsc[p][_wppaCurIdx[p]])||"&nbsp;"==a?jQuery("#descbox-"+p).css("display","none"):jQuery("#descbox-"+p).css("display","")),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),jQuery("#wppa-share-"+p).html(_wppaShareHtml[p][_wppaCurIdx[p]])),_wppaToTheSame=!1,wppaThumbPageSize?wppaThumbPage[p]=parseInt(((0|wppaSlideOffset[p])+_wppaCurIdx[p])/wppaThumbPageSize)+1:wppaThumbPage[p]=1,_wppaSSRuns[p]&&!wppaSlideWrap[p]&&_wppaCurIdx[p]+1==_wppaSlides[p].length)return _wppaIsBusy[p]=!1,void _wppaStop(p);if(_wppaShowMetaData(p,"show"),-2!=_wppaTP[p]){var i=_wppaTP[p];return _wppaTP[p]=-2,_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),_wppaDoAutocol(p,"next_5"),void wppaStartStop(p,i)}wppaUpdateLightboxes(),wppaIsMini[p]||(i=_wppaShareUrl[p][_wppaCurIdx[p]],"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(_wppaShareUrl[p][_wppaCurIdx[p]]),1<_wppaSlides[p].length&&wppaPushStateSlide(p,_wppaCurIdx[p],i)),_wppaSSRuns[p]?_wppaCurIdx[p]+1==_wppaSlides[p].length?(t=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<t.length&&"hidden"!=jQuery(t).css("visibility")?setTimeout(function(){wppaSlideInitRunning[p]="start",jQuery("#wppa-next-pagelink-"+p).trigger("click")},wppaGetSlideshowTimeout(p)):0<e.length?setTimeout(function(){jQuery(e).trigger("click")},wppaGetSlideshowTimeout(p)):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p))):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p)):_wppaStopping[p]=!1,jQuery(document).trigger("glossaryTooltipReady"),_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),wppaStopAudio(p),!wppaSlideAudioStart||0<(t=jQuery(".wppa-audio-"+_wppaId[p][_wppaCurIdx[p]]+"-"+p)).length&&((t=t[t.length-1])&&(wppaAudioPlaying[p]||t.play())),wppaProtect(),jQuery(window).trigger("resize")}function wppaFormatSlide(p){var a="theimg"+_wppaFg[p]+"-"+p,e=document.getElementById(a);if(e){var t="theslide"+_wppaFg[p]+"-"+p,i="slide_frame-"+p,w=jQuery("#wppa-container-"+p).width();wppaColWidth[p]=w;var r=jQuery(".wppa-audio-"+p),n=e.naturalWidth;void 0===n&&(n=parseInt(e.style.maxWidth));var o=e.naturalHeight;void 0===o&&(o=parseInt(e.style.maxHeight));var l=wppaAspectRatio[p],s=wppaFullSize[p],d=wppaFullFrameDelta[p],u=wppaPortraitOnly[p],_=wppaFullValign[p];void 0===_&&(_="none");var m=wppaFullHalign[p];void 0===m&&(m="none");var c,h,y,S,g,f,x,I,e=wppaStretch;if(u)c=w-d,S=y=0,x=g=w,I=f=(h=parseInt(c*o/n))+d,jQuery("#"+i).css({width:x,height:I}),jQuery("#"+t).css({width:g,height:f}),jQuery("#"+a).css({width:c,height:h});else{if(s<(x=w)&&(x=s),g=x,f=I=parseInt(x*l),e||x-d<=n||I-d<=o?l<(o+d)/(n+d)?(h=I-d,c=parseInt(h*n/o)):(c=x-d,h=parseInt(c*o/n)):(c=n,h=o),"default"!=_&&"none"!=_){switch(_){case"top":S=0;break;case"center":S=parseInt((I-(h+d))/2);break;case"bottom":S=I-(h+d);break;case"fit":S=0,f=I=h+d}jQuery("#"+a).css({marginTop:S,marginBottom:0})}if(jQuery("#"+i).css({width:x,height:I}),jQuery("#"+t).css({width:g,height:f}),jQuery("#"+a).css({width:c,height:h}),"default"!=_&&"none"!=_&&"none"!=m&&"default"!=m){switch(m){case"left":y=0;break;case"center":y=parseInt((w-x)/2);break;case"right":y=w-x}y<0&&(y=0),jQuery("#"+a).css({marginLeft:"auto",marginRight:"auto"}),jQuery("#"+i).css({marginLeft:y})}var i=jQuery(r).height(),j=(x-c)/2;i&&0<i&&(wppaAudioHeight=i,jQuery(r).css({height:wppaAudioHeight,width:c,left:j}))}j=_wppaHiresUrl[p][_wppaCurIdx[p]]||"";".pdf"==j.substr(j.length-4,j.length)&&jQuery("#"+t).css({width:"100%",height:"100%"});j=parseInt(x/3),t=2*j,r=0<r.length?I-wppaAudioHeight-wppaSlideBorderWidth-S:I;jQuery("#bbb-"+p+"-l").css({height:r,width:j,left:0}),jQuery("#bbb-"+p+"-r").css({height:r,width:j,left:t})}}function wppaMakeNameHtml(p){var a,e,t="";if(_wppaCurIdx[p]<0)return"";if("void"==_wppaFullNames[p][_wppaCurIdx[p]])return jQuery("#namebox-"+p).hide(),"";if(jQuery("#namebox-"+p).show(),wppaIsMini[p]||_wppaIsVideo[p][_wppaCurIdx[p]])t=_wppaFullNames[p][_wppaCurIdx[p]];else switch(wppaArtMonkyLink){case"file":case"zip":t=wppaArtMonkeyButton?_wppaFullNames[p][_wppaCurIdx[p]]?(a=-1!=_wppaFullNames[p][_wppaCurIdx[p]].indexOf("plus.png"),e=_wppaFullNames[p][_wppaCurIdx[p]].replace(/(<([^>]+)>)/gi,""),e=a?e.replace(" )"," +)"):e.replace(" )",")"),'<input type="button" title="Download" style="cursor:pointer;margin-bottom:0px;max-width:'+(wppaGetContainerWidth(p)-24)+'px;" class="wppa-download-button" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+'\' );" value="'+wppaDownLoad+": "+e+'" />'):"":wppaArtmonkeyFileNotSource?'<a href="'+_wppaUrl[p][_wppaCurIdx[p]]+'" title="Download" style="cursor:pointer;" download="'+_wppaFilename[p][_wppaCurIdx[p]]+'" >'+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>":'<a title="Download" style="cursor:pointer;" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+"' );\" >"+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>";break;case"none":case"new":t=_wppaFullNames[p][_wppaCurIdx[p]];break;default:t=""}return t=wppaRepairBrTags(t)}function wppaMakeTheSlideHtml(p,a,e){var t,i,w=_wppaIsVideo[p][e]?"video":"img",r="title";"wppa"==wppaLightBox[p]&&(r="data-lbtitle");var n=""==wppaLightBox[p]?' onpause="wppaVideoPlaying['+p+'] = false;" onplay="wppaVideoPlaying['+p+'] = true;"':"",o=_wppaHiresUrl[p][e]||"",l=".pdf"==o.substr(o.length-4,o.length);if(""!=_wppaLinkUrl[p][e])t=wppaSlideToFullpopup?'<a onclick="wppaStopAudio();wppaStopShow('+p+");"+_wppaLinkUrl[p][e]+'" target="'+_wppaLinkTarget[p][e]+'" title="'+_wppaLinkTitle[p][e]+'">'+(l?"<iframe "+n+' src="'+o+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+n+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>":"<a onclick=\"_bumpClickCount('"+_wppaId[p][e]+"');wppaStopAudio();wppaStopShow("+p+");window.open('"+_wppaLinkUrl[p][e]+"', '"+_wppaLinkTarget[p][e]+'\');" title="'+_wppaLinkTitle[p][e]+'">'+(l?"<iframe "+n+' src="'+o+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+n+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>";else if(""==wppaLightBox[p])t=l?"<iframe "+n+' src="'+o+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+n+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e];else{for(var s="",d=0,u=wppaLightboxSingle[p]?"":"[slide-"+p+"-"+a+"]";d<e;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),l=".pdf"==(o=_wppaHiresUrl[p][d]||"").substr(o.length-4,o.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(l?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+"></a>",d++;for(i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][e]:wppaMakeFullsizeUrl(_wppaUrl[p][e]),l=".pdf"==(o=_wppaHiresUrl[p][e]).substr(o.length-4,o.length),s+='<a href="'+i+'"'+(wppaSlideLinkEqual?' onclick="wppaStopAudio();wppaStopShow('+p+");jQuery('#wppa-film-"+e+"-"+p+"').trigger('click');return false;\"":' onclick="wppaStopAudio();wppaStopShow('+p+');"')+' style="cursor:pointer;" target="'+_wppaLinkTarget[p][e]+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][e]+'" data-videonatheight="'+_wppaVideoNatHeight[p][e]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][e])+'"':"")+(l?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][e])+'"':"")+" "+r+'="'+_wppaLbTitle[p][e]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+">"+(l?"<iframe "+n+' src="'+o+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+n+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>",d=e+1;d<_wppaUrl[p].length;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),l=".pdf"==(o=_wppaHiresUrl[p][d]).substr(o.length-4,o.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(l?" data-pdfhtml=\"src='"+o+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+"></a>",d++;t=s}""!=_wppaAudioHtml[p][e]&&(t+='<audio controls id="wppa-audio-'+_wppaId[p][e]+"-"+p+'" class="wppa-audio-'+p+" wppa-audio-"+_wppaId[p][e]+"-"+p+'" data-from="wppa" onplay="wppaAudioPlaying['+p+'] = true;" onpause="wppaAudioPlaying['+p+'] = false" style="position:relative;top:-'+(wppaAudioHeight+wppaSlideBorderWidth)+"px;z-index:10;width:"+_wppaVideoNatWidth[p][e]+'px;padding:0;box-sizing:border-box;" >'+_wppaAudioHtml[p][e]+"</audio>"),t=t.replace(/title=""/g,""),jQuery("#theslide"+a+"-"+p).html(t)}function wppaAdjustAllFilmstrips(p){jQuery(".wppa-filmstrip").each(function(){_wppaAdjustFilmstrip(jQuery(this).attr("id").substr(15),p)})}var wppaLastAnimFilmLoc=[];function _wppaAdjustFilmstrip(p,a){if("linear"!=a&&(a=wppaEasingSlide),document.getElementById("wppa-filmstrip-"+p)&&_wppaSlides[p]){var e,t,i,w,r=!document.getElementById("slide_frame-"+p);if(wppaLastAnimFilmLoc[p]||(wppaLastAnimFilmLoc[p]=0),r){var n=jQuery("#wppa-filmstrip-"+p);if(!wppaIsElementInViewport(n))return}if(r||jQuery(".wppa-film-"+p).removeClass("wppa-filmthumb-active"),_wppaFilmNoMove[p]&&wppaFilmInit[p]?_wppaFilmNoMove[p]=!1:(e=wppaFilmStripLength[p]/2-(_wppaCurIdx[p]+.5+wppaPreambule[p])*wppaThumbnailPitch[p]-wppaFilmStripMargin[p],wppaFilmShowGlue&&(e-=2*wppaFilmStripMargin[p]+2),i=e+wppaThumbnailPitch[p],w=e-wppaThumbnailPitch[p],t=wppaAnimationSpeed,wppaFilmInit[p]||(t=1),0==_wppaCurIdx[p]&&_wppaLastIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):0==_wppaLastIdx[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:w}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):(n=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),i=parseInt(e),w=wppaThumbnailPitch[p],_wppaSSRuns[p]?(n<i?2:i<n-2*w?1:0)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+w}):(i<n-1.5*w||n+1.5*w<i)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i}),wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e,wppaFilmInit[p]=!0),_wppaLastIdx[p]=_wppaCurIdx[p]),wppaMakeLazyVisible("filmstripmocc="+p),!r&&-1!=_wppaCurIdx[p]){_wppaCurIdx[p];_wppaCurIdx[p]+10>_wppaSlides[p].length&&_wppaSlides[p].length;for(var o=0;o<_wppaSlides[p].length;)jQuery("#film_wppatnf_"+_wppaId[p][o]+"_"+p).html()&&(""!=jQuery("#wppa-film-"+o+"-"+p).attr("data-title")?(jQuery("#wppa-film-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title")),jQuery("#wppa-pre-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title"))):""!=wppaFilmThumbTitle&&_wppaCurIdx[p]==o?(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaFilmThumbTitle),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaFilmThumbTitle)):(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]))),o++}r||jQuery("#wppa-film-"+_wppaCurIdx[p]+"-"+p).addClass("wppa-filmthumb-active")}}function _wppaNext(p){var a,e;!wppaSlideWrap[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1||(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length?(a=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<a.length&&"hidden"!=jQuery(a).css("visibility")?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery("#wppa-next-pagelink-"+p).trigger("click")):0<e.length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery(e).trigger("click")):_wppaNextSlide(p,_wppaNxtIdx[p]=0)):_wppaNextSlide(p,0))}function _wppaNextN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]>=_wppaSlides[p].length-a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]+a;_wppaNxtIdx[p]>=_wppaSlides[p].length;)_wppaNxtIdx[p]-=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaNextOnCallback(p){if(wppaSlideWrap[p]||_wppaCurIdx[p]!=_wppaSlides[p].length-1){if(_wppaSkipRated[p]){var a=_wppaCurIdx[p]+1;a==_wppaSlides[p].length&&(a=0);var e=a;if(0!=_wppaMyr[p][e]){for(++a==_wppaSlides[p].length&&(a=0);a!=e&&0!=_wppaMyr[p][a];)++a==_wppaSlides[p].length&&(a=0);e=a}_wppaNxtIdx[p]=e}else _wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0);_wppaNextSlide(p,0)}}function _wppaPrev(p){!wppaSlideWrap[p]&&0==_wppaCurIdx[p]||(_wppaNxtIdx[p]=_wppaCurIdx[p]-1,_wppaNxtIdx[p]<0?jQuery("#wppa-prev-page-last-item-"+p).length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopprev",jQuery("#wppa-prev-page-last-item-"+p).trigger("click")):(_wppaNxtIdx[p]+=_wppaSlides[p].length,_wppaNextSlide(p,0)):_wppaNextSlide(p,0))}function _wppaPrevN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]<a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]-a;_wppaNxtIdx[p]<0;)_wppaNxtIdx[p]+=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaGoto(p,a){_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,_wppaNextSlide(p,0)}function _wppaGotoRunning(p,a){_wppaIsBusy[p]?setTimeout("_wppaGotoRunning( "+p+","+a+" )",10):(_wppaSSRuns[p]=!1,_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,__wppaOverruleRun=!0,_wppaNextSlide(p,"manual"),_wppaGotoContinue(p))}function _wppaGotoContinue(p){_wppaIsBusy[p]?setTimeout("_wppaGotoContinue( "+p+" )",10):setTimeout("_wppaNextSlide( "+p+', "reset" )',wppaGetSlideshowTimeout(p)+10)}function _wppaStart(p,a){if(_wppaStopping[p])return _wppaStopping[p]--,void setTimeout(function(){_wppaStart(p,a)},(wppaAnimationSpeed+wppaGetSlideshowTimeout(p))/10);_wppaSSRuns[p]||(("icons"==wppaSlideshowNavigationType?_wppaStartIcons:_wppaStartText)(p,a),jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Pause-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50")))}function _wppaStartIcons(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}var t=wppaIconSize(p,"1.5em",!1);-1<a?(jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaSvgHtml("Pause-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).show(),jQuery("#speed1-"+p).show(),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStartText(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}-1<a?(jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaStop),jQuery("#speed0-"+p).css("display","inline"),jQuery("#speed1-"+p).css("display","inline"),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStop(p){_wppaStopping[p]=12,("icons"==wppaSlideshowNavigationType?_wppaStopIcons:_wppaStopText)(p),jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))}function _wppaStopIcons(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"1.5em",!1),!1,!0)),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaStopText(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaSpeed(p,a){"random"!=_wppaTimeOut[p]&&(a?500<_wppaTimeOut[p]&&(_wppaTimeOut[p]/=1.5):_wppaTimeOut[p]<6e4&&(_wppaTimeOut[p]*=1.5))}function _wppaLoadSpinner(p){}function _wppaUnloadSpinner(p){jQuery("#wppa-slide-spin-"+p).stop().fadeOut(),setTimeout(function(){jQuery("#wppa-slide-spin-"+p).stop().fadeOut()},1e3)}function _wppaCheckRewind(p){var a,e;document.getElementById("wppa-filmstrip-"+p)&&((e=Math.abs(_wppaCurIdx[p]-_wppaNxtIdx[p]))<=wppaFilmPageSize[p]||(1+wppaFilmStripLength[p]/wppaThumbnailPitch[p])/2<=e&&(a=wppaThumbnailPitch[p]*_wppaSlides[p].length,wppaFilmShowGlue&&(a+=2+2*wppaFilmStripMargin[p]),e=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),_wppaNxtIdx[p]>_wppaCurIdx[p]?e-=a:e+=a,jQuery("#wppa-filmstrip-"+p).css("margin-left",e+"px")))}function _wppaSetRatingDisplay(p){if(document.getElementById("wppa-rating-"+p)){var a,e,t=_wppaAvg[p][_wppaCurIdx[p]];if(void 0!==t){if("likes"==wppaRatingDisplayType){"void"==(e=_wppaMyr[p][_wppaCurIdx[p]])?(jQuery("#wppa-dislike-imgdiv-"+p).hide(),jQuery("#wppa-like-imgdiv-"+p).hide()):(jQuery("#wppa-dislike-imgdiv-"+p).show(),jQuery("#wppa-like-imgdiv-"+p).show());var w=t.split("|");return jQuery("#wppa-like-"+p).attr("title",w[0]),jQuery("#wppa-liketext-"+p).html(w[1]),void("1"==_wppaMyr[p][_wppaCurIdx[p]]?jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbup.png"))}if(t=(a=t.split("|"))[0],w=a[1],a=_wppaDisc[p][_wppaCurIdx[p]],e=_wppaMyr[p][_wppaCurIdx[p]],"void"==a)jQuery("#wppa-rating-"+p).hide();else{if(jQuery("#wppa-rating-"+p).show(),"graphic"==wppaRatingDisplayType)_wppaSetRd(p,t,"#wppa-avg-"),_wppaSetRd(p,e,"#wppa-rate-"),0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),document.getElementById("wppa-dislike-"+p)&&jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).stop().fadeTo(100,wppaStarOpacity),jQuery("#wppa-filler-"+p).attr("title",a));else{if(jQuery("#wppa-numrate-avg-"+p).html(t+" ( "+w+" ) "),jQuery(".wppa-my-rat-"+p).show(),"void"==e)jQuery("#wppa-numrate-mine-"+p).html(""),jQuery(".wppa-my-rat-"+p).hide();else if(wppaRatingOnce&&0<e)jQuery("#wppa-numrate-mine-"+p).html(e);else if(e<0)jQuery("#wppa-numrate-mine-"+p).html(" dislike");else{var r="";for(i=1;i<=wppaRatingMax;i++)e==i?r+='<span class="wppa-rating-numeric-mine" style="cursor:pointer; font-weight:bold;" onclick="_wppaRateIt( '+p+", "+i+' )">&nbsp;'+i+"&nbsp;</span>":(e>i-1&&e<i&&(r+="&nbsp;( "+e+" )&nbsp;"),r+='<span class="wppa-rating-numeric" style="cursor:pointer;" onclick="_wppaRateIt( '+p+", "+i+' )" onmouseover="this.style.fontWeight=\'bold\'" onmouseout="this.style.fontWeight=\'normal\'" >&nbsp;'+i+"&nbsp;</span>");jQuery("#wppa-numrate-mine-"+p).html(r)}0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline")),jQuery("#wppa-discount-"+p).html(a+"&bull; "),jQuery("#wppa-filler-"+p).css("display","none")}0==e?jQuery("#wppa-vote-button-"+p).val(wppaVoteForMe):jQuery("#wppa-vote-button-"+p).val(wppaVotedForMe),jQuery("#wppa-vote-count-"+p).html(w)}}}}function wppaGetDislikeText(p,a,e){return p}function _wppaSetRd(p,a,e){var t=parseInt(a),i=t+1,w=wppaStarOpacity+(a-t)*(1-wppaStarOpacity),r=wppaRatingMax;if("void"==a)jQuery("#wppa-my-rat-"+p).hide(),jQuery(".wppa-my-rat-"+p).hide(),jQuery(".wppa-rate-"+p).hide(),jQuery(".wppa-ratingthumb").hide(),jQuery("#wppa-numrate-mine-"+p).hide();else for(jQuery("#wppa-my-rat-"+p).show(),jQuery(".wppa-my-rat-"+p).show(),jQuery(".wppa-rate-"+p).show(),jQuery(".wppa-ratingthumb").show(),jQuery("#wppa-numrate-mine-"+p).show(),idx=1;idx<=r;idx++)"#wppa-rate-"!=e&&".wppa-rate-"!=e||jQuery(e+p+"-"+idx).attr("src")!=wppaImageDirectory+"star.ico"&&jQuery(e+p+"-"+idx).attr("src",wppaImageDirectory+"star.ico"),idx<=t?jQuery(e+p+"-"+idx).stop().fadeTo(100,1):idx==i?jQuery(e+p+"-"+idx).stop().fadeTo(100,w):jQuery(e+p+"-"+idx).stop().fadeTo(100,wppaStarOpacity)}function _wppaFollowMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,a,"#wppa-rate-")}function wppaOvlFollowMe(p,a,e){e||_wppaSetRd(p,a,".wppa-rate-")}function _wppaLeaveMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,_wppaMyr[p][_wppaCurIdx[p]],"#wppa-rate-")}function wppaOvlLeaveMe(p,a,e){_wppaSetRd(p,e,".wppa-rate-")}function _wppaValidateComment(p,a){if(a=a||_wppaId[p][_wppaCurIdx[p]],jQuery("#wppa-comname-"+p).val().length<1)return alert(wppaPleaseName),!1;if("required"==wppaEmailRequired||"optional"==wppaEmailRequired){var e=jQuery("#wppa-comemail-"+p).val();if("optional"==wppaEmailRequired&&0==e.length)return!0;var t=e.indexOf("@"),a=e.lastIndexOf(".");if(t<1||a<t+2||a+2>=e.length)return alert(wppaPleaseEmail),!1}return!(jQuery("#wppa-comment-"+p).val().length<1)||(alert(wppaPleaseComment),!1)}function _wppaGo(p){document.location=p}function _wppaBbb(p,a,e){if(!_wppaSSRuns[p]){var t="#bbb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".bbb-"+p).css("cursor","pointer");break;case"hide":jQuery(".bbb-"+p).removeAttr("title"),jQuery(".bbb-"+p).css("cursor","default");break;case"click":"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}}function _wppaUbb(p,a,e){var t="#ubb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".ubb-"+p).css("cursor","pointer"),jQuery(".ubb-"+p).stop().fadeTo(200,.8),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,.8);break;case"hide":jQuery(".ubb-"+p).removeAttr("title"),jQuery(".ubb-"+p).css("cursor","default"),wppaIsMobile?jQuery(".ubb-"+p).stop().fadeTo(200,.1):jQuery(".ubb-"+p).stop().fadeTo(200,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,0);break;case"click":wppaIsMobile&&(jQuery(".ubb-"+p).stop().fadeTo(200,1).fadeTo(1e3,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,1).fadeTo(1e3,0)),"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}function wppaOpenComments(p){_wppaSSRuns[p]&&_wppaStop(p),jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none"),wppaColWidth[p]=0,setTimeout("_wppaDoAutocol( "+p+" )",100)}function _wppaShowMetaData(p,a){_wppaSlides[p]&&(_wppaSSRuns[p]||__wppaOverruleRun?"show"==a?wppaFotomotoHideWhenRunning||wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]]):wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display","none"):"show"==a?(wppaAutoOpenComments&&(jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none")),0!=_wppaCurIdx[p]&&jQuery(".wppa-first-"+p).show(),_wppaCurIdx[p]!=_wppaSlides[p].length-1&&jQuery(".wppa-last-"+p).show(),wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display",""),wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]])):(jQuery("#wppa-comtable-wrap-"+p).css("display","none"),jQuery("#wppa-comform-wrap-"+p).css("display","none"),jQuery("#wppa-comfooter-wrap-"+p).css("display","block"),wppaFotomotoHide(p)),"show"==a?(jQuery("#imagedesc-"+p).css("visibility","visible"),jQuery("#imagetitle-"+p).css("visibility","visible"),jQuery("#counter-"+p).css("visibility","visible"),jQuery("#iptccontent-"+p).css("visibility","visible"),jQuery("#exifcontent-"+p).css("visibility","visible")):(jQuery("#counter-"+p).css("visibility","hidden"),jQuery(".wppa-first-"+p).hide(),jQuery(".wppa-last-"+p).hide(),jQuery("#iptccontent-"+p).css("visibility","hidden"),jQuery("#exifcontent-"+p).css("visibility","hidden")))}function wppaGetSlideshowTimeout(p){var a,e;return"random"==_wppaTimeOut[p]?(a=2*wppaAnimationSpeed,e=7*wppaAnimationSpeed,Math.floor(Math.random()*(e-a+1))+a):_wppaTimeOut[p]}function wppaIsSlidshowVisible(p){for(var a,e=["slide_frame-"+p,"filmwindow-"+p],t=e.length,i=0;i<t;i++)if(a=document.getElementById(e[i]),a&&(a.getBoundingClientRect(),wppaIsElementInViewport(a)))return!0;return wppaFilmInit[p]=!1}
7
  // wppa-ajax-front
8
+ var wppaJsAjaxVersion="8.3.01.006";function wppaDoAjaxRender(o,a,r,p){""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[o]&&(a+="&resp=1"),p&&_wppaCurIdx[o]&&_wppaId[o][_wppaCurIdx[o]]&&(a+="&wppa-hilite="+_wppaId[o][_wppaCurIdx[o]]),wppaCanAjaxRender||!r?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[o]&&_wppaStop(o),jQuery("#wppa-ajax-spin-"+o).fadeIn()},success:function(a,p,e){var t;"{"!=a.substr(0,1)?(wppaConsoleLog("Ajax render result starts with "+a.substr(0,100),"force"),alert("Unexpected output: "+a.substr(0,100)+"...")):(a=JSON.parse(a),t=a.html+"<script>"+a.js+"<\/script>",wppaRenderModal&&r?(a={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"},wppaPrepareModal(o),jQuery("#wppa-modal-container-"+o).html(t),jQuery("#wppa-modal-container-"+o).dialog(a),a=-1!=t.indexOf("slide-frame")?1==wppaAreaMaxFracSlide?wppaWindowHeight()/20:(wppaWindowHeight()-wppaWindowHeight()*wppaAreaMaxFracSlide)/2:1==wppaAreaMaxFrac?wppaWindowHeight()/20:(wppaWindowHeight()-wppaWindowHeight()*wppaAreaMaxFrac)/2,jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,margin:"auto",overflow:"hidden",position:"fixed",left:(wppaWindowWidth()-wppaGetContainerWidth(o))/2+"px",top:a+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(o)}),jQuery(".wppa-ajax-spin").stop().fadeOut(),setTimeout(function(){jQuery().niceScroll&&(jQuery(".wppa-albumlist-"+o).niceScroll(".wppa-nicewrap",{}),jQuery(".wppa-slidelist-"+o).niceScroll(".wppa-nicewrap",{}))},1e3),jQuery(document).trigger("resize")):(jQuery("#wppa-container-"+o).html(t),jQuery("#wppa-button-hide-"+o).show()),wppaCanPushState&&wppaUpdateAddressLine&&r&&(wppaHis++,r=r.split("&amp;").join("&"),jQuery(document).ready(function(){setTimeout(function(){try{history.pushState({page:wppaHis,occur:o,type:"html",html:t},"",r)}catch(a){try{history.replaceState({page:wppaHis,occur:o,type:"html"},"",r)}catch(a){wppaConsoleLog("Ajax rendering: History stack update and replace failed")}}},1e3)}),0==wppaFirstOccur&&(wppaFirstOccur=o)),wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(r),wppaColWidth[o]=0,_wppaDoAutocol(o,"ajax"))},error:function(a,p,e){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+e+", status = "+p),r?document.location.href=r:document.location.reload(!0)},complete:function(a,p,e){!wppaRenderModal&&wppaAjaxScroll&&jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+o).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery(".wppa-ajax-spin").stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=r,wppaColWidth[o]=0,_wppaDoAutocol(o,"nonajax"))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+e+", status = "+p)}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+e+", status = "+p)}})}function wppaAjaxAddPhotoToZip(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){a=a.split("||");"OK"==a[0]&&(jQuery("#admin-choice-"+o+"-"+t).html(a[2]),jQuery("#admin-choice-"+o+"-"+t).val(a[2]),jQuery("#admin-choice-"+o+"-"+t).prop("disabled",!0)),alert(a[1]),r&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+e+", status = "+p)}})}function wppaAjaxRemovePhotoFromZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=removefromzip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-rem-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-rem-"+r+"-"+o).prop("disabled",!0),jQuery("#admin-choice-rem-"+r+"-"+o).css("text-decoration","")):alert(a),n&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhotoFromZip failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,p,e){document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+e+", status = "+p)}})}function wppaAjaxRequestInfo(a,p,e){dialogHtml='<div class="wppa-modal"><h3>'+wppaRequestInfoDialogText+'</h3><textarea id="wppa-request-info-text-'+a+'" style="width:98%;" ></textarea><div style="clear:both;" ></div><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Send" onclick="wppaAjaxRequestInfoSend( '+a+", "+p+", "+e+' )" /><input type="button" style="float:left;margin-top:8px;margin-right:8px;" value="Cancel" onclick="jQuery( \'#wppa-modal-container-'+a+"' ).dialog( 'close' );\" /><div style=\"clear:both;\" ></div></div>";e={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"};wppaPrepareModal(a),jQuery("#wppa-modal-container-"+a).html(dialogHtml),jQuery("#wppa-modal-container-"+a).dialog(e),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,position:"fixed",top:wppaWindowHeight()/10+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(document).trigger("resize")}function wppaAjaxRequestInfoSend(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=requestinfo&photo-id="+r+"&emailtext="+jQuery("#wppa-request-info-text-"+o).val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#request-info-"+r+"-"+o).val(t[1]),jQuery("#request-info-"+r+"-"+o).prop("disabled",!0)):alert(a),n?document.location.reload(!0):(jQuery("#wppa-modal-container-"+o).dialog("close"),jQuery("#wppa-modal-container-"+o).html(""))},error:function(a,p,e){wppaConsoleLog("wppaAjaxRequestInfoSend failed. Error = "+e+", status = "+p)}})}function wppaEditPhoto(o,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+a+"&occur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){var t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:"",classes:"wppa-dialog"};wppaPrepareModal(o),jQuery("#wppa-modal-container-"+o).html(a),jQuery("#wppa-modal-container-"+o).dialog(t),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5,position:"fixed",top:wppaWindowHeight()/10+"px"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(document).trigger("resize"),jQuery(".ui-dialog").on("scroll wheel",function(a){a.stopPropagation()})},error:function(a,p,e){wppaConsoleLog("wppaEditPhoto failed. Error = "+e+", status = "+p)},complete:function(a,p,e){}})}function wppaPrevTags(a,p,e,t){for(var o,r=jQuery("."+a),n=[],i=jQuery("#"+e).val(),u=0,c=0,a="";u<r.length;)r[u].selected&&(n[c]=r[u].value,c++),u++;""!=(o=jQuery("#"+p).val())&&(n[c]=o),a=n.join(),""==o&&""==e||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+a+"&album="+i,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,p,e){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,p,e){jQuery("#"+t).html('<span style="color:red" >'+e+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+e+", status = "+p)}})}function wppaAjaxDestroyAlbum(a,p){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+p,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+e+", status = "+p)}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,p,e){},error:function(a,p,e){wppaConsoleLog("_bumpClickCount failed. Error = "+e+", status = "+p)}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){wppaPhotoView[t]=!0},error:function(a,p,e){wppaConsoleLog("_bumpViewCount failed. Error = "+e+", status = "+p)}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,p,e){wppaConsoleLog("wppaVoteThumb failed. Error = "+e+", status = "+p)}})}function _wppaRateIt(o,p){var a,e,t;0!=p&&(_wppaSSRuns[o]||(a=_wppaId[o][_wppaCurIdx[o]],e=_wppaMyr[o][_wppaCurIdx[o]],0<(t=_wppaWaitTexts[o][_wppaCurIdx[o]]).length?alert(t):0!=e&&wppaRatingOnce||e<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+a+"&wppa-occur="+o+"&wppa-index="+_wppaCurIdx[o]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+o+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+o+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");0==t[0]?900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(o)):alert("Error Code="+t[1]+"\n\n"+t[2]):(t[7]&&"likes"==t[7]?(a=t[4].split("|"),jQuery("#wppa-like-"+o).attr("title",a[0]),jQuery("#wppa-liketext-"+o).html(a[1]),"1"==t[3]?jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]):(_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(o),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7])),wppaNextOnCallback&&_wppaNextOnCallback(o))},error:function(a,p,e){wppaConsoleLog("_wppaRateIt failed. Error = "+e+", status = "+p)}}))))}function _wppaOvlRateIt(o,r,n,i){0!=r&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+r+"&wppa-rating-id="+o+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+n+"-"+r).stop().fadeTo(100,1),jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+n+"-"+r).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){a=t[4].split("|");return jQuery("#wppa-like-0").attr("title",a[0]),jQuery("#wppa-liketext-0").html(a[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+o+"-"+n).attr("title",a[0]),jQuery("#wppa-liketext-"+o+"-"+n).html(a[1]),void("1"==t[3]?jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+o+"-"+n).attr("src",wppaImageDirectory+"thumbup.png"))}_wppaSetRd(n,t[4],".wppa-avg-"),_wppaSetRd(n,t[3],".wppa-rate-"),i||wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,p,e){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+e+", status = "+p)}})}function wppaAjaxMakeOrigName(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+p+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){a=a.split("||");"0"==a[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=a[2]):"file"==wppaArtMonkyLink&&window.open(a[2]),"zip"==wppaArtMonkyLink&&(document.location=a[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+a[1]+"\n\n"+a[2]))},error:function(a,p,e){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+e+", status = "+p)},complete:function(a,p,e){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,p,e){var t=a.split("||"),o=t[0],r=t[1],a=t[2];3==t.length&&""!=a&&alert("Attention:\n\n"+a),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,p,e){alert("An error occurred:\n"+e+"\nPlease try again")},complete:function(a,p,e){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){_wppaValidateComment(t,a)&&(a="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&occur="+t,void 0!==jQuery("#wppa-comemail-"+t).val()&&(a+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(a+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(a+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(a+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,p,e){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxComment failed. Error = "+e+", status = "+p)},complete:function(a,p,e){jQuery("#wppa-comment-spin-"+t).css("display","none")}}))}function wppaUpdatePhotoNew(a,r){for(var p,e=["upn-name","upn-description","upn-tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],t="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),o=0;o<e.length;)void 0!==jQuery("#"+e[o]).val()&&(t+="&"+e[o]+"="+jQuery("#"+e[o]).val()),void 0!==(p=wppaGetTinyMceContent(e[o]))&&(t+="&"+e[o]+"="+p),o++;jQuery("#upn-reload").prop("checked")&&(t+="&upn-reload=on"),jQuery.ajax({url:wppaAjaxUrl,data:t,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,p,e){var t=a.split("||");try{var o=JSON.parse(t[2]);jQuery(".sdd-"+r).html(o.desc),jQuery(".sdn-"+r).html(o.name),jQuery(".sdf-"+r).html(o.fullname),_wppaNames[r]&&(_wppaNames[r][_wppaCurIdx[r]]=wppaFixHtml(o.name),_wppaFullNames[r][_wppaCurIdx[r]]=wppaFixHtml(o.fullname),_wppaDsc[r][_wppaCurIdx[r]]=wppaFixHtml(o.desc),jQuery("#imagetitle-"+r).html(wppaMakeNameHtml(r)))}catch{wppaConsoleLog("Failed to report updates","force")}},error:function(a,p,e){wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+e+", status = "+p)},complete:function(a,p,e){jQuery("#upn-reload").prop("checked")?document.location.reload(!0):(jQuery("#wppa-modal-container-"+r).dialog("close"),jQuery("#wppa-modal-container-"+r).html(""))}})}function wppaFixHtml(a){return a=(a=(a=(a=a.replace(/\[/g,"<")).replace(/\]/g,">")).replace(/&quot;/g,'"')).replace(/\\n/g," ")}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){0!=jQuery(t).length&&wppaLastQrcodeUrl!=a&&(wppaLastQrcodeUrl=a,a="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,success:function(a,p,e){a=a.split("|");jQuery(t).attr("src",a[0]),jQuery(t).attr("title",a[1])},error:function(a,p,e){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+e+", status = "+p)}}))}function wppaAjaxNotify(a,t,o){a=jQuery(a).prop("checked")?"on":"off",a="action=wppa&wppa-action=mailinglist&wppa-ntfy-nonce="+jQuery("#wppa-ntfy-nonce").val()+"&list="+t+"&onoff="+a;o&&(a+="&wppa-user="+o),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e4,beforeSend:function(){o&&jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){o?(wppaConsoleLog(a,"force"),jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"tick.png")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxNotify failed. Error = "+e+", status = "+p),jQuery("#img_"+t+"-"+o).attr("src",wppaImageDirectory+"cross.png")}})}function wppaAjaxGetSsIptcList(a,p,e,t){wppaAjaxGetSsIptcExifList(a,p,e,t,"iptc")}function wppaAjaxGetSsExifList(a,p,e,t){wppaAjaxGetSsIptcExifList(a,p,e,t,"exif")}function wppaAjaxGetSsIptcExifList(t,o,r,n,i){ajaxurl=wppaAjaxUrl,ajaxurl+="?action=wppa&wppa-action=getss"+i+"list&"+i+"tag="+o+"&occur="+t,jQuery.ajax({url:ajaxurl,async:!0,type:"GET",timeout:1e4,beforeSend:function(a){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(a,p,e){jQuery("#"+r).html(a),jQuery("#wppa-ss-"+i+"opts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-'+i+"list-"+t+'", "#'+r+'" )',10),n&&wppaConsoleLog("wppaAjaxGetSs"+i+"List success after retry.")},error:function(a,p,e){wppaConsoleLog("wppaAjaxGetSs"+i+"List failed. Error = "+e+", status = "+p),n||wppaAjaxGetSsIptcExifList(t,o,r,!0,i)},complete:function(a,p,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaPrepareModal(a){try{jQuery("#wppa-modal-container-"+a).dialog("destroy"),jQuery("#wppa-modal-container-"+a).html("")}catch{jQuery("#wppa-modal-container-"+a).html("")}}
9
  // wppa-lightbox
10
  var wppaJsLightboxVersion="8.2.05.002";function wppaOvlKeyboardHandler(p){var a,t=(a=(null==p?event:p).keyCode,27),p=String.fromCharCode(a).toLowerCase();switch(a){case t:wppaStopVideo(0),wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext()}switch(p){case"p":wppaOvlShowPrev();break;case"n":wppaOvlShowNext();break;case"s":wppaOvlStartStop();break;case"f":wppaFsOn();break;case"q":case"x":wppaStopVideo(0),wppaOvlHide()}return!1}function wppaOvlShow(p){var a,t,e=jQuery;if(wppaOvlActivePanorama,e("#wppa-overlay-bg").css({display:"inline"}),wppaOvlFirst&&(e("#weaver-final").removeClass("wvr-hide-bang"),wppaKbHandlerInstalled||(e(document).on("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!0),e(window).trigger("wppalightboxstart")),"object"==typeof p){wppaOvlIds=[],wppaOvlUrls=[],wppaOvlTitles=[],wppaOvlAlts=[],wppaOvlTypes=[],wppaOvlVideoHtmls=[],wppaOvlAudioHtmls=[],wppaOvlPdfHtmls=[],wppaOvlVideoNaturalWidths=[],wppaOvlVideoNaturalHeights=[],wppaOvlImgs=[],wppaOvlIdx=0,wppaOvlPanoramaHtml=[],wppaOvlPanoramaIds=[],wppaOvlHasPanoramas=!1;var l=(p.rel||!!e(p).attr("data-rel")&&e(p).attr("data-rel")).split("[");if(l[1])for(var o,i=l[1],n=e("a"),w=0,r=0;r<n.length;r++)1<(l=!!e(o=n[r]).attr("data-rel")&&e(o).attr("data-rel").split("[")).length&&"wppa"==l[0]&&l[1]==i&&(wppaOvlUrls[w]=o.href,e(o).attr("data-lbtitle")?wppaOvlTitles[w]=wppaRepairScriptTags(e(o).attr("data-lbtitle")):wppaOvlTitles[w]=wppaRepairScriptTags(o.title),wppaOvlIds[w]=e(o).attr("data-id")?e(o).attr("data-id"):"0",wppaOvlAlts[w]=e(o).attr("data-alt")?e(o).attr("data-alt"):"",wppaOvlVideoHtmls[w]=e(o).attr("data-videohtml")?decodeURI(e(o).attr("data-videohtml")):"",wppaOvlPdfHtmls[w]=e(o).attr("data-pdfhtml")?decodeURI(e(o).attr("data-pdfhtml")):"",wppaOvlAudioHtmls[w]=e(o).attr("data-audiohtml")?decodeURI(e(o).attr("data-audiohtml")):"",wppaOvlVideoNaturalWidths[w]=e(o).attr("data-videonatwidth")?e(o).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[w]=e(o).attr("data-videonatheight")?e(o).attr("data-videonatheight"):"",a=e(o).attr("data-panorama")?e(o).attr("data-panorama"):"",panType=e(o).attr("data-pantype")?e(o).attr("data-pantype"):"",0<a.length?(wppaOvlHasPanoramas=!0,t=a.indexOf("."),wppaOvlPanoramaHtml[w]=a.substr(t+1),wppaOvlPanoramaIds[w]=a.substr(0,t),wppaOvlTypes[w]=panType):(wppaOvlPanoramaHtml[w]="",wppaOvlPanoramaIds[w]=0,wppaOvlTypes[w]=""),0<wppaOvlPdfHtmls[w].length&&(wppaOvlTypes[w]="document"),decodeURI(e(o).attr("data-pdfhtml"))==decodeURI(e(p).attr("data-pdfhtml"))&&decodeURI(e(o).attr("data-videohtml"))==decodeURI(e(p).attr("data-videohtml"))&&decodeURI(e(o).attr("data-audiohtml"))==decodeURI(e(p).attr("data-audiohtml"))&&o.href==p.href&&(wppaOvlIdx=w),w++);else wppaOvlUrls[0]=p.href,e(p).attr("data-lbtitle")?wppaOvlTitles[0]=wppaRepairScriptTags(e(p).attr("data-lbtitle")):wppaOvlTitles[0]=wppaRepairScriptTags(p.title),wppaOvlIds[0]=e(p).attr("data-id")?e(p).attr("data-id"):"0",wppaOvlAlts[0]=e(p).attr("data-alt")?e(p).attr("data-alt"):"",wppaOvlVideoHtmls[0]=e(p).attr("data-videohtml")?decodeURI(e(p).attr("data-videohtml")):"",wppaOvlAudioHtmls[0]=e(p).attr("data-audiohtml")?decodeURI(e(p).attr("data-audiohtml")):"",wppaOvlPdfHtmls[0]=e(p).attr("data-pdfhtml")?decodeURI(e(p).attr("data-pdfhtml")):"",wppaOvlVideoNaturalWidths[0]=e(p).attr("data-videonatwidth")?e(p).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[0]=e(p).attr("data-videonatheight")?e(p).attr("data-videonatheight"):"",a=e(p).attr("data-panorama")?e(p).attr("data-panorama"):"",panType=e(p).attr("data-pantype")?e(p).attr("data-pantype"):"",0<a.length?(wppaOvlHasPanoramas=!0,t=a.indexOf("."),wppaOvlPanoramaHtml[0]=a.substr(t+1),wppaOvlPanoramaIds[0]=a.substr(0,t),wppaOvlTypes[0]=panType):(wppaOvlPanoramaHtml[0]="",wppaOvlPanoramaIds[0]=0,wppaOvlTypes[0]=""),0<wppaOvlPdfHtmls[0].length&&(wppaOvlTypes[0]="document"),wppaOvlIdx=0}else wppaOvlIdx=p;wppaOvlOpen=!0,e("body").trigger("quitimage"),setTimeout(function(){_wppaOvlShow(wppaOvlIdx)},100)}function _wppaOvlShow(p){var a=jQuery;a("#wppa-overlay-ic").html("").hide(),a("#wppa-overlay-pc").html("").hide(),a("#wppa-overlay-fpc").html("").hide(),a("#wppa-overlay-zpc").html("").hide(),wppaOvlCurIdx=p,a("#wppa-ovl-spin").show(),wppaIsVideo=""!=wppaOvlVideoHtmls[p],wppaHasAudio=""!=wppaOvlAudioHtmls[p],wppaOvlIsPdf=""!=wppaOvlPdfHtmls[p];var t=wppaOvlIdx==wppaOvlUrls.length-1?0:wppaOvlIdx+1,e=0==wppaOvlIdx?wppaOvlUrls.length-1:wppaOvlIdx-1;if(""==wppaOvlTypes[t]&&""==wppaOvlVideoHtmls[t]&&wppaOvlOpen&&(document.getElementById("wppa-pre-next").src=wppaOvlUrls[t]),""==wppaOvlTypes[e]&&""==wppaOvlVideoHtmls[e]&&wppaOvlOpen&&(document.getElementById("wppa-pre-prev").src=wppaOvlUrls[e]),_bumpViewCount(wppaOvlIds[p]),wppaOvlIsSingle=1==wppaOvlUrls.length,wppaOvlActivePanorama=wppaOvlPanoramaIds[p],wppaOvlActivePanorama,wppaIsFs()||wppaOvlActivePanorama){if(wppaOvlActivePanorama?l=wppaOvlPanoramaHtml[p]:wppaIsVideo?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><video id="wppa-overlay-img" controls preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video></div>":wppaOvlIsPdf?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><iframe id="wppa-overlay-img" '+wppaOvlPdfHtmls[p]+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" ></iframe></div>':(l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><img id="wppa-overlay-img" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[p]+'" style="border:none; width:'+screen.width+'px; visibility:hidden; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata"'+(wppaOvlAudioStart?" autoplay":"")+' onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;left:0px;bottom:0px;padding:0;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),l+="</div>"),!wppaIsVideo&&!wppaHasAudio||wppaOvlFsPhotoId!=wppaPhotoId||0==wppaPhotoId)if(wppaStopVideo(0),wppaStopAudio(),0<wppaOvlActivePanorama)switch(wppaOvlTypes[p]){case"spheric":a("#wppa-overlay-pc").html(l).show();break;case"flat":a("#wppa-overlay-fpc").html(l).show();break;case"zoom":a("#wppa-overlay-zpc").html(l).show()}else a("#wppa-overlay-ic").html(l).show();return 0<wppaOvlPanoramaIds[p]&&wppaOvlIsSingle&&a(".wppa-pan-prevnext").hide(),wppaProtect(),wppaOvlIsVideo=wppaIsVideo,setTimeout(wppaOvlFormatFull,10),wppaIsVideo||wppaHasAudio?setTimeout(function(){wppaOvlFsPhotoId=wppaPhotoId},20):wppaOvlFsPhotoId=0,wppaOvlFirst=!1,""==wppaOvlTypes[p]&&a("#wppa-overlay-ic").show(),wppaFsShow(),wppaProtect(),!1}wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaStopVideo(0);t="black"==wppaOvlTheme?"#a7a7a7":"#272727";wppaOvlFontColor&&(t=wppaOvlFontColor);wppaOvlUrls.length;0==wppaOvlActivePanorama&&a("#wppa-overlay-ic").css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop});var l="";l+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >',wppaIsVideo?(l+='<video id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" controls style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video>",wppaOvlIsVideo=!0):wppaOvlIsPdf?l+="<iframe "+wppaOvlPdfHtmls[p]+' id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" ></iframe>':(l+='<img id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onclick="wppaOvlImgClick( event );" src="'+wppaOvlUrls[p]+'" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata" onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;box-shadow:none;left:0;bottom:0;padding:0 '+wppaOvlBorderWidth+'px;margin:0;background-color:transparent;box-sizing:border-box;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),wppaOvlIsVideo=!1),l+="</div>";e=!wppaOvlIsSingle&&wppaOvlShowCounter;return l+='<div id="wppa-overlay-txt-container" style="position:relative;padding:10px;background-color:'+wppaOvlTheme+";color:"+t+";text-align:center;font-family:"+wppaOvlFontFamily+";font-size:"+wppaOvlFontSize+"px;font-weight:"+wppaOvlFontWeight+";line-height:"+wppaOvlLineHeight+"px;box-shadow:none;border-bottom-left-radius:"+wppaOvlRadius+"px;border-bottom-right-radius:"+wppaOvlRadius+'px;" ><div id="wppa-overlay-txt" style="text-align:center;min-height:36px;width:100%;'+("auto"==wppaOvlTxtHeight?"max-height:200px;":"max-height:"+wppaOvlTxtHeight+"px;")+'overflow:auto;box-shadow:none;" >',l+=wppaOvlNavBar(),l+=(e?wppaOvlIdx+1+"/"+wppaOvlUrls.length+"<br />":"")+wppaOvlTitles[p],l+="</div>",l+="</div>",(0==wppaOvlActivePanorama?a("#wppa-overlay-ic"):a("#wppa-overlay-pc")).html(l),""!=wppaOvlTypes[p]&&"document"!=wppaOvlTypes[p]||a("#wppa-overlay-ic").show(),wppaFsShow(),a("#wppa-overlay-img").bind("contextmenu",function(p){return!1}),0==wppaOvlPanoramaIds[p]&&wppaOvlResize(),wppaFsShow(),wppaAdjustControlbar(),!1}function wppaOvlSize(p){var a=jQuery;if(!wppaOvlActivePanorama){var t=document.getElementById("wppa-overlay-img"),e=document.getElementById("wppa-overlay-txt");if(t&&e&&"none"!=a("#wppa-overlay-bg").css("display")){if(!wppaIsFs()){var l,o=wppaWindowWidth(),i=wppaWindowHeight(),n=wppaOvlIsVideo?(t.clientWidth,l=wppaOvlVideoNaturalWidths[wppaOvlCurIdx],wppaOvlVideoNaturalHeights[wppaOvlCurIdx]):wppaOvlIsPdf?(wppaWindowWidth(),l=.9*wppaWindowWidth(),.9*wppaWindowHeight()):(t.clientWidth,l=t.naturalWidth,t.naturalHeight);void 0===l&&(l=t.clientWidth,n=t.clientHeight),(t=(e=(o-3*wppaOvlBorderWidth)/l)<(t=i/n)?e:t)<1&&(l=parseInt(l*t),n=parseInt(n*t));var t=a("#wppa-overlay-txt").height(),t="auto"==wppaOvlTxtHeight?(0==t&&(t=20+2*wppaOvlBorderWidth),i-t-20-2*wppaOvlBorderWidth):i-wppaOvlTxtHeight-20-2*wppaOvlBorderWidth,i=parseInt(t*l/n),i=(wppaOvlPadTop,parseInt((o-i)/2),i);n<t&&(wppaOvlPadTop,parseInt((o-l)/2),i=l);o=wppaSavedImageWidth-i<3&&i-wppaSavedImageWidth<3;return i<=10&&(n=180,o=!(l=i=240)),i=parseInt(i),wppaSavedImageWidth=parseInt(i),wppaSavedImageHeight=parseInt(i*n/l),wppaSavedMarginLeft=-parseInt(i/2+wppaOvlBorderWidth),wppaSavedContainerWidth=parseInt(i+2*wppaOvlBorderWidth),wppaSavedContainerHeight=parseInt(wppaSavedImageHeight+wppaOvlBorderWidth+a("#wppa-overlay-txt-container").height()+20),wppaSavedMarginTop=-parseInt(wppaSavedContainerHeight/2),wppaAnimate("#wppa-overlay-img",{width:wppaSavedImageWidth,height:wppaSavedImageHeight},p,wppaEasingLightbox),wppaAnimate("#wppa-overlay-ic",{width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop},p,wppaEasingLightbox),o?(a("#wppa-ovl-spin").hide(),wppaOvlFirst=!1):setTimeout(function(){wppaOvlSize(wppaOvlAnimSpeed)},p+10),!0}wppaOvlFormatFull()}}}function wppaOvlFormatFull(){var p,a=jQuery;if(wppaOvlOpen&&!(0<wppaOvlActivePanorama)){if(wppaOvlIsVideo)p=document.getElementById("wppa-overlay-img"),o=wppaOvlVideoNaturalWidths[wppaOvlIdx],i=wppaOvlVideoNaturalHeights[wppaOvlIdx];else if(wppaOvlIsPdf)p=document.getElementById("wppa-overlay-img"),o=screen.width,i=screen.height;else{if(p=document.getElementById("wppa-overlay-img"),!(wppaIsIe||p&&p.complete))return void setTimeout(wppaOvlFormatFull,200);o=p.naturalWidth,i=p.naturalHeight}var t=o/i,e=0,l=0,o=0,i=0,i=t<screen.width/screen.height?(e=(screen.width-screen.height*t)/2,l=0,o=screen.height,screen.height*t):(e=0,l=(screen.height-screen.width/t)/2,o=screen.width/t,screen.width),e=parseInt(e),l=parseInt(l),o=parseInt(o);return i=parseInt(i),a(p).css({height:o,width:i,marginLeft:e,marginTop:l,left:0,top:0,maxWidth:1e4}),a(p).css({visibility:"visible"}),a("#wppa-ovl-full-bg").css({overflow:"hidden"}),a("#wppa-ovl-full-bg").scrollTop(0),a("#wppa-ovl-full-bg").scrollLeft(0),a("#wppa-ovl-spin").hide(),a("#wppa-ovl-full-bg").css({visibility:"hidden"}),html=a("#wppa-overlay-ic").html(),html+='<div style="position:fixed;bottom:0;left:0;right:0;" >'+wppaOvlNavBar()+"</div>",a("#wppa-overlay-ic").html(html),wppaFsShow(),!0}}function wppaOvlStartAudio(){var p=document.getElementById("wppa-overlay-audio");p&&"function"==typeof p.play&&p.play()}function wppaOvlStartStop(){var p=jQuery;wppaOvlRunning?(wppaOvlRunning=!1,-1!=wppaOvlIdx&&(0!=wppaOvlIdx&&p("#wppa-ovl-prev-btn").css("visibility","visible"),wppaOvlIdx!=wppaOvlUrls.length-1&&p("#wppa-ovl-next-btn").css("visibility","visible")),p("#wppa-ovl-stop-btn").hide(),p("#wppa-ovl-start-btn").show()):(wppaOvlRunning=!0,wppaOvlRun(),p("#wppa-ovl-stop-btn").show(),p("#wppa-ovl-start-btn").hide())}function wppaOvlRun(){if(wppaOvlRunning)if(wppaOvlVideoPlaying||wppaOvlAudioPlaying)setTimeout(wppaOvlRun,50);else{if(!wppaIsVideo&&!wppaOvlIsPdf){var p=document.getElementById("wppa-overlay-img");if(p&&!wppaIsIe&&!p.complete)return void setTimeout(wppaOvlRun,200)}wppaOvlShowNext(),wppaOvlTimer=setTimeout(wppaOvlRun,wppaOvlSlideSpeed)}}function wppaOvlShowPrev(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var p=wppaOvlCurIdx-1;p<0&&(p=wppaOvlUrls.length-1);var a=document.getElementById("wppa-pre-prev");return""!=wppaOvlVideoHtmls[p]||wppaIsIe||a.complete||!wppaOvlOpen?wppaOvlShow(p):setTimeout(wppaOvlShowPrev,200),!1}function wppaOvlShowNext(){if(wppaOvlIsSingle)return!1;jQuery("#wppa-ovl-spin").show(),wppaOvlFsPhotoId=0,wppaPhotoId=0;var p=wppaOvlCurIdx+1;p>wppaOvlUrls.length-1&&(p=0);var a=document.getElementById("wppa-pre-next");return""!=wppaOvlVideoHtmls[p]||wppaIsIe||a.complete||!wppaOvlOpen?wppaOvlShow(p):setTimeout(wppaOvlShowNext,200),!1}function wppaOvlShowSame(){var p,a;wppaOvlOpen&&(p=wppaOvlCurIdx,a=wppaOvlRunning,wppaOvlHide(!0),jQuery("#wppa-ovl-spin").show(),setTimeout(function(){wppaOvlShow(p),a&&setTimeout(wppaOvlStartStop(),wppaOvlSlideSpeed)},1e3))}function wppaOvlHide(p){var a=jQuery;wppaOvlOpen=!1,wppaOvlClosing=!wppaOvlClosing,wppaStopAudio(),p||"lightbox"!=wppaFsPolicy||wppaIsFs()&&wppaFsOff(),a("#wppa-overlay-ic").html("").hide(),a("#wppa-overlay-pc").html("").hide(),a("#wppa-overlay-fpc").html("").hide(),a("#wppa-overlay-zpc").html("").hide(),a(document).off("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!1,wppaOvlFirst=!0,wppaOvlRunning=!1,clearTimeout(wppaOvlTimer),a("#wppa-ovl-spin").hide(),wppaOvlActivePanorama=0,a("body").trigger("quitimage"),document.onLbquitMocc&&(wppaStartStop(document.onLbquitMocc),document.onLbquitMocc=null,document.onLbquitIdx=null),a(window).trigger("wppalightboxend"),a(window).trigger("resize"),wppaOvlClosing&&wppaIsMobile?setTimeout(function(){wppaOvlHide(p)},250):(wppaOvlClosing=!1,p||setTimeout(function(){a("#wppa-overlay-bg").hide(),a("#wppa-ovl-spin").hide()},500))}function wppaOvlOnclick(p){switch(wppaOvlOnclickType){case"none":break;case"close":wppaOvlHide();break;case"browse":var a=p.screenX-window.screenX;48<p.clientY&&(a<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}return!0}function wppaInitOverlay(){var e=jQuery;e(".wp-caption").each(function(){var p=e(this),a=p.find("IMG[alt]").attr("alt")||"",t=p.find(".wp-caption-text").html()||"",p=p.find("a"),t=a+"<br>"+t;p.attr("data-lbtitle")||p.attr("data-lbtitle",t)});var p,a,t=e("a"),l=[];for(wppaOvlFsPhotoId=0,wppaPhotoId=0,(wppaOvlActivePanorama=0)==wppaSavedContainerWidth&&(wppaSavedContainerWidth=240+2*wppaOvlBorderWidth,wppaSavedContainerHeight=180+3*wppaOvlBorderWidth+20+("auto"==wppaOvlTxtHeight?50:wppaOvlTxtHeight),wppaSavedMarginLeft=-(120+wppaOvlBorderWidth),wppaSavedMarginTop=-(90+wppaOvlBorderWidth+10+("auto"==wppaOvlTxtHeight?25:wppaOvlTxtHeight/2)),wppaSavedImageWidth=240,wppaSavedImageHeight=180+wppaOvlBorderWidth),a=0;a<t.length;a++)if(p=t[a],e(p).attr("data-rel")?l=e(p).attr("data-rel").split("["):p.rel?l=p.rel.split("["):l[0]="","wppa"==l[0])switch(wppaWppaOverlayActivated=!0,e(p).on("click",function(p){wppaOvlShow(this),p.preventDefault()}),wppaMagnifierCursor){case"pointer":e(p).css("cursor","pointer");break;case"":e(p).css("cursor","default");break;default:e(p).css("cursor","url( "+wppaImageDirectory+wppaMagnifierCursor+" ),auto")}e(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaAdjustControlbar)}function wppaOvlResize(){0<wppaOvlActivePanorama||(setTimeout("wppaOvlSize( "+wppaOvlAnimSpeed+" )",10),wppaOvlAudioStart&&!wppaOvlAudioPlaying&&setTimeout(wppaOvlStartAudio,100))}function wppaOvlImgClick(p){wppaOvlBrowseOnClick&&!wppaOvlIsSingle&&(p.screenX<screen.width/2?wppaOvlShowPrev:wppaOvlShowNext)()}function wppaOvlNavBar(){var p="";return wppaOvlIsSingle||(p+='<span id="wppa-ovl-prev-btn" style="margin:0 2px 0 0;float:left;display:block;" onclick="wppaOvlShowPrev()" >'+wppaSvgHtml("Prev-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-start-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"none":"block")+';" title="Start" onclick="wppaOvlStartStop()" >'+wppaSvgHtml("Play-Button",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-ovl-stop-btn" style="margin:0 2px;float:left;display:'+(wppaOvlRunning?"block":"none")+';" title="Stop" onclick="wppaOvlStartStop()" >'+wppaSvgHtml("Pause-Button",wppaOvlIconSize,!0,!0)+"</span>",p+='<span id="wppa-ovl-next-btn" style="margin:0 2px;float:right;display:block;" onclick="wppaOvlShowNext()" >'+wppaSvgHtml("Next-Button",wppaOvlIconSize,!0,!0)+"</span>"),p+='<span id="wppa-exit-btn-2" style="margin:0 2px;float:right;display:block;" title="Exit" onclick="wppaOvlHide()" >'+wppaSvgHtml("Exit-2",wppaOvlIconSize,!0,!0)+"</span>","lightbox"!=wppaFsPolicy||wppaIsSafari||wppaIsIpad||(p+='<span id="wppa-fulls-btn-2" class="wppa-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen-2",wppaOvlIconSize,!0,!0)+'</span><span id="wppa-exit-fulls-btn-2" class="wppa-exit-fulls-btn" style="margin:0 2px;float:right;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen-2",wppaOvlIconSize,!0,!0)+"</span>"),p}jQuery(document).ready(function(p){wppaInitOverlay()}),jQuery(window).on("resize",function(){wppaOvlResize()});
11
  // wppa-popup
js/wppa-slideshow.js CHANGED
@@ -40,7 +40,8 @@ function wppaStoreSlideInfo(
40
  waittext, // The time you have to wait before you can vote again on the photo
41
  imagealt,
42
  posterurl,
43
- filename
 
44
  ) {
45
 
46
  var cursor;
@@ -95,6 +96,7 @@ function wppaStoreSlideInfo(
95
  _wppaWaitTexts[mocc] = [];
96
  _wppaImageAlt[mocc] = [];
97
  _wppaFilename[mocc] = [];
 
98
  }
99
 
100
  // Cursor
@@ -181,6 +183,7 @@ function wppaStoreSlideInfo(
181
  _wppaWaitTexts[mocc][id] = waittext;
182
  _wppaImageAlt[mocc][id] = imagealt;
183
  _wppaFilename[mocc][id] = filename;
 
184
  }
185
 
186
  // These functions check the validity and store the users request to be executed later if busy and if applicable.
@@ -1209,25 +1212,15 @@ var result = '';
1209
  }
1210
  }
1211
  else {
1212
- if ( wppaArtmonkeyFileNotSource ) {
1213
- result = '<a' +
1214
- ' href="' + _wppaUrl[mocc][_wppaCurIdx[mocc]] + '"' +
1215
- ' title="Download"' +
1216
- ' style="cursor:pointer;"' +
1217
- ' download="' + _wppaFilename[mocc][_wppaCurIdx[mocc]] + '"' +
1218
- ' >' +
1219
- wppaDownLoad + ': ' + _wppaFullNames[mocc][_wppaCurIdx[mocc]] +
1220
- '</a>';
1221
- }
1222
- else {
1223
- result = '<a' +
1224
- ' title="Download"' +
1225
- ' style="cursor:pointer;"' +
1226
- ' onclick="' + ( wppaIsSafari && wppaArtMonkyLink == 'file' ? 'wppaWindowReference = window.open();' : '' ) + 'wppaAjaxMakeOrigName( '+mocc+', \''+_wppaId[mocc][_wppaCurIdx[mocc]]+'\' );"' +
1227
- ' >' +
1228
- wppaDownLoad + ': ' + _wppaFullNames[mocc][_wppaCurIdx[mocc]] +
1229
- '</a>';
1230
- }
1231
  }
1232
  break;
1233
  case 'none':
40
  waittext, // The time you have to wait before you can vote again on the photo
41
  imagealt,
42
  posterurl,
43
+ filename,
44
+ downurl
45
  ) {
46
 
47
  var cursor;
96
  _wppaWaitTexts[mocc] = [];
97
  _wppaImageAlt[mocc] = [];
98
  _wppaFilename[mocc] = [];
99
+ _wppaDownloadUrl[mocc] = [];
100
  }
101
 
102
  // Cursor
183
  _wppaWaitTexts[mocc][id] = waittext;
184
  _wppaImageAlt[mocc][id] = imagealt;
185
  _wppaFilename[mocc][id] = filename;
186
+ _wppaDownloadUrl[mocc][id] = downurl;
187
  }
188
 
189
  // These functions check the validity and store the users request to be executed later if busy and if applicable.
1212
  }
1213
  }
1214
  else {
1215
+ result =
1216
+ '<a' +
1217
+ ' href="' + _wppaDownloadUrl[mocc][_wppaCurIdx[mocc]] + '"' +
1218
+ ' title="Download"' +
1219
+ ' style="cursor:pointer;"' +
1220
+ ' download="' + _wppaFilename[mocc][_wppaCurIdx[mocc]] + '"' +
1221
+ ' >' +
1222
+ wppaDownLoad + ': ' + _wppaFullNames[mocc][_wppaCurIdx[mocc]] +
1223
+ '</a>';
 
 
 
 
 
 
 
 
 
 
1224
  }
1225
  break;
1226
  case 'none':
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 8.2.07.002
7
  *
8
  */
9
 
@@ -550,54 +550,6 @@ function _wppa_sanitze_files( $root ) {
550
  return $count;
551
  }
552
 
553
- function wppa_admin_page_links( $curpage, $pagesize, $count, $link, $extra = '' ) {
554
-
555
- if ( $pagesize < '1' ) return; // Pagination is off
556
-
557
- $prevpage = $curpage - '1';
558
- $nextpage = $curpage + '1';
559
- $prevurl = $link.'&wppa-page='.$prevpage.$extra;
560
- $pagurl = $link.'&wppa-page=';
561
- $nexturl = $link.'&wppa-page='.$nextpage.$extra;
562
- $npages = ceil( $count / $pagesize );
563
- $lastpagecount = $count % $pagesize;
564
- if ( ! $lastpagecount ) {
565
- $lastpagecount = $pagesize;
566
- }
567
-
568
- $result = '';
569
- if ( $npages > '1' ) {
570
- $result .= '<div style="line-height:1.5em">';
571
- if ( $curpage != '1' ) {
572
- $result .= '<a href="' . esc_url( $prevurl ) . '">' . esc_html__( 'Prev page', 'wp-photo-album-plus' ) . '</a>';
573
- }
574
-
575
- $result .= '<select onchange="document.location=jQuery(this).val()">';
576
-
577
- $i = '1';
578
- while ( $i <= $npages ) {
579
- if ( $i == $curpage ) {
580
- $result .= '<option selected>' . $i . '</option>';
581
- }
582
- else {
583
- $result .= '<option value="' . esc_url( $pagurl . $i . $extra ) . '"' . ( $i == $npages ? ' title="' . esc_attr( $lastpagecount ) . '"' : '' ) . '>' . $i . '</option>';
584
- }
585
- $i++;
586
- }
587
- $result .= '</select>';
588
-
589
-
590
- if ( $curpage != $npages ) {
591
- $result .=
592
- ' <a href="' . esc_url( $nexturl ) . '" >' .
593
- esc_html__( 'Next page', 'wp-photo-album-plus' ) .
594
- '</a>';
595
- }
596
- $result .= '</div><br>&nbsp;';
597
-
598
- wppa_echo( $result );
599
- }
600
- }
601
 
602
  function wppa_update_single_photo( $file, $id, $name ) {
603
  global $wpdb;
@@ -980,42 +932,45 @@ global $wpdb;
980
  $pendingcount = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE status = 'pending'" );
981
  $schedulecount = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE status = 'scheduled'" );
982
 
983
- $result =
984
- sprintf( __( 'There are <strong>%d</strong> albums and <strong>%d</strong> photos in the system.', 'wp-photo-album-plus' ), $albcount, $photocount );
985
- if ( $pendingcount ) {
986
- $result .= ' ' . sprintf( __( '<strong>%d</strong> photos are pending moderation.', 'wp-photo-album-plus' ), $pendingcount );
987
- }
988
- if ( $schedulecount ) {
989
- $result .= ' ' . sprintf( __( '<strong>%d</strong> photos are scheduled for later publishing.', 'wp-photo-album-plus' ), $pendingcount );
990
- }
 
991
 
992
- $lastalbum = $wpdb->get_row( "SELECT id, name FROM $wpdb->wppa_albums ORDER BY id DESC LIMIT 1", ARRAY_A );
993
- if ( $lastalbum ) {
994
- $result .= '<br>' . sprintf( __( 'The most recently added album is <strong>%s</strong> (%d).', 'wp-photo-album-plus' ), sanitize_text_field( $lastalbum['name'] ), $lastalbum['id'] );
995
- }
996
- $lastphoto = $wpdb->get_row( "SELECT id, name, album FROM $wpdb->wppa_photos ORDER BY timestamp DESC LIMIT 1", ARRAY_A );
997
- if ( ! $lastphoto ) {
998
- $result .= '<br>' . __( 'There are no photos yet', 'wp-photo-album-plus' );
999
- return $result;
1000
- }
1001
- if ( $lastphoto['album'] < '1' ) {
1002
- $trashed = true;
1003
- $album = - ( $lastphoto['album'] + '9' );
1004
- }
1005
- else {
1006
- $trashed = false;
1007
- $album = $lastphoto['album'];
1008
- }
1009
- $lastphotoalbum = $wpdb->get_row( $wpdb->prepare( "SELECT id, name FROM $wpdb->wppa_albums WHERE id = %s", $album ), ARRAY_A );
1010
- if ( $lastphoto ) {
1011
- $result .= '<br>' . sprintf( __( 'The most recently added photo is <strong>%s</strong> (%d)', 'wp-photo-album-plus' ), sanitize_text_field( $lastphoto['name'] ), $lastphoto['id'] );
1012
- if ( $lastphotoalbum ) {
1013
- $result .= ' ' . sprintf( __( 'in album <strong>%s</strong> (%d).', 'wp-photo-album-plus' ), sanitize_text_field( $lastphotoalbum['name'] ), $lastphotoalbum['id'] );
1014
  }
1015
- if ( $trashed ) {
1016
- $result .= ' <span style="color:red" >' . __( 'Deleted', 'wp-photo-album-plus' ) . '</span>';
 
 
1017
  }
1018
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1019
  return $result;
1020
  }
1021
 
@@ -1112,3 +1067,395 @@ function wppa_make_360( $id, $degs ) {
1112
  // All done
1113
  return true;
1114
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 8.3.01.006
7
  *
8
  */
9
 
550
  return $count;
551
  }
552
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
 
554
  function wppa_update_single_photo( $file, $id, $name ) {
555
  global $wpdb;
932
  $pendingcount = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE status = 'pending'" );
933
  $schedulecount = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE status = 'scheduled'" );
934
 
935
+ $result = '
936
+ <div style="clear:both;display:block">' .
937
+ sprintf( __( 'There are <strong>%d</strong> albums and <strong>%d</strong> photos in the system.', 'wp-photo-album-plus' ), $albcount, $photocount );
938
+ if ( $pendingcount ) {
939
+ $result .= ' ' . sprintf( __( '<strong>%d</strong> photos are pending moderation.', 'wp-photo-album-plus' ), $pendingcount );
940
+ }
941
+ if ( $schedulecount ) {
942
+ $result .= ' ' . sprintf( __( '<strong>%d</strong> photos are scheduled for later publishing.', 'wp-photo-album-plus' ), $pendingcount );
943
+ }
944
 
945
+ $lastalbum = $wpdb->get_row( "SELECT id, name FROM $wpdb->wppa_albums ORDER BY id DESC LIMIT 1", ARRAY_A );
946
+ if ( $lastalbum ) {
947
+ $result .= '<br>' . sprintf( __( 'The most recently added album is <strong>%s</strong> (%d).', 'wp-photo-album-plus' ), esc_html( stripslashes( $lastalbum['name'] ) ), $lastalbum['id'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
948
  }
949
+ $lastphoto = $wpdb->get_row( "SELECT id, name, album FROM $wpdb->wppa_photos ORDER BY timestamp DESC LIMIT 1", ARRAY_A );
950
+ if ( ! $lastphoto ) {
951
+ $result .= '<br>' . __( 'There are no photos yet', 'wp-photo-album-plus' );
952
+ return $result;
953
  }
954
+ if ( $lastphoto['album'] < '1' ) {
955
+ $trashed = true;
956
+ $album = - ( $lastphoto['album'] + '9' );
957
+ }
958
+ else {
959
+ $trashed = false;
960
+ $album = $lastphoto['album'];
961
+ }
962
+ $lastphotoalbum = $wpdb->get_row( $wpdb->prepare( "SELECT id, name FROM $wpdb->wppa_albums WHERE id = %s", $album ), ARRAY_A );
963
+ if ( $lastphoto ) {
964
+ $result .= '<br>' . sprintf( __( 'The most recently added photo is <strong>%s</strong> (%d)', 'wp-photo-album-plus' ), sanitize_text_field( $lastphoto['name'] ), $lastphoto['id'] );
965
+ if ( $lastphotoalbum ) {
966
+ $result .= ' ' . sprintf( __( 'in album <strong>%s</strong> (%d).', 'wp-photo-album-plus' ), esc_html( stripslashes( $lastphotoalbum['name'] ) ), $lastphotoalbum['id'] );
967
+ }
968
+ if ( $trashed ) {
969
+ $result .= ' <span style="color:red" >' . __( 'Deleted', 'wp-photo-album-plus' ) . '</span>';
970
+ }
971
+ }
972
+ $result .= '</div>';
973
+
974
  return $result;
975
  }
976
 
1067
  // All done
1068
  return true;
1069
  }
1070
+
1071
+ // Admin pagelinks
1072
+ // @1: string, from where slug
1073
+ // @2: int, current pagesize
1074
+ // @3: int, current page
1075
+ // @4: int: total count
1076
+ // @5: string: reload url without '@paged=...'
1077
+ // @6: bool: return if true, else output directly
1078
+ function wppa_admin_pagination( $pagesize, $current, $total_items, $url, $which = 'bottom' ) {
1079
+
1080
+ // Need pagination?
1081
+ if ( $total_items < '21' ) {
1082
+ return '';
1083
+ }
1084
+
1085
+ // Init
1086
+ if ( $which != 'top' ) {
1087
+ $which = 'bottom';
1088
+ }
1089
+ $output = '';
1090
+ $link = $url . '&paged=';
1091
+ $total_pages = $pagesize ? ceil( $total_items / $pagesize ) : '1';
1092
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
1093
+ $current_url = remove_query_arg( 'paged', $current_url );
1094
+
1095
+ $page_links = array();
1096
+
1097
+ $disable_first = false;
1098
+ $disable_last = false;
1099
+ $disable_prev = false;
1100
+ $disable_next = false;
1101
+
1102
+ if ( 1 == $current ) {
1103
+ $disable_first = true;
1104
+ $disable_prev = true;
1105
+ }
1106
+ if ( $total_pages == $current ) {
1107
+ $disable_last = true;
1108
+ $disable_next = true;
1109
+ }
1110
+
1111
+ // Overall wrapper, for bottom only
1112
+ if ( $which == 'bottom' ) {
1113
+ $output .= '<div class="test" style="line-height:2.1em;margin-top:6px;">';
1114
+ }
1115
+
1116
+ // Inner wrapper
1117
+ $output .= '<div class="wppa-admin-pagination">';
1118
+
1119
+ // Total number of items
1120
+ $output .= '
1121
+ <span class="displaying-num">' .
1122
+ sprintf(
1123
+ /* translators: %s: Number of items. */
1124
+ _n( '%s item', '%s items', $total_items ),
1125
+ number_format_i18n( $total_items ) ) . '
1126
+ </span>';
1127
+
1128
+ // Start pagination links
1129
+ $output .= "\n".'<span class="pagination-links">';
1130
+
1131
+ // First indicator / button
1132
+ if ( $disable_first ) {
1133
+ $output .= "\n".'<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&laquo;</span>';
1134
+ } else {
1135
+ $output .= "\n" . sprintf(
1136
+ '<a class="first-page button" href="%s"><span class="screen-reader-text">%s</span><span aria-hidden="true">&laquo;</span></a>',
1137
+ esc_url( add_query_arg( 'paged', 1, $current_url ) ),
1138
+ __( 'First page' ),
1139
+ );
1140
+ }
1141
+
1142
+ // Prev indicator / button
1143
+ if ( $disable_prev ) {
1144
+ $output .= "\n".'<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&lsaquo;</span>';
1145
+ } else {
1146
+ $output .= "\n".sprintf(
1147
+ '<a class="prev-page button" href="%s"><span class="screen-reader-text">%s</span><span aria-hidden="true">&lsaquo;</span></a>',
1148
+ esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),
1149
+ __( 'Previous page' ),
1150
+ );
1151
+ }
1152
+
1153
+ // Current page bottom
1154
+ if ( 'bottom' === $which ) {
1155
+ $html_current_page = $current;
1156
+ $total_pages_before = '
1157
+ <span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">';
1158
+ }
1159
+
1160
+ // Current page top
1161
+ else {
1162
+ $html_current_page = sprintf(
1163
+ '%s<input
1164
+ class="current-page pietje"
1165
+ id="current-page-selector"
1166
+ type="text"
1167
+ name="paged"
1168
+ value="%s"
1169
+ size="%d"
1170
+ aria-describedby="table-paging"
1171
+ onchange="document.location.href=\'%s&paged=\'+Math.min(Math.max(parseInt(this.value)||1,1),'.$total_pages.')"
1172
+ /><span class="tablenav-paging-text">',
1173
+ '<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
1174
+ $current,
1175
+ strlen( $total_pages ),
1176
+ esc_url( remove_query_arg( 'paged' ) )
1177
+ );
1178
+ $total_pages_before = '<span class="paging-input">';
1179
+ }
1180
+
1181
+ $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
1182
+ $output .= $total_pages_before . sprintf(
1183
+
1184
+ /* translators: 1: Current page, 2: Total pages. */
1185
+ _x( '%1$s of %2$s', 'wp-photo-album-plus' ),
1186
+ $html_current_page,
1187
+ $html_total_pages
1188
+ ) . '</span></span>';
1189
+
1190
+ // Next button / indicator
1191
+ if ( $disable_next ) {
1192
+ $output .= "\n".'<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&rsaquo;</span>';
1193
+ } else {
1194
+ $output .= "\n". sprintf(
1195
+ '<a class="next-page button" href="%s"><span class="screen-reader-text">%s</span><span aria-hidden="true">&rsaquo;</span></a>',
1196
+ esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),
1197
+ __( 'Next page' )
1198
+ );
1199
+ }
1200
+
1201
+ // Last button / indicator
1202
+ if ( $disable_last ) {
1203
+ $output .= '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&raquo;</span>';
1204
+ } else {
1205
+ $output .= sprintf(
1206
+ '<a class="last-page button" href="%s"><span class="screen-reader-text">%s</span><span aria-hidden="true">&raquo;</span></a>',
1207
+ esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
1208
+ __( 'Last page' )
1209
+ );
1210
+ }
1211
+
1212
+ // The pagesize selectionbox
1213
+ if ( $which == 'top' ) {
1214
+ $output .= ' ' .
1215
+ __( 'Pagesize', 'wp-photo-album-plus' ) . '
1216
+ <select style="vertical-align:top"
1217
+ onchange="jQuery( \'#wppa-admin-spinner\' ).show();document.location.href=\''.$link.'1&wppa-pagesize=\'+this.value;">
1218
+ <option value="20"' . ( $pagesize == '20' ? ' selected' : '' ) . '>20</option>
1219
+ <option value="50"' . ( $pagesize == '50' ? ' selected' : '' ) . '>50</option>
1220
+ <option value="100"' . ( $pagesize == '100' ? ' selected' : '' ) . '>100</option>
1221
+ <option value="200"' . ( $pagesize == '200' ? ' selected' : '' ) . '>200</option>
1222
+ <option value="500"' . ( $pagesize == '500' ? ' selected' : '' ) . '>500</option>
1223
+ <option value="1000"' . ( $pagesize == '1000' ? ' selected' : '' ) . '>1000</option>
1224
+ </select>';
1225
+ }
1226
+
1227
+ // Close pagination links
1228
+ $output .= '</span>';
1229
+
1230
+ // Close overall inner
1231
+ $output .= '</div>';
1232
+
1233
+ // Close overall wrapper, bottom only
1234
+ if ( $which == 'bottom' ) {
1235
+ $output .= '</div>';
1236
+ }
1237
+
1238
+ // Done
1239
+ wppa_echo( $output, false, false, false, true );
1240
+ }
1241
+
1242
+ // Get paging parameters
1243
+ function wppa_get_paging_parms( $slug, $save = true ) {
1244
+
1245
+ // Init
1246
+ $result = array();
1247
+ $defdesc = false;;
1248
+
1249
+ /* Order by */
1250
+ switch( $slug ) {
1251
+ case 'edit_email':
1252
+
1253
+ // Default
1254
+ $result['order'] = 'ID';
1255
+
1256
+ // Query arg?
1257
+ $order_new = wppa_get( 'order-by', '', 'text' );
1258
+ if ( in_array( $order_new, ['ID','user_login', 'display_name'] ) ) {
1259
+ $result['order'] = $order_new;
1260
+ $new = true;
1261
+ }
1262
+ else {
1263
+ $new = false;
1264
+ }
1265
+ break;
1266
+
1267
+ case 'album_admin':
1268
+
1269
+ // Default
1270
+ $result['order'] = 'id';
1271
+
1272
+ // Query arg?
1273
+ $order_new = wppa_get( 'order-by', '', 'text' );
1274
+ if ( in_array( $order_new, ['id','name','description','owner','a_order','a_parent'] ) ) {
1275
+ $result['order'] = $order_new;
1276
+ $new = true;
1277
+ }
1278
+ else {
1279
+ $new = false;
1280
+ }
1281
+ break;
1282
+
1283
+ case 'comment_admin':
1284
+
1285
+ // Default
1286
+ $result['order'] = 'timestamp';
1287
+
1288
+ // Query arg?
1289
+ $order_new = wppa_get( 'order-by', '', 'text' );
1290
+ if ( in_array( $order_new, ['id','timestamp','photo','user'] ) ) {
1291
+ $result['order'] = $order_new;
1292
+ $new = true;
1293
+ }
1294
+ else {
1295
+ $new = false;
1296
+ }
1297
+ break;
1298
+
1299
+ case 'photo_admin':
1300
+ case 'photo_quick':
1301
+ case 'photo_bulk':
1302
+
1303
+ // Default
1304
+ $result['order'] = '';
1305
+ $new = true;
1306
+ break;
1307
+
1308
+ default:
1309
+
1310
+ // Should never get here
1311
+ wppa_log( 'err', 'Unimplemented slug in wppa_get_paging_parms(): ' . $slug);
1312
+ $result['order'] = false;
1313
+ $new = true;
1314
+ }
1315
+
1316
+ // Used before?
1317
+ if ( ! $new ) {
1318
+ $order_old = get_transient( 'wppa_' . $slug . '_seq-' . wppa_get_user() );
1319
+ if ( $order_old ) {
1320
+ $result['order'] = $order_old;
1321
+ }
1322
+ }
1323
+
1324
+ // Save ?
1325
+ if ( $save && $result['order'] ) {
1326
+ set_transient( 'wppa_' . $slug . '_seq-' . wppa_get_user(), $result['order'] );
1327
+ }
1328
+
1329
+ /* dir */
1330
+ $result['dir'] = $defdesc ? 'DESC' : 'ASC';
1331
+
1332
+ // Query arg?
1333
+ $dir_new = wppa_get( 'dir', '', 'text' );
1334
+ if ( in_array( $dir_new, ['ASC', 'DESC'] ) ) {
1335
+ $result['dir'] = $dir_new;
1336
+ }
1337
+
1338
+ // Used before?
1339
+ elseif ( get_transient( 'wppa_' . $slug . '_dir-' . wppa_get_user() ) == 'DESC' ) {
1340
+ $result['dir'] = 'DESC';
1341
+ }
1342
+
1343
+ // Save ?
1344
+ if ( $save && $result['order'] ) {
1345
+ set_transient( 'wppa_' . $slug . '_dir-' . wppa_get_user(), $result['dir'] );
1346
+ }
1347
+
1348
+ /* Page */
1349
+ $result['page'] = wppa_get( 'paged', '', 'int' );
1350
+
1351
+ // Nothing yet?
1352
+ if ( ! $result['page'] ) {
1353
+ $result['page'] = '1';
1354
+ }
1355
+
1356
+ /* Pagesize */
1357
+ $result['pagesize'] = wppa_get( 'wppa-pagesize', '', 'int' );
1358
+
1359
+ // Used before?
1360
+ if ( ! wppa_is_int( $result['pagesize'] ) ) {
1361
+ $result['pagesize'] = get_transient( 'wppa_' . $slug . '_pagesize-' . wppa_get_user() );
1362
+ }
1363
+
1364
+ // Nothing yet?
1365
+ if ( ! $result['pagesize'] ) {
1366
+ $result['pagesize'] = '20';
1367
+ }
1368
+
1369
+ // Save ?
1370
+ if ( $save ) {
1371
+ set_transient( 'wppa_' . $slug . '_pagesize-' . wppa_get_user(), $result['pagesize'] );
1372
+ }
1373
+
1374
+ return $result;
1375
+ }
1376
+
1377
+ // Get admin page reload url
1378
+ // arg1: string. where slug
1379
+ // arg2: string. a vailt order column
1380
+ function wppa_admin_reload_url( $slug, $for ) {
1381
+
1382
+ // Init
1383
+ $err = false;
1384
+
1385
+ // Validate args
1386
+ switch( $slug ) {
1387
+ case 'edit_email':
1388
+ if ( ! in_array( $for, ['ID', 'user_login', 'display_name'] ) ) {
1389
+ $err = true;
1390
+ }
1391
+ break;
1392
+ case 'album_admin':
1393
+ if ( ! in_array( $for, ['id', 'name', 'description', 'owner', 'a_order', 'a_parent'] ) ) {
1394
+ $err = true;
1395
+ }
1396
+ break;
1397
+ default:
1398
+ $err = true;
1399
+ }
1400
+
1401
+ if ( $err ) {
1402
+ wppa_log( 'err', 'Invalid for in wppa_admin_reload_url('.$slug.','.$for.')');
1403
+ return '';
1404
+ }
1405
+
1406
+ // Do it
1407
+ $parms = wppa_get_paging_parms( $slug, false );
1408
+ if ( $for == $parms['order'] ) {
1409
+ if ( $parms['dir'] == 'ASC' ) {
1410
+ $dir = 'DESC';
1411
+ }
1412
+ else {
1413
+ $dir = 'ASC';
1414
+ }
1415
+ $page = $parms['page'];
1416
+ }
1417
+ else {
1418
+ $dir = 'ASC';
1419
+ $page = '1';
1420
+ }
1421
+
1422
+ switch( $slug ) {
1423
+
1424
+ case 'edit_email':
1425
+ $url = get_admin_url() . 'admin.php?page=wppa_edit_email&wppa-order-by=' . $for . '&wppa-dir=' . $dir . '&paged=' . $page;
1426
+ break;
1427
+
1428
+ case 'album_admin':
1429
+ $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&wppa-order-by=' . $for . '&wppa-dir=' . $dir . '&paged=' . $page;
1430
+ break;
1431
+
1432
+ default:
1433
+ $url = '';
1434
+ }
1435
+
1436
+ return $url;
1437
+ }
1438
+
1439
+ function wppa_status_display_name( $status ) {
1440
+ static $wppa_statarray;
1441
+
1442
+ if ( ! $wppa_statarray ) {
1443
+ $wppa_statarray = [
1444
+ 'pending' => __( 'Pending', 'wp-photo-album-plus' ),
1445
+ 'publish' => __( 'Publish', 'wp-photo-album-plus' ),
1446
+ 'featured' => __( 'Featured', 'wp-photo-album-plus' ),
1447
+ 'gold' => __( 'Gold', 'wp-photo-album-plus' ),
1448
+ 'silver' => __( 'Silver', 'wp-photo-album-plus' ),
1449
+ 'bronze' => __( 'Bronze', 'wp-photo-album-plus' ),
1450
+ 'scheduled' => __( 'Scheduled', 'wp-photo-album-plus' ),
1451
+ 'private' => __( 'Private', 'wp-photo-album-plus' ),
1452
+ ];
1453
+ }
1454
+ if ( isset( $wppa_statarray[$status] ) ) {
1455
+ return $wppa_statarray[$status];
1456
+ }
1457
+ else {
1458
+ wppa_log( 'err', "Uniplemented status found in wppa_status_display_name( $status )" );
1459
+ return '';
1460
+ }
1461
+ }
wppa-admin-local-js.php ADDED
@@ -0,0 +1,470 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* wppa-admin-local-js.php
3
+ * Package: wp-photo-album-plus
4
+ *
5
+ * local js code for admin pages
6
+ * Version 8.3.01.006
7
+ *
8
+ */
9
+
10
+ function wppa_add_local_js( $slug ) {
11
+
12
+ switch( $slug ) {
13
+
14
+ case 'wppa_album_photos':
15
+ {
16
+ $the_js = "
17
+ function wppaTryMove( id, video ) {
18
+
19
+ var query;
20
+
21
+ if ( ! jQuery( '#target-' + id ).val() ) {
22
+ alert( '" . esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) . "' );
23
+ return false;
24
+ }
25
+
26
+ if ( video ) {
27
+ query = '" . esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) . "';
28
+ }
29
+ else {
30
+ query = '" . esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) . "';
31
+ }
32
+
33
+ if ( confirm( query ) ) {
34
+ wppaAjaxUpdatePhoto( id, 'moveto', document.getElementById( 'target-' + id ).value );
35
+ }
36
+ }
37
+
38
+ function wppaTryCopy( id, video ) {
39
+
40
+ var query;
41
+
42
+ if ( ! jQuery( '#target-' + id ).val() ) {
43
+ alert( '" . esc_js( __( 'Please select an album to copy to first.', 'wp-photo-album-plus' ) ) . "' );
44
+ return false;
45
+ }
46
+
47
+ if ( video ) {
48
+ query = '" . esc_js( __( 'Are you sure you want to copy this video?', 'wp-photo-album-plus' ) ) . "';
49
+ }
50
+ else {
51
+ query = '" . esc_js( __( 'Are you sure you want to copy this photo?', 'wp-photo-album-plus' ) ) . "';
52
+ }
53
+
54
+ if ( confirm( query ) ) {
55
+ wppaAjaxUpdatePhoto( id, 'copyto', document.getElementById( 'target-' + id ).value );
56
+ }
57
+ }
58
+
59
+ function wppaTryDelete( id, video, perm ) {
60
+
61
+ var query;
62
+
63
+ if ( perm ) {
64
+ if ( video ) {
65
+ query = '" . esc_js( __( 'Are you sure you want to remove this video permanently?', 'wp-photo-album-plus' ) ) . "';
66
+ }
67
+ else {
68
+ query = '" . esc_js( __( 'Are you sure you want to remove this photo permanently?', 'wp-photo-album-plus' ) ) . "';
69
+ }
70
+ }
71
+ else {
72
+ if ( video ) {
73
+ query = '" . esc_js( __( 'Are you sure you want to delete this video?', 'wp-photo-album-plus' ) ) . "';
74
+ }
75
+ else {
76
+ query = '" . esc_js( __( 'Are you sure you want to delete this photo?', 'wp-photo-album-plus' ) ) . "';
77
+ }
78
+ }
79
+
80
+ if ( confirm( query ) ) {
81
+ if ( perm ) {
82
+ wppaAjaxDeletePhoto( id, '', '', true );
83
+ }
84
+ else {
85
+ wppaAjaxDeletePhoto( id );
86
+ }
87
+ jQuery( window ).trigger( 'scroll' );
88
+ }
89
+ }
90
+
91
+ function wppaTryUndelete ( id ) {
92
+ wppaAjaxUndeletePhoto( id );
93
+ }
94
+
95
+ function wppaTryRotLeft( id ) {
96
+
97
+ var query = '" . esc_js( __( 'Are you sure you want to rotate this photo left?', 'wp-photo-album-plus' ) ) . "';
98
+
99
+ if ( confirm( query ) ) {
100
+ wppaAjaxUpdatePhoto( id, 'rotleft', 0 );
101
+ }
102
+ }
103
+
104
+ function wppaTryRot180( id ) {
105
+
106
+ var query = '" . esc_js( __( 'Are you sure you want to rotate this photo 180&deg;?', 'wp-photo-album-plus' ) ) . "';
107
+
108
+ if ( confirm( query ) ) {
109
+ wppaAjaxUpdatePhoto( id, 'rot180', 0 );
110
+ }
111
+ }
112
+
113
+ function wppaTryRotRight( id ) {
114
+
115
+ var query = '" . esc_js( __( 'Are you sure you want to rotate this photo right?', 'wp-photo-album-plus' ) ) . "';
116
+
117
+ if ( confirm( query ) ) {
118
+ wppaAjaxUpdatePhoto( id, 'rotright', 0 );
119
+ }
120
+ }
121
+
122
+ function wppaTryFlip( id ) {
123
+
124
+ var query = '" . esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) . "';
125
+
126
+ if ( confirm( query ) ) {
127
+ wppaAjaxUpdatePhoto( id, 'flip', 0 );
128
+ }
129
+ }
130
+
131
+ function wppaTryFlop( id ) {
132
+
133
+ var query = '" . esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) . "';
134
+
135
+ if ( confirm( query ) ) {
136
+ wppaAjaxUpdatePhoto( id, 'flop', 0 );
137
+ }
138
+ }
139
+
140
+ function wppaTryWatermark( id, hasSource, canRemove ) {
141
+
142
+ var query;
143
+ var wmFile = jQuery( '#wmfsel_' + id ).val();
144
+ if ( wmFile == '--- none ---' ) {
145
+ alert( '" . esc_js( __( 'No watermark selected', 'wp-photo-album-plus' ) ) . "' );
146
+ return;
147
+ }
148
+ if ( hasSource ) {
149
+ query = '" . esc_js( __( 'Are you sure?', 'wp-photo-album-plus' ) ) . "';
150
+ query += '. ';
151
+ query += '" . esc_js( __( 'To revert to the default watermark setting afterwards: select Watermark: --- default --- and press the Remake files button', 'wp-photo-album-plus' ) ) . "';
152
+ if ( canRemove ) {
153
+ query += '. ';
154
+ query += '" . esc_js( __( 'To remove: select Watermark: --- none --- and press the Remake files button', 'wp-photo-album-plus' ) ) . "';
155
+ }
156
+ }
157
+ else {
158
+ query = '" . esc_js( __( 'Are you sure? Once applied it can not be removed!', 'wp-photo-album-plus' ) ) . "';
159
+ query += '. ';
160
+ query += '" . esc_js( __( 'And I do not know if there is already a watermark on this photo', 'wp-photo-album-plus' ) ) . "';
161
+ }
162
+
163
+ if ( confirm( query ) ) {
164
+ wppaAjaxApplyWatermark( id, document.getElementById( 'wmfsel_' + id ).value, document.getElementById( 'wmpsel_' + id ).value );
165
+ }
166
+ }
167
+
168
+ function wppaTryMagick( id, slug, value ) {
169
+
170
+ if ( ! value ) {
171
+ value = 0;
172
+ }
173
+
174
+ var query = '" . esc_js( __( 'Are you sure you want to magically process this photo?', 'wp-photo-album-plus' ) ) . "';
175
+
176
+ if ( true || confirm( query ) ) {
177
+ jQuery( '#wppa-admin-spinner' ).css( 'display', 'inline' );
178
+ wppaAjaxUpdatePhoto( id, slug, value );
179
+ }
180
+ }
181
+
182
+ wppaHor = false;
183
+ function wppaToggleHorizon() {
184
+ if ( wppaHor ) {
185
+ jQuery( '#wppa-horizon' ).css( 'display', 'none' );
186
+ wppaHor = false;
187
+ }
188
+ else {
189
+ jQuery( '#wppa-horizon' ).css( 'display', 'inline' );
190
+ wppaHor = true;
191
+ }
192
+ }
193
+
194
+ function wppaTryScheduledel( id ) {
195
+ wppaPhotoStatusChange( id );
196
+ if ( ! jQuery( '#scheduledel-' + id ).prop( 'checked' ) ) {
197
+ wppaAjaxUpdatePhoto( id, 'removescheduledel', 0 );
198
+ }
199
+ }
200
+ ";
201
+
202
+ // The script for the tabs to operate
203
+ $the_js .= '
204
+ function wppaChangePhotoAdminTab(elm,tabId,itemId) {
205
+ jQuery(".wppa-photoadmin-tab-"+itemId).removeClass(\'active\');
206
+ jQuery(elm).addClass(\'active\');
207
+ jQuery(".wppa-tabcontent-"+itemId).hide();
208
+ jQuery(tabId).show();
209
+ }';
210
+
211
+ break;
212
+ }
213
+
214
+ case 'wppa_album_photos_bulk':
215
+ {
216
+ $the_js = "
217
+ function wppaTryMove( id, video ) {
218
+
219
+ var query;
220
+
221
+ if ( ! jQuery( '#target-' + id ).val() ) {
222
+ alert( '" . esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) . "' );
223
+ return false;
224
+ }
225
+
226
+ if ( video ) {
227
+ query = '" . esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) . "';
228
+ }
229
+ else {
230
+ query = '" . esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) . "';
231
+ }
232
+
233
+ if ( ! jQuery('#confirm-move').prop('checked') || confirm( query ) ) {
234
+ jQuery( '#moving-' + id ).html( '". __( 'Moving...', 'wp-photo-album-plus' ) . "' );
235
+ wppaAjaxUpdatePhoto( id, 'moveto', jQuery( '#target-' + id ).val(), false, '<td colspan=\'8\' >', '</td>' );
236
+ }
237
+ }" . '
238
+ jQuery(document).ready( function() {
239
+ wppaSetConfirmDelete( "confirm-delete" );
240
+ wppaSetConfirmMove( "confirm-move" );
241
+ });
242
+ function wppaConfirmAndDelete(id, immediate) {
243
+ if ( ! jQuery("#confirm-delete").prop("checked") ||
244
+ confirm( "' . esc_js( __( 'Are you sure you want to delete this photo?', 'wp-photo-album-plus' ) ) . '" ) ) {
245
+ jQuery("#wppa-delete-"+id).html( "' . esc_js( __('Deleting...', 'wp-photo-album-plus' ) ) . '" );
246
+ wppaAjaxDeletePhoto(id, "<td colspan=8 >", "</td>", immediate);
247
+ }
248
+ }';
249
+
250
+ break;
251
+ }
252
+
253
+ case 'wppa_album_photos_sequence':
254
+ {
255
+ $the_js = '
256
+ jQuery( function() {
257
+ jQuery( "#sortable" ).sortable( {
258
+ cursor: "move",
259
+ placeholder: "sortable-placeholder-photos",
260
+ stop: function( event, ui ) {
261
+ var ids = jQuery( ".wppa-sort-item" );
262
+ var seq = jQuery( ".wppa-sort-seqn" );
263
+ var idx = 0;
264
+ while ( idx < ids.length ) {
265
+ var newvalue;
266
+ if ( wppaSeqnoDesc ) {
267
+ newvalue = ids.length - idx;
268
+ }
269
+ else newvalue = idx + 1;
270
+ var oldvalue = seq[idx].value;
271
+ var photo = ids[idx].value;
272
+ if ( newvalue != oldvalue ) {
273
+ wppaDoSeqUpdate( photo, newvalue );
274
+ }
275
+ idx++;
276
+ }
277
+ },
278
+ delay: 100,
279
+ opacity: 0.5,
280
+ scroll: false,
281
+ cursorAt: { left: 90, top: 90 }
282
+ });
283
+ jQuery( "#sortable" ).disableSelection();
284
+ });
285
+ var wppaAjaxRequests = 0;
286
+ function wppaDoSeqUpdate( photo, seqno ) {
287
+ if ( wppaAjaxRequests >=10 ) {
288
+ setTimeout(function(){wppaDoSeqUpdate( photo, seqno );},500);
289
+ return;
290
+ }
291
+ var data = "action=wppa&wppa-action=update-photo&photo-id="+photo+"&item=p_order&wppa-nonce="+document.getElementById(\'photo-nonce-\'+photo).value+"&value="+seqno;
292
+ var xmlhttp = new XMLHttpRequest();
293
+
294
+ xmlhttp.onreadystatechange = function() {
295
+ if ( xmlhttp.readyState == 4 && xmlhttp.status != 404 ) {
296
+ var ArrValues = xmlhttp.responseText.split( "||" );
297
+ if ( ArrValues[0] != "" ) {
298
+ alert("The server returned unexpected output:\n"+ArrValues[0]);
299
+ }
300
+ switch ( ArrValues[1] ) {
301
+ case "0": // No error
302
+ jQuery("#wppa-seqno-"+photo).html(seqno);
303
+ break;
304
+ case "99": // Photo is gone
305
+ jQuery("#wppa-seqno-"+photo).html(\'<span style="color:red">deleted</span>\');
306
+ break;
307
+ default: // Any error
308
+ jQuery("#wppa-seqno-"+photo).html(\'<span style="color:red">Err:"+ArrValues[1]+"</span>\');
309
+ break;
310
+ }
311
+ wppaAjaxRequests--;
312
+ wppaConsoleLog("Pending ajax requests = "+wppaAjaxRequests);
313
+ }
314
+ }
315
+ xmlhttp.open("POST",wppaAjaxUrl,true);
316
+ xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
317
+ xmlhttp.send( data );
318
+ wppaAjaxRequests++;
319
+ wppaConsoleLog("Pending ajax requests = "+wppaAjaxRequests);
320
+ jQuery("#wppa-sort-seqn-"+photo).val(seqno); // set hidden value to new value to prevent duplicate action
321
+ var spinnerhtml = \'<img src="\'+wppaImageDirectory+\'spinner.gif" />\';
322
+ jQuery("#wppa-seqno-"+photo).html(spinnerhtml);
323
+ }';
324
+ break;
325
+ }
326
+
327
+ case '_wppa_admin':
328
+ {
329
+ $the_js = '
330
+ function wppaChangeAlbumAdminTab(elm,tabid) {
331
+ jQuery(".wppa-albumadmin-tab").removeClass(\'active\');
332
+ jQuery(elm).addClass(\'active\');
333
+ jQuery(".wppa-tabcontent").hide();
334
+ jQuery(tabid).show();
335
+ }
336
+ function wppaGoEditAlbNo() {
337
+ var id = parseInt(document.getElementById("wppa-edit-albid").value);
338
+ if (id > 0) {
339
+ var nonce = "' . wp_create_nonce( 'wppa-nonce' ) .'";
340
+ var href = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&wppa-nonce="+nonce+"&tab=edit&edit-id="+id;
341
+ document.location.href=href;
342
+ }
343
+ else {
344
+ alert("' . __( 'Please enter a valid album id', 'wp-photo-album-plus' ) . '");
345
+ }
346
+ }
347
+ function wppaGoApplyFilter() {
348
+ var filter = document.getElementById("wppa-edit-filter").value;
349
+ if(filter) {
350
+ document.location.href="' . get_admin_url() . 'admin.php?page=wppa_admin_menu&switchto=flat&filter="+filter;
351
+ }
352
+ else {
353
+ alert("' . __( 'Please select a filter token', 'wp-photo-album-plus' ) . '");
354
+ }
355
+ }
356
+ function wppaTryInheritCats( id ) {
357
+
358
+ var query = "' . esc_js( __( 'Are you sure you want to inherit categories to all (sub-)sub albums of this album?', 'wp-photo-album-plus' ) ) . '";
359
+ if ( confirm( query ) ) {
360
+ wppaAjaxUpdateAlbum( id, \'inherit_cats\', Math.random() );
361
+ }
362
+ }
363
+ function wppaTryAddCats( id ) {
364
+
365
+ var query = "' . esc_js( __( 'Are you sure you want to add the categories to all (sub-)sub albums of this album?', 'wp-photo-album-plus' ) ) . '";
366
+ if ( confirm( query ) ) {
367
+ wppaAjaxUpdateAlbum( id, \'inhadd_cats\', Math.random() );
368
+ }
369
+ }
370
+ function wppaTryApplyDeftags( id ) {
371
+
372
+ var query = "' . esc_js( __( 'Are you sure you want to set the default tags to all photos in this album?', 'wp-photo-album-plus' ) ) . '";
373
+ if ( confirm( query ) ) {
374
+ wppaAjaxUpdateAlbum( id, \'set_deftags\', Math.random(), true );
375
+ }
376
+ }
377
+ function wppaTryAddDeftags( id ) {
378
+
379
+ var query = "' . esc_js( __( 'Are you sure you want to add the default tags to all photos in this album?', 'wp-photo-album-plus' ) ) . '";
380
+ if ( confirm( query ) ) {
381
+ wppaAjaxUpdateAlbum( id, \'add_deftags\', Math.random(), true );
382
+ }
383
+ }
384
+ function wppaTryScheduleAll( id ) {
385
+
386
+ var query;
387
+ if ( ! jQuery( "#schedule-box" ).prop( "checked" ) ) {
388
+ query = "' . esc_js( __( 'Please switch feature on and set date/time to schedule first', 'wp-photo-album-plus' ) ) . '";
389
+ alert( query );
390
+ return;
391
+ }
392
+ query = "' . esc_js( __( 'Are you sure you want to schedule all photos in this album?', 'wp-photo-album-plus' ) ) . '";
393
+ if ( confirm( query ) ) {
394
+ wppaAjaxUpdateAlbum( id, \'setallscheduled\', Math.random(), true );
395
+ }
396
+ }
397
+ function wppaTryScheduledelAlb( id ) {
398
+
399
+ wppaAjaxUpdateAlbum( id, "scheduledel", Math.random() );
400
+ if ( ! jQuery( "#scheduledel" ).prop( "checked" ) ) {
401
+ wppaAjaxUpdateAlbum( id, "removescheduledel", 0 );
402
+ }
403
+ }
404
+ function wppaTrySetAllPanorama( id ) {
405
+ var panoval = jQuery( "#pano-opt" ).val();
406
+ if ( panoval == 0 || panoval == 1 || panoval == 2 ) {
407
+ var url = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id="+id+"&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&pano-val="+panoval;
408
+ document.location = url;
409
+ }
410
+ else {
411
+ alert("' . __( 'Please select a valid panorama mode', 'wp-photo-album-plus' ) . '");
412
+ }
413
+ }
414
+ function wppaGetCoverPreview( albumId, divId ) {
415
+
416
+ jQuery.ajax( {
417
+
418
+ url: wppaAjaxUrl,
419
+ data: "action=wppa" +
420
+ "&wppa-action=getshortcodedrendered" +
421
+ "&shortcode=[wppa type=\"cover\" album=\""+albumId+"\"]",
422
+ async: true,
423
+ type: "GET",
424
+ timeout: 10000,
425
+ beforeSend: function( xhr ) {
426
+ },
427
+ success: function( result, status, xhr ) {
428
+ result = result.replace(/\[script/g, "<script");
429
+ result = result.replace(/\[\/script/g, "</script");
430
+ result = result.replace(/&gt;/g, ">");
431
+ jQuery( "#" + divId ).html( result );
432
+ },
433
+ error: function( xhr, status, error ) {
434
+ wppaConsoleLog( "wppaGetCoverPreview failed. Error = " + error + ", status = " + status );
435
+ },
436
+ complete: function( xhr, status, newurl ) {
437
+
438
+ }
439
+ } );
440
+ }';
441
+ break;
442
+ }
443
+
444
+ case 'wppa_admin_albums_collapsible':
445
+ {
446
+ $the_js = '
447
+ function checkArrows() {
448
+ elms = jQuery(".alb-arrow-off");
449
+ for(i=0;i<elms.length;i++) {
450
+ elm = elms[i];
451
+ if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "none";
452
+ }
453
+ elms = jQuery(".alb-arrow-on");
454
+ for(i=0;i<elms.length;i++) {
455
+ elm = elms[i];
456
+ if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "";
457
+ }
458
+ }';
459
+ break;
460
+ }
461
+
462
+ default:
463
+
464
+ wppa_log( 'err', "No local js for $slug in wppa_add_local_js()" );
465
+ return;
466
+ break;
467
+ }
468
+
469
+ wppa_add_inline_script( 'wppa-admin', $the_js, true );
470
+ }
wppa-admin-styles.css CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
- * version 8.2.04.008
5
  */
6
  #files_list, #files_list2
7
  {
@@ -119,7 +119,11 @@ ul.wppa_nav
119
  }
120
  .wppa-table input {
121
  height: 20px !important;
122
- padding:0 !important;
 
 
 
 
123
  }
124
  .wppa-table textarea {
125
  padding:0 !important;
@@ -160,7 +164,11 @@ ul.wppa_nav
160
  .photoitem, .albumtable, .table_wrapper {
161
  margin: 7px 0;
162
  padding: 5px;
163
- border: 1px #ccc solid;
 
 
 
 
164
  }
165
 
166
  .photoitem .deletelink
@@ -618,7 +626,7 @@ details.hidden {
618
  border: 1px solid #8c8f94;
619
  color: #2c3338;
620
  padding: 8px;
621
- max-width: 900px;
622
  }
623
  .left {
624
  float:left;
@@ -649,44 +657,32 @@ details.hidden {
649
  color: rgba(44, 51, 56, 0.5);
650
  }
651
 
652
- #wppa-action-container {
653
- margin-top: 8px;
654
- display: flex;
655
- flex-flow: row wrap;
656
- justify-content: space-between;
657
- }
658
-
659
- #wppa-action-container-left {
660
- display: flex;
661
- flex-basis: 50%;
662
- align-items: flex-start;
663
- margin-bottom: 8px;
664
  }
665
 
666
- #wppa-action-container-left input,
667
- #wppa-action-container-left select {
668
- margin-right: 8px;
 
669
  }
670
 
671
- #wppa-action-container-left input:last-of-type {
672
- margin-right: 0;
673
  }
674
 
675
- #wppa-action-container-right {
676
- display: flex;
677
- align-items: flex-end;
678
- }
679
 
680
- #wppa-action-container-right input,
681
- #wppa-action-container-right select {
682
- margin-left: 8px;
683
- align-self:baseline;
684
  }
685
 
686
- #wppa-action-container-right select:first-of-type {
687
- margin-left: 0;
688
  }
689
 
690
- .wppa-tabcontent {
691
- min-height: 530px;
 
 
692
  }
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
+ * version 8.3.01.004
5
  */
6
  #files_list, #files_list2
7
  {
119
  }
120
  .wppa-table input {
121
  height: 20px !important;
122
+ padding-left:6px;
123
+ }
124
+ .wppa-table .wppa-doit-button {
125
+ padding-left:6px;
126
+ padding-right:6px;
127
  }
128
  .wppa-table textarea {
129
  padding:0 !important;
164
  .photoitem, .albumtable, .table_wrapper {
165
  margin: 7px 0;
166
  padding: 5px;
167
+ border: 1px solid;
168
+ }
169
+
170
+ .photoitem td {
171
+ border-bottom:1px solid #555;
172
  }
173
 
174
  .photoitem .deletelink
626
  border: 1px solid #8c8f94;
627
  color: #2c3338;
628
  padding: 8px;
629
+ max-width: 100%;
630
  }
631
  .left {
632
  float:left;
657
  color: rgba(44, 51, 56, 0.5);
658
  }
659
 
660
+ .wppa-tabcontent {
661
+ min-height: 530px;
 
 
 
 
 
 
 
 
 
 
662
  }
663
 
664
+ .wppa-table-header-box {
665
+ margin-top:12px;
666
+ margin-bottom: 9px;
667
+ display:block;
668
  }
669
 
670
+ #wppa-action-container {
671
+ display: inline-block;
672
  }
673
 
 
 
 
 
674
 
675
+ #wppa-action-container input,
676
+ #wppa-action-container select {
677
+ margin-right: 8px;
 
678
  }
679
 
680
+ #wppa-action-container input:last-of-type {
681
+ margin-right: 0;
682
  }
683
 
684
+ .wppa-admin-pagination {
685
+ display:block;
686
+ float:right;
687
+ margin-bottom:6px;
688
  }
wppa-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
- * Version 8.2.09.001
7
  *
8
  */
9
 
@@ -38,61 +38,170 @@ function wppa_add_admin() {
38
  // See if there are comments pending moderation
39
  $com_pending = '';
40
  $com_pending_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_comments WHERE status = 'pending' OR status = 'spam' OR status = ''" );
41
- if ( $com_pending_count ) $com_pending = '<span class="update-plugins"><span class="plugin-count">'.$com_pending_count.'</span></span>';
42
 
43
  // See if there are uploads pending moderation
44
  $upl_pending = '';
45
  $upl_pending_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE status = 'pending' AND album > 0" );
46
- if ( $upl_pending_count ) $upl_pending = '<span class="update-plugins"><span class="plugin-count">'.$upl_pending_count.'</span></span>';
47
 
48
  // Compute total pending moderation
49
  $tot_pending = '';
50
  $tot_pending_count = '0';
51
  if ( current_user_can('wppa_comments') || current_user_can('wppa_moderate') ) $tot_pending_count += $com_pending_count;
52
- if ( current_user_can('wppa_admin') || current_user_can('wppa_moderate') ) $tot_pending_count+= $upl_pending_count;
53
- if ( $tot_pending_count ) $tot_pending = '<span class="update-plugins"><span class="plugin-count">'.'<b>'.$tot_pending_count.'</b>'.'</span></span>';
54
 
 
55
  $icon_url = WPPA_URL . '/img/camera16.png';
56
 
57
- // page_title menu_title capability menu_slug function icon_url position
58
- add_menu_page( 'WP Photo Album', __('Photo&thinsp;Albums', 'wp-photo-album-plus' ).$tot_pending, 'wppa_admin', 'wppa_admin_menu', 'wppa_admin', $icon_url ); //,'10' );
59
-
60
- // parent_slug page_title menu_title capability menu_slug function
61
- add_submenu_page( 'wppa_admin_menu', __('Album Admin', 'wp-photo-album-plus' ), __('Album Admin', 'wp-photo-album-plus' ).$upl_pending,'wppa_admin', 'wppa_admin_menu', 'wppa_admin' );
62
- add_submenu_page( 'wppa_admin_menu', __('Upload Photos', 'wp-photo-album-plus' ), __('Upload Photos', 'wp-photo-album-plus' ), 'wppa_upload', 'wppa_upload_photos', 'wppa_page_upload' );
63
- // Uploader without album admin rights, but when the upload_edit switch set, may edit his own photos
64
- if ( ! current_user_can('wppa_admin') && wppa_opt( 'upload_edit') != '-none-' ) {
65
- add_submenu_page( 'wppa_admin_menu', __('Edit Photos', 'wp-photo-album-plus' ), __('Edit Photos', 'wp-photo-album-plus' ), 'wppa_upload', 'wppa_edit_photo', 'wppa_edit_photo' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
- add_submenu_page( 'wppa_admin_menu', __('Import Photos', 'wp-photo-album-plus' ), __('Import Photos', 'wp-photo-album-plus' ), 'wppa_import', 'wppa_import_photos', 'wppa_page_import' );
68
- add_submenu_page( 'wppa_admin_menu', __('Moderate Photos', 'wp-photo-album-plus' ), __('Moderate Photos', 'wp-photo-album-plus' ).(wppa_switch('moderate_bulk')?$upl_pending:$tot_pending), 'wppa_moderate', 'wppa_moderate_photos', 'wppa_page_moderate' );
69
- add_submenu_page( 'wppa_admin_menu', __('Export Photos', 'wp-photo-album-plus' ), __('Export Photos', 'wp-photo-album-plus' ), 'wppa_export', 'wppa_export_photos', 'wppa_page_export' );
70
- add_submenu_page( 'wppa_admin_menu', __('Settings', 'wp-photo-album-plus' ), __('Settings', 'wp-photo-album-plus' ), 'wppa_settings', 'wppa_options', 'wppa_page_options' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  if ( wppa_switch( 'show_comments' ) ) {
72
- add_submenu_page( 'wppa_admin_menu', __('Manage comments', 'wp-photo-album-plus' ), __('Comments', 'wp-photo-album-plus' ).$com_pending, 'wppa_comments', 'wppa_manage_comments', 'wppa_comment_admin' );
 
 
 
 
 
73
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  if ( wppa_switch( 'opt_menu_search' ) ) {
75
- add_submenu_page( 'wppa_admin_menu', __('Search', 'wp-photo-album-plus' ), __('Search', 'wp-photo-album-plus' ), 'wppa_admin', 'wppa_search', 'wppa_search' );
 
 
 
 
 
76
  }
 
 
77
  if ( wppa_switch( 'opt_menu_edit_tags' ) ) {
78
- add_submenu_page( 'wppa_admin_menu', __('Edit tags', 'wp-photo-album-plus' ), __('Edit tags', 'wp-photo-album-plus' ), 'wppa_edit_tags', 'wppa_edit_tags', 'wppa_tag_editor' );
 
 
 
 
 
79
  }
 
 
80
  if ( wppa_switch( 'opt_menu_edit_sequence' ) ) {
81
- add_submenu_page( 'wppa_admin_menu', __('Edit Photo Sequence', 'wp-photo-album-plus' ), __('Edit Photo Sequence', 'wp-photo-album-plus' ), 'wppa_edit_sequence', 'wppa_edit_sequence', 'wppa_edit_sequence' );
 
 
 
 
 
 
82
  }
 
 
83
  if ( wppa_switch( 'opt_menu_edit_email' ) ) {
84
- add_submenu_page( 'wppa_admin_menu', __('Manage Email subscriptions', 'wp-photo-album-plus' ), __('Email admin', 'wp-photo-album-plus' ), 'wppa_edit_email', 'wppa_edit_email', 'wppa_edit_email' );
 
 
 
 
 
85
  }
 
 
86
  if ( wppa_switch( 'opt_menu_doc' ) ) {
87
- add_submenu_page( 'wppa_admin_menu', __('Help &amp; Info', 'wp-photo-album-plus' ), __('Documentation', 'wp-photo-album-plus' ), 'wppa_help', 'wppa_help', 'wppa_page_help' );
 
 
 
 
 
88
  }
 
 
89
  if ( wppa_switch( 'logfile_on_menu' ) ) {
90
- add_submenu_page( 'wppa_admin_menu', __('Logfile', 'wp-photo-album-plus' ), __('Logfile', 'wp-photo-album-plus' ), 'administrator', 'wppa_log', 'wppa_log_page' );
 
 
 
 
 
91
  }
 
 
92
  $hits = wppa_get_option( 'wppa_cache_hits', '0' );
93
  $miss = wppa_get_option( 'wppa_cache_misses', '1' );
94
  $perc = sprintf( '%5.2f', 100 * $hits / ( $hits + $miss ) );
95
- add_submenu_page( 'wppa_admin_menu', __('Cache', 'wp-photo-album-plus' ), __('Cache', 'wp-photo-album-plus' ).' '. $perc . '%', 'wppa_admin', 'wppa_cache', 'wppa_page_cache' );
 
 
 
 
 
96
  }
97
 
98
  /* ADMIN STYLES */
@@ -194,6 +303,8 @@ global $wppa_version;
194
  wp_enqueue_script( 'wppa-touch-punch', '/wp-includes/js/jquery/jquery.ui.touch-punch.js' );
195
  }
196
 
 
 
197
  /* ADMIN PAGE PHP's */
198
 
199
  // Album admin page
@@ -205,6 +316,7 @@ function wppa_admin() {
205
  wppa_publish_scheduled();
206
  _wppa_admin();
207
  }
 
208
  // Upload admin page
209
  function wppa_page_upload() {
210
  if ( wppa_is_user_blacklisted() ) wp_die(__( 'Uploading is temporary disabled for you' , 'wp-photo-album-plus' ) );
@@ -212,6 +324,7 @@ function wppa_page_upload() {
212
  require_once 'wppa-upload.php';
213
  _wppa_page_upload();
214
  }
 
215
  // Edit photo(s)
216
  function wppa_edit_photo() {
217
  if ( wppa_is_user_blacklisted() ) wp_die(__( 'Editing is temporary disabled for you' , 'wp-photo-album-plus' ) );
@@ -219,6 +332,7 @@ function wppa_edit_photo() {
219
  wppa_publish_scheduled();
220
  _wppa_edit_photo();
221
  }
 
222
  // Import admin page
223
  function wppa_page_import() {
224
 
@@ -235,6 +349,7 @@ function wppa_page_import() {
235
  require_once 'wppa-import.php';
236
  _wppa_page_import();
237
  }
 
238
  // Moderate admin page
239
  function wppa_page_moderate() {
240
  require_once 'wppa-photo-admin-autosave.php';
@@ -263,6 +378,7 @@ function wppa_page_options() {
263
  }
264
  // Comments admin page
265
  function wppa_comment_admin() {
 
266
  require_once 'wppa-comment-admin.php';
267
  _wppa_comment_admin();
268
  }
@@ -282,7 +398,7 @@ function wppa_page_help() {
282
  }
283
 
284
  // Edit tags
285
- function wppa_tag_editor() {
286
  require_once 'wppa-edit-tags.php';
287
  _wppa_edit_tags();
288
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
+ * Version 8.3.01.005
7
  *
8
  */
9
 
38
  // See if there are comments pending moderation
39
  $com_pending = '';
40
  $com_pending_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_comments WHERE status = 'pending' OR status = 'spam' OR status = ''" );
41
+ if ( $com_pending_count ) $com_pending = '<span class="update-plugins"><span class="plugin-count">' . $com_pending_count . '</span></span>';
42
 
43
  // See if there are uploads pending moderation
44
  $upl_pending = '';
45
  $upl_pending_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE status = 'pending' AND album > 0" );
46
+ if ( $upl_pending_count ) $upl_pending = '<span class="update-plugins"><span class="plugin-count">' . $upl_pending_count . '</span></span>';
47
 
48
  // Compute total pending moderation
49
  $tot_pending = '';
50
  $tot_pending_count = '0';
51
  if ( current_user_can('wppa_comments') || current_user_can('wppa_moderate') ) $tot_pending_count += $com_pending_count;
52
+ if ( current_user_can('wppa_admin') || current_user_can('wppa_moderate') ) $tot_pending_count += $upl_pending_count;
53
+ if ( $tot_pending_count ) $tot_pending = '<span class="update-plugins"><span class="plugin-count"><b>' . $tot_pending_count . '</b></span></span>';
54
 
55
+ // Add wppa menu
56
  $icon_url = WPPA_URL . '/img/camera16.png';
57
 
58
+ // Main menu Photo Albums
59
+ add_menu_page( 'WP Photo Album', // page_title
60
+ __( 'Photo&thinsp;Albums', 'wp-photo-album-plus' ) . $tot_pending, // menu_title
61
+ 'wppa_admin', // capability
62
+ 'wppa_admin_menu', // menu_slug
63
+ 'wppa_admin', // function
64
+ $icon_url ); // icon_url
65
+
66
+ // Albums
67
+ add_submenu_page( 'wppa_admin_menu', // parent_slug
68
+ __( 'Albums', 'wp-photo-album-plus' ), // page_title
69
+ __( 'Albums', 'wp-photo-album-plus' ) . $upl_pending, // menu_title
70
+ 'wppa_admin', // capability
71
+ 'wppa_admin_menu', // menu_slug
72
+ 'wppa_admin' ); // function
73
+
74
+ // Upload *
75
+ add_submenu_page( 'wppa_admin_menu',
76
+ __( 'Upload', 'wp-photo-album-plus' ), // page_title
77
+ __( 'Upload', 'wp-photo-album-plus' ), // menu_title
78
+ 'wppa_upload',
79
+ 'wppa_upload_photos',
80
+ 'wppa_page_upload' ); // function
81
+
82
+ // Uploader without album admin rights, but when the upload_edit switch set, may edit his own photos *
83
+ if ( ! current_user_can( 'wppa_admin' ) && wppa_opt( 'upload_edit' ) != '-none-' ) {
84
+ add_submenu_page( 'wppa_admin_menu',
85
+ __( 'Edit photos', 'wp-photo-album-plus' ), // page_title
86
+ __( 'Edit photos', 'wp-photo-album-plus' ), // menu_title
87
+ 'wppa_upload',
88
+ 'wppa_edit_photo',
89
+ 'wppa_edit_photo' );
90
  }
91
+
92
+ // Import *
93
+ add_submenu_page( 'wppa_admin_menu',
94
+ __( 'Import', 'wp-photo-album-plus' ), // page_title
95
+ __( 'Import', 'wp-photo-album-plus' ), // menu_title
96
+ 'wppa_import',
97
+ 'wppa_import_photos',
98
+ 'wppa_page_import' );
99
+
100
+ // Export *
101
+ add_submenu_page( 'wppa_admin_menu',
102
+ __( 'Export', 'wp-photo-album-plus' ), // page_title
103
+ __( 'Export', 'wp-photo-album-plus' ), // menu_title
104
+ 'wppa_export',
105
+ 'wppa_export_photos',
106
+ 'wppa_page_export' );
107
+
108
+ // Comments, only if enabled *
109
  if ( wppa_switch( 'show_comments' ) ) {
110
+ add_submenu_page( 'wppa_admin_menu',
111
+ __( 'Comments', 'wp-photo-album-plus' ), // page_title
112
+ __( 'Comments', 'wp-photo-album-plus' ) . $com_pending, // menu_title
113
+ 'wppa_comments',
114
+ 'wppa_manage_comments',
115
+ 'wppa_comment_admin' );
116
  }
117
+
118
+ // Moderate uploads *
119
+ add_submenu_page( 'wppa_admin_menu',
120
+ __( 'Moderate', 'wp-photo-album-plus' ), // page_title
121
+ __( 'Moderate', 'wp-photo-album-plus' ) . ( wppa_switch( 'moderate_bulk' ) ? $upl_pending : $tot_pending ),
122
+ 'wppa_moderate',
123
+ 'wppa_moderate_photos',
124
+ 'wppa_page_moderate' );
125
+
126
+ // Settings *
127
+ add_submenu_page( 'wppa_admin_menu',
128
+ __( 'Settings', 'wp-photo-album-plus' ), // page_title
129
+ __( 'Settings', 'wp-photo-album-plus' ),
130
+ 'wppa_settings',
131
+ 'wppa_options',
132
+ 'wppa_page_options' );
133
+
134
+ // Search *
135
  if ( wppa_switch( 'opt_menu_search' ) ) {
136
+ add_submenu_page( 'wppa_admin_menu',
137
+ __( 'Search', 'wp-photo-album-plus' ),
138
+ __( 'Search', 'wp-photo-album-plus' ),
139
+ 'wppa_admin',
140
+ 'wppa_search',
141
+ 'wppa_search' );
142
  }
143
+
144
+ // Tags *
145
  if ( wppa_switch( 'opt_menu_edit_tags' ) ) {
146
+ add_submenu_page( 'wppa_admin_menu',
147
+ __( 'Tags', 'wp-photo-album-plus' ),
148
+ __( 'Tags', 'wp-photo-album-plus' ),
149
+ 'wppa_edit_tags',
150
+ 'wppa_edit_tags',
151
+ 'wppa_edit_tags' );
152
  }
153
+
154
+ // Sequence *
155
  if ( wppa_switch( 'opt_menu_edit_sequence' ) ) {
156
+ add_submenu_page( 'wppa_admin_menu',
157
+ __( 'Sequence', 'wp-photo-album-plus' ),
158
+ __( 'Sequence', 'wp-photo-album-plus' ),
159
+ 'wppa_edit_sequence',
160
+ 'wppa_edit_sequence',
161
+ 'wppa_edit_sequence' );
162
+
163
  }
164
+
165
+ // Email *
166
  if ( wppa_switch( 'opt_menu_edit_email' ) ) {
167
+ add_submenu_page( 'wppa_admin_menu',
168
+ __( 'Manage email subscriptions', 'wp-photo-album-plus' ),
169
+ __( 'Email', 'wp-photo-album-plus' ),
170
+ 'wppa_edit_email',
171
+ 'wppa_edit_email',
172
+ 'wppa_edit_email' );
173
  }
174
+
175
+ // Documentation *
176
  if ( wppa_switch( 'opt_menu_doc' ) ) {
177
+ add_submenu_page( 'wppa_admin_menu',
178
+ __( 'Documentation', 'wp-photo-album-plus' ),
179
+ __( 'Documentation', 'wp-photo-album-plus' ),
180
+ 'wppa_help',
181
+ 'wppa_help',
182
+ 'wppa_page_help' );
183
  }
184
+
185
+ // Logfile *
186
  if ( wppa_switch( 'logfile_on_menu' ) ) {
187
+ add_submenu_page( 'wppa_admin_menu',
188
+ __( 'Logfile', 'wp-photo-album-plus' ),
189
+ __( 'Logfile', 'wp-photo-album-plus' ),
190
+ 'administrator',
191
+ 'wppa_log',
192
+ 'wppa_log_page' );
193
  }
194
+
195
+ // Cache *
196
  $hits = wppa_get_option( 'wppa_cache_hits', '0' );
197
  $miss = wppa_get_option( 'wppa_cache_misses', '1' );
198
  $perc = sprintf( '%5.2f', 100 * $hits / ( $hits + $miss ) );
199
+ add_submenu_page( 'wppa_admin_menu',
200
+ __( 'Cache', 'wp-photo-album-plus' ),
201
+ __( 'Cache', 'wp-photo-album-plus' ) . ' ' . $perc . '%',
202
+ 'wppa_admin',
203
+ 'wppa_cache',
204
+ 'wppa_page_cache' );
205
  }
206
 
207
  /* ADMIN STYLES */
303
  wp_enqueue_script( 'wppa-touch-punch', '/wp-includes/js/jquery/jquery.ui.touch-punch.js' );
304
  }
305
 
306
+ require_once 'wppa-admin-local-js.php';
307
+
308
  /* ADMIN PAGE PHP's */
309
 
310
  // Album admin page
316
  wppa_publish_scheduled();
317
  _wppa_admin();
318
  }
319
+
320
  // Upload admin page
321
  function wppa_page_upload() {
322
  if ( wppa_is_user_blacklisted() ) wp_die(__( 'Uploading is temporary disabled for you' , 'wp-photo-album-plus' ) );
324
  require_once 'wppa-upload.php';
325
  _wppa_page_upload();
326
  }
327
+
328
  // Edit photo(s)
329
  function wppa_edit_photo() {
330
  if ( wppa_is_user_blacklisted() ) wp_die(__( 'Editing is temporary disabled for you' , 'wp-photo-album-plus' ) );
332
  wppa_publish_scheduled();
333
  _wppa_edit_photo();
334
  }
335
+
336
  // Import admin page
337
  function wppa_page_import() {
338
 
349
  require_once 'wppa-import.php';
350
  _wppa_page_import();
351
  }
352
+
353
  // Moderate admin page
354
  function wppa_page_moderate() {
355
  require_once 'wppa-photo-admin-autosave.php';
378
  }
379
  // Comments admin page
380
  function wppa_comment_admin() {
381
+ require_once 'wppa-listtable.php';
382
  require_once 'wppa-comment-admin.php';
383
  _wppa_comment_admin();
384
  }
398
  }
399
 
400
  // Edit tags
401
+ function wppa_edit_tags() {
402
  require_once 'wppa-edit-tags.php';
403
  _wppa_edit_tags();
404
  }
wppa-adminbar.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * enhances the admin bar with wppa+ menu
6
- * Version 8.2.09.001
7
  *
8
  */
9
 
@@ -37,20 +37,20 @@ function wppa_admin_bar_menu() {
37
  if ( current_user_can( 'wppa_admin' ) ) {
38
  $menu_items['admin'] = array(
39
  'parent' => $wppaplus,
40
- 'title' => __( 'Album Admin', 'wp-photo-album-plus' ) . $upl_pending,
41
  'href' => admin_url( 'admin.php?page=wppa_admin_menu' )
42
  );
43
  }
44
  if ( current_user_can( 'wppa_upload' ) ) {
45
  $menu_items['upload'] = array(
46
  'parent' => $wppaplus,
47
- 'title' => __( 'Upload Photos', 'wp-photo-album-plus' ),
48
  'href' => admin_url( 'admin.php?page=wppa_upload_photos' )
49
  );
50
  if ( ! current_user_can( 'wppa_admin' ) && wppa_opt( 'upload_edit' ) != 'none' ) {
51
  $menu_items['edit'] = array(
52
  'parent' => $wppaplus,
53
- 'title' => __( 'Edit Photos' , 'wp-photo-album-plus' ),
54
  'href' => admin_url( 'admin.php?page=wppa_edit_photo' )
55
  );
56
  }
@@ -58,31 +58,17 @@ function wppa_admin_bar_menu() {
58
  if ( current_user_can( 'wppa_import' ) ) {
59
  $menu_items['import'] = array(
60
  'parent' => $wppaplus,
61
- 'title' => __( 'Import Photos', 'wp-photo-album-plus' ),
62
  'href' => admin_url( 'admin.php?page=wppa_import_photos' )
63
  );
64
  }
65
- if ( current_user_can( 'wppa_moderate' ) ) {
66
- $menu_items['moderate'] = array(
67
- 'parent' => $wppaplus,
68
- 'title' => __( 'Moderate Photos', 'wp-photo-album-plus' ) . $tot_pending,
69
- 'href' => admin_url( 'admin.php?page=wppa_moderate_photos' )
70
- );
71
- }
72
  if ( current_user_can( 'wppa_export' ) ) {
73
  $menu_items['export'] = array(
74
  'parent' => $wppaplus,
75
- 'title' => __( 'Export Photos', 'wp-photo-album-plus' ),
76
  'href' => admin_url( 'admin.php?page=wppa_export_photos' )
77
  );
78
  }
79
- if ( current_user_can( 'wppa_settings' ) ) {
80
- $menu_items['settings'] = array(
81
- 'parent' => $wppaplus,
82
- 'title' => __( 'Settings', 'wp-photo-album-plus' ),
83
- 'href' => admin_url( 'admin.php?page=wppa_options' )
84
- );
85
- }
86
  if ( current_user_can( 'wppa_comments' ) && wppa_switch( 'show_comments' ) ) {
87
  $menu_items['comments'] = array(
88
  'parent' => $wppaplus,
@@ -90,10 +76,24 @@ function wppa_admin_bar_menu() {
90
  'href' => admin_url( 'admin.php?page=wppa_manage_comments' )
91
  );
92
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  if ( current_user_can( 'wppa_admin' ) && wppa_switch( 'opt_menu_search' ) ) {
94
  $menu_items['search'] = array(
95
  'parent' => $wppaplus,
96
- 'title' => __( 'Search', 'wp-photo-album-plus' ) . $com_pending,
97
  'href' => admin_url( 'admin.php?page=wppa_search' )
98
  );
99
  }
@@ -101,21 +101,21 @@ function wppa_admin_bar_menu() {
101
  if ( current_user_can( 'wppa_edit_tags' ) && wppa_switch( 'opt_menu_edit_tags' ) ) {
102
  $menu_items['edit_tags'] = array(
103
  'parent' => $wppaplus,
104
- 'title' => __( 'Edit tags', 'wp-photo-album-plus' ),
105
  'href' => admin_url( 'admin.php?page=wppa_edit_tags' )
106
  );
107
  }
108
  if ( current_user_can( 'wppa_edit_sequence' ) && wppa_switch( 'opt_menu_edit_sequence' ) ) {
109
  $menu_items['edit_squence'] = array(
110
  'parent' => $wppaplus,
111
- 'title' => __( 'Edit Photo Sequence', 'wp-photo-album-plus' ),
112
  'href' => admin_url( 'admin.php?page=wppa_edit_sequence' )
113
  );
114
  }
115
  if ( current_user_can( 'wppa_edit_email' ) && wppa_switch( 'opt_menu_edit_email' ) ) {
116
  $menu_items['edit_email'] = array(
117
  'parent' => $wppaplus,
118
- 'title' => __( 'Email admin', 'wp-photo-album-plus' ),
119
  'href' => admin_url( 'admin.php?page=wppa_edit_email' )
120
  );
121
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * enhances the admin bar with wppa+ menu
6
+ * Version 8.3.01.005
7
  *
8
  */
9
 
37
  if ( current_user_can( 'wppa_admin' ) ) {
38
  $menu_items['admin'] = array(
39
  'parent' => $wppaplus,
40
+ 'title' => __( 'Albums', 'wp-photo-album-plus' ) . $upl_pending,
41
  'href' => admin_url( 'admin.php?page=wppa_admin_menu' )
42
  );
43
  }
44
  if ( current_user_can( 'wppa_upload' ) ) {
45
  $menu_items['upload'] = array(
46
  'parent' => $wppaplus,
47
+ 'title' => __( 'Upload', 'wp-photo-album-plus' ),
48
  'href' => admin_url( 'admin.php?page=wppa_upload_photos' )
49
  );
50
  if ( ! current_user_can( 'wppa_admin' ) && wppa_opt( 'upload_edit' ) != 'none' ) {
51
  $menu_items['edit'] = array(
52
  'parent' => $wppaplus,
53
+ 'title' => __( 'Edit' , 'wp-photo-album-plus' ),
54
  'href' => admin_url( 'admin.php?page=wppa_edit_photo' )
55
  );
56
  }
58
  if ( current_user_can( 'wppa_import' ) ) {
59
  $menu_items['import'] = array(
60
  'parent' => $wppaplus,
61
+ 'title' => __( 'Import', 'wp-photo-album-plus' ),
62
  'href' => admin_url( 'admin.php?page=wppa_import_photos' )
63
  );
64
  }
 
 
 
 
 
 
 
65
  if ( current_user_can( 'wppa_export' ) ) {
66
  $menu_items['export'] = array(
67
  'parent' => $wppaplus,
68
+ 'title' => __( 'Export', 'wp-photo-album-plus' ),
69
  'href' => admin_url( 'admin.php?page=wppa_export_photos' )
70
  );
71
  }
 
 
 
 
 
 
 
72
  if ( current_user_can( 'wppa_comments' ) && wppa_switch( 'show_comments' ) ) {
73
  $menu_items['comments'] = array(
74
  'parent' => $wppaplus,
76
  'href' => admin_url( 'admin.php?page=wppa_manage_comments' )
77
  );
78
  }
79
+ if ( current_user_can( 'wppa_moderate' ) ) {
80
+ $menu_items['moderate'] = array(
81
+ 'parent' => $wppaplus,
82
+ 'title' => __( 'Moderate', 'wp-photo-album-plus' ) . $tot_pending,
83
+ 'href' => admin_url( 'admin.php?page=wppa_moderate_photos' )
84
+ );
85
+ }
86
+ if ( current_user_can( 'wppa_settings' ) ) {
87
+ $menu_items['settings'] = array(
88
+ 'parent' => $wppaplus,
89
+ 'title' => __( 'Settings', 'wp-photo-album-plus' ),
90
+ 'href' => admin_url( 'admin.php?page=wppa_options' )
91
+ );
92
+ }
93
  if ( current_user_can( 'wppa_admin' ) && wppa_switch( 'opt_menu_search' ) ) {
94
  $menu_items['search'] = array(
95
  'parent' => $wppaplus,
96
+ 'title' => __( 'Search', 'wp-photo-album-plus' ),
97
  'href' => admin_url( 'admin.php?page=wppa_search' )
98
  );
99
  }
101
  if ( current_user_can( 'wppa_edit_tags' ) && wppa_switch( 'opt_menu_edit_tags' ) ) {
102
  $menu_items['edit_tags'] = array(
103
  'parent' => $wppaplus,
104
+ 'title' => __( 'Tags', 'wp-photo-album-plus' ),
105
  'href' => admin_url( 'admin.php?page=wppa_edit_tags' )
106
  );
107
  }
108
  if ( current_user_can( 'wppa_edit_sequence' ) && wppa_switch( 'opt_menu_edit_sequence' ) ) {
109
  $menu_items['edit_squence'] = array(
110
  'parent' => $wppaplus,
111
+ 'title' => __( 'Sequence', 'wp-photo-album-plus' ),
112
  'href' => admin_url( 'admin.php?page=wppa_edit_sequence' )
113
  );
114
  }
115
  if ( current_user_can( 'wppa_edit_email' ) && wppa_switch( 'opt_menu_edit_email' ) ) {
116
  $menu_items['edit_email'] = array(
117
  'parent' => $wppaplus,
118
+ 'title' => __( 'Email', 'wp-photo-album-plus' ),
119
  'href' => admin_url( 'admin.php?page=wppa_edit_email' )
120
  );
121
  }
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 8.2.09.001
6
  *
7
  */
8
 
@@ -1749,7 +1749,7 @@ global $wppa;
1749
  }
1750
  }
1751
  else {
1752
- wppa_echo( '||0||' . __( 'No subalbums found to process', 'wp-photo-album-plus' ) );
1753
  wppa_exit();
1754
  }
1755
  }
@@ -1848,7 +1848,7 @@ global $wppa;
1848
  $itemname = __( 'Categories' , 'wp-photo-album-plus' );
1849
  break;
1850
  case 'suba_order_by':
1851
- $itemname = __( 'Subalbums sort order' , 'wp-photo-album-plus' );
1852
  break;
1853
 
1854
  case 'year':
@@ -3037,8 +3037,7 @@ global $wppa;
3037
  }
3038
  if ( current_user_can( 'wppa_edit_email' ) ) {
3039
  if ( in_array( wppa_get( 'option' ),
3040
- ['email_admin_pagesize',
3041
- 'newalbumnotify',
3042
  'feuploadnotify',
3043
  'commentnotify',
3044
  'commentprevious',
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 8.3.01.005
6
  *
7
  */
8
 
1749
  }
1750
  }
1751
  else {
1752
+ wppa_echo( '||0||' . __( 'No sub albums found to process', 'wp-photo-album-plus' ) );
1753
  wppa_exit();
1754
  }
1755
  }
1848
  $itemname = __( 'Categories' , 'wp-photo-album-plus' );
1849
  break;
1850
  case 'suba_order_by':
1851
+ $itemname = __( 'Sub albums sort order' , 'wp-photo-album-plus' );
1852
  break;
1853
 
1854
  case 'year':
3037
  }
3038
  if ( current_user_can( 'wppa_edit_email' ) ) {
3039
  if ( in_array( wppa_get( 'option' ),
3040
+ ['newalbumnotify',
 
3041
  'feuploadnotify',
3042
  'commentnotify',
3043
  'commentprevious',
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.05.002
7
  *
8
  */
9
 
@@ -14,50 +14,55 @@ global $wpdb;
14
  global $q_config;
15
  global $wppa_revno;
16
 
 
 
 
 
17
  $from = wppa_get_option( 'wppa_search_page', 'wppa_admin_menu' );
18
  delete_option( 'wppa_search_page' );
19
 
20
- if ( $from == 'wppa_admin_menu' ) {
21
- $back_url = get_admin_url() . 'admin.php?page=wppa_admin_menu';
22
- $back_title = __( 'Back to album table', 'wp-photo-album-plus' );
23
- }
24
- elseif ( $from == 'wppa_search' ) {
25
- $back_url = get_admin_url() . 'admin.php?page=wppa_search';
26
- $back_title = __( 'Back to search form', 'wp-photo-album-plus' );
 
 
27
 
28
- if ( wppa_get( 'edit-id' ) == 'search' ) {
29
 
30
- if ( wppa_get( 'searchstring' ) ) {
31
- $back_url .= '&wppa-searchstring=' . wppa_get( 'searchstring' );
32
- }
33
- $back_url .= '#wppa-edit-search-tag';
 
34
  }
35
- }
36
- $back_link_html = '
37
- <div style="float:right;background-color:lightblue;">
38
- &nbsp;
39
- <a href="' . $back_url . '"
40
- style=""
41
- >' .
42
- $back_title . '
43
- </a>
44
- &nbsp;
45
- </div>';
46
 
47
- $top_link_html = '
48
- <div style="position:fixed;right:20px;bottom:30px;background-color:lightblue;float:right" >
49
- &nbsp;
50
- <a href="#manage-photos">' .
51
- __( 'Top of page', 'wp-photo-album-plus' ) . '
52
- </a>
53
- &nbsp;
54
- </div>';
 
55
 
56
  // Delete trashed comments
57
  $wpdb->query( "DELETE FROM $wpdb->wppa_comments WHERE status = 'trash'" );
58
 
59
- $sel = 'selected';
60
-
61
  // warn if the uploads directory is no writable
62
  if ( ! is_writable( WPPA_UPLOAD_PATH ) ) {
63
  wppa_error_message(
@@ -95,29 +100,34 @@ global $wppa_revno;
95
  }
96
  }
97
 
 
98
  if ( wppa_get( 'tab' ) ) {
99
 
 
 
 
 
 
100
  // album edit page
101
  if ( wppa_get( 'tab' ) == 'edit' ) {
102
 
103
  // Edit any album, check for type is implemented c.q. existence and rights
104
  if ( wppa_get( 'edit-id' ) ) {
105
 
 
106
  $ei = wppa_get( 'edit-id' );
107
  if ( $ei != 'new' && $ei != 'search' && $ei != 'trash' && $ei != 'single' && ! is_numeric( $ei ) ) {
108
  wppa_error_message( sprintf( __( 'Album edit id %s is not implemented', 'wp-photo-album-plus' ), $ei ) );
109
  return;
110
  }
111
- if ( ! wp_verify_nonce( wppa_get( 'nonce' ), 'wppa-nonce' ) ) {
112
- wp_die('Security check failure');
113
- }
114
  if ( is_numeric( $ei ) ) {
115
  if ( ! $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_albums WHERE id=%d", $ei ), ARRAY_A ) ) {
116
  wppa_error_message( sprintf( __( 'Album %d does not exist', 'wp-photo-album-plus' ), $ei ) );
117
  return;
118
  }
119
  if ( ! wppa_have_access( $ei ) ) {
120
- wppa_error_message( sprintf( __( 'You do not have sufficient rights to edit Album %d', 'wp-photo-album-plus' ), $ei ) );
121
  return;
122
  }
123
  }
@@ -126,9 +136,9 @@ global $wppa_revno;
126
  // Edit single photo
127
  if ( wppa_get( 'edit-id' ) == 'single' ) {
128
 
129
- $txt = wppa_get( 'just-edit', __( 'Edit Single Photo', 'wp-photo-album-plus' ) );
130
 
131
- wppa_echo( '<div class="wrap" ><h2>' . $txt . '</h2>' );
132
  wppa_album_photos( $ei );
133
  wppa_echo( '</div>' );
134
  return;
@@ -137,30 +147,35 @@ global $wppa_revno;
137
  // Edit by search token
138
  if ( wppa_get( 'edit-id' ) == 'search' ) {
139
 
140
- $task = __( 'Edit photo information', 'wp-photo-album-plus' );
141
- if ( wppa_get( 'bulk' ) ) {
142
- $task = __( 'Copy / move / delete / edit name / edit description / change status', 'wp-photo-album-plus' );
143
- }
144
- elseif ( wppa_get( 'quick' ) ) {
145
- __( 'Edit photo information except copy and move', 'wp-photo-album-plus' );
146
- }
147
 
148
  wppa_echo ( '
149
  <a name="manage-photos" id="manage-photos" ></a>
150
- <h2>' .
151
- __( 'Manage Photos', 'wp-photo-album-plus' ) . ' - <small><i>' . $task . '</i></small>
152
- </h2>' .
153
- $back_link_html . '
154
- <br><br>' );
155
 
156
- if ( wppa_get( 'bulk' ) ) {
157
- wppa_album_photos_bulk( $ei );
158
- }
159
- else {
160
- wppa_album_photos( $ei );
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
163
- wppa_echo( $top_link_html . '<br>' . $back_link_html );
 
164
  return;
165
  }
166
 
@@ -169,7 +184,7 @@ global $wppa_revno;
169
 
170
  $h2 = __( 'Manage Trashed Photos', 'wp-photo-album-plus' );
171
  $task = __( 'Edit photo information', 'wp-photo-album-plus' );
172
- wppa_echo( '<div class="wrap"><a name="manage-photos" id="manage-photos" ></a><h2>' . $h2 . ' - <small><i>' . $task . '</i></small></h2>' );
173
  if ( wppa_get( 'bulk' ) ) {
174
  wppa_album_photos_bulk( $ei );
175
  }
@@ -189,7 +204,7 @@ global $wppa_revno;
189
  }
190
  $id = wppa_nextkey( WPPA_ALBUMS );
191
 
192
- // Creating a subalbum of a given parent?
193
  if ( wppa_get( 'parent_id' ) ) {
194
  $parent = wppa_get( 'parent_id' );
195
  $name = wppa_get_album_name( $parent ) . '-#' . $id;
@@ -210,7 +225,7 @@ global $wppa_revno;
210
  wppa_update_option( 'wppa_default_parent', '0' );
211
  $parent = '0';
212
  }
213
- $name = __( 'New Album', 'wp-photo-album-plus' );
214
  if ( $parent == '0' && ! wppa_can_create_top_album() ) {
215
  wp_die( __( 'You have insufficient rights to create a top-level album', 'wp-photo-album-plus' ) );
216
  }
@@ -444,106 +459,8 @@ global $wppa_revno;
444
  }
445
 
446
  // Local js functions
447
- {
448
- $the_js = '
449
- function wppaTryInheritCats( id ) {
450
-
451
- var query = "' . esc_js( __( 'Are you sure you want to inherit categories to all (sub-)subalbums of this album?', 'wp-photo-album-plus' ) ) . '";
452
- if ( confirm( query ) ) {
453
- wppaAjaxUpdateAlbum( id, \'inherit_cats\', Math.random() );
454
- }
455
- }
456
-
457
- function wppaTryAddCats( id ) {
458
-
459
- var query = "' . esc_js( __( 'Are you sure you want to add the categories to all (sub-)subalbums of this album?', 'wp-photo-album-plus' ) ) . '";
460
- if ( confirm( query ) ) {
461
- wppaAjaxUpdateAlbum( id, \'inhadd_cats\', Math.random() );
462
- }
463
- }
464
-
465
- function wppaTryApplyDeftags( id ) {
466
-
467
- var query = "' . esc_js( __( 'Are you sure you want to set the default tags to all photos in this album?', 'wp-photo-album-plus' ) ) . '";
468
- if ( confirm( query ) ) {
469
- wppaAjaxUpdateAlbum( id, \'set_deftags\', Math.random(), true );
470
- }
471
- }
472
-
473
- function wppaTryAddDeftags( id ) {
474
-
475
- var query = "' . esc_js( __( 'Are you sure you want to add the default tags to all photos in this album?', 'wp-photo-album-plus' ) ) . '";
476
- if ( confirm( query ) ) {
477
- wppaAjaxUpdateAlbum( id, \'add_deftags\', Math.random(), true );
478
- }
479
- }
480
-
481
- function wppaTryScheduleAll( id ) {
482
-
483
- var query;
484
- if ( ! jQuery( "#schedule-box" ).prop( "checked" ) ) {
485
- query = "' . esc_js( __( 'Please switch feature on and set date/time to schedule first', 'wp-photo-album-plus' ) ) . '";
486
- alert( query );
487
- return;
488
- }
489
- query = "' . esc_js( __( 'Are you sure you want to schedule all photos in this album?', 'wp-photo-album-plus' ) ) . '";
490
- if ( confirm( query ) ) {
491
- wppaAjaxUpdateAlbum( id, \'setallscheduled\', Math.random(), true );
492
- }
493
- }
494
-
495
- function wppaTryScheduledelAlb( id ) {
496
-
497
- wppaAjaxUpdateAlbum( id, "scheduledel", Math.random() );
498
- if ( ! jQuery( "#scheduledel" ).prop( "checked" ) ) {
499
- wppaAjaxUpdateAlbum( id, "removescheduledel", 0 );
500
- }
501
- }
502
-
503
- function wppaTrySetAllPanorama( id ) {
504
- var panoval = jQuery( "#pano-opt" ).val();
505
- if ( panoval == 0 || panoval == 1 || panoval == 2 ) {
506
- var url = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id="+id+"&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&pano-val="+panoval;
507
- document.location = url;
508
- }
509
- else {
510
- alert("' . __( 'Please select a valid panorama mode', 'wp-photo-album-plus' ) . '");
511
- }
512
- }
513
-
514
- function wppaGetCoverPreview( albumId, divId ) {
515
-
516
- jQuery.ajax( {
517
-
518
- url: wppaAjaxUrl,
519
- data: "action=wppa" +
520
- "&wppa-action=getshortcodedrendered" +
521
- "&shortcode=[wppa type=\"cover\" album=\""+albumId+"\"]",
522
- async: true,
523
- type: "GET",
524
- timeout: 10000,
525
- beforeSend: function( xhr ) {
526
- },
527
- success: function( result, status, xhr ) {
528
- result = result.replace(/\[script/g, "<script");
529
- result = result.replace(/\[\/script/g, "</script");
530
- result = result.replace(/&gt;/g, ">");
531
- jQuery( "#" + divId ).html( result );
532
- },
533
- error: function( xhr, status, error ) {
534
- wppaConsoleLog( "wppaGetCoverPreview failed. Error = " + error + ", status = " + status );
535
- },
536
- complete: function( xhr, status, newurl ) {
537
-
538
- }
539
- } );
540
- }
541
-
542
- jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"+'.$id.' )});
543
- ';
544
-
545
- wppa_add_inline_script( 'wppa-admin', $the_js );
546
- }
547
 
548
  /* The actual page lay-out starts here */
549
 
@@ -557,14 +474,26 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
557
  wppa_echo( '<input type="hidden" id="album-nonce-' . $id . '" value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '" />' );
558
 
559
  // The header
560
- wppa_echo( '<h1 style="display:inline">' . __( wppa_get_album_name( $id ) ) . '</h1>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
561
 
562
  wppa_echo( $back_link_html );
563
 
564
  /* Start header buttons */
565
- wppa_echo( '
566
- <div id="wppa-action-container">
567
- <div id="wppa-action-container-left">');
568
 
569
  // Goto Upload
570
  if ( current_user_can( 'wppa_upload' ) ) {
@@ -578,13 +507,13 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
578
  __( 'Upload to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' )
579
  );
580
 
581
- wppa_echo( '
582
  <input
583
  type="button"
584
  class="wppa-admin-button button"
585
  onclick="' . $onc . '"
586
  value="' . $val .'"
587
- />' );
588
  }
589
 
590
  // Goto Import
@@ -593,21 +522,19 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
593
  $onc = 'document.location = \''.get_admin_url().'admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\'';
594
  $val = __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' );
595
 
596
- wppa_echo( '
597
  <input
598
  type="button"
599
  class="wppa-admin-button button"
600
  onclick="' . $onc . '"
601
  value="' . $val .'"
602
- />' );
603
  }
604
- wppa_echo( '
605
- </div>' ); // end action-container-left
606
 
607
  // Download album
608
  if ( wppa_switch( 'allow_download_album' ) && ( ! wppa_switch( 'download_album_is_restricted' ) || wppa_user_is_admin() ) ) {
609
- wppa_echo( '
610
- <div id="wppa-action-container-right">
611
  <input
612
  type="button"
613
  class="wppa-admin-button button"
@@ -619,11 +546,12 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
619
  src="' . wppa_get_imgdir() . 'spinner.gif"
620
  style="margin-left:6px;display:none;height:18px;position:relative;bottom:-6px"
621
  alt="spinner"
622
- />
623
- </div>' ); // end action-container-right
624
  }
625
- wppa_echo( '
626
- </div>'); // end action-container
 
 
627
  /* End header */
628
 
629
  /* Main body album admin */
@@ -665,16 +593,6 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
665
  <div style="clear:both"></div>
666
  </div>');
667
 
668
- // The script for the tabs to operate
669
- $the_js = '
670
- function wppaChangeAlbumAdminTab(elm,tabid) {
671
- jQuery(".wppa-albumadmin-tab").removeClass(\'active\');
672
- jQuery(elm).addClass(\'active\');
673
- jQuery(".wppa-tabcontent").hide();
674
- jQuery(tabid).show();
675
- }';
676
- wppa_add_inline_script( 'wppa-admin', $the_js );
677
-
678
  // Tab 1: General Album Settings
679
  wppa_echo( '
680
  <div
@@ -780,7 +698,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
780
  wppa_echo( '
781
  <div class="left">
782
  <label>' .
783
- __( 'Inc subalbums', 'wp-photo-album-plus' ) . '
784
  </label><br>
785
  <div class="wppa-ldi">' .
786
  $tpviews . '
@@ -887,7 +805,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
887
 
888
  // Status
889
  {
890
- $title = __( 'Set the frontend visibility of the album cover and items not including subalbums.', 'wp-photo-album-plus' ) . ' ' .
891
  __( 'Publish: visible for all, Private: visible for logged in only, Hidden: visible for admin only', 'wp-photo-album-plus' );
892
 
893
  wppa_echo( '
@@ -1074,12 +992,12 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1074
  style="max-width: 200px;margin-right: 4px;">
1075
  <label
1076
  for="altthumb">' .
1077
- __( 'Max subalbums', 'wp-photo-album-plus' ) . '
1078
  </label><br>
1079
  <select
1080
  id="maxchild"
1081
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'max_children\', this )"
1082
- title="' . esc_attr( 'This setting can only llimit the creation of subalbums at the frontend and looks at direct subalbums only', 'wp-photo-album-plus' ) . '"
1083
  >
1084
  <option value="0"' . ( $val == '0' ? $sel : '' ) . ' >' .
1085
  __( 'unlimited', 'wp-photo-album-plus' ) . '
@@ -1159,8 +1077,8 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1159
 
1160
  // Tree limit
1161
  {
1162
- $title = __( 'The upload limit for this album and all its (sub-)subalbums.', 'wp-photo-album-plus' ) . ' ' .
1163
- __( 'This setting overrules all other limits that may apply to this album or its (sub-)subalbums.', 'wp-photo-album-plus' ) . ' ' .
1164
  __( '0 means no limit.', 'wp-photo-album-plus' );
1165
  wppa_echo( '
1166
  <div class="left">
@@ -1411,17 +1329,17 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1411
  __( 'The following buttons perform actions on albums related to this album', 'wp-photo-album-plus' ) . '
1412
  </h2>' );
1413
 
1414
- // Create subalbum
1415
  if ( wppa_can_create_album() ) {
1416
  $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $albuminfo['id'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
1417
- $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1418
 
1419
  wppa_echo( '
1420
  <input
1421
  type="button"
1422
  class="wppa-admin-button button"
1423
  onclick="' . $onc . '"
1424
- value="' . esc_attr( __( 'Create subalbum', 'wp-photo-album-plus' ) ) . '"
1425
  />' );
1426
  }
1427
 
@@ -1436,7 +1354,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1436
  '&amp;parent_id=' . $albuminfo['a_parent'] .
1437
  '&amp;is-sibling-of=' . $albuminfo['id'] .
1438
  '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
1439
- $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1440
 
1441
  wppa_echo( '
1442
  <input
@@ -1466,20 +1384,20 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1466
  <input
1467
  type="button"
1468
  class="wppa-admin-button button"
1469
- title="' . esc_attr( __( 'Apply categories to all (sub-)subalbums.', 'wp-photo-album-plus' ) ) . '"
1470
  onclick="wppaTryInheritCats( ' . $id . ' )"
1471
- value="' . esc_attr( __( 'Apply Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1472
  />
1473
  <input
1474
  type="button"
1475
  class="wppa-admin-button button"
1476
- title="' . esc_attr( __( 'Add categories to all (sub-)subalbums.', 'wp-photo-album-plus' ) ) . '"
1477
  onclick="wppaTryAddCats( ' . $id . ' )"
1478
- value="' . esc_attr( __( 'Add Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1479
  />' );
1480
  }
1481
 
1482
- // Subalbums sequence
1483
  if ( $has_children ) {
1484
  wppa_album_sequence( $edit_id );
1485
  }
@@ -1789,8 +1707,8 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
1789
  <select
1790
  title="' . esc_attr( $title ) . '"
1791
  onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_linktype\', this )" >
1792
- <option value="content"' . ( $lt == 'content' ? $sel : '' ) . ' >' . __( 'the subalbums and thumbnails', 'wp-photo-album-plus' ) . '</option>
1793
- <option value="albums"' . ( $lt == 'albums' ? $sel : '' ) . ' >' . __( 'the subalbums', 'wp-photo-album-plus' ) . '</option>
1794
  <option value="thumbs"' . ( $lt == 'thumbs' ? $sel : '' ) . ' >' . __( 'the thumbnails', 'wp-photo-album-plus' ) . '</option>
1795
  <option value="slide"' . ( $lt == 'slide' ? $sel : '' ) . ' >' . __( 'the album photos as slideshow', 'wp-photo-album-plus' ) . '</option>
1796
  <option value="page"' . ( $lt == 'page' ? $sel : '' ) . ' >' . __( 'the link page with a clean url', 'wp-photo-album-plus' ) . '</option>
@@ -2073,28 +1991,9 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2073
 
2074
  /* Manage photos section */
2075
  {
2076
- wppa_echo( '
2077
- <div class="wppa-table-wrap" style="margin-top:20px;clear:both;position:relative;">' );
2078
-
2079
- wppa_echo( '<a name="manage-photos" id="manage-photos" ></a><h2 style="padding-left:12px">' );
2080
-
2081
- if ( wppa_get( 'bulk' ) )
2082
- $result = __( 'Copy / move / delete / edit name / edit description / change status', 'wp-photo-album-plus' );
2083
- elseif ( wppa_get( 'seq' ) )
2084
- $result = __( 'Change item sequence by drag and drop', 'wp-photo-album-plus' );
2085
- elseif ( wppa_get( 'quick' ) )
2086
- $result = __( 'Edit photo information except copy and move', 'wp-photo-album-plus' );
2087
- elseif ( is_numeric( wppa_get( 'edit-id' ) ) ) {
2088
- $result = sprintf( __( 'Edit/Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
2089
- '<i>' . sanitize_text_field( wppa_get_album_name( $id ) ) . '</i>',
2090
- '<i>' . sanitize_user( wppa_get_album_item( $id, 'owner' ) ) . '</i>' );
2091
- }
2092
- else $result = '';
2093
 
2094
- $result .= '
2095
- </h2>
2096
- <div style="clear:both"></div>';
2097
- wppa_echo( $result );
2098
 
2099
  if ( wppa_get( 'bulk' ) )
2100
  wppa_album_photos_bulk( $edit_id );
@@ -2103,19 +2002,16 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2103
  else
2104
  wppa_album_photos( $edit_id );
2105
 
2106
- wppa_echo( '
2107
- </div>
2108
- </details>' );
2109
  }
2110
 
2111
  /* Footer of the page */
2112
  wppa_echo( '
2113
  <br>' .
2114
- $back_link_html .
2115
  $top_link_html . '
2116
  </div>' );
2117
 
2118
-
2119
  } // End tab is Edit
2120
 
2121
  // Comment moderate
@@ -2125,9 +2021,9 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2125
  if ( current_user_can( 'wppa_comments' ) && wppa_have_access( $alb ) ) {
2126
  $result = '
2127
  <div class="wrap">
2128
- <img src="' . WPPA_URL . '/img/page_green.png" />
2129
- <h1 style="display:inline">' . __( 'Moderate comment', 'wp-photo-album-plus' ) . '</h1>
2130
- <div style="clear:both"></div>' .
2131
  wppa_album_photos( '', $photo ) . '
2132
  </div>';
2133
  wppa_echo( $result );
@@ -2145,7 +2041,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2145
  $result = '
2146
  <div class="wrap">
2147
  <img src="' . WPPA_URL . '/img/page_green.png" />
2148
- <h1 style="display:inline">' . ( wppa_get( 'tab' ) == 'pmod' ?
2149
  __( 'Moderate photo', 'wp-photo-album-plus' ) :
2150
  __( 'Edit photo', 'wp-photo-album-plus' ) ) . '
2151
  </h1>
@@ -2169,8 +2065,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2169
 
2170
  $result = '
2171
  <div class="wrap">
2172
- <img src="' . WPPA_URL . '/img/albumdel32.png" />
2173
- <h1 style="display:inline">' . __( 'Delete Album', 'wp-photo-album-plus' ) . '</h1>
2174
 
2175
  <p>' . __( 'Album', 'wp-photo-album-plus' ) . '<b>' . htmlspecialchars( wppa_get_album_name( wppa_get( 'edit-id' ) ) ) . '</b></p>
2176
  <p>' . __( 'Are you sure you want to delete this album?', 'wp-photo-album-plus' ) . '<br>' .
@@ -2215,6 +2110,8 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2215
  </div>';
2216
  wppa_echo( $result );
2217
  }
 
 
2218
  else {
2219
  wppa_error_message( sprintf( __( 'Album admin action %s is not implemented', 'wp-photo-album-plus' ),
2220
  '<b>' . wppa_get( 'tab' ) ) . '</b>' );
@@ -2224,16 +2121,16 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2224
  // 'tab' not set. default, album manage page.
2225
  else {
2226
 
2227
- // if album deleted
2228
  if ( wppa_get( 'del-confirm' ) ) {
2229
 
2230
  if ( ! wp_verify_nonce( wppa_get( 'nonce' ), 'wppa-nonce' ) ) {
2231
- wp_die('Security check failure');
2232
  }
2233
 
2234
  $album_owner = $wpdb->get_var( $wpdb->prepare( "SELECT owner FROM $wpdb->wppa_albums WHERE id = %s", wppa_get( 'del-id' ) ) );
2235
- if ( ( $album_owner == '--- public ---' && ! current_user_can('administrator') ) || ! wppa_have_access( wppa_get( 'del-id' ) ) ) {
2236
- wp_die('You do not have the rights to delete this album');
2237
  }
2238
 
2239
  if ( wppa_get( 'del-photos' ) == 'move' ) {
@@ -2249,18 +2146,18 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2249
  }
2250
  }
2251
 
 
2252
  if ( wppa_get( 'switchto' ) ) {
2253
  wppa_update_option( 'wppa_album_table_'.wppa_get_user(), wppa_get( 'switchto' ) );
2254
  }
2255
- $style = wppa_get_option('wppa_album_table_'.wppa_get_user(), 'flat');
2256
-
2257
-
2258
 
2259
  /* The album admin table of albums page start */
2260
  wppa_echo( '
2261
  <div class="wrap">' .
2262
  wppa_admin_spinner() . '
2263
- <h1 class="wp-heading-inline">' . __( 'Manage Albums', 'wp-photo-album-plus' ) . '</h1>' );
2264
 
2265
  // The Create new album button
2266
  if ( wppa_can_create_top_album() ) {
@@ -2273,38 +2170,38 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2273
  class="page-title-action">' .
2274
  __( 'Add New', 'wp-photo-album-plus' ) . '
2275
  </a>
2276
- <br>' );
2277
  }
2278
 
2279
- /* The header buttons / sewlection boxes */
2280
  {
2281
- wppa_echo( '
2282
- <div id="wppa-action-container">
2283
- <div id="wppa-action-container-left">' );
2284
 
2285
  // The switch to flat/collapsable button(s)
2286
  if ( $style == 'flat' ) {
2287
- wppa_echo( '
2288
  <input
2289
  type="button"
2290
  class="button"
2291
  onclick="document.location=\'' . get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;switchto=collapsible\'"
2292
  value="' . esc_attr__( 'Switch to Collapsable table', 'wp-photo-album-plus' ) . '"
2293
- />' );
2294
  }
2295
  else {
2296
- wppa_echo( '
2297
  <input
2298
  type="button"
2299
  class="button"
2300
  onclick="document.location=\'' . get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;switchto=flat\'"
2301
  value="' . esc_attr__( 'Switch to Flat table', 'wp-photo-album-plus' ) . '"
2302
- />' );
2303
  }
2304
 
2305
  // The open all/close all buttons
2306
  if ( $style != 'flat' ) {
2307
- wppa_echo( '
2308
  <input
2309
  type="button"
2310
  class="button"
@@ -2328,16 +2225,12 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2328
  jQuery(\'.alb-arrow-off\').css(\'display\',\'none\');
2329
  "
2330
  value="' . esc_attr__( 'Close all', 'wp-photo-album-plus' ) . '"
2331
- />' );
2332
  }
2333
 
2334
- wppa_echo( '
2335
- </div>
2336
- <div id= "wppa-action-container-right">' );
2337
-
2338
  // Edit by id
2339
  if ( wppa_has_many_albums() ) {
2340
- wppa_echo( '
2341
  <input
2342
  id="wppa-edit-albid"
2343
  type="number"
@@ -2345,7 +2238,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2345
  placeholder="' . __( 'Album id', 'wp-photo-album-plus' ) . '"
2346
  title="' . __( 'Enter the number of the album you want to edit', 'wp-photo-album-plus' ) . '"
2347
  style="width:120px;cursor:pointer"
2348
- />' );
2349
  }
2350
  else {
2351
  $albids = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums ORDER BY id" );
@@ -2354,89 +2247,69 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2354
  unset( $albids[$key] );
2355
  }
2356
  }
2357
- wppa_echo( '
2358
  <select
2359
  id="wppa-edit-albid"
2360
  title="' . __( 'Select the number of the album you want to edit', 'wp-photo-album-plus' ) . '"
2361
  styles="width:120px;cursor:pointer;vertical-align:baseline"
2362
  />
2363
- <option value="" selected disabled>' . __( 'Album id', 'wp-photo-album-plus' ) . '</option>' );
2364
  foreach( $albids as $alb ) {
2365
- wppa_echo( '<option value="' . $alb . '">' . $alb . '</option>' );
2366
  }
2367
- wppa_echo( '
2368
- </select>' );
2369
  }
2370
- wppa_echo( '
2371
  <input
2372
  type="button"
2373
  class="button"
2374
  value="' . __( 'Edit album', 'wp-photo-album-plus' ) . '"
2375
  onclick="wppaGoEditAlbNo();"
2376
- />' );
2377
 
2378
  // Filter by searchword
2379
  $opts = $wpdb->get_col( "SELECT slug FROM $wpdb->wppa_index WHERE albums <> '' ORDER BY slug" );
2380
  $f = wppa_get( 'filter' );
2381
- wppa_echo( '
2382
  <select
2383
  id="wppa-edit-filter"
2384
  title="' . __( 'Select an album search word', 'wp-photo-album-plus' ) . '"
2385
  >
2386
- <option value="" selected disabled>' . __( 'Filter by', 'wp-photo-album-plus' ) . '</option>' );
2387
  foreach( $opts as $opt ) {
2388
- wppa_echo( '<option value="' . $opt . '"' . ( $f == $opt ? ' selected ' : '' ) . '>' . $opt . '</option>' );
2389
  }
2390
- wppa_echo( '
2391
  </select>
2392
  <input
2393
  type="button"
2394
  class="button"
2395
  onclick="wppaGoApplyFilter();"
2396
  value="' . __( 'Apply filter', 'wp-photo-album-plus' ) . '"
2397
- />' );
2398
- wppa_echo( '
2399
- </div>
2400
- </div>' );
2401
- /* End header buttons / seecion boxes */
2402
- }
2403
 
2404
- $the_js = '
2405
- function wppaGoEditAlbNo() {
2406
- var id = parseInt(document.getElementById("wppa-edit-albid").value);
2407
- if (id > 0) {
2408
- var nonce = "' . wp_create_nonce( 'wppa-nonce' ) .'";
2409
- var href = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&wppa-nonce="+nonce+"&tab=edit&edit-id="+id;
2410
- document.location.href=href;
2411
- }
2412
- else {
2413
- alert("' . __( 'Please enter a valid album id', 'wp-photo-album-plus' ) . '");
2414
- }
2415
- };
2416
- function wppaGoApplyFilter() {
2417
- var filter = document.getElementById("wppa-edit-filter").value;
2418
- if(filter) {
2419
- document.location.href="' . get_admin_url() . 'admin.php?page=wppa_admin_menu&switchto=flat&filter="+filter;
2420
- }
2421
- else {
2422
- alert("' . __( 'Please select a filter token', 'wp-photo-album-plus' ) . '");
2423
- }
2424
- };';
2425
- wppa_add_inline_script( 'wppa-admin', $the_js );
2426
 
2427
- // The table of existing albums
2428
- if ( $style == 'flat' ) {
2429
- wppa_admin_albums_flat();
2430
  }
2431
- else {
2432
- wppa_admin_albums_collapsible();
 
 
 
2433
  }
2434
 
2435
- wppa_echo( '<br>' );
2436
 
 
2437
  wppa_album_sequence( '0' );
2438
 
2439
  wppa_echo( '</div>' );
 
2440
  }
2441
  }
2442
 
@@ -2444,39 +2317,17 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
2444
  function wppa_admin_albums_flat() {
2445
  global $wpdb;
2446
 
2447
- // Init
2448
- $pagesize = wppa_opt( 'album_admin_pagesize' );
2449
- $page = wppa_get( 'album-page-no', '1' );
 
 
2450
  $skips = ( $page - 1 ) * $pagesize;
 
 
2451
 
2452
  // Read all albums, pre-ordered
2453
- $order_by = wppa_get_option( 'wppa_album_order_' . wppa_get_user(), 'id' );
2454
- $order_desc = wppa_get_option( 'wppa_album_order_' . wppa_get_user() . '_reverse' );
2455
-
2456
- switch( $order_by ) {
2457
- case 'name':
2458
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY name";
2459
- break;
2460
- case 'description':
2461
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY description";
2462
- break;
2463
- case 'owner':
2464
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY owner";
2465
- break;
2466
- case 'a_order':
2467
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_order";
2468
- break;
2469
- case 'a_parent':
2470
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_parent";
2471
- break;
2472
- default:
2473
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY id";
2474
- }
2475
- if ( $order_desc == 'yes' ) {
2476
- $query .= " DESC";
2477
- }
2478
-
2479
- $albums = $wpdb->get_results( $query, ARRAY_A );
2480
 
2481
  // Remove non accessible albums
2482
  $temp = $albums;
@@ -2491,7 +2342,7 @@ global $wpdb;
2491
  $filter = wppa_get( 'filter' );
2492
 
2493
  if ( $filter ) {
2494
- $filter_albs = $wpdb->get_var( $wpdb->prepare( "SELECT albums FROM $wpdb->wppa_index WHERE slug = %s LIMIT 1", $filter ) );
2495
  $filter_albs = wppa_index_string_to_array( $filter_albs );
2496
 
2497
  foreach( array_keys( $albums ) as $key ) {
@@ -2501,148 +2352,82 @@ global $wpdb;
2501
  }
2502
  }
2503
 
2504
- $count = count( $albums );
 
2505
 
2506
  // If paging: Make new array with selected albums only
2507
  if ( $pagesize ) {
2508
- $temp = $albums;
2509
- $albums = array();
2510
- $i = 0;
2511
- foreach( $temp as $item ) {
2512
- if ( $i >= $skips && $i < ( $skips + $pagesize ) ) {
2513
- $albums[] = $item;
2514
- }
2515
- $i++;
2516
- }
2517
- }
2518
-
2519
- // Find the final ordering method
2520
- $reverse = false;
2521
- $order = wppa_get( 'order_by' );
2522
- if ( ! $order ) {
2523
- $order = wppa_get_option('wppa_album_order_'.wppa_get_user(), 'id');
2524
- $reverse = (wppa_get_option('wppa_album_order_'.wppa_get_user().'_reverse') == 'yes');
2525
- }
2526
- else {
2527
- $old_order = wppa_get_option('wppa_album_order_'.wppa_get_user(), 'id');
2528
- $reverse = (wppa_get_option('wppa_album_order_'.wppa_get_user().'_reverse') == 'yes');
2529
- if ( $old_order == $order ) {
2530
- $reverse = ! $reverse;
2531
- }
2532
- else $reverse = false;
2533
- wppa_update_option('wppa_album_order_'.wppa_get_user(), $order);
2534
- if ( $reverse ) wppa_update_option('wppa_album_order_'.wppa_get_user().'_reverse', 'yes');
2535
- else wppa_update_option('wppa_album_order_'.wppa_get_user().'_reverse', 'no');
2536
  }
2537
 
 
2538
  if ( ! empty( $albums ) ) {
2539
 
2540
- // Setup the sequence array
2541
- $seq = false;
2542
- $num = false;
2543
- foreach( $albums as $album ) {
2544
- switch ( $order ) {
2545
- case 'name':
2546
- $seq[] = strtolower(__(stripslashes($album['name'])));
2547
- break;
2548
- case 'description':
2549
- $seq[] = strtolower(__(stripslashes($album['description'])));
2550
- break;
2551
- case 'owner':
2552
- $seq[] = strtolower($album['owner']);
2553
- break;
2554
- case 'a_order':
2555
- $seq[] = $album['a_order'];
2556
- $num = true;
2557
- break;
2558
- case 'a_parent':
2559
- $seq[] = strtolower(wppa_get_album_name($album['a_parent'], array( 'extended' => true )));
2560
- break;
2561
- default:
2562
- $seq[] = $album['id'];
2563
- $num = true;
2564
- break;
2565
- }
2566
- }
2567
-
2568
- // Sort the seq array
2569
- if ( $num ) asort( $seq, SORT_NUMERIC );
2570
- else asort( $seq, SORT_REGULAR );
2571
-
2572
- // Reverse ?
2573
- if ( $reverse ) {
2574
- $t = $seq;
2575
- $c = count($t);
2576
- $tmp = array_keys($t);
2577
- $seq = false;
2578
- for ( $i = $c-1; $i >=0; $i-- ) {
2579
- $seq[$tmp[$i]] = '0';
2580
- }
2581
- }
2582
-
2583
  $downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style="height:12px;position:relative;top:2px" />';
2584
  $upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style="height:12px;position:relative;top:2px" />';
2585
- $useimg = $reverse ? $upimg : $downimg;
2586
  $show_nl = wppa_opt( 'user_create_max_level' ) != '99';
2587
- $url = get_admin_url().'admin.php?page=wppa_admin_menu&amp;order_by=';
 
2588
 
2589
- $result = wppa_album_table_pagination( $page, $count ) . '
 
 
 
 
2590
  <table
2591
  class="wppa-table widefat wppa-setting-table striped"
2592
- style="margin-top:12px;"
2593
  >
2594
  <thead>';
2595
  $thead_body = '
2596
  <tr>
2597
  <td
2598
- style="min-width:75px;"
2599
  title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
2600
  esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
2601
- >
2602
- <a href="' . $url . 'id">' .
2603
- ( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
2604
- ( $order == 'id' ? $useimg : '' ) . '
2605
- </a>
2606
  </td>
2607
  <td
2608
- style="min-width: 120px;"
2609
- >
2610
- <a href="' . $url . 'name">' .
2611
- __( 'Name', 'wp-photo-album-plus' ) .
2612
- ( $order == 'name' ? $useimg : '' ) . '
2613
- </a>
2614
  </td>
2615
- <td>
2616
- <a href="' . $url . 'description">' .
2617
- __( 'Description', 'wp-photo-album-plus' ) .
2618
- ( $order == 'description' ? $useimg : '' ) . '
2619
- </a>
 
2620
  </td>';
2621
  if ( current_user_can( 'administrator' ) ) {
2622
  $thead_body .= '
2623
- <td style="min-width: 100px;">
2624
- <a href="' . $url . 'owner">' .
2625
- __( 'Owner', 'wp-photo-album-plus' ) .
2626
- ( $order == 'owner' ? $useimg : '' ) . '
2627
- </a>
2628
  </td>';
2629
  }
2630
  $thead_body .= '
2631
  <td
2632
- style="min-width: 100px;"
2633
- >
2634
- <a href="' . $url . 'a_order">' .
2635
- __( 'Order', 'wp-photo-album-plus' ) .
2636
- ( $order == 'a_order' ? $useimg : '' ) . '
2637
- </a>
2638
  </td>
2639
  <td
2640
- style="width: 120px;"
2641
- >
2642
- <a href="' . $url . 'a_parent">' .
2643
- __( 'Parent', 'wp-photo-album-plus' ) .
2644
- ( $order == 'a_parent' ? $useimg : '' ) . '
2645
- </a>
2646
  </td>
2647
  <td
2648
  title="' . esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) . '"
@@ -2671,8 +2456,8 @@ global $wpdb;
2671
  $result = '<tbody>';
2672
  $mayseq = ! wppa_switch( 'porder_restricted' ) || wppa_user_is_admin();
2673
 
2674
- foreach ( array_keys( $seq ) as $s ) {
2675
- $album = $albums[$s];
2676
  $id = $album['id'];
2677
  $counts = wppa_get_treecounts_a( $id, true );
2678
  $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $id;
@@ -2688,7 +2473,7 @@ global $wpdb;
2688
  $url = wppa_ea_url( $id );
2689
  $delurl = wppa_ea_url( $id, 'del' );
2690
  $creurl = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $id . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
2691
- $creonc = 'if (confirm(\''.esc_js(__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' )).'\')) document.location=\''.$creurl.'\';';
2692
 
2693
  $result .= '
2694
  <tr ' . $alt . ( $pendcount ? 'style="background-color:#ffdddd"' : '' ) . '>
@@ -2733,15 +2518,20 @@ global $wpdb;
2733
  <tfoot>' .
2734
  $thead_body . '
2735
  </tfoot>
2736
- </table>' .
2737
- wppa_album_table_pagination( $page, $count );
2738
 
 
2739
  wppa_echo( $result );
2740
 
 
 
 
 
2741
  wppa_echo( wppa_album_admin_footer() );
2742
 
2743
  }
2744
  else {
 
2745
  wppa_echo( '<h2>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</h2>' );
2746
  }
2747
  }
@@ -2750,39 +2540,18 @@ global $wpdb;
2750
  function wppa_admin_albums_collapsible() {
2751
  global $wpdb;
2752
 
2753
- // Init
2754
- $pagesize = wppa_opt( 'album_admin_pagesize' );
2755
- $page = wppa_get( 'album-page-no', '1' );
 
 
2756
  $skips = ( $page - 1 ) * $pagesize;
2757
- $show_nl = wppa_opt( 'user_create_max_level' ) != '99';
 
 
2758
 
2759
  // Read all albums, pre-ordered
2760
- $order_by = wppa_get_option( 'wppa_album_order_' . wppa_get_user(), 'id' );
2761
- $order_desc = wppa_get_option( 'wppa_album_order_' . wppa_get_user() . '_reverse' );
2762
-
2763
- switch( $order_by ) {
2764
- case 'name':
2765
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY name";
2766
- break;
2767
- case 'description':
2768
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY description";
2769
- break;
2770
- case 'owner':
2771
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY owner";
2772
- break;
2773
- case 'a_order':
2774
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_order";
2775
- break;
2776
- case 'a_parent':
2777
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_parent";
2778
- break;
2779
- default:
2780
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY id";
2781
- }
2782
- if ( $order_desc == 'yes' ) {
2783
- $query .= " DESC";
2784
- }
2785
- $albums = $wpdb->get_results( $query, ARRAY_A );
2786
 
2787
  // Remove non accessible albums
2788
  $temp = $albums;
@@ -2792,21 +2561,29 @@ global $wpdb;
2792
  $albums[] = $temp[$idx];
2793
  }
2794
  }
2795
- $count = count( $albums );
2796
 
2797
- // If pagination: Make new array with selected albums only
2798
- if ( $pagesize ) {
2799
- $temp = $albums;
2800
- $albums = array();
2801
- $i = 0;
2802
- foreach( $temp as $item ) {
2803
- if ( $i >= $skips && $i < ( $skips + $pagesize ) ) {
2804
- $albums[] = $item;
 
 
2805
  }
2806
- $i++;
2807
  }
2808
  }
2809
 
 
 
 
 
 
 
 
 
2810
  // Make sure all (grand)parents are in
2811
  $done = false;
2812
  while ( ! $done ) {
@@ -2843,31 +2620,14 @@ global $wpdb;
2843
  WHERE id in (" . implode( ',', $all_ids ) . ")", ARRAY_A );
2844
  }
2845
 
2846
- // Find the ordering method
2847
- $reverse = wppa_get_option( 'wppa_album_order_' . wppa_get_user() . '_reverse', 'no' ) == 'yes';
2848
-
2849
- $order = wppa_get( 'order_by' );
2850
- if ( ! $order ) {
2851
- $order = wppa_get_option( 'wppa_album_order_' . wppa_get_user(), 'id' );
2852
- }
2853
- else {
2854
- $old_order = wppa_get_option( 'wppa_album_order_' . wppa_get_user(), 'id' );
2855
- if ( $old_order == $order ) {
2856
- $reverse = ! $reverse;
2857
- }
2858
- else $reverse = false;
2859
- wppa_update_option( 'wppa_album_order_' . wppa_get_user(), $order );
2860
- if ( $reverse ) wppa_update_option( 'wppa_album_order_' . wppa_get_user() . '_reverse', 'yes' );
2861
- else wppa_update_option( 'wppa_album_order_' . wppa_get_user() . '_reverse', 'no' );
2862
- }
2863
-
2864
  if ( ! empty( $albums ) ) {
2865
 
2866
  // Setup the sequence array
2867
  $seq = false;
2868
  $num = false;
2869
  foreach( $albums as $album ) {
2870
- switch ( $order ) {
2871
  case 'name':
2872
  $seq[] = strtolower( __( stripslashes( $album['name'] ) ) );
2873
  break;
@@ -2896,7 +2656,7 @@ global $wpdb;
2896
  else asort( $seq, SORT_REGULAR );
2897
 
2898
  // Reverse ?
2899
- if ( $reverse ) {
2900
  $t = $seq;
2901
  $c = count($t);
2902
  $tmp = array_keys($t);
@@ -2908,67 +2668,70 @@ global $wpdb;
2908
 
2909
  $downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style="height:12px;position:relative;top:2px" />';
2910
  $upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style="height:12px;position:relative;top:2px" />';
2911
- $useimg = $reverse ? $upimg : $downimg;
2912
- $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;order_by=';
 
 
 
 
2913
 
2914
- $result = wppa_album_table_pagination( $page, $count ) . '
2915
- <table class="widefat wppa-table wppa-setting-table" style="margin-top:12px">
 
 
2916
  <thead>';
2917
  $thead_body = '
2918
  <tr>
2919
- <td colspan="6" >
2920
- <img src="' . wppa_get_imgdir() . 'backarrow.gif" style="height:16px;" title="' . __( 'Collapse subalbums', 'wp-photo-album-plus' ) . '" />
2921
  <img src="' . wppa_get_imgdir() . 'arrow.gif" style="height:16px;" title="' . __( 'Expand subalbums', 'wp-photo-album-plus' ) . '" />
2922
  </td>
2923
- <td
2924
- style="min-width:75px;"
2925
  title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
2926
  esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
2927
- >
2928
- <a href="' . $url . 'id">' .
2929
- ( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
2930
- ( $order == 'id' ? $useimg : '' ) . '
2931
- </a>
2932
  </td>
2933
  <td
2934
- style="min-width: 120px;"
2935
- >
2936
- <a href="' . $url . 'name">' .
2937
- __( 'Name', 'wp-photo-album-plus' ) .
2938
- ( $order == 'name' ? $useimg : '' ) . '
2939
- </a>
2940
  </td>
2941
- <td>
2942
- <a href="' . $url . 'description">' .
2943
- __( 'Description', 'wp-photo-album-plus' ) .
2944
- ( $order == 'description' ? $useimg : '' ) . '
2945
- </a>
 
2946
  </td>';
2947
  if ( current_user_can( 'administrator' ) ) {
2948
  $thead_body .= '
2949
- <td style="min-width: 100px;">
2950
- <a href="' . $url . 'owner">' .
2951
- __( 'Owner', 'wp-photo-album-plus' ) .
2952
- ( $order == 'owner' ? $useimg : '' ) . '
2953
- </a>
2954
  </td>';
2955
  }
2956
  $thead_body .= '
2957
  <td
2958
- style="min-width: 100px;"
2959
- >
2960
- <a href="' . $url . 'a_order">' .
2961
- __( 'Sequence', 'wp-photo-album-plus' ) .
2962
- ( $order == 'a_order' ? $useimg : '' ) . '
2963
- </a>
2964
  </td>
2965
  <td
2966
- style="width: 120px;"
2967
- >
2968
- <a href="' . $url . 'a_parent">' .
2969
- __( 'Parent', 'wp-photo-album-plus' ) .
2970
- ( $order == 'a_parent' ? $useimg : '' ) . '
2971
- </a>
2972
  </td>
2973
  <td
2974
  title="' . esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) . '"
@@ -3002,7 +2765,7 @@ global $wpdb;
3002
  if ( $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_albums WHERE a_parent = '-1'" ) > 0 ) {
3003
  $result = '
3004
  <tr>
3005
- <td colspan="' . ( '19' + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) . '" >
3006
  <em>' .
3007
  __( 'The following albums are ---separate--- and do not show up in the generic album display', 'wp-photo-album-plus' ) . '
3008
  </em>
@@ -3026,36 +2789,27 @@ global $wpdb;
3026
  <tfoot>' .
3027
  $thead_body . '
3028
  </tfoot>
3029
- </table>' .
3030
- wppa_album_table_pagination( $page, $count );
3031
 
 
3032
  wppa_echo( $result );
3033
 
3034
- wppa_echo( wppa_album_admin_footer() );
 
3035
 
3036
- $the_js = '
3037
- function checkArrows() {
3038
- elms = jQuery(".alb-arrow-off");
3039
- for(i=0;i<elms.length;i++) {
3040
- elm = elms[i];
3041
- if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "none";
3042
- }
3043
- elms = jQuery(".alb-arrow-on");
3044
- for(i=0;i<elms.length;i++) {
3045
- elm = elms[i];
3046
- if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "";
3047
- }
3048
- }';
3049
 
3050
- wppa_add_inline_script( 'wppa-admin', $the_js );
3051
  }
3052
  else {
 
3053
  wppa_echo( '<h2>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</h2>' );
3054
  }
3055
  }
3056
 
3057
  // The adnin Search field
3058
  function wppa_search_edit( $collapsible = false ) {
 
3059
 
3060
  $doit = false;
3061
  if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
@@ -3065,17 +2819,23 @@ function wppa_search_edit( $collapsible = false ) {
3065
 
3066
  $value = wppa_get( 'searchstring' );
3067
 
3068
- $result = '
3069
- <tr>
3070
- <td colspan="' . ( ( $collapsible ? '20' : '14' ) + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) . '" >
3071
- <em>' .
3072
- __( 'Search for photos to edit', 'wp-photo-album-plus' ) . '
3073
- </em>
3074
- <small>' .
3075
- __( 'Enter search words seperated by commas. Photos will meet all search words by their names, descriptions, translated keywords and/or tags.', 'wp-photo-album-plus' ) . '
3076
- </small>
3077
- </td>
3078
- </tr>
 
 
 
 
 
 
3079
  <tr class="alternate" >' .
3080
  ( $collapsible ? '<td></td>' : '' ) . '
3081
  <td id="src-alb" >' .
@@ -3135,13 +2895,12 @@ global $wpdb;
3135
  <tr>' .
3136
  ( $collapsible ? '<td></td>' : '' ) . '
3137
  <td>' . __( 'Any', 'wp-photo-album-plus' ) . '</td>' .
3138
- ( $collapsible ? '<td></td><td></td><td></td><td></td><td></td>' : '' ) . '
3139
  <td colspan="4" >' .
3140
  sprintf( __( 'There are %s trashed photos that can be rescued', 'wp-photo-album-plus' ), $trashed ) . '
3141
  </td>
3142
- <td>
3143
  </td>
3144
- <td></td>
3145
  <td>
3146
  <a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '\' );">
3147
  <span style="font-weight:bold">' . __( 'Edit', 'wp-photo-album-plus' ) . '</span>
@@ -3166,60 +2925,6 @@ global $wpdb;
3166
  return $result;
3167
  }
3168
 
3169
- // The album table pagination
3170
- function wppa_album_table_pagination( $page, $count ) {
3171
- global $wpdb;
3172
-
3173
- // Init
3174
- $result = '';
3175
- $pagesize = wppa_opt( 'album_admin_pagesize' );
3176
-
3177
- // Paging on?
3178
- if ( ! $pagesize ) {
3179
- return;
3180
- }
3181
-
3182
- $npages = ceil( $count / $pagesize );
3183
-
3184
- // Just one page?
3185
- if ( $npages == '1' ) {
3186
- return;
3187
- }
3188
-
3189
- $link = get_admin_url().'admin.php?page=wppa_admin_menu&album-page-no=';
3190
-
3191
- $result .= '<div style="line-height:1.7em">';
3192
-
3193
- // The links
3194
- if ( $page != '1' ) {
3195
- $result .= '<a href="' . $link . ( $page - '1') . '" >' . __( 'Previous page', 'wp-photo-album-plus' ) . '</a> ';
3196
- }
3197
-
3198
- $p = '1';
3199
- while ( $p <= $npages ) {
3200
- if ( $p == $page ) {
3201
- $result .= '<span style="padding:0 0,25em">' . $page . '</span> ';
3202
- }
3203
- else {
3204
- $result .= '<a' .
3205
- ' href="' . $link . $p . '"' .
3206
- ' style="border:1px solid;padding:0 0.25em;"' .
3207
- ' >' .
3208
- $p .
3209
- '</a> ';
3210
- }
3211
- $p++;
3212
- }
3213
-
3214
- if ( $page != $npages ) {
3215
- $result .= '<a href="' . $link . ( $page + '1') . '" >' . __( 'Next page', 'wp-photo-album-plus' ) . '</a>';
3216
- }
3217
-
3218
- $result .= '</div>';
3219
-
3220
- return $result;
3221
- }
3222
-
3223
  // The albumlist
3224
  function wppa_do_albumlist( $parent, $nestinglevel, $albums, $seq ) {
3225
  global $wpdb;
@@ -3296,7 +3001,7 @@ global $wpdb;
3296
  style="height:16px;display:none"
3297
  src="' . wppa_get_imgdir() . 'backarrow.gif' . '"
3298
  onclick="' . $onclickoff . '"
3299
- title="' . esc_attr( __( 'Collapse subalbums', 'wp-photo-album-plus' ) ) . '"
3300
  />
3301
  <img
3302
  id="alb-arrow-on-' . $id . '"
@@ -3304,10 +3009,10 @@ global $wpdb;
3304
  style="height:16px;"
3305
  src="' . wppa_get_imgdir() . 'arrow.gif' . '"
3306
  onclick="' . $onclickon . '"
3307
- title="' . esc_attr( __( 'Expand subalbums', 'wp-photo-album-plus' ) ) . '"
3308
  />';
3309
 
3310
- // Open subalbums by clicking the open button if it was before (cookie), and if it is visible (!)
3311
  if ( wppa_get_cookie( 'alb-arrow-' . $id ) == 'on' ) {
3312
  $the_js = '
3313
  jQuery(document).ready(function(){
@@ -3318,7 +3023,7 @@ global $wpdb;
3318
  wppa_setCookie("alb-arrow-'.$id.'","off",365);
3319
  }
3320
  });';
3321
- wppa_add_inline_script( 'wppa-admin', $the_js );
3322
  }
3323
  }
3324
 
@@ -3343,11 +3048,26 @@ global $wpdb;
3343
  $nm = $counts['pendselfphotos'];
3344
  $ns = $counts['scheduledselfphotos'];
3345
 
3346
- // The album name
3347
  $result .= '
3348
  <td>' . esc_html( stripslashes( $album['name'] ) ) . '</td>
3349
- <td><small>' . esc_html( stripslashes( $album['description'] ) ) . '</small></td>' .
3350
- ( current_user_can( 'administrator' ) ? '<td>' . __( $album['owner'], 'wp-photo-album-plus' ) . '</td>' : '' ) . '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3351
  <td>' . $album['a_order'] . '</td>
3352
  <td>' . esc_html( stripslashes( wppa_get_album_name( $album['a_parent'], ['extended' => true] ) ) ) . '</td>
3353
  <td>' . $na . '/' . $np . '/' . $nm . '/' . $ns . '</td>';
@@ -3391,7 +3111,7 @@ global $wpdb;
3391
  }
3392
  if ( wppa_can_create_album() ) {
3393
  $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $id . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
3394
- $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
3395
  $result .= '<td><a onclick="' . $onc . '" class="wppacreate">' . __( 'Create', 'wp-photo-album-plus' ) . '</a></td>';
3396
  }
3397
  }
@@ -3413,7 +3133,7 @@ global $wpdb;
3413
  }
3414
  }
3415
 
3416
- // Find accessable subalbums
3417
  function wppa_have_accessible_children( $alb ) {
3418
  global $wpdb;
3419
 
@@ -3477,7 +3197,7 @@ global $wpdb;
3477
  wppa_clear_cache( array( 'album' => $id ) );
3478
  wppa_childlist_remove( $id );
3479
 
3480
- $msg = __( 'Album Deleted.' , 'wp-photo-album-plus' );
3481
  if ( wppa( 'ajax' ) ) {
3482
  wppa_echo( $msg );
3483
  }
@@ -3502,8 +3222,8 @@ global $wpdb;
3502
  $opts = array( __( '--- random ---', 'wp-photo-album-plus' ),
3503
  __( '--- random featured ---', 'wp-photo-album-plus' ),
3504
  __( '--- most recent added ---', 'wp-photo-album-plus' ),
3505
- __( '--- random from (sub-)subalbums ---', 'wp-photo-album-plus' ),
3506
- __( '--- most recent from (sub-)subalbums ---', 'wp-photo-album-plus' ),
3507
  __( '--- according to albums photo sequence ---', 'wp-photo-album-plus' ),
3508
  );
3509
  $vals = array( '-9', '-1', '-2', '-3', '-4', '-5' );
@@ -3629,7 +3349,7 @@ global $wpdb;
3629
  }
3630
  }
3631
 
3632
- // Subalbum order
3633
  if ( $parent ) {
3634
 
3635
  $sel = ' selected';
@@ -3659,7 +3379,7 @@ global $wpdb;
3659
  <div style="margin-left:6px">
3660
  <label
3661
  for="subalbumorder">' .
3662
- __( 'Subalbum sequence method', 'wp-photo-album-plus' ) . '
3663
  </label><br>
3664
  <select
3665
  id="subalbumorder"
@@ -3695,7 +3415,7 @@ global $wpdb;
3695
  else {
3696
  $result = '
3697
  <br>' .
3698
- esc_html__( 'You can edit subalbum sequence number here when you set the album sequence to "Sequence #" or "Sequence # descending" in the "Subalbum sequence method" selection box above.' );
3699
  }
3700
  $result .= '<br>';
3701
 
@@ -3788,13 +3508,9 @@ global $wpdb;
3788
  var wppaAjaxInProgress = 0;
3789
 
3790
  function wppaDoRenumber() {
3791
-
3792
- // Busy?
3793
  if ( wppaAjaxInProgress > 0 ) {
3794
  wppaRenumberPending = true;
3795
  }
3796
-
3797
- // Not busy
3798
  else {
3799
  _wppaDoRenumber();
3800
  }
@@ -3889,18 +3605,18 @@ global $wpdb;
3889
  }
3890
  }
3891
  }
3892
- }
3893
  xmlhttp.open( "POST",wppaAjaxUrl,true );
3894
  xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" );
3895
  xmlhttp.send( data );
3896
  wppaAjaxInProgress++;
3897
 
3898
- jQuery( "#wppa-sort-seqn-albums-" + album ).prop( "value", seqno ); // set hidden value to new value to prevent duplicate action
3899
  var spinnerhtml = "<img src=\'" + wppaImageDirectory + "spinner.gif\' />";
3900
  jQuery( "#wppa-album-seqno-" + album ).html( spinnerhtml );
3901
  }';
3902
 
3903
- wppa_add_inline_script( 'wppa-admin', $the_js );
3904
 
3905
  $result = '
3906
  <br>
@@ -4043,10 +3759,15 @@ function _wppa_search() {
4043
 
4044
  $result = '
4045
  <div class="wrap" >
4046
- <img src="' . WPPA_URL . '/img/magnifier-large.png' . '" />
4047
- <h1 style="display:inline">' . __( 'Search photos', 'wp-photo-album-plus' ) . '</h1>
 
4048
  <div style="clear:both">&nbsp;</div>
4049
-
 
 
 
 
4050
  <table class="wppa-table widefat wppa-setting-table" style="margin-top:12px">
4051
  <thead>
4052
  </thead>
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.3.01.006
7
  *
8
  */
9
 
14
  global $q_config;
15
  global $wppa_revno;
16
 
17
+ // Add local javascript
18
+ wppa_add_local_js( '_wppa_admin' );
19
+
20
+ // From search page or from menu?
21
  $from = wppa_get_option( 'wppa_search_page', 'wppa_admin_menu' );
22
  delete_option( 'wppa_search_page' );
23
 
24
+ // Create the back to ... link and top of page link html
25
+ {
26
+ if ( $from == 'wppa_admin_menu' ) {
27
+ $back_url = get_admin_url() . 'admin.php?page=wppa_admin_menu';
28
+ $back_title = __( 'Back to album table', 'wp-photo-album-plus' );
29
+ }
30
+ elseif ( $from == 'wppa_search' ) {
31
+ $back_url = get_admin_url() . 'admin.php?page=wppa_search';
32
+ $back_title = __( 'Back to search form', 'wp-photo-album-plus' );
33
 
34
+ if ( wppa_get( 'edit-id' ) == 'search' ) {
35
 
36
+ if ( wppa_get( 'searchstring' ) ) {
37
+ $back_url .= '&wppa-searchstring=' . wppa_get( 'searchstring' );
38
+ }
39
+ $back_url .= '#wppa-edit-search-tag';
40
+ }
41
  }
42
+ $back_link_html = '
43
+ <div style="position:fixed;right:20px;background-color:lightblue;top:50px;z-index:3;">
44
+ &nbsp;
45
+ <a href="' . $back_url . '"
46
+ style=""
47
+ >' .
48
+ $back_title . '
49
+ </a>
50
+ &nbsp;
51
+ </div>';
 
52
 
53
+ $top_link_html = '
54
+ <div style="position:fixed;right:20px;background-color:lightblue;bottom:30px;z-index:3;" >
55
+ &nbsp;
56
+ <a href="#manage-photos">' .
57
+ __( 'Top of page', 'wp-photo-album-plus' ) . '
58
+ </a>
59
+ &nbsp;
60
+ </div>';
61
+ }
62
 
63
  // Delete trashed comments
64
  $wpdb->query( "DELETE FROM $wpdb->wppa_comments WHERE status = 'trash'" );
65
 
 
 
66
  // warn if the uploads directory is no writable
67
  if ( ! is_writable( WPPA_UPLOAD_PATH ) ) {
68
  wppa_error_message(
100
  }
101
  }
102
 
103
+ // 'tab' set? If so, check nonce and see what we are going to do
104
  if ( wppa_get( 'tab' ) ) {
105
 
106
+ // Check nonce field
107
+ if ( ! wp_verify_nonce( wppa_get( 'nonce' ), 'wppa-nonce' ) ) {
108
+ wp_die('Security check failure 1');
109
+ }
110
+
111
  // album edit page
112
  if ( wppa_get( 'tab' ) == 'edit' ) {
113
 
114
  // Edit any album, check for type is implemented c.q. existence and rights
115
  if ( wppa_get( 'edit-id' ) ) {
116
 
117
+ // Validate input
118
  $ei = wppa_get( 'edit-id' );
119
  if ( $ei != 'new' && $ei != 'search' && $ei != 'trash' && $ei != 'single' && ! is_numeric( $ei ) ) {
120
  wppa_error_message( sprintf( __( 'Album edit id %s is not implemented', 'wp-photo-album-plus' ), $ei ) );
121
  return;
122
  }
123
+
 
 
124
  if ( is_numeric( $ei ) ) {
125
  if ( ! $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_albums WHERE id=%d", $ei ), ARRAY_A ) ) {
126
  wppa_error_message( sprintf( __( 'Album %d does not exist', 'wp-photo-album-plus' ), $ei ) );
127
  return;
128
  }
129
  if ( ! wppa_have_access( $ei ) ) {
130
+ wppa_error_message( sprintf( __( 'You do not have sufficient rights to edit album %d', 'wp-photo-album-plus' ), $ei ) );
131
  return;
132
  }
133
  }
136
  // Edit single photo
137
  if ( wppa_get( 'edit-id' ) == 'single' ) {
138
 
139
+ $page_title = wppa_get( 'just-edit', __( 'Edit Single media item', 'wp-photo-album-plus' ) );
140
 
141
+ wppa_echo( '<div class="wrap" ><h1 class="wp-heading-inline">' . $page_title . '</h1>' );
142
  wppa_album_photos( $ei );
143
  wppa_echo( '</div>' );
144
  return;
147
  // Edit by search token
148
  if ( wppa_get( 'edit-id' ) == 'search' ) {
149
 
150
+ $bulk = wppa_get( 'bulk' );
 
 
 
 
 
 
151
 
152
  wppa_echo ( '
153
  <a name="manage-photos" id="manage-photos" ></a>
154
+ <div class="wrap">' );
 
 
 
 
155
 
156
+ // The page title
157
+ if ( $bulk ) {
158
+ $page_title = sprintf( __( 'Bulk edit media items searched by %s', 'wp-photo-album-plus' ), '<i>' . wppa_get( 'searchstring', '', 'text' ) . '</i>' );
159
+ }
160
+ else {
161
+ $page_title = sprintf( __( 'Edit media items searched by %s', 'wp-photo-album-plus' ), '<i>' . wppa_get( 'searchstring', '', 'text' ) . '</i>' );
162
+ }
163
+
164
+ wppa_echo( '
165
+ <h1 class="wp-heading-inline">' . $page_title . '</h1>' .
166
+ $back_link_html . '
167
+ <br><br>' );
168
+
169
+ // Do the dirty work
170
+ if ( $bulk ) {
171
+ wppa_album_photos_bulk( $ei );
172
+ }
173
+ else {
174
+ wppa_album_photos( $ei );
175
+ }
176
 
177
+ wppa_echo( $top_link_html );//. '<br>' . $back_link_html );
178
+ wppa_echo( '</div>' );
179
  return;
180
  }
181
 
184
 
185
  $h2 = __( 'Manage Trashed Photos', 'wp-photo-album-plus' );
186
  $task = __( 'Edit photo information', 'wp-photo-album-plus' );
187
+ wppa_echo( '<div class="wrap"><a name="manage-photos" id="manage-photos" ></a><h1>' . $h2 . ' - <small><i>' . $task . '</i></small></h1>' );
188
  if ( wppa_get( 'bulk' ) ) {
189
  wppa_album_photos_bulk( $ei );
190
  }
204
  }
205
  $id = wppa_nextkey( WPPA_ALBUMS );
206
 
207
+ // Creating a sub album of a given parent?
208
  if ( wppa_get( 'parent_id' ) ) {
209
  $parent = wppa_get( 'parent_id' );
210
  $name = wppa_get_album_name( $parent ) . '-#' . $id;
225
  wppa_update_option( 'wppa_default_parent', '0' );
226
  $parent = '0';
227
  }
228
+ $name = __( 'New album', 'wp-photo-album-plus' );
229
  if ( $parent == '0' && ! wppa_can_create_top_album() ) {
230
  wp_die( __( 'You have insufficient rights to create a top-level album', 'wp-photo-album-plus' ) );
231
  }
459
  }
460
 
461
  // Local js functions
462
+ $the_js = 'jQuery(document).ready(function(){wppaGetCoverPreview('.$id.', "cover-preview-"+'.$id.' )});';
463
+ wppa_add_inline_script( 'wppa-admin', $the_js, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
 
465
  /* The actual page lay-out starts here */
466
 
474
  wppa_echo( '<input type="hidden" id="album-nonce-' . $id . '" value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '" />' );
475
 
476
  // The header
477
+ if ( wppa_get( 'bulk', '0', 'int' ) ) {
478
+ $page_title = __( 'Albums -> Bulk edit -> %s', 'wp-photo-album-plus' );
479
+ }
480
+ elseif ( wppa_get( 'quick', '0', 'int' ) ) {
481
+ $page_title = __( 'Albums -> Quick edit -> %s', 'wp-photo-album-plus' );
482
+ }
483
+ elseif ( wppa_get( 'seq', '0', 'int' ) ) {
484
+ $page_title = __( 'Albums -> Sequence edit -> %s', 'wp-photo-album-plus' );
485
+ }
486
+ else {
487
+ $page_title = __( 'Albums -> Edit -> %s', 'wp-photo-album-plus' );
488
+ }
489
+ wppa_echo( '<h1 class="wp-heading-inline">' . esc_html( sprintf( $page_title, __( wppa_get_album_name( $id ) ) ) ) . '</h1>' );
490
+
491
 
492
  wppa_echo( $back_link_html );
493
 
494
  /* Start header buttons */
495
+ $result = '
496
+ <div id="wppa-action-container">';
 
497
 
498
  // Goto Upload
499
  if ( current_user_can( 'wppa_upload' ) ) {
507
  __( 'Upload to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' )
508
  );
509
 
510
+ $result .= '
511
  <input
512
  type="button"
513
  class="wppa-admin-button button"
514
  onclick="' . $onc . '"
515
  value="' . $val .'"
516
+ />';
517
  }
518
 
519
  // Goto Import
522
  $onc = 'document.location = \''.get_admin_url().'admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\'';
523
  $val = __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' );
524
 
525
+ $result .= '
526
  <input
527
  type="button"
528
  class="wppa-admin-button button"
529
  onclick="' . $onc . '"
530
  value="' . $val .'"
531
+ />';
532
  }
 
 
533
 
534
  // Download album
535
  if ( wppa_switch( 'allow_download_album' ) && ( ! wppa_switch( 'download_album_is_restricted' ) || wppa_user_is_admin() ) ) {
536
+
537
+ $result .= '
538
  <input
539
  type="button"
540
  class="wppa-admin-button button"
546
  src="' . wppa_get_imgdir() . 'spinner.gif"
547
  style="margin-left:6px;display:none;height:18px;position:relative;bottom:-6px"
548
  alt="spinner"
549
+ />';
 
550
  }
551
+
552
+ $result .= '
553
+ </div>'; // end action-container
554
+ wppa_echo( $result );
555
  /* End header */
556
 
557
  /* Main body album admin */
593
  <div style="clear:both"></div>
594
  </div>');
595
 
 
 
 
 
 
 
 
 
 
 
596
  // Tab 1: General Album Settings
597
  wppa_echo( '
598
  <div
698
  wppa_echo( '
699
  <div class="left">
700
  <label>' .
701
+ __( 'Inc sub albums', 'wp-photo-album-plus' ) . '
702
  </label><br>
703
  <div class="wppa-ldi">' .
704
  $tpviews . '
805
 
806
  // Status
807
  {
808
+ $title = __( 'Set the frontend visibility of the album cover and items not including sub albums.', 'wp-photo-album-plus' ) . ' ' .
809
  __( 'Publish: visible for all, Private: visible for logged in only, Hidden: visible for admin only', 'wp-photo-album-plus' );
810
 
811
  wppa_echo( '
992
  style="max-width: 200px;margin-right: 4px;">
993
  <label
994
  for="altthumb">' .
995
+ __( 'Max sub albums', 'wp-photo-album-plus' ) . '
996
  </label><br>
997
  <select
998
  id="maxchild"
999
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'max_children\', this )"
1000
+ title="' . esc_attr( 'This setting can only llimit the creation of sub albums at the frontend and looks at direct sub albums only', 'wp-photo-album-plus' ) . '"
1001
  >
1002
  <option value="0"' . ( $val == '0' ? $sel : '' ) . ' >' .
1003
  __( 'unlimited', 'wp-photo-album-plus' ) . '
1077
 
1078
  // Tree limit
1079
  {
1080
+ $title = __( 'The upload limit for this album and all its (sub-)sub albums.', 'wp-photo-album-plus' ) . ' ' .
1081
+ __( 'This setting overrules all other limits that may apply to this album or its (sub-)sub albums.', 'wp-photo-album-plus' ) . ' ' .
1082
  __( '0 means no limit.', 'wp-photo-album-plus' );
1083
  wppa_echo( '
1084
  <div class="left">
1329
  __( 'The following buttons perform actions on albums related to this album', 'wp-photo-album-plus' ) . '
1330
  </h2>' );
1331
 
1332
+ // Create sub album
1333
  if ( wppa_can_create_album() ) {
1334
  $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $albuminfo['id'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
1335
+ $onc = 'if (confirm(\''.__( 'Are you sure you want to create a sub album?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1336
 
1337
  wppa_echo( '
1338
  <input
1339
  type="button"
1340
  class="wppa-admin-button button"
1341
  onclick="' . $onc . '"
1342
+ value="' . esc_attr( __( 'Create sub album', 'wp-photo-album-plus' ) ) . '"
1343
  />' );
1344
  }
1345
 
1354
  '&amp;parent_id=' . $albuminfo['a_parent'] .
1355
  '&amp;is-sibling-of=' . $albuminfo['id'] .
1356
  '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
1357
+ $onc = 'if (confirm(\''.__( 'Are you sure you want to create a sub album?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1358
 
1359
  wppa_echo( '
1360
  <input
1384
  <input
1385
  type="button"
1386
  class="wppa-admin-button button"
1387
+ title="' . esc_attr( __( 'Apply categories to all (sub-)sub albums.', 'wp-photo-album-plus' ) ) . '"
1388
  onclick="wppaTryInheritCats( ' . $id . ' )"
1389
+ value="' . esc_attr( __( 'Apply Cats to sub albums', 'wp-photo-album-plus' ) ) . '"
1390
  />
1391
  <input
1392
  type="button"
1393
  class="wppa-admin-button button"
1394
+ title="' . esc_attr( __( 'Add categories to all (sub-)sub albums.', 'wp-photo-album-plus' ) ) . '"
1395
  onclick="wppaTryAddCats( ' . $id . ' )"
1396
+ value="' . esc_attr( __( 'Add Cats to sub albums', 'wp-photo-album-plus' ) ) . '"
1397
  />' );
1398
  }
1399
 
1400
+ // Sub albums sequence
1401
  if ( $has_children ) {
1402
  wppa_album_sequence( $edit_id );
1403
  }
1707
  <select
1708
  title="' . esc_attr( $title ) . '"
1709
  onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_linktype\', this )" >
1710
+ <option value="content"' . ( $lt == 'content' ? $sel : '' ) . ' >' . __( 'the sub albums and thumbnails', 'wp-photo-album-plus' ) . '</option>
1711
+ <option value="albums"' . ( $lt == 'albums' ? $sel : '' ) . ' >' . __( 'the sub albums', 'wp-photo-album-plus' ) . '</option>
1712
  <option value="thumbs"' . ( $lt == 'thumbs' ? $sel : '' ) . ' >' . __( 'the thumbnails', 'wp-photo-album-plus' ) . '</option>
1713
  <option value="slide"' . ( $lt == 'slide' ? $sel : '' ) . ' >' . __( 'the album photos as slideshow', 'wp-photo-album-plus' ) . '</option>
1714
  <option value="page"' . ( $lt == 'page' ? $sel : '' ) . ' >' . __( 'the link page with a clean url', 'wp-photo-album-plus' ) . '</option>
1991
 
1992
  /* Manage photos section */
1993
  {
1994
+ wppa_echo( '<div class="wppa-table-wrap" style="margin-top:20px;clear:both;position:relative;border:none;">' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1995
 
1996
+ wppa_echo( '<a name="manage-photos" id="manage-photos" ></a>' );
 
 
 
1997
 
1998
  if ( wppa_get( 'bulk' ) )
1999
  wppa_album_photos_bulk( $edit_id );
2002
  else
2003
  wppa_album_photos( $edit_id );
2004
 
2005
+ wppa_echo( '</div>' );
2006
+
 
2007
  }
2008
 
2009
  /* Footer of the page */
2010
  wppa_echo( '
2011
  <br>' .
 
2012
  $top_link_html . '
2013
  </div>' );
2014
 
 
2015
  } // End tab is Edit
2016
 
2017
  // Comment moderate
2021
  if ( current_user_can( 'wppa_comments' ) && wppa_have_access( $alb ) ) {
2022
  $result = '
2023
  <div class="wrap">
2024
+ <h1 class="wp-heading-inline">' .
2025
+ __( 'Moderate comment', 'wp-photo-album-plus' ) . '
2026
+ </h1>' .
2027
  wppa_album_photos( '', $photo ) . '
2028
  </div>';
2029
  wppa_echo( $result );
2041
  $result = '
2042
  <div class="wrap">
2043
  <img src="' . WPPA_URL . '/img/page_green.png" />
2044
+ <h1 class="wp-heading-inline">' . ( wppa_get( 'tab' ) == 'pmod' ?
2045
  __( 'Moderate photo', 'wp-photo-album-plus' ) :
2046
  __( 'Edit photo', 'wp-photo-album-plus' ) ) . '
2047
  </h1>
2065
 
2066
  $result = '
2067
  <div class="wrap">
2068
+ <h1 class="wp-heading-inline">' . __( 'Delete Album', 'wp-photo-album-plus' ) . '</h1>
 
2069
 
2070
  <p>' . __( 'Album', 'wp-photo-album-plus' ) . '<b>' . htmlspecialchars( wppa_get_album_name( wppa_get( 'edit-id' ) ) ) . '</b></p>
2071
  <p>' . __( 'Are you sure you want to delete this album?', 'wp-photo-album-plus' ) . '<br>' .
2110
  </div>';
2111
  wppa_echo( $result );
2112
  }
2113
+
2114
+ // Unimplemented
2115
  else {
2116
  wppa_error_message( sprintf( __( 'Album admin action %s is not implemented', 'wp-photo-album-plus' ),
2117
  '<b>' . wppa_get( 'tab' ) ) . '</b>' );
2121
  // 'tab' not set. default, album manage page.
2122
  else {
2123
 
2124
+ // Delete album
2125
  if ( wppa_get( 'del-confirm' ) ) {
2126
 
2127
  if ( ! wp_verify_nonce( wppa_get( 'nonce' ), 'wppa-nonce' ) ) {
2128
+ wp_die( 'Security check failure' );
2129
  }
2130
 
2131
  $album_owner = $wpdb->get_var( $wpdb->prepare( "SELECT owner FROM $wpdb->wppa_albums WHERE id = %s", wppa_get( 'del-id' ) ) );
2132
+ if ( ( $album_owner == '--- public ---' && ! current_user_can( 'administrator' ) ) || ! wppa_have_access( wppa_get( 'del-id' ) ) ) {
2133
+ wp_die( 'You do not have the rights to delete this album' );
2134
  }
2135
 
2136
  if ( wppa_get( 'del-photos' ) == 'move' ) {
2146
  }
2147
  }
2148
 
2149
+ // Switch to flat / collapsable table
2150
  if ( wppa_get( 'switchto' ) ) {
2151
  wppa_update_option( 'wppa_album_table_'.wppa_get_user(), wppa_get( 'switchto' ) );
2152
  }
2153
+ $style = wppa_get_option('wppa_album_table_'.wppa_get_user(), 'flat'); // 'flat' or 'collapsible'
2154
+ if ( $style != 'flat' ) $style = 'collapsible';
 
2155
 
2156
  /* The album admin table of albums page start */
2157
  wppa_echo( '
2158
  <div class="wrap">' .
2159
  wppa_admin_spinner() . '
2160
+ <h1 class="wp-heading-inline">' . get_admin_page_title() . '</h1>' );
2161
 
2162
  // The Create new album button
2163
  if ( wppa_can_create_top_album() ) {
2170
  class="page-title-action">' .
2171
  __( 'Add New', 'wp-photo-album-plus' ) . '
2172
  </a>
2173
+ ' );
2174
  }
2175
 
2176
+ /* The header buttons / selection boxes */
2177
  {
2178
+ $header = '
2179
+ <div class=="wppa-table-header-box">
2180
+ <div id="wppa-action-container">';
2181
 
2182
  // The switch to flat/collapsable button(s)
2183
  if ( $style == 'flat' ) {
2184
+ $header .= '
2185
  <input
2186
  type="button"
2187
  class="button"
2188
  onclick="document.location=\'' . get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;switchto=collapsible\'"
2189
  value="' . esc_attr__( 'Switch to Collapsable table', 'wp-photo-album-plus' ) . '"
2190
+ />';
2191
  }
2192
  else {
2193
+ $header .= '
2194
  <input
2195
  type="button"
2196
  class="button"
2197
  onclick="document.location=\'' . get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;switchto=flat\'"
2198
  value="' . esc_attr__( 'Switch to Flat table', 'wp-photo-album-plus' ) . '"
2199
+ />';
2200
  }
2201
 
2202
  // The open all/close all buttons
2203
  if ( $style != 'flat' ) {
2204
+ $header .= '
2205
  <input
2206
  type="button"
2207
  class="button"
2225
  jQuery(\'.alb-arrow-off\').css(\'display\',\'none\');
2226
  "
2227
  value="' . esc_attr__( 'Close all', 'wp-photo-album-plus' ) . '"
2228
+ />';
2229
  }
2230
 
 
 
 
 
2231
  // Edit by id
2232
  if ( wppa_has_many_albums() ) {
2233
+ $header .= '
2234
  <input
2235
  id="wppa-edit-albid"
2236
  type="number"
2238
  placeholder="' . __( 'Album id', 'wp-photo-album-plus' ) . '"
2239
  title="' . __( 'Enter the number of the album you want to edit', 'wp-photo-album-plus' ) . '"
2240
  style="width:120px;cursor:pointer"
2241
+ />';
2242
  }
2243
  else {
2244
  $albids = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums ORDER BY id" );
2247
  unset( $albids[$key] );
2248
  }
2249
  }
2250
+ $header .= '
2251
  <select
2252
  id="wppa-edit-albid"
2253
  title="' . __( 'Select the number of the album you want to edit', 'wp-photo-album-plus' ) . '"
2254
  styles="width:120px;cursor:pointer;vertical-align:baseline"
2255
  />
2256
+ <option value="" selected disabled>' . __( 'Album id', 'wp-photo-album-plus' ) . '</option>';
2257
  foreach( $albids as $alb ) {
2258
+ $header .= '<option value="' . $alb . '">' . $alb . '</option>';
2259
  }
2260
+ $header .= '
2261
+ </select>';
2262
  }
2263
+ $header .= '
2264
  <input
2265
  type="button"
2266
  class="button"
2267
  value="' . __( 'Edit album', 'wp-photo-album-plus' ) . '"
2268
  onclick="wppaGoEditAlbNo();"
2269
+ />';
2270
 
2271
  // Filter by searchword
2272
  $opts = $wpdb->get_col( "SELECT slug FROM $wpdb->wppa_index WHERE albums <> '' ORDER BY slug" );
2273
  $f = wppa_get( 'filter' );
2274
+ $header .= '
2275
  <select
2276
  id="wppa-edit-filter"
2277
  title="' . __( 'Select an album search word', 'wp-photo-album-plus' ) . '"
2278
  >
2279
+ <option value="" selected disabled>' . __( 'Filter by', 'wp-photo-album-plus' ) . '</option>';
2280
  foreach( $opts as $opt ) {
2281
+ $header .= '<option value="' . $opt . '"' . ( $f == $opt ? ' selected ' : '' ) . '>' . $opt . '</option>';
2282
  }
2283
+ $header .= '
2284
  </select>
2285
  <input
2286
  type="button"
2287
  class="button"
2288
  onclick="wppaGoApplyFilter();"
2289
  value="' . __( 'Apply filter', 'wp-photo-album-plus' ) . '"
2290
+ />';
 
 
 
 
 
2291
 
2292
+ // Close action container
2293
+ $header .= '
2294
+ </div>';
2295
+ wppa_echo( $header );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2296
 
2297
+ /* End header buttons / selection boxes */
 
 
2298
  }
2299
+
2300
+
2301
+ // The table of existing albums. $style = 'flat' or 'collapsible'
2302
+ if ( in_array( $style, ['flat', 'collapsible'] ) ) {
2303
+ call_user_func( 'wppa_admin_albums_' . $style );
2304
  }
2305
 
2306
+ wppa_echo( '<hr style="background-color:#777;height:3px;margin:20px 0;">' );
2307
 
2308
+ // The drag-drop sequence editor for toplevel albums
2309
  wppa_album_sequence( '0' );
2310
 
2311
  wppa_echo( '</div>' );
2312
+ /* The album admin table of albums page end */
2313
  }
2314
  }
2315
 
2317
  function wppa_admin_albums_flat() {
2318
  global $wpdb;
2319
 
2320
+ // Get paging parameters
2321
+ $parms = wppa_get_paging_parms( 'album_admin' );
2322
+
2323
+ $pagesize = $parms['pagesize'];
2324
+ $page = $parms['page'];
2325
  $skips = ( $page - 1 ) * $pagesize;
2326
+ $order_by = $parms['order'];
2327
+ $dir = $parms['dir'];
2328
 
2329
  // Read all albums, pre-ordered
2330
+ $albums = $wpdb->get_results( "SELECT * FROM `$wpdb->wppa_albums` ORDER BY `$order_by` $dir", ARRAY_A );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2331
 
2332
  // Remove non accessible albums
2333
  $temp = $albums;
2342
  $filter = wppa_get( 'filter' );
2343
 
2344
  if ( $filter ) {
2345
+ $filter_albs = $wpdb->get_var( $wpdb->prepare( "SELECT albums FROM `$wpdb->wppa_index` WHERE `slug` = %s LIMIT 1", $filter ) );
2346
  $filter_albs = wppa_index_string_to_array( $filter_albs );
2347
 
2348
  foreach( array_keys( $albums ) as $key ) {
2352
  }
2353
  }
2354
 
2355
+ // Potentially total albums
2356
+ $total = count( $albums );
2357
 
2358
  // If paging: Make new array with selected albums only
2359
  if ( $pagesize ) {
2360
+ $albums = array_slice( $albums, $skips, $pagesize );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2361
  }
2362
 
2363
+ // Do the dirty work
2364
  if ( ! empty( $albums ) ) {
2365
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2366
  $downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style="height:12px;position:relative;top:2px" />';
2367
  $upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style="height:12px;position:relative;top:2px" />';
2368
+ $useimg = $parms['dir'] == 'DESC' ? $upimg : $downimg;
2369
  $show_nl = wppa_opt( 'user_create_max_level' ) != '99';
2370
+ $reload_url = get_admin_url() . 'admin.php?page=wppa_admin_menu'; // &paged=';
2371
+ $order = $parms['order'];
2372
 
2373
+ wppa_admin_pagination( $pagesize, $page, $total, $reload_url, 'top' );
2374
+
2375
+ wppa_echo( '</div>' ); // Close action contatiner
2376
+
2377
+ $result = '
2378
  <table
2379
  class="wppa-table widefat wppa-setting-table striped"
2380
+ style="margin:12px 0;"
2381
  >
2382
  <thead>';
2383
  $thead_body = '
2384
  <tr>
2385
  <td
2386
+ style="min-width:75px;cursor:pointer;"
2387
  title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
2388
  esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
2389
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'id' ) . '\'"
2390
+ >' .
2391
+ ( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
2392
+ ( $order == 'id' ? $useimg : '' ) . '
 
2393
  </td>
2394
  <td
2395
+ style="min-width: 120px;cursor:pointer;"
2396
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'name' ) . '\'"
2397
+ >' .
2398
+ __( 'Name', 'wp-photo-album-plus' ) .
2399
+ ( $order == 'name' ? $useimg : '' ) . '
 
2400
  </td>
2401
+ <td
2402
+ style="cursor:pointer;"
2403
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'description' ) . '\'"
2404
+ >' .
2405
+ __( 'Description', 'wp-photo-album-plus' ) .
2406
+ ( $order == 'description' ? $useimg : '' ) . '
2407
  </td>';
2408
  if ( current_user_can( 'administrator' ) ) {
2409
  $thead_body .= '
2410
+ <td style="min-width: 100px;cursor:pointer;"
2411
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'owner' ) . '\'"
2412
+ >' .
2413
+ __( 'Owner', 'wp-photo-album-plus' ) .
2414
+ ( $order == 'owner' ? $useimg : '' ) . '
2415
  </td>';
2416
  }
2417
  $thead_body .= '
2418
  <td
2419
+ style="min-width: 100px;cursor:pointer;"
2420
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'a_order' ) . '\'"
2421
+ >' .
2422
+ __( 'Order', 'wp-photo-album-plus' ) .
2423
+ ( $order == 'a_order' ? $useimg : '' ) . '
 
2424
  </td>
2425
  <td
2426
+ style="width: 120px;cursor:pointer;"
2427
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'a_parent' ) . '\'"
2428
+ >' .
2429
+ __( 'Parent', 'wp-photo-album-plus' ) .
2430
+ ( $order == 'a_parent' ? $useimg : '' ) . '
 
2431
  </td>
2432
  <td
2433
  title="' . esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) . '"
2456
  $result = '<tbody>';
2457
  $mayseq = ! wppa_switch( 'porder_restricted' ) || wppa_user_is_admin();
2458
 
2459
+ foreach ( $albums as $album ) {
2460
+
2461
  $id = $album['id'];
2462
  $counts = wppa_get_treecounts_a( $id, true );
2463
  $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $id;
2473
  $url = wppa_ea_url( $id );
2474
  $delurl = wppa_ea_url( $id, 'del' );
2475
  $creurl = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $id . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
2476
+ $creonc = 'if (confirm(\''.esc_js(__( 'Are you sure you want to create a sub album?', 'wp-photo-album-plus' )).'\')) document.location=\''.$creurl.'\';';
2477
 
2478
  $result .= '
2479
  <tr ' . $alt . ( $pendcount ? 'style="background-color:#ffdddd"' : '' ) . '>
2518
  <tfoot>' .
2519
  $thead_body . '
2520
  </tfoot>
2521
+ </table>';
 
2522
 
2523
+ // Display the album table footer
2524
  wppa_echo( $result );
2525
 
2526
+ // Display pagination
2527
+ wppa_admin_pagination( $pagesize, $page, $total, $reload_url, 'bottom' );
2528
+
2529
+ // Display footer
2530
  wppa_echo( wppa_album_admin_footer() );
2531
 
2532
  }
2533
  else {
2534
+ wppa_echo( '</div>' ); // Close action contatiner
2535
  wppa_echo( '<h2>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</h2>' );
2536
  }
2537
  }
2540
  function wppa_admin_albums_collapsible() {
2541
  global $wpdb;
2542
 
2543
+ // Get paging parameters
2544
+ {
2545
+ $parms = wppa_get_paging_parms( 'album_admin' );
2546
+ $pagesize = $parms['pagesize'];
2547
+ $page = $parms['page'];
2548
  $skips = ( $page - 1 ) * $pagesize;
2549
+ $order_by = $parms['order'];
2550
+ $dir = $parms['dir'];
2551
+ }
2552
 
2553
  // Read all albums, pre-ordered
2554
+ $albums = $wpdb->get_results( "SELECT * FROM `$wpdb->wppa_albums` ORDER BY `$order_by` $dir", ARRAY_A );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2555
 
2556
  // Remove non accessible albums
2557
  $temp = $albums;
2561
  $albums[] = $temp[$idx];
2562
  }
2563
  }
 
2564
 
2565
+ // If filter, filter
2566
+ $filter = wppa_get( 'filter' );
2567
+
2568
+ if ( $filter ) {
2569
+ $filter_albs = $wpdb->get_var( $wpdb->prepare( "SELECT albums FROM `$wpdb->wppa_index` WHERE `slug` = %s LIMIT 1", $filter ) );
2570
+ $filter_albs = wppa_index_string_to_array( $filter_albs );
2571
+
2572
+ foreach( array_keys( $albums ) as $key ) {
2573
+ if ( ! in_array( $albums[$key]['id'], $filter_albs ) ) {
2574
+ unset( $albums[$key] );
2575
  }
 
2576
  }
2577
  }
2578
 
2579
+ // Potentially total albums
2580
+ $total = count( $albums );
2581
+
2582
+ // If paging: Make new array with selected albums only
2583
+ if ( $pagesize ) {
2584
+ $albums = array_slice( $albums, $skips, $pagesize );
2585
+ }
2586
+
2587
  // Make sure all (grand)parents are in
2588
  $done = false;
2589
  while ( ! $done ) {
2620
  WHERE id in (" . implode( ',', $all_ids ) . ")", ARRAY_A );
2621
  }
2622
 
2623
+ // If any albums left, do trhe dirty work
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2624
  if ( ! empty( $albums ) ) {
2625
 
2626
  // Setup the sequence array
2627
  $seq = false;
2628
  $num = false;
2629
  foreach( $albums as $album ) {
2630
+ switch ( $order_by ) {
2631
  case 'name':
2632
  $seq[] = strtolower( __( stripslashes( $album['name'] ) ) );
2633
  break;
2656
  else asort( $seq, SORT_REGULAR );
2657
 
2658
  // Reverse ?
2659
+ if ( $dir == 'DESC' ) {
2660
  $t = $seq;
2661
  $c = count($t);
2662
  $tmp = array_keys($t);
2668
 
2669
  $downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style="height:12px;position:relative;top:2px" />';
2670
  $upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style="height:12px;position:relative;top:2px" />';
2671
+ $useimg = $dir == 'DESC' ? $upimg : $downimg;
2672
+ $show_nl = wppa_opt( 'user_create_max_level' ) != '99';
2673
+ $reload_url = get_admin_url() . 'admin.php?page=wppa_admin_menu';
2674
+ $order = $parms['order'];
2675
+
2676
+ wppa_admin_pagination( $pagesize, $page, $total, $reload_url, 'top' );
2677
 
2678
+ wppa_echo( '</div>' ); // Close action contatiner
2679
+
2680
+ $result = '
2681
+ <table class="widefat wppa-table wppa-setting-table" style="margin:12px 0">
2682
  <thead>';
2683
  $thead_body = '
2684
  <tr>
2685
+ <td style="width:40px">
2686
+ <img src="' . wppa_get_imgdir() . 'backarrow.gif" style="height:16px;" title="' . __( 'Collapse subalbums', 'wp-photo-album-plus' ) . '" />&thinsp;
2687
  <img src="' . wppa_get_imgdir() . 'arrow.gif" style="height:16px;" title="' . __( 'Expand subalbums', 'wp-photo-album-plus' ) . '" />
2688
  </td>
2689
+ <td colspan="6"
2690
+ style="min-width:75px;cursor:pointer;"
2691
  title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
2692
  esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
2693
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'id' ) . '\'"
2694
+ >' .
2695
+ ( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
2696
+ ( $order == 'id' ? $useimg : '' ) . '
 
2697
  </td>
2698
  <td
2699
+ style="min-width: 120px;cursor:pointer;"
2700
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'name' ) . '\'"
2701
+ >' .
2702
+ __( 'Name', 'wp-photo-album-plus' ) .
2703
+ ( $order == 'name' ? $useimg : '' ) . '
 
2704
  </td>
2705
+ <td
2706
+ style="cursor:pointer;"
2707
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'description' ) . '\'"
2708
+ >' .
2709
+ __( 'Description', 'wp-photo-album-plus' ) .
2710
+ ( $order == 'description' ? $useimg : '' ) . '
2711
  </td>';
2712
  if ( current_user_can( 'administrator' ) ) {
2713
  $thead_body .= '
2714
+ <td style="min-width: 100px;cursor:pointer;"
2715
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'owner' ) . '\'"
2716
+ >' .
2717
+ __( 'Owner', 'wp-photo-album-plus' ) .
2718
+ ( $order == 'owner' ? $useimg : '' ) . '
2719
  </td>';
2720
  }
2721
  $thead_body .= '
2722
  <td
2723
+ style="min-width: 100px;cursor:pointer;"
2724
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'a_order' ) . '\'"
2725
+ >' .
2726
+ __( 'Order', 'wp-photo-album-plus' ) .
2727
+ ( $order == 'a_order' ? $useimg : '' ) . '
 
2728
  </td>
2729
  <td
2730
+ style="width: 120px;cursor:pointer;"
2731
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'a_parent' ) . '\'"
2732
+ >' .
2733
+ __( 'Parent', 'wp-photo-album-plus' ) .
2734
+ ( $order == 'a_parent' ? $useimg : '' ) . '
 
2735
  </td>
2736
  <td
2737
  title="' . esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) . '"
2765
  if ( $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_albums WHERE a_parent = '-1'" ) > 0 ) {
2766
  $result = '
2767
  <tr>
2768
+ <td colspan="' . ( '20' + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) . '" >
2769
  <em>' .
2770
  __( 'The following albums are ---separate--- and do not show up in the generic album display', 'wp-photo-album-plus' ) . '
2771
  </em>
2789
  <tfoot>' .
2790
  $thead_body . '
2791
  </tfoot>
2792
+ </table>';
 
2793
 
2794
+ // Display the album table footer
2795
  wppa_echo( $result );
2796
 
2797
+ // Display the pagination
2798
+ wppa_admin_pagination( $pagesize, $page, $total, $reload_url, 'bottom' );
2799
 
2800
+ // Display the footer
2801
+ wppa_echo( wppa_album_admin_footer() );
 
 
 
 
 
 
 
 
 
 
 
2802
 
 
2803
  }
2804
  else {
2805
+ wppa_echo( '</div>' ); // Close action contatiner
2806
  wppa_echo( '<h2>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</h2>' );
2807
  }
2808
  }
2809
 
2810
  // The adnin Search field
2811
  function wppa_search_edit( $collapsible = false ) {
2812
+ global $plugin_page;
2813
 
2814
  $doit = false;
2815
  if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
2819
 
2820
  $value = wppa_get( 'searchstring' );
2821
 
2822
+ $result = '';
2823
+
2824
+ if ( $plugin_page == 'wppa_options' ) {
2825
+ $result = '
2826
+ <tr>
2827
+ <td colspan="' . ( ( $collapsible ? '20' : '14' ) + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) . '" >
2828
+ <em>' .
2829
+ __( 'Search for photos to edit', 'wp-photo-album-plus' ) . '
2830
+ </em>
2831
+ <small>' .
2832
+ __( 'Enter search words seperated by commas. Photos will meet all search words by their names, descriptions, translated keywords and/or tags.', 'wp-photo-album-plus' ) . '
2833
+ </small>
2834
+ </td>
2835
+ </tr>';
2836
+ }
2837
+
2838
+ $result .= '
2839
  <tr class="alternate" >' .
2840
  ( $collapsible ? '<td></td>' : '' ) . '
2841
  <td id="src-alb" >' .
2895
  <tr>' .
2896
  ( $collapsible ? '<td></td>' : '' ) . '
2897
  <td>' . __( 'Any', 'wp-photo-album-plus' ) . '</td>' .
2898
+ ( $collapsible ? '<td colspan="5">' : '' ) . '
2899
  <td colspan="4" >' .
2900
  sprintf( __( 'There are %s trashed photos that can be rescued', 'wp-photo-album-plus' ), $trashed ) . '
2901
  </td>
2902
+ <td colspan="2">
2903
  </td>
 
2904
  <td>
2905
  <a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '\' );">
2906
  <span style="font-weight:bold">' . __( 'Edit', 'wp-photo-album-plus' ) . '</span>
2925
  return $result;
2926
  }
2927
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2928
  // The albumlist
2929
  function wppa_do_albumlist( $parent, $nestinglevel, $albums, $seq ) {
2930
  global $wpdb;
3001
  style="height:16px;display:none"
3002
  src="' . wppa_get_imgdir() . 'backarrow.gif' . '"
3003
  onclick="' . $onclickoff . '"
3004
+ title="' . esc_attr( __( 'Collapse sub albums', 'wp-photo-album-plus' ) ) . '"
3005
  />
3006
  <img
3007
  id="alb-arrow-on-' . $id . '"
3009
  style="height:16px;"
3010
  src="' . wppa_get_imgdir() . 'arrow.gif' . '"
3011
  onclick="' . $onclickon . '"
3012
+ title="' . esc_attr( __( 'Expand sub albums', 'wp-photo-album-plus' ) ) . '"
3013
  />';
3014
 
3015
+ // Open sub albums by clicking the open button if it was before (cookie), and if it is visible (!)
3016
  if ( wppa_get_cookie( 'alb-arrow-' . $id ) == 'on' ) {
3017
  $the_js = '
3018
  jQuery(document).ready(function(){
3023
  wppa_setCookie("alb-arrow-'.$id.'","off",365);
3024
  }
3025
  });';
3026
+ wppa_add_inline_script( 'wppa-admin', $the_js, true );
3027
  }
3028
  }
3029
 
3048
  $nm = $counts['pendselfphotos'];
3049
  $ns = $counts['scheduledselfphotos'];
3050
 
3051
+ // The album name and description
3052
  $result .= '
3053
  <td>' . esc_html( stripslashes( $album['name'] ) ) . '</td>
3054
+ <td><small>' . esc_html( stripslashes( $album['description'] ) ) . '</small></td>';
3055
+
3056
+ // The owner. Make sure he exists
3057
+ if ( current_user_can( 'administrator' ) ) {
3058
+ $album_owner = $album['owner'];
3059
+ if ( $album_owner == '--- public ---' || get_user_by( 'login', $album_owner ) ) {
3060
+ $result .= '
3061
+ <td>' . $album_owner . '</td>';
3062
+ }
3063
+ else {
3064
+ $result .= '
3065
+ <td>' . __( '--- unknown ---', 'wp-photo-album-plus' ) . '</td>';
3066
+ }
3067
+ }
3068
+
3069
+ // Order
3070
+ $result .= '
3071
  <td>' . $album['a_order'] . '</td>
3072
  <td>' . esc_html( stripslashes( wppa_get_album_name( $album['a_parent'], ['extended' => true] ) ) ) . '</td>
3073
  <td>' . $na . '/' . $np . '/' . $nm . '/' . $ns . '</td>';
3111
  }
3112
  if ( wppa_can_create_album() ) {
3113
  $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $id . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
3114
+ $onc = 'if (confirm(\''.__( 'Are you sure you want to create a sub album?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
3115
  $result .= '<td><a onclick="' . $onc . '" class="wppacreate">' . __( 'Create', 'wp-photo-album-plus' ) . '</a></td>';
3116
  }
3117
  }
3133
  }
3134
  }
3135
 
3136
+ // Find accessable sub albums
3137
  function wppa_have_accessible_children( $alb ) {
3138
  global $wpdb;
3139
 
3197
  wppa_clear_cache( array( 'album' => $id ) );
3198
  wppa_childlist_remove( $id );
3199
 
3200
+ $msg = __( 'Album deleted.' , 'wp-photo-album-plus' );
3201
  if ( wppa( 'ajax' ) ) {
3202
  wppa_echo( $msg );
3203
  }
3222
  $opts = array( __( '--- random ---', 'wp-photo-album-plus' ),
3223
  __( '--- random featured ---', 'wp-photo-album-plus' ),
3224
  __( '--- most recent added ---', 'wp-photo-album-plus' ),
3225
+ __( '--- random from (sub-)sub albums ---', 'wp-photo-album-plus' ),
3226
+ __( '--- most recent from (sub-)sub albums ---', 'wp-photo-album-plus' ),
3227
  __( '--- according to albums photo sequence ---', 'wp-photo-album-plus' ),
3228
  );
3229
  $vals = array( '-9', '-1', '-2', '-3', '-4', '-5' );
3349
  }
3350
  }
3351
 
3352
+ // Sub album order
3353
  if ( $parent ) {
3354
 
3355
  $sel = ' selected';
3379
  <div style="margin-left:6px">
3380
  <label
3381
  for="subalbumorder">' .
3382
+ __( 'Sub album sequence method', 'wp-photo-album-plus' ) . '
3383
  </label><br>
3384
  <select
3385
  id="subalbumorder"
3415
  else {
3416
  $result = '
3417
  <br>' .
3418
+ esc_html__( 'You can edit sub album sequence number here when you set the album sequence to "Sequence #" or "Sequence # descending" in the "Sub album sequence method" selection box above.' );
3419
  }
3420
  $result .= '<br>';
3421
 
3508
  var wppaAjaxInProgress = 0;
3509
 
3510
  function wppaDoRenumber() {
 
 
3511
  if ( wppaAjaxInProgress > 0 ) {
3512
  wppaRenumberPending = true;
3513
  }
 
 
3514
  else {
3515
  _wppaDoRenumber();
3516
  }
3605
  }
3606
  }
3607
  }
3608
+ };
3609
  xmlhttp.open( "POST",wppaAjaxUrl,true );
3610
  xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" );
3611
  xmlhttp.send( data );
3612
  wppaAjaxInProgress++;
3613
 
3614
+ jQuery( "#wppa-sort-seqn-albums-" + album ).prop( "value", seqno );
3615
  var spinnerhtml = "<img src=\'" + wppaImageDirectory + "spinner.gif\' />";
3616
  jQuery( "#wppa-album-seqno-" + album ).html( spinnerhtml );
3617
  }';
3618
 
3619
+ wppa_add_inline_script( 'wppa-admin', $the_js, true );
3620
 
3621
  $result = '
3622
  <br>
3759
 
3760
  $result = '
3761
  <div class="wrap" >
3762
+ <h1 class="wp-heading-inline">' .
3763
+ get_admin_page_title() . '
3764
+ </h1>
3765
  <div style="clear:both">&nbsp;</div>
3766
+ <h3>' .
3767
+ esc_html__( 'Search for photos to edit', 'wp-photo-album-plus' ) . '
3768
+ </h3>' .
3769
+ esc_html__( 'Enter search words seperated by commas. Photos will meet all search words by their names, descriptions, translated keywords and/or tags.', 'wp-photo-album-plus' ) . '
3770
+ <br>
3771
  <table class="wppa-table widefat wppa-setting-table" style="margin-top:12px">
3772
  <thead>
3773
  </thead>
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.05.001
7
  *
8
  */
9
 
@@ -891,8 +891,10 @@ global $wpdb;
891
  return;
892
  }
893
 
894
- if ( wppa_has_audio( $image['id'] ) ) {
895
- $src = wppa_fix_poster_ext( $src, $image['id'] );
 
 
896
  }
897
 
898
  if ( $is_grid ) {
@@ -911,8 +913,8 @@ global $wpdb;
911
  }
912
 
913
  // Find the posterurl if mm and exists
914
- $thumburl = wppa_get_thumb_url( $image['id'] );
915
- if ( wppa_is_file( wppa_get_thumb_path( $image['id'] ) ) && wppa_is_multi( $image['id'] ) ) {
916
  $posterurl = $thumburl;
917
  }
918
  else {
@@ -977,173 +979,186 @@ global $wpdb;
977
  $photoframestyle .
978
  ' >' );
979
 
980
- // The link from the coverphoto
981
- if ( $photolink ) {
982
 
983
- // If lightbox, we need all the album photos to set up a lightbox set
984
- if ( $photolink['is_lightbox'] ) {
985
- $thumbs = $wpdb->get_results( $wpdb->prepare(
986
- "SELECT * FROM $wpdb->wppa_photos WHERE album = %s " .
987
- wppa_get_photo_order( $albumid ), $albumid
988
- ), ARRAY_A );
989
 
990
- wppa_cache_photo( 'add', $thumbs ); // Save rsult in 2nd level cache
991
 
992
- if ( $thumbs ) foreach ( $thumbs as $thumb ) {
993
- $id = $thumb['id'];
994
- $title = wppa_get_lbtitle( 'cover', $id );
995
- if ( wppa_is_video( $id ) ) {
996
- $siz['0'] = wppa_get_videox( $id );
997
- $siz['1'] = wppa_get_videoy( $id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
998
  }
 
 
999
  else {
1000
- $siz['0'] = wppa_get_photox( $id );
1001
- $siz['1'] = wppa_get_photoy( $id );
1002
- }
1003
- $link = wppa_get_photo_url( $id, true, '', $siz['0'], $siz['1'] );
1004
- $is_video = wppa_is_video( $id );
1005
- $has_audio = wppa_has_audio( $id );
1006
- $is_pdf = wppa_is_pdf( $id );
1007
-
1008
- // Open the anchor tag for lightbox
1009
- wppa_out( "\n\t" .
1010
- '<a' .
1011
- ' data-id="' . wppa_encrypt_photo( $id ) . '"' .
1012
- ' href="' . $link . '"' .
1013
- ' style="border:0;color:transparent;"' .
1014
- ( $is_video ? ' data-videohtml="' . esc_attr( wppa_get_video_body( $id ) ) . '"' .
1015
- ' data-videonatwidth="'.wppa_get_videox( $id ).'"' .
1016
- ' data-videonatheight="'.wppa_get_videoy( $id ).'"' : '' ) .
1017
- ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
1018
- ( $is_pdf ? ' data-pdfhtml="' . esc_attr( wppa_get_pdf_html( $id ) ) .'"' : '' ) .
1019
- ' data-rel="wppa[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
1020
- ' ' . 'data-lbtitle' . '="' . $title . '"' .
1021
- wppa_get_lb_panorama_full_html( $id ) .
1022
- ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
1023
- ' style="cursor:' . wppa_wait() . ';"' .
1024
- ' onclick="return false;"' .
1025
- ' >' );
1026
-
1027
- // the cover image
1028
- if ( $id == $image['id'] ) {
1029
- if ( wppa_is_video( $image['id'] ) ) {
1030
  wppa_out(
1031
- '<video preload="metadata" class="image wppa-img" id="i-' . $image['id'] . '-' .
1032
- wppa( 'mocc' ) . '" title="' . wppa_zoom_in( $image['id'] ) .
1033
- '" style="' . $imgattr . '" ' .
1034
- $events . ' >' .
1035
- wppa_get_video_body( $image['id'] ) . '</video>'
 
 
 
 
 
1036
  );
1037
  }
 
 
1038
  else {
1039
  wppa_out(
1040
- '<img class="image wppa-img" id="i-' . $image['id'] . '-' .
1041
- wppa( 'mocc' ) . '" title="' . wppa_zoom_in( $image['id'] ) .
1042
- '" src="' . $src . '" style="' . $imgattr . '" ' .
1043
- $events . ' ' . wppa_get_imgalt( $image['id'] ) . ' />'
 
 
 
1044
  );
1045
  }
 
1046
  }
1047
-
1048
- // Close the lightbox anchor tag
1049
- wppa_out( "\n\t" . '</a>' );
1050
  }
1051
- }
1052
 
1053
- // Link is NOT lightbox
1054
- else {
1055
- $href = $photolink['url'] == '#' ? '' : 'href="' . wppa_convert_to_pretty( $photolink['url'] ) . '" ';
1056
- wppa_out( '<a' .
1057
- ' style="border:0;color:transparent;"' .
1058
- ' ' . $href .
1059
- ' target="' . $photolink['target'] . '"' .
1060
- ' title="' . $photolink['title'] . '"' .
1061
- ' onclick="' . $photolink['onclick'] . '"' .
1062
- ' >'
1063
- );
1064
 
1065
- // A video?
1066
- if ( wppa_is_video( $image['id'] ) ) {
1067
- wppa_out(
1068
- '<video' .
1069
- ' preload="metadata"' .
1070
- ' title="' . $title . '"' .
1071
- ' class="image wppa-img"' .
1072
- ' style="' . $imgattr . '"' .
1073
- ' ' . $events .
1074
- ' ' . ( $posterurl ? 'poster="' . esc_url( $posterurl ) . '"' : '' ) .
1075
- ' >' .
1076
- wppa_get_video_body( $image['id'] ) .
1077
- '</video>'
1078
- );
1079
- }
1080
 
1081
- // A photo
1082
- else {
1083
- wppa_out(
1084
- '<img' .
1085
- ' src="' . $src . '"' .
1086
- ' ' . wppa_get_imgalt( $image['id'] ) .
1087
- ' class="image wppa-img"' .
1088
- ' style="' . $imgattr . '"' .
1089
- ' ' . $events .
1090
- ' />'
1091
- );
 
1092
  }
1093
- wppa_out( '</a>' );
1094
- }
1095
- }
1096
 
1097
- // No link on coverphoto
1098
- else {
1099
 
1100
- // A video?
1101
- if ( wppa_is_video( $image['id'] ) ) {
1102
- wppa_out(
1103
- '<video' .
1104
- ' preload="metadata"' .
1105
- ' class="image wppa-img"' .
1106
- ' style="' . $imgattr . '"' .
1107
- ' ' . $events .
1108
- ' ' . ( $posterurl ? 'poster="' . esc_url( $posterurl ) . '"' : '' ) .
1109
- ' >' .
1110
- wppa_get_video_body( $image['id'] ) .
1111
- '</video>'
1112
- );
1113
- }
1114
-
1115
- // A photo
1116
- else {
1117
- wppa_out(
1118
- '<img' .
1119
- ' src="' . $src . '"' .
1120
- ' ' . wppa_get_imgalt( $image['id'] ) .
1121
- ' class="image wppa-img"' .
1122
- ' style="' . $imgattr . '"' .
1123
- ' ' . $events .
1124
- ' />'
1125
- );
1126
- }
1127
- }
1128
 
1129
- // Viewcount on coverphoto?
1130
- if ( wppa_opt( 'viewcount_on_cover' ) != '-none-' ) {
1131
- $treecounts = wppa_get_treecounts_a( $albumid, true );
1132
- if ( wppa_opt( 'viewcount_on_cover' ) == 'self' || $treecounts['selfphotoviews'] == $treecounts['treephotoviews'] ) {
1133
- $count = $treecounts['selfphotoviews'];
1134
- $title = __( 'Number of photo views in this album', 'wp-photo-album-plus' );
1135
- }
1136
- else {
1137
- $count = $treecounts['treephotoviews'];
1138
- $title = __( 'Number of photo views in this album and its subalbums', 'wp-photo-album-plus' );
 
 
 
 
 
 
 
1139
  }
1140
- wppa_out( '<div
1141
- class="wppa-album-cover-viewcount"
1142
- title="' . esc_attr( $title ) . '"
1143
- style="cursor:pointer">' .
1144
- __( 'Views:', 'wp-photo-album-plus' ) . ' ' . $count .
1145
- '</div>' );
1146
- }
1147
 
1148
  // Close the coverphoto frame
1149
  wppa_out( '</div>' );
@@ -1173,9 +1188,10 @@ global $wpdb;
1173
 
1174
  $image = $images[$idx];
1175
  $src = $srcs[$idx];
 
1176
 
1177
- if ( wppa_has_audio( $image['id'] ) ) {
1178
- $src = wppa_fix_poster_ext( $src, $image['id'] );
1179
  }
1180
 
1181
  $imgattr = $imgattrs_a[$idx]['style'];
@@ -1196,145 +1212,161 @@ global $wpdb;
1196
  $imgattr = 'width:' . $width . '%;height:auto;box-sizing:content-box;';
1197
  }
1198
 
1199
- if ( $photolink ) {
1200
- if ( $photolink['is_lightbox'] ) {
1201
- $thumb = $image;
1202
- $title = wppa_get_lbtitle( 'cover', $thumb['id'] );
1203
- if ( wppa_is_video( $thumb['id'] ) ) {
1204
- $siz['0'] = wppa_get_videox( $thumb['id'] );
1205
- $siz['1'] = wppa_get_videoy( $thumb['id'] );
1206
- }
1207
- else {
1208
- $siz['0'] = wppa_get_photox( $thumb['id'] );
1209
- $siz['1'] = wppa_get_photoy( $thumb['id'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1210
  }
1211
 
1212
- $link = wppa_get_photo_url( $thumb['id'], true, '', $siz['0'], $siz['1'] );
1213
- $is_video = wppa_is_video( $thumb['id'] );
1214
- $has_audio = wppa_has_audio( $thumb['id'] );
1215
- $is_pdf = wppa_is_pdf( $thumb['id'] );
1216
 
1217
- wppa_out(
1218
- '<a' .
1219
- ' data-id="' . wppa_encrypt_photo( $thumb['id'] ) . '"' .
1220
- ' href="' . $link . '"' .
1221
- ' style="border:0;color:transparent;cursor:wait;"' .
1222
- ( $is_video ? ' data-videohtml="' . esc_attr( wppa_get_video_body( $thumb['id'] ) ) . '"' .
1223
- ' data-videonatwidth="' . wppa_get_videox( $thumb['id'] ) . '"' .
1224
- ' data-videonatheight="' . wppa_get_videoy( $thumb['id'] ) . '"' : '' ) .
1225
- ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $thumb['id'] ) ) . '"' : '' ) .
1226
- ( $is_pdf ? ' data-pdfhtml="' . esc_attr( wppa_get_pdf_html( $thumb['id'] ) ) .'"' : '' ) .
1227
- ' data-rel="wppa[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
1228
- ( $title ? ' ' . 'data-lbtitle' . '="' . $title . '"' : '' ) .
1229
- wppa_get_lb_panorama_full_html( $thumb['id'] ) .
1230
- ' data-alt="' . esc_attr( wppa_get_imgalt( $thumb['id'], true ) ) . '"' .
1231
- ' >'
1232
- );
1233
 
1234
- // the cover image
1235
- if ( $thumb['id'] == $image['id'] ) {
1236
- if ( wppa_is_video( $image['id'] ) ) {
1237
- wppa_out( "\n\t\t" .
1238
  '<video' .
1239
- ' preload="metadata"' .
1240
  ' class="image wppa-img"' .
1241
- ' id="i-' . $image['id'] . '-' . wppa( 'mocc' ) . '"' .
1242
- ' title="' . wppa_zoom_in( $image['id'] ) . '"' .
1243
  ' style="' . $imgattr . '"' .
1244
  ' ' . $events .
1245
  ' >' .
1246
- wppa_get_video_body( $image['id'] ) .
1247
  '</video>'
1248
  );
1249
  }
1250
  else {
1251
- wppa_out( "\n\t\t" .
 
1252
  '<img' .
1253
- ' class="image wppa-img"' .
1254
- ' id="i-' . $image['id'] . '-' . wppa( 'mocc' ) . '"' .
1255
- ' title="' . wppa_zoom_in( $image['id'] ) . '"' .
1256
  ' src="' . $src . '"' .
 
 
1257
  ' style="' . $imgattr . '"' .
1258
  ' ' . $events .
1259
- ' ' . wppa_get_imgalt( $image['id'] ) .
1260
  ' />'
1261
  );
1262
  }
 
1263
  }
1264
- wppa_out( '</a> ' );
1265
  }
1266
 
1267
- else { // Link is NOT lightbox
1268
- $href = $photolink['url'] == '#' ? '' : 'href="' . $photolink['url'] . '" ';
1269
-
1270
- wppa_out(
1271
- '<a ' .
1272
- $href .
1273
- ' style="border:0;color:transparent;"' .
1274
- ' target="' . $photolink['target'] . '"' .
1275
- ' title="' . $photolink['title'] . '"' .
1276
- ' onclick="' . $photolink['onclick'] . '"' .
1277
- ' >' );
1278
-
1279
- if ( wppa_is_video( $image['id'] ) ) {
1280
 
1281
- wppa_out(
1282
- '<video' .
1283
- ' preload="metadata" ' .
1284
- ' class="image wppa-img"' .
1285
- ' style="' . $imgattr . '"' .
1286
- ' ' . $events .
1287
- ' >' .
1288
- wppa_get_video_body( $image['id'] ) .
1289
- '</video>'
 
1290
  );
1291
  }
1292
- else {
1293
 
1294
- wppa_out(
1295
- '<img' .
1296
- ' src="' . $src . '"' .
1297
- ' ' . wppa_get_imgalt( $image['id'] ) .
1298
- ' class="image wppa-img"' .
1299
- ' style="' . $imgattr . '"' .
1300
- ' ' . $events .
1301
- ' />'
 
1302
  );
1303
  }
1304
- wppa_out( '</a> ' );
1305
  }
1306
- }
1307
 
1308
- // No link on coverphoto
1309
- else {
1310
 
1311
- // A video?
1312
- if ( wppa_is_video( $image['id'] ) ) {
1313
- wppa_out( '<video' .
1314
- ' preload="metadata"' .
1315
- ' class="image wppa-img"' .
1316
- ' style="' . $imgattr . '"' .
1317
- ' ' . $events .
1318
- ' >' .
1319
- wppa_get_video_body( $image['id'] ) .
1320
- '</video>'
1321
- );
1322
- }
1323
 
1324
- // A photo
1325
- else {
1326
- wppa_out( '<img' .
1327
- ' src="' . $src . '"' .
1328
- ' ' . wppa_get_imgalt( $image['id'] ) .
1329
- ' class="image wppa-img"' .
1330
- ' style="' . $imgattr . '"' .
1331
- ' ' . $events .
1332
- ' />'
1333
- );
1334
- }
1335
- }
1336
  }
1337
 
 
 
1338
  // Close the coverphoto frame
1339
  wppa_out( '</div>' );
1340
  }
@@ -2000,7 +2032,7 @@ global $wpdb;
2000
 
2001
  /**/
2002
 
2003
- // Only if there are subalbums
2004
  if ( ! empty( $subs ) ) {
2005
 
2006
  wppa_out( '<div class="wppa-cover-sublist-container" >' );
@@ -2023,13 +2055,13 @@ global $wpdb;
2023
  wppa_out( '<div style="clear:both"></div>' );
2024
  }
2025
 
2026
- // Process the subalbums
2027
  foreach( $subs as $album ) {
2028
 
2029
  // The album id
2030
  $albumid = $album['id'];
2031
 
2032
- // This subalbum visible for this user?
2033
  if ( wppa_is_album_visible( $albumid ) ) {
2034
 
2035
  // What is in there visible?
@@ -2048,7 +2080,7 @@ global $wpdb;
2048
  $albumid = $album['id'];
2049
  $photocount = $pc;
2050
 
2051
- // Thumbnails and covers, show subalbum covers
2052
  // in case slideshow is requested on an empty album
2053
  if ( wppa_opt( 'cover_sublinks' ) == 'content' || ! $photocount ) {
2054
  $href_content = wppa_get_album_url( array( 'album' => $albumid,
@@ -2073,7 +2105,7 @@ global $wpdb;
2073
  $title = esc_attr( __( 'View the album', 'wp-photo-album-plus' ) . ': ' . wppa_get_album_name( $albumid ) );
2074
  }
2075
 
2076
- // Subalbum title link
2077
  elseif ( wppa_opt( 'cover_sublinks' ) == 'title' ) {
2078
  $sub_attr = wppa_get_album_title_attr_a( $albumid,
2079
  $album['cover_linktype'],
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
891
  return;
892
  }
893
 
894
+ $id = $image['id'];
895
+
896
+ if ( wppa_has_audio( $id ) ) {
897
+ $src = wppa_fix_poster_ext( $src, $id );
898
  }
899
 
900
  if ( $is_grid ) {
913
  }
914
 
915
  // Find the posterurl if mm and exists
916
+ $thumburl = wppa_get_thumb_url( $id );
917
+ if ( wppa_is_file( wppa_get_thumb_path( $id ) ) && wppa_is_multi( $id ) ) {
918
  $posterurl = $thumburl;
919
  }
920
  else {
979
  $photoframestyle .
980
  ' >' );
981
 
982
+ // The indiv thumbnail wrapper
983
+ wppa_out( '<div style="display:inline-block;margin:0 4px;">' );
984
 
985
+ // The medal if at the top
986
+ wppa_out( wppa_get_medal_html_a( array( 'id' => $id, 'size' => wppa_opt( 'icon_size_multimedia' ), 'where' => 'top', 'thumb' => true ) ) );
 
 
 
 
987
 
 
988
 
989
+ // The link from the coverphoto
990
+ if ( $photolink ) {
991
+
992
+ // If lightbox, we need all the album photos to set up a lightbox set
993
+ if ( $photolink['is_lightbox'] ) {
994
+ $thumbs = $wpdb->get_results( $wpdb->prepare(
995
+ "SELECT * FROM $wpdb->wppa_photos WHERE album = %s " .
996
+ wppa_get_photo_order( $albumid ), $albumid
997
+ ), ARRAY_A );
998
+
999
+ wppa_cache_photo( 'add', $thumbs ); // Save rsult in 2nd level cache
1000
+
1001
+ if ( $thumbs ) foreach ( $thumbs as $thumb ) {
1002
+ $id = $thumb['id'];
1003
+ $title = wppa_get_lbtitle( 'cover', $id );
1004
+ if ( wppa_is_video( $id ) ) {
1005
+ $siz['0'] = wppa_get_videox( $id );
1006
+ $siz['1'] = wppa_get_videoy( $id );
1007
+ }
1008
+ else {
1009
+ $siz['0'] = wppa_get_photox( $id );
1010
+ $siz['1'] = wppa_get_photoy( $id );
1011
+ }
1012
+ $link = wppa_get_photo_url( $id, true, '', $siz['0'], $siz['1'] );
1013
+ $is_video = wppa_is_video( $id );
1014
+ $has_audio = wppa_has_audio( $id );
1015
+ $is_pdf = wppa_is_pdf( $id );
1016
+
1017
+ // Open the anchor tag for lightbox
1018
+ wppa_out( "\n\t" .
1019
+ '<a' .
1020
+ ' data-id="' . wppa_encrypt_photo( $id ) . '"' .
1021
+ ' href="' . $link . '"' .
1022
+ ' style="border:0;color:transparent;"' .
1023
+ ( $is_video ? ' data-videohtml="' . esc_attr( wppa_get_video_body( $id ) ) . '"' .
1024
+ ' data-videonatwidth="'.wppa_get_videox( $id ).'"' .
1025
+ ' data-videonatheight="'.wppa_get_videoy( $id ).'"' : '' ) .
1026
+ ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
1027
+ ( $is_pdf ? ' data-pdfhtml="' . esc_attr( wppa_get_pdf_html( $id ) ) .'"' : '' ) .
1028
+ ' data-rel="wppa[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
1029
+ ' ' . 'data-lbtitle' . '="' . $title . '"' .
1030
+ wppa_get_lb_panorama_full_html( $id ) .
1031
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
1032
+ ' style="cursor:' . wppa_wait() . ';"' .
1033
+ ' onclick="return false;"' .
1034
+ ' >' );
1035
+
1036
+ // the cover image
1037
+ if ( $id == $id ) {
1038
+ if ( wppa_is_video( $id ) ) {
1039
+ wppa_out(
1040
+ '<video preload="metadata" class="image wppa-img" id="i-' . $id . '-' .
1041
+ wppa( 'mocc' ) . '" title="' . wppa_zoom_in( $id ) .
1042
+ '" style="' . $imgattr . '" ' .
1043
+ $events . ' >' .
1044
+ wppa_get_video_body( $id ) . '</video>'
1045
+ );
1046
+ }
1047
+ else {
1048
+ wppa_out(
1049
+ '<img class="image wppa-img" id="i-' . $id . '-' .
1050
+ wppa( 'mocc' ) . '" title="' . wppa_zoom_in( $id ) .
1051
+ '" src="' . $src . '" style="' . $imgattr . '" ' .
1052
+ $events . ' ' . wppa_get_imgalt( $id ) . ' />'
1053
+ );
1054
+ }
1055
+ }
1056
+
1057
+ // Close the lightbox anchor tag
1058
+ wppa_out( "\n\t" . '</a>' );
1059
+ }
1060
  }
1061
+
1062
+ // Link is NOT lightbox
1063
  else {
1064
+ $href = $photolink['url'] == '#' ? '' : 'href="' . wppa_convert_to_pretty( $photolink['url'] ) . '" ';
1065
+ wppa_out( '<a' .
1066
+ ' style="border:0;color:transparent;"' .
1067
+ ' ' . $href .
1068
+ ' target="' . $photolink['target'] . '"' .
1069
+ ' title="' . $photolink['title'] . '"' .
1070
+ ' onclick="' . $photolink['onclick'] . '"' .
1071
+ ' >'
1072
+ );
1073
+
1074
+ // A video?
1075
+ if ( wppa_is_video( $id ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1076
  wppa_out(
1077
+ '<video' .
1078
+ ' preload="metadata"' .
1079
+ ' title="' . $title . '"' .
1080
+ ' class="image wppa-img"' .
1081
+ ' style="' . $imgattr . '"' .
1082
+ ' ' . $events .
1083
+ ' ' . ( $posterurl ? 'poster="' . esc_url( $posterurl ) . '"' : '' ) .
1084
+ ' >' .
1085
+ wppa_get_video_body( $id ) .
1086
+ '</video>'
1087
  );
1088
  }
1089
+
1090
+ // A photo
1091
  else {
1092
  wppa_out(
1093
+ '<img' .
1094
+ ' src="' . $src . '"' .
1095
+ ' ' . wppa_get_imgalt( $id ) .
1096
+ ' class="image wppa-img"' .
1097
+ ' style="' . $imgattr . '"' .
1098
+ ' ' . $events .
1099
+ ' />'
1100
  );
1101
  }
1102
+ wppa_out( '</a>' );
1103
  }
 
 
 
1104
  }
 
1105
 
1106
+ // No link on coverphoto
1107
+ else {
 
 
 
 
 
 
 
 
 
1108
 
1109
+ // A video?
1110
+ if ( wppa_is_video( $id ) ) {
1111
+ wppa_out(
1112
+ '<video' .
1113
+ ' preload="metadata"' .
1114
+ ' class="image wppa-img"' .
1115
+ ' style="' . $imgattr . '"' .
1116
+ ' ' . $events .
1117
+ ' ' . ( $posterurl ? 'poster="' . esc_url( $posterurl ) . '"' : '' ) .
1118
+ ' >' .
1119
+ wppa_get_video_body( $id ) .
1120
+ '</video>'
1121
+ );
1122
+ }
 
1123
 
1124
+ // A photo
1125
+ else {
1126
+ wppa_out(
1127
+ '<img' .
1128
+ ' src="' . $src . '"' .
1129
+ ' ' . wppa_get_imgalt( $id ) .
1130
+ ' class="image wppa-img"' .
1131
+ ' style="' . $imgattr . '"' .
1132
+ ' ' . $events .
1133
+ ' />'
1134
+ );
1135
+ }
1136
  }
 
 
 
1137
 
1138
+ // The medals if near the bottom
1139
+ wppa_out( wppa_get_medal_html_a( array( 'id' => $id, 'size' => wppa_opt( 'icon_size_multimedia' ), 'where' => 'bot', 'thumb' => true ) ) );
1140
 
1141
+ // Close the indiv wrapper
1142
+ wppa_out( '</div>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1143
 
1144
+ // Viewcount on coverphoto?
1145
+ if ( wppa_opt( 'viewcount_on_cover' ) != '-none-' ) {
1146
+ $treecounts = wppa_get_treecounts_a( $albumid, true );
1147
+ if ( wppa_opt( 'viewcount_on_cover' ) == 'self' || $treecounts['selfphotoviews'] == $treecounts['treephotoviews'] ) {
1148
+ $count = $treecounts['selfphotoviews'];
1149
+ $title = __( 'Number of photo views in this album', 'wp-photo-album-plus' );
1150
+ }
1151
+ else {
1152
+ $count = $treecounts['treephotoviews'];
1153
+ $title = __( 'Number of photo views in this album and its sub albums', 'wp-photo-album-plus' );
1154
+ }
1155
+ wppa_out( '<div
1156
+ class="wppa-album-cover-viewcount"
1157
+ title="' . esc_attr( $title ) . '"
1158
+ style="cursor:pointer">' .
1159
+ __( 'Views:', 'wp-photo-album-plus' ) . ' ' . $count .
1160
+ '</div>' );
1161
  }
 
 
 
 
 
 
 
1162
 
1163
  // Close the coverphoto frame
1164
  wppa_out( '</div>' );
1188
 
1189
  $image = $images[$idx];
1190
  $src = $srcs[$idx];
1191
+ $id = $image['id'];
1192
 
1193
+ if ( wppa_has_audio( $id ) ) {
1194
+ $src = wppa_fix_poster_ext( $src, $id );
1195
  }
1196
 
1197
  $imgattr = $imgattrs_a[$idx]['style'];
1212
  $imgattr = 'width:' . $width . '%;height:auto;box-sizing:content-box;';
1213
  }
1214
 
1215
+ // The indiv thumbnail wrapper
1216
+ wppa_out( '<div style="display:inline-block;margin:0 4px;">' );
1217
+
1218
+ // The medal if at the top
1219
+ wppa_out( wppa_get_medal_html_a( array( 'id' => $id, 'size' => wppa_opt( 'icon_size_multimedia' ), 'where' => 'top', 'thumb' => true ) ) );
1220
+
1221
+
1222
+ if ( $photolink ) {
1223
+ if ( $photolink['is_lightbox'] ) {
1224
+ $thumb = $image;
1225
+ $title = wppa_get_lbtitle( 'cover', $thumb['id'] );
1226
+ if ( wppa_is_video( $thumb['id'] ) ) {
1227
+ $siz['0'] = wppa_get_videox( $thumb['id'] );
1228
+ $siz['1'] = wppa_get_videoy( $thumb['id'] );
1229
+ }
1230
+ else {
1231
+ $siz['0'] = wppa_get_photox( $thumb['id'] );
1232
+ $siz['1'] = wppa_get_photoy( $thumb['id'] );
1233
+ }
1234
+
1235
+ $link = wppa_get_photo_url( $thumb['id'], true, '', $siz['0'], $siz['1'] );
1236
+ $is_video = wppa_is_video( $thumb['id'] );
1237
+ $has_audio = wppa_has_audio( $thumb['id'] );
1238
+ $is_pdf = wppa_is_pdf( $thumb['id'] );
1239
+
1240
+ wppa_out(
1241
+ '<a' .
1242
+ ' data-id="' . wppa_encrypt_photo( $thumb['id'] ) . '"' .
1243
+ ' href="' . $link . '"' .
1244
+ ' style="border:0;color:transparent;cursor:wait;"' .
1245
+ ( $is_video ? ' data-videohtml="' . esc_attr( wppa_get_video_body( $thumb['id'] ) ) . '"' .
1246
+ ' data-videonatwidth="' . wppa_get_videox( $thumb['id'] ) . '"' .
1247
+ ' data-videonatheight="' . wppa_get_videoy( $thumb['id'] ) . '"' : '' ) .
1248
+ ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $thumb['id'] ) ) . '"' : '' ) .
1249
+ ( $is_pdf ? ' data-pdfhtml="' . esc_attr( wppa_get_pdf_html( $thumb['id'] ) ) .'"' : '' ) .
1250
+ ' data-rel="wppa[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
1251
+ ( $title ? ' ' . 'data-lbtitle' . '="' . $title . '"' : '' ) .
1252
+ wppa_get_lb_panorama_full_html( $thumb['id'] ) .
1253
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $thumb['id'], true ) ) . '"' .
1254
+ ' >'
1255
+ );
1256
+
1257
+ // the cover image
1258
+ if ( $thumb['id'] == $id ) {
1259
+ if ( wppa_is_video( $id ) ) {
1260
+ wppa_out( "\n\t\t" .
1261
+ '<video' .
1262
+ ' preload="metadata"' .
1263
+ ' class="image wppa-img"' .
1264
+ ' id="i-' . $id . '-' . wppa( 'mocc' ) . '"' .
1265
+ ' title="' . wppa_zoom_in( $id ) . '"' .
1266
+ ' style="' . $imgattr . '"' .
1267
+ ' ' . $events .
1268
+ ' >' .
1269
+ wppa_get_video_body( $id ) .
1270
+ '</video>'
1271
+ );
1272
+ }
1273
+ else {
1274
+ wppa_out( "\n\t\t" .
1275
+ '<img' .
1276
+ ' class="image wppa-img"' .
1277
+ ' id="i-' . $id . '-' . wppa( 'mocc' ) . '"' .
1278
+ ' title="' . wppa_zoom_in( $id ) . '"' .
1279
+ ' src="' . $src . '"' .
1280
+ ' style="' . $imgattr . '"' .
1281
+ ' ' . $events .
1282
+ ' ' . wppa_get_imgalt( $id ) .
1283
+ ' />'
1284
+ );
1285
+ }
1286
+ }
1287
+ wppa_out( '</a> ' );
1288
  }
1289
 
1290
+ else { // Link is NOT lightbox
1291
+ $href = $photolink['url'] == '#' ? '' : 'href="' . $photolink['url'] . '" ';
 
 
1292
 
1293
+ wppa_out(
1294
+ '<a ' .
1295
+ $href .
1296
+ ' style="border:0;color:transparent;"' .
1297
+ ' target="' . $photolink['target'] . '"' .
1298
+ ' title="' . $photolink['title'] . '"' .
1299
+ ' onclick="' . $photolink['onclick'] . '"' .
1300
+ ' >' );
1301
+
1302
+ if ( wppa_is_video( $id ) ) {
 
 
 
 
 
 
1303
 
1304
+ wppa_out(
 
 
 
1305
  '<video' .
1306
+ ' preload="metadata" ' .
1307
  ' class="image wppa-img"' .
 
 
1308
  ' style="' . $imgattr . '"' .
1309
  ' ' . $events .
1310
  ' >' .
1311
+ wppa_get_video_body( $id ) .
1312
  '</video>'
1313
  );
1314
  }
1315
  else {
1316
+
1317
+ wppa_out(
1318
  '<img' .
 
 
 
1319
  ' src="' . $src . '"' .
1320
+ ' ' . wppa_get_imgalt( $id ) .
1321
+ ' class="image wppa-img"' .
1322
  ' style="' . $imgattr . '"' .
1323
  ' ' . $events .
 
1324
  ' />'
1325
  );
1326
  }
1327
+ wppa_out( '</a> ' );
1328
  }
 
1329
  }
1330
 
1331
+ // No link on coverphoto
1332
+ else {
 
 
 
 
 
 
 
 
 
 
 
1333
 
1334
+ // A video?
1335
+ if ( wppa_is_video( $id ) ) {
1336
+ wppa_out( '<video' .
1337
+ ' preload="metadata"' .
1338
+ ' class="image wppa-img"' .
1339
+ ' style="' . $imgattr . '"' .
1340
+ ' ' . $events .
1341
+ ' >' .
1342
+ wppa_get_video_body( $id ) .
1343
+ '</video>'
1344
  );
1345
  }
 
1346
 
1347
+ // A photo
1348
+ else {
1349
+ wppa_out( '<img' .
1350
+ ' src="' . $src . '"' .
1351
+ ' ' . wppa_get_imgalt( $id ) .
1352
+ ' class="image wppa-img"' .
1353
+ ' style="' . $imgattr . '"' .
1354
+ ' ' . $events .
1355
+ ' />'
1356
  );
1357
  }
 
1358
  }
 
1359
 
1360
+ // The medals if near the bottom
1361
+ wppa_out( wppa_get_medal_html_a( array( 'id' => $id, 'size' => wppa_opt( 'icon_size_multimedia' ), 'where' => 'bot', 'thumb' => true ) ) );
1362
 
1363
+ // Close the indiv wrapper
1364
+ wppa_out( '</div>' );
 
 
 
 
 
 
 
 
 
 
1365
 
 
 
 
 
 
 
 
 
 
 
 
 
1366
  }
1367
 
1368
+
1369
+
1370
  // Close the coverphoto frame
1371
  wppa_out( '</div>' );
1372
  }
2032
 
2033
  /**/
2034
 
2035
+ // Only if there are sub albums
2036
  if ( ! empty( $subs ) ) {
2037
 
2038
  wppa_out( '<div class="wppa-cover-sublist-container" >' );
2055
  wppa_out( '<div style="clear:both"></div>' );
2056
  }
2057
 
2058
+ // Process the sub albums
2059
  foreach( $subs as $album ) {
2060
 
2061
  // The album id
2062
  $albumid = $album['id'];
2063
 
2064
+ // This sub album visible for this user?
2065
  if ( wppa_is_album_visible( $albumid ) ) {
2066
 
2067
  // What is in there visible?
2080
  $albumid = $album['id'];
2081
  $photocount = $pc;
2082
 
2083
+ // Thumbnails and covers, show sub album covers
2084
  // in case slideshow is requested on an empty album
2085
  if ( wppa_opt( 'cover_sublinks' ) == 'content' || ! $photocount ) {
2086
  $href_content = wppa_get_album_url( array( 'album' => $albumid,
2105
  $title = esc_attr( __( 'View the album', 'wp-photo-album-plus' ) . ': ' . wppa_get_album_name( $albumid ) );
2106
  }
2107
 
2108
+ // Sub album title link
2109
  elseif ( wppa_opt( 'cover_sublinks' ) == 'title' ) {
2110
  $sub_attr = wppa_get_album_title_attr_a( $albumid,
2111
  $album['cover_linktype'],
wppa-album-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
- * Version 8.2.05.002
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -82,7 +82,7 @@ class AlbumWidget extends WP_Widget {
82
 
83
  $albums = wppa_strip_void_albums( $albums );
84
 
85
- // Add subalbums if required
86
  if ( $parent != 'all' && ! empty( $albums ) && $subs ) {
87
  $ids = '';
88
 
@@ -440,8 +440,8 @@ class AlbumWidget extends WP_Widget {
440
 
441
  wppa_widget_selection( $this, 'parent', $instance['parent'], __( 'Album selection or Parent album', 'wp-photo-album-plus' ), $options, $values, $disabled );
442
 
443
- // Include subalbums
444
- wppa_widget_checkbox( $this, 'subs', $instance['subs'], __( 'Include subalbums', 'wp-photo-album-plus' ) );
445
 
446
  // Show album name?
447
  wppa_widget_checkbox( $this, 'name', $instance['name'], __( 'Show album names', 'wp-photo-album-plus' ) );
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
+ * Version 8.3.01.001
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
82
 
83
  $albums = wppa_strip_void_albums( $albums );
84
 
85
+ // Add sub albums if required
86
  if ( $parent != 'all' && ! empty( $albums ) && $subs ) {
87
  $ids = '';
88
 
440
 
441
  wppa_widget_selection( $this, 'parent', $instance['parent'], __( 'Album selection or Parent album', 'wp-photo-album-plus' ), $options, $values, $disabled );
442
 
443
+ // Include sub albums
444
+ wppa_widget_checkbox( $this, 'subs', $instance['subs'], __( 'Include sub albums', 'wp-photo-album-plus' ) );
445
 
446
  // Show album name?
447
  wppa_widget_checkbox( $this, 'name', $instance['name'], __( 'Show album names', 'wp-photo-album-plus' ) );
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 8.2.08.006
7
  *
8
  */
9
 
@@ -49,7 +49,7 @@ function wppa_thumb_area( $action ) {
49
  $result .= '<div class="wppa-nicewrap" >';
50
  }
51
 
52
- // Display create subalbum and upload photo links conditionally
53
  if ( ! wppa_is_virtual() && wppa_opt( 'upload_link_thumbs' ) == 'top' ) {
54
 
55
  $alb = wppa( 'current_album' );
@@ -61,7 +61,7 @@ function wppa_thumb_area( $action ) {
61
  // Close thumbnail area box
62
  elseif ( $action == 'close' ) {
63
 
64
- // Display create subalbum and upload photo links conditionally
65
  if ( ! wppa_is_virtual() && wppa_opt( 'upload_link_thumbs' ) == 'bottom' ) {
66
 
67
  $alb = wppa( 'current_album' );
@@ -2500,7 +2500,7 @@ function wppa_get_user_create_html( $alb, $width, $where = '', $mcr = false ) {
2500
  return '';
2501
  }
2502
 
2503
- // Basic users are not allowed to create subalbums
2504
  if ( wppa_user_is_basic() ) {
2505
  return '';
2506
  }
@@ -2574,7 +2574,7 @@ function wppa_get_user_create_html( $alb, $width, $where = '', $mcr = false ) {
2574
  elseif ( $where == 'thumb' ) {
2575
  $returnurl .= 'wppa-album=' . $parent . '&amp;wppa-cover=0&amp;wppa-occur=' . $occur;
2576
  }
2577
- if ( wppa( 'page' ) ) $returnurl .= '&amp;wppa-page=' . wppa( 'page' );
2578
  $returnurl = trim( $returnurl, '?' );
2579
  $returnurl = wppa_trim_wppa_( $returnurl );
2580
  $t = $mcr ? 'mcr-' : '';
@@ -2592,7 +2592,7 @@ function wppa_get_user_create_html( $alb, $width, $where = '', $mcr = false ) {
2592
  jQuery( \'#_wppa-cr-'.$a.'-'.$mocc.'\' ).css( \'display\',\'block\' );
2593
  window.dispatchEvent(new Event(\'resize\'))"
2594
  style="float:left;cursor:pointer"> ' .
2595
- ( $alb ? __( 'Create Subalbum', 'wp-photo-album-plus' ) : __( 'Create Album', 'wp-photo-album-plus' ) ) . '
2596
  </a>
2597
  <a id="_wppa-cr-' . $a . '-' . $mocc . '" class="wppa-create-' . $where . ' wppa-album-cover-link" onclick="
2598
  jQuery( \'#wppa-create-'.$t.$a.'-'.$mocc.'\' ).css( \'display\',\'none\' );
@@ -2765,7 +2765,7 @@ static $albums_granted;
2765
  if ( ! in_array( $xalb, (array) $albums_granted, true ) ) {
2766
 
2767
  // This function will check if $xalb is a grant parent,
2768
- // and make my subalbum if it does not already exist.
2769
  $ta = wppa_grant_albums( $xalb );
2770
  if ( ! empty( $ta ) ) {
2771
  $albums_created = array_merge( $albums_created, $ta );
@@ -2955,7 +2955,7 @@ static $albums_granted;
2955
  window.dispatchEvent(new Event(\'resize\'));
2956
  " style="float:left; cursor:pointer"
2957
  >' .
2958
- __( 'Upload Photo', 'wp-photo-album-plus' ) . '
2959
  </a>
2960
  <a id="_wppa-up-' . $a . '-' . $mocc . '" class="wppa-upload-'.$where.' wppa-album-cover-link" onclick="
2961
  jQuery( \'#wppa-file-'.$t.$a.'-'.$mocc.'\' ).css( \'display\',\'none\' );
@@ -3666,7 +3666,7 @@ function wppa_user_albumedit_html( $alb, $width, $where = '', $mcr = false ) {
3666
  }
3667
  // elseif ( $where == 'widget' || $where == 'uploadbox' ) {
3668
  // }
3669
- if ( wppa( 'page' ) ) $returnurl .= '&amp;wppa-page=' . wppa( 'page' );
3670
  $returnurl = trim( $returnurl, '?' );
3671
 
3672
  $returnurl = wppa_encrypt_url( $returnurl );
@@ -3683,7 +3683,7 @@ function wppa_user_albumedit_html( $alb, $width, $where = '', $mcr = false ) {
3683
  'jQuery( \'#_wppa-ea-'.$a.'-'.wppa( 'mocc' ).'\' ).css( \'display\',\'block\' );'. // Show backlink
3684
  '_wppaDoAutocol( ' . wppa( 'mocc' ) . ' )' . // Trigger autocol
3685
  '" style="float:left; cursor:pointer">
3686
- '.__( 'Edit Album Info', 'wp-photo-album-plus' ).'
3687
  </a>
3688
  <a id="_wppa-ea-'.$a.'-'.wppa( 'mocc' ).'" class="wppa-aedit-'.$where.' wppa-album-'.$where.'-link" onclick="'.
3689
  'jQuery( \'#wppa-fe-div-'.$a.'-'.wppa( 'mocc' ).'\' ).css( \'display\',\'none\' );'. // Hide the Edit form
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
49
  $result .= '<div class="wppa-nicewrap" >';
50
  }
51
 
52
+ // Display create sub album and upload photo links conditionally
53
  if ( ! wppa_is_virtual() && wppa_opt( 'upload_link_thumbs' ) == 'top' ) {
54
 
55
  $alb = wppa( 'current_album' );
61
  // Close thumbnail area box
62
  elseif ( $action == 'close' ) {
63
 
64
+ // Display create sub album and upload photo links conditionally
65
  if ( ! wppa_is_virtual() && wppa_opt( 'upload_link_thumbs' ) == 'bottom' ) {
66
 
67
  $alb = wppa( 'current_album' );
2500
  return '';
2501
  }
2502
 
2503
+ // Basic users are not allowed to create sub albums
2504
  if ( wppa_user_is_basic() ) {
2505
  return '';
2506
  }
2574
  elseif ( $where == 'thumb' ) {
2575
  $returnurl .= 'wppa-album=' . $parent . '&amp;wppa-cover=0&amp;wppa-occur=' . $occur;
2576
  }
2577
+ if ( wppa( 'page' ) ) $returnurl .= '&amp;paged=' . wppa( 'page' );
2578
  $returnurl = trim( $returnurl, '?' );
2579
  $returnurl = wppa_trim_wppa_( $returnurl );
2580
  $t = $mcr ? 'mcr-' : '';
2592
  jQuery( \'#_wppa-cr-'.$a.'-'.$mocc.'\' ).css( \'display\',\'block\' );
2593
  window.dispatchEvent(new Event(\'resize\'))"
2594
  style="float:left;cursor:pointer"> ' .
2595
+ ( $alb ? __( 'Create sub album', 'wp-photo-album-plus' ) : __( 'Create album', 'wp-photo-album-plus' ) ) . '
2596
  </a>
2597
  <a id="_wppa-cr-' . $a . '-' . $mocc . '" class="wppa-create-' . $where . ' wppa-album-cover-link" onclick="
2598
  jQuery( \'#wppa-create-'.$t.$a.'-'.$mocc.'\' ).css( \'display\',\'none\' );
2765
  if ( ! in_array( $xalb, (array) $albums_granted, true ) ) {
2766
 
2767
  // This function will check if $xalb is a grant parent,
2768
+ // and make my sub album if it does not already exist.
2769
  $ta = wppa_grant_albums( $xalb );
2770
  if ( ! empty( $ta ) ) {
2771
  $albums_created = array_merge( $albums_created, $ta );
2955
  window.dispatchEvent(new Event(\'resize\'));
2956
  " style="float:left; cursor:pointer"
2957
  >' .
2958
+ __( 'Upload photo', 'wp-photo-album-plus' ) . '
2959
  </a>
2960
  <a id="_wppa-up-' . $a . '-' . $mocc . '" class="wppa-upload-'.$where.' wppa-album-cover-link" onclick="
2961
  jQuery( \'#wppa-file-'.$t.$a.'-'.$mocc.'\' ).css( \'display\',\'none\' );
3666
  }
3667
  // elseif ( $where == 'widget' || $where == 'uploadbox' ) {
3668
  // }
3669
+ if ( wppa( 'page' ) ) $returnurl .= '&amp;paged=' . wppa( 'page' );
3670
  $returnurl = trim( $returnurl, '?' );
3671
 
3672
  $returnurl = wppa_encrypt_url( $returnurl );
3683
  'jQuery( \'#_wppa-ea-'.$a.'-'.wppa( 'mocc' ).'\' ).css( \'display\',\'block\' );'. // Show backlink
3684
  '_wppaDoAutocol( ' . wppa( 'mocc' ) . ' )' . // Trigger autocol
3685
  '" style="float:left; cursor:pointer">
3686
+ '.__( 'Edit album info', 'wp-photo-album-plus' ).'
3687
  </a>
3688
  <a id="_wppa-ea-'.$a.'-'.wppa( 'mocc' ).'" class="wppa-aedit-'.$where.' wppa-album-'.$where.'-link" onclick="'.
3689
  'jQuery( \'#wppa-fe-div-'.$a.'-'.wppa( 'mocc' ).'\' ).css( \'display\',\'none\' );'. // Hide the Edit form
wppa-breadcrumb.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for breadcrumbs
6
- * Version 8.2.05.002
7
  *
8
  */
9
 
@@ -226,7 +226,7 @@ global $wppa_session;
226
  }
227
  $albtxt = wppa( 'is_rootsearch' ) ?
228
  ' <span style="cursor:pointer" title="'.
229
- esc_attr( sprintf( __( 'Searchresults from album %s and its subalbums' , 'wp-photo-album-plus' ),
230
  wppa_display_root( $searchroot ) ) ).'">*</span> ' :
231
  '';
232
 
@@ -552,7 +552,7 @@ global $wppa_session;
552
  // 'Go to thumbnail display' - icon
553
  if ( wppa( 'is_slide' ) && ! wppa( 'calendar' ) ) {
554
  if ( wppa_switch( 'bc_slide_thumblink' ) ) {
555
- $pg = ( ( wppa_opt( 'thumb_page_size' ) == wppa_opt( 'slideshow_pagesize' ) ) && wppa_get_curpage() != '1' ) ? '&wppa-page='.wppa_get_curpage() : '&wppa-page=1';
556
  $thumbhref .= $pg;
557
 
558
  if ( $virtual ) {
@@ -584,7 +584,7 @@ global $wppa_session;
584
  ' title="' . __( 'Thumbnail view', 'wp-photo-album-plus' ) . '"' .
585
  ' class="wppa-nav-text"' .
586
  ' style="float:right; cursor:pointer"' .
587
- ' onclick="wppaDoAjaxRender('.wppa('mocc').', \''.$ajax_url.$s.'&wppa-page=\'+wppaThumbPage['.$mocc.']+\'&wppa-hilite=\'+_wppaId['.$mocc.'][_wppaCurIdx['.$mocc.']], \''.$href_url.$s.'&wppa-page=\'+wppaThumbPage['.$mocc.']+\'&wppa-hilite=\'+_wppaId['.$mocc.'][_wppaCurIdx['.$mocc.']],true)"' .
588
  ' >' .
589
  wppa_get_svghtml( 'Content-View', wppa_icon_size( '1.5em' ), false, false, '10', '10', '10', '10' ) .
590
  '</span>' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for breadcrumbs
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
226
  }
227
  $albtxt = wppa( 'is_rootsearch' ) ?
228
  ' <span style="cursor:pointer" title="'.
229
+ esc_attr( sprintf( __( 'Searchresults from album %s and its sub albums' , 'wp-photo-album-plus' ),
230
  wppa_display_root( $searchroot ) ) ).'">*</span> ' :
231
  '';
232
 
552
  // 'Go to thumbnail display' - icon
553
  if ( wppa( 'is_slide' ) && ! wppa( 'calendar' ) ) {
554
  if ( wppa_switch( 'bc_slide_thumblink' ) ) {
555
+ $pg = ( ( wppa_opt( 'thumb_page_size' ) == wppa_opt( 'slideshow_pagesize' ) ) && wppa_get_curpage() != '1' ) ? '&paged='.wppa_get_curpage() : '&paged=1';
556
  $thumbhref .= $pg;
557
 
558
  if ( $virtual ) {
584
  ' title="' . __( 'Thumbnail view', 'wp-photo-album-plus' ) . '"' .
585
  ' class="wppa-nav-text"' .
586
  ' style="float:right; cursor:pointer"' .
587
+ ' onclick="wppaDoAjaxRender('.wppa('mocc').', \''.$ajax_url.$s.'&paged=\'+wppaThumbPage['.$mocc.']+\'&wppa-hilite=\'+_wppaId['.$mocc.'][_wppaCurIdx['.$mocc.']], \''.$href_url.$s.'&paged=\'+wppaThumbPage['.$mocc.']+\'&wppa-hilite=\'+_wppaId['.$mocc.'][_wppaCurIdx['.$mocc.']],true)"' .
588
  ' >' .
589
  wppa_get_svghtml( 'Content-View', wppa_icon_size( '1.5em' ), false, false, '10', '10', '10', '10' ) .
590
  '</span>' );
wppa-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  /* Contains all wppa smart cache functions
5
  /*
6
- /* Version 8.2.05.002
7
  */
8
 
9
  // Test for caching
@@ -30,7 +30,7 @@ global $wppa_lang;
30
  if ( wppa( 'cache' ) ) {
31
 
32
  // No querystring?
33
- if ( /* ! wppa_in_widget() && */ ! $_SERVER['REQUEST_URI'] ) {
34
  $caching = true;
35
  }
36
 
@@ -463,8 +463,6 @@ global $wpdb;
463
  wp_die( 'You have no rights to do this' );
464
  }
465
 
466
- wppa_echo( '<h1>' . __( 'WPPA Cache', 'wp-photo-album-plus' ) . '</h1>' );
467
-
468
  $sc_files = array();
469
  $root = WPPA_CONTENT_PATH . '/' . wppa_opt( 'cache_root' ) . '/wppa-shortcode';
470
  if ( wppa_is_dir( $root ) ) {
@@ -482,6 +480,7 @@ global $wpdb;
482
  if ( $count ) {
483
  $result = '
484
  <div class="wrap" >
 
485
  <table class="wppa-table widefat wppa-setting-table striped" style="margin-top:12px">
486
  <thead style="font-weight:bold">
487
  <tr>
3
  /*
4
  /* Contains all wppa smart cache functions
5
  /*
6
+ /* Version 8.3.01.001
7
  */
8
 
9
  // Test for caching
30
  if ( wppa( 'cache' ) ) {
31
 
32
  // No querystring?
33
+ if ( ! $_SERVER['REQUEST_URI'] ) {
34
  $caching = true;
35
  }
36
 
463
  wp_die( 'You have no rights to do this' );
464
  }
465
 
 
 
466
  $sc_files = array();
467
  $root = WPPA_CONTENT_PATH . '/' . wppa_opt( 'cache_root' ) . '/wppa-shortcode';
468
  if ( wppa_is_dir( $root ) ) {
480
  if ( $count ) {
481
  $result = '
482
  <div class="wrap" >
483
+ <h1>' . get_admin_page_title() . '</h1>
484
  <table class="wppa-table widefat wppa-setting-table striped" style="margin-top:12px">
485
  <thead style="font-weight:bold">
486
  <tr>
wppa-comment-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
- * Version 8.1.09.003
7
  *
8
  */
9
 
@@ -14,7 +14,7 @@ if ( ! class_exists( 'WP_List_Table' ) ) {
14
  }
15
 
16
  // CREATE A PACKAGE CLASS *****************************
17
- class WPPA_Comment_table extends WP_List_Table {
18
 
19
  var $data;
20
 
@@ -277,7 +277,9 @@ class WPPA_Comment_table extends WP_List_Table {
277
  function prepare_items() {
278
  global $wpdb;
279
 
280
- $per_page = wppa_opt( 'comment_admin_pagesize' );
 
 
281
  $columns = $this->get_columns();
282
  $hidden = array();
283
  $sortable = $this->get_sortable_columns();
@@ -314,14 +316,19 @@ class WPPA_Comment_table extends WP_List_Table {
314
  $data = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_comments " . $filter . " ORDER BY timestamp DESC", ARRAY_A );
315
 
316
  function usort_reorder( $a, $b ) {
317
- $orderby = wppa_get( 'orderby' ) ? wppa_get( 'orderby' ) : 'timestamp'; // If no sort, default to title
318
- $order = wppa_get( 'order' ) ? wppa_get( 'order' ) : 'desc'; // If no order, default to asc
 
 
 
319
  $result = strcmp( $a[$orderby], $b[$orderby] ); // Determine sort order
320
  return ( $order === 'asc' ) ? $result : -$result; // Send final sort direction to usort
321
  }
322
  usort( $data, 'usort_reorder' );
323
 
324
- $current_page = $this->get_pagenum();
 
 
325
  $total_items = count( $data );
326
  if ( $per_page ) {
327
  $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );
@@ -336,11 +343,16 @@ class WPPA_Comment_table extends WP_List_Table {
336
  }
337
  }
338
 
339
-
340
  // The command admin page
341
  function _wppa_comment_admin() {
342
  global $wpdb;
343
 
 
 
 
 
 
 
344
  // Create an instance of our package class...
345
  $testListTable = new WPPA_Comment_table();
346
 
@@ -353,10 +365,9 @@ function _wppa_comment_admin() {
353
  // Open page
354
  wppa_echo( '
355
  <div class="wrap">
356
- <h1>' .
357
- ( $moderating ? esc_html__( 'Photo Albums -> Moderate Comment', 'wp-photo-album-plus' ) :
358
- esc_html__( 'Photo Albums -> Comment admin', 'wp-photo-album-plus' ) ) .
359
- '</h1>' );
360
  if ( $moderating ) {
361
  $status_show = array( 'pending', 'spam' );
362
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
+ * Version 8.3.01.005
7
  *
8
  */
9
 
14
  }
15
 
16
  // CREATE A PACKAGE CLASS *****************************
17
+ class WPPA_Comment_table extends WPPA_List_Table {
18
 
19
  var $data;
20
 
277
  function prepare_items() {
278
  global $wpdb;
279
 
280
+ $parms = wppa_get_paging_parms( 'comment_admin' );
281
+
282
+ $per_page = $parms['pagesize'];
283
  $columns = $this->get_columns();
284
  $hidden = array();
285
  $sortable = $this->get_sortable_columns();
316
  $data = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_comments " . $filter . " ORDER BY timestamp DESC", ARRAY_A );
317
 
318
  function usort_reorder( $a, $b ) {
319
+
320
+ $parms = wppa_get_paging_parms( 'comment_admin' );
321
+
322
+ $orderby = $parms['order']; // wppa_get( 'orderby' ) ? wppa_get( 'orderby' ) : 'timestamp'; // If no sort, default to title
323
+ $order = strtolower($parms['dir']); //wppa_get( 'order' ) ? wppa_get( 'order' ) : 'desc'; // If no order, default to asc
324
  $result = strcmp( $a[$orderby], $b[$orderby] ); // Determine sort order
325
  return ( $order === 'asc' ) ? $result : -$result; // Send final sort direction to usort
326
  }
327
  usort( $data, 'usort_reorder' );
328
 
329
+
330
+
331
+ $current_page = $parms['page']; //$this->get_pagenum();
332
  $total_items = count( $data );
333
  if ( $per_page ) {
334
  $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );
343
  }
344
  }
345
 
 
346
  // The command admin page
347
  function _wppa_comment_admin() {
348
  global $wpdb;
349
 
350
+ $wppa_page = wppa_get( 'paged', 1, 'int' );
351
+ if ( $wppa_page > '1' ) {
352
+ $_REQUEST['paged'] = $wppa_page;
353
+ }
354
+ // $parms = wppa_get_paging_parms( 'comment_admin' );
355
+
356
  // Create an instance of our package class...
357
  $testListTable = new WPPA_Comment_table();
358
 
365
  // Open page
366
  wppa_echo( '
367
  <div class="wrap">
368
+ <h1 class="wp-heading-inline">' .
369
+ get_admin_page_title() . '
370
+ </h1>' );
 
371
  if ( $moderating ) {
372
  $status_show = array( 'pending', 'spam' );
373
  }
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 8.2.05.005
6
  *
7
  */
8
 
@@ -310,7 +310,7 @@ global $wppa_randseed_modified;
310
  if ( $wppa_randseed_modified ) $renew = false; // Already renewed this pageload
311
  if ( wppa( 'ajax' ) ) $renew = false; // Not during ajax call
312
  if ( strpos( $_SERVER['REQUEST_URI'], 'wp-content' ) !== false ) $renew = false; // Url to a content item needs no renew
313
- if ( wppa_get( 'wppa-page', '0' ) ) $renew = false; // A subsequent wppa page needs the same sequence
314
  if ( isset( $wppa_session['randseedtime'] ) && $wppa_session['randseedtime'] > ( time() - 10 ) ) $renew = false; // Not within 10 seconds
315
 
316
  // Still renew if the current wp page differs from the last
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 8.3.01.001
6
  *
7
  */
8
 
310
  if ( $wppa_randseed_modified ) $renew = false; // Already renewed this pageload
311
  if ( wppa( 'ajax' ) ) $renew = false; // Not during ajax call
312
  if ( strpos( $_SERVER['REQUEST_URI'], 'wp-content' ) !== false ) $renew = false; // Url to a content item needs no renew
313
+ if ( wppa_get( 'paged', '0' ) ) $renew = false; // A subsequent wppa page needs the same sequence
314
  if ( isset( $wppa_session['randseedtime'] ) && $wppa_session['randseedtime'] > ( time() - 10 ) ) $renew = false; // Not within 10 seconds
315
 
316
  // Still renew if the current wp page differs from the last
wppa-defaults.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
- * Version 8.2.09.001
7
  *
8
  */
9
 
@@ -941,11 +941,7 @@ horizrailenabled:false,";
941
  'wppa_meta_page' => 'yes', // 9
942
  'wppa_meta_all' => 'yes', // 10
943
  'wppa_alt_type' => 'fullname',
944
- 'wppa_album_admin_pagesize' => '100',
945
- 'wppa_photo_admin_pagesize' => '20',
946
  'wppa_photo_admin_max_albums' => '500',
947
- 'wppa_comment_admin_pagesize' => '10',
948
- 'wppa_email_admin_pagesize' => '20',
949
  'wppa_jpeg_quality' => '95',
950
  'wppa_geo_edit' => 'no',
951
  'wppa_adminbarmenu_admin' => 'yes',
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
+ * Version 8.3.01.005
7
  *
8
  */
9
 
941
  'wppa_meta_page' => 'yes', // 9
942
  'wppa_meta_all' => 'yes', // 10
943
  'wppa_alt_type' => 'fullname',
 
 
944
  'wppa_photo_admin_max_albums' => '500',
 
 
945
  'wppa_jpeg_quality' => '95',
946
  'wppa_geo_edit' => 'no',
947
  'wppa_adminbarmenu_admin' => 'yes',
wppa-edit-email.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
- * Version 8.2.09.002
7
  *
8
  */
9
 
@@ -24,33 +24,21 @@ global $wpdb;
24
  );
25
  $url = get_admin_url().'admin.php?page=wppa_edit_email';
26
 
27
- // Display sequence
28
- $order = wppa_edit_email_order();
29
- $dir = wppa_edit_email_dir();
30
- $page = wppa_edit_email_page();
31
- $reverse = $dir == 'DESC';
32
-
33
- // Save sequence data for later
34
- set_transient( 'wppa_edit_email_seq-' . wppa_get_user(), $order, MONTH_IN_SECONDS );
35
- set_transient( 'wppa_edit_email_dir-' . wppa_get_user(), $dir, MONTH_IN_SECONDS );
36
- set_transient( 'wppa_edit_email_page-' . wppa_get_user(), $page, MONTH_IN_SECONDS );
37
 
38
  // Icon to use
39
  $downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style="height:12px;position:relative;top:2px" />';
40
  $upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style="height:12px;position:relative;top:2px" />';
41
- $useimg = $reverse ? $upimg : $downimg;
42
 
43
  // Get users
44
  $total = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users" ); // get_users( ['count_total'=>true] );
45
- $pagesize = wppa_opt( 'email_admin_pagesize' );
46
- $users = get_users( ['ID','user_login','display_name','orderby'=>$order,'order'=>($reverse?'DESC':'ASC'),'number'=>$pagesize,'paged'=>$page] );
47
-
48
- // After a change in pagesize (up) current page may contain no items. In that case, go to page 1 and retry finding users
49
- if ( ! count( $users ) ) {
50
- $page = '1';
51
- set_transient( 'wppa_edit_email_page-' . wppa_get_user(), $page, MONTH_IN_SECONDS );
52
- $users = get_users( ['ID','user_login','display_name','orderby'=>$order,'order'=>($reverse?'DESC':'ASC'),'number'=>$pagesize,'paged'=>$page] );
53
- }
54
 
55
  // Get mailinglist user ids
56
  foreach( array_keys( $email_types ) as $type ) {
@@ -99,55 +87,53 @@ global $wpdb;
99
 
100
  // General header
101
  wppa_echo( '
102
- <img id="icon-album" src="' . WPPA_URL.'/img/settings32.png" />
103
  <h1 style="display:inline;">' .
104
- esc_html__('Manage Email subscriptions', 'wp-photo-album-plus' ) .
105
  '</h1>' );
106
  if ( ! wppa_switch( 'email_on' ) ) {
107
  wppa_echo( '
108
  <span style="color:red;display:inline">' .
109
- esc_html( 'Email is not enabled', 'wp-photo-album-plus' ) .
110
  ( current_user_can( 'wppa_settings' ) ? wppa_see_also( 'general', '1', '7' ) : '' ) . '
111
  </span>' );
112
  }
113
 
114
- wppa_user_email_table_pagination( $pagesize, $page, $total, $url );
115
 
116
  wppa_echo( '
117
- <div>
118
  <table
119
  class="wppa-table widefat wppa-setting-table striped"
120
  style="margin-top:12px;"
121
  >
122
  <colgroup>
123
- <col style="width:5%">
124
- <col style="width:15%">
125
- <col style="width:15%">
126
- <col style="width:8%">
127
- <col style="width:8%">
128
- <col style="width:8%">
129
- <col style="width:8%">
130
- <col style="width:8%">
131
- <col style="width:8%">
132
- <col style="width:8%">
133
- <col style="width:8%">
134
  </colgroup>
135
  <thead>
136
  <tr>
137
  <td
138
  style="cursor:pointer"
139
- onclick="document.location.href=\'' . wppa_edit_reload_url( 'ID' ) . '\'">' .
140
- ( $order == 'ID' ? $useimg : '' ) . esc_html__( 'Id', 'wp-photo-album-plus' ) . '
141
  </td>
142
  <td
143
  style="cursor:pointer"
144
- onclick="document.location.href=\'' . wppa_edit_reload_url( 'user_login' ) . '\'">' .
145
- ( $order == 'user_login' ? $useimg : '' ) . esc_html__( 'User login', 'wp-photo-album-plus' ) . '
146
  </td>
147
  <td
148
  style="cursor:pointer"
149
- onclick="document.location.href=\'' . wppa_edit_reload_url( 'display_name' ) . '\'">' .
150
- ( $order == 'display_name' ? $useimg : '' ) . esc_html__( 'User display name', 'wp-photo-album-plus' ) . '
151
  </td>' );
152
  foreach( array_keys( $email_types ) as $type ) {
153
  wppa_echo( '
@@ -183,25 +169,6 @@ global $wpdb;
183
  wppa_echo( '
184
  </tr>
185
  </thead>
186
- </table>
187
- </div>
188
- <div style="max-height:600px;overflow:auto;margin-bottom:20px;border-bottom:1px solid #c3c4c7;">
189
- <table
190
- class="wppa-table widefat wppa-setting-table striped"
191
- >
192
- <colgroup>
193
- <col style="width:5%">
194
- <col style="width:15%">
195
- <col style="width:15%">
196
- <col style="width:8%">
197
- <col style="width:8%">
198
- <col style="width:8%">
199
- <col style="width:8%">
200
- <col style="width:8%">
201
- <col style="width:8%">
202
- <col style="width:8%">
203
- <col style="width:8%">
204
- </colgroup>
205
  <tbody>' );
206
  foreach( $users as $user ) {
207
  wppa_echo( '
@@ -257,171 +224,11 @@ global $wpdb;
257
  }
258
  wppa_echo( '
259
  </tbody>
260
- </table>
261
- </div>' );
262
 
263
- wppa_user_email_table_pagination( $pagesize, $page, $total, $url );
264
 
265
  wppa_echo( '
266
  </div>' );
267
  }
268
 
269
- // The user table pagination
270
- // Prints the pagelinks
271
- function wppa_user_email_table_pagination( $pagesize, $page, $count, $url ) {
272
-
273
- // Init
274
- $result = '';
275
- $link = $url . '&wppa-page=';
276
-
277
- // Paging on?
278
- if ( ! $pagesize ) {
279
- return;
280
- }
281
-
282
- $npages = ceil( $count / $pagesize );
283
-
284
- // Just one page?
285
- if ( $npages == '1' ) {
286
- return;
287
- }
288
-
289
- $result .= '<div style="line-height:1.7em">';
290
-
291
- // The links
292
- if ( $page != '1' ) {
293
- $result .= '<a style="padding:0 0.25em" href="' . $link . ( $page - '1') . '" >' . __( 'Previous page', 'wp-photo-album-plus' ) . '</a> ';
294
- }
295
-
296
- $p = '1';
297
- $result .= '<select onchange="document.location.href=\'' . $link . '\'+this.value;">';
298
- while ( $p <= $npages ) {
299
- if ( $p == $page ) {
300
- $sel = ' selected';
301
- }
302
- else {
303
- $sel = '';
304
- }
305
- $result .= '<option value="' . $p . '"' . $sel . '>' . $p . '</option>';
306
- $p++;
307
- }
308
- $result .= '</select>';
309
-
310
- if ( $page != $npages ) {
311
- $result .= '<a style="padding:0 0.25em" href="' . $link . ( $page + '1') . '" >' . __( 'Next page', 'wp-photo-album-plus' ) . '</a>';
312
- }
313
-
314
- $result .= '
315
- <span style="float:right">' .
316
- __( 'Pagesize', 'wp-photo-album-plus' ) . '
317
- <select onchange="_wppaRefreshAfter=true;wppaAjaxUpdateOptionValue(\'email_admin_pagesize\', this);">
318
- <option value="20"' . ( $pagesize == '20' ? ' selected' : '' ) . '>20</option>
319
- <option value="50"' . ( $pagesize == '50' ? ' selected' : '' ) . '>50</option>
320
- <option value="100"' . ( $pagesize == '100' ? ' selected' : '' ) . '>100</option>
321
- <option value="200"' . ( $pagesize == '200' ? ' selected' : '' ) . '>200</option>
322
- <option value="500"' . ( $pagesize == '500' ? ' selected' : '' ) . '>500</option>
323
- <option value="1000"' . ( $pagesize == '1000' ? ' selected' : '' ) . '>1000</option>
324
- </select>
325
- </span>';
326
-
327
- $result .= '</div>';
328
-
329
- wppa_echo( $result );
330
- }
331
-
332
- // The list order method
333
- // Returns 'ID', 'user_login' or 'display_name'
334
- function wppa_edit_email_order() {
335
-
336
- // Init
337
- $order = 'ID';
338
-
339
- // Query arg?
340
- $order_new = wppa_get( 'order-by', '', 'text' );
341
- if ( in_array( $order_new, ['ID','user_login', 'display_name'] ) ) {
342
- $order = $order_new;
343
- }
344
-
345
- // Used before?
346
- else {
347
- $order_old = get_transient( 'wppa_edit_email_seq-' . wppa_get_user() );
348
- if ( $order_old ) {
349
- $order = $order_old;
350
- }
351
- }
352
-
353
- // Done
354
- return $order;
355
- }
356
-
357
- // The list order asc or desc
358
- // Returns 'ASC' or 'DESC'
359
- function wppa_edit_email_dir() {
360
-
361
- // Init
362
- $dir = 'ASC';
363
-
364
- // Query arg?
365
- $desc = wppa_get( 'dir', '', 'text' );
366
- if ( in_array( $desc, ['ASC', 'DESC'] ) ) {
367
- $dir = $desc;
368
- }
369
-
370
- // Used before?
371
- elseif ( get_transient( 'wppa_edit_email_dir-' . wppa_get_user() ) == 'DESC' ) {
372
- $dir = 'DESC';
373
- }
374
-
375
- // Done
376
- return $dir;
377
- }
378
-
379
- // The page no
380
- // Returns query arg wppa-page, defaults to 1
381
- function wppa_edit_email_page() {
382
-
383
- // Query arg?
384
- $page = wppa_get( 'wppa-page', '', 'int' );
385
-
386
- // Used before?
387
- if ( ! wppa_is_int( $page ) ) {
388
- $page = get_transient( 'wppa_edit_email_page-' . wppa_get_user() );
389
- }
390
-
391
- // Nothing yet?
392
- if ( ! $page ) {
393
- $page = '1';
394
- }
395
-
396
- // Done
397
- return $page;
398
- }
399
-
400
- // Get admin page reload url
401
- // arg1: one out of 'ID', 'user_login' or 'display_name'
402
- function wppa_edit_reload_url( $for ) {
403
-
404
- if ( in_array( $for, ['ID', 'user_login', 'display_name'] ) ) {
405
- $order_now = wppa_edit_email_order();
406
- $dir_now = wppa_edit_email_dir();
407
- $page = wppa_edit_email_page();
408
- if ( $for == $order_now ) {
409
- if ( $dir_now == 'ASC' ) {
410
- $dir = 'DESC';
411
- }
412
- else {
413
- $dir = 'ASC';
414
- }
415
- }
416
- else {
417
- $dir = 'ASC';
418
- $page = '1';
419
- }
420
- $url = get_admin_url() . 'admin.php?page=wppa_edit_email&wppa-order-by=' . $for . '&wppa-dir=' . $dir . '&wppa-page=' . $page;
421
- }
422
- else {
423
- $url = get_admin_url() . 'admin.php?page=wppa_edit_email';
424
- }
425
-
426
- return $url;
427
- }
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
24
  );
25
  $url = get_admin_url().'admin.php?page=wppa_edit_email';
26
 
27
+ // Get paging parameters
28
+ $parms = wppa_get_paging_parms( 'edit_email' );
 
 
 
 
 
 
 
 
29
 
30
  // Icon to use
31
  $downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style="height:12px;position:relative;top:2px" />';
32
  $upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style="height:12px;position:relative;top:2px" />';
33
+ $useimg = $parms['dir'] == 'DESC' ? $upimg : $downimg;
34
 
35
  // Get users
36
  $total = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users" ); // get_users( ['count_total'=>true] );
37
+ $users = get_users( ['ID','user_login','display_name',
38
+ 'orderby'=>$parms['order'],
39
+ 'order'=>$parms['dir'],
40
+ 'number'=>$parms['pagesize'],
41
+ 'paged'=>$parms['page']] );
 
 
 
 
42
 
43
  // Get mailinglist user ids
44
  foreach( array_keys( $email_types ) as $type ) {
87
 
88
  // General header
89
  wppa_echo( '
 
90
  <h1 style="display:inline;">' .
91
+ get_admin_page_title() .
92
  '</h1>' );
93
  if ( ! wppa_switch( 'email_on' ) ) {
94
  wppa_echo( '
95
  <span style="color:red;display:inline">' .
96
+ esc_html__( 'Email is not enabled', 'wp-photo-album-plus' ) .
97
  ( current_user_can( 'wppa_settings' ) ? wppa_see_also( 'general', '1', '7' ) : '' ) . '
98
  </span>' );
99
  }
100
 
101
+ wppa_admin_pagination( $parms['pagesize'], $parms['page'], $total, $url );
102
 
103
  wppa_echo( '
 
104
  <table
105
  class="wppa-table widefat wppa-setting-table striped"
106
  style="margin-top:12px;"
107
  >
108
  <colgroup>
109
+ <col style="width:70px">
110
+ <col style="width:132px">
111
+ <col style="width:200px">
112
+ <col style="">
113
+ <col style="">
114
+ <col style="">
115
+ <col style="">
116
+ <col style="">
117
+ <col style="">
118
+ <col style="">
119
+ <col style="">
120
  </colgroup>
121
  <thead>
122
  <tr>
123
  <td
124
  style="cursor:pointer"
125
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'edit_email', 'ID' ) . '\'">' .
126
+ ( $parms['order'] == 'ID' ? $useimg : '' ) . esc_html__( 'Id', 'wp-photo-album-plus' ) . '
127
  </td>
128
  <td
129
  style="cursor:pointer"
130
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'edit_email', 'user_login' ) . '\'">' .
131
+ ( $parms['order'] == 'user_login' ? $useimg : '' ) . esc_html__( 'User login', 'wp-photo-album-plus' ) . '
132
  </td>
133
  <td
134
  style="cursor:pointer"
135
+ onclick="document.location.href=\'' . wppa_admin_reload_url( 'edit_email', 'display_name' ) . '\'">' .
136
+ ( $parms['order'] == 'display_name' ? $useimg : '' ) . esc_html__( 'User display name', 'wp-photo-album-plus' ) . '
137
  </td>' );
138
  foreach( array_keys( $email_types ) as $type ) {
139
  wppa_echo( '
169
  wppa_echo( '
170
  </tr>
171
  </thead>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  <tbody>' );
173
  foreach( $users as $user ) {
174
  wppa_echo( '
224
  }
225
  wppa_echo( '
226
  </tbody>
227
+ </table>' );
 
228
 
229
+ wppa_admin_pagination( $parms['pagesize'], $parms['page'], $total, $url );
230
 
231
  wppa_echo( '
232
  </div>' );
233
  }
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wppa-edit-sequence.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
- * Version 8.1.10.001
7
  *
8
  */
9
 
@@ -12,15 +12,11 @@ if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
12
  function _wppa_edit_sequence() {
13
 
14
  $album = wppa_get( 'album', '0' );
15
- $iconurl = WPPA_URL.'/img/camera32.png';
16
-
17
  $result = '
18
  <div class="wrap">
19
 
20
- <img id="icon-photos" src="' . $iconurl . '" />
21
- <h1>' . esc_html__( 'Edit Photo Sequence', 'wp-photo-album-plus' ) . '
22
- <span style="font-size:0.5em">' . esc_html( __( 'A subset of Album Admin page', 'wp-photo-album-plus' ) ) . '</span>
23
- </h1>
24
 
25
  <select
26
  id="wppa-edit-sequence-album"
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
+ * Version 8.3.01.002
7
  *
8
  */
9
 
12
  function _wppa_edit_sequence() {
13
 
14
  $album = wppa_get( 'album', '0' );
15
+
 
16
  $result = '
17
  <div class="wrap">
18
 
19
+ <h1>' . get_admin_page_title() . '</h1><br>
 
 
 
20
 
21
  <select
22
  id="wppa-edit-sequence-album"
wppa-edit-tags.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-edit-tags.php
3
  * Package: wp-photo-album-plus
4
  *
5
- * Version 8.2.05.002
6
  *
7
  */
8
 
@@ -15,9 +15,6 @@ function _wppa_edit_tags() {
15
  wp_die( 'Insuffucient rights' );
16
  }
17
 
18
- // Init
19
- $iconurl = WPPA_URL . '/img/settings32.png';
20
-
21
  // Prepare taglist
22
  $tags = wppa_get_taglist();
23
  $opts = array( __( '-select a tag-', 'wp-photo-album-plus' ) );
@@ -44,31 +41,27 @@ function _wppa_edit_tags() {
44
 
45
  $result = '
46
  <div class="wrap">
47
- <img id="icon-album" src="' . esc_url( $iconurl ) . '" />
48
- <h1 style="display:inline">' . __( 'Edit Photo Tag', 'wp-photo-album-plus' ) . '
49
- <span style="font-size:0.5em">' . __( 'A subset of WP Photo Album Plus Settings', 'wp-photo-album-plus' ) . '</span>
50
- </h1>
51
  <input type="hidden" id="wppa-nonce" name="wppa-nonce" value="' . wp_create_nonce( 'wppa-nonce' ) . '" />
52
  <input type="hidden" name="wppa-key" id="wppa-key" value="" />
53
  <input type="hidden" name="wppa-sub" id="wppa-sub" value="" />
54
  <table class="widefat wppa-table wppa-setting-table">
55
  <thead style="font-weight: bold; " class="wppa_table_8">
56
  <tr>
57
- <td>' . __('Name', 'wp-photo-album-plus' ) . '</td>
58
- <td>' . __('Description', 'wp-photo-album-plus' ) . '</td>
59
- <td>' . __('Tag to change', 'wp-photo-album-plus' ) . '</td>
60
- <td>' . __('Change into', 'wp-photo-album-plus' ) . '</td>
61
- <td>' . __('Do it!', 'wp-photo-album-plus' ) . '</td>
62
- <td>' . __('Status', 'wp-photo-album-plus' ) . '</td>
63
- <td>' . __('To Go', 'wp-photo-album-plus' ) . '</td>
64
  </tr>
65
  </thead>
66
  <tbody class="wppa_table_8">
67
- <tr
68
- class="wppa-setting" style="color:#333;"
69
- >
70
- <td>' . __( 'Edit tag', 'wp-photo-album-plus' ) . '</td>
71
- <td>' . __( 'Globally change a tagname.', 'wp-photo-album-plus' ) . '</td>
72
  <td>' .
73
  wppa_tag_select( $opts, $vals, '', '', false, '', '600') . '
74
  </td>
@@ -76,7 +69,7 @@ function _wppa_edit_tags() {
76
  <input
77
  id="new_tag_value"
78
  type="text"
79
- style="float:left;width:75%;height:20px;font-size:11px;margin:0;padding:0 0 0 6px;"
80
  value="' . esc_attr( trim( wppa_get_option( 'wppa_new_tag_value' ), ',' ) ) . '"
81
  onchange="wppaAjaxUpdateOptionValue(\'new_tag_value\',this);"
82
  />
@@ -124,7 +117,7 @@ function _wppa_edit_tags() {
124
  function wppa_tag_select( $options, $values ) {
125
 
126
  if ( ! is_array( $options ) ) {
127
- $result = __('There is nothing to select.', 'wp-photo-album-plus' );
128
  return $result;
129
  }
130
 
2
  /* wppa-edit-tags.php
3
  * Package: wp-photo-album-plus
4
  *
5
+ * Version 8.3.01.002
6
  *
7
  */
8
 
15
  wp_die( 'Insuffucient rights' );
16
  }
17
 
 
 
 
18
  // Prepare taglist
19
  $tags = wppa_get_taglist();
20
  $opts = array( __( '-select a tag-', 'wp-photo-album-plus' ) );
41
 
42
  $result = '
43
  <div class="wrap">
44
+ <h1 style="display:inline">' . get_admin_page_title() . '</h1>
45
+ <br><br>
 
 
46
  <input type="hidden" id="wppa-nonce" name="wppa-nonce" value="' . wp_create_nonce( 'wppa-nonce' ) . '" />
47
  <input type="hidden" name="wppa-key" id="wppa-key" value="" />
48
  <input type="hidden" name="wppa-sub" id="wppa-sub" value="" />
49
  <table class="widefat wppa-table wppa-setting-table">
50
  <thead style="font-weight: bold; " class="wppa_table_8">
51
  <tr>
52
+ <td>' . esc_html__( 'Name', 'wp-photo-album-plus' ) . '</td>
53
+ <td>' . esc_html__( 'Description', 'wp-photo-album-plus' ) . '</td>
54
+ <td>' . esc_html__( 'Tag to change', 'wp-photo-album-plus' ) . '</td>
55
+ <td>' . esc_html__( 'Change into', 'wp-photo-album-plus' ) . '</td>
56
+ <td>' . esc_html__( 'Do it!', 'wp-photo-album-plus' ) . '</td>
57
+ <td>' . esc_html__( 'Status', 'wp-photo-album-plus' ) . '</td>
58
+ <td>' . esc_html__( 'To Go', 'wp-photo-album-plus' ) . '</td>
59
  </tr>
60
  </thead>
61
  <tbody class="wppa_table_8">
62
+ <tr class="wppa-setting" style="color:#333;">
63
+ <td>' . esc_html__( 'Edit tag', 'wp-photo-album-plus' ) . '</td>
64
+ <td>' . esc_html__( 'Globally change a tagname.', 'wp-photo-album-plus' ) . '</td>
 
 
65
  <td>' .
66
  wppa_tag_select( $opts, $vals, '', '', false, '', '600') . '
67
  </td>
69
  <input
70
  id="new_tag_value"
71
  type="text"
72
+ style="float:left;width:75%;height:20px;font-size:11px;margin:0;"
73
  value="' . esc_attr( trim( wppa_get_option( 'wppa_new_tag_value' ), ',' ) ) . '"
74
  onchange="wppaAjaxUpdateOptionValue(\'new_tag_value\',this);"
75
  />
117
  function wppa_tag_select( $options, $values ) {
118
 
119
  if ( ! is_array( $options ) ) {
120
+ $result = __( 'There is nothing to select.', 'wp-photo-album-plus' );
121
  return $result;
122
  }
123
 
wppa-export.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the export functions
6
- * Version 8.2.09.002
7
  *
8
  */
9
 
@@ -31,9 +31,9 @@ global $wppa_try_continue;
31
  // Open the page
32
  wppa_echo( '
33
  <div class="wrap">
34
- <h2>' .
35
- __( 'Export Photos', 'wp-photo-album-plus' ) . '
36
- </h2>' );
37
 
38
  // Do the export if requested
39
  if ( wppa_get( 'export-submit' ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the export functions
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
31
  // Open the page
32
  wppa_echo( '
33
  <div class="wrap">
34
+ <h1>' .
35
+ get_admin_page_title() . '
36
+ </h1>' );
37
 
38
  // Do the export if requested
39
  if ( wppa_get( 'export-submit' ) ) {
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 8.2.08.006
7
  *
8
  */
9
 
@@ -132,7 +132,7 @@ global $other_deps;
132
  wppa( 'photos_only', true );
133
  }
134
 
135
- wppa( 'page', wppa_get( 'wppa-page', '1' ) );
136
 
137
  if ( wppa_get( 'superview' ) ) {
138
  $wppa_session['superview'] = wppa( 'is_slide' ) ? 'slide': 'thumbs';
@@ -2948,7 +2948,8 @@ static $user;
2948
  $result .= $wait_text."','";
2949
  $result .= $image_alt."','";
2950
  $result .= $poster_url."','";
2951
- $result .= $filename."'";
 
2952
 
2953
  // Remove excessive spaces and make sure there are no linebreaks in the result that would screw up Javascript.
2954
  $result = wppa_compress_html( $result );
@@ -3758,7 +3759,7 @@ function wppa_get_curpage() {
3758
  if ( wppa( 'mocc' ) == wppa_get( 'occur', '1' ) ) {
3759
 
3760
  // page may be in qstring
3761
- $curpage = wppa_get( 'wppa-page', '1' );
3762
  }
3763
  else {
3764
 
@@ -4675,6 +4676,9 @@ function wppa_is_photo_new( $id ) {
4675
  }
4676
 
4677
  $thumb = wppa_cache_photo( $id );
 
 
 
4678
 
4679
  $birthtime = $thumb['timestamp'];
4680
  $timnow = time();
@@ -4691,6 +4695,9 @@ function wppa_is_photo_modified( $id ) {
4691
  }
4692
 
4693
  $thumb = wppa_cache_photo( $id );
 
 
 
4694
 
4695
  $cretime = $thumb['timestamp'];
4696
  $modtime = $thumb['modified'];
@@ -5750,40 +5757,31 @@ function wppa_get_lbtitle( $type, $id ) {
5750
  'nobpdomain' => wppa_opt( 'art_monkey_display' ) == 'button' && $do_download,
5751
  ) );
5752
 
5753
- $result = '';
5754
  if ( $do_download ) {
5755
- $dl_name = wppa_strip_ext( wppa_get_photo_name( $id ) ) . '.' . wppa_get_ext( wppa_get_photo_path( $id ) );
5756
- $dl_url = wppa_switch( 'artmonkey_use_source' ) ? wppa_get_hires_url( $id ) : wppa_get_photo_url( $id );
5757
  if ( wppa_opt( 'art_monkey_display' ) == 'button' ) {
5758
  $result .= '
5759
  <a
5760
- href="' . $dl_url . '"
5761
- download="' . $dl_name . '"
5762
  >
5763
  <input
5764
  type="button"
5765
  title="' . __( 'Download', 'wp-photo-album-plus' ) . '"
5766
  style="cursor:pointer; margin-bottom:0px; max-width:500px;"
5767
- class="wppa-download-button wppa-ovl-button"' .
5768
-
5769
-
5770
- // onclick="' . ( wppa_is_safari() && ( wppa_opt( 'art_monkey_link' ) == 'file' ) ? 'wppaWindowReference = window.open();' : '' ) . 'wppaAjaxMakeOrigName( ' . wppa( 'mocc' ) . ', \'' . wppa_encrypt_photo( $id ) . '\' );"
5771
-
5772
- ' value="' . rtrim( __( 'Download', 'wp-photo-album-plus' ) . ' ' . $dl_name ) . '"
5773
  />
5774
  </a>';
5775
  }
5776
  else {
5777
  $result .= '
5778
  <a
5779
- href="' . $dl_url . '"
5780
- download="' . $dl_name . '"
5781
  title="' . __( 'Download', 'wp-photo-album-plus' ) . '"
5782
  style="cursor:pointer"
5783
  >'.
5784
-
5785
- // onclick="' . ( wppa_is_safari() && ( wppa_opt( 'art_monkey_link' ) == 'file' ) ? 'wppaWindowReference = window.open();' : '' ) . 'wppaAjaxMakeOrigName( '.wppa( 'mocc' ).', \''.wppa_encrypt_photo($id).'\' );"
5786
- // >' .
5787
  rtrim( __( 'Download', 'wp-photo-album-plus' ) . ' ' . $dl_name ) . '
5788
  </a>';
5789
  }
@@ -6037,3 +6035,23 @@ global $wppa_current_shortcode;
6037
  }
6038
 
6039
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 8.3.01.006
7
  *
8
  */
9
 
132
  wppa( 'photos_only', true );
133
  }
134
 
135
+ wppa( 'page', wppa_get( 'paged', '1' ) );
136
 
137
  if ( wppa_get( 'superview' ) ) {
138
  $wppa_session['superview'] = wppa( 'is_slide' ) ? 'slide': 'thumbs';
2948
  $result .= $wait_text."','";
2949
  $result .= $image_alt."','";
2950
  $result .= $poster_url."','";
2951
+ $result .= $filename."','";
2952
+ $result .= wppa_download_url( $id )."'";
2953
 
2954
  // Remove excessive spaces and make sure there are no linebreaks in the result that would screw up Javascript.
2955
  $result = wppa_compress_html( $result );
3759
  if ( wppa( 'mocc' ) == wppa_get( 'occur', '1' ) ) {
3760
 
3761
  // page may be in qstring
3762
+ $curpage = wppa_get( 'paged', '1' );
3763
  }
3764
  else {
3765
 
4676
  }
4677
 
4678
  $thumb = wppa_cache_photo( $id );
4679
+ if ( ! $thumb ) { // Photo vanished?
4680
+ return false;
4681
+ }
4682
 
4683
  $birthtime = $thumb['timestamp'];
4684
  $timnow = time();
4695
  }
4696
 
4697
  $thumb = wppa_cache_photo( $id );
4698
+ if ( ! $thumb ) { // Photo vanished?
4699
+ return false;
4700
+ }
4701
 
4702
  $cretime = $thumb['timestamp'];
4703
  $modtime = $thumb['modified'];
5757
  'nobpdomain' => wppa_opt( 'art_monkey_display' ) == 'button' && $do_download,
5758
  ) );
5759
 
5760
+ $result = '';
5761
  if ( $do_download ) {
 
 
5762
  if ( wppa_opt( 'art_monkey_display' ) == 'button' ) {
5763
  $result .= '
5764
  <a
5765
+ href="' . esc_url( wppa_download_url( $id ) ) . '"
5766
+ download="' . esc_attr( wppa_download_name( $id ) ) . '"
5767
  >
5768
  <input
5769
  type="button"
5770
  title="' . __( 'Download', 'wp-photo-album-plus' ) . '"
5771
  style="cursor:pointer; margin-bottom:0px; max-width:500px;"
5772
+ class="wppa-download-button wppa-ovl-button"
5773
+ value="' . rtrim( __( 'Download', 'wp-photo-album-plus' ) . ' ' . $dl_name ) . '"
 
 
 
 
5774
  />
5775
  </a>';
5776
  }
5777
  else {
5778
  $result .= '
5779
  <a
5780
+ href="' . esc_url( wppa_download_url( $id ) ) . '"
5781
+ download="' . esc_attr( wppa_download_name( $id ) ) . '"
5782
  title="' . __( 'Download', 'wp-photo-album-plus' ) . '"
5783
  style="cursor:pointer"
5784
  >'.
 
 
 
5785
  rtrim( __( 'Download', 'wp-photo-album-plus' ) . ' ' . $dl_name ) . '
5786
  </a>';
5787
  }
6035
  }
6036
 
6037
 
6038
+ function wppa_download_url( $id ) {
6039
+
6040
+ if ( wppa_opt( 'art_monkey_link' ) != '--- none ---' ) {
6041
+ $result = wppa_switch( 'artmonkey_use_source' ) ? wppa_get_hires_url( $id ) : wppa_get_photo_url( $id );
6042
+ }
6043
+ else {
6044
+ $result = '';
6045
+ }
6046
+ return $result;
6047
+ }
6048
+
6049
+ function wppa_download_name( $id ) {
6050
+ if ( wppa_opt( 'art_monkey_link' ) != '--- none ---' ) {
6051
+ $result = wppa_strip_ext( wppa_get_photo_name( $id ) ) . '.' . wppa_get_ext( wppa_get_photo_path( $id ) );
6052
+ }
6053
+ else {
6054
+ $result = '';
6055
+ }
6056
+ return $result;
6057
+ }
wppa-gutenberg-wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-gutenberg-wppa.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.2.05.001
6
  */
7
 
8
  function wppa_gutenberg_wppa_block() {
@@ -98,7 +98,7 @@ global $wpdb;
98
  <option value="" selected disabled style="color:#700 !important;">-- ' . __( 'Please select a gallery type', 'wp-photo-album-plus' ) . ' --</option>
99
  <option value="cover">' . __( 'The cover(s) of specific album(s)', 'wp-photo-album-plus' ) . '</option>
100
  <option value="content">' . __( 'The content of specific album(s)', 'wp-photo-album-plus' ) . '</option>
101
- <option value="covers">' . __( 'The covers of the subalbums of specific album(s)', 'wp-photo-album-plus' ) . '</option>
102
  <option value="thumbs">' . __( 'The thumbnails of specific album(s)', 'wp-photo-album-plus' ) . '</option>
103
  </select>
104
  </td>
2
  /* wppa-gutenberg-wppa.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.3.01.001
6
  */
7
 
8
  function wppa_gutenberg_wppa_block() {
98
  <option value="" selected disabled style="color:#700 !important;">-- ' . __( 'Please select a gallery type', 'wp-photo-album-plus' ) . ' --</option>
99
  <option value="cover">' . __( 'The cover(s) of specific album(s)', 'wp-photo-album-plus' ) . '</option>
100
  <option value="content">' . __( 'The content of specific album(s)', 'wp-photo-album-plus' ) . '</option>
101
+ <option value="covers">' . __( 'The covers of the sub albums of specific album(s)', 'wp-photo-album-plus' ) . '</option>
102
  <option value="thumbs">' . __( 'The thumbnails of specific album(s)', 'wp-photo-album-plus' ) . '</option>
103
  </select>
104
  </td>
wppa-help.php CHANGED
@@ -3,7 +3,7 @@
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  * admin help page
6
- * version 8.2.01.004
7
  */
8
 
9
  function _wppa_page_help() {
@@ -11,7 +11,9 @@ global $wppa_revno;
11
 
12
  $result = '
13
  <div class="wrap">
14
-
 
 
15
  <h3>' . sprintf( __( 'You will find all information and examples on the new %s%s%s site', 'wp-photo-album-plus' ), '<a href="https://wppa.nl/" target="_blank" >', __( 'Docs & Demos', 'wp-photo-album-plus' ) , '</a>' ) . '</h3>
16
 
17
  <h3>' . __( 'About and credits', 'wp-photo-album-plus' ) . '</h3>
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  * admin help page
6
+ * version 8.3.01.001
7
  */
8
 
9
  function _wppa_page_help() {
11
 
12
  $result = '
13
  <div class="wrap">
14
+ <h1 style="display:inline;">' .
15
+ get_admin_page_title() . '
16
+ </h1>
17
  <h3>' . sprintf( __( 'You will find all information and examples on the new %s%s%s site', 'wp-photo-album-plus' ), '<a href="https://wppa.nl/" target="_blank" >', __( 'Docs & Demos', 'wp-photo-album-plus' ) , '</a>' ) . '</h3>
18
 
19
  <h3>' . __( 'About and credits', 'wp-photo-album-plus' ) . '</h3>
wppa-import.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
- * Version 8.2.07.002
7
  *
8
  */
9
 
@@ -197,7 +197,11 @@ global $wppa_session;
197
  }
198
 
199
  // Open the Form
200
- wppa_echo( '<div class="wrap"><h2>' . __( 'Import Photos', 'wp-photo-album-plus' ) . '</h2>' );
 
 
 
 
201
 
202
  // See if our depot dir has been created
203
  if ( ! wppa_is_dir( WPPA_DEPOT_PATH ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
197
  }
198
 
199
  // Open the Form
200
+ wppa_echo( '
201
+ <div class="wrap">
202
+ <h1>' .
203
+ get_admin_page_title() . '
204
+ </h1>' );
205
 
206
  // See if our depot dir has been created
207
  if ( ! wppa_is_dir( WPPA_DEPOT_PATH ) ) {
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
- * Version 8.2.08.001
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
@@ -461,7 +461,7 @@ global $_gallery;
461
 
462
  $wppa_album_gallery_texts_albums = array(
463
  __( 'of the album', 'wp-photo-album-plus' ),
464
- __( 'Renew Album', 'wp-photo-album-plus' ),
465
  __( 'renew album', 'wp-photo-album-plus' ),
466
  __( 'A new album', 'wp-photo-album-plus' ),
467
  __( 'This album', 'wp-photo-album-plus' ),
@@ -484,7 +484,7 @@ global $_gallery;
484
 
485
  $wppa_album_gallery_texts_gallery = array(
486
  __( 'of the gallery', 'wp-photo-album-plus' ),
487
- __( 'Renew Gallery', 'wp-photo-album-plus' ),
488
  __( 'renew gallery', 'wp-photo-album-plus' ),
489
  __( 'A new gallery', 'wp-photo-album-plus' ),
490
  __( 'This gallery', 'wp-photo-album-plus' ),
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
+ * Version 8.3.01.001
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
461
 
462
  $wppa_album_gallery_texts_albums = array(
463
  __( 'of the album', 'wp-photo-album-plus' ),
464
+ __( 'Renew album', 'wp-photo-album-plus' ),
465
  __( 'renew album', 'wp-photo-album-plus' ),
466
  __( 'A new album', 'wp-photo-album-plus' ),
467
  __( 'This album', 'wp-photo-album-plus' ),
484
 
485
  $wppa_album_gallery_texts_gallery = array(
486
  __( 'of the gallery', 'wp-photo-album-plus' ),
487
+ __( 'Renew gallery', 'wp-photo-album-plus' ),
488
  __( 'renew gallery', 'wp-photo-album-plus' ),
489
  __( 'A new gallery', 'wp-photo-album-plus' ),
490
  __( 'This gallery', 'wp-photo-album-plus' ),
wppa-input.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
- * Version 8.2.06.005
7
  *
8
  */
9
 
@@ -58,7 +58,7 @@ function wppa_get_get_filter( $name ) {
58
  case 'comten':
59
  case 'featen':
60
  case 'relcount':
61
- case 'page':
62
  case 'page_id':
63
  case 'size':
64
  case 'fromp':
@@ -238,6 +238,7 @@ function wppa_get_get_filter( $name ) {
238
  case 'shortcode':
239
  case 'subsearch':
240
  case 'rootsearch':
 
241
  $result = 'text';
242
  break;
243
 
@@ -290,14 +291,6 @@ global $wpdb;
290
  $default = $default ? sanitize_text_field( $default ) : false;
291
  $filter = sanitize_text_field( $filter );
292
 
293
- // Check for wppa page no first
294
- if ( $xname == 'wppa-page' ) {
295
- if ( isset( $_REQUEST['wppa-page'] ) ) {
296
- return strval( intval( $_REQUEST['wppa-page'] ) );
297
- }
298
- else return $default;
299
- }
300
-
301
  // Ajax call ?
302
  if ( $xname == 'wppa-action' ) {
303
  if ( isset( $_REQUEST['wppa-action'] ) ) {
@@ -306,14 +299,6 @@ global $wpdb;
306
  else return $default;
307
  }
308
 
309
- // Admin page ?
310
- if ( $xname == 'page' ) {
311
- if ( isset( $_REQUEST['page'] ) ) {
312
- return sanitize_text_field( $_REQUEST['page'] );
313
- }
314
- else return $default;
315
- }
316
-
317
  // Normalize $name and $xname
318
  if ( substr( $xname, 0, 5 ) == 'wppa-' ) {
319
  $name = substr( $xname, 5 );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
58
  case 'comten':
59
  case 'featen':
60
  case 'relcount':
61
+ case 'paged':
62
  case 'page_id':
63
  case 'size':
64
  case 'fromp':
238
  case 'shortcode':
239
  case 'subsearch':
240
  case 'rootsearch':
241
+ case 'page':
242
  $result = 'text';
243
  break;
244
 
291
  $default = $default ? sanitize_text_field( $default ) : false;
292
  $filter = sanitize_text_field( $filter );
293
 
 
 
 
 
 
 
 
 
294
  // Ajax call ?
295
  if ( $xname == 'wppa-action' ) {
296
  if ( isset( $_REQUEST['wppa-action'] ) ) {
299
  else return $default;
300
  }
301
 
 
 
 
 
 
 
 
 
302
  // Normalize $name and $xname
303
  if ( substr( $xname, 0, 5 ) == 'wppa-' ) {
304
  $name = substr( $xname, 5 );
wppa-lasten-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the last uploaded photos
6
- * Version 8.2.05.002
7
  */
8
 
9
  class LasTenWidget extends WP_Widget {
@@ -233,8 +233,8 @@ class LasTenWidget extends WP_Widget {
233
  // Album enumeration
234
  wppa_widget_input( $this, 'albumenum', $instance['albumenum'], __( 'Albums', 'wp-photo-album-plus' ), __( 'Select --- multiple see below --- in the Album selection box. Then enter album numbers seperated by commas', 'wp-photo-album-plus' ) );
235
 
236
- // Include subalbums
237
- wppa_widget_checkbox( $this, 'includesubs', $instance['includesubs'], __( 'Include subalbums', 'wp-photo-album-plus' ) );
238
 
239
  // Display type
240
  $options = array( __( 'thumbnail images', 'wp-photo-album-plus' ),
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the last uploaded photos
6
+ * Version 8.3.01.001
7
  */
8
 
9
  class LasTenWidget extends WP_Widget {
233
  // Album enumeration
234
  wppa_widget_input( $this, 'albumenum', $instance['albumenum'], __( 'Albums', 'wp-photo-album-plus' ), __( 'Select --- multiple see below --- in the Album selection box. Then enter album numbers seperated by commas', 'wp-photo-album-plus' ) );
235
 
236
+ // Include sub albums
237
+ wppa_widget_checkbox( $this, 'includesubs', $instance['includesubs'], __( 'Include sub albums', 'wp-photo-album-plus' ) );
238
 
239
  // Display type
240
  $options = array( __( 'thumbnail images', 'wp-photo-album-plus' ),
wppa-links.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Frontend links
6
  *
7
- * Version 8.2.05.002
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -360,7 +360,7 @@ function wppa_convert_from_pretty( $uri ) {
360
  // process 'arguments'
361
  if ( is_array( $args ) && count( $args ) > 0 ) {
362
  $first = true;
363
- $possible_conflicts = array( 'wppa-page=' );
364
 
365
  foreach ( $args as $arg ) {
366
  if ( $first ) $newuri .= '?'; else $newuri .= '&';
@@ -383,7 +383,7 @@ function wppa_convert_from_pretty( $uri ) {
383
  $deltauri = 'wppa-occur=';
384
  break;
385
  case 'pg':
386
- $deltauri = 'wppa-page=';
387
  break;
388
  case 'ss':
389
  $deltauri = 'wppa-searchstring=';
@@ -1104,7 +1104,7 @@ global $previous_page_last_id;
1104
  <a' .
1105
  ' style="cursor:pointer"' .
1106
  ' title="' . esc_attr( __( 'Previous page', 'wp-photo-album-plus' ) ) . '"' .
1107
- ' onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;wppa-page=' . ( $curpage - 1 ) . '\', \'' . wppa_convert_to_pretty ( $link_url . '&amp;wppa-page=' . ( $curpage - 1 ) ) . '\' )"' .
1108
  ' >' .
1109
  wppa_get_svghtml( 'Prev-Button', $iconsize ) .
1110
  '</a>
@@ -1119,7 +1119,7 @@ global $previous_page_last_id;
1119
  ' id="wppa-next-pagelink-' . $mocc . '"' .
1120
  ' style="cursor:pointer"' .
1121
  ' title="' . esc_attr( __( 'Next page', 'wp-photo-album-plus' ) ) . '"' .
1122
- ' onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;wppa-page=' . ( $curpage + 1 ) . '\', \'' . wppa_convert_to_pretty( $link_url . '&amp;wppa-page=' . ( $curpage + 1 ) ) . '\')"' .
1123
  ' >' .
1124
  wppa_get_svghtml( 'Next-Button', $iconsize ) .
1125
  '</a>
@@ -1150,7 +1150,7 @@ global $previous_page_last_id;
1150
  '<a' .
1151
  ' id="wppa-pagelink-' . $mocc . '-' . $i . '"' .
1152
  ' style="cursor:pointer"' .
1153
- ' onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;wppa-page=' . $i . '\', \'' . wppa_convert_to_pretty( $link_url . '&amp;wppa-page=' . $i ) . '\')"' .
1154
  ' >' .
1155
  '&nbsp;' . $i . '&nbsp;' .
1156
  '</a>';
@@ -1170,7 +1170,7 @@ global $previous_page_last_id;
1170
  $result .= '
1171
  <a
1172
  id="wppa-first-pagelink-' . $mocc . '"
1173
- onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;wppa-page=1\', \'' . wppa_convert_to_pretty( $link_url . '&amp;wppa-page=1' ) . '\')"
1174
  >
1175
  </a>
1176
  <a
@@ -1211,7 +1211,7 @@ global $previous_page_last_id;
1211
  </span>
1212
  <a
1213
  style="cursor:pointer"
1214
- onclick="wppaDoAjaxRender(' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;wppa-page=' . ( $curpage - 1 ) . '\', \'' . wppa_convert_to_pretty( $link_url . '&amp;wppa-page=' . ( $curpage - 1 ) ) . '\')"
1215
  >' .
1216
  __( 'Previous', 'wp-photo-album-plus' ) . '
1217
  </a>
@@ -1225,7 +1225,7 @@ global $previous_page_last_id;
1225
  <a
1226
  id="wppa-next-pagelink-' . $mocc . '"
1227
  style="cursor:pointer"
1228
- onclick="wppaDoAjaxRender(' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;wppa-page=' . ( $curpage + 1 ) . '\', \'' . wppa_convert_to_pretty( $link_url . '&amp;wppa-page=' . ( $curpage + 1 ) ) . '\')"
1229
  >' .
1230
  __( 'Next', 'wp-photo-album-plus' ) . '
1231
  </a>
@@ -1258,7 +1258,7 @@ global $previous_page_last_id;
1258
  <a
1259
  id="wppa-pagelink-' . $mocc . '-' . $i . '"
1260
  style="cursor:pointer"
1261
- onclick="wppaDoAjaxRender(' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;wppa-page=' . $i . '\', \'' . wppa_convert_to_pretty( $link_url . '&amp;wppa-page=' . $i ) . '\')"
1262
  >&nbsp;'.$i.'&nbsp;</a
1263
  >
1264
  </div>';
@@ -1274,7 +1274,7 @@ global $previous_page_last_id;
1274
  $result .= '
1275
  <a
1276
  id="wppa-first-pagelink-' . $mocc . '"
1277
- onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;wppa-page=1\', \'' . wppa_convert_to_pretty( $link_url . '&amp;wppa-page=1' ) . '\')"
1278
  >
1279
  </a>
1280
  <a
@@ -1310,7 +1310,7 @@ function wppa_album_download_link( $albumid ) {
1310
  class="wppa-album-cover-link"
1311
  title="' . esc_attr( __( 'Download', 'wp-photo-album-plus' ) ) . '"
1312
  >' .
1313
- __( 'Download Album', 'wp-photo-album-plus' ) . '
1314
  </a>
1315
  <img
1316
  id="dwnspin-' . $mocc . '-' . wppa_encrypt_album( $albumid ) . '"
@@ -2118,7 +2118,7 @@ global $thumbs_ids;
2118
  $i++;
2119
  }
2120
  if ( $page > '1' ) {
2121
- $thumbhref .= '&amp;wppa-page='.$page;
2122
  }
2123
  }
2124
 
4
  *
5
  * Frontend links
6
  *
7
+ * Version 8.3.01.001
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
360
  // process 'arguments'
361
  if ( is_array( $args ) && count( $args ) > 0 ) {
362
  $first = true;
363
+ $possible_conflicts = array( 'paged=' );
364
 
365
  foreach ( $args as $arg ) {
366
  if ( $first ) $newuri .= '?'; else $newuri .= '&';
383
  $deltauri = 'wppa-occur=';
384
  break;
385
  case 'pg':
386
+ $deltauri = 'paged=';
387
  break;
388
  case 'ss':
389
  $deltauri = 'wppa-searchstring=';
1104
  <a' .
1105
  ' style="cursor:pointer"' .
1106
  ' title="' . esc_attr( __( 'Previous page', 'wp-photo-album-plus' ) ) . '"' .
1107
+ ' onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;paged=' . ( $curpage - 1 ) . '\', \'' . wppa_convert_to_pretty ( $link_url . '&amp;paged=' . ( $curpage - 1 ) ) . '\' )"' .
1108
  ' >' .
1109
  wppa_get_svghtml( 'Prev-Button', $iconsize ) .
1110
  '</a>
1119
  ' id="wppa-next-pagelink-' . $mocc . '"' .
1120
  ' style="cursor:pointer"' .
1121
  ' title="' . esc_attr( __( 'Next page', 'wp-photo-album-plus' ) ) . '"' .
1122
+ ' onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;paged=' . ( $curpage + 1 ) . '\', \'' . wppa_convert_to_pretty( $link_url . '&amp;paged=' . ( $curpage + 1 ) ) . '\')"' .
1123
  ' >' .
1124
  wppa_get_svghtml( 'Next-Button', $iconsize ) .
1125
  '</a>
1150
  '<a' .
1151
  ' id="wppa-pagelink-' . $mocc . '-' . $i . '"' .
1152
  ' style="cursor:pointer"' .
1153
+ ' onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;paged=' . $i . '\', \'' . wppa_convert_to_pretty( $link_url . '&amp;paged=' . $i ) . '\')"' .
1154
  ' >' .
1155
  '&nbsp;' . $i . '&nbsp;' .
1156
  '</a>';
1170
  $result .= '
1171
  <a
1172
  id="wppa-first-pagelink-' . $mocc . '"
1173
+ onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;paged=1\', \'' . wppa_convert_to_pretty( $link_url . '&amp;paged=1' ) . '\')"
1174
  >
1175
  </a>
1176
  <a
1211
  </span>
1212
  <a
1213
  style="cursor:pointer"
1214
+ onclick="wppaDoAjaxRender(' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;paged=' . ( $curpage - 1 ) . '\', \'' . wppa_convert_to_pretty( $link_url . '&amp;paged=' . ( $curpage - 1 ) ) . '\')"
1215
  >' .
1216
  __( 'Previous', 'wp-photo-album-plus' ) . '
1217
  </a>
1225
  <a
1226
  id="wppa-next-pagelink-' . $mocc . '"
1227
  style="cursor:pointer"
1228
+ onclick="wppaDoAjaxRender(' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;paged=' . ( $curpage + 1 ) . '\', \'' . wppa_convert_to_pretty( $link_url . '&amp;paged=' . ( $curpage + 1 ) ) . '\')"
1229
  >' .
1230
  __( 'Next', 'wp-photo-album-plus' ) . '
1231
  </a>
1258
  <a
1259
  id="wppa-pagelink-' . $mocc . '-' . $i . '"
1260
  style="cursor:pointer"
1261
+ onclick="wppaDoAjaxRender(' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;paged=' . $i . '\', \'' . wppa_convert_to_pretty( $link_url . '&amp;paged=' . $i ) . '\')"
1262
  >&nbsp;'.$i.'&nbsp;</a
1263
  >
1264
  </div>';
1274
  $result .= '
1275
  <a
1276
  id="wppa-first-pagelink-' . $mocc . '"
1277
+ onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&amp;paged=1\', \'' . wppa_convert_to_pretty( $link_url . '&amp;paged=1' ) . '\')"
1278
  >
1279
  </a>
1280
  <a
1310
  class="wppa-album-cover-link"
1311
  title="' . esc_attr( __( 'Download', 'wp-photo-album-plus' ) ) . '"
1312
  >' .
1313
+ __( 'Download album', 'wp-photo-album-plus' ) . '
1314
  </a>
1315
  <img
1316
  id="dwnspin-' . $mocc . '-' . wppa_encrypt_album( $albumid ) . '"
2118
  $i++;
2119
  }
2120
  if ( $page > '1' ) {
2121
+ $thumbhref .= '&amp;paged='.$page;
2122
  }
2123
  }
2124
 
wppa-listtable.php ADDED
@@ -0,0 +1,1320 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* wppa-listtable.php
3
+ * Package: wp-photo-album-plus
4
+ *
5
+ * Copy of wp version
6
+ * Modified by OpaJaap
7
+ * Version 8.3.01.003
8
+ *
9
+ */
10
+
11
+
12
+ class WPPA_List_Table {
13
+
14
+ public $items;
15
+ protected $_args;
16
+ protected $_pagination_args = array();
17
+ private $_actions;
18
+ private $_pagination;
19
+ protected $modes = array();
20
+ protected $_column_headers;
21
+ protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
22
+ protected $compat_methods = array(
23
+ 'set_pagination_args',
24
+ 'get_views',
25
+ 'get_bulk_actions',
26
+ 'bulk_actions',
27
+ 'row_actions',
28
+ 'months_dropdown',
29
+ 'view_switcher',
30
+ 'comments_bubble',
31
+ 'get_items_per_page',
32
+ 'pagination',
33
+ 'get_sortable_columns',
34
+ 'get_column_info',
35
+ 'get_table_classes',
36
+ 'display_tablenav',
37
+ 'extra_tablenav',
38
+ 'single_row_columns',
39
+ );
40
+
41
+ public function __construct( $args = array() ) {
42
+ $args = wp_parse_args(
43
+ $args,
44
+ array(
45
+ 'plural' => '',
46
+ 'singular' => '',
47
+ 'ajax' => false,
48
+ 'screen' => null,
49
+ )
50
+ );
51
+
52
+ $this->screen = convert_to_screen( $args['screen'] );
53
+
54
+ add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
55
+
56
+ if ( ! $args['plural'] ) {
57
+ $args['plural'] = $this->screen->base;
58
+ }
59
+
60
+ $args['plural'] = sanitize_key( $args['plural'] );
61
+ $args['singular'] = sanitize_key( $args['singular'] );
62
+
63
+ $this->_args = $args;
64
+
65
+ if ( $args['ajax'] ) {
66
+ // wp_enqueue_script( 'list-table' );
67
+ add_action( 'admin_footer', array( $this, '_js_vars' ) );
68
+ }
69
+
70
+ if ( empty( $this->modes ) ) {
71
+ $this->modes = array(
72
+ 'list' => ( 'Compact view' ),
73
+ 'excerpt' => ( 'Extended view' ),
74
+ );
75
+ }
76
+ }
77
+
78
+ // Make private properties readable for backward compatibility.
79
+ public function __get( $name ) {
80
+ if ( in_array( $name, $this->compat_fields, true ) ) {
81
+ return $this->$name;
82
+ }
83
+ }
84
+
85
+ // Make private properties settable for backward compatibility.
86
+ public function __set( $name, $value ) {
87
+ if ( in_array( $name, $this->compat_fields, true ) ) {
88
+ return $this->$name = $value;
89
+ }
90
+ }
91
+
92
+ // Make private properties checkable for backward compatibility.
93
+ public function __isset( $name ) {
94
+ if ( in_array( $name, $this->compat_fields, true ) ) {
95
+ return isset( $this->$name );
96
+ }
97
+
98
+ return false;
99
+ }
100
+
101
+ // Make private properties un-settable for backward compatibility.
102
+ public function __unset( $name ) {
103
+ if ( in_array( $name, $this->compat_fields, true ) ) {
104
+ unset( $this->$name );
105
+ }
106
+ }
107
+
108
+ // Make private/protected methods readable for backward compatibility.
109
+ public function __call( $name, $arguments ) {
110
+ if ( in_array( $name, $this->compat_methods, true ) ) {
111
+ return $this->$name( ...$arguments );
112
+ }
113
+ return false;
114
+ }
115
+
116
+ // Checks the current user's permissions
117
+ public function ajax_user_can() {
118
+ die( 'function WP_List_Table::ajax_user_can() must be overridden in a subclass.' );
119
+ }
120
+
121
+ // Prepares the list of items for displaying.
122
+ public function prepare_items() {
123
+ die( 'function WP_List_Table::prepare_items() must be overridden in a subclass.' );
124
+ }
125
+
126
+ // An internal method that sets all the necessary pagination arguments
127
+ protected function set_pagination_args( $args ) {
128
+ $args = wp_parse_args(
129
+ $args,
130
+ array(
131
+ 'total_items' => 0,
132
+ 'total_pages' => 0,
133
+ 'per_page' => 0,
134
+ )
135
+ );
136
+
137
+ if ( ! $args['total_pages'] && $args['per_page'] > 0 ) {
138
+ $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
139
+ }
140
+
141
+ // Redirect if page number is invalid and headers are not already sent.
142
+ if ( ! headers_sent() && ! wp_doing_ajax() && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
143
+ wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
144
+ exit;
145
+ }
146
+
147
+ $this->_pagination_args = $args;
148
+ }
149
+
150
+ // Access the pagination args.
151
+ public function get_pagination_arg( $key ) {
152
+ if ( 'page' === $key ) {
153
+ return $this->get_pagenum();
154
+ }
155
+
156
+ if ( isset( $this->_pagination_args[ $key ] ) ) {
157
+ return $this->_pagination_args[ $key ];
158
+ }
159
+
160
+ return 0;
161
+ }
162
+
163
+ // Whether the table has items to display or not
164
+ public function has_items() {
165
+ return ! empty( $this->items );
166
+ }
167
+
168
+ // Message to be displayed when there are no items
169
+ public function no_items() {
170
+ _e( 'No items found.' );
171
+ }
172
+
173
+ // Displays the search box.
174
+ public function search_box( $text, $input_id ) {
175
+ if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
176
+ return;
177
+ }
178
+
179
+ $input_id = $input_id . '-search-input';
180
+
181
+ if ( ! empty( $_REQUEST['orderby'] ) ) {
182
+ echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
183
+ }
184
+ if ( ! empty( $_REQUEST['order'] ) ) {
185
+ echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
186
+ }
187
+ if ( ! empty( $_REQUEST['post_mime_type'] ) ) {
188
+ echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
189
+ }
190
+ if ( ! empty( $_REQUEST['detached'] ) ) {
191
+ echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
192
+ }
193
+ ?>
194
+ <p class="search-box">
195
+ <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
196
+ <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" />
197
+ <?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>
198
+ </p>
199
+ <?php
200
+ }
201
+
202
+ // Generates views links.
203
+ protected function get_views_links( $link_data = array() ) {
204
+ if ( ! is_array( $link_data ) ) {
205
+ _doing_it_wrong(
206
+ __METHOD__,
207
+ sprintf(
208
+ /* translators: %s: The $link_data argument. */
209
+ ( 'The %s argument must be an array.' ),
210
+ '<code>$link_data</code>'
211
+ ),
212
+ '6.1.0'
213
+ );
214
+
215
+ return array( '' );
216
+ }
217
+
218
+ $views_links = array();
219
+
220
+ foreach ( $link_data as $view => $link ) {
221
+ if ( empty( $link['url'] ) || ! is_string( $link['url'] ) || '' === trim( $link['url'] ) ) {
222
+ _doing_it_wrong(
223
+ __METHOD__,
224
+ sprintf(
225
+ /* translators: %1$s: The argument name. %2$s: The view name. */
226
+ ( 'The %1$s argument must be a non-empty string for %2$s.' ),
227
+ '<code>url</code>',
228
+ '<code>' . esc_html( $view ) . '</code>'
229
+ ),
230
+ '6.1.0'
231
+ );
232
+
233
+ continue;
234
+ }
235
+
236
+ if ( empty( $link['label'] ) || ! is_string( $link['label'] ) || '' === trim( $link['label'] ) ) {
237
+ _doing_it_wrong(
238
+ __METHOD__,
239
+ sprintf(
240
+ /* translators: %1$s: The argument name. %2$s: The view name. */
241
+ ( 'The %1$s argument must be a non-empty string for %2$s.' ),
242
+ '<code>label</code>',
243
+ '<code>' . esc_html( $view ) . '</code>'
244
+ ),
245
+ '6.1.0'
246
+ );
247
+
248
+ continue;
249
+ }
250
+
251
+ $views_links[ $view ] = sprintf(
252
+ '<a href="%s"%s>%s</a>',
253
+ esc_url( $link['url'] ),
254
+ isset( $link['current'] ) && true === $link['current'] ? ' class="current" aria-current="page"' : '',
255
+ $link['label']
256
+ );
257
+ }
258
+
259
+ return $views_links;
260
+ }
261
+
262
+ // Gets the list of views available on this table.
263
+ protected function get_views() {
264
+ return array();
265
+ }
266
+
267
+ // Displays the list of views available on this table.
268
+ public function views() {
269
+ $views = $this->get_views();
270
+ /**
271
+ * Filters the list of available list table views.
272
+ *
273
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
274
+ * to the ID of the current screen.
275
+ *
276
+ * @since 3.1.0
277
+ *
278
+ * @param string[] $views An array of available list table views.
279
+ */
280
+ $views = apply_filters( "views_{$this->screen->id}", $views );
281
+
282
+ if ( empty( $views ) ) {
283
+ return;
284
+ }
285
+
286
+ $this->screen->render_screen_reader_content( 'heading_views' );
287
+
288
+ echo "<ul class='subsubsub'>\n";
289
+ foreach ( $views as $class => $view ) {
290
+ $views[ $class ] = "\t<li class='$class'>$view";
291
+ }
292
+ echo implode( " |</li>\n", $views ) . "</li>\n";
293
+ echo '</ul>';
294
+ }
295
+
296
+ // Retrieves the list of bulk actions available for this table.
297
+ protected function get_bulk_actions() {
298
+ return array();
299
+ }
300
+
301
+ // Displays the bulk actions dropdown.
302
+ protected function bulk_actions( $which = '' ) {
303
+ if ( is_null( $this->_actions ) ) {
304
+ $this->_actions = $this->get_bulk_actions();
305
+
306
+ /**
307
+ * Filters the items in the bulk actions menu of the list table.
308
+ *
309
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
310
+ * to the ID of the current screen.
311
+ *
312
+ * @since 3.1.0
313
+ * @since 5.6.0 A bulk action can now contain an array of options in order to create an optgroup.
314
+ *
315
+ * @param array $actions An array of the available bulk actions.
316
+ */
317
+ $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
318
+
319
+ $two = '';
320
+ } else {
321
+ $two = '2';
322
+ }
323
+
324
+ if ( empty( $this->_actions ) ) {
325
+ return;
326
+ }
327
+
328
+ echo '<label for="bulk-action-selector-' . esc_attr( $which ) . '" class="screen-reader-text">' . ( 'Select bulk action' ) . '</label>';
329
+ echo '<select name="action' . $two . '" id="bulk-action-selector-' . esc_attr( $which ) . "\">\n";
330
+ echo '<option value="-1">' . ( 'Bulk actions' ) . "</option>\n";
331
+
332
+ foreach ( $this->_actions as $key => $value ) {
333
+ if ( is_array( $value ) ) {
334
+ echo "\t" . '<optgroup label="' . esc_attr( $key ) . '">' . "\n";
335
+
336
+ foreach ( $value as $name => $title ) {
337
+ $class = ( 'edit' === $name ) ? ' class="hide-if-no-js"' : '';
338
+
339
+ echo "\t\t" . '<option value="' . esc_attr( $name ) . '"' . $class . '>' . $title . "</option>\n";
340
+ }
341
+ echo "\t" . "</optgroup>\n";
342
+ } else {
343
+ $class = ( 'edit' === $key ) ? ' class="hide-if-no-js"' : '';
344
+
345
+ echo "\t" . '<option value="' . esc_attr( $key ) . '"' . $class . '>' . $value . "</option>\n";
346
+ }
347
+ }
348
+
349
+ echo "</select>\n";
350
+
351
+ submit_button( ( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
352
+ echo "\n";
353
+ }
354
+
355
+ // Gets the current action selected from the bulk actions dropdown.
356
+ public function current_action() {
357
+ if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) ) {
358
+ return false;
359
+ }
360
+
361
+ if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
362
+ return $_REQUEST['action'];
363
+ }
364
+
365
+ return false;
366
+ }
367
+
368
+ // Generates the required HTML for a list of row action links.
369
+ protected function row_actions( $actions, $always_visible = false ) {
370
+ $action_count = count( $actions );
371
+
372
+ if ( ! $action_count ) {
373
+ return '';
374
+ }
375
+
376
+ $mode = get_user_setting( 'posts_list_mode', 'list' );
377
+
378
+ if ( 'excerpt' === $mode ) {
379
+ $always_visible = true;
380
+ }
381
+
382
+ $output = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
383
+
384
+ $i = 0;
385
+
386
+ foreach ( $actions as $action => $link ) {
387
+ ++$i;
388
+
389
+ $separator = ( $i < $action_count ) ? ' | ' : '';
390
+
391
+ $output .= "<span class='$action'>{$link}{$separator}</span>";
392
+ }
393
+
394
+ $output .= '</div>';
395
+
396
+ $output .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . ( 'Show more details' ) . '</span></button>';
397
+
398
+ return $output;
399
+ }
400
+
401
+ // Displays a dropdown for filtering items in the list table by month.
402
+ protected function months_dropdown( $post_type ) {
403
+ global $wpdb, $wp_locale;
404
+
405
+ /**
406
+ * Filters whether to remove the 'Months' drop-down from the post list table.
407
+ *
408
+ * @since 4.2.0
409
+ *
410
+ * @param bool $disable Whether to disable the drop-down. Default false.
411
+ * @param string $post_type The post type.
412
+ */
413
+ if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
414
+ return;
415
+ }
416
+
417
+ /**
418
+ * Filters whether to short-circuit performing the months dropdown query.
419
+ *
420
+ * @since 5.7.0
421
+ *
422
+ * @param object[]|false $months 'Months' drop-down results. Default false.
423
+ * @param string $post_type The post type.
424
+ */
425
+ $months = apply_filters( 'pre_months_dropdown_query', false, $post_type );
426
+
427
+ if ( ! is_array( $months ) ) {
428
+ $extra_checks = "AND post_status != 'auto-draft'";
429
+ if ( ! isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) {
430
+ $extra_checks .= " AND post_status != 'trash'";
431
+ } elseif ( isset( $_GET['post_status'] ) ) {
432
+ $extra_checks = $wpdb->prepare( ' AND post_status = %s', $_GET['post_status'] );
433
+ }
434
+
435
+ $months = $wpdb->get_results(
436
+ $wpdb->prepare(
437
+ "
438
+ SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
439
+ FROM $wpdb->posts
440
+ WHERE post_type = %s
441
+ $extra_checks
442
+ ORDER BY post_date DESC
443
+ ",
444
+ $post_type
445
+ )
446
+ );
447
+ }
448
+
449
+ /**
450
+ * Filters the 'Months' drop-down results.
451
+ *
452
+ * @since 3.7.0
453
+ *
454
+ * @param object[] $months Array of the months drop-down query results.
455
+ * @param string $post_type The post type.
456
+ */
457
+ $months = apply_filters( 'months_dropdown_results', $months, $post_type );
458
+
459
+ $month_count = count( $months );
460
+
461
+ if ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {
462
+ return;
463
+ }
464
+
465
+ $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
466
+ ?>
467
+ <label for="filter-by-date" class="screen-reader-text"><?php echo get_post_type_object( $post_type )->labels->filter_by_date; ?></label>
468
+ <select name="m" id="filter-by-date">
469
+ <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
470
+ <?php
471
+ foreach ( $months as $arc_row ) {
472
+ if ( 0 == $arc_row->year ) {
473
+ continue;
474
+ }
475
+
476
+ $month = zeroise( $arc_row->month, 2 );
477
+ $year = $arc_row->year;
478
+
479
+ printf(
480
+ "<option %s value='%s'>%s</option>\n",
481
+ selected( $m, $year . $month, false ),
482
+ esc_attr( $arc_row->year . $month ),
483
+ /* translators: 1: Month name, 2: 4-digit year. */
484
+ sprintf( ( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
485
+ );
486
+ }
487
+ ?>
488
+ </select>
489
+ <?php
490
+ }
491
+
492
+ // Displays a view switcher.
493
+ protected function view_switcher( $current_mode ) {
494
+ ?>
495
+ <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
496
+ <div class="view-switch">
497
+ <?php
498
+ foreach ( $this->modes as $mode => $title ) {
499
+ $classes = array( 'view-' . $mode );
500
+ $aria_current = '';
501
+
502
+ if ( $current_mode === $mode ) {
503
+ $classes[] = 'current';
504
+ $aria_current = ' aria-current="page"';
505
+ }
506
+
507
+ printf(
508
+ "<a href='%s' class='%s' id='view-switch-$mode'$aria_current><span class='screen-reader-text'>%s</span></a>\n",
509
+ esc_url( remove_query_arg( 'attachment-filter', add_query_arg( 'mode', $mode ) ) ),
510
+ implode( ' ', $classes ),
511
+ $title
512
+ );
513
+ }
514
+ ?>
515
+ </div>
516
+ <?php
517
+ }
518
+
519
+ // Displays a comment count bubble.
520
+ protected function comments_bubble( $post_id, $pending_comments ) {
521
+ $approved_comments = get_comments_number();
522
+
523
+ $approved_comments_number = number_format_i18n( $approved_comments );
524
+ $pending_comments_number = number_format_i18n( $pending_comments );
525
+
526
+ $approved_only_phrase = sprintf(
527
+ /* translators: %s: Number of comments. */
528
+ _n( '%s comment', '%s comments', $approved_comments ),
529
+ $approved_comments_number
530
+ );
531
+
532
+ $approved_phrase = sprintf(
533
+ /* translators: %s: Number of comments. */
534
+ _n( '%s approved comment', '%s approved comments', $approved_comments ),
535
+ $approved_comments_number
536
+ );
537
+
538
+ $pending_phrase = sprintf(
539
+ /* translators: %s: Number of comments. */
540
+ _n( '%s pending comment', '%s pending comments', $pending_comments ),
541
+ $pending_comments_number
542
+ );
543
+
544
+ if ( ! $approved_comments && ! $pending_comments ) {
545
+ // No comments at all.
546
+ printf(
547
+ '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">%s</span>',
548
+ ( 'No comments' )
549
+ );
550
+ } elseif ( $approved_comments && 'trash' === get_post_status( $post_id ) ) {
551
+ // Don't link the comment bubble for a trashed post.
552
+ printf(
553
+ '<span class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
554
+ $approved_comments_number,
555
+ $pending_comments ? $approved_phrase : $approved_only_phrase
556
+ );
557
+ } elseif ( $approved_comments ) {
558
+ // Link the comment bubble to approved comments.
559
+ printf(
560
+ '<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
561
+ esc_url(
562
+ add_query_arg(
563
+ array(
564
+ 'p' => $post_id,
565
+ 'comment_status' => 'approved',
566
+ ),
567
+ admin_url( 'edit-comments.php' )
568
+ )
569
+ ),
570
+ $approved_comments_number,
571
+ $pending_comments ? $approved_phrase : $approved_only_phrase
572
+ );
573
+ } else {
574
+ // Don't link the comment bubble when there are no approved comments.
575
+ printf(
576
+ '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
577
+ $approved_comments_number,
578
+ $pending_comments ? ( 'No approved comments' ) : ( 'No comments' )
579
+ );
580
+ }
581
+
582
+ if ( $pending_comments ) {
583
+ printf(
584
+ '<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
585
+ esc_url(
586
+ add_query_arg(
587
+ array(
588
+ 'p' => $post_id,
589
+ 'comment_status' => 'moderated',
590
+ ),
591
+ admin_url( 'edit-comments.php' )
592
+ )
593
+ ),
594
+ $pending_comments_number,
595
+ $pending_phrase
596
+ );
597
+ } else {
598
+ printf(
599
+ '<span class="post-com-count post-com-count-pending post-com-count-no-pending"><span class="comment-count comment-count-no-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
600
+ $pending_comments_number,
601
+ $approved_comments ? ( 'No pending comments' ) : ( 'No comments' )
602
+ );
603
+ }
604
+ }
605
+
606
+ // Gets the current page number.
607
+ public function get_pagenum() {
608
+ $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
609
+
610
+ if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) {
611
+ $pagenum = $this->_pagination_args['total_pages'];
612
+ }
613
+
614
+ return max( 1, $pagenum );
615
+ }
616
+
617
+ // Gets the number of items to display on a single page.
618
+ protected function get_items_per_page( $option, $default_value = 20 ) {
619
+ $per_page = (int) get_user_option( $option );
620
+ if ( empty( $per_page ) || $per_page < 1 ) {
621
+ $per_page = $default_value;
622
+ }
623
+
624
+ /**
625
+ * Filters the number of items to be displayed on each page of the list table.
626
+ *
627
+ * The dynamic hook name, `$option`, refers to the `per_page` option depending
628
+ * on the type of list table in use. Possible filter names include:
629
+ *
630
+ * - `edit_comments_per_page`
631
+ * - `sites_network_per_page`
632
+ * - `site_themes_network_per_page`
633
+ * - `themes_network_per_page'`
634
+ * - `users_network_per_page`
635
+ * - `edit_post_per_page`
636
+ * - `edit_page_per_page'`
637
+ * - `edit_{$post_type}_per_page`
638
+ * - `edit_post_tag_per_page`
639
+ * - `edit_category_per_page`
640
+ * - `edit_{$taxonomy}_per_page`
641
+ * - `site_users_network_per_page`
642
+ * - `users_per_page`
643
+ *
644
+ * @since 2.9.0
645
+ *
646
+ * @param int $per_page Number of items to be displayed. Default 20.
647
+ */
648
+ return (int) apply_filters( "{$option}", $per_page );
649
+ }
650
+
651
+ /**
652
+ * Displays the pagination.
653
+ *
654
+ * @since 3.1.0
655
+ *
656
+ * @param string $which
657
+ */
658
+ protected function pagination( $which ) {
659
+ if ( empty( $this->_pagination_args ) ) {
660
+ return;
661
+ }
662
+
663
+ $total_items = $this->_pagination_args['total_items'];
664
+
665
+ // By opaJaap, if less than one full page of the smallest kind, ignore baging
666
+ if ( $total_items < '21' ) {
667
+ return;
668
+ } // End mod
669
+
670
+ $total_pages = $this->_pagination_args['total_pages'];
671
+ $infinite_scroll = false;
672
+ if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
673
+ $infinite_scroll = $this->_pagination_args['infinite_scroll'];
674
+ }
675
+
676
+ if ( 'top' === $which && $total_pages > 1 ) {
677
+ $this->screen->render_screen_reader_content( 'heading_pagination' );
678
+ }
679
+
680
+ $output = '<span class="displaying-num">' . sprintf(
681
+ /* translators: %s: Number of items. */
682
+ _n( '%s item', '%s items', $total_items ),
683
+ number_format_i18n( $total_items )
684
+ ) . '</span>';
685
+
686
+ $current = $this->get_pagenum();
687
+ $removable_query_args = wp_removable_query_args();
688
+
689
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
690
+
691
+ $current_url = remove_query_arg( $removable_query_args, $current_url );
692
+
693
+ $page_links = array();
694
+
695
+ $total_pages_before = '<span class="paging-input">';
696
+ $total_pages_after = '</span></span>';
697
+
698
+ $disable_first = false;
699
+ $disable_last = false;
700
+ $disable_prev = false;
701
+ $disable_next = false;
702
+
703
+ if ( 1 == $current ) {
704
+ $disable_first = true;
705
+ $disable_prev = true;
706
+ }
707
+ if ( $total_pages == $current ) {
708
+ $disable_last = true;
709
+ $disable_next = true;
710
+ }
711
+
712
+ if ( $disable_first ) {
713
+ $page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&laquo;</span>';
714
+ } else {
715
+ $page_links[] = sprintf(
716
+ "<a class='first-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
717
+ esc_url( remove_query_arg( 'paged', $current_url ) ),
718
+ ( 'First page' ),
719
+ '&laquo;'
720
+ );
721
+ }
722
+
723
+ if ( $disable_prev ) {
724
+ $page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&lsaquo;</span>';
725
+ } else {
726
+ $page_links[] = sprintf(
727
+ "<a class='prev-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
728
+ esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),
729
+ ( 'Previous page' ),
730
+ '&lsaquo;'
731
+ );
732
+ }
733
+
734
+ if ( 'bottom' === $which ) {
735
+ $html_current_page = $current;
736
+ $total_pages_before = '<span class="screen-reader-text">' . ( 'Current Page' ) . '</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">';
737
+ } else {
738
+ $html_current_page = sprintf(
739
+ "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' /><span class='tablenav-paging-text'>",
740
+ '<label for="current-page-selector" class="screen-reader-text">' . ( 'Current Page' ) . '</label>',
741
+ $current,
742
+ strlen( $total_pages )
743
+ );
744
+ }
745
+ $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
746
+ $page_links[] = $total_pages_before . sprintf(
747
+ /* translators: 1: Current page, 2: Total pages. */
748
+ _x( '%1$s of %2$s', 'paging' ),
749
+ $html_current_page,
750
+ $html_total_pages
751
+ ) . $total_pages_after;
752
+
753
+ if ( $disable_next ) {
754
+ $page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&rsaquo;</span>';
755
+ } else {
756
+ $page_links[] = sprintf(
757
+ "<a class='next-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
758
+ esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),
759
+ ( 'Next page' ),
760
+ '&rsaquo;'
761
+ );
762
+ }
763
+
764
+ if ( $disable_last ) {
765
+ $page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&raquo;</span>';
766
+ } else {
767
+ $page_links[] = sprintf(
768
+ "<a class='last-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
769
+ esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
770
+ ( 'Last page' ),
771
+ '&raquo;'
772
+ );
773
+ }
774
+
775
+ $pagination_links_class = 'pagination-links';
776
+ if ( ! empty( $infinite_scroll ) ) {
777
+ $pagination_links_class .= ' hide-if-js';
778
+ }
779
+ $output .= "\n<span class='$pagination_links_class'>" . implode( "\n", $page_links ) . '</span>';
780
+
781
+ if ( $total_pages ) {
782
+ $page_class = $total_pages < 2 ? ' one-page' : '';
783
+ } else {
784
+ $page_class = ' no-pages';
785
+ }
786
+
787
+ /**/
788
+ // Added by OpaJaap: page size selector
789
+ $ps = $this->_pagination_args['per_page']; // current pagesize
790
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
791
+ $current_url = remove_query_arg( 'paged', $current_url );
792
+ $output .= '
793
+ <span>' . __( 'Page size', 'wp-photo-album-plus' ) . '
794
+ <select
795
+ style="margin-bottom:3px"
796
+ onchange="jQuery( \'#wppa-admin-spinner\' ).show();document.location.href=\''.$current_url.'&paged=1&wppa-pagesize=\'+this.value;"
797
+ >
798
+ <option value="20" ' . ( $ps == '20' ? 'selected' : '' ) . '>20</option>
799
+ <option value="50" ' . ( $ps == '50' ? 'selected' : '' ) . '>50</option>
800
+ <option value="100" ' . ( $ps == '100' ? 'selected' : '' ) . '>100</option>
801
+ <option value="200" ' . ( $ps == '200' ? 'selected' : '' ) . '>200</option>
802
+ <option value="500" ' . ( $ps == '500' ? 'selected' : '' ) . '>500</option>
803
+ <option value="1000" ' . ( $ps == '1000' ? 'selected' : '' ) . '>1000</option>
804
+ </select>
805
+ </span>';
806
+ /**/
807
+
808
+ $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
809
+
810
+ echo $this->_pagination;
811
+ }
812
+
813
+ // Gets a list of columns.
814
+ public function get_columns() {
815
+ die( 'function WP_List_Table::get_columns() must be overridden in a subclass.' );
816
+ }
817
+
818
+ // Gets a list of sortable columns.
819
+ protected function get_sortable_columns() {
820
+ return array();
821
+ }
822
+
823
+ // Gets the name of the default primary column.
824
+ protected function get_default_primary_column_name() {
825
+ $columns = $this->get_columns();
826
+ $column = '';
827
+
828
+ if ( empty( $columns ) ) {
829
+ return $column;
830
+ }
831
+
832
+ // We need a primary defined so responsive views show something,
833
+ // so let's fall back to the first non-checkbox column.
834
+ foreach ( $columns as $col => $column_name ) {
835
+ if ( 'cb' === $col ) {
836
+ continue;
837
+ }
838
+
839
+ $column = $col;
840
+ break;
841
+ }
842
+
843
+ return $column;
844
+ }
845
+
846
+ /**
847
+ * Public wrapper for WP_List_Table::get_default_primary_column_name().
848
+ *
849
+ * @since 4.4.0
850
+ *
851
+ * @return string Name of the default primary column.
852
+ */
853
+ public function get_primary_column() {
854
+ return $this->get_primary_column_name();
855
+ }
856
+
857
+ /**
858
+ * Gets the name of the primary column.
859
+ *
860
+ * @since 4.3.0
861
+ *
862
+ * @return string The name of the primary column.
863
+ */
864
+ protected function get_primary_column_name() {
865
+ $columns = get_column_headers( $this->screen );
866
+ $default = $this->get_default_primary_column_name();
867
+
868
+ // If the primary column doesn't exist,
869
+ // fall back to the first non-checkbox column.
870
+ if ( ! isset( $columns[ $default ] ) ) {
871
+ $default = self::get_default_primary_column_name();
872
+ }
873
+
874
+ /**
875
+ * Filters the name of the primary column for the current list table.
876
+ *
877
+ * @since 4.3.0
878
+ *
879
+ * @param string $default Column name default for the specific list table, e.g. 'name'.
880
+ * @param string $context Screen ID for specific list table, e.g. 'plugins'.
881
+ */
882
+ $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
883
+
884
+ if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
885
+ $column = $default;
886
+ }
887
+
888
+ return $column;
889
+ }
890
+
891
+ /**
892
+ * Gets a list of all, hidden, and sortable columns, with filter applied.
893
+ *
894
+ * @since 3.1.0
895
+ *
896
+ * @return array
897
+ */
898
+ protected function get_column_info() {
899
+ // $_column_headers is already set / cached.
900
+ if (
901
+ isset( $this->_column_headers ) &&
902
+ is_array( $this->_column_headers )
903
+ ) {
904
+ /*
905
+ * Backward compatibility for `$_column_headers` format prior to WordPress 4.3.
906
+ *
907
+ * In WordPress 4.3 the primary column name was added as a fourth item in the
908
+ * column headers property. This ensures the primary column name is included
909
+ * in plugins setting the property directly in the three item format.
910
+ */
911
+ if ( 4 === count( $this->_column_headers ) ) {
912
+ return $this->_column_headers;
913
+ }
914
+
915
+ $column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
916
+ foreach ( $this->_column_headers as $key => $value ) {
917
+ $column_headers[ $key ] = $value;
918
+ }
919
+
920
+ $this->_column_headers = $column_headers;
921
+
922
+ return $this->_column_headers;
923
+ }
924
+
925
+ $columns = get_column_headers( $this->screen );
926
+ $hidden = get_hidden_columns( $this->screen );
927
+
928
+ $sortable_columns = $this->get_sortable_columns();
929
+ /**
930
+ * Filters the list table sortable columns for a specific screen.
931
+ *
932
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
933
+ * to the ID of the current screen.
934
+ *
935
+ * @since 3.1.0
936
+ *
937
+ * @param array $sortable_columns An array of sortable columns.
938
+ */
939
+ $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
940
+
941
+ $sortable = array();
942
+ foreach ( $_sortable as $id => $data ) {
943
+ if ( empty( $data ) ) {
944
+ continue;
945
+ }
946
+
947
+ $data = (array) $data;
948
+ if ( ! isset( $data[1] ) ) {
949
+ $data[1] = false;
950
+ }
951
+
952
+ $sortable[ $id ] = $data;
953
+ }
954
+
955
+ $primary = $this->get_primary_column_name();
956
+ $this->_column_headers = array( $columns, $hidden, $sortable, $primary );
957
+
958
+ return $this->_column_headers;
959
+ }
960
+
961
+ /**
962
+ * Returns the number of visible columns.
963
+ *
964
+ * @since 3.1.0
965
+ *
966
+ * @return int
967
+ */
968
+ public function get_column_count() {
969
+ list ( $columns, $hidden ) = $this->get_column_info();
970
+ $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
971
+ return count( $columns ) - count( $hidden );
972
+ }
973
+
974
+ /**
975
+ * Prints column headers, accounting for hidden and sortable columns.
976
+ *
977
+ * @since 3.1.0
978
+ *
979
+ * @param bool $with_id Whether to set the ID attribute or not
980
+ */
981
+ public function print_column_headers( $with_id = true ) {
982
+ list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
983
+
984
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
985
+ $current_url = remove_query_arg( 'paged', $current_url );
986
+
987
+ if ( isset( $_GET['orderby'] ) ) {
988
+ $current_orderby = $_GET['orderby'];
989
+ } else {
990
+ $current_orderby = '';
991
+ }
992
+
993
+ if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {
994
+ $current_order = 'desc';
995
+ } else {
996
+ $current_order = 'asc';
997
+ }
998
+
999
+ if ( ! empty( $columns['cb'] ) ) {
1000
+ static $cb_counter = 1;
1001
+ $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . ( 'Select All' ) . '</label>'
1002
+ . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
1003
+ $cb_counter++;
1004
+ }
1005
+
1006
+ foreach ( $columns as $column_key => $column_display_name ) {
1007
+ $class = array( 'manage-column', "column-$column_key" );
1008
+
1009
+ if ( in_array( $column_key, $hidden, true ) ) {
1010
+ $class[] = 'hidden';
1011
+ }
1012
+
1013
+ if ( 'cb' === $column_key ) {
1014
+ $class[] = 'check-column';
1015
+ } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ), true ) ) {
1016
+ $class[] = 'num';
1017
+ }
1018
+
1019
+ if ( $column_key === $primary ) {
1020
+ $class[] = 'column-primary';
1021
+ }
1022
+
1023
+ if ( isset( $sortable[ $column_key ] ) ) {
1024
+ list( $orderby, $desc_first ) = $sortable[ $column_key ];
1025
+
1026
+ if ( $current_orderby === $orderby ) {
1027
+ $order = 'asc' === $current_order ? 'desc' : 'asc';
1028
+
1029
+ $class[] = 'sorted';
1030
+ $class[] = $current_order;
1031
+ } else {
1032
+ $order = strtolower( $desc_first );
1033
+
1034
+ if ( ! in_array( $order, array( 'desc', 'asc' ), true ) ) {
1035
+ $order = $desc_first ? 'desc' : 'asc';
1036
+ }
1037
+
1038
+ $class[] = 'sortable';
1039
+ $class[] = 'desc' === $order ? 'asc' : 'desc';
1040
+ }
1041
+
1042
+ $column_display_name = sprintf(
1043
+ '<a href="%s"><span>%s</span><span class="sorting-indicator"></span></a>',
1044
+ esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ),
1045
+ $column_display_name
1046
+ );
1047
+ }
1048
+
1049
+ $tag = ( 'cb' === $column_key ) ? 'td' : 'th';
1050
+ $scope = ( 'th' === $tag ) ? 'scope="col"' : '';
1051
+ $id = $with_id ? "id='$column_key'" : '';
1052
+
1053
+ if ( ! empty( $class ) ) {
1054
+ $class = "class='" . implode( ' ', $class ) . "'";
1055
+ }
1056
+
1057
+ echo "<$tag $scope $id $class>$column_display_name</$tag>";
1058
+ }
1059
+ }
1060
+
1061
+ /**
1062
+ * Displays the table.
1063
+ *
1064
+ * @since 3.1.0
1065
+ */
1066
+ public function display() {
1067
+ $singular = $this->_args['singular'];
1068
+
1069
+ $this->display_tablenav( 'top' );
1070
+
1071
+ $this->screen->render_screen_reader_content( 'heading_list' );
1072
+ ?>
1073
+ <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
1074
+ <thead>
1075
+ <tr>
1076
+ <?php $this->print_column_headers(); ?>
1077
+ </tr>
1078
+ </thead>
1079
+
1080
+ <tbody id="the-list"
1081
+ <?php
1082
+ if ( $singular ) {
1083
+ echo " data-wp-lists='list:$singular'";
1084
+ }
1085
+ ?>
1086
+ >
1087
+ <?php $this->display_rows_or_placeholder(); ?>
1088
+ </tbody>
1089
+
1090
+ <tfoot>
1091
+ <tr>
1092
+ <?php $this->print_column_headers( false ); ?>
1093
+ </tr>
1094
+ </tfoot>
1095
+
1096
+ </table>
1097
+ <?php
1098
+ $this->display_tablenav( 'bottom' );
1099
+ }
1100
+
1101
+ /**
1102
+ * Gets a list of CSS classes for the WP_List_Table table tag.
1103
+ *
1104
+ * @since 3.1.0
1105
+ *
1106
+ * @return string[] Array of CSS classes for the table tag.
1107
+ */
1108
+ protected function get_table_classes() {
1109
+ $mode = get_user_setting( 'posts_list_mode', 'list' );
1110
+
1111
+ $mode_class = esc_attr( 'table-view-' . $mode );
1112
+
1113
+ return array( 'widefat', 'fixed', 'striped', $mode_class, $this->_args['plural'] );
1114
+ }
1115
+
1116
+ /**
1117
+ * Generates the table navigation above or below the table
1118
+ *
1119
+ * @since 3.1.0
1120
+ * @param string $which
1121
+ */
1122
+ protected function display_tablenav( $which ) {
1123
+ if ( 'top' === $which ) {
1124
+ wp_nonce_field( 'bulk-' . $this->_args['plural'] );
1125
+ }
1126
+ ?>
1127
+ <div class="tablenav <?php echo esc_attr( $which ); ?>">
1128
+
1129
+ <?php if ( $this->has_items() ) : ?>
1130
+ <div class="alignleft actions bulkactions">
1131
+ <?php $this->bulk_actions( $which ); ?>
1132
+ </div>
1133
+ <?php
1134
+ endif;
1135
+ $this->extra_tablenav( $which );
1136
+ $this->pagination( $which );
1137
+ ?>
1138
+
1139
+ <br class="clear" />
1140
+ </div>
1141
+ <?php
1142
+ }
1143
+
1144
+ /**
1145
+ * Extra controls to be displayed between bulk actions and pagination.
1146
+ *
1147
+ * @since 3.1.0
1148
+ *
1149
+ * @param string $which
1150
+ */
1151
+ protected function extra_tablenav( $which ) {}
1152
+
1153
+ /**
1154
+ * Generates the tbody element for the list table.
1155
+ *
1156
+ * @since 3.1.0
1157
+ */
1158
+ public function display_rows_or_placeholder() {
1159
+ if ( $this->has_items() ) {
1160
+ $this->display_rows();
1161
+ } else {
1162
+ echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
1163
+ $this->no_items();
1164
+ echo '</td></tr>';
1165
+ }
1166
+ }
1167
+
1168
+ /**
1169
+ * Generates the table rows.
1170
+ *
1171
+ * @since 3.1.0
1172
+ */
1173
+ public function display_rows() {
1174
+ foreach ( $this->items as $item ) {
1175
+ $this->single_row( $item );
1176
+ }
1177
+ }
1178
+
1179
+ /**
1180
+ * Generates content for a single row of the table.
1181
+ *
1182
+ * @since 3.1.0
1183
+ *
1184
+ * @param object|array $item The current item
1185
+ */
1186
+ public function single_row( $item ) {
1187
+ echo '<tr>';
1188
+ $this->single_row_columns( $item );
1189
+ echo '</tr>';
1190
+ }
1191
+
1192
+ /**
1193
+ * @param object|array $item
1194
+ * @param string $column_name
1195
+ */
1196
+ protected function column_default( $item, $column_name ) {}
1197
+
1198
+ /**
1199
+ * @param object|array $item
1200
+ */
1201
+ protected function column_cb( $item ) {}
1202
+
1203
+ /**
1204
+ * Generates the columns for a single row of the table.
1205
+ *
1206
+ * @since 3.1.0
1207
+ *
1208
+ * @param object|array $item The current item.
1209
+ */
1210
+ protected function single_row_columns( $item ) {
1211
+ list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
1212
+
1213
+ foreach ( $columns as $column_name => $column_display_name ) {
1214
+ $classes = "$column_name column-$column_name";
1215
+ if ( $primary === $column_name ) {
1216
+ $classes .= ' has-row-actions column-primary';
1217
+ }
1218
+
1219
+ if ( in_array( $column_name, $hidden, true ) ) {
1220
+ $classes .= ' hidden';
1221
+ }
1222
+
1223
+ // Comments column uses HTML in the display name with screen reader text.
1224
+ // Strip tags to get closer to a user-friendly string.
1225
+ $data = 'data-colname="' . esc_attr( wp_strip_all_tags( $column_display_name ) ) . '"';
1226
+
1227
+ $attributes = "class='$classes' $data";
1228
+
1229
+ if ( 'cb' === $column_name ) {
1230
+ echo '<th scope="row" class="check-column">';
1231
+ echo $this->column_cb( $item );
1232
+ echo '</th>';
1233
+ } elseif ( method_exists( $this, '_column_' . $column_name ) ) {
1234
+ echo call_user_func(
1235
+ array( $this, '_column_' . $column_name ),
1236
+ $item,
1237
+ $classes,
1238
+ $data,
1239
+ $primary
1240
+ );
1241
+ } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
1242
+ echo "<td $attributes>";
1243
+ echo call_user_func( array( $this, 'column_' . $column_name ), $item );
1244
+ echo $this->handle_row_actions( $item, $column_name, $primary );
1245
+ echo '</td>';
1246
+ } else {
1247
+ echo "<td $attributes>";
1248
+ echo $this->column_default( $item, $column_name );
1249
+ echo $this->handle_row_actions( $item, $column_name, $primary );
1250
+ echo '</td>';
1251
+ }
1252
+ }
1253
+ }
1254
+
1255
+ /**
1256
+ * Generates and display row actions links for the list table.
1257
+ *
1258
+ * @since 4.3.0
1259
+ *
1260
+ * @param object|array $item The item being acted upon.
1261
+ * @param string $column_name Current column name.
1262
+ * @param string $primary Primary column name.
1263
+ * @return string The row actions HTML, or an empty string
1264
+ * if the current column is not the primary column.
1265
+ */
1266
+ protected function handle_row_actions( $item, $column_name, $primary ) {
1267
+ return $column_name === $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . ( 'Show more details' ) . '</span></button>' : '';
1268
+ }
1269
+
1270
+ /**
1271
+ * Handles an incoming ajax request (called from admin-ajax.php)
1272
+ *
1273
+ * @since 3.1.0
1274
+ */
1275
+ public function ajax_response() {
1276
+ $this->prepare_items();
1277
+
1278
+ ob_start();
1279
+ if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
1280
+ $this->display_rows();
1281
+ } else {
1282
+ $this->display_rows_or_placeholder();
1283
+ }
1284
+
1285
+ $rows = ob_get_clean();
1286
+
1287
+ $response = array( 'rows' => $rows );
1288
+
1289
+ if ( isset( $this->_pagination_args['total_items'] ) ) {
1290
+ $response['total_items_i18n'] = sprintf(
1291
+ /* translators: Number of items. */
1292
+ _n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
1293
+ number_format_i18n( $this->_pagination_args['total_items'] )
1294
+ );
1295
+ }
1296
+ if ( isset( $this->_pagination_args['total_pages'] ) ) {
1297
+ $response['total_pages'] = $this->_pagination_args['total_pages'];
1298
+ $response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
1299
+ }
1300
+
1301
+ die( wp_json_encode( $response ) );
1302
+ }
1303
+
1304
+ /**
1305
+ * Sends required variables to JavaScript land.
1306
+ *
1307
+ * @since 3.1.0
1308
+ */
1309
+ public function _js_vars() {
1310
+ $args = array(
1311
+ 'class' => get_class( $this ),
1312
+ 'screen' => array(
1313
+ 'id' => $this->screen->id,
1314
+ 'base' => $this->screen->base,
1315
+ ),
1316
+ );
1317
+
1318
+ printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
1319
+ }
1320
+ }
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.06.006
7
  *
8
  */
9
 
@@ -1717,15 +1717,15 @@ function wppa_log_page() {
1717
  <div class="wrap">' .
1718
  wppa_admin_spinner() .
1719
  wp_nonce_field( 'wppa-nonce', 'wppa-nonce', true, false ) . '
1720
- <img id="icon-album" src="' . esc_url( WPPA_URL . '/img/page_green.png' ) . '" />
1721
- <h1 style="display:inline">' . htmlspecialchars( __('WP Photo Album Plus Logfile', 'wp-photo-album-plus' ) ) . '
1722
  <input
1723
  class="button button-primary"
1724
  style="float:right;"
1725
  value="Purge logfile"
1726
  onclick="wppaAjaxUpdateOptionValue(\'errorlog_purge\', 0);jQuery(\'#wppa-maintenance-list\').fadeOut(2000);"
1727
  type="button" >
1728
- </h1>' .
1729
 
1730
  wp_nonce_field('wppa-nonce', 'wppa-nonce') . '
1731
 
@@ -1737,7 +1737,7 @@ function wppa_log_page() {
1737
  />
1738
  <div id="wppa-logbody" >' .
1739
 
1740
- wppa_do_maintenance_popup( 'wppa_list_errorlog' ) .
1741
 
1742
  '</div>
1743
  </div>' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 8.3.01.002
7
  *
8
  */
9
 
1717
  <div class="wrap">' .
1718
  wppa_admin_spinner() .
1719
  wp_nonce_field( 'wppa-nonce', 'wppa-nonce', true, false ) . '
1720
+
1721
+ <h1 style="display:inline">' . get_admin_page_title() . '
1722
  <input
1723
  class="button button-primary"
1724
  style="float:right;"
1725
  value="Purge logfile"
1726
  onclick="wppaAjaxUpdateOptionValue(\'errorlog_purge\', 0);jQuery(\'#wppa-maintenance-list\').fadeOut(2000);"
1727
  type="button" >
1728
+ </h1><br>' .
1729
 
1730
  wp_nonce_field('wppa-nonce', 'wppa-nonce') . '
1731
 
1737
  />
1738
  <div id="wppa-logbody" >' .
1739
 
1740
+ ltrim( wppa_do_maintenance_popup( 'wppa_list_errorlog' ), '| ' ) .
1741
 
1742
  '</div>
1743
  </div>' );
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.09.002
7
  *
8
  */
9
 
@@ -20,9 +20,14 @@ function _wppa_edit_photo() {
20
  $photo = wppa_get( 'photo', '0', 'int' );
21
  $thumb = wppa_cache_photo( $photo );
22
  if ( $thumb['owner'] == wppa_get_user() ) {
23
- wppa_echo( '<div class="wrap"><h2>' . esc_html__( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>' );
 
 
 
 
24
  wppa_album_photos( '', $photo );
25
- wppa_echo( '</div>' );
 
26
  }
27
  else {
28
  wp_die( 'You do not have the rights to do this' );
@@ -31,9 +36,14 @@ function _wppa_edit_photo() {
31
 
32
  // Edit all photos owned by current user
33
  else {
34
- wppa_echo( '<div class="wrap"><h2>' . esc_html__( 'Edit photos', 'wp-photo-album-plus' ) . '</h2>' );
 
 
 
 
35
  wppa_album_photos( '', '', wppa_get_user() );
36
- wppa_echo( '</div>' );
 
37
  }
38
  }
39
 
@@ -45,19 +55,30 @@ function _wppa_moderate_photos() {
45
  $just_edit = wppa_get( 'just-edit' );
46
 
47
  if ( $photo && $just_edit && wppa_user_is_admin() ) {
48
- wppa_echo( '<div class="wrap"><h2>' . esc_html__( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>' . wppa_get( 'just-edit' ) );
 
 
 
 
 
49
  wppa_album_photos( '', $photo, '', false );
50
- wppa_echo( '</div>' );
 
51
  }
52
  else {
53
- wppa_echo( '<div class="wrap"><h2>' . esc_html__( 'Moderate photos' , 'wp-photo-album-plus' ) . '</h2>' );
 
 
 
 
54
  if ( wppa_switch( 'moderate_bulk' ) ) {
55
  wppa_album_photos_bulk( 'moderate' );
56
  }
57
  else {
58
  wppa_album_photos( '', $photo, '', true );
59
  }
60
- wppa_echo( '</div>' );
 
61
  }
62
  }
63
 
@@ -65,11 +86,26 @@ function _wppa_moderate_photos() {
65
  function wppa_album_photos( $album = '', $photo = '', $owner = '', $moderate = false ) {
66
  global $wpdb;
67
 
68
- $pagesize = wppa_opt( 'photo_admin_pagesize' );
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 ) {
@@ -78,7 +114,6 @@ global $wpdb;
78
  if ( $album == 'search' ) {
79
  $count = wppa_get_edit_search_photos( '', '', 'count_only' );
80
  $photos = wppa_get_edit_search_photos( $skip, $pagesize );
81
-
82
  $link = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=' . $album . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&wppa-searchstring=' . wppa_get( 'searchstring' );
83
  }
84
 
@@ -103,7 +138,7 @@ 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
@@ -149,29 +184,8 @@ global $wpdb;
149
  $link = '';
150
  }
151
 
152
- // Are there photos with pending comments?
153
- else {
154
-
155
- // Find pending comments
156
- $cmt = $wpdb->get_results( "SELECT photo FROM $wpdb->wppa_comments
157
- WHERE status = 'pending'
158
- OR status = 'spam'", ARRAY_A );
159
-
160
- $photos = array();
161
-
162
- if ( is_array( $cmt ) && count( $cmt ) ) {
163
-
164
- foreach( $cmt as $id ) {
165
- $photos[] = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
166
- WHERE id = %d", $id ), ARRAY_A );
167
- }
168
- $count = count( $photos );
169
- }
170
- $link = get_admin_url() . 'admin.php?page=wppa_moderate_photos&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
171
- }
172
-
173
  // Are there photos to moderate?
174
- if ( empty( $photos ) ) {
175
 
176
  $photos = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_photos
177
  WHERE status = 'pending'
@@ -179,36 +193,27 @@ global $wpdb;
179
  $count = count( $photos );
180
  }
181
 
182
- // No photos to moderate?
183
- if ( empty( $photos ) ) {
184
-
185
- // Single photo moderate requested
186
- if ( $photo ) {
187
- wppa_echo( '<p>' . esc_html__( 'This photo is no longer awaiting moderation.' , 'wp-photo-album-plus' ) . '</p>' );
188
- }
189
-
190
- // Multiple photos to moderate requested
191
- else {
192
- wppa_echo( '<p>' . esc_html__( 'There are no photos awaiting moderation at this time.', 'wp-photo-album-plus' ) . '</p>' );
193
- }
194
 
195
- // If i am admin, i can edit all photos here, sorted by timestamp desc
196
- if ( wppa_user_is_admin() ) {
197
- wppa_echo( '<h1>' . esc_html__( 'Manage all photos by timestamp', 'wp-photo-album-plus' ) . '</h1>' );
 
198
 
199
- $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
200
- ORDER BY timestamp DESC
201
- LIMIT %d, %d", $skip, $pagesize ), ARRAY_A );
202
 
203
- $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos" );
204
- $link = get_admin_url() . 'admin.php?page=wppa_moderate_photos&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
 
205
  }
 
206
 
207
- // Nothing to do
208
- else {
209
- return;
210
  }
211
  }
 
212
  }
213
 
214
  // If not one of the cases above apply, log error and quit
@@ -217,12 +222,53 @@ global $wpdb;
217
  return;
218
  }
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  // Quick edit skips a few time consuming settings like copy and move to other album
221
  $quick = wppa_get( 'quick' );
222
  if ( $link && $quick ) $link .= '&quick=1';
223
 
224
  // In case it is a seaerch and edit, show the search statistics
225
- wppa_show_search_statistics();
 
 
226
 
227
  // If no photos selected produce appropriate message and quit
228
  if ( empty( $photos ) ) {
@@ -243,7 +289,7 @@ global $wpdb;
243
 
244
  // Search
245
  if ( wppa_get( 'searchstring' ) ) {
246
- wppa_echo( '<h1>' . esc_html__( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . '</h1>' );
247
  }
248
 
249
  // Album
@@ -258,204 +304,13 @@ global $wpdb;
258
  // There are photos to display for editing
259
  else {
260
 
261
- // Local js functions
262
- {
263
- $the_js = "
264
- function wppaTryMove( id, video ) {
265
-
266
- var query;
267
-
268
- if ( ! jQuery( '#target-' + id ).val() ) {
269
- alert( '" . esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) . "' );
270
- return false;
271
- }
272
-
273
- if ( video ) {
274
- query = '" . esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) . "';
275
- }
276
- else {
277
- query = '" . esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) . "';
278
- }
279
-
280
- if ( confirm( query ) ) {
281
- wppaAjaxUpdatePhoto( id, 'moveto', document.getElementById( 'target-' + id ).value );
282
- }
283
- }
284
-
285
- function wppaTryCopy( id, video ) {
286
-
287
- var query;
288
-
289
- if ( ! jQuery( '#target-' + id ).val() ) {
290
- alert( '" . esc_js( __( 'Please select an album to copy to first.', 'wp-photo-album-plus' ) ) . "' );
291
- return false;
292
- }
293
-
294
- if ( video ) {
295
- query = '" . esc_js( __( 'Are you sure you want to copy this video?', 'wp-photo-album-plus' ) ) . "';
296
- }
297
- else {
298
- query = '" . esc_js( __( 'Are you sure you want to copy this photo?', 'wp-photo-album-plus' ) ) . "';
299
- }
300
-
301
- if ( confirm( query ) ) {
302
- wppaAjaxUpdatePhoto( id, 'copyto', document.getElementById( 'target-' + id ).value );
303
- }
304
- }
305
-
306
- function wppaTryDelete( id, video, perm ) {
307
-
308
- var query;
309
-
310
- if ( perm ) {
311
- if ( video ) {
312
- query = '" . esc_js( __( 'Are you sure you want to remove this video permanently?', 'wp-photo-album-plus' ) ) . "';
313
- }
314
- else {
315
- query = '" . esc_js( __( 'Are you sure you want to remove this photo permanently?', 'wp-photo-album-plus' ) ) . "';
316
- }
317
- }
318
- else {
319
- if ( video ) {
320
- query = '" . esc_js( __( 'Are you sure you want to delete this video?', 'wp-photo-album-plus' ) ) . "';
321
- }
322
- else {
323
- query = '" . esc_js( __( 'Are you sure you want to delete this photo?', 'wp-photo-album-plus' ) ) . "';
324
- }
325
- }
326
-
327
- if ( confirm( query ) ) {
328
- if ( perm ) {
329
- wppaAjaxDeletePhoto( id, '', '', true );
330
- }
331
- else {
332
- wppaAjaxDeletePhoto( id );
333
- }
334
- jQuery( window ).trigger( 'scroll' );
335
- }
336
- }
337
-
338
- function wppaTryUndelete ( id ) {
339
- wppaAjaxUndeletePhoto( id );
340
- }
341
-
342
- function wppaTryRotLeft( id ) {
343
-
344
- var query = '" . esc_js( __( 'Are you sure you want to rotate this photo left?', 'wp-photo-album-plus' ) ) . "';
345
-
346
- if ( confirm( query ) ) {
347
- wppaAjaxUpdatePhoto( id, 'rotleft', 0 );
348
- }
349
- }
350
-
351
- function wppaTryRot180( id ) {
352
-
353
- var query = '" . esc_js( __( 'Are you sure you want to rotate this photo 180&deg;?', 'wp-photo-album-plus' ) ) . "';
354
-
355
- if ( confirm( query ) ) {
356
- wppaAjaxUpdatePhoto( id, 'rot180', 0 );
357
- }
358
- }
359
-
360
- function wppaTryRotRight( id ) {
361
-
362
- var query = '" . esc_js( __( 'Are you sure you want to rotate this photo right?', 'wp-photo-album-plus' ) ) . "';
363
-
364
- if ( confirm( query ) ) {
365
- wppaAjaxUpdatePhoto( id, 'rotright', 0 );
366
- }
367
- }
368
-
369
- function wppaTryFlip( id ) {
370
-
371
- var query = '" . esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) . "';
372
-
373
- if ( confirm( query ) ) {
374
- wppaAjaxUpdatePhoto( id, 'flip', 0 );
375
- }
376
- }
377
-
378
- function wppaTryFlop( id ) {
379
-
380
- var query = '" . esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) . "';
381
-
382
- if ( confirm( query ) ) {
383
- wppaAjaxUpdatePhoto( id, 'flop', 0 );
384
- }
385
- }
386
-
387
- function wppaTryWatermark( id, hasSource, canRemove ) {
388
-
389
- var query;
390
- var wmFile = jQuery( '#wmfsel_' + id ).val();
391
- if ( wmFile == '--- none ---' ) {
392
- alert( '" . esc_js( __( 'No watermark selected', 'wp-photo-album-plus' ) ) . "' );
393
- return;
394
- }
395
- if ( hasSource ) {
396
- query = '" . esc_js( __( 'Are you sure?', 'wp-photo-album-plus' ) ) . "';
397
- query += '. ';
398
- query += '" . esc_js( __( 'To revert to the default watermark setting afterwards: select Watermark: --- default --- and press the Remake files button', 'wp-photo-album-plus' ) ) . "';
399
- if ( canRemove ) {
400
- query += '. ';
401
- query += '" . esc_js( __( 'To remove: select Watermark: --- none --- and press the Remake files button', 'wp-photo-album-plus' ) ) . "';
402
- }
403
- }
404
- else {
405
- query = '" . esc_js( __( 'Are you sure? Once applied it can not be removed!', 'wp-photo-album-plus' ) ) . "';
406
- query += '. ';
407
- query += '" . esc_js( __( 'And I do not know if there is already a watermark on this photo', 'wp-photo-album-plus' ) ) . "';
408
- }
409
-
410
- if ( confirm( query ) ) {
411
- wppaAjaxApplyWatermark( id, document.getElementById( 'wmfsel_' + id ).value, document.getElementById( 'wmpsel_' + id ).value );
412
- }
413
- }
414
-
415
- function wppaTryMagick( id, slug, value ) {
416
-
417
- if ( ! value ) {
418
- value = 0;
419
- }
420
-
421
- var query = '" . esc_js( __( 'Are you sure you want to magically process this photo?', 'wp-photo-album-plus' ) ) . "';
422
-
423
- if ( true || confirm( query ) ) {
424
- jQuery( '#wppa-admin-spinner' ).css( 'display', 'inline' );
425
- wppaAjaxUpdatePhoto( id, slug, value );
426
- }
427
- }
428
-
429
- wppaHor = false;
430
- function wppaToggleHorizon() {
431
- if ( wppaHor ) {
432
- jQuery( '#wppa-horizon' ).css( 'display', 'none' );
433
- wppaHor = false;
434
- }
435
- else {
436
- jQuery( '#wppa-horizon' ).css( 'display', 'inline' );
437
- wppaHor = true;
438
- }
439
- }
440
-
441
- function wppaTryScheduledel( id ) {
442
- wppaPhotoStatusChange( id );
443
- if ( ! jQuery( '#scheduledel-' + id ).prop( 'checked' ) ) {
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' ) );
454
  $cvt = esc_attr( __( 'Copy video', 'wp-photo-album-plus' ) );
455
  $cpt = esc_attr( __( 'Copy photo', 'wp-photo-album-plus' ) );
456
 
457
  // Display the pagelinks
458
- wppa_admin_page_links( $page, $pagesize, $count, $link );
459
 
460
  // Horizon
461
  wppa_echo( '<div id="wppa-horizon"><hr></div>' );
@@ -591,8 +446,8 @@ function wppaTryScheduledel( id ) {
591
  wppa_echo( '
592
  <div
593
  id="photoitem-' . $id . '"
594
- class="wppa-table-wrap"
595
- style="display:block;padding:20px"
596
  >' .
597
 
598
  // Photo specific nonce field
@@ -621,7 +476,8 @@ function wppaTryScheduledel( id ) {
621
  'width' => '160',
622
  'height' => '160' * $videoy / $videox,
623
  'controls' => false,
624
- 'use_thumb' => true
 
625
  ) ) . '
626
  </a>' );
627
 
@@ -665,7 +521,7 @@ function wppaTryScheduledel( id ) {
665
  id="thumburl-' . $id . '"' .
666
  ( wppa_lazy() && $count > '1' ? ' data-' : ' ' ) . 'src="' . esc_url( $src ) . '"
667
  alt="' . esc_attr( $name ) . '"
668
- style="max-width:160px;vertical-align:middle"
669
  />
670
  </a>' );
671
 
@@ -702,36 +558,136 @@ function wppaTryScheduledel( id ) {
702
 
703
  wppa_echo( '</div>' );
704
  }
705
- wppa_echo( '<h1 style="display:inline;vertical-align:bottom;">' . wppa_get_photo_name( $id ) . '</h1>' );
706
 
707
- // Get the clicks, views and downloads stats
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
708
  {
709
- $th_1 = array();
710
- $td_1 = array();
711
 
712
  // Clicks
713
  if ( wppa_switch( 'track_clickcounts' ) ) {
714
- $th_1[] = __( 'Clicks', 'wp-photo-album-plus' );
715
- $td_1[] = strval( intval( $clicks ) );
716
  }
717
 
718
  // Views
719
  if ( wppa_switch( 'track_viewcounts' ) ) {
720
- $th_1[] = __( 'Views', 'wp-photo-album-plus' );
721
- $td_1[] = strval( intval( $views ) );
722
  }
723
 
724
  // Downloads. Only photos are downloadable
725
  if ( ! wppa_is_multi( $id ) ) {
726
- $th_1[] = __( 'Downloads', 'wp-photo-album-plus' );
727
- $td_1[] = strval( intval( $dlcount ) );
728
  }
729
- }
730
-
731
- // Get the rating stats
732
- {
733
- $th_2 = array();
734
- $td_2 = array();
735
 
736
  // Rating
737
  $entries = wppa_get_rating_count_by_id( $id );
@@ -742,7 +698,9 @@ function wppaTryScheduledel( id ) {
742
  }
743
  else {
744
  $label = __( 'Rating (#, avg)', 'wp-photo-album-plus' );
745
- $value = wppa_get_rating_by_id( $id, 'nolabel' );
 
 
746
  }
747
  }
748
  else {
@@ -750,48 +708,60 @@ function wppaTryScheduledel( id ) {
750
  $value = __( 'None', 'wp-photo-album-plus' );
751
  }
752
 
753
- $th_2[] = $label;
754
- $td_2[] = $value;
755
 
756
  // Dislikes
757
  $dislikes = wppa_dislike_get( $id );
758
  if ( $dislikes ) {
759
- $th_2[] = __( 'Dislikes', 'wp-photo-album-plus' );
760
- $td_2[] = strval( intval( $dislikes ) );
761
  }
762
 
763
  // Pending votes
764
  $pending = wppa_pendrat_get( $id );
765
  if ( $pending ) {
766
- $th_2[] = __( 'Pending votes', 'wp-photo-album-plus' );
767
- $td_2[] = strval( intval( $pending ) );
768
  }
769
  }
770
 
771
  // Display the stats
772
- {
773
- $table = '<table>';
774
- $header = array(1 => array(), 2 => array());
775
- $rows = array(1 => array(), 2 => array());
776
-
777
- for($i=0, $limit = max(count($th_1), count($th_2)); $i < $limit; $i++) {
778
-
779
- $header[1][] .= isset($th_1[$i]) ? $th_1[$i] : '';
780
- $header[2][] .= isset($th_2[$i]) ? $th_2[$i] : '';
781
- $rows[1][] .= isset($td_1[$i]) ? $td_1[$i] : '';
782
- $rows[2][] .= isset($td_2[$i]) ? $td_2[$i] : '';
783
-
784
- }
785
-
786
- $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>';
787
- $table .= '<tbody><tr><td>' . implode('</td><td>', $rows[1]) . '</td></tr></tbody>';
788
- $table .= '<thead><tr><th style="text-align: left;">' . implode('</th><th style="text-align: left;">', $header[2]) . '</th></tr></thead>';
789
- $table .= '<tbody><tr><td>' . implode('</td><td>', $rows[2]) . '</td></tr></tbody>';
790
 
791
- $table .= '</table>';
792
 
793
- wppa_echo( $table );
794
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
795
 
796
  wppa_echo( '
797
  </div>' );
@@ -804,11 +774,11 @@ function wppaTryScheduledel( id ) {
804
 
805
  // Open the details area
806
  wppa_echo( '
807
- <details class="wppa-toplevel-details" ' . ( $timestamp > time() - 3600 ? 'open' : '' ) . '>
808
  <summary class="toplevel wppa-summary-sublevel"> ' .
809
  $details . '
810
  </summary>' );
811
-
812
  // Update status field
813
  {
814
  wppa_echo( '
@@ -822,7 +792,7 @@ function wppaTryScheduledel( id ) {
822
  </span>
823
  </h3>' );
824
  }
825
-
826
  // The tabs
827
  $ptitle = __( 'Photo', 'wp-photo-album-plus' );
828
  if ( wppa_is_video( $id ) ) $ptitle = __( 'Video', 'wp-photo-album-plus' );
@@ -842,15 +812,28 @@ function wppaTryScheduledel( id ) {
842
  }
843
  if ( ! $quick && ! empty( $exifs ) ) {
844
  $result .= '
845
- <li class="wppa-photoadmin-tab-'.$id.'" onclick="wppaChangePhotoAdminTab(this,\'#photoexif-'.$id.'\','.$id.');">' . __( 'EXIF', 'wp-photo-album-plus' ) . '</li>';
 
 
 
 
846
  }
847
  if ( ! $quick && ! empty( $iptcs ) ) {
848
  $result .= '
849
- <li class="wppa-photoadmin-tab-'.$id.'" onclick="wppaChangePhotoAdminTab(this,\'#photoiptc-'.$id.'\','.$id.');">' . __( 'IPTC', 'wp-photo-album-plus' ) . '</li>';
 
 
 
 
850
  }
851
  if ( ! $quick && ! empty( $comments ) ) {
852
  $result .= '
853
- <li class="wppa-photoadmin-tab-'.$id.'" onclick="wppaChangePhotoAdminTab(this,\'#photocomment-'.$id.'\','.$id.');">' . __( 'Comments', 'wp-photo-album-plus' ) . '</li>';
 
 
 
 
 
854
  }
855
  $result .= '
856
  </ul>
@@ -858,20 +841,6 @@ function wppaTryScheduledel( id ) {
858
  </div>';
859
  wppa_echo( $result );
860
 
861
- // The script for the tabs to operate, we need this only once
862
- global $did_add_cpat;
863
- if ( ! $did_add_cpat ) {
864
- $the_js = '
865
- function wppaChangePhotoAdminTab(elm,tabId,itemId) {
866
- jQuery(".wppa-photoadmin-tab-"+itemId).removeClass(\'active\');
867
- jQuery(elm).addClass(\'active\');
868
- jQuery(".wppa-tabcontent-"+itemId).hide();
869
- jQuery(tabId).show();
870
- }';
871
- wppa_add_inline_script( 'wppa-admin', $the_js );
872
- $did_add_cpat = true;
873
- }
874
-
875
  // Tab 1 Photo general
876
  wppa_echo( '
877
  <div
@@ -953,7 +922,7 @@ function wppaTryScheduledel( id ) {
953
  }
954
 
955
  // Album. Show album only when it is not evident
956
- if ( ! $album_is_obvious ) {
957
  wppa_echo( '
958
  <div class="left" style="margin-right: 4px;">
959
  <label>' .
@@ -1023,6 +992,7 @@ function wppaTryScheduledel( id ) {
1023
  }
1024
 
1025
  // Status
 
1026
  if ( ! $may_edit_status ) {
1027
  if ( $status == 'pending' ) $s = __( 'Pending', 'wp-photo-album-plus' );
1028
  elseif ( $status == 'publish' ) $s = __( 'Publish', 'wp-photo-album-plus' );
@@ -1042,6 +1012,7 @@ function wppaTryScheduledel( id ) {
1042
  </div>
1043
  </div>' );
1044
  }
 
1045
 
1046
  // Schedule for delete
1047
  if ( ! wppa_user_is_admin() && $owner != wppa_get_user() ) {
@@ -1098,22 +1069,6 @@ function wppaTryScheduledel( id ) {
1098
 
1099
  // Owner
1100
  if ( $owner_editable ) {
1101
- /*
1102
- wppa_echo( '
1103
- <div class="left">
1104
- <label
1105
- for="owner-' . $id . '">' .
1106
- __( 'Owned by', 'wp-photo-album-plus' ) . '
1107
- </label><br>
1108
- <input
1109
- style="max-width:150px"
1110
- id="owner-' . $id . '"
1111
- type="text"
1112
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'owner\', this.value )"
1113
- value="' . esc_attr( $owner ) . '"
1114
- />
1115
- </div>' );
1116
- */
1117
  if ( wppa_get_user_count() > wppa_opt( 'max_users' ) ) {
1118
  wppa_echo( '
1119
  <div class="left">
@@ -1218,7 +1173,7 @@ function wppaTryScheduledel( id ) {
1218
  }
1219
 
1220
  // Status
1221
- if ( $may_edit_status ) {
1222
  $sel = ' selected';
1223
  if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is_admin() ) {
1224
  $dis = ' disabled';
@@ -1645,25 +1600,6 @@ function wppaTryScheduledel( id ) {
1645
  wppa_echo( '
1646
  <div class="wppa-flex-column">' );
1647
 
1648
- // Name
1649
- wppa_echo( '
1650
- <fieldset class="wppa-fieldset">
1651
- <legend class="wppa-legend">' .
1652
- __( 'Name', 'wp-photo-album-plus' ) . '
1653
- </legend>
1654
- <input
1655
- type="text"
1656
- style="width:100%"
1657
- id="pname-' . $id . '"
1658
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'name\', this.value)"
1659
- value="' . esc_attr( stripslashes( $name ) ) . '"
1660
- />
1661
- <br>
1662
- <span style="float:right">' .
1663
- __( 'Name slug', 'wp-photo-album-plus' ) . ': ' . $sname . '
1664
- </span>
1665
- </fieldset>' );
1666
-
1667
  // Description editable
1668
  if ( ! wppa_switch( 'desc_is_restricted' ) || wppa_user_is_admin() ) {
1669
  wppa_echo( '
@@ -1964,357 +1900,372 @@ function wppaTryScheduledel( id ) {
1964
  <div
1965
  id="photofiles-' . $id . '"
1966
  class="wppa-table-wrap wppa-tabcontent-'.$id.'"
1967
- style="position:relative;padding-bottom:12px;padding-left:12px;display:none"
1968
  >' );
1969
 
1970
- {
1971
  wppa_echo( '
1972
- <table class="wppa-table">
1973
- <thead>
1974
- <td>' . __( 'Type', 'wp-photo-album-plus' ) . '</td>
1975
- <td>' . __( 'Size', 'wp-photo-album-plus' ) . '</td>
1976
- <td>' . __( 'Path', 'wp-photo-album-plus' ) . '</td>
1977
- <td>' . __( 'Url', 'wp-photo-album-plus' ) . '</td>
1978
- </thead>
1979
- <tbody>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1980
 
1981
- // Video
1982
- if ( $b_is_video ) {
1983
-
1984
- $formats = '';
1985
- $paths = '';
1986
- $urls = '';
1987
- foreach ( $is_video as $fmt ) {
1988
- $formats .= $fmt . ' (' . wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . ')<br>';
1989
- $paths .= str_replace( WPPA_UPLOAD_PATH, '.../wppa', str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . '<br>';
1990
- $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) );
1991
- $urls .= '<a href="'. $url .'" target="_blank">' . $url . '<br>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1992
  }
1993
 
1994
- wppa_echo( '
1995
- <tr>
1996
- <td>' .
1997
- $formats . '
1998
- </td>
1999
- <td>' );
 
 
 
 
 
 
 
 
2000
 
2001
- // If video sizes are correct and retieved from the file,
2002
- // and possible rotation has been into account, field needs not to be editable
2003
- if ( $photo['videox'] == $videox && $photo['videoy'] == $videoy ) {
2004
- wppa_echo( sprintf( __( 'Width: %d pixels, height: %d pixels', 'wp-photo-album-plus' ), $videox, $videoy ) );
2005
- }
2006
- else {
2007
- wppa_echo( '
2008
- <input
2009
- type="text"
2010
- style="width:50px;margin:0 4px;padding-left:8px!important"
2011
- onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videox\', this.value)"
2012
- value="' . esc_attr( $videox ) . '"
2013
- />px W' .
2014
- sprintf( __( '(0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_width' ) ) . '
2015
- <input
2016
- type="text"
2017
- style="width:50px;margin:0 4px;padding-left:8px!important"
2018
- onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videoy\', this.value)"
2019
- value="' . esc_attr( $videoy ) . '"
2020
- />px H' .
2021
- sprintf( __( '(0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_height' ) ) );
2022
- }
2023
  wppa_echo( '
2024
- </td>
2025
- <td>' .
2026
- $paths . '
2027
- </td>
2028
- <td>' .
2029
- $urls . '
2030
- </td>
2031
- </tr>' );
2032
- }
2033
-
2034
- // Audio
2035
- if ( $b_has_audio ) {
2036
-
2037
- $formats = '';
2038
- $sizes = '';
2039
- $paths = '';
2040
- $urls = '';
2041
- foreach ( $has_audio as $fmt ) {
2042
- $formats .= $fmt . '<br>';
2043
- $sizes .= wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . '<br>';
2044
- $paths .= str_replace( WPPA_UPLOAD_PATH, '.../wppa', str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . '<br>';
2045
- $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) );
2046
- $urls .= '<a href="'. $url .'" target="_blank">' . $url . '<br>';
2047
  }
2048
 
2049
- wppa_echo( '
2050
- <tr>
2051
- <td>' .
2052
- $formats . '
2053
- </td>
2054
- <td>' .
2055
- $sizes . '
2056
- </td>
2057
- <td>' .
2058
- $paths . '
2059
- </td>
2060
- <td>' .
2061
- $urls . '
2062
- </td>
2063
- </tr>' );
2064
- }
2065
-
2066
- // Pdf
2067
- if ( $is_pdf ) {
2068
 
2069
- // Source
2070
- $sp = wppa_get_source_path( $id );
2071
- $fs = wppa_get_filesize( $sp );
2072
- $path = str_replace( WPPA_UPLOAD_PATH, '.../wppa', $sp );
2073
- $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $sp );
2074
- wppa_echo( '
2075
- <tr>
2076
- <td>' .
2077
- __( 'Document file', 'wp-photo-album-plus' ) . '
2078
- </td>
2079
- <td>' .
2080
- $fs . '
2081
- </td>
2082
- <td>' .
2083
- $path . '
2084
- </td>
2085
- <td>
2086
- <a href="'.$url.'" target="_blank">' .
2087
- $url . '
2088
- </a>
2089
- </td>
2090
- </tr>' );
2091
- }
2092
 
2093
- // Non pdf source_file
2094
- else {
2095
 
2096
- // Source
2097
- $sp = wppa_get_source_path( $id );
2098
- $o1sp = wppa_get_o1_source_path( $id );
2099
- $files = [];
2100
- if ( wppa_is_file( $sp ) || wppa_is_file( $o1sp ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2101
 
2102
- if ( is_file( $sp ) ) {
2103
- $ima = getimagesize( $sp );
2104
- $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $sp ) . '.';
2105
- $files[] = ['name' => __( 'Source', 'wp-photo-album-plus' ),
2106
- 'path' => str_replace( WPPA_UPLOAD_PATH, '.../wppa', $sp ),
2107
- 'size' => $txt,
2108
- 'url' => str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $sp )];
 
 
 
 
 
 
 
 
 
 
 
 
2109
  }
2110
- if ( is_file( $o1sp ) ) {
2111
- $ima = getimagesize( $o1sp );
2112
- $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $o1sp ) . '.';
2113
- $files[] = ['name' => __( 'Oriented source', 'wp-photo-album-plus' ),
2114
- 'path' => str_replace( WPPA_UPLOAD_PATH, '.../wppa', $o1sp ),
2115
- 'size' => $txt,
2116
- 'url' => str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $o1sp )];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2117
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2118
 
2119
- foreach( $files as $file ) {
2120
  wppa_echo( '
2121
  <tr>
2122
  <td>' .
2123
- $file['name'] . '
2124
  </td>
2125
  <td>' .
2126
- $file['size'] . '
2127
  </td>
2128
  <td>' .
2129
- $file['path'] . '
2130
  </td>
2131
  <td>
2132
- <a href="'.$file['url'].'" target="_blank">' .
2133
- $file['url'] . '
2134
  </a>
2135
  </td>
2136
  </tr>' );
2137
  }
2138
  }
2139
- }
2140
 
2141
- // Poster
2142
- if ( $is_pdf || $b_is_video ) {
 
 
 
 
 
 
 
 
 
 
 
 
2143
 
2144
- // Poster
2145
- $sp = wppa_fix_poster_ext( wppa_get_source_path( $id ), $id );
2146
- $dsp = wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id );
2147
- $files = [];
2148
- if ( wppa_is_file( $sp ) || wppa_is_file( $dsp ) ) {
2149
-
2150
- if ( wppa_is_file( $sp ) ) {
2151
- $ima = getimagesize( $sp );
2152
- $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $sp ) . '.';
2153
- $files[] = ['name' => __( 'Poster source', 'wp-photo-album-plus' ),
2154
- 'path' => str_replace( WPPA_UPLOAD_PATH, '.../wppa', $sp ),
2155
- 'size' => $txt,
2156
- 'url' => str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $sp )];
2157
- }
2158
- if ( wppa_is_file( $dsp ) ) {
2159
- $ima = getimagesize( $dsp );
2160
- $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $dsp ) . '.';
2161
- $files[] = ['name' => __( 'Poster display', 'wp-photo-album-plus' ),
2162
- 'path' => str_replace( WPPA_UPLOAD_PATH, '.../wppa', $dsp ),
2163
- 'size' => $txt,
2164
- 'url' => str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $dsp )];
2165
- }
2166
 
2167
- foreach( $files as $file ) {
2168
  wppa_echo( '
2169
  <tr>
2170
  <td>' .
2171
- $file['name'] . '
2172
  </td>
2173
  <td>' .
2174
- $file['size'] . '
2175
  </td>
2176
  <td>' .
2177
- $file['path'] . '
2178
  </td>
2179
  <td>
2180
- <a href="'.$file['url'].'" target="_blank">' .
2181
- $file['url'] . '
2182
  </a>
2183
  </td>
2184
  </tr>' );
2185
  }
2186
  }
2187
- }
2188
 
2189
- // Non video, non pdf Display
2190
- if ( ! $b_is_video && ! $is_pdf ) {
2191
- $dp = wppa_get_photo_path( $id );
2192
- $path = str_replace( WPPA_UPLOAD_PATH, '.../wppa', $dp );
2193
- $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $dp );
2194
 
2195
- if ( is_file( $dp ) ) {
 
2196
 
2197
- $txt = '
2198
- <span id="photox-' . $id . '">' . wppa_get_photox( $id ) . '</span> x
2199
- <span id="photoy-' . $id . '">' . wppa_get_photoy( $id ) . '</span>:
2200
- (<span id="photofilesize-' . $id . '">' . wppa_get_filesize( $dp ) . '</span>)';
2201
 
2202
- wppa_echo( '
2203
- <tr>
2204
- <td>' .
2205
- __( 'Display file', 'wp-photo-album-plus' ) . '
2206
- </td>
2207
- <td>' .
2208
- $txt . '
2209
- </td>
2210
- <td>' .
2211
- $path . '
2212
- </td>
2213
- <td>
2214
- <a href="'.$url.'" target="_blank">' .
2215
- $url . '
2216
- </a>
2217
- </td>
2218
- </tr>' );
2219
- }
2220
- }
2221
 
2222
- // Thumbnail
2223
- if ( true ) {
2224
- $tp = wppa_get_thumb_path( $id );
2225
- if ( is_file( $tp ) ) {
2226
- $txt = '
2227
- <span id="thumbx-' . $id . '">' . wppa_get_thumbx( $id ) . '</span> x
2228
- <span id="thumby-' . $id . '">' . wppa_get_thumby( $id ) . '</span>:
2229
- (<span id="thumbfilesize-' . $id . '">' . wppa_get_filesize( $tp ) . '</span>)
2230
- &nbsp;
2231
- <input
2232
- type="checkbox"' .
2233
- ( $thumblock ? ' checked' : '' ) . '
2234
- onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'thumblock\', jQuery(this).prop(\'checked\') ? 1 : 0 )" /> ' .
2235
- __( 'Locked', 'wp-photo-album-plus' );
2236
 
2237
- $path = str_replace( WPPA_UPLOAD_PATH, '.../wppa', $tp );
2238
- $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $tp );
2239
 
2240
- wppa_echo( '
2241
- <tr>
2242
- <td>' .
2243
- __( 'Thumbnail', 'wp-photo-album-plus' ) . '
2244
- </td>
2245
- <td>' .
2246
- $txt . '
2247
- </td>
2248
- <td>' .
2249
- $path . '
2250
- </td>
2251
- <td>
2252
- <a href="'.$url.'" target="_blank">' .
2253
- $url . '
2254
- </a>
2255
- </td>
2256
- </tr>' );
2257
- }
2258
- }
2259
-
2260
- // Local CDN
2261
- if ( wppa_cdn( 'admin' ) == 'local' ) {
2262
 
2263
- $files = wppa_cdn_files( $id );
2264
- if ( !empty( $files ) ) {
2265
 
2266
- $txt = '<span id="cdnfiles-' . $id . '">';
2267
- $paths = '';
2268
- $urls = '';
2269
-
2270
- foreach( $files as $file ) {
2271
- if ( basename( $file ) != 'index.php' ) {
2272
- $t = explode( '.', basename( $file ) );
2273
- $t = explode( '-', $t[0] );
2274
- $x = $t[0];
2275
- $y = $t[1];
2276
- $size = filesize( $file );
2277
-
2278
- $txt .=
2279
-
2280
- str_replace( '-', ' x ', wppa_strip_ext( basename( $file ) ) ) . ': ' .
2281
-
2282
- sprintf( '(%4.2fkB)', $size / 1024 ) . '<br>';
2283
-
2284
- $paths .= str_replace( WPPA_UPLOAD_PATH, '.../wppa', $file ) . '<br>';
2285
-
2286
- $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $file );
2287
- $urls .= '<a href="'.$url.'" target="_blank">' . $url . '</a><br>';
2288
  }
2289
- }
2290
- $txt .= '</span>';
2291
 
2292
- wppa_echo( '
2293
- <tr>
2294
- <td style="line-height:20px">' .
2295
- __( 'Local CDN', 'wp-photo-album-plus' ) . '
2296
- </td>
2297
- <td style="line-height:20px">' .
2298
- $txt . '
2299
- </td>
2300
- <td style="line-height:20px">' .
2301
- $paths . '
2302
- </td>
2303
- <td style="line-height:20px">' .
2304
- $urls . '
2305
- </td>
2306
- </tr>' );
 
2307
  }
 
 
 
 
2308
  }
2309
 
2310
- wppa_echo( '
2311
- </tbody>
2312
- </table>' );
2313
- }
2314
 
2315
- // Remake displayfiles
2316
  if ( ! $is_video ) {
2317
  wppa_echo( '
 
 
 
 
 
2318
 
2319
  <input
2320
  type="button"
@@ -2323,13 +2274,6 @@ function wppaTryScheduledel( id ) {
2323
  onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remake\', 0 )"
2324
  value="' . esc_attr( __( 'Remake files', 'wp-photo-album-plus' ) ) . '"
2325
  />
2326
- ' );
2327
- }
2328
-
2329
- // Remake thumbnail
2330
- if ( ! $is_video ) {
2331
- wppa_echo( '
2332
-
2333
  <input
2334
  type="button"
2335
  class="wppa-admin-button button"
@@ -2337,7 +2281,8 @@ function wppaTryScheduledel( id ) {
2337
  onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remakethumb\', 0 )"
2338
  value="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
2339
  />
2340
- ' );
 
2341
  }
2342
 
2343
 
@@ -2352,340 +2297,348 @@ function wppaTryScheduledel( id ) {
2352
  <div
2353
  id="photomagic-' . $id . '"
2354
  class="wppa-table-wrap wppa-tabcontent-'.$id.'"
2355
- style="position:relative;padding-bottom:12px;padding-left:12px;display:none"
2356
  >' );
2357
 
2358
- {
2359
-
2360
- // Explanation
2361
  wppa_echo( '
2362
- <h2 class="description" style="margin:1em">' .
2363
- __( 'The operations are executed upon the display file.', 'wp-photo-album-plus' ) . ' ' .
2364
- __( 'A new thumbnail image will be created from the display file.', 'wp-photo-album-plus' ) . '
2365
- </h2>' );
2366
 
2367
- // --- Actions ---
2368
- wppa_echo( '
2369
- <div class="wppa-flex">' );
2370
 
2371
  {
2372
- // Rotate left
2373
- wppa_echo( '
2374
- <input
2375
- type="button"
2376
- class="wppa-admin-button button"
2377
- onclick="wppaTryMagick( ' . $id . ', \'magickrotleft\' )"
2378
- value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus' ) ) . '"
2379
- />' );
2380
 
2381
- // Rotat 180
2382
  wppa_echo( '
2383
- <input
2384
- type="button"
2385
- class="wppa-admin-button button"
2386
- onclick="wppaTryMagick( ' . $id . ', \'magickrot180\' )"
2387
- value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus' ) ) . '"
2388
- />' );
2389
 
2390
- // Rotate right
2391
  wppa_echo( '
2392
- <input
2393
- type="button"
2394
- class="wppa-admin-button button"
2395
- onclick="wppaTryMagick( ' . $id . ', \'magickrotright\' )"
2396
- value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus' ) ) . '"
2397
- />' );
2398
 
2399
- // Flip
2400
- wppa_echo( '
2401
- <input
2402
- type="button"
2403
- class="wppa-admin-button button"
2404
- onclick="wppaTryMagick( ' . $id . ', \'magickflip\' )"
2405
- value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus' ) ) . '&thinsp;&#8212;"
2406
- title="-flip"
2407
- />' );
2408
 
2409
- // Flop
2410
- wppa_echo( '
2411
- <input
2412
- type="button"
2413
- class="wppa-admin-button button"
2414
- onclick="wppaTryMagick( ' . $id . ', \'magickflop\' )"
2415
- value="' . esc_attr( __( 'Flop', 'wp-photo-album-plus' ) ) . ' |"
2416
- title="-flop"
2417
- />' );
2418
 
2419
- // Enhance
2420
- wppa_echo( '
2421
- <input
2422
- type="button"
2423
- class="wppa-admin-button button"
2424
- onclick="wppaTryMagick( ' . $id . ', \'enhance\' )"
2425
- value="' . esc_attr( __( 'Enhance', 'wp-photo-album-plus' ) ) . '"
2426
- title="-enhance"
2427
- />' );
2428
 
2429
- // Sharpen
2430
- wppa_echo( '
2431
- <input
2432
- type="button"
2433
- class="wppa-admin-button button"
2434
- onclick="wppaTryMagick( ' . $id . ', \'sharpen\' )"
2435
- value="' . esc_attr( __( 'Sharpen', 'wp-photo-album-plus' ) ) . '"
2436
- title="-sharpen 0x1"
2437
- />' );
2438
 
2439
- // Blur
2440
- wppa_echo( '
2441
- <input
2442
- type="button"
2443
- class="wppa-admin-button button"
2444
- onclick="wppaTryMagick( ' . $id . ', \'blur\' )"
2445
- value="' . esc_attr( __( 'Blur', 'wp-photo-album-plus' ) ) . '"
2446
- title="-blur 0x1"
2447
- />' );
2448
 
2449
- // Auto gamma
2450
- wppa_echo( '
2451
- <input
2452
- type="button"
2453
- class="wppa-admin-button button"
2454
- onclick="wppaTryMagick( ' . $id . ', \'auto-gamma\' )"
2455
- value="' . esc_attr( __( 'Auto Gamma', 'wp-photo-album-plus' ) ) . '"
2456
- title="-auto-gamma"
2457
- />' );
2458
 
2459
- // Auto level
2460
- wppa_echo( '
2461
- <input
2462
- type="button"
2463
- class="wppa-admin-button button"
2464
- onclick="wppaTryMagick( ' . $id . ', \'auto-level\' )"
2465
- value="' . esc_attr( __( 'Auto Level', 'wp-photo-album-plus' ) ) . '"
2466
- title="-auto-level"
2467
- />' );
2468
 
2469
- // Contrast+
2470
- wppa_echo( '
2471
- <input
2472
- type="button"
2473
- class="wppa-admin-button button"
2474
- onclick="wppaTryMagick( ' . $id . ', \'contrast-p\' )"
2475
- value="' . esc_attr( __( 'Contrast+', 'wp-photo-album-plus' ) ) . '"
2476
- title="-brightness-contrast 0x5"
2477
- />' );
2478
 
2479
- // Contrast-
2480
- wppa_echo( '
2481
- <input
2482
- type="button"
2483
- class="wppa-admin-button button"
2484
- onclick="wppaTryMagick( ' . $id . ', \'contrast-m\' )"
2485
- value="' . esc_attr( __( 'Contrast-', 'wp-photo-album-plus' ) ) . '"
2486
- title="-brightness-contrast 0x-5"
2487
- />' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2488
 
2489
- // Brightness+
2490
- wppa_echo( '
2491
- <input
2492
- type="button"
2493
- class="wppa-admin-button button"
2494
- onclick="wppaTryMagick( ' . $id . ', \'brightness-p\' )"
2495
- value="' . esc_attr( __( 'Brightness+', 'wp-photo-album-plus' ) ) . '"
2496
- title="-brightness-contrast 5"
2497
- />' );
2498
 
2499
- // Brightness-
2500
- wppa_echo( '
2501
- <input
2502
- type="button"
2503
- class="wppa-admin-button button"
2504
- onclick="wppaTryMagick( ' . $id . ', \'brightness-m\' )"
2505
- value="' . esc_attr( __( 'Brightness-', 'wp-photo-album-plus' ) ) . '"
2506
- title="-brightness-contrast -5"
2507
- />' );
2508
 
2509
- // Despeckle
2510
- wppa_echo( '
2511
- <input
2512
- type="button"
2513
- class="wppa-admin-button button"
2514
- onclick="wppaTryMagick( ' . $id . ', \'despeckle\' )"
2515
- value="' . esc_attr( __( 'Despeckle', 'wp-photo-album-plus' ) ) . '"
2516
- title="-despeckle"
2517
- />' );
2518
 
2519
- // Lenear gray
2520
- wppa_echo( '
2521
- <input
2522
- type="button"
2523
- class="wppa-admin-button button"
2524
- onclick="wppaTryMagick( ' . $id . ', \'lineargray\' )"
2525
- value="' . esc_attr( __( 'Linear gray', 'wp-photo-album-plus' ) ) . '"
2526
- title="-colorspace gray"
2527
- />' );
2528
 
2529
- // Non-linear gray
2530
- wppa_echo( '
2531
- <input
2532
- type="button"
2533
- class="wppa-admin-button button"
2534
- onclick="wppaTryMagick( ' . $id . ', \'nonlineargray\' )"
2535
- value="' . esc_attr( __( 'Non-linear gray', 'wp-photo-album-plus' ) ) . '"
2536
- title="-grayscale Rec709Luma"
2537
- />' );
2538
 
2539
- // Charcoal
2540
- wppa_echo( '
2541
- <input
2542
- type="button"
2543
- class="wppa-admin-button button"
2544
- onclick="wppaTryMagick( ' . $id . ', \'charcoal\' )"
2545
- value="' . esc_attr( __( 'Charcoal', 'wp-photo-album-plus' ) ) . '"
2546
- title="-charcoal"
2547
- />' );
2548
 
2549
- // Paint
2550
- wppa_echo( '
2551
- <input
2552
- type="button"
2553
- class="wppa-admin-button button"
2554
- onclick="wppaTryMagick( ' . $id . ', \'paint\' )"
2555
- value="' . esc_attr( __( 'Paint', 'wp-photo-album-plus' ) ) . '"
2556
- title="-paint"
2557
- />' );
2558
 
2559
- // Sepia
2560
- wppa_echo( '
2561
- <input
2562
- type="button"
2563
- class="wppa-admin-button button"
2564
- onclick="wppaTryMagick( ' . $id . ', \'sepia\' )"
2565
- value="' . esc_attr( __( 'Sepia', 'wp-photo-album-plus' ) ) . '"
2566
- title="-sepia-tone 80%"
2567
- />' );
2568
 
2569
- // Show/hide wppa-horizon
2570
- wppa_echo( '
2571
- <input
2572
- type="button"
2573
- class="wppa-admin-button button"
2574
- onclick="wppaToggleHorizon()"
2575
- value="' . esc_attr( 'Show/hide horizon', 'wp-photo-album-plus' ) . '"
2576
- title="' . esc_attr( 'Toggle horizon reference line on/off', 'wp-photo-album-plus' ) . '"
2577
- />' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2578
 
2579
- // Anticlock 0.5 deg
2580
- wppa_echo( '
2581
- <input
2582
- type="button"
2583
- class="wppa-admin-button button"
2584
- onclick="wppaTryMagick( ' . $id . ', \'skyleft\' )"
2585
- value="' . esc_attr( '0.5&deg;', 'wp-photo-album-plus' ) . '"
2586
- title="' . esc_attr( 'Rotate image by 0.5&deg; anticlockwise', 'wp-photo-album-plus' ) . '"
2587
- />' );
2588
 
2589
- // Clockwise 0.5 deg
2590
- wppa_echo( '
2591
- <input
2592
- type="button"
2593
- class="wppa-admin-button button"
2594
- onclick="wppaTryMagick( ' . $id . ', \'skyright\' )"
2595
- value="' . esc_attr( '-0.5&deg;', 'wp-photo-album-plus' ) . '"
2596
- title="' . esc_attr( 'Rotate image by 0.5&deg; clockwise', 'wp-photo-album-plus' ) . '"
2597
- />' );
2598
 
2599
- // Crop
2600
  wppa_echo( '
2601
- <input
2602
- type="button"
2603
- class="wppa-admin-button button"
2604
- id="button-' . $id . '"
2605
- value="Crop"
2606
- title=""
2607
- />' );
2608
-
2609
- // Set cropbox aspect ratio
2610
- $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
2611
- $dflt = wppa_opt( 'image_magick_ratio' );
 
 
 
 
 
 
 
2612
 
 
 
 
2613
  wppa_echo( '
2614
- <select
2615
- onchange="wppaCropper[' . $id . '].setAspectRatio(this.value)"
2616
- title="' . __( 'Aspect ratio of cropped image', 'wp-photo-album-plus' ) . '"
2617
- >
2618
- <option value="NaN"' . ( $dflt == 'NaN' ? ' selected' : '' ) . '>' . __( 'free', 'wp-photo-album-plus' ) . '</option>
2619
- <option value="' . $ratio . '"' . ( $dflt == 'ratio' ? ' selected' : '' ) . '>' . __( 'original', 'wp-photo-album-plus' ) . '</option>
2620
- <option value="1"' . ( $dflt == '1' ? ' selected' : '' ) . '>' . __( 'square', 'wp-photo-album-plus' ) . '</option>
2621
- <option value="1.25"' . ( $dflt == '1.25' ? ' selected' : '' ) . '>4:5 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2622
- <option value="1.33333"' . ( $dflt == '1.33333' ? ' selected' : '' ) . '>3:4 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2623
- <option value="1.5"' . ( $dflt == '1.5' ? ' selected' : '' ) . '>2:3 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2624
- <option value="1.6"' . ( $dflt == '1.6' ? ' selected' : '' ) . '>5:8 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2625
- <option value="1.77777"' . ( $dflt == '1.77777' ? ' selected' : '' ) . '>9:16 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2626
- <option value="2"' . ( $dflt == '2' ? ' selected' : '' ) . '>1:2 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2627
- <option value="0.8"' . ( $dflt == '0.8' ? ' selected' : '' ) . '>4:5 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2628
- <option value="0.75"' . ( $dflt == '0.75' ? ' selected' : '' ) . '>3:4 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2629
- <option value="0.66667"' . ( $dflt == '0.66667' ? ' selected' : '' ) . '>2:3 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2630
- <option value="0.625"' . ( $dflt == '0.625' ? ' selected' : '' ) . '>5:8 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2631
- <option value="0.5625"' . ( $dflt == '0.5625' ? ' selected' : '' ) . '>9:16 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2632
- <option value="0.5"' . ( $dflt == '0.5' ? ' selected' : '' ) . '>1:2 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2633
- </select>' . $br );
2634
-
2635
- if ( $dflt == 'ratio' ) {
2636
- $value = $ratio;
2637
- }
2638
- elseif ( $dflt == 'free' ) {
2639
- $value = '';
2640
- }
2641
- else {
2642
- $value = $dflt;
2643
- }
2644
 
2645
- // $the_js = 'jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});';
2646
- // wppa_add_inline_script( 'wppa-admin', $the_js );
2647
  }
2648
 
2649
- // End flex div
2650
- wppa_echo( '</div>' );
2651
-
2652
- // Command stack
2653
- wppa_echo( '
2654
- <h2 class="description" style="margin:1em">' .
2655
- __( '<b>ImageMagick</b> command stack', 'wp-photo-album-plus' ) . ':
2656
- <span
2657
- id="magickstack-' . strval( intval( $id ) ). '"
2658
- style="color:blue"
2659
- >' .
2660
- sanitize_text_field( $magickstack ) . '
2661
- </span>
2662
- <input
2663
- type="button"
2664
- class="wppa-admin-button button"
2665
- id="imstackbutton-' . strval( intval( $id ) ) . '"
2666
- onclick="wppaTryMagick( ' . strval( intval( $id ) ) . ', \'magickundo\' )"
2667
- value="' . esc_attr( __( 'Undo', 'wp-photo-album-plus' ) ) . '"
2668
- title="' . esc_attr( __( 'Undo last Magick command', 'wp-photo-album-plus' ) ) . '"
2669
- style="margin-left:4px;' . ( $magickstack ? 'display:inline;' : 'display:none;' ) . '"
2670
- />
2671
- </h2>' );
2672
-
2673
- // Cropper container
2674
- // Fake 'for social media' to use the local file here, not cloudinary. Files from cloudinary do not reload, even with ?ver=...
2675
- wppa( 'for_sm', true );
2676
- wppa_echo( '
2677
- <div
2678
- class="wppa-cropper-container-wrapper">
2679
- <img
2680
- id="fs-img-' . $id . '"
2681
- src="' . esc_url( wppa_get_photo_url( $id ) ) . '"
2682
- style="float:left;max-width:100%"
2683
- />
2684
- </div>' );
2685
-
2686
- // Reset switch
2687
- wppa( 'for_sm', false );
2688
- }
2689
 
2690
  // End Tab 3
2691
  wppa_echo( '</div>' );
@@ -2809,6 +2762,7 @@ function wppaTryScheduledel( id ) {
2809
 
2810
 
2811
  // Comments
 
2812
  if ( ! $quick && ! empty( $comments ) ) {
2813
 
2814
  wppa_echo( '
@@ -2869,6 +2823,9 @@ function wppaTryScheduledel( id ) {
2869
  }
2870
  wppa_echo( '<td style="padding:0 4px">' . $comment['comment'] . '</td>
2871
  </tr>' );
 
 
 
2872
  }
2873
 
2874
  wppa_echo( '
@@ -2878,7 +2835,18 @@ function wppaTryScheduledel( id ) {
2878
  </div>' );
2879
  }
2880
 
2881
- wppa_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange('.$id.');' );
 
 
 
 
 
 
 
 
 
 
 
2882
 
2883
  wppa_echo( '
2884
  <div class="clear"></div>
@@ -2891,7 +2859,7 @@ function wppaTryScheduledel( id ) {
2891
 
2892
  } /* foreach photo */
2893
 
2894
- wppa_admin_page_links( $page, $pagesize, $count, $link );
2895
 
2896
  } /* photos not empty */
2897
  } /* function */
@@ -2907,6 +2875,7 @@ function wppa_album_photos_bulk( $album ) {
2907
  }
2908
 
2909
  // Init
 
2910
  $count = '0';
2911
  $abort = false;
2912
 
@@ -3020,7 +2989,10 @@ function wppa_album_photos_bulk( $album ) {
3020
  }
3021
  else wppa_error_message( 'Unexpected error #2 in wppa_album_photos_bulk().' );
3022
  }
3023
- else wppa_error_message( 'Unexpected error #1 in wppa_album_photos_bulk().' );
 
 
 
3024
 
3025
  if ( $count && ! $abort ) {
3026
  switch ( wppa_get( 'bulk-action' ) ) {
@@ -3050,11 +3022,18 @@ function wppa_album_photos_bulk( $album ) {
3050
  }
3051
  }
3052
 
3053
- $pagesize = wppa_opt( 'photo_admin_pagesize' ) ? wppa_opt( 'photo_admin_pagesize' ) : '20';
3054
- $next_after = wppa_get( 'next-after', '0' ) ? '1' : '0';
3055
- $p = wppa_get( 'wppa-page', '1' );
3056
- $page = $p + $next_after;
3057
- $skip = ( $page - '1' ) * $pagesize;
 
 
 
 
 
 
 
3058
 
3059
  if ( $album ) {
3060
  if ( $album == 'moderate' ) {
@@ -3099,177 +3078,176 @@ function wppa_album_photos_bulk( $album ) {
3099
 
3100
  if ( $photos ) {
3101
  $plink = $link . '&next-after=' . $next_after;
3102
- wppa_admin_page_links( $page, $pagesize, $count, $plink, '#manage-photos' );
3103
 
3104
- $the_js = "
3105
- function wppaTryMove( id, video ) {
3106
 
3107
- var query;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3108
 
3109
- if ( ! jQuery( '#target-' + id ).val() ) {
3110
- alert( '" . esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) . "' );
3111
- return false;
3112
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3113
 
3114
- if ( video ) {
3115
- query = '" . esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) . "';
3116
- }
3117
- else {
3118
- query = '" . esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) . "';
3119
- }
3120
 
3121
- if ( ! jQuery('#confirm-move').prop('checked') || confirm( query ) ) {
3122
- jQuery( '#moving-' + id ).html( '". __( 'Moving...', 'wp-photo-album-plus' ) . "' );
3123
- wppaAjaxUpdatePhoto( id, 'moveto', jQuery( '#target-' + id ).val(), false, '<td colspan=\'8\' >', '</td>' );
3124
- }
3125
- }" . '
3126
- jQuery(document).ready( function() {
3127
- wppaSetConfirmDelete( "confirm-delete" );
3128
- wppaSetConfirmMove( "confirm-move" );
3129
- });
3130
- function wppaConfirmAndDelete(id, immediate) {
3131
- if ( ! jQuery("#confirm-delete").prop("checked") ||
3132
- confirm( "' . esc_js( __( 'Are you sure you want to delete this photo?', 'wp-photo-album-plus' ) ) . '" ) ) {
3133
- jQuery("#wppa-delete-"+id).html( "' . esc_js( __('Deleting...', 'wp-photo-album-plus' ) ) . '" );
3134
- wppaAjaxDeletePhoto(id, "<td colspan=8 >", "</td>", immediate);
3135
- }
3136
- }';
3137
-
3138
- wppa_add_inline_script( 'wppa-admin', $the_js );
3139
-
3140
- $result = '
3141
- <form action="' . $link . '&wppa-page=' . $page . '#manage-photos" method="post">' .
3142
- wp_nonce_field( 'wppa-bulk', 'wppa-bulk' ) . '
3143
- <h1>
3144
- <span style="font-weight:bold">' . __( 'Bulk action', 'wp-photo-album-plus' ) . '</span>
3145
- <select id="wppa-bulk-action" name="wppa-bulk-action" onchange="wppaBulkActionChange( this, \'bulk-album\' )">
3146
- <option value=""></option>';
3147
- if ( $album == 'trash' ) {
3148
- $result .= '
3149
- <option value="wppa-bulk-delete-immediate">' . __( 'Remove permanently', 'wp-photo-album-plus' ) . '</option>
3150
- <option value="wppa-bulk-undelete">' . __( 'Undelete', 'wp-photo-album-plus' ) . '</option>';
3151
- }
3152
- else {
3153
- $result .= '
3154
- <option value="wppa-bulk-delete">' . __( 'Delete', 'wp-photo-album-plus' ) . '</option>';
3155
- }
3156
- $result .= '
3157
- <option value="wppa-bulk-move-to">' . __( 'Move to', 'wp-photo-album-plus' ) . '</option>
3158
- <option value="wppa-bulk-copy-to">' . __( 'Copy to', 'wp-photo-album-plus' ) . '</option>';
3159
 
3160
- if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) {
3161
- $result .= '
3162
- <option value="wppa-bulk-status">' . __( 'Set status to', 'wp-photo-album-plus' ) . '</option>';
3163
- }
3164
- if ( wppa_user_is_admin() && wppa_switch( 'photo_owner_change' ) ) {
3165
- $result .= '
3166
- <option value="wppa-bulk-owner">' . __( 'Set owner to', 'wp-photo-album-plus' ) . '</option>';
3167
- }
3168
- $result .= '
3169
- </select>' .
3170
-
3171
- wppa_album_select_a( array( 'checkaccess' => true,
3172
- 'path' => true,
3173
- 'exclude' => $album,
3174
- 'selected' => '0',
3175
- 'addpleaseselect' => true,
3176
- 'sort' => true,
3177
- 'tagopen' => '<select' .
3178
- ' name="wppa-bulk-album"' .
3179
- ' id="wppa-bulk-album"' .
3180
- ' style="display:none"' .
3181
- ' onchange="wppa_setCookie( \'wppa_bulk_album\',this.value,365 )"' .
3182
- ' >',
3183
- 'tagname' => 'wppa-bulk-album',
3184
- 'tagid' => 'wppa-bulk-album',
3185
- 'tagonchange' => 'wppa_setCookie( \'wppa_bulk_album\',this.value,365 );',
3186
- 'tagstyle' => 'display:none;cursor:pointer;',
3187
- ) );
3188
 
3189
- wppa_echo( $result );
3190
- ?>
3191
- <select name="wppa-bulk-status" id="wppa-bulk-status" style="display:none" onchange="wppa_setCookie( 'wppa_bulk_status',this.value,365 )">
3192
- <option value=""><?php _e( '- select a status -' , 'wp-photo-album-plus' ) ?></option>
3193
- <option value="pending"><?php _e( 'Pending' , 'wp-photo-album-plus' ) ?></option>
3194
- <option value="publish"><?php _e( 'Publish' , 'wp-photo-album-plus' ) ?></option>
3195
- <?php if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is_admin() ) $dis = ' disabled'; else $dis = ''; ?>
3196
- <option value="featured"<?php wppa_echo( $dis )?> ><?php _e( 'Featured' , 'wp-photo-album-plus' ) ?></option>
3197
- <option value="gold" <?php wppa_echo( $dis )?> ><?php _e( 'Gold' , 'wp-photo-album-plus' ) ?></option>
3198
- <option value="silver" <?php wppa_echo( $dis )?> ><?php _e( 'Silver' , 'wp-photo-album-plus' ) ?></option>
3199
- <option value="bronze" <?php wppa_echo( $dis )?> ><?php _e( 'Bronze' , 'wp-photo-album-plus' ) ?></option>
3200
- <option value="scheduled" <?php wppa_echo( $dis )?> ><?php _e( 'Scheduled' , 'wp-photo-album-plus' ) ?></option>
3201
- <option value="private" <?php wppa_echo( $dis ) ?> ><?php _e( 'Private' , 'wp-photo-album-plus' ) ?></option>
3202
- </select>
3203
- <!-- Owner -->
3204
- <?php $users = wppa_get_users();
3205
- if ( count( $users ) ) { ?>
3206
- <select name="wppa-bulk-owner" id="wppa-bulk-owner" style="display:none" onchange="wppa_setCookie( 'wppa_bulk_owner',this.value,365 )">
3207
- <option value=""><?php _e( '- select an owner -' , 'wp-photo-album-plus' ) ?></option>
3208
- <?php
3209
-
3210
- foreach ( $users as $user ) {
3211
- wppa_echo( '<option value="' . esc_attr( $user['user_login'] ) . '">' . htmlspecialchars( $user['display_name'] ) . ' (' . htmlspecialchars( $user['user_login'] ) . ')</option>' );
3212
- }
3213
- ?>
3214
- </select>
3215
- <?php } else { ?>
3216
- <input name="wppa-bulk-owner" id="wppa-bulk-owner" style="display:none" onchange="wppa_setCookie( 'wppa_bulk_owner',this.value,365 )" />
3217
- <?php } ?>
3218
- <!-- Submit -->
3219
- <input type="submit" onclick="return wppaBulkDoitOnClick()" class="button-primary" value="<?php _e( 'Doit!' , 'wp-photo-album-plus' ) ?>" />
3220
- <?php
3221
  if ( wppa_is_mobile() ) {
3222
- wppa_echo( '<br>' );
3223
  }
3224
- ?>
3225
- <?php $nextafterselhtml =
3226
- '<select name="next-after">' .
3227
- '<option value="-1"' . ( $next_after == '-1' ? ' selected' : '' ) . '>' . __( 'the previous page', 'wp-photo-album-plus' ) . '</option>' .
3228
- '<option value="0"' . ( $next_after == '0' ? ' selected' : '' ) . '>' . __( 'the same page', 'wp-photo-album-plus' ) . '</option>' .
3229
- '<option value="1"' . ( $next_after == '1' ? ' selected' : '' ) . '>' . __( 'the next page', 'wp-photo-album-plus' ) . '</option>' .
3230
- '</select>';
3231
- wppa_echo( sprintf( __( 'Go to %s after Doit!.', 'wp-photo-album-plus' ), $nextafterselhtml ) );
 
3232
  if ( wppa_is_mobile() ) {
3233
- wppa_echo( '<br>' );
3234
  }
3235
- ?>
3236
-
3237
- <input
3238
- type="checkbox"
3239
- id="confirm-delete"
3240
- name="confirm-delete"
3241
- checked="checked"
3242
- onchange="wppaToggleConfirmDelete( this )"
3243
- />
3244
- <?php _e('Confirm delete', 'wp-photo-album-plus' ) ?>
3245
-
3246
- <input
3247
- type="checkbox"
3248
- id="confirm-move"
3249
- name="confirm-move"
3250
- checked="checked"
3251
- onchange="wppaToggleConfirmMove(this)"
3252
- />
3253
- <?php _e('Confirm move', 'wp-photo-album-plus' ) ?>
3254
 
3255
- <?php wppa_echo( '<small style="float:right"> (' . count( $photos ) . ')</small>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3256
 
3257
- ?>
3258
- </h1>
3259
- <?php $edit_link = wppa_ea_url( 'single', 'edit' ) ?>
 
 
 
 
 
 
 
 
 
 
3260
  <table class="widefat">
3261
- <thead style="font-weight:bold">
3262
- <td><input type="checkbox" class="wppa-bulk-photo" onchange="jQuery( '.wppa-bulk-photo' ).prop( 'checked', this.checked )" /></td>
3263
- <td><?php _e( 'ID' , 'wp-photo-album-plus' ) ?></td>
3264
- <td><?php _e( 'Preview' , 'wp-photo-album-plus' ) ?></td>
3265
- <td><?php _e( 'Name' , 'wp-photo-album-plus' ) ?></td>
3266
- <td><?php _e( 'Description' , 'wp-photo-album-plus' ) ?></td>
3267
- <td><?php _e( 'Status' , 'wp-photo-album-plus' ) ?></td>
3268
- <td><?php _e( 'Owner' , 'wp-photo-album-plus' ) ?></td>
3269
- <td><?php _e( 'Remark' , 'wp-photo-album-plus' ) ?></td>
3270
  </thead>
3271
- <tbody>
3272
- <?php
 
3273
  foreach ( $photos as $photo ) {
3274
  $id = $photo['id'];
3275
 
@@ -3291,185 +3269,202 @@ function wppaTryMove( id, video ) {
3291
  }
3292
  }
3293
 
3294
- $maxsize = wppa_get_minisize(); ?>
3295
- <tr id="photoitem-<?php wppa_echo( $photo['id'] ) ?>">
 
 
3296
  <!-- Checkbox -->
3297
  <td>
3298
- <input type="hidden" id="photo-nonce-<?php wppa_echo( $photo['id'] ) ?>" value="<?php wppa_echo( wp_create_nonce( 'wppa-nonce_'.$photo['id'] ) ) ?>" />
3299
- <input type="checkbox" name="wppa-bulk-photo[<?php wppa_echo( $photo['id'] ) ?>]" class="wppa-bulk-photo" />
3300
  </td>
3301
  <!-- ID and delete link -->
3302
- <td><?php
3303
- wppa_echo(
3304
- '<a
3305
- href="' . $edit_link . '&photo=' . $photo['id'] . '"
3306
  target="_blank"
3307
  >' .
3308
- $photo['id'] . '
3309
  </a>
3310
  <br>
3311
  <a
3312
- id="wppa-delete-' . $photo['id'] . '"
3313
- onclick="wppaConfirmAndDelete(' . $photo['id'] . ', '.( $album == 'trash' ? 'true' : 'false' ).' )"
3314
  style="color:red;font-weight:bold;cursor:pointer"
3315
  >' .
3316
  ( $album == 'trash' ? __( 'Remove permanently', 'wp-photo-album-plus' ) : __( 'Delete', 'wp-photo-album-plus' ) ) . '
3317
- </a>' );
3318
- ?>
3319
  </td>
3320
  <!-- Preview -->
3321
- <td style="min-width:240px; text-align:center">
3322
- <?php if ( wppa_is_video( $photo['id'] ) ) {
 
3323
  $a = false;
3324
  if ( wppa_is_file( wppa_strip_ext( wppa_get_photo_path( $id ) ) . '.mp4' ) ) {
3325
  $a = true;
3326
- wppa_echo( '
3327
  <a
3328
  href="' . esc_url( str_replace( '.jpg', '.mp4', wppa_get_photo_url( $id ) ) ) . '"
3329
  target="_blank"
3330
  title="' . esc_attr( __( 'Click to see fullsize video', 'wp-photo-album-plus' ) ) . '"
3331
- >' );
3332
  }
3333
 
3334
- wppa_echo( wppa_get_video_html( array(
3335
- 'id' => $id,
3336
- 'height' => '160',
3337
- 'controls' => false,
3338
- 'tagid' => 'pa-id-' . $id,
3339
- 'preload' => 'metadata',
3340
- 'use_thumb' => true,
3341
- ) ) );
3342
- if ( $a ) {
3343
- wppa_echo( '</a>' );
3344
- }
3345
  }
3346
  else {
3347
- wppa_echo(
3348
- '<a' .
3349
- ' href="' . esc_url( wppa_get_photo_url( $photo['id'] ) ) . '"' .
3350
- ' target="_blank"' .
3351
- ' title="' . esc_attr( __( 'Click to see fullsize', 'wp-photo-album-plus' ) ) . '"' .
3352
- ' >' .
3353
- '<img' .
3354
- ' class="wppa-bulk-thumb"' .
3355
- ' ' . ( wppa_lazy() ? 'data-' : '' ) . 'src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '"' .
3356
- ' style="max-width:' . $maxsize . 'px;max-height:' . $maxsize . 'px"' .
3357
- ' />' .
3358
- '</a>' );
3359
  }
3360
- ?>
3361
  </td>
3362
  <!-- Name, size, move -->
3363
- <!-- Name -->
3364
  <td style="width:25%">
3365
- <input type="text" style="width:300px" id="pname-<?php wppa_echo( $photo['id'] ) ?>" onchange="wppaAjaxUpdatePhoto( <?php wppa_echo( $photo['id'] ) ?>, 'name', this.value)" value="<?php wppa_echo( esc_attr( stripslashes( $photo['name'] ) ) ) ?>" />
3366
- <!-- Size -->
3367
- <?php
3368
- if ( wppa_is_video( $photo['id'] ) ) {
3369
- wppa_echo( '<br>'.wppa_get_videox( $photo['id'], 'admin' ).' x '.wppa_get_videoy( $photo['id'], 'admin' ).' px.' );
 
 
 
 
 
 
3370
  }
3371
  else {
3372
- $sp = wppa_get_source_path( $photo['id'] );
3373
  if ( is_file( $sp ) ) {
3374
  $ima = getimagesize( $sp );
3375
  if ( is_array( $ima ) ) {
3376
- wppa_echo( '<br>'.$ima['0'].' x '.$ima['1'].' px.' );
3377
  }
3378
  }
3379
  }
3380
- ?>
3381
- <!-- Move -->
3382
- <?php
3383
- $max = wppa_opt( 'photo_admin_max_albums' );
3384
- if ( ! $max || wppa_get_total_album_count() < $max ) {
3385
-
3386
- // If not done yet, get the album options html with the current album excluded
3387
- if ( ! isset( $album_select[$album] ) ) {
3388
- $album_select[$album] = wppa_album_select_a( array( 'checkaccess' => true,
3389
- 'path' => true,
3390
- 'exclude' => $album,
3391
- 'selected' => '0',
3392
- 'addpleaseselect' => true,
3393
- 'sort' => true,
3394
- )
3395
- );
3396
- }
3397
-
3398
- wppa_echo(
3399
- '<br>' . __( 'Target album for move to', 'wp-photo-album-plus' ) . '<br>' .
3400
- '<select' .
3401
- ' id="target-' . $id . '"' .
3402
- ' onchange="wppaTryMove(' . $id . ', ' . ( wppa_is_video( $id ) ? 'true' : 'false' ) . ')"' .
3403
- ' style="max-width:300px"' .
3404
- ' >' .
3405
- $album_select[$album] .
3406
- '</select>' .
3407
- '<span id="moving-' . $id . '" style="color:red;font-weight:bold"></span>' );
3408
  }
3409
 
3410
- ?>
3411
- </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3412
  <!-- Description -->
3413
  <td style="width:25%">
3414
- <textarea class="wppa-bulk-dec" style="height:50px; width:100%" onchange="wppaAjaxUpdatePhoto( <?php wppa_echo( $photo['id'] ) ?>, 'description', this.value)"><?php wppa_echo( ( esc_textarea( stripslashes( $photo['description'] ) ) ) ) ?></textarea>
 
 
 
 
 
 
3415
  </td>
3416
  <!-- Status -->
3417
- <td>
3418
- <?php if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) { ?>
3419
- <select id="status-<?php wppa_echo( $photo['id'] ) ?>" onchange="wppaAjaxUpdatePhoto( <?php wppa_echo( $photo['id'] ) ?>, 'status', this.value); wppaPhotoStatusChange( <?php wppa_echo( $photo['id'] ) ?> ); ">
3420
- <option value="pending" <?php if ( $photo['status']=='pending' ) wppa_echo( 'selected' )?> ><?php _e( 'Pending' , 'wp-photo-album-plus' ) ?></option>
3421
- <option value="publish" <?php if ( $photo['status']=='publish' ) wppa_echo( 'selected' )?> ><?php _e( 'Publish' , 'wp-photo-album-plus' ) ?></option>
3422
- <?php if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is_admin() ) $dis = ' disabled'; else $dis = ''; ?>
3423
- <option value="featured" <?php if ( $photo['status']=='featured' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Featured' , 'wp-photo-album-plus' ) ?></option>
3424
- <option value="gold" <?php if ( $photo['status'] == 'gold' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Gold' , 'wp-photo-album-plus' ) ?></option>
3425
- <option value="silver" <?php if ( $photo['status'] == 'silver' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Silver' , 'wp-photo-album-plus' ) ?></option>
3426
- <option value="bronze" <?php if ( $photo['status'] == 'bronze' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Bronze' , 'wp-photo-album-plus' ) ?></option>
3427
- <option value="scheduled" <?php if ( $photo['status'] == 'scheduled' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Scheduled' , 'wp-photo-album-plus' ) ?></option>
3428
- <option value="private" <?php if ( $photo['status'] == 'private' ) wppa_echo( 'selected' ); wppa_echo( $dis )?> ><?php _e( 'Private' , 'wp-photo-album-plus' ) ?></option>
3429
- </select>
3430
- <?php }
3431
  else {
3432
- if ( $photo['status'] == 'pending' ) _e( 'Pending' , 'wp-photo-album-plus' );
3433
- elseif ( $photo['status'] == 'publish' ) _e( 'Publish' , 'wp-photo-album-plus' );
3434
- elseif ( $photo['status'] == 'featured' ) e( 'Featured' );
3435
- elseif ( $photo['status'] == 'gold' ) _e( 'Gold' , 'wp-photo-album-plus' );
3436
- elseif ( $photo['status'] == 'silver' ) _e( 'Silver' , 'wp-photo-album-plus' );
3437
- elseif ( $photo['status'] == 'bronze' ) _e( 'Bronze' , 'wp-photo-album-plus' );
3438
- elseif ( $photo['status'] == 'scheduled' ) _e( 'Scheduled' , 'wp-photo-album-plus' );
3439
- elseif ( $photo['status'] == 'private' ) _e( 'Private' , 'wp-photo-album-plus' );
3440
- } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3441
  </td>
3442
  <!-- Owner -->
3443
- <td>
3444
- <?php wppa_echo( $photo['owner'] ) ?>
3445
  </td>
3446
  <!-- Remark -->
3447
- <td id="remark-<?php wppa_echo( $photo['id'] ) ?>" style="width:25%">
3448
- <?php _e( 'Not modified' , 'wp-photo-album-plus' ) ?>
3449
- <?php wppa_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange('.$photo['id'].');' ); ?>
3450
  </td>
3451
- </tr>
3452
- <?php } ?>
 
 
 
 
 
3453
  </tbody>
3454
- <tfoot style="font-weight:bold">
3455
- <td><input type="checkbox" class="wppa-bulk-photo" onchange="jQuery( '.wppa-bulk-photo' ).prop( 'checked', this.checked )" /></td>
3456
- <td><?php _e( 'ID' , 'wp-photo-album-plus' ) ?></td>
3457
- <td><?php _e( 'Preview' , 'wp-photo-album-plus' ) ?></td>
3458
- <td><?php _e( 'Name' , 'wp-photo-album-plus' ) ?></td>
3459
- <td><?php _e( 'Description' , 'wp-photo-album-plus' ) ?></td>
3460
- <td><?php _e( 'Status' , 'wp-photo-album-plus' ) ?></td>
3461
- <td><?php _e( 'Owner' , 'wp-photo-album-plus' ) ?></td>
3462
- <td><?php _e( 'Remark' , 'wp-photo-album-plus' ) ?></td>
3463
  </tfoot>
3464
  </table>
3465
- </form>
3466
- <?php
3467
- wppa_admin_page_links( $page, $pagesize, $count, $plink, '#manage-photos' );
 
 
3468
  }
3469
  else {
3470
  if ( $page == '1' ) {
3471
  if ( wppa_get( 'searchstring' ) ) {
3472
- wppa_echo( '<h1>' . __( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . '</h1>' );
3473
  }
3474
  elseif ( $album == 'moderate' ) {
3475
  wppa_echo( '<h1>' . __( 'No photos to moderate', 'wp-photo-album-plus' ) . '</h1>' );
@@ -3483,7 +3478,7 @@ function wppaTryMove( id, video ) {
3483
  }
3484
  else {
3485
  $page_1 = $page - '1';
3486
- wppa_echo( sprintf( __( 'Page %d is empty, try <a href="%s">page %d</a>.', 'wp-photo-album-plus' ), $page, $link . '&wppa-page=' . $page_1 . '#manage-photos', $page_1 ) );
3487
  }
3488
  }
3489
  }
@@ -3492,11 +3487,20 @@ function wppaTryMove( id, video ) {
3492
  function wppa_album_photos_sequence( $album ) {
3493
  global $wpdb;
3494
 
 
 
3495
  if ( $album ) {
3496
  $photoorder = wppa_get_photo_order( $album, 'norandom' );
3497
  $is_descending = strpos( $photoorder, 'DESC' ) !== false;
3498
  $is_p_order = strpos( $photoorder, 'p_order' ) !== false;
3499
 
 
 
 
 
 
 
 
3500
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
3501
  WHERE album = %s" . $photoorder, $album ), ARRAY_A );
3502
 
@@ -3504,150 +3508,95 @@ global $wpdb;
3504
  $size = '180';
3505
 
3506
  if ( $photos ) {
 
3507
 
3508
- $the_js = '
3509
- jQuery( function() {
3510
- jQuery( "#sortable" ).sortable( {
3511
- cursor: "move",
3512
- placeholder: "sortable-placeholder-photos",
3513
- stop: function( event, ui ) {
3514
- var ids = jQuery( ".wppa-sort-item" );
3515
- var seq = jQuery( ".wppa-sort-seqn" );
3516
- var idx = 0;
3517
- var descend = ' . ( $is_descending ? 'true' : 'false' ) . ';
3518
- while ( idx < ids.length ) {
3519
- var newvalue;
3520
- if ( descend ) newvalue = ids.length - idx;
3521
- else newvalue = idx + 1;
3522
- var oldvalue = seq[idx].value;
3523
- var photo = ids[idx].value;
3524
- if ( newvalue != oldvalue ) {
3525
- wppaDoSeqUpdate( photo, newvalue );
3526
- }
3527
- idx++;
3528
- }
3529
- },
3530
- delay: 100,
3531
- opacity: 0.5,
3532
- scroll: false,
3533
- cursorAt: { left: 90, top: 90 }
3534
- });
3535
- jQuery( "#sortable" ).disableSelection();
3536
- });
3537
- var wppaAjaxRequests = 0;
3538
- function wppaDoSeqUpdate( photo, seqno ) {
3539
- if ( wppaAjaxRequests >=10 ) {
3540
- setTimeout(function(){wppaDoSeqUpdate( photo, seqno );},500);
3541
- return;
3542
  }
3543
- var data = "action=wppa&wppa-action=update-photo&photo-id="+photo+"&item=p_order&wppa-nonce="+document.getElementById(\'photo-nonce-\'+photo).value+"&value="+seqno;
3544
- var xmlhttp = new XMLHttpRequest();
3545
-
3546
- xmlhttp.onreadystatechange = function() {
3547
- if ( xmlhttp.readyState == 4 && xmlhttp.status != 404 ) {
3548
- var ArrValues = xmlhttp.responseText.split( "||" );
3549
- if ( ArrValues[0] != "" ) {
3550
- alert("The server returned unexpected output:\n"+ArrValues[0]);
3551
- }
3552
- switch ( ArrValues[1] ) {
3553
- case "0": // No error
3554
- jQuery("#wppa-seqno-"+photo).html(seqno);
3555
- break;
3556
- case "99": // Photo is gone
3557
- jQuery("#wppa-seqno-"+photo).html(\'<span style="color:red">deleted</span>\');
3558
- break;
3559
- default: // Any error
3560
- jQuery("#wppa-seqno-"+photo).html(\'<span style="color:red">Err:"+ArrValues[1]+"</span>\');
3561
- break;
3562
- }
3563
- wppaAjaxRequests--;
3564
- wppaConsoleLog("Pending ajax requests = "+wppaAjaxRequests);
3565
- }
3566
  }
3567
- xmlhttp.open("POST",wppaAjaxUrl,true);
3568
- xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
3569
- xmlhttp.send( data );
3570
- wppaAjaxRequests++;
3571
- wppaConsoleLog("Pending ajax requests = "+wppaAjaxRequests);
3572
- jQuery("#wppa-sort-seqn-"+photo).val(seqno); // set hidden value to new value to prevent duplicate action
3573
- var spinnerhtml = \'<img src="\'+wppaImageDirectory+\'spinner.gif" />\';
3574
- jQuery("#wppa-seqno-"+photo).html(spinnerhtml);
3575
- }';
3576
- wppa_add_inline_script( 'wppa-admin', $the_js );
3577
-
3578
- if ( ! $is_p_order ) wppa_warning_message( __( 'Setting photo sequence has only effect if the photo sequence method is set to <b>Sequence #</b>' , 'wp-photo-album-plus' ) ) ?>
3579
- <div class="widefat wppa-photo-admin-sortable" style="border-color:#cccccc">
3580
- <ul id="sortable">
3581
- <?php foreach ( $photos as $photo ) {
3582
- if ( wppa_is_video( $photo['id'] ) ) {
3583
- $imgs['0'] = wppa_get_videox( $photo['id'], 'admin' );
3584
- $imgs['1'] = wppa_get_videoy( $photo['id'], 'admin' );
 
 
 
 
 
 
 
 
 
 
 
 
3585
  }
3586
  else {
3587
- $imgs['0'] = wppa_get_thumbx( $photo['id'] );
3588
- $imgs['1'] = wppa_get_thumby( $photo['id'] );
3589
- }
3590
- if ( ! $imgs['0'] ) { // missing thuimbnail, prevent division by zero
3591
- $imgs['0'] = 200;
3592
- $imgs['1'] = 150;
3593
- }
3594
- $mw = $size - '20';
3595
- $mh = $mw * '3' / '4';
3596
- if ( $imgs[1]/$imgs[0] > $mh/$mw ) { // more portrait than 200x150, y is limit
3597
- $mt = '15';
3598
- }
3599
- else { // x is limit
3600
- $mt = ( $mh - ( $imgs[1]/$imgs[0] * $mw ) ) / '2' + '15';
3601
  }
3602
- ?>
3603
- <li id="photoitem-<?php wppa_echo( $photo['id'] ) ?>" class="ui-state-default-photos wppa-<?php wppa_echo( $photo['status'] ) ?>" style="background-image:none; text-align:center; cursor:move">
3604
- <?php if ( wppa_is_video( $photo['id'] ) ) { ?>
3605
- <?php $id = $photo['id'] ?>
3606
- <?php $imgstyle = 'max-width:'.$mw.'px;max-height:'.$mh.'px;margin-top:'.$mt.'px;' ?>
3607
- <?php wppa_echo( wppa_get_video_html( array(
3608
- 'id' => $id,
3609
- // 'width' => $imgwidth,
3610
- // 'height' => '60',
3611
- 'controls' => false,
3612
- // 'margin_top' => '0',
3613
- // 'margin_bottom' => '0',
3614
- 'tagid' => 'pa-id-'.$id,
3615
- // 'cursor' => 'cursor:pointer;',
3616
- // 'events' => ' onmouseover="jQuery( this ).css( \'height\', \'160\' )" onmouseout="jQuery( this ).css( \'height\', \'60\' )"',
3617
- // 'title' => $title,
3618
- 'preload' => 'metadata',
3619
- // 'onclick' => $onclick,
3620
- // 'lb' => false,
3621
- 'class' => 'wppa-bulk-thumb',
3622
- 'style' => $imgstyle,
3623
- 'use_thumb' => true
3624
- )) );
3625
 
 
 
3626
 
3627
- }
3628
- else {
3629
- wppa_echo(
3630
- '<img' .
3631
- ' class="wppa-bulk-thumb"' .
3632
- ' ' . ( wppa_lazy() ? 'data-' : '' ) . 'src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '"' .
3633
- ' style="max-width:' . $mw . 'px;max-height:' . $mh . 'px;margin-top:' . $mt . 'px" />' );
3634
- } ?>
3635
- <div style="font-size:9px; position:absolute; bottom:24px; text-align:center; width:<?php wppa_echo( $size ) ?>px"><?php wppa_echo( wppa_get_photo_name( $photo['id'] ) ) ?></div>
3636
- <div style="text-align: center; width: <?php wppa_echo( $size ) ?>px; position:absolute; bottom:8px">
3637
- <span style="margin-left:15px;float:left"><?php wppa_echo( __( 'Id: ' , 'wp-photo-album-plus' ).$photo['id'] )?></span>
3638
- <?php if ( wppa_is_video( $photo['id'] ) )_e('Video', 'wp-photo-album-plus' ); ?>
3639
- <?php if ( wppa_has_audio( $photo['id'] ) ) _e('Audio', 'wp-photo-album-plus' ); ?>
3640
- <span style="float:right; margin-right:15px"><?php wppa_echo( __( 'Seq: ' , 'wp-photo-album-plus' ).'<span id="wppa-seqno-'.$photo['id'].'">'.$photo['p_order'] ) ?></span>
3641
  </div>
3642
- <input type="hidden" id="photo-nonce-<?php wppa_echo( $photo['id'] ) ?>" value="<?php wppa_echo( wp_create_nonce( 'wppa-nonce_'.$photo['id'] ) ); ?>" />
3643
- <input type="hidden" class="wppa-sort-item" value="<?php wppa_echo( $photo['id'] ) ?>" />
3644
- <input type="hidden" class="wppa-sort-seqn" id="wppa-sort-seqn-<?php wppa_echo( $photo['id'] ) ?>" value="<?php wppa_echo( $photo['p_order'] ) ?>" />
3645
- </li>
3646
- <?php } ?>
 
 
3647
  </ul>
3648
  <div style="clear:both"></div>
3649
- </div>
3650
- <?php
3651
  }
3652
  else {
3653
  wppa_echo( '<h1>'.__( 'The album is empty.' , 'wp-photo-album-plus' ).'</h1>' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 8.3.01.006
7
  *
8
  */
9
 
20
  $photo = wppa_get( 'photo', '0', 'int' );
21
  $thumb = wppa_cache_photo( $photo );
22
  if ( $thumb['owner'] == wppa_get_user() ) {
23
+ wppa_echo( '
24
+ <div class="wrap">
25
+ <h1 class="wp-heading-inline">' .
26
+ get_admin_page_title() . '
27
+ </h1>' );
28
  wppa_album_photos( '', $photo );
29
+ wppa_echo( '
30
+ </div>' );
31
  }
32
  else {
33
  wp_die( 'You do not have the rights to do this' );
36
 
37
  // Edit all photos owned by current user
38
  else {
39
+ wppa_echo( '
40
+ <div class="wrap">
41
+ <h1 class="wp-heading-inline">' .
42
+ get_admin_page_title() . '
43
+ </h1>' );
44
  wppa_album_photos( '', '', wppa_get_user() );
45
+ wppa_echo( '
46
+ </div>' );
47
  }
48
  }
49
 
55
  $just_edit = wppa_get( 'just-edit' );
56
 
57
  if ( $photo && $just_edit && wppa_user_is_admin() ) {
58
+ wppa_echo( '
59
+ <div class="wrap">
60
+ <h1 class="wp-heading-inline">' .
61
+ esc_html__( 'Edit', 'wp-photo-album-plus' ) . '
62
+ </h1>' .
63
+ wppa_get( 'just-edit' ) );
64
  wppa_album_photos( '', $photo, '', false );
65
+ wppa_echo( '
66
+ </div>' );
67
  }
68
  else {
69
+ wppa_echo( '
70
+ <div class="wrap">
71
+ <h1 class="wp-heading-inline">' .
72
+ get_admin_page_title() . '
73
+ </h1>' );
74
  if ( wppa_switch( 'moderate_bulk' ) ) {
75
  wppa_album_photos_bulk( 'moderate' );
76
  }
77
  else {
78
  wppa_album_photos( '', $photo, '', true );
79
  }
80
+ wppa_echo( '
81
+ </div>' );
82
  }
83
  }
84
 
86
  function wppa_album_photos( $album = '', $photo = '', $owner = '', $moderate = false ) {
87
  global $wpdb;
88
 
89
+ // Init
90
+ wppa_add_local_js( 'wppa_album_photos' );
91
+ $a = wppa_is_int( $album ) ? $album : '0';
92
+ $is_empty = false;
93
+
94
+ $slug = 'photo_admin';
95
+ $quick = wppa_get( 'quick' );
96
+ if ( $quick )
97
+ $slug = 'photo_quick';
98
+
99
+ $parms = wppa_get_paging_parms( $slug );
100
+
101
+ $pagesize = $parms['pagesize'];
102
+ $page = $parms['page'];
103
+
104
+ if ( ! is_numeric( $page ) )
105
+ $page = 1;
106
  $skip = ( $page - '1' ) * $pagesize;
107
+ $is_album = false;
108
+ $photos = array();
109
 
110
  // Edit the photos in a specific album
111
  if ( $album ) {
114
  if ( $album == 'search' ) {
115
  $count = wppa_get_edit_search_photos( '', '', 'count_only' );
116
  $photos = wppa_get_edit_search_photos( $skip, $pagesize );
 
117
  $link = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=' . $album . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&wppa-searchstring=' . wppa_get( 'searchstring' );
118
  }
119
 
138
 
139
  // A physical album
140
  else {
141
+ $is_album = true;
142
  $counts = wppa_get_treecounts_a( $album, true );
143
  $count = $counts['selfphotos'] + $counts['pendselfphotos'] + $counts['scheduledselfphotos'];
144
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
184
  $link = '';
185
  }
186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  // Are there photos to moderate?
188
+ elseif ( empty( $photos ) ) {
189
 
190
  $photos = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_photos
191
  WHERE status = 'pending'
193
  $count = count( $photos );
194
  }
195
 
196
+ // Are there photos with pending comments?
 
 
 
 
 
 
 
 
 
 
 
197
 
198
+ // Find pending comments
199
+ $cmt = $wpdb->get_results( "SELECT photo FROM $wpdb->wppa_comments
200
+ WHERE status = 'pending'
201
+ OR status = 'spam'", ARRAY_A );
202
 
203
+ $cphotos = array();
204
+ if ( is_array( $cmt ) && count( $cmt ) ) {
 
205
 
206
+ foreach( $cmt as $id ) {
207
+ $cphotos[] = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
208
+ WHERE id = %d", $id ), ARRAY_A );
209
  }
210
+ $count = count( $cphotos );
211
 
212
+ if ( $count ) {
213
+ $photos = array_merge( $photos, $cphotos );
 
214
  }
215
  }
216
+ $link = get_admin_url() . 'admin.php?page=wppa_moderate_photos&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
217
  }
218
 
219
  // If not one of the cases above apply, log error and quit
222
  return;
223
  }
224
 
225
+ // No photos to moderate?
226
+ if ( empty( $photos ) ) {
227
+
228
+ $is_empty = true;
229
+
230
+ // Single photo moderate requested
231
+ if ( $photo ) {
232
+ wppa_echo( '<p>' . esc_html__( 'This photo is no longer awaiting moderation' , 'wp-photo-album-plus' ) . '</p>' );
233
+ }
234
+
235
+ // Multiple photos to moderate requested
236
+ elseif ( $moderate ) {
237
+ wppa_echo( '<p>' . esc_html__( 'There are no photos awaiting moderation at this time', 'wp-photo-album-plus' ) . '</p>' );
238
+ }
239
+
240
+ else {
241
+ wppa_echo( '<p>' . esc_html__( 'There are no items matching your search creteria', 'wp-photo-album-plus' ) . '</p>' );
242
+ }
243
+
244
+ // If i am admin, i can edit all photos here, sorted by timestamp desc
245
+ if ( wppa_user_is_admin() ) {
246
+
247
+ wppa_echo( '<p>' . esc_html( 'Instead, here is a list of all items ordered by timestamp, most recently first', 'wp-photo-album-plus' ) . '</p>' );
248
+ wppa_echo( '<h1>' . esc_html__( 'Manage all photos by timestamp', 'wp-photo-album-plus' ) . '</h1>' );
249
+
250
+ $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
251
+ ORDER BY timestamp DESC
252
+ LIMIT %d, %d", $skip, $pagesize ), ARRAY_A );
253
+
254
+ $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos" );
255
+ $link = get_admin_url() . 'admin.php?page=wppa_moderate_photos&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
256
+ }
257
+
258
+ // Nothing to do
259
+ else {
260
+ return;
261
+ }
262
+ }
263
+
264
  // Quick edit skips a few time consuming settings like copy and move to other album
265
  $quick = wppa_get( 'quick' );
266
  if ( $link && $quick ) $link .= '&quick=1';
267
 
268
  // In case it is a seaerch and edit, show the search statistics
269
+ if ( ! $is_empty ) {
270
+ wppa_show_search_statistics();
271
+ }
272
 
273
  // If no photos selected produce appropriate message and quit
274
  if ( empty( $photos ) ) {
289
 
290
  // Search
291
  if ( wppa_get( 'searchstring' ) ) {
292
+ wppa_echo( '<h1>' . esc_html__( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . ' 1</h1>' );
293
  }
294
 
295
  // Album
304
  // There are photos to display for editing
305
  else {
306
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  $mvt = esc_attr( __( 'Move video', 'wp-photo-album-plus' ) );
308
  $mpt = esc_attr( __( 'Move photo', 'wp-photo-album-plus' ) );
309
  $cvt = esc_attr( __( 'Copy video', 'wp-photo-album-plus' ) );
310
  $cpt = esc_attr( __( 'Copy photo', 'wp-photo-album-plus' ) );
311
 
312
  // Display the pagelinks
313
+ wppa_admin_pagination( $pagesize, $page, $count, $link, 'top' );
314
 
315
  // Horizon
316
  wppa_echo( '<div id="wppa-horizon"><hr></div>' );
446
  wppa_echo( '
447
  <div
448
  id="photoitem-' . $id . '"
449
+ class="wppa-table-wrap photoitem"
450
+ style="display:block;padding:20px;clear:both;"
451
  >' .
452
 
453
  // Photo specific nonce field
476
  'width' => '160',
477
  'height' => '160' * $videoy / $videox,
478
  'controls' => false,
479
+ 'use_thumb' => true,
480
+ 'margin_bottom' => '6px;',
481
  ) ) . '
482
  </a>' );
483
 
521
  id="thumburl-' . $id . '"' .
522
  ( wppa_lazy() && $count > '1' ? ' data-' : ' ' ) . 'src="' . esc_url( $src ) . '"
523
  alt="' . esc_attr( $name ) . '"
524
+ style="max-width:160px;vertical-align:middle;margin-bottom:6px;"
525
  />
526
  </a>' );
527
 
558
 
559
  wppa_echo( '</div>' );
560
  }
 
561
 
562
+ // Name
563
+ wppa_echo( '
564
+ <fieldset class="wppa-fieldset" style="float:left;margin-right:12px;min-height:72px;margin-bottom:6px;">
565
+ <legend class="wppa-legend">' .
566
+ __( 'Name', 'wp-photo-album-plus' ) . '
567
+ </legend>
568
+ <div style="display:inline-block;padding-left:12px;">
569
+ <label>' .
570
+ __( 'Name slug', 'wp-photo-album-plus' ) . ': ' . $sname . '
571
+ </label><br>
572
+ <input
573
+ type="text"
574
+ style="width:100%;height:32px;"
575
+ id="pname-' . $id . '"
576
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'name\', this.value)"
577
+ value="' . esc_attr( stripslashes( $name ) ) . '"
578
+ />
579
+ </div>
580
+ </fieldset>' );
581
+
582
+ // Status
583
+ if ( $may_edit_status ) {
584
+ $sel = ' selected';
585
+ if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is_admin() ) {
586
+ $dis = ' disabled';
587
+ }
588
+ else {
589
+ $dis = '';
590
+ }
591
+ wppa_echo( '
592
+ <fieldset class="wppa-fieldset" style="float:left;margin-right:12px;min-height:72px;margin-bottom:6px;">
593
+ <legend class="wppa-legend">' .
594
+ __( 'Status', 'wp-photo-album-plus' ) . '
595
+ </legend>
596
+ <div style="display:inline-block;padding-left:12px;">
597
+ <label>
598
+ &nbsp;
599
+ </label><br>
600
+
601
+ <select
602
+ style="vertical-align:inherit;height:32px;"
603
+ id="status-' . $id . '"
604
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'status\', this.value); wppaPhotoStatusChange( ' . $id . ' )">
605
+ <option value="pending"' . ( $status == 'pending' ? $sel : '' ) . ' >' .
606
+ __( 'Pending', 'wp-photo-album-plus' ) . '
607
+ </option>
608
+ <option value="publish"' . ( $status =='publish' ? $sel : '' ) . ' >' .
609
+ __( 'Publish', 'wp-photo-album-plus' ) . '
610
+ </option>
611
+ <option value="featured"' . ( $status == 'featured' ? $sel : '' ) . $dis . ' >' .
612
+ __( 'Featured', 'wp-photo-album-plus' ) . '
613
+ </option>
614
+ <option value="gold"' . ( $status == 'gold' ? $sel : '' ) . $dis . ' >' .
615
+ __( 'Gold', 'wp-photo-album-plus' ) . '
616
+ </option>
617
+ <option value="silver"' . ( $status == 'silver' ? $sel : '' ) . $dis . ' >' .
618
+ __( 'Silver', 'wp-photo-album-plus' ) . '
619
+ </option>
620
+ <option value="bronze"' . ( $status == 'bronze' ? $sel : '' ) . $dis . ' >' .
621
+ __( 'Bronze', 'wp-photo-album-plus' ) . '
622
+ </option>
623
+ <option value="scheduled"' . ( $status == 'scheduled' ? $sel : '' ) . $dis . ' >' .
624
+ __( 'Scheduled', 'wp-photo-album-plus' ) . '
625
+ </option>
626
+ <option value="private"' . ( $status == 'private' ? $sel : '' ) . $dis . ' >' .
627
+ __( 'Private', 'wp-photo-album-plus' ) . '
628
+ </option>
629
+ </select>
630
+ ' .
631
+ wppa_get_date_time_select_html( 'photo', $id, true ) . '
632
+ </div>
633
+
634
+
635
+ </fieldset>' );
636
+ }
637
+ else {
638
+
639
+ if ( $status == 'pending' ) $s = __( 'Pending', 'wp-photo-album-plus' );
640
+ elseif ( $status == 'publish' ) $s = __( 'Publish', 'wp-photo-album-plus' );
641
+ elseif ( $status == 'featured' ) $s = __( 'Featured', 'wp-photo-album-plus' );
642
+ elseif ( $status == 'gold' ) $s = __( 'Gold', 'wp-photo-album-plus' );
643
+ elseif ( $status == 'silver' ) $s = __( 'Silver', 'wp-photo-album-plus' );
644
+ elseif ( $status == 'bronze' ) $s = __( 'Bronze', 'wp-photo-album-plus' );
645
+ elseif ( $status == 'scheduled' ) $s = __( 'Scheduled', 'wp-photo-album-plus' );
646
+ elseif ( $status == 'private' ) $s = __( 'Private', 'wp-photo-album-plus' );
647
+ wppa_echo( '
648
+ <fieldset class="wppa-fieldset" style="float:left;margin-right:12px;min-height:72px;margin-bottom:6px;">
649
+ <legend class="wppa-legend">' .
650
+ __( 'Status', 'wp-photo-album-plus' ) . '
651
+ </legend>
652
+ <div style="display:inline-block;padding-left:12px;">
653
+ <label>
654
+ &nbsp;
655
+ </label><br>' .
656
+ $s . '
657
+ </div>
658
+ </div>' );
659
+ }
660
+
661
+ // Get the statistics
662
+
663
+ wppa_echo( '
664
+ <fieldset class="wppa-fieldset" style="float:left;margin-right:12px;min-height:72px;margin-bottom:6px;">
665
+ <legend class="wppa-legend">' .
666
+ __( 'Statistics', 'wp-photo-album-plus' ) . '
667
+ </legend>' );
668
+
669
+
670
  {
671
+ $th = array();
672
+ $td = array();
673
 
674
  // Clicks
675
  if ( wppa_switch( 'track_clickcounts' ) ) {
676
+ $th[] = __( 'Clicks', 'wp-photo-album-plus' );
677
+ $td[] = strval( intval( $clicks ) );
678
  }
679
 
680
  // Views
681
  if ( wppa_switch( 'track_viewcounts' ) ) {
682
+ $th[] = __( 'Views', 'wp-photo-album-plus' );
683
+ $td[] = strval( intval( $views ) );
684
  }
685
 
686
  // Downloads. Only photos are downloadable
687
  if ( ! wppa_is_multi( $id ) ) {
688
+ $th[] = __( 'Downloads', 'wp-photo-album-plus' );
689
+ $td[] = strval( intval( $dlcount ) );
690
  }
 
 
 
 
 
 
691
 
692
  // Rating
693
  $entries = wppa_get_rating_count_by_id( $id );
698
  }
699
  else {
700
  $label = __( 'Rating (#, avg)', 'wp-photo-album-plus' );
701
+ $count = wppa_get_rating_count_by_id( $id );
702
+ $avg = wppa_get_rating_by_id( $id, 'nolabel' );
703
+ $value = $count . ', ' . $avg;
704
  }
705
  }
706
  else {
708
  $value = __( 'None', 'wp-photo-album-plus' );
709
  }
710
 
711
+ $th[] = $label;
712
+ $td[] = $value;
713
 
714
  // Dislikes
715
  $dislikes = wppa_dislike_get( $id );
716
  if ( $dislikes ) {
717
+ $th[] = __( 'Dislikes', 'wp-photo-album-plus' );
718
+ $td[] = strval( intval( $dislikes ) );
719
  }
720
 
721
  // Pending votes
722
  $pending = wppa_pendrat_get( $id );
723
  if ( $pending ) {
724
+ $th[] = __( 'Pending votes', 'wp-photo-album-plus' );
725
+ $td[] = strval( intval( $pending ) );
726
  }
727
  }
728
 
729
  // Display the stats
730
+ $c = count( $th );
731
+ for ( $i = 0; $i < $c; $i++ ) {
732
+ wppa_echo( '
733
+ <div style="display:inline-block;padding-left:12px;">
734
+ <label>' .
735
+ $th[$i] . '
736
+ </label><br>
737
+ <div class="wppa-ldi">' .
738
+ $td[$i] . '
739
+ </div>
740
+ </div>' );
741
+ }
 
 
 
 
 
 
742
 
743
+ wppa_echo( '</fieldset>' );
744
 
745
+ // Update status field
746
+ {
747
+ wppa_echo( '
748
+ <fieldset class="wppa-fieldset" style="float:left;margin-right:12px;min-height:72px;margin-bottom:6px;">
749
+ <legend class="wppa-legend">' .
750
+ __( 'Remark', 'wp-photo-album-plus' ) . '
751
+ </legend>
752
+ <div style="display:inline-block;padding-left:12px;">
753
+ <label>
754
+ &nbsp;
755
+ </label><br>
756
+ <span
757
+ id="remark-' . $id . '"
758
+ style="font-weight:bold;color:#00AA00;font-size:1.5em;">' .
759
+ ( $is_video ? sprintf( __( 'Video %s is not modified yet', 'wp-photo-album-plus' ), $id ) :
760
+ sprintf( __( 'Photo %s is not modified yet', 'wp-photo-album-plus' ), $id ) ) . '
761
+ </span>
762
+ </div>
763
+ </fieldset>' );
764
+ }
765
 
766
  wppa_echo( '
767
  </div>' );
774
 
775
  // Open the details area
776
  wppa_echo( '
777
+ <details id="wppa-toplevel-details-'.$id.'" class="wppa-toplevel-details" ' . ( $timestamp > time() - 3600 ? 'open' : '' ) . '>
778
  <summary class="toplevel wppa-summary-sublevel"> ' .
779
  $details . '
780
  </summary>' );
781
+ /*
782
  // Update status field
783
  {
784
  wppa_echo( '
792
  </span>
793
  </h3>' );
794
  }
795
+ */
796
  // The tabs
797
  $ptitle = __( 'Photo', 'wp-photo-album-plus' );
798
  if ( wppa_is_video( $id ) ) $ptitle = __( 'Video', 'wp-photo-album-plus' );
812
  }
813
  if ( ! $quick && ! empty( $exifs ) ) {
814
  $result .= '
815
+ <li
816
+ class="wppa-photoadmin-tab-'.$id.'"
817
+ onclick="wppaChangePhotoAdminTab(this,\'#photoexif-'.$id.'\','.$id.');">' .
818
+ __( 'EXIF', 'wp-photo-album-plus' ) . '
819
+ </li>';
820
  }
821
  if ( ! $quick && ! empty( $iptcs ) ) {
822
  $result .= '
823
+ <li
824
+ class="wppa-photoadmin-tab-'.$id.'"
825
+ onclick="wppaChangePhotoAdminTab(this,\'#photoiptc-'.$id.'\','.$id.');">' .
826
+ __( 'IPTC', 'wp-photo-album-plus' ) . '
827
+ </li>';
828
  }
829
  if ( ! $quick && ! empty( $comments ) ) {
830
  $result .= '
831
+ <li
832
+ id="wppa-photoadmin-tab-'.$id.'"
833
+ class="wppa-photoadmin-tab-'.$id.'"
834
+ onclick="wppaChangePhotoAdminTab(this,\'#photocomment-'.$id.'\','.$id.');">' .
835
+ __( 'Comments', 'wp-photo-album-plus' ) . '
836
+ </li>';
837
  }
838
  $result .= '
839
  </ul>
841
  </div>';
842
  wppa_echo( $result );
843
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
844
  // Tab 1 Photo general
845
  wppa_echo( '
846
  <div
922
  }
923
 
924
  // Album. Show album only when it is not evident
925
+ if ( ! $is_album ) {
926
  wppa_echo( '
927
  <div class="left" style="margin-right: 4px;">
928
  <label>' .
992
  }
993
 
994
  // Status
995
+ /*
996
  if ( ! $may_edit_status ) {
997
  if ( $status == 'pending' ) $s = __( 'Pending', 'wp-photo-album-plus' );
998
  elseif ( $status == 'publish' ) $s = __( 'Publish', 'wp-photo-album-plus' );
1012
  </div>
1013
  </div>' );
1014
  }
1015
+ */
1016
 
1017
  // Schedule for delete
1018
  if ( ! wppa_user_is_admin() && $owner != wppa_get_user() ) {
1069
 
1070
  // Owner
1071
  if ( $owner_editable ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1072
  if ( wppa_get_user_count() > wppa_opt( 'max_users' ) ) {
1073
  wppa_echo( '
1074
  <div class="left">
1173
  }
1174
 
1175
  // Status
1176
+ if ( ! $moderate && $may_edit_status ) {
1177
  $sel = ' selected';
1178
  if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is_admin() ) {
1179
  $dis = ' disabled';
1600
  wppa_echo( '
1601
  <div class="wppa-flex-column">' );
1602
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1603
  // Description editable
1604
  if ( ! wppa_switch( 'desc_is_restricted' ) || wppa_user_is_admin() ) {
1605
  wppa_echo( '
1900
  <div
1901
  id="photofiles-' . $id . '"
1902
  class="wppa-table-wrap wppa-tabcontent-'.$id.'"
1903
+ style="position:relative;padding:10px;display:none"
1904
  >' );
1905
 
 
1906
  wppa_echo( '
1907
+ <div class="wppa-flex">' );
1908
+
1909
+ wppa_echo( '
1910
+ <fieldset class="wppa-fieldset">
1911
+ <legend class="wppa-legend">' .
1912
+ __( 'Available files', 'wp-photo-album-plus' ) . '
1913
+ </legend>' );
1914
+ {
1915
+ wppa_echo( '
1916
+ <table class="wppa-table">
1917
+ <thead>
1918
+ <td>' . __( 'Type', 'wp-photo-album-plus' ) . '</td>
1919
+ <td>' . __( 'Size', 'wp-photo-album-plus' ) . '</td>
1920
+ <td>' . __( 'Path', 'wp-photo-album-plus' ) . '</td>
1921
+ <td>' . __( 'Url', 'wp-photo-album-plus' ) . '</td>
1922
+ </thead>
1923
+ <tbody>' );
1924
+
1925
+ // Video
1926
+ if ( $b_is_video ) {
1927
+
1928
+ $formats = '';
1929
+ $paths = '';
1930
+ $urls = '';
1931
+ foreach ( $is_video as $fmt ) {
1932
+ $formats .= $fmt . ' (' . wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . ')<br>';
1933
+ $paths .= str_replace( WPPA_UPLOAD_PATH, '.../wppa', str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . '<br>';
1934
+ $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) );
1935
+ $urls .= '<a href="'. $url .'" target="_blank">' . $url . '<br>';
1936
+ }
1937
 
1938
+ wppa_echo( '
1939
+ <tr>
1940
+ <td>' .
1941
+ $formats . '
1942
+ </td>
1943
+ <td>' );
1944
+
1945
+ // If video sizes are correct and retieved from the file,
1946
+ // and possible rotation has been into account, field needs not to be editable
1947
+ if ( $photo['videox'] == $videox && $photo['videoy'] == $videoy ) {
1948
+ wppa_echo( sprintf( __( 'Width: %d pixels, height: %d pixels', 'wp-photo-album-plus' ), $videox, $videoy ) );
1949
+ }
1950
+ else {
1951
+ wppa_echo( '
1952
+ <input
1953
+ type="text"
1954
+ style="width:50px;margin:0 4px;padding-left:8px!important"
1955
+ onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videox\', this.value)"
1956
+ value="' . esc_attr( $videox ) . '"
1957
+ />px W' .
1958
+ sprintf( __( '(0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_width' ) ) . '
1959
+ <input
1960
+ type="text"
1961
+ style="width:50px;margin:0 4px;padding-left:8px!important"
1962
+ onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videoy\', this.value)"
1963
+ value="' . esc_attr( $videoy ) . '"
1964
+ />px H' .
1965
+ sprintf( __( '(0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_height' ) ) );
1966
+ }
1967
+ wppa_echo( '
1968
+ </td>
1969
+ <td>' .
1970
+ $paths . '
1971
+ </td>
1972
+ <td>' .
1973
+ $urls . '
1974
+ </td>
1975
+ </tr>' );
1976
  }
1977
 
1978
+ // Audio
1979
+ if ( $b_has_audio ) {
1980
+
1981
+ $formats = '';
1982
+ $sizes = '';
1983
+ $paths = '';
1984
+ $urls = '';
1985
+ foreach ( $has_audio as $fmt ) {
1986
+ $formats .= $fmt . '<br>';
1987
+ $sizes .= wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . '<br>';
1988
+ $paths .= str_replace( WPPA_UPLOAD_PATH, '.../wppa', str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . '<br>';
1989
+ $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) );
1990
+ $urls .= '<a href="'. $url .'" target="_blank">' . $url . '<br>';
1991
+ }
1992
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1993
  wppa_echo( '
1994
+ <tr>
1995
+ <td>' .
1996
+ $formats . '
1997
+ </td>
1998
+ <td>' .
1999
+ $sizes . '
2000
+ </td>
2001
+ <td>' .
2002
+ $paths . '
2003
+ </td>
2004
+ <td>' .
2005
+ $urls . '
2006
+ </td>
2007
+ </tr>' );
 
 
 
 
 
 
 
 
 
2008
  }
2009
 
2010
+ // Pdf
2011
+ if ( $is_pdf ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2012
 
2013
+ // Source
2014
+ $sp = wppa_get_source_path( $id );
2015
+ $fs = wppa_get_filesize( $sp );
2016
+ $path = str_replace( WPPA_UPLOAD_PATH, '.../wppa', $sp );
2017
+ $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $sp );
2018
+ wppa_echo( '
2019
+ <tr>
2020
+ <td>' .
2021
+ __( 'Document file', 'wp-photo-album-plus' ) . '
2022
+ </td>
2023
+ <td>' .
2024
+ $fs . '
2025
+ </td>
2026
+ <td>' .
2027
+ $path . '
2028
+ </td>
2029
+ <td>
2030
+ <a href="'.$url.'" target="_blank">' .
2031
+ $url . '
2032
+ </a>
2033
+ </td>
2034
+ </tr>' );
2035
+ }
2036
 
2037
+ // Non pdf source_file
2038
+ else {
2039
 
2040
+ // Source
2041
+ $sp = wppa_get_source_path( $id );
2042
+ $o1sp = wppa_get_o1_source_path( $id );
2043
+ $files = [];
2044
+ if ( wppa_is_file( $sp ) || wppa_is_file( $o1sp ) ) {
2045
+
2046
+ if ( is_file( $sp ) ) {
2047
+ $ima = getimagesize( $sp );
2048
+ $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $sp ) . '.';
2049
+ $files[] = ['name' => __( 'Source', 'wp-photo-album-plus' ),
2050
+ 'path' => str_replace( WPPA_UPLOAD_PATH, '.../wppa', $sp ),
2051
+ 'size' => $txt,
2052
+ 'url' => str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $sp )];
2053
+ }
2054
+ if ( is_file( $o1sp ) ) {
2055
+ $ima = getimagesize( $o1sp );
2056
+ $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $o1sp ) . '.';
2057
+ $files[] = ['name' => __( 'Oriented source', 'wp-photo-album-plus' ),
2058
+ 'path' => str_replace( WPPA_UPLOAD_PATH, '.../wppa', $o1sp ),
2059
+ 'size' => $txt,
2060
+ 'url' => str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $o1sp )];
2061
+ }
2062
 
2063
+ foreach( $files as $file ) {
2064
+ wppa_echo( '
2065
+ <tr>
2066
+ <td>' .
2067
+ $file['name'] . '
2068
+ </td>
2069
+ <td>' .
2070
+ $file['size'] . '
2071
+ </td>
2072
+ <td>' .
2073
+ $file['path'] . '
2074
+ </td>
2075
+ <td>
2076
+ <a href="'.$file['url'].'" target="_blank">' .
2077
+ $file['url'] . '
2078
+ </a>
2079
+ </td>
2080
+ </tr>' );
2081
+ }
2082
  }
2083
+ }
2084
+
2085
+ // Poster
2086
+ if ( $is_pdf || $b_is_video ) {
2087
+
2088
+ // Poster
2089
+ $sp = wppa_fix_poster_ext( wppa_get_source_path( $id ), $id );
2090
+ $dsp = wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id );
2091
+ $files = [];
2092
+ if ( wppa_is_file( $sp ) || wppa_is_file( $dsp ) ) {
2093
+
2094
+ if ( wppa_is_file( $sp ) ) {
2095
+ $ima = getimagesize( $sp );
2096
+ $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $sp ) . '.';
2097
+ $files[] = ['name' => __( 'Poster source', 'wp-photo-album-plus' ),
2098
+ 'path' => str_replace( WPPA_UPLOAD_PATH, '.../wppa', $sp ),
2099
+ 'size' => $txt,
2100
+ 'url' => str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $sp )];
2101
+ }
2102
+ if ( wppa_is_file( $dsp ) ) {
2103
+ $ima = getimagesize( $dsp );
2104
+ $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $dsp ) . '.';
2105
+ $files[] = ['name' => __( 'Poster display', 'wp-photo-album-plus' ),
2106
+ 'path' => str_replace( WPPA_UPLOAD_PATH, '.../wppa', $dsp ),
2107
+ 'size' => $txt,
2108
+ 'url' => str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $dsp )];
2109
+ }
2110
+
2111
+ foreach( $files as $file ) {
2112
+ wppa_echo( '
2113
+ <tr>
2114
+ <td>' .
2115
+ $file['name'] . '
2116
+ </td>
2117
+ <td>' .
2118
+ $file['size'] . '
2119
+ </td>
2120
+ <td>' .
2121
+ $file['path'] . '
2122
+ </td>
2123
+ <td>
2124
+ <a href="'.$file['url'].'" target="_blank">' .
2125
+ $file['url'] . '
2126
+ </a>
2127
+ </td>
2128
+ </tr>' );
2129
+ }
2130
  }
2131
+ }
2132
+
2133
+ // Non video, non pdf Display
2134
+ if ( ! $b_is_video && ! $is_pdf ) {
2135
+ $dp = wppa_get_photo_path( $id );
2136
+ $path = str_replace( WPPA_UPLOAD_PATH, '.../wppa', $dp );
2137
+ $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $dp );
2138
+
2139
+ if ( is_file( $dp ) ) {
2140
+
2141
+ $txt = '
2142
+ <span id="photox-' . $id . '">' . wppa_get_photox( $id ) . '</span> x
2143
+ <span id="photoy-' . $id . '">' . wppa_get_photoy( $id ) . '</span>:
2144
+ (<span id="photofilesize-' . $id . '">' . wppa_get_filesize( $dp ) . '</span>)';
2145
 
 
2146
  wppa_echo( '
2147
  <tr>
2148
  <td>' .
2149
+ __( 'Display file', 'wp-photo-album-plus' ) . '
2150
  </td>
2151
  <td>' .
2152
+ $txt . '
2153
  </td>
2154
  <td>' .
2155
+ $path . '
2156
  </td>
2157
  <td>
2158
+ <a href="'.$url.'" target="_blank">' .
2159
+ $url . '
2160
  </a>
2161
  </td>
2162
  </tr>' );
2163
  }
2164
  }
 
2165
 
2166
+ // Thumbnail
2167
+ if ( true ) {
2168
+ $tp = wppa_get_thumb_path( $id );
2169
+ if ( is_file( $tp ) ) {
2170
+ $txt = '
2171
+ <span id="thumbx-' . $id . '">' . wppa_get_thumbx( $id ) . '</span> x
2172
+ <span id="thumby-' . $id . '">' . wppa_get_thumby( $id ) . '</span>:
2173
+ (<span id="thumbfilesize-' . $id . '">' . wppa_get_filesize( $tp ) . '</span>)
2174
+ &nbsp;
2175
+ <input
2176
+ type="checkbox"' .
2177
+ ( $thumblock ? ' checked' : '' ) . '
2178
+ onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'thumblock\', jQuery(this).prop(\'checked\') ? 1 : 0 )" /> ' .
2179
+ __( 'Locked', 'wp-photo-album-plus' );
2180
 
2181
+ $path = str_replace( WPPA_UPLOAD_PATH, '.../wppa', $tp );
2182
+ $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $tp );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2183
 
 
2184
  wppa_echo( '
2185
  <tr>
2186
  <td>' .
2187
+ __( 'Thumbnail', 'wp-photo-album-plus' ) . '
2188
  </td>
2189
  <td>' .
2190
+ $txt . '
2191
  </td>
2192
  <td>' .
2193
+ $path . '
2194
  </td>
2195
  <td>
2196
+ <a href="'.$url.'" target="_blank">' .
2197
+ $url . '
2198
  </a>
2199
  </td>
2200
  </tr>' );
2201
  }
2202
  }
 
2203
 
2204
+ // Local CDN
2205
+ if ( wppa_cdn( 'admin' ) == 'local' ) {
 
 
 
2206
 
2207
+ $files = wppa_cdn_files( $id );
2208
+ if ( !empty( $files ) ) {
2209
 
2210
+ $txt = '<span id="cdnfiles-' . $id . '">';
2211
+ $paths = '';
2212
+ $urls = '';
 
2213
 
2214
+ foreach( $files as $file ) {
2215
+ if ( basename( $file ) != 'index.php' ) {
2216
+ $t = explode( '.', basename( $file ) );
2217
+ $t = explode( '-', $t[0] );
2218
+ $x = $t[0];
2219
+ $y = $t[1];
2220
+ $size = filesize( $file );
 
 
 
 
 
 
 
 
 
 
 
 
2221
 
2222
+ $txt .=
 
 
 
 
 
 
 
 
 
 
 
 
 
2223
 
2224
+ str_replace( '-', ' x ', wppa_strip_ext( basename( $file ) ) ) . ': ' .
 
2225
 
2226
+ sprintf( '(%4.2fkB)', $size / 1024 ) . '<br>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2227
 
2228
+ $paths .= str_replace( WPPA_UPLOAD_PATH, '.../wppa', $file ) . '<br>';
 
2229
 
2230
+ $url = str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $file );
2231
+ $urls .= '<a href="'.$url.'" target="_blank">' . $url . '</a><br>';
2232
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2233
  }
2234
+ $txt .= '</span>';
 
2235
 
2236
+ wppa_echo( '
2237
+ <tr>
2238
+ <td style="line-height:20px">' .
2239
+ __( 'Local CDN', 'wp-photo-album-plus' ) . '
2240
+ </td>
2241
+ <td style="line-height:20px">' .
2242
+ $txt . '
2243
+ </td>
2244
+ <td style="line-height:20px">' .
2245
+ $paths . '
2246
+ </td>
2247
+ <td style="line-height:20px">' .
2248
+ $urls . '
2249
+ </td>
2250
+ </tr>' );
2251
+ }
2252
  }
2253
+
2254
+ wppa_echo( '
2255
+ </tbody>
2256
+ </table>' );
2257
  }
2258
 
2259
+ wppa_echo( '</fieldset></div>' );
 
 
 
2260
 
2261
+ // Remake displayfiles / yhumbnail
2262
  if ( ! $is_video ) {
2263
  wppa_echo( '
2264
+ <div class="wppa-flex">
2265
+ <fieldset class="wppa-fieldset">
2266
+ <legend class="wppa-legend">' .
2267
+ __( 'Actions', 'wp-photo-album-plus' ) . '
2268
+ </legend>
2269
 
2270
  <input
2271
  type="button"
2274
  onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remake\', 0 )"
2275
  value="' . esc_attr( __( 'Remake files', 'wp-photo-album-plus' ) ) . '"
2276
  />
 
 
 
 
 
 
 
2277
  <input
2278
  type="button"
2279
  class="wppa-admin-button button"
2281
  onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remakethumb\', 0 )"
2282
  value="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
2283
  />
2284
+
2285
+ </fieldset></div>' );
2286
  }
2287
 
2288
 
2297
  <div
2298
  id="photomagic-' . $id . '"
2299
  class="wppa-table-wrap wppa-tabcontent-'.$id.'"
2300
+ style="position:relative;padding:10px;display:none"
2301
  >' );
2302
 
 
 
 
2303
  wppa_echo( '
2304
+ <fieldset class="wppa-fieldset">
2305
+ <legend class="wppa-legend">' .
2306
+ __( 'Magically edit image', 'wp-photo-album-plus' ) . '
2307
+ </legend>' );
2308
 
 
 
 
2309
 
2310
  {
 
 
 
 
 
 
 
 
2311
 
2312
+ // Explanation
2313
  wppa_echo( '
2314
+ <h2 class="description" style="margin:1em">' .
2315
+ __( 'The operations are executed upon the display file.', 'wp-photo-album-plus' ) . ' ' .
2316
+ __( 'A new thumbnail image will be created from the display file.', 'wp-photo-album-plus' ) . '
2317
+ </h2>' );
 
 
2318
 
2319
+ // --- Actions ---
2320
  wppa_echo( '
2321
+ <div class="wppa-flex">' );
 
 
 
 
 
2322
 
2323
+ {
 
 
 
 
 
 
 
 
2324
 
2325
+ // Rotate left
2326
+ wppa_echo( '
2327
+ <input
2328
+ type="button"
2329
+ class="wppa-admin-button button"
2330
+ onclick="wppaTryMagick( ' . $id . ', \'magickrotleft\' )"
2331
+ value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus' ) ) . '"
2332
+ />' );
 
2333
 
2334
+ // Rotat 180
2335
+ wppa_echo( '
2336
+ <input
2337
+ type="button"
2338
+ class="wppa-admin-button button"
2339
+ onclick="wppaTryMagick( ' . $id . ', \'magickrot180\' )"
2340
+ value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus' ) ) . '"
2341
+ />' );
 
2342
 
2343
+ // Rotate right
2344
+ wppa_echo( '
2345
+ <input
2346
+ type="button"
2347
+ class="wppa-admin-button button"
2348
+ onclick="wppaTryMagick( ' . $id . ', \'magickrotright\' )"
2349
+ value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus' ) ) . '"
2350
+ />' );
 
2351
 
2352
+ // Flip
2353
+ wppa_echo( '
2354
+ <input
2355
+ type="button"
2356
+ class="wppa-admin-button button"
2357
+ onclick="wppaTryMagick( ' . $id . ', \'magickflip\' )"
2358
+ value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus' ) ) . '&thinsp;&#8212;"
2359
+ title="-flip"
2360
+ />' );
2361
 
2362
+ // Flop
2363
+ wppa_echo( '
2364
+ <input
2365
+ type="button"
2366
+ class="wppa-admin-button button"
2367
+ onclick="wppaTryMagick( ' . $id . ', \'magickflop\' )"
2368
+ value="' . esc_attr( __( 'Flop', 'wp-photo-album-plus' ) ) . ' |"
2369
+ title="-flop"
2370
+ />' );
2371
 
2372
+ // Enhance
2373
+ wppa_echo( '
2374
+ <input
2375
+ type="button"
2376
+ class="wppa-admin-button button"
2377
+ onclick="wppaTryMagick( ' . $id . ', \'enhance\' )"
2378
+ value="' . esc_attr( __( 'Enhance', 'wp-photo-album-plus' ) ) . '"
2379
+ title="-enhance"
2380
+ />' );
2381
 
2382
+ // Sharpen
2383
+ wppa_echo( '
2384
+ <input
2385
+ type="button"
2386
+ class="wppa-admin-button button"
2387
+ onclick="wppaTryMagick( ' . $id . ', \'sharpen\' )"
2388
+ value="' . esc_attr( __( 'Sharpen', 'wp-photo-album-plus' ) ) . '"
2389
+ title="-sharpen 0x1"
2390
+ />' );
2391
 
2392
+ // Blur
2393
+ wppa_echo( '
2394
+ <input
2395
+ type="button"
2396
+ class="wppa-admin-button button"
2397
+ onclick="wppaTryMagick( ' . $id . ', \'blur\' )"
2398
+ value="' . esc_attr( __( 'Blur', 'wp-photo-album-plus' ) ) . '"
2399
+ title="-blur 0x1"
2400
+ />' );
2401
+
2402
+ // Auto gamma
2403
+ wppa_echo( '
2404
+ <input
2405
+ type="button"
2406
+ class="wppa-admin-button button"
2407
+ onclick="wppaTryMagick( ' . $id . ', \'auto-gamma\' )"
2408
+ value="' . esc_attr( __( 'Auto Gamma', 'wp-photo-album-plus' ) ) . '"
2409
+ title="-auto-gamma"
2410
+ />' );
2411
+
2412
+ // Auto level
2413
+ wppa_echo( '
2414
+ <input
2415
+ type="button"
2416
+ class="wppa-admin-button button"
2417
+ onclick="wppaTryMagick( ' . $id . ', \'auto-level\' )"
2418
+ value="' . esc_attr( __( 'Auto Level', 'wp-photo-album-plus' ) ) . '"
2419
+ title="-auto-level"
2420
+ />' );
2421
+
2422
+ // Contrast+
2423
+ wppa_echo( '
2424
+ <input
2425
+ type="button"
2426
+ class="wppa-admin-button button"
2427
+ onclick="wppaTryMagick( ' . $id . ', \'contrast-p\' )"
2428
+ value="' . esc_attr( __( 'Contrast+', 'wp-photo-album-plus' ) ) . '"
2429
+ title="-brightness-contrast 0x5"
2430
+ />' );
2431
+
2432
+ // Contrast-
2433
+ wppa_echo( '
2434
+ <input
2435
+ type="button"
2436
+ class="wppa-admin-button button"
2437
+ onclick="wppaTryMagick( ' . $id . ', \'contrast-m\' )"
2438
+ value="' . esc_attr( __( 'Contrast-', 'wp-photo-album-plus' ) ) . '"
2439
+ title="-brightness-contrast 0x-5"
2440
+ />' );
2441
+
2442
+ // Brightness+
2443
+ wppa_echo( '
2444
+ <input
2445
+ type="button"
2446
+ class="wppa-admin-button button"
2447
+ onclick="wppaTryMagick( ' . $id . ', \'brightness-p\' )"
2448
+ value="' . esc_attr( __( 'Brightness+', 'wp-photo-album-plus' ) ) . '"
2449
+ title="-brightness-contrast 5"
2450
+ />' );
2451
+
2452
+ // Brightness-
2453
+ wppa_echo( '
2454
+ <input
2455
+ type="button"
2456
+ class="wppa-admin-button button"
2457
+ onclick="wppaTryMagick( ' . $id . ', \'brightness-m\' )"
2458
+ value="' . esc_attr( __( 'Brightness-', 'wp-photo-album-plus' ) ) . '"
2459
+ title="-brightness-contrast -5"
2460
+ />' );
2461
+
2462
+ // Despeckle
2463
+ wppa_echo( '
2464
+ <input
2465
+ type="button"
2466
+ class="wppa-admin-button button"
2467
+ onclick="wppaTryMagick( ' . $id . ', \'despeckle\' )"
2468
+ value="' . esc_attr( __( 'Despeckle', 'wp-photo-album-plus' ) ) . '"
2469
+ title="-despeckle"
2470
+ />' );
2471
+
2472
+ // Lenear gray
2473
+ wppa_echo( '
2474
+ <input
2475
+ type="button"
2476
+ class="wppa-admin-button button"
2477
+ onclick="wppaTryMagick( ' . $id . ', \'lineargray\' )"
2478
+ value="' . esc_attr( __( 'Linear gray', 'wp-photo-album-plus' ) ) . '"
2479
+ title="-colorspace gray"
2480
+ />' );
2481
+
2482
+ // Non-linear gray
2483
+ wppa_echo( '
2484
+ <input
2485
+ type="button"
2486
+ class="wppa-admin-button button"
2487
+ onclick="wppaTryMagick( ' . $id . ', \'nonlineargray\' )"
2488
+ value="' . esc_attr( __( 'Non-linear gray', 'wp-photo-album-plus' ) ) . '"
2489
+ title="-grayscale Rec709Luma"
2490
+ />' );
2491
 
2492
+ // Charcoal
2493
+ wppa_echo( '
2494
+ <input
2495
+ type="button"
2496
+ class="wppa-admin-button button"
2497
+ onclick="wppaTryMagick( ' . $id . ', \'charcoal\' )"
2498
+ value="' . esc_attr( __( 'Charcoal', 'wp-photo-album-plus' ) ) . '"
2499
+ title="-charcoal"
2500
+ />' );
2501
 
2502
+ // Paint
2503
+ wppa_echo( '
2504
+ <input
2505
+ type="button"
2506
+ class="wppa-admin-button button"
2507
+ onclick="wppaTryMagick( ' . $id . ', \'paint\' )"
2508
+ value="' . esc_attr( __( 'Paint', 'wp-photo-album-plus' ) ) . '"
2509
+ title="-paint"
2510
+ />' );
2511
 
2512
+ // Sepia
2513
+ wppa_echo( '
2514
+ <input
2515
+ type="button"
2516
+ class="wppa-admin-button button"
2517
+ onclick="wppaTryMagick( ' . $id . ', \'sepia\' )"
2518
+ value="' . esc_attr( __( 'Sepia', 'wp-photo-album-plus' ) ) . '"
2519
+ title="-sepia-tone 80%"
2520
+ />' );
2521
 
2522
+ // Show/hide wppa-horizon
2523
+ wppa_echo( '
2524
+ <input
2525
+ type="button"
2526
+ class="wppa-admin-button button"
2527
+ onclick="wppaToggleHorizon()"
2528
+ value="' . esc_attr( 'Show/hide horizon', 'wp-photo-album-plus' ) . '"
2529
+ title="' . esc_attr( 'Toggle horizon reference line on/off', 'wp-photo-album-plus' ) . '"
2530
+ />' );
2531
 
2532
+ // Anticlock 0.5 deg
2533
+ wppa_echo( '
2534
+ <input
2535
+ type="button"
2536
+ class="wppa-admin-button button"
2537
+ onclick="wppaTryMagick( ' . $id . ', \'skyleft\' )"
2538
+ value="' . esc_attr( '0.5&deg;', 'wp-photo-album-plus' ) . '"
2539
+ title="' . esc_attr( 'Rotate image by 0.5&deg; anticlockwise', 'wp-photo-album-plus' ) . '"
2540
+ />' );
2541
 
2542
+ // Clockwise 0.5 deg
2543
+ wppa_echo( '
2544
+ <input
2545
+ type="button"
2546
+ class="wppa-admin-button button"
2547
+ onclick="wppaTryMagick( ' . $id . ', \'skyright\' )"
2548
+ value="' . esc_attr( '-0.5&deg;', 'wp-photo-album-plus' ) . '"
2549
+ title="' . esc_attr( 'Rotate image by 0.5&deg; clockwise', 'wp-photo-album-plus' ) . '"
2550
+ />' );
2551
 
2552
+ // Crop
2553
+ wppa_echo( '
2554
+ <input
2555
+ type="button"
2556
+ class="wppa-admin-button button"
2557
+ id="button-' . $id . '"
2558
+ value="Crop"
2559
+ title=""
2560
+ />' );
2561
 
2562
+ // Set cropbox aspect ratio
2563
+ $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
2564
+ $dflt = wppa_opt( 'image_magick_ratio' );
 
 
 
 
 
 
2565
 
2566
+ wppa_echo( '
2567
+ <select
2568
+ onchange="wppaCropper[' . $id . '].setAspectRatio(this.value)"
2569
+ title="' . __( 'Aspect ratio of cropped image', 'wp-photo-album-plus' ) . '"
2570
+ >
2571
+ <option value="NaN"' . ( $dflt == 'NaN' ? ' selected' : '' ) . '>' . __( 'free', 'wp-photo-album-plus' ) . '</option>
2572
+ <option value="' . $ratio . '"' . ( $dflt == 'ratio' ? ' selected' : '' ) . '>' . __( 'original', 'wp-photo-album-plus' ) . '</option>
2573
+ <option value="1"' . ( $dflt == '1' ? ' selected' : '' ) . '>' . __( 'square', 'wp-photo-album-plus' ) . '</option>
2574
+ <option value="1.25"' . ( $dflt == '1.25' ? ' selected' : '' ) . '>4:5 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2575
+ <option value="1.33333"' . ( $dflt == '1.33333' ? ' selected' : '' ) . '>3:4 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2576
+ <option value="1.5"' . ( $dflt == '1.5' ? ' selected' : '' ) . '>2:3 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2577
+ <option value="1.6"' . ( $dflt == '1.6' ? ' selected' : '' ) . '>5:8 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2578
+ <option value="1.77777"' . ( $dflt == '1.77777' ? ' selected' : '' ) . '>9:16 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2579
+ <option value="2"' . ( $dflt == '2' ? ' selected' : '' ) . '>1:2 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2580
+ <option value="0.8"' . ( $dflt == '0.8' ? ' selected' : '' ) . '>4:5 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2581
+ <option value="0.75"' . ( $dflt == '0.75' ? ' selected' : '' ) . '>3:4 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2582
+ <option value="0.66667"' . ( $dflt == '0.66667' ? ' selected' : '' ) . '>2:3 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2583
+ <option value="0.625"' . ( $dflt == '0.625' ? ' selected' : '' ) . '>5:8 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2584
+ <option value="0.5625"' . ( $dflt == '0.5625' ? ' selected' : '' ) . '>9:16 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2585
+ <option value="0.5"' . ( $dflt == '0.5' ? ' selected' : '' ) . '>1:2 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2586
+ </select>' . $br );
2587
+
2588
+ if ( $dflt == 'ratio' ) {
2589
+ $value = $ratio;
2590
+ }
2591
+ elseif ( $dflt == 'free' ) {
2592
+ $value = '';
2593
+ }
2594
+ else {
2595
+ $value = $dflt;
2596
+ }
2597
 
2598
+ }
 
 
 
 
 
 
 
 
2599
 
2600
+ // End flex div
2601
+ wppa_echo( '</div>' );
 
 
 
 
 
 
 
2602
 
2603
+ // Command stack
2604
  wppa_echo( '
2605
+ <h2 class="description" style="margin:1em">' .
2606
+ __( '<b>ImageMagick</b> command stack', 'wp-photo-album-plus' ) . ':
2607
+ <span
2608
+ id="magickstack-' . strval( intval( $id ) ). '"
2609
+ style="color:blue"
2610
+ >' .
2611
+ sanitize_text_field( $magickstack ) . '
2612
+ </span>
2613
+ <input
2614
+ type="button"
2615
+ class="wppa-admin-button button"
2616
+ id="imstackbutton-' . strval( intval( $id ) ) . '"
2617
+ onclick="wppaTryMagick( ' . strval( intval( $id ) ) . ', \'magickundo\' )"
2618
+ value="' . esc_attr( __( 'Undo', 'wp-photo-album-plus' ) ) . '"
2619
+ title="' . esc_attr( __( 'Undo last Magick command', 'wp-photo-album-plus' ) ) . '"
2620
+ style="margin-left:4px;' . ( $magickstack ? 'display:inline;' : 'display:none;' ) . '"
2621
+ />
2622
+ </h2>' );
2623
 
2624
+ // Cropper container
2625
+ // Fake 'for social media' to use the local file here, not cloudinary. Files from cloudinary do not reload, even with ?ver=...
2626
+ wppa( 'for_sm', true );
2627
  wppa_echo( '
2628
+ <div
2629
+ class="wppa-cropper-container-wrapper">
2630
+ <img
2631
+ id="fs-img-' . $id . '"
2632
+ src="' . esc_url( wppa_get_photo_url( $id ) ) . '"
2633
+ style="float:left;max-width:100%"
2634
+ />
2635
+ </div>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2636
 
2637
+ // Reset switch
2638
+ wppa( 'for_sm', false );
2639
  }
2640
 
2641
+ wppa_echo( '</fieldset>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2642
 
2643
  // End Tab 3
2644
  wppa_echo( '</div>' );
2762
 
2763
 
2764
  // Comments
2765
+ $has_pending_comments = false;
2766
  if ( ! $quick && ! empty( $comments ) ) {
2767
 
2768
  wppa_echo( '
2823
  }
2824
  wppa_echo( '<td style="padding:0 4px">' . $comment['comment'] . '</td>
2825
  </tr>' );
2826
+ if ( $comment['status'] != 'approved' ) {
2827
+ $has_pending_comments = true;
2828
+ }
2829
  }
2830
 
2831
  wppa_echo( '
2835
  </div>' );
2836
  }
2837
 
2838
+ // Fix the background color
2839
+ $the_js = 'wppaPhotoStatusChange(' . $id . ');';
2840
+
2841
+ // When there are moderatable comments, open details and comments tab
2842
+ if ( $has_pending_comments && ( current_user_can( 'wppa_comments' ) || current_user_can( 'wppa_moderate' ) || ( ( wppa_get_user() == $photo['owner'] && wppa_switch( 'owner_moderate_comment' ) ) ) ) ) {
2843
+ $the_js .= '
2844
+ jQuery(document).ready(function(){
2845
+ jQuery("#wppa-toplevel-details-'.$id.'").attr("open","open");
2846
+ jQuery("#wppa-photoadmin-tab-'.$id.'").trigger("click");
2847
+ });';
2848
+ }
2849
+ wppa_add_inline_script( 'wppa-admin', $the_js );
2850
 
2851
  wppa_echo( '
2852
  <div class="clear"></div>
2859
 
2860
  } /* foreach photo */
2861
 
2862
+ wppa_admin_pagination( $pagesize, $page, $count, $link, 'bottom' );
2863
 
2864
  } /* photos not empty */
2865
  } /* function */
2875
  }
2876
 
2877
  // Init
2878
+ wppa_add_local_js( 'wppa_album_photos_bulk' );
2879
  $count = '0';
2880
  $abort = false;
2881
 
2989
  }
2990
  else wppa_error_message( 'Unexpected error #2 in wppa_album_photos_bulk().' );
2991
  }
2992
+ else {
2993
+ wppa_error_message( 'Unexpected error #1 in wppa_album_photos_bulk().' );
2994
+ var_dump($_REQUEST);
2995
+ }
2996
 
2997
  if ( $count && ! $abort ) {
2998
  switch ( wppa_get( 'bulk-action' ) ) {
3022
  }
3023
  }
3024
 
3025
+ $slug = 'photo_bulk';
3026
+ $a = wppa_is_int( $album ) ? $album : '0';
3027
+ if ( ! $a ) {
3028
+ $slug .= '_' . $album;
3029
+ }
3030
+ $parms = wppa_get_paging_parms( $slug );
3031
+
3032
+ $pagesize = $parms['pagesize']; // wppa_opt( 'photo_admin_pagesize' ) ? wppa_opt( 'photo_admin_pagesize' ) : '20';
3033
+ $next_after = wppa_get( 'next-after', '0' ) ? '1' : '0';
3034
+ $p = $parms['page']; // wppa_get( 'paged', '1' );
3035
+ $page = $p + $next_after;
3036
+ $skip = ( $page - '1' ) * $pagesize;
3037
 
3038
  if ( $album ) {
3039
  if ( $album == 'moderate' ) {
3078
 
3079
  if ( $photos ) {
3080
  $plink = $link . '&next-after=' . $next_after;
 
3081
 
3082
+ wppa_admin_pagination( $pagesize, $page, $count, $plink, 'top' );
 
3083
 
3084
+ $result = '
3085
+ <form action="' . $link . '&paged=' . $page . '#manage-photos" method="post">' .
3086
+ wp_nonce_field( 'wppa-bulk', 'wppa-bulk' ) . '
3087
+ <div>
3088
+ <!-- Bulk action -->
3089
+ <select id="wppa-bulk-action" name="wppa-bulk-action" onchange="wppaBulkActionChange( this, \'bulk-album\' )">
3090
+ <option value="" disabled selected>' . esc_html__( 'Bulk action', 'wp-photo-album-plus' ) . '</option>';
3091
+ if ( $album == 'trash' ) {
3092
+ $result .= '
3093
+ <option value="wppa-bulk-delete-immediate">' . esc_html__( 'Remove permanently', 'wp-photo-album-plus' ) . '</option>
3094
+ <option value="wppa-bulk-undelete">' . esc_html__( 'Undelete', 'wp-photo-album-plus' ) . '</option>';
3095
+ }
3096
+ else {
3097
+ $result .= '
3098
+ <option value="wppa-bulk-delete">' . esc_html__( 'Delete', 'wp-photo-album-plus' ) . '</option>';
3099
+ }
3100
+ $result .= '
3101
+ <option value="wppa-bulk-move-to">' . esc_html__( 'Move to', 'wp-photo-album-plus' ) . '</option>
3102
+ <option value="wppa-bulk-copy-to">' . esc_html__( 'Copy to', 'wp-photo-album-plus' ) . '</option>';
3103
 
3104
+ if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) {
3105
+ $result .= '
3106
+ <option value="wppa-bulk-status">' . esc_html__( 'Set status to', 'wp-photo-album-plus' ) . '</option>';
3107
+ }
3108
+ if ( wppa_user_is_admin() && wppa_switch( 'photo_owner_change' ) ) {
3109
+ $result .= '
3110
+ <option value="wppa-bulk-owner">' . esc_html__( 'Set owner to', 'wp-photo-album-plus' ) . '</option>';
3111
+ }
3112
+ $result .= '
3113
+ </select>
3114
+ <!-- Select album -->' .
3115
+
3116
+ wppa_album_select_a( array( 'checkaccess' => true,
3117
+ 'path' => true,
3118
+ 'exclude' => $album,
3119
+ 'selected' => '0',
3120
+ 'addpleaseselect' => true,
3121
+ 'sort' => true,
3122
+ 'tagopen' => '<select' .
3123
+ ' name="wppa-bulk-album"' .
3124
+ ' id="wppa-bulk-album"' .
3125
+ ' style="display:none"' .
3126
+ ' onchange="wppa_setCookie( \'wppa_bulk_album\',this.value,365 )"' .
3127
+ ' >',
3128
+ 'tagname' => 'wppa-bulk-album',
3129
+ 'tagid' => 'wppa-bulk-album',
3130
+ 'tagonchange' => 'wppa_setCookie( \'wppa_bulk_album\',this.value,365 );',
3131
+ 'tagstyle' => 'display:none;cursor:pointer;',
3132
+ ) );
3133
+
3134
+ if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) {
3135
+ $result .= '
3136
+ <!-- Select status -->
3137
+ <select
3138
+ name="wppa-bulk-status"
3139
+ id="wppa-bulk-status"
3140
+ style="display:none"
3141
+ onchange="wppa_setCookie( \'wppa_bulk_status\',this.value,365 )"
3142
+ >
3143
+ <option value="">' . esc_html__( '- select a status -' , 'wp-photo-album-plus' ) . '</option>
3144
+ <option value="pending">' . esc_html__( 'Pending' , 'wp-photo-album-plus' ) . '</option>
3145
+ <option value="publish">' . esc_html__( 'Publish' , 'wp-photo-album-plus' ) . '</option>';
3146
+ if ( ! wppa_switch( 'ext_status_restricted' ) || wppa_user_is_admin() ) {
3147
+ $result .= '
3148
+ <option value="featured">' . esc_html__( 'Featured' , 'wp-photo-album-plus' ) . '</option>
3149
+ <option value="gold">' . esc_html__( 'Gold' , 'wp-photo-album-plus' ) . '</option>
3150
+ <option value="silver">' . esc_html__( 'Silver' , 'wp-photo-album-plus' ) . '</option>
3151
+ <option value="bronze">' . esc_html__( 'Bronze' , 'wp-photo-album-plus' ) . '</option>
3152
+ <option value="scheduled">' . esc_html__( 'Scheduled' , 'wp-photo-album-plus' ) . '</option>
3153
+ <option value="private">' . esc_html__( 'Private' , 'wp-photo-album-plus' ) . '</option>';
3154
+ }
3155
+ $result .= '
3156
+ </select>';
3157
+ }
3158
 
3159
+ $users = wppa_get_users();
 
 
 
 
 
3160
 
3161
+ // Less tha2 250 users
3162
+ if ( count( $users ) < 250 ) {
3163
+ $result .= '
3164
+ <!-- Select user -->
3165
+ <select name="wppa-bulk-owner" id="wppa-bulk-owner" style="display:none" onchange="wppa_setCookie( \'wppa_bulk_owner\',this.value,365 )">
3166
+ <option value="">' . esc_html__( '- select an owner -' , 'wp-photo-album-plus' ) . '</option>';
3167
+ foreach ( $users as $user ) {
3168
+ $result .= '<option value="' . esc_attr( $user['user_login'] ) . '">' . htmlspecialchars( $user['display_name'] ) . ' (' . htmlspecialchars( $user['user_login'] ) . ')</option>';
3169
+ }
3170
+ $result .= '
3171
+ </select>';
3172
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3173
 
3174
+ // Mor ethan 250 users
3175
+ else {
3176
+ $result .= '
3177
+ <!-- Input user_login -->
3178
+ <input name="wppa-bulk-owner" id="wppa-bulk-owner" style="display:none" onchange="wppa_setCookie( \'wppa_bulk_owner\',this.value,365 )" />';
3179
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3180
 
3181
+ // Submit
3182
+ $result .= '
3183
+ <!-- Submit -->
3184
+ <input type="submit" onclick="return wppaBulkDoitOnClick()" class="button-primary" value="' . esc_html__( 'Doit!' , 'wp-photo-album-plus' ) . '"/>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3185
  if ( wppa_is_mobile() ) {
3186
+ $result .= '<br>';
3187
  }
3188
+
3189
+ // Net page after selection
3190
+ $nextafterselhtml = '
3191
+ <select name="next-after">
3192
+ <option value="-1"' . ( $next_after == '-1' ? ' selected' : '' ) . '>' . esc_html__( 'the previous page', 'wp-photo-album-plus' ) . '</option>
3193
+ <option value="0"' . ( $next_after == '0' ? ' selected' : '' ) . '>' . esc_html__( 'the same page', 'wp-photo-album-plus' ) . '</option>
3194
+ <option value="1"' . ( $next_after == '1' ? ' selected' : '' ) . '>' . esc_html__( 'the next page', 'wp-photo-album-plus' ) . '</option>
3195
+ </select>';
3196
+ $result .= sprintf( __( 'Go to %s after Doit!.', 'wp-photo-album-plus' ), $nextafterselhtml );
3197
  if ( wppa_is_mobile() ) {
3198
+ $result .= '<br>';
3199
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3200
 
3201
+ // Confirm delete
3202
+ $result .= '
3203
+ <input
3204
+ type="checkbox"
3205
+ id="confirm-delete"
3206
+ name="confirm-delete"
3207
+ checked="checked"
3208
+ onchange="wppaToggleConfirmDelete(this)"
3209
+ />
3210
+ <label for="confirm-delete">' .
3211
+ esc_html__( 'Confirm delete', 'wp-photo-album-plus' ) . '
3212
+ </label>';
3213
+
3214
+ // Confirm move
3215
+ $result .= '
3216
+ <input
3217
+ type="checkbox"
3218
+ id="confirm-move"
3219
+ name="confirm-move"
3220
+ checked="checked"
3221
+ onchange="wppaToggleConfirmMove(this)"
3222
+ />
3223
+ <label for="confirm-move">' .
3224
+ esc_html__( 'Confirm move', 'wp-photo-album-plus' ) . '
3225
+ </label>';
3226
+
3227
+ $result .= '
3228
+ </div>';
3229
+ wppa_echo( $result );
3230
 
3231
+ $edit_link = wppa_ea_url( 'single', 'edit' );
3232
+
3233
+ // The table of bulk ediatble items
3234
+ $thead_body = '
3235
+ <td><input type="checkbox" class="wppa-bulk-photo" onchange="jQuery( \'.wppa-bulk-photo\' ).prop( \'checked\', this.checked )" /></td>
3236
+ <td>' . esc_html__( 'ID', 'wp-photo-album-plus' ) . '</td>
3237
+ <td>' . esc_html__( 'Preview', 'wp-photo-album-plus' ) . '</td>
3238
+ <td>' . esc_html__( 'Name', 'wp-photo-album-plus' ) . '</td>
3239
+ <td>' . esc_html__( 'Description', 'wp-photo-album-plus' ) . '</td>
3240
+ <td>' . esc_html__( 'Status', 'wp-photo-album-plus' ) . '</td>
3241
+ <td>' . esc_html__( 'Owner', 'wp-photo-album-plus' ) . '</td>
3242
+ <td>' . esc_html__( 'Remark', 'wp-photo-album-plus' ) . '</td>';
3243
+ $result = '
3244
  <table class="widefat">
3245
+ <thead style="font-weight:bold">' .
3246
+ $thead_body . '
 
 
 
 
 
 
 
3247
  </thead>
3248
+ <tbody>';
3249
+ wppa_echo( $result );
3250
+
3251
  foreach ( $photos as $photo ) {
3252
  $id = $photo['id'];
3253
 
3269
  }
3270
  }
3271
 
3272
+ $maxsize = wppa_get_minisize();
3273
+
3274
+ $result = '
3275
+ <tr id="photoitem-' . $id . '" class="photoitem">
3276
  <!-- Checkbox -->
3277
  <td>
3278
+ <input type="hidden" id="photo-nonce-' . $id . '" value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '" />
3279
+ <input type="checkbox" name="wppa-bulk-photo[' . $id . ']" class="wppa-bulk-photo" />
3280
  </td>
3281
  <!-- ID and delete link -->
3282
+ <td>
3283
+ <a
3284
+ href="' . $edit_link . '&photo=' . $id . '"
 
3285
  target="_blank"
3286
  >' .
3287
+ $id . '
3288
  </a>
3289
  <br>
3290
  <a
3291
+ id="wppa-delete-' . $id . '"
3292
+ onclick="wppaConfirmAndDelete(' . $id . ', ' . ( $album == 'trash' ? 'true' : 'false' ) . ' )"
3293
  style="color:red;font-weight:bold;cursor:pointer"
3294
  >' .
3295
  ( $album == 'trash' ? __( 'Remove permanently', 'wp-photo-album-plus' ) : __( 'Delete', 'wp-photo-album-plus' ) ) . '
3296
+ </a>
 
3297
  </td>
3298
  <!-- Preview -->
3299
+ <td style="min-width:240px; text-align:center">';
3300
+
3301
+ if ( wppa_is_video( $photo['id'] ) ) {
3302
  $a = false;
3303
  if ( wppa_is_file( wppa_strip_ext( wppa_get_photo_path( $id ) ) . '.mp4' ) ) {
3304
  $a = true;
3305
+ $result .= '
3306
  <a
3307
  href="' . esc_url( str_replace( '.jpg', '.mp4', wppa_get_photo_url( $id ) ) ) . '"
3308
  target="_blank"
3309
  title="' . esc_attr( __( 'Click to see fullsize video', 'wp-photo-album-plus' ) ) . '"
3310
+ >' ;
3311
  }
3312
 
3313
+ $result .= wppa_get_video_html( array(
3314
+ 'id' => $id,
3315
+ 'height' => '160',
3316
+ 'controls' => false,
3317
+ 'tagid' => 'pa-id-' . $id,
3318
+ 'preload' => 'metadata',
3319
+ 'use_thumb' => true,
3320
+ ) );
3321
+ if ( $a ) {
3322
+ $result .= '</a>';
3323
+ }
3324
  }
3325
  else {
3326
+ $result .= '
3327
+ <a
3328
+ href="' . esc_url( wppa_get_photo_url( $photo['id'] ) ) . '"
3329
+ target="_blank"
3330
+ title="' . esc_attr( __( 'Click to see fullsize', 'wp-photo-album-plus' ) ) . '"
3331
+ >
3332
+ <img
3333
+ class="wppa-bulk-thumb"' .
3334
+ ( wppa_lazy() ? ' data-' : ' ' ) . 'src="' . esc_url( wppa_get_thumb_url( $id ) ) . '"
3335
+ style="max-width:' . $maxsize . 'px;max-height:' . $maxsize . 'px"
3336
+ />
3337
+ </a>';
3338
  }
3339
+ $result .= '
3340
  </td>
3341
  <!-- Name, size, move -->
 
3342
  <td style="width:25%">
3343
+ <!-- Name -->
3344
+ <input
3345
+ type="text"
3346
+ style="width:300px"
3347
+ id="pname-' . $id . '"
3348
+ onchange="wppaAjaxUpdatePhoto(' . $id . ', \'name\', this.value)"
3349
+ value="' . esc_attr( stripslashes( $photo['name'] ) ) . '"
3350
+ />
3351
+ <!-- Size -->';
3352
+ if ( wppa_is_video( $id ) ) {
3353
+ $result .= '<br>' . wppa_get_videox( $id, 'admin' ) . ' x ' . wppa_get_videoy( $id, 'admin' ) . ' px.';
3354
  }
3355
  else {
3356
+ $sp = wppa_get_source_path( $id );
3357
  if ( is_file( $sp ) ) {
3358
  $ima = getimagesize( $sp );
3359
  if ( is_array( $ima ) ) {
3360
+ $result .= '<br>' . $ima['0'] . ' x ' . $ima['1'] . ' px.';
3361
  }
3362
  }
3363
  }
3364
+ $result .= '
3365
+ <!-- Move -->';
3366
+ $max = wppa_opt( 'photo_admin_max_albums' );
3367
+ if ( ! $max || wppa_get_total_album_count() < $max ) {
3368
+
3369
+ // If not done yet, get the album options html with the current album excluded
3370
+ if ( ! isset( $album_select[$album] ) ) {
3371
+ $album_select[$album] = wppa_album_select_a( array( 'checkaccess' => true,
3372
+ 'path' => true,
3373
+ 'exclude' => $album,
3374
+ 'selected' => '0',
3375
+ 'addpleaseselect' => true,
3376
+ 'sort' => true,
3377
+ )
3378
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
3379
  }
3380
 
3381
+ $result .= '
3382
+ <br>' . __( 'Target album for move to', 'wp-photo-album-plus' ) . '<br>
3383
+ <select
3384
+ id="target-' . $id . '"
3385
+ onchange="wppaTryMove(' . $id . ', ' . ( wppa_is_video( $id ) ? 'true' : 'false' ) . ')"
3386
+ style="max-width:300px"
3387
+ >' .
3388
+ $album_select[$album] . '
3389
+ </select>
3390
+ <span id="moving-' . $id . '" style="color:red;font-weight:bold"></span>';
3391
+ }
3392
+ $result .= '
3393
+ </td>';
3394
+ wppa_echo( $result );
3395
+
3396
+ $result = '
3397
  <!-- Description -->
3398
  <td style="width:25%">
3399
+ <textarea
3400
+ class="wppa-bulk-desc"
3401
+ style="height:50px; width:100%"
3402
+ onchange="wppaAjaxUpdatePhoto(' . $id . ', \'description\', this.value)"
3403
+ >' .
3404
+ esc_textarea( stripslashes( $photo['description'] ) ) . '
3405
+ </textarea>
3406
  </td>
3407
  <!-- Status -->
3408
+ <td>';
3409
+ if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) {
3410
+ if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is_admin() ) {
3411
+ $dis = ' disabled';
3412
+ }
 
 
 
 
 
 
 
 
 
3413
  else {
3414
+ $dis = '';
3415
+ }
3416
+ $ps = $photo['status'];
3417
+ $sel = ' selected';
3418
+ $result .= '
3419
+ <select
3420
+ id="status-' . $id . '"
3421
+ onchange="wppaAjaxUpdatePhoto(' . $id . ', \'status\', this.value); wppaPhotoStatusChange(' . $id . ')"
3422
+ >
3423
+ <option value="pending"' . ( $ps == 'pending' ? $sel : '' ) . '>' . esc_html__( 'Pending' , 'wp-photo-album-plus' ) . '</option>
3424
+ <option value="publish"' . ( $ps == 'publish' ? $sel : '' ) . '>' . esc_html__( 'Publish' , 'wp-photo-album-plus' ) . '</option>
3425
+ <option value="featured"' . ( $ps == 'featured' ? $sel : '' ) . $dis . '>' . esc_html__( 'Featured' , 'wp-photo-album-plus' ) . '</option>
3426
+ <option value="gold"' . ( $ps == 'gold' ? $sel : '' ) . $dis . '>' . esc_html__( 'Gold' , 'wp-photo-album-plus' ) . '</option>
3427
+ <option value="silver"' . ( $ps == 'silver' ? $sel : '' ) . $dis . '>' . esc_html__( 'Silver' , 'wp-photo-album-plus' ) . '</option>
3428
+ <option value="bronze"' . ( $ps == 'bronze' ? $sel : '' ) . $dis . '>' . esc_html__( 'Bronze' , 'wp-photo-album-plus' ) . '</option>
3429
+ <option value="scheduled"' . ( $ps == 'scheduled' ? $sel : '' ) . $dis . '>' . esc_html__( 'Scheduled' , 'wp-photo-album-plus' ) . '</option>
3430
+ <option value="private"' . ( $ps == 'private' ? $sel : '' ) . $dis . '>' . esc_html__( 'Private' , 'wp-photo-album-plus' ) . '</option>
3431
+ </select>';
3432
+ }
3433
+ else {
3434
+ $result .= wppa_status_display_name( $photo['status'] );
3435
+ }
3436
+ $result .= '
3437
  </td>
3438
  <!-- Owner -->
3439
+ <td>' .
3440
+ $photo['owner'] . '
3441
  </td>
3442
  <!-- Remark -->
3443
+ <td id="remark-' . $id . '" style="width:25%">' .
3444
+ esc_html__( 'Not modified' , 'wp-photo-album-plus' ) . '
 
3445
  </td>
3446
+ </tr>';
3447
+ wppa_echo( $result );
3448
+
3449
+ wppa_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange(' . $id . ');' );
3450
+ }
3451
+
3452
+ $result = '
3453
  </tbody>
3454
+ <tfoot style="font-weight:bold">' .
3455
+ $thead_body . '
 
 
 
 
 
 
 
3456
  </tfoot>
3457
  </table>
3458
+ </form>';
3459
+
3460
+ wppa_echo( $result );
3461
+
3462
+ wppa_admin_pagination( $pagesize, $page, $count, $plink, 'bottom' );
3463
  }
3464
  else {
3465
  if ( $page == '1' ) {
3466
  if ( wppa_get( 'searchstring' ) ) {
3467
+ wppa_echo( '<h1>' . __( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . ' 2</h1>' );
3468
  }
3469
  elseif ( $album == 'moderate' ) {
3470
  wppa_echo( '<h1>' . __( 'No photos to moderate', 'wp-photo-album-plus' ) . '</h1>' );
3478
  }
3479
  else {
3480
  $page_1 = $page - '1';
3481
+ wppa_echo( sprintf( __( 'Page %d is empty, try <a href="%s">page %d</a>.', 'wp-photo-album-plus' ), $page, $link . '&paged=' . $page_1 . '#manage-photos', $page_1 ) );
3482
  }
3483
  }
3484
  }
3487
  function wppa_album_photos_sequence( $album ) {
3488
  global $wpdb;
3489
 
3490
+ wppa_add_local_js( 'wppa_album_photos_sequence' );
3491
+
3492
  if ( $album ) {
3493
  $photoorder = wppa_get_photo_order( $album, 'norandom' );
3494
  $is_descending = strpos( $photoorder, 'DESC' ) !== false;
3495
  $is_p_order = strpos( $photoorder, 'p_order' ) !== false;
3496
 
3497
+ if ( $is_descending && $is_p_order ) {
3498
+ wppa_add_inline_script( 'wppa-admin', 'var wppaSeqnoDesc = true;' );
3499
+ }
3500
+ else {
3501
+ wppa_add_inline_script( 'wppa-admin', 'var wppaSeqnoDesc = false;' );
3502
+ }
3503
+
3504
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
3505
  WHERE album = %s" . $photoorder, $album ), ARRAY_A );
3506
 
3508
  $size = '180';
3509
 
3510
  if ( $photos ) {
3511
+ if ( ! $is_p_order ) wppa_warning_message( __( 'Setting photo sequence has only effect if the photo sequence method is set to <b>Sequence #</b>' , 'wp-photo-album-plus' ) );
3512
 
3513
+ $result = '
3514
+ <div class="widefat wppa-photo-admin-sortable" style="border-color:#cccccc">
3515
+ <ul id="sortable">';
3516
+ foreach ( $photos as $photo ) {
3517
+ $id = $photo['id'];
3518
+ if ( wppa_is_video( $id ) ) {
3519
+ $imgs['0'] = wppa_get_videox( $id, 'admin' );
3520
+ $imgs['1'] = wppa_get_videoy( $id, 'admin' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3521
  }
3522
+ else {
3523
+ $imgs['0'] = wppa_get_thumbx( $id );
3524
+ $imgs['1'] = wppa_get_thumby( $id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3525
  }
3526
+ if ( ! $imgs['0'] ) { // missing thuimbnail, prevent division by zero
3527
+ $imgs['0'] = 200;
3528
+ $imgs['1'] = 150;
3529
+ }
3530
+ $mw = $size - '20';
3531
+ $mh = $mw * '3' / '4';
3532
+ if ( $imgs[1]/$imgs[0] > $mh/$mw ) { // more portrait than 200x150, y is limit
3533
+ $mt = '15';
3534
+ }
3535
+ else { // x is limit
3536
+ $mt = ( $mh - ( $imgs[1]/$imgs[0] * $mw ) ) / '2' + '15';
3537
+ }
3538
+
3539
+ $result .= '
3540
+ <li
3541
+ id="photoitem-' . $id . '"
3542
+ class="ui-state-default-photos wppa-' . $photo['status'] . '"
3543
+ style="background-image:none; text-align:center; cursor:move"
3544
+ >';
3545
+ if ( wppa_is_video( $id ) ) {
3546
+ $imgstyle = 'max-width:'.$mw.'px;max-height:'.$mh.'px;margin-top:'.$mt.'px;';
3547
+ $result .= wppa_get_video_html( array(
3548
+ 'id' => $id,
3549
+ 'controls' => false,
3550
+ 'tagid' => 'pa-id-'.$id,
3551
+ 'preload' => 'metadata',
3552
+ 'class' => 'wppa-bulk-thumb',
3553
+ 'style' => $imgstyle,
3554
+ 'use_thumb' => true
3555
+ ) );
3556
  }
3557
  else {
3558
+ $result .= '
3559
+ <img
3560
+ class="wppa-bulk-thumb"' .
3561
+ ( wppa_lazy() ? ' data-' : ' ' ) . 'src="' . esc_url( wppa_get_thumb_url( $id ) ) . '"
3562
+ style="max-width:' . $mw . 'px;max-height:' . $mh . 'px;margin-top:' . $mt . 'px"
3563
+ />';
 
 
 
 
 
 
 
 
3564
  }
3565
+ $result .= '
3566
+ <div
3567
+ style="font-size:9px;position:absolute;bottom:24px;text-align:center;width:' . $size . 'px">' .
3568
+ wppa_get_photo_name( $id ) . '
3569
+ </div>
3570
+ <div
3571
+ style="text-align:center;width:' . $size . 'px;position:absolute;bottom:8px"
3572
+ >
3573
+ <span
3574
+ style="margin-left:15px;float:left">' .
3575
+ esc_html__( 'Id: ' , 'wp-photo-album-plus' ) . $id . '
3576
+ </span>';
 
 
 
 
 
 
 
 
 
 
 
3577
 
3578
+ if ( wppa_is_video( $id ) ) $result .= __( 'Video', 'wp-photo-album-plus' );
3579
+ if ( wppa_has_audio( $id ) ) $result .= __( 'Audio', 'wp-photo-album-plus' );
3580
 
3581
+ $result .= '
3582
+ <span style="float:right;margin-right:15px">' .
3583
+ esc_html__( 'Seq: ' , 'wp-photo-album-plus' ) . '
3584
+ <span id="wppa-seqno-' . $id . '">' .
3585
+ $photo['p_order'] . '
3586
+ </span>
3587
+ </span>
 
 
 
 
 
 
 
3588
  </div>
3589
+ <input type="hidden" id="photo-nonce-' . $id . '" value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '" />
3590
+ <input type="hidden" class="wppa-sort-item" value="' . $id . '" />
3591
+ <input type="hidden" class="wppa-sort-seqn" id="wppa-sort-seqn-' . $id . '" value="' . $photo['p_order'] . '" />
3592
+ </li>';
3593
+ }
3594
+
3595
+ $result .= '
3596
  </ul>
3597
  <div style="clear:both"></div>
3598
+ </div>';
3599
+ wppa_echo( $result );
3600
  }
3601
  else {
3602
  wppa_echo( '<h1>'.__( 'The album is empty.' , 'wp-photo-album-plus' ).'</h1>' );
wppa-picture.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Make the picture html
6
- * Version 8.2.05.000
7
  *
8
  */
9
 
@@ -41,7 +41,7 @@ function wppa_get_picture_html( $args ) {
41
 
42
  // Does the photo exist?
43
  if ( ! wppa_photo_exists( $id ) ) {
44
- wppa_log( 'Err', 'Photo ' . $id . ' does not exist in call to wppa_get_picture_html(). Type = ' . $type );
45
  return false;
46
  }
47
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Make the picture html
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
41
 
42
  // Does the photo exist?
43
  if ( ! wppa_photo_exists( $id ) ) {
44
+ wppa_log( 'Err', 'Photo ' . $id . ' does not exist in call to wppa_get_picture_html(). Type = ' . $args['type'] );
45
  return false;
46
  }
47
 
wppa-scripts.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
- * Version 8.2.09.002
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
@@ -90,7 +90,6 @@ global $wpdb;
90
  wppaFilmInit = [],
91
  wppaResizeEndDelay = ' . ( wppa_is_mobile() ? wppa_opt( 'resizeend_delay_mob' ) : wppa_opt( 'resizeend_delay' ) ) . ',
92
  wppaScrollEndDelay = ' . ( wppa_is_mobile() ? wppa_opt( 'scrollend_delay_mob' ) : wppa_opt( 'scrollend_delay' ) ) . ',
93
- wppaArtmonkeyFileNotSource = false,
94
  wppaRequestInfoDialogText = "Please specify your question",
95
  wppaGlobalFsIconSize = 32,
96
  wppaFsFillcolor = "#999999",
@@ -144,6 +143,7 @@ global $wpdb;
144
  _wppaLastIdx = [],
145
  _wppaStopping = [],
146
  _wppaFilename = [],
 
147
  _wppaLat = [],
148
  _wppaLon = [],
149
  __wppaOverruleRun = false,
@@ -405,9 +405,6 @@ global $wpdb;
405
  wppaAjaxScroll = ' . ( wppa_switch( 'ajax_scroll' ) && ! is_admin() ? 'true' : 'false' ) . ',
406
  wppaThumbSize = ' . wppa_opt( 'thumbsize' ) . ',
407
  wppaTfMargin = ' . wppa_opt( 'tn_margin' ) . ',
408
- wppaArtmonkeyFileNotSource = ' . ( wppa_opt( 'art_monkey_link' ) == 'file' &&
409
- wppa_opt( 'art_monkey_display' ) == 'text' &&
410
- ! wppa_switch( 'artmonkey_use_source' ) ? 'true' : 'false' ) . ',
411
  wppaRequestInfoDialogText = "' . wppa_opt( 'request_info_text' ) . '",
412
  wppaThumbAspect = ' . wppa_thumb_asp() . ',';
413
 
@@ -768,13 +765,65 @@ global $wppa_script_open;
768
  // Compress javascript
769
  function wppa_compress_js( $txt ) {
770
 
771
- $result = $txt;
772
- $result = str_replace( "\t", "", $result );
773
- $result = str_replace( "\r\n", "", $result );
774
- $result = str_replace( " = ", "=", $result );
775
- $result = str_replace( "; ", ";", $result );
776
- $result = str_replace( "/*", "\r\n/*", $result );
777
 
778
- return $result;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
779
  }
780
 
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
+ * Version 8.3.01.006
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
90
  wppaFilmInit = [],
91
  wppaResizeEndDelay = ' . ( wppa_is_mobile() ? wppa_opt( 'resizeend_delay_mob' ) : wppa_opt( 'resizeend_delay' ) ) . ',
92
  wppaScrollEndDelay = ' . ( wppa_is_mobile() ? wppa_opt( 'scrollend_delay_mob' ) : wppa_opt( 'scrollend_delay' ) ) . ',
 
93
  wppaRequestInfoDialogText = "Please specify your question",
94
  wppaGlobalFsIconSize = 32,
95
  wppaFsFillcolor = "#999999",
143
  _wppaLastIdx = [],
144
  _wppaStopping = [],
145
  _wppaFilename = [],
146
+ _wppaDownloadUrl = [],
147
  _wppaLat = [],
148
  _wppaLon = [],
149
  __wppaOverruleRun = false,
405
  wppaAjaxScroll = ' . ( wppa_switch( 'ajax_scroll' ) && ! is_admin() ? 'true' : 'false' ) . ',
406
  wppaThumbSize = ' . wppa_opt( 'thumbsize' ) . ',
407
  wppaTfMargin = ' . wppa_opt( 'tn_margin' ) . ',
 
 
 
408
  wppaRequestInfoDialogText = "' . wppa_opt( 'request_info_text' ) . '",
409
  wppaThumbAspect = ' . wppa_thumb_asp() . ',';
410
 
765
  // Compress javascript
766
  function wppa_compress_js( $txt ) {
767
 
768
+ if ( ! $txt ) return '';
 
 
 
 
 
769
 
770
+ // Remove single line comments and empty lines
771
+ $js_arr = explode( "\n", $txt );
772
+ foreach( array_keys( $js_arr ) as $key ) {
773
+ $line = trim( str_replace( "\t", " ", $js_arr[$key] ) );
774
+ if ( ! strlen( $line ) ) {
775
+ unset( $js_arr[$key] ); // remove empty line
776
+ }
777
+ else {
778
+ $i = 0;
779
+ $done = false;
780
+ while ( ! $done ) {
781
+ $compos = strpos( $line, '//', $i );
782
+ $httppos = strpos( $line, '://', $i );
783
+
784
+ // Is there a // ?
785
+ if ( $compos !== false ) {
786
+
787
+ // Is it a :// ?
788
+ if ( $compos == $httppos + 1 ) {
789
+
790
+ // Yes, continue searching
791
+ $i = $compos + 2;
792
+ }
793
+
794
+ // No, just cut off
795
+ else {
796
+ $js_arr[$key] = substr( $line, 0, $compos );
797
+ $done = true;
798
+ }
799
+ }
800
+
801
+ // No, we need the whole line
802
+ else {
803
+ $js_arr[$key] = $line;
804
+ $done = true;
805
+ }
806
+ }
807
+ }
808
+ }
809
+
810
+ // $js = implode( "\n", $js_arr );
811
+ // return $js;
812
+
813
+ $js = implode( " ", $js_arr );
814
+ $js = str_replace( "; ", ";", $js );
815
+ $js = str_replace( "} ", "}", $js );
816
+ $js = str_replace( "}", "};", $js );
817
+ $js = str_replace( "};,", "},", $js );
818
+ $js = str_replace( "}; ,", "},", $js );
819
+ $js = str_replace( ";}", "}", $js );
820
+ $js = str_replace( "};else", "}else", $js );
821
+ $js = str_replace( "}; else", "}else", $js );
822
+ $js = str_replace( [" (","( "], "(", $js );
823
+ $js = str_replace( [" )",") "], ")", $js );
824
+ $js = str_replace( ";)", ")", $js );
825
+ $js = str_replace( ";function", ";\nfunction", $js );
826
+
827
+ return $js;
828
  }
829
 
wppa-search-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the search widget
6
- * Version 8.2.03.006
7
  *
8
  */
9
 
@@ -113,7 +113,7 @@ class SearchPhotos extends WP_Widget {
113
  $body,
114
  __( 'Album', 'wp-photo-album-plus' ),
115
  false,
116
- __( 'If you want the search to be limited to a specific album and its (sub-)subalbums, select the album here.', 'wp-photo-album-plus' ) .
117
  ' ' .
118
  __( 'If you select an album here, it will overrule the previous checkbox using the album as a \'fixed\' root.', 'wp-photo-album-plus' )
119
  );
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the search widget
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
113
  $body,
114
  __( 'Album', 'wp-photo-album-plus' ),
115
  false,
116
+ __( 'If you want the search to be limited to a specific album and its (sub-)sub albums, select the album here.', 'wp-photo-album-plus' ) .
117
  ' ' .
118
  __( 'If you select an album here, it will overrule the previous checkbox using the album as a \'fixed\' root.', 'wp-photo-album-plus' )
119
  );
wppa-setting-see-also.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 8.2.02.005
7
  *
8
  */
9
 
@@ -123,7 +123,7 @@ global $wppa_subtab_names;
123
  ),
124
  'admin' => array(
125
  '1' => __( 'WPPA+ related roles and capabilities', 'wp-photo-album-plus' ),
126
- '2' => __( 'Frontend create Albums and upload Photos enabling and limiting settings' , 'wp-photo-album-plus' ),
127
  '3' => __( 'Import related settings', 'wp-photo-album-plus' ),
128
  '4' => __( 'Admin Functionality restrictions for non administrators' , 'wp-photo-album-plus' ),
129
  '5' => __( 'Miscellaneous limiting settings' , 'wp-photo-album-plus' ),
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
123
  ),
124
  'admin' => array(
125
  '1' => __( 'WPPA+ related roles and capabilities', 'wp-photo-album-plus' ),
126
+ '2' => __( 'Frontend create albums and upload photos enabling and limiting settings' , 'wp-photo-album-plus' ),
127
  '3' => __( 'Import related settings', 'wp-photo-album-plus' ),
128
  '4' => __( 'Admin Functionality restrictions for non administrators' , 'wp-photo-album-plus' ),
129
  '5' => __( 'Miscellaneous limiting settings' , 'wp-photo-album-plus' ),
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 8.2.09.001
7
  *
8
  */
9
 
@@ -299,26 +299,15 @@ global $wppa_subtab_names;
299
  // Fix invalid source path
300
  wppa_fix_source_path();
301
 
302
- wppa_echo( '<div class="wrap">' );
 
303
 
304
- wppa_admin_spinner();
305
- $iconurl = WPPA_URL.'/img/settings32.png';
306
-
307
- // General header
308
- wppa_echo( '
309
- <img id="icon-album" src="' . $iconurl . '" />
310
- <h1 style="display:inline">' . __( 'WP Photo Album Plus Settings', 'wp-photo-album-plus' ) . '
311
- <span style="color:blue"> ' . __( 'Auto Save', 'wp-photo-album-plus' ) . '</span>
312
  </h1>' );
313
- if ( current_user_can( 'administrator' ) ) {
314
- wppa_echo( ' ' .
315
- __( 'Database revision:', 'wp-photo-album-plus' ) . ' ' . wppa_get_option( 'wppa_revision', '100') . '. ' .
316
- __( 'WP Charset:', 'wp-photo-album-plus' ) . ' ' . get_bloginfo( 'charset' ) . '. ' .
317
- __( 'Current PHP version:', 'wp-photo-album-plus' ) . ' ' . phpversion() . '. ' .
318
- __( 'WPPA+ API Version:', 'wp-photo-album-plus' ) . ' ' . $wppa_version . '. ' .
319
- __( 'Filesystem method:', 'wp-photo-album-plus' ) . ' ' . get_filesystem_method() );
320
- }
321
- wppa_echo( '<br>' );
322
 
323
  if ( is_multisite() ) {
324
  if ( WPPA_MULTISITE_GLOBAL ) {
@@ -1353,7 +1342,7 @@ global $wppa_subtab_names;
1353
  $vals = array('normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900');
1354
 
1355
  $name = __('Album titles', 'wp-photo-album-plus' );
1356
- $desc = __('Font used for Album titles.', 'wp-photo-album-plus' );
1357
  $help = __('Enter font name, size, color and weight for album cover titles.', 'wp-photo-album-plus' );
1358
  $slug1 = 'wppa_fontfamily_title';
1359
  $slug2 = 'wppa_fontsize_title';
@@ -1673,8 +1662,8 @@ global $wppa_subtab_names;
1673
  wppa_setting_new($slug, '4', $name, $desc, $html, $help);
1674
 
1675
  $name = __('Treecount', 'wp-photo-album-plus' );
1676
- $desc = __('Display the total number of (sub)albums and photos in subalbums', 'wp-photo-album-plus' );
1677
- $help = __('Displays the total number of subalbums and photos in the entire album tree in parenthesis if the numbers differ from the direct content of the album.', 'wp-photo-album-plus' );
1678
  $slug = 'wppa_show_treecount';
1679
  $opts = array( __('none', 'wp-photo-album-plus' ), __('detailed', 'wp-photo-album-plus' ), __('totals only', 'wp-photo-album-plus' ));
1680
  $vals = array( '-none-', 'detail', 'total' );
@@ -1787,8 +1776,8 @@ global $wppa_subtab_names;
1787
  wppa_setting_new($slug, '5', $name, $desc, $html, $help);
1788
 
1789
  $name = __('Cats include subs', 'wp-photo-album-plus' );
1790
- $desc = __('Subalbums are included in Category based shortcodes.', 'wp-photo-album-plus' );
1791
- $help = __('When you use album="#cat,...", in a shortcode, the subalbums will be included.', 'wp-photo-album-plus' );
1792
  $slug = 'wppa_cats_inherit';
1793
  $html = wppa_checkbox($slug);
1794
  wppa_setting_new($slug, '6', $name, $desc, $html, $help);
@@ -2114,8 +2103,8 @@ global $wppa_subtab_names;
2114
  }
2115
 
2116
  if ( wppa_get_option( 'wppa_potd_album_type' ) == 'physical' ) {
2117
- $name = __( 'Include (sub-)subalbums', 'wp-photo-album-plus' );
2118
- $desc = __( 'Include the photos of all subalbums?', 'wp-photo-album-plus' );
2119
  $slug = 'wppa_potd_include_subs';
2120
  $html = wppa_checkbox( $slug, 'wppaRefreshAfter();' );
2121
  wppa_setting_new( $slug, '9', $name, $desc, $html );
@@ -5204,7 +5193,7 @@ global $wppa_subtab_names;
5204
  $slug4 = 'wppa_album_widget_overrule';
5205
  $slug = array($slug1, $slug2, $slug3, $slug4);
5206
  $opts = array(
5207
- __('subalbums and thumbnails.', 'wp-photo-album-plus' ),
5208
  __('slideshow', 'wp-photo-album-plus' ),
5209
  __('a plain page without a querystring.', 'wp-photo-album-plus' ),
5210
  __('lightbox', 'wp-photo-album-plus' ),
@@ -5237,7 +5226,7 @@ global $wppa_subtab_names;
5237
  $opts = array(
5238
  __('thumbnails', 'wp-photo-album-plus' ),
5239
  __('slideshow', 'wp-photo-album-plus' ),
5240
- __('subalbums and thumbnails', 'wp-photo-album-plus' ),
5241
  __('a plain page without a querystring.', 'wp-photo-album-plus' ),
5242
  __('lightbox', 'wp-photo-album-plus' ),
5243
  );
@@ -5657,8 +5646,8 @@ global $wppa_subtab_names;
5657
  $html = array($html1, $html2, $html3, $html4);
5658
  wppa_setting_new($slug, '11', $name, $desc, $html, $help);
5659
 
5660
- $name = __('Album cover subalbums link', 'wp-photo-album-plus' );
5661
- $desc = __('Select the linktype and display type for subalbums on parent album covers.', 'wp-photo-album-plus' );
5662
  $help = '';
5663
  $slug1 = 'wppa_cover_sublinks';
5664
  $slug2 = 'wppa_cover_sublinks_display';
@@ -5669,7 +5658,7 @@ global $wppa_subtab_names;
5669
  __('No link at all', 'wp-photo-album-plus' ),
5670
  __('Thumbnails and covers', 'wp-photo-album-plus' ),
5671
  __('Slideshow or covers', 'wp-photo-album-plus' ),
5672
- __('Subalbum title link', 'wp-photo-album-plus' ),
5673
  );
5674
  $vals = array(
5675
  'none',
@@ -5681,7 +5670,7 @@ global $wppa_subtab_names;
5681
  $opts = array(
5682
  __('No display at all', 'wp-photo-album-plus' ),
5683
  __('A list with sub-(sub) albums', 'wp-photo-album-plus' ),
5684
- __('A list of subalbums', 'wp-photo-album-plus' ),
5685
  __('An enumeration of names', 'wp-photo-album-plus' ),
5686
  __('Micro thumbnails', 'wp-photo-album-plus' ),
5687
  );
@@ -6518,7 +6507,7 @@ global $wppa_subtab_names;
6518
  wppa_setting_new($slug, '23', $name, $desc, $html, $help);
6519
 
6520
  $name = __('Thumbs first', 'wp-photo-album-plus' );
6521
- $desc = __('When displaying album content: thumbnails before subalbums.', 'wp-photo-album-plus' );
6522
  $help = '';
6523
  $slug = 'wppa_thumbs_first';
6524
  $html = wppa_checkbox($slug);
@@ -7055,7 +7044,7 @@ global $wppa_subtab_names;
7055
  case 'selectionbox':
7056
  $name = __('Grant parent', 'wp-photo-album-plus' );
7057
  $desc = __('The parent album(s) of the auto created albums.', 'wp-photo-album-plus' );
7058
- $help = (__('You may select multiple albums. All logged in visitors will get their own subalbum in each granted parent.', 'wp-photo-album-plus' ));
7059
  $slug = 'wppa_grant_parent';
7060
  $opts = array( __('--- none ---', 'wp-photo-album-plus' ), __('--- separate ---', 'wp-photo-album-plus' ) );
7061
  $vals = array( 'zero', '-1');
@@ -7190,8 +7179,8 @@ global $wppa_subtab_names;
7190
  $desc = __('The album linktype for new albums', 'wp-photo-album-plus' );
7191
  $help = '';
7192
  $slug = 'wppa_default_album_linktype';
7193
- $opts = array( __('the subalbums and thumbnails', 'wp-photo-album-plus' ),
7194
- __('the subalbums', 'wp-photo-album-plus' ),
7195
  __('the thumbnails', 'wp-photo-album-plus' ),
7196
  __('the album photos as slideshow', 'wp-photo-album-plus' ),
7197
  __('no link at all', 'wp-photo-album-plus' )
@@ -7336,7 +7325,7 @@ global $wppa_subtab_names;
7336
 
7337
  wppa_setting_box_footer_new();
7338
  }
7339
- // Frontend create Albums and upload Photos enabling and limiting settings
7340
  {
7341
  $desc = $wppa_subtab_names[$tab]['2'];
7342
  wppa_setting_tab_description($desc);
@@ -7349,7 +7338,7 @@ global $wppa_subtab_names;
7349
  );
7350
  wppa_setting_box_header_new($tab, $coldef);
7351
 
7352
- $name = __('User create Albums', 'wp-photo-album-plus' );
7353
  $desc = __('Enable frontend album creation.', 'wp-photo-album-plus' );
7354
  $help = __('If you check this item, frontend album creation will be enabled.', 'wp-photo-album-plus' );
7355
  $slug = 'wppa_user_create_on';
@@ -7413,7 +7402,7 @@ global $wppa_subtab_names;
7413
  $html = array( $html1, $html2 );
7414
  wppa_setting_new($slug, '5', $name, $desc, $html, $help);
7415
 
7416
- $name = __('User delete Albums', 'wp-photo-album-plus' );
7417
  $desc = __('Enable frontend album deletion', 'wp-photo-album-plus' );
7418
  $help = __('If you check this item, frontend album deletion will be enabled.', 'wp-photo-album-plus' );
7419
  $slug = 'wppa_user_destroy_on';
@@ -7423,7 +7412,7 @@ global $wppa_subtab_names;
7423
  $html = array( $html1, $html2 );
7424
  wppa_setting_new($slug, '6', $name, $desc, $html, $help);
7425
 
7426
- $name = __('User create Albums Captcha', 'wp-photo-album-plus' );
7427
  $desc = __('User must answer security question.', 'wp-photo-album-plus' );
7428
  $help = '';
7429
  $slug = 'wppa_user_create_captcha';
@@ -8037,24 +8026,6 @@ global $wppa_subtab_names;
8037
  $html = wppa_checkbox($slug);
8038
  wppa_setting_new($slug, '3', $name, $desc, $html, $help);
8039
 
8040
- $name = __('Album admin page size', 'wp-photo-album-plus' );
8041
- $desc = __('The number of albums per page on the Edit Album admin page.', 'wp-photo-album-plus' );
8042
- $help = '';
8043
- $slug = 'wppa_album_admin_pagesize';
8044
- $opts = array( '10', '20', '50', '100', '200', '500', '700', '1000', '1500', '2000' );
8045
- $vals = array( '10', '20', '50', '100', '200', '500', '700', '1000', '1500', '2000' );
8046
- $html = wppa_select($slug, $opts, $vals);
8047
- wppa_setting_new($slug, '4', $name, $desc, $html, $help);
8048
-
8049
- $name = __('Photo admin page size', 'wp-photo-album-plus' );
8050
- $desc = __('The number of photos per page on the Edit Album -> Manage photos and Edit Photos admin pages.', 'wp-photo-album-plus' );
8051
- $help = '';
8052
- $slug = 'wppa_photo_admin_pagesize';
8053
- $opts = array( '10', '20', '50', '100', '200', '500', '700', '1000' );
8054
- $vals = array( '10', '20', '50', '100', '200', '500', '700', '1000' );
8055
- $html = wppa_select($slug, $opts, $vals);
8056
- wppa_setting_new($slug, '5', $name, $desc, $html, $help);
8057
-
8058
  $name = __('Photo admin max albums', 'wp-photo-album-plus' );
8059
  $desc = __('Max albums to show in album selectionbox.', 'wp-photo-album-plus' );
8060
  $help = __('If there are more albums in the system, display an input box asking for album id#', 'wp-photo-album-plus' );
@@ -8064,15 +8035,6 @@ global $wppa_subtab_names;
8064
  $html = wppa_select($slug, $opts, $vals, '', '', '', 'wppaRefreshAfter();');
8065
  wppa_setting_new($slug, '6', $name, $desc, $html, $help);
8066
 
8067
- $name = __('Comment admin page size', 'wp-photo-album-plus' );
8068
- $desc = __('The number of comments per page on the Comments admin pages.', 'wp-photo-album-plus' );
8069
- $help = '';
8070
- $slug = 'wppa_comment_admin_pagesize';
8071
- $opts = array( __('--- off ---', 'wp-photo-album-plus' ), '10', '20', '50', '100', '200');
8072
- $vals = array('0', '10', '20', '50', '100', '200');
8073
- $html = wppa_select($slug, $opts, $vals);
8074
- wppa_setting_new($slug, '7', $name, $desc, $html, $help);
8075
-
8076
  $name = __('Geo info edit', 'wp-photo-album-plus' );
8077
  $desc = __('Lattitude and longitude may be edited in photo admin.', 'wp-photo-album-plus' );
8078
  $help = '';
@@ -8630,7 +8592,7 @@ global $wppa_subtab_names;
8630
 
8631
  $name = __('Remove empty albums', 'wp-photo-album-plus' );
8632
  $desc = __('Removes albums that are not used.', 'wp-photo-album-plus' );
8633
- $help = __('Removes all albums that have no photos and no subalbums in it.', 'wp-photo-album-plus' );
8634
  $slug2 = 'wppa_remove_empty_albums';
8635
  $html1 = '';
8636
  $html2 = wppa_maintenance_button( $slug2 );
@@ -9810,8 +9772,8 @@ global $wppa_subtab_names;
9810
  $opts = array( __('--- random ---', 'wp-photo-album-plus' ),
9811
  __('--- random featured ---', 'wp-photo-album-plus' ),
9812
  __('--- most recent added ---', 'wp-photo-album-plus' ),
9813
- __('--- random from (sub-)subalbums ---', 'wp-photo-album-plus' ),
9814
- __('--- most recent from (sub-)subalbums ---', 'wp-photo-album-plus' ),
9815
  __('--- according to albums photo sequence ---', 'wp-photo-album-plus' ),
9816
  );
9817
  $vals = array('-9', '-1', '-2', '-3', '-4', '-5');
@@ -10515,12 +10477,18 @@ global $wppa_subtab_names;
10515
  // close wrapper
10516
  wppa_echo( '</div>' );
10517
 
10518
- // Report resource used
10519
  wppa_echo( '
10520
- <div style="clear:both;margin-top:12px">' .
10521
- sprintf(__('<br>Memory used on this page: %6.2f Mb.', 'wp-photo-album-plus' ), memory_get_peak_usage(true)/(1024*1024)) .
10522
- sprintf(__('<br>There are %d settings and %d runtime parameters.', 'wp-photo-album-plus' ), count($wppa_opt), count($wppa)) . '
10523
- </div>' );
 
 
 
 
 
 
10524
 
10525
  wppa_initialize_runtime( true );
10526
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.3.01.005
7
  *
8
  */
9
 
299
  // Fix invalid source path
300
  wppa_fix_source_path();
301
 
302
+ // Spinner image
303
+ wppa_admin_spinner();
304
 
305
+ // Open page
306
+ wppa_echo( '
307
+ <div class="wrap">
308
+ <h1 class="wp-heading-inline">' .
309
+ get_admin_page_title() . '
 
 
 
310
  </h1>' );
 
 
 
 
 
 
 
 
 
311
 
312
  if ( is_multisite() ) {
313
  if ( WPPA_MULTISITE_GLOBAL ) {
1342
  $vals = array('normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900');
1343
 
1344
  $name = __('Album titles', 'wp-photo-album-plus' );
1345
+ $desc = __('Font used for album titles.', 'wp-photo-album-plus' );
1346
  $help = __('Enter font name, size, color and weight for album cover titles.', 'wp-photo-album-plus' );
1347
  $slug1 = 'wppa_fontfamily_title';
1348
  $slug2 = 'wppa_fontsize_title';
1662
  wppa_setting_new($slug, '4', $name, $desc, $html, $help);
1663
 
1664
  $name = __('Treecount', 'wp-photo-album-plus' );
1665
+ $desc = __('Display the total number of (sub)albums and photos in sub albums', 'wp-photo-album-plus' );
1666
+ $help = __('Displays the total number of sub albums and photos in the entire album tree in parenthesis if the numbers differ from the direct content of the album.', 'wp-photo-album-plus' );
1667
  $slug = 'wppa_show_treecount';
1668
  $opts = array( __('none', 'wp-photo-album-plus' ), __('detailed', 'wp-photo-album-plus' ), __('totals only', 'wp-photo-album-plus' ));
1669
  $vals = array( '-none-', 'detail', 'total' );
1776
  wppa_setting_new($slug, '5', $name, $desc, $html, $help);
1777
 
1778
  $name = __('Cats include subs', 'wp-photo-album-plus' );
1779
+ $desc = __('Sub albums are included in Category based shortcodes.', 'wp-photo-album-plus' );
1780
+ $help = __('When you use album="#cat,...", in a shortcode, the sub albums will be included.', 'wp-photo-album-plus' );
1781
  $slug = 'wppa_cats_inherit';
1782
  $html = wppa_checkbox($slug);
1783
  wppa_setting_new($slug, '6', $name, $desc, $html, $help);
2103
  }
2104
 
2105
  if ( wppa_get_option( 'wppa_potd_album_type' ) == 'physical' ) {
2106
+ $name = __( 'Include (sub-)sub albums', 'wp-photo-album-plus' );
2107
+ $desc = __( 'Include the photos of all sub albums?', 'wp-photo-album-plus' );
2108
  $slug = 'wppa_potd_include_subs';
2109
  $html = wppa_checkbox( $slug, 'wppaRefreshAfter();' );
2110
  wppa_setting_new( $slug, '9', $name, $desc, $html );
5193
  $slug4 = 'wppa_album_widget_overrule';
5194
  $slug = array($slug1, $slug2, $slug3, $slug4);
5195
  $opts = array(
5196
+ __('sub albums and thumbnails.', 'wp-photo-album-plus' ),
5197
  __('slideshow', 'wp-photo-album-plus' ),
5198
  __('a plain page without a querystring.', 'wp-photo-album-plus' ),
5199
  __('lightbox', 'wp-photo-album-plus' ),
5226
  $opts = array(
5227
  __('thumbnails', 'wp-photo-album-plus' ),
5228
  __('slideshow', 'wp-photo-album-plus' ),
5229
+ __('sub albums and thumbnails', 'wp-photo-album-plus' ),
5230
  __('a plain page without a querystring.', 'wp-photo-album-plus' ),
5231
  __('lightbox', 'wp-photo-album-plus' ),
5232
  );
5646
  $html = array($html1, $html2, $html3, $html4);
5647
  wppa_setting_new($slug, '11', $name, $desc, $html, $help);
5648
 
5649
+ $name = __('Album cover sub albums link', 'wp-photo-album-plus' );
5650
+ $desc = __('Select the linktype and display type for sub albums on parent album covers.', 'wp-photo-album-plus' );
5651
  $help = '';
5652
  $slug1 = 'wppa_cover_sublinks';
5653
  $slug2 = 'wppa_cover_sublinks_display';
5658
  __('No link at all', 'wp-photo-album-plus' ),
5659
  __('Thumbnails and covers', 'wp-photo-album-plus' ),
5660
  __('Slideshow or covers', 'wp-photo-album-plus' ),
5661
+ __('Sub album title link', 'wp-photo-album-plus' ),
5662
  );
5663
  $vals = array(
5664
  'none',
5670
  $opts = array(
5671
  __('No display at all', 'wp-photo-album-plus' ),
5672
  __('A list with sub-(sub) albums', 'wp-photo-album-plus' ),
5673
+ __('A list of sub albums', 'wp-photo-album-plus' ),
5674
  __('An enumeration of names', 'wp-photo-album-plus' ),
5675
  __('Micro thumbnails', 'wp-photo-album-plus' ),
5676
  );
6507
  wppa_setting_new($slug, '23', $name, $desc, $html, $help);
6508
 
6509
  $name = __('Thumbs first', 'wp-photo-album-plus' );
6510
+ $desc = __('When displaying album content: thumbnails before sub albums.', 'wp-photo-album-plus' );
6511
  $help = '';
6512
  $slug = 'wppa_thumbs_first';
6513
  $html = wppa_checkbox($slug);
7044
  case 'selectionbox':
7045
  $name = __('Grant parent', 'wp-photo-album-plus' );
7046
  $desc = __('The parent album(s) of the auto created albums.', 'wp-photo-album-plus' );
7047
+ $help = (__('You may select multiple albums. All logged in visitors will get their own sub album in each granted parent.', 'wp-photo-album-plus' ));
7048
  $slug = 'wppa_grant_parent';
7049
  $opts = array( __('--- none ---', 'wp-photo-album-plus' ), __('--- separate ---', 'wp-photo-album-plus' ) );
7050
  $vals = array( 'zero', '-1');
7179
  $desc = __('The album linktype for new albums', 'wp-photo-album-plus' );
7180
  $help = '';
7181
  $slug = 'wppa_default_album_linktype';
7182
+ $opts = array( __('the sub albums and thumbnails', 'wp-photo-album-plus' ),
7183
+ __('the sub albums', 'wp-photo-album-plus' ),
7184
  __('the thumbnails', 'wp-photo-album-plus' ),
7185
  __('the album photos as slideshow', 'wp-photo-album-plus' ),
7186
  __('no link at all', 'wp-photo-album-plus' )
7325
 
7326
  wppa_setting_box_footer_new();
7327
  }
7328
+ // Frontend create albums and upload Photos enabling and limiting settings
7329
  {
7330
  $desc = $wppa_subtab_names[$tab]['2'];
7331
  wppa_setting_tab_description($desc);
7338
  );
7339
  wppa_setting_box_header_new($tab, $coldef);
7340
 
7341
+ $name = __('User create albums', 'wp-photo-album-plus' );
7342
  $desc = __('Enable frontend album creation.', 'wp-photo-album-plus' );
7343
  $help = __('If you check this item, frontend album creation will be enabled.', 'wp-photo-album-plus' );
7344
  $slug = 'wppa_user_create_on';
7402
  $html = array( $html1, $html2 );
7403
  wppa_setting_new($slug, '5', $name, $desc, $html, $help);
7404
 
7405
+ $name = __('User delete albums', 'wp-photo-album-plus' );
7406
  $desc = __('Enable frontend album deletion', 'wp-photo-album-plus' );
7407
  $help = __('If you check this item, frontend album deletion will be enabled.', 'wp-photo-album-plus' );
7408
  $slug = 'wppa_user_destroy_on';
7412
  $html = array( $html1, $html2 );
7413
  wppa_setting_new($slug, '6', $name, $desc, $html, $help);
7414
 
7415
+ $name = __('User create albums captcha', 'wp-photo-album-plus' );
7416
  $desc = __('User must answer security question.', 'wp-photo-album-plus' );
7417
  $help = '';
7418
  $slug = 'wppa_user_create_captcha';
8026
  $html = wppa_checkbox($slug);
8027
  wppa_setting_new($slug, '3', $name, $desc, $html, $help);
8028
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8029
  $name = __('Photo admin max albums', 'wp-photo-album-plus' );
8030
  $desc = __('Max albums to show in album selectionbox.', 'wp-photo-album-plus' );
8031
  $help = __('If there are more albums in the system, display an input box asking for album id#', 'wp-photo-album-plus' );
8035
  $html = wppa_select($slug, $opts, $vals, '', '', '', 'wppaRefreshAfter();');
8036
  wppa_setting_new($slug, '6', $name, $desc, $html, $help);
8037
 
 
 
 
 
 
 
 
 
 
8038
  $name = __('Geo info edit', 'wp-photo-album-plus' );
8039
  $desc = __('Lattitude and longitude may be edited in photo admin.', 'wp-photo-album-plus' );
8040
  $help = '';
8592
 
8593
  $name = __('Remove empty albums', 'wp-photo-album-plus' );
8594
  $desc = __('Removes albums that are not used.', 'wp-photo-album-plus' );
8595
+ $help = __('Removes all albums that have no photos and no sub albums in it.', 'wp-photo-album-plus' );
8596
  $slug2 = 'wppa_remove_empty_albums';
8597
  $html1 = '';
8598
  $html2 = wppa_maintenance_button( $slug2 );
9772
  $opts = array( __('--- random ---', 'wp-photo-album-plus' ),
9773
  __('--- random featured ---', 'wp-photo-album-plus' ),
9774
  __('--- most recent added ---', 'wp-photo-album-plus' ),
9775
+ __('--- random from (sub-)sub albums ---', 'wp-photo-album-plus' ),
9776
+ __('--- most recent from (sub-)sub albums ---', 'wp-photo-album-plus' ),
9777
  __('--- according to albums photo sequence ---', 'wp-photo-album-plus' ),
9778
  );
9779
  $vals = array('-9', '-1', '-2', '-3', '-4', '-5');
10477
  // close wrapper
10478
  wppa_echo( '</div>' );
10479
 
10480
+ // Report resource used and other environmental data
10481
  wppa_echo( '
10482
+ <div style="clear:both;margin-top:12px">
10483
+ <br>' .
10484
+ sprintf( __( 'Memory used on this page: %6.2f Mb', 'wp-photo-album-plus' ), memory_get_peak_usage( true ) / ( 1024 * 1024 ) ) . '<br>' .
10485
+ sprintf( __( 'There are %d settings and %d runtime parameters', 'wp-photo-album-plus' ), count( $wppa_opt ), count( $wppa ) ) . '<br>' .
10486
+ __( 'Database revision:', 'wp-photo-album-plus' ) . ' ' . wppa_get_option( 'wppa_revision', '100' ) . '<br>' .
10487
+ __( 'WP Charset:', 'wp-photo-album-plus' ) . ' ' . get_bloginfo( 'charset' ) . '<br>' .
10488
+ __( 'Current PHP version:', 'wp-photo-album-plus' ) . ' ' . phpversion() . '<br>' .
10489
+ __( 'WPPA+ API Version:', 'wp-photo-album-plus' ) . ' ' . $wppa_version . '<br>' .
10490
+ __( 'Filesystem method:', 'wp-photo-album-plus' ) . ' ' . get_filesystem_method() .
10491
+ '<br>' );
10492
 
10493
  wppa_initialize_runtime( true );
10494
  }
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 8.2.05.003
7
  *
8
  */
9
 
@@ -634,7 +634,7 @@ static $user;
634
  $my_albs_parents[] = $parent;
635
  }
636
  else {
637
- wppa_log( 'Err', 'Could not create subalbum of ' . $parent . ' for ' . $user );
638
  }
639
  wppa_invalidate_treecounts( $parent );
640
  wppa_index_add( 'album', $id );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
634
  $my_albs_parents[] = $parent;
635
  }
636
  else {
637
+ wppa_log( 'Err', 'Could not create sub album of ' . $parent . ' for ' . $user );
638
  }
639
  wppa_invalidate_treecounts( $parent );
640
  wppa_index_add( 'album', $id );
wppa-slideshow-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display a slideshow in the sidebar
6
- * Version 8.2.05.002
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -88,7 +88,7 @@ class SlideshowWidget extends WP_Widget {
88
  wppa( 'max_slides_in_ss_widget', $instance['maxslides'] );
89
  wppa( 'is_random', wppa_checked( $instance['random'] ) );
90
 
91
- // Including subalbums?
92
  if ( $album > '0' && wppa_checked( $instance['incsubs'] ) ) {
93
  $album = wppa_alb_to_enum_children( $album );
94
  }
@@ -196,8 +196,8 @@ class SlideshowWidget extends WP_Widget {
196
  wppa_widget_input( $this, 'album', $instance['album'], __( 'Album', 'wp-photo-album-plus' ) );
197
  }
198
 
199
- // Including subalbums?
200
- wppa_widget_checkbox( $this, 'incsubs', $instance['incsubs'], __( 'Include subalbums', 'wp-photo-album-plus' ) );
201
 
202
  // Max
203
  $body =
3
  * Package: wp-photo-album-plus
4
  *
5
  * display a slideshow in the sidebar
6
+ * Version 8.3.01.001
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
88
  wppa( 'max_slides_in_ss_widget', $instance['maxslides'] );
89
  wppa( 'is_random', wppa_checked( $instance['random'] ) );
90
 
91
+ // Including sub albums?
92
  if ( $album > '0' && wppa_checked( $instance['incsubs'] ) ) {
93
  $album = wppa_alb_to_enum_children( $album );
94
  }
196
  wppa_widget_input( $this, 'album', $instance['album'], __( 'Album', 'wp-photo-album-plus' ) );
197
  }
198
 
199
+ // Including sub albums?
200
+ wppa_widget_checkbox( $this, 'incsubs', $instance['incsubs'], __( 'Include sub albums', 'wp-photo-album-plus' ) );
201
 
202
  // Max
203
  $body =
wppa-slideshow.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
- * Version 8.2.06.006
8
  *
9
  */
10
 
@@ -178,7 +178,7 @@ global $previous_page_last_id;
178
  wppa( 'curpage', '1' );
179
 
180
  // If a page is requested, find it
181
- $pagreq = wppa_get( 'wppa-page', '0' );
182
  if ( $pagreq ) {
183
  wppa( 'curpage', $pagreq );
184
  }
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
+ * Version 8.3.01.001
8
  *
9
  */
10
 
178
  wppa( 'curpage', '1' );
179
 
180
  // If a page is requested, find it
181
+ $pagreq = wppa_get( 'paged', '0' );
182
  if ( $pagreq ) {
183
  wppa( 'curpage', $pagreq );
184
  }
wppa-statistics.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Functions for counts etc
6
  * Common use front and admin
7
- * Version 8.2.07.003
8
  *
9
  */
10
 
@@ -25,7 +25,7 @@ function wppa_show_statistics() {
25
  $result .= '<a href="'.wppa_get_permalink().'wppa-album='.$y_id.'&amp;wppa-cover=0&amp;wppa-occur=1">'.$y_name.'</a>';
26
 
27
  if ($p_id > '0') {
28
- $result .= __(', a subalbum of', 'wp-photo-album-plus' ).' ';
29
  $result .= '<a href="'.wppa_get_permalink().'wppa-album='.$p_id.'&amp;wppa-cover=0&amp;wppa-occur=1">'.$p_name.'</a>';
30
  }
31
 
@@ -317,7 +317,7 @@ global $wpdb;
317
  return $treecounts;
318
  }
319
 
320
- // Get the ids of the subalbums
321
  $child_ids = $wpdb->get_col( "SELECT id " .
322
  "FROM $wpdb->wppa_albums " .
323
  "WHERE a_parent = $alb"
@@ -584,11 +584,11 @@ global $wpdb;
584
  return $result;
585
  }
586
 
587
- // An album is physically empty when it has no subalbums, no photos and no recoverable deleted photos
588
  function wppa_is_album_empty( $id ) {
589
  global $wpdb;
590
 
591
- // Subalbums?
592
  $has_albums = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_albums WHERE a_parent = %s", $id ) );
593
  if ( $has_albums ) {
594
  return false;
@@ -665,7 +665,7 @@ static $login;
665
  }
666
  }
667
 
668
- // Look at subalbums
669
  $albs = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_albums WHERE a_parent = %s", $id ) );
670
  foreach( $albs as $a ) {
671
 
@@ -823,7 +823,7 @@ static $cache;
823
  return $result;
824
  }
825
 
826
- // Get array of subalbum ids, not checked for visibility
827
  function wppa_get_sub_album_ids( $id ) {
828
  global $wpdb;
829
  static $cache;
4
  *
5
  * Functions for counts etc
6
  * Common use front and admin
7
+ * Version 8.3.01.001
8
  *
9
  */
10
 
25
  $result .= '<a href="'.wppa_get_permalink().'wppa-album='.$y_id.'&amp;wppa-cover=0&amp;wppa-occur=1">'.$y_name.'</a>';
26
 
27
  if ($p_id > '0') {
28
+ $result .= __(', a sub album of', 'wp-photo-album-plus' ).' ';
29
  $result .= '<a href="'.wppa_get_permalink().'wppa-album='.$p_id.'&amp;wppa-cover=0&amp;wppa-occur=1">'.$p_name.'</a>';
30
  }
31
 
317
  return $treecounts;
318
  }
319
 
320
+ // Get the ids of the sub albums
321
  $child_ids = $wpdb->get_col( "SELECT id " .
322
  "FROM $wpdb->wppa_albums " .
323
  "WHERE a_parent = $alb"
584
  return $result;
585
  }
586
 
587
+ // An album is physically empty when it has no sub albums, no photos and no recoverable deleted photos
588
  function wppa_is_album_empty( $id ) {
589
  global $wpdb;
590
 
591
+ // Sub albums?
592
  $has_albums = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_albums WHERE a_parent = %s", $id ) );
593
  if ( $has_albums ) {
594
  return false;
665
  }
666
  }
667
 
668
+ // Look at sub albums
669
  $albs = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_albums WHERE a_parent = %s", $id ) );
670
  foreach( $albs as $a ) {
671
 
823
  return $result;
824
  }
825
 
826
+ // Get array of sub album ids, not checked for visibility
827
  function wppa_get_sub_album_ids( $id ) {
828
  global $wpdb;
829
  static $cache;
wppa-thumbnails.php CHANGED
@@ -5,7 +5,7 @@
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
- * Version 8.2.05.001
9
  *
10
  */
11
 
@@ -61,17 +61,6 @@ global $wpdb;
61
  $class = 'thumbnail-frame thumbnail-frame-'.$mocc.' thumbnail-frame-photo-'.$xid;
62
  }
63
 
64
- // If no image to display, die gracefully
65
- // $imgsrc = wppa_get_thumb_path( $id );
66
- // if ( ! wppa_is_video( $id ) && ! is_file( $imgsrc ) && ! wppa_has_audio( $id ) ) {
67
- // $result .= '<div' .
68
- // ' class="' . $class . '"' .
69
- // ' style="' . $framestyle . '; color:red">' .
70
- // 'Missing thumbnail image #' . $id .
71
- // '</div>';
72
- // return $result;
73
- // }
74
-
75
  // Find image attributes
76
  $imgsrc = wppa_get_thumb_path( $id );
77
  if ( ! wppa_is_file( $imgsrc ) ) {
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
+ * Version 8.3.01.001
9
  *
10
  */
11
 
61
  $class = 'thumbnail-frame thumbnail-frame-'.$mocc.' thumbnail-frame-photo-'.$xid;
62
  }
63
 
 
 
 
 
 
 
 
 
 
 
 
64
  // Find image attributes
65
  $imgsrc = wppa_get_thumb_path( $id );
66
  if ( ! wppa_is_file( $imgsrc ) ) {
wppa-tinymce-shortcodes.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-tinymce-shortcodes.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.2.05.001
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) )
@@ -111,7 +111,7 @@ global $wpdb;
111
  <option value="" selected disabled style="color:#700 !important;">-- ' . __( 'Please select a gallery type', 'wp-photo-album-plus' ) . ' --</option>
112
  <option value="cover">' . __( 'The cover(s) of specific album(s)', 'wp-photo-album-plus' ) . '</option>
113
  <option value="content">' . __( 'The content of specific album(s)', 'wp-photo-album-plus' ) . '</option>
114
- <option value="covers">' . __( 'The covers of the subalbums of specific album(s)', 'wp-photo-album-plus' ) . '</option>
115
  <option value="thumbs">' . __( 'The thumbnails of specific album(s)', 'wp-photo-album-plus' ) . '</option>
116
  </select>
117
  </td>
2
  /* wppa-tinymce-shortcodes.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.3.01.001
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) )
111
  <option value="" selected disabled style="color:#700 !important;">-- ' . __( 'Please select a gallery type', 'wp-photo-album-plus' ) . ' --</option>
112
  <option value="cover">' . __( 'The cover(s) of specific album(s)', 'wp-photo-album-plus' ) . '</option>
113
  <option value="content">' . __( 'The content of specific album(s)', 'wp-photo-album-plus' ) . '</option>
114
+ <option value="covers">' . __( 'The covers of the sub albums of specific album(s)', 'wp-photo-album-plus' ) . '</option>
115
  <option value="thumbs">' . __( 'The thumbnails of specific album(s)', 'wp-photo-album-plus' ) . '</option>
116
  </select>
117
  </td>
wppa-topten-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
- * Version 8.2.05.002
7
  */
8
 
9
  class TopTenWidget extends WP_Widget {
@@ -108,7 +108,7 @@ class TopTenWidget extends WP_Widget {
108
  }
109
  }
110
 
111
- // Including subalbums?
112
  if ( $includesubs ) {
113
  $albenum = wppa_expand_enum( $album );
114
  $albenum = wppa_alb_to_enum_children( $albenum );
@@ -579,8 +579,8 @@ class TopTenWidget extends WP_Widget {
579
 
580
  wppa_widget_selection( $this, 'sortby', $instance['sortby'], __( 'Sort by', 'wp-photo-album-plus' ), $options, $values );
581
 
582
- // Include subalbums
583
- wppa_widget_checkbox( $this, 'includesubs', $instance['includesubs'], __( 'Include subalbums', 'wp-photo-album-plus' ) );
584
 
585
  // Medals only
586
  wppa_widget_checkbox( $this, 'medalsonly', $instance['medalsonly'], __( 'Only with medals', 'wp-photo-album-plus' ) );
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
+ * Version 8.3.01.001
7
  */
8
 
9
  class TopTenWidget extends WP_Widget {
108
  }
109
  }
110
 
111
+ // Including sub albums?
112
  if ( $includesubs ) {
113
  $albenum = wppa_expand_enum( $album );
114
  $albenum = wppa_alb_to_enum_children( $albenum );
579
 
580
  wppa_widget_selection( $this, 'sortby', $instance['sortby'], __( 'Sort by', 'wp-photo-album-plus' ), $options, $values );
581
 
582
+ // Include sub albums
583
+ wppa_widget_checkbox( $this, 'includesubs', $instance['includesubs'], __( 'Include sub albums', 'wp-photo-album-plus' ) );
584
 
585
  // Medals only
586
  wppa_widget_checkbox( $this, 'medalsonly', $instance['medalsonly'], __( 'Only with medals', 'wp-photo-album-plus' ) );
wppa-upldr-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display a list of users linking to their photos
6
- * Version 8.2.05.002
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -228,7 +228,7 @@ class UpldrWidget extends WP_Widget {
228
  ?>
229
 
230
 
231
- <p><label for="<?php echo $this->get_field_id('parent'); ?>"><?php _e('Look only in albums (including subalbums):', 'wp-photo-album-plus' ); ?></label>
232
  <input type="hidden" id="<?php echo $this->get_field_id('parent'); ?>" name="<?php echo $this->get_field_name('parent'); ?>" value="<?php echo $instance['parent'] ?>" />
233
  <?php if ( $instance['parent'] ) echo '<br/><small>( '.$instance['parent'].' )</small>' ?>
234
  <select class="widefat" multiple onchange="wppaGetSelEnumToId( 'parentalbums-<?php echo $this->get_widget_id() ?>', '<?php echo $this->get_field_id('parent') ?>' )" id="<?php echo $this->get_field_id('parent-list'); ?>" name="<?php echo $this->get_field_name('parent-list'); ?>" >
3
  * Package: wp-photo-album-plus
4
  *
5
  * display a list of users linking to their photos
6
+ * Version 8.3.01.001
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
228
  ?>
229
 
230
 
231
+ <p><label for="<?php echo $this->get_field_id('parent'); ?>"><?php _e('Look only in albums (including sub albums):', 'wp-photo-album-plus' ); ?></label>
232
  <input type="hidden" id="<?php echo $this->get_field_id('parent'); ?>" name="<?php echo $this->get_field_name('parent'); ?>" value="<?php echo $instance['parent'] ?>" />
233
  <?php if ( $instance['parent'] ) echo '<br/><small>( '.$instance['parent'].' )</small>' ?>
234
  <select class="widefat" multiple onchange="wppaGetSelEnumToId( 'parentalbums-<?php echo $this->get_widget_id() ?>', '<?php echo $this->get_field_id('parent') ?>' )" id="<?php echo $this->get_field_id('parent-list'); ?>" name="<?php echo $this->get_field_name('parent-list'); ?>" >
wppa-upload-common.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains common upload functions
6
- * Version 8.2.09.002
7
  *
8
  */
9
 
@@ -268,7 +268,7 @@ global $wppa_supported_document_extensions;
268
 
269
  while ( $i < count( $names ) -1 ) {
270
 
271
- // Find album with parent is current and name is subalbum name
272
  $a = $wpdb->get_var( $wpdb->prepare( "SELECT id
273
  FROM $wpdb->wppa_albums
274
  WHERE name = %s
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains common upload functions
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
268
 
269
  while ( $i < count( $names ) -1 ) {
270
 
271
+ // Find album with parent is current and name is sub album name
272
  $a = $wpdb->get_var( $wpdb->prepare( "SELECT id
273
  FROM $wpdb->wppa_albums
274
  WHERE name = %s
wppa-upload-widget.php CHANGED
@@ -4,14 +4,14 @@
4
  *
5
  * A wppa widget to upload photos
6
  *
7
- * Version 8.2.05.002
8
  */
9
 
10
  class WppaUploadWidget extends WP_Widget {
11
 
12
  function __construct() {
13
  $widget_ops = array( 'classname' => 'wppa_upload_widget', 'description' => __( 'Display upload photos dialog', 'wp-photo-album-plus' ) );
14
- parent::__construct( 'wppa_upload_widget', __( 'WPPA+ Upload Photos', 'wp-photo-album-plus' ), $widget_ops );
15
  }
16
 
17
  function widget( $args, $instance ) {
@@ -115,7 +115,7 @@ class WppaUploadWidget extends WP_Widget {
115
  // Set defaults
116
  function get_defaults() {
117
 
118
- $defaults = array( 'title' => __( 'Upload Photos', 'wp-photo-album-plus' ),
119
  'album' => '0',
120
  'logonly' => 'no',
121
  'cache' => '0',
4
  *
5
  * A wppa widget to upload photos
6
  *
7
+ * Version 8.3.01.001
8
  */
9
 
10
  class WppaUploadWidget extends WP_Widget {
11
 
12
  function __construct() {
13
  $widget_ops = array( 'classname' => 'wppa_upload_widget', 'description' => __( 'Display upload photos dialog', 'wp-photo-album-plus' ) );
14
+ parent::__construct( 'wppa_upload_widget', __( 'WPPA+ Upload photos', 'wp-photo-album-plus' ), $widget_ops );
15
  }
16
 
17
  function widget( $args, $instance ) {
115
  // Set defaults
116
  function get_defaults() {
117
 
118
+ $defaults = array( 'title' => __( 'Upload photos', 'wp-photo-album-plus' ),
119
  'album' => '0',
120
  'logonly' => 'no',
121
  'cache' => '0',
wppa-upload.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
- * Version 8.2.05.002
7
  *
8
  */
9
 
@@ -95,7 +95,9 @@ global $upload_album;
95
  // Open the form
96
  $result = '
97
  <div class="wrap">
98
- <h2>' . __( 'Upload Photos', 'wp-photo-album-plus' ) . '</h2>';
 
 
99
 
100
  // Get some req'd data
101
  $max_files = ini_get( 'max_file_uploads' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
95
  // Open the form
96
  $result = '
97
  <div class="wrap">
98
+ <h1>' .
99
+ get_admin_page_title() . '
100
+ </h1>';
101
 
102
  // Get some req'd data
103
  $max_files = ini_get( 'max_file_uploads' );
wppa-users.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains user and capabilities related routines
6
- * Version 8.2.05.002
7
  *
8
  */
9
 
@@ -40,16 +40,31 @@ static $users;
40
 
41
  // Get the options html for a selectionbox with users
42
  function wppa_get_user_select( $select = '' ) {
 
 
43
  $result = '';
 
 
 
 
 
44
  $iam = $select == '' ? wppa_get_user() : $select;
 
 
45
  $users = wppa_get_users();
 
 
46
  $sel = $select == '--- public ---' ? 'selected' : '';
47
  $result .= '<option value="--- public ---" '.$sel.'>'.__( '--- public ---' , 'wp-photo-album-plus' ).'</option>';
 
 
48
  foreach ( $users as $usr ) {
49
  if ( $usr['user_login'] == $iam ) $sel = 'selected';
50
  else $sel = '';
51
  $result .= '<option value="' . esc_attr( $usr['user_login'] ) . '" ' . $sel . '>' . sanitize_text_field( $usr['display_name'] ) . '</option>';
52
  }
 
 
53
  return $result;
54
  }
55
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains user and capabilities related routines
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
40
 
41
  // Get the options html for a selectionbox with users
42
  function wppa_get_user_select( $select = '' ) {
43
+
44
+ // Init
45
  $result = '';
46
+
47
+ // Unknown user
48
+ $result .= '<option value="" disabled selected>' . __( 'Please select' , 'wp-photo-album-plus' ) . '</option>';
49
+
50
+ // Who am i?
51
  $iam = $select == '' ? wppa_get_user() : $select;
52
+
53
+ // Get all users
54
  $users = wppa_get_users();
55
+
56
+ // Add user --- public ---
57
  $sel = $select == '--- public ---' ? 'selected' : '';
58
  $result .= '<option value="--- public ---" '.$sel.'>'.__( '--- public ---' , 'wp-photo-album-plus' ).'</option>';
59
+
60
+ // Add all users
61
  foreach ( $users as $usr ) {
62
  if ( $usr['user_login'] == $iam ) $sel = 'selected';
63
  else $sel = '';
64
  $result .= '<option value="' . esc_attr( $usr['user_login'] ) . '" ' . $sel . '>' . sanitize_text_field( $usr['display_name'] ) . '</option>';
65
  }
66
+
67
+ // Done
68
  return $result;
69
  }
70
 
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 8.2.09.001
7
  *
8
  */
9
 
@@ -2612,7 +2612,7 @@ global $wpdb;
2612
  }
2613
  }
2614
 
2615
- // Retrieve the number of subalbums ( if any )
2616
  function wppa_has_children( $alb ) {
2617
  global $wpdb;
2618
  static $childcounts;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
2612
  }
2613
  }
2614
 
2615
+ // Retrieve the number of sub albums ( if any )
2616
  function wppa_has_children( $alb ) {
2617
  global $wpdb;
2618
  static $childcounts;
wppa-widget-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-widget-functions.php
3
  /* Package: wp-photo-album-plus
4
  /*
5
- /* Version 8.2.08.001
6
  /*
7
  */
8
 
@@ -61,7 +61,7 @@ global $wpdb;
61
  }
62
  }
63
 
64
- // If physical album(s) and include subalbums is active, make it an enumeration(with ',' as seperator)
65
  if ( wppa_opt( 'potd_album_type' ) == 'physical' && wppa_switch( 'potd_include_subs' ) ) {
66
  $alb = str_replace( ',', '.', $alb );
67
  $alb = wppa_expand_enum( wppa_alb_to_enum_children( $alb ) );
2
  /* wppa-widget-functions.php
3
  /* Package: wp-photo-album-plus
4
  /*
5
+ /* Version 8.3.01.001
6
  /*
7
  */
8
 
61
  }
62
  }
63
 
64
+ // If physical album(s) and include sub albums is active, make it an enumeration(with ',' as seperator)
65
  if ( wppa_opt( 'potd_album_type' ) == 'physical' && wppa_switch( 'potd_include_subs' ) ) {
66
  $alb = str_replace( ',', '.', $alb );
67
  $alb = wppa_expand_enum( wppa_alb_to_enum_children( $alb ) );
wppa-wpdb-update.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that update records
6
- * Version 8.2.05.003
7
  *
8
  */
9
 
@@ -131,6 +131,11 @@ global $wpdb;
131
  if ( is_numeric( $itemvalue ) ) {
132
  $doit = true;
133
  }
 
 
 
 
 
134
  default:
135
  wppa_log( 'Error', 'Not implemented in wppa_update_album(): '.$itemname );
136
  return false;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that update records
6
+ * Version 8.3.01.001
7
  *
8
  */
9
 
131
  if ( is_numeric( $itemvalue ) ) {
132
  $doit = true;
133
  }
134
+ case 'owner':
135
+ if ( $itemvalue == '--- public ---' || get_user_by( 'login', $itemvalue ) ) {
136
+ $doit = true;
137
+ }
138
+
139
  default:
140
  wppa_log( 'Error', 'Not implemented in wppa_update_album(): '.$itemname );
141
  return false;
wppa-wrappers.php CHANGED
@@ -5,7 +5,7 @@
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
- * Version 8.2.08.001
9
  *
10
  */
11
 
@@ -765,7 +765,7 @@ static $allowed_tags;
765
  'h4' => $sa,
766
  'h5' => $sa,
767
  'h6' => $sa,
768
- 'hr' => array(),
769
  'i' => $sa,
770
  'img' => array_merge( $sa, array(
771
  'alt' => true,
@@ -789,6 +789,8 @@ static $allowed_tags;
789
  'accept' => true,
790
  'placeholder' => true,
791
  'download' => true,
 
 
792
  ) ),
793
  'label' => array(
794
  'for' => true,
@@ -975,9 +977,11 @@ add_filter( 'safe_style_css', function( $styles ) {
975
  return array_merge( $styles, $my_styles );
976
  } );
977
 
978
- function wppa_add_inline_script( $where, $script ) {
979
 
980
- $debug = false;
 
 
981
  if ( $debug ) {
982
  echo '<script>' . $script . '</script>';
983
  }
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 8.3.01.006
9
  *
10
  */
11
 
765
  'h4' => $sa,
766
  'h5' => $sa,
767
  'h6' => $sa,
768
+ 'hr' => $sa,
769
  'i' => $sa,
770
  'img' => array_merge( $sa, array(
771
  'alt' => true,
789
  'accept' => true,
790
  'placeholder' => true,
791
  'download' => true,
792
+ 'size' => true,
793
+ 'aria-describedby' => true,
794
  ) ),
795
  'label' => array(
796
  'for' => true,
977
  return array_merge( $styles, $my_styles );
978
  } );
979
 
980
+ function wppa_add_inline_script( $where, $script, $compress = false, $debug = false ) {
981
 
982
+ if ( $compress ) {
983
+ $script = wppa_compress_js( $script );
984
+ }
985
  if ( $debug ) {
986
  echo '<script>' . $script . '</script>';
987
  }
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.09.002
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -23,7 +23,7 @@ global $wpdb;
23
  global $wp_version;
24
 
25
  /* WPPA Version */
26
- global $wppa_version; $wppa_version = '8.2.09.002'; // WPPA software version
27
  global $wppa_revno; $wppa_revno = str_replace( '.', '', $wppa_version ); // WPPA db version
28
 
29
  /* Init page js data */
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.3.01.006
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/
23
  global $wp_version;
24
 
25
  /* WPPA Version */
26
+ global $wppa_version; $wppa_version = '8.3.01.006'; // WPPA software version
27
  global $wppa_revno; $wppa_revno = str_replace( '.', '', $wppa_version ); // WPPA db version
28
 
29
  /* Init page js data */