Version Description
= 7.0.08 =
- This version addresses various security issues.
- This version addresses various bug fixes
= 7.0.07 =
- This version addresses various security issues.
- This version addresses various bug fixes
= 7.0.06 =
- This version addresses various bug fixes
- This version addresses various security issues.
= 7.0.05 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 7.0.04 =
- This version addresses various bug fixes
- This version addresses various security issues.
= 7.0.03 =
- This version addresses various minor bug fixes and feature requests.
= 7.0.02 =
- This version addresses various bug fixes
- This version addresses various security issues.
= 7.0.01 =
- This version addresses various minor bug fixes and feature requests.
= 7.0.00 =
- Shortcode generators for Gutenberg added.
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
- To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised. Configure Table IX-M to enable various mailing lists, and use the WPPA+ Notify widget for full user flexibility.
= 6.9.21 =
- This version addresses various bug fixes
- This version addresses various security issues.
= 6.9.20 =
- This version addresses various bug fixes
= 6.9.19 =
- This version addresses various minor bug fixes
= 6.9.18 =
- This version addresses various minor bug fixes
= 6.9.17 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.16 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.15 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.14 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.13 =
- Security release.
= 6.9.12 =
- This version addresses various minor bug fixes and performance improvements.
= 6.9.11 =
- This version addresses various minor bug fixes and performance improvements.
= 6.9.10 =
- This version addresses various minor bug fixes and performance improvements.
= 6.9.09 =
- Panorama support phase III.
= 6.9.08 =
- This version addresses various minor bug fixes and feature requests.
- Panorama support phase II.
= 6.9.07 =
- This version addresses various minor bug fixes and feature requests.
- Panorama support phase I.
= 6.9.06 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.05 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.04 =
- This version addresses various minor bug fixes and feature requests.
- Local CDN functionality has been added.
= 6.9.03 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.02 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.01 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.00 =
- This version includes the code for the privacy policy requirements.
= 6.8.09
- This version addresses various bug fixes and code edits.
= 6.8.08 =
- This version addresses various minor bug fixes and feature requests.
- This version offers substantial performance improvements when the box in Table IV-A13: Defer Javascript is ticked. This setting is now recommended and set ticked as the default.
- For more info on performance improvements and compatibility with optimizers: see the changelog.txt
= 6.8.07 =
- This version addresses various minor bug fixes and enhancements, and a new widget: Statistics.
= 6.8.06 =
- This version addresses various minor bug fixes and improved cache handling.
= 6.8.05 =
- This version addresses various minor bug fixes and feture requests.
= 6.8.04 =
- This version addresses various display issues and a few fixes of bugs that seldom affected the plugins behaviour.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 7.0.08.005 |
Comparing to | |
See all releases |
Code changes from version 7.0.07.007 to 7.0.08.005
- changelog.txt +8 -0
- js/wppa-admin-scripts.js +3 -3
- js/wppa-admin-scripts.min.js +1 -1
- readme.txt +7 -2
- wppa-admin.php +2 -196
- wppa-ajax.php +3 -1
- wppa-dashboard-widgets.php +441 -0
- wppa-links.php +3 -3
- wppa-photo-files.php +10 -1
- wppa-potd-admin.php +347 -425
- wppa-settings-autosave.php +69 -44
- wppa-setup.php +23 -101
- wppa-utils.php +5 -0
- wppa-wrappers.php +45 -3
- wppa.php +2 -2
changelog.txt
CHANGED
@@ -1,5 +1,13 @@
|
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 7.0.07 =
|
4 |
|
5 |
* Security fixes
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
3 |
+
= 7.0.08 =
|
4 |
+
|
5 |
+
* Added dashboard widget for (un)subscribing to/from mailinglists.
|
6 |
+
* Reamke failed on .pdf's. Fixed.
|
7 |
+
* Links defined on the photo of the day admin page did not work. Fixed.
|
8 |
+
* Available tags were not updated when a photo was deleted. Fixed.
|
9 |
+
* Auto updates could fail due to improper initialisation of wp filesystem. Fixed.
|
10 |
+
|
11 |
= 7.0.07 =
|
12 |
|
13 |
* Security fixes
|
js/wppa-admin-scripts.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
/* admin-scripts.js */
|
2 |
/* Package: wp-photo-album-plus
|
3 |
/*
|
4 |
-
/* Version 7.0.
|
5 |
/* Various js routines used in admin pages
|
6 |
*/
|
7 |
|
@@ -1795,7 +1795,7 @@ function wppaMaintenanceProc(slug, intern, asCronJob ) {
|
|
1795 |
}
|
1796 |
else if ( ! intern && document.getElementById(slug+"_continue").value == 'yes' ) {
|
1797 |
document.getElementById(slug+"_continue").value = 'no';
|
1798 |
-
document.getElementById(slug+"_button").value = 'Start
|
1799 |
if ( jQuery("#"+slug+"_togo").html() > 0 ) {
|
1800 |
jQuery("#"+slug+"_status").html('Pausing...');
|
1801 |
jQuery("#"+slug+"_button").css('display', 'none');
|
@@ -1808,7 +1808,7 @@ function wppaMaintenanceProc(slug, intern, asCronJob ) {
|
|
1808 |
}
|
1809 |
else {
|
1810 |
document.getElementById(slug+"_continue").value = 'yes';
|
1811 |
-
document.getElementById(slug+"_button").value = 'Stop
|
1812 |
if ( jQuery("#"+slug+"_status").html() == '' ) {
|
1813 |
jQuery("#"+slug+"_status").html('Wait...');
|
1814 |
}
|
1 |
/* admin-scripts.js */
|
2 |
/* Package: wp-photo-album-plus
|
3 |
/*
|
4 |
+
/* Version 7.0.08
|
5 |
/* Various js routines used in admin pages
|
6 |
*/
|
7 |
|
1795 |
}
|
1796 |
else if ( ! intern && document.getElementById(slug+"_continue").value == 'yes' ) {
|
1797 |
document.getElementById(slug+"_continue").value = 'no';
|
1798 |
+
document.getElementById(slug+"_button").value = ' Start! ';
|
1799 |
if ( jQuery("#"+slug+"_togo").html() > 0 ) {
|
1800 |
jQuery("#"+slug+"_status").html('Pausing...');
|
1801 |
jQuery("#"+slug+"_button").css('display', 'none');
|
1808 |
}
|
1809 |
else {
|
1810 |
document.getElementById(slug+"_continue").value = 'yes';
|
1811 |
+
document.getElementById(slug+"_button").value = ' Stop! ';
|
1812 |
if ( jQuery("#"+slug+"_status").html() == '' ) {
|
1813 |
jQuery("#"+slug+"_status").html('Wait...');
|
1814 |
}
|
js/wppa-admin-scripts.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album";function checkjQueryRev(e,t,p){var a=parseFloat(jQuery.fn.jquery);t.checked&&a<p&&(alert(e+"\nThe version of your jQuery library: "+a+" is too low for this feature. It requires version "+p),t.checked="")}function wppaReUpload(e,t,p){document.getElementById("wppa-re-up-form-"+t);var a=document.getElementById("wppa-re-up-file-"+t),o=document.getElementById("wppa-re-up-butn-"+t);e.preventDefault();var n=a.files[0];if(n.type.match("image.*")){if(0==p.length)alert("Filename will be set to "+n.name);else if(n.name!=p&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+t).css("display","none");o.value="Uploading...",o.style.color="black";var i=new FormData;i.append("photo",n,n.name);var s=new XMLHttpRequest,l="?action=wppa&wppa-action=update-photo&photo-id="+t+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;s.open("POST",wppaAjaxUrl+l,!0),s.onload=function(){if(200===s.status){var e=wppaTrim(s.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]),o.value="Upload",jQuery("#re-up-"+t).css("display","none");break;case"99":document.getElementById("photoitem-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",o.value="Error occured",o.style.color="red"}}else alert("An error occurred!")},s.send(i)}else alert("File is not an image file!")}function wppaInitSettings(){wppaCheckBreadcrumb(),wppaCheckFullHalign(),wppaCheckUseThumbOpacity(),wppaCheckUseCoverOpacity(),wppaCheckThumbType(),wppaCheckThumbLink(),wppaCheckTopTenLink(),wppaCheckFeaTenLink(),wppaCheckLasTenLink(),wppaCheckThumbnailWLink(),wppaCheckCommentLink(),wppaCheckXphotoLink(),wppaCheckMphotoLink(),wppaCheckSphotoLink(),wppaCheckSlidePhotoLink(),wppaCheckSlideOnlyLink(),wppaCheckAlbumWidgetLink(),wppaCheckSlideLink(),wppaCheckCoverImg(),wppaCheckPotdLink(),wppaCheckTagLink(),wppaCheckRating(),wppaCheckComments(),wppaCheckCustom(),wppaCheckResize(),wppaCheckNumbar(),wppaCheckWatermark(),wppaCheckPopup(),wppaCheckGravatar(),wppaCheckUserUpload(),wppaCheckAjax(),wppaCheckFotomoto(),wppaCheckLinkPageErr("sphoto"),wppaCheckLinkPageErr("mphoto"),wppaCheckLinkPageErr("xphoto"),wppaCheckLinkPageErr("topten_widget"),wppaCheckLinkPageErr("slideonly_widget"),wppaCheckLinkPageErr("potd"),wppaCheckLinkPageErr("comment_widget"),wppaCheckLinkPageErr("thumbnail_widget"),wppaCheckLinkPageErr("lasten_widget"),wppaCheckLinkPageErr("album_widget"),wppaCheckLinkPageErr("tagcloud"),wppaCheckLinkPageErr("multitag"),wppaCheckLinkPageErr("super_view"),wppaCheckSplitNamedesc(),wppaCheckShares(),wppaCheckCoverType(),wppaCheckNewpag(),wppaCheckCDN(),wppaCheckAutoPage(),wppaCheckGps(),wppaCheckFontPreview(),wppaCheckCheck("wppa_enable_video","wppa-video"),wppaCheckCheck("wppa_custom_fields","custfields"),wppaCheckCheck("wppa_album_custom_fields","albumcustfields"),wppaCheckCheck("wppa_new_mod_label_is_text","nmtxt"),wppaCheckCheck("wppa_coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for("on"==p?wppaShowTable(table):wppaHideTable(table),subtab=0;subtab<13;subtab++)"on"==(p=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]))&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","Z");for(table=1;table<13;table++)for(table<13?wppaShowTable(table):wppaHideTable(table),wppa_tablecookieoff(table),subtab=0;subtab<12;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);0<p.length&&(p.removeClass("wppa-none"),wppaSubTabOn[e[table-1]+"-"+t[subtab]]=!1,wppa_tablecookieoff(e[table-1]+"-"+t[subtab]))}if(tag1=jQuery("#wppa-quick-selbox-1").val(),tag2=jQuery("#wppa-quick-selbox-2").val(),"-"==tag1&&"-"==tag2)for(jQuery("._wppatag-").addClass("wppa-none"),table=1;table<13;table++)wppaHideTable(table);else"-"!=tag1&&jQuery("._wppatag-"+tag1).addClass("wppa-none"),"-"!=tag2&&jQuery("._wppatag-"+tag2).addClass("wppa-none")}function wppaToggleTable(e){"none"==jQuery("#wppa_table_"+e).css("display")?(jQuery("#wppa_table_"+e).css("display","inline"),wppa_tablecookieon(e)):(jQuery("#wppa_table_"+e).css("display","none"),wppa_tablecookieoff(e))}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",wppaMakeLazyVisible),wppaMakeLazyVisible()});var wppaSubTabOn=new Array;function wppaToggleSubTable(e,t){wppaSubTabOn[e+"-"+t]?(jQuery(".wppa-"+e+"-"+t).addClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-help").css("display","none"),wppaSubTabOn[e+"-"+t]=!1,wppa_tablecookieoff(e+"-"+t)):(jQuery(".wppa-"+e+"-"+t).removeClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-h").css("display",""),wppaSubTabOn[e+"-"+t]=!0,wppa_tablecookieon(e+"-"+t))}function wppaHideTable(e){jQuery("#wppa_table_"+e).css("display","none"),jQuery("#wppa_tableHide-"+e).css("display","none"),jQuery("#wppa_tableShow-"+e).css("display","inline"),wppa_tablecookieoff(e)}function wppaShowTable(e){jQuery("#wppa_table_"+e).css("display","block"),jQuery("#wppa_tableHide-"+e).css("display","inline"),jQuery("#wppa_tableShow-"+e).css("display","none"),wppa_tablecookieon(e)}var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaFollow(e,t){jQuery("#"+e).prop("checked")?jQuery("."+t).css("display",""):jQuery("."+t).css("display","none")}function wppaCheckCheck(e,t){var p=e.substring(5);document.getElementById(p).checked?(jQuery("."+t).css("display",""),jQuery(".-"+t).css("display","none")):(jQuery("."+t).css("display","none"),jQuery(".-"+t).css("display",""))}function wppaCheckSlideVideoControls(){"none"!=document.getElementById("slideshow_linktype").value&&alert("Warning! \nYou can not have video controls on a videoslide when there is a link on the slide.\nThe videoslide will not show controls and will also not autoplay")}function wppaCheckFotomoto(){document.getElementById("fotomoto_on").checked?jQuery(".wppa_fotomoto").css("display",""):jQuery(".wppa_fotomoto").css("display","none")}function wppaCheckFontPreview(){var e=document.getElementById("textual_watermark_font").value,t=document.getElementById("textual_watermark_type").value,p=wppaFontDirectory+"wmf"+e+"-"+t+".png",a=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",a)}function wppaCheckWidgetMethod(){var e,t;if("4"==document.getElementById("wppa-wm").value){document.getElementById("wppa-wp").style.visibility="visible";var p=jQuery("#wppa-wp").val();"day-of-week"==p||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")}else document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden");if("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 wppaCheckFullHalign(){var e=document.getElementById("fullsize").value,t=document.getElementById("colwidth").value,p=document.getElementById("fullvalign").value;e!=t&&"default"!=p?jQuery(".wppa_ha").css("display",""):jQuery(".wppa_ha").css("display","none"),"auto"==t?jQuery(".wppa_init_resp_width").css("display",""):jQuery(".wppa_init_resp_width").css("display","none")}function wppaCheckCDN(){var e=document.getElementById("cdn_service").value;"cloudinary"==e||"cloudinarymaintenance"==e?jQuery(".cloudinary").css("display",""):jQuery(".cloudinary").css("display","none")}function wppaCheckGps(){"wppa-plus-embedded"==document.getElementById("gpx_implementation").value?(jQuery(".wppa_gpx_native").css("display",""),jQuery(".wppa_gpx_plugin").css("display","none")):(jQuery(".wppa_gpx_native").css("display","none"),jQuery(".wppa_gpx_plugin").css("display",""))}function wppaCheckThumbType(){var e=document.getElementById("thumbtype").value;"default"==e&&(jQuery(".tt_normal").css("display",""),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),wppaCheckUseThumbOpacity()),"ascovers"!=e&&"ascovers-mcr"!=e||(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display",""),jQuery(".tt_always").css("display","")),"masonry"==e&&(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),jQuery(".tt_masonry").css("display",""))}function wppaCheckAutoPage(){document.getElementById("auto_page").checked?jQuery(".autopage").css("display",""):jQuery(".autopage").css("display","none")}function wppaCheckUseThumbOpacity(){document.getElementById("use_thumb_opacity").checked?(jQuery(".thumb_opacity").css("color","#333"),jQuery(".thumb_opacity_html").css("visibility","visible")):(jQuery(".thumb_opacity").css("color","#999"),jQuery(".thumb_opacity_html").css("visibility","hidden"))}function wppaCheckUseCoverOpacity(){document.getElementById("use_cover_opacity").checked?(jQuery(".cover_opacity").css("color","#333"),jQuery(".cover_opacity_html").css("visibility","visible")):(jQuery(".cover_opacity").css("color","#999"),jQuery(".cover_opacity_html").css("visibility","hidden"))}function wppaCheckBreadcrumb(){var e=document.getElementById("show_bread_posts").checked,t=document.getElementById("show_bread_pages").checked;if(e||t){jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display","");var p=document.getElementById("bc_separator").value;"txt"==p?(jQuery(".wppa_bc_txt").css("display",""),jQuery(".wppa_bc_url").css("display","none"),jQuery(".wppa_bc_txt_html").css("display",""),jQuery(".wppa_bc_url_html").css("display","none")):"url"==p?(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display",""),jQuery(".wppa_bc_txt_html").css("display","none"),jQuery(".wppa_bc_url_html").css("display","")):(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))}else jQuery(".wppa_bc").css("display","none"),jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none")}function wppaCheckRating(){document.getElementById("rating_on").checked?(jQuery(".wppa_rating").css("color","#333"),jQuery(".wppa_rating_html").css("visibility","visible"),jQuery(".wppa_rating_").css("display","")):(jQuery(".wppa_rating").css("color","#999"),jQuery(".wppa_rating_html").css("visibility","hidden"),jQuery(".wppa_rating_").css("display","none"))}function wppaCheckComments(){document.getElementById("show_comments").checked?(jQuery(".wppa_comment").css("color","#333"),jQuery(".wppa_comment_html").css("visibility","visible"),jQuery(".wppa_comment_").css("display","")):(jQuery(".wppa_comment").css("color","#999"),jQuery(".wppa_comment_html").css("visibility","hidden"),jQuery(".wppa_comment_").css("display","none"))}function wppaCheckAjax(){document.getElementById("allow_ajax").checked?jQuery(".wppa_allow_ajax_").css("display",""):jQuery(".wppa_allow_ajax_").css("display","none")}function wppaCheckShares(){document.getElementById("share_on").checked||document.getElementById("share_on_widget").checked||document.getElementById("share_on_lightbox").checked||document.getElementById("share_on_thumbs").checked||document.getElementById("share_on_mphoto").checked?jQuery(".wppa_share").css("display",""):jQuery(".wppa_share").css("display","none")}function wppaCheckCoverType(){var e=document.getElementById("cover_type").value;document.getElementById("coverphoto_pos").value;"imagefactory"==e||"imagefactory-mcr"==e?jQuery(".wppa_imgfact_").css("display",""):jQuery(".wppa_imgfact_").css("display","none")}function wppaCheckNewpag(){document.getElementById("newpag_create").checked?jQuery(".wppa_newpag").css("display",""):jQuery(".wppa_newpag").css("display","none")}function wppaCheckCustom(){document.getElementById("custom_on").checked?(jQuery(".wppa_custom").css("color","#333"),jQuery(".wppa_custom_html").css("visibility","visible"),jQuery(".wppa_custom_").css("display","")):(jQuery(".wppa_custom").css("color","#999"),jQuery(".wppa_custom_html").css("visibility","hidden"),jQuery(".wppa_custom_").css("display","none"))}function wppaCheckWidgetLink(){"-1"==document.getElementById("wlp").value?(jQuery(".wppa_wlu").css("display",""),jQuery(".wppa_wlt").css("visibility","hidden")):(jQuery(".wppa_wlu").css("display","none"),jQuery(".wppa_wlt").css("visibility","visible"))}function wppaCheckSmWidgetLink(){"home"==document.getElementById("widget_sm_linktype").value?jQuery(".wppa_smrp").css("visibility","hidden"):jQuery(".wppa_smrp").css("visibility","")}function wppaCheckThumbLink(){var e=document.getElementById("thumb_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlp").css("visibility","hidden"):jQuery(".wppa_tlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlb").css("visibility","hidden"):jQuery(".wppa_tlb").css("visibility","visible")}function wppaCheckTopTenLink(){var e=document.getElementById("topten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlp").css("visibility","hidden"):jQuery(".wppa_ttlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlb").css("visibility","hidden"):jQuery(".wppa_ttlb").css("visibility","visible")}function wppaCheckFeaTenLink(){var e=document.getElementById("featen_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlp").css("visibility","hidden"):jQuery(".wppa_ftlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlb").css("visibility","hidden"):jQuery(".wppa_ftlb").css("visibility","visible")}function wppaCheckLasTenLink(){var e=document.getElementById("lasten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlp").css("visibility","hidden"):jQuery(".wppa_ltlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlb").css("visibility","hidden"):jQuery(".wppa_ltlb").css("visibility","visible")}function wppaCheckThumbnailWLink(){var e=document.getElementById("thumbnail_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlp").css("visibility","hidden"):jQuery(".wppa_tnlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlb").css("visibility","hidden"):jQuery(".wppa_tnlb").css("visibility","visible")}function wppaCheckCommentLink(){var e=document.getElementById("comment_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlp").css("visibility","hidden"):jQuery(".wppa_cmlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlb").css("visibility","hidden"):jQuery(".wppa_cmlb").css("visibility","visible")}function wppaCheckSlideOnlyLink(){var e=document.getElementById("slideonly_widget_linktype").value;"none"==e||"file"==e||"widget"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solp").css("visibility","hidden"):jQuery(".wppa_solp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solb").css("visibility","hidden"):jQuery(".wppa_solb").css("visibility","visible")}function wppaCheckAlbumWidgetLink(){var e=document.getElementById("album_widget_linktype").value;"lightbox"==e?jQuery(".wppa_awlp").css("visibility","hidden"):jQuery(".wppa_awlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_awlb").css("visibility","hidden"):jQuery(".wppa_awlb").css("visibility","visible")}function wppaCheckSlideLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckCoverImg(){var e=document.getElementById("coverimg_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_covimgbl").css("visibility","hidden"):jQuery(".wppa_covimgbl").css("visibility","visible")}function wppaCheckPotdLink(){var e=document.getElementById("potd_linktype").value;"none"==e||"lightbox"==e||"file"==e||"custom"==e?jQuery(".wppa_potdlp").css("visibility","hidden"):jQuery(".wppa_potdlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_potdlb").css("visibility","hidden"):jQuery(".wppa_potdlb").css("visibility","visible")}function wppaCheckTagLink(){document.getElementById("tagcloud_linktype").value}function wppaCheckMTagLink(){document.getElementById("multitag_linktype").value}function wppaCheckXphotoLink(){var e=document.getElementById("xphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_xlp").css("visibility","hidden"):jQuery(".wppa_xlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_xlb").css("visibility","hidden"):jQuery(".wppa_xlb").css("visibility","visible")}function wppaCheckMphotoLink(){var e=document.getElementById("mphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_mlp").css("visibility","hidden"):jQuery(".wppa_mlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_mlb").css("visibility","hidden"):jQuery(".wppa_mlb").css("visibility","visible")}function wppaCheckSphotoLink(){var e=document.getElementById("sphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_slp").css("visibility","hidden"):jQuery(".wppa_slp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_slb").css("visibility","hidden"):jQuery(".wppa_slb").css("visibility","visible")}function wppaCheckSlidePhotoLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"file"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslp").css("visibility","hidden"):jQuery(".wppa_sslp").css("visibility","visible"),"none"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckResize(){document.getElementById("resize_on_upload").checked?jQuery(".re_up").css("display",""):jQuery(".re_up").css("display","none")}function wppaCheckNumbar(){document.getElementById("show_slideshownumbar").checked?jQuery(".wppa_numbar").css("display",""):jQuery(".wppa_numbar").css("display","none")}function wppaCheckWatermark(){document.getElementById("watermark_on").checked?jQuery(".wppa_watermark").css("display",""):jQuery(".wppa_watermark").css("display","none")}function wppaCheckPopup(){document.getElementById("use_thumb_popup").checked?jQuery(".wppa_popup").css("display",""):jQuery(".wppa_popup").css("display","none")}function wppaCheckGravatar(){document.getElementById("comment_gravatar")&&("url"==document.getElementById("comment_gravatar").value?jQuery(".wppa_grav").css("display",""):jQuery(".wppa_grav").css("display","none"))}function wppaCheckUserUpload(){document.getElementById("user_upload_on").checked?jQuery(".wppa_feup").css("display",""):jQuery(".wppa_feup").css("display","none")}function wppaCheckSplitNamedesc(){document.getElementById("split_namedesc").checked?(jQuery(".swap_namedesc").css("display","none"),jQuery(".hide_empty").css("display","")):(jQuery(".swap_namedesc").css("display",""),jQuery(".hide_empty").css("display","none"))}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),p=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",p)}function checkAll(e,t){var p=document.getElementById(e);p&&(p.checked?jQuery(t).prop("checked","checked"):jQuery(t).prop("checked",""))}function impUpd(e,t){e.checked?(jQuery(t).prop("value",wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).prop("value",wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,p){var a="",o="";a=e||'<div style="padding-left:5px;" >',p?o=p:aftrer="</div>",wppaFeAjaxLog("in");var n=wppaGetXmlHttp(),i=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;i+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,n.open("GET",i,!0),n.send(),n.onreadystatechange=function(){switch(n.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==n.status){var e=wppaTrim(n.responseText).split("||");"ER"==e[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("photostatus-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=a+e[2]+o,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=a+'<span style="color:red;" >Comm error '+n.status+": "+n.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p.open("GET",e,!0),p.send(),p.onreadystatechange=function(){switch(p.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==p.status){var e=wppaTrim(p.responseText).split("||");"ER"==e[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("photostatus-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var o="action=wppa&wppa-action=watermark-photo&photo-id="+t;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(o+="&wppa-watermark-file="+e),p&&(o+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o),a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":document.getElementById("photostatus-"+t).innerHTML=e[2];break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>"}jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("photostatus-"+t).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"}}var wppaAjaxPhotoCount=new Array,wppaPhotoUpdateMatrix=new Array;function wppaAjaxUpdatePhoto(e,t,p,a,o){var n=!1;o&&(n=0==jQuery("#wppaphotodesc"+o+":visible").length,jQuery("#wppaphotodesc"+o+"-html").click(),n&&jQuery("#wppaphotodesc"+o+"-tmce").click());for(var i=wppaPhotoUpdateMatrix.length,s=0,l=!1,r=-1;s<i;)wppaPhotoUpdateMatrix[s][0]==e&&wppaPhotoUpdateMatrix[s][1]==t&&(l=!0,r=s),s++;if(!l){wppaPhotoUpdateMatrix[i]=[e,t,"undefined",!1,!1,a],r=i}wppaPhotoUpdateMatrix[r][3]="number"==typeof p?p:p.value,wppaPhotoUpdateMatrix[r][5]=a,wppaAjaxUpdatePhotoMonitor()}function wppaAjaxUpdateDelphoto(e,t,p){wppaAjaxUpdatePhoto(e,"del"+t,p)}function wppaAjaxUpdatePhotoMonitor(){for(var e=wppaPhotoUpdateMatrix.length,t=0;t<e;)wppaPhotoUpdateMatrix[t][2]==wppaPhotoUpdateMatrix[t][3]||wppaPhotoUpdateMatrix[t][4]||(wppaPhotoUpdateMatrix[t][4]=!0,_wppaAjaxUpdatePhoto(wppaPhotoUpdateMatrix[t][0],wppaPhotoUpdateMatrix[t][1],wppaPhotoUpdateMatrix[t][3],wppaPhotoUpdateMatrix[t][5])),t++}function _wppaAjaxUpdatePhoto(s,l,r,u,c,d){c||(c=""),d||(d="");wppaFeAjaxLog("in"),wppaAjaxPhotoCount[s]||(wppaAjaxPhotoCount[s]=0),wppaAjaxPhotoCount[s]++,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxPhotoCount[s]--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":var o;if(0==wppaAjaxPhotoCount[s]?jQuery("#photostatus-"+s).html(a[2]):jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")"),a[3])(o=jQuery("#fs-a-"+s).attr("href").split("="))[1]=parseInt(o[1])+1,jQuery("#fs-a-"+s).attr("href",o[0]+"="+o[1]),jQuery("#fs-img-"+s).attr("src",o[0]+"="+o[1]);if(a[4])(o=jQuery("#tnp-"+s).attr("src").split("="))[1]=parseInt(o[1])+1,jQuery("#tnp-"+s).attr("src",o[0]+"="+o[1]);void 0!==a[5]&&(jQuery("#imstack-"+s).html(a[5]),0<a[5].length?jQuery("#imstackbutton-"+s).css("display",""):jQuery("#imstackbutton-"+s).css("display","none")),void 0!==a[6]&&jQuery("#dispfileinfo-"+s).html(a[6]);break;case"99":jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+a[2]+"</span>"+d);break;default:jQuery("#photostatus-"+s).html('<span style="color:red">'+a[2]+" ("+a[1]+")</span>")}"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"});var n=0,i=-1;for(count=wppaPhotoUpdateMatrix.length;n<count;)wppaPhotoUpdateMatrix[n][0]==s&&wppaPhotoUpdateMatrix[n][1]==l&&(i=n),n++;if(wppaPhotoUpdateMatrix[i]&&(wppaPhotoUpdateMatrix[i][2]=r||0,wppaPhotoUpdateMatrix[i][4]=!1,wppaPhotoUpdateMatrix[i][5]=!1),wppaFeAjaxLog("out"),wppaAjaxUpdatePhotoMonitor(),u&&"0"==a[1])return jQuery("#photostatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),void setTimeout(function(){wppaReload("#photo_"+s)},1e3)},error:function(e,t,p){wppaAjaxPhotoCount[s]--,jQuery("#photostatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){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",document.getElementById("wppa-dummy")))}_wppaRefreshAfter=!1;var wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,p,a){var o=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var n=wppaAlbumUpdateMatrix.length,i=0,s=!1,l=-1;i<n;)wppaAlbumUpdateMatrix[i][0]==e&&wppaAlbumUpdateMatrix[i][1]==t&&(s=!0,l=i),i++;if(!s){wppaAlbumUpdateMatrix[n]=[e,t,"undefined",!1,!1,a],l=n}wppaAlbumUpdateMatrix[l][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[l][5]=a,wppaAjaxUpdateAlbumMonitor(o)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,p=0;p<t;)wppaAlbumUpdateMatrix[p][2]==wppaAlbumUpdateMatrix[p][3]||wppaAlbumUpdateMatrix[p][4]||(wppaAlbumUpdateMatrix[p][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[p][0],wppaAlbumUpdateMatrix[p][1],wppaAlbumUpdateMatrix[p][3],e,wppaAlbumUpdateMatrix[p][5])),p++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(s,l,r,u,c){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("album-nonce-"+s).value+"&value="+wppaEncode(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxAlbumCount--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+s).html(a[2]):jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+s).html='<span style="color:red">'+a[2]+" ("+a[1]+")</span>"}if(void 0!==a[3]&&wppaProcessFull(a[3],a[4]),c&&"0"==a[1])return jQuery("#albumstatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==l&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var o=0,n=-1,i=wppaAlbumUpdateMatrix.length;o<i;)wppaAlbumUpdateMatrix[o][0]==s&&wppaAlbumUpdateMatrix[o][1]==l&&(n=o),o++;wppaAlbumUpdateMatrix[n][2]=r||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(u)},error:function(e,t,p){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){}})}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,p,e){var a=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+p+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]);break;default:jQuery("#photostatus-"+t).html('<span style="color:red">'+e[2]+"</span>")}jQuery("#wppa-comment-spin-"+p).css("visibility","hidden")}else jQuery("#photostatus-"+t).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")},a.open("GET",o,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(p.responseText).split("||");if(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=p.status)switch(e[1]){case"0":jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2]),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+p.status),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))}else jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+p.status);wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(o,e,i){if(i);else if(!e&&"yes"==document.getElementById(o+"_continue").value)return document.getElementById(o+"_continue").value="no",document.getElementById(o+"_button").value="Start!",void(0<jQuery("#"+o+"_togo").html()&&(jQuery("#"+o+"_status").html("Pausing..."),jQuery("#"+o+"_button").css("display","none")));i||(document.getElementById(o+"_continue").value="yes",document.getElementById(o+"_button").value="Stop!",""==jQuery("#"+o+"_status").html()&&jQuery("#"+o+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+o+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(i?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("||"),o=a[1],n=!1;return o?(10<a[0].length&&(alert("An error occurred:\n"+a[0]),n=!0),jQuery("#"+o+"_status").html(a[2]),jQuery("#"+o+"_togo").html(a[3]),jQuery("#"+o+"_button").css("display",""),n||"0"==a[3]?"reload"==a[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+o+"', false)",20):void("yes"!=document.getElementById(o+"_continue").value?i||jQuery("#"+o+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+o+"', true)",20))):(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,p){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+o+", Error = "+p+", status = "+t,"force"),jQuery("#"+o+"_status").html("Server error #"+(11-wppaAlwaysContinue));var a=!1;--wppaAlwaysContinue<1&&(a=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(a||0<wppaAlwaysContinue)&&("wppa_remake"==o&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==o&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==o&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+o+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":"Search index table";break;case"wppa_list_errorlog":"WPPA+ Error log";break;case"wppa_list_rating":"Recent ratings";break;case"wppa_list_session":"Active sessions";break;case"wppa_list_comments":"Recent comments"}var t=.9*wppaWindowWidth(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,o="action=wppa&wppa-action=maintenancepopup&slug="+e;if(o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(o),4==p.readyState&&200==p.status){var n=wppaEntityDecode(p.responseText).split("|"),i=n[0];n[0]="";var s=n.join("|").substring(1),l={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(s).dialog(l).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").html("<h2>"+i+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText)}}function wppaAjaxUpdateOptionValue(r,e,t){var p="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(r)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(p+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+r,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+r).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0])alert("The server returned unexpected output:\n"+a[0]);else{switch(a[1]){case"0":jQuery("#img_"+r).attr("src",wppaImageDirectory+"tick.png"),a[3]&&alert(a[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+r).attr("src",wppaImageDirectory+"cross.png"),a[3]&&alert(a[3])}if(jQuery("#img_"+r).attr("title",a[2]),a[4])for(var o,n,i,s=a[4].split(";"),l=0;l<s.length;)o=s[l].split(":"),n=jQuery("#"+o[0]).html(),i=o[1],""!=n&&""==i&&(i='<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("#"+o[0]).html(i),l++}},error:function(e){jQuery("#img_"+r).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+r).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=r&&"icon_corner_style"!=r||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=r&&"svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=r&&"ovl_svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){var t;if(void 0!==e){if("number"==typeof e)return e;var p=(t=(t=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0;for(t="";a<p.length;)t+=p[a],++a<p.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 window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"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 p=0;p<t.length;)"jpg"!=t[p]&&"JPG"!=t[p]||jQuery("#psdesc-"+e).css({display:""}),p++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaCheckLinkPageErr(e){var t="nil";document.getElementById(e+"_linktype")&&(t=document.getElementById(e+"_linktype").value),"0"!=document.getElementById(e+"_linkpage").value||"nil"!=t&&"photo"!=t&&"single"!=t&&"album"!=t&&"content"!=t&&"slide"!=t&&"plainpage"!=t?jQuery("#"+e+"-err").css({display:"none"}):jQuery("#"+e+"-err").css({display:""})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){var p=document.getElementById(t);e&&(p.value?p.value+=","+e:p.value=e,"-clear-"==e&&(p.value=""))}function wppaRefresh(e){var t=new String(document.location).split("#")[0]+"#"+e;document.location=t}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 p,a="",o=-1,n=-2,i=0,s=!1,l=0;l<e.length;)0!=(p=e[l].valueOf())&&(i=o,p==++i?s=!0:s?(a+=o==n?t+o+t+p:t+t+o+t+p,s=!1):a+=t+p,s||(n=p,n++),o=p),l++;for(s&&(a+=".."+o);"."==a.substr(0,1);)a=a.substr(1);for(;a.substr(0,1)==t;)a=a.substr(1);return a}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 p,a=[],o=0,n=0;for(t||(t="."),p=jQuery(e),n=o=0;o<p.length;)p[o].selected&&(a[n]=p[o].value,n++),o++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){var p=jQuery("#"+t).val();0==p.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+p}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+a,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+a+"-spin").css("display","inline")},success:function(e,t,p){var a=e.split("||");"0"==a[1]?document.location=a[2]:alert("Error: "+a[1]+"\n\n"+a[2])},error:function(e,t,p){alert("Export Db Table "+a+" failed. Error = "+p+", status = "+t)},complete:function(e,t,p){jQuery("#"+a+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(i){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+i,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+i+"_togo").html(a[0]);var o=jQuery("#"+i+"_status").html(),n=a[1];""!=o&&""==n&&(n='<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("#"+i+"_status").html(n),setTimeout(function(){wppaAjaxUpdateTogo(i)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||0==e)))}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:"9999"}),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-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,o){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,p){var a=e.split("|");jQuery("#"+o).html(a[0])},error:function(e){},complete:function(e){}})}
|
1 |
+
var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album";function checkjQueryRev(e,t,p){var a=parseFloat(jQuery.fn.jquery);t.checked&&a<p&&(alert(e+"\nThe version of your jQuery library: "+a+" is too low for this feature. It requires version "+p),t.checked="")}function wppaReUpload(e,t,p){document.getElementById("wppa-re-up-form-"+t);var a=document.getElementById("wppa-re-up-file-"+t),o=document.getElementById("wppa-re-up-butn-"+t);e.preventDefault();var n=a.files[0];if(n.type.match("image.*")){if(0==p.length)alert("Filename will be set to "+n.name);else if(n.name!=p&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+t).css("display","none");o.value="Uploading...",o.style.color="black";var i=new FormData;i.append("photo",n,n.name);var s=new XMLHttpRequest,l="?action=wppa&wppa-action=update-photo&photo-id="+t+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;s.open("POST",wppaAjaxUrl+l,!0),s.onload=function(){if(200===s.status){var e=wppaTrim(s.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]),o.value="Upload",jQuery("#re-up-"+t).css("display","none");break;case"99":document.getElementById("photoitem-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",o.value="Error occured",o.style.color="red"}}else alert("An error occurred!")},s.send(i)}else alert("File is not an image file!")}function wppaInitSettings(){wppaCheckBreadcrumb(),wppaCheckFullHalign(),wppaCheckUseThumbOpacity(),wppaCheckUseCoverOpacity(),wppaCheckThumbType(),wppaCheckThumbLink(),wppaCheckTopTenLink(),wppaCheckFeaTenLink(),wppaCheckLasTenLink(),wppaCheckThumbnailWLink(),wppaCheckCommentLink(),wppaCheckXphotoLink(),wppaCheckMphotoLink(),wppaCheckSphotoLink(),wppaCheckSlidePhotoLink(),wppaCheckSlideOnlyLink(),wppaCheckAlbumWidgetLink(),wppaCheckSlideLink(),wppaCheckCoverImg(),wppaCheckPotdLink(),wppaCheckTagLink(),wppaCheckRating(),wppaCheckComments(),wppaCheckCustom(),wppaCheckResize(),wppaCheckNumbar(),wppaCheckWatermark(),wppaCheckPopup(),wppaCheckGravatar(),wppaCheckUserUpload(),wppaCheckAjax(),wppaCheckFotomoto(),wppaCheckLinkPageErr("sphoto"),wppaCheckLinkPageErr("mphoto"),wppaCheckLinkPageErr("xphoto"),wppaCheckLinkPageErr("topten_widget"),wppaCheckLinkPageErr("slideonly_widget"),wppaCheckLinkPageErr("potd"),wppaCheckLinkPageErr("comment_widget"),wppaCheckLinkPageErr("thumbnail_widget"),wppaCheckLinkPageErr("lasten_widget"),wppaCheckLinkPageErr("album_widget"),wppaCheckLinkPageErr("tagcloud"),wppaCheckLinkPageErr("multitag"),wppaCheckLinkPageErr("super_view"),wppaCheckSplitNamedesc(),wppaCheckShares(),wppaCheckCoverType(),wppaCheckNewpag(),wppaCheckCDN(),wppaCheckAutoPage(),wppaCheckGps(),wppaCheckFontPreview(),wppaCheckCheck("wppa_enable_video","wppa-video"),wppaCheckCheck("wppa_custom_fields","custfields"),wppaCheckCheck("wppa_album_custom_fields","albumcustfields"),wppaCheckCheck("wppa_new_mod_label_is_text","nmtxt"),wppaCheckCheck("wppa_coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for("on"==p?wppaShowTable(table):wppaHideTable(table),subtab=0;subtab<13;subtab++)"on"==(p=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]))&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","Z");for(table=1;table<13;table++)for(table<13?wppaShowTable(table):wppaHideTable(table),wppa_tablecookieoff(table),subtab=0;subtab<12;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);0<p.length&&(p.removeClass("wppa-none"),wppaSubTabOn[e[table-1]+"-"+t[subtab]]=!1,wppa_tablecookieoff(e[table-1]+"-"+t[subtab]))}if(tag1=jQuery("#wppa-quick-selbox-1").val(),tag2=jQuery("#wppa-quick-selbox-2").val(),"-"==tag1&&"-"==tag2)for(jQuery("._wppatag-").addClass("wppa-none"),table=1;table<13;table++)wppaHideTable(table);else"-"!=tag1&&jQuery("._wppatag-"+tag1).addClass("wppa-none"),"-"!=tag2&&jQuery("._wppatag-"+tag2).addClass("wppa-none")}function wppaToggleTable(e){"none"==jQuery("#wppa_table_"+e).css("display")?(jQuery("#wppa_table_"+e).css("display","inline"),wppa_tablecookieon(e)):(jQuery("#wppa_table_"+e).css("display","none"),wppa_tablecookieoff(e))}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",wppaMakeLazyVisible),wppaMakeLazyVisible()});var wppaSubTabOn=new Array;function wppaToggleSubTable(e,t){wppaSubTabOn[e+"-"+t]?(jQuery(".wppa-"+e+"-"+t).addClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-help").css("display","none"),wppaSubTabOn[e+"-"+t]=!1,wppa_tablecookieoff(e+"-"+t)):(jQuery(".wppa-"+e+"-"+t).removeClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-h").css("display",""),wppaSubTabOn[e+"-"+t]=!0,wppa_tablecookieon(e+"-"+t))}function wppaHideTable(e){jQuery("#wppa_table_"+e).css("display","none"),jQuery("#wppa_tableHide-"+e).css("display","none"),jQuery("#wppa_tableShow-"+e).css("display","inline"),wppa_tablecookieoff(e)}function wppaShowTable(e){jQuery("#wppa_table_"+e).css("display","block"),jQuery("#wppa_tableHide-"+e).css("display","inline"),jQuery("#wppa_tableShow-"+e).css("display","none"),wppa_tablecookieon(e)}var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaFollow(e,t){jQuery("#"+e).prop("checked")?jQuery("."+t).css("display",""):jQuery("."+t).css("display","none")}function wppaCheckCheck(e,t){var p=e.substring(5);document.getElementById(p).checked?(jQuery("."+t).css("display",""),jQuery(".-"+t).css("display","none")):(jQuery("."+t).css("display","none"),jQuery(".-"+t).css("display",""))}function wppaCheckSlideVideoControls(){"none"!=document.getElementById("slideshow_linktype").value&&alert("Warning! \nYou can not have video controls on a videoslide when there is a link on the slide.\nThe videoslide will not show controls and will also not autoplay")}function wppaCheckFotomoto(){document.getElementById("fotomoto_on").checked?jQuery(".wppa_fotomoto").css("display",""):jQuery(".wppa_fotomoto").css("display","none")}function wppaCheckFontPreview(){var e=document.getElementById("textual_watermark_font").value,t=document.getElementById("textual_watermark_type").value,p=wppaFontDirectory+"wmf"+e+"-"+t+".png",a=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",a)}function wppaCheckWidgetMethod(){var e,t;if("4"==document.getElementById("wppa-wm").value){document.getElementById("wppa-wp").style.visibility="visible";var p=jQuery("#wppa-wp").val();"day-of-week"==p||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")}else document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden");if("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 wppaCheckFullHalign(){var e=document.getElementById("fullsize").value,t=document.getElementById("colwidth").value,p=document.getElementById("fullvalign").value;e!=t&&"default"!=p?jQuery(".wppa_ha").css("display",""):jQuery(".wppa_ha").css("display","none"),"auto"==t?jQuery(".wppa_init_resp_width").css("display",""):jQuery(".wppa_init_resp_width").css("display","none")}function wppaCheckCDN(){var e=document.getElementById("cdn_service").value;"cloudinary"==e||"cloudinarymaintenance"==e?jQuery(".cloudinary").css("display",""):jQuery(".cloudinary").css("display","none")}function wppaCheckGps(){"wppa-plus-embedded"==document.getElementById("gpx_implementation").value?(jQuery(".wppa_gpx_native").css("display",""),jQuery(".wppa_gpx_plugin").css("display","none")):(jQuery(".wppa_gpx_native").css("display","none"),jQuery(".wppa_gpx_plugin").css("display",""))}function wppaCheckThumbType(){var e=document.getElementById("thumbtype").value;"default"==e&&(jQuery(".tt_normal").css("display",""),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),wppaCheckUseThumbOpacity()),"ascovers"!=e&&"ascovers-mcr"!=e||(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display",""),jQuery(".tt_always").css("display","")),"masonry"==e&&(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),jQuery(".tt_masonry").css("display",""))}function wppaCheckAutoPage(){document.getElementById("auto_page").checked?jQuery(".autopage").css("display",""):jQuery(".autopage").css("display","none")}function wppaCheckUseThumbOpacity(){document.getElementById("use_thumb_opacity").checked?(jQuery(".thumb_opacity").css("color","#333"),jQuery(".thumb_opacity_html").css("visibility","visible")):(jQuery(".thumb_opacity").css("color","#999"),jQuery(".thumb_opacity_html").css("visibility","hidden"))}function wppaCheckUseCoverOpacity(){document.getElementById("use_cover_opacity").checked?(jQuery(".cover_opacity").css("color","#333"),jQuery(".cover_opacity_html").css("visibility","visible")):(jQuery(".cover_opacity").css("color","#999"),jQuery(".cover_opacity_html").css("visibility","hidden"))}function wppaCheckBreadcrumb(){var e=document.getElementById("show_bread_posts").checked,t=document.getElementById("show_bread_pages").checked;if(e||t){jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display","");var p=document.getElementById("bc_separator").value;"txt"==p?(jQuery(".wppa_bc_txt").css("display",""),jQuery(".wppa_bc_url").css("display","none"),jQuery(".wppa_bc_txt_html").css("display",""),jQuery(".wppa_bc_url_html").css("display","none")):"url"==p?(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display",""),jQuery(".wppa_bc_txt_html").css("display","none"),jQuery(".wppa_bc_url_html").css("display","")):(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))}else jQuery(".wppa_bc").css("display","none"),jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none")}function wppaCheckRating(){document.getElementById("rating_on").checked?(jQuery(".wppa_rating").css("color","#333"),jQuery(".wppa_rating_html").css("visibility","visible"),jQuery(".wppa_rating_").css("display","")):(jQuery(".wppa_rating").css("color","#999"),jQuery(".wppa_rating_html").css("visibility","hidden"),jQuery(".wppa_rating_").css("display","none"))}function wppaCheckComments(){document.getElementById("show_comments").checked?(jQuery(".wppa_comment").css("color","#333"),jQuery(".wppa_comment_html").css("visibility","visible"),jQuery(".wppa_comment_").css("display","")):(jQuery(".wppa_comment").css("color","#999"),jQuery(".wppa_comment_html").css("visibility","hidden"),jQuery(".wppa_comment_").css("display","none"))}function wppaCheckAjax(){document.getElementById("allow_ajax").checked?jQuery(".wppa_allow_ajax_").css("display",""):jQuery(".wppa_allow_ajax_").css("display","none")}function wppaCheckShares(){document.getElementById("share_on").checked||document.getElementById("share_on_widget").checked||document.getElementById("share_on_lightbox").checked||document.getElementById("share_on_thumbs").checked||document.getElementById("share_on_mphoto").checked?jQuery(".wppa_share").css("display",""):jQuery(".wppa_share").css("display","none")}function wppaCheckCoverType(){var e=document.getElementById("cover_type").value;document.getElementById("coverphoto_pos").value;"imagefactory"==e||"imagefactory-mcr"==e?jQuery(".wppa_imgfact_").css("display",""):jQuery(".wppa_imgfact_").css("display","none")}function wppaCheckNewpag(){document.getElementById("newpag_create").checked?jQuery(".wppa_newpag").css("display",""):jQuery(".wppa_newpag").css("display","none")}function wppaCheckCustom(){document.getElementById("custom_on").checked?(jQuery(".wppa_custom").css("color","#333"),jQuery(".wppa_custom_html").css("visibility","visible"),jQuery(".wppa_custom_").css("display","")):(jQuery(".wppa_custom").css("color","#999"),jQuery(".wppa_custom_html").css("visibility","hidden"),jQuery(".wppa_custom_").css("display","none"))}function wppaCheckWidgetLink(){"-1"==document.getElementById("wlp").value?(jQuery(".wppa_wlu").css("display",""),jQuery(".wppa_wlt").css("visibility","hidden")):(jQuery(".wppa_wlu").css("display","none"),jQuery(".wppa_wlt").css("visibility","visible"))}function wppaCheckSmWidgetLink(){"home"==document.getElementById("widget_sm_linktype").value?jQuery(".wppa_smrp").css("visibility","hidden"):jQuery(".wppa_smrp").css("visibility","")}function wppaCheckThumbLink(){var e=document.getElementById("thumb_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlp").css("visibility","hidden"):jQuery(".wppa_tlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlb").css("visibility","hidden"):jQuery(".wppa_tlb").css("visibility","visible")}function wppaCheckTopTenLink(){var e=document.getElementById("topten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlp").css("visibility","hidden"):jQuery(".wppa_ttlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlb").css("visibility","hidden"):jQuery(".wppa_ttlb").css("visibility","visible")}function wppaCheckFeaTenLink(){var e=document.getElementById("featen_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlp").css("visibility","hidden"):jQuery(".wppa_ftlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlb").css("visibility","hidden"):jQuery(".wppa_ftlb").css("visibility","visible")}function wppaCheckLasTenLink(){var e=document.getElementById("lasten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlp").css("visibility","hidden"):jQuery(".wppa_ltlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlb").css("visibility","hidden"):jQuery(".wppa_ltlb").css("visibility","visible")}function wppaCheckThumbnailWLink(){var e=document.getElementById("thumbnail_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlp").css("visibility","hidden"):jQuery(".wppa_tnlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlb").css("visibility","hidden"):jQuery(".wppa_tnlb").css("visibility","visible")}function wppaCheckCommentLink(){var e=document.getElementById("comment_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlp").css("visibility","hidden"):jQuery(".wppa_cmlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlb").css("visibility","hidden"):jQuery(".wppa_cmlb").css("visibility","visible")}function wppaCheckSlideOnlyLink(){var e=document.getElementById("slideonly_widget_linktype").value;"none"==e||"file"==e||"widget"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solp").css("visibility","hidden"):jQuery(".wppa_solp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solb").css("visibility","hidden"):jQuery(".wppa_solb").css("visibility","visible")}function wppaCheckAlbumWidgetLink(){var e=document.getElementById("album_widget_linktype").value;"lightbox"==e?jQuery(".wppa_awlp").css("visibility","hidden"):jQuery(".wppa_awlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_awlb").css("visibility","hidden"):jQuery(".wppa_awlb").css("visibility","visible")}function wppaCheckSlideLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckCoverImg(){var e=document.getElementById("coverimg_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_covimgbl").css("visibility","hidden"):jQuery(".wppa_covimgbl").css("visibility","visible")}function wppaCheckPotdLink(){var e=document.getElementById("potd_linktype").value;"none"==e||"lightbox"==e||"file"==e||"custom"==e?jQuery(".wppa_potdlp").css("visibility","hidden"):jQuery(".wppa_potdlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_potdlb").css("visibility","hidden"):jQuery(".wppa_potdlb").css("visibility","visible")}function wppaCheckTagLink(){document.getElementById("tagcloud_linktype").value}function wppaCheckMTagLink(){document.getElementById("multitag_linktype").value}function wppaCheckXphotoLink(){var e=document.getElementById("xphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_xlp").css("visibility","hidden"):jQuery(".wppa_xlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_xlb").css("visibility","hidden"):jQuery(".wppa_xlb").css("visibility","visible")}function wppaCheckMphotoLink(){var e=document.getElementById("mphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_mlp").css("visibility","hidden"):jQuery(".wppa_mlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_mlb").css("visibility","hidden"):jQuery(".wppa_mlb").css("visibility","visible")}function wppaCheckSphotoLink(){var e=document.getElementById("sphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_slp").css("visibility","hidden"):jQuery(".wppa_slp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_slb").css("visibility","hidden"):jQuery(".wppa_slb").css("visibility","visible")}function wppaCheckSlidePhotoLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"file"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslp").css("visibility","hidden"):jQuery(".wppa_sslp").css("visibility","visible"),"none"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckResize(){document.getElementById("resize_on_upload").checked?jQuery(".re_up").css("display",""):jQuery(".re_up").css("display","none")}function wppaCheckNumbar(){document.getElementById("show_slideshownumbar").checked?jQuery(".wppa_numbar").css("display",""):jQuery(".wppa_numbar").css("display","none")}function wppaCheckWatermark(){document.getElementById("watermark_on").checked?jQuery(".wppa_watermark").css("display",""):jQuery(".wppa_watermark").css("display","none")}function wppaCheckPopup(){document.getElementById("use_thumb_popup").checked?jQuery(".wppa_popup").css("display",""):jQuery(".wppa_popup").css("display","none")}function wppaCheckGravatar(){document.getElementById("comment_gravatar")&&("url"==document.getElementById("comment_gravatar").value?jQuery(".wppa_grav").css("display",""):jQuery(".wppa_grav").css("display","none"))}function wppaCheckUserUpload(){document.getElementById("user_upload_on").checked?jQuery(".wppa_feup").css("display",""):jQuery(".wppa_feup").css("display","none")}function wppaCheckSplitNamedesc(){document.getElementById("split_namedesc").checked?(jQuery(".swap_namedesc").css("display","none"),jQuery(".hide_empty").css("display","")):(jQuery(".swap_namedesc").css("display",""),jQuery(".hide_empty").css("display","none"))}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),p=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",p)}function checkAll(e,t){var p=document.getElementById(e);p&&(p.checked?jQuery(t).prop("checked","checked"):jQuery(t).prop("checked",""))}function impUpd(e,t){e.checked?(jQuery(t).prop("value",wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).prop("value",wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,p){var a="",o="";a=e||'<div style="padding-left:5px;" >',p?o=p:aftrer="</div>",wppaFeAjaxLog("in");var n=wppaGetXmlHttp(),i=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;i+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,n.open("GET",i,!0),n.send(),n.onreadystatechange=function(){switch(n.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==n.status){var e=wppaTrim(n.responseText).split("||");"ER"==e[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("photostatus-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=a+e[2]+o,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=a+'<span style="color:red;" >Comm error '+n.status+": "+n.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p.open("GET",e,!0),p.send(),p.onreadystatechange=function(){switch(p.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==p.status){var e=wppaTrim(p.responseText).split("||");"ER"==e[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("photostatus-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var o="action=wppa&wppa-action=watermark-photo&photo-id="+t;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(o+="&wppa-watermark-file="+e),p&&(o+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o),a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":document.getElementById("photostatus-"+t).innerHTML=e[2];break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>"}jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("photostatus-"+t).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"}}var wppaAjaxPhotoCount=new Array,wppaPhotoUpdateMatrix=new Array;function wppaAjaxUpdatePhoto(e,t,p,a,o){var n=!1;o&&(n=0==jQuery("#wppaphotodesc"+o+":visible").length,jQuery("#wppaphotodesc"+o+"-html").click(),n&&jQuery("#wppaphotodesc"+o+"-tmce").click());for(var i=wppaPhotoUpdateMatrix.length,s=0,l=!1,r=-1;s<i;)wppaPhotoUpdateMatrix[s][0]==e&&wppaPhotoUpdateMatrix[s][1]==t&&(l=!0,r=s),s++;if(!l){wppaPhotoUpdateMatrix[i]=[e,t,"undefined",!1,!1,a],r=i}wppaPhotoUpdateMatrix[r][3]="number"==typeof p?p:p.value,wppaPhotoUpdateMatrix[r][5]=a,wppaAjaxUpdatePhotoMonitor()}function wppaAjaxUpdateDelphoto(e,t,p){wppaAjaxUpdatePhoto(e,"del"+t,p)}function wppaAjaxUpdatePhotoMonitor(){for(var e=wppaPhotoUpdateMatrix.length,t=0;t<e;)wppaPhotoUpdateMatrix[t][2]==wppaPhotoUpdateMatrix[t][3]||wppaPhotoUpdateMatrix[t][4]||(wppaPhotoUpdateMatrix[t][4]=!0,_wppaAjaxUpdatePhoto(wppaPhotoUpdateMatrix[t][0],wppaPhotoUpdateMatrix[t][1],wppaPhotoUpdateMatrix[t][3],wppaPhotoUpdateMatrix[t][5])),t++}function _wppaAjaxUpdatePhoto(s,l,r,u,c,d){c||(c=""),d||(d="");wppaFeAjaxLog("in"),wppaAjaxPhotoCount[s]||(wppaAjaxPhotoCount[s]=0),wppaAjaxPhotoCount[s]++,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxPhotoCount[s]--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":var o;if(0==wppaAjaxPhotoCount[s]?jQuery("#photostatus-"+s).html(a[2]):jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")"),a[3])(o=jQuery("#fs-a-"+s).attr("href").split("="))[1]=parseInt(o[1])+1,jQuery("#fs-a-"+s).attr("href",o[0]+"="+o[1]),jQuery("#fs-img-"+s).attr("src",o[0]+"="+o[1]);if(a[4])(o=jQuery("#tnp-"+s).attr("src").split("="))[1]=parseInt(o[1])+1,jQuery("#tnp-"+s).attr("src",o[0]+"="+o[1]);void 0!==a[5]&&(jQuery("#imstack-"+s).html(a[5]),0<a[5].length?jQuery("#imstackbutton-"+s).css("display",""):jQuery("#imstackbutton-"+s).css("display","none")),void 0!==a[6]&&jQuery("#dispfileinfo-"+s).html(a[6]);break;case"99":jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+a[2]+"</span>"+d);break;default:jQuery("#photostatus-"+s).html('<span style="color:red">'+a[2]+" ("+a[1]+")</span>")}"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"});var n=0,i=-1;for(count=wppaPhotoUpdateMatrix.length;n<count;)wppaPhotoUpdateMatrix[n][0]==s&&wppaPhotoUpdateMatrix[n][1]==l&&(i=n),n++;if(wppaPhotoUpdateMatrix[i]&&(wppaPhotoUpdateMatrix[i][2]=r||0,wppaPhotoUpdateMatrix[i][4]=!1,wppaPhotoUpdateMatrix[i][5]=!1),wppaFeAjaxLog("out"),wppaAjaxUpdatePhotoMonitor(),u&&"0"==a[1])return jQuery("#photostatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),void setTimeout(function(){wppaReload("#photo_"+s)},1e3)},error:function(e,t,p){wppaAjaxPhotoCount[s]--,jQuery("#photostatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){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",document.getElementById("wppa-dummy")))}_wppaRefreshAfter=!1;var wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,p,a){var o=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var n=wppaAlbumUpdateMatrix.length,i=0,s=!1,l=-1;i<n;)wppaAlbumUpdateMatrix[i][0]==e&&wppaAlbumUpdateMatrix[i][1]==t&&(s=!0,l=i),i++;if(!s){wppaAlbumUpdateMatrix[n]=[e,t,"undefined",!1,!1,a],l=n}wppaAlbumUpdateMatrix[l][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[l][5]=a,wppaAjaxUpdateAlbumMonitor(o)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,p=0;p<t;)wppaAlbumUpdateMatrix[p][2]==wppaAlbumUpdateMatrix[p][3]||wppaAlbumUpdateMatrix[p][4]||(wppaAlbumUpdateMatrix[p][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[p][0],wppaAlbumUpdateMatrix[p][1],wppaAlbumUpdateMatrix[p][3],e,wppaAlbumUpdateMatrix[p][5])),p++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(s,l,r,u,c){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("album-nonce-"+s).value+"&value="+wppaEncode(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxAlbumCount--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+s).html(a[2]):jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+s).html='<span style="color:red">'+a[2]+" ("+a[1]+")</span>"}if(void 0!==a[3]&&wppaProcessFull(a[3],a[4]),c&&"0"==a[1])return jQuery("#albumstatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==l&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var o=0,n=-1,i=wppaAlbumUpdateMatrix.length;o<i;)wppaAlbumUpdateMatrix[o][0]==s&&wppaAlbumUpdateMatrix[o][1]==l&&(n=o),o++;wppaAlbumUpdateMatrix[n][2]=r||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(u)},error:function(e,t,p){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){}})}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,p,e){var a=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+p+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]);break;default:jQuery("#photostatus-"+t).html('<span style="color:red">'+e[2]+"</span>")}jQuery("#wppa-comment-spin-"+p).css("visibility","hidden")}else jQuery("#photostatus-"+t).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")},a.open("GET",o,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(p.responseText).split("||");if(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=p.status)switch(e[1]){case"0":jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2]),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+p.status),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))}else jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+p.status);wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(o,e,i){if(i);else if(!e&&"yes"==document.getElementById(o+"_continue").value)return document.getElementById(o+"_continue").value="no",document.getElementById(o+"_button").value=" Start! ",void(0<jQuery("#"+o+"_togo").html()&&(jQuery("#"+o+"_status").html("Pausing..."),jQuery("#"+o+"_button").css("display","none")));i||(document.getElementById(o+"_continue").value="yes",document.getElementById(o+"_button").value=" Stop! ",""==jQuery("#"+o+"_status").html()&&jQuery("#"+o+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+o+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(i?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("||"),o=a[1],n=!1;return o?(10<a[0].length&&(alert("An error occurred:\n"+a[0]),n=!0),jQuery("#"+o+"_status").html(a[2]),jQuery("#"+o+"_togo").html(a[3]),jQuery("#"+o+"_button").css("display",""),n||"0"==a[3]?"reload"==a[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+o+"', false)",20):void("yes"!=document.getElementById(o+"_continue").value?i||jQuery("#"+o+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+o+"', true)",20))):(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,p){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+o+", Error = "+p+", status = "+t,"force"),jQuery("#"+o+"_status").html("Server error #"+(11-wppaAlwaysContinue));var a=!1;--wppaAlwaysContinue<1&&(a=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(a||0<wppaAlwaysContinue)&&("wppa_remake"==o&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==o&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==o&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+o+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":"Search index table";break;case"wppa_list_errorlog":"WPPA+ Error log";break;case"wppa_list_rating":"Recent ratings";break;case"wppa_list_session":"Active sessions";break;case"wppa_list_comments":"Recent comments"}var t=.9*wppaWindowWidth(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,o="action=wppa&wppa-action=maintenancepopup&slug="+e;if(o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(o),4==p.readyState&&200==p.status){var n=wppaEntityDecode(p.responseText).split("|"),i=n[0];n[0]="";var s=n.join("|").substring(1),l={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(s).dialog(l).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").html("<h2>"+i+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText)}}function wppaAjaxUpdateOptionValue(r,e,t){var p="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(r)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(p+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+r,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+r).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0])alert("The server returned unexpected output:\n"+a[0]);else{switch(a[1]){case"0":jQuery("#img_"+r).attr("src",wppaImageDirectory+"tick.png"),a[3]&&alert(a[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+r).attr("src",wppaImageDirectory+"cross.png"),a[3]&&alert(a[3])}if(jQuery("#img_"+r).attr("title",a[2]),a[4])for(var o,n,i,s=a[4].split(";"),l=0;l<s.length;)o=s[l].split(":"),n=jQuery("#"+o[0]).html(),i=o[1],""!=n&&""==i&&(i='<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("#"+o[0]).html(i),l++}},error:function(e){jQuery("#img_"+r).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+r).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=r&&"icon_corner_style"!=r||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=r&&"svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=r&&"ovl_svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){var t;if(void 0!==e){if("number"==typeof e)return e;var p=(t=(t=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0;for(t="";a<p.length;)t+=p[a],++a<p.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 window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"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 p=0;p<t.length;)"jpg"!=t[p]&&"JPG"!=t[p]||jQuery("#psdesc-"+e).css({display:""}),p++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaCheckLinkPageErr(e){var t="nil";document.getElementById(e+"_linktype")&&(t=document.getElementById(e+"_linktype").value),"0"!=document.getElementById(e+"_linkpage").value||"nil"!=t&&"photo"!=t&&"single"!=t&&"album"!=t&&"content"!=t&&"slide"!=t&&"plainpage"!=t?jQuery("#"+e+"-err").css({display:"none"}):jQuery("#"+e+"-err").css({display:""})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){var p=document.getElementById(t);e&&(p.value?p.value+=","+e:p.value=e,"-clear-"==e&&(p.value=""))}function wppaRefresh(e){var t=new String(document.location).split("#")[0]+"#"+e;document.location=t}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 p,a="",o=-1,n=-2,i=0,s=!1,l=0;l<e.length;)0!=(p=e[l].valueOf())&&(i=o,p==++i?s=!0:s?(a+=o==n?t+o+t+p:t+t+o+t+p,s=!1):a+=t+p,s||(n=p,n++),o=p),l++;for(s&&(a+=".."+o);"."==a.substr(0,1);)a=a.substr(1);for(;a.substr(0,1)==t;)a=a.substr(1);return a}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 p,a=[],o=0,n=0;for(t||(t="."),p=jQuery(e),n=o=0;o<p.length;)p[o].selected&&(a[n]=p[o].value,n++),o++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){var p=jQuery("#"+t).val();0==p.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+p}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+a,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+a+"-spin").css("display","inline")},success:function(e,t,p){var a=e.split("||");"0"==a[1]?document.location=a[2]:alert("Error: "+a[1]+"\n\n"+a[2])},error:function(e,t,p){alert("Export Db Table "+a+" failed. Error = "+p+", status = "+t)},complete:function(e,t,p){jQuery("#"+a+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(i){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+i,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+i+"_togo").html(a[0]);var o=jQuery("#"+i+"_status").html(),n=a[1];""!=o&&""==n&&(n='<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("#"+i+"_status").html(n),setTimeout(function(){wppaAjaxUpdateTogo(i)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||0==e)))}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:"9999"}),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-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,o){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,p){var a=e.split("|");jQuery("#"+o).html(a[0])},error:function(e){},complete:function(e){}})}
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
-
Version: 7.0.
|
6 |
-
Stable tag: 7.0.
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -137,6 +137,11 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
|
|
137 |
|
138 |
== Upgrade Notice ==
|
139 |
|
|
|
|
|
|
|
|
|
|
|
140 |
= 7.0.07 =
|
141 |
|
142 |
* This version addresses various security issues.
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
+
Version: 7.0.08
|
6 |
+
Stable tag: 7.0.07.007
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
137 |
|
138 |
== Upgrade Notice ==
|
139 |
|
140 |
+
= 7.0.08 =
|
141 |
+
|
142 |
+
* This version addresses various security issues.
|
143 |
+
* This version addresses various bug fixes
|
144 |
+
|
145 |
= 7.0.07 =
|
146 |
|
147 |
* This version addresses various security issues.
|
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 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -240,202 +240,8 @@ add_action( 'admin_init', 'wppa_check_tag_system' );
|
|
240 |
// Check if cats system needs conversion
|
241 |
add_action( 'admin_init', 'wppa_check_cat_system' );
|
242 |
|
243 |
-
|
244 |
-
add_action( 'do_meta_boxes', 'wppa_activity' );
|
245 |
|
246 |
-
function wppa_activity(){
|
247 |
-
|
248 |
-
// Are we configured to show the activity widgets?
|
249 |
-
switch ( wppa_opt( 'show_dashboard_widgets' ) ) {
|
250 |
-
case 'all': $doit = true; break;
|
251 |
-
case 'admin': $doit = current_user_can( 'administrator' ); break;
|
252 |
-
default: $doit = false;
|
253 |
-
}
|
254 |
-
|
255 |
-
if ( $doit && function_exists( 'wp_add_dashboard_widget' ) ) {
|
256 |
-
wp_add_dashboard_widget( 'wppa-activity', __( 'Recent WPPA activity', 'wp-photo-album-plus' ), 'wppa_show_activity_feed' ); //, $control_callback = null, $callback_args = null )
|
257 |
-
}
|
258 |
-
}
|
259 |
-
|
260 |
-
function wppa_show_activity_feed() {
|
261 |
-
global $wpdb;
|
262 |
-
|
263 |
-
// Recently uploaded photos
|
264 |
-
echo '<h3>' . __( 'Recently uploaded photos', 'wp-photo-album-plus' ) . '</h3>';
|
265 |
-
// echo '<style>#dashboard-widgets .inside .error { display:none; }</style>';
|
266 |
-
$photos = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_photos ORDER BY timestamp DESC LIMIT 5", ARRAY_A );
|
267 |
-
|
268 |
-
if ( ! empty( $photos ) ) {
|
269 |
-
echo
|
270 |
-
'<table>';
|
271 |
-
foreach( $photos as $photo ) {
|
272 |
-
if ( wppa_user_is( 'administrator' ) ) {
|
273 |
-
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
274 |
-
}
|
275 |
-
else {
|
276 |
-
$href = wppa_get_photo_url( $photo['id'] );
|
277 |
-
}
|
278 |
-
echo
|
279 |
-
'<tr>' .
|
280 |
-
'<td>' .
|
281 |
-
'<a href="' . esc_url( $href ) . '" target="_blank" >' .
|
282 |
-
'<img src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
283 |
-
'</a>' .
|
284 |
-
'</td>' .
|
285 |
-
'<td>';
|
286 |
-
$usr = wppa_get_user_by( 'login', $photo['owner'] );
|
287 |
-
if ( $usr ) {
|
288 |
-
$usr = $usr -> display_name;
|
289 |
-
}
|
290 |
-
else {
|
291 |
-
$usr = sanitize_user( $photo['owner'] );
|
292 |
-
}
|
293 |
-
echo
|
294 |
-
sprintf( __( 'by %s in album %s', 'wp-photo-album-plus' ),
|
295 |
-
'<b>' . $usr . '</b>',
|
296 |
-
'<b>' . sanitize_text_field( wppa_get_album_name( $photo['album'] ) ) . '</b> (' . strval( intval( $photo['album'] ) ) . ')'
|
297 |
-
) .
|
298 |
-
'<br />' .
|
299 |
-
wppa_local_date( '', $photo['timestamp'] ) .
|
300 |
-
'</td>' .
|
301 |
-
'</tr>';
|
302 |
-
}
|
303 |
-
echo
|
304 |
-
'</table>';
|
305 |
-
}
|
306 |
-
else {
|
307 |
-
echo
|
308 |
-
'<p>' .
|
309 |
-
__( 'There are no recently uploaded photos', 'wp-photo-album-plus' ) .
|
310 |
-
'</p>';
|
311 |
-
}
|
312 |
-
echo '<br />';
|
313 |
-
|
314 |
-
// Recent comments
|
315 |
-
echo '<h3>' . __( 'Recent comments on photos', 'wp-photo-album-plus' ) . '</h3>';
|
316 |
-
$comments = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_comments ORDER BY timestamp DESC LIMIT 5", ARRAY_A );
|
317 |
-
if ( ! empty( $comments ) ) {
|
318 |
-
|
319 |
-
echo
|
320 |
-
'<table>';
|
321 |
-
foreach( $comments as $comment ) {
|
322 |
-
$photo = wppa_cache_photo( $comment['photo'] );
|
323 |
-
if ( wppa_user_is( 'administrator' ) ) {
|
324 |
-
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
325 |
-
}
|
326 |
-
else {
|
327 |
-
$href = wppa_get_photo_url( $photo['id'] );
|
328 |
-
}
|
329 |
-
echo
|
330 |
-
'<tr>' .
|
331 |
-
'<td>' .
|
332 |
-
'<a href="' . esc_url( $href ) . '" target="_blank" >' .
|
333 |
-
'<img src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
334 |
-
'</a>' .
|
335 |
-
'</td>' .
|
336 |
-
'<td>';
|
337 |
-
$usr = wppa_get_user_by( 'login', $comment['user'] );
|
338 |
-
if ( $usr ) {
|
339 |
-
$usr = $usr->display_name;
|
340 |
-
}
|
341 |
-
else {
|
342 |
-
$usr = $comment['user'];
|
343 |
-
}
|
344 |
-
echo
|
345 |
-
'<i>' . sanitize_text_field( $comment['comment'] ) . '</i>' .
|
346 |
-
'<br />' .
|
347 |
-
sprintf( __( 'by %s', 'wp-photo-album-plus' ),
|
348 |
-
'<b>' . $usr . '</b>' ) .
|
349 |
-
'<br />' .
|
350 |
-
wppa_local_date( '', $comment['timestamp'] ) .
|
351 |
-
'</td>' .
|
352 |
-
'</tr>';
|
353 |
-
}
|
354 |
-
echo
|
355 |
-
'</table>';
|
356 |
-
}
|
357 |
-
else {
|
358 |
-
echo
|
359 |
-
'<p>' .
|
360 |
-
__( 'There are no recent comments on photos', 'wp-photo-album-plus' ) .
|
361 |
-
'</p>';
|
362 |
-
}
|
363 |
-
|
364 |
-
}
|
365 |
-
|
366 |
-
// Photo of the day history. This is undocumented and no setting for available.
|
367 |
-
if ( get_option( 'wppa_potd_log', 'no' ) == 'yes' ) {
|
368 |
-
add_action( 'do_meta_boxes', 'wppa_potdlog' );
|
369 |
-
}
|
370 |
-
function wppa_potdlog() {
|
371 |
-
|
372 |
-
// Are we configured to show the activity widgets?
|
373 |
-
switch ( wppa_opt( 'show_dashboard_widgets' ) ) {
|
374 |
-
case 'all': $doit = true; break;
|
375 |
-
case 'admin': $doit = current_user_can( 'administrator' ); break;
|
376 |
-
default: $doit = false;
|
377 |
-
}
|
378 |
-
|
379 |
-
if ( $doit && function_exists( 'wp_add_dashboard_widget' ) ) {
|
380 |
-
wp_add_dashboard_widget( 'wppa-potdlog', __( 'Photo of the day history', 'wp-photo-album-plus' ), 'wppa_show_potd_log' );
|
381 |
-
}
|
382 |
-
}
|
383 |
-
function wppa_show_potd_log() {
|
384 |
-
|
385 |
-
// echo '<style>#dashboard-widgets .inside .error { display:none; }</style>';
|
386 |
-
|
387 |
-
// Get data
|
388 |
-
$his = get_option( 'wppa_potd_log_data', array() );
|
389 |
-
if ( ! empty( $his ) ) {
|
390 |
-
echo
|
391 |
-
'<table>';
|
392 |
-
foreach( $his as $item ) {
|
393 |
-
if ( wppa_photo_exists( $item['id'] ) ) {
|
394 |
-
$photo = wppa_cache_photo( $item['id'] );
|
395 |
-
$time = $item['tm'];
|
396 |
-
if ( wppa_user_is( 'administrator' ) ) {
|
397 |
-
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
398 |
-
}
|
399 |
-
else {
|
400 |
-
$href = wppa_get_photo_url( $photo['id'] );
|
401 |
-
}
|
402 |
-
echo
|
403 |
-
'<tr style="border-bottom:1px solid #444;" >' .
|
404 |
-
'<td>' .
|
405 |
-
'<a href="' . esc_url( $href ) . '" target="_blank" >' .
|
406 |
-
'<img src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
407 |
-
'</a>' .
|
408 |
-
'</td>' .
|
409 |
-
'<td>' .
|
410 |
-
__( 'First displayed at', 'wp-photo-album-plus' ) . ': ' . wppa_local_date( '', $time ) . '<br />' .
|
411 |
-
__( 'Name', 'wp-photo-album-plus' ) . ': ' . wppa_get_photo_name( $photo['id'] ) . '<br />' .
|
412 |
-
__( 'Description', 'wp-photo-album-plus' ) . ':<br />' .
|
413 |
-
htmlentities( strip_tags( wppa_get_photo_desc( $photo['id'] ) ) ) .
|
414 |
-
'</td>' .
|
415 |
-
'</tr>';
|
416 |
-
}
|
417 |
-
else {
|
418 |
-
echo
|
419 |
-
'<tr style="border-bottom:1px solid #444;" >' .
|
420 |
-
'<td>' .
|
421 |
-
sprintf( __( 'Photo %d has been removed' ), $item['id'] ) .
|
422 |
-
'</td>' .
|
423 |
-
'<td>' .
|
424 |
-
__( 'First displayed at', 'wp-photo-album-plus' ) . ': ' . wppa_local_date( '', $item['tm'] ) . '<br />' .
|
425 |
-
'</td>' .
|
426 |
-
'</tr>';
|
427 |
-
}
|
428 |
-
}
|
429 |
-
echo
|
430 |
-
'</table>';
|
431 |
-
}
|
432 |
-
else {
|
433 |
-
echo
|
434 |
-
'<p>' .
|
435 |
-
__( 'There is no photo of the day history', 'wp-photo-album-plus' ) .
|
436 |
-
'</p>';
|
437 |
-
}
|
438 |
-
}
|
439 |
|
440 |
// Load panoama js if needed at the backend
|
441 |
if ( get_option( 'wppa_enable_panorama' ) == 'yes' ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
+
* Version 7.0.08
|
7 |
*
|
8 |
*/
|
9 |
|
240 |
// Check if cats system needs conversion
|
241 |
add_action( 'admin_init', 'wppa_check_cat_system' );
|
242 |
|
243 |
+
require_once 'wppa-dashboard-widgets.php';
|
|
|
244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
|
246 |
// Load panoama js if needed at the backend
|
247 |
if ( get_option( 'wppa_enable_panorama' ) == 'yes' ) {
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 7.0.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -404,6 +404,7 @@ global $wppa_log_file;
|
|
404 |
if ( isset( $_POST['tags'] ) ) {
|
405 |
$tags = wppa_sanitize_tags( $_POST['tags'] );
|
406 |
wppa_update_photo( array( 'id' => $photo, 'tags' => $tags ) );
|
|
|
407 |
}
|
408 |
|
409 |
// Custom fields
|
@@ -1344,6 +1345,7 @@ global $wppa_log_file;
|
|
1344 |
echo '||1||<span style="color:red" >'.sprintf( __( 'Could not undelete photo %s' , 'wp-photo-album-plus'), $photo ).'</span>';
|
1345 |
}
|
1346 |
wppa_clear_cache();
|
|
|
1347 |
break;
|
1348 |
|
1349 |
case 'update-album':
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 7.0.08
|
6 |
*
|
7 |
*/
|
8 |
|
404 |
if ( isset( $_POST['tags'] ) ) {
|
405 |
$tags = wppa_sanitize_tags( $_POST['tags'] );
|
406 |
wppa_update_photo( array( 'id' => $photo, 'tags' => $tags ) );
|
407 |
+
wppa_clear_taglist();
|
408 |
}
|
409 |
|
410 |
// Custom fields
|
1345 |
echo '||1||<span style="color:red" >'.sprintf( __( 'Could not undelete photo %s' , 'wp-photo-album-plus'), $photo ).'</span>';
|
1346 |
}
|
1347 |
wppa_clear_cache();
|
1348 |
+
wppa_clear_taglist();
|
1349 |
break;
|
1350 |
|
1351 |
case 'update-album':
|
wppa-dashboard-widgets.php
ADDED
@@ -0,0 +1,441 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* wppa-dashboard-widgets.php
|
3 |
+
* Package: wp-photo-album-plus
|
4 |
+
*
|
5 |
+
* Contains dashboard widgets code
|
6 |
+
*
|
7 |
+
* Version 7.0.08
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Email subscription dashboard widget
|
12 |
+
add_action( 'do_meta_boxes', 'wppa_email_subscription' );
|
13 |
+
|
14 |
+
function wppa_email_subscription() {
|
15 |
+
|
16 |
+
$doit =
|
17 |
+
wppa_switch( 'newalbumnotify' ) ||
|
18 |
+
wppa_switch( 'feuploadnotify' ) ||
|
19 |
+
( wppa_switch( 'commentnotify' ) && wppa_switch( 'show_comments' ) ) ||
|
20 |
+
( wppa_switch( 'commentprevious' ) && wppa_switch( 'show_comments' ) )||
|
21 |
+
( wppa_switch( 'moderatephoto' ) && current_user_can( 'wppa_moderate' ) ) ||
|
22 |
+
( wppa_switch( 'moderatecomment' ) && wppa_switch( 'show_comments' ) && current_user_can( 'wppa_moderate' ) ) ||
|
23 |
+
( wppa_switch( 'photoapproved' ) && wppa_switch( 'upload_moderate' ) ) ||
|
24 |
+
( wppa_switch( 'commentapproved' ) && wppa_switch( 'show_comments' ) );
|
25 |
+
|
26 |
+
if ( $doit && function_exists( 'wp_add_dashboard_widget' ) ) {
|
27 |
+
wp_add_dashboard_widget( 'wppa-email-subscription', __( 'Notify me', 'wp-photo-album-plus' ), 'wppa_show_email_subscription' ); //, $control_callback = null, $callback_args = null )
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
function wppa_show_email_subscription() {
|
32 |
+
|
33 |
+
// Get the body of the widget
|
34 |
+
$body = '';
|
35 |
+
|
36 |
+
// New album
|
37 |
+
if ( wppa_switch( 'newalbumnotify' ) ) {
|
38 |
+
$in_list = wppa_am_i_in_mailinglist( 'newalbumnotify' );
|
39 |
+
$body .= '
|
40 |
+
<li style="padding-top:12px;clear:both;" >
|
41 |
+
<input
|
42 |
+
id="wppa-newalbum-notify"
|
43 |
+
class="wppa-notify-check"
|
44 |
+
type="checkbox"
|
45 |
+
style="float:left;" ' .
|
46 |
+
( $in_list ? 'checked="checked" ' : ' ' ) .
|
47 |
+
'onchange="wppaAjaxNotify(this,\'newalbumnotify\');"
|
48 |
+
/>
|
49 |
+
<label
|
50 |
+
for="wppa-newalbum-notify"
|
51 |
+
class="wppa-notify-label"
|
52 |
+
style="float:left;padding-left:4px;width:90%;margin-top:-3px;"
|
53 |
+
> ' .
|
54 |
+
__( 'A new album is created', 'wp-photo-album-plus' ) . '
|
55 |
+
</label>
|
56 |
+
</li>';
|
57 |
+
}
|
58 |
+
|
59 |
+
// Only if fe upload notify is activated
|
60 |
+
if ( wppa_switch( 'feuploadnotify' ) ) {
|
61 |
+
$in_list = wppa_am_i_in_mailinglist( 'feuploadnotify' );
|
62 |
+
$body .= '
|
63 |
+
<li style="padding-top:12px;clear:both;" >
|
64 |
+
<input
|
65 |
+
id="wppa-feupload-notify"
|
66 |
+
class="wppa-notify-check"
|
67 |
+
type="checkbox"
|
68 |
+
style="float:left;" ' .
|
69 |
+
( $in_list ? 'checked="checked" ' : ' ' ) .
|
70 |
+
'onchange="wppaAjaxNotify(this,\'feuploadnotify\');"
|
71 |
+
/>
|
72 |
+
<label
|
73 |
+
for="wppa-feupload-notify"
|
74 |
+
class="wppa-notify-label"
|
75 |
+
style="float:left;padding-left:4px;width:90%;margin-top:-3px;"
|
76 |
+
> ' .
|
77 |
+
__( 'A new photo is uploaded', 'wp-photo-album-plus' ) . '
|
78 |
+
</label>
|
79 |
+
</li>';
|
80 |
+
}
|
81 |
+
|
82 |
+
// Only if upload moderation is activated
|
83 |
+
if ( wppa_switch( 'upload_moderate' ) ) {
|
84 |
+
|
85 |
+
// Photo approved
|
86 |
+
if ( wppa_switch( 'photoapproved' ) ) {
|
87 |
+
$in_list = wppa_am_i_in_mailinglist( 'photoapproved' );
|
88 |
+
$body .= '
|
89 |
+
<li style="padding-top:12px;clear:both;" >
|
90 |
+
<input
|
91 |
+
id="wppa-photoapproved-notify"
|
92 |
+
class="wppa-notify-check"
|
93 |
+
type="checkbox"
|
94 |
+
style="float:left;" ' .
|
95 |
+
( $in_list ? 'checked="checked" ' : ' ' ) .
|
96 |
+
'onchange="wppaAjaxNotify(this,\'photoapproved\');"
|
97 |
+
/>
|
98 |
+
<label
|
99 |
+
for="wppa-photoapproved-notify"
|
100 |
+
class="wppa-notify-label"
|
101 |
+
style="float:left;padding-left:4px;width:90%;margin-top:-3px;"
|
102 |
+
> ' .
|
103 |
+
__( 'My photo is approved', 'wp-photo-album-plus' ) . '
|
104 |
+
</label>
|
105 |
+
</li>';
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
// Only if comments sytem is activated
|
110 |
+
if ( wppa_switch( 'show_comments' ) ) {
|
111 |
+
|
112 |
+
// A comment is given
|
113 |
+
if ( wppa_switch( 'commentnotify' ) ) {
|
114 |
+
$in_list = wppa_am_i_in_mailinglist( 'commentnotify' );
|
115 |
+
$body .= '
|
116 |
+
<li style="padding-top:12px;clear:both;" >
|
117 |
+
<input
|
118 |
+
id="wppa-comment-notify"
|
119 |
+
class="wppa-notify-check"
|
120 |
+
type="checkbox"
|
121 |
+
style="float:left;" ' .
|
122 |
+
( $in_list ? 'checked="checked" ' : ' ' ) .
|
123 |
+
'onchange="wppaAjaxNotify(this,\'commentnotify\');"
|
124 |
+
/>
|
125 |
+
<label
|
126 |
+
for="wppa-comment-notify"
|
127 |
+
class="wppa-notify-label"
|
128 |
+
style="float:left;padding-left:4px;width:90%;margin-top:-3px;"
|
129 |
+
> ' .
|
130 |
+
__( 'A comment on a photo is given', 'wp-photo-album-plus' ) . '
|
131 |
+
</label>
|
132 |
+
</li>';
|
133 |
+
}
|
134 |
+
|
135 |
+
// Comment approved (to photo owner and commenter)
|
136 |
+
if ( wppa_switch( 'commentapproved' ) ) {
|
137 |
+
$in_list = wppa_am_i_in_mailinglist( 'commentapproved' );
|
138 |
+
$body .= '
|
139 |
+
<li style="padding-top:12px;clear:both;" >
|
140 |
+
<input
|
141 |
+
id="wppa-commentapproved-notify"
|
142 |
+
class="wppa-notify-check"
|
143 |
+
type="checkbox"
|
144 |
+
style="float:left;" ' .
|
145 |
+
( $in_list ? 'checked="checked" ' : ' ' ) .
|
146 |
+
'onchange="wppaAjaxNotify(this,\'commentapproved\');"
|
147 |
+
/>
|
148 |
+
<label
|
149 |
+
for="wppa-commentapproved-notify"
|
150 |
+
class="wppa-notify-label"
|
151 |
+
style="float:left;padding-left:4px;width:90%;margin-top:-3px;"
|
152 |
+
> ' .
|
153 |
+
__( 'A comment on my photo is approved or my comment is approved', 'wp-photo-album-plus' ) . '
|
154 |
+
</label>
|
155 |
+
</li>';
|
156 |
+
}
|
157 |
+
|
158 |
+
// Commented previous (to photo owner)
|
159 |
+
if ( wppa_switch( 'commentprevious' ) ) {
|
160 |
+
$in_list = wppa_am_i_in_mailinglist( 'commentprevious' );
|
161 |
+
$body .= '
|
162 |
+
<li style="padding-top:12px;clear:both;" >
|
163 |
+
<input
|
164 |
+
id="wppa-commentprevious-notify"
|
165 |
+
class="wppa-notify-check"
|
166 |
+
type="checkbox"
|
167 |
+
style="float:left;" ' .
|
168 |
+
( $in_list ? 'checked="checked" ' : ' ' ) .
|
169 |
+
'onchange="wppaAjaxNotify(this,\'commentprevious\');"
|
170 |
+
/>
|
171 |
+
<label
|
172 |
+
for="wppa-commentprevious-notify"
|
173 |
+
class="wppa-notify-label"
|
174 |
+
style="float:left;padding-left:4px;width:90%;margin-top:-3px;"
|
175 |
+
> ' .
|
176 |
+
__( 'A comment is given on a photo that i commented before', 'wp-photo-album-plus' ) . '
|
177 |
+
</label>
|
178 |
+
</li>';
|
179 |
+
}
|
180 |
+
|
181 |
+
}
|
182 |
+
|
183 |
+
// Only show to moderators
|
184 |
+
if ( current_user_can( 'wppa_moderate' ) ) {
|
185 |
+
|
186 |
+
// Only if photo modaration activated
|
187 |
+
if ( wppa_switch( 'upload_moderate' ) ) {
|
188 |
+
$in_list = wppa_am_i_in_mailinglist( 'moderatephoto' );
|
189 |
+
$body .= '
|
190 |
+
<li style="padding-top:12px;clear:both;" >
|
191 |
+
<input
|
192 |
+
id="wppa-upload-moderate"
|
193 |
+
class="wppa-notify-check"
|
194 |
+
type="checkbox"
|
195 |
+
style="float:left;" ' .
|
196 |
+
( $in_list ? 'checked="checked" ' : ' ' ) .
|
197 |
+
'onchange="wppaAjaxNotify(this,\'moderatephoto\');"
|
198 |
+
/>
|
199 |
+
<label
|
200 |
+
for="wppa-upload-moderate"
|
201 |
+
class="wppa-notify-label"
|
202 |
+
style="float:left;padding-left:4px;width:90%;margin-top:-3px;"
|
203 |
+
> ' .
|
204 |
+
__( 'A photo needs moderation', 'wp-photo-album-plus' ) . '
|
205 |
+
</label>
|
206 |
+
</li>';
|
207 |
+
}
|
208 |
+
|
209 |
+
// Only if comment moderation activated
|
210 |
+
if ( wppa_opt( 'moderate_comment' ) != '-none-' ) {
|
211 |
+
$in_list = wppa_am_i_in_mailinglist( 'moderatecomment' );
|
212 |
+
$body .= '
|
213 |
+
<li style="padding-top:12px;clear:both;" >
|
214 |
+
<input
|
215 |
+
id="wppa-upload-moderate-comment"
|
216 |
+
class="wppa-notify-check"
|
217 |
+
type="checkbox"
|
218 |
+
style="float:left;" ' .
|
219 |
+
( $in_list ? 'checked="checked" ' : ' ' ) .
|
220 |
+
'onchange="wppaAjaxNotify(this,\'moderatecomment\');"
|
221 |
+
/>
|
222 |
+
<label
|
223 |
+
for="wppa-upload-moderate-comment"
|
224 |
+
class="wppa-notify-label"
|
225 |
+
style="float:left;padding-left:4px;width:90%;margin-top:-3px;"
|
226 |
+
> ' .
|
227 |
+
__( 'A comment needs moderation', 'wp-photo-album-plus' ) . '
|
228 |
+
</label>
|
229 |
+
</li>';
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
// Nothing to show?
|
234 |
+
if ( ! $body ) {
|
235 |
+
return;
|
236 |
+
}
|
237 |
+
|
238 |
+
echo
|
239 |
+
__( 'Notify me when...', 'wp-photo-album-plus' ) . '
|
240 |
+
<br />
|
241 |
+
<ul>' . $body . '</ul>
|
242 |
+
<input type="hidden" id="wppa-ntfy-nonce" value="' . wp_create_nonce( 'wppa-ntfy-nonce' ) . '" />
|
243 |
+
<div style="clear:both;" ></div>';
|
244 |
+
}
|
245 |
+
|
246 |
+
// Activity feed
|
247 |
+
add_action( 'do_meta_boxes', 'wppa_activity' );
|
248 |
+
|
249 |
+
function wppa_activity(){
|
250 |
+
|
251 |
+
// Are we configured to show the activity widgets?
|
252 |
+
switch ( wppa_opt( 'show_dashboard_widgets' ) ) {
|
253 |
+
case 'all': $doit = true; break;
|
254 |
+
case 'admin': $doit = current_user_can( 'administrator' ); break;
|
255 |
+
default: $doit = false;
|
256 |
+
}
|
257 |
+
|
258 |
+
if ( $doit && function_exists( 'wp_add_dashboard_widget' ) ) {
|
259 |
+
wp_add_dashboard_widget( 'wppa-activity', __( 'Recent WPPA activity', 'wp-photo-album-plus' ), 'wppa_show_activity_feed' ); //, $control_callback = null, $callback_args = null )
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
+
function wppa_show_activity_feed() {
|
264 |
+
global $wpdb;
|
265 |
+
|
266 |
+
// Recently uploaded photos
|
267 |
+
echo '<h3>' . __( 'Recently uploaded photos', 'wp-photo-album-plus' ) . '</h3>';
|
268 |
+
|
269 |
+
$photos = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_photos ORDER BY timestamp DESC LIMIT 5", ARRAY_A );
|
270 |
+
|
271 |
+
if ( ! empty( $photos ) ) {
|
272 |
+
echo
|
273 |
+
'<table>';
|
274 |
+
foreach( $photos as $photo ) {
|
275 |
+
if ( wppa_user_is( 'administrator' ) ) {
|
276 |
+
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
277 |
+
}
|
278 |
+
else {
|
279 |
+
$href = wppa_get_photo_url( $photo['id'] );
|
280 |
+
}
|
281 |
+
echo
|
282 |
+
'<tr>' .
|
283 |
+
'<td>' .
|
284 |
+
'<a href="' . esc_url( $href ) . '" target="_blank" >' .
|
285 |
+
'<img src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
286 |
+
'</a>' .
|
287 |
+
'</td>' .
|
288 |
+
'<td>';
|
289 |
+
$usr = wppa_get_user_by( 'login', $photo['owner'] );
|
290 |
+
if ( $usr ) {
|
291 |
+
$usr = $usr -> display_name;
|
292 |
+
}
|
293 |
+
else {
|
294 |
+
$usr = sanitize_user( $photo['owner'] );
|
295 |
+
}
|
296 |
+
echo
|
297 |
+
sprintf( __( 'by %s in album %s', 'wp-photo-album-plus' ),
|
298 |
+
'<b>' . $usr . '</b>',
|
299 |
+
'<b>' . sanitize_text_field( wppa_get_album_name( $photo['album'] ) ) . '</b> (' . strval( intval( $photo['album'] ) ) . ')'
|
300 |
+
) .
|
301 |
+
'<br />' .
|
302 |
+
wppa_local_date( '', $photo['timestamp'] ) .
|
303 |
+
'</td>' .
|
304 |
+
'</tr>';
|
305 |
+
}
|
306 |
+
echo
|
307 |
+
'</table>';
|
308 |
+
}
|
309 |
+
else {
|
310 |
+
echo
|
311 |
+
'<p>' .
|
312 |
+
__( 'There are no recently uploaded photos', 'wp-photo-album-plus' ) .
|
313 |
+
'</p>';
|
314 |
+
}
|
315 |
+
echo '<br />';
|
316 |
+
|
317 |
+
// Recent comments
|
318 |
+
echo '<h3>' . __( 'Recent comments on photos', 'wp-photo-album-plus' ) . '</h3>';
|
319 |
+
$comments = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_comments ORDER BY timestamp DESC LIMIT 5", ARRAY_A );
|
320 |
+
if ( ! empty( $comments ) ) {
|
321 |
+
|
322 |
+
echo
|
323 |
+
'<table>';
|
324 |
+
foreach( $comments as $comment ) {
|
325 |
+
$photo = wppa_cache_photo( $comment['photo'] );
|
326 |
+
if ( wppa_user_is( 'administrator' ) ) {
|
327 |
+
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
328 |
+
}
|
329 |
+
else {
|
330 |
+
$href = wppa_get_photo_url( $photo['id'] );
|
331 |
+
}
|
332 |
+
echo
|
333 |
+
'<tr>' .
|
334 |
+
'<td>' .
|
335 |
+
'<a href="' . esc_url( $href ) . '" target="_blank" >' .
|
336 |
+
'<img src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
337 |
+
'</a>' .
|
338 |
+
'</td>' .
|
339 |
+
'<td>';
|
340 |
+
$usr = wppa_get_user_by( 'login', $comment['user'] );
|
341 |
+
if ( $usr ) {
|
342 |
+
$usr = $usr->display_name;
|
343 |
+
}
|
344 |
+
else {
|
345 |
+
$usr = $comment['user'];
|
346 |
+
}
|
347 |
+
echo
|
348 |
+
'<i>' . sanitize_text_field( $comment['comment'] ) . '</i>' .
|
349 |
+
'<br />' .
|
350 |
+
sprintf( __( 'by %s', 'wp-photo-album-plus' ),
|
351 |
+
'<b>' . $usr . '</b>' ) .
|
352 |
+
'<br />' .
|
353 |
+
wppa_local_date( '', $comment['timestamp'] ) .
|
354 |
+
'</td>' .
|
355 |
+
'</tr>';
|
356 |
+
}
|
357 |
+
echo
|
358 |
+
'</table>';
|
359 |
+
}
|
360 |
+
else {
|
361 |
+
echo
|
362 |
+
'<p>' .
|
363 |
+
__( 'There are no recent comments on photos', 'wp-photo-album-plus' ) .
|
364 |
+
'</p>';
|
365 |
+
}
|
366 |
+
|
367 |
+
}
|
368 |
+
|
369 |
+
// Photo of the day history. This is undocumented and no setting for available.
|
370 |
+
if ( get_option( 'wppa_potd_log', 'no' ) == 'yes' ) {
|
371 |
+
add_action( 'do_meta_boxes', 'wppa_potdlog' );
|
372 |
+
}
|
373 |
+
|
374 |
+
function wppa_potdlog() {
|
375 |
+
|
376 |
+
// Are we configured to show the activity widgets?
|
377 |
+
switch ( wppa_opt( 'show_dashboard_widgets' ) ) {
|
378 |
+
case 'all': $doit = true; break;
|
379 |
+
case 'admin': $doit = current_user_can( 'administrator' ); break;
|
380 |
+
default: $doit = false;
|
381 |
+
}
|
382 |
+
|
383 |
+
if ( $doit && function_exists( 'wp_add_dashboard_widget' ) ) {
|
384 |
+
wp_add_dashboard_widget( 'wppa-potdlog', __( 'Photo of the day history', 'wp-photo-album-plus' ), 'wppa_show_potd_log' );
|
385 |
+
}
|
386 |
+
}
|
387 |
+
|
388 |
+
function wppa_show_potd_log() {
|
389 |
+
|
390 |
+
// Get data
|
391 |
+
$his = get_option( 'wppa_potd_log_data', array() );
|
392 |
+
if ( ! empty( $his ) ) {
|
393 |
+
echo
|
394 |
+
'<table>';
|
395 |
+
foreach( $his as $item ) {
|
396 |
+
if ( wppa_photo_exists( $item['id'] ) ) {
|
397 |
+
$photo = wppa_cache_photo( $item['id'] );
|
398 |
+
$time = $item['tm'];
|
399 |
+
if ( wppa_user_is( 'administrator' ) ) {
|
400 |
+
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
401 |
+
}
|
402 |
+
else {
|
403 |
+
$href = wppa_get_photo_url( $photo['id'] );
|
404 |
+
}
|
405 |
+
echo
|
406 |
+
'<tr style="border-bottom:1px solid #444;" >' .
|
407 |
+
'<td>' .
|
408 |
+
'<a href="' . esc_url( $href ) . '" target="_blank" >' .
|
409 |
+
'<img src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
410 |
+
'</a>' .
|
411 |
+
'</td>' .
|
412 |
+
'<td>' .
|
413 |
+
__( 'First displayed at', 'wp-photo-album-plus' ) . ': ' . wppa_local_date( '', $time ) . '<br />' .
|
414 |
+
__( 'Name', 'wp-photo-album-plus' ) . ': ' . wppa_get_photo_name( $photo['id'] ) . '<br />' .
|
415 |
+
__( 'Description', 'wp-photo-album-plus' ) . ':<br />' .
|
416 |
+
htmlentities( strip_tags( wppa_get_photo_desc( $photo['id'] ) ) ) .
|
417 |
+
'</td>' .
|
418 |
+
'</tr>';
|
419 |
+
}
|
420 |
+
else {
|
421 |
+
echo
|
422 |
+
'<tr style="border-bottom:1px solid #444;" >' .
|
423 |
+
'<td>' .
|
424 |
+
sprintf( __( 'Photo %d has been removed' ), $item['id'] ) .
|
425 |
+
'</td>' .
|
426 |
+
'<td>' .
|
427 |
+
__( 'First displayed at', 'wp-photo-album-plus' ) . ': ' . wppa_local_date( '', $item['tm'] ) . '<br />' .
|
428 |
+
'</td>' .
|
429 |
+
'</tr>';
|
430 |
+
}
|
431 |
+
}
|
432 |
+
echo
|
433 |
+
'</table>';
|
434 |
+
}
|
435 |
+
else {
|
436 |
+
echo
|
437 |
+
'<p>' .
|
438 |
+
__( 'There is no photo of the day history', 'wp-photo-album-plus' ) .
|
439 |
+
'</p>';
|
440 |
+
}
|
441 |
+
}
|
wppa-links.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Frontend links
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1843,8 +1843,8 @@ global $wpdb;
|
|
1843 |
break;
|
1844 |
case 'custom':
|
1845 |
if ( $wich == 'potdwidget' ) {
|
1846 |
-
$result['url'] = wppa_opt( '
|
1847 |
-
$result['title'] = wppa_opt( '
|
1848 |
$result['is_url'] = true;
|
1849 |
$result['is_lightbox'] = false;
|
1850 |
return $result;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Frontend links
|
6 |
+
* Version 7.0.08
|
7 |
*
|
8 |
*/
|
9 |
|
1843 |
break;
|
1844 |
case 'custom':
|
1845 |
if ( $wich == 'potdwidget' ) {
|
1846 |
+
$result['url'] = wppa_opt( 'potd_linkurl' );
|
1847 |
+
$result['title'] = wppa_opt( 'potd_linktitle' );
|
1848 |
$result['is_url'] = true;
|
1849 |
$result['is_lightbox'] = false;
|
1850 |
return $result;
|
wppa-photo-files.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-photo-files.php
|
3 |
*
|
4 |
* Functions used to create/manipulate photofiles
|
5 |
-
* Version 7.0.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -153,6 +153,15 @@ global $wpdb;
|
|
153 |
wppa_log('dbg', 'make called with'.$file.' '.$id.' '.$ext.' '.$do_thumb. ' exists=' . is_file($file), true);
|
154 |
$thumb = wppa_cache_thumb( $id );
|
155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
$src_size = @getimagesize( $file, $info );
|
157 |
|
158 |
// If the given file is not an image file, log error and exit
|
2 |
/* wppa-photo-files.php
|
3 |
*
|
4 |
* Functions used to create/manipulate photofiles
|
5 |
+
* Version 7.0.08
|
6 |
*
|
7 |
*/
|
8 |
|
153 |
wppa_log('dbg', 'make called with'.$file.' '.$id.' '.$ext.' '.$do_thumb. ' exists=' . is_file($file), true);
|
154 |
$thumb = wppa_cache_thumb( $id );
|
155 |
|
156 |
+
// If it is a pdf, check if the .jpg source exists, and change $file to the source .jpg
|
157 |
+
if ( wppa_is_pdf( $id ) ) {
|
158 |
+
$file = wppa_strip_ext( wppa_get_source_path( $id ) ) . '.jpg';
|
159 |
+
if ( ! wppa_is_file( $file ) ) {
|
160 |
+
wppa_log( 'fso', 'Could not make files out of non-existing ...' . htmlentities( substr( $file, strpos( $file, '/wppa-source' ) ) ) );
|
161 |
+
return false;
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
$src_size = @getimagesize( $file, $info );
|
166 |
|
167 |
// If the given file is not an image file, log error and exit
|
wppa-potd-admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
* admin photo of the day widget
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -52,7 +52,7 @@ global $wppa_defaults;
|
|
52 |
|
53 |
// The Page title
|
54 |
echo
|
55 |
-
'<h1 style="display:inline;" >' . __( 'Photo of the Day (Widget) Settings', 'wp-photo-album-plus' ) . '</h1>' .
|
56 |
__( 'Changes are updated immediately. The page will reload if required.', 'wp-photo-album-plus' ) .
|
57 |
'<br /> ';
|
58 |
|
@@ -71,7 +71,6 @@ global $wppa_defaults;
|
|
71 |
'<td>' . __( 'Name', 'wp-photo-album-plus' ) . '</td>' .
|
72 |
'<td>' . __( 'Description', 'wp-photo-album-plus') . '</td>' .
|
73 |
'<td>' . __( 'Setting', 'wp-photo-album-plus') . '</td>' .
|
74 |
-
'<td>' . __( 'Help', 'wp-photo-album-plus' ) . '</td>' .
|
75 |
'</tr>' .
|
76 |
'</thead>';
|
77 |
|
@@ -79,157 +78,172 @@ global $wppa_defaults;
|
|
79 |
echo
|
80 |
'<tbody class="wppa_table" >';
|
81 |
|
82 |
-
$name = __('Widget Title:', 'wp-photo-album-plus');
|
83 |
-
$desc = __('The title of the widget.', 'wp-photo-album-plus');
|
84 |
-
$help = esc_js(__('Enter/modify the title for the widget. This is a default and can be overriden at widget activation.', 'wp-photo-album-plus'));
|
85 |
$slug = 'wppa_potd_title';
|
86 |
-
$html = wppa_potd_input($slug, '85%');
|
87 |
-
wppa_potd_setting($slug, '1', $name, $desc, $html
|
88 |
|
89 |
-
$name = __('Widget Photo Width:', 'wp-photo-album-plus');
|
90 |
-
$desc = __('Enter the desired display width of the photo in the sidebar.', 'wp-photo-album-plus');
|
91 |
-
$help = '';
|
92 |
$slug = 'wppa_potd_widget_width';
|
93 |
-
$html = wppa_potd_input($slug, '40px', '', __('pixels wide', 'wp-photo-album-plus'));
|
94 |
-
wppa_potd_setting($slug, '2', $name, $desc, $html
|
95 |
|
96 |
-
$name = __('Horizontal alignment:', 'wp-photo-album-plus');
|
97 |
-
$desc = __('Enter the desired display alignment of the photo in the sidebar.', 'wp-photo-album-plus');
|
98 |
-
$help = '';
|
99 |
$slug = 'wppa_potd_align';
|
100 |
-
$opts = array(__('--- none ---', 'wp-photo-album-plus'
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
$linktype = wppa_opt( 'potd_linktype' );
|
106 |
if ( $linktype == 'custom' ) {
|
107 |
|
108 |
-
$name = __('Link to:', 'wp-photo-album-plus');
|
109 |
-
$desc = __('Enter the url. Do\'nt forget the HTTP://', 'wp-photo-album-plus');
|
110 |
-
$help = '';
|
111 |
$slug = 'wppa_potd_linkurl';
|
112 |
-
$html = wppa_potd_input($slug, '85%');
|
113 |
-
wppa_potd_setting($slug, '4', $name, $desc, $html
|
114 |
|
115 |
-
$name = __('Link Title:', 'wp-photo-album-plus');
|
116 |
-
$desc = __('The balloon text when hovering over the photo.', 'wp-photo-album-plus');
|
117 |
-
$help = '';
|
118 |
$slug = 'wppa_potd_linktitle';
|
119 |
-
$html = wppa_potd_input($slug, '85%');
|
120 |
-
wppa_potd_setting($slug, '4a', $name, $desc, $html
|
121 |
-
|
122 |
}
|
123 |
else {
|
124 |
-
$name = __('Link to:', 'wp-photo-album-plus');
|
125 |
-
$desc = __('Links are set on the <b>Photo Albums -> Settings</b> screen.', 'wp-photo-album-plus');
|
126 |
-
$help = '';
|
127 |
$slug = 'wppa_potd_linkurl';
|
128 |
$html = '';
|
129 |
-
wppa_potd_setting($slug, '4', $name, $desc, $html
|
130 |
}
|
131 |
|
132 |
-
$name = __('Subtitle:', 'wp-photo-album-plus');
|
133 |
-
$desc = __('Select the content of the subtitle.', 'wp-photo-album-plus');
|
134 |
-
$help = '';
|
135 |
$slug = 'wppa_potd_subtitle';
|
136 |
-
$opts = array( __('--- none ---', 'wp-photo-album-plus'),
|
137 |
-
__('Photo Name', 'wp-photo-album-plus'),
|
138 |
-
__('Description', 'wp-photo-album-plus'),
|
139 |
-
__('Owner', 'wp-photo-album-plus')
|
140 |
);
|
141 |
-
$vals = array(
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
144 |
|
145 |
-
$name = __('Counter:', 'wp-photo-album-plus');
|
146 |
-
$desc = __('Display a counter of other photos in the album.', 'wp-photo-album-plus');
|
147 |
-
$help = '';
|
148 |
$slug = 'wppa_potd_counter';
|
149 |
-
$html = wppa_potd_checkbox($slug);
|
150 |
-
wppa_potd_setting($slug, '6', $name, $desc, $html
|
151 |
|
152 |
-
$name = __('Link to:', 'wp-photo-album-plus');
|
153 |
-
$desc = __('The counter links to.', 'wp-photo-album-plus');
|
154 |
-
$help = '';
|
155 |
$slug = 'wppa_potd_counter_link';
|
156 |
-
$opts = array(__( 'thumbnails', 'wp-photo-album-plus' ),
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
164 |
$slug = 'wppa_potd_album_type';
|
165 |
-
$opts = array(__('physical albums', 'wp-photo-album-plus'),
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
$
|
172 |
-
$
|
|
|
|
|
|
|
173 |
$slug = 'wppa_potd_album';
|
174 |
if ( get_option( 'wppa_potd_album_type' ) == 'physical' ) {
|
175 |
-
$html = '<select
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
'
|
184 |
-
|
185 |
-
|
186 |
-
'
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
|
|
|
|
|
|
|
|
192 |
}
|
193 |
else {
|
194 |
-
$desc = __('Select the albums to use for the photo of the day.', 'wp-photo-album-plus');
|
195 |
$opts = array( __( '- all albums -' , 'wp-photo-album-plus' ),
|
196 |
__( '- all -separate- albums -' , 'wp-photo-album-plus' ),
|
197 |
__( '- all albums except -separate-' , 'wp-photo-album-plus' ),
|
198 |
__( '- top rated photos -' , 'wp-photo-album-plus' ),
|
199 |
);
|
200 |
-
$vals = array(
|
201 |
-
|
202 |
-
|
|
|
|
|
|
|
|
|
203 |
}
|
204 |
|
205 |
if ( get_option( 'wppa_potd_album_type' ) == 'physical' ) {
|
206 |
-
$name = __('Include (grand)children:', 'wp-photo-album-plus');
|
207 |
-
$desc = __('Include the photos of all sub albums?', 'wp-photo-album-plus');
|
208 |
-
$help = '';
|
209 |
$slug = 'wppa_potd_include_subs';
|
210 |
-
$html = wppa_potd_checkbox($slug, $onch);
|
211 |
-
wppa_potd_setting($slug, '9a', $name, $desc, $html
|
212 |
|
213 |
-
$name = __('Inverse selection:', 'wp-photo-album-plus');
|
214 |
-
$desc = __('Use any album, except the selection made above.', 'wp-photo-album-plus');
|
215 |
-
$help = '';
|
216 |
$slug = 'wppa_potd_inverse';
|
217 |
-
$html = wppa_potd_checkbox($slug, $onch);
|
218 |
-
wppa_potd_setting($slug, '9b', $name, $desc, $html
|
219 |
}
|
220 |
|
221 |
-
$name = __('Status filter:', 'wp-photo-album-plus');
|
222 |
-
$desc = __('Use only photos with a certain status.', 'wp-photo-album-plus');
|
223 |
-
$help = esc_js(__('Select - none - if you want no filtering on status.', 'wp-photo-album-plus'));
|
224 |
$slug = 'wppa_potd_status_filter';
|
225 |
-
$opts = array( __('- none -', 'wp-photo-album-plus'),
|
226 |
-
__( 'Publish' , 'wp-photo-album-plus'),
|
227 |
-
__( 'Featured' , 'wp-photo-album-plus'),
|
228 |
-
__( 'Gold' , 'wp-photo-album-plus'),
|
229 |
-
__( 'Silver' , 'wp-photo-album-plus'),
|
230 |
-
__( 'Bronze' , 'wp-photo-album-plus'),
|
231 |
-
__( 'Any medal' , 'wp-photo-album-plus'),
|
232 |
-
|
233 |
$vals = array( 'none',
|
234 |
'publish',
|
235 |
'featured',
|
@@ -237,40 +251,50 @@ global $wppa_defaults;
|
|
237 |
'silver',
|
238 |
'bronze',
|
239 |
'anymedal',
|
240 |
-
|
241 |
-
$html = wppa_potd_select($slug, $opts, $vals);
|
242 |
-
wppa_potd_setting($slug, '10', $name, $desc, $html
|
243 |
|
244 |
-
$name = __('Display method:', 'wp-photo-album-plus');
|
245 |
-
$desc = __('Select the way a photo will be selected.', 'wp-photo-album-plus');
|
246 |
-
$help = '';
|
247 |
$slug = 'wppa_potd_method';
|
248 |
-
$opts = array( __('Fixed photo', 'wp-photo-album-plus'),
|
249 |
-
__('Random', 'wp-photo-album-plus'),
|
250 |
-
__('Last upload', 'wp-photo-album-plus'),
|
251 |
-
__('Change every', 'wp-photo-album-plus'),
|
252 |
-
|
253 |
-
$vals = array(
|
254 |
-
|
255 |
-
|
|
|
|
|
|
|
|
|
256 |
|
257 |
if ( get_option( 'wppa_potd_method' ) == '4' ) { // Change every
|
258 |
-
$name = __('Change every period:', 'wp-photo-album-plus');
|
259 |
-
$desc = __('The time period a certain photo is used.', 'wp-photo-album-plus');
|
260 |
-
$help = '';
|
261 |
$slug = 'wppa_potd_period';
|
262 |
-
$opts = array( __('pageview.', 'wp-photo-album-plus'),
|
263 |
-
__('hour.', 'wp-photo-album-plus'),
|
264 |
-
__('day.', 'wp-photo-album-plus'),
|
265 |
-
__('week.', 'wp-photo-album-plus'),
|
266 |
-
__('month.', 'wp-photo-album-plus'),
|
267 |
-
__('day of week is order#', 'wp-photo-album-plus'),
|
268 |
-
__('day of month is order#', 'wp-photo-album-plus'),
|
269 |
-
__('day of year is order#', 'wp-photo-album-plus')
|
270 |
);
|
271 |
-
$vals = array(
|
272 |
-
|
273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
$wppa_widget_period = get_option( 'wppa_potd_period' );
|
276 |
if ( substr( $wppa_widget_period, 0, 7 ) == 'day-of-' ) {
|
@@ -288,12 +312,15 @@ global $wppa_defaults;
|
|
288 |
$date_key = 'z';
|
289 |
break;
|
290 |
}
|
291 |
-
while ( get_option( 'wppa_potd_offset', '0' ) > $n_days )
|
292 |
-
|
|
|
|
|
|
|
|
|
293 |
|
294 |
-
$name = __('Day offset:', 'wp-photo-album-plus');
|
295 |
-
$desc = __('The difference between daynumber and photo order number.', 'wp-photo-album-plus');
|
296 |
-
$help = '';
|
297 |
$slug = 'wppa_potd_offset';
|
298 |
$opts = array();
|
299 |
$day = '0';
|
@@ -305,61 +332,57 @@ global $wppa_defaults;
|
|
305 |
$html = '<span style="float:left;" >' .
|
306 |
sprintf( __('Current day# = %s, offset =', 'wp-photo-album-plus'), wppa_local_date( $date_key ) ) .
|
307 |
'</span> ' .
|
308 |
-
wppa_potd_select($slug, $opts, $vals, $onch);
|
309 |
|
310 |
$photo_order = wppa_local_date( $date_key ) - get_option( 'wppa_potd_offset', '0' );
|
311 |
while ( $photo_order < '0' ) {
|
312 |
$photo_order += $n_days;
|
313 |
}
|
314 |
|
315 |
-
$html .= sprintf( __('Todays photo order# = %s.', 'wp-photo-album-plus'), $photo_order );
|
316 |
-
wppa_potd_setting($slug, '11b', $name, $desc, $html
|
317 |
|
318 |
}
|
319 |
}
|
320 |
|
321 |
-
$name = __('Preview', 'wp-photo-album-plus');
|
322 |
-
$desc = __('Current "photo of the day":', 'wp-photo-album-plus');
|
323 |
-
$help = '';
|
324 |
$slug = 'wppa_potd_photo';
|
325 |
$photo = wppa_get_potd();
|
326 |
if ( $photo ) {
|
327 |
$html = '<div style="display:inline-block;width:25%;text-align:center;vertical-align:middle;">' .
|
328 |
-
'<img src="' . wppa_get_thumb_url( $photo['id'] ) . '" />' .
|
329 |
'</div>' .
|
330 |
'<div style="display:inline-block;width:75%;text-align:center;vertical-align:middle;" >' .
|
331 |
-
__('Album', 'wp-photo-album-plus') . ': ' . wppa_get_album_name( $photo['album'] ) .
|
332 |
'<br />' .
|
333 |
-
__('Uploader', 'wp-photo-album-plus') . ': ' . $photo['owner'] .
|
334 |
'</div>';
|
335 |
|
336 |
}
|
337 |
else {
|
338 |
-
$html = __('Not found.', 'wp-photo-album-plus');
|
339 |
}
|
340 |
-
wppa_potd_setting($slug, '12', $name, $desc, $html
|
341 |
|
342 |
-
$name = __('Show selection', 'wp-photo-album-plus');
|
343 |
-
$desc = __('Show the photos in the current selection.', 'wp-photo-album-plus');
|
344 |
-
$help = '';
|
345 |
$slug = 'wppa_potd_preview';
|
346 |
-
$html = wppa_potd_checkbox($slug, $onch);
|
347 |
-
wppa_potd_setting($slug, '13', $name, $desc, $html
|
348 |
|
349 |
-
$name = __('Log potd', 'wp-photo-album-plus');
|
350 |
-
$desc = __('Keep track of the potd history', 'wp-photo-album-plus');
|
351 |
-
$help = '';
|
352 |
$slug = 'wppa_potd_log';
|
353 |
-
$html = wppa_potd_checkbox($slug);
|
354 |
-
wppa_potd_setting($slug, '14', $name, $desc, $html
|
355 |
|
356 |
-
$name = __('Log potd max', 'wp-photo-album-plus');
|
357 |
-
$desc = __('Max length of the potd history (items)', 'wp-photo-album-plus');
|
358 |
-
$help = '';
|
359 |
$slug = 'wppa_potd_log_max';
|
360 |
$opts = array( '5', '10', '15', '20', '30', '50', '100' );
|
361 |
-
$html = wppa_potd_select($slug, $opts, $opts);
|
362 |
-
wppa_potd_setting($slug, '15', $name, $desc, $html
|
363 |
|
364 |
|
365 |
// Cose table body
|
@@ -374,20 +397,15 @@ global $wppa_defaults;
|
|
374 |
'<td>' . __( 'Name', 'wp-photo-album-plus' ) . '</td>' .
|
375 |
'<td>' . __( 'Description', 'wp-photo-album-plus') . '</td>' .
|
376 |
'<td>' . __( 'Setting', 'wp-photo-album-plus') . '</td>' .
|
377 |
-
'<td>' . __( 'Help', 'wp-photo-album-plus' ) . '</td>' .
|
378 |
'</tr>' .
|
379 |
'</tfoot>' .
|
380 |
'</table>';
|
381 |
|
382 |
-
// Diagnostic
|
383 |
-
// echo
|
384 |
-
// 'Diagnostic: wppa_potd_album = ' . get_option( 'wppa_potd_album' ) . ' wppa_potd_photo = ' . get_option( 'wppa_potd_photo' );
|
385 |
-
|
386 |
// Status star must be here for js
|
387 |
echo
|
388 |
'<img' .
|
389 |
' id="img_potd_photo"' .
|
390 |
-
' src="' . wppa_get_imgdir( 'star.ico' ) . '" style="height:12px;display:none;"' .
|
391 |
' />';
|
392 |
|
393 |
// The potd photo pool
|
@@ -399,7 +417,7 @@ global $wppa_defaults;
|
|
399 |
'<thead>' .
|
400 |
'<tr>' .
|
401 |
'<td>' .
|
402 |
-
__( 'Photos in the current selection', 'wp-photo-album-plus' ) .
|
403 |
'</td>' .
|
404 |
'</tr>' .
|
405 |
'</thead>';
|
@@ -417,17 +435,17 @@ global $wppa_defaults;
|
|
417 |
$photos = wppa_get_widgetphotos( $alb, $opt );
|
418 |
|
419 |
// Count them
|
420 |
-
$cnt = count( $photos );
|
421 |
|
422 |
// Find current
|
423 |
$curid = wppa_opt( 'potd_photo' );
|
424 |
|
425 |
// See if we do this
|
426 |
if ( empty( $photos ) ) {
|
427 |
-
|
428 |
}
|
429 |
elseif ( $cnt > '5000' ) {
|
430 |
-
echo sprintf( __( 'There are too many photos in the selection to show a preview ( %d )', 'wp-photo-album-plus' ), $cnt );
|
431 |
}
|
432 |
else {
|
433 |
|
@@ -436,23 +454,17 @@ global $wppa_defaults;
|
|
436 |
$id = $photo['id'];
|
437 |
|
438 |
// Open container div
|
439 |
-
echo
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
'height:300px;' .
|
445 |
-
'" >';
|
446 |
|
447 |
// Open image container div
|
448 |
-
echo
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
'height:135px;' .
|
453 |
-
'overflow:hidden;' .
|
454 |
-
'text-align:center;' .
|
455 |
-
'" >';
|
456 |
|
457 |
// The image if a video
|
458 |
if ( wppa_is_video( $id ) ) {
|
@@ -463,14 +475,12 @@ global $wppa_defaults;
|
|
463 |
|
464 |
// The image if a photo
|
465 |
else {
|
466 |
-
echo '
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
'"' .
|
473 |
-
' alt="' . esc_attr( wppa_get_photo_name( $id ) ) .'" />';
|
474 |
|
475 |
// Audio ?
|
476 |
if ( wppa_has_audio( $id ) ) {
|
@@ -483,268 +493,180 @@ global $wppa_defaults;
|
|
483 |
}
|
484 |
|
485 |
// Close image container div
|
486 |
-
echo
|
487 |
-
|
488 |
|
489 |
// The order# and select radio box
|
490 |
-
echo
|
491 |
-
|
492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
493 |
|
494 |
if ( get_option( 'wppa_potd_method' ) == '1' ) { // Only if fixed photo
|
495 |
-
echo
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
( $id == $curid ? 'checked="checked"' : '' ) .
|
503 |
-
|
504 |
-
|
505 |
}
|
506 |
|
507 |
-
echo
|
508 |
-
|
509 |
|
510 |
// The name/desc boxecho
|
511 |
-
echo
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
520 |
|
521 |
// Close container
|
522 |
-
echo
|
523 |
-
|
524 |
}
|
525 |
-
echo
|
526 |
-
|
527 |
}
|
528 |
|
529 |
// Close the table
|
530 |
-
echo
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
}
|
535 |
-
echo
|
536 |
-
|
537 |
|
538 |
// Close wrap
|
539 |
-
echo
|
540 |
-
|
541 |
}
|
542 |
|
543 |
// The functions below this line are different from the ones with the same names in the Settings page!!!
|
544 |
-
function wppa_potd_setting( $slug, $num, $name, $desc, $html
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
$
|
555 |
-
|
556 |
-
}
|
557 |
-
if ( is_array($html) ) $htmls = $html;
|
558 |
-
else {
|
559 |
-
$htmls = false;
|
560 |
-
if ( $html ) $htmls[] = $html;
|
561 |
-
}
|
562 |
-
if ( strpos($num, ',') !== false ) {
|
563 |
-
$nums = explode(',', $num);
|
564 |
-
$nums[0] = substr($nums[0], 1);
|
565 |
-
}
|
566 |
-
else {
|
567 |
-
$nums = false;
|
568 |
-
if ( $num ) $nums[] = $num;
|
569 |
-
}
|
570 |
-
|
571 |
-
// Build the html
|
572 |
-
$result = "\n";
|
573 |
-
$result .= '<tr id="potd-setting" class="" style="color:#333;">';
|
574 |
-
$result .= '<td>'.$num.'</td>';
|
575 |
-
$result .= '<td>'.$name.'</td>';
|
576 |
-
$result .= '<td><small>'.$desc.'</small></td>';
|
577 |
-
if ( $htmls ) foreach ( $htmls as $html ) {
|
578 |
-
$result .= '<td>'.$html.'</td>';
|
579 |
-
}
|
580 |
-
else {
|
581 |
-
$result .= '<td></td>';
|
582 |
-
}
|
583 |
-
|
584 |
-
if ( $help ) { //|| ( defined( 'WP_DEBUG') && WP_DEBUG ) ) {
|
585 |
-
$is_dflt = true;
|
586 |
-
$hlp = esc_js($name).':\n\n'.$help;
|
587 |
-
if ( ! $no_default ) {
|
588 |
-
if ( $slugs ) {
|
589 |
-
$hlp .= '\n\n'.__('The default for this setting is:', 'wp-photo-album-plus');
|
590 |
-
if ( count($slugs) == 1) {
|
591 |
-
if ( $slugs[0] != '' ) {
|
592 |
-
$hlp .= ' '.esc_js(wppa_potd_dflt($slugs[0]));
|
593 |
-
if ( $wppa_opt[$slugs[0]] != $wppa_defaults[$slugs[0]] ) {
|
594 |
-
$is_dflt = false;
|
595 |
-
}
|
596 |
-
}
|
597 |
-
}
|
598 |
-
else foreach ( array_keys($slugs) as $slugidx ) {
|
599 |
-
if ( $slugs[$slugidx] != '' && isset($nums[$slugidx]) ) $hlp .= ' '.$nums[$slugidx].'. '.esc_js(wppa_potd_dflt($slugs[$slugidx]));
|
600 |
-
if ( $slugs[$slugidx] != '' && $wppa_opt[$slugs[$slugidx]] != $wppa_defaults[$slugs[$slugidx]] ) {
|
601 |
-
$is_dflt = false;
|
602 |
-
}
|
603 |
-
}
|
604 |
-
}
|
605 |
-
}
|
606 |
-
|
607 |
-
$result .=
|
608 |
-
'<td>' .
|
609 |
-
'<input' .
|
610 |
-
' type="button"' .
|
611 |
-
' style="font-size: 11px; height:20px; padding:0; cursor: pointer;"' .
|
612 |
-
' title="'.__('Click for help', 'wp-photo-album-plus').'"' .
|
613 |
-
' onclick="' .
|
614 |
-
'jQuery( \'#' . $wppa_table.$wppa_subtable.$num.'-help\' ).css(\'display\',\'\');' .
|
615 |
-
'jQuery( this ).css( \'display\', \'none\' );' .
|
616 |
-
'"' .
|
617 |
-
' value=" ? "' .
|
618 |
-
' />' .
|
619 |
-
'</td>';
|
620 |
-
}
|
621 |
-
else {
|
622 |
-
$result .= '<td></td>';//$hlp = __('No help available');
|
623 |
-
}
|
624 |
-
|
625 |
-
$result .= '</tr>';
|
626 |
-
|
627 |
-
if ( $help ) {
|
628 |
-
$result .=
|
629 |
-
'<tr id="'.$wppa_table.$wppa_subtable.$num.'-help" class="wppa-setting-help wppa-'.$wppa_table.'-'.$wppa_subtable.'-help " style="display:none;" >' .
|
630 |
-
'<td></td>' . // num
|
631 |
-
'<td></td>' . // name
|
632 |
-
'<td colspan="3" style="color:#000077;" ><small><i>' . stripslashes( str_replace( '\n', ' ', $hlp ) ) . '</i></small></td>' .
|
633 |
-
'</tr>';
|
634 |
-
}
|
635 |
-
|
636 |
-
echo $result;
|
637 |
-
|
638 |
}
|
639 |
|
640 |
|
641 |
-
function
|
642 |
-
global $wppa_defaults;
|
643 |
-
global $no_default;
|
644 |
-
|
645 |
-
if ( $slug == '' ) return '';
|
646 |
-
if ( $no_default ) return '';
|
647 |
-
|
648 |
-
$dflt = isset( $wppa_defaults[$slug] ) ? $wppa_defaults[$slug] : '';
|
649 |
-
|
650 |
-
$dft = $dflt;
|
651 |
-
switch ($dflt) {
|
652 |
-
case 'yes': $dft .= ': '.__('Checked', 'wp-photo-album-plus'); break;
|
653 |
-
case 'no': $dft .= ': '.__('Unchecked', 'wp-photo-album-plus'); break;
|
654 |
-
case 'none': $dft .= ': '.__('no link at all.', 'wp-photo-album-plus'); break;
|
655 |
-
case 'file': $dft .= ': '.__('the plain photo (file).', 'wp-photo-album-plus'); break;
|
656 |
-
case 'photo': $dft .= ': '.__('the full size photo in a slideshow.', 'wp-photo-album-plus'); break;
|
657 |
-
case 'single': $dft .= ': '.__('the fullsize photo on its own.', 'wp-photo-album-plus'); break;
|
658 |
-
case 'indiv': $dft .= ': '.__('the photo specific link.', 'wp-photo-album-plus'); break;
|
659 |
-
case 'album': $dft .= ': '.__('the content of the album.', 'wp-photo-album-plus'); break;
|
660 |
-
case 'widget': $dft .= ': '.__('defined at widget activation.', 'wp-photo-album-plus'); break;
|
661 |
-
case 'custom': $dft .= ': '.__('defined on widget admin page.', 'wp-photo-album-plus'); break;
|
662 |
-
case 'same': $dft .= ': '.__('same as title.', 'wp-photo-album-plus'); break;
|
663 |
-
default:
|
664 |
-
}
|
665 |
-
|
666 |
-
return $dft;
|
667 |
-
}
|
668 |
-
|
669 |
-
function wppa_potd_checkbox($xslug, $onchange = '', $class = '') {
|
670 |
-
global $wppa_defaults;
|
671 |
-
global $wppa_opt;
|
672 |
|
673 |
$slug = substr( $xslug, 5 );
|
674 |
-
|
675 |
-
$
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
|
690 |
return $html;
|
691 |
}
|
692 |
|
693 |
-
function wppa_potd_input($xslug, $width, $minwidth = '', $text = '', $onchange = '', $placeholder = '') {
|
694 |
-
global $wppa_opt;
|
695 |
|
696 |
$slug = substr( $xslug, 5 );
|
697 |
-
|
698 |
-
$
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
709 |
|
710 |
return $html;
|
711 |
}
|
712 |
|
713 |
-
function wppa_potd_select($xslug, $options, $values, $onchange = '', $class = '', $first_disable = false, $postaction = '', $max_width = '220' ) {
|
714 |
-
global $wppa_opt;
|
715 |
|
716 |
$slug = substr( $xslug, 5 );
|
717 |
|
718 |
-
$
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
if ($opt != $options[$idx]) $dis = true;
|
739 |
-
if ($val == $values[$idx]) $html .= ' selected="selected"';
|
740 |
-
if ($dis) $html .= ' disabled="disabled"';
|
741 |
-
$html .= '>'.$opt.'</option>';
|
742 |
-
$idx++;
|
743 |
}
|
744 |
-
|
745 |
-
$html .= '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
746 |
|
747 |
return $html;
|
748 |
}
|
749 |
|
750 |
-
require_once
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
* admin photo of the day widget
|
6 |
+
* Version 7.0.08
|
7 |
*
|
8 |
*/
|
9 |
|
52 |
|
53 |
// The Page title
|
54 |
echo
|
55 |
+
'<h1 style="display:inline;" >' . __( 'Photo of the Day (Widget) Settings', 'wp-photo-album-plus' ) . ' </h1>' .
|
56 |
__( 'Changes are updated immediately. The page will reload if required.', 'wp-photo-album-plus' ) .
|
57 |
'<br /> ';
|
58 |
|
71 |
'<td>' . __( 'Name', 'wp-photo-album-plus' ) . '</td>' .
|
72 |
'<td>' . __( 'Description', 'wp-photo-album-plus') . '</td>' .
|
73 |
'<td>' . __( 'Setting', 'wp-photo-album-plus') . '</td>' .
|
|
|
74 |
'</tr>' .
|
75 |
'</thead>';
|
76 |
|
78 |
echo
|
79 |
'<tbody class="wppa_table" >';
|
80 |
|
81 |
+
$name = __( 'Widget Title:', 'wp-photo-album-plus' );
|
82 |
+
$desc = __( 'The title of the widget.', 'wp-photo-album-plus' );
|
|
|
83 |
$slug = 'wppa_potd_title';
|
84 |
+
$html = wppa_potd_input( $slug, '85%' );
|
85 |
+
wppa_potd_setting( $slug, '1', $name, $desc, $html );
|
86 |
|
87 |
+
$name = __( 'Widget Photo Width:', 'wp-photo-album-plus' );
|
88 |
+
$desc = __( 'Enter the desired display width of the photo in the sidebar.', 'wp-photo-album-plus' );
|
|
|
89 |
$slug = 'wppa_potd_widget_width';
|
90 |
+
$html = wppa_potd_input( $slug, '40px', '', __( 'pixels wide', 'wp-photo-album-plus' ) );
|
91 |
+
wppa_potd_setting( $slug, '2', $name, $desc, $html );
|
92 |
|
93 |
+
$name = __( 'Horizontal alignment:', 'wp-photo-album-plus' );
|
94 |
+
$desc = __( 'Enter the desired display alignment of the photo in the sidebar.', 'wp-photo-album-plus' );
|
|
|
95 |
$slug = 'wppa_potd_align';
|
96 |
+
$opts = array( __( '--- none ---', 'wp-photo-album-plus' ),
|
97 |
+
__( 'left', 'wp-photo-album-plus' ),
|
98 |
+
__( 'center', 'wp-photo-album-plus' ),
|
99 |
+
__( 'right', 'wp-photo-album-plus' ),
|
100 |
+
);
|
101 |
+
$vals = array( 'none',
|
102 |
+
'left',
|
103 |
+
'center',
|
104 |
+
'right',
|
105 |
+
);
|
106 |
+
$html = wppa_potd_select( $slug, $opts, $vals );
|
107 |
+
wppa_potd_setting( $slug, '3', $name, $desc, $html );
|
108 |
|
109 |
$linktype = wppa_opt( 'potd_linktype' );
|
110 |
if ( $linktype == 'custom' ) {
|
111 |
|
112 |
+
$name = __( 'Link to:', 'wp-photo-album-plus' );
|
113 |
+
$desc = __( 'Enter the url. Do\'nt forget the HTTP://', 'wp-photo-album-plus' );
|
|
|
114 |
$slug = 'wppa_potd_linkurl';
|
115 |
+
$html = wppa_potd_input( $slug, '85%', '', '', '', __( 'Type your custom url here', 'wp-photo-album-plus' ) );
|
116 |
+
wppa_potd_setting( $slug, '4', $name, $desc, $html );
|
117 |
|
118 |
+
$name = __( 'Link Title:', 'wp-photo-album-plus' );
|
119 |
+
$desc = __( 'The balloon text when hovering over the photo.', 'wp-photo-album-plus' );
|
|
|
120 |
$slug = 'wppa_potd_linktitle';
|
121 |
+
$html = wppa_potd_input( $slug, '85%', '', '', '', __( 'Type the title here', 'wp-photo-album-plus' ) );
|
122 |
+
wppa_potd_setting($slug, '4a', $name, $desc, $html );
|
|
|
123 |
}
|
124 |
else {
|
125 |
+
$name = __( 'Link to:', 'wp-photo-album-plus' );
|
126 |
+
$desc = __( 'Links are set on the <b>Photo Albums -> Settings</b> screen.', 'wp-photo-album-plus' );
|
|
|
127 |
$slug = 'wppa_potd_linkurl';
|
128 |
$html = '';
|
129 |
+
wppa_potd_setting( $slug, '4', $name, $desc, $html );
|
130 |
}
|
131 |
|
132 |
+
$name = __( 'Subtitle:', 'wp-photo-album-plus' );
|
133 |
+
$desc = __( 'Select the content of the subtitle.', 'wp-photo-album-plus' );
|
|
|
134 |
$slug = 'wppa_potd_subtitle';
|
135 |
+
$opts = array( __( '--- none ---', 'wp-photo-album-plus' ),
|
136 |
+
__( 'Photo Name', 'wp-photo-album-plus' ),
|
137 |
+
__( 'Description', 'wp-photo-album-plus' ),
|
138 |
+
__( 'Owner', 'wp-photo-album-plus' ),
|
139 |
);
|
140 |
+
$vals = array( 'none',
|
141 |
+
'name',
|
142 |
+
'desc',
|
143 |
+
'owner',
|
144 |
+
);
|
145 |
+
$html = wppa_potd_select( $slug, $opts, $vals );
|
146 |
+
wppa_potd_setting( $slug, '5', $name, $desc, $html );
|
147 |
|
148 |
+
$name = __( 'Counter:', 'wp-photo-album-plus' );
|
149 |
+
$desc = __( 'Display a counter of other photos in the album.', 'wp-photo-album-plus' );
|
|
|
150 |
$slug = 'wppa_potd_counter';
|
151 |
+
$html = wppa_potd_checkbox( $slug );
|
152 |
+
wppa_potd_setting( $slug, '6', $name, $desc, $html );
|
153 |
|
154 |
+
$name = __( 'Link to:', 'wp-photo-album-plus' );
|
155 |
+
$desc = __( 'The counter links to.', 'wp-photo-album-plus' );
|
|
|
156 |
$slug = 'wppa_potd_counter_link';
|
157 |
+
$opts = array( __( 'thumbnails', 'wp-photo-album-plus' ),
|
158 |
+
__( 'slideshow', 'wp-photo-album-plus' ),
|
159 |
+
__('single image', 'wp-photo-album-plus' ),
|
160 |
+
);
|
161 |
+
$vals = array( 'thumbs',
|
162 |
+
'slide',
|
163 |
+
'single',
|
164 |
+
);
|
165 |
+
$html = wppa_potd_select( $slug, $opts, $vals );
|
166 |
+
wppa_potd_setting( $slug, '7', $name, $desc, $html );
|
167 |
+
|
168 |
+
$name = __( 'Type of album(s) to use:', 'wp-photo-album-plus' );
|
169 |
+
$desc = __( 'Select physical or virtual.', 'wp-photo-album-plus' );
|
170 |
$slug = 'wppa_potd_album_type';
|
171 |
+
$opts = array( __( 'physical albums', 'wp-photo-album-plus' ),
|
172 |
+
__( 'virtual albums', 'wp-photo-album-plus' ),
|
173 |
+
);
|
174 |
+
$vals = array( 'physical',
|
175 |
+
'virtual',
|
176 |
+
);
|
177 |
+
$html = wppa_potd_select( $slug, $opts, $vals, $onch );
|
178 |
+
wppa_potd_setting( $slug, '8', $name, $desc, $html );
|
179 |
+
|
180 |
+
$name = __( 'Albums to use:', 'wp-photo-album-plus' );
|
181 |
+
$desc = __( 'Select the albums to use for the photo of the day.', 'wp-photo-album-plus' );
|
182 |
$slug = 'wppa_potd_album';
|
183 |
if ( get_option( 'wppa_potd_album_type' ) == 'physical' ) {
|
184 |
+
$html = '<select
|
185 |
+
id="wppa_potd_album"
|
186 |
+
name="wppa_potd_album"
|
187 |
+
style="float:left; max-width: 400px; height: auto !important;"
|
188 |
+
multiple="multiple"
|
189 |
+
onchange="didsome=true;wppaAjaxUpdateOptionValue(\'potd_album\', this, true)"
|
190 |
+
onmouseout="if(didsome)document.location.reload(true);"
|
191 |
+
size="10"
|
192 |
+
>' .
|
193 |
+
wppa_album_select_a( array ( 'path' => true,
|
194 |
+
'optionclass' => 'potd_album',
|
195 |
+
'selected' => get_option( 'wppa_potd_album' ),
|
196 |
+
) ) . '
|
197 |
+
</select>
|
198 |
+
<img
|
199 |
+
id="img_potd_album"
|
200 |
+
src="' . esc_url( wppa_get_imgdir() ) . 'star.ico"
|
201 |
+
title="' . esc_attr( __( 'Setting unmodified', 'wp-photo-album-plus' ) ) . '"
|
202 |
+
style="padding:0 4px; float:left; height:16px; width:16px;"
|
203 |
+
/>';
|
204 |
+
wppa_potd_setting( $slug, '9', $name, $desc, $html );
|
205 |
}
|
206 |
else {
|
207 |
+
$desc = __( 'Select the albums to use for the photo of the day.', 'wp-photo-album-plus' );
|
208 |
$opts = array( __( '- all albums -' , 'wp-photo-album-plus' ),
|
209 |
__( '- all -separate- albums -' , 'wp-photo-album-plus' ),
|
210 |
__( '- all albums except -separate-' , 'wp-photo-album-plus' ),
|
211 |
__( '- top rated photos -' , 'wp-photo-album-plus' ),
|
212 |
);
|
213 |
+
$vals = array( 'all',
|
214 |
+
'sep',
|
215 |
+
'all-sep',
|
216 |
+
'topten',
|
217 |
+
);
|
218 |
+
$html = wppa_potd_select( $slug, $opts, $vals );
|
219 |
+
wppa_potd_setting( $slug, '9', $name, $desc, $html );
|
220 |
}
|
221 |
|
222 |
if ( get_option( 'wppa_potd_album_type' ) == 'physical' ) {
|
223 |
+
$name = __( 'Include (grand)children:', 'wp-photo-album-plus' );
|
224 |
+
$desc = __( 'Include the photos of all sub albums?', 'wp-photo-album-plus' );
|
|
|
225 |
$slug = 'wppa_potd_include_subs';
|
226 |
+
$html = wppa_potd_checkbox( $slug, $onch );
|
227 |
+
wppa_potd_setting( $slug, '9a', $name, $desc, $html );
|
228 |
|
229 |
+
$name = __( 'Inverse selection:', 'wp-photo-album-plus' );
|
230 |
+
$desc = __( 'Use any album, except the selection made above.', 'wp-photo-album-plus' );
|
|
|
231 |
$slug = 'wppa_potd_inverse';
|
232 |
+
$html = wppa_potd_checkbox( $slug, $onch );
|
233 |
+
wppa_potd_setting( $slug, '9b', $name, $desc, $html );
|
234 |
}
|
235 |
|
236 |
+
$name = __( 'Status filter:', 'wp-photo-album-plus' );
|
237 |
+
$desc = __( 'Use only photos with a certain status.', 'wp-photo-album-plus' );
|
|
|
238 |
$slug = 'wppa_potd_status_filter';
|
239 |
+
$opts = array( __( '- none -', 'wp-photo-album-plus' ),
|
240 |
+
__( 'Publish' , 'wp-photo-album-plus' ),
|
241 |
+
__( 'Featured' , 'wp-photo-album-plus' ),
|
242 |
+
__( 'Gold' , 'wp-photo-album-plus' ),
|
243 |
+
__( 'Silver' , 'wp-photo-album-plus' ),
|
244 |
+
__( 'Bronze' , 'wp-photo-album-plus' ),
|
245 |
+
__( 'Any medal' , 'wp-photo-album-plus' ),
|
246 |
+
);
|
247 |
$vals = array( 'none',
|
248 |
'publish',
|
249 |
'featured',
|
251 |
'silver',
|
252 |
'bronze',
|
253 |
'anymedal',
|
254 |
+
);
|
255 |
+
$html = wppa_potd_select( $slug, $opts, $vals );
|
256 |
+
wppa_potd_setting( $slug, '10', $name, $desc, $html );
|
257 |
|
258 |
+
$name = __( 'Display method:', 'wp-photo-album-plus' );
|
259 |
+
$desc = __( 'Select the way a photo will be selected.', 'wp-photo-album-plus' );
|
|
|
260 |
$slug = 'wppa_potd_method';
|
261 |
+
$opts = array( __( 'Fixed photo', 'wp-photo-album-plus' ),
|
262 |
+
__( 'Random', 'wp-photo-album-plus' ),
|
263 |
+
__( 'Last upload', 'wp-photo-album-plus' ),
|
264 |
+
__( 'Change every', 'wp-photo-album-plus' ),
|
265 |
+
);
|
266 |
+
$vals = array( '1',
|
267 |
+
'2',
|
268 |
+
'3',
|
269 |
+
'4',
|
270 |
+
);
|
271 |
+
$html = wppa_potd_select( $slug, $opts, $vals, $onch );
|
272 |
+
wppa_potd_setting( $slug, '11', $name, $desc, $html );
|
273 |
|
274 |
if ( get_option( 'wppa_potd_method' ) == '4' ) { // Change every
|
275 |
+
$name = __( 'Change every period:', 'wp-photo-album-plus' );
|
276 |
+
$desc = __( 'The time period a certain photo is used.', 'wp-photo-album-plus' );
|
|
|
277 |
$slug = 'wppa_potd_period';
|
278 |
+
$opts = array( __( 'pageview.', 'wp-photo-album-plus' ),
|
279 |
+
__( 'hour.', 'wp-photo-album-plus' ),
|
280 |
+
__( 'day.', 'wp-photo-album-plus' ),
|
281 |
+
__( 'week.', 'wp-photo-album-plus' ),
|
282 |
+
__( 'month.', 'wp-photo-album-plus' ),
|
283 |
+
__( 'day of week is order#', 'wp-photo-album-plus' ),
|
284 |
+
__( 'day of month is order#', 'wp-photo-album-plus' ),
|
285 |
+
__( 'day of year is order#', 'wp-photo-album-plus' ),
|
286 |
);
|
287 |
+
$vals = array( '0',
|
288 |
+
'1',
|
289 |
+
'24',
|
290 |
+
'168',
|
291 |
+
'736',
|
292 |
+
'day-of-week',
|
293 |
+
'day-of-month',
|
294 |
+
'day-of-year',
|
295 |
+
);
|
296 |
+
$html = wppa_potd_select( $slug, $opts, $vals, $onch );
|
297 |
+
wppa_potd_setting( $slug, '11a', $name, $desc, $html );
|
298 |
|
299 |
$wppa_widget_period = get_option( 'wppa_potd_period' );
|
300 |
if ( substr( $wppa_widget_period, 0, 7 ) == 'day-of-' ) {
|
312 |
$date_key = 'z';
|
313 |
break;
|
314 |
}
|
315 |
+
while ( get_option( 'wppa_potd_offset', '0' ) > $n_days ) {
|
316 |
+
update_option( 'wppa_potd_offset', get_option( 'wppa_potd_offset') - $n_days );
|
317 |
+
}
|
318 |
+
while ( get_option( 'wppa_potd_offset', '0' ) < '0' ) {
|
319 |
+
update_option( 'wppa_potd_offset', get_option( 'wppa_potd_offset') + $n_days );
|
320 |
+
}
|
321 |
|
322 |
+
$name = __( 'Day offset:', 'wp-photo-album-plus' );
|
323 |
+
$desc = __( 'The difference between daynumber and photo order number.', 'wp-photo-album-plus' );
|
|
|
324 |
$slug = 'wppa_potd_offset';
|
325 |
$opts = array();
|
326 |
$day = '0';
|
332 |
$html = '<span style="float:left;" >' .
|
333 |
sprintf( __('Current day# = %s, offset =', 'wp-photo-album-plus'), wppa_local_date( $date_key ) ) .
|
334 |
'</span> ' .
|
335 |
+
wppa_potd_select( $slug, $opts, $vals, $onch );
|
336 |
|
337 |
$photo_order = wppa_local_date( $date_key ) - get_option( 'wppa_potd_offset', '0' );
|
338 |
while ( $photo_order < '0' ) {
|
339 |
$photo_order += $n_days;
|
340 |
}
|
341 |
|
342 |
+
$html .= sprintf( __( 'Todays photo order# = %s.', 'wp-photo-album-plus' ), $photo_order );
|
343 |
+
wppa_potd_setting( $slug, '11b', $name, $desc, $html );
|
344 |
|
345 |
}
|
346 |
}
|
347 |
|
348 |
+
$name = __( 'Preview', 'wp-photo-album-plus' );
|
349 |
+
$desc = __( 'Current "photo of the day":', 'wp-photo-album-plus' );
|
|
|
350 |
$slug = 'wppa_potd_photo';
|
351 |
$photo = wppa_get_potd();
|
352 |
if ( $photo ) {
|
353 |
$html = '<div style="display:inline-block;width:25%;text-align:center;vertical-align:middle;">' .
|
354 |
+
'<img src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '" />' .
|
355 |
'</div>' .
|
356 |
'<div style="display:inline-block;width:75%;text-align:center;vertical-align:middle;" >' .
|
357 |
+
__( 'Album', 'wp-photo-album-plus' ) . ': ' . htmlentities( wppa_get_album_name( $photo['album'] ) ) .
|
358 |
'<br />' .
|
359 |
+
__('Uploader', 'wp-photo-album-plus') . ': ' . htmlentities( $photo['owner'] ) .
|
360 |
'</div>';
|
361 |
|
362 |
}
|
363 |
else {
|
364 |
+
$html = __( 'Not found.', 'wp-photo-album-plus' );
|
365 |
}
|
366 |
+
wppa_potd_setting( $slug, '12', $name, $desc, $html );
|
367 |
|
368 |
+
$name = __( 'Show selection', 'wp-photo-album-plus' );
|
369 |
+
$desc = __( 'Show the photos in the current selection.', 'wp-photo-album-plus' );
|
|
|
370 |
$slug = 'wppa_potd_preview';
|
371 |
+
$html = wppa_potd_checkbox( $slug, $onch );
|
372 |
+
wppa_potd_setting( $slug, '13', $name, $desc, $html );
|
373 |
|
374 |
+
$name = __( 'Log potd', 'wp-photo-album-plus' );
|
375 |
+
$desc = __( 'Keep track of the potd history', 'wp-photo-album-plus' );
|
|
|
376 |
$slug = 'wppa_potd_log';
|
377 |
+
$html = wppa_potd_checkbox( $slug );
|
378 |
+
wppa_potd_setting( $slug, '14', $name, $desc, $html );
|
379 |
|
380 |
+
$name = __( 'Log potd max', 'wp-photo-album-plus' );
|
381 |
+
$desc = __( 'Max length of the potd history (items)', 'wp-photo-album-plus' );
|
|
|
382 |
$slug = 'wppa_potd_log_max';
|
383 |
$opts = array( '5', '10', '15', '20', '30', '50', '100' );
|
384 |
+
$html = wppa_potd_select( $slug, $opts, $opts );
|
385 |
+
wppa_potd_setting( $slug, '15', $name, $desc, $html );
|
386 |
|
387 |
|
388 |
// Cose table body
|
397 |
'<td>' . __( 'Name', 'wp-photo-album-plus' ) . '</td>' .
|
398 |
'<td>' . __( 'Description', 'wp-photo-album-plus') . '</td>' .
|
399 |
'<td>' . __( 'Setting', 'wp-photo-album-plus') . '</td>' .
|
|
|
400 |
'</tr>' .
|
401 |
'</tfoot>' .
|
402 |
'</table>';
|
403 |
|
|
|
|
|
|
|
|
|
404 |
// Status star must be here for js
|
405 |
echo
|
406 |
'<img' .
|
407 |
' id="img_potd_photo"' .
|
408 |
+
' src="' . esc_url( wppa_get_imgdir( 'star.ico' ) ) . '" style="height:12px;display:none;"' .
|
409 |
' />';
|
410 |
|
411 |
// The potd photo pool
|
417 |
'<thead>' .
|
418 |
'<tr>' .
|
419 |
'<td>' .
|
420 |
+
htmlentities( __( 'Photos in the current selection', 'wp-photo-album-plus' ) ) .
|
421 |
'</td>' .
|
422 |
'</tr>' .
|
423 |
'</thead>';
|
435 |
$photos = wppa_get_widgetphotos( $alb, $opt );
|
436 |
|
437 |
// Count them
|
438 |
+
$cnt = $photos ? count( $photos ) : 0;
|
439 |
|
440 |
// Find current
|
441 |
$curid = wppa_opt( 'potd_photo' );
|
442 |
|
443 |
// See if we do this
|
444 |
if ( empty( $photos ) ) {
|
445 |
+
echo htmlentities( __( 'No photos in the selection', 'wp-photo-album-plus' ) );
|
446 |
}
|
447 |
elseif ( $cnt > '5000' ) {
|
448 |
+
echo htmlentities( sprintf( __( 'There are too many photos in the selection to show a preview ( %d )', 'wp-photo-album-plus' ), $cnt ) );
|
449 |
}
|
450 |
else {
|
451 |
|
454 |
$id = $photo['id'];
|
455 |
|
456 |
// Open container div
|
457 |
+
echo '
|
458 |
+
<div
|
459 |
+
class="photoselect"
|
460 |
+
style="width:180px;height:200px;overflow:hidden;"
|
461 |
+
>';
|
|
|
|
|
462 |
|
463 |
// Open image container div
|
464 |
+
echo '
|
465 |
+
<div
|
466 |
+
style="width:180px;height:135px;overflow:hidden;text-align:center;"
|
467 |
+
>';
|
|
|
|
|
|
|
|
|
468 |
|
469 |
// The image if a video
|
470 |
if ( wppa_is_video( $id ) ) {
|
475 |
|
476 |
// The image if a photo
|
477 |
else {
|
478 |
+
echo '
|
479 |
+
<img
|
480 |
+
src="' . esc_url( wppa_get_thumb_url( $id ) ) . '"
|
481 |
+
style="max-width:180px;max-height:135px;margin:auto;"
|
482 |
+
alt="' . esc_attr( wppa_get_photo_name( $id ) ) . '"
|
483 |
+
/>';
|
|
|
|
|
484 |
|
485 |
// Audio ?
|
486 |
if ( wppa_has_audio( $id ) ) {
|
493 |
}
|
494 |
|
495 |
// Close image container div
|
496 |
+
echo '
|
497 |
+
</div>';
|
498 |
|
499 |
// The order# and select radio box
|
500 |
+
echo '
|
501 |
+
<div
|
502 |
+
style="clear:both;width:100%;margin:3px 0;position:relative;top:5px;"
|
503 |
+
>
|
504 |
+
<div
|
505 |
+
style="font-size:9px; line-height:10px;float:left;"
|
506 |
+
>
|
507 |
+
(#' . strval( intval( $photo['p_order'] ) ) . ')
|
508 |
+
</div>';
|
509 |
|
510 |
if ( get_option( 'wppa_potd_method' ) == '1' ) { // Only if fixed photo
|
511 |
+
echo '
|
512 |
+
<input
|
513 |
+
style="float:right;"
|
514 |
+
type="radio"
|
515 |
+
name="wppa-widget-photo"
|
516 |
+
id="wppa-widget-photo-' . strval( intval( $id ) ) . '"
|
517 |
+
value="' . esc_attr( $id ) . '"' .
|
518 |
+
( $id == $curid ? 'checked="checked"' : '' ) . '
|
519 |
+
onchange="wppaSetFixed(' . strval( intval( $id ) ) . ');"
|
520 |
+
/>';
|
521 |
}
|
522 |
|
523 |
+
echo '
|
524 |
+
</div>';
|
525 |
|
526 |
// The name/desc boxecho
|
527 |
+
echo '
|
528 |
+
<div
|
529 |
+
style="clear:both;overflow:hidden;height:150px;position:relative;top:10px;"
|
530 |
+
>
|
531 |
+
<div
|
532 |
+
style="font-size:11px;overflow:hidden;"
|
533 |
+
>' .
|
534 |
+
wppa_get_photo_name( $id ) . '
|
535 |
+
</div>
|
536 |
+
<div
|
537 |
+
style="font-size:9px;line-height:10px;"
|
538 |
+
>' .
|
539 |
+
wppa_get_photo_desc( $id ) . '
|
540 |
+
</div>
|
541 |
+
</div>';
|
542 |
|
543 |
// Close container
|
544 |
+
echo '
|
545 |
+
</div>';
|
546 |
}
|
547 |
+
echo '
|
548 |
+
<div class="clear"></div>';
|
549 |
}
|
550 |
|
551 |
// Close the table
|
552 |
+
echo '
|
553 |
+
</td>
|
554 |
+
</tr>
|
555 |
+
</tbody>';
|
556 |
}
|
557 |
+
echo '
|
558 |
+
</table>';
|
559 |
|
560 |
// Close wrap
|
561 |
+
echo '
|
562 |
+
</div>';
|
563 |
}
|
564 |
|
565 |
// The functions below this line are different from the ones with the same names in the Settings page!!!
|
566 |
+
function wppa_potd_setting( $slug, $num, $name, $desc, $html ) {
|
567 |
+
|
568 |
+
echo '
|
569 |
+
<tr
|
570 |
+
id="potd-setting"
|
571 |
+
style="color:#333;"
|
572 |
+
>
|
573 |
+
<td>' . htmlentities( $num ) . '</td>
|
574 |
+
<td>' . htmlentities( $name ) . '</td>
|
575 |
+
<td><small>' . htmlentities( $desc ) . '</small></td>
|
576 |
+
<td>' . $html . '</td>
|
577 |
+
</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
578 |
}
|
579 |
|
580 |
|
581 |
+
function wppa_potd_checkbox( $xslug, $onchange = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
582 |
|
583 |
$slug = substr( $xslug, 5 );
|
584 |
+
|
585 |
+
$html = '
|
586 |
+
<input
|
587 |
+
id="' . $slug . '"
|
588 |
+
style="float:left;height:15px;margin:0px;padding:0px;"
|
589 |
+
type="checkbox"' .
|
590 |
+
( wppa_switch( $slug ) ? ' checked="checked"' : '' ) . '
|
591 |
+
onchange="' . $onchange . ';wppaAjaxUpdateOptionCheckBox(\'' . $slug . '\', this)"
|
592 |
+
/>
|
593 |
+
<img
|
594 |
+
id="img_' . $slug . '"
|
595 |
+
src="' . esc_url( wppa_get_imgdir() . 'star.ico' ) . '"
|
596 |
+
title="' . esc_attr( __( 'Setting unmodified', 'wp-photo-album-plus' ) ) . '"
|
597 |
+
style="padding-left:4px;float:left;height:16px;width:16px;"
|
598 |
+
/>';
|
599 |
|
600 |
return $html;
|
601 |
}
|
602 |
|
603 |
+
function wppa_potd_input( $xslug, $width, $minwidth = '', $text = '', $onchange = '', $placeholder = '' ) {
|
|
|
604 |
|
605 |
$slug = substr( $xslug, 5 );
|
606 |
+
|
607 |
+
$html = '
|
608 |
+
<input
|
609 |
+
id="' . $slug . '"
|
610 |
+
style="float:left;
|
611 |
+
width:' . $width . ';
|
612 |
+
height:20px;
|
613 |
+
' . ( $minwidth ? ' min-width:' . $minwidth . ';' : '' ) . '
|
614 |
+
font-size:11px;
|
615 |
+
margin:0px;
|
616 |
+
padding:0px;"
|
617 |
+
type="text"
|
618 |
+
placeholder="' . $placeholder . '"
|
619 |
+
onchange="' . $onchange . ';wppaAjaxUpdateOptionValue(\'' . $slug . '\', this)"
|
620 |
+
value="' . esc_attr( wppa_opt( $slug ) ) . '"
|
621 |
+
/>
|
622 |
+
<img
|
623 |
+
id="img_' . $slug . '"
|
624 |
+
src="' . esc_url( wppa_get_imgdir() . 'star.ico' ) . '"
|
625 |
+
title="' . esc_attr( __( 'Setting unmodified', 'wp-photo-album-plus' ) ) .'"
|
626 |
+
style="padding:04px;float:left;height:16px;width:16px;"
|
627 |
+
/>
|
628 |
+
<span style="float:left">' . $text . '</span>';
|
629 |
|
630 |
return $html;
|
631 |
}
|
632 |
|
633 |
+
function wppa_potd_select( $xslug, $options, $values, $onchange = '', $class = '', $first_disable = false, $postaction = '', $max_width = '220' ) {
|
|
|
634 |
|
635 |
$slug = substr( $xslug, 5 );
|
636 |
|
637 |
+
$html = '
|
638 |
+
<select
|
639 |
+
id="' . $slug . '"
|
640 |
+
style="float:left;font-size:11px;height:20px;margin:0px;padding:0px;max-width:' . $max_width . 'px;"
|
641 |
+
onchange="' . $onchange . ';wppaAjaxUpdateOptionValue(\'' . $slug . '\', this);' . $postaction . '"
|
642 |
+
class="' . $class . '"
|
643 |
+
>';
|
644 |
+
|
645 |
+
$val = wppa_opt( $slug );
|
646 |
+
|
647 |
+
foreach( array_keys( $options ) as $idx ) {
|
648 |
+
|
649 |
+
$html .= '
|
650 |
+
<option
|
651 |
+
value="' . $values[$idx] . '"' .
|
652 |
+
( $idx == 0 && $first_disable ? ' disabled="disabled"' : '' ) .
|
653 |
+
( $val == $values[$idx] ? ' selected="selected"' : '' ) . '
|
654 |
+
>' .
|
655 |
+
$options[$idx] . '
|
656 |
+
</option>';
|
|
|
|
|
|
|
|
|
|
|
657 |
}
|
658 |
+
|
659 |
+
$html .= '
|
660 |
+
</select>
|
661 |
+
<img
|
662 |
+
id="img_' . $slug . '"
|
663 |
+
class="' . $class . '"
|
664 |
+
src="' . esc_url( wppa_get_imgdir() . 'star.ico' ) . '"
|
665 |
+
title="' . esc_attr( __( 'Setting unmodified', 'wp-photo-album-plus' ) ) . '"
|
666 |
+
style="padding:0 4px;float:left;height:16px;width:16px;"
|
667 |
+
/>';
|
668 |
|
669 |
return $html;
|
670 |
}
|
671 |
|
672 |
+
require_once 'wppa-widget-functions.php';
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -281,7 +281,8 @@ global $wppa_supported_camara_brands;
|
|
281 |
__( 'Database revision:', 'wp-photo-album-plus' ) . ' ' . get_option( 'wppa_revision', '100') . '. ' .
|
282 |
__( 'WP Charset:', 'wp-photo-album-plus') . ' ' . get_bloginfo( 'charset' ) . '. ' .
|
283 |
// __( 'Current PHP version:', 'wp-photo-album-plus' ) . ' ' . phpversion() . '. ' .
|
284 |
-
__( 'WPPA+ API Version:', 'wp-photo-album-plus' ) . ' ' . $wppa_api_version . '.'
|
|
|
285 |
}
|
286 |
?>
|
287 |
<br /><?php if ( is_multisite() ) {
|
@@ -11108,21 +11109,21 @@ global $no_default;
|
|
11108 |
global $wppa_opt;
|
11109 |
global $wppa_totcols;
|
11110 |
|
11111 |
-
$num = str_replace( array( ',', '.'), '_', $xnum );
|
11112 |
|
11113 |
-
if ( is_array($slug) ) $slugs = $slug;
|
11114 |
else {
|
11115 |
$slugs = false;
|
11116 |
if ( $slug ) $slugs[] = $slug;
|
11117 |
}
|
11118 |
-
if ( is_array($html) ) $htmls = $html;
|
11119 |
else {
|
11120 |
$htmls = false;
|
11121 |
if ( $html ) $htmls[] = $html;
|
11122 |
}
|
11123 |
-
if ( strpos($xnum, ',') !== false ) {
|
11124 |
-
$nums = explode(',', $xnum);
|
11125 |
-
$nums[0] = substr($nums[0], 1);
|
11126 |
}
|
11127 |
else {
|
11128 |
$nums = false;
|
@@ -11132,20 +11133,11 @@ global $wppa_totcols;
|
|
11132 |
// Convert tags to classes
|
11133 |
$tagcls = wppa_tags_to_clas( $tags );
|
11134 |
|
11135 |
-
//
|
11136 |
-
$
|
11137 |
-
$result .= '<tr id="'.$wppa_table.$wppa_subtable.$num.'" class="wppa-setting wppa-'.$wppa_table.'-'.$wppa_subtable.' '.$cls.$tagcls.' wppa-none" style="color:#333;">';
|
11138 |
-
$result .= '<td>'.$xnum.'</td>';
|
11139 |
-
$result .= '<td>'.$name.'</td>';
|
11140 |
-
$result .= '<td><small>'.$desc.'</small></td>';
|
11141 |
-
if ( $htmls ) foreach ( $htmls as $html ) {
|
11142 |
-
$result .= '<td>'.$html.'</td>';
|
11143 |
-
}
|
11144 |
-
|
11145 |
-
if ( $help ) { //|| ( defined( 'WP_DEBUG') && WP_DEBUG ) ) {
|
11146 |
$is_dflt = true;
|
11147 |
$help = nl2br( $help );
|
11148 |
-
$
|
11149 |
'br' => array(),
|
11150 |
'em' => array(),
|
11151 |
'b' => array(),
|
@@ -11153,46 +11145,82 @@ global $wppa_totcols;
|
|
11153 |
) );
|
11154 |
if ( ! $no_default ) {
|
11155 |
if ( $slugs ) {
|
11156 |
-
$
|
11157 |
if ( count($slugs) == 1) {
|
11158 |
if ( $slugs[0] != '' ) {
|
11159 |
-
$
|
11160 |
if ( $wppa_opt[$slugs[0]] != $wppa_defaults[$slugs[0]] ) {
|
11161 |
$is_dflt = false;
|
11162 |
}
|
11163 |
}
|
11164 |
}
|
11165 |
else foreach ( array_keys($slugs) as $slugidx ) {
|
11166 |
-
if ( $slugs[$slugidx] != '' && isset($nums[$slugidx]) ) $
|
11167 |
if ( $slugs[$slugidx] != '' && $wppa_opt[$slugs[$slugidx]] != $wppa_defaults[$slugs[$slugidx]] ) {
|
11168 |
$is_dflt = false;
|
11169 |
}
|
11170 |
}
|
11171 |
}
|
11172 |
}
|
11173 |
-
$result .=
|
11174 |
-
'<td>' .
|
11175 |
-
'<input' .
|
11176 |
-
' type="button"' .
|
11177 |
-
' style="font-size: 11px; height:20px; padding:0; cursor: pointer;"' .
|
11178 |
-
' class="wppa-h wppa-' . $wppa_table . '-' . $wppa_subtable . '-h"' .
|
11179 |
-
' title="'.__('Click for help', 'wp-photo-album-plus').'"' .
|
11180 |
-
' onclick="' .
|
11181 |
-
'jQuery( \'#' . $wppa_table.$wppa_subtable.$num.'-help\' ).css(\'display\',\'\');' .
|
11182 |
-
'jQuery( this ).css( \'display\', \'none\' );' .
|
11183 |
-
'"' .
|
11184 |
-
' value=" ' . ( $is_dflt ? '?' : '!' ) . ' "' .
|
11185 |
-
' />' .
|
11186 |
-
'</td>';
|
11187 |
}
|
11188 |
else {
|
11189 |
-
$
|
11190 |
}
|
11191 |
|
11192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11193 |
|
|
|
11194 |
if ( $help ) {
|
11195 |
-
|
11196 |
<tr
|
11197 |
id="' . esc_attr( $wppa_table . $wppa_subtable . $num . '-help' ) . '"
|
11198 |
class="' . esc_attr( 'wppa-setting-help wppa-' . $wppa_table . '-' . $wppa_subtable . '-help ' ) . '"
|
@@ -11206,15 +11234,12 @@ global $wppa_totcols;
|
|
11206 |
>
|
11207 |
<small>
|
11208 |
<i>' .
|
11209 |
-
$
|
11210 |
</i>
|
11211 |
</small>
|
11212 |
</td>
|
11213 |
</tr>';
|
11214 |
}
|
11215 |
-
|
11216 |
-
echo $result;
|
11217 |
-
|
11218 |
}
|
11219 |
|
11220 |
function wppa_tags_to_clas( $tags = '-' ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 7.0.08
|
7 |
*
|
8 |
*/
|
9 |
|
281 |
__( 'Database revision:', 'wp-photo-album-plus' ) . ' ' . get_option( 'wppa_revision', '100') . '. ' .
|
282 |
__( 'WP Charset:', 'wp-photo-album-plus') . ' ' . get_bloginfo( 'charset' ) . '. ' .
|
283 |
// __( 'Current PHP version:', 'wp-photo-album-plus' ) . ' ' . phpversion() . '. ' .
|
284 |
+
__( 'WPPA+ API Version:', 'wp-photo-album-plus' ) . ' ' . $wppa_api_version . '. ' .
|
285 |
+
__( 'Filesystem method:', 'wp-photo-album-plus' ) . ' ' . get_filesystem_method();
|
286 |
}
|
287 |
?>
|
288 |
<br /><?php if ( is_multisite() ) {
|
11109 |
global $wppa_opt;
|
11110 |
global $wppa_totcols;
|
11111 |
|
11112 |
+
$num = str_replace( array( ',', '.' ), '_', $xnum );
|
11113 |
|
11114 |
+
if ( is_array( $slug ) ) $slugs = $slug;
|
11115 |
else {
|
11116 |
$slugs = false;
|
11117 |
if ( $slug ) $slugs[] = $slug;
|
11118 |
}
|
11119 |
+
if ( is_array( $html ) ) $htmls = $html;
|
11120 |
else {
|
11121 |
$htmls = false;
|
11122 |
if ( $html ) $htmls[] = $html;
|
11123 |
}
|
11124 |
+
if ( strpos( $xnum, ',' ) !== false ) {
|
11125 |
+
$nums = explode( ',', $xnum );
|
11126 |
+
$nums[0] = substr( $nums[0], 1 );
|
11127 |
}
|
11128 |
else {
|
11129 |
$nums = false;
|
11133 |
// Convert tags to classes
|
11134 |
$tagcls = wppa_tags_to_clas( $tags );
|
11135 |
|
11136 |
+
// Make the helptext
|
11137 |
+
if ( $help ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11138 |
$is_dflt = true;
|
11139 |
$help = nl2br( $help );
|
11140 |
+
$helptext = wp_kses( $help, array( 'a' => array( 'href' => array(), 'title' => array() ),
|
11141 |
'br' => array(),
|
11142 |
'em' => array(),
|
11143 |
'b' => array(),
|
11145 |
) );
|
11146 |
if ( ! $no_default ) {
|
11147 |
if ( $slugs ) {
|
11148 |
+
$helptext .= '<br>' . __( 'The default for this setting is:', 'wp-photo-album-plus' );
|
11149 |
if ( count($slugs) == 1) {
|
11150 |
if ( $slugs[0] != '' ) {
|
11151 |
+
$helptext .= ' '.wppa_dflt($slugs[0]);
|
11152 |
if ( $wppa_opt[$slugs[0]] != $wppa_defaults[$slugs[0]] ) {
|
11153 |
$is_dflt = false;
|
11154 |
}
|
11155 |
}
|
11156 |
}
|
11157 |
else foreach ( array_keys($slugs) as $slugidx ) {
|
11158 |
+
if ( $slugs[$slugidx] != '' && isset($nums[$slugidx]) ) $helptext .= ' '.$nums[$slugidx].'. '.wppa_dflt($slugs[$slugidx]);
|
11159 |
if ( $slugs[$slugidx] != '' && $wppa_opt[$slugs[$slugidx]] != $wppa_defaults[$slugs[$slugidx]] ) {
|
11160 |
$is_dflt = false;
|
11161 |
}
|
11162 |
}
|
11163 |
}
|
11164 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11165 |
}
|
11166 |
else {
|
11167 |
+
$helptext = '';
|
11168 |
}
|
11169 |
|
11170 |
+
// Start the item
|
11171 |
+
echo
|
11172 |
+
'<tr
|
11173 |
+
id="' . $wppa_table . $wppa_subtable . $num . '"
|
11174 |
+
class="wppa-setting wppa-' . $wppa_table . '-' . $wppa_subtable . ' ' . $cls . $tagcls . ' wppa-none" style="color:#333;"
|
11175 |
+
>';
|
11176 |
+
|
11177 |
+
// The item number
|
11178 |
+
echo '
|
11179 |
+
<td>' . $xnum . '</td>';
|
11180 |
+
|
11181 |
+
// The Item name
|
11182 |
+
echo '
|
11183 |
+
<td>' . $name . '</td>';
|
11184 |
+
|
11185 |
+
// The item description
|
11186 |
+
echo '
|
11187 |
+
<td><small>' . $desc . '</small></td>';
|
11188 |
+
|
11189 |
+
// Thr html
|
11190 |
+
if ( $htmls ) foreach ( $htmls as $html ) {
|
11191 |
+
echo '
|
11192 |
+
<td>' . $html . '</td>';
|
11193 |
+
}
|
11194 |
+
|
11195 |
+
// The helpbutton
|
11196 |
+
if ( $helptext ) {
|
11197 |
+
echo '
|
11198 |
+
<td>
|
11199 |
+
<input
|
11200 |
+
type="button"
|
11201 |
+
style="font-size: 11px; height:20px; padding:0; cursor: pointer;"
|
11202 |
+
class="wppa-h wppa-' . $wppa_table . '-' . $wppa_subtable . '-h"
|
11203 |
+
title="' . esc_attr( __( 'Click for help', 'wp-photo-album-plus' ) ) . '"
|
11204 |
+
onclick="
|
11205 |
+
jQuery( \'#' . $wppa_table . $wppa_subtable . $num . '-help\' ).css(\'display\',\'\');
|
11206 |
+
jQuery( this ).css( \'display\', \'none\' );
|
11207 |
+
"
|
11208 |
+
value=" ' . ( $is_dflt ? '?' : '!' ) . ' "
|
11209 |
+
/>
|
11210 |
+
</td>';
|
11211 |
+
}
|
11212 |
+
else {
|
11213 |
+
echo '
|
11214 |
+
<td></td>';
|
11215 |
+
}
|
11216 |
+
|
11217 |
+
// Close item
|
11218 |
+
echo '
|
11219 |
+
</tr>';
|
11220 |
|
11221 |
+
// The Helptext
|
11222 |
if ( $help ) {
|
11223 |
+
echo '
|
11224 |
<tr
|
11225 |
id="' . esc_attr( $wppa_table . $wppa_subtable . $num . '-help' ) . '"
|
11226 |
class="' . esc_attr( 'wppa-setting-help wppa-' . $wppa_table . '-' . $wppa_subtable . '-help ' ) . '"
|
11234 |
>
|
11235 |
<small>
|
11236 |
<i>' .
|
11237 |
+
htmlentities( $helptext ) . '
|
11238 |
</i>
|
11239 |
</small>
|
11240 |
</td>
|
11241 |
</tr>';
|
11242 |
}
|
|
|
|
|
|
|
11243 |
}
|
11244 |
|
11245 |
function wppa_tags_to_clas( $tags = '-' ) {
|
wppa-setup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1878,8 +1878,8 @@ cursorborder:'2px solid transparent',";
|
|
1878 |
'wppa_potd_title' => __('Photo of the day', 'wp-photo-album-plus'),
|
1879 |
'wppa_potd_widget_width' => '200',
|
1880 |
'wppa_potd_align' => 'center',
|
1881 |
-
'wppa_potd_linkurl' =>
|
1882 |
-
'wppa_potd_linktitle' =>
|
1883 |
'wppa_potd_subtitle' => 'none',
|
1884 |
'wppa_potd_counter' => 'no',
|
1885 |
'wppa_potd_counter_link' => 'thumbs',
|
@@ -1943,132 +1943,54 @@ function wppa_set_default( $value, $key ) {
|
|
1943 |
// Check if the required directories exist, if not, try to create them and optionally report it
|
1944 |
function wppa_check_dirs() {
|
1945 |
|
1946 |
-
/* wp_upload_dir() gives wrong result when provider moves site. wp bug.
|
1947 |
-
if ( ! is_multisite() ) {
|
1948 |
-
// check if uploads dir exists
|
1949 |
-
$upload_dir = wp_upload_dir();
|
1950 |
-
$dir = $upload_dir['basedir'];
|
1951 |
-
if ( ! wppa_is_dir($dir) ) {
|
1952 |
-
wppa_mktree($dir);
|
1953 |
-
if ( ! wppa_is_dir($dir) ) {
|
1954 |
-
wppa_error_message(__('The uploads directory does not exist, please do a regular WP upload first.', 'wp-photo-album-plus').'<br/>'.$dir);
|
1955 |
-
return false;
|
1956 |
-
}
|
1957 |
-
else {
|
1958 |
-
if ( WPPA_DEBUG ) wppa_ok_message(__('Successfully created uploads directory.', 'wp-photo-album-plus').'<br/>'.$dir);
|
1959 |
-
}
|
1960 |
-
}
|
1961 |
-
// wppa_chmod( $dir );
|
1962 |
-
}
|
1963 |
-
*/
|
1964 |
-
|
1965 |
// check if wppa dir exists
|
1966 |
$dir = WPPA_UPLOAD_PATH;
|
1967 |
-
if ( ! wppa_is_dir($dir) ) {
|
1968 |
-
wppa_mktree($dir);
|
1969 |
-
if ( ! wppa_is_dir($dir) ) {
|
1970 |
-
wppa_error_message(__('Could not create the wppa directory.', 'wp-photo-album-plus').wppa_credirmsg($dir));
|
1971 |
-
return false;
|
1972 |
-
}
|
1973 |
-
else {
|
1974 |
-
if ( WPPA_DEBUG ) wppa_ok_message(__('Successfully created wppa directory.', 'wp-photo-album-plus').'<br/>'.$dir);
|
1975 |
-
}
|
1976 |
}
|
1977 |
-
// wppa_chmod( $dir );
|
1978 |
|
1979 |
// check if thumbs dir exists
|
1980 |
-
$dir = WPPA_UPLOAD_PATH.'/thumbs';
|
1981 |
-
if ( ! wppa_is_dir($dir) ) {
|
1982 |
-
wppa_mktree($dir);
|
1983 |
-
if ( ! wppa_is_dir($dir) ) {
|
1984 |
-
wppa_error_message(__('Could not create the wppa thumbs directory.', 'wp-photo-album-plus').wppa_credirmsg($dir));
|
1985 |
-
return false;
|
1986 |
-
}
|
1987 |
-
else {
|
1988 |
-
if ( WPPA_DEBUG ) wppa_ok_message(__('Successfully created wppa thumbs directory.', 'wp-photo-album-plus').'<br/>'.$dir);
|
1989 |
-
}
|
1990 |
}
|
1991 |
-
// wppa_chmod( $dir );
|
1992 |
|
1993 |
// check if watermarks dir exists
|
1994 |
-
$dir = WPPA_UPLOAD_PATH.'/watermarks';
|
1995 |
-
if ( ! wppa_is_dir($dir) ) {
|
1996 |
-
wppa_mktree($dir);
|
1997 |
-
if ( ! wppa_is_dir($dir) ) {
|
1998 |
-
wppa_error_message(__('Could not create the wppa watermarks directory.', 'wp-photo-album-plus').wppa_credirmsg($dir));
|
1999 |
-
return false;
|
2000 |
-
}
|
2001 |
-
else {
|
2002 |
-
if ( WPPA_DEBUG ) wppa_ok_message(__('Successfully created wppa watermarks directory.', 'wp-photo-album-plus').'<br/>'.$dir);
|
2003 |
-
}
|
2004 |
}
|
2005 |
-
// wppa_chmod( $dir );
|
2006 |
|
2007 |
// check if fonts dir exists
|
2008 |
-
$dir = WPPA_UPLOAD_PATH.'/fonts';
|
2009 |
-
if ( ! wppa_is_dir($dir) ) {
|
2010 |
-
wppa_mktree($dir);
|
2011 |
-
if ( ! wppa_is_dir($dir) ) {
|
2012 |
-
wppa_error_message(__('Could not create the wppa fonts directory.', 'wp-photo-album-plus').wppa_credirmsg($dir));
|
2013 |
-
return false;
|
2014 |
-
}
|
2015 |
-
else {
|
2016 |
-
if ( WPPA_DEBUG ) wppa_ok_message(__('Successfully created wppa fonts directory.', 'wp-photo-album-plus').'<br/>'.$dir);
|
2017 |
-
}
|
2018 |
}
|
2019 |
-
// wppa_chmod( $dir );
|
2020 |
|
2021 |
// check if depot dir exists
|
2022 |
if ( ! is_multisite() ) {
|
|
|
2023 |
// check if users depot dir exists
|
2024 |
-
$dir = WPPA_CONTENT_PATH.'/wppa-depot';
|
2025 |
-
if ( ! wppa_is_dir($dir) ) {
|
2026 |
-
wppa_mktree($dir);
|
2027 |
-
if ( ! wppa_is_dir($dir) ) {
|
2028 |
-
wppa_error_message(__('Unable to create depot directory.', 'wp-photo-album-plus').wppa_credirmsg($dir));
|
2029 |
-
return false;
|
2030 |
-
}
|
2031 |
-
else {
|
2032 |
-
if ( WPPA_DEBUG ) wppa_ok_message(__('Successfully created wppa depot directory.', 'wp-photo-album-plus').'<br/>'.$dir);
|
2033 |
-
}
|
2034 |
}
|
2035 |
-
// wppa_chmod( $dir );
|
2036 |
}
|
2037 |
|
2038 |
// check the user depot directory
|
2039 |
$dir = WPPA_DEPOT_PATH;
|
2040 |
-
if ( ! wppa_is_dir($dir) ) {
|
2041 |
-
wppa_mktree($dir);
|
2042 |
-
if ( ! wppa_is_dir($dir) ) {
|
2043 |
-
wppa_error_message(__('Unable to create user depot directory', 'wp-photo-album-plus').wppa_credirmsg($dir));
|
2044 |
-
return false;
|
2045 |
-
}
|
2046 |
-
else {
|
2047 |
-
if ( WPPA_DEBUG ) wppa_ok_message(__('Successfully created wppa user depot directory.', 'wp-photo-album-plus').'<br/>'.$dir);
|
2048 |
-
}
|
2049 |
}
|
2050 |
-
// wppa_chmod( $dir );
|
2051 |
|
2052 |
// check the temp dir
|
2053 |
-
$dir = WPPA_UPLOAD_PATH.'/temp/';
|
2054 |
-
if ( ! wppa_is_dir($dir) ) {
|
2055 |
-
wppa_mktree($dir);
|
2056 |
-
if ( ! wppa_is_dir($dir) ) {
|
2057 |
-
wppa_error_message(__('Unable to create temp directory', 'wp-photo-album-plus').wppa_credirmsg($dir));
|
2058 |
-
return false;
|
2059 |
-
}
|
2060 |
-
else {
|
2061 |
-
if ( WPPA_DEBUG ) wppa_ok_message(__('Successfully created temp directory.', 'wp-photo-album-plus').'<br/>'.$dir);
|
2062 |
-
}
|
2063 |
}
|
2064 |
-
// wppa_chmod( $dir );
|
2065 |
|
2066 |
return true;
|
2067 |
}
|
2068 |
-
function wppa_credirmsg($dir) {
|
2069 |
-
$msg = ' '.sprintf(__('Ask your administrator to give you more rights, or create <b>%s</b> manually using an FTP program.', 'wp-photo-album-plus'), $dir);
|
2070 |
-
return $msg;
|
2071 |
-
}
|
2072 |
|
2073 |
// Create grated album(s)
|
2074 |
// @1: int album id that may be a grant parent, if so, create child for current user if not already exists
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
+
* Version 7.0.08
|
7 |
*
|
8 |
*/
|
9 |
|
1878 |
'wppa_potd_title' => __('Photo of the day', 'wp-photo-album-plus'),
|
1879 |
'wppa_potd_widget_width' => '200',
|
1880 |
'wppa_potd_align' => 'center',
|
1881 |
+
'wppa_potd_linkurl' => '',
|
1882 |
+
'wppa_potd_linktitle' => '',
|
1883 |
'wppa_potd_subtitle' => 'none',
|
1884 |
'wppa_potd_counter' => 'no',
|
1885 |
'wppa_potd_counter_link' => 'thumbs',
|
1943 |
// Check if the required directories exist, if not, try to create them and optionally report it
|
1944 |
function wppa_check_dirs() {
|
1945 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1946 |
// check if wppa dir exists
|
1947 |
$dir = WPPA_UPLOAD_PATH;
|
1948 |
+
if ( ! wppa_is_dir( $dir ) ) {
|
1949 |
+
wppa_mktree( $dir );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1950 |
}
|
|
|
1951 |
|
1952 |
// check if thumbs dir exists
|
1953 |
+
$dir = WPPA_UPLOAD_PATH . '/thumbs';
|
1954 |
+
if ( ! wppa_is_dir( $dir ) ) {
|
1955 |
+
wppa_mktree( $dir );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1956 |
}
|
|
|
1957 |
|
1958 |
// check if watermarks dir exists
|
1959 |
+
$dir = WPPA_UPLOAD_PATH . '/watermarks';
|
1960 |
+
if ( ! wppa_is_dir( $dir ) ) {
|
1961 |
+
wppa_mktree( $dir );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1962 |
}
|
|
|
1963 |
|
1964 |
// check if fonts dir exists
|
1965 |
+
$dir = WPPA_UPLOAD_PATH . '/fonts';
|
1966 |
+
if ( ! wppa_is_dir( $dir ) ) {
|
1967 |
+
wppa_mktree( $dir );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1968 |
}
|
|
|
1969 |
|
1970 |
// check if depot dir exists
|
1971 |
if ( ! is_multisite() ) {
|
1972 |
+
|
1973 |
// check if users depot dir exists
|
1974 |
+
$dir = WPPA_CONTENT_PATH . '/wppa-depot';
|
1975 |
+
if ( ! wppa_is_dir( $dir ) ) {
|
1976 |
+
wppa_mktree( $dir );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1977 |
}
|
|
|
1978 |
}
|
1979 |
|
1980 |
// check the user depot directory
|
1981 |
$dir = WPPA_DEPOT_PATH;
|
1982 |
+
if ( ! wppa_is_dir( $dir ) ) {
|
1983 |
+
wppa_mktree( $dir );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1984 |
}
|
|
|
1985 |
|
1986 |
// check the temp dir
|
1987 |
+
$dir = WPPA_UPLOAD_PATH . '/temp/';
|
1988 |
+
if ( ! wppa_is_dir( $dir ) ) {
|
1989 |
+
wppa_mktree( $dir );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1990 |
}
|
|
|
1991 |
|
1992 |
return true;
|
1993 |
}
|
|
|
|
|
|
|
|
|
1994 |
|
1995 |
// Create grated album(s)
|
1996 |
// @1: int album id that may be a grant parent, if so, create child for current user if not already exists
|
wppa-utils.php
CHANGED
@@ -658,6 +658,7 @@ global $wpdb;
|
|
658 |
"FROM $wpdb->wppa_photos " .
|
659 |
"WHERE status <> 'pending' " .
|
660 |
"AND status <> 'scheduled' " .
|
|
|
661 |
"AND tags <> '' " .
|
662 |
"LIMIT " . $skip . "," . $pagsize,
|
663 |
ARRAY_A );
|
@@ -1216,6 +1217,7 @@ global $wpdb;
|
|
1216 |
wppa_update_photo( array( 'id' => $photo, 'album' => $newalb, 'modified' => time() ) );
|
1217 |
wppa_mark_treecounts( $album );
|
1218 |
wppa_schedule_cleanup( 'now' );
|
|
|
1219 |
}
|
1220 |
return;
|
1221 |
}
|
@@ -1262,6 +1264,9 @@ global $wpdb;
|
|
1262 |
wppa_invalidate_treecounts($album);
|
1263 |
wppa_flush_upldr_cache('photoid', $photo);
|
1264 |
|
|
|
|
|
|
|
1265 |
// Delete from cloud
|
1266 |
if ( wppa_cdn( 'admin' ) == 'cloudinary' ) {
|
1267 |
wppa_delete_from_cloudinary( $photo );
|
658 |
"FROM $wpdb->wppa_photos " .
|
659 |
"WHERE status <> 'pending' " .
|
660 |
"AND status <> 'scheduled' " .
|
661 |
+
"AND album > 0 " .
|
662 |
"AND tags <> '' " .
|
663 |
"LIMIT " . $skip . "," . $pagsize,
|
664 |
ARRAY_A );
|
1217 |
wppa_update_photo( array( 'id' => $photo, 'album' => $newalb, 'modified' => time() ) );
|
1218 |
wppa_mark_treecounts( $album );
|
1219 |
wppa_schedule_cleanup( 'now' );
|
1220 |
+
wppa_clear_taglist();
|
1221 |
}
|
1222 |
return;
|
1223 |
}
|
1264 |
wppa_invalidate_treecounts($album);
|
1265 |
wppa_flush_upldr_cache('photoid', $photo);
|
1266 |
|
1267 |
+
// Clear taglist to trigger recreata
|
1268 |
+
wppa_clear_taglist();
|
1269 |
+
|
1270 |
// Delete from cloud
|
1271 |
if ( wppa_cdn( 'admin' ) == 'cloudinary' ) {
|
1272 |
wppa_delete_from_cloudinary( $photo );
|
wppa-wrappers.php
CHANGED
@@ -5,12 +5,46 @@
|
|
5 |
* Contains wrappers for standard php functions
|
6 |
* For security and bug reasons
|
7 |
*
|
8 |
-
* Version 7.0.
|
9 |
*
|
10 |
*/
|
11 |
|
12 |
require_once ABSPATH . 'wp-admin/includes/file.php';
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
// To fix a bug in PHP as that photos made with the selfie camera of an android smartphone
|
16 |
// erroneously cause the PHP warning 'is not a valid JPEG file' and cause imagecreatefromjpag crash.
|
@@ -65,6 +99,8 @@ global $wp_filesystem;
|
|
65 |
wppa_log( 'War', '3 Unsafe to path detected in wppa_copy(): ' . sanitize_text_field( $to ), true );
|
66 |
return false; // For diagnostic purposes, no return here yet
|
67 |
}
|
|
|
|
|
68 |
return $wp_filesystem->copy( $from, $to, true, 0644 );
|
69 |
}
|
70 |
|
@@ -80,6 +116,7 @@ global $wp_filesystem;
|
|
80 |
$bret = false;
|
81 |
}
|
82 |
else {
|
|
|
83 |
$bret = $wp_filesystem->copy( $from, $to, 0644 );
|
84 |
if ( $bret ) {
|
85 |
$wp_filesystem->delete( $from, false, 'f' );
|
@@ -105,6 +142,7 @@ global $wp_filesystem;
|
|
105 |
return false;
|
106 |
}
|
107 |
|
|
|
108 |
if ( $wp_filesystem->file_exists( $from ) ) {
|
109 |
$bret = $wp_filesystem->move( $from, $to );
|
110 |
if ( ! $bret ) {
|
@@ -149,13 +187,15 @@ function wppa_glob( $pattern, $flags = null, $wp_content = false ) {
|
|
149 |
|
150 |
// Wrapper for unlink
|
151 |
function wppa_unlink( $file ) {
|
|
|
152 |
|
153 |
if ( ! wppa_is_path_safe( $file ) ) {
|
154 |
wppa_log( 'War', 'Unsafe path detected in wppa_unlink(): ' . sanitize_text_field( $file ), true );
|
155 |
return false;
|
156 |
}
|
157 |
|
158 |
-
|
|
|
159 |
return true;
|
160 |
}
|
161 |
|
@@ -211,6 +251,7 @@ global $wp_filesystem;
|
|
211 |
return false;
|
212 |
}
|
213 |
|
|
|
214 |
return $wp_filesystem->is_dir( $dir );
|
215 |
}
|
216 |
|
@@ -223,6 +264,7 @@ global $wp_filesystem;
|
|
223 |
return false;
|
224 |
}
|
225 |
|
|
|
226 |
return $wp_filesystem->is_file( $path );
|
227 |
}
|
228 |
|
5 |
* Contains wrappers for standard php functions
|
6 |
* For security and bug reasons
|
7 |
*
|
8 |
+
* Version 7.0.08
|
9 |
*
|
10 |
*/
|
11 |
|
12 |
require_once ABSPATH . 'wp-admin/includes/file.php';
|
13 |
+
|
14 |
+
// add_action( 'admin_init', 'wppa_init_fs' );
|
15 |
+
|
16 |
+
function wppa_init_fs() {
|
17 |
+
global $wp_filesystem;
|
18 |
+
|
19 |
+
if ( empty( $wp_filesystem ) ) {
|
20 |
+
|
21 |
+
$access_type = get_filesystem_method();
|
22 |
+
// wppa_log( 'fso', $access_type );
|
23 |
+
if ( $access_type === 'direct' ) {
|
24 |
+
|
25 |
+
/* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */
|
26 |
+
$creds = request_filesystem_credentials( site_url() . '/wp-admin/', '', false, false, array() );
|
27 |
+
|
28 |
+
/* initialize the API */
|
29 |
+
if ( ! WP_Filesystem( $creds, false, true ) ) {
|
30 |
+
|
31 |
+
/* any problems and we exit */
|
32 |
+
return false;
|
33 |
+
}
|
34 |
+
|
35 |
+
global $wp_filesystem;
|
36 |
+
/* do our file manipulations below */
|
37 |
+
}
|
38 |
+
else
|
39 |
+
{
|
40 |
+
/* don't have direct write access. Prompt user with our notice */
|
41 |
+
// add_action( 'admin_notices', 'wppa_fs_admin_notice' );
|
42 |
+
}
|
43 |
+
|
44 |
+
// WP_Filesystem( array( 'verbose' => true ), false, true );
|
45 |
+
}
|
46 |
+
return true;
|
47 |
+
}
|
48 |
|
49 |
// To fix a bug in PHP as that photos made with the selfie camera of an android smartphone
|
50 |
// erroneously cause the PHP warning 'is not a valid JPEG file' and cause imagecreatefromjpag crash.
|
99 |
wppa_log( 'War', '3 Unsafe to path detected in wppa_copy(): ' . sanitize_text_field( $to ), true );
|
100 |
return false; // For diagnostic purposes, no return here yet
|
101 |
}
|
102 |
+
|
103 |
+
wppa_init_fs();
|
104 |
return $wp_filesystem->copy( $from, $to, true, 0644 );
|
105 |
}
|
106 |
|
116 |
$bret = false;
|
117 |
}
|
118 |
else {
|
119 |
+
wppa_init_fs();
|
120 |
$bret = $wp_filesystem->copy( $from, $to, 0644 );
|
121 |
if ( $bret ) {
|
122 |
$wp_filesystem->delete( $from, false, 'f' );
|
142 |
return false;
|
143 |
}
|
144 |
|
145 |
+
wppa_init_fs();
|
146 |
if ( $wp_filesystem->file_exists( $from ) ) {
|
147 |
$bret = $wp_filesystem->move( $from, $to );
|
148 |
if ( ! $bret ) {
|
187 |
|
188 |
// Wrapper for unlink
|
189 |
function wppa_unlink( $file ) {
|
190 |
+
global $wp_filesystem;
|
191 |
|
192 |
if ( ! wppa_is_path_safe( $file ) ) {
|
193 |
wppa_log( 'War', 'Unsafe path detected in wppa_unlink(): ' . sanitize_text_field( $file ), true );
|
194 |
return false;
|
195 |
}
|
196 |
|
197 |
+
wppa_init_fs();
|
198 |
+
$wp_filesystem->delete( $file, false, 'f' );
|
199 |
return true;
|
200 |
}
|
201 |
|
251 |
return false;
|
252 |
}
|
253 |
|
254 |
+
wppa_init_fs();
|
255 |
return $wp_filesystem->is_dir( $dir );
|
256 |
}
|
257 |
|
264 |
return false;
|
265 |
}
|
266 |
|
267 |
+
wppa_init_fs();
|
268 |
return $wp_filesystem->is_file( $path );
|
269 |
}
|
270 |
|
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: 7.0.
|
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 $wp_version;
|
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
global $wppa_revno; $wppa_revno = '7007'; // WPPA db version
|
26 |
-
global $wppa_api_version; $wppa_api_version = '7.0.
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
+
* Version: 7.0.08.005
|
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 |
|
24 |
/* WPPA GLOBALS */
|
25 |
global $wppa_revno; $wppa_revno = '7007'; // WPPA db version
|
26 |
+
global $wppa_api_version; $wppa_api_version = '7.0.08.005'; // WPPA software version
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|