WP Photo Album Plus - Version 6.8.07

Version Description

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

Release Info

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

Code changes from version 6.8.06 to 6.8.07

changelog.txt CHANGED
@@ -1,5 +1,20 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 6.8.06 =
4
 
5
  = Bug Fixes =
1
  WP Photo Album Plus Changelog
2
 
3
+ = 6.8.07 =
4
+
5
+ = Bug Fixes =
6
+
7
+ * Fixed an error when timezone was set to an UTC offset rather than a city.
8
+ * Some settings caused js errors and did not work correctily. Fixed.
9
+
10
+ = New Features =
11
+
12
+ * New widget: Statistics.
13
+
14
+ = Other Changes =
15
+
16
+ * All widgets have a checkbox to restrict the display to logged-in visitors only.
17
+
18
  = 6.8.06 =
19
 
20
  = Bug Fixes =
js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 6.8.01
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -167,11 +167,11 @@ function wppaInitSettings() {
167
  wppaCheckAutoPage();
168
  wppaCheckGps();
169
  wppaCheckFontPreview();
170
- wppaCheckCheck( 'enable_video', 'wppa-video' );
171
- wppaCheckCheck( 'custom_fields', 'custfields' );
172
- wppaCheckCheck( 'album_custom_fields', 'albumcustfields' );
173
- wppaCheckCheck( 'new_mod_label_is_text', 'nmtxt' );
174
- wppaCheckCheck( 'coverphoto_responsive', 'cvpr' );
175
  wppaCheckSmWidgetLink();
176
 
177
  var tab = new Array('O','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII');
@@ -316,9 +316,10 @@ function wppaFollow( id, clas ) {
316
  }
317
  }
318
 
319
- function wppaCheckCheck( slug, clas ) {
320
  //wppaConsoleLog( 'CheckCheck slug = '+slug, 'force' );
321
 
 
322
  var on = document.getElementById( slug ).checked;
323
  if ( on ) {
324
  jQuery( '.'+clas ).css( 'display', '' );
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 6.8.07
5
  /* Various js routines used in admin pages
6
  */
7
 
167
  wppaCheckAutoPage();
168
  wppaCheckGps();
169
  wppaCheckFontPreview();
170
+ wppaCheckCheck( 'wppa_enable_video', 'wppa-video' );
171
+ wppaCheckCheck( 'wppa_custom_fields', 'custfields' );
172
+ wppaCheckCheck( 'wppa_album_custom_fields', 'albumcustfields' );
173
+ wppaCheckCheck( 'wppa_new_mod_label_is_text', 'nmtxt' );
174
+ wppaCheckCheck( 'wppa_coverphoto_responsive', 'cvpr' );
175
  wppaCheckSmWidgetLink();
176
 
177
  var tab = new Array('O','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII');
316
  }
317
  }
318
 
319
+ function wppaCheckCheck( xslug, clas ) {
320
  //wppaConsoleLog( 'CheckCheck slug = '+slug, 'force' );
321
 
322
+ var slug = xslug.substring(5);
323
  var on = document.getElementById( slug ).checked;
324
  if ( on ) {
325
  jQuery( '.'+clas ).css( 'display', '' );
js/wppa-admin-scripts.min.js CHANGED
@@ -1 +1 @@
1
- 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("enable_video","wppa-video"),wppaCheckCheck("custom_fields","custfields"),wppaCheckCheck("album_custom_fields","albumcustfields"),wppaCheckCheck("new_mod_label_is_text","nmtxt"),wppaCheckCheck("coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for("on"==p?wppaShowTable(table):wppaHideTable(table),subtab=0;subtab<12;subtab++)"on"==(p=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]))&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","Z");for(table=1;table<13;table++)for(table<13?wppaShowTable(table):wppaHideTable(table),wppa_tablecookieoff(table),subtab=0;subtab<12;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);p.length>0&&(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))}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)}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){document.getElementById(e).checked?(jQuery("."+t).css("display",""),jQuery(".-"+t).css("display","none")):(jQuery("."+t).css("display","none"),jQuery(".-"+t).css("display",""))}function wppaCheckSlideVideoControls(){"none"!=document.getElementById("slideshow_linktype").value&&alert("Warning! \nYou can not have video controls on a videoslide when there is a link on the slide.\nThe videoslide will not show controls and will also not autoplay")}function wppaCheckFotomoto(){document.getElementById("fotomoto_on").checked?jQuery(".wppa_fotomoto").css("display",""):jQuery(".wppa_fotomoto").css("display","none")}function wppaCheckFontPreview(){var e=document.getElementById("textual_watermark_font").value,t=document.getElementById("textual_watermark_type").value,p=wppaFontDirectory+"wmf"+e+"-"+t+".png",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(e,t,p){var a="",o="";a=t||'<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="+e;i+="&wppa-nonce="+document.getElementById("photo-nonce-"+e).value,n.open("GET",i,!0),n.send(),n.onreadystatechange=function(){switch(n.readyState){case 1:document.getElementById("photostatus-"+e).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+e).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+e).innerHTML="processing request";break;case 4:if(200==n.status){var t=wppaTrim(n.responseText).split("||");"ER"==t[0]?(t[3]&&alert(t[3]),jQuery("#wppa-delete-"+e).css("text-decoration","line-through")):""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),0==t[1]?document.getElementById("photostatus-"+e).innerHTML=t[2]:(document.getElementById("photoitem-"+e).innerHTML=a+t[2]+o,wppaProcessFull(t[3],t[4])),wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+e).innerHTML=a+'<span style="color:red;" >Comm error '+n.status+": "+n.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(e){wppaFeAjaxLog("in");var t=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+e;p+="&wppa-nonce="+document.getElementById("photo-nonce-"+e).value,t.open("GET",p,!0),t.send(),t.onreadystatechange=function(){switch(t.readyState){case 1:document.getElementById("photostatus-"+e).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+e).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+e).innerHTML="processing request";break;case 4:if(200==t.status){var p=wppaTrim(t.responseText).split("||");"ER"==p[0]?(p[3]&&alert(p[3]),jQuery("#wppa-delete-"+e).css("text-decoration","line-through")):""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),0==p[1]?document.getElementById("photostatus-"+e).innerHTML=p[2]:document.getElementById("photoitem-"+e).innerHTML='<div style="padding-left:5px;" >'+p[2]+"</div>",wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+e).innerHTML=before+'<span style="color:red;" >Comm error '+t.status+": "+t.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(e,t,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+e).css({visibility:"visible"});var o="action=wppa&wppa-action=watermark-photo&photo-id="+e;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+e).value,t&&(o+="&wppa-watermark-file="+t),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 t=wppaTrim(a.responseText).split("||");switch(""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),t[1]){case"0":document.getElementById("photostatus-"+e).innerHTML=t[2];break;default:document.getElementById("photostatus-"+e).innerHTML='<span style="color:red">'+t[2]+"</span>"}jQuery("#wppa-water-spin-"+e).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("photostatus-"+e).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"}}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(e,t,p,a,o,n){o||(o=""),n||(n="");wppaFeAjaxLog("in"),wppaAjaxPhotoCount[e]||(wppaAjaxPhotoCount[e]=0),wppaAjaxPhotoCount[e]++,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+e+"&item="+t+"&wppa-nonce="+document.getElementById("photo-nonce-"+e).value+"&value="+wppaEncode(p),async:!0,type:"POST",timeout:6e4,beforeSend:function(p){"description"==t&&jQuery("#wppa-photo-spin-"+e).css({visibility:"visible"}),jQuery("#photostatus-"+e).html("Working, please wait... ("+wppaAjaxPhotoCount[e]+")")},success:function(i,s,l){var r=wppaTrim(i).split("||");switch(wppaAjaxPhotoCount[e]--,""!=r[0]&&alert("The server returned unexpected output:\n"+r[0]),r[1]){case"0":if(0==wppaAjaxPhotoCount[e]?jQuery("#photostatus-"+e).html(r[2]):jQuery("#photostatus-"+e).html("Working, please wait... ("+wppaAjaxPhotoCount[e]+")"),r[3]&&((u=jQuery("#fs-a-"+e).attr("href").split("="))[1]=parseInt(u[1])+1,jQuery("#fs-a-"+e).attr("href",u[0]+"="+u[1]),jQuery("#fs-img-"+e).attr("src",u[0]+"="+u[1])),r[4]){var u=jQuery("#tnp-"+e).attr("src").split("=");u[1]=parseInt(u[1])+1,jQuery("#tnp-"+e).attr("src",u[0]+"="+u[1])}void 0!==r[5]&&(jQuery("#imstack-"+e).html(r[5]),r[5].length>0?jQuery("#imstackbutton-"+e).css("display",""):jQuery("#imstackbutton-"+e).css("display","none")),void 0!==r[6]&&jQuery("#dispfileinfo-"+e).html(r[6]);break;case"99":jQuery("#photoitem-"+e).html(o+'<span style="color:red">'+r[2]+"</span>"+n);break;default:jQuery("#photostatus-"+e).html('<span style="color:red">'+r[2]+" ("+r[1]+")</span>")}"description"==t&&jQuery("#wppa-photo-spin-"+e).css({visibility:"hidden"});var c=0,d=-1;for(count=wppaPhotoUpdateMatrix.length;c<count;)wppaPhotoUpdateMatrix[c][0]==e&&wppaPhotoUpdateMatrix[c][1]==t&&(d=c),c++;if(wppaPhotoUpdateMatrix[d]&&(wppaPhotoUpdateMatrix[d][2]=p||0,wppaPhotoUpdateMatrix[d][4]=!1,wppaPhotoUpdateMatrix[d][5]=!1),wppaFeAjaxLog("out"),wppaAjaxUpdatePhotoMonitor(),a&&"0"==r[1])return jQuery("#photostatus-"+e).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-photo-spin-"+e).css({visibility:"visible"}),void setTimeout(function(){wppaReload("#photo_"+e)},1e3)},error:function(t,p,a){wppaAjaxPhotoCount[e]--,jQuery("#photostatus-"+e).html('<span style="color:red;" >Comm error '+p+"</span>"),wppaConsoleLog("_wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+p,"force")},complete:function(e,t,p){jQuery("#wppa-admin-spinner").css("display","none")}})}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")))}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(e,t,p,a,o){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+e+"&item="+t+"&wppa-nonce="+document.getElementById("album-nonce-"+e).value+"&value="+wppaEncode(p),async:!0,type:"POST",timeout:6e4,beforeSend:function(p){"description"==t&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+e).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(n,i,s){var l=wppaTrim(n).split("||");switch(wppaAjaxAlbumCount--,""!=l[0]&&alert("The server returned unexpected output:\n"+l[0]),l[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+e).html(l[2]):jQuery("#albumstatus-"+e).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+e).html='<span style="color:red">'+l[2]+" ("+l[1]+")</span>"}if(void 0!==l[3]&&wppaProcessFull(l[3],l[4]),o&&"0"==l[1])return jQuery("#albumstatus-"+e).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==t&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var r=0,u=-1,c=wppaAlbumUpdateMatrix.length;r<c;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=r),r++;wppaAlbumUpdateMatrix[u][2]=p||0,wppaAlbumUpdateMatrix[u][4]=!1,wppaAlbumUpdateMatrix[u][5]=!1,wppaAjaxUpdateAlbumMonitor(a)},error:function(t,p,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+e).html('<span style="color:red;" >Comm error '+p+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+p,"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"),t>0?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(e,t,p){var a=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+e+"&wppa-comment-id="+t+"&wppa-comment-status="+p+"&wppa-nonce="+document.getElementById("photo-nonce-"+e).value;a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var p=wppaTrim(a.responseText).split("||");switch(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),p[1]){case"0":jQuery("#photostatus-"+e).html(p[2]);break;default:jQuery("#photostatus-"+e).html('<span style="color:red">'+p[2]+"</span>")}jQuery("#wppa-comment-spin-"+t).css("visibility","hidden")}else jQuery("#photostatus-"+e).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")},a.open("GET",o,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(e,t){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+e;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,t.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+e).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var t=wppaTrim(p.responseText).split("||");if(""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),404!=p.status)switch(t[1]){case"0":jQuery("#img_"+e).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+e).attr("title",t[2]),t[3]&&alert(t[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+e).attr("title","Error #"+t[1]+", message: "+t[2]+", status: "+p.status),t[3]&&alert(t[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))}else jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+e).attr("title","Communication error, status = "+p.status);wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}function wppaMaintenanceProc(e,t,p){if(p);else if(!t&&"yes"==document.getElementById(e+"_continue").value)return document.getElementById(e+"_continue").value="no",document.getElementById(e+"_button").value="Start!",void(jQuery("#"+e+"_togo").html()>0&&(jQuery("#"+e+"_status").html("Pausing..."),jQuery("#"+e+"_button").css("display","none")));p||(document.getElementById(e+"_continue").value="yes",document.getElementById(e+"_button").value="Stop!",""==jQuery("#"+e+"_status").html()&&jQuery("#"+e+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+e+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(p?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var o=e.split("||"),n=o[1],i=!1;return n?(o[0].length>10&&(alert("An error occurred:\n"+o[0]),i=!0),jQuery("#"+n+"_status").html(o[2]),jQuery("#"+n+"_togo").html(o[3]),jQuery("#"+n+"_button").css("display",""),i||"0"==o[3]?"reload"==o[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?p||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(t,p,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+$slug+", Error = "+a+", status = "+p,"force"),jQuery("#"+e+"_status").html("Server error #"+(11-wppaAlwaysContinue));var o=!1;--wppaAlwaysContinue<1&&(o=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=10),(o||wppaAlwaysContinue>0)&&("wppa_remake"==e&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==e&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==e&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+e+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":"Search index table";break;case"wppa_list_errorlog":"WPPA+ Error log";break;case"wppa_list_rating":"Recent ratings";break;case"wppa_list_session":"Active sessions";break;case"wppa_list_comments":"Recent comments"}var t=.9*jQuery(window).width(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,o="action=wppa&wppa-action=maintenancepopup&slug="+e;if(o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(o),4==p.readyState&&200==p.status){var n=p.responseText,i={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(n).dialog(i).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right"}),jQuery(".ui-button").attr("title",wppaCloseText)}}function wppaAjaxUpdateOptionValue(e,t,p){var a=wppaGetXmlHttp();a.onreadystatechange=function(){if(4!=a.readyState)jQuery("#img_"+e).attr("src",wppaImageDirectory+"spinner.gif");else{var t=wppaTrim(a.responseText).split("||");if(""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),404!=a.status){switch(t[1]){case"0":jQuery("#img_"+e).attr("src",wppaImageDirectory+"tick.png"),t[3]&&alert(t[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),t[3]&&alert(t[3])}if(jQuery("#img_"+e).attr("title",t[2]),t[4])for(var p,o,n,i=t[4].split(";"),s=0;s<i.length;)p=i[s].split(":"),o=jQuery("#"+p[0]).html(),n=p[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("#"+p[0]).html(n),s++}else jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+e).title="Communication error";wppaCheckInconsistencies()}},eslug=wppaEncode(e);var o="action=wppa&wppa-action=update-option&wppa-option="+eslug;o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,0!=t&&(o+="number"==typeof t?"&value="+t:p?"&value="+wppaGetSelectionEnumByClass("."+e,","):"&value="+wppaEncode(t.value)),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o)}function wppaEncode(e){var t,p;if(void 0!==e){if("number"==typeof e)return e;var a=(t=p=(t=p=(t=e).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),o=0;for(p="";o<a.length;)p+=a[o],++o<a.length&&(p+="||PLUS||");return p}}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(t.length>1)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)}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--),wppaFeCount>1&&(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),o=0,n=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(e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+e,async:!0,type:"GET",timeout:1e5,beforeSend:function(t){jQuery("#"+e+"-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(t,p,a){alert("Export Db Table "+e+" failed. Error = "+a+", status = "+p)},complete:function(t,p,a){jQuery("#"+e+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+e,async:!0,type:"GET",timeout:1e5,beforesend:function(e){},success:function(t,p,a){var o=t.split("|");jQuery("#"+e+"_togo").html(o[0]);var n=jQuery("#"+e+"_status").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("#"+e+"_status").html(i),setTimeout(function(){wppaAjaxUpdateTogo(e)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||0==e)))}var wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaImageDirectory,wppaAjaxUrl,wppaUploadToThisAlbum="Upload to this album",wppaSubTabOn=new Array,_wppaRefreshAfter=!1,wppaAjaxPhotoCount=new Array,wppaPhotoUpdateMatrix=new Array,_wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array,wppaAlwaysContinue=10,wppaFeCount=0;
1
+ var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album";function checkjQueryRev(e,t,p){var a=parseFloat(jQuery.fn.jquery);t.checked&&a<p&&(alert(e+"\nThe version of your jQuery library: "+a+" is too low for this feature. It requires version "+p),t.checked="")}function wppaReUpload(e,t,p){document.getElementById("wppa-re-up-form-"+t);var a=document.getElementById("wppa-re-up-file-"+t),o=document.getElementById("wppa-re-up-butn-"+t);e.preventDefault();var n=a.files[0];if(n.type.match("image.*")){if(0==p.length)alert("Filename will be set to "+n.name);else if(n.name!=p&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+t).css("display","none");o.value="Uploading...",o.style.color="black";var i=new FormData;i.append("photo",n,n.name);var s=new XMLHttpRequest,l="?action=wppa&wppa-action=update-photo&photo-id="+t+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;s.open("POST",wppaAjaxUrl+l,!0),s.onload=function(){if(200===s.status){var e=wppaTrim(s.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]),o.value="Upload",jQuery("#re-up-"+t).css("display","none");break;case"99":document.getElementById("photoitem-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",o.value="Error occured",o.style.color="red"}}else alert("An error occurred!")},s.send(i)}else alert("File is not an image file!")}function wppaInitSettings(){wppaCheckBreadcrumb(),wppaCheckFullHalign(),wppaCheckUseThumbOpacity(),wppaCheckUseCoverOpacity(),wppaCheckThumbType(),wppaCheckThumbLink(),wppaCheckTopTenLink(),wppaCheckFeaTenLink(),wppaCheckLasTenLink(),wppaCheckThumbnailWLink(),wppaCheckCommentLink(),wppaCheckXphotoLink(),wppaCheckMphotoLink(),wppaCheckSphotoLink(),wppaCheckSlidePhotoLink(),wppaCheckSlideOnlyLink(),wppaCheckAlbumWidgetLink(),wppaCheckSlideLink(),wppaCheckCoverImg(),wppaCheckPotdLink(),wppaCheckTagLink(),wppaCheckRating(),wppaCheckComments(),wppaCheckCustom(),wppaCheckResize(),wppaCheckNumbar(),wppaCheckWatermark(),wppaCheckPopup(),wppaCheckGravatar(),wppaCheckUserUpload(),wppaCheckAjax(),wppaCheckFotomoto(),wppaCheckLinkPageErr("sphoto"),wppaCheckLinkPageErr("mphoto"),wppaCheckLinkPageErr("xphoto"),wppaCheckLinkPageErr("topten_widget"),wppaCheckLinkPageErr("slideonly_widget"),wppaCheckLinkPageErr("potd"),wppaCheckLinkPageErr("comment_widget"),wppaCheckLinkPageErr("thumbnail_widget"),wppaCheckLinkPageErr("lasten_widget"),wppaCheckLinkPageErr("album_widget"),wppaCheckLinkPageErr("tagcloud"),wppaCheckLinkPageErr("multitag"),wppaCheckLinkPageErr("super_view"),wppaCheckSplitNamedesc(),wppaCheckShares(),wppaCheckCoverType(),wppaCheckNewpag(),wppaCheckCDN(),wppaCheckAutoPage(),wppaCheckGps(),wppaCheckFontPreview(),wppaCheckCheck("wppa_enable_video","wppa-video"),wppaCheckCheck("wppa_custom_fields","custfields"),wppaCheckCheck("wppa_album_custom_fields","albumcustfields"),wppaCheckCheck("wppa_new_mod_label_is_text","nmtxt"),wppaCheckCheck("wppa_coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for("on"==p?wppaShowTable(table):wppaHideTable(table),subtab=0;subtab<12;subtab++)"on"==(p=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]))&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","Z");for(table=1;table<13;table++)for(table<13?wppaShowTable(table):wppaHideTable(table),wppa_tablecookieoff(table),subtab=0;subtab<12;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);p.length>0&&(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))}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(e,t,p){var a="",o="";a=t||'<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="+e;i+="&wppa-nonce="+document.getElementById("photo-nonce-"+e).value,n.open("GET",i,!0),n.send(),n.onreadystatechange=function(){switch(n.readyState){case 1:document.getElementById("photostatus-"+e).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+e).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+e).innerHTML="processing request";break;case 4:if(200==n.status){var t=wppaTrim(n.responseText).split("||");"ER"==t[0]?(t[3]&&alert(t[3]),jQuery("#wppa-delete-"+e).css("text-decoration","line-through")):""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),0==t[1]?document.getElementById("photostatus-"+e).innerHTML=t[2]:(document.getElementById("photoitem-"+e).innerHTML=a+t[2]+o,wppaProcessFull(t[3],t[4])),wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+e).innerHTML=a+'<span style="color:red;" >Comm error '+n.status+": "+n.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(e){wppaFeAjaxLog("in");var t=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+e;p+="&wppa-nonce="+document.getElementById("photo-nonce-"+e).value,t.open("GET",p,!0),t.send(),t.onreadystatechange=function(){switch(t.readyState){case 1:document.getElementById("photostatus-"+e).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+e).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+e).innerHTML="processing request";break;case 4:if(200==t.status){var p=wppaTrim(t.responseText).split("||");"ER"==p[0]?(p[3]&&alert(p[3]),jQuery("#wppa-delete-"+e).css("text-decoration","line-through")):""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),0==p[1]?document.getElementById("photostatus-"+e).innerHTML=p[2]:document.getElementById("photoitem-"+e).innerHTML='<div style="padding-left:5px;" >'+p[2]+"</div>",wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+e).innerHTML=before+'<span style="color:red;" >Comm error '+t.status+": "+t.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(e,t,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+e).css({visibility:"visible"});var o="action=wppa&wppa-action=watermark-photo&photo-id="+e;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+e).value,t&&(o+="&wppa-watermark-file="+t),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 t=wppaTrim(a.responseText).split("||");switch(""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),t[1]){case"0":document.getElementById("photostatus-"+e).innerHTML=t[2];break;default:document.getElementById("photostatus-"+e).innerHTML='<span style="color:red">'+t[2]+"</span>"}jQuery("#wppa-water-spin-"+e).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("photostatus-"+e).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(e,t,p,a,o,n){o||(o=""),n||(n="");wppaFeAjaxLog("in"),wppaAjaxPhotoCount[e]||(wppaAjaxPhotoCount[e]=0),wppaAjaxPhotoCount[e]++,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+e+"&item="+t+"&wppa-nonce="+document.getElementById("photo-nonce-"+e).value+"&value="+wppaEncode(p),async:!0,type:"POST",timeout:6e4,beforeSend:function(p){"description"==t&&jQuery("#wppa-photo-spin-"+e).css({visibility:"visible"}),jQuery("#photostatus-"+e).html("Working, please wait... ("+wppaAjaxPhotoCount[e]+")")},success:function(i,s,l){var r=wppaTrim(i).split("||");switch(wppaAjaxPhotoCount[e]--,""!=r[0]&&alert("The server returned unexpected output:\n"+r[0]),r[1]){case"0":var u;if(0==wppaAjaxPhotoCount[e]?jQuery("#photostatus-"+e).html(r[2]):jQuery("#photostatus-"+e).html("Working, please wait... ("+wppaAjaxPhotoCount[e]+")"),r[3])(u=jQuery("#fs-a-"+e).attr("href").split("="))[1]=parseInt(u[1])+1,jQuery("#fs-a-"+e).attr("href",u[0]+"="+u[1]),jQuery("#fs-img-"+e).attr("src",u[0]+"="+u[1]);if(r[4])(u=jQuery("#tnp-"+e).attr("src").split("="))[1]=parseInt(u[1])+1,jQuery("#tnp-"+e).attr("src",u[0]+"="+u[1]);void 0!==r[5]&&(jQuery("#imstack-"+e).html(r[5]),r[5].length>0?jQuery("#imstackbutton-"+e).css("display",""):jQuery("#imstackbutton-"+e).css("display","none")),void 0!==r[6]&&jQuery("#dispfileinfo-"+e).html(r[6]);break;case"99":jQuery("#photoitem-"+e).html(o+'<span style="color:red">'+r[2]+"</span>"+n);break;default:jQuery("#photostatus-"+e).html('<span style="color:red">'+r[2]+" ("+r[1]+")</span>")}"description"==t&&jQuery("#wppa-photo-spin-"+e).css({visibility:"hidden"});var c=0,d=-1;for(count=wppaPhotoUpdateMatrix.length;c<count;)wppaPhotoUpdateMatrix[c][0]==e&&wppaPhotoUpdateMatrix[c][1]==t&&(d=c),c++;if(wppaPhotoUpdateMatrix[d]&&(wppaPhotoUpdateMatrix[d][2]=p||0,wppaPhotoUpdateMatrix[d][4]=!1,wppaPhotoUpdateMatrix[d][5]=!1),wppaFeAjaxLog("out"),wppaAjaxUpdatePhotoMonitor(),a&&"0"==r[1])return jQuery("#photostatus-"+e).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-photo-spin-"+e).css({visibility:"visible"}),void setTimeout(function(){wppaReload("#photo_"+e)},1e3)},error:function(t,p,a){wppaAjaxPhotoCount[e]--,jQuery("#photostatus-"+e).html('<span style="color:red;" >Comm error '+p+"</span>"),wppaConsoleLog("_wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+p,"force")},complete:function(e,t,p){jQuery("#wppa-admin-spinner").css("display","none")}})}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(e,t,p,a,o){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+e+"&item="+t+"&wppa-nonce="+document.getElementById("album-nonce-"+e).value+"&value="+wppaEncode(p),async:!0,type:"POST",timeout:6e4,beforeSend:function(p){"description"==t&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+e).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(n,i,s){var l=wppaTrim(n).split("||");switch(wppaAjaxAlbumCount--,""!=l[0]&&alert("The server returned unexpected output:\n"+l[0]),l[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+e).html(l[2]):jQuery("#albumstatus-"+e).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+e).html='<span style="color:red">'+l[2]+" ("+l[1]+")</span>"}if(void 0!==l[3]&&wppaProcessFull(l[3],l[4]),o&&"0"==l[1])return jQuery("#albumstatus-"+e).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==t&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var r=0,u=-1,c=wppaAlbumUpdateMatrix.length;r<c;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=r),r++;wppaAlbumUpdateMatrix[u][2]=p||0,wppaAlbumUpdateMatrix[u][4]=!1,wppaAlbumUpdateMatrix[u][5]=!1,wppaAjaxUpdateAlbumMonitor(a)},error:function(t,p,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+e).html('<span style="color:red;" >Comm error '+p+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+p,"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"),t>0?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(e,t,p){var a=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+e+"&wppa-comment-id="+t+"&wppa-comment-status="+p+"&wppa-nonce="+document.getElementById("photo-nonce-"+e).value;a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var p=wppaTrim(a.responseText).split("||");switch(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),p[1]){case"0":jQuery("#photostatus-"+e).html(p[2]);break;default:jQuery("#photostatus-"+e).html('<span style="color:red">'+p[2]+"</span>")}jQuery("#wppa-comment-spin-"+t).css("visibility","hidden")}else jQuery("#photostatus-"+e).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")},a.open("GET",o,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(e,t){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+e;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,t.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+e).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var t=wppaTrim(p.responseText).split("||");if(""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),404!=p.status)switch(t[1]){case"0":jQuery("#img_"+e).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+e).attr("title",t[2]),t[3]&&alert(t[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+e).attr("title","Error #"+t[1]+", message: "+t[2]+", status: "+p.status),t[3]&&alert(t[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))}else jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+e).attr("title","Communication error, status = "+p.status);wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=10;function wppaMaintenanceProc(e,t,p){if(p);else if(!t&&"yes"==document.getElementById(e+"_continue").value)return document.getElementById(e+"_continue").value="no",document.getElementById(e+"_button").value="Start!",void(jQuery("#"+e+"_togo").html()>0&&(jQuery("#"+e+"_status").html("Pausing..."),jQuery("#"+e+"_button").css("display","none")));p||(document.getElementById(e+"_continue").value="yes",document.getElementById(e+"_button").value="Stop!",""==jQuery("#"+e+"_status").html()&&jQuery("#"+e+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+e+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(p?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var o=e.split("||"),n=o[1],i=!1;return n?(o[0].length>10&&(alert("An error occurred:\n"+o[0]),i=!0),jQuery("#"+n+"_status").html(o[2]),jQuery("#"+n+"_togo").html(o[3]),jQuery("#"+n+"_button").css("display",""),i||"0"==o[3]?"reload"==o[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?p||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(t,p,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+$slug+", Error = "+a+", status = "+p,"force"),jQuery("#"+e+"_status").html("Server error #"+(11-wppaAlwaysContinue));var o=!1;--wppaAlwaysContinue<1&&(o=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=10),(o||wppaAlwaysContinue>0)&&("wppa_remake"==e&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==e&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==e&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+e+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":"Search index table";break;case"wppa_list_errorlog":"WPPA+ Error log";break;case"wppa_list_rating":"Recent ratings";break;case"wppa_list_session":"Active sessions";break;case"wppa_list_comments":"Recent comments"}var t=.9*jQuery(window).width(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,o="action=wppa&wppa-action=maintenancepopup&slug="+e;if(o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(o),4==p.readyState&&200==p.status){var n=p.responseText,i={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(n).dialog(i).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right"}),jQuery(".ui-button").attr("title",wppaCloseText)}}function wppaAjaxUpdateOptionValue(e,t,p){var a=wppaGetXmlHttp();a.onreadystatechange=function(){if(4!=a.readyState)jQuery("#img_"+e).attr("src",wppaImageDirectory+"spinner.gif");else{var t=wppaTrim(a.responseText).split("||");if(""!=t[0]&&alert("The server returned unexpected output:\n"+t[0]),404!=a.status){switch(t[1]){case"0":jQuery("#img_"+e).attr("src",wppaImageDirectory+"tick.png"),t[3]&&alert(t[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),t[3]&&alert(t[3])}if(jQuery("#img_"+e).attr("title",t[2]),t[4])for(var p,o,n,i=t[4].split(";"),s=0;s<i.length;)p=i[s].split(":"),o=jQuery("#"+p[0]).html(),n=p[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("#"+p[0]).html(n),s++}else jQuery("#img_"+e).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+e).title="Communication error";wppaCheckInconsistencies()}},eslug=wppaEncode(e);var o="action=wppa&wppa-action=update-option&wppa-option="+eslug;o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,0!=t&&(o+="number"==typeof t?"&value="+t:p?"&value="+wppaGetSelectionEnumByClass("."+e,","):"&value="+wppaEncode(t.value)),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o)}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(t.length>1)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--),wppaFeCount>1&&(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),o=0,n=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(e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+e,async:!0,type:"GET",timeout:1e5,beforeSend:function(t){jQuery("#"+e+"-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(t,p,a){alert("Export Db Table "+e+" failed. Error = "+a+", status = "+p)},complete:function(t,p,a){jQuery("#"+e+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+e,async:!0,type:"GET",timeout:1e5,beforesend:function(e){},success:function(t,p,a){var o=t.split("|");jQuery("#"+e+"_togo").html(o[0]);var n=jQuery("#"+e+"_status").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("#"+e+"_status").html(i),setTimeout(function(){wppaAjaxUpdateTogo(e)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||0==e)))}
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
- Version: 6.8.06
6
- Stable tag: 6.8.05
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -128,6 +128,10 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
128
 
129
  == Upgrade Notice ==
130
 
 
 
 
 
131
  = 6.8.06 =
132
 
133
  * This version addresses various minor bug fixes and improved cache handling.
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
+ Version: 6.8.07
6
+ Stable tag: 6.8.06
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
128
 
129
  == Upgrade Notice ==
130
 
131
+ = 6.8.07 =
132
+
133
+ * This version addresses various minor bug fixes and enhancements, and a new widget: Statistics.
134
+
135
  = 6.8.06 =
136
 
137
  * This version addresses various minor bug fixes and improved cache handling.
wppa-admins-choice-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the admins-choice widget
6
- * Version 6.8.06
7
  *
8
  */
9
 
@@ -32,7 +32,12 @@ class AdminsChoice extends WP_Widget {
32
 
33
  extract( $args );
34
 
35
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Admins Choice', 'wp-photo-album-plus' ) ) );
 
 
 
 
 
36
 
37
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
38
 
@@ -65,6 +70,7 @@ class AdminsChoice extends WP_Widget {
65
 
66
  $instance = $old_instance;
67
  $instance['title'] = strip_tags( $new_instance['title'] );
 
68
  return $instance;
69
  }
70
 
@@ -80,11 +86,16 @@ class AdminsChoice extends WP_Widget {
80
  }
81
 
82
  // Defaults
83
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Admins Choice', 'wp-photo-album-plus' ) ) );
84
 
85
  // Title
86
  echo
87
  wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
 
 
 
 
 
88
  }
89
 
90
  } // class AdminsChoice
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the admins-choice widget
6
+ * Version 6.8.07
7
  *
8
  */
9
 
32
 
33
  extract( $args );
34
 
35
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Admins Choice', 'wp-photo-album-plus' ), 'logonly' => 'no' ) );
36
+
37
+ // Logged in only and logged out?
38
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
39
+ return;
40
+ }
41
 
42
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
43
 
70
 
71
  $instance = $old_instance;
72
  $instance['title'] = strip_tags( $new_instance['title'] );
73
+ $instance['logonly'] = $new_instance['logonly'];
74
  return $instance;
75
  }
76
 
86
  }
87
 
88
  // Defaults
89
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Admins Choice', 'wp-photo-album-plus' ), 'logonly' => 'no' ) );
90
 
91
  // Title
92
  echo
93
  wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
94
+
95
+ // Loggedin only
96
+ echo
97
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
98
+
99
  }
100
 
101
  } // class AdminsChoice
wppa-album-navigator-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display album names linking to content
6
- * Version 6.8.06
7
  */
8
 
9
  class AlbumNavigatorWidget extends WP_Widget {
@@ -37,9 +37,15 @@ class AlbumNavigatorWidget extends WP_Widget {
37
  $instance = wp_parse_args( (array) $instance, array(
38
  'title' => __( 'Album Navigator', 'wp-photo-album-plus' ), // Widget title
39
  'parent' => '0', // Parent album
40
- 'skip' => 'yes' // Skip empty albums
 
41
  ) );
42
 
 
 
 
 
 
43
  $widget_title = apply_filters('widget_title', $instance['title']);
44
 
45
  $page = wppa_get_the_landing_page('album_navigator_widget_linkpage', __('Photo Albums', 'wp-photo-album-plus'));
@@ -83,10 +89,10 @@ class AlbumNavigatorWidget extends WP_Widget {
83
  /** @see WP_Widget::update */
84
  function update( $new_instance, $old_instance ) {
85
  $instance = $old_instance;
86
- $instance['title'] = strip_tags( $new_instance['title'] );
87
- $instance['parent'] = $new_instance['parent'];
88
- $instance['skip'] = $new_instance['skip'];
89
-
90
  return $instance;
91
  }
92
 
@@ -99,7 +105,9 @@ class AlbumNavigatorWidget extends WP_Widget {
99
  $instance = wp_parse_args( (array) $instance, array(
100
  'title' => __( 'Album Navigator', 'wp-photo-album-plus' ),
101
  'parent' => '0',
102
- 'skip' => 'yes' ) );
 
 
103
  $parent = $instance['parent'];
104
  $skip = $instance['skip'];
105
  $widget_title = $instance['title'];
@@ -146,6 +154,10 @@ class AlbumNavigatorWidget extends WP_Widget {
146
  wppa_widget_checkbox( $this, 'skip', $instance['skip'], __( 'Skip "empty" albums', 'wp-photo-album-plus' ) );
147
  }
148
 
 
 
 
 
149
  }
150
 
151
  function get_widget_id() {
3
  * Package: wp-photo-album-plus
4
  *
5
  * display album names linking to content
6
+ * Version 6.8.07
7
  */
8
 
9
  class AlbumNavigatorWidget extends WP_Widget {
37
  $instance = wp_parse_args( (array) $instance, array(
38
  'title' => __( 'Album Navigator', 'wp-photo-album-plus' ), // Widget title
39
  'parent' => '0', // Parent album
40
+ 'skip' => 'yes', // Skip empty albums
41
+ 'logonly' => 'no', // Logged in only?
42
  ) );
43
 
44
+ // Logged in only and logged out?
45
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
46
+ return;
47
+ }
48
+
49
  $widget_title = apply_filters('widget_title', $instance['title']);
50
 
51
  $page = wppa_get_the_landing_page('album_navigator_widget_linkpage', __('Photo Albums', 'wp-photo-album-plus'));
89
  /** @see WP_Widget::update */
90
  function update( $new_instance, $old_instance ) {
91
  $instance = $old_instance;
92
+ $instance['title'] = strip_tags( $new_instance['title'] );
93
+ $instance['parent'] = $new_instance['parent'];
94
+ $instance['skip'] = $new_instance['skip'];
95
+ $instance['logonly'] = $new_instance['logonly'];
96
  return $instance;
97
  }
98
 
105
  $instance = wp_parse_args( (array) $instance, array(
106
  'title' => __( 'Album Navigator', 'wp-photo-album-plus' ),
107
  'parent' => '0',
108
+ 'skip' => 'yes',
109
+ 'logonly' => 'no',
110
+ ) );
111
  $parent = $instance['parent'];
112
  $skip = $instance['skip'];
113
  $widget_title = $instance['title'];
154
  wppa_widget_checkbox( $this, 'skip', $instance['skip'], __( 'Skip "empty" albums', 'wp-photo-album-plus' ) );
155
  }
156
 
157
+ // Loggedin only
158
+ echo
159
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
160
+
161
  }
162
 
163
  function get_widget_id() {
wppa-album-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
- * Version 6.8.06
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -34,11 +34,17 @@ class AlbumWidget extends WP_Widget {
34
  'title' => __( 'Photo Albums' , 'wp-photo-album-plus'), // Widget title
35
  'parent' => 'none', // Parent album
36
  'name' => 'no', // Display album name?
37
- 'skip' => 'yes' // Skip empty albums
 
38
  // 'count' => wppa_opt( 'album_widget_count' ), // to be added
39
  // 'size' => wppa_opt( 'album_widget_size' )
40
  ) );
41
 
 
 
 
 
 
42
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
43
 
44
  $page = in_array( wppa_opt( 'album_widget_linktype' ), wppa( 'links_no_page' ) ) ? '' : wppa_get_the_landing_page( 'album_widget_linkpage', __( 'Photo Albums', 'wp-photo-album-plus' ) );
@@ -312,10 +318,11 @@ class AlbumWidget extends WP_Widget {
312
  /** @see WP_Widget::update */
313
  function update( $new_instance, $old_instance ) {
314
  $instance = $old_instance;
315
- $instance['title'] = strip_tags( $new_instance['title'] );
316
- $instance['parent'] = $new_instance['parent'];
317
- $instance['name'] = $new_instance['name'];
318
- $instance['skip'] = $new_instance['skip'];
 
319
 
320
  return $instance;
321
  }
@@ -329,7 +336,9 @@ class AlbumWidget extends WP_Widget {
329
  'title' => __( 'Thumbnail Albums', 'wp-photo-album-plus' ),
330
  'parent' => '0',
331
  'name' => 'no',
332
- 'skip' => 'yes' ) );
 
 
333
 
334
  // Widget title
335
  echo
@@ -377,6 +386,9 @@ class AlbumWidget extends WP_Widget {
377
  // Skip empty albums?
378
  wppa_widget_checkbox( $this, 'skip', $instance['skip'], __( 'Skip "empty" albums', 'wp-photo-album-plus' ) ) .
379
 
 
 
 
380
  '<p>' .
381
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus') .
382
  ' ' . __( 'Table I-F9 and 10', 'wp-photo-album-plus' ) .
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
+ * Version 6.8.07
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
34
  'title' => __( 'Photo Albums' , 'wp-photo-album-plus'), // Widget title
35
  'parent' => 'none', // Parent album
36
  'name' => 'no', // Display album name?
37
+ 'skip' => 'yes', // Skip empty albums
38
+ 'logonly' => 'no',
39
  // 'count' => wppa_opt( 'album_widget_count' ), // to be added
40
  // 'size' => wppa_opt( 'album_widget_size' )
41
  ) );
42
 
43
+ // Logged in only and logged out?
44
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
45
+ return;
46
+ }
47
+
48
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
49
 
50
  $page = in_array( wppa_opt( 'album_widget_linktype' ), wppa( 'links_no_page' ) ) ? '' : wppa_get_the_landing_page( 'album_widget_linkpage', __( 'Photo Albums', 'wp-photo-album-plus' ) );
318
  /** @see WP_Widget::update */
319
  function update( $new_instance, $old_instance ) {
320
  $instance = $old_instance;
321
+ $instance['title'] = strip_tags( $new_instance['title'] );
322
+ $instance['parent'] = $new_instance['parent'];
323
+ $instance['name'] = $new_instance['name'];
324
+ $instance['skip'] = $new_instance['skip'];
325
+ $instance['logonly'] = $new_instance['logonly'];
326
 
327
  return $instance;
328
  }
336
  'title' => __( 'Thumbnail Albums', 'wp-photo-album-plus' ),
337
  'parent' => '0',
338
  'name' => 'no',
339
+ 'skip' => 'yes',
340
+ 'logonly' => 'no',
341
+ ) );
342
 
343
  // Widget title
344
  echo
386
  // Skip empty albums?
387
  wppa_widget_checkbox( $this, 'skip', $instance['skip'], __( 'Skip "empty" albums', 'wp-photo-album-plus' ) ) .
388
 
389
+ // Loggedin only
390
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) ) .
391
+
392
  '<p>' .
393
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus') .
394
  ' ' . __( 'Table I-F9 and 10', 'wp-photo-album-plus' ) .
wppa-bestof-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the best rated photos
6
- * Version 6.8.06
7
  *
8
  */
9
 
@@ -38,8 +38,14 @@ class BestOfWidget extends WP_Widget {
38
  'ratcount' => 'yes',
39
  'linktype' => 'none',
40
  'totvalue' => '',
 
41
  ) );
42
 
 
 
 
 
 
43
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
44
  $page = in_array( $instance['linktype'], wppa( 'links_no_page' ) ) ? '' : wppa_get_the_landing_page( 'bestof_widget_linkpage', __( 'Best Of Photos', 'wp-photo-album-plus' ) );
45
  $count = $instance['count'] ? $instance['count'] : '10';
@@ -96,6 +102,7 @@ class BestOfWidget extends WP_Widget {
96
  $instance['ratcount'] = $new_instance['ratcount'];
97
  $instance['linktype'] = $new_instance['linktype'];
98
  $instance['totvalue'] = $new_instance['totvalue'];
 
99
 
100
  return $instance;
101
  }
@@ -115,6 +122,7 @@ class BestOfWidget extends WP_Widget {
115
  'ratcount' => 'yes',
116
  'linktype' => 'none',
117
  'totvalue' => '',
 
118
  ) );
119
 
120
  // WP Bug?
@@ -204,6 +212,9 @@ class BestOfWidget extends WP_Widget {
204
  echo
205
  wppa_widget_selection( $this, 'linktype', $instance['linktype'], __( 'Link to', 'wp-photo-album-plus' ), $options, $values, array(), '' );
206
 
 
 
 
207
  }
208
 
209
  } // class BestOfWidget
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the best rated photos
6
+ * Version 6.8.07
7
  *
8
  */
9
 
38
  'ratcount' => 'yes',
39
  'linktype' => 'none',
40
  'totvalue' => '',
41
+ 'logonly' => 'no',
42
  ) );
43
 
44
+ // Logged in only and logged out?
45
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
46
+ return;
47
+ }
48
+
49
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
50
  $page = in_array( $instance['linktype'], wppa( 'links_no_page' ) ) ? '' : wppa_get_the_landing_page( 'bestof_widget_linkpage', __( 'Best Of Photos', 'wp-photo-album-plus' ) );
51
  $count = $instance['count'] ? $instance['count'] : '10';
102
  $instance['ratcount'] = $new_instance['ratcount'];
103
  $instance['linktype'] = $new_instance['linktype'];
104
  $instance['totvalue'] = $new_instance['totvalue'];
105
+ $instance['logonly'] = $new_instance['logonly'];
106
 
107
  return $instance;
108
  }
122
  'ratcount' => 'yes',
123
  'linktype' => 'none',
124
  'totvalue' => '',
125
+ 'logonly' => 'no',
126
  ) );
127
 
128
  // WP Bug?
212
  echo
213
  wppa_widget_selection( $this, 'linktype', $instance['linktype'], __( 'Link to', 'wp-photo-album-plus' ), $options, $values, array(), '' );
214
 
215
+ // Loggedin only
216
+ echo
217
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
218
  }
219
 
220
  } // class BestOfWidget
wppa-comment-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the recent commets on photos
6
- * Version 6.8.06
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -30,7 +30,17 @@ class wppaCommentWidget extends WP_Widget {
30
  extract( $args );
31
  wppa( 'in_widget', 'com' );
32
  wppa_bump_mocc();
33
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Comments on photos', 'wp-photo-album-plus' ) ) );
 
 
 
 
 
 
 
 
 
 
34
  $page = in_array( wppa_opt( 'comment_widget_linktype' ), wppa( 'links_no_page' ) ) ? '' : wppa_get_the_landing_page( 'comment_widget_linkpage', __( 'Recently commented photos', 'wp-photo-album-plus' ) );
35
  $max = wppa_opt( 'comten_count' );
36
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
@@ -106,6 +116,7 @@ class wppaCommentWidget extends WP_Widget {
106
 
107
  $instance = $old_instance;
108
  $instance['title'] = strip_tags( $new_instance['title'] );
 
109
 
110
  return $instance;
111
  }
@@ -114,19 +125,22 @@ class wppaCommentWidget extends WP_Widget {
114
  function form( $instance ) {
115
 
116
  //Defaults
117
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Comments on Photos', 'wp-photo-album-plus' ) ) );
118
 
119
  // Title
120
  echo
121
  wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
122
 
 
 
 
 
123
  echo
124
  '<p>' .
125
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus' ) .
126
  ' ' . __( 'Table I-F3 and 4', 'wp-photo-album-plus' ) .
127
  '</p>';
128
-
129
- }
130
 
131
  } // class wppaCommentWidget
132
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the recent commets on photos
6
+ * Version 6.8.07
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
30
  extract( $args );
31
  wppa( 'in_widget', 'com' );
32
  wppa_bump_mocc();
33
+
34
+ $instance = wp_parse_args( (array) $instance,
35
+ array( 'title' => __( 'Comments on photos', 'wp-photo-album-plus' ),
36
+ 'logonly' => 'no',
37
+ ) );
38
+
39
+ // Logged in only and logged out?
40
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
41
+ return;
42
+ }
43
+
44
  $page = in_array( wppa_opt( 'comment_widget_linktype' ), wppa( 'links_no_page' ) ) ? '' : wppa_get_the_landing_page( 'comment_widget_linkpage', __( 'Recently commented photos', 'wp-photo-album-plus' ) );
45
  $max = wppa_opt( 'comten_count' );
46
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
116
 
117
  $instance = $old_instance;
118
  $instance['title'] = strip_tags( $new_instance['title'] );
119
+ $instance['logonly'] = $new_instance['logonly'];
120
 
121
  return $instance;
122
  }
125
  function form( $instance ) {
126
 
127
  //Defaults
128
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Comments on Photos', 'wp-photo-album-plus' ), 'logonly' => 'no' ) );
129
 
130
  // Title
131
  echo
132
  wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
133
 
134
+ // Loggedin only
135
+ echo
136
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
137
+
138
  echo
139
  '<p>' .
140
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus' ) .
141
  ' ' . __( 'Table I-F3 and 4', 'wp-photo-album-plus' ) .
142
  '</p>';
143
+ }
 
144
 
145
  } // class wppaCommentWidget
146
 
wppa-cron.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
- * Version 6.8.06
7
  *
8
  *
9
  */
@@ -335,11 +335,16 @@ function _wppa_do_clear_cache( $dir ) {
335
  $file = fopen( $fso, 'rb' );
336
  if ( $file ) {
337
  $size = filesize( $fso );
338
- $haystack = fread( $file, $size );
339
- if ( strpos( $haystack, $needle ) !== false ) {
340
- fclose( $file );
341
- unlink( $fso );
342
- wppa_log( 'fso', 'Cron removed cachefile: {b}' . str_replace( WPPA_CONTENT_PATH, '', $fso ) . '{/b}' );
 
 
 
 
 
343
  }
344
  else {
345
  fclose( $file );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
+ * Version 6.8.07
7
  *
8
  *
9
  */
335
  $file = fopen( $fso, 'rb' );
336
  if ( $file ) {
337
  $size = filesize( $fso );
338
+ if ( $size ) {
339
+ $haystack = fread( $file, $size );
340
+ if ( strpos( $haystack, $needle ) !== false ) {
341
+ fclose( $file );
342
+ unlink( $fso );
343
+ wppa_log( 'fso', 'Cron removed cachefile: {b}' . str_replace( WPPA_CONTENT_PATH, '', $fso ) . '{/b}' );
344
+ }
345
+ else {
346
+ fclose( $file );
347
+ }
348
  }
349
  else {
350
  fclose( $file );
wppa-date-time.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
- * Version 6.6.22
7
  *
8
  */
9
 
@@ -191,16 +191,13 @@ function wppa_local_date( $format, $timestamp = false ) {
191
  $tzstring = get_option( 'timezone_string' );
192
  if ( empty( $tzstring ) ) {
193
 
194
- // Create a UTC+- zone if no timezone string exists
195
  $current_offset = get_option( 'gmt_offset', 0 );
196
- if ( 0 == $current_offset ) {
197
- $tzstring = 'UTC';
198
- }
199
- elseif ($current_offset < 0 ) {
200
- $tzstring = 'UTC' . $current_offset;
201
- }
202
- else {
203
- $tzstring = 'UTC+' . $current_offset;
204
  }
205
  }
206
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
+ * Version 6.8.07
7
  *
8
  */
9
 
191
  $tzstring = get_option( 'timezone_string' );
192
  if ( empty( $tzstring ) ) {
193
 
194
+ // Correct $time according to gmt_offset
195
  $current_offset = get_option( 'gmt_offset', 0 );
196
+
197
+ $tzstring = 'UTC';
198
+
199
+ if ( is_numeric( $current_offset ) ) {
200
+ $time += $current_offset * 3600;
 
 
 
201
  }
202
  }
203
 
wppa-featen-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the featured photos
6
- * Version 6.8.06
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -27,7 +27,13 @@ class FeaTenWidget extends WP_Widget {
27
  wppa( 'in_widget', 'featen' );
28
  wppa_bump_mocc();
29
 
30
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Featured photos', 'wp-photo-album-plus' ), 'album' => '' ) );
 
 
 
 
 
 
31
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
32
  $page = in_array( wppa_opt( 'featen_widget_linktype' ), wppa( 'links_no_page' ) ) ?
33
  '' :
@@ -172,8 +178,9 @@ class FeaTenWidget extends WP_Widget {
172
  function update( $new_instance, $old_instance ) {
173
 
174
  $instance = $old_instance;
175
- $instance['title'] = strip_tags( $new_instance['title'] );
176
- $instance['album'] = $new_instance['album'];
 
177
 
178
  return $instance;
179
  }
@@ -182,7 +189,7 @@ class FeaTenWidget extends WP_Widget {
182
  function form( $instance ) {
183
 
184
  //Defaults
185
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Featured Photos', 'wp-photo-album-plus' ), 'album' => '0' ) );
186
 
187
  $album = $instance['album'];
188
 
@@ -198,13 +205,18 @@ class FeaTenWidget extends WP_Widget {
198
  echo
199
  wppa_widget_selection_frame( $this, 'album', $body, __( 'Album', 'wp-photo-album-plus' ) );
200
 
201
- // Explanation
 
 
 
 
202
  echo
203
  '<p>' .
204
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus' ) .
205
  ' ' . __( 'Table I-F11 and 12', 'wp-photo-album-plus' ) .
206
  '</p>';
207
- }
 
208
 
209
  } // class FeaTenWidget
210
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the featured photos
6
+ * Version 6.8.07
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
27
  wppa( 'in_widget', 'featen' );
28
  wppa_bump_mocc();
29
 
30
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Featured photos', 'wp-photo-album-plus' ), 'album' => '', 'logonly' => 'no' ) );
31
+
32
+ // Logged in only and logged out?
33
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
34
+ return;
35
+ }
36
+
37
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
38
  $page = in_array( wppa_opt( 'featen_widget_linktype' ), wppa( 'links_no_page' ) ) ?
39
  '' :
178
  function update( $new_instance, $old_instance ) {
179
 
180
  $instance = $old_instance;
181
+ $instance['title'] = strip_tags( $new_instance['title'] );
182
+ $instance['album'] = $new_instance['album'];
183
+ $instance['logonly'] = $new_instance['logonly'];
184
 
185
  return $instance;
186
  }
189
  function form( $instance ) {
190
 
191
  //Defaults
192
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Featured Photos', 'wp-photo-album-plus' ), 'album' => '0', 'logonly' => 'no' ) );
193
 
194
  $album = $instance['album'];
195
 
205
  echo
206
  wppa_widget_selection_frame( $this, 'album', $body, __( 'Album', 'wp-photo-album-plus' ) );
207
 
208
+ // Loggedin only
209
+ echo
210
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
211
+
212
+ // Explanation
213
  echo
214
  '<p>' .
215
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus' ) .
216
  ' ' . __( 'Table I-F11 and 12', 'wp-photo-album-plus' ) .
217
  '</p>';
218
+
219
+ }
220
 
221
  } // class FeaTenWidget
222
 
wppa-gp-widget.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * A text widget that interpretes wppa shortcodes
6
  *
7
- * Version 6.8.06
8
  */
9
 
10
  class WppaGpWidget extends WP_Widget {
@@ -92,7 +92,7 @@ class WppaGpWidget extends WP_Widget {
92
  wppa_widget_checkbox( $this, 'filter', $instance['filter'], __( 'Automatically add paragraphs', 'wp-photo-album-plus' ) ) .
93
 
94
  // Logged in only?
95
- wppa_widget_checkbox( $this, 'loggedinonly', $instance['loggedinonly'], __( 'Show to logged in users only', 'wp-photo-album-plus' ) );
96
 
97
  }
98
  }
4
  *
5
  * A text widget that interpretes wppa shortcodes
6
  *
7
+ * Version 6.8.07
8
  */
9
 
10
  class WppaGpWidget extends WP_Widget {
92
  wppa_widget_checkbox( $this, 'filter', $instance['filter'], __( 'Automatically add paragraphs', 'wp-photo-album-plus' ) ) .
93
 
94
  // Logged in only?
95
+ wppa_widget_checkbox( $this, 'loggedinonly', $instance['loggedinonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
96
 
97
  }
98
  }
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
- * Version 6.8.04
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
@@ -28,6 +28,7 @@ require_once 'wppa-bestof-widget.php';
28
  require_once 'wppa-album-navigator-widget.php';
29
  require_once 'wppa-stereo-widget.php';
30
  require_once 'wppa-admins-choice-widget.php';
 
31
 
32
  /* COMMON FUNCTIONS */
33
  require_once 'wppa-common-functions.php';
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
+ * Version 6.8.07
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
28
  require_once 'wppa-album-navigator-widget.php';
29
  require_once 'wppa-stereo-widget.php';
30
  require_once 'wppa-admins-choice-widget.php';
31
+ require_once 'wppa-stats-widget.php';
32
 
33
  /* COMMON FUNCTIONS */
34
  require_once 'wppa-common-functions.php';
wppa-lasten-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the last uploaded photos
6
- * Version 6.8.06
7
  */
8
 
9
  class LasTenWidget extends WP_Widget {
@@ -33,7 +33,14 @@ class LasTenWidget extends WP_Widget {
33
  'timesince' => 'yes',
34
  'display' => 'thumbs',
35
  'includesubs' => 'no',
 
36
  ) );
 
 
 
 
 
 
37
  $widget_title = apply_filters('widget_title', $instance['title'] );
38
  $page = in_array( wppa_opt( 'lasten_widget_linktype' ), wppa( 'links_no_page' ) ) ?
39
  '' :
@@ -173,6 +180,7 @@ class LasTenWidget extends WP_Widget {
173
  $instance['timesince'] = $new_instance['timesince'];
174
  $instance['display'] = $new_instance['display'];
175
  $instance['includesubs'] = isset( $new_instance['includesubs'] ) ? $new_instance['includesubs'] : false;
 
176
 
177
  return $instance;
178
  }
@@ -188,6 +196,7 @@ class LasTenWidget extends WP_Widget {
188
  'timesince' => 'yes',
189
  'display' => 'thumbs',
190
  'includesubs' => 'no',
 
191
  ) );
192
 
193
  // Title
@@ -231,6 +240,10 @@ class LasTenWidget extends WP_Widget {
231
  echo
232
  wppa_widget_checkbox( $this, 'timesince', $instance['timesince'], __( 'Show time since', 'wp-photo-album-plus' ) );
233
 
 
 
 
 
234
  echo
235
  '<p>' .
236
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus' ) .
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the last uploaded photos
6
+ * Version 6.8.07
7
  */
8
 
9
  class LasTenWidget extends WP_Widget {
33
  'timesince' => 'yes',
34
  'display' => 'thumbs',
35
  'includesubs' => 'no',
36
+ 'logonly' => 'no',
37
  ) );
38
+
39
+ // Logged in only and logged out?
40
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
41
+ return;
42
+ }
43
+
44
  $widget_title = apply_filters('widget_title', $instance['title'] );
45
  $page = in_array( wppa_opt( 'lasten_widget_linktype' ), wppa( 'links_no_page' ) ) ?
46
  '' :
180
  $instance['timesince'] = $new_instance['timesince'];
181
  $instance['display'] = $new_instance['display'];
182
  $instance['includesubs'] = isset( $new_instance['includesubs'] ) ? $new_instance['includesubs'] : false;
183
+ $instance['logonly'] = $new_instance['logonly'];
184
 
185
  return $instance;
186
  }
196
  'timesince' => 'yes',
197
  'display' => 'thumbs',
198
  'includesubs' => 'no',
199
+ 'logonly' => 'no',
200
  ) );
201
 
202
  // Title
240
  echo
241
  wppa_widget_checkbox( $this, 'timesince', $instance['timesince'], __( 'Show time since', 'wp-photo-album-plus' ) );
242
 
243
+ // Loggedin only
244
+ echo
245
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
246
+
247
  echo
248
  '<p>' .
249
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus' ) .
wppa-multitag-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the multitag widget
6
- * Version 6.8.06
7
  *
8
  */
9
 
@@ -20,6 +20,7 @@ class MultitagPhotos extends WP_Widget {
20
  var $defaults = array( 'title' => '',
21
  'cols' => '2',
22
  'tags' => '',
 
23
  );
24
 
25
  /** @see WP_Widget::widget */
@@ -35,7 +36,12 @@ class MultitagPhotos extends WP_Widget {
35
 
36
  $instance = wppa_parse_args( (array) $instance, $this -> defaults );
37
 
38
- $widget_title = apply_filters( 'widget_title', $instance['title'] );
 
 
 
 
 
39
 
40
  // Display the widget
41
  echo $before_widget;
@@ -63,6 +69,7 @@ class MultitagPhotos extends WP_Widget {
63
  // Sanitize
64
  $instance['title'] = strip_tags( $instance['title'] );
65
  $instance['cols'] = min( max( '1', $instance['cols'] ), '6' );
 
66
 
67
  return $instance;
68
  }
@@ -106,6 +113,11 @@ class MultitagPhotos extends WP_Widget {
106
  $s .
107
  '</b>' .
108
  '</p>';
 
 
 
 
 
109
  }
110
 
111
  } // class MultitagPhotos
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the multitag widget
6
+ * Version 6.8.07
7
  *
8
  */
9
 
20
  var $defaults = array( 'title' => '',
21
  'cols' => '2',
22
  'tags' => '',
23
+ 'logonly' => 'no',
24
  );
25
 
26
  /** @see WP_Widget::widget */
36
 
37
  $instance = wppa_parse_args( (array) $instance, $this -> defaults );
38
 
39
+ // Logged in only and logged out?
40
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
41
+ return;
42
+ }
43
+
44
+ $widget_title = apply_filters( 'widget_title', $instance['title'] );
45
 
46
  // Display the widget
47
  echo $before_widget;
69
  // Sanitize
70
  $instance['title'] = strip_tags( $instance['title'] );
71
  $instance['cols'] = min( max( '1', $instance['cols'] ), '6' );
72
+ $instance['logonly'] = $new_instance['logonly'];
73
 
74
  return $instance;
75
  }
113
  $s .
114
  '</b>' .
115
  '</p>';
116
+
117
+ // Loggedin only
118
+ echo
119
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
120
+
121
  }
122
 
123
  } // class MultitagPhotos
wppa-potd-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the widget
6
- * Version 6.8.06
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -28,7 +28,13 @@ class PhotoOfTheDay extends WP_Widget {
28
  extract( $args );
29
 
30
  // Defaults
31
- $instance = wp_parse_args( (array) $instance, array( 'title' => wppa_opt( 'potd_title' ) ) );
 
 
 
 
 
 
32
 
33
  $widget_title = apply_filters('widget_title', $instance['title']);
34
 
@@ -200,6 +206,7 @@ class PhotoOfTheDay extends WP_Widget {
200
  function update( $new_instance, $old_instance ) {
201
  $instance = $old_instance;
202
  $instance['title'] = strip_tags( $new_instance['title'] );
 
203
 
204
  return $instance;
205
  }
@@ -208,12 +215,18 @@ class PhotoOfTheDay extends WP_Widget {
208
  function form( $instance ) {
209
 
210
  // Defaults
211
- $instance = wp_parse_args( (array) $instance, array( 'title' => wppa_opt( 'potd_title' ) ) );
 
 
212
 
213
  // Title
214
  echo
215
  wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
216
 
 
 
 
 
217
  // Explanation
218
  echo
219
  '<p>' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the widget
6
+ * Version 6.8.07
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
28
  extract( $args );
29
 
30
  // Defaults
31
+ $instance = wp_parse_args( (array) $instance, array( 'title' => wppa_opt( 'potd_title' ),
32
+ 'logonly' => 'no' ) );
33
+
34
+ // Logged in only and logged out?
35
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
36
+ return;
37
+ }
38
 
39
  $widget_title = apply_filters('widget_title', $instance['title']);
40
 
206
  function update( $new_instance, $old_instance ) {
207
  $instance = $old_instance;
208
  $instance['title'] = strip_tags( $new_instance['title'] );
209
+ $instance['logonly'] = $new_instance['logonly'];
210
 
211
  return $instance;
212
  }
215
  function form( $instance ) {
216
 
217
  // Defaults
218
+ $instance = wp_parse_args( (array) $instance, array( 'title' => wppa_opt( 'potd_title' ),
219
+ 'logonly' => 'no',
220
+ ) );
221
 
222
  // Title
223
  echo
224
  wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
225
 
226
+ // Loggedin only
227
+ echo
228
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
229
+
230
  // Explanation
231
  echo
232
  '<p>' .
wppa-qr-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display qr code
6
- * Version 6.8.06
7
  */
8
 
9
 
@@ -24,7 +24,14 @@ class wppaQRWidget extends WP_Widget {
24
 
25
  extract( $args );
26
 
27
- $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'QR Widget' , 'wp-photo-album-plus' ) : $instance['title']);
 
 
 
 
 
 
 
28
  $qrsrc = 'http' . ( is_ssl() ? 's' : '' ) . '://api.qrserver.com/v1/create-qr-code/' .
29
  '?format=svg' .
30
  '&size='. wppa_opt( 'qr_size' ).'x'.wppa_opt( 'qr_size' ) .
@@ -71,6 +78,7 @@ class wppaQRWidget extends WP_Widget {
71
  function update( $new_instance, $old_instance ) {
72
  $instance = $old_instance;
73
  $instance['title'] = strip_tags( $new_instance['title'] );
 
74
 
75
  return $instance;
76
  }
@@ -79,12 +87,16 @@ class wppaQRWidget extends WP_Widget {
79
  function form( $instance ) {
80
 
81
  // Defaults
82
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'QR Widget' , 'wp-photo-album-plus') ) );
83
 
84
  // Title
85
  echo
86
  wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
87
 
 
 
 
 
88
  // Explanation
89
  echo
90
  '<p>' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * display qr code
6
+ * Version 6.8.07
7
  */
8
 
9
 
24
 
25
  extract( $args );
26
 
27
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'QR Widget' , 'wp-photo-album-plus' ), 'logonly' => 'no' ) );
28
+
29
+ // Logged in only and logged out?
30
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
31
+ return;
32
+ }
33
+
34
+ $title = apply_filters( 'widget_title', $instance['title'] );
35
  $qrsrc = 'http' . ( is_ssl() ? 's' : '' ) . '://api.qrserver.com/v1/create-qr-code/' .
36
  '?format=svg' .
37
  '&size='. wppa_opt( 'qr_size' ).'x'.wppa_opt( 'qr_size' ) .
78
  function update( $new_instance, $old_instance ) {
79
  $instance = $old_instance;
80
  $instance['title'] = strip_tags( $new_instance['title'] );
81
+ $instance['logonly'] = $new_instance['logonly'];
82
 
83
  return $instance;
84
  }
87
  function form( $instance ) {
88
 
89
  // Defaults
90
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'QR Widget' , 'wp-photo-album-plus'), 'logonly' => 'no' ) );
91
 
92
  // Title
93
  echo
94
  wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
95
 
96
+ // Loggedin only
97
+ echo
98
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
99
+
100
  // Explanation
101
  echo
102
  '<p>' .
wppa-search-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the search widget
6
- * Version 6.8.06
7
  *
8
  */
9
 
@@ -38,8 +38,14 @@ class SearchPhotos extends WP_Widget {
38
  'landingpage' => '0',
39
  'catbox' => false,
40
  'selboxes' => false,
 
41
  ) );
42
 
 
 
 
 
 
43
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
44
 
45
  // Display the widget
@@ -77,6 +83,7 @@ class SearchPhotos extends WP_Widget {
77
  $instance['landingpage'] = $new_instance['landingpage'];
78
  $instance['catbox'] = isset( $new_instance['catbox'] ) ? $new_instance['catbox'] : false;
79
  $instance['selboxes'] = isset( $new_instance['selboxes'] ) ? $new_instance['selboxes'] : false;
 
80
 
81
  return $instance;
82
  }
@@ -96,6 +103,7 @@ class SearchPhotos extends WP_Widget {
96
  'landingpage' => '',
97
  'catbox' => false,
98
  'selboxes' => false,
 
99
  ) );
100
 
101
  // Title
@@ -212,6 +220,10 @@ class SearchPhotos extends WP_Widget {
212
  __( 'The default page will be created automatically', 'wp-photo-album-plus' )
213
  );
214
 
 
 
 
 
215
  }
216
 
217
  } // class SearchPhotos
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the search widget
6
+ * Version 6.8.07
7
  *
8
  */
9
 
38
  'landingpage' => '0',
39
  'catbox' => false,
40
  'selboxes' => false,
41
+ 'logonly' => 'no',
42
  ) );
43
 
44
+ // Logged in only and logged out?
45
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
46
+ return;
47
+ }
48
+
49
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
50
 
51
  // Display the widget
83
  $instance['landingpage'] = $new_instance['landingpage'];
84
  $instance['catbox'] = isset( $new_instance['catbox'] ) ? $new_instance['catbox'] : false;
85
  $instance['selboxes'] = isset( $new_instance['selboxes'] ) ? $new_instance['selboxes'] : false;
86
+ $instance['logonly'] = $new_instance['logonly'];
87
 
88
  return $instance;
89
  }
103
  'landingpage' => '',
104
  'catbox' => false,
105
  'selboxes' => false,
106
+ 'logonly' => 'no',
107
  ) );
108
 
109
  // Title
220
  __( 'The default page will be created automatically', 'wp-photo-album-plus' )
221
  );
222
 
223
+ // Loggedin only
224
+ echo
225
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
226
+
227
  }
228
 
229
  } // class SearchPhotos
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 6.8.06
7
  *
8
  */
9
 
@@ -1500,11 +1500,11 @@ global $wppa_supported_camara_brands;
1500
  wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
1501
 
1502
  }
1503
- wppa_setting_subheader( 'H', '1', __( 'Video related size settings' , 'wp-photo-album-plus') );
1504
  {
1505
  $name = __('Default width', 'wp-photo-album-plus');
1506
  $desc = __('The width of most videos', 'wp-photo-album-plus');
1507
- $help = esc_js('This setting can be overruled for individual videos on the photo admin pages.');
1508
  $slug = 'wppa_video_width';
1509
  $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus'));
1510
  $clas = 'wppa-video';
@@ -1513,7 +1513,7 @@ global $wppa_supported_camara_brands;
1513
 
1514
  $name = __('Default height', 'wp-photo-album-plus');
1515
  $desc = __('The height of most videos', 'wp-photo-album-plus');
1516
- $help = esc_js('This setting can be overruled for individual videos on the photo admin pages.');
1517
  $slug = 'wppa_video_height';
1518
  $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus'));
1519
  $clas = 'wppa-video';
@@ -3890,7 +3890,7 @@ global $wppa_supported_camara_brands;
3890
  $onchange = 'wppaCheckCheck( \''.$slug.'\', \'wppa-video\' )';
3891
  $html = wppa_checkbox($slug, $onchange);
3892
  $clas = '';
3893
- $tags = 'system';
3894
  wppa_setting($slug, '22', $name, $desc, $html, $help, $clas, $tags);
3895
 
3896
  $name = __('Enable Audio', 'wp-photo-album-plus');
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 6.8.07
7
  *
8
  */
9
 
1500
  wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
1501
 
1502
  }
1503
+ wppa_setting_subheader( 'H', '1', __( 'Video related size settings' , 'wp-photo-album-plus'), 'wppa-video' );
1504
  {
1505
  $name = __('Default width', 'wp-photo-album-plus');
1506
  $desc = __('The width of most videos', 'wp-photo-album-plus');
1507
+ $help = esc_js(__('This setting can be overruled for individual videos on the photo admin pages.', 'wp-photo-album-plus'));
1508
  $slug = 'wppa_video_width';
1509
  $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus'));
1510
  $clas = 'wppa-video';
1513
 
1514
  $name = __('Default height', 'wp-photo-album-plus');
1515
  $desc = __('The height of most videos', 'wp-photo-album-plus');
1516
+ $help = esc_js(__('This setting can be overruled for individual videos on the photo admin pages.', 'wp-photo-album-plus'));
1517
  $slug = 'wppa_video_height';
1518
  $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus'));
1519
  $clas = 'wppa-video';
3890
  $onchange = 'wppaCheckCheck( \''.$slug.'\', \'wppa-video\' )';
3891
  $html = wppa_checkbox($slug, $onchange);
3892
  $clas = '';
3893
+ $tags = 'system,video';
3894
  wppa_setting($slug, '22', $name, $desc, $html, $help, $clas, $tags);
3895
 
3896
  $name = __('Enable Audio', 'wp-photo-album-plus');
wppa-slideshow-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display a slideshow in the sidebar
6
- * Version 6.8.06
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -44,6 +44,7 @@ class SlideshowWidget extends WP_Widget {
44
  'maxslides' => '100',
45
  'random' => 'no',
46
  'incsubs' => 'no',
 
47
  );
48
 
49
  /** @see WP_Widget::widget */
@@ -66,6 +67,11 @@ class SlideshowWidget extends WP_Widget {
66
  $page = in_array( wppa_opt( 'slideonly_widget_linktype' ), wppa( 'links_no_page' ) ) ? '' :
67
  wppa_get_the_landing_page( 'slideonly_widget_linkpage', __( 'Widget landing page', 'wp-photo-album-plus' ) );
68
 
 
 
 
 
 
69
  // Calculate the height if set to 0
70
  if ( ! $instance['height'] ) {
71
  $instance['height'] = round( wppa_opt( 'widget_width' ) * wppa_opt( 'maxheight' ) / wppa_opt( 'fullsize' ) );
@@ -344,6 +350,11 @@ class SlideshowWidget extends WP_Widget {
344
 
345
  '</div>';
346
 
 
 
 
 
 
347
  }
348
 
349
  } // class SlideshowWidget
3
  * Package: wp-photo-album-plus
4
  *
5
  * display a slideshow in the sidebar
6
+ * Version 6.8.07
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
44
  'maxslides' => '100',
45
  'random' => 'no',
46
  'incsubs' => 'no',
47
+ 'logonly' => 'no',
48
  );
49
 
50
  /** @see WP_Widget::widget */
67
  $page = in_array( wppa_opt( 'slideonly_widget_linktype' ), wppa( 'links_no_page' ) ) ? '' :
68
  wppa_get_the_landing_page( 'slideonly_widget_linkpage', __( 'Widget landing page', 'wp-photo-album-plus' ) );
69
 
70
+ // Logged in only and logged out?
71
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
72
+ return;
73
+ }
74
+
75
  // Calculate the height if set to 0
76
  if ( ! $instance['height'] ) {
77
  $instance['height'] = round( wppa_opt( 'widget_width' ) * wppa_opt( 'maxheight' ) / wppa_opt( 'fullsize' ) );
350
 
351
  '</div>';
352
 
353
+ // Loggedin only
354
+ echo
355
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
356
+
357
+
358
  }
359
 
360
  } // class SlideshowWidget
wppa-stats-widget.php ADDED
@@ -0,0 +1,298 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* wppa-stats-widget.php
3
+ * Package: wp-photo-album-plus
4
+ *
5
+ * display the stats widget
6
+ * Version 6.8.07
7
+ *
8
+ */
9
+ class WppaStatsWidget extends WP_Widget {
10
+
11
+ // Default settings
12
+ var $defaults = array( 'title' => '',
13
+ 'ip' => 'no',
14
+ 'browser' => 'no',
15
+ 'dayno' => 'no',
16
+ 'sessions-active' => 'no',
17
+ 'sessions-day' => 'no',
18
+ 'reg-users' => 'no',
19
+ 'albums' => 'no',
20
+ 'mediaitems' => 'no',
21
+ 'photos' => 'no',
22
+ 'videos' => 'no',
23
+ 'audios' => 'no',
24
+ 'pdfs' => 'no',
25
+ 'comments' => 'no',
26
+ 'rating' => 'no',
27
+ 'logonly' => 'no',
28
+ );
29
+
30
+ // Constructor
31
+ function __construct() {
32
+ $widget_ops = array( 'classname' => 'wppa_stats_widget', 'description' => __( 'WPPA Statistics', 'your-ip-widget' ) );
33
+ parent::__construct( 'your_ip', __( 'WPPA Stats', 'wppa_stats_widget' ), $widget_ops );
34
+ }
35
+
36
+ // Widget
37
+ function widget( $args, $instance ) {
38
+
39
+ global $wpdb;
40
+ global $widget_content;
41
+
42
+ extract( $args );
43
+
44
+ $this->defaults['title'] = __( 'Statistics', 'wp-photo-album-plus' );
45
+ $instance = wp_parse_args( (array) $instance, $this->defaults );
46
+
47
+ // Logged in only and logged out?
48
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
49
+ return;
50
+ }
51
+
52
+
53
+ $widget_content = '';
54
+
55
+ if ( wppa_checked( $instance['ip'] ) ) {
56
+ $widget_content .= __('Your ip is', 'wp-photo-album-plus') . ': <b>'.$_SERVER['REMOTE_ADDR'].'</b><br />';
57
+ }
58
+ if ( wppa_checked( $instance['browser'] ) ) {
59
+ $browser = isset( $_SERVER["HTTP_USER_AGENT"] ) ? $_SERVER["HTTP_USER_AGENT"] : 'unknown';
60
+ $widget_content .= __('Your browser is', 'wp-photo-album-plus') . ': <b>' . $browser .'</b><br />';
61
+ }
62
+ if ( wppa_checked( $instance['dayno'] ) ) {
63
+ $widget_content .= __('Today is day no', 'wp-photo-album-plus') . ': <b>' . ( date_i18n( 'z', time() ) + 1 ) . '</b><br />';
64
+ }
65
+ if ( wppa_checked( $instance['sessions-active'] ) ) {
66
+ $sescount = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_SESSION . "` WHERE `timestamp` > '" . ( time() - 3600 ) . "'" );
67
+ $widget_content .= __('Number of active sessions', 'wp-photo-album-plus') . ': <b>' . $sescount . '</b><br />';
68
+ }
69
+ if ( wppa_checked( $instance['sessions-day'] ) ) {
70
+ $t = time() - 3600*24;
71
+ $daysescount = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_SESSION . "` WHERE `timestamp` > '" . $t . "'" );
72
+ $robots = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_SESSION . "` WHERE `timestamp` > '" . $t . "' AND `data` LIKE '%\"isrobot\";b:1;%'" );
73
+ $widget_content .= __('Number of sessions last 24 hours', 'wp-photo-album-plus') . ': <b>' . $daysescount . '</b><br />' .
74
+ __('Of which robots', 'wp-photo-album-plus') . ': <b>' . $robots . '</b><br />';
75
+ }
76
+ if ( wppa_checked( $instance['reg-users'] ) ) {
77
+ $users = $wpdb->get_var( "SELECT COUNT(*) FROM `" . $wpdb->prefix . 'users' . "`" );
78
+ $widget_content .= __('Number of registered users', 'wp-photo-album-plus') . ': <b>' . $users . '</b><br />';
79
+ }
80
+ if ( wppa_checked( $instance['albums'] ) ) {
81
+ $albums = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_ALBUMS . "`" );
82
+ if ( $albums ) {
83
+ $widget_content .= __('Number of albums', 'wp-photo-album-plus') . ': <b>' . $albums . '</b><br />';
84
+ }
85
+ }
86
+ if ( wppa_checked( $instance['mediaitems'] ) ) {
87
+ $items = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "`" );
88
+ if ( $items ) {
89
+ $widget_content .= __('Number of media items', 'wp-photo-album-plus') . ': <b>' . $items . '</b><br />';
90
+ }
91
+ }
92
+ if ( wppa_checked( $instance['photos'] ) ) {
93
+ $photos = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `ext` <> 'xxx' AND `filename` NOT LIKE '%.pdf'" );
94
+ if ( $photos ) {
95
+ $widget_content .= __('Number of photos', 'wp-photo-album-plus') . ': <b>' . $photos . '</b><br />';
96
+ }
97
+ }
98
+ $multi = false;
99
+ if ( wppa_checked( $instance['videos'] ) && wppa_switch( 'enable_video' ) ) {
100
+ $multi = $wpdb->get_col( "SELECT `id` FROM `" . WPPA_PHOTOS . "` WHERE `ext` = 'xxx'" );
101
+ $cnt = 0;
102
+ foreach( $multi as $item ) {
103
+ if ( wppa_is_video( $item ) ) $cnt++;
104
+ }
105
+ if ( $cnt ) {
106
+ $widget_content .= __('Number of videos', 'wp-photo-album-plus') . ': <b>' . $cnt . '</b><br />';
107
+ }
108
+ }
109
+ if ( wppa_checked( $instance['audios'] ) && wppa_switch( 'enable_audio' ) ) {
110
+ if ( ! $multi ) {
111
+ $multi = $wpdb->get_col( "SELECT `id` FROM `" . WPPA_PHOTOS . "` WHERE `ext` = 'xxx'" );
112
+ }
113
+ $cnt = 0;
114
+ foreach( $multi as $item ) {
115
+ if ( wppa_has_audio( $item ) ) $cnt++;
116
+ }
117
+ if ( $cnt ) {
118
+ $widget_content .= __('Number of audios', 'wp-photo-album-plus') . ': <b>' . $cnt . '</b><br />';
119
+ }
120
+ }
121
+ if ( wppa_checked( $instance['pdfs'] ) && wppa_can_pdf() ) {
122
+ $pdfs = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `filename` LIKE '%.pdf'" );
123
+ if ( $pdfs ) {
124
+ $widget_content .= __('Number of pdfs', 'wp-photo-album-plus') . ': <b>' . $pdfs . '</b><br />';
125
+ }
126
+ }
127
+ if ( wppa_checked( $instance['comments'] ) && wppa_switch( 'show_comments' ) ) {
128
+ $comments = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_COMMENTS . "`" );
129
+ if ( $comments ) {
130
+ $widget_content .= __('Number of comments', 'wp-photo-album-plus') . ': <b>' . $comments . '</b><br />';
131
+ }
132
+ }
133
+ if ( wppa_checked( $instance['rating'] ) && wppa_switch( 'rating_on' ) ) {
134
+ $ratings = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_RATING . "`" );
135
+ if ( $ratings ) {
136
+ $widget_content .= __('Number of ratings', 'wp-photo-album-plus') . ': <b>' . $ratings . '</b><br />';
137
+ }
138
+ }
139
+
140
+ if ( substr( $widget_content, -6 ) == '<br />' ) {
141
+ $widget_content = substr( $widget_content, 0, strlen( $widget_content ) - 6 );
142
+ }
143
+
144
+ echo $before_widget . $before_title . $instance['title'] . $after_title . $widget_content . $after_widget;
145
+ }
146
+
147
+ // Update settings
148
+ function update( $new_instance, $old_instance ) {
149
+ $instance = $new_instance;
150
+ $instance['title'] = strip_tags( $new_instance['title'] );
151
+ return $instance;
152
+ }
153
+
154
+ // Settings dialog
155
+ function form( $instance ) {
156
+
157
+ // Defaults
158
+ $this->defaults['title'] = __( 'Statistics', 'wp-photo-album-plus' );
159
+ $instance = wp_parse_args( (array) $instance, $this->defaults );
160
+
161
+ // Title
162
+ echo
163
+ wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
164
+
165
+ // Ip
166
+ echo
167
+ wppa_widget_checkbox( $this,
168
+ 'ip',
169
+ $instance['ip'],
170
+ __( 'Show IP address', 'wp-photo-album-plus' ),
171
+ __( 'Tick this box when the widget is used on non-cached pages only', 'wp-photo-album-plus' )
172
+ );
173
+
174
+ // Ip
175
+ echo
176
+ wppa_widget_checkbox( $this,
177
+ 'browser',
178
+ $instance['browser'],
179
+ __( 'Show browser', 'wp-photo-album-plus' ),
180
+ __( 'Tick this box when the widget is used on non-cached pages only', 'wp-photo-album-plus' )
181
+ );
182
+
183
+ // Dayno
184
+ echo
185
+ wppa_widget_checkbox( $this,
186
+ 'dayno',
187
+ $instance['dayno'],
188
+ __( 'Show day of the year', 'wp-photo-album-plus' )
189
+ );
190
+
191
+ // Active sessions
192
+ echo
193
+ wppa_widget_checkbox( $this,
194
+ 'sessions-active',
195
+ $instance['sessions-active'],
196
+ __( 'Show active sessions', 'wp-photo-album-plus' )
197
+ );
198
+
199
+ // 24 hrs sessions
200
+ echo
201
+ wppa_widget_checkbox( $this,
202
+ 'sessions-day',
203
+ $instance['sessions-day'],
204
+ __( 'Show 24hr sessions', 'wp-photo-album-plus' )
205
+ );
206
+
207
+ echo
208
+ wppa_widget_checkbox( $this,
209
+ 'reg-users',
210
+ $instance['reg-users'],
211
+ __( 'Show number of registered users', 'wp-photo-album-plus' )
212
+ );
213
+
214
+ echo
215
+ wppa_widget_checkbox( $this,
216
+ 'albums',
217
+ $instance['albums'],
218
+ __( 'Show number of albums', 'wp-photo-album-plus' )
219
+ );
220
+
221
+ echo
222
+ wppa_widget_checkbox( $this,
223
+ 'mediaitems',
224
+ $instance['mediaitems'],
225
+ __( 'Show number of media items', 'wp-photo-album-plus' )
226
+ );
227
+
228
+ echo
229
+ wppa_widget_checkbox( $this,
230
+ 'photos',
231
+ $instance['photos'],
232
+ __( 'Show number of albums', 'wp-photo-album-plus' )
233
+ );
234
+
235
+ if ( wppa_switch( 'enable_video' ) ) {
236
+ echo
237
+ wppa_widget_checkbox( $this,
238
+ 'videos',
239
+ $instance['videos'],
240
+ __( 'Show number of videos', 'wp-photo-album-plus' )
241
+ );
242
+ }
243
+
244
+ if ( wppa_switch( 'enable_audio' ) ) {
245
+ echo
246
+ wppa_widget_checkbox( $this,
247
+ 'audios',
248
+ $instance['videos'],
249
+ __( 'Show number of audios', 'wp-photo-album-plus' )
250
+ );
251
+ }
252
+
253
+ if ( wppa_can_pdf() ) {
254
+ echo
255
+ wppa_widget_checkbox( $this,
256
+ 'pdfs',
257
+ $instance['pdfs'],
258
+ __( 'Show number of pdfs', 'wp-photo-album-plus' )
259
+ );
260
+ }
261
+
262
+ if ( wppa_switch( 'show_comments' ) ) {
263
+ echo
264
+ wppa_widget_checkbox( $this,
265
+ 'comments',
266
+ $instance['comments'],
267
+ __( 'Show number of comments', 'wp-photo-album-plus' )
268
+ );
269
+
270
+ }
271
+
272
+ if ( wppa_switch( 'rating_on' ) ) {
273
+ echo
274
+ wppa_widget_checkbox( $this,
275
+ 'rating',
276
+ $instance['rating'],
277
+ __( 'Show number of ratings', 'wp-photo-album-plus' )
278
+ );
279
+
280
+ }
281
+
282
+ // Loggedin only
283
+ echo
284
+ wppa_widget_checkbox( $this,
285
+ 'logonly',
286
+ $instance['logonly'],
287
+ __( 'Show to logged in visitors only', 'wp-photo-album-plus' )
288
+ );
289
+
290
+ }
291
+
292
+ } // class WppaStatsWidget
293
+
294
+ // register WppaStatsWidget widget
295
+ add_action('widgets_init', 'wppa_stats_register_widget');
296
+ function wppa_stats_register_widget() {
297
+ register_widget("WppaStatsWidget");
298
+ }
wppa-stereo-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
- * Version 6.8.06
7
  */
8
 
9
  class wppaStereoWidget extends WP_Widget {
@@ -25,8 +25,12 @@ class wppaStereoWidget extends WP_Widget {
25
 
26
  extract( $args );
27
 
28
- $instance = wp_parse_args( (array) $instance, array( 'title' => __('Stereo Photo Settings', 'wp-photo-album-plus') ) );
29
 
 
 
 
 
30
 
31
  $widget_title = apply_filters('widget_title', $instance['title'] );
32
 
@@ -48,6 +52,7 @@ class wppaStereoWidget extends WP_Widget {
48
  function update($new_instance, $old_instance) {
49
  $instance = $old_instance;
50
  $instance['title'] = strip_tags( $new_instance['title'] );
 
51
 
52
  return $instance;
53
  }
@@ -56,12 +61,15 @@ class wppaStereoWidget extends WP_Widget {
56
  function form($instance) {
57
 
58
  //Defaults
59
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Stereo Photo Settings', 'wp-photo-album-plus ' ) ) );
60
 
61
  // Title
62
  echo
63
  wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
64
 
 
 
 
65
  }
66
 
67
  } // class wppaStereoWidget
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
+ * Version 6.8.07
7
  */
8
 
9
  class wppaStereoWidget extends WP_Widget {
25
 
26
  extract( $args );
27
 
28
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __('Stereo Photo Settings', 'wp-photo-album-plus'), 'logonly' => 'no' ) );
29
 
30
+ // Logged in only and logged out?
31
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
32
+ return;
33
+ }
34
 
35
  $widget_title = apply_filters('widget_title', $instance['title'] );
36
 
52
  function update($new_instance, $old_instance) {
53
  $instance = $old_instance;
54
  $instance['title'] = strip_tags( $new_instance['title'] );
55
+ $instance['logonly'] = $new_instance['logonly'];
56
 
57
  return $instance;
58
  }
61
  function form($instance) {
62
 
63
  //Defaults
64
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Stereo Photo Settings', 'wp-photo-album-plus ' ), 'logonly' => 'no' ) );
65
 
66
  // Title
67
  echo
68
  wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
69
 
70
+ // Loggedin only
71
+ echo
72
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
73
  }
74
 
75
  } // class wppaStereoWidget
wppa-super-view-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * ask the album / display you want
6
- * Version 6.8.06
7
  */
8
 
9
 
@@ -27,8 +27,14 @@ class WppaSuperView extends WP_Widget {
27
  'title' => __( 'Super View', 'wp-photo-album-plus' ),
28
  'root' => '0',
29
  'sort' => true,
 
30
  ) );
31
 
 
 
 
 
 
32
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
33
  $album_root = $instance['root'];
34
  $sort = wppa_checked( $instance['sort'] ) ? true : false;
@@ -49,6 +55,7 @@ class WppaSuperView extends WP_Widget {
49
  $instance['title'] = strip_tags($new_instance['title']);
50
  $instance['root'] = $new_instance['root'];
51
  $instance['sort'] = $new_instance['sort'];
 
52
 
53
  return $instance;
54
  }
@@ -59,7 +66,8 @@ class WppaSuperView extends WP_Widget {
59
  //Defaults
60
  $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Super View' , 'wp-photo-album-plus' ),
61
  'root' => '0',
62
- 'sort' => true
 
63
  ) );
64
 
65
  // Title
@@ -80,7 +88,11 @@ class WppaSuperView extends WP_Widget {
80
  __( 'If unticked, the album sort method for the album or system will be used', 'wp-photo-album-plus' )
81
  );
82
 
83
- }
 
 
 
 
84
 
85
  } // class WppaSuperView
86
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * ask the album / display you want
6
+ * Version 6.8.07
7
  */
8
 
9
 
27
  'title' => __( 'Super View', 'wp-photo-album-plus' ),
28
  'root' => '0',
29
  'sort' => true,
30
+ 'logonly' => 'no',
31
  ) );
32
 
33
+ // Logged in only and logged out?
34
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
35
+ return;
36
+ }
37
+
38
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
39
  $album_root = $instance['root'];
40
  $sort = wppa_checked( $instance['sort'] ) ? true : false;
55
  $instance['title'] = strip_tags($new_instance['title']);
56
  $instance['root'] = $new_instance['root'];
57
  $instance['sort'] = $new_instance['sort'];
58
+ $instance['logonly'] = $new_instance['logonly'];
59
 
60
  return $instance;
61
  }
66
  //Defaults
67
  $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Super View' , 'wp-photo-album-plus' ),
68
  'root' => '0',
69
+ 'sort' => true,
70
+ 'logonly' => 'no',
71
  ) );
72
 
73
  // Title
88
  __( 'If unticked, the album sort method for the album or system will be used', 'wp-photo-album-plus' )
89
  );
90
 
91
+ // Loggedin only
92
+ echo
93
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
94
+
95
+ }
96
 
97
  } // class WppaSuperView
98
 
wppa-tagcloud-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the tagcloud widget
6
- * Version 6.8.06
7
  *
8
  */
9
 
@@ -26,8 +26,14 @@ class TagcloudPhotos extends WP_Widget {
26
 
27
  extract( $args );
28
 
29
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Photo Tag Cloud', 'wp-photo-album-plus' ), 'tags' => array() ) );
30
- if ( empty( $instance['tags'] ) ) $instance['tags'] = array();
 
 
 
 
 
 
31
 
32
  $widget_title = apply_filters('widget_title', $instance['title']);
33
 
@@ -55,6 +61,8 @@ class TagcloudPhotos extends WP_Widget {
55
  $instance = $old_instance;
56
  $instance['title'] = strip_tags($new_instance['title']);
57
  $instance['tags'] = $new_instance['tags'];
 
 
58
  return $instance;
59
  }
60
 
@@ -62,7 +70,7 @@ class TagcloudPhotos extends WP_Widget {
62
  function form( $instance ) {
63
 
64
  //Defaults
65
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Photo Tag Cloud', 'wp-photo-album-plus' ), 'tags' => '' ) );
66
  $title = $instance['title'];
67
  $stags = $instance['tags'];
68
  if ( ! $stags ) $stags = array();
@@ -91,7 +99,11 @@ class TagcloudPhotos extends WP_Widget {
91
  }
92
  echo '<p style="word-break:break-all;" >' . __( 'Currently selected tags', 'wp-photo-album-plus' ) . ': <br /><b>' . $s . '</b></p>';
93
 
94
- }
 
 
 
 
95
 
96
  } // class TagcloudPhotos
97
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the tagcloud widget
6
+ * Version 6.8.07
7
  *
8
  */
9
 
26
 
27
  extract( $args );
28
 
29
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Photo Tag Cloud', 'wp-photo-album-plus' ), 'tags' => array(), 'logonly' => 'no' ) );
30
+
31
+ // Logged in only and logged out?
32
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
33
+ return;
34
+ }
35
+
36
+ if ( empty( $instance['tags'] ) ) $instance['tags'] = array();
37
 
38
  $widget_title = apply_filters('widget_title', $instance['title']);
39
 
61
  $instance = $old_instance;
62
  $instance['title'] = strip_tags($new_instance['title']);
63
  $instance['tags'] = $new_instance['tags'];
64
+ $instance['logonly'] = $new_instance['logonly'];
65
+
66
  return $instance;
67
  }
68
 
70
  function form( $instance ) {
71
 
72
  //Defaults
73
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Photo Tag Cloud', 'wp-photo-album-plus' ), 'tags' => '', 'logonly' => 'no' ) );
74
  $title = $instance['title'];
75
  $stags = $instance['tags'];
76
  if ( ! $stags ) $stags = array();
99
  }
100
  echo '<p style="word-break:break-all;" >' . __( 'Currently selected tags', 'wp-photo-album-plus' ) . ': <br /><b>' . $s . '</b></p>';
101
 
102
+ // Loggedin only
103
+ echo
104
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
105
+
106
+ }
107
 
108
  } // class TagcloudPhotos
109
 
wppa-thumbnail-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail photos
6
- * Version 6.8.06
7
  */
8
 
9
  class ThumbnailWidget extends WP_Widget {
@@ -34,8 +34,14 @@ class ThumbnailWidget extends WP_Widget {
34
  'name' => 'no',
35
  'display' => 'thumbs',
36
  'sortby' => wppa_get_photo_order('0'),
37
- 'limit' => wppa_opt( 'thumbnail_widget_count' )
 
38
  ) );
 
 
 
 
 
39
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
40
 
41
  $widget_link = $instance['link'];
@@ -157,6 +163,7 @@ class ThumbnailWidget extends WP_Widget {
157
  $instance['linktitle'] = $new_instance['linktitle'];
158
  $instance['sortby'] = $new_instance['sortby'];
159
  $instance['limit'] = strval(intval($new_instance['limit']));
 
160
 
161
  return $instance;
162
  }
@@ -173,7 +180,8 @@ class ThumbnailWidget extends WP_Widget {
173
  'name' => 'no',
174
  'display' => 'thumbs',
175
  'sortby' => wppa_get_photo_order('0'),
176
- 'limit' => wppa_opt( 'thumbnail_widget_count' )
 
177
  ) );
178
 
179
  // Title
@@ -229,6 +237,10 @@ class ThumbnailWidget extends WP_Widget {
229
  echo
230
  wppa_widget_checkbox( $this, 'name', $instance['name'], __( 'Show photo names under thumbnails', 'wp-photo-album-plus' ) );
231
 
 
 
 
 
232
  echo
233
  '<p>' .
234
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus' ) .
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail photos
6
+ * Version 6.8.07
7
  */
8
 
9
  class ThumbnailWidget extends WP_Widget {
34
  'name' => 'no',
35
  'display' => 'thumbs',
36
  'sortby' => wppa_get_photo_order('0'),
37
+ 'limit' => wppa_opt( 'thumbnail_widget_count' ),
38
+ 'logonly' => 'no',
39
  ) );
40
+ // Logged in only and logged out?
41
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
42
+ return;
43
+ }
44
+
45
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
46
 
47
  $widget_link = $instance['link'];
163
  $instance['linktitle'] = $new_instance['linktitle'];
164
  $instance['sortby'] = $new_instance['sortby'];
165
  $instance['limit'] = strval(intval($new_instance['limit']));
166
+ $instance['logonly'] = $new_instance['logonly'];
167
 
168
  return $instance;
169
  }
180
  'name' => 'no',
181
  'display' => 'thumbs',
182
  'sortby' => wppa_get_photo_order('0'),
183
+ 'limit' => wppa_opt( 'thumbnail_widget_count' ),
184
+ 'logonly' => 'no',
185
  ) );
186
 
187
  // Title
237
  echo
238
  wppa_widget_checkbox( $this, 'name', $instance['name'], __( 'Show photo names under thumbnails', 'wp-photo-album-plus' ) );
239
 
240
+ // Loggedin only
241
+ echo
242
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
243
+
244
  echo
245
  '<p>' .
246
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus' ) .
wppa-topten-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
- * Version 6.8.06
7
  */
8
 
9
  class TopTenWidget extends WP_Widget {
@@ -37,9 +37,16 @@ class TopTenWidget extends WP_Widget {
37
  'includesubs' => 'yes',
38
  'medalsonly' => 'no',
39
  'showowner' => 'no',
40
- 'showalbum' => 'no'
 
41
  ) );
42
- $widget_title = apply_filters('widget_title', $instance['title'] );
 
 
 
 
 
 
43
  $page = in_array( wppa_opt( 'topten_widget_linktype' ), wppa( 'links_no_page' ) ) ? '' : wppa_get_the_landing_page('topten_widget_linkpage', __('Top Ten Photos', 'wp-photo-album-plus'));
44
  $albumlinkpage = wppa_get_the_landing_page('topten_widget_album_linkpage', __('Top Ten Photo album', 'wp-photo-album-plus'));
45
  $max = wppa_opt( 'topten_count' );
@@ -308,6 +315,7 @@ class TopTenWidget extends WP_Widget {
308
  $instance['medalsonly'] = $new_instance['medalsonly'];
309
  $instance['showalbum'] = $new_instance['showalbum'];
310
  $instance['showowner'] = $new_instance['showowner'];
 
311
 
312
  return $instance;
313
  }
@@ -327,7 +335,8 @@ class TopTenWidget extends WP_Widget {
327
  'includesubs' => 'yes',
328
  'medalsonly' => 'no',
329
  'showowner' => 'no',
330
- 'showalbum' => 'no'
 
331
 
332
  ) );
333
 
@@ -393,6 +402,10 @@ class TopTenWidget extends WP_Widget {
393
  echo
394
  '</div>';
395
 
 
 
 
 
396
  echo
397
  '<p>' .
398
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus' ) .
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
+ * Version 6.8.07
7
  */
8
 
9
  class TopTenWidget extends WP_Widget {
37
  'includesubs' => 'yes',
38
  'medalsonly' => 'no',
39
  'showowner' => 'no',
40
+ 'showalbum' => 'no',
41
+ 'logonly' => 'no',
42
  ) );
43
+
44
+ // Logged in only and logged out?
45
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
46
+ return;
47
+ }
48
+
49
+ $widget_title = apply_filters('widget_title', $instance['title'] );
50
  $page = in_array( wppa_opt( 'topten_widget_linktype' ), wppa( 'links_no_page' ) ) ? '' : wppa_get_the_landing_page('topten_widget_linkpage', __('Top Ten Photos', 'wp-photo-album-plus'));
51
  $albumlinkpage = wppa_get_the_landing_page('topten_widget_album_linkpage', __('Top Ten Photo album', 'wp-photo-album-plus'));
52
  $max = wppa_opt( 'topten_count' );
315
  $instance['medalsonly'] = $new_instance['medalsonly'];
316
  $instance['showalbum'] = $new_instance['showalbum'];
317
  $instance['showowner'] = $new_instance['showowner'];
318
+ $instance['logonly'] = $new_instance['logonly'];
319
 
320
  return $instance;
321
  }
335
  'includesubs' => 'yes',
336
  'medalsonly' => 'no',
337
  'showowner' => 'no',
338
+ 'showalbum' => 'no',
339
+ 'logonly' => 'no',
340
 
341
  ) );
342
 
402
  echo
403
  '</div>';
404
 
405
+ // Loggedin only
406
+ echo
407
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
408
+
409
  echo
410
  '<p>' .
411
  __( 'You can set the sizes in this widget in the <b>Photo Albums -> Settings</b> admin page.', 'wp-photo-album-plus' ) .
wppa-upldr-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display a list of users linking to their photos
6
- * Version 6.8.06
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -31,8 +31,15 @@ class UpldrWidget extends WP_Widget {
31
  'title' => __( 'Uploader Photos', 'wp-photo-album-plus' ),
32
  'sortby' => 'name',
33
  'ignore' => 'admin',
34
- 'parent' => ''
 
35
  ) );
 
 
 
 
 
 
36
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
37
  $page = in_array( 'album', wppa( 'links_no_page' ) ) ? '' : wppa_get_the_landing_page('upldr_widget_linkpage', __('User uploaded photos', 'wp-photo-album-plus'));
38
  $ignorelist = explode(',', $instance['ignore']);
@@ -167,6 +174,7 @@ class UpldrWidget extends WP_Widget {
167
  $instance['parent'] = $new_instance['parent'];
168
  $instance['showownercount'] = $new_instance['showownercount'];
169
  $instance['showphotocount'] = $new_instance['showphotocount'];
 
170
 
171
  wppa_flush_upldr_cache( 'widgetid', $this->get_widget_id() );
172
 
@@ -184,7 +192,8 @@ class UpldrWidget extends WP_Widget {
184
  'ignore' => 'admin',
185
  'parent' => '',
186
  'showownercount' => '',
187
- 'showphotocount' => ''
 
188
  ) );
189
 
190
  // Title
@@ -261,7 +270,11 @@ class UpldrWidget extends WP_Widget {
261
  echo
262
  wppa_widget_checkbox( $this, 'showphotocount', $instance['showphotocount'], __( 'Show count of photos', 'wp-photo-album-plus' ) );
263
 
264
- }
 
 
 
 
265
 
266
  function get_widget_id() {
267
  $widgetid = substr( $this->get_field_name( 'txt' ), strpos( $this->get_field_name( 'txt' ), '[' ) + 1 );
3
  * Package: wp-photo-album-plus
4
  *
5
  * display a list of users linking to their photos
6
+ * Version 6.8.07
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
31
  'title' => __( 'Uploader Photos', 'wp-photo-album-plus' ),
32
  'sortby' => 'name',
33
  'ignore' => 'admin',
34
+ 'parent' => '',
35
+ 'logonly' => 'no',
36
  ) );
37
+
38
+ // Logged in only and logged out?
39
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
40
+ return;
41
+ }
42
+
43
  $widget_title = apply_filters( 'widget_title', $instance['title'] );
44
  $page = in_array( 'album', wppa( 'links_no_page' ) ) ? '' : wppa_get_the_landing_page('upldr_widget_linkpage', __('User uploaded photos', 'wp-photo-album-plus'));
45
  $ignorelist = explode(',', $instance['ignore']);
174
  $instance['parent'] = $new_instance['parent'];
175
  $instance['showownercount'] = $new_instance['showownercount'];
176
  $instance['showphotocount'] = $new_instance['showphotocount'];
177
+ $instance['logonly'] = $new_instance['logonly'];
178
 
179
  wppa_flush_upldr_cache( 'widgetid', $this->get_widget_id() );
180
 
192
  'ignore' => 'admin',
193
  'parent' => '',
194
  'showownercount' => '',
195
+ 'showphotocount' => '',
196
+ 'logonly' => 'no',
197
  ) );
198
 
199
  // Title
270
  echo
271
  wppa_widget_checkbox( $this, 'showphotocount', $instance['showphotocount'], __( 'Show count of photos', 'wp-photo-album-plus' ) );
272
 
273
+ // Loggedin only
274
+ echo
275
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
276
+
277
+ }
278
 
279
  function get_widget_id() {
280
  $widgetid = substr( $this->get_field_name( 'txt' ), strpos( $this->get_field_name( 'txt' ), '[' ) + 1 );
wppa-upload-widget.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * A wppa widget to upload photos
6
  *
7
- * Version 6.8.06
8
  */
9
 
10
  class WppaUploadWidget extends WP_Widget {
@@ -22,8 +22,15 @@ class WppaUploadWidget extends WP_Widget {
22
  extract($args);
23
  $instance = wp_parse_args( (array) $instance,
24
  array( 'title' => __( 'Upload Photos', 'wp-photo-album-plus' ),
25
- 'album' => '0'
 
26
  ));
 
 
 
 
 
 
27
  $title = apply_filters( 'widget_title', $instance['title'] );
28
  $album = $instance['album'];
29
 
@@ -79,12 +86,14 @@ class WppaUploadWidget extends WP_Widget {
79
  $instance = $old_instance;
80
  $instance['title'] = strip_tags( $new_instance['title'] );
81
  $instance['album'] = strval( intval( $new_instance['album'] ) );
 
 
82
  return $instance;
83
  }
84
 
85
  function form( $instance ) {
86
 
87
- $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Upload Photos', 'wp-photo-album-plus' ), 'album' => '0' ) );
88
 
89
  // Widget title
90
  echo
@@ -95,6 +104,10 @@ class WppaUploadWidget extends WP_Widget {
95
  echo
96
  wppa_widget_selection_frame( $this, 'album', $body, __( 'Album', 'wp-photo-album-plus' ) );
97
 
 
 
 
 
98
  }
99
  }
100
 
4
  *
5
  * A wppa widget to upload photos
6
  *
7
+ * Version 6.8.07
8
  */
9
 
10
  class WppaUploadWidget extends WP_Widget {
22
  extract($args);
23
  $instance = wp_parse_args( (array) $instance,
24
  array( 'title' => __( 'Upload Photos', 'wp-photo-album-plus' ),
25
+ 'album' => '0',
26
+ 'logonly' => 'no',
27
  ));
28
+
29
+ // Logged in only and logged out?
30
+ if ( wppa_checked( $instance['logonly'] ) && ! is_user_logged_in() ) {
31
+ return;
32
+ }
33
+
34
  $title = apply_filters( 'widget_title', $instance['title'] );
35
  $album = $instance['album'];
36
 
86
  $instance = $old_instance;
87
  $instance['title'] = strip_tags( $new_instance['title'] );
88
  $instance['album'] = strval( intval( $new_instance['album'] ) );
89
+ $instance['logonly'] = $new_instance['logonly'];
90
+
91
  return $instance;
92
  }
93
 
94
  function form( $instance ) {
95
 
96
+ $instance = wp_parse_args( (array) $instance, array( 'title' => __( 'Upload Photos', 'wp-photo-album-plus' ), 'album' => '0', 'logonly' => 'no' ) );
97
 
98
  // Widget title
99
  echo
104
  echo
105
  wppa_widget_selection_frame( $this, 'album', $body, __( 'Album', 'wp-photo-album-plus' ) );
106
 
107
+ // Loggedin only
108
+ echo
109
+ wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
110
+
111
  }
112
  }
113
 
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 6.8.06
7
  *
8
  */
9
 
@@ -4060,10 +4060,10 @@ function wppa_pdf_preprocess( &$file, $alb, $i = false ) {
4060
  if ( wppa_is_windows() ) {
4061
 
4062
  // On windows the filename[pageno] must be enclosed in "", on unix in ''
4063
- wppa_image_magick( 'convert -density 300 "' . $src . $file['name'] . '[0]" ' . $src . $jpg, null, $result );
4064
  }
4065
  else {
4066
- wppa_image_magick( "convert -density 300 '" . $src . $file['name'] . "[0]' " . $src . $jpg, null, $result );
4067
  }
4068
  }
4069
  else {
@@ -4071,10 +4071,10 @@ function wppa_pdf_preprocess( &$file, $alb, $i = false ) {
4071
  if ( wppa_is_windows() ) {
4072
 
4073
  // On windows the filename[pageno] must be enclosed in "", on unix in ''
4074
- wppa_image_magick( 'convert -density 300 "' . $src . $file['name'][$i] . '[0]" ' . $src . $jpg, null, $result );
4075
  }
4076
  else {
4077
- wppa_image_magick( "convert -density 300 '" . $src . $file['name'][$i] . "[0]' " . $src . $jpg, null, $result );
4078
  }
4079
  }
4080
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 6.8.07
7
  *
8
  */
9
 
4060
  if ( wppa_is_windows() ) {
4061
 
4062
  // On windows the filename[pageno] must be enclosed in "", on unix in ''
4063
+ wppa_image_magick( 'convert -density 300 "' . $src . $file['name'] . '[0]" ' . $src . $jpg );//, null, $result );
4064
  }
4065
  else {
4066
+ wppa_image_magick( "convert -density 300 '" . $src . $file['name'] . "[0]' " . $src . $jpg );//, null, $result );
4067
  }
4068
  }
4069
  else {
4071
  if ( wppa_is_windows() ) {
4072
 
4073
  // On windows the filename[pageno] must be enclosed in "", on unix in ''
4074
+ wppa_image_magick( 'convert -density 300 "' . $src . $file['name'][$i] . '[0]" ' . $src . $jpg );//, null, $result );
4075
  }
4076
  else {
4077
+ wppa_image_magick( "convert -density 300 '" . $src . $file['name'][$i] . "[0]' " . $src . $jpg );//, null, $result );
4078
  }
4079
  }
4080
 
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: 6.8.06.008
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 = '6805'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '6-8-06-008'; // 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: 6.8.07.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
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
+ global $wppa_revno; $wppa_revno = '6807'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '6-8-07-003'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );