WP Photo Album Plus - Version 7.0.09.004

Version Description

= 7.0.09 =

  • This version addresses various security issues.
  • This version addresses various bug fixes and feature requests.

= 7.0.08 =

  • This version addresses various security issues.
  • This version addresses various bug fixes

= 7.0.07 =

  • This version addresses various security issues.
  • This version addresses various bug fixes

= 7.0.06 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.05 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 7.0.04 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.03 =

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

= 7.0.02 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.01 =

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

= 7.0.00 =

  • Shortcode generators for Gutenberg added.
  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.
  • To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised. Configure Table IX-M to enable various mailing lists, and use the WPPA+ Notify widget for full user flexibility.

= 6.9.21 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 6.9.20 =

  • This version addresses various bug fixes

= 6.9.19 =

  • This version addresses various minor bug fixes

= 6.9.18 =

  • This version addresses various minor bug fixes

= 6.9.17 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.16 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.15 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.14 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.13 =

  • Security release.

= 6.9.12 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.11 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.10 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.09 =

  • Panorama support phase III.

= 6.9.08 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase II.

= 6.9.07 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase I.

= 6.9.06 =

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

= 6.9.05 =

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

= 6.9.04 =

  • This version addresses various minor bug fixes and feature requests.
  • Local CDN functionality has been added.

= 6.9.03 =

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

= 6.9.02 =

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

= 6.9.01 =

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

= 6.9.00 =

  • This version includes the code for the privacy policy requirements.

= 6.8.09

  • This version addresses various bug fixes and code edits.

= 6.8.08 =

  • This version addresses various minor bug fixes and feature requests.
  • This version offers substantial performance improvements when the box in Table IV-A13: Defer Javascript is ticked. This setting is now recommended and set ticked as the default.
  • For more info on performance improvements and compatibility with optimizers: see the changelog.txt

= 6.8.07 =

  • This version addresses various minor bug fixes and enhancements, and a new widget: Statistics.

= 6.8.06 =

  • This version addresses various minor bug fixes and improved cache handling.

= 6.8.05 =

  • This version addresses various minor bug fixes and feture requests.

= 6.8.04 =

  • This version addresses various display issues and a few fixes of bugs that seldom affected the plugins behaviour.
Download this release

Release Info

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

Code changes from version 7.0.09.003 to 7.0.09.004

changelog.txt CHANGED
@@ -5,6 +5,10 @@ WP Photo Album Plus Changelog
5
  * Added a checkbox to the album widget to include (great)(grand)children.
6
  * Cosmetic changes to the settings page Table VIII buttons.
7
  * Thumbnail popups now stay within the thumbnail area.
 
 
 
 
8
 
9
  = 7.0.08 =
10
 
5
  * Added a checkbox to the album widget to include (great)(grand)children.
6
  * Cosmetic changes to the settings page Table VIII buttons.
7
  * Thumbnail popups now stay within the thumbnail area.
8
+ * QR cache did not work. Fixed.
9
+ * The logfile is now displayed with the youngest message first.
10
+ * Local cdn did not generate .png images. Fixed.
11
+ * Status stars on the settings page for changing iptc and exif items did not show busy/ready/error icons. Fixed.
12
 
13
  = 7.0.08 =
14
 
js/wppa-admin-scripts.js CHANGED
@@ -2009,7 +2009,7 @@ function wppaAjaxUpdateOptionValue(slug, elem, multisel) {
2009
  type: 'POST',
2010
  timeout: 100000,
2011
  beforeSend: function( xhr ) {
2012
- jQuery( '#img_'+slug ).attr( 'src', wppaImageDirectory+'spinner.gif' );
2013
  },
2014
  success: function( result, status, xhr ) {
2015
  var str = wppaTrim(result);
@@ -2021,7 +2021,7 @@ function wppaAjaxUpdateOptionValue(slug, elem, multisel) {
2021
  // Process result
2022
  switch (ArrValues[1]) {
2023
  case '0': // No error
2024
- jQuery( '#img_'+slug ).attr( 'src', wppaImageDirectory+'tick.png' );
2025
  if ( ArrValues[3] ) alert(ArrValues[3]);
2026
  if ( _wppaRefreshAfter ) {
2027
  _wppaRefreshAfter = false;
@@ -2029,10 +2029,10 @@ function wppaAjaxUpdateOptionValue(slug, elem, multisel) {
2029
  }
2030
  break;
2031
  default:
2032
- jQuery( '#img_'+slug ).attr( 'src', wppaImageDirectory+'cross.png' );
2033
  if ( ArrValues[3] ) alert(ArrValues[3]);
2034
  }
2035
- jQuery( '#img_'+slug ).attr( 'title', ArrValues[2] );
2036
 
2037
  // Update cron statusses
2038
  if ( ArrValues[4] ) {
@@ -2054,7 +2054,7 @@ function wppaAjaxUpdateOptionValue(slug, elem, multisel) {
2054
  }
2055
  },
2056
  error: function( xhr ) {
2057
- jQuery( '#img_'+slug ).attr( 'src', wppaImageDirectory+'cross.png' );
2058
  document.getElementById('img_'+slug).title = 'Communication error';
2059
  },
2060
  complete: function( xhr ) {
2009
  type: 'POST',
2010
  timeout: 100000,
2011
  beforeSend: function( xhr ) {
2012
+ jQuery( '#img_'+slug.replace('#','H') ).attr( 'src', wppaImageDirectory+'spinner.gif' );
2013
  },
2014
  success: function( result, status, xhr ) {
2015
  var str = wppaTrim(result);
2021
  // Process result
2022
  switch (ArrValues[1]) {
2023
  case '0': // No error
2024
+ jQuery( '#img_'+slug.replace('#','H') ).attr( 'src', wppaImageDirectory+'tick.png' );
2025
  if ( ArrValues[3] ) alert(ArrValues[3]);
2026
  if ( _wppaRefreshAfter ) {
2027
  _wppaRefreshAfter = false;
2029
  }
2030
  break;
2031
  default:
2032
+ jQuery( '#img_'+slug.replace('#','H') ).attr( 'src', wppaImageDirectory+'cross.png' );
2033
  if ( ArrValues[3] ) alert(ArrValues[3]);
2034
  }
2035
+ jQuery( '#img_'+slug.replace('#','H') ).attr( 'title', ArrValues[2] );
2036
 
2037
  // Update cron statusses
2038
  if ( ArrValues[4] ) {
2054
  }
2055
  },
2056
  error: function( xhr ) {
2057
+ jQuery( '#img_'+slug.replace('#','H') ).attr( 'src', wppaImageDirectory+'cross.png' );
2058
  document.getElementById('img_'+slug).title = 'Communication error';
2059
  },
2060
  complete: function( xhr ) {
js/wppa-admin-scripts.min.js CHANGED
@@ -1 +1 @@
1
- var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album";function checkjQueryRev(e,t,p){var a=parseFloat(jQuery.fn.jquery);t.checked&&a<p&&(alert(e+"\nThe version of your jQuery library: "+a+" is too low for this feature. It requires version "+p),t.checked="")}function wppaReUpload(e,t,p){document.getElementById("wppa-re-up-form-"+t);var a=document.getElementById("wppa-re-up-file-"+t),o=document.getElementById("wppa-re-up-butn-"+t);e.preventDefault();var n=a.files[0];if(n.type.match("image.*")){if(0==p.length)alert("Filename will be set to "+n.name);else if(n.name!=p&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+t).css("display","none");o.value="Uploading...",o.style.color="black";var i=new FormData;i.append("photo",n,n.name);var s=new XMLHttpRequest,l="?action=wppa&wppa-action=update-photo&photo-id="+t+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;s.open("POST",wppaAjaxUrl+l,!0),s.onload=function(){if(200===s.status){var e=wppaTrim(s.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]),o.value="Upload",jQuery("#re-up-"+t).css("display","none");break;case"99":document.getElementById("photoitem-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",o.value="Error occured",o.style.color="red"}}else alert("An error occurred!")},s.send(i)}else alert("File is not an image file!")}function wppaInitSettings(){wppaCheckBreadcrumb(),wppaCheckFullHalign(),wppaCheckUseThumbOpacity(),wppaCheckUseCoverOpacity(),wppaCheckThumbType(),wppaCheckThumbLink(),wppaCheckTopTenLink(),wppaCheckFeaTenLink(),wppaCheckLasTenLink(),wppaCheckThumbnailWLink(),wppaCheckCommentLink(),wppaCheckXphotoLink(),wppaCheckMphotoLink(),wppaCheckSphotoLink(),wppaCheckSlidePhotoLink(),wppaCheckSlideOnlyLink(),wppaCheckAlbumWidgetLink(),wppaCheckSlideLink(),wppaCheckCoverImg(),wppaCheckPotdLink(),wppaCheckTagLink(),wppaCheckRating(),wppaCheckComments(),wppaCheckCustom(),wppaCheckResize(),wppaCheckNumbar(),wppaCheckWatermark(),wppaCheckPopup(),wppaCheckGravatar(),wppaCheckUserUpload(),wppaCheckAjax(),wppaCheckFotomoto(),wppaCheckLinkPageErr("sphoto"),wppaCheckLinkPageErr("mphoto"),wppaCheckLinkPageErr("xphoto"),wppaCheckLinkPageErr("topten_widget"),wppaCheckLinkPageErr("slideonly_widget"),wppaCheckLinkPageErr("potd"),wppaCheckLinkPageErr("comment_widget"),wppaCheckLinkPageErr("thumbnail_widget"),wppaCheckLinkPageErr("lasten_widget"),wppaCheckLinkPageErr("album_widget"),wppaCheckLinkPageErr("tagcloud"),wppaCheckLinkPageErr("multitag"),wppaCheckLinkPageErr("super_view"),wppaCheckSplitNamedesc(),wppaCheckShares(),wppaCheckCoverType(),wppaCheckNewpag(),wppaCheckCDN(),wppaCheckAutoPage(),wppaCheckGps(),wppaCheckFontPreview(),wppaCheckCheck("wppa_enable_video","wppa-video"),wppaCheckCheck("wppa_custom_fields","custfields"),wppaCheckCheck("wppa_album_custom_fields","albumcustfields"),wppaCheckCheck("wppa_new_mod_label_is_text","nmtxt"),wppaCheckCheck("wppa_coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for("on"==p?wppaShowTable(table):wppaHideTable(table),subtab=0;subtab<13;subtab++)"on"==(p=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]))&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","Z");for(table=1;table<13;table++)for(table<13?wppaShowTable(table):wppaHideTable(table),wppa_tablecookieoff(table),subtab=0;subtab<12;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);0<p.length&&(p.removeClass("wppa-none"),wppaSubTabOn[e[table-1]+"-"+t[subtab]]=!1,wppa_tablecookieoff(e[table-1]+"-"+t[subtab]))}if(tag1=jQuery("#wppa-quick-selbox-1").val(),tag2=jQuery("#wppa-quick-selbox-2").val(),"-"==tag1&&"-"==tag2)for(jQuery("._wppatag-").addClass("wppa-none"),table=1;table<13;table++)wppaHideTable(table);else"-"!=tag1&&jQuery("._wppatag-"+tag1).addClass("wppa-none"),"-"!=tag2&&jQuery("._wppatag-"+tag2).addClass("wppa-none")}function wppaToggleTable(e){"none"==jQuery("#wppa_table_"+e).css("display")?(jQuery("#wppa_table_"+e).css("display","inline"),wppa_tablecookieon(e)):(jQuery("#wppa_table_"+e).css("display","none"),wppa_tablecookieoff(e))}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",wppaMakeLazyVisible),wppaMakeLazyVisible()});var wppaSubTabOn=new Array;function wppaToggleSubTable(e,t){wppaSubTabOn[e+"-"+t]?(jQuery(".wppa-"+e+"-"+t).addClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-help").css("display","none"),wppaSubTabOn[e+"-"+t]=!1,wppa_tablecookieoff(e+"-"+t)):(jQuery(".wppa-"+e+"-"+t).removeClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-h").css("display",""),wppaSubTabOn[e+"-"+t]=!0,wppa_tablecookieon(e+"-"+t))}function wppaHideTable(e){jQuery("#wppa_table_"+e).css("display","none"),jQuery("#wppa_tableHide-"+e).css("display","none"),jQuery("#wppa_tableShow-"+e).css("display","inline"),wppa_tablecookieoff(e)}function wppaShowTable(e){jQuery("#wppa_table_"+e).css("display","block"),jQuery("#wppa_tableHide-"+e).css("display","inline"),jQuery("#wppa_tableShow-"+e).css("display","none"),wppa_tablecookieon(e)}var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaFollow(e,t){jQuery("#"+e).prop("checked")?jQuery("."+t).css("display",""):jQuery("."+t).css("display","none")}function wppaCheckCheck(e,t){var p=e.substring(5);document.getElementById(p).checked?(jQuery("."+t).css("display",""),jQuery(".-"+t).css("display","none")):(jQuery("."+t).css("display","none"),jQuery(".-"+t).css("display",""))}function wppaCheckSlideVideoControls(){"none"!=document.getElementById("slideshow_linktype").value&&alert("Warning! \nYou can not have video controls on a videoslide when there is a link on the slide.\nThe videoslide will not show controls and will also not autoplay")}function wppaCheckFotomoto(){document.getElementById("fotomoto_on").checked?jQuery(".wppa_fotomoto").css("display",""):jQuery(".wppa_fotomoto").css("display","none")}function wppaCheckFontPreview(){var e=document.getElementById("textual_watermark_font").value,t=document.getElementById("textual_watermark_type").value,p=wppaFontDirectory+"wmf"+e+"-"+t+".png",a=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",a)}function wppaCheckWidgetMethod(){var e,t;if("4"==document.getElementById("wppa-wm").value){document.getElementById("wppa-wp").style.visibility="visible";var p=jQuery("#wppa-wp").val();"day-of-week"==p||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")}else document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden");if("1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppaCheckFullHalign(){var e=document.getElementById("fullsize").value,t=document.getElementById("colwidth").value,p=document.getElementById("fullvalign").value;e!=t&&"default"!=p?jQuery(".wppa_ha").css("display",""):jQuery(".wppa_ha").css("display","none"),"auto"==t?jQuery(".wppa_init_resp_width").css("display",""):jQuery(".wppa_init_resp_width").css("display","none")}function wppaCheckCDN(){var e=document.getElementById("cdn_service").value;"cloudinary"==e||"cloudinarymaintenance"==e?jQuery(".cloudinary").css("display",""):jQuery(".cloudinary").css("display","none")}function wppaCheckGps(){"wppa-plus-embedded"==document.getElementById("gpx_implementation").value?(jQuery(".wppa_gpx_native").css("display",""),jQuery(".wppa_gpx_plugin").css("display","none")):(jQuery(".wppa_gpx_native").css("display","none"),jQuery(".wppa_gpx_plugin").css("display",""))}function wppaCheckThumbType(){var e=document.getElementById("thumbtype").value;"default"==e&&(jQuery(".tt_normal").css("display",""),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),wppaCheckUseThumbOpacity()),"ascovers"!=e&&"ascovers-mcr"!=e||(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display",""),jQuery(".tt_always").css("display","")),"masonry"==e&&(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),jQuery(".tt_masonry").css("display",""))}function wppaCheckAutoPage(){document.getElementById("auto_page").checked?jQuery(".autopage").css("display",""):jQuery(".autopage").css("display","none")}function wppaCheckUseThumbOpacity(){document.getElementById("use_thumb_opacity").checked?(jQuery(".thumb_opacity").css("color","#333"),jQuery(".thumb_opacity_html").css("visibility","visible")):(jQuery(".thumb_opacity").css("color","#999"),jQuery(".thumb_opacity_html").css("visibility","hidden"))}function wppaCheckUseCoverOpacity(){document.getElementById("use_cover_opacity").checked?(jQuery(".cover_opacity").css("color","#333"),jQuery(".cover_opacity_html").css("visibility","visible")):(jQuery(".cover_opacity").css("color","#999"),jQuery(".cover_opacity_html").css("visibility","hidden"))}function wppaCheckBreadcrumb(){var e=document.getElementById("show_bread_posts").checked,t=document.getElementById("show_bread_pages").checked;if(e||t){jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display","");var p=document.getElementById("bc_separator").value;"txt"==p?(jQuery(".wppa_bc_txt").css("display",""),jQuery(".wppa_bc_url").css("display","none"),jQuery(".wppa_bc_txt_html").css("display",""),jQuery(".wppa_bc_url_html").css("display","none")):"url"==p?(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display",""),jQuery(".wppa_bc_txt_html").css("display","none"),jQuery(".wppa_bc_url_html").css("display","")):(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))}else jQuery(".wppa_bc").css("display","none"),jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none")}function wppaCheckRating(){document.getElementById("rating_on").checked?(jQuery(".wppa_rating").css("color","#333"),jQuery(".wppa_rating_html").css("visibility","visible"),jQuery(".wppa_rating_").css("display","")):(jQuery(".wppa_rating").css("color","#999"),jQuery(".wppa_rating_html").css("visibility","hidden"),jQuery(".wppa_rating_").css("display","none"))}function wppaCheckComments(){document.getElementById("show_comments").checked?(jQuery(".wppa_comment").css("color","#333"),jQuery(".wppa_comment_html").css("visibility","visible"),jQuery(".wppa_comment_").css("display","")):(jQuery(".wppa_comment").css("color","#999"),jQuery(".wppa_comment_html").css("visibility","hidden"),jQuery(".wppa_comment_").css("display","none"))}function wppaCheckAjax(){document.getElementById("allow_ajax").checked?jQuery(".wppa_allow_ajax_").css("display",""):jQuery(".wppa_allow_ajax_").css("display","none")}function wppaCheckShares(){document.getElementById("share_on").checked||document.getElementById("share_on_widget").checked||document.getElementById("share_on_lightbox").checked||document.getElementById("share_on_thumbs").checked||document.getElementById("share_on_mphoto").checked?jQuery(".wppa_share").css("display",""):jQuery(".wppa_share").css("display","none")}function wppaCheckCoverType(){var e=document.getElementById("cover_type").value;document.getElementById("coverphoto_pos").value;"imagefactory"==e||"imagefactory-mcr"==e?jQuery(".wppa_imgfact_").css("display",""):jQuery(".wppa_imgfact_").css("display","none")}function wppaCheckNewpag(){document.getElementById("newpag_create").checked?jQuery(".wppa_newpag").css("display",""):jQuery(".wppa_newpag").css("display","none")}function wppaCheckCustom(){document.getElementById("custom_on").checked?(jQuery(".wppa_custom").css("color","#333"),jQuery(".wppa_custom_html").css("visibility","visible"),jQuery(".wppa_custom_").css("display","")):(jQuery(".wppa_custom").css("color","#999"),jQuery(".wppa_custom_html").css("visibility","hidden"),jQuery(".wppa_custom_").css("display","none"))}function wppaCheckWidgetLink(){"-1"==document.getElementById("wlp").value?(jQuery(".wppa_wlu").css("display",""),jQuery(".wppa_wlt").css("visibility","hidden")):(jQuery(".wppa_wlu").css("display","none"),jQuery(".wppa_wlt").css("visibility","visible"))}function wppaCheckSmWidgetLink(){"home"==document.getElementById("widget_sm_linktype").value?jQuery(".wppa_smrp").css("visibility","hidden"):jQuery(".wppa_smrp").css("visibility","")}function wppaCheckThumbLink(){var e=document.getElementById("thumb_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlp").css("visibility","hidden"):jQuery(".wppa_tlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlb").css("visibility","hidden"):jQuery(".wppa_tlb").css("visibility","visible")}function wppaCheckTopTenLink(){var e=document.getElementById("topten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlp").css("visibility","hidden"):jQuery(".wppa_ttlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlb").css("visibility","hidden"):jQuery(".wppa_ttlb").css("visibility","visible")}function wppaCheckFeaTenLink(){var e=document.getElementById("featen_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlp").css("visibility","hidden"):jQuery(".wppa_ftlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlb").css("visibility","hidden"):jQuery(".wppa_ftlb").css("visibility","visible")}function wppaCheckLasTenLink(){var e=document.getElementById("lasten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlp").css("visibility","hidden"):jQuery(".wppa_ltlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlb").css("visibility","hidden"):jQuery(".wppa_ltlb").css("visibility","visible")}function wppaCheckThumbnailWLink(){var e=document.getElementById("thumbnail_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlp").css("visibility","hidden"):jQuery(".wppa_tnlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlb").css("visibility","hidden"):jQuery(".wppa_tnlb").css("visibility","visible")}function wppaCheckCommentLink(){var e=document.getElementById("comment_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlp").css("visibility","hidden"):jQuery(".wppa_cmlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlb").css("visibility","hidden"):jQuery(".wppa_cmlb").css("visibility","visible")}function wppaCheckSlideOnlyLink(){var e=document.getElementById("slideonly_widget_linktype").value;"none"==e||"file"==e||"widget"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solp").css("visibility","hidden"):jQuery(".wppa_solp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solb").css("visibility","hidden"):jQuery(".wppa_solb").css("visibility","visible")}function wppaCheckAlbumWidgetLink(){var e=document.getElementById("album_widget_linktype").value;"lightbox"==e?jQuery(".wppa_awlp").css("visibility","hidden"):jQuery(".wppa_awlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_awlb").css("visibility","hidden"):jQuery(".wppa_awlb").css("visibility","visible")}function wppaCheckSlideLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckCoverImg(){var e=document.getElementById("coverimg_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_covimgbl").css("visibility","hidden"):jQuery(".wppa_covimgbl").css("visibility","visible")}function wppaCheckPotdLink(){var e=document.getElementById("potd_linktype").value;"none"==e||"lightbox"==e||"file"==e||"custom"==e?jQuery(".wppa_potdlp").css("visibility","hidden"):jQuery(".wppa_potdlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_potdlb").css("visibility","hidden"):jQuery(".wppa_potdlb").css("visibility","visible")}function wppaCheckTagLink(){document.getElementById("tagcloud_linktype").value}function wppaCheckMTagLink(){document.getElementById("multitag_linktype").value}function wppaCheckXphotoLink(){var e=document.getElementById("xphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_xlp").css("visibility","hidden"):jQuery(".wppa_xlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_xlb").css("visibility","hidden"):jQuery(".wppa_xlb").css("visibility","visible")}function wppaCheckMphotoLink(){var e=document.getElementById("mphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_mlp").css("visibility","hidden"):jQuery(".wppa_mlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_mlb").css("visibility","hidden"):jQuery(".wppa_mlb").css("visibility","visible")}function wppaCheckSphotoLink(){var e=document.getElementById("sphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_slp").css("visibility","hidden"):jQuery(".wppa_slp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_slb").css("visibility","hidden"):jQuery(".wppa_slb").css("visibility","visible")}function wppaCheckSlidePhotoLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"file"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslp").css("visibility","hidden"):jQuery(".wppa_sslp").css("visibility","visible"),"none"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckResize(){document.getElementById("resize_on_upload").checked?jQuery(".re_up").css("display",""):jQuery(".re_up").css("display","none")}function wppaCheckNumbar(){document.getElementById("show_slideshownumbar").checked?jQuery(".wppa_numbar").css("display",""):jQuery(".wppa_numbar").css("display","none")}function wppaCheckWatermark(){document.getElementById("watermark_on").checked?jQuery(".wppa_watermark").css("display",""):jQuery(".wppa_watermark").css("display","none")}function wppaCheckPopup(){document.getElementById("use_thumb_popup").checked?jQuery(".wppa_popup").css("display",""):jQuery(".wppa_popup").css("display","none")}function wppaCheckGravatar(){document.getElementById("comment_gravatar")&&("url"==document.getElementById("comment_gravatar").value?jQuery(".wppa_grav").css("display",""):jQuery(".wppa_grav").css("display","none"))}function wppaCheckUserUpload(){document.getElementById("user_upload_on").checked?jQuery(".wppa_feup").css("display",""):jQuery(".wppa_feup").css("display","none")}function wppaCheckSplitNamedesc(){document.getElementById("split_namedesc").checked?(jQuery(".swap_namedesc").css("display","none"),jQuery(".hide_empty").css("display","")):(jQuery(".swap_namedesc").css("display",""),jQuery(".hide_empty").css("display","none"))}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),p=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",p)}function checkAll(e,t){var p=document.getElementById(e);p&&(p.checked?jQuery(t).prop("checked","checked"):jQuery(t).prop("checked",""))}function impUpd(e,t){e.checked?(jQuery(t).prop("value",wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).prop("value",wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,p){var a="",o="";a=e||'<div style="padding-left:5px;" >',p?o=p:aftrer="</div>",wppaFeAjaxLog("in");var n=wppaGetXmlHttp(),i=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;i+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,n.open("GET",i,!0),n.send(),n.onreadystatechange=function(){switch(n.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==n.status){var e=wppaTrim(n.responseText).split("||");"ER"==e[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("photostatus-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=a+e[2]+o,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=a+'<span style="color:red;" >Comm error '+n.status+": "+n.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p.open("GET",e,!0),p.send(),p.onreadystatechange=function(){switch(p.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==p.status){var e=wppaTrim(p.responseText).split("||");"ER"==e[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("photostatus-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var o="action=wppa&wppa-action=watermark-photo&photo-id="+t;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(o+="&wppa-watermark-file="+e),p&&(o+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o),a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":document.getElementById("photostatus-"+t).innerHTML=e[2];break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>"}jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("photostatus-"+t).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"}}var wppaAjaxPhotoCount=new Array,wppaPhotoUpdateMatrix=new Array;function wppaAjaxUpdatePhoto(e,t,p,a,o){var n=!1;o&&(n=0==jQuery("#wppaphotodesc"+o+":visible").length,jQuery("#wppaphotodesc"+o+"-html").click(),n&&jQuery("#wppaphotodesc"+o+"-tmce").click());for(var i=wppaPhotoUpdateMatrix.length,s=0,l=!1,r=-1;s<i;)wppaPhotoUpdateMatrix[s][0]==e&&wppaPhotoUpdateMatrix[s][1]==t&&(l=!0,r=s),s++;if(!l){wppaPhotoUpdateMatrix[i]=[e,t,"undefined",!1,!1,a],r=i}wppaPhotoUpdateMatrix[r][3]="number"==typeof p?p:p.value,wppaPhotoUpdateMatrix[r][5]=a,wppaAjaxUpdatePhotoMonitor()}function wppaAjaxUpdateDelphoto(e,t,p){wppaAjaxUpdatePhoto(e,"del"+t,p)}function wppaAjaxUpdatePhotoMonitor(){for(var e=wppaPhotoUpdateMatrix.length,t=0;t<e;)wppaPhotoUpdateMatrix[t][2]==wppaPhotoUpdateMatrix[t][3]||wppaPhotoUpdateMatrix[t][4]||(wppaPhotoUpdateMatrix[t][4]=!0,_wppaAjaxUpdatePhoto(wppaPhotoUpdateMatrix[t][0],wppaPhotoUpdateMatrix[t][1],wppaPhotoUpdateMatrix[t][3],wppaPhotoUpdateMatrix[t][5])),t++}function _wppaAjaxUpdatePhoto(s,l,r,u,c,d){c||(c=""),d||(d="");wppaFeAjaxLog("in"),wppaAjaxPhotoCount[s]||(wppaAjaxPhotoCount[s]=0),wppaAjaxPhotoCount[s]++,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxPhotoCount[s]--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":var o;if(0==wppaAjaxPhotoCount[s]?jQuery("#photostatus-"+s).html(a[2]):jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")"),a[3])(o=jQuery("#fs-a-"+s).attr("href").split("="))[1]=parseInt(o[1])+1,jQuery("#fs-a-"+s).attr("href",o[0]+"="+o[1]),jQuery("#fs-img-"+s).attr("src",o[0]+"="+o[1]);if(a[4])(o=jQuery("#tnp-"+s).attr("src").split("="))[1]=parseInt(o[1])+1,jQuery("#tnp-"+s).attr("src",o[0]+"="+o[1]);void 0!==a[5]&&(jQuery("#imstack-"+s).html(a[5]),0<a[5].length?jQuery("#imstackbutton-"+s).css("display",""):jQuery("#imstackbutton-"+s).css("display","none")),void 0!==a[6]&&jQuery("#dispfileinfo-"+s).html(a[6]);break;case"99":jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+a[2]+"</span>"+d);break;default:jQuery("#photostatus-"+s).html('<span style="color:red">'+a[2]+" ("+a[1]+")</span>")}"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"});var n=0,i=-1;for(count=wppaPhotoUpdateMatrix.length;n<count;)wppaPhotoUpdateMatrix[n][0]==s&&wppaPhotoUpdateMatrix[n][1]==l&&(i=n),n++;if(wppaPhotoUpdateMatrix[i]&&(wppaPhotoUpdateMatrix[i][2]=r||0,wppaPhotoUpdateMatrix[i][4]=!1,wppaPhotoUpdateMatrix[i][5]=!1),wppaFeAjaxLog("out"),wppaAjaxUpdatePhotoMonitor(),u&&"0"==a[1])return jQuery("#photostatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),void setTimeout(function(){wppaReload("#photo_"+s)},1e3)},error:function(e,t,p){wppaAjaxPhotoCount[s]--,jQuery("#photostatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",document.getElementById("wppa-dummy")))}_wppaRefreshAfter=!1;var wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,p,a){var o=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var n=wppaAlbumUpdateMatrix.length,i=0,s=!1,l=-1;i<n;)wppaAlbumUpdateMatrix[i][0]==e&&wppaAlbumUpdateMatrix[i][1]==t&&(s=!0,l=i),i++;if(!s){wppaAlbumUpdateMatrix[n]=[e,t,"undefined",!1,!1,a],l=n}wppaAlbumUpdateMatrix[l][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[l][5]=a,wppaAjaxUpdateAlbumMonitor(o)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,p=0;p<t;)wppaAlbumUpdateMatrix[p][2]==wppaAlbumUpdateMatrix[p][3]||wppaAlbumUpdateMatrix[p][4]||(wppaAlbumUpdateMatrix[p][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[p][0],wppaAlbumUpdateMatrix[p][1],wppaAlbumUpdateMatrix[p][3],e,wppaAlbumUpdateMatrix[p][5])),p++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(s,l,r,u,c){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("album-nonce-"+s).value+"&value="+wppaEncode(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxAlbumCount--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+s).html(a[2]):jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+s).html='<span style="color:red">'+a[2]+" ("+a[1]+")</span>"}if(void 0!==a[3]&&wppaProcessFull(a[3],a[4]),c&&"0"==a[1])return jQuery("#albumstatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==l&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var o=0,n=-1,i=wppaAlbumUpdateMatrix.length;o<i;)wppaAlbumUpdateMatrix[o][0]==s&&wppaAlbumUpdateMatrix[o][1]==l&&(n=o),o++;wppaAlbumUpdateMatrix[n][2]=r||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(u)},error:function(e,t,p){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,p,e){var a=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+p+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]);break;default:jQuery("#photostatus-"+t).html('<span style="color:red">'+e[2]+"</span>")}jQuery("#wppa-comment-spin-"+p).css("visibility","hidden")}else jQuery("#photostatus-"+t).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")},a.open("GET",o,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(p.responseText).split("||");if(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=p.status)switch(e[1]){case"0":jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2]),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+p.status),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))}else jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+p.status);wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(o,e,i){if(i);else if(!e&&"yes"==document.getElementById(o+"_continue").value)return document.getElementById(o+"_continue").value="no",document.getElementById(o+"_button").value="Start!",void(0<jQuery("#"+o+"_togo").html()&&(jQuery("#"+o+"_status").html("Pausing..."),jQuery("#"+o+"_button").css("display","none")));i||(document.getElementById(o+"_continue").value="yes",document.getElementById(o+"_button").value="Stop!",""==jQuery("#"+o+"_status").html()&&jQuery("#"+o+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+o+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(i?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("||"),o=a[1],n=!1;return o?(10<a[0].length&&(alert("An error occurred:\n"+a[0]),n=!0),jQuery("#"+o+"_status").html(a[2]),jQuery("#"+o+"_togo").html(a[3]),jQuery("#"+o+"_button").css("display",""),n||"0"==a[3]?"reload"==a[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+o+"', false)",20):void("yes"!=document.getElementById(o+"_continue").value?i||jQuery("#"+o+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+o+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,p){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+o+", Error = "+p+", status = "+t,"force"),jQuery("#"+o+"_status").html("Server error #"+(11-wppaAlwaysContinue));var a=!1;--wppaAlwaysContinue<1&&(a=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(a||0<wppaAlwaysContinue)&&("wppa_remake"==o&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==o&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==o&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+o+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":"Search index table";break;case"wppa_list_errorlog":"WPPA+ Error log";break;case"wppa_list_rating":"Recent ratings";break;case"wppa_list_session":"Active sessions";break;case"wppa_list_comments":"Recent comments"}var t=.9*wppaWindowWidth(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,o="action=wppa&wppa-action=maintenancepopup&slug="+e;if(o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(o),4==p.readyState&&200==p.status){var n=wppaEntityDecode(p.responseText).split("|"),i=n[0];n[0]="";var s=n.join("|").substring(1),l={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(s).dialog(l).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").html("<h2>"+i+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText)}}function wppaAjaxUpdateOptionValue(r,e,t){var p="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(r)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(p+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+r,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+r).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0])alert("The server returned unexpected output:\n"+a[0]);else{switch(a[1]){case"0":jQuery("#img_"+r).attr("src",wppaImageDirectory+"tick.png"),a[3]&&alert(a[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+r).attr("src",wppaImageDirectory+"cross.png"),a[3]&&alert(a[3])}if(jQuery("#img_"+r).attr("title",a[2]),a[4])for(var o,n,i,s=a[4].split(";"),l=0;l<s.length;)o=s[l].split(":"),n=jQuery("#"+o[0]).html(),i=o[1],""!=n&&""==i&&(i='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+o[0]).html(i),l++}},error:function(e){jQuery("#img_"+r).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+r).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=r&&"icon_corner_style"!=r||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=r&&"svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=r&&"ovl_svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){var t;if(void 0!==e){if("number"==typeof e)return e;var p=(t=(t=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0;for(t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var p=0;p<t.length;)"jpg"!=t[p]&&"JPG"!=t[p]||jQuery("#psdesc-"+e).css({display:""}),p++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaCheckLinkPageErr(e){var t="nil";document.getElementById(e+"_linktype")&&(t=document.getElementById(e+"_linktype").value),"0"!=document.getElementById(e+"_linkpage").value||"nil"!=t&&"photo"!=t&&"single"!=t&&"album"!=t&&"content"!=t&&"slide"!=t&&"plainpage"!=t?jQuery("#"+e+"-err").css({display:"none"}):jQuery("#"+e+"-err").css({display:""})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){var p=document.getElementById(t);e&&(p.value?p.value+=","+e:p.value=e,"-clear-"==e&&(p.value=""))}function wppaRefresh(e){var t=new String(document.location).split("#")[0]+"#"+e;document.location=t}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var p,a="",o=-1,n=-2,i=0,s=!1,l=0;l<e.length;)0!=(p=e[l].valueOf())&&(i=o,p==++i?s=!0:s?(a+=o==n?t+o+t+p:t+t+o+t+p,s=!1):a+=t+p,s||(n=p,n++),o=p),l++;for(s&&(a+=".."+o);"."==a.substr(0,1);)a=a.substr(1);for(;a.substr(0,1)==t;)a=a.substr(1);return a}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var p,a=[],o=0,n=0;for(t||(t="."),p=jQuery(e),n=o=0;o<p.length;)p[o].selected&&(a[n]=p[o].value,n++),o++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){var p=jQuery("#"+t).val();0==p.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+p}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+a,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+a+"-spin").css("display","inline")},success:function(e,t,p){var a=e.split("||");"0"==a[1]?document.location=a[2]:alert("Error: "+a[1]+"\n\n"+a[2])},error:function(e,t,p){alert("Export Db Table "+a+" failed. Error = "+p+", status = "+t)},complete:function(e,t,p){jQuery("#"+a+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(i){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+i,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+i+"_togo").html(a[0]);var o=jQuery("#"+i+"_status").html(),n=a[1];""!=o&&""==n&&(n='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+i+"_status").html(n),setTimeout(function(){wppaAjaxUpdateTogo(i)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||0==e)))}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+o).html(a[0])},error:function(e){},complete:function(e){}})}
1
+ var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album";function checkjQueryRev(e,t,p){var a=parseFloat(jQuery.fn.jquery);t.checked&&a<p&&(alert(e+"\nThe version of your jQuery library: "+a+" is too low for this feature. It requires version "+p),t.checked="")}function wppaReUpload(e,t,p){document.getElementById("wppa-re-up-form-"+t);var a=document.getElementById("wppa-re-up-file-"+t),o=document.getElementById("wppa-re-up-butn-"+t);e.preventDefault();var n=a.files[0];if(n.type.match("image.*")){if(0==p.length)alert("Filename will be set to "+n.name);else if(n.name!=p&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+t).css("display","none");o.value="Uploading...",o.style.color="black";var i=new FormData;i.append("photo",n,n.name);var s=new XMLHttpRequest,l="?action=wppa&wppa-action=update-photo&photo-id="+t+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;s.open("POST",wppaAjaxUrl+l,!0),s.onload=function(){if(200===s.status){var e=wppaTrim(s.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]),o.value="Upload",jQuery("#re-up-"+t).css("display","none");break;case"99":document.getElementById("photoitem-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",o.value="Error occured",o.style.color="red"}}else alert("An error occurred!")},s.send(i)}else alert("File is not an image file!")}function wppaInitSettings(){wppaCheckBreadcrumb(),wppaCheckFullHalign(),wppaCheckUseThumbOpacity(),wppaCheckUseCoverOpacity(),wppaCheckThumbType(),wppaCheckThumbLink(),wppaCheckTopTenLink(),wppaCheckFeaTenLink(),wppaCheckLasTenLink(),wppaCheckThumbnailWLink(),wppaCheckCommentLink(),wppaCheckXphotoLink(),wppaCheckMphotoLink(),wppaCheckSphotoLink(),wppaCheckSlidePhotoLink(),wppaCheckSlideOnlyLink(),wppaCheckAlbumWidgetLink(),wppaCheckSlideLink(),wppaCheckCoverImg(),wppaCheckPotdLink(),wppaCheckTagLink(),wppaCheckRating(),wppaCheckComments(),wppaCheckCustom(),wppaCheckResize(),wppaCheckNumbar(),wppaCheckWatermark(),wppaCheckPopup(),wppaCheckGravatar(),wppaCheckUserUpload(),wppaCheckAjax(),wppaCheckFotomoto(),wppaCheckLinkPageErr("sphoto"),wppaCheckLinkPageErr("mphoto"),wppaCheckLinkPageErr("xphoto"),wppaCheckLinkPageErr("topten_widget"),wppaCheckLinkPageErr("slideonly_widget"),wppaCheckLinkPageErr("potd"),wppaCheckLinkPageErr("comment_widget"),wppaCheckLinkPageErr("thumbnail_widget"),wppaCheckLinkPageErr("lasten_widget"),wppaCheckLinkPageErr("album_widget"),wppaCheckLinkPageErr("tagcloud"),wppaCheckLinkPageErr("multitag"),wppaCheckLinkPageErr("super_view"),wppaCheckSplitNamedesc(),wppaCheckShares(),wppaCheckCoverType(),wppaCheckNewpag(),wppaCheckCDN(),wppaCheckAutoPage(),wppaCheckGps(),wppaCheckFontPreview(),wppaCheckCheck("wppa_enable_video","wppa-video"),wppaCheckCheck("wppa_custom_fields","custfields"),wppaCheckCheck("wppa_album_custom_fields","albumcustfields"),wppaCheckCheck("wppa_new_mod_label_is_text","nmtxt"),wppaCheckCheck("wppa_coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for("on"==p?wppaShowTable(table):wppaHideTable(table),subtab=0;subtab<13;subtab++)"on"==(p=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]))&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","Z");for(table=1;table<13;table++)for(table<13?wppaShowTable(table):wppaHideTable(table),wppa_tablecookieoff(table),subtab=0;subtab<12;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);0<p.length&&(p.removeClass("wppa-none"),wppaSubTabOn[e[table-1]+"-"+t[subtab]]=!1,wppa_tablecookieoff(e[table-1]+"-"+t[subtab]))}if(tag1=jQuery("#wppa-quick-selbox-1").val(),tag2=jQuery("#wppa-quick-selbox-2").val(),"-"==tag1&&"-"==tag2)for(jQuery("._wppatag-").addClass("wppa-none"),table=1;table<13;table++)wppaHideTable(table);else"-"!=tag1&&jQuery("._wppatag-"+tag1).addClass("wppa-none"),"-"!=tag2&&jQuery("._wppatag-"+tag2).addClass("wppa-none")}function wppaToggleTable(e){"none"==jQuery("#wppa_table_"+e).css("display")?(jQuery("#wppa_table_"+e).css("display","inline"),wppa_tablecookieon(e)):(jQuery("#wppa_table_"+e).css("display","none"),wppa_tablecookieoff(e))}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",wppaMakeLazyVisible),wppaMakeLazyVisible()});var wppaSubTabOn=new Array;function wppaToggleSubTable(e,t){wppaSubTabOn[e+"-"+t]?(jQuery(".wppa-"+e+"-"+t).addClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-help").css("display","none"),wppaSubTabOn[e+"-"+t]=!1,wppa_tablecookieoff(e+"-"+t)):(jQuery(".wppa-"+e+"-"+t).removeClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-h").css("display",""),wppaSubTabOn[e+"-"+t]=!0,wppa_tablecookieon(e+"-"+t))}function wppaHideTable(e){jQuery("#wppa_table_"+e).css("display","none"),jQuery("#wppa_tableHide-"+e).css("display","none"),jQuery("#wppa_tableShow-"+e).css("display","inline"),wppa_tablecookieoff(e)}function wppaShowTable(e){jQuery("#wppa_table_"+e).css("display","block"),jQuery("#wppa_tableHide-"+e).css("display","inline"),jQuery("#wppa_tableShow-"+e).css("display","none"),wppa_tablecookieon(e)}var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaFollow(e,t){jQuery("#"+e).prop("checked")?jQuery("."+t).css("display",""):jQuery("."+t).css("display","none")}function wppaCheckCheck(e,t){var p=e.substring(5);document.getElementById(p).checked?(jQuery("."+t).css("display",""),jQuery(".-"+t).css("display","none")):(jQuery("."+t).css("display","none"),jQuery(".-"+t).css("display",""))}function wppaCheckSlideVideoControls(){"none"!=document.getElementById("slideshow_linktype").value&&alert("Warning! \nYou can not have video controls on a videoslide when there is a link on the slide.\nThe videoslide will not show controls and will also not autoplay")}function wppaCheckFotomoto(){document.getElementById("fotomoto_on").checked?jQuery(".wppa_fotomoto").css("display",""):jQuery(".wppa_fotomoto").css("display","none")}function wppaCheckFontPreview(){var e=document.getElementById("textual_watermark_font").value,t=document.getElementById("textual_watermark_type").value,p=wppaFontDirectory+"wmf"+e+"-"+t+".png",a=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",a)}function wppaCheckWidgetMethod(){var e,t;if("4"==document.getElementById("wppa-wm").value){document.getElementById("wppa-wp").style.visibility="visible";var p=jQuery("#wppa-wp").val();"day-of-week"==p||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")}else document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden");if("1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppaCheckFullHalign(){var e=document.getElementById("fullsize").value,t=document.getElementById("colwidth").value,p=document.getElementById("fullvalign").value;e!=t&&"default"!=p?jQuery(".wppa_ha").css("display",""):jQuery(".wppa_ha").css("display","none"),"auto"==t?jQuery(".wppa_init_resp_width").css("display",""):jQuery(".wppa_init_resp_width").css("display","none")}function wppaCheckCDN(){var e=document.getElementById("cdn_service").value;"cloudinary"==e||"cloudinarymaintenance"==e?jQuery(".cloudinary").css("display",""):jQuery(".cloudinary").css("display","none")}function wppaCheckGps(){"wppa-plus-embedded"==document.getElementById("gpx_implementation").value?(jQuery(".wppa_gpx_native").css("display",""),jQuery(".wppa_gpx_plugin").css("display","none")):(jQuery(".wppa_gpx_native").css("display","none"),jQuery(".wppa_gpx_plugin").css("display",""))}function wppaCheckThumbType(){var e=document.getElementById("thumbtype").value;"default"==e&&(jQuery(".tt_normal").css("display",""),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),wppaCheckUseThumbOpacity()),"ascovers"!=e&&"ascovers-mcr"!=e||(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display",""),jQuery(".tt_always").css("display","")),"masonry"==e&&(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),jQuery(".tt_masonry").css("display",""))}function wppaCheckAutoPage(){document.getElementById("auto_page").checked?jQuery(".autopage").css("display",""):jQuery(".autopage").css("display","none")}function wppaCheckUseThumbOpacity(){document.getElementById("use_thumb_opacity").checked?(jQuery(".thumb_opacity").css("color","#333"),jQuery(".thumb_opacity_html").css("visibility","visible")):(jQuery(".thumb_opacity").css("color","#999"),jQuery(".thumb_opacity_html").css("visibility","hidden"))}function wppaCheckUseCoverOpacity(){document.getElementById("use_cover_opacity").checked?(jQuery(".cover_opacity").css("color","#333"),jQuery(".cover_opacity_html").css("visibility","visible")):(jQuery(".cover_opacity").css("color","#999"),jQuery(".cover_opacity_html").css("visibility","hidden"))}function wppaCheckBreadcrumb(){var e=document.getElementById("show_bread_posts").checked,t=document.getElementById("show_bread_pages").checked;if(e||t){jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display","");var p=document.getElementById("bc_separator").value;"txt"==p?(jQuery(".wppa_bc_txt").css("display",""),jQuery(".wppa_bc_url").css("display","none"),jQuery(".wppa_bc_txt_html").css("display",""),jQuery(".wppa_bc_url_html").css("display","none")):"url"==p?(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display",""),jQuery(".wppa_bc_txt_html").css("display","none"),jQuery(".wppa_bc_url_html").css("display","")):(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))}else jQuery(".wppa_bc").css("display","none"),jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none")}function wppaCheckRating(){document.getElementById("rating_on").checked?(jQuery(".wppa_rating").css("color","#333"),jQuery(".wppa_rating_html").css("visibility","visible"),jQuery(".wppa_rating_").css("display","")):(jQuery(".wppa_rating").css("color","#999"),jQuery(".wppa_rating_html").css("visibility","hidden"),jQuery(".wppa_rating_").css("display","none"))}function wppaCheckComments(){document.getElementById("show_comments").checked?(jQuery(".wppa_comment").css("color","#333"),jQuery(".wppa_comment_html").css("visibility","visible"),jQuery(".wppa_comment_").css("display","")):(jQuery(".wppa_comment").css("color","#999"),jQuery(".wppa_comment_html").css("visibility","hidden"),jQuery(".wppa_comment_").css("display","none"))}function wppaCheckAjax(){document.getElementById("allow_ajax").checked?jQuery(".wppa_allow_ajax_").css("display",""):jQuery(".wppa_allow_ajax_").css("display","none")}function wppaCheckShares(){document.getElementById("share_on").checked||document.getElementById("share_on_widget").checked||document.getElementById("share_on_lightbox").checked||document.getElementById("share_on_thumbs").checked||document.getElementById("share_on_mphoto").checked?jQuery(".wppa_share").css("display",""):jQuery(".wppa_share").css("display","none")}function wppaCheckCoverType(){var e=document.getElementById("cover_type").value;document.getElementById("coverphoto_pos").value;"imagefactory"==e||"imagefactory-mcr"==e?jQuery(".wppa_imgfact_").css("display",""):jQuery(".wppa_imgfact_").css("display","none")}function wppaCheckNewpag(){document.getElementById("newpag_create").checked?jQuery(".wppa_newpag").css("display",""):jQuery(".wppa_newpag").css("display","none")}function wppaCheckCustom(){document.getElementById("custom_on").checked?(jQuery(".wppa_custom").css("color","#333"),jQuery(".wppa_custom_html").css("visibility","visible"),jQuery(".wppa_custom_").css("display","")):(jQuery(".wppa_custom").css("color","#999"),jQuery(".wppa_custom_html").css("visibility","hidden"),jQuery(".wppa_custom_").css("display","none"))}function wppaCheckWidgetLink(){"-1"==document.getElementById("wlp").value?(jQuery(".wppa_wlu").css("display",""),jQuery(".wppa_wlt").css("visibility","hidden")):(jQuery(".wppa_wlu").css("display","none"),jQuery(".wppa_wlt").css("visibility","visible"))}function wppaCheckSmWidgetLink(){"home"==document.getElementById("widget_sm_linktype").value?jQuery(".wppa_smrp").css("visibility","hidden"):jQuery(".wppa_smrp").css("visibility","")}function wppaCheckThumbLink(){var e=document.getElementById("thumb_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlp").css("visibility","hidden"):jQuery(".wppa_tlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlb").css("visibility","hidden"):jQuery(".wppa_tlb").css("visibility","visible")}function wppaCheckTopTenLink(){var e=document.getElementById("topten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlp").css("visibility","hidden"):jQuery(".wppa_ttlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlb").css("visibility","hidden"):jQuery(".wppa_ttlb").css("visibility","visible")}function wppaCheckFeaTenLink(){var e=document.getElementById("featen_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlp").css("visibility","hidden"):jQuery(".wppa_ftlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlb").css("visibility","hidden"):jQuery(".wppa_ftlb").css("visibility","visible")}function wppaCheckLasTenLink(){var e=document.getElementById("lasten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlp").css("visibility","hidden"):jQuery(".wppa_ltlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlb").css("visibility","hidden"):jQuery(".wppa_ltlb").css("visibility","visible")}function wppaCheckThumbnailWLink(){var e=document.getElementById("thumbnail_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlp").css("visibility","hidden"):jQuery(".wppa_tnlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlb").css("visibility","hidden"):jQuery(".wppa_tnlb").css("visibility","visible")}function wppaCheckCommentLink(){var e=document.getElementById("comment_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlp").css("visibility","hidden"):jQuery(".wppa_cmlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlb").css("visibility","hidden"):jQuery(".wppa_cmlb").css("visibility","visible")}function wppaCheckSlideOnlyLink(){var e=document.getElementById("slideonly_widget_linktype").value;"none"==e||"file"==e||"widget"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solp").css("visibility","hidden"):jQuery(".wppa_solp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solb").css("visibility","hidden"):jQuery(".wppa_solb").css("visibility","visible")}function wppaCheckAlbumWidgetLink(){var e=document.getElementById("album_widget_linktype").value;"lightbox"==e?jQuery(".wppa_awlp").css("visibility","hidden"):jQuery(".wppa_awlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_awlb").css("visibility","hidden"):jQuery(".wppa_awlb").css("visibility","visible")}function wppaCheckSlideLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckCoverImg(){var e=document.getElementById("coverimg_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_covimgbl").css("visibility","hidden"):jQuery(".wppa_covimgbl").css("visibility","visible")}function wppaCheckPotdLink(){var e=document.getElementById("potd_linktype").value;"none"==e||"lightbox"==e||"file"==e||"custom"==e?jQuery(".wppa_potdlp").css("visibility","hidden"):jQuery(".wppa_potdlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_potdlb").css("visibility","hidden"):jQuery(".wppa_potdlb").css("visibility","visible")}function wppaCheckTagLink(){document.getElementById("tagcloud_linktype").value}function wppaCheckMTagLink(){document.getElementById("multitag_linktype").value}function wppaCheckXphotoLink(){var e=document.getElementById("xphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_xlp").css("visibility","hidden"):jQuery(".wppa_xlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_xlb").css("visibility","hidden"):jQuery(".wppa_xlb").css("visibility","visible")}function wppaCheckMphotoLink(){var e=document.getElementById("mphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_mlp").css("visibility","hidden"):jQuery(".wppa_mlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_mlb").css("visibility","hidden"):jQuery(".wppa_mlb").css("visibility","visible")}function wppaCheckSphotoLink(){var e=document.getElementById("sphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_slp").css("visibility","hidden"):jQuery(".wppa_slp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_slb").css("visibility","hidden"):jQuery(".wppa_slb").css("visibility","visible")}function wppaCheckSlidePhotoLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"file"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslp").css("visibility","hidden"):jQuery(".wppa_sslp").css("visibility","visible"),"none"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckResize(){document.getElementById("resize_on_upload").checked?jQuery(".re_up").css("display",""):jQuery(".re_up").css("display","none")}function wppaCheckNumbar(){document.getElementById("show_slideshownumbar").checked?jQuery(".wppa_numbar").css("display",""):jQuery(".wppa_numbar").css("display","none")}function wppaCheckWatermark(){document.getElementById("watermark_on").checked?jQuery(".wppa_watermark").css("display",""):jQuery(".wppa_watermark").css("display","none")}function wppaCheckPopup(){document.getElementById("use_thumb_popup").checked?jQuery(".wppa_popup").css("display",""):jQuery(".wppa_popup").css("display","none")}function wppaCheckGravatar(){document.getElementById("comment_gravatar")&&("url"==document.getElementById("comment_gravatar").value?jQuery(".wppa_grav").css("display",""):jQuery(".wppa_grav").css("display","none"))}function wppaCheckUserUpload(){document.getElementById("user_upload_on").checked?jQuery(".wppa_feup").css("display",""):jQuery(".wppa_feup").css("display","none")}function wppaCheckSplitNamedesc(){document.getElementById("split_namedesc").checked?(jQuery(".swap_namedesc").css("display","none"),jQuery(".hide_empty").css("display","")):(jQuery(".swap_namedesc").css("display",""),jQuery(".hide_empty").css("display","none"))}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),p=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",p)}function checkAll(e,t){var p=document.getElementById(e);p&&(p.checked?jQuery(t).prop("checked","checked"):jQuery(t).prop("checked",""))}function impUpd(e,t){e.checked?(jQuery(t).prop("value",wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).prop("value",wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,p){var a="",o="";a=e||'<div style="padding-left:5px;" >',p?o=p:aftrer="</div>",wppaFeAjaxLog("in");var n=wppaGetXmlHttp(),i=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;i+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,n.open("GET",i,!0),n.send(),n.onreadystatechange=function(){switch(n.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==n.status){var e=wppaTrim(n.responseText).split("||");"ER"==e[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("photostatus-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=a+e[2]+o,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=a+'<span style="color:red;" >Comm error '+n.status+": "+n.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p.open("GET",e,!0),p.send(),p.onreadystatechange=function(){switch(p.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==p.status){var e=wppaTrim(p.responseText).split("||");"ER"==e[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("photostatus-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var o="action=wppa&wppa-action=watermark-photo&photo-id="+t;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(o+="&wppa-watermark-file="+e),p&&(o+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o),a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":document.getElementById("photostatus-"+t).innerHTML=e[2];break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>"}jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("photostatus-"+t).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"}}var wppaAjaxPhotoCount=new Array,wppaPhotoUpdateMatrix=new Array;function wppaAjaxUpdatePhoto(e,t,p,a,o){var n=!1;o&&(n=0==jQuery("#wppaphotodesc"+o+":visible").length,jQuery("#wppaphotodesc"+o+"-html").click(),n&&jQuery("#wppaphotodesc"+o+"-tmce").click());for(var i=wppaPhotoUpdateMatrix.length,s=0,l=!1,r=-1;s<i;)wppaPhotoUpdateMatrix[s][0]==e&&wppaPhotoUpdateMatrix[s][1]==t&&(l=!0,r=s),s++;if(!l){wppaPhotoUpdateMatrix[i]=[e,t,"undefined",!1,!1,a],r=i}wppaPhotoUpdateMatrix[r][3]="number"==typeof p?p:p.value,wppaPhotoUpdateMatrix[r][5]=a,wppaAjaxUpdatePhotoMonitor()}function wppaAjaxUpdateDelphoto(e,t,p){wppaAjaxUpdatePhoto(e,"del"+t,p)}function wppaAjaxUpdatePhotoMonitor(){for(var e=wppaPhotoUpdateMatrix.length,t=0;t<e;)wppaPhotoUpdateMatrix[t][2]==wppaPhotoUpdateMatrix[t][3]||wppaPhotoUpdateMatrix[t][4]||(wppaPhotoUpdateMatrix[t][4]=!0,_wppaAjaxUpdatePhoto(wppaPhotoUpdateMatrix[t][0],wppaPhotoUpdateMatrix[t][1],wppaPhotoUpdateMatrix[t][3],wppaPhotoUpdateMatrix[t][5])),t++}function _wppaAjaxUpdatePhoto(s,l,r,u,c,d){c||(c=""),d||(d="");wppaFeAjaxLog("in"),wppaAjaxPhotoCount[s]||(wppaAjaxPhotoCount[s]=0),wppaAjaxPhotoCount[s]++,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxPhotoCount[s]--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":var o;if(0==wppaAjaxPhotoCount[s]?jQuery("#photostatus-"+s).html(a[2]):jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")"),a[3])(o=jQuery("#fs-a-"+s).attr("href").split("="))[1]=parseInt(o[1])+1,jQuery("#fs-a-"+s).attr("href",o[0]+"="+o[1]),jQuery("#fs-img-"+s).attr("src",o[0]+"="+o[1]);if(a[4])(o=jQuery("#tnp-"+s).attr("src").split("="))[1]=parseInt(o[1])+1,jQuery("#tnp-"+s).attr("src",o[0]+"="+o[1]);void 0!==a[5]&&(jQuery("#imstack-"+s).html(a[5]),0<a[5].length?jQuery("#imstackbutton-"+s).css("display",""):jQuery("#imstackbutton-"+s).css("display","none")),void 0!==a[6]&&jQuery("#dispfileinfo-"+s).html(a[6]);break;case"99":jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+a[2]+"</span>"+d);break;default:jQuery("#photostatus-"+s).html('<span style="color:red">'+a[2]+" ("+a[1]+")</span>")}"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"});var n=0,i=-1;for(count=wppaPhotoUpdateMatrix.length;n<count;)wppaPhotoUpdateMatrix[n][0]==s&&wppaPhotoUpdateMatrix[n][1]==l&&(i=n),n++;if(wppaPhotoUpdateMatrix[i]&&(wppaPhotoUpdateMatrix[i][2]=r||0,wppaPhotoUpdateMatrix[i][4]=!1,wppaPhotoUpdateMatrix[i][5]=!1),wppaFeAjaxLog("out"),wppaAjaxUpdatePhotoMonitor(),u&&"0"==a[1])return jQuery("#photostatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),void setTimeout(function(){wppaReload("#photo_"+s)},1e3)},error:function(e,t,p){wppaAjaxPhotoCount[s]--,jQuery("#photostatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",document.getElementById("wppa-dummy")))}_wppaRefreshAfter=!1;var wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,p,a){var o=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var n=wppaAlbumUpdateMatrix.length,i=0,s=!1,l=-1;i<n;)wppaAlbumUpdateMatrix[i][0]==e&&wppaAlbumUpdateMatrix[i][1]==t&&(s=!0,l=i),i++;if(!s){wppaAlbumUpdateMatrix[n]=[e,t,"undefined",!1,!1,a],l=n}wppaAlbumUpdateMatrix[l][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[l][5]=a,wppaAjaxUpdateAlbumMonitor(o)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,p=0;p<t;)wppaAlbumUpdateMatrix[p][2]==wppaAlbumUpdateMatrix[p][3]||wppaAlbumUpdateMatrix[p][4]||(wppaAlbumUpdateMatrix[p][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[p][0],wppaAlbumUpdateMatrix[p][1],wppaAlbumUpdateMatrix[p][3],e,wppaAlbumUpdateMatrix[p][5])),p++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(s,l,r,u,c){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("album-nonce-"+s).value+"&value="+wppaEncode(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxAlbumCount--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+s).html(a[2]):jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+s).html='<span style="color:red">'+a[2]+" ("+a[1]+")</span>"}if(void 0!==a[3]&&wppaProcessFull(a[3],a[4]),c&&"0"==a[1])return jQuery("#albumstatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==l&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var o=0,n=-1,i=wppaAlbumUpdateMatrix.length;o<i;)wppaAlbumUpdateMatrix[o][0]==s&&wppaAlbumUpdateMatrix[o][1]==l&&(n=o),o++;wppaAlbumUpdateMatrix[n][2]=r||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(u)},error:function(e,t,p){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,p,e){var a=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+p+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]);break;default:jQuery("#photostatus-"+t).html('<span style="color:red">'+e[2]+"</span>")}jQuery("#wppa-comment-spin-"+p).css("visibility","hidden")}else jQuery("#photostatus-"+t).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")},a.open("GET",o,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(p.responseText).split("||");if(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=p.status)switch(e[1]){case"0":jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2]),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+p.status),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))}else jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+p.status);wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(o,e,i){if(i);else if(!e&&"yes"==document.getElementById(o+"_continue").value)return document.getElementById(o+"_continue").value="no",document.getElementById(o+"_button").value="Start!",void(0<jQuery("#"+o+"_togo").html()&&(jQuery("#"+o+"_status").html("Pausing..."),jQuery("#"+o+"_button").css("display","none")));i||(document.getElementById(o+"_continue").value="yes",document.getElementById(o+"_button").value="Stop!",""==jQuery("#"+o+"_status").html()&&jQuery("#"+o+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+o+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(i?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("||"),o=a[1],n=!1;return o?(10<a[0].length&&(alert("An error occurred:\n"+a[0]),n=!0),jQuery("#"+o+"_status").html(a[2]),jQuery("#"+o+"_togo").html(a[3]),jQuery("#"+o+"_button").css("display",""),n||"0"==a[3]?"reload"==a[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+o+"', false)",20):void("yes"!=document.getElementById(o+"_continue").value?i||jQuery("#"+o+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+o+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,p){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+o+", Error = "+p+", status = "+t,"force"),jQuery("#"+o+"_status").html("Server error #"+(11-wppaAlwaysContinue));var a=!1;--wppaAlwaysContinue<1&&(a=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(a||0<wppaAlwaysContinue)&&("wppa_remake"==o&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==o&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==o&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+o+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":"Search index table";break;case"wppa_list_errorlog":"WPPA+ Error log";break;case"wppa_list_rating":"Recent ratings";break;case"wppa_list_session":"Active sessions";break;case"wppa_list_comments":"Recent comments"}var t=.9*wppaWindowWidth(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,o="action=wppa&wppa-action=maintenancepopup&slug="+e;if(o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(o),4==p.readyState&&200==p.status){var n=wppaEntityDecode(p.responseText).split("|"),i=n[0];n[0]="";var s=n.join("|").substring(1),l={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(s).dialog(l).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").html("<h2>"+i+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText)}}function wppaAjaxUpdateOptionValue(r,e,t){var p="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(r)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(p+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+r,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+r.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0])alert("The server returned unexpected output:\n"+a[0]);else{switch(a[1]){case"0":jQuery("#img_"+r.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),a[3]&&alert(a[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+r.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),a[3]&&alert(a[3])}if(jQuery("#img_"+r.replace("#","H")).attr("title",a[2]),a[4])for(var o,n,i,s=a[4].split(";"),l=0;l<s.length;)o=s[l].split(":"),n=jQuery("#"+o[0]).html(),i=o[1],""!=n&&""==i&&(i='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+o[0]).html(i),l++}},error:function(e){jQuery("#img_"+r.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+r).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=r&&"icon_corner_style"!=r||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=r&&"svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=r&&"ovl_svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){var t;if(void 0!==e){if("number"==typeof e)return e;var p=(t=(t=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0;for(t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var p=0;p<t.length;)"jpg"!=t[p]&&"JPG"!=t[p]||jQuery("#psdesc-"+e).css({display:""}),p++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaCheckLinkPageErr(e){var t="nil";document.getElementById(e+"_linktype")&&(t=document.getElementById(e+"_linktype").value),"0"!=document.getElementById(e+"_linkpage").value||"nil"!=t&&"photo"!=t&&"single"!=t&&"album"!=t&&"content"!=t&&"slide"!=t&&"plainpage"!=t?jQuery("#"+e+"-err").css({display:"none"}):jQuery("#"+e+"-err").css({display:""})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){var p=document.getElementById(t);e&&(p.value?p.value+=","+e:p.value=e,"-clear-"==e&&(p.value=""))}function wppaRefresh(e){var t=new String(document.location).split("#")[0]+"#"+e;document.location=t}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var p,a="",o=-1,n=-2,i=0,s=!1,l=0;l<e.length;)0!=(p=e[l].valueOf())&&(i=o,p==++i?s=!0:s?(a+=o==n?t+o+t+p:t+t+o+t+p,s=!1):a+=t+p,s||(n=p,n++),o=p),l++;for(s&&(a+=".."+o);"."==a.substr(0,1);)a=a.substr(1);for(;a.substr(0,1)==t;)a=a.substr(1);return a}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var p,a=[],o=0,n=0;for(t||(t="."),p=jQuery(e),n=o=0;o<p.length;)p[o].selected&&(a[n]=p[o].value,n++),o++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){var p=jQuery("#"+t).val();0==p.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+p}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+a,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+a+"-spin").css("display","inline")},success:function(e,t,p){var a=e.split("||");"0"==a[1]?document.location=a[2]:alert("Error: "+a[1]+"\n\n"+a[2])},error:function(e,t,p){alert("Export Db Table "+a+" failed. Error = "+p+", status = "+t)},complete:function(e,t,p){jQuery("#"+a+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(i){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+i,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+i+"_togo").html(a[0]);var o=jQuery("#"+i+"_status").html(),n=a[1];""!=o&&""==n&&(n='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+i+"_status").html(n),setTimeout(function(){wppaAjaxUpdateTogo(i)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||0==e)))}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+o).html(a[0])},error:function(e){},complete:function(e){}})}
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 7.0.07
7
  *
8
  */
9
 
@@ -11,36 +11,28 @@ if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
11
 
12
  function wppa_backup_settings() {
13
  global $wppa_opt;
14
- global $wppa_bu_err;
15
-
16
- // Open file
17
- $fname = WPPA_DEPOT_PATH.'/settings.bak';
18
- if ( wppa( 'debug' ) ) wppa_dbg_msg( 'Backing up to: '.$fname );
19
-
20
- $file = wppa_fopen( $fname, 'wb' );
21
- // Backup
22
- if ( $file ) {
23
- array_walk( $wppa_opt, 'wppa_save_an_option', $file );
24
- // Close file
25
- fclose( $file );
26
- if ( ! $wppa_bu_err ) {
27
- wppa_ok_message( __( 'Settings successfully backed up' , 'wp-photo-album-plus') );
28
- return true;
29
- }
30
  }
31
- wppa_error_message( __( 'Unable to backup settings' , 'wp-photo-album-plus') );
32
- return false;
33
- }
34
 
35
- function wppa_save_an_option( $value, $key, $file ) {
36
- global $wppa_bu_err;
37
- $value = str_replace( "\n", "\\n", $value );
38
- if ( fwrite( $file, $key.":".$value."\n" ) === false ) {
39
- if ( $wppa_bu_err !== true ) {
40
- wppa_error_message( __( 'Error writing to settings backup file' , 'wp-photo-album-plus') );
41
- $wppa_bu_err = true;
42
- }
 
 
43
  }
 
 
44
  }
45
 
46
  function wppa_restore_settings( $fname, $type = '' ) {
@@ -89,12 +81,12 @@ function wppa_restore_settings( $fname, $type = '' ) {
89
  );
90
  }
91
 
92
- // Open file
93
- $file = wppa_fopen( $fname, 'r' );
 
94
  // Restore
95
- if ( $file ) {
96
- $buffer = fgets( $file, 4096 );
97
- while ( !feof( $file ) ) {
98
  $buflen = strlen( $buffer );
99
  if ( $buflen > '0' && substr( $buffer, 0, 1 ) != '/' ) { // lines that start with '/' are comment
100
  $cpos = strpos( $buffer, ':' );
@@ -109,9 +101,7 @@ function wppa_restore_settings( $fname, $type = '' ) {
109
  else wppa_dbg_msg( $slug.' skipped' );
110
  }
111
  }
112
- $buffer = fgets( $file, 4096 );
113
  }
114
- fclose( $file );
115
  wppa_initialize_runtime( true );
116
  return true;
117
  }
@@ -452,7 +442,7 @@ global $wpdb;
452
  break;
453
  case 3:
454
  $err = '17';
455
- $bret = imagepng( $rotate, $file );
456
  break;
457
  default:
458
  $err = '20';
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 7.0.09
7
  *
8
  */
9
 
11
 
12
  function wppa_backup_settings() {
13
  global $wppa_opt;
14
+
15
+
16
+ // Make contents
17
+ $contents = '';
18
+ foreach( array_keys( $wppa_opt ) as $key ) {
19
+ $value = str_replace( "\n", "\\n", $wppa_opt[$key] );
20
+ $contents .= $key.":".$value."\n";
 
 
 
 
 
 
 
 
 
21
  }
 
 
 
22
 
23
+ // Save to file
24
+ wppa_ok_message( __( 'Backing up to', 'wp-photo-album-plus' ) . ': ' . str_replace( WPPA_ABSPATH, '.../', WPPA_DEPOT_PATH ) . '/settings.bak' );
25
+ $bret = wppa_put_contents( WPPA_DEPOT_PATH . '/settings.bak', $contents );
26
+
27
+ // Report
28
+ if ( $bret ) {
29
+ wppa_ok_message( __( 'Settings successfully backed up' , 'wp-photo-album-plus') );
30
+ }
31
+ else {
32
+ wppa_error_message( __( 'Unable to backup settings' , 'wp-photo-album-plus') );
33
  }
34
+
35
+ return $bret;
36
  }
37
 
38
  function wppa_restore_settings( $fname, $type = '' ) {
81
  );
82
  }
83
 
84
+ // Get file contents
85
+ $buffers = wppa_get_contents_array( $fname );
86
+
87
  // Restore
88
+ if ( $buffers ) {
89
+ foreach( $buffers as $buffer ) {
 
90
  $buflen = strlen( $buffer );
91
  if ( $buflen > '0' && substr( $buffer, 0, 1 ) != '/' ) { // lines that start with '/' are comment
92
  $cpos = strpos( $buffer, ':' );
101
  else wppa_dbg_msg( $slug.' skipped' );
102
  }
103
  }
 
104
  }
 
105
  wppa_initialize_runtime( true );
106
  return true;
107
  }
442
  break;
443
  case 3:
444
  $err = '17';
445
+ $bret = imagepng( $rotate, $file, 6 );
446
  break;
447
  default:
448
  $err = '20';
wppa-ajax.php CHANGED
@@ -2637,15 +2637,9 @@ global $wppa_log_file;
2637
  if ( ! wppa_is_dir( dirname( $path ) ) ) {
2638
  wppa_mkdir( dirname( $path ) );
2639
  }
2640
- $file = wppa_fopen( $path, 'wb' );
2641
- if ( ! $file ) {
2642
- $err = true;
2643
- }
2644
- if ( fwrite( $file, $value ) === false ) {
2645
- $err = true;
2646
- }
2647
- @ fclose( $file );
2648
- if ( $err ) {
2649
  $title = __( 'Failed to save code', 'wp-photo-album-plus' );
2650
  $alert = __( 'Failed to save code', 'wp-photo-album-plus' );
2651
  }
@@ -3334,8 +3328,8 @@ global $wppa_log_file;
3334
  break;
3335
 
3336
  case 'wppa_errorlog_purge':
3337
- if ( is_file( $wppa_log_file ) ) {
3338
- unlink( $wppa_log_file );
3339
  }
3340
  break;
3341
 
@@ -3345,7 +3339,7 @@ global $wppa_log_file;
3345
  // Remove old file if it exists
3346
  $oldfile = WPPA_CONTENT_PATH . '/' . get_option( 'wppa_pl_dirname' ) . '/.htaccess';
3347
  if ( is_file( $oldfile ) ) {
3348
- if ( ! unlink( $oldfile ) ) {
3349
  wppa_log('obs', 'Could not remove: '.$oldfile);
3350
  }
3351
  }
2637
  if ( ! wppa_is_dir( dirname( $path ) ) ) {
2638
  wppa_mkdir( dirname( $path ) );
2639
  }
2640
+ $bret = wppa_put_contents( $path, $value );
2641
+
2642
+ if ( ! $bret ) {
 
 
 
 
 
 
2643
  $title = __( 'Failed to save code', 'wp-photo-album-plus' );
2644
  $alert = __( 'Failed to save code', 'wp-photo-album-plus' );
2645
  }
3328
  break;
3329
 
3330
  case 'wppa_errorlog_purge':
3331
+ if ( wppa_is_file( $wppa_log_file ) ) {
3332
+ wppa_unlink( $wppa_log_file );
3333
  }
3334
  break;
3335
 
3339
  // Remove old file if it exists
3340
  $oldfile = WPPA_CONTENT_PATH . '/' . get_option( 'wppa_pl_dirname' ) . '/.htaccess';
3341
  if ( is_file( $oldfile ) ) {
3342
+ if ( ! wppa_unlink( $oldfile ) ) {
3343
  wppa_log('obs', 'Could not remove: '.$oldfile);
3344
  }
3345
  }
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.0.07
6
  *
7
  */
8
 
@@ -297,64 +297,6 @@ static $randseed_modified;
297
  return $randseed;
298
  }
299
 
300
- /*
301
- function wppa_phpinfo( $key = -1 ) {
302
-
303
- if ( ! current_user_can( 'adminstrator' ) ) return;
304
-
305
- echo '<div id="phpinfo" style="width:600px; margin:auto;" >';
306
-
307
- ob_start();
308
- if ( wppa_switch( 'allow_debug' ) ) phpinfo( -1 ); else phpinfo( 4 );
309
- $php = ob_get_clean();
310
- $php = preg_replace( array ( '@<!DOCTYPE.*?>@siu',
311
- '@<html.*?>@siu',
312
- '@</html.*?>@siu',
313
- '@<head[^>]*?>.*?</head>@siu',
314
- '@<body.*?>@siu',
315
- '@</body.*?>@siu',
316
- '@cellpadding=".*?"@siu',
317
- '@border=".*?"@siu',
318
- '@width=".*?"@siu',
319
- '@name=".*?"@siu',
320
- '@<font.*?>@siu',
321
- '@</font.*?>@siu'
322
- ),
323
- '',
324
- $php );
325
-
326
- $php = str_replace( 'Features','Features</td><td>', $php );
327
-
328
- echo $php;
329
-
330
- echo '</div>';
331
- }
332
- */
333
-
334
- function wppa_errorlog() {
335
-
336
- // Make name
337
- $filename = WPPA_CONTENT_PATH.'/wppa-depot/admin/error.log';
338
-
339
- // Logfile present?
340
- if ( ! is_file( $filename ) ) return;
341
-
342
- // Open file
343
- $file = wppa_fopen( $filename, 'r' );
344
-
345
- // If unable to open, quit
346
- if ( ! $file ) return;
347
- wppa_dbg_msg( 'Start errorlog' );
348
-
349
- $size = filesize( $filename );
350
- $data = fread( $file, $size );
351
-
352
- echo str_replace( "\n", '<br />', $data );
353
-
354
- wppa_dbg_msg( 'dbg', 'End errorlog' );
355
- fclose( $file );
356
- }
357
-
358
  // get the url to the plugins image directory
359
  function wppa_get_imgdir( $file = '', $rel = false ) {
360
 
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 7.0.09
6
  *
7
  */
8
 
297
  return $randseed;
298
  }
299
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  // get the url to the plugins image directory
301
  function wppa_get_imgdir( $file = '', $rel = false ) {
302
 
wppa-import.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
- * Version 7.0.06
7
  *
8
  */
9
 
@@ -1702,10 +1702,10 @@ global $wppa_supported_audio_extensions;
1702
  $parent = '0';
1703
  $porder = '0';
1704
  $owner = '';
1705
- $handle = wppa_fopen( WPPA_DEPOT_PATH . '/' . basename( $album ), "r" );
1706
- if ( $handle ) {
1707
- $buffer = fgets( $handle, 4096 );
1708
- while ( !feof( $handle ) ) {
1709
  $tag = substr( $buffer, 0, 5 );
1710
  $len = strlen( $buffer ) - 6; // substract 5 for label and one for eol
1711
  $data = substr( $buffer, 5, $len );
@@ -1740,9 +1740,8 @@ global $wppa_supported_audio_extensions;
1740
  $owner = $data;
1741
  break;
1742
  }
1743
- $buffer = fgets( $handle, 4096 );
1744
- } // while !foef
1745
- fclose( $handle );
1746
  if ( wppa_get_album_id( $name ) != '' ) {
1747
  wppa_warning_message( 'Album already exists ' . stripslashes( $name ) );
1748
  if ( $dela ) wppa_unlink( $album );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
+ * Version 7.0.09
7
  *
8
  */
9
 
1702
  $parent = '0';
1703
  $porder = '0';
1704
  $owner = '';
1705
+ $path = WPPA_DEPOT_PATH . '/' . basename( $album );
1706
+ if ( wppa_is_file( $path ) ) {
1707
+ $buffers = wppa_get_contents_array( $path );
1708
+ foreach( $buffers as $buffer ) {
1709
  $tag = substr( $buffer, 0, 5 );
1710
  $len = strlen( $buffer ) - 6; // substract 5 for label and one for eol
1711
  $data = substr( $buffer, 5, $len );
1740
  $owner = $data;
1741
  break;
1742
  }
1743
+ }
1744
+
 
1745
  if ( wppa_get_album_id( $name ) != '' ) {
1746
  wppa_warning_message( 'Album already exists ' . stripslashes( $name ) );
1747
  if ( $dela ) wppa_unlink( $album );
wppa-local-cdn.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains routines for local cdn implementation
6
- * Version 7.0.06
7
  *
8
  */
9
 
@@ -120,6 +120,18 @@ function wppa_cdn_make( $id, $x, $y ) {
120
 
121
  case 3: // png
122
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  break;
124
 
125
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains routines for local cdn implementation
6
+ * Version 7.0.09
7
  *
8
  */
9
 
120
 
121
  case 3: // png
122
 
123
+ // Make source image
124
+ $src = wppa_imagecreatefrompng( $fmpath );
125
+
126
+ // Make empty destination image
127
+ $dst = imagecreatetruecolor( $x, $y );
128
+
129
+ // Copy rescaled
130
+ imagecopyresampled( $dst, $src, 0, 0, 0, 0, $x, $y, $fmsize[0], $fmsize[1] );
131
+
132
+ // Save new image
133
+ $bret = imagepng( $dst, $topath, 6 );
134
+
135
  break;
136
 
137
  }
wppa-maintenance.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
- * Version 7.0.06
7
  *
8
  */
9
 
@@ -1243,22 +1243,14 @@ global $wppa_log_file;
1243
  $result .=
1244
  '<div style="float:left; clear:both; width:100%; overflow:auto; word-wrap:none;" >';
1245
 
1246
- if ( ! $file = wppa_fopen( $wppa_log_file, 'r' ) ) {
1247
  $result .= __( 'There are no log messages', 'wp-photo-album-plus' );
1248
  }
1249
  else {
1250
- $size = filesize( $wppa_log_file );
1251
- $data = fread( $file, $size );
1252
- $data = strip_tags( $data );
1253
-
1254
- // Trim leading partial logline
1255
- if ( substr( $data, 0, 1 ) != '{' ) {
1256
- $brpos = strpos( $data, "\n" );
1257
- $data = substr( $data, $brpos + 1 );
1258
- }
1259
  $data = str_replace( array( '{b}', '{/b}', '{i}', '{/i}', "\n", '{span', '{/span}', '" }', '{}' ), array( '<b>', '</b>', '<i>', '</i>', '<br />', '<span', '</span>', '" >', '<>' ), $data );
1260
  $result .= $data;
1261
- fclose( $file );
1262
  }
1263
 
1264
  $result .= '
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 7.0.09
7
  *
8
  */
9
 
1243
  $result .=
1244
  '<div style="float:left; clear:both; width:100%; overflow:auto; word-wrap:none;" >';
1245
 
1246
+ if ( ! wppa_is_file( $wppa_log_file ) ) {
1247
  $result .= __( 'There are no log messages', 'wp-photo-album-plus' );
1248
  }
1249
  else {
1250
+ $data = wppa_get_contents_array( $wppa_log_file );
1251
+ $data = implode( '', array_reverse( $data ) );
 
 
 
 
 
 
 
1252
  $data = str_replace( array( '{b}', '{/b}', '{i}', '{/i}', "\n", '{span', '{/span}', '" }', '{}' ), array( '<b>', '</b>', '<i>', '</i>', '<br />', '<span', '</span>', '" >', '<>' ), $data );
1253
  $result .= $data;
 
1254
  }
1255
 
1256
  $result .= '
wppa-non-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
- * Version 7.0.07
7
  *
8
  */
9
 
@@ -902,8 +902,7 @@ global $wppa_dynamic_css_data;
902
 
903
  if ( wppa( 'debug' ) ) {
904
  error_reporting( wppa( 'debug' ) );
905
- // add_action( 'wp_footer', 'wppa_phpinfo' );
906
- add_action( 'wp_footer', 'wppa_errorlog' );
907
  echo '
908
  <script type="text/javascript" >
909
  wppaDebug = true;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
+ * Version 7.0.09
7
  *
8
  */
9
 
902
 
903
  if ( wppa( 'debug' ) ) {
904
  error_reporting( wppa( 'debug' ) );
905
+
 
906
  echo '
907
  <script type="text/javascript" >
908
  wppaDebug = true;
wppa-settings-autosave.php CHANGED
@@ -11329,22 +11329,44 @@ global $wppa_opt;
11329
  return $html;
11330
  }
11331
 
11332
- function wppa_edit($xslug, $value, $width = '90%', $minwidth = '', $text = '', $onchange = '') {
11333
 
11334
- $slug = substr( $xslug, 5 );
11335
- $tit = __('Slug =', 'wp-photo-album-plus').' '.$xslug;
11336
- $title = wppa_switch( 'enable_shortcode_wppa_set' ) ? ' title="'.esc_attr( $tit ).'"' : '';
11337
- $html = '<input'.$title.' style="float:left; width: '.$width.'; height:20px;';
11338
- if ($minwidth != '') $html .= ' min-width:'.$minwidth.';';
11339
- $html .= ' font-size: 11px; margin: 0px; padding: 0px;" type="text" id="'.$slug.'"';
11340
- if ($onchange != '') $html .= ' onchange="'.$onchange.';wppaAjaxUpdateOptionValue(\''.$slug.'\', this)"';
11341
- else $html .= ' onchange="wppaAjaxUpdateOptionValue(\''.$slug.'\', this)"';
11342
- $html .= ' value="'.esc_attr($value).'" />';
11343
- $html .= '<img id="img_'.$slug.'" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
11344
- $html .= $text;
11345
 
11346
- return $html;
 
 
 
 
 
 
 
 
 
11347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11348
  }
11349
 
11350
  function wppa_textarea($xslug, $buttonlabel = '') {
@@ -11513,7 +11535,7 @@ global $wppa_opt;
11513
  $idx++;
11514
  }
11515
  $html .= '</select>';
11516
- $html .= '<img id="img_'.$slug.'" class="'.$class.'" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
11517
 
11518
  return $html;
11519
  }
@@ -11599,7 +11621,7 @@ function wppa_select_e( $xslug, $curval, $options, $values, $onchange = '', $cla
11599
  $idx++;
11600
  }
11601
  $html .= '</select>';
11602
- $html .= '<img id="img_'.$slug.'" class="'.$class.'" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding-left:4px; float:left; height:16px; width:16px;" />';
11603
 
11604
  return $html;
11605
  }
11329
  return $html;
11330
  }
11331
 
11332
+ function wppa_edit( $xslug, $value, $width = '90%', $minwidth = '', $text = '', $onch = '' ) {
11333
 
11334
+ // Slug
11335
+ $slug = substr( $xslug, 5 );
 
 
 
 
 
 
 
 
 
11336
 
11337
+ // Title
11338
+ $tit = __( 'Slug =', 'wp-photo-album-plus' ) . ' ' . $xslug;
11339
+ $title = wppa_switch( 'enable_shortcode_wppa_set' ) ? esc_attr( $tit ) : '';
11340
+
11341
+ // Style
11342
+ $style = 'float:left;width:' . $width . ';height:20px;';
11343
+ $style .= 'font-size:11px;margin:0;padding:0;';
11344
+ if ( $minwidth != '' ) {
11345
+ $style .= 'min-width:' . $minwidth . ';';
11346
+ }
11347
 
11348
+ // Onchange
11349
+ $onchange = ltrim( $onch . ';wppaAjaxUpdateOptionValue(\'' . $slug . '\',this)', ';' );
11350
+
11351
+ // Compose the html
11352
+ $html = '
11353
+ <input
11354
+ id="' . esc_attr( $slug ) . '"
11355
+ title="' . esc_attr( $title ) . '"
11356
+ type="text"
11357
+ style="' . esc_attr( $style ) . '"
11358
+ value="' . esc_attr( $value ) . '"
11359
+ onchange="' . esc_attr( $onchange ) . '"
11360
+ />
11361
+ <img
11362
+ id="' . esc_attr( 'img_' . str_replace( '#', 'H', $slug ) ) . '"
11363
+ src="' . esc_url( wppa_get_imgdir() . 'star.ico' ) . '"
11364
+ title="' . esc_attr( __( 'Setting unmodified', 'wp-photo-album-plus' ) ) . '"
11365
+ style="padding:0 4px;float:left;height:16px;width:16px;"
11366
+ />' .
11367
+ $text;
11368
+
11369
+ return $html;
11370
  }
11371
 
11372
  function wppa_textarea($xslug, $buttonlabel = '') {
11535
  $idx++;
11536
  }
11537
  $html .= '</select>';
11538
+ $html .= '<img id="img_'.str_replace( '#', 'H', $slug ).'" class="'.$class.'" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
11539
 
11540
  return $html;
11541
  }
11621
  $idx++;
11622
  }
11623
  $html .= '</select>';
11624
+ $html .= '<img id="img_'.str_replace( '#', 'H', $slug ).'" class="'.$class.'" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding-left:4px; float:left; height:16px; width:16px;" />';
11625
 
11626
  return $html;
11627
  }
wppa-styles.php CHANGED
@@ -3,7 +3,7 @@
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
- /* Version 6.9.16
7
  /*
8
  */
9
 
@@ -261,36 +261,34 @@ global $wppa_dynamic_css_data;
261
  // Add custom style
262
  $content .= wppa_opt( 'custom_style' );
263
 
264
- // Open file
265
- $file = wppa_fopen ( WPPA_PATH . '/dynamic/wppa-dynamic.css', 'wb' );
266
- if ( $file ) {
267
- // Minify
268
- $old_len = strlen( $content );
269
- $new_len = '0';
270
- while ( $old_len != $new_len ) {
271
- $content = str_replace( ' ', ' ', $content );
272
- $old_len = $new_len;
273
- $new_len = strlen( $content );
274
- }
275
- $content = str_replace( "\t", '', $content );
276
- $content = str_replace( "\n", '', $content );
277
- $content = str_replace( ' }', '}', $content );
278
- $content = str_replace( '} ', '}', $content );
279
- $content = str_replace( ' {', '{', $content );
280
- $content = str_replace( '{ ', '{', $content );
281
- $content = str_replace( ' ;', ';', $content );
282
- $content = str_replace( '; ', ';', $content );
283
- $content = str_replace( ' :', ':', $content );
284
- $content = str_replace( ': ', ':', $content );
285
- $content = str_replace( '}', "}\n", $content );
286
- $content = str_replace( '*/', "*/\n", $content );
287
- $content = str_replace( ",\n", ',', $content );
288
- // Write file
289
- fwrite ( $file, $header . $content );
290
- // Close file
291
- fclose ( $file );
292
  $wppa_dynamic_css_data = '';
293
  }
 
 
294
  else {
295
  $wppa_dynamic_css_data =
296
  '<style type="text/css">
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
+ /* Version 7.0.09
7
  /*
8
  */
9
 
261
  // Add custom style
262
  $content .= wppa_opt( 'custom_style' );
263
 
264
+ // Minify
265
+ $old_len = strlen( $content );
266
+ $new_len = '0';
267
+ while ( $old_len != $new_len ) {
268
+ $content = str_replace( ' ', ' ', $content );
269
+ $old_len = $new_len;
270
+ $new_len = strlen( $content );
271
+ }
272
+ $content = str_replace( "\t", '', $content );
273
+ $content = str_replace( "\n", '', $content );
274
+ $content = str_replace( ' }', '}', $content );
275
+ $content = str_replace( '} ', '}', $content );
276
+ $content = str_replace( ' {', '{', $content );
277
+ $content = str_replace( '{ ', '{', $content );
278
+ $content = str_replace( ' ;', ';', $content );
279
+ $content = str_replace( '; ', ';', $content );
280
+ $content = str_replace( ' :', ':', $content );
281
+ $content = str_replace( ': ', ':', $content );
282
+ $content = str_replace( '}', "}\n", $content );
283
+ $content = str_replace( '*/', "*/\n", $content );
284
+ $content = str_replace( ",\n", ',', $content );
285
+
286
+ // Write to file
287
+ if ( wppa_put_contents( WPPA_PATH . '/dynamic/wppa-dynamic.css', $header . $content ) ) {
 
 
 
 
288
  $wppa_dynamic_css_data = '';
289
  }
290
+
291
+ // File error, keep data in global for output on page
292
  else {
293
  $wppa_dynamic_css_data =
294
  '<style type="text/css">
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 7.0.06
7
  *
8
  */
9
 
@@ -1579,31 +1579,29 @@ global $wppa_log_file;
1579
  }
1580
  }
1581
 
1582
- // See if max size exceeded
1583
- if ( is_file( $wppa_log_file ) ) {
1584
- $filesize = filesize( $wppa_log_file );
1585
- if ( $filesize > 1024000 ) {
1586
-
1587
- // File > 1000kB, shorten it
1588
- $file = @ fopen( $wppa_log_file, 'rb' );
1589
- if ( $file ) {
1590
- $buffer = @ fread( $file, $filesize );
1591
- $buffer = substr( $buffer, $filesize - 900*1024 ); // Take ending 900 kB
1592
- fclose( $file );
1593
- $file = @ fopen( $wppa_log_file, 'wb' );
1594
- @ fwrite( $file, $buffer );
1595
- @ fclose( $file );
1596
  }
1597
  }
 
 
 
 
 
 
1598
  }
1599
-
1600
- // Open for append
1601
- if ( ! $file = fopen( $wppa_log_file, 'ab' ) ) return; // Unable to open log file
1602
 
1603
  // Write log message
1604
  $msg = strip_tags( $msg );
1605
-
1606
- @ fwrite( $file, '{b}'.$type.'{/b}: on:'.wppa_local_date( 'd.m.Y H:i:s', time()).': '.wppa_get_user().': '.$msg. ' ' );
1607
 
1608
  // Log stacktrace 3 levels
1609
  if ( $trace ) {
@@ -1617,34 +1615,27 @@ global $wppa_log_file;
1617
  $i++;
1618
  }
1619
  }
1620
- /*
1621
- ob_start();
1622
- debug_print_backtrace( 0, 5 );//DEBUG_BACKTRACE_IGNORE_ARGS, 12 );
1623
- $trace = ob_get_contents();
1624
- ob_end_clean();
1625
- */
1626
- @ fwrite( $file, $traceline . "\n" );
1627
- }
1628
- else {
1629
- @ fwrite( $file, "\n" );
1630
  }
 
 
1631
  if ( $trace || strtolower( substr( $xtype, 0, 2 ) ) == 'er' ) {
1632
- @ fwrite( $file, '{b}url{/b}: '.$_SERVER['REQUEST_URI']."\n" );
1633
  }
1634
 
1635
  // Add uri history
1636
  if ( $listuri ) {
1637
- @ fwrite( $file, 'Uri history:'."\n" );
1638
  if ( is_array( $wppa_session ) ) {
1639
  foreach ( $wppa_session['uris'] as $uri ) {
1640
- @ fwrite( $file, $uri . "\n" );
1641
  }
1642
- @ fwrite( $file, "\n\n" );
1643
  }
1644
  }
1645
 
1646
  // Done
1647
- @ fclose( $file );
1648
  }
1649
 
1650
  function wppa_is_landscape($img_attr) {
@@ -3790,10 +3781,9 @@ function wppa_memry_limit() {
3790
  // Create qr code cache and return its url
3791
  function wppa_create_qrcode_cache( $qrsrc ) {
3792
 
3793
- /* hbi */
3794
  // Make sure the data portion is url encoded
3795
- // $temp = explode( 'data=', $qrsrc );
3796
- // $qrsrc = $temp[0] . 'data=' . urlencode( urldecode( $temp[1] ) );
3797
 
3798
  // Anything to do here?
3799
  if ( ! wppa_switch( 'qr_cache' ) ) {
@@ -3820,20 +3810,25 @@ function wppa_create_qrcode_cache( $qrsrc ) {
3820
  // Catch the qr image
3821
  $curl = curl_init();
3822
  curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
3823
- curl_setopt( $curl, CURLOPT_URL, urlencode( $qrsrc ) ); // urlencode here is a security fix, does it still work?, see above /* hbi */
3824
  $contents = curl_exec( $curl );
3825
  curl_close( $curl );
3826
 
3827
  // Save the image
3828
  if ( strlen( $contents ) > 1000 ) {
3829
- $file = wppa_fopen( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg', 'w' );
 
 
 
 
3830
  if ( $file ) {
3831
  fwrite( $file, $contents, strlen( $contents ) );
3832
  fclose( $file );
3833
  }
 
3834
  }
3835
 
3836
- if ( is_file( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg' ) ) {
3837
  return WPPA_UPLOAD_URL . '/qr/' . $key . '.svg';
3838
  }
3839
  else {
@@ -4730,24 +4725,11 @@ function wppa_dump( $txt = '' ) {
4730
  // Init
4731
  $file = WPPA_PATH . '/wppa-dump.txt';
4732
 
4733
- // Open file, append if text not empty
4734
- if ( file_exists( $file ) && $txt ) {
4735
- $mode = 'ab';
4736
  }
4737
-
4738
- // Overwrite if file not exists or empty text
4739
  else {
4740
- $mode = 'wb';
4741
- }
4742
- $handle = wppa_fopen( $file, $mode );
4743
-
4744
- // Write
4745
- if ( $handle ) {
4746
- if ( is_array( $txt ) ) {
4747
- $txt = var_export( $txt, true );
4748
- }
4749
- fwrite( $handle, $txt . "\n" );
4750
- fclose( $handle );
4751
  }
4752
  }
4753
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 7.0.09
7
  *
8
  */
9
 
1579
  }
1580
  }
1581
 
1582
+ // Get existing log if it exists
1583
+ if ( wppa_is_file( $wppa_log_file, false ) ) {
1584
+
1585
+ $contents = wppa_get_contents_array( $wppa_log_file, false );
1586
+
1587
+ if ( is_array( $contents ) ) {
1588
+
1589
+ // See if max size exceeded, if so, remove 10 items at the start
1590
+ if ( count( $contents ) > 1000 ) {
1591
+ $contents = array_slice( $contents, 10 );
 
 
 
 
1592
  }
1593
  }
1594
+ else {
1595
+ $contents = array();
1596
+ }
1597
+ }
1598
+ else {
1599
+ $contents = array();
1600
  }
 
 
 
1601
 
1602
  // Write log message
1603
  $msg = strip_tags( $msg );
1604
+ array_push( $contents, '{b}'.$type.'{/b}: on:'.wppa_local_date( 'd.m.Y H:i:s', time()).': '.wppa_get_user().': '.$msg. "\n" );
 
1605
 
1606
  // Log stacktrace 3 levels
1607
  if ( $trace ) {
1615
  $i++;
1616
  }
1617
  }
1618
+ array_push( $contents, $traceline . "\n" );
 
 
 
 
 
 
 
 
 
1619
  }
1620
+
1621
+ // Trace on or error? log url
1622
  if ( $trace || strtolower( substr( $xtype, 0, 2 ) ) == 'er' ) {
1623
+ array_push( $contents, '{b}url{/b}: '.$_SERVER['REQUEST_URI']."\n" );
1624
  }
1625
 
1626
  // Add uri history
1627
  if ( $listuri ) {
1628
+ array_push( $contents, 'Uri history:'."\n" );
1629
  if ( is_array( $wppa_session ) ) {
1630
  foreach ( $wppa_session['uris'] as $uri ) {
1631
+ array_push( $contents, $uri . "\n" );
1632
  }
1633
+ array_push( $contents, "\n\n" );
1634
  }
1635
  }
1636
 
1637
  // Done
1638
+ wppa_put_contents( $wppa_log_file, implode( '', $contents ), false );
1639
  }
1640
 
1641
  function wppa_is_landscape($img_attr) {
3781
  // Create qr code cache and return its url
3782
  function wppa_create_qrcode_cache( $qrsrc ) {
3783
 
 
3784
  // Make sure the data portion is url encoded
3785
+ $temp = explode( 'data=', $qrsrc );
3786
+ $qrsrc = $temp[0] . 'data=' . urlencode( urldecode( $temp[1] ) );
3787
 
3788
  // Anything to do here?
3789
  if ( ! wppa_switch( 'qr_cache' ) ) {
3810
  // Catch the qr image
3811
  $curl = curl_init();
3812
  curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
3813
+ curl_setopt( $curl, CURLOPT_URL, $qrsrc ); // urlencode here is a security fix, does it still work?, see above /* hbi */
3814
  $contents = curl_exec( $curl );
3815
  curl_close( $curl );
3816
 
3817
  // Save the image
3818
  if ( strlen( $contents ) > 1000 ) {
3819
+
3820
+ wppa_put_contents( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg', $contents );
3821
+
3822
+ /*
3823
+ $file = wppa _fopen( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg', 'w' );
3824
  if ( $file ) {
3825
  fwrite( $file, $contents, strlen( $contents ) );
3826
  fclose( $file );
3827
  }
3828
+ */
3829
  }
3830
 
3831
+ if ( wppa_is_file( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg' ) ) {
3832
  return WPPA_UPLOAD_URL . '/qr/' . $key . '.svg';
3833
  }
3834
  else {
4725
  // Init
4726
  $file = WPPA_PATH . '/wppa-dump.txt';
4727
 
4728
+ if ( $txt ) {
4729
+ wppa_put_contents( $file, $txt );
 
4730
  }
 
 
4731
  else {
4732
+ wppa_unlink( $file );
 
 
 
 
 
 
 
 
 
 
4733
  }
4734
  }
4735
 
wppa-wrappers.php CHANGED
@@ -5,7 +5,7 @@
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
- * Version 7.0.08
9
  *
10
  */
11
 
@@ -257,6 +257,45 @@ global $wp_filesystem;
257
  return $wp_filesystem->is_file( $path );
258
  }
259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  // Utility to check if a given full filepath is safe to manipulate upon
261
  function wppa_is_path_safe( $path, $wp_content = false ) {
262
  global $wppa_lang;
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 7.0.09
9
  *
10
  */
11
 
257
  return $wp_filesystem->is_file( $path );
258
  }
259
 
260
+ // Wrie an entire file
261
+ function wppa_put_contents( $path, $contents, $log = true ) {
262
+ global $wp_filesystem;
263
+
264
+ if ( ! wppa_is_path_safe( $path ) ) {
265
+ if ( $log ) wppa_log( 'War', 'Unsafe path detected in wppa_put_contents(): ' . sanitize_text_field( $path ), true );
266
+ return false;
267
+ }
268
+
269
+ wppa_init_fs();
270
+ return $wp_filesystem->put_contents( $path, $contents, 0644 );
271
+ }
272
+
273
+ // Read an entire file
274
+ function wppa_get_contents( $path ) {
275
+ global $wp_filesystem;
276
+
277
+ if ( ! wppa_is_path_safe( $path ) ) {
278
+ wppa_log( 'War', 'Unsafe path detected in wppa_get_contents(): ' . sanitize_text_field( $path ), true );
279
+ return false;
280
+ }
281
+
282
+ wppa_init_fs();
283
+ return $wp_filesystem->get_contents( $path );
284
+ }
285
+
286
+ // Read entire file into array
287
+ function wppa_get_contents_array( $path, $log = true ) {
288
+ global $wp_filesystem;
289
+
290
+ if ( ! wppa_is_path_safe( $path ) ) {
291
+ if ( $log ) wppa_log( 'War', 'Unsafe path detected in wppa_get_contents_array(): ' . sanitize_text_field( $path ), true );
292
+ return false;
293
+ }
294
+
295
+ wppa_init_fs();
296
+ return $wp_filesystem->get_contents_array( $path );
297
+ }
298
+
299
  // Utility to check if a given full filepath is safe to manipulate upon
300
  function wppa_is_path_safe( $path, $wp_content = false ) {
301
  global $wppa_lang;
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 7.0.09.003
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/
@@ -22,8 +22,8 @@ global $wpdb;
22
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
- global $wppa_revno; $wppa_revno = '7008'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '7.0.09.003'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 7.0.09.004
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/
22
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
+ global $wppa_revno; $wppa_revno = '7009'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '7.0.09.004'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );