Version Description
= 8.1.08 =
- This version addresses various bug fixes, feature requests and security fixes.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 8.3.01.002 |
Comparing to | |
See all releases |
Code changes from version 8.2.09.002 to 8.3.01.002
- changelog.txt +15 -7
- js/wppa-admin-scripts.js +7 -5
- js/wppa-admin-scripts.min.js +1 -1
- wppa-admin-functions.php +398 -82
- wppa-admin-styles.css +25 -33
- wppa-admin.php +141 -27
- wppa-adminbar.php +10 -10
- wppa-ajax.php +3 -3
- wppa-album-admin-autosave.php +312 -420
- wppa-album-covers.php +293 -261
- wppa-album-widget.php +4 -4
- wppa-boxes-html.php +10 -10
- wppa-breadcrumb.php +4 -4
- wppa-cache.php +3 -4
- wppa-comment-admin.php +22 -11
- wppa-common-functions.php +2 -2
- wppa-defaults.php +1 -3
- wppa-edit-email.php +31 -224
- wppa-edit-sequence.php +3 -7
- wppa-edit-tags.php +15 -22
- wppa-export.php +4 -4
- wppa-functions.php +9 -3
- wppa-gutenberg-wppa.php +2 -2
- wppa-help.php +4 -2
- wppa-import.php +6 -2
- wppa-init.php +3 -3
- wppa-input.php +3 -18
- wppa-lasten-widget.php +3 -3
- wppa-links.php +13 -13
- wppa-listtable.php +1314 -0
- wppa-maintenance.php +5 -5
- wppa-photo-admin-autosave.php +73 -35
- wppa-picture.php +2 -2
- wppa-search-widget.php +2 -2
- wppa-setting-see-also.php +2 -2
- wppa-settings-autosave.php +43 -66
- wppa-setup.php +2 -2
- wppa-slideshow-widget.php +4 -4
- wppa-slideshow.php +2 -2
- wppa-statistics.php +7 -7
- wppa-thumbnails.php +1 -12
- wppa-tinymce-shortcodes.php +2 -2
- wppa-topten-widget.php +4 -4
- wppa-upldr-widget.php +2 -2
- wppa-upload-common.php +2 -2
- wppa-upload-widget.php +3 -3
- wppa-upload.php +4 -2
- wppa-users.php +16 -1
- wppa-utils.php +2 -2
- wppa-widget-functions.php +2 -2
- wppa-wpdb-update.php +6 -1
- wppa-wrappers.php +3 -1
- wppa.php +2 -2
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
|
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 '
|
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
|
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
|
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
|
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
|
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
|
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.
|
9 |
+
Admin page sizes are no longer in the settings page, but 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.
|
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 |
-
|
|
|
|
|
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(/</g,"<")).replace(/>/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(/</g,"<")).replace(/>/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(/</g,"<")).replace(/>/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(/>/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(/</g,"<")).replace(/>/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(/</g,"<")).replace(/>/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(/</g,"<")).replace(/>/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(/>/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)});
|
wppa-admin-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* gp admin functions
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -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> ';
|
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 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
|
|
991 |
|
992 |
-
|
993 |
-
|
994 |
-
|
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 |
-
|
1016 |
-
|
|
|
|
|
1017 |
}
|
1018 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1019 |
return $result;
|
1020 |
}
|
1021 |
|
@@ -1112,3 +1067,364 @@ 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.002
|
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' ), sanitize_text_field( $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' ), sanitize_text_field( $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', $return = false ) {
|
1079 |
+
|
1080 |
+
// Need pagination?
|
1081 |
+
if ( $total_items < '21' ) {
|
1082 |
+
return '';
|
1083 |
+
}
|
1084 |
+
|
1085 |
+
// Init
|
1086 |
+
$output = '';
|
1087 |
+
$link = $url . '&paged=';
|
1088 |
+
$total_pages = $pagesize ? ceil( $total_items / $pagesize ) : '1';
|
1089 |
+
|
1090 |
+
// Overall wrapper
|
1091 |
+
$st = $which == 'bottom' ? 'style="display:block"' : 'style="display:inline"';
|
1092 |
+
$output .= '
|
1093 |
+
<div class="tablenav" ' . $st . '>
|
1094 |
+
<div class="tablenav-pages wppa-admin-pagination">';
|
1095 |
+
|
1096 |
+
$output .= '
|
1097 |
+
<span class="displaying-num">' .
|
1098 |
+
sprintf(
|
1099 |
+
/* translators: %s: Number of items. */
|
1100 |
+
_n( '%s item', '%s items', $total_items ),
|
1101 |
+
number_format_i18n( $total_items ) ) . '
|
1102 |
+
</span>';
|
1103 |
+
|
1104 |
+
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
1105 |
+
$current_url = remove_query_arg( 'paged', $current_url );
|
1106 |
+
|
1107 |
+
$page_links = array();
|
1108 |
+
|
1109 |
+
$total_pages_before = '<span class="paging-input">';
|
1110 |
+
$total_pages_after = '</span></span>';
|
1111 |
+
|
1112 |
+
$disable_first = false;
|
1113 |
+
$disable_last = false;
|
1114 |
+
$disable_prev = false;
|
1115 |
+
$disable_next = false;
|
1116 |
+
|
1117 |
+
if ( 1 == $current ) {
|
1118 |
+
$disable_first = true;
|
1119 |
+
$disable_prev = true;
|
1120 |
+
}
|
1121 |
+
if ( $total_pages == $current ) {
|
1122 |
+
$disable_last = true;
|
1123 |
+
$disable_next = true;
|
1124 |
+
}
|
1125 |
+
|
1126 |
+
if ( $disable_first ) {
|
1127 |
+
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">«</span>';
|
1128 |
+
} else {
|
1129 |
+
$page_links[] = sprintf(
|
1130 |
+
"<a class='first-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
1131 |
+
esc_url( remove_query_arg( 'paged', $current_url ) ),
|
1132 |
+
__( 'First page' ),
|
1133 |
+
'«'
|
1134 |
+
);
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
if ( $disable_prev ) {
|
1138 |
+
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">‹</span>';
|
1139 |
+
} else {
|
1140 |
+
$page_links[] = sprintf(
|
1141 |
+
"<a class='prev-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
1142 |
+
esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),
|
1143 |
+
__( 'Previous page' ),
|
1144 |
+
'‹'
|
1145 |
+
);
|
1146 |
+
}
|
1147 |
+
|
1148 |
+
if ( 'bottom' === $which ) {
|
1149 |
+
$html_current_page = $current;
|
1150 |
+
$total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">';
|
1151 |
+
} else {
|
1152 |
+
$html_current_page = sprintf(
|
1153 |
+
"%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'>",
|
1154 |
+
'<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
|
1155 |
+
$current,
|
1156 |
+
strlen( $total_pages )
|
1157 |
+
);
|
1158 |
+
}
|
1159 |
+
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
|
1160 |
+
$page_links[] = $total_pages_before . sprintf(
|
1161 |
+
/* translators: 1: Current page, 2: Total pages. */
|
1162 |
+
_x( '%1$s of %2$s', 'paging' ),
|
1163 |
+
$html_current_page,
|
1164 |
+
$html_total_pages
|
1165 |
+
) . $total_pages_after;
|
1166 |
+
|
1167 |
+
if ( $disable_next ) {
|
1168 |
+
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">›</span>';
|
1169 |
+
} else {
|
1170 |
+
$page_links[] = sprintf(
|
1171 |
+
"<a class='next-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
1172 |
+
esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),
|
1173 |
+
__( 'Next page' ),
|
1174 |
+
'›'
|
1175 |
+
);
|
1176 |
+
}
|
1177 |
+
|
1178 |
+
if ( $disable_last ) {
|
1179 |
+
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">»</span>';
|
1180 |
+
} else {
|
1181 |
+
$page_links[] = sprintf(
|
1182 |
+
"<a class='last-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
1183 |
+
esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
|
1184 |
+
__( 'Last page' ),
|
1185 |
+
'»'
|
1186 |
+
);
|
1187 |
+
}
|
1188 |
+
|
1189 |
+
$pagination_links_class = 'pagination-links';
|
1190 |
+
$output .= "\n<span class='$pagination_links_class'>" . implode( "\n", $page_links ) . '</span>';
|
1191 |
+
|
1192 |
+
if ( $total_pages ) {
|
1193 |
+
$page_class = $total_pages < 2 ? ' one-page' : '';
|
1194 |
+
} else {
|
1195 |
+
$page_class = ' no-pages';
|
1196 |
+
}
|
1197 |
+
|
1198 |
+
|
1199 |
+
// The pagesize selectionbox
|
1200 |
+
if ( $which == 'top' ) {
|
1201 |
+
$output .= ' ' .
|
1202 |
+
__( 'Pagesize', 'wp-photo-album-plus' ) . '
|
1203 |
+
<select onchange="jQuery( \'#wppa-admin-spinner\' ).show();document.location.href=\''.$link.'1&wppa-pagesize=\'+this.value;">
|
1204 |
+
<option value="20"' . ( $pagesize == '20' ? ' selected' : '' ) . '>20</option>
|
1205 |
+
<option value="50"' . ( $pagesize == '50' ? ' selected' : '' ) . '>50</option>
|
1206 |
+
<option value="100"' . ( $pagesize == '100' ? ' selected' : '' ) . '>100</option>
|
1207 |
+
<option value="200"' . ( $pagesize == '200' ? ' selected' : '' ) . '>200</option>
|
1208 |
+
<option value="500"' . ( $pagesize == '500' ? ' selected' : '' ) . '>500</option>
|
1209 |
+
<option value="1000"' . ( $pagesize == '1000' ? ' selected' : '' ) . '>1000</option>
|
1210 |
+
</select>';
|
1211 |
+
}
|
1212 |
+
|
1213 |
+
// Close overall wrapper
|
1214 |
+
$output .= '</div></div>';
|
1215 |
+
|
1216 |
+
// Done
|
1217 |
+
if ( $return ) {
|
1218 |
+
return $output;
|
1219 |
+
}
|
1220 |
+
else {
|
1221 |
+
wppa_echo( $output );
|
1222 |
+
}
|
1223 |
+
}
|
1224 |
+
|
1225 |
+
// Get paging parameters
|
1226 |
+
function wppa_get_paging_parms( $slug, $save = true ) {
|
1227 |
+
|
1228 |
+
// Init
|
1229 |
+
$result = array();
|
1230 |
+
$defdesc = false;;
|
1231 |
+
|
1232 |
+
/* Order by */
|
1233 |
+
switch( $slug ) {
|
1234 |
+
case 'edit_email':
|
1235 |
+
|
1236 |
+
// Default
|
1237 |
+
$result['order'] = 'ID';
|
1238 |
+
|
1239 |
+
// Query arg?
|
1240 |
+
$order_new = wppa_get( 'order-by', '', 'text' );
|
1241 |
+
if ( in_array( $order_new, ['ID','user_login', 'display_name'] ) ) {
|
1242 |
+
$result['order'] = $order_new;
|
1243 |
+
$new = true;
|
1244 |
+
}
|
1245 |
+
else {
|
1246 |
+
$new = false;
|
1247 |
+
}
|
1248 |
+
break;
|
1249 |
+
|
1250 |
+
case 'album_admin':
|
1251 |
+
|
1252 |
+
// Default
|
1253 |
+
$result['order'] = 'id';
|
1254 |
+
|
1255 |
+
// Query arg?
|
1256 |
+
$order_new = wppa_get( 'order-by', '', 'text' );
|
1257 |
+
if ( in_array( $order_new, ['id','name','description','owner','a_order','a_parent'] ) ) {
|
1258 |
+
$result['order'] = $order_new;
|
1259 |
+
$new = true;
|
1260 |
+
}
|
1261 |
+
else {
|
1262 |
+
$new = false;
|
1263 |
+
}
|
1264 |
+
break;
|
1265 |
+
|
1266 |
+
case 'comment_admin':
|
1267 |
+
|
1268 |
+
// Default
|
1269 |
+
$result['order'] = 'timestamp';
|
1270 |
+
|
1271 |
+
// Query arg?
|
1272 |
+
$order_new = wppa_get( 'order-by', '', 'text' );
|
1273 |
+
if ( in_array( $order_new, ['id','timestamp','photo','user'] ) ) {
|
1274 |
+
$result['order'] = $order_new;
|
1275 |
+
$new = true;
|
1276 |
+
}
|
1277 |
+
else {
|
1278 |
+
$new = false;
|
1279 |
+
}
|
1280 |
+
break;
|
1281 |
+
|
1282 |
+
case 'photo_admin':
|
1283 |
+
case 'photo_quick':
|
1284 |
+
case 'photo_bulk':
|
1285 |
+
|
1286 |
+
// Default
|
1287 |
+
$result['order'] = '';
|
1288 |
+
$new = true;
|
1289 |
+
break;
|
1290 |
+
|
1291 |
+
default:
|
1292 |
+
|
1293 |
+
// Should never get here
|
1294 |
+
wppa_log( 'err', 'Unimplemented slug in wppa_get_paging_parms(): ' . $slug);
|
1295 |
+
$result['order'] = false;
|
1296 |
+
$new = true;
|
1297 |
+
}
|
1298 |
+
|
1299 |
+
// Used before?
|
1300 |
+
if ( ! $new ) {
|
1301 |
+
$order_old = get_transient( 'wppa_' . $slug . '_seq-' . wppa_get_user() );
|
1302 |
+
if ( $order_old ) {
|
1303 |
+
$result['order'] = $order_old;
|
1304 |
+
}
|
1305 |
+
}
|
1306 |
+
|
1307 |
+
// Save ?
|
1308 |
+
if ( $save && $result['order'] ) {
|
1309 |
+
set_transient( 'wppa_' . $slug . '_seq-' . wppa_get_user(), $result['order'] );
|
1310 |
+
}
|
1311 |
+
|
1312 |
+
/* dir */
|
1313 |
+
$result['dir'] = $defdesc ? 'DESC' : 'ASC';
|
1314 |
+
|
1315 |
+
// Query arg?
|
1316 |
+
$dir_new = wppa_get( 'dir', '', 'text' );
|
1317 |
+
if ( in_array( $dir_new, ['ASC', 'DESC'] ) ) {
|
1318 |
+
$result['dir'] = $dir_new;
|
1319 |
+
}
|
1320 |
+
|
1321 |
+
// Used before?
|
1322 |
+
elseif ( get_transient( 'wppa_' . $slug . '_dir-' . wppa_get_user() ) == 'DESC' ) {
|
1323 |
+
$result['dir'] = 'DESC';
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
// Save ?
|
1327 |
+
if ( $save && $result['order'] ) {
|
1328 |
+
set_transient( 'wppa_' . $slug . '_dir-' . wppa_get_user(), $result['dir'] );
|
1329 |
+
}
|
1330 |
+
|
1331 |
+
/* Page */
|
1332 |
+
$result['page'] = wppa_get( 'paged', '', 'int' );
|
1333 |
+
|
1334 |
+
// Used before?
|
1335 |
+
// if ( ! wppa_is_int( $result['page'] ) ) {
|
1336 |
+
// $result['page'] = get_transient( 'wppa_' . $slug . '_page-' . wppa_get_user() );
|
1337 |
+
// }
|
1338 |
+
|
1339 |
+
// Nothing yet?
|
1340 |
+
if ( ! $result['page'] ) {
|
1341 |
+
$result['page'] = '1';
|
1342 |
+
}
|
1343 |
+
|
1344 |
+
// Save ?
|
1345 |
+
// if ( $save ) {
|
1346 |
+
// set_transient( 'wppa_' . $slug . '_page-' . wppa_get_user(), $result['page'] );
|
1347 |
+
// }
|
1348 |
+
|
1349 |
+
/* Pagesize */
|
1350 |
+
$result['pagesize'] = wppa_get( 'wppa-pagesize', '', 'int' );
|
1351 |
+
|
1352 |
+
// Used before?
|
1353 |
+
if ( ! wppa_is_int( $result['pagesize'] ) ) {
|
1354 |
+
$result['pagesize'] = get_transient( 'wppa_' . $slug . '_pagesize-' . wppa_get_user() );
|
1355 |
+
}
|
1356 |
+
|
1357 |
+
// Nothing yet?
|
1358 |
+
if ( ! $result['pagesize'] ) {
|
1359 |
+
$result['pagesize'] = '20';
|
1360 |
+
}
|
1361 |
+
|
1362 |
+
// Save ?
|
1363 |
+
if ( $save ) {
|
1364 |
+
set_transient( 'wppa_' . $slug . '_pagesize-' . wppa_get_user(), $result['pagesize'] );
|
1365 |
+
}
|
1366 |
+
|
1367 |
+
return $result;
|
1368 |
+
}
|
1369 |
+
|
1370 |
+
// Get admin page reload url
|
1371 |
+
// arg1: string. where slug
|
1372 |
+
// arg2: string. a vailt order column
|
1373 |
+
function wppa_admin_reload_url( $slug, $for ) {
|
1374 |
+
|
1375 |
+
// Init
|
1376 |
+
$err = false;
|
1377 |
+
|
1378 |
+
// Validate args
|
1379 |
+
switch( $slug ) {
|
1380 |
+
case 'edit_email':
|
1381 |
+
if ( ! in_array( $for, ['ID', 'user_login', 'display_name'] ) ) {
|
1382 |
+
$err = true;
|
1383 |
+
}
|
1384 |
+
break;
|
1385 |
+
case 'album_admin':
|
1386 |
+
if ( ! in_array( $for, ['id', 'name', 'description', 'owner', 'a_order', 'a_parent'] ) ) {
|
1387 |
+
$err = true;
|
1388 |
+
}
|
1389 |
+
break;
|
1390 |
+
default:
|
1391 |
+
$err = true;
|
1392 |
+
}
|
1393 |
+
|
1394 |
+
if ( $err ) {
|
1395 |
+
wppa_log( 'err', 'Invalid for in wppa_admin_reload_url('.$slug.','.$for.')');
|
1396 |
+
return '';
|
1397 |
+
}
|
1398 |
+
|
1399 |
+
// Do it
|
1400 |
+
$parms = wppa_get_paging_parms( $slug, false );
|
1401 |
+
if ( $for == $parms['order'] ) {
|
1402 |
+
if ( $parms['dir'] == 'ASC' ) {
|
1403 |
+
$dir = 'DESC';
|
1404 |
+
}
|
1405 |
+
else {
|
1406 |
+
$dir = 'ASC';
|
1407 |
+
}
|
1408 |
+
$page = $parms['page'];
|
1409 |
+
}
|
1410 |
+
else {
|
1411 |
+
$dir = 'ASC';
|
1412 |
+
$page = '1';
|
1413 |
+
}
|
1414 |
+
|
1415 |
+
switch( $slug ) {
|
1416 |
+
|
1417 |
+
case 'edit_email':
|
1418 |
+
$url = get_admin_url() . 'admin.php?page=wppa_edit_email&wppa-order-by=' . $for . '&wppa-dir=' . $dir . '&paged=' . $page;
|
1419 |
+
break;
|
1420 |
+
|
1421 |
+
case 'album_admin':
|
1422 |
+
$url = get_admin_url() . 'admin.php?page=wppa_admin_menu&wppa-order-by=' . $for . '&wppa-dir=' . $dir . '&paged=' . $page;
|
1423 |
+
break;
|
1424 |
+
|
1425 |
+
default:
|
1426 |
+
$url = '';
|
1427 |
+
}
|
1428 |
+
|
1429 |
+
return $url;
|
1430 |
+
}
|
wppa-admin-styles.css
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
/* admin-styles.css
|
2 |
*
|
3 |
* wp-photo-album-plus
|
4 |
-
* version 8.
|
5 |
*/
|
6 |
#files_list, #files_list2
|
7 |
{
|
@@ -81,7 +81,7 @@ ul.wppa_nav
|
|
81 |
}
|
82 |
|
83 |
.wppa-table-wrap {
|
84 |
-
border:1px solid #ccc;
|
85 |
position:relative;
|
86 |
}
|
87 |
.wppa-table {
|
@@ -119,7 +119,11 @@ ul.wppa_nav
|
|
119 |
}
|
120 |
.wppa-table input {
|
121 |
height: 20px !important;
|
122 |
-
padding:
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
164 |
}
|
165 |
|
166 |
.photoitem .deletelink
|
@@ -194,6 +202,14 @@ ul.wppa_nav
|
|
194 |
float: right;
|
195 |
}
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
tt {
|
198 |
font-weight: bold;
|
199 |
font-family: Consolas,Monaco,"Courier New",Courier,monospace;
|
@@ -650,43 +666,19 @@ details.hidden {
|
|
650 |
}
|
651 |
|
652 |
#wppa-action-container {
|
653 |
-
|
654 |
-
|
655 |
-
flex-flow: row wrap;
|
656 |
-
justify-content: space-between;
|
657 |
}
|
658 |
|
659 |
-
#wppa-action-container
|
660 |
-
|
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
|
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.001
|
5 |
*/
|
6 |
#files_list, #files_list2
|
7 |
{
|
81 |
}
|
82 |
|
83 |
.wppa-table-wrap {
|
84 |
+
/* border:1px solid #ccc; */
|
85 |
position:relative;
|
86 |
}
|
87 |
.wppa-table {
|
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
|
202 |
float: right;
|
203 |
}
|
204 |
|
205 |
+
.wppa-admin-pagination {
|
206 |
+
display:block;
|
207 |
+
height:32px;
|
208 |
+
line-height:1.7em;
|
209 |
+
margin:12px 0;
|
210 |
+
float:right;
|
211 |
+
}
|
212 |
+
|
213 |
tt {
|
214 |
font-weight: bold;
|
215 |
font-family: Consolas,Monaco,"Courier New",Courier,monospace;
|
666 |
}
|
667 |
|
668 |
#wppa-action-container {
|
669 |
+
display: inline-block;
|
670 |
+
margin-bottom: 9px;
|
|
|
|
|
671 |
}
|
672 |
|
673 |
+
#wppa-action-container input,
|
674 |
+
#wppa-action-container select {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
675 |
margin-right: 8px;
|
676 |
}
|
677 |
|
678 |
+
#wppa-action-container input:last-of-type {
|
679 |
margin-right: 0;
|
680 |
}
|
681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
.wppa-tabcontent {
|
683 |
min-height: 530px;
|
684 |
}
|
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.
|
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">'
|
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">'
|
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">'.
|
54 |
|
|
|
55 |
$icon_url = WPPA_URL . '/img/camera16.png';
|
56 |
|
57 |
-
//
|
58 |
-
add_menu_page( 'WP Photo Album',
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
-
|
68 |
-
|
69 |
-
add_submenu_page( 'wppa_admin_menu',
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
if ( wppa_switch( 'show_comments' ) ) {
|
72 |
-
add_submenu_page( 'wppa_admin_menu',
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
if ( wppa_switch( 'opt_menu_search' ) ) {
|
75 |
-
add_submenu_page( 'wppa_admin_menu',
|
|
|
|
|
|
|
|
|
|
|
76 |
}
|
|
|
|
|
77 |
if ( wppa_switch( 'opt_menu_edit_tags' ) ) {
|
78 |
-
add_submenu_page( 'wppa_admin_menu',
|
|
|
|
|
|
|
|
|
|
|
79 |
}
|
|
|
|
|
80 |
if ( wppa_switch( 'opt_menu_edit_sequence' ) ) {
|
81 |
-
add_submenu_page( 'wppa_admin_menu',
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
|
|
|
|
83 |
if ( wppa_switch( 'opt_menu_edit_email' ) ) {
|
84 |
-
add_submenu_page( 'wppa_admin_menu',
|
|
|
|
|
|
|
|
|
|
|
85 |
}
|
|
|
|
|
86 |
if ( wppa_switch( 'opt_menu_doc' ) ) {
|
87 |
-
add_submenu_page( 'wppa_admin_menu',
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
|
|
|
|
89 |
if ( wppa_switch( 'logfile_on_menu' ) ) {
|
90 |
-
add_submenu_page( 'wppa_admin_menu',
|
|
|
|
|
|
|
|
|
|
|
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',
|
|
|
|
|
|
|
|
|
|
|
96 |
}
|
97 |
|
98 |
/* ADMIN STYLES */
|
@@ -205,6 +314,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 +322,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 +330,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 +347,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 +376,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 +396,7 @@ function wppa_page_help() {
|
|
282 |
}
|
283 |
|
284 |
// Edit tags
|
285 |
-
function
|
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.002
|
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 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 */
|
314 |
wppa_publish_scheduled();
|
315 |
_wppa_admin();
|
316 |
}
|
317 |
+
|
318 |
// Upload admin page
|
319 |
function wppa_page_upload() {
|
320 |
if ( wppa_is_user_blacklisted() ) wp_die(__( 'Uploading is temporary disabled for you' , 'wp-photo-album-plus' ) );
|
322 |
require_once 'wppa-upload.php';
|
323 |
_wppa_page_upload();
|
324 |
}
|
325 |
+
|
326 |
// Edit photo(s)
|
327 |
function wppa_edit_photo() {
|
328 |
if ( wppa_is_user_blacklisted() ) wp_die(__( 'Editing is temporary disabled for you' , 'wp-photo-album-plus' ) );
|
330 |
wppa_publish_scheduled();
|
331 |
_wppa_edit_photo();
|
332 |
}
|
333 |
+
|
334 |
// Import admin page
|
335 |
function wppa_page_import() {
|
336 |
|
347 |
require_once 'wppa-import.php';
|
348 |
_wppa_page_import();
|
349 |
}
|
350 |
+
|
351 |
// Moderate admin page
|
352 |
function wppa_page_moderate() {
|
353 |
require_once 'wppa-photo-admin-autosave.php';
|
376 |
}
|
377 |
// Comments admin page
|
378 |
function wppa_comment_admin() {
|
379 |
+
require_once 'wppa-listtable.php';
|
380 |
require_once 'wppa-comment-admin.php';
|
381 |
_wppa_comment_admin();
|
382 |
}
|
396 |
}
|
397 |
|
398 |
// Edit tags
|
399 |
+
function wppa_edit_tags() {
|
400 |
require_once 'wppa-edit-tags.php';
|
401 |
_wppa_edit_tags();
|
402 |
}
|
wppa-adminbar.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* enhances the admin bar with wppa+ menu
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -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' => __( '
|
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
|
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
|
54 |
'href' => admin_url( 'admin.php?page=wppa_edit_photo' )
|
55 |
);
|
56 |
}
|
@@ -58,21 +58,21 @@ function wppa_admin_bar_menu() {
|
|
58 |
if ( current_user_can( 'wppa_import' ) ) {
|
59 |
$menu_items['import'] = array(
|
60 |
'parent' => $wppaplus,
|
61 |
-
'title' => __( 'Import
|
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
|
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
|
76 |
'href' => admin_url( 'admin.php?page=wppa_export_photos' )
|
77 |
);
|
78 |
}
|
@@ -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' => __( '
|
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' => __( '
|
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
|
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.001
|
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_moderate' ) ) {
|
66 |
$menu_items['moderate'] = array(
|
67 |
'parent' => $wppaplus,
|
68 |
+
'title' => __( 'Moderate', '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', 'wp-photo-album-plus' ),
|
76 |
'href' => admin_url( 'admin.php?page=wppa_export_photos' )
|
77 |
);
|
78 |
}
|
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.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -1749,7 +1749,7 @@ global $wppa;
|
|
1749 |
}
|
1750 |
}
|
1751 |
else {
|
1752 |
-
wppa_echo( '||0||' . __( 'No
|
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 = __( '
|
1852 |
break;
|
1853 |
|
1854 |
case 'year':
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 8.3.01.001
|
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':
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -97,27 +97,31 @@ global $wppa_revno;
|
|
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 |
-
|
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
|
121 |
return;
|
122 |
}
|
123 |
}
|
@@ -126,9 +130,9 @@ global $wppa_revno;
|
|
126 |
// Edit single photo
|
127 |
if ( wppa_get( 'edit-id' ) == 'single' ) {
|
128 |
|
129 |
-
$
|
130 |
|
131 |
-
wppa_echo( '<div class="wrap" ><
|
132 |
wppa_album_photos( $ei );
|
133 |
wppa_echo( '</div>' );
|
134 |
return;
|
@@ -137,30 +141,35 @@ global $wppa_revno;
|
|
137 |
// Edit by search token
|
138 |
if ( wppa_get( 'edit-id' ) == 'search' ) {
|
139 |
|
140 |
-
$
|
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 |
-
<
|
151 |
-
__( 'Manage Photos', 'wp-photo-album-plus' ) . ' - <small><i>' . $task . '</i></small>
|
152 |
-
</h2>' .
|
153 |
-
$back_link_html . '
|
154 |
-
<br><br>' );
|
155 |
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
-
|
|
|
164 |
return;
|
165 |
}
|
166 |
|
@@ -169,7 +178,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><
|
173 |
if ( wppa_get( 'bulk' ) ) {
|
174 |
wppa_album_photos_bulk( $ei );
|
175 |
}
|
@@ -189,7 +198,7 @@ global $wppa_revno;
|
|
189 |
}
|
190 |
$id = wppa_nextkey( WPPA_ALBUMS );
|
191 |
|
192 |
-
// Creating a
|
193 |
if ( wppa_get( 'parent_id' ) ) {
|
194 |
$parent = wppa_get( 'parent_id' );
|
195 |
$name = wppa_get_album_name( $parent ) . '-#' . $id;
|
@@ -210,7 +219,7 @@ global $wppa_revno;
|
|
210 |
wppa_update_option( 'wppa_default_parent', '0' );
|
211 |
$parent = '0';
|
212 |
}
|
213 |
-
$name = __( 'New
|
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 |
}
|
@@ -448,7 +457,7 @@ global $wppa_revno;
|
|
448 |
$the_js = '
|
449 |
function wppaTryInheritCats( id ) {
|
450 |
|
451 |
-
var query = "' . esc_js( __( 'Are you sure you want to inherit categories to all (sub-)
|
452 |
if ( confirm( query ) ) {
|
453 |
wppaAjaxUpdateAlbum( id, \'inherit_cats\', Math.random() );
|
454 |
}
|
@@ -456,7 +465,7 @@ global $wppa_revno;
|
|
456 |
|
457 |
function wppaTryAddCats( id ) {
|
458 |
|
459 |
-
var query = "' . esc_js( __( 'Are you sure you want to add the categories to all (sub-)
|
460 |
if ( confirm( query ) ) {
|
461 |
wppaAjaxUpdateAlbum( id, \'inhadd_cats\', Math.random() );
|
462 |
}
|
@@ -557,14 +566,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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
561 |
|
562 |
wppa_echo( $back_link_html );
|
563 |
|
564 |
/* Start header buttons */
|
565 |
-
|
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 +599,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 |
-
|
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 +614,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 |
-
|
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 |
-
|
610 |
-
|
611 |
<input
|
612 |
type="button"
|
613 |
class="wppa-admin-button button"
|
@@ -619,11 +638,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 |
-
|
626 |
-
|
|
|
|
|
627 |
/* End header */
|
628 |
|
629 |
/* Main body album admin */
|
@@ -780,7 +800,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
780 |
wppa_echo( '
|
781 |
<div class="left">
|
782 |
<label>' .
|
783 |
-
__( 'Inc
|
784 |
</label><br>
|
785 |
<div class="wppa-ldi">' .
|
786 |
$tpviews . '
|
@@ -887,7 +907,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
|
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 +1094,12 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1074 |
style="max-width: 200px;margin-right: 4px;">
|
1075 |
<label
|
1076 |
for="altthumb">' .
|
1077 |
-
__( 'Max
|
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
|
1083 |
>
|
1084 |
<option value="0"' . ( $val == '0' ? $sel : '' ) . ' >' .
|
1085 |
__( 'unlimited', 'wp-photo-album-plus' ) . '
|
@@ -1159,8 +1179,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-)
|
1163 |
-
__( 'This setting overrules all other limits that may apply to this album or its (sub-)
|
1164 |
__( '0 means no limit.', 'wp-photo-album-plus' );
|
1165 |
wppa_echo( '
|
1166 |
<div class="left">
|
@@ -1411,17 +1431,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
|
1415 |
if ( wppa_can_create_album() ) {
|
1416 |
$url = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&parent_id=' . $albuminfo['id'] . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
|
1417 |
-
$onc = 'if (confirm(\''.__( 'Are you sure you want to create a
|
1418 |
|
1419 |
wppa_echo( '
|
1420 |
<input
|
1421 |
type="button"
|
1422 |
class="wppa-admin-button button"
|
1423 |
onclick="' . $onc . '"
|
1424 |
-
value="' . esc_attr( __( 'Create
|
1425 |
/>' );
|
1426 |
}
|
1427 |
|
@@ -1436,7 +1456,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
1436 |
'&parent_id=' . $albuminfo['a_parent'] .
|
1437 |
'&is-sibling-of=' . $albuminfo['id'] .
|
1438 |
'&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
|
1439 |
-
$onc = 'if (confirm(\''.__( 'Are you sure you want to create a
|
1440 |
|
1441 |
wppa_echo( '
|
1442 |
<input
|
@@ -1466,20 +1486,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-)
|
1470 |
onclick="wppaTryInheritCats( ' . $id . ' )"
|
1471 |
-
value="' . esc_attr( __( 'Apply Cats to
|
1472 |
/>
|
1473 |
<input
|
1474 |
type="button"
|
1475 |
class="wppa-admin-button button"
|
1476 |
-
title="' . esc_attr( __( 'Add categories to all (sub-)
|
1477 |
onclick="wppaTryAddCats( ' . $id . ' )"
|
1478 |
-
value="' . esc_attr( __( 'Add Cats to
|
1479 |
/>' );
|
1480 |
}
|
1481 |
|
1482 |
-
//
|
1483 |
if ( $has_children ) {
|
1484 |
wppa_album_sequence( $edit_id );
|
1485 |
}
|
@@ -1789,8 +1809,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
|
1793 |
-
<option value="albums"' . ( $lt == 'albums' ? $sel : '' ) . ' >' . __( 'the
|
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>
|
@@ -2076,7 +2096,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2076 |
wppa_echo( '
|
2077 |
<div class="wppa-table-wrap" style="margin-top:20px;clear:both;position:relative;">' );
|
2078 |
|
2079 |
-
|
2080 |
|
2081 |
if ( wppa_get( 'bulk' ) )
|
2082 |
$result = __( 'Copy / move / delete / edit name / edit description / change status', 'wp-photo-album-plus' );
|
@@ -2092,9 +2112,9 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2092 |
else $result = '';
|
2093 |
|
2094 |
$result .= '
|
2095 |
-
</h2>
|
2096 |
-
|
2097 |
-
wppa_echo( $result );
|
2098 |
|
2099 |
if ( wppa_get( 'bulk' ) )
|
2100 |
wppa_album_photos_bulk( $edit_id );
|
@@ -2125,9 +2145,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 |
-
<
|
2129 |
-
|
2130 |
-
|
2131 |
wppa_album_photos( '', $photo ) . '
|
2132 |
</div>';
|
2133 |
wppa_echo( $result );
|
@@ -2145,7 +2165,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
|
2149 |
__( 'Moderate photo', 'wp-photo-album-plus' ) :
|
2150 |
__( 'Edit photo', 'wp-photo-album-plus' ) ) . '
|
2151 |
</h1>
|
@@ -2169,8 +2189,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2169 |
|
2170 |
$result = '
|
2171 |
<div class="wrap">
|
2172 |
-
<
|
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>' .
|
@@ -2260,7 +2279,7 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2260 |
wppa_echo( '
|
2261 |
<div class="wrap">' .
|
2262 |
wppa_admin_spinner() . '
|
2263 |
-
<h1 class="wp-heading-inline">' .
|
2264 |
|
2265 |
// The Create new album button
|
2266 |
if ( wppa_can_create_top_album() ) {
|
@@ -2273,38 +2292,38 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2273 |
class="page-title-action">' .
|
2274 |
__( 'Add New', 'wp-photo-album-plus' ) . '
|
2275 |
</a>
|
2276 |
-
|
2277 |
}
|
2278 |
|
2279 |
/* The header buttons / sewlection boxes */
|
2280 |
{
|
2281 |
-
|
2282 |
-
<div
|
2283 |
-
<div id="wppa-action-container
|
2284 |
|
2285 |
// The switch to flat/collapsable button(s)
|
2286 |
if ( $style == 'flat' ) {
|
2287 |
-
|
2288 |
<input
|
2289 |
type="button"
|
2290 |
class="button"
|
2291 |
onclick="document.location=\'' . get_admin_url() . 'admin.php?page=wppa_admin_menu&switchto=collapsible\'"
|
2292 |
value="' . esc_attr__( 'Switch to Collapsable table', 'wp-photo-album-plus' ) . '"
|
2293 |
-
/>'
|
2294 |
}
|
2295 |
else {
|
2296 |
-
|
2297 |
<input
|
2298 |
type="button"
|
2299 |
class="button"
|
2300 |
onclick="document.location=\'' . get_admin_url() . 'admin.php?page=wppa_admin_menu&switchto=flat\'"
|
2301 |
value="' . esc_attr__( 'Switch to Flat table', 'wp-photo-album-plus' ) . '"
|
2302 |
-
/>'
|
2303 |
}
|
2304 |
|
2305 |
// The open all/close all buttons
|
2306 |
if ( $style != 'flat' ) {
|
2307 |
-
|
2308 |
<input
|
2309 |
type="button"
|
2310 |
class="button"
|
@@ -2328,16 +2347,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 |
-
|
2341 |
<input
|
2342 |
id="wppa-edit-albid"
|
2343 |
type="number"
|
@@ -2345,7 +2360,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,50 +2369,51 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2354 |
unset( $albids[$key] );
|
2355 |
}
|
2356 |
}
|
2357 |
-
|
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 |
-
|
2366 |
}
|
2367 |
-
|
2368 |
-
</select>'
|
2369 |
}
|
2370 |
-
|
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 |
-
|
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 |
-
|
2389 |
}
|
2390 |
-
|
2391 |
</select>
|
2392 |
<input
|
2393 |
type="button"
|
2394 |
class="button"
|
2395 |
onclick="wppaGoApplyFilter();"
|
2396 |
value="' . __( 'Apply filter', 'wp-photo-album-plus' ) . '"
|
2397 |
-
/>'
|
2398 |
-
|
2399 |
</div>
|
2400 |
-
|
|
|
2401 |
/* End header buttons / seecion boxes */
|
2402 |
}
|
2403 |
|
@@ -2444,39 +2460,17 @@ jQuery(document).ready(function(){wppaGetCoverPreview( '.$id.', "cover-preview-"
|
|
2444 |
function wppa_admin_albums_flat() {
|
2445 |
global $wpdb;
|
2446 |
|
2447 |
-
//
|
2448 |
-
$
|
2449 |
-
|
|
|
|
|
2450 |
$skips = ( $page - 1 ) * $pagesize;
|
|
|
|
|
2451 |
|
2452 |
// Read all albums, pre-ordered
|
2453 |
-
$
|
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 +2485,7 @@ global $wpdb;
|
|
2491 |
$filter = wppa_get( 'filter' );
|
2492 |
|
2493 |
if ( $filter ) {
|
2494 |
-
$filter_albs = $wpdb->get_var( $wpdb->prepare( "SELECT albums FROM
|
2495 |
$filter_albs = wppa_index_string_to_array( $filter_albs );
|
2496 |
|
2497 |
foreach( array_keys( $albums ) as $key ) {
|
@@ -2501,7 +2495,8 @@ global $wpdb;
|
|
2501 |
}
|
2502 |
}
|
2503 |
|
2504 |
-
|
|
|
2505 |
|
2506 |
// If paging: Make new array with selected albums only
|
2507 |
if ( $pagesize ) {
|
@@ -2516,133 +2511,74 @@ global $wpdb;
|
|
2516 |
}
|
2517 |
}
|
2518 |
|
2519 |
-
//
|
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 = $
|
2586 |
$show_nl = wppa_opt( 'user_create_max_level' ) != '99';
|
2587 |
-
$
|
|
|
2588 |
|
2589 |
-
|
|
|
|
|
|
|
|
|
2590 |
<table
|
2591 |
class="wppa-table widefat wppa-setting-table striped"
|
2592 |
-
style="margin
|
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 |
-
|
2603 |
-
|
2604 |
-
|
2605 |
-
</a>
|
2606 |
</td>
|
2607 |
<td
|
2608 |
-
style="min-width: 120px;"
|
2609 |
-
|
2610 |
-
|
2611 |
-
|
2612 |
-
|
2613 |
-
</a>
|
2614 |
</td>
|
2615 |
-
<td
|
2616 |
-
|
2617 |
-
|
2618 |
-
|
2619 |
-
|
|
|
2620 |
</td>';
|
2621 |
if ( current_user_can( 'administrator' ) ) {
|
2622 |
$thead_body .= '
|
2623 |
-
<td
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
</td>';
|
2629 |
}
|
2630 |
$thead_body .= '
|
2631 |
<td
|
2632 |
-
style="min-width: 100px;"
|
2633 |
-
|
2634 |
-
|
2635 |
-
|
2636 |
-
|
2637 |
-
</a>
|
2638 |
</td>
|
2639 |
<td
|
2640 |
-
style="width: 120px;"
|
2641 |
-
|
2642 |
-
|
2643 |
-
|
2644 |
-
|
2645 |
-
</a>
|
2646 |
</td>
|
2647 |
<td
|
2648 |
title="' . esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) . '"
|
@@ -2671,8 +2607,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 |
-
|
2676 |
$id = $album['id'];
|
2677 |
$counts = wppa_get_treecounts_a( $id, true );
|
2678 |
$url = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=' . $id;
|
@@ -2688,7 +2624,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&tab=edit&edit-id=new&parent_id=' . $id . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
|
2691 |
-
$creonc = 'if (confirm(\''.esc_js(__( 'Are you sure you want to create a
|
2692 |
|
2693 |
$result .= '
|
2694 |
<tr ' . $alt . ( $pendcount ? 'style="background-color:#ffdddd"' : '' ) . '>
|
@@ -2733,15 +2669,16 @@ 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 +2687,17 @@ global $wpdb;
|
|
2750 |
function wppa_admin_albums_collapsible() {
|
2751 |
global $wpdb;
|
2752 |
|
2753 |
-
//
|
2754 |
-
$
|
2755 |
-
|
|
|
|
|
2756 |
$skips = ( $page - 1 ) * $pagesize;
|
2757 |
-
$
|
|
|
2758 |
|
2759 |
// Read all albums, pre-ordered
|
2760 |
-
$
|
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,9 +2707,25 @@ global $wpdb;
|
|
2792 |
$albums[] = $temp[$idx];
|
2793 |
}
|
2794 |
}
|
2795 |
-
$count = count( $albums );
|
2796 |
|
2797 |
-
// If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2798 |
if ( $pagesize ) {
|
2799 |
$temp = $albums;
|
2800 |
$albums = array();
|
@@ -2843,31 +2774,13 @@ 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 ( $
|
2871 |
case 'name':
|
2872 |
$seq[] = strtolower( __( stripslashes( $album['name'] ) ) );
|
2873 |
break;
|
@@ -2896,7 +2809,7 @@ global $wpdb;
|
|
2896 |
else asort( $seq, SORT_REGULAR );
|
2897 |
|
2898 |
// Reverse ?
|
2899 |
-
if ( $
|
2900 |
$t = $seq;
|
2901 |
$c = count($t);
|
2902 |
$tmp = array_keys($t);
|
@@ -2908,67 +2821,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 = $
|
2912 |
-
$
|
|
|
|
|
2913 |
|
2914 |
-
|
2915 |
-
|
|
|
|
|
|
|
|
|
2916 |
<thead>';
|
2917 |
$thead_body = '
|
2918 |
<tr>
|
2919 |
-
<td
|
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 |
-
|
2929 |
-
|
2930 |
-
|
2931 |
-
</a>
|
2932 |
</td>
|
2933 |
<td
|
2934 |
-
style="min-width: 120px;"
|
2935 |
-
|
2936 |
-
|
2937 |
-
|
2938 |
-
|
2939 |
-
</a>
|
2940 |
</td>
|
2941 |
-
<td
|
2942 |
-
|
2943 |
-
|
2944 |
-
|
2945 |
-
|
|
|
2946 |
</td>';
|
2947 |
if ( current_user_can( 'administrator' ) ) {
|
2948 |
$thead_body .= '
|
2949 |
-
<td
|
2950 |
-
|
2951 |
-
|
2952 |
-
|
2953 |
-
|
2954 |
</td>';
|
2955 |
}
|
2956 |
$thead_body .= '
|
2957 |
<td
|
2958 |
-
style="min-width: 100px;"
|
2959 |
-
|
2960 |
-
|
2961 |
-
|
2962 |
-
|
2963 |
-
</a>
|
2964 |
</td>
|
2965 |
<td
|
2966 |
-
style="width: 120px;"
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
</a>
|
2972 |
</td>
|
2973 |
<td
|
2974 |
title="' . esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) . '"
|
@@ -3026,11 +2942,12 @@ 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 = '
|
@@ -3050,12 +2967,15 @@ global $wpdb;
|
|
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 +2985,23 @@ function wppa_search_edit( $collapsible = false ) {
|
|
3065 |
|
3066 |
$value = wppa_get( 'searchstring' );
|
3067 |
|
3068 |
-
$result = '
|
3069 |
-
|
3070 |
-
|
3071 |
-
|
3072 |
-
|
3073 |
-
|
3074 |
-
|
3075 |
-
|
3076 |
-
|
3077 |
-
|
3078 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3079 |
<tr class="alternate" >' .
|
3080 |
( $collapsible ? '<td></td>' : '' ) . '
|
3081 |
<td id="src-alb" >' .
|
@@ -3166,60 +3092,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 +3168,7 @@ global $wpdb;
|
|
3296 |
style="height:16px;display:none"
|
3297 |
src="' . wppa_get_imgdir() . 'backarrow.gif' . '"
|
3298 |
onclick="' . $onclickoff . '"
|
3299 |
-
title="' . esc_attr( __( 'Collapse
|
3300 |
/>
|
3301 |
<img
|
3302 |
id="alb-arrow-on-' . $id . '"
|
@@ -3304,10 +3176,10 @@ global $wpdb;
|
|
3304 |
style="height:16px;"
|
3305 |
src="' . wppa_get_imgdir() . 'arrow.gif' . '"
|
3306 |
onclick="' . $onclickon . '"
|
3307 |
-
title="' . esc_attr( __( 'Expand
|
3308 |
/>';
|
3309 |
|
3310 |
-
// Open
|
3311 |
if ( wppa_get_cookie( 'alb-arrow-' . $id ) == 'on' ) {
|
3312 |
$the_js = '
|
3313 |
jQuery(document).ready(function(){
|
@@ -3343,11 +3215,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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 +3278,7 @@ global $wpdb;
|
|
3391 |
}
|
3392 |
if ( wppa_can_create_album() ) {
|
3393 |
$url = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&parent_id=' . $id . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
|
3394 |
-
$onc = 'if (confirm(\''.__( 'Are you sure you want to create a
|
3395 |
$result .= '<td><a onclick="' . $onc . '" class="wppacreate">' . __( 'Create', 'wp-photo-album-plus' ) . '</a></td>';
|
3396 |
}
|
3397 |
}
|
@@ -3413,7 +3300,7 @@ global $wpdb;
|
|
3413 |
}
|
3414 |
}
|
3415 |
|
3416 |
-
// Find accessable
|
3417 |
function wppa_have_accessible_children( $alb ) {
|
3418 |
global $wpdb;
|
3419 |
|
@@ -3477,7 +3364,7 @@ global $wpdb;
|
|
3477 |
wppa_clear_cache( array( 'album' => $id ) );
|
3478 |
wppa_childlist_remove( $id );
|
3479 |
|
3480 |
-
$msg = __( 'Album
|
3481 |
if ( wppa( 'ajax' ) ) {
|
3482 |
wppa_echo( $msg );
|
3483 |
}
|
@@ -3502,8 +3389,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-)
|
3506 |
-
__( '--- most recent from (sub-)
|
3507 |
__( '--- according to albums photo sequence ---', 'wp-photo-album-plus' ),
|
3508 |
);
|
3509 |
$vals = array( '-9', '-1', '-2', '-3', '-4', '-5' );
|
@@ -3629,7 +3516,7 @@ global $wpdb;
|
|
3629 |
}
|
3630 |
}
|
3631 |
|
3632 |
-
//
|
3633 |
if ( $parent ) {
|
3634 |
|
3635 |
$sel = ' selected';
|
@@ -3659,7 +3546,7 @@ global $wpdb;
|
|
3659 |
<div style="margin-left:6px">
|
3660 |
<label
|
3661 |
for="subalbumorder">' .
|
3662 |
-
__( '
|
3663 |
</label><br>
|
3664 |
<select
|
3665 |
id="subalbumorder"
|
@@ -3695,7 +3582,7 @@ global $wpdb;
|
|
3695 |
else {
|
3696 |
$result = '
|
3697 |
<br>' .
|
3698 |
-
esc_html__( 'You can edit
|
3699 |
}
|
3700 |
$result .= '<br>';
|
3701 |
|
@@ -4043,10 +3930,15 @@ function _wppa_search() {
|
|
4043 |
|
4044 |
$result = '
|
4045 |
<div class="wrap" >
|
4046 |
-
<
|
4047 |
-
|
|
|
4048 |
<div style="clear:both"> </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.002
|
7 |
*
|
8 |
*/
|
9 |
|
97 |
|
98 |
if ( wppa_get( 'tab' ) ) {
|
99 |
|
100 |
+
// Check nonce field
|
101 |
+
if ( ! wp_verify_nonce( wppa_get( 'nonce' ), 'wppa-nonce' ) ) {
|
102 |
+
wp_die('Security check failure 1');
|
103 |
+
}
|
104 |
+
|
105 |
// album edit page
|
106 |
if ( wppa_get( 'tab' ) == 'edit' ) {
|
107 |
|
108 |
// Edit any album, check for type is implemented c.q. existence and rights
|
109 |
if ( wppa_get( 'edit-id' ) ) {
|
110 |
|
111 |
+
// Validate input
|
112 |
$ei = wppa_get( 'edit-id' );
|
113 |
if ( $ei != 'new' && $ei != 'search' && $ei != 'trash' && $ei != 'single' && ! is_numeric( $ei ) ) {
|
114 |
wppa_error_message( sprintf( __( 'Album edit id %s is not implemented', 'wp-photo-album-plus' ), $ei ) );
|
115 |
return;
|
116 |
}
|
117 |
+
|
|
|
|
|
118 |
if ( is_numeric( $ei ) ) {
|
119 |
if ( ! $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_albums WHERE id=%d", $ei ), ARRAY_A ) ) {
|
120 |
wppa_error_message( sprintf( __( 'Album %d does not exist', 'wp-photo-album-plus' ), $ei ) );
|
121 |
return;
|
122 |
}
|
123 |
if ( ! wppa_have_access( $ei ) ) {
|
124 |
+
wppa_error_message( sprintf( __( 'You do not have sufficient rights to edit album %d', 'wp-photo-album-plus' ), $ei ) );
|
125 |
return;
|
126 |
}
|
127 |
}
|
130 |
// Edit single photo
|
131 |
if ( wppa_get( 'edit-id' ) == 'single' ) {
|
132 |
|
133 |
+
$page_title = wppa_get( 'just-edit', __( 'Edit Single media item', 'wp-photo-album-plus' ) );
|
134 |
|
135 |
+
wppa_echo( '<div class="wrap" ><h1 class="wp-heading-inline">' . $page_title . '</h1>' );
|
136 |
wppa_album_photos( $ei );
|
137 |
wppa_echo( '</div>' );
|
138 |
return;
|
141 |
// Edit by search token
|
142 |
if ( wppa_get( 'edit-id' ) == 'search' ) {
|
143 |
|
144 |
+
$bulk = wppa_get( 'bulk' );
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
wppa_echo ( '
|
147 |
<a name="manage-photos" id="manage-photos" ></a>
|
148 |
+
<div class="wrap">' );
|
|
|
|
|
|
|
|
|
149 |
|
150 |
+
// The page title
|
151 |
+
if ( $bulk ) {
|
152 |
+
$page_title = sprintf( __( 'Bulk edit media items searched by %s', 'wp-photo-album-plus' ), '<i>' . wppa_get( 'searchstring', '', 'text' ) . '</i>' );
|
153 |
+
}
|
154 |
+
else {
|
155 |
+
$page_title = sprintf( __( 'Edit media items searched by %s', 'wp-photo-album-plus' ), '<i>' . wppa_get( 'searchstring', '', 'text' ) . '</i>' );
|
156 |
+
}
|
157 |
+
|
158 |
+
wppa_echo( '
|
159 |
+
<h1 class="wp-heading-inline">' . $page_title . '</h1>' .
|
160 |
+
$back_link_html . '
|
161 |
+
<br><br>' );
|
162 |
+
|
163 |
+
// Do the dirty work
|
164 |
+
if ( $bulk ) {
|
165 |
+
wppa_album_photos_bulk( $ei );
|
166 |
+
}
|
167 |
+
else {
|
168 |
+
wppa_album_photos( $ei );
|
169 |
+
}
|
170 |
|
171 |
+
wppa_echo( $top_link_html . '<br>' . $back_link_html );
|
172 |
+
wppa_echo( '</div>' );
|
173 |
return;
|
174 |
}
|
175 |
|
178 |
|
179 |
$h2 = __( 'Manage Trashed Photos', 'wp-photo-album-plus' );
|
180 |
$task = __( 'Edit photo information', 'wp-photo-album-plus' );
|
181 |
+
wppa_echo( '<div class="wrap"><a name="manage-photos" id="manage-photos" ></a><h1>' . $h2 . ' - <small><i>' . $task . '</i></small></h1>' );
|
182 |
if ( wppa_get( 'bulk' ) ) {
|
183 |
wppa_album_photos_bulk( $ei );
|
184 |
}
|
198 |
}
|
199 |
$id = wppa_nextkey( WPPA_ALBUMS );
|
200 |
|
201 |
+
// Creating a sub album of a given parent?
|
202 |
if ( wppa_get( 'parent_id' ) ) {
|
203 |
$parent = wppa_get( 'parent_id' );
|
204 |
$name = wppa_get_album_name( $parent ) . '-#' . $id;
|
219 |
wppa_update_option( 'wppa_default_parent', '0' );
|
220 |
$parent = '0';
|
221 |
}
|
222 |
+
$name = __( 'New album', 'wp-photo-album-plus' );
|
223 |
if ( $parent == '0' && ! wppa_can_create_top_album() ) {
|
224 |
wp_die( __( 'You have insufficient rights to create a top-level album', 'wp-photo-album-plus' ) );
|
225 |
}
|
457 |
$the_js = '
|
458 |
function wppaTryInheritCats( id ) {
|
459 |
|
460 |
+
var query = "' . esc_js( __( 'Are you sure you want to inherit categories to all (sub-)sub albums of this album?', 'wp-photo-album-plus' ) ) . '";
|
461 |
if ( confirm( query ) ) {
|
462 |
wppaAjaxUpdateAlbum( id, \'inherit_cats\', Math.random() );
|
463 |
}
|
465 |
|
466 |
function wppaTryAddCats( id ) {
|
467 |
|
468 |
+
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' ) ) . '";
|
469 |
if ( confirm( query ) ) {
|
470 |
wppaAjaxUpdateAlbum( id, \'inhadd_cats\', Math.random() );
|
471 |
}
|
566 |
wppa_echo( '<input type="hidden" id="album-nonce-' . $id . '" value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '" />' );
|
567 |
|
568 |
// The header
|
569 |
+
if ( wppa_get( 'bulk', '0', 'int' ) ) {
|
570 |
+
$page_title = __( 'Albums -> Bulk edit -> %s', 'wp-photo-album-plus' );
|
571 |
+
}
|
572 |
+
elseif ( wppa_get( 'quick', '0', 'int' ) ) {
|
573 |
+
$page_title = __( 'Albums -> Quick edit -> %s', 'wp-photo-album-plus' );
|
574 |
+
}
|
575 |
+
elseif ( wppa_get( 'seq', '0', 'int' ) ) {
|
576 |
+
$page_title = __( 'Albums -> Sequence edit -> %s', 'wp-photo-album-plus' );
|
577 |
+
}
|
578 |
+
else {
|
579 |
+
$page_title = __( 'Albums -> Edit -> %s', 'wp-photo-album-plus' );
|
580 |
+
}
|
581 |
+
wppa_echo( '<h1 class="wp-heading-inline">' . esc_html( sprintf( $page_title, __( wppa_get_album_name( $id ) ) ) ) . '</h1>' );
|
582 |
+
|
583 |
|
584 |
wppa_echo( $back_link_html );
|
585 |
|
586 |
/* Start header buttons */
|
587 |
+
$result = '
|
588 |
+
<div id="wppa-action-container" style="margin-top:12px;display:block">';
|
|
|
589 |
|
590 |
// Goto Upload
|
591 |
if ( current_user_can( 'wppa_upload' ) ) {
|
599 |
__( 'Upload to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' )
|
600 |
);
|
601 |
|
602 |
+
$result .= '
|
603 |
<input
|
604 |
type="button"
|
605 |
class="wppa-admin-button button"
|
606 |
onclick="' . $onc . '"
|
607 |
value="' . $val .'"
|
608 |
+
/>';
|
609 |
}
|
610 |
|
611 |
// Goto Import
|
614 |
$onc = 'document.location = \''.get_admin_url().'admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\'';
|
615 |
$val = __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' );
|
616 |
|
617 |
+
$result .= '
|
618 |
<input
|
619 |
type="button"
|
620 |
class="wppa-admin-button button"
|
621 |
onclick="' . $onc . '"
|
622 |
value="' . $val .'"
|
623 |
+
/>';
|
624 |
}
|
|
|
|
|
625 |
|
626 |
// Download album
|
627 |
if ( wppa_switch( 'allow_download_album' ) && ( ! wppa_switch( 'download_album_is_restricted' ) || wppa_user_is_admin() ) ) {
|
628 |
+
|
629 |
+
$result .= '
|
630 |
<input
|
631 |
type="button"
|
632 |
class="wppa-admin-button button"
|
638 |
src="' . wppa_get_imgdir() . 'spinner.gif"
|
639 |
style="margin-left:6px;display:none;height:18px;position:relative;bottom:-6px"
|
640 |
alt="spinner"
|
641 |
+
/>';
|
|
|
642 |
}
|
643 |
+
|
644 |
+
$result .= '
|
645 |
+
</div>'; // end action-container
|
646 |
+
wppa_echo( $result );
|
647 |
/* End header */
|
648 |
|
649 |
/* Main body album admin */
|
800 |
wppa_echo( '
|
801 |
<div class="left">
|
802 |
<label>' .
|
803 |
+
__( 'Inc sub albums', 'wp-photo-album-plus' ) . '
|
804 |
</label><br>
|
805 |
<div class="wppa-ldi">' .
|
806 |
$tpviews . '
|
907 |
|
908 |
// Status
|
909 |
{
|
910 |
+
$title = __( 'Set the frontend visibility of the album cover and items not including sub albums.', 'wp-photo-album-plus' ) . ' ' .
|
911 |
__( 'Publish: visible for all, Private: visible for logged in only, Hidden: visible for admin only', 'wp-photo-album-plus' );
|
912 |
|
913 |
wppa_echo( '
|
1094 |
style="max-width: 200px;margin-right: 4px;">
|
1095 |
<label
|
1096 |
for="altthumb">' .
|
1097 |
+
__( 'Max sub albums', 'wp-photo-album-plus' ) . '
|
1098 |
</label><br>
|
1099 |
<select
|
1100 |
id="maxchild"
|
1101 |
onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'max_children\', this )"
|
1102 |
+
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' ) . '"
|
1103 |
>
|
1104 |
<option value="0"' . ( $val == '0' ? $sel : '' ) . ' >' .
|
1105 |
__( 'unlimited', 'wp-photo-album-plus' ) . '
|
1179 |
|
1180 |
// Tree limit
|
1181 |
{
|
1182 |
+
$title = __( 'The upload limit for this album and all its (sub-)sub albums.', 'wp-photo-album-plus' ) . ' ' .
|
1183 |
+
__( 'This setting overrules all other limits that may apply to this album or its (sub-)sub albums.', 'wp-photo-album-plus' ) . ' ' .
|
1184 |
__( '0 means no limit.', 'wp-photo-album-plus' );
|
1185 |
wppa_echo( '
|
1186 |
<div class="left">
|
1431 |
__( 'The following buttons perform actions on albums related to this album', 'wp-photo-album-plus' ) . '
|
1432 |
</h2>' );
|
1433 |
|
1434 |
+
// Create sub album
|
1435 |
if ( wppa_can_create_album() ) {
|
1436 |
$url = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&parent_id=' . $albuminfo['id'] . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
|
1437 |
+
$onc = 'if (confirm(\''.__( 'Are you sure you want to create a sub album?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
|
1438 |
|
1439 |
wppa_echo( '
|
1440 |
<input
|
1441 |
type="button"
|
1442 |
class="wppa-admin-button button"
|
1443 |
onclick="' . $onc . '"
|
1444 |
+
value="' . esc_attr( __( 'Create sub album', 'wp-photo-album-plus' ) ) . '"
|
1445 |
/>' );
|
1446 |
}
|
1447 |
|
1456 |
'&parent_id=' . $albuminfo['a_parent'] .
|
1457 |
'&is-sibling-of=' . $albuminfo['id'] .
|
1458 |
'&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
|
1459 |
+
$onc = 'if (confirm(\''.__( 'Are you sure you want to create a sub album?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
|
1460 |
|
1461 |
wppa_echo( '
|
1462 |
<input
|
1486 |
<input
|
1487 |
type="button"
|
1488 |
class="wppa-admin-button button"
|
1489 |
+
title="' . esc_attr( __( 'Apply categories to all (sub-)sub albums.', 'wp-photo-album-plus' ) ) . '"
|
1490 |
onclick="wppaTryInheritCats( ' . $id . ' )"
|
1491 |
+
value="' . esc_attr( __( 'Apply Cats to sub albums', 'wp-photo-album-plus' ) ) . '"
|
1492 |
/>
|
1493 |
<input
|
1494 |
type="button"
|
1495 |
class="wppa-admin-button button"
|
1496 |
+
title="' . esc_attr( __( 'Add categories to all (sub-)sub albums.', 'wp-photo-album-plus' ) ) . '"
|
1497 |
onclick="wppaTryAddCats( ' . $id . ' )"
|
1498 |
+
value="' . esc_attr( __( 'Add Cats to sub albums', 'wp-photo-album-plus' ) ) . '"
|
1499 |
/>' );
|
1500 |
}
|
1501 |
|
1502 |
+
// Sub albums sequence
|
1503 |
if ( $has_children ) {
|
1504 |
wppa_album_sequence( $edit_id );
|
1505 |
}
|
1809 |
<select
|
1810 |
title="' . esc_attr( $title ) . '"
|
1811 |
onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_linktype\', this )" >
|
1812 |
+
<option value="content"' . ( $lt == 'content' ? $sel : '' ) . ' >' . __( 'the sub albums and thumbnails', 'wp-photo-album-plus' ) . '</option>
|
1813 |
+
<option value="albums"' . ( $lt == 'albums' ? $sel : '' ) . ' >' . __( 'the sub albums', 'wp-photo-album-plus' ) . '</option>
|
1814 |
<option value="thumbs"' . ( $lt == 'thumbs' ? $sel : '' ) . ' >' . __( 'the thumbnails', 'wp-photo-album-plus' ) . '</option>
|
1815 |
<option value="slide"' . ( $lt == 'slide' ? $sel : '' ) . ' >' . __( 'the album photos as slideshow', 'wp-photo-album-plus' ) . '</option>
|
1816 |
<option value="page"' . ( $lt == 'page' ? $sel : '' ) . ' >' . __( 'the link page with a clean url', 'wp-photo-album-plus' ) . '</option>
|
2096 |
wppa_echo( '
|
2097 |
<div class="wppa-table-wrap" style="margin-top:20px;clear:both;position:relative;">' );
|
2098 |
|
2099 |
+
// wppa_echo( '<a name="manage-photos" id="manage-photos" ></a><h2 style="padding-left:12px">' );
|
2100 |
|
2101 |
if ( wppa_get( 'bulk' ) )
|
2102 |
$result = __( 'Copy / move / delete / edit name / edit description / change status', 'wp-photo-album-plus' );
|
2112 |
else $result = '';
|
2113 |
|
2114 |
$result .= '
|
2115 |
+
</h2>';
|
2116 |
+
// <div style="clear:both"></div>';
|
2117 |
+
// wppa_echo( $result );
|
2118 |
|
2119 |
if ( wppa_get( 'bulk' ) )
|
2120 |
wppa_album_photos_bulk( $edit_id );
|
2145 |
if ( current_user_can( 'wppa_comments' ) && wppa_have_access( $alb ) ) {
|
2146 |
$result = '
|
2147 |
<div class="wrap">
|
2148 |
+
<h1 class="wp-heading-inline">' .
|
2149 |
+
__( 'Moderate comment', 'wp-photo-album-plus' ) . '
|
2150 |
+
</h1>' .
|
2151 |
wppa_album_photos( '', $photo ) . '
|
2152 |
</div>';
|
2153 |
wppa_echo( $result );
|
2165 |
$result = '
|
2166 |
<div class="wrap">
|
2167 |
<img src="' . WPPA_URL . '/img/page_green.png" />
|
2168 |
+
<h1 class="wp-heading-inline">' . ( wppa_get( 'tab' ) == 'pmod' ?
|
2169 |
__( 'Moderate photo', 'wp-photo-album-plus' ) :
|
2170 |
__( 'Edit photo', 'wp-photo-album-plus' ) ) . '
|
2171 |
</h1>
|
2189 |
|
2190 |
$result = '
|
2191 |
<div class="wrap">
|
2192 |
+
<h1 class="wp-heading-inline">' . __( 'Delete Album', 'wp-photo-album-plus' ) . '</h1>
|
|
|
2193 |
|
2194 |
<p>' . __( 'Album', 'wp-photo-album-plus' ) . '<b>' . htmlspecialchars( wppa_get_album_name( wppa_get( 'edit-id' ) ) ) . '</b></p>
|
2195 |
<p>' . __( 'Are you sure you want to delete this album?', 'wp-photo-album-plus' ) . '<br>' .
|
2279 |
wppa_echo( '
|
2280 |
<div class="wrap">' .
|
2281 |
wppa_admin_spinner() . '
|
2282 |
+
<h1 class="wp-heading-inline">' . get_admin_page_title() . '</h1>' );
|
2283 |
|
2284 |
// The Create new album button
|
2285 |
if ( wppa_can_create_top_album() ) {
|
2292 |
class="page-title-action">' .
|
2293 |
__( 'Add New', 'wp-photo-album-plus' ) . '
|
2294 |
</a>
|
2295 |
+
' );
|
2296 |
}
|
2297 |
|
2298 |
/* The header buttons / sewlection boxes */
|
2299 |
{
|
2300 |
+
$header = '
|
2301 |
+
<div style="margin-top:12px;">
|
2302 |
+
<div id="wppa-action-container">';
|
2303 |
|
2304 |
// The switch to flat/collapsable button(s)
|
2305 |
if ( $style == 'flat' ) {
|
2306 |
+
$header .= '
|
2307 |
<input
|
2308 |
type="button"
|
2309 |
class="button"
|
2310 |
onclick="document.location=\'' . get_admin_url() . 'admin.php?page=wppa_admin_menu&switchto=collapsible\'"
|
2311 |
value="' . esc_attr__( 'Switch to Collapsable table', 'wp-photo-album-plus' ) . '"
|
2312 |
+
/>';
|
2313 |
}
|
2314 |
else {
|
2315 |
+
$header .= '
|
2316 |
<input
|
2317 |
type="button"
|
2318 |
class="button"
|
2319 |
onclick="document.location=\'' . get_admin_url() . 'admin.php?page=wppa_admin_menu&switchto=flat\'"
|
2320 |
value="' . esc_attr__( 'Switch to Flat table', 'wp-photo-album-plus' ) . '"
|
2321 |
+
/>';
|
2322 |
}
|
2323 |
|
2324 |
// The open all/close all buttons
|
2325 |
if ( $style != 'flat' ) {
|
2326 |
+
$header .= '
|
2327 |
<input
|
2328 |
type="button"
|
2329 |
class="button"
|
2347 |
jQuery(\'.alb-arrow-off\').css(\'display\',\'none\');
|
2348 |
"
|
2349 |
value="' . esc_attr__( 'Close all', 'wp-photo-album-plus' ) . '"
|
2350 |
+
/>';
|
2351 |
}
|
2352 |
|
|
|
|
|
|
|
|
|
2353 |
// Edit by id
|
2354 |
if ( wppa_has_many_albums() ) {
|
2355 |
+
$header .= '
|
2356 |
<input
|
2357 |
id="wppa-edit-albid"
|
2358 |
type="number"
|
2360 |
placeholder="' . __( 'Album id', 'wp-photo-album-plus' ) . '"
|
2361 |
title="' . __( 'Enter the number of the album you want to edit', 'wp-photo-album-plus' ) . '"
|
2362 |
style="width:120px;cursor:pointer"
|
2363 |
+
/>';
|
2364 |
}
|
2365 |
else {
|
2366 |
$albids = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums ORDER BY id" );
|
2369 |
unset( $albids[$key] );
|
2370 |
}
|
2371 |
}
|
2372 |
+
$header .= '
|
2373 |
<select
|
2374 |
id="wppa-edit-albid"
|
2375 |
title="' . __( 'Select the number of the album you want to edit', 'wp-photo-album-plus' ) . '"
|
2376 |
styles="width:120px;cursor:pointer;vertical-align:baseline"
|
2377 |
/>
|
2378 |
+
<option value="" selected disabled>' . __( 'Album id', 'wp-photo-album-plus' ) . '</option>';
|
2379 |
foreach( $albids as $alb ) {
|
2380 |
+
$header .= '<option value="' . $alb . '">' . $alb . '</option>';
|
2381 |
}
|
2382 |
+
$header .= '
|
2383 |
+
</select>';
|
2384 |
}
|
2385 |
+
$header .= '
|
2386 |
<input
|
2387 |
type="button"
|
2388 |
class="button"
|
2389 |
value="' . __( 'Edit album', 'wp-photo-album-plus' ) . '"
|
2390 |
onclick="wppaGoEditAlbNo();"
|
2391 |
+
/>';
|
2392 |
|
2393 |
// Filter by searchword
|
2394 |
$opts = $wpdb->get_col( "SELECT slug FROM $wpdb->wppa_index WHERE albums <> '' ORDER BY slug" );
|
2395 |
$f = wppa_get( 'filter' );
|
2396 |
+
$header .= '
|
2397 |
<select
|
2398 |
id="wppa-edit-filter"
|
2399 |
title="' . __( 'Select an album search word', 'wp-photo-album-plus' ) . '"
|
2400 |
>
|
2401 |
+
<option value="" selected disabled>' . __( 'Filter by', 'wp-photo-album-plus' ) . '</option>';
|
2402 |
foreach( $opts as $opt ) {
|
2403 |
+
$header .= '<option value="' . $opt . '"' . ( $f == $opt ? ' selected ' : '' ) . '>' . $opt . '</option>';
|
2404 |
}
|
2405 |
+
$header .= '
|
2406 |
</select>
|
2407 |
<input
|
2408 |
type="button"
|
2409 |
class="button"
|
2410 |
onclick="wppaGoApplyFilter();"
|
2411 |
value="' . __( 'Apply filter', 'wp-photo-album-plus' ) . '"
|
2412 |
+
/>';
|
2413 |
+
$header .= '
|
2414 |
</div>
|
2415 |
+
';
|
2416 |
+
wppa_echo( $header );
|
2417 |
/* End header buttons / seecion boxes */
|
2418 |
}
|
2419 |
|
2460 |
function wppa_admin_albums_flat() {
|
2461 |
global $wpdb;
|
2462 |
|
2463 |
+
// Get paging parameters
|
2464 |
+
$parms = wppa_get_paging_parms( 'album_admin' );
|
2465 |
+
|
2466 |
+
$pagesize = $parms['pagesize'];
|
2467 |
+
$page = $parms['page'];
|
2468 |
$skips = ( $page - 1 ) * $pagesize;
|
2469 |
+
$order_by = $parms['order'];
|
2470 |
+
$dir = $parms['dir'];
|
2471 |
|
2472 |
// Read all albums, pre-ordered
|
2473 |
+
$albums = $wpdb->get_results( "SELECT * FROM `$wpdb->wppa_albums` ORDER BY `$order_by` $dir", ARRAY_A );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2474 |
|
2475 |
// Remove non accessible albums
|
2476 |
$temp = $albums;
|
2485 |
$filter = wppa_get( 'filter' );
|
2486 |
|
2487 |
if ( $filter ) {
|
2488 |
+
$filter_albs = $wpdb->get_var( $wpdb->prepare( "SELECT albums FROM `$wpdb->wppa_index` WHERE `slug` = %s LIMIT 1", $filter ) );
|
2489 |
$filter_albs = wppa_index_string_to_array( $filter_albs );
|
2490 |
|
2491 |
foreach( array_keys( $albums ) as $key ) {
|
2495 |
}
|
2496 |
}
|
2497 |
|
2498 |
+
// Potentially total albums
|
2499 |
+
$total = count( $albums );
|
2500 |
|
2501 |
// If paging: Make new array with selected albums only
|
2502 |
if ( $pagesize ) {
|
2511 |
}
|
2512 |
}
|
2513 |
|
2514 |
+
// Do the dirty work
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2515 |
if ( ! empty( $albums ) ) {
|
2516 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2517 |
$downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style="height:12px;position:relative;top:2px" />';
|
2518 |
$upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style="height:12px;position:relative;top:2px" />';
|
2519 |
+
$useimg = $parms['dir'] == 'DESC' ? $upimg : $downimg;
|
2520 |
$show_nl = wppa_opt( 'user_create_max_level' ) != '99';
|
2521 |
+
$reload_url = get_admin_url() . 'admin.php?page=wppa_admin_menu'; // &paged=';
|
2522 |
+
$order = $parms['order'];
|
2523 |
|
2524 |
+
wppa_admin_pagination( $pagesize, $page, $total, $reload_url, 'top' );
|
2525 |
+
|
2526 |
+
wppa_echo( '</div>' ); // Close action contatiner
|
2527 |
+
|
2528 |
+
$result = '
|
2529 |
<table
|
2530 |
class="wppa-table widefat wppa-setting-table striped"
|
2531 |
+
style="margin:12px 0;"
|
2532 |
>
|
2533 |
<thead>';
|
2534 |
$thead_body = '
|
2535 |
<tr>
|
2536 |
<td
|
2537 |
+
style="min-width:75px;cursor:pointer;"
|
2538 |
title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
|
2539 |
esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
|
2540 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'id' ) . '\'"
|
2541 |
+
>' .
|
2542 |
+
( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
|
2543 |
+
( $order == 'id' ? $useimg : '' ) . '
|
|
|
2544 |
</td>
|
2545 |
<td
|
2546 |
+
style="min-width: 120px;cursor:pointer;"
|
2547 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'name' ) . '\'"
|
2548 |
+
>' .
|
2549 |
+
__( 'Name', 'wp-photo-album-plus' ) .
|
2550 |
+
( $order == 'name' ? $useimg : '' ) . '
|
|
|
2551 |
</td>
|
2552 |
+
<td
|
2553 |
+
style="cursor:pointer;"
|
2554 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'description' ) . '\'"
|
2555 |
+
>' .
|
2556 |
+
__( 'Description', 'wp-photo-album-plus' ) .
|
2557 |
+
( $order == 'description' ? $useimg : '' ) . '
|
2558 |
</td>';
|
2559 |
if ( current_user_can( 'administrator' ) ) {
|
2560 |
$thead_body .= '
|
2561 |
+
<td style="min-width: 100px;cursor:pointer;"
|
2562 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'owner' ) . '\'"
|
2563 |
+
>' .
|
2564 |
+
__( 'Owner', 'wp-photo-album-plus' ) .
|
2565 |
+
( $order == 'owner' ? $useimg : '' ) . '
|
2566 |
</td>';
|
2567 |
}
|
2568 |
$thead_body .= '
|
2569 |
<td
|
2570 |
+
style="min-width: 100px;cursor:pointer;"
|
2571 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'a_order' ) . '\'"
|
2572 |
+
>' .
|
2573 |
+
__( 'Order', 'wp-photo-album-plus' ) .
|
2574 |
+
( $order == 'a_order' ? $useimg : '' ) . '
|
|
|
2575 |
</td>
|
2576 |
<td
|
2577 |
+
style="width: 120px;cursor:pointer;"
|
2578 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'a_parent' ) . '\'"
|
2579 |
+
>' .
|
2580 |
+
__( 'Parent', 'wp-photo-album-plus' ) .
|
2581 |
+
( $order == 'a_parent' ? $useimg : '' ) . '
|
|
|
2582 |
</td>
|
2583 |
<td
|
2584 |
title="' . esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) . '"
|
2607 |
$result = '<tbody>';
|
2608 |
$mayseq = ! wppa_switch( 'porder_restricted' ) || wppa_user_is_admin();
|
2609 |
|
2610 |
+
foreach ( $albums as $album ) {//array_keys( $seq ) as $s ) {
|
2611 |
+
// $album = $albums[$s];
|
2612 |
$id = $album['id'];
|
2613 |
$counts = wppa_get_treecounts_a( $id, true );
|
2614 |
$url = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=' . $id;
|
2624 |
$url = wppa_ea_url( $id );
|
2625 |
$delurl = wppa_ea_url( $id, 'del' );
|
2626 |
$creurl = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&parent_id=' . $id . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
|
2627 |
+
$creonc = 'if (confirm(\''.esc_js(__( 'Are you sure you want to create a sub album?', 'wp-photo-album-plus' )).'\')) document.location=\''.$creurl.'\';';
|
2628 |
|
2629 |
$result .= '
|
2630 |
<tr ' . $alt . ( $pendcount ? 'style="background-color:#ffdddd"' : '' ) . '>
|
2669 |
<tfoot>' .
|
2670 |
$thead_body . '
|
2671 |
</tfoot>
|
2672 |
+
</table>';
|
|
|
|
|
2673 |
wppa_echo( $result );
|
2674 |
|
2675 |
+
wppa_admin_pagination( $pagesize, $page, $total, $reload_url, 'bottom' );
|
2676 |
+
|
2677 |
wppa_echo( wppa_album_admin_footer() );
|
2678 |
|
2679 |
}
|
2680 |
else {
|
2681 |
+
wppa_echo( '</div>' ); // Close action contatiner
|
2682 |
wppa_echo( '<h2>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</h2>' );
|
2683 |
}
|
2684 |
}
|
2687 |
function wppa_admin_albums_collapsible() {
|
2688 |
global $wpdb;
|
2689 |
|
2690 |
+
// Get paging parameters
|
2691 |
+
$parms = wppa_get_paging_parms( 'album_admin' );
|
2692 |
+
|
2693 |
+
$pagesize = $parms['pagesize'];
|
2694 |
+
$page = $parms['page'];
|
2695 |
$skips = ( $page - 1 ) * $pagesize;
|
2696 |
+
$order_by = $parms['order'];
|
2697 |
+
$dir = $parms['dir'];
|
2698 |
|
2699 |
// Read all albums, pre-ordered
|
2700 |
+
$albums = $wpdb->get_results( "SELECT * FROM `$wpdb->wppa_albums` ORDER BY `$order_by` $dir", ARRAY_A );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2701 |
|
2702 |
// Remove non accessible albums
|
2703 |
$temp = $albums;
|
2707 |
$albums[] = $temp[$idx];
|
2708 |
}
|
2709 |
}
|
|
|
2710 |
|
2711 |
+
// If filter, filter
|
2712 |
+
$filter = wppa_get( 'filter' );
|
2713 |
+
|
2714 |
+
if ( $filter ) {
|
2715 |
+
$filter_albs = $wpdb->get_var( $wpdb->prepare( "SELECT albums FROM `$wpdb->wppa_index` WHERE `slug` = %s LIMIT 1", $filter ) );
|
2716 |
+
$filter_albs = wppa_index_string_to_array( $filter_albs );
|
2717 |
+
|
2718 |
+
foreach( array_keys( $albums ) as $key ) {
|
2719 |
+
if ( ! in_array( $albums[$key]['id'], $filter_albs ) ) {
|
2720 |
+
unset( $albums[$key] );
|
2721 |
+
}
|
2722 |
+
}
|
2723 |
+
}
|
2724 |
+
|
2725 |
+
// Potentially total albums
|
2726 |
+
$total = count( $albums );
|
2727 |
+
|
2728 |
+
// If paging: Make new array with selected albums only
|
2729 |
if ( $pagesize ) {
|
2730 |
$temp = $albums;
|
2731 |
$albums = array();
|
2774 |
WHERE id in (" . implode( ',', $all_ids ) . ")", ARRAY_A );
|
2775 |
}
|
2776 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2777 |
if ( ! empty( $albums ) ) {
|
2778 |
|
2779 |
// Setup the sequence array
|
2780 |
$seq = false;
|
2781 |
$num = false;
|
2782 |
foreach( $albums as $album ) {
|
2783 |
+
switch ( $order_by ) {
|
2784 |
case 'name':
|
2785 |
$seq[] = strtolower( __( stripslashes( $album['name'] ) ) );
|
2786 |
break;
|
2809 |
else asort( $seq, SORT_REGULAR );
|
2810 |
|
2811 |
// Reverse ?
|
2812 |
+
if ( $dir == 'DESC' ) {
|
2813 |
$t = $seq;
|
2814 |
$c = count($t);
|
2815 |
$tmp = array_keys($t);
|
2821 |
|
2822 |
$downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style="height:12px;position:relative;top:2px" />';
|
2823 |
$upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style="height:12px;position:relative;top:2px" />';
|
2824 |
+
$useimg = $dir == 'DESC' ? $upimg : $downimg;
|
2825 |
+
$show_nl = wppa_opt( 'user_create_max_level' ) != '99';
|
2826 |
+
$reload_url = get_admin_url() . 'admin.php?page=wppa_admin_menu';
|
2827 |
+
$order = $parms['order'];
|
2828 |
|
2829 |
+
wppa_admin_pagination( $pagesize, $page, $total, $reload_url, 'top' );
|
2830 |
+
|
2831 |
+
wppa_echo( '</div>' ); // Close action contatiner
|
2832 |
+
|
2833 |
+
$result = '
|
2834 |
+
<table class="widefat wppa-table wppa-setting-table" style="margin:12px 0">
|
2835 |
<thead>';
|
2836 |
$thead_body = '
|
2837 |
<tr>
|
2838 |
+
<td style="width:40px">
|
2839 |
+
<img src="' . wppa_get_imgdir() . 'backarrow.gif" style="height:16px;" title="' . __( 'Collapse subalbums', 'wp-photo-album-plus' ) . '" /> 
|
2840 |
<img src="' . wppa_get_imgdir() . 'arrow.gif" style="height:16px;" title="' . __( 'Expand subalbums', 'wp-photo-album-plus' ) . '" />
|
2841 |
</td>
|
2842 |
+
<td colspan="6"
|
2843 |
+
style="min-width:75px;cursor:pointer;"
|
2844 |
title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
|
2845 |
esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
|
2846 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'id' ) . '\'"
|
2847 |
+
>' .
|
2848 |
+
( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
|
2849 |
+
( $order == 'id' ? $useimg : '' ) . '
|
|
|
2850 |
</td>
|
2851 |
<td
|
2852 |
+
style="min-width: 120px;cursor:pointer;"
|
2853 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'name' ) . '\'"
|
2854 |
+
>' .
|
2855 |
+
__( 'Name', 'wp-photo-album-plus' ) .
|
2856 |
+
( $order == 'name' ? $useimg : '' ) . '
|
|
|
2857 |
</td>
|
2858 |
+
<td
|
2859 |
+
style="cursor:pointer;"
|
2860 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'description' ) . '\'"
|
2861 |
+
>' .
|
2862 |
+
__( 'Description', 'wp-photo-album-plus' ) .
|
2863 |
+
( $order == 'description' ? $useimg : '' ) . '
|
2864 |
</td>';
|
2865 |
if ( current_user_can( 'administrator' ) ) {
|
2866 |
$thead_body .= '
|
2867 |
+
<td style="min-width: 100px;cursor:pointer;"
|
2868 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'owner' ) . '\'"
|
2869 |
+
>' .
|
2870 |
+
__( 'Owner', 'wp-photo-album-plus' ) .
|
2871 |
+
( $order == 'owner' ? $useimg : '' ) . '
|
2872 |
</td>';
|
2873 |
}
|
2874 |
$thead_body .= '
|
2875 |
<td
|
2876 |
+
style="min-width: 100px;cursor:pointer;"
|
2877 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'a_order' ) . '\'"
|
2878 |
+
>' .
|
2879 |
+
__( 'Order', 'wp-photo-album-plus' ) .
|
2880 |
+
( $order == 'a_order' ? $useimg : '' ) . '
|
|
|
2881 |
</td>
|
2882 |
<td
|
2883 |
+
style="width: 120px;cursor:pointer;"
|
2884 |
+
onclick="document.location.href=\'' . wppa_admin_reload_url( 'album_admin', 'a_parent' ) . '\'"
|
2885 |
+
>' .
|
2886 |
+
__( 'Parent', 'wp-photo-album-plus' ) .
|
2887 |
+
( $order == 'a_parent' ? $useimg : '' ) . '
|
|
|
2888 |
</td>
|
2889 |
<td
|
2890 |
title="' . esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) . '"
|
2942 |
<tfoot>' .
|
2943 |
$thead_body . '
|
2944 |
</tfoot>
|
2945 |
+
</table>';
|
|
|
2946 |
|
2947 |
wppa_echo( $result );
|
2948 |
|
2949 |
+
wppa_admin_pagination( $pagesize, $page, $total, $reload_url, 'bottom' );
|
2950 |
+
|
2951 |
wppa_echo( wppa_album_admin_footer() );
|
2952 |
|
2953 |
$the_js = '
|
2967 |
wppa_add_inline_script( 'wppa-admin', $the_js );
|
2968 |
}
|
2969 |
else {
|
2970 |
+
wppa_echo( '</div>' ); // Close action contatiner
|
2971 |
+
|
2972 |
wppa_echo( '<h2>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</h2>' );
|
2973 |
}
|
2974 |
}
|
2975 |
|
2976 |
// The adnin Search field
|
2977 |
function wppa_search_edit( $collapsible = false ) {
|
2978 |
+
global $plugin_page;
|
2979 |
|
2980 |
$doit = false;
|
2981 |
if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
|
2985 |
|
2986 |
$value = wppa_get( 'searchstring' );
|
2987 |
|
2988 |
+
$result = '';
|
2989 |
+
|
2990 |
+
if ( $plugin_page == 'wppa_options' ) {
|
2991 |
+
$result = '
|
2992 |
+
<tr>
|
2993 |
+
<td colspan="' . ( ( $collapsible ? '20' : '14' ) + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) . '" >
|
2994 |
+
<em>' .
|
2995 |
+
__( 'Search for photos to edit', 'wp-photo-album-plus' ) . '
|
2996 |
+
</em>
|
2997 |
+
<small>' .
|
2998 |
+
__( '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' ) . '
|
2999 |
+
</small>
|
3000 |
+
</td>
|
3001 |
+
</tr>';
|
3002 |
+
}
|
3003 |
+
|
3004 |
+
$result .= '
|
3005 |
<tr class="alternate" >' .
|
3006 |
( $collapsible ? '<td></td>' : '' ) . '
|
3007 |
<td id="src-alb" >' .
|
3092 |
return $result;
|
3093 |
}
|
3094 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3095 |
// The albumlist
|
3096 |
function wppa_do_albumlist( $parent, $nestinglevel, $albums, $seq ) {
|
3097 |
global $wpdb;
|
3168 |
style="height:16px;display:none"
|
3169 |
src="' . wppa_get_imgdir() . 'backarrow.gif' . '"
|
3170 |
onclick="' . $onclickoff . '"
|
3171 |
+
title="' . esc_attr( __( 'Collapse sub albums', 'wp-photo-album-plus' ) ) . '"
|
3172 |
/>
|
3173 |
<img
|
3174 |
id="alb-arrow-on-' . $id . '"
|
3176 |
style="height:16px;"
|
3177 |
src="' . wppa_get_imgdir() . 'arrow.gif' . '"
|
3178 |
onclick="' . $onclickon . '"
|
3179 |
+
title="' . esc_attr( __( 'Expand sub albums', 'wp-photo-album-plus' ) ) . '"
|
3180 |
/>';
|
3181 |
|
3182 |
+
// Open sub albums by clicking the open button if it was before (cookie), and if it is visible (!)
|
3183 |
if ( wppa_get_cookie( 'alb-arrow-' . $id ) == 'on' ) {
|
3184 |
$the_js = '
|
3185 |
jQuery(document).ready(function(){
|
3215 |
$nm = $counts['pendselfphotos'];
|
3216 |
$ns = $counts['scheduledselfphotos'];
|
3217 |
|
3218 |
+
// The album name and description
|
3219 |
$result .= '
|
3220 |
<td>' . esc_html( stripslashes( $album['name'] ) ) . '</td>
|
3221 |
+
<td><small>' . esc_html( stripslashes( $album['description'] ) ) . '</small></td>';
|
3222 |
+
|
3223 |
+
// The owner. Make sure he exists
|
3224 |
+
if ( current_user_can( 'administrator' ) ) {
|
3225 |
+
$album_owner = $album['owner'];
|
3226 |
+
if ( $album_owner == '--- public ---' || get_user_by( 'login', $album_owner ) ) {
|
3227 |
+
$result .= '
|
3228 |
+
<td>' . $album_owner . '</td>';
|
3229 |
+
}
|
3230 |
+
else {
|
3231 |
+
$result .= '
|
3232 |
+
<td>' . __( '--- unknown ---', 'wp-photo-album-plus' ) . '</td>';
|
3233 |
+
}
|
3234 |
+
}
|
3235 |
+
|
3236 |
+
// Order
|
3237 |
+
$result .= '
|
3238 |
<td>' . $album['a_order'] . '</td>
|
3239 |
<td>' . esc_html( stripslashes( wppa_get_album_name( $album['a_parent'], ['extended' => true] ) ) ) . '</td>
|
3240 |
<td>' . $na . '/' . $np . '/' . $nm . '/' . $ns . '</td>';
|
3278 |
}
|
3279 |
if ( wppa_can_create_album() ) {
|
3280 |
$url = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&parent_id=' . $id . '&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
|
3281 |
+
$onc = 'if (confirm(\''.__( 'Are you sure you want to create a sub album?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
|
3282 |
$result .= '<td><a onclick="' . $onc . '" class="wppacreate">' . __( 'Create', 'wp-photo-album-plus' ) . '</a></td>';
|
3283 |
}
|
3284 |
}
|
3300 |
}
|
3301 |
}
|
3302 |
|
3303 |
+
// Find accessable sub albums
|
3304 |
function wppa_have_accessible_children( $alb ) {
|
3305 |
global $wpdb;
|
3306 |
|
3364 |
wppa_clear_cache( array( 'album' => $id ) );
|
3365 |
wppa_childlist_remove( $id );
|
3366 |
|
3367 |
+
$msg = __( 'Album deleted.' , 'wp-photo-album-plus' );
|
3368 |
if ( wppa( 'ajax' ) ) {
|
3369 |
wppa_echo( $msg );
|
3370 |
}
|
3389 |
$opts = array( __( '--- random ---', 'wp-photo-album-plus' ),
|
3390 |
__( '--- random featured ---', 'wp-photo-album-plus' ),
|
3391 |
__( '--- most recent added ---', 'wp-photo-album-plus' ),
|
3392 |
+
__( '--- random from (sub-)sub albums ---', 'wp-photo-album-plus' ),
|
3393 |
+
__( '--- most recent from (sub-)sub albums ---', 'wp-photo-album-plus' ),
|
3394 |
__( '--- according to albums photo sequence ---', 'wp-photo-album-plus' ),
|
3395 |
);
|
3396 |
$vals = array( '-9', '-1', '-2', '-3', '-4', '-5' );
|
3516 |
}
|
3517 |
}
|
3518 |
|
3519 |
+
// Sub album order
|
3520 |
if ( $parent ) {
|
3521 |
|
3522 |
$sel = ' selected';
|
3546 |
<div style="margin-left:6px">
|
3547 |
<label
|
3548 |
for="subalbumorder">' .
|
3549 |
+
__( 'Sub album sequence method', 'wp-photo-album-plus' ) . '
|
3550 |
</label><br>
|
3551 |
<select
|
3552 |
id="subalbumorder"
|
3582 |
else {
|
3583 |
$result = '
|
3584 |
<br>' .
|
3585 |
+
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.' );
|
3586 |
}
|
3587 |
$result .= '<br>';
|
3588 |
|
3930 |
|
3931 |
$result = '
|
3932 |
<div class="wrap" >
|
3933 |
+
<h1 class="wp-heading-inline">' .
|
3934 |
+
get_admin_page_title() . '
|
3935 |
+
</h1>
|
3936 |
<div style="clear:both"> </div>
|
3937 |
+
<h3>' .
|
3938 |
+
esc_html__( 'Search for photos to edit', 'wp-photo-album-plus' ) . '
|
3939 |
+
</h3>' .
|
3940 |
+
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' ) . '
|
3941 |
+
<br>
|
3942 |
<table class="wppa-table widefat wppa-setting-table" style="margin-top:12px">
|
3943 |
<thead>
|
3944 |
</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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -891,8 +891,10 @@ global $wpdb;
|
|
891 |
return;
|
892 |
}
|
893 |
|
894 |
-
|
895 |
-
|
|
|
|
|
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( $
|
915 |
-
if ( wppa_is_file( wppa_get_thumb_path( $
|
916 |
$posterurl = $thumburl;
|
917 |
}
|
918 |
else {
|
@@ -977,173 +979,186 @@ global $wpdb;
|
|
977 |
$photoframestyle .
|
978 |
' >' );
|
979 |
|
980 |
-
|
981 |
-
|
982 |
|
983 |
-
|
984 |
-
|
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 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
998 |
}
|
|
|
|
|
999 |
else {
|
1000 |
-
$
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
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
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
|
|
|
|
|
|
|
|
|
|
1036 |
);
|
1037 |
}
|
|
|
|
|
1038 |
else {
|
1039 |
wppa_out(
|
1040 |
-
'<img
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
|
|
|
|
|
|
1044 |
);
|
1045 |
}
|
|
|
1046 |
}
|
1047 |
-
|
1048 |
-
// Close the lightbox anchor tag
|
1049 |
-
wppa_out( "\n\t" . '</a>' );
|
1050 |
}
|
1051 |
-
}
|
1052 |
|
1053 |
-
|
1054 |
-
|
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 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
}
|
1080 |
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
|
|
1092 |
}
|
1093 |
-
wppa_out( '</a>' );
|
1094 |
-
}
|
1095 |
-
}
|
1096 |
|
1097 |
-
|
1098 |
-
|
1099 |
|
1100 |
-
//
|
1101 |
-
|
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 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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( $
|
1178 |
-
$src = wppa_fix_poster_ext( $src, $
|
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 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
$
|
1209 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1210 |
}
|
1211 |
|
1212 |
-
|
1213 |
-
|
1214 |
-
$has_audio = wppa_has_audio( $thumb['id'] );
|
1215 |
-
$is_pdf = wppa_is_pdf( $thumb['id'] );
|
1216 |
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
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 |
-
|
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( $
|
1247 |
'</video>'
|
1248 |
);
|
1249 |
}
|
1250 |
else {
|
1251 |
-
|
|
|
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 |
-
|
1268 |
-
|
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 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
|
|
1290 |
);
|
1291 |
}
|
1292 |
-
else {
|
1293 |
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
|
|
1302 |
);
|
1303 |
}
|
1304 |
-
wppa_out( '</a> ' );
|
1305 |
}
|
1306 |
-
}
|
1307 |
|
1308 |
-
|
1309 |
-
|
1310 |
|
1311 |
-
|
1312 |
-
|
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
|
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
|
2027 |
foreach( $subs as $album ) {
|
2028 |
|
2029 |
// The album id
|
2030 |
$albumid = $album['id'];
|
2031 |
|
2032 |
-
// This
|
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
|
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 |
-
//
|
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.
|
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
|
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
|
444 |
-
wppa_widget_checkbox( $this, 'subs', $instance['subs'], __( 'Include
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -49,7 +49,7 @@ function wppa_thumb_area( $action ) {
|
|
49 |
$result .= '<div class="wppa-nicewrap" >';
|
50 |
}
|
51 |
|
52 |
-
// Display create
|
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
|
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
|
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 . '&wppa-cover=0&wppa-occur=' . $occur;
|
2576 |
}
|
2577 |
-
if ( wppa( 'page' ) ) $returnurl .= '&
|
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
|
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
|
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
|
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 .= '&
|
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
|
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 . '&wppa-cover=0&wppa-occur=' . $occur;
|
2576 |
}
|
2577 |
+
if ( wppa( 'page' ) ) $returnurl .= '&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 .= '&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.
|
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
|
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' ) ? '&
|
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.'&
|
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.
|
7 |
*/
|
8 |
|
9 |
// Test for caching
|
@@ -30,7 +30,7 @@ global $wppa_lang;
|
|
30 |
if ( wppa( 'cache' ) ) {
|
31 |
|
32 |
// No querystring?
|
33 |
-
if (
|
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.
|
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
|
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 |
-
$
|
|
|
|
|
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 |
-
|
318 |
-
$
|
|
|
|
|
|
|
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 |
-
|
|
|
|
|
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 |
-
(
|
358 |
-
|
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.001
|
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']; //wppa_opt( 'comment_admin_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.
|
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( '
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -941,8 +941,6 @@ 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',
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains default settings
|
6 |
+
* Version 8.3.01.001
|
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_comment_admin_pagesize' => '10',
|
946 |
'wppa_email_admin_pagesize' => '20',
|
wppa-edit-email.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all comments
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -24,33 +24,21 @@ global $wpdb;
|
|
24 |
);
|
25 |
$url = get_admin_url().'admin.php?page=wppa_edit_email';
|
26 |
|
27 |
-
//
|
28 |
-
$
|
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 = $
|
42 |
|
43 |
// Get users
|
44 |
$total = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users" ); // get_users( ['count_total'=>true] );
|
45 |
-
$
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
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 |
-
|
105 |
'</h1>' );
|
106 |
if ( ! wppa_switch( 'email_on' ) ) {
|
107 |
wppa_echo( '
|
108 |
<span style="color:red;display:inline">' .
|
109 |
-
|
110 |
( current_user_can( 'wppa_settings' ) ? wppa_see_also( 'general', '1', '7' ) : '' ) . '
|
111 |
</span>' );
|
112 |
}
|
113 |
|
114 |
-
|
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:
|
124 |
-
<col style="width:
|
125 |
-
<col style="width:
|
126 |
-
<col style="
|
127 |
-
<col style="
|
128 |
-
<col style="
|
129 |
-
<col style="
|
130 |
-
<col style="
|
131 |
-
<col style="
|
132 |
-
<col style="
|
133 |
-
<col style="
|
134 |
</colgroup>
|
135 |
<thead>
|
136 |
<tr>
|
137 |
<td
|
138 |
style="cursor:pointer"
|
139 |
-
onclick="document.location.href=\'' .
|
140 |
-
( $order == 'ID' ? $useimg : '' ) . esc_html__( 'Id', 'wp-photo-album-plus' ) . '
|
141 |
</td>
|
142 |
<td
|
143 |
style="cursor:pointer"
|
144 |
-
onclick="document.location.href=\'' .
|
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=\'' .
|
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 |
-
|
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.
|
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 |
-
|
16 |
-
|
17 |
$result = '
|
18 |
<div class="wrap">
|
19 |
|
20 |
-
<
|
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.
|
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 |
-
<
|
48 |
-
<
|
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>' .
|
58 |
-
<td>' .
|
59 |
-
<td>' .
|
60 |
-
<td>' .
|
61 |
-
<td>' .
|
62 |
-
<td>' .
|
63 |
-
<td>' .
|
64 |
</tr>
|
65 |
</thead>
|
66 |
<tbody class="wppa_table_8">
|
67 |
-
<tr
|
68 |
-
|
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;
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -31,9 +31,9 @@ global $wppa_try_continue;
|
|
31 |
// Open the page
|
32 |
wppa_echo( '
|
33 |
<div class="wrap">
|
34 |
-
<
|
35 |
-
|
36 |
-
</
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -132,7 +132,7 @@ global $other_deps;
|
|
132 |
wppa( 'photos_only', true );
|
133 |
}
|
134 |
|
135 |
-
wppa( 'page', wppa_get( '
|
136 |
|
137 |
if ( wppa_get( 'superview' ) ) {
|
138 |
$wppa_session['superview'] = wppa( 'is_slide' ) ? 'slide': 'thumbs';
|
@@ -3758,7 +3758,7 @@ function wppa_get_curpage() {
|
|
3758 |
if ( wppa( 'mocc' ) == wppa_get( 'occur', '1' ) ) {
|
3759 |
|
3760 |
// page may be in qstring
|
3761 |
-
$curpage = wppa_get( '
|
3762 |
}
|
3763 |
else {
|
3764 |
|
@@ -4675,6 +4675,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 +4694,9 @@ function wppa_is_photo_modified( $id ) {
|
|
4691 |
}
|
4692 |
|
4693 |
$thumb = wppa_cache_photo( $id );
|
|
|
|
|
|
|
4694 |
|
4695 |
$cretime = $thumb['timestamp'];
|
4696 |
$modtime = $thumb['modified'];
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
+
* Version 8.3.01.001
|
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';
|
3758 |
if ( wppa( 'mocc' ) == wppa_get( 'occur', '1' ) ) {
|
3759 |
|
3760 |
// page may be in qstring
|
3761 |
+
$curpage = wppa_get( 'paged', '1' );
|
3762 |
}
|
3763 |
else {
|
3764 |
|
4675 |
}
|
4676 |
|
4677 |
$thumb = wppa_cache_photo( $id );
|
4678 |
+
if ( ! $thumb ) { // Photo vanished?
|
4679 |
+
return false;
|
4680 |
+
}
|
4681 |
|
4682 |
$birthtime = $thumb['timestamp'];
|
4683 |
$timnow = time();
|
4694 |
}
|
4695 |
|
4696 |
$thumb = wppa_cache_photo( $id );
|
4697 |
+
if ( ! $thumb ) { // Photo vanished?
|
4698 |
+
return false;
|
4699 |
+
}
|
4700 |
|
4701 |
$cretime = $thumb['timestamp'];
|
4702 |
$modtime = $thumb['modified'];
|
wppa-gutenberg-wppa.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-gutenberg-wppa.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
-
* Version 8.
|
6 |
*/
|
7 |
|
8 |
function wppa_gutenberg_wppa_block() {
|
@@ -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
|
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.
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -197,7 +197,11 @@ global $wppa_session;
|
|
197 |
}
|
198 |
|
199 |
// Open the Form
|
200 |
-
wppa_echo( '
|
|
|
|
|
|
|
|
|
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.
|
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
|
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
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -58,7 +58,7 @@ function wppa_get_get_filter( $name ) {
|
|
58 |
case 'comten':
|
59 |
case 'featen':
|
60 |
case 'relcount':
|
61 |
-
case '
|
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.
|
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
|
237 |
-
wppa_widget_checkbox( $this, 'includesubs', $instance['includesubs'], __( 'Include
|
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.
|
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( '
|
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 = '
|
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 . '&
|
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 . '&
|
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 . '&
|
1154 |
' >' .
|
1155 |
' ' . $i . ' ' .
|
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 . '&
|
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 . '&
|
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 . '&
|
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 . '&
|
1262 |
> '.$i.' </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 . '&
|
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
|
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 .= '&
|
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 . '&paged=' . ( $curpage - 1 ) . '\', \'' . wppa_convert_to_pretty ( $link_url . '&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 . '&paged=' . ( $curpage + 1 ) . '\', \'' . wppa_convert_to_pretty( $link_url . '&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 . '&paged=' . $i . '\', \'' . wppa_convert_to_pretty( $link_url . '&paged=' . $i ) . '\')"' .
|
1154 |
' >' .
|
1155 |
' ' . $i . ' ' .
|
1156 |
'</a>';
|
1170 |
$result .= '
|
1171 |
<a
|
1172 |
id="wppa-first-pagelink-' . $mocc . '"
|
1173 |
+
onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&paged=1\', \'' . wppa_convert_to_pretty( $link_url . '&paged=1' ) . '\')"
|
1174 |
>
|
1175 |
</a>
|
1176 |
<a
|
1211 |
</span>
|
1212 |
<a
|
1213 |
style="cursor:pointer"
|
1214 |
+
onclick="wppaDoAjaxRender(' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&paged=' . ( $curpage - 1 ) . '\', \'' . wppa_convert_to_pretty( $link_url . '&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 . '&paged=' . ( $curpage + 1 ) . '\', \'' . wppa_convert_to_pretty( $link_url . '&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 . '&paged=' . $i . '\', \'' . wppa_convert_to_pretty( $link_url . '&paged=' . $i ) . '\')"
|
1262 |
> '.$i.' </a
|
1263 |
>
|
1264 |
</div>';
|
1274 |
$result .= '
|
1275 |
<a
|
1276 |
id="wppa-first-pagelink-' . $mocc . '"
|
1277 |
+
onclick="wppaDoAjaxRender( ' . wppa( 'mocc' ) . ', \'' . $ajax_url . '&paged=1\', \'' . wppa_convert_to_pretty( $link_url . '&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 .= '&paged='.$page;
|
2122 |
}
|
2123 |
}
|
2124 |
|
wppa-listtable.php
ADDED
@@ -0,0 +1,1314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.001
|
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">—</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 |
+
$total_pages = $this->_pagination_args['total_pages'];
|
665 |
+
$infinite_scroll = false;
|
666 |
+
if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
|
667 |
+
$infinite_scroll = $this->_pagination_args['infinite_scroll'];
|
668 |
+
}
|
669 |
+
|
670 |
+
if ( 'top' === $which && $total_pages > 1 ) {
|
671 |
+
$this->screen->render_screen_reader_content( 'heading_pagination' );
|
672 |
+
}
|
673 |
+
|
674 |
+
$output = '<span class="displaying-num">' . sprintf(
|
675 |
+
/* translators: %s: Number of items. */
|
676 |
+
_n( '%s item', '%s items', $total_items ),
|
677 |
+
number_format_i18n( $total_items )
|
678 |
+
) . '</span>';
|
679 |
+
|
680 |
+
$current = $this->get_pagenum();
|
681 |
+
$removable_query_args = wp_removable_query_args();
|
682 |
+
|
683 |
+
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
684 |
+
|
685 |
+
$current_url = remove_query_arg( $removable_query_args, $current_url );
|
686 |
+
|
687 |
+
$page_links = array();
|
688 |
+
|
689 |
+
$total_pages_before = '<span class="paging-input">';
|
690 |
+
$total_pages_after = '</span></span>';
|
691 |
+
|
692 |
+
$disable_first = false;
|
693 |
+
$disable_last = false;
|
694 |
+
$disable_prev = false;
|
695 |
+
$disable_next = false;
|
696 |
+
|
697 |
+
if ( 1 == $current ) {
|
698 |
+
$disable_first = true;
|
699 |
+
$disable_prev = true;
|
700 |
+
}
|
701 |
+
if ( $total_pages == $current ) {
|
702 |
+
$disable_last = true;
|
703 |
+
$disable_next = true;
|
704 |
+
}
|
705 |
+
|
706 |
+
if ( $disable_first ) {
|
707 |
+
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">«</span>';
|
708 |
+
} else {
|
709 |
+
$page_links[] = sprintf(
|
710 |
+
"<a class='first-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
711 |
+
esc_url( remove_query_arg( 'paged', $current_url ) ),
|
712 |
+
__( 'First page' ),
|
713 |
+
'«'
|
714 |
+
);
|
715 |
+
}
|
716 |
+
|
717 |
+
if ( $disable_prev ) {
|
718 |
+
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">‹</span>';
|
719 |
+
} else {
|
720 |
+
$page_links[] = sprintf(
|
721 |
+
"<a class='prev-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
722 |
+
esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),
|
723 |
+
__( 'Previous page' ),
|
724 |
+
'‹'
|
725 |
+
);
|
726 |
+
}
|
727 |
+
|
728 |
+
if ( 'bottom' === $which ) {
|
729 |
+
$html_current_page = $current;
|
730 |
+
$total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">';
|
731 |
+
} else {
|
732 |
+
$html_current_page = sprintf(
|
733 |
+
"%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'>",
|
734 |
+
'<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
|
735 |
+
$current,
|
736 |
+
strlen( $total_pages )
|
737 |
+
);
|
738 |
+
}
|
739 |
+
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
|
740 |
+
$page_links[] = $total_pages_before . sprintf(
|
741 |
+
/* translators: 1: Current page, 2: Total pages. */
|
742 |
+
_x( '%1$s of %2$s', 'paging' ),
|
743 |
+
$html_current_page,
|
744 |
+
$html_total_pages
|
745 |
+
) . $total_pages_after;
|
746 |
+
|
747 |
+
if ( $disable_next ) {
|
748 |
+
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">›</span>';
|
749 |
+
} else {
|
750 |
+
$page_links[] = sprintf(
|
751 |
+
"<a class='next-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
752 |
+
esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),
|
753 |
+
__( 'Next page' ),
|
754 |
+
'›'
|
755 |
+
);
|
756 |
+
}
|
757 |
+
|
758 |
+
if ( $disable_last ) {
|
759 |
+
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">»</span>';
|
760 |
+
} else {
|
761 |
+
$page_links[] = sprintf(
|
762 |
+
"<a class='last-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
763 |
+
esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
|
764 |
+
__( 'Last page' ),
|
765 |
+
'»'
|
766 |
+
);
|
767 |
+
}
|
768 |
+
|
769 |
+
$pagination_links_class = 'pagination-links';
|
770 |
+
if ( ! empty( $infinite_scroll ) ) {
|
771 |
+
$pagination_links_class .= ' hide-if-js';
|
772 |
+
}
|
773 |
+
$output .= "\n<span class='$pagination_links_class'>" . implode( "\n", $page_links ) . '</span>';
|
774 |
+
|
775 |
+
if ( $total_pages ) {
|
776 |
+
$page_class = $total_pages < 2 ? ' one-page' : '';
|
777 |
+
} else {
|
778 |
+
$page_class = ' no-pages';
|
779 |
+
}
|
780 |
+
|
781 |
+
/**/
|
782 |
+
// Added by OpaJaap: page size selector
|
783 |
+
$ps = $this->_pagination_args['per_page']; // current pagesize
|
784 |
+
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
785 |
+
$current_url = remove_query_arg( 'paged', $current_url );
|
786 |
+
$output .= '
|
787 |
+
<span>' . __( 'Page size', 'wp-photo-album-plus' ) . '
|
788 |
+
<select
|
789 |
+
style="margin-bottom:3px"
|
790 |
+
onchange="jQuery( \'#wppa-admin-spinner\' ).show();document.location.href=\''.$current_url.'&paged=1&wppa-pagesize=\'+this.value;"
|
791 |
+
>
|
792 |
+
<option value="20" ' . ( $ps == '20' ? 'selected' : '' ) . '>20</option>
|
793 |
+
<option value="50" ' . ( $ps == '50' ? 'selected' : '' ) . '>50</option>
|
794 |
+
<option value="100" ' . ( $ps == '100' ? 'selected' : '' ) . '>100</option>
|
795 |
+
<option value="200" ' . ( $ps == '200' ? 'selected' : '' ) . '>200</option>
|
796 |
+
<option value="500" ' . ( $ps == '500' ? 'selected' : '' ) . '>500</option>
|
797 |
+
<option value="1000" ' . ( $ps == '1000' ? 'selected' : '' ) . '>1000</option>
|
798 |
+
</select>
|
799 |
+
</span>';
|
800 |
+
/**/
|
801 |
+
|
802 |
+
$this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
|
803 |
+
|
804 |
+
echo $this->_pagination;
|
805 |
+
}
|
806 |
+
|
807 |
+
// Gets a list of columns.
|
808 |
+
public function get_columns() {
|
809 |
+
die( 'function WP_List_Table::get_columns() must be overridden in a subclass.' );
|
810 |
+
}
|
811 |
+
|
812 |
+
// Gets a list of sortable columns.
|
813 |
+
protected function get_sortable_columns() {
|
814 |
+
return array();
|
815 |
+
}
|
816 |
+
|
817 |
+
// Gets the name of the default primary column.
|
818 |
+
protected function get_default_primary_column_name() {
|
819 |
+
$columns = $this->get_columns();
|
820 |
+
$column = '';
|
821 |
+
|
822 |
+
if ( empty( $columns ) ) {
|
823 |
+
return $column;
|
824 |
+
}
|
825 |
+
|
826 |
+
// We need a primary defined so responsive views show something,
|
827 |
+
// so let's fall back to the first non-checkbox column.
|
828 |
+
foreach ( $columns as $col => $column_name ) {
|
829 |
+
if ( 'cb' === $col ) {
|
830 |
+
continue;
|
831 |
+
}
|
832 |
+
|
833 |
+
$column = $col;
|
834 |
+
break;
|
835 |
+
}
|
836 |
+
|
837 |
+
return $column;
|
838 |
+
}
|
839 |
+
|
840 |
+
/**
|
841 |
+
* Public wrapper for WP_List_Table::get_default_primary_column_name().
|
842 |
+
*
|
843 |
+
* @since 4.4.0
|
844 |
+
*
|
845 |
+
* @return string Name of the default primary column.
|
846 |
+
*/
|
847 |
+
public function get_primary_column() {
|
848 |
+
return $this->get_primary_column_name();
|
849 |
+
}
|
850 |
+
|
851 |
+
/**
|
852 |
+
* Gets the name of the primary column.
|
853 |
+
*
|
854 |
+
* @since 4.3.0
|
855 |
+
*
|
856 |
+
* @return string The name of the primary column.
|
857 |
+
*/
|
858 |
+
protected function get_primary_column_name() {
|
859 |
+
$columns = get_column_headers( $this->screen );
|
860 |
+
$default = $this->get_default_primary_column_name();
|
861 |
+
|
862 |
+
// If the primary column doesn't exist,
|
863 |
+
// fall back to the first non-checkbox column.
|
864 |
+
if ( ! isset( $columns[ $default ] ) ) {
|
865 |
+
$default = self::get_default_primary_column_name();
|
866 |
+
}
|
867 |
+
|
868 |
+
/**
|
869 |
+
* Filters the name of the primary column for the current list table.
|
870 |
+
*
|
871 |
+
* @since 4.3.0
|
872 |
+
*
|
873 |
+
* @param string $default Column name default for the specific list table, e.g. 'name'.
|
874 |
+
* @param string $context Screen ID for specific list table, e.g. 'plugins'.
|
875 |
+
*/
|
876 |
+
$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
|
877 |
+
|
878 |
+
if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
|
879 |
+
$column = $default;
|
880 |
+
}
|
881 |
+
|
882 |
+
return $column;
|
883 |
+
}
|
884 |
+
|
885 |
+
/**
|
886 |
+
* Gets a list of all, hidden, and sortable columns, with filter applied.
|
887 |
+
*
|
888 |
+
* @since 3.1.0
|
889 |
+
*
|
890 |
+
* @return array
|
891 |
+
*/
|
892 |
+
protected function get_column_info() {
|
893 |
+
// $_column_headers is already set / cached.
|
894 |
+
if (
|
895 |
+
isset( $this->_column_headers ) &&
|
896 |
+
is_array( $this->_column_headers )
|
897 |
+
) {
|
898 |
+
/*
|
899 |
+
* Backward compatibility for `$_column_headers` format prior to WordPress 4.3.
|
900 |
+
*
|
901 |
+
* In WordPress 4.3 the primary column name was added as a fourth item in the
|
902 |
+
* column headers property. This ensures the primary column name is included
|
903 |
+
* in plugins setting the property directly in the three item format.
|
904 |
+
*/
|
905 |
+
if ( 4 === count( $this->_column_headers ) ) {
|
906 |
+
return $this->_column_headers;
|
907 |
+
}
|
908 |
+
|
909 |
+
$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
|
910 |
+
foreach ( $this->_column_headers as $key => $value ) {
|
911 |
+
$column_headers[ $key ] = $value;
|
912 |
+
}
|
913 |
+
|
914 |
+
$this->_column_headers = $column_headers;
|
915 |
+
|
916 |
+
return $this->_column_headers;
|
917 |
+
}
|
918 |
+
|
919 |
+
$columns = get_column_headers( $this->screen );
|
920 |
+
$hidden = get_hidden_columns( $this->screen );
|
921 |
+
|
922 |
+
$sortable_columns = $this->get_sortable_columns();
|
923 |
+
/**
|
924 |
+
* Filters the list table sortable columns for a specific screen.
|
925 |
+
*
|
926 |
+
* The dynamic portion of the hook name, `$this->screen->id`, refers
|
927 |
+
* to the ID of the current screen.
|
928 |
+
*
|
929 |
+
* @since 3.1.0
|
930 |
+
*
|
931 |
+
* @param array $sortable_columns An array of sortable columns.
|
932 |
+
*/
|
933 |
+
$_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
|
934 |
+
|
935 |
+
$sortable = array();
|
936 |
+
foreach ( $_sortable as $id => $data ) {
|
937 |
+
if ( empty( $data ) ) {
|
938 |
+
continue;
|
939 |
+
}
|
940 |
+
|
941 |
+
$data = (array) $data;
|
942 |
+
if ( ! isset( $data[1] ) ) {
|
943 |
+
$data[1] = false;
|
944 |
+
}
|
945 |
+
|
946 |
+
$sortable[ $id ] = $data;
|
947 |
+
}
|
948 |
+
|
949 |
+
$primary = $this->get_primary_column_name();
|
950 |
+
$this->_column_headers = array( $columns, $hidden, $sortable, $primary );
|
951 |
+
|
952 |
+
return $this->_column_headers;
|
953 |
+
}
|
954 |
+
|
955 |
+
/**
|
956 |
+
* Returns the number of visible columns.
|
957 |
+
*
|
958 |
+
* @since 3.1.0
|
959 |
+
*
|
960 |
+
* @return int
|
961 |
+
*/
|
962 |
+
public function get_column_count() {
|
963 |
+
list ( $columns, $hidden ) = $this->get_column_info();
|
964 |
+
$hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
|
965 |
+
return count( $columns ) - count( $hidden );
|
966 |
+
}
|
967 |
+
|
968 |
+
/**
|
969 |
+
* Prints column headers, accounting for hidden and sortable columns.
|
970 |
+
*
|
971 |
+
* @since 3.1.0
|
972 |
+
*
|
973 |
+
* @param bool $with_id Whether to set the ID attribute or not
|
974 |
+
*/
|
975 |
+
public function print_column_headers( $with_id = true ) {
|
976 |
+
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
977 |
+
|
978 |
+
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
979 |
+
$current_url = remove_query_arg( 'paged', $current_url );
|
980 |
+
|
981 |
+
if ( isset( $_GET['orderby'] ) ) {
|
982 |
+
$current_orderby = $_GET['orderby'];
|
983 |
+
} else {
|
984 |
+
$current_orderby = '';
|
985 |
+
}
|
986 |
+
|
987 |
+
if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {
|
988 |
+
$current_order = 'desc';
|
989 |
+
} else {
|
990 |
+
$current_order = 'asc';
|
991 |
+
}
|
992 |
+
|
993 |
+
if ( ! empty( $columns['cb'] ) ) {
|
994 |
+
static $cb_counter = 1;
|
995 |
+
$columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
|
996 |
+
. '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
|
997 |
+
$cb_counter++;
|
998 |
+
}
|
999 |
+
|
1000 |
+
foreach ( $columns as $column_key => $column_display_name ) {
|
1001 |
+
$class = array( 'manage-column', "column-$column_key" );
|
1002 |
+
|
1003 |
+
if ( in_array( $column_key, $hidden, true ) ) {
|
1004 |
+
$class[] = 'hidden';
|
1005 |
+
}
|
1006 |
+
|
1007 |
+
if ( 'cb' === $column_key ) {
|
1008 |
+
$class[] = 'check-column';
|
1009 |
+
} elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ), true ) ) {
|
1010 |
+
$class[] = 'num';
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
if ( $column_key === $primary ) {
|
1014 |
+
$class[] = 'column-primary';
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
if ( isset( $sortable[ $column_key ] ) ) {
|
1018 |
+
list( $orderby, $desc_first ) = $sortable[ $column_key ];
|
1019 |
+
|
1020 |
+
if ( $current_orderby === $orderby ) {
|
1021 |
+
$order = 'asc' === $current_order ? 'desc' : 'asc';
|
1022 |
+
|
1023 |
+
$class[] = 'sorted';
|
1024 |
+
$class[] = $current_order;
|
1025 |
+
} else {
|
1026 |
+
$order = strtolower( $desc_first );
|
1027 |
+
|
1028 |
+
if ( ! in_array( $order, array( 'desc', 'asc' ), true ) ) {
|
1029 |
+
$order = $desc_first ? 'desc' : 'asc';
|
1030 |
+
}
|
1031 |
+
|
1032 |
+
$class[] = 'sortable';
|
1033 |
+
$class[] = 'desc' === $order ? 'asc' : 'desc';
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
$column_display_name = sprintf(
|
1037 |
+
'<a href="%s"><span>%s</span><span class="sorting-indicator"></span></a>',
|
1038 |
+
esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ),
|
1039 |
+
$column_display_name
|
1040 |
+
);
|
1041 |
+
}
|
1042 |
+
|
1043 |
+
$tag = ( 'cb' === $column_key ) ? 'td' : 'th';
|
1044 |
+
$scope = ( 'th' === $tag ) ? 'scope="col"' : '';
|
1045 |
+
$id = $with_id ? "id='$column_key'" : '';
|
1046 |
+
|
1047 |
+
if ( ! empty( $class ) ) {
|
1048 |
+
$class = "class='" . implode( ' ', $class ) . "'";
|
1049 |
+
}
|
1050 |
+
|
1051 |
+
echo "<$tag $scope $id $class>$column_display_name</$tag>";
|
1052 |
+
}
|
1053 |
+
}
|
1054 |
+
|
1055 |
+
/**
|
1056 |
+
* Displays the table.
|
1057 |
+
*
|
1058 |
+
* @since 3.1.0
|
1059 |
+
*/
|
1060 |
+
public function display() {
|
1061 |
+
$singular = $this->_args['singular'];
|
1062 |
+
|
1063 |
+
$this->display_tablenav( 'top' );
|
1064 |
+
|
1065 |
+
$this->screen->render_screen_reader_content( 'heading_list' );
|
1066 |
+
?>
|
1067 |
+
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
|
1068 |
+
<thead>
|
1069 |
+
<tr>
|
1070 |
+
<?php $this->print_column_headers(); ?>
|
1071 |
+
</tr>
|
1072 |
+
</thead>
|
1073 |
+
|
1074 |
+
<tbody id="the-list"
|
1075 |
+
<?php
|
1076 |
+
if ( $singular ) {
|
1077 |
+
echo " data-wp-lists='list:$singular'";
|
1078 |
+
}
|
1079 |
+
?>
|
1080 |
+
>
|
1081 |
+
<?php $this->display_rows_or_placeholder(); ?>
|
1082 |
+
</tbody>
|
1083 |
+
|
1084 |
+
<tfoot>
|
1085 |
+
<tr>
|
1086 |
+
<?php $this->print_column_headers( false ); ?>
|
1087 |
+
</tr>
|
1088 |
+
</tfoot>
|
1089 |
+
|
1090 |
+
</table>
|
1091 |
+
<?php
|
1092 |
+
$this->display_tablenav( 'bottom' );
|
1093 |
+
}
|
1094 |
+
|
1095 |
+
/**
|
1096 |
+
* Gets a list of CSS classes for the WP_List_Table table tag.
|
1097 |
+
*
|
1098 |
+
* @since 3.1.0
|
1099 |
+
*
|
1100 |
+
* @return string[] Array of CSS classes for the table tag.
|
1101 |
+
*/
|
1102 |
+
protected function get_table_classes() {
|
1103 |
+
$mode = get_user_setting( 'posts_list_mode', 'list' );
|
1104 |
+
|
1105 |
+
$mode_class = esc_attr( 'table-view-' . $mode );
|
1106 |
+
|
1107 |
+
return array( 'widefat', 'fixed', 'striped', $mode_class, $this->_args['plural'] );
|
1108 |
+
}
|
1109 |
+
|
1110 |
+
/**
|
1111 |
+
* Generates the table navigation above or below the table
|
1112 |
+
*
|
1113 |
+
* @since 3.1.0
|
1114 |
+
* @param string $which
|
1115 |
+
*/
|
1116 |
+
protected function display_tablenav( $which ) {
|
1117 |
+
if ( 'top' === $which ) {
|
1118 |
+
wp_nonce_field( 'bulk-' . $this->_args['plural'] );
|
1119 |
+
}
|
1120 |
+
?>
|
1121 |
+
<div class="tablenav <?php echo esc_attr( $which ); ?>">
|
1122 |
+
|
1123 |
+
<?php if ( $this->has_items() ) : ?>
|
1124 |
+
<div class="alignleft actions bulkactions">
|
1125 |
+
<?php $this->bulk_actions( $which ); ?>
|
1126 |
+
</div>
|
1127 |
+
<?php
|
1128 |
+
endif;
|
1129 |
+
$this->extra_tablenav( $which );
|
1130 |
+
$this->pagination( $which );
|
1131 |
+
?>
|
1132 |
+
|
1133 |
+
<br class="clear" />
|
1134 |
+
</div>
|
1135 |
+
<?php
|
1136 |
+
}
|
1137 |
+
|
1138 |
+
/**
|
1139 |
+
* Extra controls to be displayed between bulk actions and pagination.
|
1140 |
+
*
|
1141 |
+
* @since 3.1.0
|
1142 |
+
*
|
1143 |
+
* @param string $which
|
1144 |
+
*/
|
1145 |
+
protected function extra_tablenav( $which ) {}
|
1146 |
+
|
1147 |
+
/**
|
1148 |
+
* Generates the tbody element for the list table.
|
1149 |
+
*
|
1150 |
+
* @since 3.1.0
|
1151 |
+
*/
|
1152 |
+
public function display_rows_or_placeholder() {
|
1153 |
+
if ( $this->has_items() ) {
|
1154 |
+
$this->display_rows();
|
1155 |
+
} else {
|
1156 |
+
echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
|
1157 |
+
$this->no_items();
|
1158 |
+
echo '</td></tr>';
|
1159 |
+
}
|
1160 |
+
}
|
1161 |
+
|
1162 |
+
/**
|
1163 |
+
* Generates the table rows.
|
1164 |
+
*
|
1165 |
+
* @since 3.1.0
|
1166 |
+
*/
|
1167 |
+
public function display_rows() {
|
1168 |
+
foreach ( $this->items as $item ) {
|
1169 |
+
$this->single_row( $item );
|
1170 |
+
}
|
1171 |
+
}
|
1172 |
+
|
1173 |
+
/**
|
1174 |
+
* Generates content for a single row of the table.
|
1175 |
+
*
|
1176 |
+
* @since 3.1.0
|
1177 |
+
*
|
1178 |
+
* @param object|array $item The current item
|
1179 |
+
*/
|
1180 |
+
public function single_row( $item ) {
|
1181 |
+
echo '<tr>';
|
1182 |
+
$this->single_row_columns( $item );
|
1183 |
+
echo '</tr>';
|
1184 |
+
}
|
1185 |
+
|
1186 |
+
/**
|
1187 |
+
* @param object|array $item
|
1188 |
+
* @param string $column_name
|
1189 |
+
*/
|
1190 |
+
protected function column_default( $item, $column_name ) {}
|
1191 |
+
|
1192 |
+
/**
|
1193 |
+
* @param object|array $item
|
1194 |
+
*/
|
1195 |
+
protected function column_cb( $item ) {}
|
1196 |
+
|
1197 |
+
/**
|
1198 |
+
* Generates the columns for a single row of the table.
|
1199 |
+
*
|
1200 |
+
* @since 3.1.0
|
1201 |
+
*
|
1202 |
+
* @param object|array $item The current item.
|
1203 |
+
*/
|
1204 |
+
protected function single_row_columns( $item ) {
|
1205 |
+
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
1206 |
+
|
1207 |
+
foreach ( $columns as $column_name => $column_display_name ) {
|
1208 |
+
$classes = "$column_name column-$column_name";
|
1209 |
+
if ( $primary === $column_name ) {
|
1210 |
+
$classes .= ' has-row-actions column-primary';
|
1211 |
+
}
|
1212 |
+
|
1213 |
+
if ( in_array( $column_name, $hidden, true ) ) {
|
1214 |
+
$classes .= ' hidden';
|
1215 |
+
}
|
1216 |
+
|
1217 |
+
// Comments column uses HTML in the display name with screen reader text.
|
1218 |
+
// Strip tags to get closer to a user-friendly string.
|
1219 |
+
$data = 'data-colname="' . esc_attr( wp_strip_all_tags( $column_display_name ) ) . '"';
|
1220 |
+
|
1221 |
+
$attributes = "class='$classes' $data";
|
1222 |
+
|
1223 |
+
if ( 'cb' === $column_name ) {
|
1224 |
+
echo '<th scope="row" class="check-column">';
|
1225 |
+
echo $this->column_cb( $item );
|
1226 |
+
echo '</th>';
|
1227 |
+
} elseif ( method_exists( $this, '_column_' . $column_name ) ) {
|
1228 |
+
echo call_user_func(
|
1229 |
+
array( $this, '_column_' . $column_name ),
|
1230 |
+
$item,
|
1231 |
+
$classes,
|
1232 |
+
$data,
|
1233 |
+
$primary
|
1234 |
+
);
|
1235 |
+
} elseif ( method_exists( $this, 'column_' . $column_name ) ) {
|
1236 |
+
echo "<td $attributes>";
|
1237 |
+
echo call_user_func( array( $this, 'column_' . $column_name ), $item );
|
1238 |
+
echo $this->handle_row_actions( $item, $column_name, $primary );
|
1239 |
+
echo '</td>';
|
1240 |
+
} else {
|
1241 |
+
echo "<td $attributes>";
|
1242 |
+
echo $this->column_default( $item, $column_name );
|
1243 |
+
echo $this->handle_row_actions( $item, $column_name, $primary );
|
1244 |
+
echo '</td>';
|
1245 |
+
}
|
1246 |
+
}
|
1247 |
+
}
|
1248 |
+
|
1249 |
+
/**
|
1250 |
+
* Generates and display row actions links for the list table.
|
1251 |
+
*
|
1252 |
+
* @since 4.3.0
|
1253 |
+
*
|
1254 |
+
* @param object|array $item The item being acted upon.
|
1255 |
+
* @param string $column_name Current column name.
|
1256 |
+
* @param string $primary Primary column name.
|
1257 |
+
* @return string The row actions HTML, or an empty string
|
1258 |
+
* if the current column is not the primary column.
|
1259 |
+
*/
|
1260 |
+
protected function handle_row_actions( $item, $column_name, $primary ) {
|
1261 |
+
return $column_name === $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>' : '';
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
/**
|
1265 |
+
* Handles an incoming ajax request (called from admin-ajax.php)
|
1266 |
+
*
|
1267 |
+
* @since 3.1.0
|
1268 |
+
*/
|
1269 |
+
public function ajax_response() {
|
1270 |
+
$this->prepare_items();
|
1271 |
+
|
1272 |
+
ob_start();
|
1273 |
+
if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
|
1274 |
+
$this->display_rows();
|
1275 |
+
} else {
|
1276 |
+
$this->display_rows_or_placeholder();
|
1277 |
+
}
|
1278 |
+
|
1279 |
+
$rows = ob_get_clean();
|
1280 |
+
|
1281 |
+
$response = array( 'rows' => $rows );
|
1282 |
+
|
1283 |
+
if ( isset( $this->_pagination_args['total_items'] ) ) {
|
1284 |
+
$response['total_items_i18n'] = sprintf(
|
1285 |
+
/* translators: Number of items. */
|
1286 |
+
_n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
|
1287 |
+
number_format_i18n( $this->_pagination_args['total_items'] )
|
1288 |
+
);
|
1289 |
+
}
|
1290 |
+
if ( isset( $this->_pagination_args['total_pages'] ) ) {
|
1291 |
+
$response['total_pages'] = $this->_pagination_args['total_pages'];
|
1292 |
+
$response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
|
1293 |
+
}
|
1294 |
+
|
1295 |
+
die( wp_json_encode( $response ) );
|
1296 |
+
}
|
1297 |
+
|
1298 |
+
/**
|
1299 |
+
* Sends required variables to JavaScript land.
|
1300 |
+
*
|
1301 |
+
* @since 3.1.0
|
1302 |
+
*/
|
1303 |
+
public function _js_vars() {
|
1304 |
+
$args = array(
|
1305 |
+
'class' => get_class( $this ),
|
1306 |
+
'screen' => array(
|
1307 |
+
'id' => $this->screen->id,
|
1308 |
+
'base' => $this->screen->base,
|
1309 |
+
),
|
1310 |
+
);
|
1311 |
+
|
1312 |
+
printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
|
1313 |
+
}
|
1314 |
+
}
|
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.
|
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 |
-
|
1721 |
-
<h1 style="display:inline">' .
|
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.
|
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( '
|
|
|
|
|
|
|
|
|
24 |
wppa_album_photos( '', $photo );
|
25 |
-
wppa_echo( '
|
|
|
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( '
|
|
|
|
|
|
|
|
|
35 |
wppa_album_photos( '', '', wppa_get_user() );
|
36 |
-
wppa_echo( '
|
|
|
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( '
|
|
|
|
|
|
|
|
|
|
|
49 |
wppa_album_photos( '', $photo, '', false );
|
50 |
-
|
|
|
51 |
}
|
52 |
else {
|
53 |
-
wppa_echo( '
|
|
|
|
|
|
|
|
|
54 |
if ( wppa_switch( 'moderate_bulk' ) ) {
|
55 |
wppa_album_photos_bulk( 'moderate' );
|
56 |
}
|
57 |
else {
|
58 |
wppa_album_photos( '', $photo, '', true );
|
59 |
}
|
60 |
-
|
|
|
61 |
}
|
62 |
}
|
63 |
|
@@ -65,8 +86,20 @@ function _wppa_moderate_photos() {
|
|
65 |
function wppa_album_photos( $album = '', $photo = '', $owner = '', $moderate = false ) {
|
66 |
global $wpdb;
|
67 |
|
68 |
-
$
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
if ( ! is_numeric( $page ) ) $page = 1;
|
71 |
$skip = ( $page - '1' ) * $pagesize;
|
72 |
$album_is_obvious = false;
|
@@ -78,7 +111,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 |
|
@@ -243,7 +275,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
|
@@ -455,7 +487,7 @@ function wppaTryScheduledel( id ) {
|
|
455 |
$cpt = esc_attr( __( 'Copy photo', 'wp-photo-album-plus' ) );
|
456 |
|
457 |
// Display the pagelinks
|
458 |
-
|
459 |
|
460 |
// Horizon
|
461 |
wppa_echo( '<div id="wppa-horizon"><hr></div>' );
|
@@ -591,8 +623,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
|
@@ -2891,7 +2923,7 @@ function wppaTryScheduledel( id ) {
|
|
2891 |
|
2892 |
} /* foreach photo */
|
2893 |
|
2894 |
-
|
2895 |
|
2896 |
} /* photos not empty */
|
2897 |
} /* function */
|
@@ -3050,11 +3082,18 @@ function wppa_album_photos_bulk( $album ) {
|
|
3050 |
}
|
3051 |
}
|
3052 |
|
3053 |
-
$
|
3054 |
-
$
|
3055 |
-
|
3056 |
-
|
3057 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3058 |
|
3059 |
if ( $album ) {
|
3060 |
if ( $album == 'moderate' ) {
|
@@ -3099,7 +3138,8 @@ function wppa_album_photos_bulk( $album ) {
|
|
3099 |
|
3100 |
if ( $photos ) {
|
3101 |
$plink = $link . '&next-after=' . $next_after;
|
3102 |
-
|
|
|
3103 |
|
3104 |
$the_js = "
|
3105 |
function wppaTryMove( id, video ) {
|
@@ -3138,12 +3178,11 @@ function wppaTryMove( id, video ) {
|
|
3138 |
wppa_add_inline_script( 'wppa-admin', $the_js );
|
3139 |
|
3140 |
$result = '
|
3141 |
-
<form action="' . $link . '&
|
3142 |
wp_nonce_field( 'wppa-bulk', 'wppa-bulk' ) . '
|
3143 |
-
<
|
3144 |
-
|
3145 |
-
|
3146 |
-
<option value=""></option>';
|
3147 |
if ( $album == 'trash' ) {
|
3148 |
$result .= '
|
3149 |
<option value="wppa-bulk-delete-immediate">' . __( 'Remove permanently', 'wp-photo-album-plus' ) . '</option>
|
@@ -3252,10 +3291,9 @@ function wppaTryMove( id, video ) {
|
|
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">
|
@@ -3292,7 +3330,7 @@ function wppaTryMove( id, video ) {
|
|
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'] ) ) ?>" />
|
@@ -3464,12 +3502,12 @@ function wppaTryMove( id, video ) {
|
|
3464 |
</table>
|
3465 |
</form>
|
3466 |
<?php
|
3467 |
-
|
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 +3521,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 . '&
|
3487 |
}
|
3488 |
}
|
3489 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
+
* Version 8.3.01.002
|
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 photo', '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 |
+
$a = wppa_is_int( $album ) ? $album : '0';
|
90 |
+
|
91 |
+
$quick = wppa_get( 'quick' );
|
92 |
+
$slug = 'photo_admin';
|
93 |
+
if ( ! $a ) {
|
94 |
+
$slug .= '_' . $album;
|
95 |
+
}
|
96 |
+
if ( $quick ) $slug = 'photo_quick';
|
97 |
+
|
98 |
+
$parms = wppa_get_paging_parms( $slug );
|
99 |
+
|
100 |
+
$pagesize = $parms['pagesize'];
|
101 |
+
$page = $parms['page'];
|
102 |
+
|
103 |
if ( ! is_numeric( $page ) ) $page = 1;
|
104 |
$skip = ( $page - '1' ) * $pagesize;
|
105 |
$album_is_obvious = false;
|
111 |
if ( $album == 'search' ) {
|
112 |
$count = wppa_get_edit_search_photos( '', '', 'count_only' );
|
113 |
$photos = wppa_get_edit_search_photos( $skip, $pagesize );
|
|
|
114 |
$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' );
|
115 |
}
|
116 |
|
275 |
|
276 |
// Search
|
277 |
if ( wppa_get( 'searchstring' ) ) {
|
278 |
+
wppa_echo( '<h1>' . esc_html__( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . ' 1</h1>' );
|
279 |
}
|
280 |
|
281 |
// Album
|
487 |
$cpt = esc_attr( __( 'Copy photo', 'wp-photo-album-plus' ) );
|
488 |
|
489 |
// Display the pagelinks
|
490 |
+
wppa_admin_pagination( $pagesize, $page, $count, $link, 'top' );
|
491 |
|
492 |
// Horizon
|
493 |
wppa_echo( '<div id="wppa-horizon"><hr></div>' );
|
623 |
wppa_echo( '
|
624 |
<div
|
625 |
id="photoitem-' . $id . '"
|
626 |
+
class="wppa-table-wrap photoitem"
|
627 |
+
style="display:block;padding:20px;clear:both;"
|
628 |
>' .
|
629 |
|
630 |
// Photo specific nonce field
|
2923 |
|
2924 |
} /* foreach photo */
|
2925 |
|
2926 |
+
wppa_admin_pagination( $pagesize, $page, $count, $link, 'bottom' );
|
2927 |
|
2928 |
} /* photos not empty */
|
2929 |
} /* function */
|
3082 |
}
|
3083 |
}
|
3084 |
|
3085 |
+
$slug = 'photo_bulk';
|
3086 |
+
$a = wppa_is_int( $album ) ? $album : '0';
|
3087 |
+
if ( ! $a ) {
|
3088 |
+
$slug .= '_' . $album;
|
3089 |
+
}
|
3090 |
+
$parms = wppa_get_paging_parms( $slug );
|
3091 |
+
|
3092 |
+
$pagesize = $parms['pagesize']; // wppa_opt( 'photo_admin_pagesize' ) ? wppa_opt( 'photo_admin_pagesize' ) : '20';
|
3093 |
+
$next_after = wppa_get( 'next-after', '0' ) ? '1' : '0';
|
3094 |
+
$p = $parms['page']; // wppa_get( 'paged', '1' );
|
3095 |
+
$page = $p + $next_after;
|
3096 |
+
$skip = ( $page - '1' ) * $pagesize;
|
3097 |
|
3098 |
if ( $album ) {
|
3099 |
if ( $album == 'moderate' ) {
|
3138 |
|
3139 |
if ( $photos ) {
|
3140 |
$plink = $link . '&next-after=' . $next_after;
|
3141 |
+
|
3142 |
+
wppa_admin_pagination( $pagesize, $page, $count, $plink, 'top' );
|
3143 |
|
3144 |
$the_js = "
|
3145 |
function wppaTryMove( id, video ) {
|
3178 |
wppa_add_inline_script( 'wppa-admin', $the_js );
|
3179 |
|
3180 |
$result = '
|
3181 |
+
<form action="' . $link . '&paged=' . $page . '#manage-photos" method="post">' .
|
3182 |
wp_nonce_field( 'wppa-bulk', 'wppa-bulk' ) . '
|
3183 |
+
<div>' . //__( 'Bulk action', 'wp-photo-album-plus' ) . '
|
3184 |
+
' <select id="wppa-bulk-action" name="wppa-bulk-action" onchange="wppaBulkActionChange( this, \'bulk-album\' )">
|
3185 |
+
<option value="" disabled selected>' . esc_html__( 'Bulk action', 'wp-photo-album-plus' ) . '</option>';
|
|
|
3186 |
if ( $album == 'trash' ) {
|
3187 |
$result .= '
|
3188 |
<option value="wppa-bulk-delete-immediate">' . __( 'Remove permanently', 'wp-photo-album-plus' ) . '</option>
|
3291 |
/>
|
3292 |
<?php _e('Confirm move', 'wp-photo-album-plus' ) ?>
|
3293 |
|
3294 |
+
<?php /* wppa_echo( '<small style="float:right"> (' . count( $photos ) . ')</small>' );*/ ?>
|
3295 |
|
3296 |
+
</div>
|
|
|
3297 |
<?php $edit_link = wppa_ea_url( 'single', 'edit' ) ?>
|
3298 |
<table class="widefat">
|
3299 |
<thead style="font-weight:bold">
|
3330 |
}
|
3331 |
|
3332 |
$maxsize = wppa_get_minisize(); ?>
|
3333 |
+
<tr id="photoitem-<?php wppa_echo( $photo['id'] ) ?>" class="photoitem">
|
3334 |
<!-- Checkbox -->
|
3335 |
<td>
|
3336 |
<input type="hidden" id="photo-nonce-<?php wppa_echo( $photo['id'] ) ?>" value="<?php wppa_echo( wp_create_nonce( 'wppa-nonce_'.$photo['id'] ) ) ?>" />
|
3502 |
</table>
|
3503 |
</form>
|
3504 |
<?php
|
3505 |
+
wppa_admin_pagination( $pagesize, $page, $count, $plink, 'bottom' );
|
3506 |
}
|
3507 |
else {
|
3508 |
if ( $page == '1' ) {
|
3509 |
if ( wppa_get( 'searchstring' ) ) {
|
3510 |
+
wppa_echo( '<h1>' . __( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . ' 2</h1>' );
|
3511 |
}
|
3512 |
elseif ( $album == 'moderate' ) {
|
3513 |
wppa_echo( '<h1>' . __( 'No photos to moderate', 'wp-photo-album-plus' ) . '</h1>' );
|
3521 |
}
|
3522 |
else {
|
3523 |
$page_1 = $page - '1';
|
3524 |
+
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 ) );
|
3525 |
}
|
3526 |
}
|
3527 |
}
|
wppa-picture.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Make the picture html
|
6 |
-
* Version 8.
|
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-search-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the search widget
|
6 |
-
* Version 8.
|
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-)
|
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.
|
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
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -299,26 +299,15 @@ global $wppa_subtab_names;
|
|
299 |
// Fix invalid source path
|
300 |
wppa_fix_source_path();
|
301 |
|
302 |
-
|
|
|
303 |
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
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
|
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
|
1677 |
-
$help = __('Displays the total number of
|
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 = __('
|
1791 |
-
$help = __('When you use album="#cat,...", in a shortcode, the
|
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-)
|
2118 |
-
$desc = __( 'Include the photos of all
|
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 |
-
__('
|
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 |
-
__('
|
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
|
5661 |
-
$desc = __('Select the linktype and display type for
|
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 |
-
__('
|
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
|
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
|
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
|
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
|
7194 |
-
__('the
|
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
|
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
|
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
|
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
|
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' );
|
@@ -8630,7 +8601,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
|
8634 |
$slug2 = 'wppa_remove_empty_albums';
|
8635 |
$html1 = '';
|
8636 |
$html2 = wppa_maintenance_button( $slug2 );
|
@@ -9810,8 +9781,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-)
|
9814 |
-
__('--- most recent from (sub-)
|
9815 |
__('--- according to albums photo sequence ---', 'wp-photo-album-plus' ),
|
9816 |
);
|
9817 |
$vals = array('-9', '-1', '-2', '-3', '-4', '-5');
|
@@ -10515,12 +10486,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 |
-
|
10522 |
-
sprintf(__('
|
10523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
10524 |
|
10525 |
wppa_initialize_runtime( true );
|
10526 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 8.3.01.001
|
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' );
|
8601 |
|
8602 |
$name = __('Remove empty albums', 'wp-photo-album-plus' );
|
8603 |
$desc = __('Removes albums that are not used.', 'wp-photo-album-plus' );
|
8604 |
+
$help = __('Removes all albums that have no photos and no sub albums in it.', 'wp-photo-album-plus' );
|
8605 |
$slug2 = 'wppa_remove_empty_albums';
|
8606 |
$html1 = '';
|
8607 |
$html2 = wppa_maintenance_button( $slug2 );
|
9781 |
$opts = array( __('--- random ---', 'wp-photo-album-plus' ),
|
9782 |
__('--- random featured ---', 'wp-photo-album-plus' ),
|
9783 |
__('--- most recent added ---', 'wp-photo-album-plus' ),
|
9784 |
+
__('--- random from (sub-)sub albums ---', 'wp-photo-album-plus' ),
|
9785 |
+
__('--- most recent from (sub-)sub albums ---', 'wp-photo-album-plus' ),
|
9786 |
__('--- according to albums photo sequence ---', 'wp-photo-album-plus' ),
|
9787 |
);
|
9788 |
$vals = array('-9', '-1', '-2', '-3', '-4', '-5');
|
10486 |
// close wrapper
|
10487 |
wppa_echo( '</div>' );
|
10488 |
|
10489 |
+
// Report resource used and other environmental data
|
10490 |
wppa_echo( '
|
10491 |
+
<div style="clear:both;margin-top:12px">
|
10492 |
+
<br>' .
|
10493 |
+
sprintf( __( 'Memory used on this page: %6.2f Mb', 'wp-photo-album-plus' ), memory_get_peak_usage( true ) / ( 1024 * 1024 ) ) . '<br>' .
|
10494 |
+
sprintf( __( 'There are %d settings and %d runtime parameters', 'wp-photo-album-plus' ), count( $wppa_opt ), count( $wppa ) ) . '<br>' .
|
10495 |
+
__( 'Database revision:', 'wp-photo-album-plus' ) . ' ' . wppa_get_option( 'wppa_revision', '100' ) . '<br>' .
|
10496 |
+
__( 'WP Charset:', 'wp-photo-album-plus' ) . ' ' . get_bloginfo( 'charset' ) . '<br>' .
|
10497 |
+
__( 'Current PHP version:', 'wp-photo-album-plus' ) . ' ' . phpversion() . '<br>' .
|
10498 |
+
__( 'WPPA+ API Version:', 'wp-photo-album-plus' ) . ' ' . $wppa_version . '<br>' .
|
10499 |
+
__( 'Filesystem method:', 'wp-photo-album-plus' ) . ' ' . get_filesystem_method() .
|
10500 |
+
'<br>' );
|
10501 |
|
10502 |
wppa_initialize_runtime( true );
|
10503 |
}
|
wppa-setup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
-
* Version 8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -634,7 +634,7 @@ static $user;
|
|
634 |
$my_albs_parents[] = $parent;
|
635 |
}
|
636 |
else {
|
637 |
-
wppa_log( 'Err', 'Could not create
|
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.
|
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
|
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
|
200 |
-
wppa_widget_checkbox( $this, 'incsubs', $instance['incsubs'], __( 'Include
|
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.
|
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( '
|
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.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -25,7 +25,7 @@ function wppa_show_statistics() {
|
|
25 |
$result .= '<a href="'.wppa_get_permalink().'wppa-album='.$y_id.'&wppa-cover=0&wppa-occur=1">'.$y_name.'</a>';
|
26 |
|
27 |
if ($p_id > '0') {
|
28 |
-
$result .= __(', a
|
29 |
$result .= '<a href="'.wppa_get_permalink().'wppa-album='.$p_id.'&wppa-cover=0&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
|
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
|
588 |
function wppa_is_album_empty( $id ) {
|
589 |
global $wpdb;
|
590 |
|
591 |
-
//
|
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
|
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
|
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.'&wppa-cover=0&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.'&wppa-cover=0&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.
|
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.
|
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
|
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.
|
7 |
*/
|
8 |
|
9 |
class TopTenWidget extends WP_Widget {
|
@@ -108,7 +108,7 @@ class TopTenWidget extends WP_Widget {
|
|
108 |
}
|
109 |
}
|
110 |
|
111 |
-
// Including
|
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
|
583 |
-
wppa_widget_checkbox( $this, 'includesubs', $instance['includesubs'], __( 'Include
|
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.
|
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
|
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.
|
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
|
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.
|
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
|
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
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -95,7 +95,9 @@ global $upload_album;
|
|
95 |
// Open the form
|
96 |
$result = '
|
97 |
<div class="wrap">
|
98 |
-
<
|
|
|
|
|
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.
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -2612,7 +2612,7 @@ global $wpdb;
|
|
2612 |
}
|
2613 |
}
|
2614 |
|
2615 |
-
// Retrieve the number of
|
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.
|
6 |
/*
|
7 |
*/
|
8 |
|
@@ -61,7 +61,7 @@ global $wpdb;
|
|
61 |
}
|
62 |
}
|
63 |
|
64 |
-
// If physical album(s) and include
|
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.
|
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.
|
9 |
*
|
10 |
*/
|
11 |
|
@@ -789,6 +789,8 @@ static $allowed_tags;
|
|
789 |
'accept' => true,
|
790 |
'placeholder' => true,
|
791 |
'download' => true,
|
|
|
|
|
792 |
) ),
|
793 |
'label' => array(
|
794 |
'for' => true,
|
5 |
* Contains wrappers for standard php functions
|
6 |
* For security and bug reasons
|
7 |
*
|
8 |
+
* Version 8.3.01.001
|
9 |
*
|
10 |
*/
|
11 |
|
789 |
'accept' => true,
|
790 |
'placeholder' => true,
|
791 |
'download' => true,
|
792 |
+
'size' => true,
|
793 |
+
'aria-describedby' => true,
|
794 |
) ),
|
795 |
'label' => array(
|
796 |
'for' => true,
|
wppa.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
-
* Version: 8.
|
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.
|
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.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 |
global $wp_version;
|
24 |
|
25 |
/* WPPA Version */
|
26 |
+
global $wppa_version; $wppa_version = '8.3.01.002'; // WPPA software version
|
27 |
global $wppa_revno; $wppa_revno = str_replace( '.', '', $wppa_version ); // WPPA db version
|
28 |
|
29 |
/* Init page js data */
|