Version Description
= 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.00.016 |
Comparing to | |
See all releases |
Code changes from version 7.0.00.009 to 7.0.00.016
- changelog.txt +5 -4
- js/wppa-admin-scripts.js +2 -2
- js/wppa-admin-scripts.min.js +1 -1
- js/wppa-ajax-front.js +1 -0
- js/wppa-ajax-front.min.js +1 -1
- readme.txt +2 -2
- wppa-admin-functions.php +1 -1
- wppa-ajax.php +49 -41
- wppa-boxes-html.php +3 -2
- wppa-comment-admin.php +2 -2
- wppa-cron.php +49 -2
- wppa-functions.php +13 -31
- wppa-import.php +2 -2
- wppa-mailing.php +533 -78
- wppa-notify-widget.php +56 -116
- wppa-settings-autosave.php +151 -126
- wppa-setup.php +24 -13
- wppa-upload.php +3 -3
- wppa-utils.php +0 -79
- wppa-widget-functions.php +2 -1
- wppa-wpdb-insert.php +1 -1
- wppa.php +2 -2
changelog.txt
CHANGED
@@ -2,21 +2,22 @@ WP Photo Album Plus Changelog
|
|
2 |
|
3 |
= 7.0.00 =
|
4 |
|
5 |
-
= Bug Fixes =
|
6 |
|
7 |
* [wppa type="slphoto" photo="#last"] did not work. Fixed.
|
8 |
|
9 |
= New Features =
|
10 |
|
11 |
* Shortcode generators for Gutenberg added.
|
12 |
-
* New widget: WPPA+ Notify. Users can subscribe/unsubscribe for various mailings.
|
13 |
|
14 |
= Other Changes =
|
15 |
|
16 |
* Removed Table IX-A14. Frontend code is now always loaded.
|
17 |
* Removed script to shortcode conversion warning and tool.
|
18 |
* The shortcode generators now produce self-closing shortcodes, i.e. without [/wppa].
|
19 |
-
*
|
|
|
20 |
|
21 |
= 6.9.21 =
|
22 |
|
@@ -24,7 +25,7 @@ WP Photo Album Plus Changelog
|
|
24 |
|
25 |
* Album owner could no longer be set to --- public ---. Fixed.
|
26 |
|
27 |
-
= Other Changes =
|
28 |
|
29 |
* Added 'pointer' to the selectable lightbox cursors in Table I-G2.
|
30 |
|
2 |
|
3 |
= 7.0.00 =
|
4 |
|
5 |
+
= Bug Fixes =
|
6 |
|
7 |
* [wppa type="slphoto" photo="#last"] did not work. Fixed.
|
8 |
|
9 |
= New Features =
|
10 |
|
11 |
* Shortcode generators for Gutenberg added.
|
12 |
+
* New widget: WPPA+ Notify. Users can subscribe/unsubscribe for various mailings. Configure availability of mailing types in Table IX-M.
|
13 |
|
14 |
= Other Changes =
|
15 |
|
16 |
* Removed Table IX-A14. Frontend code is now always loaded.
|
17 |
* Removed script to shortcode conversion warning and tool.
|
18 |
* The shortcode generators now produce self-closing shortcodes, i.e. without [/wppa].
|
19 |
+
* Removed Table IV-F5. Configure emailing in Table IX-M.
|
20 |
+
* Album selectionlist in upload widget is now always sorted alphabetically.
|
21 |
|
22 |
= 6.9.21 =
|
23 |
|
25 |
|
26 |
* Album owner could no longer be set to --- public ---. Fixed.
|
27 |
|
28 |
+
= Other Changes =
|
29 |
|
30 |
* Added 'pointer' to the selectable lightbox cursors in Table I-G2.
|
31 |
|
js/wppa-admin-scripts.js
CHANGED
@@ -181,7 +181,7 @@ function wppaInitSettings() {
|
|
181 |
wppaCheckSmWidgetLink();
|
182 |
|
183 |
var tab = new Array('O','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII');
|
184 |
-
var sub = new Array('A','B','C','D','E','F','G','H','I','J','K','L');
|
185 |
|
186 |
for (table=1; table<13; table++) {
|
187 |
var cookie = wppa_getCookie('table_'+table);
|
@@ -191,7 +191,7 @@ function wppaInitSettings() {
|
|
191 |
else {
|
192 |
wppaHideTable(table); // Refreshes cookie, so it 'never' forgets
|
193 |
}
|
194 |
-
for (subtab=0; subtab<
|
195 |
cookie = wppa_getCookie('table_'+tab[table-1]+'-'+sub[subtab]);
|
196 |
if (cookie == 'on') {
|
197 |
wppaToggleSubTable(tab[table-1],sub[subtab]);
|
181 |
wppaCheckSmWidgetLink();
|
182 |
|
183 |
var tab = new Array('O','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII');
|
184 |
+
var sub = new Array('A','B','C','D','E','F','G','H','I','J','K','L','M');
|
185 |
|
186 |
for (table=1; table<13; table++) {
|
187 |
var cookie = wppa_getCookie('table_'+table);
|
191 |
else {
|
192 |
wppaHideTable(table); // Refreshes cookie, so it 'never' forgets
|
193 |
}
|
194 |
+
for (subtab=0; subtab<13; subtab++) {
|
195 |
cookie = wppa_getCookie('table_'+tab[table-1]+'-'+sub[subtab]);
|
196 |
if (cookie == 'on') {
|
197 |
wppaToggleSubTable(tab[table-1],sub[subtab]);
|
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");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for("on"==p?wppaShowTable(table):wppaHideTable(table),subtab=0;subtab<12;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*jQuery(window).width(),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),i={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(n).dialog(i).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"}),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*jQuery(window).width(),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),i={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(n).dialog(i).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"}),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){}})}
|
js/wppa-ajax-front.js
CHANGED
@@ -109,6 +109,7 @@ function wppaDoAjaxRender( mocc, ajaxurl, newurl, add, waitfor, addHilite ) {
|
|
109 |
if ( wppaCanPushState && wppaUpdateAddressLine ) {
|
110 |
wppaHis++;
|
111 |
|
|
|
112 |
try {
|
113 |
history.pushState( {page: wppaHis, occur: mocc, type: 'html', html: result}, "", newurl );
|
114 |
wppaConsoleLog( 'Ajax rendering: History stack pushed', 'force' );
|
109 |
if ( wppaCanPushState && wppaUpdateAddressLine ) {
|
110 |
wppaHis++;
|
111 |
|
112 |
+
newurl = newurl.split('&').join('&');
|
113 |
try {
|
114 |
history.pushState( {page: wppaHis, occur: mocc, type: 'html', html: result}, "", newurl );
|
115 |
wppaConsoleLog( 'Ajax rendering: History stack pushed', 'force' );
|
js/wppa-ajax-front.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wppaJsAjaxVersion="7.0.00",wppaRenderAdd=!1,wppaWaitForCounter=0;function wppaDoAjaxRender(n,a,i,p,e,t){0<parseInt(e)&&e!=wppaWaitForCounter?setTimeout("wppaDoAjaxRender( "+n+", '"+a+"', '"+i+"', '"+p+"', "+e+" )",100):(wppaRenderAdd=p,""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[n]&&(a+="&resp=1"),t&&_wppaCurIdx[n]&&_wppaId[n][_wppaCurIdx[n]]&&(a+="&wppa-hilite="+_wppaId[n][_wppaCurIdx[n]]),wppaCanAjaxRender||!i?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[n]&&_wppaStop(n),jQuery("#wppa-ajax-spin-"+n).fadeIn()},success:function(a,p,e){if(wppaRenderAdd)jQuery(wppaRenderAdd+a).insertBefore("#wppa-container-"+n+"-end");else if(wppaRenderModal&&i){var t={modal:!0,resizable:!0,width:wppaGetContainerWidth(n),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+n).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(n)})}else jQuery("#wppa-container-"+n).html(a),jQuery("#wppa-button-hide-"+n).show();if(wppaCanPushState&&wppaUpdateAddressLine){wppaHis++;try{history.pushState({page:wppaHis,occur:n,type:"html",html:a},"",i),wppaConsoleLog("Ajax rendering: History stack pushed","force")}catch(a){try{history.replaceState({page:wppaHis,occur:n,type:"html"},"",i),wppaConsoleLog("Ajax rendering: History stack updated","force")}catch(a){wppaConsoleLog("Ajax rendering: History stack update failed","force")}}0==wppaFirstOccur&&(wppaFirstOccur=n)}wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&(wppaConsoleLog("Ajax render asked qr code for "+i,"force"),wppaQRUpdate(i)),wppaColWidth[n]=0,_wppaDoAutocol(n);var o=a.indexOf("<script"),r=a.lastIndexOf("<script");-1==o?wppaConsoleLog("Ajax render did NOT contain a script tag","force"):wppaConsoleLog("Ajax render did contain a script tag at position "+o+" last at "+r,"force")},error:function(a,p,e){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+e+", status = "+p,"force"),document.location.href=i,wppaColWidth[n]=0,_wppaDoAutocol(n)},complete:function(a,p,e){wppaWaitForCounter++,wppaRenderModal||jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+n).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery("#wppa-ajax-spin-"+n).stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=i,wppaColWidth[n]=0,_wppaDoAutocol(n)))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxAddPhotoToZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-"+r+"-"+o).html(t[1]),jQuery("#admin-choice-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-"+r+"-"+o).prop("disabled",!0)):alert(a),n&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,p,e){document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+e+", status = "+p,"force")}})}function wppaEditPhoto(o,a){var r,t=String(a),e="Edit Photo "+t,n=wppaEditPhotoWidth;screen.availWidth<n&&(n=screen.availWidth),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+t+"&moccur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){if("classic"==wppaUploadEdit){(r=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+n+", height=512",!0)).document.write("<! DOCTYPE html>"),r.document.write("<html>"),r.document.write("<head>");var p='<meta name="viewport" content="width='+n+'" ><link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+"/wppa-admin-styles.css?ver="+wppaVersion+'" type="text/css" media="all" /><link rel="stylesheet" id="theme_style" href="'+wppaThemeStyles+'" type="text/css" media="all" /><style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style><script type="text/javascript" src="'+wppaIncludeUrl+"/js/jquery/jquery.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-utils.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-admin-scripts.js?ver="+wppaVersion+'"><\/script><title>'+e+'</title><script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";<\/script>';r.document.write(p),r.document.write("</head>"),r.document.write("<body>")}},success:function(a,p,e){if("classic"==wppaUploadEdit&&r.document.write(a),"new"==wppaUploadEdit){var t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close")}},error:function(a,p,e){"classic"==wppaUploadEdit&&r.document.write(p+" "+e),wppaConsoleLog("wppaEditPhoto failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){"classic"==wppaUploadEdit&&(r.document.write('<script>wppaPhotoStatusChange( "'+t+'" )<\/script>'),r.document.write("</body>"),r.document.write("</html>"))}})}function wppaPrevTags(a,p,e,t){for(var o,r,n=jQuery("."+a),i=[],c=jQuery("#"+e).val(),u=0,s=0;u<n.length;)n[u].selected&&(i[s]=n[u].value,s++),u++;""!=(o=jQuery("#"+p).val())&&(i[s]=o),r=i.join(),""==o&&""==e||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+r+"&album="+c,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,p,e){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,p,e){jQuery("#"+t).html('<span style="color:red" >'+e+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDestroyAlbum(a,p){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+p,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+e+", status = "+p,"force")}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,p,e){wppaConsoleLog("_bumpClickCount success.")},error:function(a,p,e){wppaConsoleLog("_bumpClickCount failed. Error = "+e+", status = "+p,"force")}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){wppaPhotoView[t]=!0},error:function(a,p,e){wppaConsoleLog("_bumpViewCount failed. Error = "+e+", status = "+p,"force")}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,p,e){wppaConsoleLog("wppaVoteThumb failed. Error = "+e+", status = "+p,"force")}})}function _wppaRateIt(r,p){if(0!=p&&!_wppaSSRuns[r]){var a=_wppaId[r][_wppaCurIdx[r]],e=_wppaMyr[r][_wppaCurIdx[r]],t=_wppaWaitTexts[r][_wppaCurIdx[r]];0<t.length?alert(t):0!=e&&wppaRatingOnce||e<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+a+"&wppa-occur="+r+"&wppa-index="+_wppaCurIdx[r]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+r+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+r+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+r).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");if(0==t[0])900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(r)):alert("Error Code="+t[1]+"\n\n"+t[2]);else{if(t[7]&&"likes"==t[7]){var o=t[4].split("|");jQuery("#wppa-like-"+r).attr("title",o[0]),jQuery("#wppa-liketext-"+r).html(o[1]),"1"==t[3]?jQuery("#wppa-like-"+r).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+r).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]}else _wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(r),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7]);wppaNextOnCallback&&_wppaNextOnCallback(r)}},error:function(a,p,e){wppaConsoleLog("_wppaRateIt failed. Error = "+e+", status = "+p,"force")}}))}}function _wppaOvlRateIt(r,n,i,c){0!=n&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+n+"&wppa-rating-id="+r+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+i+"-"+n).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+i+"-"+n).stop().fadeTo(100,1),jQuery("#wppa-like-"+r+"-"+i).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){wppaConsoleLog(a,"force");var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+i+"-"+n).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){var o=t[4].split("|");return jQuery("#wppa-like-0").attr("title",o[0]),jQuery("#wppa-liketext-0").html(o[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+r+"-"+i).attr("title",o[0]),jQuery("#wppa-liketext-"+r+"-"+i).html(o[1]),void("1"==t[3]?jQuery("#wppa-like-"+r+"-"+i).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+r+"-"+i).attr("src",wppaImageDirectory+"thumbup.png"))}if(_wppaSetRd(i,t[4],".wppa-avg-"),_wppaSetRd(i,t[3],".wppa-rate-"),c)return;wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,p,e){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxMakeOrigName(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+p+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){var t=a.split("||");"0"==t[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=t[2]):"file"==wppaArtMonkyLink&&window.open(t[2]),"zip"==wppaArtMonkyLink&&(document.location=t[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+t[1]+"\n\n"+t[2]))},error:function(a,p,e){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,p,e){var t=a.split("||"),o=t[0],r=t[1],n=t[2];3==t.length&&""!=n&&alert("Attention:\n\n"+n),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,p,e){alert("An error occurred:\n"+e+"\nPlease try again")},complete:function(a,p,e){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){if(_wppaValidateComment(t,a)){var p="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&moccur="+t;void 0!==jQuery("#wppa-comemail-"+t).val()&&(p+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(p+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(p+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(p+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,p,e){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxComment failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){jQuery("#wppa-comment-spin-"+t).css("display","none")}})}}function wppaUpdatePhotoNew(a){for(var p=["name","description","tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],e="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),t=0;t<p.length;)void 0!==jQuery("#"+p[t]).val()&&(e+="&"+p[t]+"="+jQuery("#"+p[t]).val()),t++;jQuery.ajax({url:wppaAjaxUrl,data:e,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,p,e){0<a.length&&alert(a)},error:function(a,p,e){alert(result),wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){if(wppaLastQrcodeUrl!=a){wppaLastQrcodeUrl=a;var p="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a);jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e4,success:function(a,p,e){document.getElementById(t).src=a,wppaConsoleLog("wppaAjaxSetQrCodeSrc put "+a+" into "+t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+e+", status = "+p,"force")}})}}function wppaAjaxNotify(a,p){var e=jQuery(a).prop("checked")?"on":"off",t="action=wppa&wppa-action=mailinglist&wppa-ntfy-nonce="+jQuery("#wppa-ntfy-nonce").val()+"&list="+p+"&onoff="+e;jQuery.ajax({url:wppaAjaxUrl,data:t,async:!0,type:"POST",timeout:1e4,success:function(a,p,e){alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxNotify failed. Error = "+e+", status = "+p,"force")}})}wppaConsoleLog("wppa-ajax-front.js version "+wppaJsAjaxVersion+" loaded.","force");
|
1 |
+
var wppaJsAjaxVersion="7.0.00",wppaRenderAdd=!1,wppaWaitForCounter=0;function wppaDoAjaxRender(n,a,i,p,e,t){0<parseInt(e)&&e!=wppaWaitForCounter?setTimeout("wppaDoAjaxRender( "+n+", '"+a+"', '"+i+"', '"+p+"', "+e+" )",100):(wppaRenderAdd=p,""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[n]&&(a+="&resp=1"),t&&_wppaCurIdx[n]&&_wppaId[n][_wppaCurIdx[n]]&&(a+="&wppa-hilite="+_wppaId[n][_wppaCurIdx[n]]),wppaCanAjaxRender||!i?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[n]&&_wppaStop(n),jQuery("#wppa-ajax-spin-"+n).fadeIn()},success:function(a,p,e){if(wppaRenderAdd)jQuery(wppaRenderAdd+a).insertBefore("#wppa-container-"+n+"-end");else if(wppaRenderModal&&i){var t={modal:!0,resizable:!0,width:wppaGetContainerWidth(n),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+n).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(n)})}else jQuery("#wppa-container-"+n).html(a),jQuery("#wppa-button-hide-"+n).show();if(wppaCanPushState&&wppaUpdateAddressLine){wppaHis++,i=i.split("&").join("&");try{history.pushState({page:wppaHis,occur:n,type:"html",html:a},"",i),wppaConsoleLog("Ajax rendering: History stack pushed","force")}catch(a){try{history.replaceState({page:wppaHis,occur:n,type:"html"},"",i),wppaConsoleLog("Ajax rendering: History stack updated","force")}catch(a){wppaConsoleLog("Ajax rendering: History stack update failed","force")}}0==wppaFirstOccur&&(wppaFirstOccur=n)}wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&(wppaConsoleLog("Ajax render asked qr code for "+i,"force"),wppaQRUpdate(i)),wppaColWidth[n]=0,_wppaDoAutocol(n);var o=a.indexOf("<script"),r=a.lastIndexOf("<script");-1==o?wppaConsoleLog("Ajax render did NOT contain a script tag","force"):wppaConsoleLog("Ajax render did contain a script tag at position "+o+" last at "+r,"force")},error:function(a,p,e){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+e+", status = "+p,"force"),document.location.href=i,wppaColWidth[n]=0,_wppaDoAutocol(n)},complete:function(a,p,e){wppaWaitForCounter++,wppaRenderModal||jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+n).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery("#wppa-ajax-spin-"+n).stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=i,wppaColWidth[n]=0,_wppaDoAutocol(n)))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxAddPhotoToZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-"+r+"-"+o).html(t[1]),jQuery("#admin-choice-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-"+r+"-"+o).prop("disabled",!0)):alert(a),n&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,p,e){document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+e+", status = "+p,"force")}})}function wppaEditPhoto(o,a){var r,t=String(a),e="Edit Photo "+t,n=wppaEditPhotoWidth;screen.availWidth<n&&(n=screen.availWidth),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+t+"&moccur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){if("classic"==wppaUploadEdit){(r=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+n+", height=512",!0)).document.write("<! DOCTYPE html>"),r.document.write("<html>"),r.document.write("<head>");var p='<meta name="viewport" content="width='+n+'" ><link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+"/wppa-admin-styles.css?ver="+wppaVersion+'" type="text/css" media="all" /><link rel="stylesheet" id="theme_style" href="'+wppaThemeStyles+'" type="text/css" media="all" /><style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style><script type="text/javascript" src="'+wppaIncludeUrl+"/js/jquery/jquery.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-utils.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-admin-scripts.js?ver="+wppaVersion+'"><\/script><title>'+e+'</title><script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";<\/script>';r.document.write(p),r.document.write("</head>"),r.document.write("<body>")}},success:function(a,p,e){if("classic"==wppaUploadEdit&&r.document.write(a),"new"==wppaUploadEdit){var t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close")}},error:function(a,p,e){"classic"==wppaUploadEdit&&r.document.write(p+" "+e),wppaConsoleLog("wppaEditPhoto failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){"classic"==wppaUploadEdit&&(r.document.write('<script>wppaPhotoStatusChange( "'+t+'" )<\/script>'),r.document.write("</body>"),r.document.write("</html>"))}})}function wppaPrevTags(a,p,e,t){for(var o,r,n=jQuery("."+a),i=[],c=jQuery("#"+e).val(),u=0,s=0;u<n.length;)n[u].selected&&(i[s]=n[u].value,s++),u++;""!=(o=jQuery("#"+p).val())&&(i[s]=o),r=i.join(),""==o&&""==e||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+r+"&album="+c,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,p,e){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,p,e){jQuery("#"+t).html('<span style="color:red" >'+e+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDestroyAlbum(a,p){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+p,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+e+", status = "+p,"force")}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,p,e){wppaConsoleLog("_bumpClickCount success.")},error:function(a,p,e){wppaConsoleLog("_bumpClickCount failed. Error = "+e+", status = "+p,"force")}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){wppaPhotoView[t]=!0},error:function(a,p,e){wppaConsoleLog("_bumpViewCount failed. Error = "+e+", status = "+p,"force")}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,p,e){wppaConsoleLog("wppaVoteThumb failed. Error = "+e+", status = "+p,"force")}})}function _wppaRateIt(r,p){if(0!=p&&!_wppaSSRuns[r]){var a=_wppaId[r][_wppaCurIdx[r]],e=_wppaMyr[r][_wppaCurIdx[r]],t=_wppaWaitTexts[r][_wppaCurIdx[r]];0<t.length?alert(t):0!=e&&wppaRatingOnce||e<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+a+"&wppa-occur="+r+"&wppa-index="+_wppaCurIdx[r]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+r+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+r+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+r).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");if(0==t[0])900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(r)):alert("Error Code="+t[1]+"\n\n"+t[2]);else{if(t[7]&&"likes"==t[7]){var o=t[4].split("|");jQuery("#wppa-like-"+r).attr("title",o[0]),jQuery("#wppa-liketext-"+r).html(o[1]),"1"==t[3]?jQuery("#wppa-like-"+r).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+r).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]}else _wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(r),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7]);wppaNextOnCallback&&_wppaNextOnCallback(r)}},error:function(a,p,e){wppaConsoleLog("_wppaRateIt failed. Error = "+e+", status = "+p,"force")}}))}}function _wppaOvlRateIt(r,n,i,c){0!=n&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+n+"&wppa-rating-id="+r+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+i+"-"+n).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+i+"-"+n).stop().fadeTo(100,1),jQuery("#wppa-like-"+r+"-"+i).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){wppaConsoleLog(a,"force");var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+i+"-"+n).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){var o=t[4].split("|");return jQuery("#wppa-like-0").attr("title",o[0]),jQuery("#wppa-liketext-0").html(o[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+r+"-"+i).attr("title",o[0]),jQuery("#wppa-liketext-"+r+"-"+i).html(o[1]),void("1"==t[3]?jQuery("#wppa-like-"+r+"-"+i).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+r+"-"+i).attr("src",wppaImageDirectory+"thumbup.png"))}if(_wppaSetRd(i,t[4],".wppa-avg-"),_wppaSetRd(i,t[3],".wppa-rate-"),c)return;wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,p,e){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxMakeOrigName(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+p+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){var t=a.split("||");"0"==t[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=t[2]):"file"==wppaArtMonkyLink&&window.open(t[2]),"zip"==wppaArtMonkyLink&&(document.location=t[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+t[1]+"\n\n"+t[2]))},error:function(a,p,e){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,p,e){var t=a.split("||"),o=t[0],r=t[1],n=t[2];3==t.length&&""!=n&&alert("Attention:\n\n"+n),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,p,e){alert("An error occurred:\n"+e+"\nPlease try again")},complete:function(a,p,e){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){if(_wppaValidateComment(t,a)){var p="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&moccur="+t;void 0!==jQuery("#wppa-comemail-"+t).val()&&(p+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(p+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(p+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(p+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,p,e){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxComment failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){jQuery("#wppa-comment-spin-"+t).css("display","none")}})}}function wppaUpdatePhotoNew(a){for(var p=["name","description","tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],e="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),t=0;t<p.length;)void 0!==jQuery("#"+p[t]).val()&&(e+="&"+p[t]+"="+jQuery("#"+p[t]).val()),t++;jQuery.ajax({url:wppaAjaxUrl,data:e,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,p,e){0<a.length&&alert(a)},error:function(a,p,e){alert(result),wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){if(wppaLastQrcodeUrl!=a){wppaLastQrcodeUrl=a;var p="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a);jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e4,success:function(a,p,e){document.getElementById(t).src=a,wppaConsoleLog("wppaAjaxSetQrCodeSrc put "+a+" into "+t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+e+", status = "+p,"force")}})}}function wppaAjaxNotify(a,p){var e=jQuery(a).prop("checked")?"on":"off",t="action=wppa&wppa-action=mailinglist&wppa-ntfy-nonce="+jQuery("#wppa-ntfy-nonce").val()+"&list="+p+"&onoff="+e;jQuery.ajax({url:wppaAjaxUrl,data:t,async:!0,type:"POST",timeout:1e4,success:function(a,p,e){alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxNotify failed. Error = "+e+", status = "+p,"force")}})}wppaConsoleLog("wppa-ajax-front.js version "+wppaJsAjaxVersion+" loaded.","force");
|
readme.txt
CHANGED
@@ -139,11 +139,11 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
|
|
139 |
|
140 |
= 7.0.00 =
|
141 |
|
142 |
-
* Shortcode generators for Gutenberg added
|
143 |
* This version addresses various minor bug fixes and feature requests.
|
144 |
* This version addresses various security issues.
|
145 |
* To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised.
|
146 |
-
|
147 |
|
148 |
= 6.9.21 =
|
149 |
|
139 |
|
140 |
= 7.0.00 =
|
141 |
|
142 |
+
* Shortcode generators for Gutenberg added.
|
143 |
* This version addresses various minor bug fixes and feature requests.
|
144 |
* This version addresses various security issues.
|
145 |
* To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised.
|
146 |
+
Configure Table IX-M to enable various mailing lists, and use the WPPA+ Notify widget for full user flexibility.
|
147 |
|
148 |
= 6.9.21 =
|
149 |
|
wppa-admin-functions.php
CHANGED
@@ -831,7 +831,7 @@ global $warning_given_small;
|
|
831 |
wppa_error_message( sprintf( __( 'Album %s does not exist or is not accessible while trying to add a photo' , 'wp-photo-album-plus'), $alb ) );
|
832 |
return false;
|
833 |
}
|
834 |
-
$status = ( wppa_switch( '
|
835 |
|
836 |
// Add photo to db
|
837 |
$id = wppa_create_photo_entry( array( 'id' => $id,
|
831 |
wppa_error_message( sprintf( __( 'Album %s does not exist or is not accessible while trying to add a photo' , 'wp-photo-album-plus'), $alb ) );
|
832 |
return false;
|
833 |
}
|
834 |
+
$status = ( wppa_switch( 'moderatephoto' ) && ! current_user_can( 'wppa_admin' ) ) ? 'pending' : 'publish';
|
835 |
|
836 |
// Add photo to db
|
837 |
$id = wppa_create_photo_entry( array( 'id' => $id,
|
wppa-ajax.php
CHANGED
@@ -60,17 +60,36 @@ global $wppa_log_file;
|
|
60 |
|
61 |
// Sanitize input
|
62 |
$nonce = isset( $_REQUEST['wppa-ntfy-nonce'] ) ? strip_tags( stripslashes( $_REQUEST['wppa-ntfy-nonce'] ) ) : '';
|
|
|
63 |
$list_type = isset( $_REQUEST['list'] ) ? strip_tags( stripslashes( $_REQUEST['list'] ) ) : '';
|
64 |
$onoff = isset( $_REQUEST['onoff'] ) ? strip_tags( stripslashes( $_REQUEST['onoff'] ) ) : '';
|
|
|
65 |
|
66 |
-
// Check nonce
|
67 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
_e( 'Security check failure', 'wp-photo-album-plus' );
|
69 |
wppa_exit();
|
70 |
}
|
71 |
|
72 |
// Existing list type?
|
73 |
-
if ( ! in_array( $list_type, array( '
|
|
|
74 |
'photoapproved',
|
75 |
'commentnotify',
|
76 |
'commentapproved',
|
@@ -94,20 +113,27 @@ global $wppa_log_file;
|
|
94 |
|
95 |
// Dispatch on list type
|
96 |
switch( $list_type ) {
|
97 |
-
case '
|
|
|
98 |
case 'photoapproved':
|
|
|
99 |
case 'commentapproved':
|
100 |
case 'commentprevious':
|
101 |
case 'moderatephoto':
|
102 |
case 'moderatecomment':
|
103 |
|
104 |
if ( $onoff == 'on' ) {
|
105 |
-
$userarray[] =
|
106 |
$msg = __( 'You have been added to this mailinglist', 'wp-photo-album-plus' );
|
107 |
}
|
108 |
else {
|
109 |
-
$userarray = array_diff( $userarray, array(
|
110 |
$msg = __( 'You have been removed from this mailinglist', 'wp-photo-album-plus' );
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
112 |
$mailinglist = wppa_index_array_to_string( $userarray );
|
113 |
update_option( 'wppa_mailinglist_' . $list_type, $mailinglist );
|
@@ -469,11 +495,14 @@ global $wppa_log_file;
|
|
469 |
$iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
|
470 |
SET status = 'publish'
|
471 |
WHERE id = %d", $pid ) );
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
|
|
|
|
|
|
477 |
}
|
478 |
|
479 |
if ( $cid && current_user_can( 'wppa_moderate' ) ) {
|
@@ -481,7 +510,7 @@ global $wppa_log_file;
|
|
481 |
SET status = 'approved'
|
482 |
WHERE id = %d", $cid ) );
|
483 |
if ( $iret ) {
|
484 |
-
|
485 |
wppa_add_credit_points( wppa_opt( 'cp_points_comment_appr' ),
|
486 |
__( 'Photo comment approved' , 'wp-photo-album-plus'),
|
487 |
$pid,
|
@@ -490,8 +519,9 @@ global $wppa_log_file;
|
|
490 |
);
|
491 |
}
|
492 |
}
|
|
|
493 |
if ( $iret ) {
|
494 |
-
if (
|
495 |
wppa_update_photo( $id );
|
496 |
}
|
497 |
echo 'OK';
|
@@ -1608,7 +1638,7 @@ global $wppa_log_file;
|
|
1608 |
|
1609 |
if ( $iret !== false ) {
|
1610 |
if ( $comstat == 'approved' ) {
|
1611 |
-
|
1612 |
wppa_add_credit_points( wppa_opt( 'cp_points_comment_appr' ),
|
1613 |
__( 'Photo comment approved' , 'wp-photo-album-plus'),
|
1614 |
$photo,
|
@@ -2112,30 +2142,8 @@ global $wppa_log_file;
|
|
2112 |
case 'status':
|
2113 |
if ( ! current_user_can( 'wppa_moderate' ) && ! current_user_can( 'wppa_admin' ) ) die( 'Security check failure #78' );
|
2114 |
wppa_invalidate_treecounts( wppa_get_photo_item( $photo, 'album' ) );
|
2115 |
-
|
2116 |
-
|
2117 |
-
$oldstatus = wppa_get_photo_item( $photo, 'status' );
|
2118 |
-
if ( $oldstatus == 'pending' ) {
|
2119 |
-
if ( $value == 'publish' ) {
|
2120 |
-
$owner = wppa_get_photo_item( $photo, 'owner' );
|
2121 |
-
$user = wppa_get_user_by( 'login', $owner );
|
2122 |
-
$to = $user->user_email;
|
2123 |
-
$subj = __('Photo approved', 'wp-photo-album-plus');
|
2124 |
-
$cont = sprintf( __('Your recently uploaded photo %s in album %s has been approved', 'wp-photo-album-plus'),
|
2125 |
-
'<b>' . wppa_get_photo_item( $photo, 'name' ) . '</b>',
|
2126 |
-
'<b>' . wppa_get_album_name( wppa_get_photo_item( $photo, 'album' ) ) . '</b>'
|
2127 |
-
);
|
2128 |
-
if ( wppa_is_user_in_mailinglist( $owner, 'photoapproved' ) ) {
|
2129 |
-
wppa_send_mail( array( 'to' =>$to,
|
2130 |
-
'subj' =>$subj,
|
2131 |
-
'cont' =>$cont,
|
2132 |
-
'photo' =>$photo,
|
2133 |
-
'email' =>'void',
|
2134 |
-
'listtype' =>'photoapproved',
|
2135 |
-
));
|
2136 |
-
}
|
2137 |
-
}
|
2138 |
-
}
|
2139 |
}
|
2140 |
$itemname = __( 'Status', 'wp-photo-album-plus');
|
2141 |
break;
|
@@ -3026,7 +3034,7 @@ global $wppa_log_file;
|
|
3026 |
wppa_update_option( 'wppa_owner_only', 'yes' );
|
3027 |
wppa_update_option( 'wppa_upload_moderate', 'yes' );
|
3028 |
wppa_update_option( 'wppa_upload_edit', 'new' );
|
3029 |
-
wppa_update_option( '
|
3030 |
wppa_update_option( 'wppa_grant_an_album', 'yes' );
|
3031 |
$grantparent = wppa_opt( 'grant_parent' );
|
3032 |
if ( ! wppa_album_exists( $grantparent ) ) {
|
@@ -3065,8 +3073,8 @@ global $wppa_log_file;
|
|
3065 |
case 'wppa_i_comment':
|
3066 |
if ( $value == 'yes' ) {
|
3067 |
wppa_update_option( 'wppa_show_comments', 'yes' );
|
3068 |
-
wppa_update_option( '
|
3069 |
-
wppa_update_option( '
|
3070 |
}
|
3071 |
if ( $value == 'no' ) {
|
3072 |
wppa_update_option( 'wppa_show_comments', 'no' );
|
60 |
|
61 |
// Sanitize input
|
62 |
$nonce = isset( $_REQUEST['wppa-ntfy-nonce'] ) ? strip_tags( stripslashes( $_REQUEST['wppa-ntfy-nonce'] ) ) : '';
|
63 |
+
$crypt = isset( $_REQUEST['crypt'] ) ? strip_tags( stripslashes( $_REQUEST['crypt'] ) ) : '';
|
64 |
$list_type = isset( $_REQUEST['list'] ) ? strip_tags( stripslashes( $_REQUEST['list'] ) ) : '';
|
65 |
$onoff = isset( $_REQUEST['onoff'] ) ? strip_tags( stripslashes( $_REQUEST['onoff'] ) ) : '';
|
66 |
+
$user_id = isset( $_REQUEST['user'] ) ? strip_tags( stripslashes( $_REQUEST['user'] ) ) : '';
|
67 |
|
68 |
+
// Check nonce or crypt
|
69 |
+
if ( $nonce ) {
|
70 |
+
if ( ! wp_verify_nonce( $nonce, 'wppa-ntfy-nonce' ) ) {
|
71 |
+
_e( 'Security check failure', 'wp-photo-album-plus' );
|
72 |
+
wppa_exit();
|
73 |
+
}
|
74 |
+
$user_id = wppa_get_user( 'id' );
|
75 |
+
}
|
76 |
+
elseif( $crypt ) {
|
77 |
+
$user = get_user_by( 'ID', $user_id );
|
78 |
+
if ( $user ) {
|
79 |
+
if ( $crypt != crypt( $list_type . $user->ID . $user->login_name, $user->display_name ) ) {
|
80 |
+
_e( 'Security check failure', 'wp-photo-album-plus' );
|
81 |
+
wppa_exit();
|
82 |
+
}
|
83 |
+
}
|
84 |
+
}
|
85 |
+
else {
|
86 |
_e( 'Security check failure', 'wp-photo-album-plus' );
|
87 |
wppa_exit();
|
88 |
}
|
89 |
|
90 |
// Existing list type?
|
91 |
+
if ( ! in_array( $list_type, array( 'newalbumnotify',
|
92 |
+
'feuploadnotify',
|
93 |
'photoapproved',
|
94 |
'commentnotify',
|
95 |
'commentapproved',
|
113 |
|
114 |
// Dispatch on list type
|
115 |
switch( $list_type ) {
|
116 |
+
case 'newalbumnotify':
|
117 |
+
case 'feuploadnotify':
|
118 |
case 'photoapproved':
|
119 |
+
case 'commentnotify':
|
120 |
case 'commentapproved':
|
121 |
case 'commentprevious':
|
122 |
case 'moderatephoto':
|
123 |
case 'moderatecomment':
|
124 |
|
125 |
if ( $onoff == 'on' ) {
|
126 |
+
$userarray[] = $user_id;
|
127 |
$msg = __( 'You have been added to this mailinglist', 'wp-photo-album-plus' );
|
128 |
}
|
129 |
else {
|
130 |
+
$userarray = array_diff( $userarray, array( $user_id ) );
|
131 |
$msg = __( 'You have been removed from this mailinglist', 'wp-photo-album-plus' );
|
132 |
+
|
133 |
+
// If unsubscribe link from email. format output
|
134 |
+
if ( $crypt ) {
|
135 |
+
$msg = '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" ><body><div style="margin:auto;" ><h2>' . $msg . '</h2></div></body></html>';
|
136 |
+
}
|
137 |
}
|
138 |
$mailinglist = wppa_index_array_to_string( $userarray );
|
139 |
update_option( 'wppa_mailinglist_' . $list_type, $mailinglist );
|
495 |
$iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
|
496 |
SET status = 'publish'
|
497 |
WHERE id = %d", $pid ) );
|
498 |
+
if ( $iret ) {
|
499 |
+
wppa_flush_upldr_cache( 'photoid', $pid );
|
500 |
+
$alb = $wpdb->get_var( $wpdb->prepare( "SELECT album FROM $wpdb->wppa_photos
|
501 |
+
WHERE id = %d", $pid ) );
|
502 |
+
wppa_clear_taglist();
|
503 |
+
wppa_invalidate_treecounts( $alb );
|
504 |
+
wppa_schedule_mailinglist( 'photoapproved', $alb, $pid );
|
505 |
+
}
|
506 |
}
|
507 |
|
508 |
if ( $cid && current_user_can( 'wppa_moderate' ) ) {
|
510 |
SET status = 'approved'
|
511 |
WHERE id = %d", $cid ) );
|
512 |
if ( $iret ) {
|
513 |
+
wppa_schedule_mailinglist( 'commentapproved', 0, 0, $cid );
|
514 |
wppa_add_credit_points( wppa_opt( 'cp_points_comment_appr' ),
|
515 |
__( 'Photo comment approved' , 'wp-photo-album-plus'),
|
516 |
$pid,
|
519 |
);
|
520 |
}
|
521 |
}
|
522 |
+
|
523 |
if ( $iret ) {
|
524 |
+
if ( wppa_switch( 'search_comments' ) ) {
|
525 |
wppa_update_photo( $id );
|
526 |
}
|
527 |
echo 'OK';
|
1638 |
|
1639 |
if ( $iret !== false ) {
|
1640 |
if ( $comstat == 'approved' ) {
|
1641 |
+
wppa_schedule_mailinglist( 'commentapproved', 0, 0, $comid );
|
1642 |
wppa_add_credit_points( wppa_opt( 'cp_points_comment_appr' ),
|
1643 |
__( 'Photo comment approved' , 'wp-photo-album-plus'),
|
1644 |
$photo,
|
2142 |
case 'status':
|
2143 |
if ( ! current_user_can( 'wppa_moderate' ) && ! current_user_can( 'wppa_admin' ) ) die( 'Security check failure #78' );
|
2144 |
wppa_invalidate_treecounts( wppa_get_photo_item( $photo, 'album' ) );
|
2145 |
+
if ( wppa_get_photo_item( $photo, 'status' ) == 'pending' && $value == 'publish' ) {
|
2146 |
+
wppa_schedule_mailinglist( 'photoapproved', 0, $photo );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2147 |
}
|
2148 |
$itemname = __( 'Status', 'wp-photo-album-plus');
|
2149 |
break;
|
3034 |
wppa_update_option( 'wppa_owner_only', 'yes' );
|
3035 |
wppa_update_option( 'wppa_upload_moderate', 'yes' );
|
3036 |
wppa_update_option( 'wppa_upload_edit', 'new' );
|
3037 |
+
wppa_update_option( 'wppa_feuploadnotify', 'yes' );
|
3038 |
wppa_update_option( 'wppa_grant_an_album', 'yes' );
|
3039 |
$grantparent = wppa_opt( 'grant_parent' );
|
3040 |
if ( ! wppa_album_exists( $grantparent ) ) {
|
3073 |
case 'wppa_i_comment':
|
3074 |
if ( $value == 'yes' ) {
|
3075 |
wppa_update_option( 'wppa_show_comments', 'yes' );
|
3076 |
+
wppa_update_option( 'wppa_moderate_comment', 'all' );
|
3077 |
+
wppa_update_option( 'wppa_commentnotify', 'admin' );
|
3078 |
}
|
3079 |
if ( $value == 'no' ) {
|
3080 |
wppa_update_option( 'wppa_show_comments', 'no' );
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -2633,6 +2633,7 @@ static $albums_granted;
|
|
2633 |
'path' => wppa_switch( 'hier_albsel' ),
|
2634 |
'checkarray' => count( $alb ) > 1,
|
2635 |
'array' => $alb,
|
|
|
2636 |
) ) .
|
2637 |
'</select>' .
|
2638 |
'<div style="clear:both;" ></div>';
|
@@ -2758,7 +2759,7 @@ static $albums_granted;
|
|
2758 |
}
|
2759 |
|
2760 |
// Explanation
|
2761 |
-
if ( wppa_switch( 'upload_one_only' ) ) {
|
2762 |
$max = 1;
|
2763 |
}
|
2764 |
// if ( ! wppa_switch( 'upload_one_only' ) ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 7.0.00
|
7 |
*
|
8 |
*/
|
9 |
|
2633 |
'path' => wppa_switch( 'hier_albsel' ),
|
2634 |
'checkarray' => count( $alb ) > 1,
|
2635 |
'array' => $alb,
|
2636 |
+
'sort' => true,
|
2637 |
) ) .
|
2638 |
'</select>' .
|
2639 |
'<div style="clear:both;" ></div>';
|
2759 |
}
|
2760 |
|
2761 |
// Explanation
|
2762 |
+
if ( wppa_switch( 'upload_one_only' ) && ! wppa_user_is( 'administrator' ) ) {
|
2763 |
$max = 1;
|
2764 |
}
|
2765 |
// if ( ! wppa_switch( 'upload_one_only' ) ) {
|
wppa-comment-admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all comments
|
6 |
-
* Version
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -239,7 +239,7 @@ class WPPA_Comment_table extends WP_List_Table {
|
|
239 |
$iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_comments SET status = 'approved' WHERE id = %s", $id ) );
|
240 |
|
241 |
if ( $iret ) {
|
242 |
-
|
243 |
$photo = $wpdb->get_var( $wpdb->prepare( "SELECT photo FROM $wpdb->wppa_comments WHERE id = %s", $id ) );
|
244 |
wppa_add_credit_points( wppa_opt( 'cp_points_comment_appr' ), __( 'Photo comment approved' , 'wp-photo-album-plus'), $photo, '', wppa_get_photo_item( $photo, 'owner' ) );
|
245 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all comments
|
6 |
+
* Version 7.0.00
|
7 |
*
|
8 |
*/
|
9 |
|
239 |
$iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_comments SET status = 'approved' WHERE id = %s", $id ) );
|
240 |
|
241 |
if ( $iret ) {
|
242 |
+
wppa_schedule_mailinglist( 'commentapproved', 0, 0, $id );
|
243 |
$photo = $wpdb->get_var( $wpdb->prepare( "SELECT photo FROM $wpdb->wppa_comments WHERE id = %s", $id ) );
|
244 |
wppa_add_credit_points( wppa_opt( 'cp_points_comment_appr' ), __( 'Photo comment approved' , 'wp-photo-album-plus'), $photo, '', wppa_get_photo_item( $photo, 'owner' ) );
|
245 |
}
|
wppa-cron.php
CHANGED
@@ -199,11 +199,13 @@ global $wpdb;
|
|
199 |
// Re-animate crashed cronjobs
|
200 |
wppa_re_animate_cron();
|
201 |
|
|
|
202 |
// Find lost photos, update their album to -9, meaning trashed
|
203 |
$album_ids = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums" );
|
204 |
if ( ! empty( $album_ids ) ) {
|
205 |
$lost = $wpdb->query( "UPDATE $wpdb->wppa_photos SET album = '-9' WHERE album > '0' AND album NOT IN ( " . implode( ',', $album_ids ) . " ) " );
|
206 |
}
|
|
|
207 |
|
208 |
// Remove 'deleted' photos from system
|
209 |
$dels = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_photos WHERE album <= '-9' AND modified < " . ( time() - 3600 ) );
|
@@ -252,9 +254,11 @@ global $wpdb;
|
|
252 |
update_option( 'wppa_failed_mails', $failed_mails );
|
253 |
}
|
254 |
|
|
|
255 |
// Cleanup iptc and exif
|
256 |
wppa_iptc_clean_garbage();
|
257 |
wppa_exif_clean_garbage();
|
|
|
258 |
|
259 |
// Cleanup qr cache
|
260 |
if ( wppa_is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
|
@@ -268,12 +272,49 @@ global $wpdb;
|
|
268 |
}
|
269 |
}
|
270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} completed.' );
|
272 |
|
273 |
$outbuf = ob_get_clean();
|
274 |
if ( $outbuf ) {
|
275 |
wppa_log( 'dbg', 'Cron unexpected output: ' . $outbuf );
|
276 |
}
|
|
|
277 |
}
|
278 |
|
279 |
// Selectively clear caches
|
@@ -286,8 +327,13 @@ function wppa_schedule_clear_cache( $time = 10 ) {
|
|
286 |
return;
|
287 |
}
|
288 |
|
289 |
-
// If a cron job is scheduled
|
290 |
$next_scheduled = wp_next_scheduled( 'wppa_clear_cache' );
|
|
|
|
|
|
|
|
|
|
|
291 |
if ( $time == 10 && is_numeric( $next_scheduled ) && $next_scheduled > ( time() + $time ) ) {
|
292 |
|
293 |
wp_unschedule_event( $next_scheduled, 'wppa_clear_cache' );
|
@@ -296,13 +342,14 @@ function wppa_schedule_clear_cache( $time = 10 ) {
|
|
296 |
else {
|
297 |
$did_unschedule = false;
|
298 |
}
|
|
|
299 |
|
300 |
// Schedule new event
|
301 |
if ( ! wp_next_scheduled( 'wppa_clear_cache' ) ) {
|
302 |
|
303 |
wp_schedule_single_event( time() + $time, 'wppa_clear_cache' );
|
304 |
|
305 |
-
wppa_log( 'Cron', '{b}wppa_clear_cache{/b}
|
306 |
}
|
307 |
}
|
308 |
|
199 |
// Re-animate crashed cronjobs
|
200 |
wppa_re_animate_cron();
|
201 |
|
202 |
+
/*
|
203 |
// Find lost photos, update their album to -9, meaning trashed
|
204 |
$album_ids = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums" );
|
205 |
if ( ! empty( $album_ids ) ) {
|
206 |
$lost = $wpdb->query( "UPDATE $wpdb->wppa_photos SET album = '-9' WHERE album > '0' AND album NOT IN ( " . implode( ',', $album_ids ) . " ) " );
|
207 |
}
|
208 |
+
*/
|
209 |
|
210 |
// Remove 'deleted' photos from system
|
211 |
$dels = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_photos WHERE album <= '-9' AND modified < " . ( time() - 3600 ) );
|
254 |
update_option( 'wppa_failed_mails', $failed_mails );
|
255 |
}
|
256 |
|
257 |
+
/*
|
258 |
// Cleanup iptc and exif
|
259 |
wppa_iptc_clean_garbage();
|
260 |
wppa_exif_clean_garbage();
|
261 |
+
*/
|
262 |
|
263 |
// Cleanup qr cache
|
264 |
if ( wppa_is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
|
272 |
}
|
273 |
}
|
274 |
|
275 |
+
// Add new users to default mailing list subscriptions
|
276 |
+
if ( wppa_opt( 'mailinglist_policy' ) == 'opt-out' ) {
|
277 |
+
$ini = ini_get( 'max_execution_time' );
|
278 |
+
if ( ! $ini ) {
|
279 |
+
$ini = 30;
|
280 |
+
}
|
281 |
+
$endtime = time() + $ini - 5;
|
282 |
+
|
283 |
+
$from = get_option( 'wppa_mailinglist_highest_user_auto_subscribed', 0 );
|
284 |
+
$to = $wpdb->get_var( "SELECT ID from {$wpdb->users} ORDER BY ID DESC LIMIT 1" );
|
285 |
+
if ( $to > $from ) {
|
286 |
+
$i = $from + 1;
|
287 |
+
$mailings = array( 'newalbumnotify',
|
288 |
+
'feuploadnotify',
|
289 |
+
'commentnotify',
|
290 |
+
'commentprevious',
|
291 |
+
'moderatephoto',
|
292 |
+
'moderatecomment',
|
293 |
+
'photoapproved',
|
294 |
+
'commentapproved',
|
295 |
+
);
|
296 |
+
|
297 |
+
while ( $i <= $to && time() < $endtime ) {
|
298 |
+
foreach( $mailings as $list ) {
|
299 |
+
if ( substr( $list, 0, 8 ) != 'moderate' || user_can( $i, 'wppa_moderate' ) ) {
|
300 |
+
wppa_subscribe_user( $i, $list );
|
301 |
+
// wppa_log( 'Cron', 'User ' . $i . ' added to mailinglist ' . $list );
|
302 |
+
}
|
303 |
+
}
|
304 |
+
$i++;
|
305 |
+
}
|
306 |
+
wppa_log( 'Eml', $to - $from . ' users added to mailinlists' );
|
307 |
+
update_option( 'wppa_mailinglist_highest_user_auto_subscribed', $to );
|
308 |
+
}
|
309 |
+
}
|
310 |
+
|
311 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} completed.' );
|
312 |
|
313 |
$outbuf = ob_get_clean();
|
314 |
if ( $outbuf ) {
|
315 |
wppa_log( 'dbg', 'Cron unexpected output: ' . $outbuf );
|
316 |
}
|
317 |
+
|
318 |
}
|
319 |
|
320 |
// Selectively clear caches
|
327 |
return;
|
328 |
}
|
329 |
|
330 |
+
// If a cron job is scheduled cancel the request
|
331 |
$next_scheduled = wp_next_scheduled( 'wppa_clear_cache' );
|
332 |
+
|
333 |
+
if ( $next_scheduled ) {
|
334 |
+
return;
|
335 |
+
}
|
336 |
+
/*
|
337 |
if ( $time == 10 && is_numeric( $next_scheduled ) && $next_scheduled > ( time() + $time ) ) {
|
338 |
|
339 |
wp_unschedule_event( $next_scheduled, 'wppa_clear_cache' );
|
342 |
else {
|
343 |
$did_unschedule = false;
|
344 |
}
|
345 |
+
*/
|
346 |
|
347 |
// Schedule new event
|
348 |
if ( ! wp_next_scheduled( 'wppa_clear_cache' ) ) {
|
349 |
|
350 |
wp_schedule_single_event( time() + $time, 'wppa_clear_cache' );
|
351 |
|
352 |
+
wppa_log( 'Cron', '{b}wppa_clear_cache{/b} scheduled for run in ' . $time . ' sec.' );
|
353 |
}
|
354 |
}
|
355 |
|
wppa-functions.php
CHANGED
@@ -2407,7 +2407,7 @@ global $wppa_done;
|
|
2407 |
$save_comment = str_replace( "\n", '<br />', $comment ); // Resque newline chars
|
2408 |
$save_comment = stripslashes( $save_comment );
|
2409 |
|
2410 |
-
$policy = wppa_opt( '
|
2411 |
switch ( $policy ) {
|
2412 |
case 'all':
|
2413 |
$status = 'pending';
|
@@ -2504,7 +2504,7 @@ global $wppa_done;
|
|
2504 |
else {
|
2505 |
|
2506 |
if ( $cedit ) {
|
2507 |
-
if ( wppa_switch( '
|
2508 |
echo( '<script id="cme" type="text/javascript">alert( "'.__( 'Comment edited' , 'wp-photo-album-plus').'" );jQuery( "#cme" ).html( "" );</script>' );
|
2509 |
}
|
2510 |
}
|
@@ -2532,7 +2532,7 @@ global $wppa_done;
|
|
2532 |
}
|
2533 |
|
2534 |
// SEND EMAILS
|
2535 |
-
|
2536 |
|
2537 |
/*
|
2538 |
|
@@ -2566,10 +2566,10 @@ global $wppa_done;
|
|
2566 |
'</a>';
|
2567 |
|
2568 |
// Process various types of emails
|
2569 |
-
if ( is_numeric( wppa_opt( '
|
2570 |
|
2571 |
// Mail specific user
|
2572 |
-
$moduser = get_userdata( wppa_opt( '
|
2573 |
$to = $moduser->user_email;
|
2574 |
if ( user_can( $moduser, 'wppa_comments' ) ) $cont['3'] = $cont2; else $cont['3'] = '';
|
2575 |
if ( user_can( $moduser, 'wppa_admin' ) ) $cont['4'] = $cont3; else $cont['4'] = '';
|
@@ -2583,7 +2583,7 @@ global $wppa_done;
|
|
2583 |
// Remember if we sent him or skipped him because its his own comment
|
2584 |
$sentto[] = $moduser->user_login;
|
2585 |
}
|
2586 |
-
if ( wppa_opt( '
|
2587 |
|
2588 |
// Mail admin
|
2589 |
$moduser = wppa_get_user_by( 'id', '1' );
|
@@ -2604,7 +2604,7 @@ global $wppa_done;
|
|
2604 |
$sentto[] = $moduser->user_login;
|
2605 |
}
|
2606 |
}
|
2607 |
-
if ( wppa_opt( '
|
2608 |
|
2609 |
// Mail uploader
|
2610 |
$uploader = $wpdb->get_var( $wpdb->prepare( "SELECT owner FROM $wpdb->wppa_photos WHERE id = %d", $id ) );
|
@@ -2626,7 +2626,7 @@ global $wppa_done;
|
|
2626 |
}
|
2627 |
}
|
2628 |
}
|
2629 |
-
if ( wppa_opt( '
|
2630 |
// Mail album owner
|
2631 |
$alb = $wpdb->get_var( $wpdb->prepare( "SELECT album FROM $wpdb->wppa_photos WHERE id = %d", $id ) );
|
2632 |
$owner = $wpdb->get_var( $wpdb->prepare( "SELECT owner FROM $wpdb->wppa_albums WHERE id = %d", $alb ) );
|
@@ -2645,7 +2645,7 @@ global $wppa_done;
|
|
2645 |
$sentto[] = $moduser->user_login;
|
2646 |
}
|
2647 |
}
|
2648 |
-
if ( wppa_switch( '
|
2649 |
// Mail users already commented on this photo
|
2650 |
$cmnts = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments WHERE photo = %d", $photo ), ARRAY_A );
|
2651 |
if ( $cmnts ) foreach( $cmnts as $cmnt ) {
|
@@ -2686,8 +2686,8 @@ global $wppa_done;
|
|
2686 |
if ( $iret ) wppa_rate_photo( $id ); // Recalc ratings for this photo
|
2687 |
// }
|
2688 |
|
2689 |
-
//
|
2690 |
-
if ( wppa_switch( '
|
2691 |
echo( '<script id="cme" type="text/javascript">alert( "'.__( 'Comment added' , 'wp-photo-album-plus').'" );jQuery( "#cme" ).html( "" );</script>' );
|
2692 |
}
|
2693 |
}
|
@@ -4886,25 +4886,7 @@ global $wppa_alert;
|
|
4886 |
wppa_check_coverimage( $id );
|
4887 |
|
4888 |
// Mail
|
4889 |
-
|
4890 |
-
$to = get_bloginfo( 'admin_email' );
|
4891 |
-
$subj = sprintf( __( 'New photo uploaded: %s' , 'wp-photo-album-plus'), $name );
|
4892 |
-
$cont['0'] = sprintf( __( 'User %1$s uploaded photo %2$s into album %3$s' , 'wp-photo-album-plus'), wppa_get_user(), $id, wppa_get_album_name( $alb ) );
|
4893 |
-
if ( wppa_switch( 'upload_moderate' ) && !current_user_can( 'wppa_admin' ) ) {
|
4894 |
-
$cont['1'] = __( 'This upload requires moderation' , 'wp-photo-album-plus');
|
4895 |
-
$cont['2'] = '<a href="'.get_admin_url().'admin.php?page=wppa_admin_menu&tab=pmod&photo='.$id.'" >'.__( 'Moderate manage photo' , 'wp-photo-album-plus').'</a>';
|
4896 |
-
}
|
4897 |
-
else {
|
4898 |
-
$cont['1'] = __( 'Details:' , 'wp-photo-album-plus');
|
4899 |
-
$cont['1'] .= ' <a href="'.get_admin_url().'admin.php?page=wppa_admin_menu&tab=pmod&photo='.$id.'" >'.__( 'Manage photo' , 'wp-photo-album-plus').'</a>';
|
4900 |
-
}
|
4901 |
-
wppa_send_mail( array( 'to' => $to,
|
4902 |
-
'subj' => $subj,
|
4903 |
-
'cont' => $cont,
|
4904 |
-
'photo' => $id,
|
4905 |
-
'listtype' => 'feupload',
|
4906 |
-
));
|
4907 |
-
}
|
4908 |
|
4909 |
// Do pdf postprocessing
|
4910 |
wppa_pdf_postprocess( $id );
|
@@ -5247,7 +5229,7 @@ function wppa_check_comment( $user, $email, $comment ) {
|
|
5247 |
global $wpdb;
|
5248 |
|
5249 |
// If manual moderation is enabled, skip all checks and return 'pending'.
|
5250 |
-
if ( 1 == get_option( '
|
5251 |
wppa_log( 'Com', 'Comment {i}' . $comment . '{/i} held for moderation (1)' );
|
5252 |
return 'pending';
|
5253 |
}
|
2407 |
$save_comment = str_replace( "\n", '<br />', $comment ); // Resque newline chars
|
2408 |
$save_comment = stripslashes( $save_comment );
|
2409 |
|
2410 |
+
$policy = wppa_opt( 'moderate_comment' );
|
2411 |
switch ( $policy ) {
|
2412 |
case 'all':
|
2413 |
$status = 'pending';
|
2504 |
else {
|
2505 |
|
2506 |
if ( $cedit ) {
|
2507 |
+
if ( wppa_switch( 'commentnotify_added' ) ) {
|
2508 |
echo( '<script id="cme" type="text/javascript">alert( "'.__( 'Comment edited' , 'wp-photo-album-plus').'" );jQuery( "#cme" ).html( "" );</script>' );
|
2509 |
}
|
2510 |
}
|
2532 |
}
|
2533 |
|
2534 |
// SEND EMAILS
|
2535 |
+
wppa_schedule_mailinglist( 'commentnotify', 0, $photo, $key, wppa_get_post( 'returnurl' ) );
|
2536 |
|
2537 |
/*
|
2538 |
|
2566 |
'</a>';
|
2567 |
|
2568 |
// Process various types of emails
|
2569 |
+
if ( is_numeric( wppa_opt( 'commentnotify' ) ) ) {
|
2570 |
|
2571 |
// Mail specific user
|
2572 |
+
$moduser = get_userdata( wppa_opt( 'commentnotify' ) );
|
2573 |
$to = $moduser->user_email;
|
2574 |
if ( user_can( $moduser, 'wppa_comments' ) ) $cont['3'] = $cont2; else $cont['3'] = '';
|
2575 |
if ( user_can( $moduser, 'wppa_admin' ) ) $cont['4'] = $cont3; else $cont['4'] = '';
|
2583 |
// Remember if we sent him or skipped him because its his own comment
|
2584 |
$sentto[] = $moduser->user_login;
|
2585 |
}
|
2586 |
+
if ( wppa_opt( 'commentnotify' ) == 'admin' || wppa_opt( 'commentnotify' ) == 'both' || wppa_opt( 'commentnotify' ) == 'upadmin' ) {
|
2587 |
|
2588 |
// Mail admin
|
2589 |
$moduser = wppa_get_user_by( 'id', '1' );
|
2604 |
$sentto[] = $moduser->user_login;
|
2605 |
}
|
2606 |
}
|
2607 |
+
if ( wppa_opt( 'commentnotify' ) == 'upload' || wppa_opt( 'commentnotify' ) == 'upadmin' || wppa_opt( 'commentnotify' ) == 'upowner' ) {
|
2608 |
|
2609 |
// Mail uploader
|
2610 |
$uploader = $wpdb->get_var( $wpdb->prepare( "SELECT owner FROM $wpdb->wppa_photos WHERE id = %d", $id ) );
|
2626 |
}
|
2627 |
}
|
2628 |
}
|
2629 |
+
if ( wppa_opt( 'commentnotify' ) == 'owner' || wppa_opt( 'commentnotify' ) == 'both' || wppa_opt( 'commentnotify' ) == 'upowner' ) {
|
2630 |
// Mail album owner
|
2631 |
$alb = $wpdb->get_var( $wpdb->prepare( "SELECT album FROM $wpdb->wppa_photos WHERE id = %d", $id ) );
|
2632 |
$owner = $wpdb->get_var( $wpdb->prepare( "SELECT owner FROM $wpdb->wppa_albums WHERE id = %d", $alb ) );
|
2645 |
$sentto[] = $moduser->user_login;
|
2646 |
}
|
2647 |
}
|
2648 |
+
if ( wppa_switch( 'commentprevious' ) ) {
|
2649 |
// Mail users already commented on this photo
|
2650 |
$cmnts = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments WHERE photo = %d", $photo ), ARRAY_A );
|
2651 |
if ( $cmnts ) foreach( $cmnts as $cmnt ) {
|
2686 |
if ( $iret ) wppa_rate_photo( $id ); // Recalc ratings for this photo
|
2687 |
// }
|
2688 |
|
2689 |
+
// Notify user
|
2690 |
+
if ( wppa_switch( 'commentnotify_added' ) ) {
|
2691 |
echo( '<script id="cme" type="text/javascript">alert( "'.__( 'Comment added' , 'wp-photo-album-plus').'" );jQuery( "#cme" ).html( "" );</script>' );
|
2692 |
}
|
2693 |
}
|
4886 |
wppa_check_coverimage( $id );
|
4887 |
|
4888 |
// Mail
|
4889 |
+
wppa_schedule_mailinglist( 'feuploadnotify', 0, $id, 0, '', wppa_get_user() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4890 |
|
4891 |
// Do pdf postprocessing
|
4892 |
wppa_pdf_postprocess( $id );
|
5229 |
global $wpdb;
|
5230 |
|
5231 |
// If manual moderation is enabled, skip all checks and return 'pending'.
|
5232 |
+
if ( 1 == get_option( 'moderatecomment' ) ) {
|
5233 |
wppa_log( 'Com', 'Comment {i}' . $comment . '{/i} held for moderation (1)' );
|
5234 |
return 'pending';
|
5235 |
}
|
wppa-import.php
CHANGED
@@ -1154,7 +1154,7 @@ global $wppa_session;
|
|
1154 |
'<b>' .
|
1155 |
wppa_sanitize_file_name( basename( $dir ) ) .
|
1156 |
'</b>';
|
1157 |
-
$subfiles =
|
1158 |
$subdircount = '0';
|
1159 |
if ( $subfiles ) {
|
1160 |
foreach ( $subfiles as $subfile ) {
|
@@ -1625,7 +1625,7 @@ function wppa_get_import_files() {
|
|
1625 |
|
1626 |
// Send emails after backend upload
|
1627 |
function wppa_backend_upload_mail( $id, $alb, $name ) {
|
1628 |
-
|
1629 |
$owner = wppa_get_user();
|
1630 |
if ( $owner == 'admin' ) return; // Admin does not send mails to himself
|
1631 |
|
1154 |
'<b>' .
|
1155 |
wppa_sanitize_file_name( basename( $dir ) ) .
|
1156 |
'</b>';
|
1157 |
+
$subfiles = wppa_glob( $dir.'/*' );
|
1158 |
$subdircount = '0';
|
1159 |
if ( $subfiles ) {
|
1160 |
foreach ( $subfiles as $subfile ) {
|
1625 |
|
1626 |
// Send emails after backend upload
|
1627 |
function wppa_backend_upload_mail( $id, $alb, $name ) {
|
1628 |
+
return;
|
1629 |
$owner = wppa_get_user();
|
1630 |
if ( $owner == 'admin' ) return; // Admin does not send mails to himself
|
1631 |
|
wppa-mailing.php
CHANGED
@@ -8,20 +8,35 @@
|
|
8 |
*
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
add_action( 'wppa_do_mailinglist_cron', 'wppa_do_mailinglist', 10,
|
13 |
|
14 |
// Call this function to schedule a mailinglist emission
|
15 |
-
function wppa_schedule_mailinglist( $type, $time =
|
16 |
|
17 |
-
wp_schedule_single_event( time() + $time, 'wppa_do_mailinglist_cron', array( $type ) );
|
18 |
|
19 |
}
|
20 |
|
21 |
// Send the mails for a mailinglist
|
22 |
-
function wppa_do_mailinglist( $type, $
|
23 |
global $wpdb;
|
24 |
|
|
|
|
|
|
|
|
|
|
|
25 |
// Get mailinglist user ids
|
26 |
$mailinglist = get_option( 'wppa_mailinglist_' . $type, '' );
|
27 |
$userarray = wppa_index_string_to_array( $mailinglist );
|
@@ -31,34 +46,30 @@ global $wpdb;
|
|
31 |
return;
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
34 |
// Dispatch on type of mailinglist
|
35 |
switch( $type ) {
|
36 |
-
case 'newalbum':
|
37 |
-
|
38 |
-
// Get the last added album id
|
39 |
-
$alb = wppa_get_youngest_album_id();
|
40 |
-
|
41 |
-
// If album removed, quit
|
42 |
-
$lastkey = get_option( 'wppa_' . WPPA_ALBUMS . '_lastkey' );
|
43 |
-
if ( $lastkey != $alb ) {
|
44 |
-
return false;
|
45 |
-
}
|
46 |
-
|
47 |
-
// Get the album items we need
|
48 |
-
$name = wppa_get_album_name( $alb );
|
49 |
-
$desc = wppa_get_album_desc( $alb );
|
50 |
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
-
|
55 |
-
|
|
|
56 |
|
57 |
-
|
58 |
-
|
59 |
|
60 |
-
//
|
61 |
-
$
|
62 |
|
63 |
// The content of the mail
|
64 |
$content =
|
@@ -77,68 +88,467 @@ global $wpdb;
|
|
77 |
if ( $link ) {
|
78 |
$content .=
|
79 |
'<br />' .
|
80 |
-
sprintf( __( 'You can see the content %shere%s', 'wp-photo-album-plus' ), '<a href="' . esc_url( $link ) . '" >', '</a>' );
|
81 |
}
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
break;
|
92 |
|
93 |
case 'commentnotify':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
-
|
96 |
-
|
97 |
|
98 |
-
|
99 |
-
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
</blockquote>';
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
'</a>';
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
-
|
116 |
-
|
|
|
|
|
117 |
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
120 |
|
121 |
-
//
|
122 |
-
$
|
123 |
-
|
124 |
-
$cont .= $moderator_content;
|
125 |
}
|
126 |
|
127 |
-
//
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
}
|
137 |
break;
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
default:
|
140 |
wppa_log( 'Err', 'Unimplemented mailinglist type found: ' . $type, true );
|
141 |
}
|
|
|
|
|
|
|
|
|
142 |
}
|
143 |
|
144 |
// Is current user in mailinglist?
|
@@ -170,6 +580,53 @@ function wppa_is_user_in_mailinglist( $usr, $list ) {
|
|
170 |
return ( in_array( $user_id, $userarray ) );
|
171 |
}
|
172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
// Send a mail
|
174 |
function wppa_send_mail( $args ) {
|
175 |
|
@@ -180,6 +637,7 @@ function wppa_send_mail( $args ) {
|
|
180 |
'email' => '',
|
181 |
'listtype' => '',
|
182 |
'replyurl' => '',
|
|
|
183 |
);
|
184 |
$args = wp_parse_args( $args, $defaults );
|
185 |
extract( $args );
|
@@ -231,25 +689,21 @@ function wppa_send_mail( $args ) {
|
|
231 |
$message_part_1 .= '<p>'.$cont.'</p>';
|
232 |
}
|
233 |
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
$
|
238 |
-
$e = $current_user->user_email;
|
239 |
-
$eml = sprintf(__('The visitors email address is: <a href="mailto:%s">%s</a>', 'wp-photo-album-plus'), $e, $e);
|
240 |
-
$message_part_2 .= '<p>'.$eml.'</p>';
|
241 |
-
}
|
242 |
-
elseif ( $email ) {
|
243 |
-
$e = $email;
|
244 |
-
$eml = sprintf(__('The visitor says his email address is: <a href="mailto:%s">%s</a>', 'wp-photo-album-plus'), $e, $e);
|
245 |
$message_part_2 .= '<p>'.$eml.'</p>';
|
246 |
-
}
|
247 |
}
|
248 |
|
249 |
if ( $replyurl ) {
|
250 |
$message_part_2 .= '<a href="' . $replyurl . '" >' . __( 'Reply' , 'wp-photo-album-plus') . '</a>';
|
251 |
}
|
252 |
|
|
|
|
|
|
|
|
|
253 |
$message_part_3 .=
|
254 |
'<p>' .
|
255 |
'<small>' .
|
@@ -285,4 +739,5 @@ function wppa_send_mail( $args ) {
|
|
285 |
'' );
|
286 |
}
|
287 |
|
288 |
-
}
|
|
8 |
*
|
9 |
*/
|
10 |
|
11 |
+
/* The following mailing lists exist:
|
12 |
+
'newalbumnotify',
|
13 |
+
'feuploadnotify',
|
14 |
+
'commentnotify',
|
15 |
+
'commentprevious',
|
16 |
+
'moderatephoto',
|
17 |
+
'moderatecomment',
|
18 |
+
'photoapproved',
|
19 |
+
'commentapproved',
|
20 |
+
*/
|
21 |
|
22 |
+
add_action( 'wppa_do_mailinglist_cron', 'wppa_do_mailinglist', 10, 6 );
|
23 |
|
24 |
// Call this function to schedule a mailinglist emission
|
25 |
+
function wppa_schedule_mailinglist( $type, $alb = 0, $pho = 0, $com = 0, $url = '', $who = '', $time = 120 ) {
|
26 |
|
27 |
+
wp_schedule_single_event( time() + $time, 'wppa_do_mailinglist_cron', array( $type, $alb, $pho, $com, $url, $who ) );
|
28 |
|
29 |
}
|
30 |
|
31 |
// Send the mails for a mailinglist
|
32 |
+
function wppa_do_mailinglist( $type, $alb = 0, $pho = 0, $com = 0, $url = '', $who = '' ) {
|
33 |
global $wpdb;
|
34 |
|
35 |
+
// Mailinglist enabled?
|
36 |
+
if ( ! wppa_switch( $type ) ) {
|
37 |
+
return;
|
38 |
+
}
|
39 |
+
|
40 |
// Get mailinglist user ids
|
41 |
$mailinglist = get_option( 'wppa_mailinglist_' . $type, '' );
|
42 |
$userarray = wppa_index_string_to_array( $mailinglist );
|
46 |
return;
|
47 |
}
|
48 |
|
49 |
+
if ( wppa_is_cron() ) {
|
50 |
+
wppa_log( 'Cron', 'Doing mailing ' . $type . ' for ' . count( $userarray ) . ' recipients' );
|
51 |
+
}
|
52 |
+
|
53 |
// Dispatch on type of mailinglist
|
54 |
switch( $type ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
+
case 'newalbumnotify':
|
57 |
+
{
|
58 |
+
// If album removed, quit
|
59 |
+
$album = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->wppa_albums} WHERE id = %d", $alb ), ARRAY_A );
|
60 |
+
if ( ! $album ) {
|
61 |
+
return;
|
62 |
+
}
|
63 |
|
64 |
+
// Get the album items we need
|
65 |
+
$name = wppa_get_album_name( $alb );
|
66 |
+
$desc = wppa_get_album_desc( $alb );
|
67 |
|
68 |
+
// The blog
|
69 |
+
$blog = get_bloginfo( 'name' );
|
70 |
|
71 |
+
// The callback url if any
|
72 |
+
$link = get_option( 'wppa_mailinglist_callback_url', '' );
|
73 |
|
74 |
// The content of the mail
|
75 |
$content =
|
88 |
if ( $link ) {
|
89 |
$content .=
|
90 |
'<br />' .
|
91 |
+
sprintf( __( 'You can see the content %shere%s', 'wp-photo-album-plus' ), '<a href="' . esc_url( $link . '?album=' . $alb . '&cover=1&occur=1' ) . '" >', '</a>' );
|
92 |
}
|
93 |
|
94 |
+
|
95 |
+
// Process all subscribed users
|
96 |
+
foreach( $userarray as $usr ) {
|
97 |
+
|
98 |
+
// Get the user data
|
99 |
+
$user = get_user_by( 'ID', $usr );
|
100 |
+
|
101 |
+
// Send the mail
|
102 |
+
wppa_send_mail( array( 'to' => $user->user_email,
|
103 |
+
'subj' => __( 'New album created', 'wp-photo-album-plus' ),
|
104 |
+
'cont' => $content,
|
105 |
+
'listtype' => 'newalbumnotify',
|
106 |
+
'unsubscribe' => wppa_unsubscribe_link( $usr, $type ),
|
107 |
+
) );
|
108 |
+
}
|
109 |
+
}
|
110 |
+
break;
|
111 |
+
|
112 |
+
case 'feuploadnotify':
|
113 |
+
{
|
114 |
+
// If moderation required, do the moderatephoto mailing
|
115 |
+
if ( wppa_get_photo_item( $pho, 'status' ) == 'pending' ) {
|
116 |
+
wppa_do_mailinglist( 'moderatephoto', $alb, $pho, $com, $url, $who );
|
117 |
+
return;
|
118 |
+
}
|
119 |
+
|
120 |
+
// The subject
|
121 |
+
$subj = sprintf( __( 'New photo uploaded: %s' , 'wp-photo-album-plus'), wppa_get_photo_item( $pho, 'name' ) );
|
122 |
+
|
123 |
+
// The photo owner
|
124 |
+
$owner = get_user_by( 'login', wppa_get_photo_item( $pho, 'owner' ) );
|
125 |
+
|
126 |
+
// The album
|
127 |
+
if ( ! $alb ) {
|
128 |
+
$alb = wppa_get_photo_item( $pho, 'album' );
|
129 |
+
}
|
130 |
+
|
131 |
+
// The callback url if any
|
132 |
+
$link = get_option( 'wppa_mailinglist_callback_url', '' );
|
133 |
+
|
134 |
+
// The content
|
135 |
+
$cont = sprintf( __( 'User %1$s uploaded photo %2$s into album %3$s' , 'wp-photo-album-plus' ), $owner->display_name, $pho, wppa_get_album_name( $alb ) );
|
136 |
+
|
137 |
+
// Preview
|
138 |
+
if ( $link ) {
|
139 |
+
$cont .= '<br />' . sprintf( __( 'You can see the photo %shere%s', 'wp-photo-album-plus' ), '<a href="' . esc_url( $link . '?album=' . $alb . '&photo=' . $pho . '&occur=1' ) . '" >', '</a>' );
|
140 |
+
}
|
141 |
+
|
142 |
+
// Process all subscribed users
|
143 |
+
foreach( $userarray as $usr ) {
|
144 |
+
|
145 |
+
// Get the user data
|
146 |
+
$user = get_user_by( 'ID', $usr );
|
147 |
+
|
148 |
+
// If user exists, mail
|
149 |
+
if ( $user ) {
|
150 |
+
wppa_send_mail( array( 'to' => $user->user_email,
|
151 |
+
'subj' => $subj,
|
152 |
+
'cont' => $cont,
|
153 |
+
'photo' => $pho,
|
154 |
+
'listtype' => $type,
|
155 |
+
'unsubscribe' => wppa_unsubscribe_link( $usr, $type ),
|
156 |
+
));
|
157 |
+
}
|
158 |
+
}
|
159 |
}
|
160 |
break;
|
161 |
|
162 |
case 'commentnotify':
|
163 |
+
{
|
164 |
+
// Get the comment
|
165 |
+
$comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->wppa_comments} WHERE id = %d", $com ), ARRAY_A );
|
166 |
+
|
167 |
+
// Get the photo id
|
168 |
+
if ( ! $pho ) {
|
169 |
+
$pho = $comment['photo'];
|
170 |
+
}
|
171 |
+
|
172 |
+
// Get the photos album
|
173 |
+
if ( ! $alb ) {
|
174 |
+
$alb = wppa_get_photo_item( $pho, 'album' );
|
175 |
+
}
|
176 |
+
|
177 |
+
// If moderation required, do the moderatecomment mailing
|
178 |
+
if ( $comment['status'] == 'pending' ) {
|
179 |
+
wppa_do_mailinglist( 'moderatecomment', $alb, $pho, $com, $url, $who );
|
180 |
+
return;
|
181 |
+
}
|
182 |
+
|
183 |
+
// Subject
|
184 |
+
$subj = sprintf( __( 'Comment on photo %s' , 'wp-photo-album-plus' ), wppa_get_photo_name( $comment['photo'] ) );
|
185 |
+
|
186 |
+
// The callback url if any
|
187 |
+
$link = get_option( 'wppa_mailinglist_callback_url', '' );
|
188 |
+
|
189 |
+
// The author
|
190 |
+
$author = get_user_by( 'login', $comment['user'] );
|
191 |
+
if ( $author ) {
|
192 |
+
$aut = $author->display_name;
|
193 |
+
}
|
194 |
+
else {
|
195 |
+
$aut = $comment['user'];
|
196 |
+
}
|
197 |
+
|
198 |
+
// The content
|
199 |
+
$cont = $aut . ' ' . __( 'wrote on photo' , 'wp-photo-album-plus') . ' ' . wppa_get_photo_name( $comment['photo'] ) . ':' .
|
200 |
+
'<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" >
|
201 |
+
<em> ' . stripslashes( $comment['comment'] ) . '</em>
|
202 |
+
</blockquote>';
|
203 |
+
|
204 |
+
// Preview
|
205 |
+
if ( $link ) {
|
206 |
+
$cont .= '<br />' . sprintf( __( 'You can see the photo %shere%s', 'wp-photo-album-plus' ), '<a href="' . esc_url( $link . '?album=' . $alb . '&photo=' . $pho . '&occur=1' ) . '" >', '</a>' );
|
207 |
+
}
|
208 |
+
|
209 |
+
// Process all subscribed users
|
210 |
+
foreach( $userarray as $usr ) {
|
211 |
+
|
212 |
+
// Get the user data
|
213 |
+
$user = get_user_by( 'ID', $usr );
|
214 |
+
|
215 |
+
// If user exists, mail
|
216 |
+
if ( $user ) {
|
217 |
+
wppa_send_mail( array( 'to' => $user->user_email,
|
218 |
+
'subj' => $subj,
|
219 |
+
'cont' => $cont,
|
220 |
+
'photo' => $pho,
|
221 |
+
'listtype' => $type,
|
222 |
+
'unsubscribe' => wppa_unsubscribe_link( $usr, $type ),
|
223 |
+
));
|
224 |
+
}
|
225 |
+
}
|
226 |
+
|
227 |
+
// Now do the 'commentprevious' mailing
|
228 |
+
wppa_schedule_mailinglist( 'commentprevious', 0, 0, $com );
|
229 |
+
}
|
230 |
+
break;
|
231 |
+
|
232 |
+
case 'photoapproved':
|
233 |
+
{
|
234 |
+
// To who?
|
235 |
+
$user = get_user_by( 'login', wppa_get_photo_item( $pho, 'owner' ) );
|
236 |
+
if ( ! $user ) {
|
237 |
+
return;
|
238 |
+
}
|
239 |
+
$usr = $user->ID;
|
240 |
|
241 |
+
// The callback url if any
|
242 |
+
$link = get_option( 'wppa_mailinglist_callback_url', '' );
|
243 |
|
244 |
+
// Did user subscribe?
|
245 |
+
if ( wppa_is_user_in_mailinglist( $user->ID, 'photoapproved' ) ) {
|
246 |
|
247 |
+
$to = $user->user_email;
|
248 |
+
$subj = __( 'Photo approved', 'wp-photo-album-plus' );
|
249 |
+
$cont = sprintf( __( 'Your recently uploaded photo %s in album %s has been approved', 'wp-photo-album-plus' ),
|
250 |
+
'<b>' . wppa_get_photo_item( $pho, 'name' ) . '</b>',
|
251 |
+
'<b>' . wppa_get_album_name( wppa_get_photo_item( $pho, 'album' ) ) . '</b>' );
|
|
|
252 |
|
253 |
+
// Preview
|
254 |
+
if ( $link ) {
|
255 |
+
$cont .= '<br />' . sprintf( __( 'You can see the photo %shere%s', 'wp-photo-album-plus' ), '<a href="' . esc_url( $link . '?album=' . $alb . '&photo=' . $pho . '&occur=1' ) . '" >', '</a>' );
|
256 |
+
}
|
|
|
257 |
|
258 |
+
wppa_send_mail( array( 'to' => $to,
|
259 |
+
'subj' => $subj,
|
260 |
+
'cont' => $cont,
|
261 |
+
'photo' => $pho,
|
262 |
+
'listtype' => $type,
|
263 |
+
'unsubscribe' => wppa_unsubscribe_link( $usr, $type ),
|
264 |
+
));
|
265 |
+
}
|
266 |
|
267 |
+
// Now the photo is approved, we can mail 'feuploadnotify'
|
268 |
+
wppa_schedule_mailinglist( 'feuploadnotify', 0, $pho );
|
269 |
+
}
|
270 |
+
break;
|
271 |
|
272 |
+
// A comment on my photo is approved or my comment is approved
|
273 |
+
case 'commentapproved':
|
274 |
+
{
|
275 |
+
// Get the comment
|
276 |
+
$comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->wppa_comments} WHERE id = %d", $com ), ARRAY_A );
|
277 |
|
278 |
+
// The photo
|
279 |
+
if ( ! $pho ) {
|
280 |
+
$pho = $comment['photo'];
|
|
|
281 |
}
|
282 |
|
283 |
+
// Find the owner of the photo
|
284 |
+
$owner = wppa_get_photo_item( $pho, 'owner' );
|
285 |
+
|
286 |
+
// The author
|
287 |
+
$author = get_user_by( 'login', $comment['user'] );
|
288 |
+
if ( $author ) {
|
289 |
+
$aut = $author->display_name;
|
290 |
+
}
|
291 |
+
else {
|
292 |
+
$aut = $comment['user'];
|
293 |
+
}
|
294 |
+
|
295 |
+
// The callback url if any
|
296 |
+
$link = get_option( 'wppa_mailinglist_callback_url', '' );
|
297 |
+
|
298 |
+
// Send the owner of the photo the mail if he is in the mailinglist
|
299 |
+
if ( wppa_is_user_in_mailinglist( $owner, $type ) ) {
|
300 |
+
|
301 |
+
// Get the user data
|
302 |
+
$user = get_user_by( 'login', $owner );
|
303 |
+
$usr = $user->ID;
|
304 |
+
|
305 |
+
// If user still exists...
|
306 |
+
if ( $user ) {
|
307 |
+
|
308 |
+
$cont =
|
309 |
+
$aut . ' ' . __( 'wrote on photo' , 'wp-photo-album-plus' ) . ' ' . wppa_get_photo_name( $comment['photo'] ) . ':' .
|
310 |
+
'<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" >
|
311 |
+
<em> ' . stripslashes( $comment['comment'] ) . '</em>
|
312 |
+
</blockquote>';
|
313 |
+
|
314 |
+
// Preview
|
315 |
+
if ( $link ) {
|
316 |
+
$cont .= '<br />' . sprintf( __( 'You can see the photo %shere%s', 'wp-photo-album-plus' ), '<a href="' . esc_url( $link . '?album=' . $alb . '&photo=' . $pho . '&occur=1' ) . '" >', '</a>' );
|
317 |
+
}
|
318 |
+
|
319 |
+
wppa_send_mail( array( 'to' => $user->user_email,
|
320 |
+
'subj' => sprintf( __( 'Comment on photo %s appoved' , 'wp-photo-album-plus' ), wppa_get_photo_name( $comment['photo'] ) ),
|
321 |
+
'cont' => $cont,
|
322 |
+
'photo' => $comment['photo'],
|
323 |
+
'replyurl' => $url,
|
324 |
+
'listtype' => $type,
|
325 |
+
'unsubscribe' => wppa_unsubscribe_link( $usr, $type ),
|
326 |
+
));
|
327 |
+
}
|
328 |
+
}
|
329 |
+
|
330 |
+
// Send the author of the comment the mail if he is in the mailinglist
|
331 |
+
if ( $author && wppa_is_user_in_mailinglist( $author->ID, $type ) ) {
|
332 |
+
|
333 |
+
$cont = __( 'You wrote on photo', 'wp-photo-album-plus' ) . ' ' . wppa_get_photo_name( $comment['photo'] ) . ':' .
|
334 |
+
'<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" >
|
335 |
+
<em> ' . stripslashes( $comment['comment'] ) . '</em>
|
336 |
+
</blockquote>';
|
337 |
+
|
338 |
+
// Preview
|
339 |
+
if ( $link ) {
|
340 |
+
$cont .= '<br />' . sprintf( __( 'You can see the photo %shere%s', 'wp-photo-album-plus' ), '<a href="' . esc_url( $link . '?album=' . $alb . '&photo=' . $pho . '&occur=1' ) . '" >', '</a>' );
|
341 |
+
}
|
342 |
+
|
343 |
+
wppa_send_mail( array( 'to' => $author->user_email,
|
344 |
+
'subj' => sprintf( __( 'Your comment on photo %s appoved' , 'wp-photo-album-plus' ), wppa_get_photo_name( $comment['photo'] ) ),
|
345 |
+
'cont' => $cont,
|
346 |
+
'photo' => $comment['photo'],
|
347 |
+
'replyurl' => $url,
|
348 |
+
'listtype' => $type,
|
349 |
+
'unsubscribe' => wppa_unsubscribe_link( $usr, $type ),
|
350 |
+
));
|
351 |
+
|
352 |
+
}
|
353 |
+
|
354 |
+
// Now the comment is approved, we can mail 'commentnotify'
|
355 |
+
wppa_schedule_mailinglist( 'commentnotify', 0, 0, $com );
|
356 |
|
357 |
}
|
358 |
break;
|
359 |
|
360 |
+
case 'commentprevious':
|
361 |
+
{
|
362 |
+
// Get the comment
|
363 |
+
$comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->wppa_comments} WHERE id = %d", $com ), ARRAY_A );
|
364 |
+
|
365 |
+
// Get the photo
|
366 |
+
if ( ! $pho ) {
|
367 |
+
$pho = $comment['photo'];
|
368 |
+
}
|
369 |
+
|
370 |
+
// Get teh author
|
371 |
+
$author = get_user_by( 'login', $comment['user'] );
|
372 |
+
if ( $author ) {
|
373 |
+
$aut = $author->display_name;
|
374 |
+
}
|
375 |
+
else {
|
376 |
+
$aut = $comment['user'];
|
377 |
+
}
|
378 |
+
|
379 |
+
// Get the users who commented on the photo
|
380 |
+
$users = $wpdb->get_col( $wpdb->prepare( "SELECT UNIQUE user FROM {$wpdb->wppa_comments} WHERE photo = %d", $pho ) );
|
381 |
+
|
382 |
+
// If the current author is in the list: remove him, he is most likely already notified
|
383 |
+
if ( isset( $usres[$comment['user']] ) ) {
|
384 |
+
unset( $usres[$comment['user']] );
|
385 |
+
}
|
386 |
+
|
387 |
+
// Any users left?
|
388 |
+
if ( empty( $users ) ) {
|
389 |
+
return;
|
390 |
+
}
|
391 |
+
|
392 |
+
// The callback url if any
|
393 |
+
$link = get_option( 'wppa_mailinglist_callback_url', '' );
|
394 |
+
|
395 |
+
$cont =
|
396 |
+
$aut . ' ' . __( 'wrote on photo' , 'wp-photo-album-plus' ) . ' ' . wppa_get_photo_name( $comment['photo'] ) . ':' .
|
397 |
+
'<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" >
|
398 |
+
<em> ' . stripslashes( $comment['comment'] ) . '</em>
|
399 |
+
</blockquote>';
|
400 |
+
|
401 |
+
// Preview
|
402 |
+
if ( $link ) {
|
403 |
+
$cont .= '<br />' . sprintf( __( 'You can see the photo %shere%s', 'wp-photo-album-plus' ), '<a href="' . esc_url( $link . '?album=' . $alb . '&photo=' . $pho . '&occur=1' ) . '" >', '</a>' );
|
404 |
+
}
|
405 |
+
|
406 |
+
// Process users
|
407 |
+
foreach( $users as $usr ) {
|
408 |
+
|
409 |
+
$user = get_user_by( 'login', $usr );
|
410 |
+
|
411 |
+
// User still exists?
|
412 |
+
if ( $user ) {
|
413 |
+
|
414 |
+
wppa_send_mail( array( 'to' => $user->user_email,
|
415 |
+
'subj' => sprintf( __( 'Comment on photo %s that you commented earlier' , 'wp-photo-album-plus' ), wppa_get_photo_name( $comment['photo'] ) ),
|
416 |
+
'cont' => $cont,
|
417 |
+
'photo' => $comment['photo'],
|
418 |
+
'replyurl' => $url,
|
419 |
+
'listtype' => $type,
|
420 |
+
'unsubscribe' => wppa_unsubscribe_link( $usr, $type ),
|
421 |
+
));
|
422 |
+
|
423 |
+
}
|
424 |
+
}
|
425 |
+
}
|
426 |
+
break;
|
427 |
+
|
428 |
+
case 'moderatephoto':
|
429 |
+
{
|
430 |
+
// The subject
|
431 |
+
$subj = sprintf( __( 'New photo moderate request: %s' , 'wp-photo-album-plus'), wppa_get_photo_item( $pho, 'name' ) );
|
432 |
+
|
433 |
+
// The photo owner
|
434 |
+
$owner = get_user_by( 'login', wppa_get_photo_item( $pho, 'owner' ) );
|
435 |
+
if ( ! $alb ) {
|
436 |
+
$alb = wppa_get_photo_item( $pho, 'album' );
|
437 |
+
}
|
438 |
+
|
439 |
+
// The callback url if any
|
440 |
+
$link = get_option( 'wppa_mailinglist_callback_url', '' );
|
441 |
+
|
442 |
+
// The content
|
443 |
+
$cont = sprintf( __( 'User %1$s uploaded photo %2$s into album %3$s' , 'wp-photo-album-plus' ), $owner->display_name, $pho, wppa_get_album_name( $alb ) );
|
444 |
+
|
445 |
+
$cont .= '<br />' . __( 'This photo needs moderation', 'wp-photo-album-plus' );
|
446 |
+
|
447 |
+
// Preview
|
448 |
+
if ( $link ) {
|
449 |
+
$cont .= '<br />' . sprintf( __( 'You can see the photo %shere%s', 'wp-photo-album-plus' ), '<a href="' . esc_url( $link . '?album=' . $alb . '&photo=' . $pho . '&occur=1' ) . '" >', '</a>' );
|
450 |
+
}
|
451 |
+
|
452 |
+
// Moderate links
|
453 |
+
$cont .=
|
454 |
+
'<br /><a href="' . get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $pho . '" >' .
|
455 |
+
__( 'Moderate photo admin' , 'wp-photo-album-plus') .
|
456 |
+
'</a>';
|
457 |
+
|
458 |
+
// Process all subscribed users
|
459 |
+
foreach( $userarray as $usr ) {
|
460 |
+
|
461 |
+
// Get the user data
|
462 |
+
$user = get_user_by( 'ID', $usr );
|
463 |
+
|
464 |
+
// If user exists, mail
|
465 |
+
if ( $user && user_can( $usr, 'wppa_moderate' ) ) {
|
466 |
+
wppa_send_mail( array( 'to' => $user->user_email,
|
467 |
+
'subj' => $subj,
|
468 |
+
'cont' => $cont,
|
469 |
+
'photo' => $pho,
|
470 |
+
'email' => $owner->user_email,
|
471 |
+
'listtype' => $type,
|
472 |
+
'unsubscribe' => wppa_unsubscribe_link( $usr, $type ),
|
473 |
+
));
|
474 |
+
}
|
475 |
+
}
|
476 |
+
}
|
477 |
+
break;
|
478 |
+
|
479 |
+
case 'moderatecomment':
|
480 |
+
{
|
481 |
+
// The comment
|
482 |
+
$comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->wppa_comments} WHERE id = %d", $com ), ARRAY_A );
|
483 |
+
|
484 |
+
// The photo
|
485 |
+
if ( ! $pho ) {
|
486 |
+
$pho = $comment['photo'];
|
487 |
+
}
|
488 |
+
|
489 |
+
// The subject
|
490 |
+
$subj = sprintf( __( 'New comment moderate request: %s' , 'wp-photo-album-plus'), wppa_get_photo_item( $pho, 'name' ) );
|
491 |
+
|
492 |
+
// Get teh author
|
493 |
+
$author = get_user_by( 'email', $comment['email'] );
|
494 |
+
if ( $author ) {
|
495 |
+
$aut = $author->display_name;
|
496 |
+
}
|
497 |
+
else {
|
498 |
+
$aut = $comment['user'];
|
499 |
+
}
|
500 |
+
|
501 |
+
// The callback url if any
|
502 |
+
$link = get_option( 'wppa_mailinglist_callback_url', '' );
|
503 |
+
|
504 |
+
$cont =
|
505 |
+
$aut . ' ' . __( 'wrote on photo' , 'wp-photo-album-plus' ) . ' ' . wppa_get_photo_name( $pho ) . ':' .
|
506 |
+
'<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" >
|
507 |
+
<em> ' . stripslashes( $comment['comment'] ) . '</em>
|
508 |
+
</blockquote>';
|
509 |
+
|
510 |
+
// Preview
|
511 |
+
if ( $link ) {
|
512 |
+
$cont .= '<br />' . sprintf( __( 'You can see the photo %shere%s', 'wp-photo-album-plus' ), '<a href="' . esc_url( $link . '?album=' . $alb . '&photo=' . $pho . '&occur=1' ) . '" >', '</a>' );
|
513 |
+
}
|
514 |
+
|
515 |
+
// Moderate links
|
516 |
+
$cont .=
|
517 |
+
'<br /><a href="' . get_admin_url() . 'admin.php?page=wppa_manage_comments&comment=' . $com . '" >' .
|
518 |
+
__( 'Moderate photo admin' , 'wp-photo-album-plus') .
|
519 |
+
'</a>';
|
520 |
+
|
521 |
+
// The commenters email, only if the user exists, i.e. we are sure the email is valid
|
522 |
+
$email = ( $author ? $author->user_email : '' );
|
523 |
+
|
524 |
+
// Process all subscribed users
|
525 |
+
foreach( $userarray as $usr ) {
|
526 |
+
|
527 |
+
// Get the user data
|
528 |
+
$user = get_user_by( 'ID', $usr );
|
529 |
+
|
530 |
+
// If user exists, mail
|
531 |
+
if ( $user && user_can( $usr, 'wppa_moderate' ) ) {
|
532 |
+
wppa_send_mail( array( 'to' => $user->user_email,
|
533 |
+
'subj' => $subj,
|
534 |
+
'cont' => $cont,
|
535 |
+
'photo' => $pho,
|
536 |
+
'email' => $email,
|
537 |
+
'listtype' => $type,
|
538 |
+
'unsubscribe' => wppa_unsubscribe_link( $usr, $type ),
|
539 |
+
));
|
540 |
+
}
|
541 |
+
}
|
542 |
+
}
|
543 |
+
break;
|
544 |
+
|
545 |
default:
|
546 |
wppa_log( 'Err', 'Unimplemented mailinglist type found: ' . $type, true );
|
547 |
}
|
548 |
+
|
549 |
+
if ( wppa_is_cron() ) {
|
550 |
+
wppa_log( 'Cron', 'Done mailing ' . $type );
|
551 |
+
}
|
552 |
}
|
553 |
|
554 |
// Is current user in mailinglist?
|
580 |
return ( in_array( $user_id, $userarray ) );
|
581 |
}
|
582 |
|
583 |
+
// Remove user fron mailinglist
|
584 |
+
function wppa_unsubscribe_user( $user_id, $list_type ) {
|
585 |
+
|
586 |
+
if ( ! $user_id ) {
|
587 |
+
return;
|
588 |
+
}
|
589 |
+
|
590 |
+
$mailinglist = get_option( 'wppa_mailinglist_' . $list_type, '' );
|
591 |
+
$userarray = wppa_index_string_to_array( $mailinglist );
|
592 |
+
if ( in_array( $user_id, $userarray ) ) {
|
593 |
+
$userarray = array_diff( $userarray, array( $user_id ) );
|
594 |
+
$mailinglist = wppa_index_array_to_string( $userarray );
|
595 |
+
update_option( 'wppa_mailinglist_' . $list_type, $mailinglist );
|
596 |
+
}
|
597 |
+
}
|
598 |
+
|
599 |
+
// Add user to mailinglist
|
600 |
+
function wppa_subscribe_user( $user_id, $list_type ) {
|
601 |
+
|
602 |
+
if ( ! $user_id ) {
|
603 |
+
return;
|
604 |
+
}
|
605 |
+
|
606 |
+
$mailinglist = get_option( 'wppa_mailinglist_' . $list_type, '' );
|
607 |
+
$userarray = wppa_index_string_to_array( $mailinglist );
|
608 |
+
if ( ! in_array( $user_id, $userarray ) ) {
|
609 |
+
$userarray[] = $user_id;
|
610 |
+
sort( $userarray );
|
611 |
+
$mailinglist = wppa_index_array_to_string( $userarray );
|
612 |
+
update_option( 'wppa_mailinglist_' . $list_type, $mailinglist );
|
613 |
+
}
|
614 |
+
}
|
615 |
+
|
616 |
+
// Get the unsubscribe link
|
617 |
+
function wppa_unsubscribe_link( $user_id, $listtype ) {
|
618 |
+
|
619 |
+
$user = get_user_by( 'ID', $user_id );
|
620 |
+
$crypt = crypt( $listtype . $user->ID . $user->login_name, $user->display_name );
|
621 |
+
$url = admin_url( 'admin-ajax.php' );
|
622 |
+
$url .= '?action=wppa&wppa-action=mailinglist&list=' . $listtype . '&onoff=off&user=' . $user_id . '&crypt=' . $crypt;
|
623 |
+
|
624 |
+
$link = '<a href="' . esc_url( $url ) . '" >';
|
625 |
+
$result = sprintf( __( 'You can %sunsubscribe%s here from this mailinglist', 'wp-photo-album-plus' ), $link, '</a>' );
|
626 |
+
|
627 |
+
return $result;
|
628 |
+
}
|
629 |
+
|
630 |
// Send a mail
|
631 |
function wppa_send_mail( $args ) {
|
632 |
|
637 |
'email' => '',
|
638 |
'listtype' => '',
|
639 |
'replyurl' => '',
|
640 |
+
'unsubscribe' => '',
|
641 |
);
|
642 |
$args = wp_parse_args( $args, $defaults );
|
643 |
extract( $args );
|
689 |
$message_part_1 .= '<p>'.$cont.'</p>';
|
690 |
}
|
691 |
|
692 |
+
// Tell the moderator the email address of the originator of the photo/comment
|
693 |
+
if ( $email && substr( $listtype, 0, 8 ) == 'moderate' ) {
|
694 |
+
|
695 |
+
$eml = sprintf(__('The visitors email address is: <a href="mailto:%s">%s</a>', 'wp-photo-album-plus'), $email, $email);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
696 |
$message_part_2 .= '<p>'.$eml.'</p>';
|
|
|
697 |
}
|
698 |
|
699 |
if ( $replyurl ) {
|
700 |
$message_part_2 .= '<a href="' . $replyurl . '" >' . __( 'Reply' , 'wp-photo-album-plus') . '</a>';
|
701 |
}
|
702 |
|
703 |
+
if ( $unsubscribe ) {
|
704 |
+
$message_part_2 .= '<br />' . $unsubscribe;
|
705 |
+
}
|
706 |
+
|
707 |
$message_part_3 .=
|
708 |
'<p>' .
|
709 |
'<small>' .
|
739 |
'' );
|
740 |
}
|
741 |
|
742 |
+
}
|
743 |
+
|
wppa-notify-widget.php
CHANGED
@@ -20,14 +20,6 @@ class wppaNotifyWidget extends WP_Widget {
|
|
20 |
extract( $args );
|
21 |
|
22 |
$instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Notify me', 'wp-photo-album-plus' ),
|
23 |
-
'newalbum' => 'no',
|
24 |
-
'newalbumlink' => '',
|
25 |
-
'photoapproved' => 'no',
|
26 |
-
'commentnotify' => 'no',
|
27 |
-
'commentapproved' => 'no',
|
28 |
-
'commentprevious' => 'no',
|
29 |
-
'moderatephoto' => 'no',
|
30 |
-
'moderatecomment' => 'no',
|
31 |
'logonly' => 'yes',
|
32 |
) );
|
33 |
// Logged in only and logged out?
|
@@ -38,14 +30,14 @@ class wppaNotifyWidget extends WP_Widget {
|
|
38 |
$widget_title = apply_filters( 'widget_title', $instance['title'] );
|
39 |
$widget_content = '<!-- WPPA+ notify Widget start -->';
|
40 |
|
41 |
-
$widget_content .= __( '
|
42 |
|
43 |
// Get the body of the widget
|
44 |
$body = '';
|
45 |
|
46 |
// New album
|
47 |
-
if ( wppa_switch( '
|
48 |
-
$in_list = wppa_am_i_in_mailinglist( '
|
49 |
$body .= '
|
50 |
<div style="clear:both;" >
|
51 |
<input
|
@@ -53,7 +45,7 @@ class wppaNotifyWidget extends WP_Widget {
|
|
53 |
type="checkbox"
|
54 |
style="float:left;" ' .
|
55 |
( $in_list ? 'checked="checked" ' : ' ' ) .
|
56 |
-
'onchange="wppaAjaxNotify(this,\'
|
57 |
/>
|
58 |
<label
|
59 |
for="wppa-newalbum-notify"
|
@@ -64,11 +56,32 @@ class wppaNotifyWidget extends WP_Widget {
|
|
64 |
</div>';
|
65 |
}
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
// Only if upload moderation is activated
|
68 |
if ( wppa_switch( 'upload_moderate' ) ) {
|
69 |
|
70 |
// Photo approved
|
71 |
-
if ( wppa_switch( '
|
72 |
$in_list = wppa_am_i_in_mailinglist( 'photoapproved' );
|
73 |
$body .= '
|
74 |
<div style="clear:both;" >
|
@@ -92,8 +105,29 @@ class wppaNotifyWidget extends WP_Widget {
|
|
92 |
// Only if comments sytem is activated
|
93 |
if ( wppa_switch( 'show_comments' ) ) {
|
94 |
|
95 |
-
//
|
96 |
-
if ( wppa_switch( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
$in_list = wppa_am_i_in_mailinglist( 'commentapproved' );
|
98 |
$body .= '
|
99 |
<div style="clear:both;" >
|
@@ -108,13 +142,13 @@ class wppaNotifyWidget extends WP_Widget {
|
|
108 |
for="wppa-commentapproved-notify"
|
109 |
style="float:left;padding-left:4px;width:90%;"
|
110 |
> ' .
|
111 |
-
__( '
|
112 |
</label>
|
113 |
</div>';
|
114 |
}
|
115 |
|
116 |
// Commented previous (to photo owner)
|
117 |
-
if ( wppa_switch( '
|
118 |
$in_list = wppa_am_i_in_mailinglist( 'commentprevious' );
|
119 |
$body .= '
|
120 |
<div style="clear:both;" >
|
@@ -129,7 +163,7 @@ class wppaNotifyWidget extends WP_Widget {
|
|
129 |
for="wppa-commentprevious-notify"
|
130 |
style="float:left;padding-left:4px;width:90%;"
|
131 |
> ' .
|
132 |
-
__( '
|
133 |
</label>
|
134 |
</div>';
|
135 |
}
|
@@ -161,7 +195,7 @@ class wppaNotifyWidget extends WP_Widget {
|
|
161 |
}
|
162 |
|
163 |
// Only if comment moderation activated
|
164 |
-
if ( wppa_opt( '
|
165 |
$in_list = wppa_am_i_in_mailinglist( 'moderatecomment' );
|
166 |
$body .= '
|
167 |
<div style="clear:both;" >
|
@@ -206,20 +240,11 @@ class wppaNotifyWidget extends WP_Widget {
|
|
206 |
|
207 |
// Defaults
|
208 |
$instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Notify me', 'wp-photo-album-plus' ),
|
209 |
-
'newalbum' => 'no',
|
210 |
-
'newalbumlink' => '',
|
211 |
-
'photoapproved' => 'no',
|
212 |
-
'commentnotify' => 'no',
|
213 |
-
'commentapproved' => 'no',
|
214 |
-
'commentprevious' => 'no',
|
215 |
-
'moderatephoto' => 'no',
|
216 |
-
'moderatecomment' => 'no',
|
217 |
'logonly' => 'yes',
|
218 |
) );
|
219 |
|
220 |
$instance = $new_instance;
|
221 |
$instance['title'] = strip_tags( $instance['title'] );
|
222 |
-
$instance['newalbumlink'] = esc_url( $instance['newalbumlink'] );
|
223 |
|
224 |
return $instance;
|
225 |
}
|
@@ -229,14 +254,6 @@ class wppaNotifyWidget extends WP_Widget {
|
|
229 |
|
230 |
//Defaults
|
231 |
$instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Notify me', 'wp-photo-album-plus' ),
|
232 |
-
'newalbum' => 'no',
|
233 |
-
'newalbumlink' => '',
|
234 |
-
'photoapproved' => 'no',
|
235 |
-
'commentnotify' => 'no',
|
236 |
-
'commentapproved' => 'no',
|
237 |
-
'commentprevious' => 'no',
|
238 |
-
'moderatephoto' => 'no',
|
239 |
-
'moderatecomment' => 'no',
|
240 |
'logonly' => 'yes',
|
241 |
) );
|
242 |
|
@@ -244,87 +261,10 @@ class wppaNotifyWidget extends WP_Widget {
|
|
244 |
echo
|
245 |
wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
|
246 |
|
247 |
-
// Notify when new album created
|
248 |
echo
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
__( 'New album created', 'wp-photo-album-plus'),
|
253 |
-
__( 'See Table IX-D19 and 20: Mail on new album', 'wp-photo-album-plus'),
|
254 |
-
'disabled' );
|
255 |
-
|
256 |
-
// Only when upload moderation is acitvated
|
257 |
-
echo '<div style="padding:0 6px 6px;border:1px solid lightgray;margin-top:2px;margin-bottom:1em;" >' .
|
258 |
-
'<small>' . __( 'These boxes only show up when upload moderation is activated in Table VII-B7.0', 'wp-photo-album-plus' ) . '</small>';
|
259 |
-
|
260 |
-
// Notify when photo approved
|
261 |
-
echo
|
262 |
-
wppa_widget_checkbox( $this,
|
263 |
-
'photoapproved',
|
264 |
-
wppa_switch( 'mail_on_approve' ) ? 'yes' : 'no',
|
265 |
-
__( 'Photo approved', 'wp-photo-album-plus' ),
|
266 |
-
__( 'See Table VII-B7.2: Notify approve photo', 'wp-photo-album-plus' ),
|
267 |
-
'disabled' );
|
268 |
-
|
269 |
-
echo '</div>';
|
270 |
-
|
271 |
-
// Only when comments system is activated
|
272 |
-
echo '<div style="padding:0 6px 6px;border:1px solid lightgray;margin-top:2px;margin-bottom:1em;" >' .
|
273 |
-
'<small>' . __( 'These boxes only show up when the comments system is activated in Table II-B10', 'wp-photo-album-plus' ) . '</small>';
|
274 |
-
|
275 |
-
// Notify when comment on photo approved
|
276 |
-
echo
|
277 |
-
wppa_widget_checkbox( $this,
|
278 |
-
'commentapproved',
|
279 |
-
wppa_switch( 'com_notify_approved' ) ? 'yes' : 'no',
|
280 |
-
__( 'Comment on photo approved', 'wp-photo-album-plus' ),
|
281 |
-
__( 'See Table IV-F5.2 and 5.3: Comment notify approved', 'wp-photo-album-plus' ),
|
282 |
-
'disabled' );
|
283 |
-
|
284 |
-
echo
|
285 |
-
wppa_widget_checkbox( $this,
|
286 |
-
'commentprevious',
|
287 |
-
wppa_switch( 'com_notify_previous' ) ? 'yes' : 'no',
|
288 |
-
__( 'Commented the photo before', 'wp-photo-album-plus' ),
|
289 |
-
__( 'See Table IV-F5.1: Comment notify previous', 'wp-photo-album-plus' ),
|
290 |
-
'disabled' );
|
291 |
-
|
292 |
-
echo '</div>';
|
293 |
-
|
294 |
-
// Only for moderators
|
295 |
-
echo '<div style="padding:0 6px 6px;border:1px solid lightgray;margin-top:2px;margin-bottom:1em;" >' .
|
296 |
-
'<small>' . __( 'These boxes only show up to moderators', 'wp-photo-album-plus' ) . '</small>';
|
297 |
-
|
298 |
-
// Notify when photo needs moderation
|
299 |
-
echo
|
300 |
-
wppa_widget_checkbox( $this,
|
301 |
-
'moderatephoto',
|
302 |
-
wppa_switch( 'upload_moderate' ) ? 'yes' : 'no',
|
303 |
-
__( 'Upload moderation', 'wp-photo-album-plus' ),
|
304 |
-
__( 'See Table VII-B7.0: Upload moderation', 'wp-photo-album-plus' ),
|
305 |
-
'disabled' );
|
306 |
-
|
307 |
-
// Notify when comment needs moderation
|
308 |
-
echo
|
309 |
-
wppa_widget_checkbox( $this,
|
310 |
-
'moderatecomment',
|
311 |
-
wppa_opt( 'comment_moderation' ) != 'none' ? 'yes' : 'no',
|
312 |
-
__( 'Comment moderation', 'wp-photo-album-plus' ),
|
313 |
-
__( 'See Table IV-F3: Comment moderation', 'wp-photo-album-plus' ),
|
314 |
-
'disabled' );
|
315 |
-
|
316 |
-
echo '</div>';
|
317 |
-
|
318 |
-
// Loggedin only
|
319 |
-
echo
|
320 |
-
wppa_widget_checkbox( $this,
|
321 |
-
'logonly',
|
322 |
-
'yes',
|
323 |
-
__( 'Show to logged in visitors only', 'wp-photo-album-plus' ),
|
324 |
-
__( 'We only mail to registered users', 'wp-photo-album-plus' ),
|
325 |
-
'disabled' );
|
326 |
-
|
327 |
-
|
328 |
|
329 |
}
|
330 |
|
20 |
extract( $args );
|
21 |
|
22 |
$instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Notify me', 'wp-photo-album-plus' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
'logonly' => 'yes',
|
24 |
) );
|
25 |
// Logged in only and logged out?
|
30 |
$widget_title = apply_filters( 'widget_title', $instance['title'] );
|
31 |
$widget_content = '<!-- WPPA+ notify Widget start -->';
|
32 |
|
33 |
+
$widget_content .= __( 'Notify me when...', 'wp-photo-album-plus' ) . '<br />';
|
34 |
|
35 |
// Get the body of the widget
|
36 |
$body = '';
|
37 |
|
38 |
// New album
|
39 |
+
if ( wppa_switch( 'newalbumnotify' ) ) {
|
40 |
+
$in_list = wppa_am_i_in_mailinglist( 'newalbumnotify' );
|
41 |
$body .= '
|
42 |
<div style="clear:both;" >
|
43 |
<input
|
45 |
type="checkbox"
|
46 |
style="float:left;" ' .
|
47 |
( $in_list ? 'checked="checked" ' : ' ' ) .
|
48 |
+
'onchange="wppaAjaxNotify(this,\'newalbumnotify\');"
|
49 |
/>
|
50 |
<label
|
51 |
for="wppa-newalbum-notify"
|
56 |
</div>';
|
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 |
+
<div style="clear:both;" >
|
64 |
+
<input
|
65 |
+
id="wppa-feupload-notify"
|
66 |
+
type="checkbox"
|
67 |
+
style="float:left;" ' .
|
68 |
+
( $in_list ? 'checked="checked" ' : ' ' ) .
|
69 |
+
'onchange="wppaAjaxNotify(this,\'feuploadnotify\');"
|
70 |
+
/>
|
71 |
+
<label
|
72 |
+
for="wppa-newalbum-notify"
|
73 |
+
style="float:left;padding-left:4px;width:90%;"
|
74 |
+
> ' .
|
75 |
+
__( 'A new photo is uploaded', 'wp-photo-album-plus' ) . '
|
76 |
+
</label>
|
77 |
+
</div>';
|
78 |
+
}
|
79 |
+
|
80 |
// Only if upload moderation is activated
|
81 |
if ( wppa_switch( 'upload_moderate' ) ) {
|
82 |
|
83 |
// Photo approved
|
84 |
+
if ( wppa_switch( 'photoapproved' ) ) {
|
85 |
$in_list = wppa_am_i_in_mailinglist( 'photoapproved' );
|
86 |
$body .= '
|
87 |
<div style="clear:both;" >
|
105 |
// Only if comments sytem is activated
|
106 |
if ( wppa_switch( 'show_comments' ) ) {
|
107 |
|
108 |
+
// A comment is given
|
109 |
+
if ( wppa_switch( 'commentnotify' ) ) {
|
110 |
+
$in_list = wppa_am_i_in_mailinglist( 'commentnotify' );
|
111 |
+
$body .= '
|
112 |
+
<div style="clear:both;" >
|
113 |
+
<input
|
114 |
+
id="wppa-comment-notify"
|
115 |
+
type="checkbox"
|
116 |
+
style="float:left;" ' .
|
117 |
+
( $in_list ? 'checked="checked" ' : ' ' ) .
|
118 |
+
'onchange="wppaAjaxNotify(this,\'commentnotify\');"
|
119 |
+
/>
|
120 |
+
<label
|
121 |
+
for="wppa-comment-notify"
|
122 |
+
style="float:left;padding-left:4px;width:90%;"
|
123 |
+
> ' .
|
124 |
+
__( 'A comment on a photo is given', 'wp-photo-album-plus' ) . '
|
125 |
+
</label>
|
126 |
+
</div>';
|
127 |
+
}
|
128 |
+
|
129 |
+
// Comment approved (to photo owner and commenter)
|
130 |
+
if ( wppa_switch( 'commentapproved' ) ) {
|
131 |
$in_list = wppa_am_i_in_mailinglist( 'commentapproved' );
|
132 |
$body .= '
|
133 |
<div style="clear:both;" >
|
142 |
for="wppa-commentapproved-notify"
|
143 |
style="float:left;padding-left:4px;width:90%;"
|
144 |
> ' .
|
145 |
+
__( 'A comment on my photo is approved or my comment is approved', 'wp-photo-album-plus' ) . '
|
146 |
</label>
|
147 |
</div>';
|
148 |
}
|
149 |
|
150 |
// Commented previous (to photo owner)
|
151 |
+
if ( wppa_switch( 'commentprevious' ) ) {
|
152 |
$in_list = wppa_am_i_in_mailinglist( 'commentprevious' );
|
153 |
$body .= '
|
154 |
<div style="clear:both;" >
|
163 |
for="wppa-commentprevious-notify"
|
164 |
style="float:left;padding-left:4px;width:90%;"
|
165 |
> ' .
|
166 |
+
__( 'A comment is given on a photo that i commented before', 'wp-photo-album-plus' ) . '
|
167 |
</label>
|
168 |
</div>';
|
169 |
}
|
195 |
}
|
196 |
|
197 |
// Only if comment moderation activated
|
198 |
+
if ( wppa_opt( 'moderate_comment' ) != '-none-' ) {
|
199 |
$in_list = wppa_am_i_in_mailinglist( 'moderatecomment' );
|
200 |
$body .= '
|
201 |
<div style="clear:both;" >
|
240 |
|
241 |
// Defaults
|
242 |
$instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Notify me', 'wp-photo-album-plus' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
'logonly' => 'yes',
|
244 |
) );
|
245 |
|
246 |
$instance = $new_instance;
|
247 |
$instance['title'] = strip_tags( $instance['title'] );
|
|
|
248 |
|
249 |
return $instance;
|
250 |
}
|
254 |
|
255 |
//Defaults
|
256 |
$instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Notify me', 'wp-photo-album-plus' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
'logonly' => 'yes',
|
258 |
) );
|
259 |
|
261 |
echo
|
262 |
wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
|
263 |
|
|
|
264 |
echo
|
265 |
+
'<div style="padding:6px;border:1px solid lightgray;margin-top:2px;" >' .
|
266 |
+
__( 'You can configure the availability of mailing types in Table IX-M', 'wp-photo-album-plus' ) .
|
267 |
+
'</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
|
269 |
}
|
270 |
|
wppa-settings-autosave.php
CHANGED
@@ -4956,7 +4956,7 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
4956 |
$name = __('Comment moderation', 'wp-photo-album-plus');
|
4957 |
$desc = __('Comments from what users need approval.', 'wp-photo-album-plus');
|
4958 |
$help = esc_js(__('Select the desired users of which the comments need approval.', 'wp-photo-album-plus'));
|
4959 |
-
$slug = '
|
4960 |
$options = array( __('All users', 'wp-photo-album-plus'),
|
4961 |
__('Logged out users', 'wp-photo-album-plus'),
|
4962 |
__('No users', 'wp-photo-album-plus'),
|
@@ -4964,7 +4964,7 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
4964 |
);
|
4965 |
$values = array( 'all',
|
4966 |
'logout',
|
4967 |
-
'none',
|
4968 |
'wprules',
|
4969 |
);
|
4970 |
$html = wppa_select($slug, $options, $values);
|
@@ -4989,57 +4989,10 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
4989 |
$tags = 'comment,mail';
|
4990 |
wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
|
4991 |
|
4992 |
-
$name = __('Comment notify', 'wp-photo-album-plus');
|
4993 |
-
$desc = __('Select if users can subscribe to e-mail notification of a new comment.', 'wp-photo-album-plus');
|
4994 |
-
$help = '';
|
4995 |
-
$slug = 'wppa_comment_notify';
|
4996 |
-
$html = wppa_checkbox($slug, $options, $values);
|
4997 |
-
$clas = 'wppa_comment_';
|
4998 |
-
$tags = 'comment,mail';
|
4999 |
-
wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
|
5000 |
-
|
5001 |
-
$name = __('Comment notify previous', 'wp-photo-album-plus');
|
5002 |
-
$desc = __('Notify users who has commented this photo earlier.', 'wp-photo-album-plus');
|
5003 |
-
$help = '';
|
5004 |
-
$slug = 'wppa_com_notify_previous';
|
5005 |
-
$html = wppa_checkbox($slug);
|
5006 |
-
$clas = 'wppa_comment_';
|
5007 |
-
$tags = 'comment';
|
5008 |
-
wppa_setting($slug, '5.1', $name, $desc, $html, $help, $clas, $tags);
|
5009 |
-
|
5010 |
-
$name = __('Comment notify approved', 'wp-photo-album-plus');
|
5011 |
-
$desc = __('Notify photo owner of approved comment.', 'wp-photo-album-plus');
|
5012 |
-
$help = '';
|
5013 |
-
$slug = 'wppa_com_notify_approved';
|
5014 |
-
$html = wppa_checkbox($slug);
|
5015 |
-
$clas = 'wppa_comment_';
|
5016 |
-
$tags = 'comment';
|
5017 |
-
wppa_setting($slug, '5.2', $name, $desc, $html, $help, $clas, $tags);
|
5018 |
-
|
5019 |
-
$name = __('Com ntfy appr email content', 'wp-photo-album-plus');
|
5020 |
-
$desc = __('The content of the email.', 'wp-photo-album-plus');
|
5021 |
-
$help = esc_js(__('If you leave this blank, the default content will be used', 'wp-photo-album-plus'));
|
5022 |
-
$help .= '\n\n'.esc_js(__('The content may contain html.', 'wp-photo-album-plus'));
|
5023 |
-
$help .= '\n\n'.esc_js(__('You may use the following keywords: w#comment for the comment content, w#user for the commenters name and the standard photo description keywords w#name, w#filename, w#owner, w#id, w#tags, w#timestamp, w#modified, w#views, w#amx, w#amy, w#amfs, w#url, w#hrurl, w#tnurl, w#cc0..w#cc9, w#cd0..w#cd9.', 'wp-photo-album-plus'));
|
5024 |
-
$slug = 'wppa_com_notify_approved_text';
|
5025 |
-
$html = wppa_textarea($slug, $name);
|
5026 |
-
$clas = 'wppa_comment_';
|
5027 |
-
$tags = 'comment,mail';
|
5028 |
-
wppa_setting($slug, '5.3', $name, $desc, $html, $help, $clas, $tags);
|
5029 |
-
|
5030 |
-
$name = __('Com ntfy appr email subject', 'wp-photo-album-plus');
|
5031 |
-
$desc = __('The subject of the email.', 'wp-photo-album-plus');
|
5032 |
-
$help = '';
|
5033 |
-
$slug = 'wppa_com_notify_approved_subj';
|
5034 |
-
$html = wppa_input($slug, '300px;');
|
5035 |
-
$clas = 'wppa_comment_';
|
5036 |
-
$tags = 'comment,mail';
|
5037 |
-
wppa_setting($slug, '5.4', $name, $desc, $html, $help, $clas, $tags);
|
5038 |
-
|
5039 |
$name = __('Comment ntfy added', 'wp-photo-album-plus');
|
5040 |
$desc = __('Show "Comment added" after successfull adding a comment.', 'wp-photo-album-plus');
|
5041 |
$help = '';
|
5042 |
-
$slug = '
|
5043 |
$html = wppa_checkbox($slug);
|
5044 |
$clas = 'wppa_comment_';
|
5045 |
$tags = 'comment';
|
@@ -5072,16 +5025,6 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
5072 |
$tags = 'comment,layout';
|
5073 |
wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
|
5074 |
|
5075 |
-
$name = __('Show commenter email', 'wp-photo-album-plus');
|
5076 |
-
$desc = __('Show the commenter\'s email in the notify emails.', 'wp-photo-album-plus');
|
5077 |
-
$help = esc_js(__('Shows the email address of the commenter in all notify emails.', 'wp-photo-album-plus'));
|
5078 |
-
$help .= '\n'.esc_js(__('If switched off, admin will still receive the senders email in the notification mail', 'wp-photo-album-plus'));
|
5079 |
-
$slug = 'wppa_mail_upl_email';
|
5080 |
-
$html = wppa_checkbox($slug);
|
5081 |
-
$clas = 'wppa_comment_';
|
5082 |
-
$tags = 'comment,layout,mail';
|
5083 |
-
wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
|
5084 |
-
|
5085 |
$name = __('Allow clickable links', 'wp-photo-album-plus');
|
5086 |
$desc = __('Make links in comments clickable', 'wp-photo-album-plus');
|
5087 |
$help = '';
|
@@ -6715,18 +6658,7 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
6715 |
$clas = '';
|
6716 |
$tags = 'access,album';
|
6717 |
wppa_setting($slug, '1.2', $name, $desc, $html, $help, $clas, $tags);
|
6718 |
-
|
6719 |
-
$name = __('User create notify', 'wp-photo-album-plus');
|
6720 |
-
$desc = __('Notify these users when an album is created at the front-end', 'wp-photo-album-plus');
|
6721 |
-
$help = esc_js(__('Enter login names seperated by comma\'s (,)', 'wp-photo-album-plus'));
|
6722 |
-
$slug = 'wppa_fe_create_ntfy';
|
6723 |
-
$html1 = wppa_input($slug, '300px' );
|
6724 |
-
$html2 = '';
|
6725 |
-
$html = array( $html1, $html2 );
|
6726 |
-
$clas = '';
|
6727 |
-
$tags = 'mail,album';
|
6728 |
-
wppa_setting($slug, '1.3', $name, $desc, $html, $help, $clas, $tags);
|
6729 |
-
*/
|
6730 |
$name = __('User create Albums login', 'wp-photo-album-plus');
|
6731 |
$desc = __('Frontend album creation requires the user is logged in.', 'wp-photo-album-plus');
|
6732 |
$help = '';
|
@@ -6847,39 +6779,6 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
6847 |
$tags = 'upload';
|
6848 |
wppa_setting($slug, '7.1', $name, $desc, $html, $help, $clas, $tags);
|
6849 |
|
6850 |
-
$name = __('Notify approve photo', 'wp-photo-album-plus');
|
6851 |
-
$desc = __('Send an email to the owner when a photo is approved', 'wp-photo-album-plus');
|
6852 |
-
$help = '';
|
6853 |
-
$slug = 'wppa_mail_on_approve';
|
6854 |
-
$html1 = wppa_checkbox($slug);
|
6855 |
-
$html2 = '';
|
6856 |
-
$html = array( $html1, $html2 );
|
6857 |
-
$clas = '';
|
6858 |
-
$tags = 'upload,mail';
|
6859 |
-
wppa_setting($slug, '7.2', $name, $desc, $html, $help, $clas, $tags);
|
6860 |
-
|
6861 |
-
$name = __('Upload notify', 'wp-photo-album-plus');
|
6862 |
-
$desc = __('Notify admin at frontend upload.', 'wp-photo-album-plus');
|
6863 |
-
$help = esc_js(__('If checked, admin will receive a notification by email.', 'wp-photo-album-plus'));
|
6864 |
-
$slug = 'wppa_upload_notify';
|
6865 |
-
$html1 = wppa_checkbox($slug);
|
6866 |
-
$html2 = '';
|
6867 |
-
$html = array( $html1, $html2 );
|
6868 |
-
$clas = '';
|
6869 |
-
$tags = 'upload,mail';
|
6870 |
-
wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags);
|
6871 |
-
|
6872 |
-
$name = __('Upload backend notify', 'wp-photo-album-plus');
|
6873 |
-
$desc = __('Notify admin at backend upload.', 'wp-photo-album-plus');
|
6874 |
-
$help = esc_js(__('If checked, admin will receive a notification by email.', 'wp-photo-album-plus'));
|
6875 |
-
$slug = 'wppa_upload_backend_notify';
|
6876 |
-
$html1 = wppa_checkbox($slug);
|
6877 |
-
$html2 = '';
|
6878 |
-
$html = array( $html1, $html2 );
|
6879 |
-
$clas = '';
|
6880 |
-
$tags = 'upload,mail';
|
6881 |
-
wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
|
6882 |
-
|
6883 |
$name = __('Min size in pixels', 'wp-photo-album-plus');
|
6884 |
$desc = __('Min size for height and width for front-end uploads.', 'wp-photo-album-plus');
|
6885 |
$help = esc_js(__('Enter the minimum size.', 'wp-photo-album-plus'));
|
@@ -9267,26 +9166,6 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
9267 |
$html = wppa_select($slug, $opts, $vals);
|
9268 |
wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags);
|
9269 |
|
9270 |
-
$name = __('Mail on new album', 'wp-photo-album-plus');
|
9271 |
-
$desc = __('Enable mailing users when a new album is created', 'wp-photo-album-plus');
|
9272 |
-
$help = __('Use the WPPA+ Notify Me widget', 'wp-photo-album-plus');
|
9273 |
-
$slug = 'wppa_mail_new_album';
|
9274 |
-
$html = wppa_checkbox($slug);
|
9275 |
-
$clas = '';
|
9276 |
-
$tags = 'mail';
|
9277 |
-
wppa_setting($slug, '19', $name, $desc, $html, $help, $clas, $tags);
|
9278 |
-
|
9279 |
-
$name = __('New album email callback url', 'wp-photo-album-plus');
|
9280 |
-
$desc = __('The link in the email to the new album', 'wp-photo-album-plus');
|
9281 |
-
$help = __( 'Recommendation', 'wp-photo-album-plus' ) . ': ' .
|
9282 |
-
__( 'Create a page with shortcode', 'wp-photo-album-plus' ) .
|
9283 |
-
'<b>[wppa type="thumbs" album="#last"]</b>. ' .
|
9284 |
-
__( 'The email will contain a link to this page, so the users will have quick access to the latest album', 'wp-photo-album-plus' );
|
9285 |
-
$slug = 'wppa_mailinglist_newalbum_link';
|
9286 |
-
$html = wppa_input($slug, '90%'); //$width, $minwidth = '', $text = '', $onchange = '', $placeholder = '') {
|
9287 |
-
$clas = '';
|
9288 |
-
$tags = 'mail';
|
9289 |
-
wppa_setting($slug, '20', $name, $desc, $html, $help, $clas, $tags);
|
9290 |
}
|
9291 |
wppa_setting_subheader( 'E', '1', __( 'Search Albums and Photos related settings' , 'wp-photo-album-plus') );
|
9292 |
{
|
@@ -10572,7 +10451,6 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
10572 |
$clas = '';
|
10573 |
$tags = 'system';
|
10574 |
wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
|
10575 |
-
}
|
10576 |
|
10577 |
$name = __('Render photo once', 'wp-photo-album-plus');
|
10578 |
$desc = __('Replace shortcode by html', 'wp-photo-album-plus');
|
@@ -10583,6 +10461,153 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
10583 |
$clas = '';
|
10584 |
$tags = 'system';
|
10585 |
wppa_setting($slug, '7.1', $name, $desc, $html, $help, $clas, $tags);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10586 |
|
10587 |
?>
|
10588 |
|
4956 |
$name = __('Comment moderation', 'wp-photo-album-plus');
|
4957 |
$desc = __('Comments from what users need approval.', 'wp-photo-album-plus');
|
4958 |
$help = esc_js(__('Select the desired users of which the comments need approval.', 'wp-photo-album-plus'));
|
4959 |
+
$slug = 'wppa_moderate_comment';
|
4960 |
$options = array( __('All users', 'wp-photo-album-plus'),
|
4961 |
__('Logged out users', 'wp-photo-album-plus'),
|
4962 |
__('No users', 'wp-photo-album-plus'),
|
4964 |
);
|
4965 |
$values = array( 'all',
|
4966 |
'logout',
|
4967 |
+
'-none-',
|
4968 |
'wprules',
|
4969 |
);
|
4970 |
$html = wppa_select($slug, $options, $values);
|
4989 |
$tags = 'comment,mail';
|
4990 |
wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
|
4991 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4992 |
$name = __('Comment ntfy added', 'wp-photo-album-plus');
|
4993 |
$desc = __('Show "Comment added" after successfull adding a comment.', 'wp-photo-album-plus');
|
4994 |
$help = '';
|
4995 |
+
$slug = 'wppa_commentnotify_added';
|
4996 |
$html = wppa_checkbox($slug);
|
4997 |
$clas = 'wppa_comment_';
|
4998 |
$tags = 'comment';
|
5025 |
$tags = 'comment,layout';
|
5026 |
wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
|
5027 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5028 |
$name = __('Allow clickable links', 'wp-photo-album-plus');
|
5029 |
$desc = __('Make links in comments clickable', 'wp-photo-album-plus');
|
5030 |
$help = '';
|
6658 |
$clas = '';
|
6659 |
$tags = 'access,album';
|
6660 |
wppa_setting($slug, '1.2', $name, $desc, $html, $help, $clas, $tags);
|
6661 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6662 |
$name = __('User create Albums login', 'wp-photo-album-plus');
|
6663 |
$desc = __('Frontend album creation requires the user is logged in.', 'wp-photo-album-plus');
|
6664 |
$help = '';
|
6779 |
$tags = 'upload';
|
6780 |
wppa_setting($slug, '7.1', $name, $desc, $html, $help, $clas, $tags);
|
6781 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6782 |
$name = __('Min size in pixels', 'wp-photo-album-plus');
|
6783 |
$desc = __('Min size for height and width for front-end uploads.', 'wp-photo-album-plus');
|
6784 |
$help = esc_js(__('Enter the minimum size.', 'wp-photo-album-plus'));
|
9166 |
$html = wppa_select($slug, $opts, $vals);
|
9167 |
wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags);
|
9168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9169 |
}
|
9170 |
wppa_setting_subheader( 'E', '1', __( 'Search Albums and Photos related settings' , 'wp-photo-album-plus') );
|
9171 |
{
|
10451 |
$clas = '';
|
10452 |
$tags = 'system';
|
10453 |
wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
|
|
|
10454 |
|
10455 |
$name = __('Render photo once', 'wp-photo-album-plus');
|
10456 |
$desc = __('Replace shortcode by html', 'wp-photo-album-plus');
|
10461 |
$clas = '';
|
10462 |
$tags = 'system';
|
10463 |
wppa_setting($slug, '7.1', $name, $desc, $html, $help, $clas, $tags);
|
10464 |
+
}
|
10465 |
+
|
10466 |
+
wppa_setting_subheader( 'M', '1', __( 'Email notification related settings' , 'wp-photo-album-plus' ) .
|
10467 |
+
' <small><i>' . __( 'Use the WPPA+ Notify Me widget', 'wp-photo-album-plus' ) . '</i></small>' );
|
10468 |
+
{
|
10469 |
+
$name = __('Mail on new album', 'wp-photo-album-plus');
|
10470 |
+
$desc = __('Enable mailing users when a new album is created', 'wp-photo-album-plus');
|
10471 |
+
$help = '';
|
10472 |
+
$slug = 'wppa_newalbumnotify';
|
10473 |
+
$html = wppa_checkbox($slug);
|
10474 |
+
$clas = '';
|
10475 |
+
$tags = 'mail,album';
|
10476 |
+
wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
|
10477 |
+
|
10478 |
+
$name = __('Mail on upload', 'wp-photo-album-plus');
|
10479 |
+
$desc = __('Enable mailing users when a frontend upload has been done', 'wp-photo-album-plus');
|
10480 |
+
$help = esc_js(__('When moderation is required, the mails will be sent after approval', 'wp-photo-album-plus'));
|
10481 |
+
$slug = 'wppa_feuploadnotify';
|
10482 |
+
$html = wppa_checkbox($slug);
|
10483 |
+
$clas = '';
|
10484 |
+
$tags = 'upload,mail';
|
10485 |
+
wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
|
10486 |
+
/*
|
10487 |
+
$name = __('Mail on upload backend', 'wp-photo-album-plus');
|
10488 |
+
$desc = __('Notify admin at backend upload.', 'wp-photo-album-plus');
|
10489 |
+
$help = esc_js(__('If checked, admin will receive a notification by email.', 'wp-photo-album-plus'));
|
10490 |
+
$slug = 'wppa_upload_backend_notify';
|
10491 |
+
$html1 = wppa_checkbox($slug);
|
10492 |
+
$html2 = '';
|
10493 |
+
$html = array( $html1, $html2 );
|
10494 |
+
$clas = '';
|
10495 |
+
$tags = 'upload,mail';
|
10496 |
+
wppa_setting($slug, '2.1', $name, $desc, $html, $help, $clas, $tags);
|
10497 |
+
*/
|
10498 |
+
$name = __('Mail on comment', 'wp-photo-album-plus');
|
10499 |
+
$desc = __('Enable mailing users when a new comment has been added', 'wp-photo-album-plus');
|
10500 |
+
$help = esc_js(__('When moderation is required, the mails will be sent after approval', 'wp-photo-album-plus'));
|
10501 |
+
$slug = 'wppa_commentnotify';
|
10502 |
+
$html = wppa_checkbox($slug);
|
10503 |
+
$clas = '';
|
10504 |
+
$tags = 'comment,mail';
|
10505 |
+
wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags);
|
10506 |
+
|
10507 |
+
/*
|
10508 |
+
$name = __('Mail on comment: Subject', 'wp-photo-album-plus');
|
10509 |
+
$desc = __('The subject of the email.', 'wp-photo-album-plus');
|
10510 |
+
$help = '';
|
10511 |
+
$slug = 'wppa_commentapproved_subj';
|
10512 |
+
$html = wppa_input($slug, '300px;');
|
10513 |
+
$clas = '';
|
10514 |
+
$tags = 'comment,mail';
|
10515 |
+
wppa_setting($slug, '3.1', $name, $desc, $html, $help, $clas, $tags);
|
10516 |
+
|
10517 |
+
$name = __('Mail on comment: Content', 'wp-photo-album-plus');
|
10518 |
+
$desc = __('The content of the email.', 'wp-photo-album-plus');
|
10519 |
+
$help = esc_js(__('If you leave this blank, the default content will be used', 'wp-photo-album-plus'));
|
10520 |
+
$help .= '\n\n'.esc_js(__('The content may contain html.', 'wp-photo-album-plus'));
|
10521 |
+
$help .= '\n\n'.esc_js(__('You may use the following keywords: w#comment for the comment content, w#user for the commenters name and the standard photo description keywords w#name, w#filename, w#owner, w#id, w#tags, w#timestamp, w#modified, w#views, w#amx, w#amy, w#amfs, w#url, w#hrurl, w#tnurl, w#cc0..w#cc9, w#cd0..w#cd9.', 'wp-photo-album-plus'));
|
10522 |
+
$slug = 'wppa_commentapproved_text';
|
10523 |
+
$html = wppa_textarea($slug, $name);
|
10524 |
+
$clas = '';
|
10525 |
+
$tags = 'comment,mail';
|
10526 |
+
wppa_setting($slug, '3.2', $name, $desc, $html, $help, $clas, $tags);
|
10527 |
+
*//*
|
10528 |
+
$name = __('Mail on comment: Show commenter email', 'wp-photo-album-plus');
|
10529 |
+
$desc = __('Show the commenter\'s email in the notify emails.', 'wp-photo-album-plus');
|
10530 |
+
$help = esc_js(__('Shows the email address of the commenter in all notify emails.', 'wp-photo-album-plus'));
|
10531 |
+
$help .= '\n'.esc_js(__('If switched off, admin will still receive the senders email in the notification mail', 'wp-photo-album-plus'));
|
10532 |
+
$slug = 'wppa_mail_upl_email';
|
10533 |
+
$html = wppa_checkbox($slug);
|
10534 |
+
$clas = '';
|
10535 |
+
$tags = 'comment,layout,mail';
|
10536 |
+
wppa_setting($slug, '3.3', $name, $desc, $html, $help, $clas, $tags);
|
10537 |
+
*/
|
10538 |
+
$name = __('Mail on previous comment', 'wp-photo-album-plus');
|
10539 |
+
$desc = __('Notify users who has commented this photo earlier', 'wp-photo-album-plus');
|
10540 |
+
$help = '';
|
10541 |
+
$slug = 'wppa_commentprevious';
|
10542 |
+
$html = wppa_checkbox($slug);
|
10543 |
+
$tags = 'comment,mail';
|
10544 |
+
wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
|
10545 |
+
|
10546 |
+
$name = __('Mail on photo needs moderation', 'wp-photo-album-plus' );
|
10547 |
+
$desc = __('Notify moderators when a photo needs moderation', 'wp-photo-album-plus');
|
10548 |
+
$help = '';
|
10549 |
+
$slug = 'wppa_moderatephoto';
|
10550 |
+
$html = wppa_checkbox($slug);
|
10551 |
+
$tags = 'upload,mail';
|
10552 |
+
wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
|
10553 |
+
|
10554 |
+
$name = __('Mail on comment needs moderation', 'wp-photo-album-plus' );
|
10555 |
+
$desc = __('Notify moderators when a comment needs moderation', 'wp-photo-album-plus');
|
10556 |
+
$help = '';
|
10557 |
+
$slug = 'wppa_moderatecomment';
|
10558 |
+
$html = wppa_checkbox($slug);
|
10559 |
+
$tags = 'upload,mail';
|
10560 |
+
wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags);
|
10561 |
+
|
10562 |
+
$name = __('Mail on approve photo', 'wp-photo-album-plus');
|
10563 |
+
$desc = __('Send an email to the owner when a photo is approved', 'wp-photo-album-plus');
|
10564 |
+
$help = '';
|
10565 |
+
$slug = 'wppa_photoapproved';
|
10566 |
+
$html1 = wppa_checkbox($slug);
|
10567 |
+
$html2 = '';
|
10568 |
+
$html = array( $html1, $html2 );
|
10569 |
+
$clas = '';
|
10570 |
+
$tags = 'upload,mail';
|
10571 |
+
wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
|
10572 |
+
|
10573 |
+
$name = __('Mail on approve comment', 'wp-photo-album-plus');
|
10574 |
+
$desc = __('Notify photo owner and commenter of approved comment', 'wp-photo-album-plus');
|
10575 |
+
$help = '';
|
10576 |
+
$slug = 'wppa_commentapproved';
|
10577 |
+
$html = wppa_checkbox($slug);
|
10578 |
+
$clas = 'wppa_comment_';
|
10579 |
+
$tags = 'comment,mail';
|
10580 |
+
wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags);
|
10581 |
+
|
10582 |
+
|
10583 |
+
|
10584 |
+
$name = __( 'Email policy', 'wp-photo-album-plus' );
|
10585 |
+
$desc = __( 'Select either "opt-in" or "opt-out"', 'wp-photo-album-plus' );
|
10586 |
+
$help = __( 'If you select "opt-in", use the "Notify Me" widget to enable the users to subscribe to emails', 'wp-photo-album-plus' );
|
10587 |
+
$slug = 'wppa_mailinglist_policy';
|
10588 |
+
$opts = array( 'opt-in', 'opt-out' );
|
10589 |
+
$vals = array( 'opt-in', 'opt-out' );
|
10590 |
+
$html = wppa_select( $slug, $opts, $vals );
|
10591 |
+
$clas = '';
|
10592 |
+
$tags = 'mail';
|
10593 |
+
wppa_setting($slug, '98', $name, $desc, $html, $help, $clas, $tags);
|
10594 |
+
|
10595 |
+
|
10596 |
+
|
10597 |
+
$name = __( 'Email callback url', 'wp-photo-album-plus' );
|
10598 |
+
$desc = __( 'The link in emails will point to', 'wp-photo-album-plus' );
|
10599 |
+
$help = __( 'Recommendation', 'wp-photo-album-plus' ) . ': ' .
|
10600 |
+
__( 'Create a page with shortcode', 'wp-photo-album-plus' ) .
|
10601 |
+
'<b>[wppa type="landing"]</b>. ';
|
10602 |
+
$slug = 'wppa_mailinglist_callback_url';
|
10603 |
+
$html = wppa_input($slug, '90%');
|
10604 |
+
$clas = '';
|
10605 |
+
$tags = 'mail';
|
10606 |
+
wppa_setting($slug, '99', $name, $desc, $html, $help, $clas, $tags);
|
10607 |
+
|
10608 |
+
}
|
10609 |
+
|
10610 |
+
|
10611 |
|
10612 |
?>
|
10613 |
|
wppa-setup.php
CHANGED
@@ -590,8 +590,10 @@ global $silent;
|
|
590 |
}
|
591 |
|
592 |
if ( $old_rev <= '7000' ) {
|
593 |
-
|
|
|
594 |
}
|
|
|
595 |
}
|
596 |
|
597 |
// Set Defaults
|
@@ -1303,18 +1305,17 @@ cursorborder:'2px solid transparent',";
|
|
1303 |
'wppa_comment_login' => 'no',
|
1304 |
'wppa_comment_view_login' => 'no',
|
1305 |
'wppa_comments_desc' => 'no',
|
1306 |
-
'
|
1307 |
'wppa_comment_email_required' => 'required',
|
1308 |
-
'
|
1309 |
-
'
|
1310 |
-
'
|
1311 |
-
'
|
1312 |
-
'
|
1313 |
-
'wppa_comment_notify_added' => 'yes',
|
1314 |
'wppa_comten_alt_display' => 'no',
|
1315 |
'wppa_comten_alt_thumbsize' => '75',
|
1316 |
'wppa_comment_smiley_picker' => 'no',
|
1317 |
-
'wppa_mail_upl_email' => 'yes',
|
1318 |
'wppa_comment_clickable' => 'no',
|
1319 |
'wppa_comment_need_db_agree' => 'no',
|
1320 |
|
@@ -1498,7 +1499,7 @@ cursorborder:'2px solid transparent',";
|
|
1498 |
'wppa_user_album_edit_on' => 'no',
|
1499 |
'wppa_upload_moderate' => 'no',
|
1500 |
'wppa_fe_upload_private' => 'no',
|
1501 |
-
'
|
1502 |
'wppa_upload_edit' => '-none-',
|
1503 |
'wppa_upload_edit_users' => 'admin',
|
1504 |
'wppa_upload_edit_period' => '0',
|
@@ -1511,7 +1512,6 @@ cursorborder:'2px solid transparent',";
|
|
1511 |
'wppa_upload_delete' => 'no',
|
1512 |
'wppa_upload_delete_period' => '0',
|
1513 |
'wppa_owner_moderate_comment' => 'no',
|
1514 |
-
'wppa_upload_notify' => 'no',
|
1515 |
'wppa_upload_backend_notify' => 'no',
|
1516 |
'wppa_upload_one_only' => 'no',
|
1517 |
'wppa_memcheck' => 'yes',
|
@@ -1735,8 +1735,6 @@ cursorborder:'2px solid transparent',";
|
|
1735 |
'wppa_frontend_album_public' => 'no',
|
1736 |
'wppa_optimize_new' => 'no',
|
1737 |
'wppa_default_album_linktype' => 'content',
|
1738 |
-
'wppa_mail_new_album' => 'no',
|
1739 |
-
'wppa_mailinglist_newalbum_link' => '',
|
1740 |
|
1741 |
// E Search
|
1742 |
'wppa_search_linkpage' => '0', // 1
|
@@ -1854,6 +1852,17 @@ cursorborder:'2px solid transparent',";
|
|
1854 |
'wppa_photo_shortcode_random_fixed' => 'no',
|
1855 |
'wppa_photo_shortcode_random_fixed_html' => 'no',
|
1856 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1857 |
// Photo of the day widget
|
1858 |
'wppa_potd_title' => __('Photo of the day', 'wp-photo-album-plus'),
|
1859 |
'wppa_potd_widget_width' => '200',
|
@@ -1923,6 +1932,7 @@ function wppa_set_default( $value, $key ) {
|
|
1923 |
// Check if the required directories exist, if not, try to create them and optionally report it
|
1924 |
function wppa_check_dirs() {
|
1925 |
|
|
|
1926 |
if ( ! is_multisite() ) {
|
1927 |
// check if uploads dir exists
|
1928 |
$upload_dir = wp_upload_dir();
|
@@ -1939,6 +1949,7 @@ function wppa_check_dirs() {
|
|
1939 |
}
|
1940 |
wppa_chmod( $dir );
|
1941 |
}
|
|
|
1942 |
|
1943 |
// check if wppa dir exists
|
1944 |
$dir = WPPA_UPLOAD_PATH;
|
590 |
}
|
591 |
|
592 |
if ( $old_rev <= '7000' ) {
|
593 |
+
|
594 |
+
|
595 |
}
|
596 |
+
|
597 |
}
|
598 |
|
599 |
// Set Defaults
|
1305 |
'wppa_comment_login' => 'no',
|
1306 |
'wppa_comment_view_login' => 'no',
|
1307 |
'wppa_comments_desc' => 'no',
|
1308 |
+
'wppa_moderate_comment' => '-none-',
|
1309 |
'wppa_comment_email_required' => 'required',
|
1310 |
+
'wppa_commentprevious' => 'no',
|
1311 |
+
'wppa_commentapproved' => 'no',
|
1312 |
+
'wppa_commentapproved_text' => '',
|
1313 |
+
'wppa_commentapproved_subj' => '',
|
1314 |
+
'wppa_commentnotify_added' => 'yes',
|
|
|
1315 |
'wppa_comten_alt_display' => 'no',
|
1316 |
'wppa_comten_alt_thumbsize' => '75',
|
1317 |
'wppa_comment_smiley_picker' => 'no',
|
1318 |
+
// 'wppa_mail_upl_email' => 'yes',
|
1319 |
'wppa_comment_clickable' => 'no',
|
1320 |
'wppa_comment_need_db_agree' => 'no',
|
1321 |
|
1499 |
'wppa_user_album_edit_on' => 'no',
|
1500 |
'wppa_upload_moderate' => 'no',
|
1501 |
'wppa_fe_upload_private' => 'no',
|
1502 |
+
'wppa_photoapproved' => 'no',
|
1503 |
'wppa_upload_edit' => '-none-',
|
1504 |
'wppa_upload_edit_users' => 'admin',
|
1505 |
'wppa_upload_edit_period' => '0',
|
1512 |
'wppa_upload_delete' => 'no',
|
1513 |
'wppa_upload_delete_period' => '0',
|
1514 |
'wppa_owner_moderate_comment' => 'no',
|
|
|
1515 |
'wppa_upload_backend_notify' => 'no',
|
1516 |
'wppa_upload_one_only' => 'no',
|
1517 |
'wppa_memcheck' => 'yes',
|
1735 |
'wppa_frontend_album_public' => 'no',
|
1736 |
'wppa_optimize_new' => 'no',
|
1737 |
'wppa_default_album_linktype' => 'content',
|
|
|
|
|
1738 |
|
1739 |
// E Search
|
1740 |
'wppa_search_linkpage' => '0', // 1
|
1852 |
'wppa_photo_shortcode_random_fixed' => 'no',
|
1853 |
'wppa_photo_shortcode_random_fixed_html' => 'no',
|
1854 |
|
1855 |
+
// M Mails
|
1856 |
+
'wppa_newalbumnotify' => 'no',
|
1857 |
+
'wppa_feuploadnotify' => 'no',
|
1858 |
+
'wppa_commentnotify' => 'no',
|
1859 |
+
'wppa_moderatephoto' => 'no',
|
1860 |
+
'wppa_moderatecomment' => 'no',
|
1861 |
+
|
1862 |
+
'wppa_mailinglist_policy' => 'opt-in',
|
1863 |
+
'wppa_mailinglist_callback_url' => '',
|
1864 |
+
|
1865 |
+
|
1866 |
// Photo of the day widget
|
1867 |
'wppa_potd_title' => __('Photo of the day', 'wp-photo-album-plus'),
|
1868 |
'wppa_potd_widget_width' => '200',
|
1932 |
// Check if the required directories exist, if not, try to create them and optionally report it
|
1933 |
function wppa_check_dirs() {
|
1934 |
|
1935 |
+
/* wp_upload_dir() gives wrong result when provider moves site. wp bug.
|
1936 |
if ( ! is_multisite() ) {
|
1937 |
// check if uploads dir exists
|
1938 |
$upload_dir = wp_upload_dir();
|
1949 |
}
|
1950 |
wppa_chmod( $dir );
|
1951 |
}
|
1952 |
+
*/
|
1953 |
|
1954 |
// check if wppa dir exists
|
1955 |
$dir = WPPA_UPLOAD_PATH;
|
wppa-upload.php
CHANGED
@@ -568,7 +568,7 @@ global $upload_album;
|
|
568 |
$uploaded_a_file = true;
|
569 |
$count++;
|
570 |
wppa_pdf_postprocess( $id );
|
571 |
-
wppa_backend_upload_mail( $id, $upload_album, wppa_sima($file['name'][$i]) );
|
572 |
}
|
573 |
else {
|
574 |
wppa_error_message( __( 'Error inserting photo' , 'wp-photo-album-plus') . ' ' . wppa_sanitize_file_name( wppa_sima( basename( $file['name'][$i] ) ) ) . '.' );
|
@@ -605,7 +605,7 @@ global $upload_album;
|
|
605 |
$uploaded_a_file = true;
|
606 |
$count++;
|
607 |
wppa_pdf_postprocess( $id );
|
608 |
-
wppa_backend_upload_mail( $id, $upload_album, wppa_sima( $file['name'] ) );
|
609 |
}
|
610 |
else {
|
611 |
wppa_error_message( __( 'Error inserting photo' , 'wp-photo-album-plus') . ' ' . wppa_sanitize_file_name( basename( $file['name'] ) ) . '.' );
|
@@ -622,7 +622,7 @@ global $upload_album;
|
|
622 |
|
623 |
// Send emails after backend upload
|
624 |
function wppa_backend_upload_mail( $id, $alb, $name ) {
|
625 |
-
|
626 |
$owner = wppa_get_user();
|
627 |
if ( $owner == 'admin' ) return; // Admin does not send mails to himself
|
628 |
|
568 |
$uploaded_a_file = true;
|
569 |
$count++;
|
570 |
wppa_pdf_postprocess( $id );
|
571 |
+
// wppa_backend_upload_mail( $id, $upload_album, wppa_sima($file['name'][$i]) );
|
572 |
}
|
573 |
else {
|
574 |
wppa_error_message( __( 'Error inserting photo' , 'wp-photo-album-plus') . ' ' . wppa_sanitize_file_name( wppa_sima( basename( $file['name'][$i] ) ) ) . '.' );
|
605 |
$uploaded_a_file = true;
|
606 |
$count++;
|
607 |
wppa_pdf_postprocess( $id );
|
608 |
+
// wppa_backend_upload_mail( $id, $upload_album, wppa_sima( $file['name'] ) );
|
609 |
}
|
610 |
else {
|
611 |
wppa_error_message( __( 'Error inserting photo' , 'wp-photo-album-plus') . ' ' . wppa_sanitize_file_name( basename( $file['name'] ) ) . '.' );
|
622 |
|
623 |
// Send emails after backend upload
|
624 |
function wppa_backend_upload_mail( $id, $alb, $name ) {
|
625 |
+
return;
|
626 |
$owner = wppa_get_user();
|
627 |
if ( $owner == 'admin' ) return; // Admin does not send mails to himself
|
628 |
|
wppa-utils.php
CHANGED
@@ -928,85 +928,6 @@ global $wpdb;
|
|
928 |
return $count;
|
929 |
}
|
930 |
|
931 |
-
// Send the owner of a photo an email telling he has a new approved comment
|
932 |
-
// $id is comment id.
|
933 |
-
function wppa_send_comment_approved_email( $id ) {
|
934 |
-
global $wpdb;
|
935 |
-
|
936 |
-
// Feature enabled?
|
937 |
-
if ( ! wppa_switch( 'com_notify_approved' ) ) return;
|
938 |
-
|
939 |
-
// Get comment
|
940 |
-
$com = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments WHERE id = %d", $id ), ARRAY_A );
|
941 |
-
if ( ! $com ) return;
|
942 |
-
|
943 |
-
// Get photo owner
|
944 |
-
$owner = wppa_get_photo_item( $com['photo'], 'owner' );
|
945 |
-
if ( ! $owner ) return;
|
946 |
-
|
947 |
-
// Get email
|
948 |
-
$user = wppa_get_user_by( 'login', $owner );
|
949 |
-
if ( ! $user ) return;
|
950 |
-
|
951 |
-
// Custom content?
|
952 |
-
if ( wppa_opt( 'com_notify_approved_text' ) ) {
|
953 |
-
|
954 |
-
// The subject
|
955 |
-
$subject = wppa_opt( 'com_notify_approved_subj' );
|
956 |
-
|
957 |
-
// The content
|
958 |
-
$content = wppa_opt( 'com_notify_approved_text' );
|
959 |
-
$content = str_replace( 'w#comment', $com['comment'], $content );
|
960 |
-
$content = str_replace( 'w#user', $com['user'], $content );
|
961 |
-
$content = wppa_translate_photo_keywords( $com['photo'], $content );
|
962 |
-
|
963 |
-
// Try to send it with extra headers and with html
|
964 |
-
$iret = wp_mail( $user->user_email,
|
965 |
-
$subject,
|
966 |
-
$content,
|
967 |
-
array( 'Content-Type: text/html; charset=UTF-8' ),
|
968 |
-
'' );
|
969 |
-
if ( $iret ) return;
|
970 |
-
|
971 |
-
// Failed
|
972 |
-
if ( ! wppa_is_cron() ) {
|
973 |
-
// echo 'Mail sending Failed';
|
974 |
-
// echo 'Subj='.$subject.', content='.$content;
|
975 |
-
wppa_process_failed_mail( $user->user_email,
|
976 |
-
$subject,
|
977 |
-
$content,
|
978 |
-
array( 'Content-Type: text/html; charset=UTF-8' ),
|
979 |
-
'' );
|
980 |
-
}
|
981 |
-
|
982 |
-
return;
|
983 |
-
}
|
984 |
-
|
985 |
-
|
986 |
-
// Make email text
|
987 |
-
$content =
|
988 |
-
'<h3>' .
|
989 |
-
__('Your photo has a new approved comment', 'wp-photo-album-plus') .
|
990 |
-
'</h3>' .
|
991 |
-
'<h3>' .
|
992 |
-
__('From:', 'wp-photo-album-plus') . ' ' . $com['user'] .
|
993 |
-
'</h3>' .
|
994 |
-
'<h3>' .
|
995 |
-
__('Comment:', 'wp-photo-album-plus') .
|
996 |
-
'</h3>' .
|
997 |
-
'<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" ><em> '.stripslashes($com['comment']).'</em></blockquote>';
|
998 |
-
|
999 |
-
// Send mail
|
1000 |
-
if ( wppa_is_user_in_mailinglist( $owner, 'commentapproved' ) ) {
|
1001 |
-
wppa_send_mail( array( 'to' => $user->user_email,
|
1002 |
-
'subj' => __( 'Approved comment on photo', 'wp-photo-album-plus' ),
|
1003 |
-
'cont' => $content,
|
1004 |
-
'photo' => $com['photo'],
|
1005 |
-
'email' => 'void'
|
1006 |
-
));
|
1007 |
-
}
|
1008 |
-
|
1009 |
-
}
|
1010 |
|
1011 |
|
1012 |
function wppa_get_imgalt( $id, $lb = false ) {
|
928 |
return $count;
|
929 |
}
|
930 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
931 |
|
932 |
|
933 |
function wppa_get_imgalt( $id, $lb = false ) {
|
wppa-widget-functions.php
CHANGED
@@ -327,7 +327,7 @@ static $potd;
|
|
327 |
}
|
328 |
|
329 |
// Get widget checkbox html
|
330 |
-
function wppa_widget_checkbox( $class, $item, $value, $label, $subtext = '', $disabled = false ) {
|
331 |
|
332 |
$result =
|
333 |
'<p style="clear:both;" >' .
|
@@ -337,6 +337,7 @@ function wppa_widget_checkbox( $class, $item, $value, $label, $subtext = '', $di
|
|
337 |
' type="checkbox"' .
|
338 |
wppa_checked( $value ) .
|
339 |
( $disabled ? ' disabled="disabled"' : '' ) .
|
|
|
340 |
' /> ' .
|
341 |
'<label' .
|
342 |
' for="' . $class->get_field_id( $item ) . '"' .
|
327 |
}
|
328 |
|
329 |
// Get widget checkbox html
|
330 |
+
function wppa_widget_checkbox( $class, $item, $value, $label, $subtext = '', $disabled = false, $onchange = '' ) {
|
331 |
|
332 |
$result =
|
333 |
'<p style="clear:both;" >' .
|
337 |
' type="checkbox"' .
|
338 |
wppa_checked( $value ) .
|
339 |
( $disabled ? ' disabled="disabled"' : '' ) .
|
340 |
+
( $onchange ? ' onchange="' . esc_attr( $onchange ) . '"' : '' ) .
|
341 |
' /> ' .
|
342 |
'<label' .
|
343 |
' for="' . $class->get_field_id( $item ) . '"' .
|
wppa-wpdb-insert.php
CHANGED
@@ -454,7 +454,7 @@ global $wpdb;
|
|
454 |
// Update index
|
455 |
wppa_schedule_maintenance_proc( 'wppa_remake_index_albums' );
|
456 |
wppa_clear_cache();
|
457 |
-
wppa_schedule_mailinglist( '
|
458 |
|
459 |
return $args['id'];
|
460 |
}
|
454 |
// Update index
|
455 |
wppa_schedule_maintenance_proc( 'wppa_remake_index_albums' );
|
456 |
wppa_clear_cache();
|
457 |
+
wppa_schedule_mailinglist( 'newalbumnotify', $args['id'] );
|
458 |
|
459 |
return $args['id'];
|
460 |
}
|
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.00.
|
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 = '7000'; // WPPA db version
|
26 |
-
global $wppa_api_version; $wppa_api_version = '7-0-00-
|
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.00.016
|
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 = '7000'; // WPPA db version
|
26 |
+
global $wppa_api_version; $wppa_api_version = '7-0-00-016'; // WPPA software version
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|