WP Photo Album Plus - Version 7.7.05.002

Version Description

= 7.7.05 =

  • This version addresses various minor bug fixes and feature requests.
Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 7.7.05.002
Comparing to
See all releases

Code changes from version 7.7.05.001 to 7.7.05.002

changelog.txt CHANGED
@@ -4,6 +4,8 @@ WP Photo Album Plus Changelog
4
 
5
  * The 'You can see the photo here' link on moderate comment request mailings did not work. Fixed.
6
  * The logfile admin page will now be updated every 5 seconds.
 
 
7
 
8
  = 7.7.04 =
9
 
4
 
5
  * The 'You can see the photo here' link on moderate comment request mailings did not work. Fixed.
6
  * The logfile admin page will now be updated every 5 seconds.
7
+ * On the Album Admin -> Edit album information page you can now schedule a time to delete an album.
8
+ * When a deleted photo is being undeleted and the original album has been removed, it will be re-created with default settings and with paren set to ---separate---
9
 
10
  = 7.7.04 =
11
 
js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 7.7.05.001
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -1521,7 +1521,18 @@ function wppaChangeScheduleAlbum(album, elem) {
1521
  }
1522
  else {
1523
  jQuery('.wppa-datetime-'+album).css('display', 'none');
1524
- wppaAjaxUpdateAlbum(album, 'scheduledtm', document.getElementById('wppa-dummy') );
 
 
 
 
 
 
 
 
 
 
 
1525
  }
1526
  }
1527
 
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 7.7.05.002
5
  /* Various js routines used in admin pages
6
  */
7
 
1521
  }
1522
  else {
1523
  jQuery('.wppa-datetime-'+album).css('display', 'none');
1524
+ wppaAjaxUpdateAlbum(album, 'scheduledtm', Math.rand() );
1525
+ }
1526
+ }
1527
+
1528
+ function wppaChangeScheduleDelAlbum(album, elem) {
1529
+ var onoff = jQuery(elem).prop('checked');
1530
+ if ( onoff ) {
1531
+ jQuery('.wppa-datetimedel-'+album).css('display', 'inline');
1532
+ }
1533
+ else {
1534
+ jQuery('.wppa-datetimedel-'+album).css('display', 'none');
1535
+ wppaAjaxUpdateAlbum(album, 'scheduledel', Math.rand() );
1536
  }
1537
  }
1538
 
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",wppaCropper=[];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,i,t,o){document.getElementById("wppa-re-up-form-"+i);var p=document.getElementById("wppa-re-up-file-"+i),l=document.getElementById("wppa-re-up-butn-"+i);e.preventDefault();p=p.files[0];if(p.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+p.name);else if(p.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+i).css("display","none");l.value="Uploading...",l.style.color="black";t=new FormData;t.append("photo",p,p.name);var s=new XMLHttpRequest,p="?action=wppa&wppa-action=update-photo&photo-id="+i+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+i).value;s.open("POST",wppaAjaxUrl+p,!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":var t,p,a,n=JSON.parse(e[2]);for(t in n)switch(a=n[t],t){case"remark":a=(a=(a=a.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),p="0"!=e[1]?'<span style="color:red;" >'+a+"</span>":'<span style="color:green;" >'+a+"</span>",o&&(p+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+i).html(p);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(a):jQuery("#photourl-"+i).attr("src",a),jQuery("#thumba-"+i).attr("href",a);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",a);break;case"magickstack":jQuery("#magickstack-"+i).html(a),0<a.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+t+"-"+i).html(a)}l.value="Upload",jQuery("#re-up-"+i).css("display","none");break;case"99":document.getElementById("photoitem-"+i).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+i).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",l.value="Error occured",l.style.color="red"}}else alert("An error occurred!")},s.send(t)}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(),wppaCheckAlbumNavigatorWidgetLink(),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","X","Y");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for(("on"==p?wppaShowTable:wppaHideTable)(table),subtab=0;subtab<15;subtab++)"on"==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","L","M","X","Y");for(table=1;table<13;table++)for((table<13?wppaShowTable:wppaHideTable)(table),wppa_tablecookieoff(table),subtab=0;subtab<15;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){e=e.substring(5);document.getElementById(e).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",e=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",e)}function wppaCheckWidgetMethod(){var e,t,p;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(p=jQuery("#wppa-wp").val())||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function 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;e||t?(jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display",""),"txt"==(t=document.getElementById("bc_separator").value)?(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"==t?(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"))):(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 wppaCheckAlbumNavigatorWidgetLink(){var e=document.getElementById("album_navigator_widget_linktype").value;"lightbox"==e?jQuery(".wppa_anwlp").css("visibility","hidden"):jQuery(".wppa_anwlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_anwlb").css("visibility","hidden"):jQuery(".wppa_anwlb").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),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,p){var a="",n="",a=e||'<div style="padding-left:5px;" >';p?n=p:aftrer="</div>",wppaFeAjaxLog("in");var i=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;p+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,i.open("GET",p,!0),i.send(),i.onreadystatechange=function(){switch(i.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==i.status?("ER"==(e=wppaTrim(i.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=a+e[2]+n,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=a+'<span style="color:red;" >Comm error '+i.status+": "+i.statusText+"</span>"+n}}}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("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==p.status?("ER"==(e=wppaTrim(p.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+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 n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),p&&(n+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(n),a.onreadystatechange=function(){var e;4==a.readyState&&(200==a.status?(""!=(e=wppaTrim(a.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")}}function wppaAjaxUpdateIptc(s,e,t,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+s+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(t)+"&tagname="+p,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+s).html("Working, please wait...")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),"99"===a[1])jQuery("#photoitem-"+s).html(bef+'<span style="color:red">'+a[2]+"</span>"+aft);else{var n,i,o,l=JSON.parse(a[2]);for(n in l)switch(o=l[n],n){case"remark":o=(o=(o=o.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),i="0"!=a[1]?'<span style="color:red;" >'+o+"</span>":'<span style="color:green;" >'+o+"</span>",jQuery("#remark-"+s).html(i);break;case"photourl":wppaCropper[s]?wppaCropper[s].replace(o):jQuery("#photourl-"+s).attr("src",o),jQuery("#thumba-"+s).attr("href",o);break;case"thumburl":jQuery("#thumburl-"+s).attr("src",o);break;case"magickstack":jQuery("#magickstack-"+s).html(o),0<o.length?jQuery("#imstackbutton-"+s).css("display","inline"):jQuery("#imstackbutton-"+s).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,p){jQuery("#remark-"+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 wppaAjaxUpdatePhoto(s,r,e,u,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+s+"&item="+r+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==r&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#remark-"+s).html("Working, please wait...")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),"99"===a[1])jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+a[2]+"</span>"+d);else{var n,i,o,l=JSON.parse(a[2]);for(n in l)switch(o=l[n],n){case"remark":o=(o=(o=o.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),i="0"!=a[1]?'<span style="color:red;" >'+o+"</span>":'<span style="color:green;" >'+o+"</span>",u&&(i+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+s).html(i);break;case"photourl":wppaCropper[s]?wppaCropper[s].replace(o):jQuery("#photourl-"+s).attr("src",o),jQuery("#thumba-"+s).attr("href",o);break;case"thumburl":jQuery("#thumburl-"+s).attr("src",o);break;case"magickstack":jQuery("#magickstack-"+s).html(o),0<o.length?jQuery("#imstackbutton-"+s).css("display","inline"):jQuery("#imstackbutton-"+s).css("display","none");break;default:jQuery("#"+n+"-"+s).html(o)}}"description"==r&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,p){jQuery("#remark-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){u?document.location.reload(!0):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"),u&&setTimeout(function(){document.location.reload(!0)},200))}})}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")))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,p,a){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var i=wppaAlbumUpdateMatrix.length,o=0,l=!1,s=-1;o<i;)wppaAlbumUpdateMatrix[o][0]==e&&wppaAlbumUpdateMatrix[o][1]==t&&(l=!0,s=o),o++;l||(wppaAlbumUpdateMatrix[i]=[e,t,"undefined",!1,!1,a],s=i),wppaAlbumUpdateMatrix[s][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[s][5]=a,wppaAjaxUpdateAlbumMonitor(n)}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(o,l,s,r,u){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+o+"&item="+l+"&wppa-nonce="+document.getElementById("album-nonce-"+o).value+"&value="+wppaEncode(s),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+o).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,p){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+o).html(e[2]):jQuery("#albumstatus-"+o).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+o).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),u&&"0"==e[1])return jQuery("#albumstatus-"+o).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 a=0,n=-1,i=wppaAlbumUpdateMatrix.length;a<i;)wppaAlbumUpdateMatrix[a][0]==o&&wppaAlbumUpdateMatrix[a][1]==l&&(n=a),a++;wppaAlbumUpdateMatrix[n][2]=s||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(r)},error:function(e,t,p){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+o).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(),e=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(){var e;4==a.readyState&&(200==a.status?(""!=(e=wppaTrim(a.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+p).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"))},a.open("GET",e,!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("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=p.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+p.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+p.status)),wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(a,e,o){if(!o&&!e&&"yes"==document.getElementById(a+"_continue").value)return document.getElementById(a+"_continue").value="no",document.getElementById(a+"_button").value="Start!",void(0<jQuery("#"+a+"_togo").html()&&(jQuery("#"+a+"_status").html("Pausing..."),jQuery("#"+a+"_button").css("display","none")));o||(document.getElementById(a+"_continue").value="yes",document.getElementById(a+"_button").value="Stop!",""==jQuery("#"+a+"_status").html()&&jQuery("#"+a+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(o?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("||"),n=a[1],i=!1;return n?(10<a[0].length&&(alert("An error occurred:\n"+a[0]),i=!0),jQuery("#"+n+"_status").html(a[2]),jQuery("#"+n+"_togo").html(a[3]),jQuery("#"+n+"_button").css("display",""),i||"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('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?o||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', 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 = "+a+", Error = "+p+", status = "+t,"force"),jQuery("#"+a+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==a&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==a&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==a&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+a+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(e),4==p.readyState&&200==p.status&&(p=(e=wppaEntityDecode(p.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").html("<h2>"+p+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText))}function wppaAjaxUpdateOptionValue(s,e,t){var p="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(s)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(p+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+s,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,p){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+s.replace("#","H")).attr("title",e[2]),e[4])for(var a,n,i,o=e[4].split(";"),l=0;l<o.length;)a=o[l].split(":"),n=jQuery("#"+a[0]).html(),i=a[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("#"+a[0]).html(i),l++},error:function(e){jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+s).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=s&&"icon_corner_style"!=s||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=s&&"svg_bg_color"!=s||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=s&&"ovl_svg_bg_color"!=s||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(a=(a=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),p=0,a="";p<t.length;)a+=t[p],++p<t.length&&(a+="||PLUS||");return a}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),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){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var p,a="",n=-1,i=-2,o=0,l=!1,s=0;s<e.length;)0!=(p=e[s].valueOf())&&(o=n,p==++o?l=!0:l?(a+=n==i?t+n+t+p:t+t+n+t+p,l=!1):a+=t+p,l||(i=p,i++),n=p),s++;for(l&&(a+=".."+n);"."==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=[],n=0,i=0;for(t=t||".",p=jQuery(e),i=n=0;n<p.length;)p[n].selected&&(a[i]=p[n].value,i++),n++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(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){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[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(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+n+"_togo").html(a[0]);e=jQuery("#"+n+"_status").html(),a=a[1];""!=e&&""==a&&(a='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(a),setTimeout(function(){wppaAjaxUpdateTogo(n)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"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,a){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){e=e.split("|");jQuery("#"+a).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var p=0,a=0;function n(e){(e=e||window.event).preventDefault(),p=a-e.clientY,a=e.clientY,t.style.top=t.offsetTop-p+"px"}function i(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,a=e.clientY,document.onmouseup=i,document.onmousemove=n}}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,p){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}
1
+ var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album",wppaCropper=[];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,i,t,o){document.getElementById("wppa-re-up-form-"+i);var p=document.getElementById("wppa-re-up-file-"+i),l=document.getElementById("wppa-re-up-butn-"+i);e.preventDefault();p=p.files[0];if(p.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+p.name);else if(p.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+i).css("display","none");l.value="Uploading...",l.style.color="black";t=new FormData;t.append("photo",p,p.name);var s=new XMLHttpRequest,p="?action=wppa&wppa-action=update-photo&photo-id="+i+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+i).value;s.open("POST",wppaAjaxUrl+p,!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":var t,p,a,n=JSON.parse(e[2]);for(t in n)switch(a=n[t],t){case"remark":a=(a=(a=a.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),p="0"!=e[1]?'<span style="color:red;" >'+a+"</span>":'<span style="color:green;" >'+a+"</span>",o&&(p+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+i).html(p);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(a):jQuery("#photourl-"+i).attr("src",a),jQuery("#thumba-"+i).attr("href",a);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",a);break;case"magickstack":jQuery("#magickstack-"+i).html(a),0<a.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+t+"-"+i).html(a)}l.value="Upload",jQuery("#re-up-"+i).css("display","none");break;case"99":document.getElementById("photoitem-"+i).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+i).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",l.value="Error occured",l.style.color="red"}}else alert("An error occurred!")},s.send(t)}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(),wppaCheckAlbumNavigatorWidgetLink(),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","X","Y");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for(("on"==p?wppaShowTable:wppaHideTable)(table),subtab=0;subtab<15;subtab++)"on"==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","L","M","X","Y");for(table=1;table<13;table++)for((table<13?wppaShowTable:wppaHideTable)(table),wppa_tablecookieoff(table),subtab=0;subtab<15;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){e=e.substring(5);document.getElementById(e).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",e=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",e)}function wppaCheckWidgetMethod(){var e,t,p;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(p=jQuery("#wppa-wp").val())||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function 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;e||t?(jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display",""),"txt"==(t=document.getElementById("bc_separator").value)?(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"==t?(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"))):(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 wppaCheckAlbumNavigatorWidgetLink(){var e=document.getElementById("album_navigator_widget_linktype").value;"lightbox"==e?jQuery(".wppa_anwlp").css("visibility","hidden"):jQuery(".wppa_anwlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_anwlb").css("visibility","hidden"):jQuery(".wppa_anwlb").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),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,p){var a="",n="",a=e||'<div style="padding-left:5px;" >';p?n=p:aftrer="</div>",wppaFeAjaxLog("in");var i=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;p+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,i.open("GET",p,!0),i.send(),i.onreadystatechange=function(){switch(i.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==i.status?("ER"==(e=wppaTrim(i.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=a+e[2]+n,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=a+'<span style="color:red;" >Comm error '+i.status+": "+i.statusText+"</span>"+n}}}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("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==p.status?("ER"==(e=wppaTrim(p.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+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 n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),p&&(n+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(n),a.onreadystatechange=function(){var e;4==a.readyState&&(200==a.status?(""!=(e=wppaTrim(a.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")}}function wppaAjaxUpdateIptc(s,e,t,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+s+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(t)+"&tagname="+p,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+s).html("Working, please wait...")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),"99"===a[1])jQuery("#photoitem-"+s).html(bef+'<span style="color:red">'+a[2]+"</span>"+aft);else{var n,i,o,l=JSON.parse(a[2]);for(n in l)switch(o=l[n],n){case"remark":o=(o=(o=o.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),i="0"!=a[1]?'<span style="color:red;" >'+o+"</span>":'<span style="color:green;" >'+o+"</span>",jQuery("#remark-"+s).html(i);break;case"photourl":wppaCropper[s]?wppaCropper[s].replace(o):jQuery("#photourl-"+s).attr("src",o),jQuery("#thumba-"+s).attr("href",o);break;case"thumburl":jQuery("#thumburl-"+s).attr("src",o);break;case"magickstack":jQuery("#magickstack-"+s).html(o),0<o.length?jQuery("#imstackbutton-"+s).css("display","inline"):jQuery("#imstackbutton-"+s).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,p){jQuery("#remark-"+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 wppaAjaxUpdatePhoto(s,r,e,u,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+s+"&item="+r+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==r&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#remark-"+s).html("Working, please wait...")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),"99"===a[1])jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+a[2]+"</span>"+d);else{var n,i,o,l=JSON.parse(a[2]);for(n in l)switch(o=l[n],n){case"remark":o=(o=(o=o.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),i="0"!=a[1]?'<span style="color:red;" >'+o+"</span>":'<span style="color:green;" >'+o+"</span>",u&&(i+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+s).html(i);break;case"photourl":wppaCropper[s]?wppaCropper[s].replace(o):jQuery("#photourl-"+s).attr("src",o),jQuery("#thumba-"+s).attr("href",o);break;case"thumburl":jQuery("#thumburl-"+s).attr("src",o);break;case"magickstack":jQuery("#magickstack-"+s).html(o),0<o.length?jQuery("#imstackbutton-"+s).css("display","inline"):jQuery("#imstackbutton-"+s).css("display","none");break;default:jQuery("#"+n+"-"+s).html(o)}}"description"==r&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,p){jQuery("#remark-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){u?document.location.reload(!0):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"),u&&setTimeout(function(){document.location.reload(!0)},200))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,p,a){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var i=wppaAlbumUpdateMatrix.length,o=0,l=!1,s=-1;o<i;)wppaAlbumUpdateMatrix[o][0]==e&&wppaAlbumUpdateMatrix[o][1]==t&&(l=!0,s=o),o++;l||(wppaAlbumUpdateMatrix[i]=[e,t,"undefined",!1,!1,a],s=i),wppaAlbumUpdateMatrix[s][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[s][5]=a,wppaAjaxUpdateAlbumMonitor(n)}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(o,l,s,r,u){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+o+"&item="+l+"&wppa-nonce="+document.getElementById("album-nonce-"+o).value+"&value="+wppaEncode(s),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+o).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,p){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+o).html(e[2]):jQuery("#albumstatus-"+o).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+o).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),u&&"0"==e[1])return jQuery("#albumstatus-"+o).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 a=0,n=-1,i=wppaAlbumUpdateMatrix.length;a<i;)wppaAlbumUpdateMatrix[a][0]==o&&wppaAlbumUpdateMatrix[a][1]==l&&(n=a),a++;wppaAlbumUpdateMatrix[n][2]=s||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(r)},error:function(e,t,p){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+o).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(),e=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(){var e;4==a.readyState&&(200==a.status?(""!=(e=wppaTrim(a.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+p).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"))},a.open("GET",e,!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("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=p.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+p.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+p.status)),wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(a,e,o){if(!o&&!e&&"yes"==document.getElementById(a+"_continue").value)return document.getElementById(a+"_continue").value="no",document.getElementById(a+"_button").value="Start!",void(0<jQuery("#"+a+"_togo").html()&&(jQuery("#"+a+"_status").html("Pausing..."),jQuery("#"+a+"_button").css("display","none")));o||(document.getElementById(a+"_continue").value="yes",document.getElementById(a+"_button").value="Stop!",""==jQuery("#"+a+"_status").html()&&jQuery("#"+a+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(o?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("||"),n=a[1],i=!1;return n?(10<a[0].length&&(alert("An error occurred:\n"+a[0]),i=!0),jQuery("#"+n+"_status").html(a[2]),jQuery("#"+n+"_togo").html(a[3]),jQuery("#"+n+"_button").css("display",""),i||"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('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?o||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', 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 = "+a+", Error = "+p+", status = "+t,"force"),jQuery("#"+a+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==a&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==a&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==a&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+a+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(e),4==p.readyState&&200==p.status&&(p=(e=wppaEntityDecode(p.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").html("<h2>"+p+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText))}function wppaAjaxUpdateOptionValue(s,e,t){var p="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(s)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(p+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+s,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,p){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+s.replace("#","H")).attr("title",e[2]),e[4])for(var a,n,i,o=e[4].split(";"),l=0;l<o.length;)a=o[l].split(":"),n=jQuery("#"+a[0]).html(),i=a[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("#"+a[0]).html(i),l++},error:function(e){jQuery("#img_"+s.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+s).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=s&&"icon_corner_style"!=s||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=s&&"svg_bg_color"!=s||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=s&&"ovl_svg_bg_color"!=s||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(a=(a=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),p=0,a="";p<t.length;)a+=t[p],++p<t.length&&(a+="||PLUS||");return a}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),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){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var p,a="",n=-1,i=-2,o=0,l=!1,s=0;s<e.length;)0!=(p=e[s].valueOf())&&(o=n,p==++o?l=!0:l?(a+=n==i?t+n+t+p:t+t+n+t+p,l=!1):a+=t+p,l||(i=p,i++),n=p),s++;for(l&&(a+=".."+n);"."==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=[],n=0,i=0;for(t=t||".",p=jQuery(e),i=n=0;n<p.length;)p[n].selected&&(a[i]=p[n].value,i++),n++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(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){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[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(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+n+"_togo").html(a[0]);e=jQuery("#"+n+"_status").html(),a=a[1];""!=e&&""==a&&(a='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(a),setTimeout(function(){wppaAjaxUpdateTogo(n)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"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,a){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){e=e.split("|");jQuery("#"+a).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var p=0,a=0;function n(e){(e=e||window.event).preventDefault(),p=a-e.clientY,a=e.clientY,t.style.top=t.offsetTop-p+"px"}function i(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,a=e.clientY,document.onmouseup=i,document.onmousemove=n}}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,p){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 7.7.05.001
6
  *
7
  */
8
 
@@ -1540,12 +1540,36 @@ global $wppa;
1540
  }
1541
  $album = $wpdb->get_var( $wpdb->prepare( "SELECT album FROM $wpdb->wppa_photos
1542
  WHERE id = %d", $photo ) );
 
 
1543
  if ( wppa_is_int( $album ) && $album < '-9' ) {
1544
- wppa_update_photo( array( 'id' => $photo, 'album' => - ( $album + '9' ) ) );
1545
- wppa_invalidate_treecounts( - ( $album + '9' ) );
1546
- echo '||1||<span style="color:red" >'.sprintf( __( 'Photo %s has been undeleted' , 'wp-photo-album-plus'), $photo ).'</span>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1547
  }
1548
- else {
 
1549
  echo '||1||<span style="color:red" >'.sprintf( __( 'Could not undelete photo %s' , 'wp-photo-album-plus'), $photo ).'</span>';
1550
  }
1551
  wppa_clear_cache();
@@ -1781,6 +1805,30 @@ global $wppa;
1781
  wppa_exit();
1782
  break;
1783
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1784
  case 'setallscheduled':
1785
  $scheduledtm = $wpdb->get_var( $wpdb->prepare( "SELECT scheduledtm
1786
  FROM $wpdb->wppa_albums
@@ -1840,6 +1888,15 @@ global $wppa;
1840
  wppa_exit();
1841
  break;
1842
 
 
 
 
 
 
 
 
 
 
1843
  default:
1844
  $itemname = $item;
1845
  }
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 7.7.05.002
6
  *
7
  */
8
 
1540
  }
1541
  $album = $wpdb->get_var( $wpdb->prepare( "SELECT album FROM $wpdb->wppa_photos
1542
  WHERE id = %d", $photo ) );
1543
+
1544
+ $album_exists = true;
1545
  if ( wppa_is_int( $album ) && $album < '-9' ) {
1546
+
1547
+ $real_alb = - ( $album + '9' );
1548
+
1549
+ // Check if album exists, otherwise recreate it, assume it works, otherwise say the photo could not be recovered
1550
+ if ( ! wppa_album_exists( $real_alb ) ) {
1551
+ $iret =
1552
+ wppa_create_album_entry(
1553
+ array( 'id' => $real_alb,
1554
+ 'a_parent' => '-1',
1555
+ 'name' => __( 'Recovered deleted album', 'wp-photo-album-plus' ),
1556
+ 'description' => __( 'Automatically created album when a deleted photo was recovered and the original album did no longer exist', 'wp-photo-album-plus' )
1557
+ )
1558
+ );
1559
+ }
1560
+
1561
+ if ( ! $iret ) {
1562
+ $album_exists = false;
1563
+ }
1564
+
1565
+ if ( $album_exists ) {
1566
+ wppa_update_photo( array( 'id' => $photo, 'album' => $real_alb ) );
1567
+ wppa_invalidate_treecounts( - ( $album + '9' ) );
1568
+ echo '||1||<span style="color:red" >'.sprintf( __( 'Photo %s has been undeleted' , 'wp-photo-album-plus'), $photo ).'</span>';
1569
+ }
1570
  }
1571
+
1572
+ if ( ! $album_exists ) {
1573
  echo '||1||<span style="color:red" >'.sprintf( __( 'Could not undelete photo %s' , 'wp-photo-album-plus'), $photo ).'</span>';
1574
  }
1575
  wppa_clear_cache();
1805
  wppa_exit();
1806
  break;
1807
 
1808
+ case 'delyear':
1809
+ case 'delmonth':
1810
+ case 'delday':
1811
+ case 'delhour':
1812
+ case 'delmin':
1813
+ $itemname = __( 'Delete date/time' , 'wp-photo-album-plus');
1814
+ $scheduledtm = $wpdb->get_var( $wpdb->prepare( "SELECT scheduledel
1815
+ FROM $wpdb->wppa_albums
1816
+ WHERE id = %d", $album ) );
1817
+ if ( ! $scheduledtm ) {
1818
+ $scheduledtm = wppa_get_default_scheduledtm();
1819
+ }
1820
+ $temp = explode( ',', $scheduledtm );
1821
+ if ( $item == 'delyear' ) $temp[0] = $value;
1822
+ if ( $item == 'delmonth' ) $temp[1] = $value;
1823
+ if ( $item == 'delday' ) $temp[2] = $value;
1824
+ if ( $item == 'delhour' ) $temp[3] = $value;
1825
+ if ( $item == 'delmin' ) $temp[4] = $value;
1826
+ $scheduledel = implode( ',', $temp );
1827
+ wppa_update_album( array( 'id' => $album, 'scheduledel' => $scheduledel, 'modified' => time() ) );
1828
+ echo '||0||'.sprintf( __( '%s of album %s updated', 'wp-photo-album-plus' ), $itemname, htmlentities( $album ) );
1829
+ wppa_exit();
1830
+ break;
1831
+
1832
  case 'setallscheduled':
1833
  $scheduledtm = $wpdb->get_var( $wpdb->prepare( "SELECT scheduledtm
1834
  FROM $wpdb->wppa_albums
1888
  wppa_exit();
1889
  break;
1890
 
1891
+ case 'scheduledel':
1892
+ $value = '';
1893
+ $itemname = __( 'Delete date/time' , 'wp-photo-album-plus');
1894
+ break;
1895
+ case 'scheduledtm':
1896
+ $value = '';
1897
+ $itemname = __( 'Schedule date/time' , 'wp-photo-album-plus');
1898
+ break;
1899
+
1900
  default:
1901
  $itemname = $item;
1902
  }
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 7.7.04.005
7
  *
8
  */
9
 
@@ -335,6 +335,7 @@ global $wppa_revno;
335
  $sname = $albuminfo['sname'];
336
  $zoomable = $albuminfo['zoomable'];
337
  $displayopts = $albuminfo['displayopts'];
 
338
 
339
  $treecounts = wppa_get_treecounts_a( $id, true );
340
  $pviews = $treecounts['selfphotoviews'];
@@ -396,6 +397,15 @@ global $wppa_revno;
396
  wppaAjaxUpdateAlbum( id, \'setallscheduled\', Math.random(), true );
397
  }
398
  }
 
 
 
 
 
 
 
 
 
399
  </script>';
400
 
401
  // The header
@@ -832,6 +842,31 @@ global $wppa_revno;
832
  </select>';
833
  }
834
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
835
  // Status
836
  echo '<br />' .
837
  __( 'Remark', 'wp-photo-album-plus' ) . ':&nbsp;
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 7.7.05.002
7
  *
8
  */
9
 
335
  $sname = $albuminfo['sname'];
336
  $zoomable = $albuminfo['zoomable'];
337
  $displayopts = $albuminfo['displayopts'];
338
+ $scheduledel = $albuminfo['scheduledel'];
339
 
340
  $treecounts = wppa_get_treecounts_a( $id, true );
341
  $pviews = $treecounts['selfphotoviews'];
397
  wppaAjaxUpdateAlbum( id, \'setallscheduled\', Math.random(), true );
398
  }
399
  }
400
+
401
+ function wppaTryScheduledelAlb( id ) {
402
+
403
+ wppaAjaxUpdateAlbum( id, "scheduledel", Math.random() );
404
+ if ( ! jQuery( "#scheduledel" ).prop( "checked" ) ) {
405
+ wppaAjaxUpdateAlbum( id, "removescheduledel", 0 );
406
+ }
407
+ }
408
+
409
  </script>';
410
 
411
  // The header
842
  </select>';
843
  }
844
 
845
+ // Schedule for delete
846
+ if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
847
+ $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
848
+
849
+ echo
850
+ __( 'Delete at', 'wp-photo-album-plus' ) .
851
+ ' ' .
852
+ '<input' .
853
+ ' type="checkbox"' .
854
+ ' id="scheduledel"' .
855
+ ( $scheduledel ? ' checked="checked"' : '' ) .
856
+ ( $may_change ? '' : ' disabled="disabled"' ) .
857
+ ' onchange="wppaChangeScheduleDelAlbum( ' . $id . ', this );"' .
858
+ ' />' .
859
+ ' ' .
860
+ '<input type="hidden" value="" id="wppa-dummy-del" />' .
861
+ '<span
862
+ class="wppa-datetimedel-' . $id . '"' .
863
+ ( $albuminfo['scheduledel'] ? '' : ' style="display:none;"' ) .
864
+ ' >' .
865
+ wppa_get_date_time_select_html( 'delalbum', $id, $may_change ) .
866
+ '</span>' .
867
+ ' ';
868
+ }
869
+
870
  // Status
871
  echo '<br />' .
872
  __( 'Remark', 'wp-photo-album-plus' ) . ':&nbsp;
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 7.7.02.005
6
  *
7
  */
8
 
@@ -2107,6 +2107,18 @@ global $wpdb;
2107
  wppa_delete_photo( $photo['id'] );
2108
  }
2109
 
 
 
 
 
 
 
 
 
 
 
 
 
2110
  // Update timestamp of this action
2111
  update_option( 'wppa_last_schedule_check', time() );
2112
  }
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 7.7.05.002
6
  *
7
  */
8
 
2107
  wppa_delete_photo( $photo['id'] );
2108
  }
2109
 
2110
+ // Delete albums scheduled for deletion
2111
+ $albums_to_delete = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_albums WHERE scheduledel <> '' AND scheduledel < %s", wppa_get_default_scheduledtm() ) );
2112
+ if ( $albums_to_delete ) {
2113
+ $delalbs = implode( ',', $albums_to_delete );
2114
+ $photos_to_delete = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_photos WHERE album IN ( $delalbs )" );
2115
+ if ( $photos_to_delete ) foreach( $photos_to_delete as $id ) {
2116
+ wppa_delete_photo( $id );
2117
+ }
2118
+ $wpdb->query( "DELETE FROM $wpdb->wppa_albums WHERE id IN ( $delalbs )" );
2119
+ $wpdb->query( "UPDATE $wpdb->wppa_albums SET a_parent = '-1' WHERE a_parent IN ( $delalbs )" );
2120
+ }
2121
+
2122
  // Update timestamp of this action
2123
  update_option( 'wppa_last_schedule_check', time() );
2124
  }
wppa-date-time.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
- * Version 7.3.07
7
  *
8
  */
9
 
@@ -70,12 +70,12 @@ function wppa_get_timestamp( $key = false ) {
70
 
71
  function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
72
 
73
- $type = strtoupper( substr( $type, 0, 1 ) ).strtolower( substr( $type, 1 ) );
74
 
75
  if ( $type == 'Photo' || $type == 'Delphoto' ) {
76
  $thumb = wppa_cache_thumb( $id );
77
  }
78
- elseif ( $type == 'Album' ) {
79
  $album = wppa_cache_album( $id );
80
  }
81
  else {
@@ -112,6 +112,10 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
112
  $curval = $thumb['scheduledel'];
113
  $class = 'wppa-del-datetime-' . $id;
114
  break;
 
 
 
 
115
  default:
116
  $curval = '';
117
  $class = '';
@@ -138,9 +142,12 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
138
  elseif ( $type == 'Delphoto' ) {
139
  $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'delday\', this.value);" >';
140
  }
141
- else {
142
  $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'day\', this);" >';
143
  }
 
 
 
144
 
145
  foreach ( array_keys( $opt_days ) as $key ) {
146
  $sel = $val_days[$key] == $cur_day ? 'selected="selected"' : '';
@@ -150,14 +157,17 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
150
 
151
  // Month
152
  if ( $type == 'Photo' ) {
153
- $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'month\', this.value);" >';
154
  }
155
  elseif ( $type == 'Delphoto' ) {
156
- $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'delmonth\', this.value);" >';
157
  }
158
- else {
159
  $result .= '<select name="wppa-month" id="wppa-month-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'month\', this);" >';
160
  }
 
 
 
161
 
162
  foreach ( array_keys( $opt_months ) as $key ) {
163
  $sel = $val_months[$key] == $cur_month ? 'selected="selected"' : '';
@@ -167,14 +177,17 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
167
 
168
  // Year
169
  if ( $type == 'Photo' ) {
170
- $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'year\', this.value);" >';
171
  }
172
  elseif ( $type == 'Delphoto' ) {
173
- $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'delyear\', this.value);" >';
174
  }
175
- else {
176
  $result .= '<select name="wppa-year" id="wppa-year-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'year\', this);" >';
177
  }
 
 
 
178
 
179
  foreach ( array_keys( $opt_years ) as $key ) {
180
  $sel = $val_years[$key] == $cur_year ? 'selected="selected"' : '';
@@ -185,14 +198,17 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
185
 
186
  // Hour
187
  if ( $type == 'Photo' ) {
188
- $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'hour\', this.value);" >';
189
  }
190
  elseif ( $type == 'Delphoto' ) {
191
- $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'delhour\', this.value);" >';
192
  }
193
- else {
194
  $result .= '<select name="wppa-hour" id="wppa-hour-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'hour\', this);" >';
195
  }
 
 
 
196
 
197
  foreach ( array_keys( $opt_hours ) as $key ) {
198
  $sel = $val_hours[$key] == $cur_hour ? 'selected="selected"' : '';
@@ -203,14 +219,17 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
203
 
204
  // Min
205
  if ( $type == 'Photo' ) {
206
- $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'min\', this.value);" >';
207
  }
208
  elseif ( $type == 'Delphoto' ) {
209
- $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'delmin\', this.value);" >';
210
  }
211
- else {
212
  $result .= '<select name="wppa-min" id="wppa-min-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'min\', this);">';
213
  }
 
 
 
214
 
215
  foreach ( array_keys( $opt_mins ) as $key ) {
216
  $sel = $val_mins[$key] == $cur_min ? 'selected="selected"' : '';
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
+ * Version 7.7.05.002
7
  *
8
  */
9
 
70
 
71
  function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
72
 
73
+ $type = ucfirst( strtolower( $type ) );
74
 
75
  if ( $type == 'Photo' || $type == 'Delphoto' ) {
76
  $thumb = wppa_cache_thumb( $id );
77
  }
78
+ elseif ( $type == 'Album' || $type = 'Delalbum' ) {
79
  $album = wppa_cache_album( $id );
80
  }
81
  else {
112
  $curval = $thumb['scheduledel'];
113
  $class = 'wppa-del-datetime-' . $id;
114
  break;
115
+ case 'Delalbum':
116
+ $curval = $album['scheduledel'];
117
+ $class = 'wppa-del-datetime-' . $id;
118
+ break;
119
  default:
120
  $curval = '';
121
  $class = '';
142
  elseif ( $type == 'Delphoto' ) {
143
  $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'delday\', this.value);" >';
144
  }
145
+ elseif ( $type == 'Album' ) {
146
  $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'day\', this);" >';
147
  }
148
+ else {
149
+ $result .= '<select name="wppa-day" id="wppa-day-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'delday\', this);" >';
150
+ }
151
 
152
  foreach ( array_keys( $opt_days ) as $key ) {
153
  $sel = $val_days[$key] == $cur_day ? 'selected="selected"' : '';
157
 
158
  // Month
159
  if ( $type == 'Photo' ) {
160
+ $result .= '<select name="wppa-month" id="wppa-month-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'month\', this.value);" >';
161
  }
162
  elseif ( $type == 'Delphoto' ) {
163
+ $result .= '<select name="wppa-month" id="wppa-month-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'delmonth\', this.value);" >';
164
  }
165
+ elseif ( $type == 'Album' ) {
166
  $result .= '<select name="wppa-month" id="wppa-month-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'month\', this);" >';
167
  }
168
+ else {
169
+ $result .= '<select name="wppa-month" id="wppa-month-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'delmonth\', this);" >';
170
+ }
171
 
172
  foreach ( array_keys( $opt_months ) as $key ) {
173
  $sel = $val_months[$key] == $cur_month ? 'selected="selected"' : '';
177
 
178
  // Year
179
  if ( $type == 'Photo' ) {
180
+ $result .= '<select name="wppa-year" id="wppa-year-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'year\', this.value);" >';
181
  }
182
  elseif ( $type == 'Delphoto' ) {
183
+ $result .= '<select name="wppa-year" id="wppa-year-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'delyear\', this.value);" >';
184
  }
185
+ elseif ( $type == 'Album' ) {
186
  $result .= '<select name="wppa-year" id="wppa-year-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'year\', this);" >';
187
  }
188
+ else {
189
+ $result .= '<select name="wppa-year" id="wppa-year-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'delyear\', this);" >';
190
+ }
191
 
192
  foreach ( array_keys( $opt_years ) as $key ) {
193
  $sel = $val_years[$key] == $cur_year ? 'selected="selected"' : '';
198
 
199
  // Hour
200
  if ( $type == 'Photo' ) {
201
+ $result .= '<select name="wppa-hour" id="wppa-hour-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'hour\', this.value);" >';
202
  }
203
  elseif ( $type == 'Delphoto' ) {
204
+ $result .= '<select name="wppa-hour" id="wppa-hour-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'delhour\', this.value);" >';
205
  }
206
+ elseif ( $type == 'Album' ) {
207
  $result .= '<select name="wppa-hour" id="wppa-hour-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'hour\', this);" >';
208
  }
209
+ else {
210
+ $result .= '<select name="wppa-hour" id="wppa-hour-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'delhour\', this);" >';
211
+ }
212
 
213
  foreach ( array_keys( $opt_hours ) as $key ) {
214
  $sel = $val_hours[$key] == $cur_hour ? 'selected="selected"' : '';
219
 
220
  // Min
221
  if ( $type == 'Photo' ) {
222
+ $result .= '<select name="wppa-min" id="wppa-min-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'min\', this.value);" >';
223
  }
224
  elseif ( $type == 'Delphoto' ) {
225
+ $result .= '<select name="wppa-min" id="wppa-min-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdatePhoto('.$id.', \'delmin\', this.value);" >';
226
  }
227
+ elseif ( $type == 'Album' ) {
228
  $result .= '<select name="wppa-min" id="wppa-min-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'min\', this);">';
229
  }
230
+ else {
231
+ $result .= '<select name="wppa-min" id="wppa-min-'.$id.'" class="'.$class.'" onchange="wppaAjaxUpdateAlbum('.$id.', \'delmin\', this);">';
232
+ }
233
 
234
  foreach ( array_keys( $opt_mins ) as $key ) {
235
  $sel = $val_mins[$key] == $cur_min ? 'selected="selected"' : '';
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 7.7.04.009
7
  *
8
  */
9
 
@@ -73,6 +73,7 @@ global $wppa_error;
73
  zoomable tinytext NOT NULL,
74
  displayopts tinytext NOT NULL,
75
  upload_limit_tree tinytext NOT NULL,
 
76
  PRIMARY KEY (id)
77
  ) DEFAULT CHARACTER SET utf8;";
78
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 7.7.05.002
7
  *
8
  */
9
 
73
  zoomable tinytext NOT NULL,
74
  displayopts tinytext NOT NULL,
75
  upload_limit_tree tinytext NOT NULL,
76
+ scheduledel tinytext NOT NULL,
77
  PRIMARY KEY (id)
78
  ) DEFAULT CHARACTER SET utf8;";
79
 
wppa-wpdb-insert.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that add new records
6
- * Version 7.7.02.005
7
  *
8
  */
9
 
@@ -470,6 +470,7 @@ global $wpdb;
470
  'zoomable' => '',
471
  'displayopts' => '0,0,0,0',
472
  'upload_limit_tree' => '0',
 
473
  ) );
474
 
475
  if ( ! wppa_is_id_free( WPPA_ALBUMS, $args['id'] ) ) $args['id'] = wppa_nextkey( WPPA_ALBUMS );
@@ -503,9 +504,10 @@ global $wpdb;
503
  sname,
504
  zoomable,
505
  displayopts,
506
- upload_limit_tree
 
507
  )
508
- VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s ,%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )",
509
  $args['id'],
510
  trim( $args['name'] ),
511
  trim( $args['description'] ),
@@ -535,7 +537,8 @@ global $wpdb;
535
  $args['sname'],
536
  $args['zoomable'],
537
  $args['displayopts'],
538
- $args['upload_limit_tree']
 
539
  );
540
  $iret = $wpdb->query( $query );
541
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that add new records
6
+ * Version 7.7.05.002
7
  *
8
  */
9
 
470
  'zoomable' => '',
471
  'displayopts' => '0,0,0,0',
472
  'upload_limit_tree' => '0',
473
+ 'scheduledel' => '',
474
  ) );
475
 
476
  if ( ! wppa_is_id_free( WPPA_ALBUMS, $args['id'] ) ) $args['id'] = wppa_nextkey( WPPA_ALBUMS );
504
  sname,
505
  zoomable,
506
  displayopts,
507
+ upload_limit_tree,
508
+ scheduledel
509
  )
510
+ VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s ,%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )",
511
  $args['id'],
512
  trim( $args['name'] ),
513
  trim( $args['description'] ),
537
  $args['sname'],
538
  $args['zoomable'],
539
  $args['displayopts'],
540
+ $args['upload_limit_tree'],
541
+ $args['scheduledel']
542
  );
543
  $iret = $wpdb->query( $query );
544
 
wppa-wpdb-update.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that update records
6
- * Version 7.7.02.005
7
  *
8
  */
9
 
@@ -113,6 +113,9 @@ global $wpdb;
113
  $doit = true;
114
  }
115
  break;
 
 
 
116
  default:
117
  wppa_log( 'Error', 'Not implemented in wppa_update_album(): '.$itemname );
118
  return false;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that update records
6
+ * Version 7.7.05.002
7
  *
8
  */
9
 
113
  $doit = true;
114
  }
115
  break;
116
+ case 'scheduledel':
117
+ $doit = true;
118
+ break;
119
  default:
120
  wppa_log( 'Error', 'Not implemented in wppa_update_album(): '.$itemname );
121
  return false;
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.7.05.001
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '7.7.05.001'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 7.7.05.002
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '7.7.05.002'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30