WP Photo Album Plus - Version 6.8.02

Version Description

Download this release

Release Info

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

Code changes from version 6.8.01 to 6.8.02

js/wppa-admin-scripts.js CHANGED
@@ -1321,7 +1321,7 @@ function _wppaAjaxUpdatePhoto( photo, actionslug, value, refresh, bef, aft ) {
1321
  '&value=' + wppaEncode( value ),
1322
  async: true,
1323
  type: 'POST',
1324
- timeout: 10000,
1325
  beforeSend: function( xhr ) {
1326
 
1327
  // Show spinner
@@ -1581,7 +1581,7 @@ function _wppaAjaxUpdateAlbum( album, actionslug, value, isTmce, refresh ) {
1581
  '&value=' + wppaEncode( value ),
1582
  async: true,
1583
  type: 'POST',
1584
- timeout: 10000,
1585
  beforeSend: function( xhr ) {
1586
 
1587
  // Show spinner
1321
  '&value=' + wppaEncode( value ),
1322
  async: true,
1323
  type: 'POST',
1324
+ timeout: 60000,
1325
  beforeSend: function( xhr ) {
1326
 
1327
  // Show spinner
1581
  '&value=' + wppaEncode( value ),
1582
  async: true,
1583
  type: 'POST',
1584
+ timeout: 60000,
1585
  beforeSend: function( xhr ) {
1586
 
1587
  // Show spinner
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:1e4,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:1e4,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
+ 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;
js/wppa.js CHANGED
@@ -2,7 +2,7 @@
2
  //
3
  // conatins common vars and functions
4
  //
5
- var wppaJsVersion = '6.7.09';
6
 
7
  // Important notice:
8
  // All external vars that may be given a value in wppa-non-admin.php must be declared here and not in other front-end js files!!
@@ -612,6 +612,9 @@ function _wppaDoAutocol( mocc ) {
612
  jQuery( ".wppa-searchsel-item-"+mocc ).css( 'width', ( 100 / wppaSearchBoxSelItems[mocc] ) + '%' );
613
  }
614
  }
 
 
 
615
 
616
  }
617
 
2
  //
3
  // conatins common vars and functions
4
  //
5
+ var wppaJsVersion = '6.8.02';
6
 
7
  // Important notice:
8
  // All external vars that may be given a value in wppa-non-admin.php must be declared here and not in other front-end js files!!
612
  jQuery( ".wppa-searchsel-item-"+mocc ).css( 'width', ( 100 / wppaSearchBoxSelItems[mocc] ) + '%' );
613
  }
614
  }
615
+
616
+ // Upload dialog album selectionbox
617
+ jQuery( ".wppa-upload-album-"+mocc ).css( 'maxWidth', 0.6 * w );
618
 
619
  }
620
 
js/wppa.min.js CHANGED
@@ -1 +1 @@
1
- function wppaDoInit(p){var a=!1;for(mocc=1;mocc<=wppaTopMoc;mocc++)wppaAutoColumnWidth[mocc]&&(wppaColWidth[mocc]=0,_wppaDoAutocol(mocc),a=!0);p||(_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),a&&jQuery(window).resize(function(){for(mocc=1;mocc<=wppaTopMoc;mocc++)wppaAutoColumnWidth[mocc]&&(wppaColWidth[mocc]=0,_wppaDoAutocol(mocc))})),jQuery(".wppa-ajax-spin").stop().fadeOut(),setTimeout(function(){jQuery(".wppa-ajax-spin").stop().fadeOut()},1e3),jQuery(".wppa-ovl-spin").stop().fadeOut(),setTimeout(function(){jQuery(".wppa-ovl-spin").stop().fadeOut()},1e3),setTimeout(function(){for(var p=1;p<wppaTopMoc;)jQuery("ubb-"+p+"-l")&&(wppaUbb(p,"l","hide"),wppaUbb(p,"r","hide")),p++},3e3)}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(p){var a,e,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+p,t[3]="theimg1-"+p,e=0;e<3;)1==++e&&0!=p||(a=document.getElementById(t[e]))&&"function"==typeof a.pause&&(a.pause(),wppaConsoleLog("Video "+t[e]+" paused","force"))}function wppaStopAudio(p){if("number"==typeof p)jQuery("#audio-"+p).pause&&jQuery("#audio-"+p).pause();else{var a=jQuery("audio");if(a.length>0)for(var e=0;e<a.length;)"wppa"==jQuery(a[e]).attr("data-from")&&a[e].pause(),e++}}function wppaMakeFullsizeUrl(p){var a,e;(a=(p=p.replace("/thumbs/","/")).split("//"))[1]?(e=a[1].split("/"),p=a[0]+"//"):(e=a[0].split("/"),p="");for(var t=0;t<e.length;){var o=e[t];"w"!=o.split("_")[0]&&(0!=t&&(p+="/"),p+=o),t++}return p}function wppaGetContainerWidth(p){var a=document.getElementById("wppa-container-"+p),e=0;if(!wppaAutoColumnWidth[p])return a.clientWidth;for(;0==e;)a=a.parentNode,e=jQuery(a).width();return parseInt(e*wppaAutoColumnFrac[p])}function _wppaDoAutocol(p){if(wppaAutoColumnWidth[p]){var a;if(a=wppaGetContainerWidth(p),wppaColWidth[p]!=a){wppaConsoleLog("Doing autocol "+p),wppaColWidth[p]=a,jQuery(".wppa-container-"+p).css("width",a),wppaRenderModal&&(jQuery(".ui-dialog").css("width",a),jQuery(".ui-dialog").attr("height","auto")),wppaCoverImageResponsive[p]||(jQuery(".wppa-asym-text-frame-"+p).css("width",a-wppaTextFrameDelta),jQuery(".wppa-cover-box-"+p).css("width",a));var e,t=jQuery(".wppa-cover-box-mcr-"+p);if(t.length>1){var o=parseInt((a+8)/(wppaMaxCoverWidth+8))+1,s=o-1;e=parseInt((a+8)/o-8);for(var r=0;r<t.length;){switch(r%o){case 0:jQuery(t[r]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(t[r]).css({marginLeft:"8px",clear:"none",float:"right"});break;default:jQuery(t[r]).css({marginLeft:"8px",clear:"none",float:"left"})}r++}wppaCoverImageResponsive[p]||jQuery(".wppa-asym-text-frame-mcr-"+p).css("width",e-wppaTextFrameDelta),jQuery(".wppa-cover-box-mcr-"+p).css("width",e)}else if(wppaCoverImageResponsive[p]);else{jQuery(".wppa-asym-text-frame-mcr-"+p).css("width",a-wppaTextFrameDelta);var i={marginLeft:"0px",float:"left"};jQuery(".wppa-cover-box-mcr-"+p).css(i)}if(wppaThumbSpaceAuto){var n=parseInt(jQuery(".thumbnail-frame-"+p).css("width"));if(n){var w=wppaMinThumbSpace,l=a-wppaThumbnailAreaDelta-7,u=parseInt(l/(n+w)),c=l-u*n,d=parseInt(.5+c/(u+1));jQuery(".thumbnail-frame-"+p).css({marginLeft:d})}}jQuery(".thumbnail-frame-comalt-"+p).css("width",a-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+p).css("width",a-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var h,m=1,y=jQuery("#wppa-mas-h-"+m+"-"+p).attr("data-height-perc");y;)h=y*(a-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+m+"-"+p).css("height",h),m++,y=jQuery("#wppa-mas-h-"+m+"-"+p).attr("data-height-perc");wppaSetMasHorFrameWidthsForIeAndChrome(p),wppaFormatSlide(p),jQuery("#audio-slide-"+p).css("width",a-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+p).css("width",.7*a),wppaFilmStripLength[p]=a-wppaFilmStripAreaDelta[p],jQuery("#filmwindow-"+p).css("width",wppaFilmStripLength[p]),_wppaAdjustFilmstrip(p),wppaIsMini[p]||void 0===_wppaSlides[p]||(wppaColWidth[p]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat),jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating),jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length))),jQuery(".wppa-sphoto-"+p).css("width",a),jQuery(".wppa-simg-"+p).css("width",a-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+p).css("height",""),jQuery(".wppa-mphoto-"+p).css("width",a+10),jQuery(".wppa-mimg-"+p).css("width",a),jQuery(".wppa-mimg-"+p).css("height",""),wppaSearchBoxSelItems[p]>0&&(a/wppaSearchBoxSelItems[p]<125?jQuery(".wppa-searchsel-item-"+p).css("width","100%"):jQuery(".wppa-searchsel-item-"+p).css("width",100/wppaSearchBoxSelItems[p]+"%"))}}}function wppaSetMasHorFrameWidthsForIeAndChrome(p){for(var a=jQuery(".wppa-mas-h-"+p),e=wppaMinThumbSpace,t=0;t<a.length;t++){var o=wppaGetChildI(a[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+p+" )",400);var s=o.naturalWidth/o.naturalHeight*o.height+e;jQuery(a[t]).css({width:s})}}}function wppaGetChildI(p){var a,e=p.childNodes;for(a=0;a<e.length;a++){var t=e[a];if(t.id&&"i-"==t.id.substr(0,2))return t;var o=wppaGetChildI(t);if(o)return o}return!1}function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(p,a){if(!(wppaColWidth[p]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+p).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+p).css("display","none");jQuery("#wppa-fotomoto-container-"+p).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+p)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(a),wppaFotomotoToolbarIds[p]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+p,a)):(setTimeout("wppaFotomotoToolbar( "+p+',"'+a+'" )',200),wppaConsoleLog("Waiting for Fotomoto")))}function wppaFotomotoHide(p){jQuery("#wppa-fotomoto-container-"+p).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","none")}function wppaGetCurrentFullUrl(p,a){var e,t,o,s=document.location.href.split("?"),r="nil",i=0,n=!0;o=wppaShortQargs?"":"wppa-",s[1]&&(r=s[1].split("&"));var w=!1;if(e=s[0],"nil"!=r&&r.length>0)for(;i<r.length;)(t=r[i].split("="))[0]==o+"album"&&(w=!0),t[0]!=o+"photo"&&(e+=n?"?":"&",n=!1,e+=r[i]),i++;return w?(e+=n?"?":"&",e+=wppaUsePhotoNamesInUrls?o+"photo="+encodeURIComponent(_wppaNames[p][a]):o+"photo="+_wppaId[p][a]):""}function wppaStringContainsForbiddenChars(p){for(var a=["?","&","#","/",'"',"'"],e=0;e<a.length;){if(-1!=p.indexOf(a[e]))return!0;e++}return!1}function wppaPushStateSlide(p,a,e){if(!wppaIsMini[p]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=e)try{history.pushState({page:wppaHis,occur:p,type:"slide",slide:a},"---",e),wppaConsoleLog("Slide history stack updated")}catch(p){wppaConsoleLog("Slide history stack update failed")}}function wppaRepairScriptTags(p){if(void 0===p)return"";for(;-1!=p.indexOf("[script");)p=p.replace("[script","<script");for(;-1!=p.indexOf("[/script");)p=p.replace("[/script","</script");return p}function wppaRepairBrTags(p){return void 0===p?"":p.replace("[br /]","<br />")}function wppaTrimAlt(p){return void 0===p?"":p.length>13?p.substr(0,10)+"...":p}function wppaFbInit(){wppaFbInitBusy?wppaConsoleLog("Fb Init busy"):"undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):(wppaConsoleLog("Fb wait"),setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(p,a){if(document.selection)p.focus(),sel=document.selection.createRange(),sel.text=a;else if(p.selectionStart||"0"==p.selectionStart){var e=p.selectionStart,t=p.selectionEnd;p.value=p.value.substring(0,e)+a+p.value.substring(t,p.value.length),p.selectionStart=e+a.length,p.selectionEnd=e+a.length}else p.value+=a}function wppaGeoInit(p,a,e){var t=new google.maps.LatLng(a,e),o={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:10,center:t},s=new google.maps.Map(document.getElementById("map-canvas-"+p),o),r=new google.maps.Marker({position:t,map:s,title:""});google.maps.event.addListener(s,"center_changed",function(){window.setTimeout(function(){s.panTo(r.getPosition())},1e3)})}function wppaEncode(p){var a,e;if(void 0!==p){var t=(a=e=(a=e=(a=p).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),o=0;for(e="";o<t.length;)e+=t[o],++o<t.length&&(e+="||PLUS||");return e}}function wppaUrlToId(p){var a=p.split("/wppa/");return 1==a.length&&(a=p.split("/upload/")),1==a.length?0:(a=a[1],a=a.split("."),a=a[0].replace("/",""),a=a.replace("/",""),a=a.replace("/",""),a=a.replace("/",""),a=a.replace("/",""))}function wppaSuperSearchSelect(p,a){jQuery("#wppa-ss-albumopt-"+p).css("display","none"),jQuery("#wppa-ss-albumcat-"+p).css("display","none"),jQuery("#wppa-ss-albumname-"+p).css("display","none"),jQuery("#wppa-ss-albumtext-"+p).css("display","none"),jQuery("#wppa-ss-photoopt-"+p).css("display","none"),jQuery("#wppa-ss-photoname-"+p).css("display","none"),jQuery("#wppa-ss-photoowner-"+p).css("display","none"),jQuery("#wppa-ss-phototag-"+p).css("display","none"),jQuery("#wppa-ss-phototext-"+p).css("display","none"),jQuery("#wppa-ss-photoexif-"+p).css("display","none"),jQuery("#wppa-ss-photoiptc-"+p).css("display","none"),jQuery("#wppa-ss-exifopts-"+p).css("display","none"),jQuery("#wppa-ss-iptcopts-"+p).css("display","none"),jQuery("#wppa-ss-spinner-"+p).css("display","none"),jQuery("#wppa-ss-button-"+p).css("display","none");var e=jQuery("#wppa-ss-pa-"+p).val(),t="",o="",s="";switch(e){case"a":switch(jQuery("#wppa-ss-albumopt-"+p).css("display",""),t=jQuery("#wppa-ss-albumopt-"+p).val()){case"c":jQuery("#wppa-ss-albumcat-"+p).css("display","");r=jQuery(".wppa-ss-albumcat-"+p);s="";for(i=0;i<r.length;i++)"selected"==jQuery(r[i]).attr("selected")&&(s+="."+jQuery(r[i]).val());""!=(s=s.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+p).css("display",""),null!=(s=jQuery("#wppa-ss-albumname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+p).css("display","");r=jQuery(".wppa-ss-albumtext-"+p);s="";for(i=0;i<r.length;i++)"selected"==jQuery(r[i]).attr("selected")&&(s+="."+jQuery(r[i]).val());""!=(s=s.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+p).css("display",""),t=jQuery("#wppa-ss-photoopt-"+p).val()){case"n":jQuery("#wppa-ss-photoname-"+p).css("display",""),null!=(s=jQuery("#wppa-ss-photoname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+p).css("display",""),null!=(s=jQuery("#wppa-ss-photoowner-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+p).css("display","");r=jQuery(".wppa-ss-phototag-"+p);s="";for(i=0;i<r.length;i++)"selected"==jQuery(r[i]).attr("selected")&&(s+="."+jQuery(r[i]).val());""!=(s=s.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+p).css("display","");var r=jQuery(".wppa-ss-phototext-"+p);s="";var i;for(i=0;i<r.length;i++)"selected"==jQuery(r[i]).attr("selected")&&(s+="."+jQuery(r[i]).val());""!=(s=s.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+p).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+p).val())&&(o.length>2&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(p,o,"wppa-ss-iptcopts-"+p),wppaLastIptc=o):null!=(s=jQuery("#wppa-ss-iptcopts-"+p).val())&&""!=s&&jQuery("#wppa-ss-button-"+p).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+p).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+p).val())&&(o.length>2&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(p,o,"wppa-ss-exifopts-"+p),wppaLastExif=o):null!=(s=jQuery("#wppa-ss-exifopts-"+p).val())&&""!=s&&jQuery("#wppa-ss-button-"+p).css("display","")))}}if(a){var n=jQuery("#wppa-ss-pageurl-"+p).val();-1==n.indexOf("?")?n+="?":n+="&",n+="occur=1&wppa-supersearch="+e+","+t+","+o+","+s,document.location.href=n}}function wppaAjaxGetSsIptcList(p,a,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssiptclist&tag="+a+"&moccur="+p,async:!0,type:"GET",timeout:1e4,beforeSend:function(a){jQuery("#wppa-ss-spinner-"+p).css("display","")},success:function(a,t,o){jQuery("#"+e).html(a),jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaSuperSearchSelect(p),setTimeout('wppaSetIptcExifSize( ".wppa-iptclist-'+p+'", "#'+e+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsIptcList failed. Error = "+e+", status = "+a,"force")},complete:function(a,e,t){jQuery("#wppa-ss-spinner-"+p).css("display","none")}})}function wppaAjaxGetSsExifList(p,a,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssexiflist&tag="+a+"&moccur="+p,async:!0,type:"GET",timeout:1e4,beforeSend:function(a){jQuery("#wppa-ss-spinner-"+p).css("display","")},success:function(a,t,o){jQuery("#"+e).html(a),jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaSuperSearchSelect(p),setTimeout('wppaSetIptcExifSize( ".wppa-exiflist-'+p+'", "#'+e+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsExifList failed. Error = "+e+", status = "+a,"force")},complete:function(a,e,t){jQuery("#wppa-ss-spinner-"+p).css("display","none")}})}function wppaSetIptcExifSize(p,a){var e=jQuery(p).length;e>6&&(e=6),e<2&&(e=2),jQuery(a).attr("size",e)}function wppaUpdateSearchRoot(p,a){for(var e=jQuery(".wppa-search-root"),t=0;t<e.length;)jQuery(e[t]).html(p),t++;for(e=jQuery(".wppa-rootbox"),t=0;t<e.length;)a?(jQuery(e[t]).removeAttr("checked"),jQuery(e[t]).removeAttr("disabled")):(jQuery(e[t]).attr("checked","checked"),jQuery(e[t]).attr("disabled","disabled")),t++;for(e=jQuery(".wppa-search-root-id"),t=0;t<e.length;)jQuery(e[t]).val(a),t++}function wppaSubboxChange(p){if("checked"==jQuery(p).attr("checked"))for(var a=jQuery(".wppa-rootbox"),e=0;e<a.length;)jQuery(a[e]).attr("checked","checked"),e++}function wppaClearSubsearch(){for(var p=jQuery(".wppa-display-searchstring"),a=0;a<p.length;)jQuery(p[a]).html(""),a++;for(p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).attr("disabled","disabled"),a++}function wppaEnableSubsearch(){for(var p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).removeAttr("disabled"),a++}function wppaDisplaySelectedFiles(p){for(var a=jQuery("#"+p),e=0,t="";e<a[0].files.length;)t+=a[0].files[e].name+" ",e++;jQuery("#"+p+"-display").val(t)}function wppaIsEmpty(p){return null==p||(void 0===p||(""==p||(0==p||(0==p||void 0))))}var wppaJsVersion="6.7.09",wppaVersion="0",wppaIsIe=!1,wppaUseSvg=!0,wppaDebug,wppaFullValign=[],wppaFullHalign=[],wppaFullFrameDelta=[],wppaAnimationSpeed,wppaImageDirectory,wppaAutoColumnWidth=[],wppaAutoColumnFrac=[],wppaThumbnailAreaDelta,wppaSlideShowTimeOut=2500,wppaFadeInAfterFadeOut=!1,wppaTextFrameDelta=0,wppaBoxDelta=0,wppaPreambule=[],wppaHideWhenEmpty=!1,wppaThumbnailPitch=[],wppaFilmStripLength=[],wppaFilmStripMargin=[],wppaFilmStripAreaDelta=[],wppaFilmShowGlue=!1,wppaIsMini=[],wppaPortraitOnly=[],wppaSlideShow,wppaPhoto,wppaOf,wppaNextPhoto,wppaPreviousPhoto,wppaNextP,wppaPrevP,wppaAvgRating,wppaMyRating,wppaAvgRat,wppaMyRat,wppaDislikeMsg,wppaMiniTreshold=300,wppaStart="Start",wppaStop="Stop",wppaPleaseName,wppaPleaseEmail,wppaPleaseComment,wppaRatingOnce=!0,wppaBGcolorNumbar="transparent",wppaBcolorNumbar="transparent",wppaBGcolorNumbarActive="transparent",wppaBcolorNumbarActive="transparent",wppaFontFamilyNumbar="",wppaFontSizeNumbar="",wppaFontColorNumbar="",wppaFontWeightNumbar="",wppaFontFamilyNumbarActive="",wppaFontSizeNumbarActive="",wppaFontColorNumbarActive="",wppaFontWeightNumbarActive="",wppaNumbarMax="10",wppaAjaxUrl="",wppaLang="",wppaNextOnCallback=!1,wppaStarOpacity=.2,wppaLightBox=[],wppaEmailRequired="required",wppaSlideBorderWidth=0,wppaSlideInitRunning=[],wppaAnimationType="fadeover",wppaSlidePause=[],wppaSlideBlank=[],wppaRatingMax=5,wppaRatingDisplayType="graphic",wppaRatingPrec=2,wppaFilmPageSize=[],wppaAspectRatio=[],wppaFullSize=[],wppaStretch=!1,wppaThumbSpaceAuto=!1,wppaMinThumbSpace=4,wppaMagnifierCursor="",wppaArtMonkyLink="none",wppaAutoOpenComments=!1,wppaUpdateAddressLine=!1,wppaFilmThumbTitle="",wppaClickToView="",wppaUploadUrl="",wppaVoteForMe="",wppaVotedForMe="",wppaSlideSwipe=!0,wppaLightboxSingle=[],wppaMaxCoverWidth=300,wppaDownLoad="Download",wppaSiteUrl="",wppaWppaUrl="",wppaIncludeUrl="",wppaSlideToFullpopup=!1,wppaComAltSize=75,wppaBumpViewCount=!0,wppaBumpClickCount=!1,wppaFotomoto=!1,wppaArtMonkeyButton=!0,wppaShortQargs=!1,wppaOvlHires=!1,wppaMasonryCols=[],wppaVideoPlaying=[],wppaAudioPlaying=[],wppaSlideVideoStart=!1,wppaSlideAudioStart=!1,wppaAudioHeight=28,wppaHis=0,wppaStartHtml=[],wppaCanAjaxRender=!1,wppaCanPushState=!1,wppaAllowAjax=!0,wppaMaxOccur=0,wppaFirstOccur=0,wppaUsePhotoNamesInUrls=!1,wppaShareHideWhenRunning=!1,wppaCommentRequiredAfterVote=!0,wppaTopMoc=0,wppaColWidth=[],wppaFotomotoHideWhenRunning=!1,wppaFotomotoMinWidth=400,wppaPhotoView=[],wppaBackgroundColorImage="",wppaPopupLinkType="",wppaPopupOnclick=[],wppaThumbTargetBlank=!1,wppaRel="rel",wppaEditPhotoWidth="960",wppaThemeStyles="",wppaStickyHeaderHeight=0,wppaRenderModal=!1,wppaModalBgColor="#ffffff",wppaBoxRadius=0,wppaModalQuitImg,wppaUploadEdit="none",wppaPageArg="",wppaSlideshowNavigationType="icons",wppaCoverImageResponsive=[],wppaSearchBoxSelItems=[],wppaSlideWrap=[],_wppaId=[],_wppaAvg=[],_wppaDisc=[],_wppaMyr=[],_wppaVRU=[],_wppaLinkUrl=[],_wppaLinkTitle=[],_wppaLinkTarget=[],_wppaCommentHtml=[],_wppaIptcHtml=[],_wppaExifHtml=[],_wppaToTheSame=!1,_wppaSlides=[],_wppaNames=[],_wppaFullNames=[],_wppaDsc=[],_wppaOgDsc=[],_wppaCurIdx=[],_wppaNxtIdx=[],_wppaTimeOut=[],_wppaSSRuns=[],_wppaFg=[],_wppaTP=[],_wppaIsBusy=[],_wppaFirst=[],_wppaVoteInProgress=!1,_wppaTextDelay,_wppaUrl=[],_wppaSkipRated=[],_wppaLbTitle=[],_wppaStateCount=0,_wppaDidGoto=[],_wppaShareUrl=[],_wppaShareHtml=[],_wppaFilmNoMove=[],_wppaHiresUrl=[],_wppaIsVideo=[],_wppaVideoHtml=[],_wppaAudioHtml=[],_wppaVideoNatWidth=[],_wppaVideoNatHeight=[],_wppaWaitTexts=[],_wppaImageAlt=[],__wppaOverruleRun=!1,wppaOvlUrls,wppaOvlTitles,wppaOvlAlts,wppaOvlIdx=0,wppaOvlFirst=!0,wppaOvlKbHandler="",wppaOvlSizeHandler="",wppaOvlPadTop=5,wppaOvlIsSingle,wppaOvlRunning=!1,wppaOvlVideoHtmls,wppaOvlAudioHtmls,wppaOvlVideoNaturalWidths,wppaOvlVideoNaturalHeights,wppaOvlModeInitial="normal",wppaOvlVideoPlaying=!1,wppaOvlAudioPlaying=!1,wppaOvlShowLegenda=!0,wppaOvlShowStartStop=!0,wppaOvlRadius=0,wppaOvlBorderWidth=16,wppaOvlOpen=!1,wppaOvlTxtHeight=36,wppaOvlOpacity=.8,wppaOvlOnclickType="none",wppaOvlTheme="black",wppaOvlAnimSpeed=300,wppaOvlSlideSpeed=3e3,wppaVer4WindowWidth=800,wppaVer4WindowHeight=600,wppaOvlFontFamily="Helvetica",wppaOvlFontSize="10",wppaOvlFontColor="",wppaOvlFontWeight="bold",wppaOvlLineHeight="12",wppaOvlShowCounter=!0,wppaOvlIsVideo=!1,wppaShowLegenda="",wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlVideoStart=!1,wppaOvlAudioStart=!1,wppaLastIptc="",wppaLastExif="",wppaIsMobile=!1,wppaSvgFillcolor="gray",wppaSvgBgcolor="transparent",wppaSvgCornerStyle="light";jQuery(document).ready(function(){wppaDoInit(!1),setTimeout(function(){wppaDoInit(!0)},1e3)}),jQuery(document).ready(function(p){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var a=1;a<=wppaMaxOccur;)wppaStartHtml[a]=jQuery("#wppa-container-"+a).html(),a++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];window.onpopstate=function(p){var a=0;if(wppaCanPushState){if(p.state)switch(a=p.state.occur,p.state.type){case"html":jQuery("#wppa-container-"+a).html(p.state.html);break;case"slide":_wppaGoto(a,p.state.slide)}else if(wppaUpdateAddressLine){if(a=wppaFirstOccur,jQuery("#wppa-container-"+a).html(wppaStartHtml[a]),wppaFirstOccur=0,0==a){t=(e=document.location.href).split("&wppa-occur=");a=parseInt(t[1])}var e=document.location.href,t=e.split("&wppa-photo="),o=parseInt(t[1]);if(o>0){for(var s=0;s<_wppaId[a].length&&_wppaId[a][s]!=o;)s++;s<_wppaId[a].length&&_wppaGoto(a,s)}}document.getElementById("theslide0-"+a)&&_wppaStop(a)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;wppaConsoleLog("wppa.js version "+wppaJsVersion+" loaded.","force");
1
+ var wppaDebug,wppaAnimationSpeed,wppaImageDirectory,wppaThumbnailAreaDelta,wppaSlideShow,wppaPhoto,wppaOf,wppaNextPhoto,wppaPreviousPhoto,wppaNextP,wppaPrevP,wppaAvgRating,wppaMyRating,wppaAvgRat,wppaMyRat,wppaDislikeMsg,wppaPleaseName,wppaPleaseEmail,wppaPleaseComment,wppaModalQuitImg,_wppaTextDelay,wppaOvlUrls,wppaOvlTitles,wppaOvlAlts,wppaOvlIsSingle,wppaOvlVideoHtmls,wppaOvlAudioHtmls,wppaOvlVideoNaturalWidths,wppaOvlVideoNaturalHeights,wppaJsVersion="6.8.02",wppaVersion="0",wppaIsIe=!1,wppaUseSvg=!0,wppaFullValign=[],wppaFullHalign=[],wppaFullFrameDelta=[],wppaAutoColumnWidth=[],wppaAutoColumnFrac=[],wppaSlideShowTimeOut=2500,wppaFadeInAfterFadeOut=!1,wppaTextFrameDelta=0,wppaBoxDelta=0,wppaPreambule=[],wppaHideWhenEmpty=!1,wppaThumbnailPitch=[],wppaFilmStripLength=[],wppaFilmStripMargin=[],wppaFilmStripAreaDelta=[],wppaFilmShowGlue=!1,wppaIsMini=[],wppaPortraitOnly=[],wppaMiniTreshold=300,wppaStart="Start",wppaStop="Stop",wppaRatingOnce=!0,wppaBGcolorNumbar="transparent",wppaBcolorNumbar="transparent",wppaBGcolorNumbarActive="transparent",wppaBcolorNumbarActive="transparent",wppaFontFamilyNumbar="",wppaFontSizeNumbar="",wppaFontColorNumbar="",wppaFontWeightNumbar="",wppaFontFamilyNumbarActive="",wppaFontSizeNumbarActive="",wppaFontColorNumbarActive="",wppaFontWeightNumbarActive="",wppaNumbarMax="10",wppaAjaxUrl="",wppaLang="",wppaNextOnCallback=!1,wppaStarOpacity=.2,wppaLightBox=[],wppaEmailRequired="required",wppaSlideBorderWidth=0,wppaSlideInitRunning=[],wppaAnimationType="fadeover",wppaSlidePause=[],wppaSlideBlank=[],wppaRatingMax=5,wppaRatingDisplayType="graphic",wppaRatingPrec=2,wppaFilmPageSize=[],wppaAspectRatio=[],wppaFullSize=[],wppaStretch=!1,wppaThumbSpaceAuto=!1,wppaMinThumbSpace=4,wppaMagnifierCursor="",wppaArtMonkyLink="none",wppaAutoOpenComments=!1,wppaUpdateAddressLine=!1,wppaFilmThumbTitle="",wppaClickToView="",wppaUploadUrl="",wppaVoteForMe="",wppaVotedForMe="",wppaSlideSwipe=!0,wppaLightboxSingle=[],wppaMaxCoverWidth=300,wppaDownLoad="Download",wppaSiteUrl="",wppaWppaUrl="",wppaIncludeUrl="",wppaSlideToFullpopup=!1,wppaComAltSize=75,wppaBumpViewCount=!0,wppaBumpClickCount=!1,wppaFotomoto=!1,wppaArtMonkeyButton=!0,wppaShortQargs=!1,wppaOvlHires=!1,wppaMasonryCols=[],wppaVideoPlaying=[],wppaAudioPlaying=[],wppaSlideVideoStart=!1,wppaSlideAudioStart=!1,wppaAudioHeight=28,wppaHis=0,wppaStartHtml=[],wppaCanAjaxRender=!1,wppaCanPushState=!1,wppaAllowAjax=!0,wppaMaxOccur=0,wppaFirstOccur=0,wppaUsePhotoNamesInUrls=!1,wppaShareHideWhenRunning=!1,wppaCommentRequiredAfterVote=!0,wppaTopMoc=0,wppaColWidth=[],wppaFotomotoHideWhenRunning=!1,wppaFotomotoMinWidth=400,wppaPhotoView=[],wppaBackgroundColorImage="",wppaPopupLinkType="",wppaPopupOnclick=[],wppaThumbTargetBlank=!1,wppaRel="rel",wppaEditPhotoWidth="960",wppaThemeStyles="",wppaStickyHeaderHeight=0,wppaRenderModal=!1,wppaModalBgColor="#ffffff",wppaBoxRadius=0,wppaUploadEdit="none",wppaPageArg="",wppaSlideshowNavigationType="icons",wppaCoverImageResponsive=[],wppaSearchBoxSelItems=[],wppaSlideWrap=[],_wppaId=[],_wppaAvg=[],_wppaDisc=[],_wppaMyr=[],_wppaVRU=[],_wppaLinkUrl=[],_wppaLinkTitle=[],_wppaLinkTarget=[],_wppaCommentHtml=[],_wppaIptcHtml=[],_wppaExifHtml=[],_wppaToTheSame=!1,_wppaSlides=[],_wppaNames=[],_wppaFullNames=[],_wppaDsc=[],_wppaOgDsc=[],_wppaCurIdx=[],_wppaNxtIdx=[],_wppaTimeOut=[],_wppaSSRuns=[],_wppaFg=[],_wppaTP=[],_wppaIsBusy=[],_wppaFirst=[],_wppaVoteInProgress=!1,_wppaUrl=[],_wppaSkipRated=[],_wppaLbTitle=[],_wppaStateCount=0,_wppaDidGoto=[],_wppaShareUrl=[],_wppaShareHtml=[],_wppaFilmNoMove=[],_wppaHiresUrl=[],_wppaIsVideo=[],_wppaVideoHtml=[],_wppaAudioHtml=[],_wppaVideoNatWidth=[],_wppaVideoNatHeight=[],_wppaWaitTexts=[],_wppaImageAlt=[],__wppaOverruleRun=!1,wppaOvlIdx=0,wppaOvlFirst=!0,wppaOvlKbHandler="",wppaOvlSizeHandler="",wppaOvlPadTop=5,wppaOvlRunning=!1,wppaOvlModeInitial="normal",wppaOvlVideoPlaying=!1,wppaOvlAudioPlaying=!1,wppaOvlShowLegenda=!0,wppaOvlShowStartStop=!0,wppaOvlRadius=0,wppaOvlBorderWidth=16,wppaOvlOpen=!1,wppaOvlTxtHeight=36,wppaOvlOpacity=.8,wppaOvlOnclickType="none",wppaOvlTheme="black",wppaOvlAnimSpeed=300,wppaOvlSlideSpeed=3e3,wppaVer4WindowWidth=800,wppaVer4WindowHeight=600,wppaOvlFontFamily="Helvetica",wppaOvlFontSize="10",wppaOvlFontColor="",wppaOvlFontWeight="bold",wppaOvlLineHeight="12",wppaOvlShowCounter=!0,wppaOvlIsVideo=!1,wppaShowLegenda="",wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlVideoStart=!1,wppaOvlAudioStart=!1,wppaLastIptc="",wppaLastExif="",wppaIsMobile=!1,wppaSvgFillcolor="gray",wppaSvgBgcolor="transparent",wppaSvgCornerStyle="light";function wppaDoInit(p){var a=!1;for(mocc=1;mocc<=wppaTopMoc;mocc++)wppaAutoColumnWidth[mocc]&&(wppaColWidth[mocc]=0,_wppaDoAutocol(mocc),a=!0);p||(_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),a&&jQuery(window).resize(function(){for(mocc=1;mocc<=wppaTopMoc;mocc++)wppaAutoColumnWidth[mocc]&&(wppaColWidth[mocc]=0,_wppaDoAutocol(mocc))})),jQuery(".wppa-ajax-spin").stop().fadeOut(),setTimeout(function(){jQuery(".wppa-ajax-spin").stop().fadeOut()},1e3),jQuery(".wppa-ovl-spin").stop().fadeOut(),setTimeout(function(){jQuery(".wppa-ovl-spin").stop().fadeOut()},1e3),setTimeout(function(){for(var p=1;p<wppaTopMoc;)jQuery("ubb-"+p+"-l")&&(wppaUbb(p,"l","hide"),wppaUbb(p,"r","hide")),p++},3e3)}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(p){var a,e,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+p,t[3]="theimg1-"+p,e=0;e<3;)1==++e&&0!=p||(a=document.getElementById(t[e]))&&"function"==typeof a.pause&&(a.pause(),wppaConsoleLog("Video "+t[e]+" paused","force"))}function wppaStopAudio(p){if("number"==typeof p)jQuery("#audio-"+p).pause&&jQuery("#audio-"+p).pause();else{var a=jQuery("audio");if(a.length>0)for(var e=0;e<a.length;)"wppa"==jQuery(a[e]).attr("data-from")&&a[e].pause(),e++}}function wppaMakeFullsizeUrl(p){var a,e;(a=(p=p.replace("/thumbs/","/")).split("//"))[1]?(e=a[1].split("/"),p=a[0]+"//"):(e=a[0].split("/"),p="");for(var t=0;t<e.length;){var o=e[t];"w"!=o.split("_")[0]&&(0!=t&&(p+="/"),p+=o),t++}return p}function wppaGetContainerWidth(p){var a=document.getElementById("wppa-container-"+p),e=0;if(!wppaAutoColumnWidth[p])return a.clientWidth;for(;0==e;)a=a.parentNode,e=jQuery(a).width();return parseInt(e*wppaAutoColumnFrac[p])}function _wppaDoAutocol(p){var a;if(wppaAutoColumnWidth[p]&&(a=wppaGetContainerWidth(p),wppaColWidth[p]!=a)){wppaConsoleLog("Doing autocol "+p),wppaColWidth[p]=a,jQuery(".wppa-container-"+p).css("width",a),wppaRenderModal&&(jQuery(".ui-dialog").css("width",a),jQuery(".ui-dialog").attr("height","auto")),wppaCoverImageResponsive[p]||(jQuery(".wppa-asym-text-frame-"+p).css("width",a-wppaTextFrameDelta),jQuery(".wppa-cover-box-"+p).css("width",a));var e,t=jQuery(".wppa-cover-box-mcr-"+p);if(t.length>1){var o=parseInt((a+8)/(wppaMaxCoverWidth+8))+1,s=o-1;e=parseInt((a+8)/o-8);for(var r=0;r<t.length;){switch(r%o){case 0:jQuery(t[r]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(t[r]).css({marginLeft:"8px",clear:"none",float:"right"});break;default:jQuery(t[r]).css({marginLeft:"8px",clear:"none",float:"left"})}r++}wppaCoverImageResponsive[p]||jQuery(".wppa-asym-text-frame-mcr-"+p).css("width",e-wppaTextFrameDelta),jQuery(".wppa-cover-box-mcr-"+p).css("width",e)}else if(wppaCoverImageResponsive[p]);else{jQuery(".wppa-asym-text-frame-mcr-"+p).css("width",a-wppaTextFrameDelta);jQuery(".wppa-cover-box-mcr-"+p).css({marginLeft:"0px",float:"left"})}if(wppaThumbSpaceAuto){var i=parseInt(jQuery(".thumbnail-frame-"+p).css("width"));if(i){var n=a-wppaThumbnailAreaDelta-7,w=parseInt(n/(i+wppaMinThumbSpace)),l=parseInt(.5+(n-w*i)/(w+1));jQuery(".thumbnail-frame-"+p).css({marginLeft:l})}}jQuery(".thumbnail-frame-comalt-"+p).css("width",a-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+p).css("width",a-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,d=jQuery("#wppa-mas-h-"+c+"-"+p).attr("data-height-perc");d;)u=d*(a-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+p).css("height",u),c++,d=jQuery("#wppa-mas-h-"+c+"-"+p).attr("data-height-perc");wppaSetMasHorFrameWidthsForIeAndChrome(p),wppaFormatSlide(p),jQuery("#audio-slide-"+p).css("width",a-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+p).css("width",.7*a),wppaFilmStripLength[p]=a-wppaFilmStripAreaDelta[p],jQuery("#filmwindow-"+p).css("width",wppaFilmStripLength[p]),_wppaAdjustFilmstrip(p),wppaIsMini[p]||void 0===_wppaSlides[p]||(wppaColWidth[p]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat),jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating),jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length))),jQuery(".wppa-sphoto-"+p).css("width",a),jQuery(".wppa-simg-"+p).css("width",a-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+p).css("height",""),jQuery(".wppa-mphoto-"+p).css("width",a+10),jQuery(".wppa-mimg-"+p).css("width",a),jQuery(".wppa-mimg-"+p).css("height",""),wppaSearchBoxSelItems[p]>0&&(a/wppaSearchBoxSelItems[p]<125?jQuery(".wppa-searchsel-item-"+p).css("width","100%"):jQuery(".wppa-searchsel-item-"+p).css("width",100/wppaSearchBoxSelItems[p]+"%")),jQuery(".wppa-upload-album-"+p).css("maxWidth",.6*a)}}function wppaSetMasHorFrameWidthsForIeAndChrome(p){for(var a=jQuery(".wppa-mas-h-"+p),e=wppaMinThumbSpace,t=0;t<a.length;t++){var o=wppaGetChildI(a[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+p+" )",400);var s=o.naturalWidth/o.naturalHeight*o.height+e;jQuery(a[t]).css({width:s})}}}function wppaGetChildI(p){var a,e=p.childNodes;for(a=0;a<e.length;a++){var t=e[a];if(t.id&&"i-"==t.id.substr(0,2))return t;var o=wppaGetChildI(t);if(o)return o}return!1}jQuery(document).ready(function(){wppaDoInit(!1),setTimeout(function(){wppaDoInit(!0)},1e3)}),jQuery(document).ready(function(p){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var a=1;a<=wppaMaxOccur;)wppaStartHtml[a]=jQuery("#wppa-container-"+a).html(),a++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(p,a){if(!(wppaColWidth[p]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+p).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+p).css("display","none");jQuery("#wppa-fotomoto-container-"+p).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+p)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(a),wppaFotomotoToolbarIds[p]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+p,a)):(setTimeout("wppaFotomotoToolbar( "+p+',"'+a+'" )',200),wppaConsoleLog("Waiting for Fotomoto")))}function wppaFotomotoHide(p){jQuery("#wppa-fotomoto-container-"+p).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","none")}function wppaGetCurrentFullUrl(p,a){var e,t,o,s=document.location.href.split("?"),r="nil",i=0,n=!0;o=wppaShortQargs?"":"wppa-",s[1]&&(r=s[1].split("&"));var w=!1;if(e=s[0],"nil"!=r&&r.length>0)for(;i<r.length;)(t=r[i].split("="))[0]==o+"album"&&(w=!0),t[0]!=o+"photo"&&(e+=n?"?":"&",n=!1,e+=r[i]),i++;return w?(e+=n?"?":"&",e+=wppaUsePhotoNamesInUrls?o+"photo="+encodeURIComponent(_wppaNames[p][a]):o+"photo="+_wppaId[p][a]):""}function wppaStringContainsForbiddenChars(p){for(var a=["?","&","#","/",'"',"'"],e=0;e<a.length;){if(-1!=p.indexOf(a[e]))return!0;e++}return!1}function wppaPushStateSlide(p,a,e){if(!wppaIsMini[p]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=e)try{history.pushState({page:wppaHis,occur:p,type:"slide",slide:a},"---",e),wppaConsoleLog("Slide history stack updated")}catch(p){wppaConsoleLog("Slide history stack update failed")}}function wppaRepairScriptTags(p){if(void 0===p)return"";for(;-1!=p.indexOf("[script");)p=p.replace("[script","<script");for(;-1!=p.indexOf("[/script");)p=p.replace("[/script","</script");return p}function wppaRepairBrTags(p){return void 0===p?"":p.replace("[br /]","<br />")}function wppaTrimAlt(p){return void 0===p?"":p.length>13?p.substr(0,10)+"...":p}window.onpopstate=function(p){var a=0;if(wppaCanPushState){if(p.state)switch(a=p.state.occur,p.state.type){case"html":jQuery("#wppa-container-"+a).html(p.state.html);break;case"slide":_wppaGoto(a,p.state.slide)}else if(wppaUpdateAddressLine){if(a=wppaFirstOccur,jQuery("#wppa-container-"+a).html(wppaStartHtml[a]),wppaFirstOccur=0,0==a){var e=document.location.href.split("&wppa-occur=");a=parseInt(e[1])}e=document.location.href.split("&wppa-photo=");var t=parseInt(e[1]);if(t>0){for(var o=0;o<_wppaId[a].length&&_wppaId[a][o]!=t;)o++;o<_wppaId[a].length&&_wppaGoto(a,o)}}document.getElementById("theslide0-"+a)&&_wppaStop(a)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy?wppaConsoleLog("Fb Init busy"):"undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):(wppaConsoleLog("Fb wait"),setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(p,a){if(document.selection)p.focus(),sel=document.selection.createRange(),sel.text=a;else if(p.selectionStart||"0"==p.selectionStart){var e=p.selectionStart,t=p.selectionEnd;p.value=p.value.substring(0,e)+a+p.value.substring(t,p.value.length),p.selectionStart=e+a.length,p.selectionEnd=e+a.length}else p.value+=a}function wppaGeoInit(p,a,e){var t=new google.maps.LatLng(a,e),o={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:10,center:t},s=new google.maps.Map(document.getElementById("map-canvas-"+p),o),r=new google.maps.Marker({position:t,map:s,title:""});google.maps.event.addListener(s,"center_changed",function(){window.setTimeout(function(){s.panTo(r.getPosition())},1e3)})}function wppaEncode(p){var a;if(void 0!==p){var e=(a=(a=p.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),t=0;for(a="";t<e.length;)a+=e[t],++t<e.length&&(a+="||PLUS||");return a}}function wppaUrlToId(p){var a=p.split("/wppa/");return 1==a.length&&(a=p.split("/upload/")),1==a.length?0:a=(a=(a=(a=(a=(a=(a=a[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(p,a){jQuery("#wppa-ss-albumopt-"+p).css("display","none"),jQuery("#wppa-ss-albumcat-"+p).css("display","none"),jQuery("#wppa-ss-albumname-"+p).css("display","none"),jQuery("#wppa-ss-albumtext-"+p).css("display","none"),jQuery("#wppa-ss-photoopt-"+p).css("display","none"),jQuery("#wppa-ss-photoname-"+p).css("display","none"),jQuery("#wppa-ss-photoowner-"+p).css("display","none"),jQuery("#wppa-ss-phototag-"+p).css("display","none"),jQuery("#wppa-ss-phototext-"+p).css("display","none"),jQuery("#wppa-ss-photoexif-"+p).css("display","none"),jQuery("#wppa-ss-photoiptc-"+p).css("display","none"),jQuery("#wppa-ss-exifopts-"+p).css("display","none"),jQuery("#wppa-ss-iptcopts-"+p).css("display","none"),jQuery("#wppa-ss-spinner-"+p).css("display","none"),jQuery("#wppa-ss-button-"+p).css("display","none");var e=jQuery("#wppa-ss-pa-"+p).val(),t="",o="",s="";switch(e){case"a":switch(jQuery("#wppa-ss-albumopt-"+p).css("display",""),t=jQuery("#wppa-ss-albumopt-"+p).val()){case"c":jQuery("#wppa-ss-albumcat-"+p).css("display","");var r=jQuery(".wppa-ss-albumcat-"+p);for(s="",i=0;i<r.length;i++)"selected"==jQuery(r[i]).attr("selected")&&(s+="."+jQuery(r[i]).val());""!=(s=s.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+p).css("display",""),null!=(s=jQuery("#wppa-ss-albumname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+p).css("display","");r=jQuery(".wppa-ss-albumtext-"+p);for(s="",i=0;i<r.length;i++)"selected"==jQuery(r[i]).attr("selected")&&(s+="."+jQuery(r[i]).val());""!=(s=s.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+p).css("display",""),t=jQuery("#wppa-ss-photoopt-"+p).val()){case"n":jQuery("#wppa-ss-photoname-"+p).css("display",""),null!=(s=jQuery("#wppa-ss-photoname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+p).css("display",""),null!=(s=jQuery("#wppa-ss-photoowner-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+p).css("display","");r=jQuery(".wppa-ss-phototag-"+p);for(s="",i=0;i<r.length;i++)"selected"==jQuery(r[i]).attr("selected")&&(s+="."+jQuery(r[i]).val());""!=(s=s.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+p).css("display","");var i;r=jQuery(".wppa-ss-phototext-"+p);for(s="",i=0;i<r.length;i++)"selected"==jQuery(r[i]).attr("selected")&&(s+="."+jQuery(r[i]).val());""!=(s=s.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+p).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+p).val())&&(o.length>2&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(p,o,"wppa-ss-iptcopts-"+p),wppaLastIptc=o):null!=(s=jQuery("#wppa-ss-iptcopts-"+p).val())&&""!=s&&jQuery("#wppa-ss-button-"+p).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+p).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+p).val())&&(o.length>2&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(p,o,"wppa-ss-exifopts-"+p),wppaLastExif=o):null!=(s=jQuery("#wppa-ss-exifopts-"+p).val())&&""!=s&&jQuery("#wppa-ss-button-"+p).css("display","")))}}if(a){var n=jQuery("#wppa-ss-pageurl-"+p).val();-1==n.indexOf("?")?n+="?":n+="&",n+="occur=1&wppa-supersearch="+e+","+t+","+o+","+s,document.location.href=n}}function wppaAjaxGetSsIptcList(p,a,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssiptclist&tag="+a+"&moccur="+p,async:!0,type:"GET",timeout:1e4,beforeSend:function(a){jQuery("#wppa-ss-spinner-"+p).css("display","")},success:function(a,t,o){jQuery("#"+e).html(a),jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaSuperSearchSelect(p),setTimeout('wppaSetIptcExifSize( ".wppa-iptclist-'+p+'", "#'+e+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsIptcList failed. Error = "+e+", status = "+a,"force")},complete:function(a,e,t){jQuery("#wppa-ss-spinner-"+p).css("display","none")}})}function wppaAjaxGetSsExifList(p,a,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssexiflist&tag="+a+"&moccur="+p,async:!0,type:"GET",timeout:1e4,beforeSend:function(a){jQuery("#wppa-ss-spinner-"+p).css("display","")},success:function(a,t,o){jQuery("#"+e).html(a),jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaSuperSearchSelect(p),setTimeout('wppaSetIptcExifSize( ".wppa-exiflist-'+p+'", "#'+e+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsExifList failed. Error = "+e+", status = "+a,"force")},complete:function(a,e,t){jQuery("#wppa-ss-spinner-"+p).css("display","none")}})}function wppaSetIptcExifSize(p,a){var e=jQuery(p).length;e>6&&(e=6),e<2&&(e=2),jQuery(a).attr("size",e)}function wppaUpdateSearchRoot(p,a){for(var e=jQuery(".wppa-search-root"),t=0;t<e.length;)jQuery(e[t]).html(p),t++;for(e=jQuery(".wppa-rootbox"),t=0;t<e.length;)a?(jQuery(e[t]).removeAttr("checked"),jQuery(e[t]).removeAttr("disabled")):(jQuery(e[t]).attr("checked","checked"),jQuery(e[t]).attr("disabled","disabled")),t++;for(e=jQuery(".wppa-search-root-id"),t=0;t<e.length;)jQuery(e[t]).val(a),t++}function wppaSubboxChange(p){if("checked"==jQuery(p).attr("checked"))for(var a=jQuery(".wppa-rootbox"),e=0;e<a.length;)jQuery(a[e]).attr("checked","checked"),e++}function wppaClearSubsearch(){for(var p=jQuery(".wppa-display-searchstring"),a=0;a<p.length;)jQuery(p[a]).html(""),a++;for(p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).attr("disabled","disabled"),a++}function wppaEnableSubsearch(){for(var p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).removeAttr("disabled"),a++}function wppaDisplaySelectedFiles(p){for(var a=jQuery("#"+p),e=0,t="";e<a[0].files.length;)t+=a[0].files[e].name+" ",e++;jQuery("#"+p+"-display").val(t)}function wppaIsEmpty(p){return null==p||(void 0===p||(""==p||(0==p||(0==p||void 0))))}wppaConsoleLog("wppa.js version "+wppaJsVersion+" loaded.","force");
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.01
6
- Stable tag: 6.8.00
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -127,6 +127,35 @@ If this happens, make sure (ask your hosting provider) that you have all the rig
127
 
128
  See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  = 6.8.01 =
131
 
132
  = Bug Fixes =
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.02
6
+ Stable tag: 6.8.01
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
127
 
128
  See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
129
 
130
+ = 6.8.02 =
131
+
132
+ = Bug Fixes =
133
+
134
+ * Sourcefiles got erroneoulsy removed in certain circumstances.
135
+ This happened when there were two or more photos with the same name in an album and one got deleted.
136
+ This also happened when a photo was deleted and re-uploaded before the background process actually removed the files of the deleted photo.
137
+ This issue has been fixed.
138
+ * w#hrurl and w#pl in photo descriptions got wrong results when the filename contained spaces or brackets. Fixed.
139
+ * Fixes for compatibility with plugin Simple Cart & By Now. This plugin is not maintained for over three years.
140
+ If you update to wppa version 6.8.02 and use SCABN, you MUST install the special - fixed - version to maintain compatibility.
141
+
142
+ = New Features =
143
+
144
+ * Table VII-B4: Fe limts per album. If this box is ticked, the upload limits set for userroles apply to each album individually where the user has frontend oploads to.
145
+ * You can now add browser specific css. Table IV-A15.x.
146
+ * If the user has the right to import, there is a button on the album admin screen to import to the album, like the upload to this album button.
147
+ * Added links to upload and import pages on the album admin main page, dependant of user rights.
148
+
149
+ = Other Changes =
150
+
151
+ * On most installations you will no longer see failed uploads due to memory limitations.
152
+ When there is not enough memory to downsize photos or to apply watermarks, downsizing will be skipped.
153
+ Note that in those cases one can have copies of the original photofiles as thumbnail images.
154
+ If this happens often, it is rcommended to set an upload size limit in Table VII-B10.2 to force users to upload smaller images,
155
+ or to ask the hosting provider to increase the available sever memory.
156
+ * Created a fixed version of plugin Simple Cart & Buy Now. You will need this special version if you previously used Simple Cart & Buy Now in combination with wppa.
157
+ Download it <a href="https://wppa.nl/wp-content/uploads/simple-cart-buy-now-for-wppa.zip" >here</a>
158
+
159
  = 6.8.01 =
160
 
161
  = Bug Fixes =
wppa-ajax.php CHANGED
@@ -21,7 +21,7 @@ global $wppa_log_file;
21
  wppa( 'out', '' );
22
  $wppa_session['page']--;
23
  $wppa_session['ajax']++;
24
- wppa_save_session();
25
 
26
  // ALTHOUGH IF WE ARE HERE AS FRONT END VISITOR, is_admin() is true.
27
  // So, $wppa_opt switches are 'yes' or 'no' and not true or false.
21
  wppa( 'out', '' );
22
  $wppa_session['page']--;
23
  $wppa_session['ajax']++;
24
+ // wppa_save_session();
25
 
26
  // ALTHOUGH IF WE ARE HERE AS FRONT END VISITOR, is_admin() is true.
27
  // So, $wppa_opt switches are 'yes' or 'no' and not true or false.
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 6.8.01
7
  *
8
  */
9
 
@@ -1123,6 +1123,31 @@ function wppaTryScheduleAll( id ) {
1123
  ' />';
1124
  }
1125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1126
  echo
1127
  '</td>' .
1128
  '</tr>' .
@@ -1268,7 +1293,7 @@ function wppaTryScheduleAll( id ) {
1268
  $style = get_option('wppa_album_table_'.wppa_get_user(), 'flat');
1269
  }
1270
  else $style = 'flat';
1271
-
1272
  // The Manage Album page
1273
  ?>
1274
  <div class="wrap">
@@ -1289,7 +1314,7 @@ function wppaTryScheduleAll( id ) {
1289
  echo '</form>';
1290
  }
1291
  // The switch to button(s)
1292
- if ( wppa_extended_access() ) {
1293
  if ( $style == 'flat' ) { ?>
1294
  <input type="button" class="button-secundary" onclick="document.location='<?php echo wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;switchto=collapsible') ?>'" value="<?php _e('Switch to Collapsable table', 'wp-photo-album-plus'); ?>" />
1295
  <?php }
@@ -1322,7 +1347,8 @@ function wppaTryScheduleAll( id ) {
1322
  value="<?php _e('Close all', 'wp-photo-album-plus'); ?>"
1323
  />
1324
  <?php }
1325
- } ?>
 
1326
 
1327
  <br />
1328
  <?php // The table of existing albums
@@ -1528,6 +1554,14 @@ global $wpdb;
1528
  <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
1529
  <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
1530
  <td ><?php _e('Seq', 'wp-photo-album-plus'); ?></td>
 
 
 
 
 
 
 
 
1531
  <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
1532
  <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
1533
  </tr>
@@ -1536,11 +1570,11 @@ global $wpdb;
1536
  <?php $alt = ' class="alternate" '; ?>
1537
 
1538
  <?php
1539
- // foreach ($albums as $album) if(wppa_have_access($album)) {
1540
  $idx = '0';
1541
- foreach (array_keys($seq) as $s) {
1542
  $album = $albums[$s];
1543
- if (wppa_have_access($album)) {
 
1544
  $counts = wppa_get_treecounts_a($album['id'], true);
1545
  $pendcount = $counts['pendselfphotos'];
1546
  // $pendcount = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `".WPPA_PHOTOS."` WHERE album=%s AND status=%s", $album['id'], 'pending'));
@@ -1560,12 +1594,20 @@ global $wpdb;
1560
  <?php $nm = $counts['pendselfphotos']; ?>
1561
  <?php $ns = $counts['scheduledselfphotos']; ?>
1562
  <td><?php echo $na.'/'.$np.'/'.$nm.'/'.$ns; ?></td>
1563
- <?php if ( $album['owner'] != '--- public ---' || wppa_user_is('administrator') ) { ?>
1564
  <?php $url = wppa_ea_url($album['id']) ?>
1565
  <td><a href="<?php echo($url) ?>" class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?></a></td>
1566
  <td><a href="<?php echo($url.'&amp;quick') ?>" class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?></a></td>
1567
  <td><a href="<?php echo($url.'&amp;bulk#manage-photos') ?>" class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?></a></td>
1568
  <td><a href="<?php echo($url.'&amp;seq') ?>" class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?></a></td>
 
 
 
 
 
 
 
 
1569
 
1570
  <?php $url = wppa_ea_url($album['id'], 'del') ?>
1571
  <td><a href="<?php echo($url) ?>" class="wppadelete"><?php _e('Delete', 'wp-photo-album-plus'); ?></a></td>
@@ -1579,10 +1621,8 @@ global $wpdb;
1579
  echo '<td><a href="'.$url.'" class="wppacreate">'.__('Create', 'wp-photo-album-plus').'</a></td>';
1580
  }
1581
  }
1582
- }
1583
- else { ?>
1584
- <td></td><td></td><?php if ( wppa_can_create_album() ) echo '<td></td' ?>
1585
- <?php } ?>
1586
  </tr>
1587
  <?php if ($alt == '') { $alt = ' class="alternate" '; } else { $alt = '';}
1588
  }
@@ -1666,6 +1706,14 @@ global $wpdb;
1666
  <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
1667
  <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
1668
  <td ><?php _e('Seq', 'wp-photo-album-plus'); ?></td>
 
 
 
 
 
 
 
 
1669
  <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
1670
  <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
1671
  </tr>
@@ -1901,6 +1949,14 @@ global $wpdb;
1901
  <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
1902
  <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
1903
  <td ><?php _e('Seq', 'wp-photo-album-plus'); ?></td>
 
 
 
 
 
 
 
 
1904
  <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
1905
  <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
1906
  </tr>
@@ -1910,7 +1966,11 @@ global $wpdb;
1910
  <?php wppa_do_albumlist('0', '0', $albums, $seq); ?>
1911
  <?php if ( $wpdb->get_var( "SELECT COUNT(*) FROM `".WPPA_ALBUMS."` WHERE `a_parent` = '-1'" ) > 0 ) { ?>
1912
  <tr>
1913
- <td colspan="19" ><em><?php _e('The following albums are ---separate--- and do not show up in the generic album display', 'wp-photo-album-plus'); ?></em></td>
 
 
 
 
1914
  </tr>
1915
  <?php wppa_do_albumlist('-1', '0', $albums, $seq); ?>
1916
  <?php }
@@ -1997,6 +2057,14 @@ global $wpdb;
1997
  <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
1998
  <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
1999
  <td ><?php _e('Seq', 'wp-photo-album-plus'); ?></td>
 
 
 
 
 
 
 
 
2000
  <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
2001
  <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
2002
  </tr>
@@ -2040,10 +2108,11 @@ function wppa_search_edit( $collapsible = false ) {
2040
 
2041
  $result =
2042
  '<tr>' .
2043
- '<td colspan="' . ( $collapsible ? 19 : 13 ) . '" >' .
2044
  '<em>' .
2045
  __( 'Search for photos to edit', 'wp-photo-album-plus' ) .
2046
  '</em>' .
 
2047
  '<small>' .
2048
  __( 'Enter search words seperated by commas. Photos will meet all search words by their names, descriptions, translated keywords and/or tags.', 'wp-photo-album-plus' ) .
2049
  '</small>' .
@@ -2090,6 +2159,7 @@ function wppa_search_edit( $collapsible = false ) {
2090
  '</a>' .
2091
  '</td>' .
2092
  '<td></td><td></td><td></td>' .
 
2093
  '</tr>';
2094
 
2095
  echo $result;
@@ -2195,15 +2265,16 @@ global $wpdb;
2195
  echo $result;
2196
  }
2197
 
2198
- function wppa_do_albumlist($parent, $nestinglevel, $albums, $seq) {
2199
  global $wpdb;
2200
 
2201
  $alt = true;
2202
 
2203
- foreach (array_keys($seq) as $s) { // Obey the global sequence
2204
  $album = $albums[$s];
2205
  if ( $album['a_parent'] == $parent ) {
2206
- if (wppa_have_access($album)) {
 
2207
  $counts = wppa_get_treecounts_a($album['id'], true);
2208
  $pendcount = $counts['pendselfphotos'];
2209
  $schedulecount = $counts['scheduledselfphotos'];
@@ -2222,7 +2293,6 @@ global $wpdb;
2222
  if ( $alt ) $class .= ' alternate';
2223
  $style = '';
2224
  if ( $pendcount ) $style .= 'background-color:#ffdddd; ';
2225
- // if ( $haschildren ) $style .= 'font-weight:bold; ';
2226
  if ( $parent != '0' && $parent != '-1' ) $style .= 'display:none; ';
2227
  $onclickon = 'jQuery(\'.wppa-alb-on-'.$album['id'].'\').css(\'display\',\'\'); jQuery(\'#alb-arrow-on-'.$album['id'].'\').css(\'display\',\'none\'); jQuery(\'#alb-arrow-off-'.$album['id'].'\').css(\'display\',\'\');';
2228
  $onclickoff = 'jQuery(\'.wppa-alb-off-'.$album['id'].'\').css(\'display\',\'none\'); jQuery(\'#alb-arrow-on-'.$album['id'].'\').css(\'display\',\'\'); jQuery(\'#alb-arrow-off-'.$album['id'].'\').css(\'display\',\'none\'); checkArrows();';
@@ -2263,13 +2333,21 @@ global $wpdb;
2263
  <?php $nm = $counts['pendselfphotos']; ?>
2264
  <?php $ns = $counts['scheduledselfphotos']; ?>
2265
  <td><?php echo $na.'/'.$np.'/'.$nm.'/'.$ns; ?></td>
 
2266
  <?php if ( $album['owner'] != '--- public ---' || wppa_user_is('administrator') ) { ?>
2267
  <?php $url = wppa_ea_url($album['id']) ?>
2268
  <td><a href="<?php echo($url) ?>" class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?></a></td>
2269
  <td><a href="<?php echo($url.'&amp;quick') ?>" class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?></a></td>
2270
  <td><a href="<?php echo($url.'&amp;bulk#manage-photos') ?>" class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?></a></td>
2271
  <td><a href="<?php echo($url.'&amp;seq') ?>" class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?></a></td>
2272
-
 
 
 
 
 
 
 
2273
  <?php $url = wppa_ea_url($album['id'], 'del') ?>
2274
  <td><a href="<?php echo($url) ?>" class="wppadelete"><?php _e('Delete', 'wp-photo-album-plus'); ?></a></td>
2275
  <?php if ( wppa_can_create_album() ) {
@@ -2283,9 +2361,13 @@ global $wpdb;
2283
  }
2284
  }
2285
  }
2286
- else { ?>
2287
- <td></td><td></td><?php if ( wppa_can_create_album() ) echo '<td></td' ?>
2288
- <?php } ?>
 
 
 
 
2289
  </tr>
2290
  <?php if ($alt == '') { $alt = ' class="alternate" '; } else { $alt = '';}
2291
  if ( $haschildren ) wppa_do_albumlist($album['id'], $nestinglevel+'1', $albums, $seq);
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 6.8.02
7
  *
8
  */
9
 
1123
  ' />';
1124
  }
1125
 
1126
+ // Goto Import
1127
+ if ( current_user_can( 'wppa_import' ) ) {
1128
+ $a = wppa_allow_uploads( $id );
1129
+ if ( $a ) {
1130
+ $full = false;
1131
+ }
1132
+ else {
1133
+ $full = true;
1134
+ }
1135
+ $onc = ( $full ?
1136
+ 'alert(\''.__('Change the upload limit or remove photos to enable new imports.', 'wp-photo-album-plus').'\')' :
1137
+ 'document.location = \''.wppa_dbg_url(get_admin_url()).'/admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\''
1138
+ );
1139
+ $val = ( $full ?
1140
+ __( 'Album is full', 'wp-photo-album-plus' ) :
1141
+ __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' )
1142
+ );
1143
+ echo
1144
+ '<input' .
1145
+ ' type="button"' .
1146
+ ' onclick="' . $onc . '"' .
1147
+ ' value="' . $val .'"' .
1148
+ ' />';
1149
+ }
1150
+
1151
  echo
1152
  '</td>' .
1153
  '</tr>' .
1293
  $style = get_option('wppa_album_table_'.wppa_get_user(), 'flat');
1294
  }
1295
  else $style = 'flat';
1296
+ $style='tree'; // debug
1297
  // The Manage Album page
1298
  ?>
1299
  <div class="wrap">
1314
  echo '</form>';
1315
  }
1316
  // The switch to button(s)
1317
+ // if ( wppa_extended_access() ) {
1318
  if ( $style == 'flat' ) { ?>
1319
  <input type="button" class="button-secundary" onclick="document.location='<?php echo wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;switchto=collapsible') ?>'" value="<?php _e('Switch to Collapsable table', 'wp-photo-album-plus'); ?>" />
1320
  <?php }
1347
  value="<?php _e('Close all', 'wp-photo-album-plus'); ?>"
1348
  />
1349
  <?php }
1350
+ // }
1351
+ ?>
1352
 
1353
  <br />
1354
  <?php // The table of existing albums
1554
  <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
1555
  <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
1556
  <td ><?php _e('Seq', 'wp-photo-album-plus'); ?></td>
1557
+ <?php
1558
+ if ( current_user_can( 'wppa_upload' ) ) {
1559
+ echo '<td >' . __('Upload', 'wp-photo-album-plus') . '</td>';
1560
+ }
1561
+ if ( current_user_can( 'wppa_import' ) ) {
1562
+ echo '<td >' . __('Import', 'wp-photo-album-plus') . '</td>';
1563
+ }
1564
+ ?>
1565
  <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
1566
  <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
1567
  </tr>
1570
  <?php $alt = ' class="alternate" '; ?>
1571
 
1572
  <?php
 
1573
  $idx = '0';
1574
+ foreach ( array_keys( $seq ) as $s ) {
1575
  $album = $albums[$s];
1576
+
1577
+ if ( wppa_have_access( $album ) && ( wppa_user_is( 'administrator' ) || $album['owner'] != '--- public ---' ) ) {
1578
  $counts = wppa_get_treecounts_a($album['id'], true);
1579
  $pendcount = $counts['pendselfphotos'];
1580
  // $pendcount = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `".WPPA_PHOTOS."` WHERE album=%s AND status=%s", $album['id'], 'pending'));
1594
  <?php $nm = $counts['pendselfphotos']; ?>
1595
  <?php $ns = $counts['scheduledselfphotos']; ?>
1596
  <td><?php echo $na.'/'.$np.'/'.$nm.'/'.$ns; ?></td>
1597
+
1598
  <?php $url = wppa_ea_url($album['id']) ?>
1599
  <td><a href="<?php echo($url) ?>" class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?></a></td>
1600
  <td><a href="<?php echo($url.'&amp;quick') ?>" class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?></a></td>
1601
  <td><a href="<?php echo($url.'&amp;bulk#manage-photos') ?>" class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?></a></td>
1602
  <td><a href="<?php echo($url.'&amp;seq') ?>" class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?></a></td>
1603
+ <?php
1604
+ if ( current_user_can( 'wppa_upload' ) ) {
1605
+ echo '<td ><a href="' . get_admin_url().'/admin.php?page=wppa_upload_photos&wppa-set-album='.$album['id'] . '" class="wppaedit" >' . __('Upload', 'wp-photo-album-plus') . '</a></td>';
1606
+ }
1607
+ if ( current_user_can( 'wppa_import' ) ) {
1608
+ echo '<td ><a href="' . get_admin_url().'/admin.php?page=wppa_import_photos&wppa-set-album='.$album['id'] . '" class="wppaedit" >' . __('Import', 'wp-photo-album-plus') . '</a></td>';
1609
+ }
1610
+ ?>
1611
 
1612
  <?php $url = wppa_ea_url($album['id'], 'del') ?>
1613
  <td><a href="<?php echo($url) ?>" class="wppadelete"><?php _e('Delete', 'wp-photo-album-plus'); ?></a></td>
1621
  echo '<td><a href="'.$url.'" class="wppacreate">'.__('Create', 'wp-photo-album-plus').'</a></td>';
1622
  }
1623
  }
1624
+
1625
+ ?>
 
 
1626
  </tr>
1627
  <?php if ($alt == '') { $alt = ' class="alternate" '; } else { $alt = '';}
1628
  }
1706
  <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
1707
  <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
1708
  <td ><?php _e('Seq', 'wp-photo-album-plus'); ?></td>
1709
+ <?php
1710
+ if ( current_user_can( 'wppa_upload' ) ) {
1711
+ echo '<td >' . __('Upload', 'wp-photo-album-plus') . '</td>';
1712
+ }
1713
+ if ( current_user_can( 'wppa_import' ) ) {
1714
+ echo '<td >' . __('Import', 'wp-photo-album-plus') . '</td>';
1715
+ }
1716
+ ?>
1717
  <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
1718
  <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
1719
  </tr>
1949
  <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
1950
  <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
1951
  <td ><?php _e('Seq', 'wp-photo-album-plus'); ?></td>
1952
+ <?php
1953
+ if ( current_user_can( 'wppa_upload' ) ) {
1954
+ echo '<td >' . __('Upload', 'wp-photo-album-plus') . '</td>';
1955
+ }
1956
+ if ( current_user_can( 'wppa_import' ) ) {
1957
+ echo '<td >' . __('Import', 'wp-photo-album-plus') . '</td>';
1958
+ }
1959
+ ?>
1960
  <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
1961
  <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
1962
  </tr>
1966
  <?php wppa_do_albumlist('0', '0', $albums, $seq); ?>
1967
  <?php if ( $wpdb->get_var( "SELECT COUNT(*) FROM `".WPPA_ALBUMS."` WHERE `a_parent` = '-1'" ) > 0 ) { ?>
1968
  <tr>
1969
+ <td colspan="<?php echo ( '19' + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) ?>" >
1970
+ <em>
1971
+ <?php _e('The following albums are ---separate--- and do not show up in the generic album display', 'wp-photo-album-plus'); ?>
1972
+ </em>
1973
+ </td>
1974
  </tr>
1975
  <?php wppa_do_albumlist('-1', '0', $albums, $seq); ?>
1976
  <?php }
2057
  <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
2058
  <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
2059
  <td ><?php _e('Seq', 'wp-photo-album-plus'); ?></td>
2060
+ <?php
2061
+ if ( current_user_can( 'wppa_upload' ) ) {
2062
+ echo '<td >' . __('Upload', 'wp-photo-album-plus') . '</td>';
2063
+ }
2064
+ if ( current_user_can( 'wppa_import' ) ) {
2065
+ echo '<td >' . __('Import', 'wp-photo-album-plus') . '</td>';
2066
+ }
2067
+ ?>
2068
  <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
2069
  <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
2070
  </tr>
2108
 
2109
  $result =
2110
  '<tr>' .
2111
+ '<td colspan="' . ( ( $collapsible ? '19' : '13' ) + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) . '" >' .
2112
  '<em>' .
2113
  __( 'Search for photos to edit', 'wp-photo-album-plus' ) .
2114
  '</em>' .
2115
+ ' ' .
2116
  '<small>' .
2117
  __( 'Enter search words seperated by commas. Photos will meet all search words by their names, descriptions, translated keywords and/or tags.', 'wp-photo-album-plus' ) .
2118
  '</small>' .
2159
  '</a>' .
2160
  '</td>' .
2161
  '<td></td><td></td><td></td>' .
2162
+ '<td colspan="' . ( ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) . '"></td>' .
2163
  '</tr>';
2164
 
2165
  echo $result;
2265
  echo $result;
2266
  }
2267
 
2268
+ function wppa_do_albumlist( $parent, $nestinglevel, $albums, $seq ) {
2269
  global $wpdb;
2270
 
2271
  $alt = true;
2272
 
2273
+ foreach ( array_keys( $seq ) as $s ) { // Obey the global sequence
2274
  $album = $albums[$s];
2275
  if ( $album['a_parent'] == $parent ) {
2276
+ if ( wppa_have_access( $album ) ) {
2277
+
2278
  $counts = wppa_get_treecounts_a($album['id'], true);
2279
  $pendcount = $counts['pendselfphotos'];
2280
  $schedulecount = $counts['scheduledselfphotos'];
2293
  if ( $alt ) $class .= ' alternate';
2294
  $style = '';
2295
  if ( $pendcount ) $style .= 'background-color:#ffdddd; ';
 
2296
  if ( $parent != '0' && $parent != '-1' ) $style .= 'display:none; ';
2297
  $onclickon = 'jQuery(\'.wppa-alb-on-'.$album['id'].'\').css(\'display\',\'\'); jQuery(\'#alb-arrow-on-'.$album['id'].'\').css(\'display\',\'none\'); jQuery(\'#alb-arrow-off-'.$album['id'].'\').css(\'display\',\'\');';
2298
  $onclickoff = 'jQuery(\'.wppa-alb-off-'.$album['id'].'\').css(\'display\',\'none\'); jQuery(\'#alb-arrow-on-'.$album['id'].'\').css(\'display\',\'\'); jQuery(\'#alb-arrow-off-'.$album['id'].'\').css(\'display\',\'none\'); checkArrows();';
2333
  <?php $nm = $counts['pendselfphotos']; ?>
2334
  <?php $ns = $counts['scheduledselfphotos']; ?>
2335
  <td><?php echo $na.'/'.$np.'/'.$nm.'/'.$ns; ?></td>
2336
+
2337
  <?php if ( $album['owner'] != '--- public ---' || wppa_user_is('administrator') ) { ?>
2338
  <?php $url = wppa_ea_url($album['id']) ?>
2339
  <td><a href="<?php echo($url) ?>" class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?></a></td>
2340
  <td><a href="<?php echo($url.'&amp;quick') ?>" class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?></a></td>
2341
  <td><a href="<?php echo($url.'&amp;bulk#manage-photos') ?>" class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?></a></td>
2342
  <td><a href="<?php echo($url.'&amp;seq') ?>" class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?></a></td>
2343
+ <?php
2344
+ if ( current_user_can( 'wppa_upload' ) ) {
2345
+ echo '<td ><a href="' . get_admin_url().'/admin.php?page=wppa_upload_photos&wppa-set-album='.$album['id'] . '" class="wppaedit" >' . __('Upload', 'wp-photo-album-plus') . '</a></td>';
2346
+ }
2347
+ if ( current_user_can( 'wppa_import' ) ) {
2348
+ echo '<td ><a href="' . get_admin_url().'/admin.php?page=wppa_import_photos&wppa-set-album='.$album['id'] . '" class="wppaedit" >' . __('Import', 'wp-photo-album-plus') . '</a></td>';
2349
+ }
2350
+ ?>
2351
  <?php $url = wppa_ea_url($album['id'], 'del') ?>
2352
  <td><a href="<?php echo($url) ?>" class="wppadelete"><?php _e('Delete', 'wp-photo-album-plus'); ?></a></td>
2353
  <?php if ( wppa_can_create_album() ) {
2361
  }
2362
  }
2363
  }
2364
+ else {
2365
+ if ( wppa_can_create_album() ) echo '<td></td>';
2366
+ if ( current_user_can( 'wppa_upload' ) ) echo '<td></td>';
2367
+ if ( current_user_can( 'wppa_import' ) ) echo '<td></td>';
2368
+ echo '<td></td><td></td><td></td><td></td><td></td>';
2369
+ } ?>
2370
+
2371
  </tr>
2372
  <?php if ($alt == '') { $alt = ' class="alternate" '; } else { $alt = '';}
2373
  if ( $haschildren ) wppa_do_albumlist($album['id'], $nestinglevel+'1', $albums, $seq);
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 6.8.01
7
  *
8
  */
9
 
@@ -132,7 +132,7 @@ function wppa_get_search_html( $label = '', $sub = false, $rt = false, $force_ro
132
  global $wppa_session;
133
 
134
  $wppa_session['has_searchbox'] = true;
135
- wppa_save_session();
136
 
137
  if ( ! $page ) {
138
  $page = wppa_get_the_landing_page( 'search_linkpage',
@@ -2440,7 +2440,14 @@ static $albums_granted;
2440
  // The result is: $alb is either an album id, or an array of album ids. Always with upload access.
2441
 
2442
  // Find max files for the user
2443
- $allow_me = wppa_allow_user_uploads();
 
 
 
 
 
 
 
2444
  if ( ! $allow_me ) {
2445
  if ( wppa_switch( 'show_album_full' ) ) {
2446
  $result .=
@@ -2589,6 +2596,7 @@ static $albums_granted;
2589
  '<select' .
2590
  ' id="wppa-upload-album-'.$mocc.'-'.$seqno.'"' .
2591
  ' name="wppa-upload-album"' .
 
2592
  ' style="max-width: 100%;"' .
2593
  ' onchange="jQuery( \'#wppa-sel-'.$yalb.'-'.$mocc.'\' ).trigger( \'onchange\' )"' .
2594
  ' >' .
@@ -2749,6 +2757,7 @@ static $albums_granted;
2749
  sprintf( __( 'Max photo size: %d pixels', 'wp-photo-album-plus' ), $maxsize ) .
2750
  '</div>';
2751
  }
 
2752
  else {
2753
  $maxsize = wppa_check_memory_limit( false );
2754
  if ( is_array( $maxsize ) ) {
@@ -2760,6 +2769,7 @@ static $albums_granted;
2760
  '</div>';
2761
  }
2762
  }
 
2763
  $supp = $wppa_supported_photo_extensions;
2764
  $body .=
2765
  '<div style="font-size:10px;" >' .
@@ -2829,7 +2839,8 @@ static $albums_granted;
2829
  ' >' .
2830
  __( 'Position:', 'wp-photo-album-plus' ) .
2831
  '</td>' .
2832
- ( $small ? '</tr><tr>' : '' ) .
 
2833
  '<td' .
2834
  ' class="wppa-box-text wppa-td"' .
2835
  ' style="width: '.$width.';'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'"' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 6.8.02
7
  *
8
  */
9
 
132
  global $wppa_session;
133
 
134
  $wppa_session['has_searchbox'] = true;
135
+ // wppa_save_session();
136
 
137
  if ( ! $page ) {
138
  $page = wppa_get_the_landing_page( 'search_linkpage',
2440
  // The result is: $alb is either an album id, or an array of album ids. Always with upload access.
2441
 
2442
  // Find max files for the user
2443
+ if ( wppa_is_int( $xalb ) ) {
2444
+ $a = $xalb;
2445
+ }
2446
+ else {
2447
+ $a = '';
2448
+ }
2449
+ $allow_me = wppa_allow_user_uploads( $a );
2450
+
2451
  if ( ! $allow_me ) {
2452
  if ( wppa_switch( 'show_album_full' ) ) {
2453
  $result .=
2596
  '<select' .
2597
  ' id="wppa-upload-album-'.$mocc.'-'.$seqno.'"' .
2598
  ' name="wppa-upload-album"' .
2599
+ ' class="wppa-upload-album-'.$mocc.'"' .
2600
  ' style="max-width: 100%;"' .
2601
  ' onchange="jQuery( \'#wppa-sel-'.$yalb.'-'.$mocc.'\' ).trigger( \'onchange\' )"' .
2602
  ' >' .
2757
  sprintf( __( 'Max photo size: %d pixels', 'wp-photo-album-plus' ), $maxsize ) .
2758
  '</div>';
2759
  }
2760
+ /*
2761
  else {
2762
  $maxsize = wppa_check_memory_limit( false );
2763
  if ( is_array( $maxsize ) ) {
2769
  '</div>';
2770
  }
2771
  }
2772
+ */
2773
  $supp = $wppa_supported_photo_extensions;
2774
  $body .=
2775
  '<div style="font-size:10px;" >' .
2839
  ' >' .
2840
  __( 'Position:', 'wp-photo-album-plus' ) .
2841
  '</td>' .
2842
+ '</tr>' .
2843
+ '<tr>' .
2844
  '<td' .
2845
  ' class="wppa-box-text wppa-td"' .
2846
  ' style="width: '.$width.';'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'"' .
wppa-cart.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the interface to SCABN
6
- * Version 6.5.00
7
  *
8
  */
9
 
@@ -15,6 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
15
  // $thumb MUST contain the current photo info
16
  function wppa_add_to_cart( $atts ) {
17
  global $post;
 
18
 
19
  if ( ! class_exists( 'wfCart' ) ) {
20
  wppa_dbg_msg('Plugin <i>Simple Cart and BuyNow</i> must be activated to use thus featue.', 'red', 'force');
@@ -25,7 +26,7 @@ global $post;
25
 
26
  extract( shortcode_atts( array(
27
  'name' => wppa_get_photo_name( $thumb['id'] ),
28
- 'price' => 0.01,
29
  'qty_field' => '',
30
  'b_title' => __('Buy now', 'wp-photo-album-plus'),
31
  'options' => '',
@@ -35,7 +36,7 @@ global $post;
35
  'weight' => ''
36
  ), $atts ) );
37
 
38
- $cart =& $_SESSION['wfcart']; // load the cart from the session
39
  $scabn_options = get_option('scabn_options');
40
  $currency = apply_filters('scabn_display_currency_symbol',NULL);
41
 
@@ -55,6 +56,8 @@ global $post;
55
  $item_url = wppa_convert_to_pretty( $item_url );
56
  }
57
 
 
 
58
  $output = '
59
  <div class="wppa-addtocart">
60
  <form method="post" class="wppa-cartform '.$name.'" action="'.$action_url.'">
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the interface to SCABN
6
+ * Version 6.8.02
7
  *
8
  */
9
 
15
  // $thumb MUST contain the current photo info
16
  function wppa_add_to_cart( $atts ) {
17
  global $post;
18
+ global $wppa_session;
19
 
20
  if ( ! class_exists( 'wfCart' ) ) {
21
  wppa_dbg_msg('Plugin <i>Simple Cart and BuyNow</i> must be activated to use thus featue.', 'red', 'force');
26
 
27
  extract( shortcode_atts( array(
28
  'name' => wppa_get_photo_name( $thumb['id'] ),
29
+ 'price' => '0.01',
30
  'qty_field' => '',
31
  'b_title' => __('Buy now', 'wp-photo-album-plus'),
32
  'options' => '',
36
  'weight' => ''
37
  ), $atts ) );
38
 
39
+ $cart = $wppa_session['wfcart']; // load the cart from the session
40
  $scabn_options = get_option('scabn_options');
41
  $currency = apply_filters('scabn_display_currency_symbol',NULL);
42
 
56
  $item_url = wppa_convert_to_pretty( $item_url );
57
  }
58
 
59
+ $action_url = wppa_convert_from_pretty( $action_url );
60
+
61
  $output = '
62
  <div class="wppa-addtocart">
63
  <form method="post" class="wppa-cartform '.$name.'" action="'.$action_url.'">
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 6.8.00
6
  *
7
  */
8
 
@@ -266,7 +266,7 @@ static $randseed_modified;
266
  }
267
  }
268
 
269
- wppa_save_session();
270
 
271
  return $randseed;
272
  }
@@ -842,7 +842,7 @@ global $wppa;
842
  global $wppa_session;
843
  $wppa_session['use_searchstring'] = $str;
844
  $wppa_session['display_searchstring'] = $str;
845
- wppa_save_session();
846
  }
847
  $result = $str;
848
  }
@@ -992,7 +992,7 @@ global $wppa;
992
  }
993
  }
994
 
995
- // Return the allowed number to upload in an album. -1 = unlimited
996
  function wppa_allow_uploads( $alb = '0' ) {
997
  global $wpdb;
998
 
@@ -1024,30 +1024,58 @@ global $wpdb;
1024
  }
1025
 
1026
  // Return the allowed number of uploads for a certain user. -1 = unlimited
1027
- function wppa_allow_user_uploads() {
 
1028
  global $wpdb;
1029
 
1030
  // Get the limits
1031
- $limits = wppa_get_user_upload_limits();
1032
-
1033
- $temp = explode( '/', $limits );
1034
  $limit_max = isset( $temp[0] ) ? $temp[0] : '0';
1035
  $limit_time = isset( $temp[1] ) ? $temp[1] : '0';
1036
 
1037
- if ( ! $limit_max ) return '-1'; // Unlimited max
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1038
 
 
1039
  $user = wppa_get_user( 'login' );
 
 
1040
  if ( ! $limit_time ) { // For ever
1041
- $curcount = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `".WPPA_PHOTOS."` WHERE `owner` = %s", $user ) );
1042
  }
1043
  else { // Time criterium in place
1044
  $timnow = time();
1045
  $timthen = $timnow - $limit_time;
1046
- $curcount = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `".WPPA_PHOTOS."` WHERE `owner` = %s AND `timestamp` > %s", $user, $timthen ) );
 
1047
  }
1048
 
1049
- if ( $curcount >= $limit_max ) $result = '0'; // No more allowed
1050
- else $result = $limit_max - $curcount;
 
 
 
 
 
1051
 
1052
  return $result;
1053
  }
@@ -1083,6 +1111,79 @@ function wppa_alfa_id( $id = '0' ) {
1083
  return str_replace( array( '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' ), array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' ), $id );
1084
  }
1085
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1086
  // Thanx to the maker of nextgen, but greatly improved
1087
  // Usage: wppa_check_memory_limit() return string telling the max upload size
1088
  // @1: if false, return array ( 'maxx', 'maxy', 'maxp' )
@@ -1139,6 +1240,9 @@ function wppa_check_memory_limit( $verbose = true, $x = '0', $y = '0' ) {
1139
  // Calculate max size
1140
  $maxpixels = ( $free_memory / $factor ) - $resizedpixels;
1141
 
 
 
 
1142
  // If obviously faulty: quit silently
1143
  if ( $maxpixels < 0 ) return '';
1144
 
@@ -1151,7 +1255,7 @@ function wppa_check_memory_limit( $verbose = true, $x = '0', $y = '0' ) {
1151
  $maxx = sqrt( $maxpixels / 12 ) * 4;
1152
  $maxy = sqrt( $maxpixels / 12 ) * 3;
1153
  if ( $verbose ) { // Make it a string
1154
- $result = '<br />'.sprintf( __( 'Based on your server memory limit you should not upload images larger then <strong>%d x %d (%2.1f MP)</strong>' , 'wp-photo-album-plus'), $maxx, $maxy, $maxpixels / ( 1024 * 1024 ) );
1155
  }
1156
  else { // Or an array
1157
  $result['maxx'] = $maxx;
@@ -1322,7 +1426,7 @@ global $wpdb;
1322
 
1323
  // See if selection is valid
1324
  if ( ( $args['selected'] == $args['exclude'] ) ||
1325
- ( $args['checkupload'] && ! wppa_allow_uploads( $args['selected'] ) ) ||
1326
  ( $args['disableancestors'] && wppa_is_ancestor( $args['exclude'], $args['selected'] ) )
1327
  ) {
1328
  $args['selected'] = '0';
@@ -1582,9 +1686,13 @@ global $wpdb;
1582
  }
1583
 
1584
  if ( $albums ) foreach ( $albums as $album ) {
 
 
 
 
1585
  if ( ( $args['disabled'] == $album['id'] ) ||
1586
  ( $args['exclude'] == $album['id'] ) ||
1587
- ( $args['checkupload'] && ! wppa_allow_uploads( $album['id'] ) ) ||
1588
  ( $args['disableancestors'] && wppa_is_ancestor( $args['exclude'], $album['id'] ) )
1589
  ) $disabled = ' disabled="disabled"'; else $disabled = '';
1590
  if ( in_array( $album['id'], $selarr, true ) && ! $disabled ) $selected = ' selected="selected"'; else $selected = '';
@@ -1593,28 +1701,31 @@ global $wpdb;
1593
  if ( $args['checkaccess'] && ! wppa_have_access( $album['id'] ) ) {
1594
  $ok = false;
1595
  }
1596
- /* This is in the query now
1597
- if ( $args['checkowner'] && wppa_switch( 'upload_owner_only' ) ) { // Need to check
1598
- if ( $album['owner'] != wppa_get_user() && $album['owner'] != '--- public ---' ) { // Not 'mine'
1599
- if ( ! wppa_user_is( 'administrator' ) ) { // No admin
1600
- $ok = false;
1601
- }
1602
- }
1603
- }
1604
- */
1605
- /* This is in the query now
1606
- if ( $args['checkarray'] ) {
1607
- if ( ! in_array( $album['id'], $args['array'] ) ) {
1608
- $ok = false;
1609
- }
1610
- }
1611
- */
1612
  if ( $selected && $args['addselected'] ) {
1613
  $ok = true;
1614
  }
1615
  if ( $ok ) {
1616
- if ( $args['addnumbers'] ) $number = ' ( '.$album['id'].' )'; else $number = '';
1617
- $result .= '<option class="' . $args['optionclass']. '" value="' . $album['id'] . '" ' . $selected . $disabled . '>' . $album['name'] . $number . '</option>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1618
  }
1619
  }
1620
 
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 6.8.02
6
  *
7
  */
8
 
266
  }
267
  }
268
 
269
+ // wppa_save_session();
270
 
271
  return $randseed;
272
  }
842
  global $wppa_session;
843
  $wppa_session['use_searchstring'] = $str;
844
  $wppa_session['display_searchstring'] = $str;
845
+ // wppa_save_session();
846
  }
847
  $result = $str;
848
  }
992
  }
993
  }
994
 
995
+ // Return the allowed number to upload in an album. -1 = unlimited ( the limit on the album info screen, possibly set by Table IX-D6 )
996
  function wppa_allow_uploads( $alb = '0' ) {
997
  global $wpdb;
998
 
1024
  }
1025
 
1026
  // Return the allowed number of uploads for a certain user. -1 = unlimited
1027
+ // If album <> 0 and 'role_limit_per_album' is set, look at the album, not global
1028
+ function wppa_allow_user_uploads( $album = false ) {
1029
  global $wpdb;
1030
 
1031
  // Get the limits
1032
+ $limits = wppa_get_user_upload_limits();
1033
+ $temp = explode( '/', $limits );
 
1034
  $limit_max = isset( $temp[0] ) ? $temp[0] : '0';
1035
  $limit_time = isset( $temp[1] ) ? $temp[1] : '0';
1036
 
1037
+ // Unlimited max
1038
+ if ( ! $limit_max ) return '-1';
1039
+
1040
+ // If the userlimits are per album and no album given, return the limit_max if not zero, else -1
1041
+ if ( wppa_switch( 'role_limit_per_album' ) && ! $album ) {
1042
+ if ( $limit_max > 0 ) {
1043
+ return $limit_max;
1044
+ }
1045
+ else {
1046
+ return '-1';
1047
+ }
1048
+ }
1049
+
1050
+ // Make the album clause
1051
+ if ( wppa_switch( 'role_limit_per_album' ) && $album ) {
1052
+ $album_clause = sprintf( " AND `album` = %d", $album );
1053
+ }
1054
+ else {
1055
+ $album_clause = "";
1056
+ }
1057
 
1058
+ // Get the user
1059
  $user = wppa_get_user( 'login' );
1060
+
1061
+ // Get the currently uploaded photos
1062
  if ( ! $limit_time ) { // For ever
1063
+ $curcount = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `".WPPA_PHOTOS."` WHERE `owner` = %s" . $album_clause, $user ) );
1064
  }
1065
  else { // Time criterium in place
1066
  $timnow = time();
1067
  $timthen = $timnow - $limit_time;
1068
+ $curcount = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `".WPPA_PHOTOS."` WHERE `owner` = %s AND `timestamp` > %s" . $album_clause, $user, $timthen ) );
1069
+ wppa_log('obs', $wpdb->prepare( "SELECT COUNT(*) FROM `".WPPA_PHOTOS."` WHERE `owner` = %s AND `timestamp` > %s", $user, $timthen ) . ' returns:' . $curcount );
1070
  }
1071
 
1072
+ // Compute the allowed number of photos
1073
+ if ( $curcount >= $limit_max ) {
1074
+ $result = '0'; // No more allowed
1075
+ }
1076
+ else {
1077
+ $result = $limit_max - $curcount;
1078
+ }
1079
 
1080
  return $result;
1081
  }
1111
  return str_replace( array( '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' ), array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' ), $id );
1112
  }
1113
 
1114
+ // Checks if there is enough memory for an image to be resized to a given size
1115
+ // @1: string - path to target file
1116
+ // @2: int - size in pixels of the largest edge of the target image
1117
+ // Returns bool
1118
+ function wppa_can_resize( $file, $size, $log_error = true ) {
1119
+ //ini_set('memory_limit', '32M');
1120
+ $bytes_per_pixel = 4.6;
1121
+
1122
+ // If file does not exists, log error and return true
1123
+ if ( ! file_exists( $file ) ) {
1124
+ wppa_log( 'err', 'wppa_can_resize() called with non existing file: ' . $file );
1125
+ return true;
1126
+ }
1127
+
1128
+ // get memory limit
1129
+ $memory_limit = 0;
1130
+ $memory_limini = wppa_convert_bytes( ini_get( 'memory_limit' ) );
1131
+ $memory_limcfg = wppa_convert_bytes( get_cfg_var( 'memory_limit' ) );
1132
+
1133
+ // find the smallest not being <= zero
1134
+ if ( $memory_limini > 0 && $memory_limcfg > 0 ) {
1135
+ $memory_limit = min( $memory_limini, $memory_limcfg );
1136
+ }
1137
+ elseif ( $memory_limini > 0 ) {
1138
+ $memory_limit = $memory_limini;
1139
+ }
1140
+ elseif ( $memory_limcfg > 0 ) {
1141
+ $memory_limit = $memory_limcfg;
1142
+ }
1143
+
1144
+ // If no data, assume yes
1145
+ if ( ! $memory_limit ) {
1146
+ return true;
1147
+ }
1148
+
1149
+ // Calculate the free memory
1150
+ $free_memory = $memory_limit - memory_get_usage( true );
1151
+
1152
+ // Substract filesize
1153
+ $free_memory -= filesize( $file );
1154
+
1155
+ // Compute required memorysize
1156
+ $imagesize = getimagesize( $file );
1157
+ $source_pixels = $imagesize[0] * $imagesize[1];
1158
+ if ( $size ) {
1159
+ if ( $imagesize[0] > $imagesize[1] ) {
1160
+ $target_pixels = $size * $size * $imagesize[1] / $imagesize[0];
1161
+ }
1162
+ else {
1163
+ $target_pixels = $size * $size * $imagesize[0] / $imagesize[1];
1164
+ }
1165
+ }
1166
+ else {
1167
+ $target_pixels = 0;
1168
+ }
1169
+ $required_memorysize = ( $source_pixels + $target_pixels ) * $bytes_per_pixel;
1170
+
1171
+ // Does it fit?
1172
+ if ( $required_memorysize <= $free_memory ) {
1173
+ return true;
1174
+ }
1175
+ elseif ( $log_error ) {
1176
+ if ( $size ) {
1177
+ wppa_log( 'War', 'Too little memory to resize ' . $file . ' (' . $imagesize[0] . 'x' . $imagesize[1] . ' px) to ' . $size );
1178
+ }
1179
+ else {
1180
+ wppa_log( 'War', 'Too little memory to manipulate ' . $file . ' (' . $imagesize[0] . 'x' . $imagesize[1] . ' px)' );
1181
+ }
1182
+ return false;
1183
+ }
1184
+ return false;
1185
+ }
1186
+
1187
  // Thanx to the maker of nextgen, but greatly improved
1188
  // Usage: wppa_check_memory_limit() return string telling the max upload size
1189
  // @1: if false, return array ( 'maxx', 'maxy', 'maxp' )
1240
  // Calculate max size
1241
  $maxpixels = ( $free_memory / $factor ) - $resizedpixels;
1242
 
1243
+ // Safety margin
1244
+ $maxpixels = round( $maxpixels * 0.95 );
1245
+
1246
  // If obviously faulty: quit silently
1247
  if ( $maxpixels < 0 ) return '';
1248
 
1255
  $maxx = sqrt( $maxpixels / 12 ) * 4;
1256
  $maxy = sqrt( $maxpixels / 12 ) * 3;
1257
  if ( $verbose ) { // Make it a string
1258
+ $result = '<br />'.sprintf( __( 'Based on your server memory limit you should not upload images larger then %2.1f Mega pixels' , 'wp-photo-album-plus'), $maxpixels / ( 1024 * 1024 ) );
1259
  }
1260
  else { // Or an array
1261
  $result['maxx'] = $maxx;
1426
 
1427
  // See if selection is valid
1428
  if ( ( $args['selected'] == $args['exclude'] ) ||
1429
+ ( $args['checkupload'] && ( ! wppa_allow_uploads( $args['selected'] ) || ! wppa_allow_user_uploads( $args['selected'] ) ) ) ||
1430
  ( $args['disableancestors'] && wppa_is_ancestor( $args['exclude'], $args['selected'] ) )
1431
  ) {
1432
  $args['selected'] = '0';
1686
  }
1687
 
1688
  if ( $albums ) foreach ( $albums as $album ) {
1689
+ $lim = '-1'; // Assume no limit on album
1690
+ if ( wppa_switch( 'role_limit_per_album' ) ) {
1691
+ $lim = wppa_allow_user_uploads( $album['id'] );
1692
+ }
1693
  if ( ( $args['disabled'] == $album['id'] ) ||
1694
  ( $args['exclude'] == $album['id'] ) ||
1695
+ ( $args['checkupload'] && ( ! wppa_allow_uploads( $album['id'] ) || ! $lim ) ) ||
1696
  ( $args['disableancestors'] && wppa_is_ancestor( $args['exclude'], $album['id'] ) )
1697
  ) $disabled = ' disabled="disabled"'; else $disabled = '';
1698
  if ( in_array( $album['id'], $selarr, true ) && ! $disabled ) $selected = ' selected="selected"'; else $selected = '';
1701
  if ( $args['checkaccess'] && ! wppa_have_access( $album['id'] ) ) {
1702
  $ok = false;
1703
  }
1704
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1705
  if ( $selected && $args['addselected'] ) {
1706
  $ok = true;
1707
  }
1708
  if ( $ok ) {
1709
+ if ( $args['addnumbers'] ) {
1710
+ $number = ' (' . $album['id'] . ')';
1711
+ }
1712
+ else {
1713
+ $number = '';
1714
+ }
1715
+ if ( $lim > '0' ) {
1716
+ $limt = ' (max ' . $lim . ')';
1717
+ }
1718
+ else {
1719
+ $limt = '';
1720
+ }
1721
+ $result .=
1722
+ '<option' .
1723
+ ' class="' . $args['optionclass']. '"' .
1724
+ ' value="' . $album['id'] . '"' .
1725
+ ' ' . $selected . $disabled .
1726
+ '>' .
1727
+ $album['name'] . $number . $limt .
1728
+ '</option>';
1729
  }
1730
  }
1731
 
wppa-exif-iptc-common.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * exif and iptc common functions
6
- * version 6.8.01
7
  *
8
  *
9
  */
@@ -4250,7 +4250,7 @@ if ( strlen($tag) != 6 ) {
4250
  $hextag = hexdec( substr( $tag, 2,4 ) );
4251
  $result = exif_tagname( $hextag );
4252
  if ( ! $result ) {
4253
- wppa_log( 'dbg', 'exif_tagname found nothing for ' . $tag );
4254
  $result = sprintf( 'UndefinedTag:0x%04X', $hextag );
4255
  }
4256
  }
@@ -4353,7 +4353,7 @@ global $wpdb;
4353
 
4354
  // Try source path
4355
  $src = wppa_get_source_path( $id );
4356
- if ( $src ) {
4357
  $exifs = @ exif_read_data( $src, 'EXIF' );
4358
  if ( $exifs ) {
4359
  if ( isset( $exifs['Make'] ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * exif and iptc common functions
6
+ * version 6.8.02
7
  *
8
  *
9
  */
4250
  $hextag = hexdec( substr( $tag, 2,4 ) );
4251
  $result = exif_tagname( $hextag );
4252
  if ( ! $result ) {
4253
+ // wppa_log( 'dbg', 'exif_tagname found nothing for ' . $tag );
4254
  $result = sprintf( 'UndefinedTag:0x%04X', $hextag );
4255
  }
4256
  }
4353
 
4354
  // Try source path
4355
  $src = wppa_get_source_path( $id );
4356
+ if ( file_exists( $src ) ) {
4357
  $exifs = @ exif_read_data( $src, 'EXIF' );
4358
  if ( $exifs ) {
4359
  if ( isset( $exifs['Make'] ) ) {
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 6.8.01
7
  *
8
  */
9
 
@@ -154,7 +154,7 @@ global $wppa_session;
154
  if ( wppa_get_get( 'superview' ) ) {
155
  $wppa_session['superview'] = wppa( 'is_slide' ) ? 'slide': 'thumbs';
156
  $wppa_session['superalbum'] = wppa( 'start_album' );
157
- wppa_save_session();
158
  wppa( 'photos_only', true );
159
  }
160
  wppa( 'is_upldr', wppa_get_get( 'upldr' ) );
@@ -172,7 +172,7 @@ global $wppa_session;
172
  }
173
  wppa( 'supersearch', strip_tags( wppa_get_get( 'supersearch' ) ) );
174
  $wppa_session['supersearch'] = wppa( 'supersearch' );
175
- wppa_save_session();
176
  if ( wppa( 'supersearch' ) ) {
177
  $ss_info = explode( ',', wppa( 'supersearch' ) );
178
  if ( $ss_info['0'] == 'a' ) {
@@ -711,13 +711,13 @@ global $wppa_session;
711
  $wppa_session['search_root'] = strval( intval( $_REQUEST['wppa-forceroot'] ) );
712
  wppa( 'is_rootsearch', true );
713
  wppa( 'start_album', strval( intval( $_REQUEST['wppa-forceroot'] ) ) );
714
- wppa_save_session();
715
  }
716
 
717
  // No rootsearch, forget previous root
718
  if ( ! wppa( 'is_rootsearch' ) ) {
719
  $wppa_session['search_root'] = '0';
720
- wppa_save_session();
721
  }
722
 
723
  wppa_dbg_msg( 'Forceroot='.(isset( $_REQUEST['wppa-forceroot'] )?$_REQUEST['wppa-forceroot']:'none').', is_rootsearch='.wppa('is_rootsearch').', start_album='.wppa('start_album'), 'red');
@@ -733,7 +733,7 @@ global $wppa_session;
733
 
734
  // Update session with new searchroot
735
  $wppa_session['search_root'] = wppa( 'start_album' );
736
- wppa_save_session();
737
 
738
  }
739
 
@@ -746,7 +746,7 @@ global $wppa_session;
746
  if ( ! wppa( 'src' ) ) {
747
  $wppa_session['use_searchstring'] = '';
748
  $wppa_session['display_searchstring'] = '';
749
- wppa_save_session();
750
  wppa_add( 'src_script', "\n" . 'jQuery(document).ready(function(){wppaClearSubsearch()});' );
751
  }
752
  else { // Enable subbox
@@ -4449,9 +4449,10 @@ global $wppa_upload_succes_id;
4449
  $reload = wppa_switch( 'home_after_upload' ) && $done ? 'home' : false;
4450
 
4451
  // Init alert text with possible results from wppa_do_frontend_file_upload()
4452
- $alert = $wppa_alert;
4453
  $upload_message = $alert;
4454
- $blog_failed = false;
 
4455
 
4456
  if ( $done ) {
4457
 
@@ -4506,21 +4507,23 @@ global $wppa_upload_succes_id;
4506
  }
4507
 
4508
  // Alert text for blogged
4509
- if ( $status == 'pending' ) {
4510
- $m = ' ' . __( 'Your post is awaiting moderation.', 'wp-photo-album-plus' );
4511
- }
4512
- else {
4513
- $m = ' ' . __( 'Your post is published.', 'wp-photo-album-plus' );
4514
- }
4515
- if ( $blogged && ( wppa_opt( 'fe_alert' ) == 'blog' || wppa_opt( 'fe_alert' ) == 'all' ) ) {
4516
- $alert .= $m;
4517
- $upload_message .= $m;
4518
- }
 
4519
 
4520
- if ( $blog_failed ) {
4521
- $m = ' ' . __( 'Blog failed', 'wp-photo-album-plus' );
4522
- $alert .= $m;
4523
- $upload_message .= $m;
 
4524
  }
4525
  }
4526
 
@@ -4623,7 +4626,7 @@ global $wppa_alert;
4623
  $album = wppa_cache_album( $alb );
4624
 
4625
  // Legal here?
4626
- if ( ! wppa_allow_uploads( $alb ) || ! wppa_allow_user_uploads() ) {
4627
  $wppa_alert .= esc_js( __( 'Max uploads reached' , 'wp-photo-album-plus') ) . '.';
4628
  return false;
4629
  }
@@ -4765,7 +4768,7 @@ global $wppa_alert;
4765
  return false;
4766
  }
4767
  }
4768
-
4769
  // Check for max memory needed to rocess image?
4770
  $mayupload = wppa_check_memory_limit( '', $imgsize[0], $imgsize[1] );
4771
  if ( $mayupload === false ) {
@@ -4775,7 +4778,7 @@ global $wppa_alert;
4775
  return false;
4776
  }
4777
  }
4778
-
4779
  // Find extension from mimetype
4780
  switch( $imgsize[2] ) { // mime type
4781
  case 1: $ext = 'gif'; break;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 6.8.02
7
  *
8
  */
9
 
154
  if ( wppa_get_get( 'superview' ) ) {
155
  $wppa_session['superview'] = wppa( 'is_slide' ) ? 'slide': 'thumbs';
156
  $wppa_session['superalbum'] = wppa( 'start_album' );
157
+ // wppa_save_session();
158
  wppa( 'photos_only', true );
159
  }
160
  wppa( 'is_upldr', wppa_get_get( 'upldr' ) );
172
  }
173
  wppa( 'supersearch', strip_tags( wppa_get_get( 'supersearch' ) ) );
174
  $wppa_session['supersearch'] = wppa( 'supersearch' );
175
+ // wppa_save_session();
176
  if ( wppa( 'supersearch' ) ) {
177
  $ss_info = explode( ',', wppa( 'supersearch' ) );
178
  if ( $ss_info['0'] == 'a' ) {
711
  $wppa_session['search_root'] = strval( intval( $_REQUEST['wppa-forceroot'] ) );
712
  wppa( 'is_rootsearch', true );
713
  wppa( 'start_album', strval( intval( $_REQUEST['wppa-forceroot'] ) ) );
714
+ // wppa_save_session();
715
  }
716
 
717
  // No rootsearch, forget previous root
718
  if ( ! wppa( 'is_rootsearch' ) ) {
719
  $wppa_session['search_root'] = '0';
720
+ // wppa_save_session();
721
  }
722
 
723
  wppa_dbg_msg( 'Forceroot='.(isset( $_REQUEST['wppa-forceroot'] )?$_REQUEST['wppa-forceroot']:'none').', is_rootsearch='.wppa('is_rootsearch').', start_album='.wppa('start_album'), 'red');
733
 
734
  // Update session with new searchroot
735
  $wppa_session['search_root'] = wppa( 'start_album' );
736
+ // wppa_save_session();
737
 
738
  }
739
 
746
  if ( ! wppa( 'src' ) ) {
747
  $wppa_session['use_searchstring'] = '';
748
  $wppa_session['display_searchstring'] = '';
749
+ // wppa_save_session();
750
  wppa_add( 'src_script', "\n" . 'jQuery(document).ready(function(){wppaClearSubsearch()});' );
751
  }
752
  else { // Enable subbox
4449
  $reload = wppa_switch( 'home_after_upload' ) && $done ? 'home' : false;
4450
 
4451
  // Init alert text with possible results from wppa_do_frontend_file_upload()
4452
+ $alert = $wppa_alert;
4453
  $upload_message = $alert;
4454
+ $blog_failed = false;
4455
+ $status = '';
4456
 
4457
  if ( $done ) {
4458
 
4507
  }
4508
 
4509
  // Alert text for blogged
4510
+ if ( $blogged or $blog_failed ) {
4511
+ if ( $status == 'pending' ) {
4512
+ $m = ' ' . __( 'Your post is awaiting moderation.', 'wp-photo-album-plus' );
4513
+ }
4514
+ else {
4515
+ $m = ' ' . __( 'Your post is published.', 'wp-photo-album-plus' );
4516
+ }
4517
+ if ( $blogged && ( wppa_opt( 'fe_alert' ) == 'blog' || wppa_opt( 'fe_alert' ) == 'all' ) ) {
4518
+ $alert .= $m;
4519
+ $upload_message .= $m;
4520
+ }
4521
 
4522
+ if ( $blog_failed ) {
4523
+ $m = ' ' . __( 'Blog failed', 'wp-photo-album-plus' );
4524
+ $alert .= $m;
4525
+ $upload_message .= $m;
4526
+ }
4527
  }
4528
  }
4529
 
4626
  $album = wppa_cache_album( $alb );
4627
 
4628
  // Legal here?
4629
+ if ( ! wppa_allow_uploads( $alb ) || ! wppa_allow_user_uploads( $alb ) ) {
4630
  $wppa_alert .= esc_js( __( 'Max uploads reached' , 'wp-photo-album-plus') ) . '.';
4631
  return false;
4632
  }
4768
  return false;
4769
  }
4770
  }
4771
+ /*
4772
  // Check for max memory needed to rocess image?
4773
  $mayupload = wppa_check_memory_limit( '', $imgsize[0], $imgsize[1] );
4774
  if ( $mayupload === false ) {
4778
  return false;
4779
  }
4780
  }
4781
+ */
4782
  // Find extension from mimetype
4783
  switch( $imgsize[2] ) { // mime type
4784
  case 1: $ext = 'gif'; break;
wppa-import.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
- * Version 6.8.00
7
  *
8
  */
9
 
@@ -73,6 +73,13 @@ global $wppa_session;
73
  update_option( 'wppa-audio-album-import-'.wppa_get_user(), strval( intval( $_POST['wppa-audio-album'] ) ) );
74
  }
75
 
 
 
 
 
 
 
 
76
  // Verify last albums still exist
77
  $alb = get_option( 'wppa-photo-album-import-'.wppa_get_user(), '0' );
78
  if ( $alb ) {
@@ -591,12 +598,12 @@ global $wppa_session;
591
  }
592
 
593
  // Delay
594
- $delays = array( '1', '2', '5', '10', '20', '50', '100' );
595
  echo
596
  __( 'Delay', 'wp-photo-album-plus' ) .
597
  '<select id="wppa-delay" >';
598
  foreach ( $delays as $d ) {
599
- echo '<option value="' . ( $d * 1000 ) . '" >' . $d . '</option>';
600
  }
601
  echo
602
  '</select> s. ' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
+ * Version 6.8.02
7
  *
8
  */
9
 
73
  update_option( 'wppa-audio-album-import-'.wppa_get_user(), strval( intval( $_POST['wppa-audio-album'] ) ) );
74
  }
75
 
76
+ // Link from album admin overrules last album
77
+ if ( isset( $_GET['wppa-set-album'] ) ) {
78
+ update_option( 'wppa-photo-album-import-'.wppa_get_user(), strval( intval( $_GET['wppa-set-album'] ) ) );
79
+ update_option( 'wppa-video-album-import-'.wppa_get_user(), strval( intval( $_GET['wppa-set-album'] ) ) );
80
+ update_option( 'wppa-audio-album-import-'.wppa_get_user(), strval( intval( $_GET['wppa-set-album'] ) ) );
81
+ }
82
+
83
  // Verify last albums still exist
84
  $alb = get_option( 'wppa-photo-album-import-'.wppa_get_user(), '0' );
85
  if ( $alb ) {
598
  }
599
 
600
  // Delay
601
+ $delays = array( '0', '1', '2', '5', '10', '20', '50', '100' );
602
  echo
603
  __( 'Delay', 'wp-photo-album-plus' ) .
604
  '<select id="wppa-delay" >';
605
  foreach ( $delays as $d ) {
606
+ echo '<option value="' . ( $d * 1000 ) . '" ' . ( $d == '1' ? 'selected="selected" ' : '' ) . '>' . $d . '</option>';
607
  }
608
  echo
609
  '</select> s. ' .
wppa-index.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all indexing functions
6
- * Version 6.8.00
7
  *
8
  *
9
  */
@@ -295,36 +295,67 @@ function wppa_index_string_to_array( $string ) {
295
  if ( ! $string ) return array();
296
 
297
  // Any ranges?
298
- if ( ! strstr($string, '..') ) {
299
- $result = explode(',', $string);
300
- foreach( array_keys( $result ) as $key ) {
301
- $result[$key] = strval($result[$key]);
302
- }
303
- return $result;
304
- }
 
 
305
 
306
- // Yes
307
- $temp = explode(',', $string);
308
- $result = array();
309
- foreach ( $temp as $t ) {
310
- if ( ! strstr($t, '..') ) $result[] = intval($t);
311
- else {
312
- $range = explode('..', $t);
313
- $from = $range['0'];
314
- $to = $range['1'];
315
- while ( $from <= $to ) {
316
- $result[] = strval($from);
317
- $from++;
 
 
318
  }
319
  }
320
  }
321
 
322
- // Remove dups
323
- $result = array_unique( $result );
 
 
 
 
 
 
 
324
 
325
- // foreach( array_keys($result) as $key ) {
326
- // $result[$key] = strval($result[$key]);
327
- // }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
 
329
  return $result;
330
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all indexing functions
6
+ * Version 6.8.02
7
  *
8
  *
9
  */
295
  if ( ! $string ) return array();
296
 
297
  // Any ranges?
298
+ if ( strstr( $string, '..' ) ) {
299
+ $temp = explode(',', $string);
300
+ $result = array();
301
+ foreach ( $temp as $t ) {
302
+
303
+ // Single value
304
+ if ( ! strstr( $t, '..' ) ) {
305
+ $result[] = $t;
306
+ }
307
 
308
+ // Range
309
+ else {
310
+ $range = explode( '..', $t );
311
+ $from = $range['0'];
312
+ $to = $range['1'];
313
+ if ( $from >= $to ) {
314
+ wppa_log( 'err', 'Illegal range: ' . $t );
315
+ $result[] = $range['0'];
316
+ $result[] = $range['1'];
317
+ }
318
+ else while ( $from <= $to ) {
319
+ $result[] = strval($from);
320
+ $from++;
321
+ }
322
  }
323
  }
324
  }
325
 
326
+ // No
327
+ else {
328
+ $result = explode(',', $string);
329
+ }
330
+
331
+ // Sort
332
+ if ( ! sort( $result, SORT_NUMERIC ) ) {
333
+ wppa_log( 'err', 'Sort index failed' );
334
+ }
335
 
336
+ // Remove dups
337
+ // $result = array_unique( $result );
338
+ // array_unique() may cause 'Not enough space' errors
339
+ // assuming array is not descending ( E[n+1] >= E[n] )
340
+ $i = 0;
341
+ $j = 1;
342
+ $c = count( $result );
343
+ $t = $c - 1;
344
+ while ( $i < $t ) {
345
+ while ( $result[$j] === $result[$i] ) {
346
+ $result[$j] = 0;
347
+ $j++;
348
+ }
349
+ $j++;
350
+ $i = $j - 1;
351
+ }
352
+ $i = 0;
353
+ while ( $i < $c ) {
354
+ if ( $result[$i] === 0 ) {
355
+ unset( $result[$i] );
356
+ }
357
+ $i++;
358
+ }
359
 
360
  return $result;
361
  }
wppa-init.php CHANGED
@@ -361,4 +361,22 @@ function wppa_donate_link($links, $file) {
361
  $links[] = $donate_link_usd . ' | ' . $donate_link_eur . ' | ' . $docs_link;
362
  }
363
  return $links;
364
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  $links[] = $donate_link_usd . ' | ' . $donate_link_eur . ' | ' . $docs_link;
362
  }
363
  return $links;
364
+ }
365
+
366
+ function wppa_check_scabn_compatibility() {
367
+ if ( wppa_switch( 'use_scabn' ) ) {
368
+ $msg = '';
369
+ if ( ! function_exists( 'scabn_check_wppa' ) ) {
370
+ $msg = __( 'You must install plugin <a href="https://wppa.nl/wp-content/uploads/simple-cart-buy-now-for-wppa.zip" ><b>simple-cart-buy-now-for-wppa</b></a> for the shopping cart functionality in wppa', 'wp-photo-album-plus' );
371
+ if ( class_exists( 'wfCart' ) ) {
372
+ $msg .= '<br>' . __( 'Plugin <b>simple-cart-buy-now</b> is no longer compatible with wppa', 'wp-photo-album-plus' );
373
+ $msg .= '<br>' . __( 'Note: you can not have both shopping plugins active at the same time.', 'wp-photo-album-plus' );
374
+ $msg .= '<br>' . __( 'The new version will work outside wppa as long as wppa is activated.', 'wp-photo-album-plus' );
375
+ }
376
+ }
377
+ if ( $msg ) {
378
+ wppa_warning_message( $msg );
379
+ }
380
+ }
381
+ }
382
+ add_action( 'admin_notices', 'wppa_check_scabn_compatibility' );
wppa-items.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions to retrieve album and photo items
6
- * Version 6.7.09
7
  *
8
  */
9
 
@@ -328,9 +328,6 @@ function wppa_get_photo_desc( $id, $xargs = array() ) {
328
  wppa_do_geo( $id, $thumb['location'] );
329
  }
330
 
331
- // Other keywords
332
- $desc = wppa_translate_photo_keywords( $id, $desc );
333
-
334
  // Shortcodes
335
  if ( $args['doshortcodes'] ) $desc = do_shortcode( $desc ); // Do shortcodes if wanted
336
  else $desc = strip_shortcodes( $desc ); // Remove shortcodes if not wanted
@@ -342,6 +339,9 @@ function wppa_get_photo_desc( $id, $xargs = array() ) {
342
  $desc = make_clickable( $desc ); // Auto make a tags for links
343
  $desc = convert_smilies( $desc ); // Make smilies visible
344
 
 
 
 
345
  // CMTooltipGlossary on board?
346
  $desc = wppa_filter_glossary( $desc );
347
 
@@ -354,9 +354,10 @@ function wppa_translate_photo_keywords( $id, $text ) {
354
  $result = $text;
355
 
356
  // Is there any 'w#' ?
357
- if ( strpos($result, 'w#') !== false ) {
358
  $thumb = wppa_cache_thumb( $id );
359
- // Keywords
 
360
  $result = str_replace( 'w#albumname', wppa_get_album_name( $thumb['album'] ), $result );
361
  $result = str_replace( 'w#albumid', $thumb['album'], $result );
362
  $keywords = array('name', 'filename', 'owner', 'id', 'tags', 'views', 'album');
@@ -368,12 +369,21 @@ function wppa_translate_photo_keywords( $id, $text ) {
368
  if ( $replacement == '' ) $replacement = '&lsaquo;'.__( 'none' , 'wp-photo-album-plus').'&rsaquo;';
369
  $result = str_replace( 'w#'.$keyword, $replacement, $result );
370
  }
371
- $result = str_replace( 'w#url', wppa_get_lores_url( $id ), $result );
372
- $result = str_replace( 'w#hrurl', esc_attr( wppa_get_hires_url( $id ) ), $result );
373
- $result = str_replace( 'w#tnurl', wppa_get_tnres_url( $id ), $result );
374
- $result = str_replace( 'w#pl', wppa_get_source_pl( $id ), $result );
375
- $result = str_replace( 'w#rating', wppa_get_rating_by_id( $id, 'nolabel' ), $result );
376
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
  $user = wppa_get_user_by( 'login', $thumb['owner'] );
378
  if ( $user ) {
379
  $result = str_replace( 'w#displayname', $user->display_name, $result );
@@ -597,9 +607,6 @@ function wppa_get_album_desc( $id, $xargs = array() ) {
597
  // Unescape
598
  $desc = stripslashes( $desc );
599
 
600
- // Album keywords
601
- $desc = wppa_translate_album_keywords( $id, $desc, $args['translate'] );
602
-
603
  // Optionally translate
604
  if ( $args['translate'] ) {
605
 
@@ -625,6 +632,9 @@ function wppa_get_album_desc( $id, $xargs = array() ) {
625
  // Convert links and mailto:
626
  $desc = make_clickable( $desc );
627
 
 
 
 
628
  // CMTooltipGlossary on board?
629
  $desc = wppa_filter_glossary( $desc );
630
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions to retrieve album and photo items
6
+ * Version 6.8.02
7
  *
8
  */
9
 
328
  wppa_do_geo( $id, $thumb['location'] );
329
  }
330
 
 
 
 
331
  // Shortcodes
332
  if ( $args['doshortcodes'] ) $desc = do_shortcode( $desc ); // Do shortcodes if wanted
333
  else $desc = strip_shortcodes( $desc ); // Remove shortcodes if not wanted
339
  $desc = make_clickable( $desc ); // Auto make a tags for links
340
  $desc = convert_smilies( $desc ); // Make smilies visible
341
 
342
+ // Other keywords
343
+ $desc = wppa_translate_photo_keywords( $id, $desc );
344
+
345
  // CMTooltipGlossary on board?
346
  $desc = wppa_filter_glossary( $desc );
347
 
354
  $result = $text;
355
 
356
  // Is there any 'w#' ?
357
+ if ( strpos( $result, 'w#' ) !== false ) {
358
  $thumb = wppa_cache_thumb( $id );
359
+
360
+ // General keywords
361
  $result = str_replace( 'w#albumname', wppa_get_album_name( $thumb['album'] ), $result );
362
  $result = str_replace( 'w#albumid', $thumb['album'], $result );
363
  $keywords = array('name', 'filename', 'owner', 'id', 'tags', 'views', 'album');
369
  if ( $replacement == '' ) $replacement = '&lsaquo;'.__( 'none' , 'wp-photo-album-plus').'&rsaquo;';
370
  $result = str_replace( 'w#'.$keyword, $replacement, $result );
371
  }
 
 
 
 
 
372
 
373
+ // Urls
374
+ $w_url = wppa_get_lores_url( $id );
375
+ $result = str_replace( 'w#url', '<a href="' . esc_attr( $w_url ) . ' ">' . $w_url . '</a> ', $result );
376
+ $w_hrurl = wppa_get_hires_url( $id );
377
+ $result = str_replace( 'w#hrurl', '<a href="' . esc_attr( $w_hrurl ) . ' ">' . $w_hrurl . '</a> ', $result );
378
+ $w_tnurl = wppa_get_tnres_url( $id );
379
+ $result = str_replace( 'w#tnurl', '<a href="' . esc_attr( $w_tnurl ) . ' ">' . $w_tnurl . '</a> ', $result );
380
+ $w_pl = wppa_get_source_pl( $id );
381
+ $result = str_replace( 'w#pl', '<a href="' . esc_attr( $w_pl ) . ' ">' . $w_pl . '</a> ', $result );
382
+
383
+ // Rating
384
+ $result = str_replace( 'w#rating', wppa_get_rating_by_id( $id, 'nolabel' ), $result );
385
+
386
+ // Owner
387
  $user = wppa_get_user_by( 'login', $thumb['owner'] );
388
  if ( $user ) {
389
  $result = str_replace( 'w#displayname', $user->display_name, $result );
607
  // Unescape
608
  $desc = stripslashes( $desc );
609
 
 
 
 
610
  // Optionally translate
611
  if ( $args['translate'] ) {
612
 
632
  // Convert links and mailto:
633
  $desc = make_clickable( $desc );
634
 
635
+ // Album keywords
636
+ $desc = wppa_translate_album_keywords( $id, $desc, $args['translate'] );
637
+
638
  // CMTooltipGlossary on board?
639
  $desc = wppa_filter_glossary( $desc );
640
 
wppa-maintenance.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
- * Version 6.8.01
7
  *
8
  */
9
 
@@ -152,7 +152,7 @@ global $wppa_timestamp_start;
152
  $wppa_session[$slug.'_skipped'] = '0';
153
  }
154
 
155
- wppa_save_session();
156
 
157
  // Pre-processing needed?
158
  if ( $lastid == '0' ) {
@@ -255,7 +255,7 @@ global $wppa_timestamp_start;
255
  break;
256
 
257
  }
258
- wppa_save_session();
259
  }
260
 
261
  if ( $lastid != '0' ) {
@@ -1111,7 +1111,7 @@ global $wppa_timestamp_start;
1111
 
1112
  }
1113
 
1114
- wppa_save_session();
1115
 
1116
  if ( wppa_is_cron() ) {
1117
  if ( get_option( $slug . '_ad_inf' ) == 'yes' ) {
@@ -1328,11 +1328,18 @@ global $wppa_log_file;
1328
  implode( ',', array_keys($data[$key]) ) .
1329
  ')<br />';
1330
  }
 
 
 
 
 
 
1331
  else {
1332
  $result .= '['.$key.'] => '.$data[$key].'<br />';
1333
  }
1334
  }
1335
  }
 
1336
  $result .= '
1337
  </td>
1338
  <td style="border-bottom:1px solid gray;" >';
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 6.8.02
7
  *
8
  */
9
 
152
  $wppa_session[$slug.'_skipped'] = '0';
153
  }
154
 
155
+ // wppa_save_session();
156
 
157
  // Pre-processing needed?
158
  if ( $lastid == '0' ) {
255
  break;
256
 
257
  }
258
+ // wppa_save_session();
259
  }
260
 
261
  if ( $lastid != '0' ) {
1111
 
1112
  }
1113
 
1114
+ // wppa_save_session();
1115
 
1116
  if ( wppa_is_cron() ) {
1117
  if ( get_option( $slug . '_ad_inf' ) == 'yes' ) {
1328
  implode( ',', array_keys($data[$key]) ) .
1329
  ')<br />';
1330
  }
1331
+ elseif ( is_object( $data[$key] ) ) {
1332
+ $temp = var_export( $data[$key], true );
1333
+ // $temp = str_replace( "\n", '<br />', $temp );
1334
+ // $temp = str_replace( "\t", '&nbsp;&nbsp;', $temp );
1335
+ $result .= '['.$key.'] => ' . $temp;
1336
+ }
1337
  else {
1338
  $result .= '['.$key.'] => '.$data[$key].'<br />';
1339
  }
1340
  }
1341
  }
1342
+
1343
  $result .= '
1344
  </td>
1345
  <td style="border-bottom:1px solid gray;" >';
wppa-non-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
- * Version 6.7.10
7
  *
8
  */
9
 
@@ -745,26 +745,7 @@ global $wppa_dynamic_css_data;
745
 
746
  // init.js failed?
747
  if ( $wppa_init_js_data ) echo $wppa_init_js_data;
748
- /* Obsolete?
749
- // Patch for chrome or Edge?
750
- // Test for chrome needs also test for NOT Edge, because browser signature of Edge also reports that it is chrome(-like)
751
- if ( false && isset($_SERVER["HTTP_USER_AGENT"] ) ) {
752
- echo '
753
 
754
- <!-- WPPA+ Kickoff -->
755
- <!-- Browser detected = '.wppa_decode_uri_component(strip_tags($_SERVER["HTTP_USER_AGENT"])).' -->';
756
- if ( strstr($_SERVER["HTTP_USER_AGENT"], 'Chrome') && ! strstr($_SERVER["HTTP_USER_AGENT"], 'Edge') && wppa_switch( 'ovl_chrome_at_top') ) echo '
757
- <style type="text/css">
758
- #wppa-overlay-ic { padding-top: 5px !important; }
759
- #wppa-overlay-qt-img { top: 5px !important; }
760
- </style>';
761
- if ( strstr($_SERVER["HTTP_USER_AGENT"], 'Edge') ) echo '
762
- <style type="text/css">
763
- #wppa-overlay-ic { padding-top: 0px !important; }
764
- #wppa-overlay-qt-img { top: 5px !important; }
765
- </style>';
766
- }
767
- */
768
  // Inline styles?
769
  if ( wppa_switch( 'inline_css') ) {
770
  echo '
@@ -773,8 +754,64 @@ global $wppa_dynamic_css_data;
773
  if ( ! wppa_switch( 'ovl_fs_icons' ) ) {
774
  echo '#wppa-norms-btn, #wppa-fulls-btn { display:none; }';
775
  }
776
- echo wppa_opt( 'custom_style' ).'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777
  </style>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
778
  }
779
 
780
  // Pinterest js
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
+ * Version 6.8.02
7
  *
8
  */
9
 
745
 
746
  // init.js failed?
747
  if ( $wppa_init_js_data ) echo $wppa_init_js_data;
 
 
 
 
 
748
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
749
  // Inline styles?
750
  if ( wppa_switch( 'inline_css') ) {
751
  echo '
754
  if ( ! wppa_switch( 'ovl_fs_icons' ) ) {
755
  echo '#wppa-norms-btn, #wppa-fulls-btn { display:none; }';
756
  }
757
+ echo wppa_opt( 'custom_style' ) . '
758
+ </style>';
759
+ }
760
+
761
+ // Browser dependant css
762
+ if ( wppa_is_edge() ) {
763
+ if ( wppa_opt( 'custom_style_edge' ) ) {
764
+ echo '
765
+ <!-- WPPA+ Custom styles Edge -->
766
+ <style type="text/css" >
767
+ ' . wppa_opt( 'custom_style_edge' ) . '
768
+ </style>';
769
+ }
770
+ }
771
+ elseif ( wppa_is_chrome() ) {
772
+ if ( wppa_opt( 'custom_style_chrome' ) ) {
773
+ echo '
774
+ <!-- WPPA+ Custom styles Chrome -->
775
+ <style type="text/css" >
776
+ ' . wppa_opt( 'custom_style_chrome' ) . '
777
+ </style>';
778
+ }
779
+ }
780
+ elseif ( wppa_is_firefox() ) {
781
+ if ( wppa_opt( 'custom_style_firefox' ) ) {
782
+ echo '
783
+ <!-- WPPA+ Custom styles Firefox -->
784
+ <style type="text/css" >
785
+ ' . wppa_opt( 'custom_style_firefox' ) . '
786
+ </style>';
787
+ }
788
+ }
789
+ elseif ( wppa_is_safari() ) {
790
+ if ( wppa_opt( 'custom_style_safari' ) ) {
791
+ echo '
792
+ <!-- WPPA+ Custom styles Safari -->
793
+ <style type="text/css" >
794
+ ' . wppa_opt( 'custom_style_safari' ) . '
795
  </style>';
796
+ }
797
+ }
798
+ elseif ( wppa_is_ie() ) {
799
+ if ( wppa_opt( 'custom_style_ie' ) ) {
800
+ echo '
801
+ <!-- WPPA+ Custom styles IE -->
802
+ <style type="text/css" >
803
+ ' . wppa_opt( 'custom_style_ie' ) . '
804
+ </style>';
805
+ }
806
+ }
807
+ elseif ( wppa_is_opera() ) {
808
+ if ( wppa_opt( 'custom_style_opera' ) ) {
809
+ echo '
810
+ <!-- WPPA+ Custom styles Opera -->
811
+ <style type="text/css" >
812
+ ' . wppa_opt( 'custom_style_opera' ) . '
813
+ </style>';
814
+ }
815
  }
816
 
817
  // Pinterest js
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 6.8.01
7
  *
8
  */
9
 
@@ -952,7 +952,7 @@ function wppaToggleExif( id, count ) {
952
  if ( is_file( $sp ) ) {
953
  $ima = getimagesize( $sp );
954
  echo
955
- $ima['0'] . ' x ' . $ima['1'] . ' px, ' .
956
  wppa_get_filesize( $sp ) . '. ';
957
  }
958
  else {
@@ -1970,7 +1970,7 @@ function wppaToggleExif( id, count ) {
1970
  __( 'Permalink', 'wp-photo-album-plus' ) . ':' .
1971
  '</td>' .
1972
  '<td>' .
1973
- '<a href="' . $spl . '" target="_blank" >' . $spl . '</a>' .
1974
  '</td>' .
1975
  '<td>' .
1976
  '</td>' .
@@ -1985,7 +1985,7 @@ function wppaToggleExif( id, count ) {
1985
  __( 'Hi resolution url', 'wp-photo-album-plus') . ':' .
1986
  '</td>' .
1987
  '<td>' .
1988
- '<a href="' . $hru . '" target="_blank" >' . $hru . '</a>' .
1989
  '</td>' .
1990
  '<td>' .
1991
  '</td>' .
@@ -2000,7 +2000,7 @@ function wppaToggleExif( id, count ) {
2000
  __( 'Display file url', 'wp-photo-album-plus') . ':' .
2001
  '</td>' .
2002
  '<td>' .
2003
- '<a href="' . $lru . '" target="_blank" >' . $lru . '</a>' .
2004
  '</td>' .
2005
  '<td>' .
2006
  '</td>' .
@@ -2016,7 +2016,7 @@ function wppaToggleExif( id, count ) {
2016
  __( 'Thumbnail file url', 'wp-photo-album-plus' ) . ':' .
2017
  '</td>' .
2018
  '<td>' .
2019
- '<a href="' . $tnu . '" target="_blank" >' . $tnu . '</a>' .
2020
  '</td>' .
2021
  '<td>' .
2022
  '</td>' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 6.8.02
7
  *
8
  */
9
 
952
  if ( is_file( $sp ) ) {
953
  $ima = getimagesize( $sp );
954
  echo
955
+ $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' .
956
  wppa_get_filesize( $sp ) . '. ';
957
  }
958
  else {
1970
  __( 'Permalink', 'wp-photo-album-plus' ) . ':' .
1971
  '</td>' .
1972
  '<td>' .
1973
+ '<a href="' . esc_attr( $spl ) . '" target="_blank" >' . $spl . '</a>' .
1974
  '</td>' .
1975
  '<td>' .
1976
  '</td>' .
1985
  __( 'Hi resolution url', 'wp-photo-album-plus') . ':' .
1986
  '</td>' .
1987
  '<td>' .
1988
+ '<a href="' . esc_attr( $hru ) . '" target="_blank" >' . $hru . '</a>' .
1989
  '</td>' .
1990
  '<td>' .
1991
  '</td>' .
2000
  __( 'Display file url', 'wp-photo-album-plus') . ':' .
2001
  '</td>' .
2002
  '<td>' .
2003
+ '<a href="' . esc_attr( $lru ) . '" target="_blank" >' . $lru . '</a>' .
2004
  '</td>' .
2005
  '<td>' .
2006
  '</td>' .
2016
  __( 'Thumbnail file url', 'wp-photo-album-plus' ) . ':' .
2017
  '</td>' .
2018
  '<td>' .
2019
+ '<a href="' . esc_attr( $tnu ) . '" target="_blank" >' . $tnu . '</a>' .
2020
  '</td>' .
2021
  '<td>' .
2022
  '</td>' .
wppa-photo-files.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-photo-files.php
3
  *
4
  * Functions used to create/manipulate photofiles
5
- * Version 6.7.08
6
  *
7
  */
8
 
@@ -180,7 +180,7 @@ global $wpdb;
180
  }
181
 
182
  // If Resize on upload is checked
183
- if ( wppa_switch( 'resize_on_upload' ) ) {
184
 
185
  // ImageMagick
186
  if ( wppa_opt( 'image_magick' ) ) {
@@ -319,6 +319,7 @@ global $wpdb;
319
  copy( $file, $newimage );
320
  }
321
  }
 
322
  }
323
 
324
  // No resize on upload checked
@@ -458,158 +459,167 @@ function wppa_create_thumbnail( $id, $use_source = true ) {
458
  $src_size_w *= 2;
459
  }
460
 
461
- // Image Magick?
462
- if ( wppa_opt( 'image_magick' ) && $type == 'none' ) {
463
- wppa_image_magick( 'convert "' . $file . '" -thumbnail ' . $max_side . 'x' . $max_side . ' ' . $thumbpath );
464
- }
465
-
466
- // Classic GD
467
- else {
468
- // Create the source image
469
- switch ( $mime ) { // mime type
470
- case 1: // gif
471
- $temp = @ imagecreatefromgif( $file );
472
- if ( $temp ) {
473
- $src = imagecreatetruecolor( $src_size_w, $src_size_h );
474
- imagecopy( $src, $temp, 0, 0, 0, 0, $src_size_w, $src_size_h );
475
- imagedestroy( $temp );
476
- }
477
- else $src = false;
478
- break;
479
- case 2: // jpeg
480
- if ( ! function_exists( 'wppa_imagecreatefromjpeg' ) ) wppa_log( 'Error', 'Function wppa_imagecreatefromjpeg does not exist.' );
481
- $src = @ wppa_imagecreatefromjpeg( $file );
482
- break;
483
- case 3: // png
484
- $src = @ imagecreatefrompng( $file );
485
- break;
486
- }
487
- if ( ! $src ) {
488
- wppa_log( 'Error', 'Image file '.$file.' is corrupt while creating thmbnail' );
489
- return true;
490
- }
491
 
492
- // Compute the destination image size
493
- if ( $dst_asp < 1.0 ) { // Landscape
494
- $dst_size_w = $max_side;
495
- $dst_size_h = round( $max_side * $dst_asp );
496
- }
497
- else { // Portrait
498
- $dst_size_w = round( $max_side / $dst_asp );
499
- $dst_size_h = $max_side;
500
  }
501
 
502
- // Create the ( empty ) destination image
503
- $dst = imagecreatetruecolor( $dst_size_w, $dst_size_h );
504
- if ( $mime == 3 ) { // Png, save transparancy
505
- imagealphablending( $dst, false );
506
- imagesavealpha( $dst, true );
507
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
508
 
509
- // Fill with the required color
510
- $c = trim( strtolower( wppa_opt( 'bgcolor_thumbnail' ) ) );
511
- if ( $c != '#000000' ) {
512
- $r = hexdec( substr( $c, 1, 2 ) );
513
- $g = hexdec( substr( $c, 3, 2 ) );
514
- $b = hexdec( substr( $c, 5, 2 ) );
515
- $color = imagecolorallocate( $dst, $r, $g, $b );
516
- if ( $color === false ) {
517
- wppa_log( 'Err', 'Unable to set background color to: '.$r.', '.$g.', '.$b.' in wppa_create_thumbnail' );
518
  }
519
- else {
520
- imagefilledrectangle( $dst, 0, 0, $dst_size_w, $dst_size_h, $color );
 
521
  }
522
- }
523
 
524
- // Switch on what we have to do
525
- switch ( $type ) {
526
- case 'none': // Use aspect from fullsize image
527
- $src_x = 0;
528
- $src_y = 0;
529
- $src_w = $src_size_w;
530
- $src_h = $src_size_h;
531
- $dst_x = 0;
532
- $dst_y = 0;
533
- $dst_w = $dst_size_w;
534
- $dst_h = $dst_size_h;
535
- break;
536
- case 'clip': // Clip image to given aspect ratio
537
- if ( $src_asp < $dst_asp ) { // Source image more landscape than destination
538
- $dst_x = 0;
539
- $dst_y = 0;
540
- $dst_w = $dst_size_w;
541
- $dst_h = $dst_size_h;
542
- $src_x = round( ( $src_size_w - $src_size_h / $dst_asp ) / 2 );
543
- $src_y = 0;
544
- $src_w = round( $src_size_h / $dst_asp );
545
- $src_h = $src_size_h;
546
  }
547
  else {
548
- $dst_x = 0;
549
- $dst_y = 0;
550
- $dst_w = $dst_size_w;
551
- $dst_h = $dst_size_h;
552
- $src_x = 0;
553
- $src_y = round( ( $src_size_h - $src_size_w * $dst_asp ) / 2 );
554
- $src_w = $src_size_w;
555
- $src_h = round( $src_size_w * $dst_asp );
556
  }
557
- break;
558
- case 'padd': // Padd image to given aspect ratio
559
- if ( $src_asp < $dst_asp ) { // Source image more landscape than destination
560
- $dst_x = 0;
561
- $dst_y = round( ( $dst_size_h - $dst_size_w * $src_asp ) / 2 );
562
- $dst_w = $dst_size_w;
563
- $dst_h = round( $dst_size_w * $src_asp );
564
  $src_x = 0;
565
  $src_y = 0;
566
  $src_w = $src_size_w;
567
  $src_h = $src_size_h;
568
- }
569
- else {
570
- $dst_x = round( ( $dst_size_w - $dst_size_h / $src_asp ) / 2 );
571
  $dst_y = 0;
572
- $dst_w = round( $dst_size_h / $src_asp );
573
  $dst_h = $dst_size_h;
574
- $src_x = 0;
575
- $src_y = 0;
576
- $src_w = $src_size_w;
577
- $src_h = $src_size_h;
578
- }
579
- break;
580
- default: // Not implemented
581
- return false;
582
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
583
 
584
- // Copy left half if stereo
585
- if ( wppa_get_photo_item( $id, 'stereo' ) ) {
586
- $src_w /= 2;
587
- }
588
 
589
- // Do the copy
590
- imagecopyresampled( $dst, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
591
 
592
- // Save the thumb
593
- $thumbpath = wppa_strip_ext( $thumbpath );
594
- switch ( $mime ) { // mime type
595
- case 1:
596
- $full_thumbpath = $thumbpath . '.gif';
597
- imagegif( $dst, $full_thumbpath );
598
- break;
599
- case 2:
600
- $full_thumbpath = $thumbpath . '.jpg';
601
- imagejpeg( $dst, $full_thumbpath, wppa_opt( 'jpeg_quality' ) );
602
- break;
603
- case 3:
604
- $full_thumbpath = $thumbpath . '.png';
605
- imagepng( $dst, $full_thumbpath, 6 );
606
- break;
607
  }
608
- $thumbpath = $full_thumbpath;
609
 
610
- // Cleanup
611
- imagedestroy( $src );
612
- imagedestroy( $dst );
613
  }
614
 
615
  // Make sure file is accessible
2
  /* wppa-photo-files.php
3
  *
4
  * Functions used to create/manipulate photofiles
5
+ * Version 6.8.02
6
  *
7
  */
8
 
180
  }
181
 
182
  // If Resize on upload is checked
183
+ if ( wppa_switch( 'resize_on_upload' ) && wppa_can_resize( $file, max( $max_width, $max_height ) ) ) {
184
 
185
  // ImageMagick
186
  if ( wppa_opt( 'image_magick' ) ) {
319
  copy( $file, $newimage );
320
  }
321
  }
322
+ wppa_log('dbg', 'Max memory used: ' . sprintf( '%6.2f MB', memory_get_peak_usage( true ) / ( 1024 * 1024 ) ) );
323
  }
324
 
325
  // No resize on upload checked
459
  $src_size_w *= 2;
460
  }
461
 
462
+ // Enough memory?
463
+ if ( wppa_can_resize( $file, $max_side ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
 
465
+ // Image Magick?
466
+ if ( wppa_opt( 'image_magick' ) && $type == 'none' ) {
467
+ wppa_image_magick( 'convert "' . $file . '" -thumbnail ' . $max_side . 'x' . $max_side . ' ' . $thumbpath );
 
 
 
 
 
468
  }
469
 
470
+ // Classic GD
471
+ else {
472
+ // Create the source image
473
+ switch ( $mime ) { // mime type
474
+ case 1: // gif
475
+ $temp = @ imagecreatefromgif( $file );
476
+ if ( $temp ) {
477
+ $src = imagecreatetruecolor( $src_size_w, $src_size_h );
478
+ imagecopy( $src, $temp, 0, 0, 0, 0, $src_size_w, $src_size_h );
479
+ imagedestroy( $temp );
480
+ }
481
+ else $src = false;
482
+ break;
483
+ case 2: // jpeg
484
+ if ( ! function_exists( 'wppa_imagecreatefromjpeg' ) ) wppa_log( 'Error', 'Function wppa_imagecreatefromjpeg does not exist.' );
485
+ $src = @ wppa_imagecreatefromjpeg( $file );
486
+ break;
487
+ case 3: // png
488
+ $src = @ imagecreatefrompng( $file );
489
+ break;
490
+ }
491
+ if ( ! $src ) {
492
+ wppa_log( 'Error', 'Image file '.$file.' is corrupt while creating thmbnail' );
493
+ return true;
494
+ }
495
 
496
+ // Compute the destination image size
497
+ if ( $dst_asp < 1.0 ) { // Landscape
498
+ $dst_size_w = $max_side;
499
+ $dst_size_h = round( $max_side * $dst_asp );
 
 
 
 
 
500
  }
501
+ else { // Portrait
502
+ $dst_size_w = round( $max_side / $dst_asp );
503
+ $dst_size_h = $max_side;
504
  }
 
505
 
506
+ // Create the ( empty ) destination image
507
+ $dst = imagecreatetruecolor( $dst_size_w, $dst_size_h );
508
+ if ( $mime == 3 ) { // Png, save transparancy
509
+ imagealphablending( $dst, false );
510
+ imagesavealpha( $dst, true );
511
+ }
512
+
513
+ // Fill with the required color
514
+ $c = trim( strtolower( wppa_opt( 'bgcolor_thumbnail' ) ) );
515
+ if ( $c != '#000000' ) {
516
+ $r = hexdec( substr( $c, 1, 2 ) );
517
+ $g = hexdec( substr( $c, 3, 2 ) );
518
+ $b = hexdec( substr( $c, 5, 2 ) );
519
+ $color = imagecolorallocate( $dst, $r, $g, $b );
520
+ if ( $color === false ) {
521
+ wppa_log( 'Err', 'Unable to set background color to: '.$r.', '.$g.', '.$b.' in wppa_create_thumbnail' );
 
 
 
 
 
 
522
  }
523
  else {
524
+ imagefilledrectangle( $dst, 0, 0, $dst_size_w, $dst_size_h, $color );
 
 
 
 
 
 
 
525
  }
526
+ }
527
+
528
+ // Switch on what we have to do
529
+ switch ( $type ) {
530
+ case 'none': // Use aspect from fullsize image
 
 
531
  $src_x = 0;
532
  $src_y = 0;
533
  $src_w = $src_size_w;
534
  $src_h = $src_size_h;
535
+ $dst_x = 0;
 
 
536
  $dst_y = 0;
537
+ $dst_w = $dst_size_w;
538
  $dst_h = $dst_size_h;
539
+ break;
540
+ case 'clip': // Clip image to given aspect ratio
541
+ if ( $src_asp < $dst_asp ) { // Source image more landscape than destination
542
+ $dst_x = 0;
543
+ $dst_y = 0;
544
+ $dst_w = $dst_size_w;
545
+ $dst_h = $dst_size_h;
546
+ $src_x = round( ( $src_size_w - $src_size_h / $dst_asp ) / 2 );
547
+ $src_y = 0;
548
+ $src_w = round( $src_size_h / $dst_asp );
549
+ $src_h = $src_size_h;
550
+ }
551
+ else {
552
+ $dst_x = 0;
553
+ $dst_y = 0;
554
+ $dst_w = $dst_size_w;
555
+ $dst_h = $dst_size_h;
556
+ $src_x = 0;
557
+ $src_y = round( ( $src_size_h - $src_size_w * $dst_asp ) / 2 );
558
+ $src_w = $src_size_w;
559
+ $src_h = round( $src_size_w * $dst_asp );
560
+ }
561
+ break;
562
+ case 'padd': // Padd image to given aspect ratio
563
+ if ( $src_asp < $dst_asp ) { // Source image more landscape than destination
564
+ $dst_x = 0;
565
+ $dst_y = round( ( $dst_size_h - $dst_size_w * $src_asp ) / 2 );
566
+ $dst_w = $dst_size_w;
567
+ $dst_h = round( $dst_size_w * $src_asp );
568
+ $src_x = 0;
569
+ $src_y = 0;
570
+ $src_w = $src_size_w;
571
+ $src_h = $src_size_h;
572
+ }
573
+ else {
574
+ $dst_x = round( ( $dst_size_w - $dst_size_h / $src_asp ) / 2 );
575
+ $dst_y = 0;
576
+ $dst_w = round( $dst_size_h / $src_asp );
577
+ $dst_h = $dst_size_h;
578
+ $src_x = 0;
579
+ $src_y = 0;
580
+ $src_w = $src_size_w;
581
+ $src_h = $src_size_h;
582
+ }
583
+ break;
584
+ default: // Not implemented
585
+ return false;
586
+ }
587
 
588
+ // Copy left half if stereo
589
+ if ( wppa_get_photo_item( $id, 'stereo' ) ) {
590
+ $src_w /= 2;
591
+ }
592
 
593
+ // Do the copy
594
+ imagecopyresampled( $dst, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
595
+
596
+ // Save the thumb
597
+ $thumbpath = wppa_strip_ext( $thumbpath );
598
+ switch ( $mime ) { // mime type
599
+ case 1:
600
+ $full_thumbpath = $thumbpath . '.gif';
601
+ imagegif( $dst, $full_thumbpath );
602
+ break;
603
+ case 2:
604
+ $full_thumbpath = $thumbpath . '.jpg';
605
+ imagejpeg( $dst, $full_thumbpath, wppa_opt( 'jpeg_quality' ) );
606
+ break;
607
+ case 3:
608
+ $full_thumbpath = $thumbpath . '.png';
609
+ imagepng( $dst, $full_thumbpath, 6 );
610
+ break;
611
+ }
612
+ $thumbpath = $full_thumbpath;
613
 
614
+ // Cleanup
615
+ imagedestroy( $src );
616
+ imagedestroy( $dst );
 
 
 
 
 
 
 
 
 
 
 
 
617
  }
618
+ }
619
 
620
+ // Too litlle memory
621
+ else {
622
+ copy( $file, $thumbpath );
623
  }
624
 
625
  // Make sure file is accessible
wppa-session.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all session routines
6
- * Version 6.8.00
7
  *
8
  * Firefox modifies data in the superglobal $_SESSION.
9
  * See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
@@ -75,15 +75,17 @@ global $wppa_session;
75
  }
76
 
77
  $wppa_session = array();
78
- $wppa_session['page'] = '0';
79
- $wppa_session['ajax'] = '0';
80
- $wppa_session['id'] = $iret;
81
- $wppa_session['user'] = wppa_get_user();
 
82
  }
83
 
84
  // Session exists, Update counter
85
  else {
86
  $wppa_session = unserialize( $data );
 
87
  $wpdb->query( $wpdb->prepare( "UPDATE `" . WPPA_SESSION . "` SET `count` = %s WHERE `id` = %s", $session['count'] + '1', $session['id'] ) );
88
  }
89
 
@@ -132,7 +134,7 @@ global $wppa_session;
132
  'id' => '0',
133
  'uris' => array(),
134
  'isrobot' => false,
135
-
136
  );
137
 
138
  $wppa_session = wp_parse_args( $wppa_session, $defaults );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all session routines
6
+ * Version 6.8.02
7
  *
8
  * Firefox modifies data in the superglobal $_SESSION.
9
  * See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
75
  }
76
 
77
  $wppa_session = array();
78
+ $wppa_session['page'] = '0';
79
+ $wppa_session['ajax'] = '0';
80
+ $wppa_session['id'] = $iret;
81
+ $wppa_session['user'] = wppa_get_user();
82
+ $wppa_session['wfcart'] = null;
83
  }
84
 
85
  // Session exists, Update counter
86
  else {
87
  $wppa_session = unserialize( $data );
88
+
89
  $wpdb->query( $wpdb->prepare( "UPDATE `" . WPPA_SESSION . "` SET `count` = %s WHERE `id` = %s", $session['count'] + '1', $session['id'] ) );
90
  }
91
 
134
  'id' => '0',
135
  'uris' => array(),
136
  'isrobot' => false,
137
+ 'wfcart' => null,
138
  );
139
 
140
  $wppa_session = wp_parse_args( $wppa_session, $defaults );
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 6.8.01
7
  *
8
  */
9
 
@@ -3761,6 +3761,60 @@ global $wppa_supported_camara_brands;
3761
  $tags = 'system,layout';
3762
  wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags);
3763
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3764
  $name = __('Use customized style file', 'wp-photo-album-plus');
3765
  $desc = __('This feature is highly discouraged.', 'wp-photo-album-plus');
3766
  $help = '';
@@ -6435,6 +6489,18 @@ global $wppa_supported_camara_brands;
6435
  $tags = 'access,album';
6436
  wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags);
6437
 
 
 
 
 
 
 
 
 
 
 
 
 
6438
  // User upload limits
6439
  $options = array( __('for ever', 'wp-photo-album-plus'),
6440
  __('per hour', 'wp-photo-album-plus'),
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 6.8.02
7
  *
8
  */
9
 
3761
  $tags = 'system,layout';
3762
  wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags);
3763
 
3764
+ $name = __('Custom style Chrome', 'wp-photo-album-plus');
3765
+ $desc = __('Enter browser specific custom style specs here', 'wp-photo-album-plus');
3766
+ $help = '';
3767
+ $slug = 'wppa_custom_style_chrome';
3768
+ $html = wppa_textarea($slug, $name);
3769
+ $clas = '';
3770
+ $tags = 'system,layout';
3771
+ wppa_setting($slug, '15.1', $name, $desc, $html, $help, $clas, $tags);
3772
+
3773
+ $name = __('Custom style Firefox', 'wp-photo-album-plus');
3774
+ $desc = __('Enter browser specific custom style specs here', 'wp-photo-album-plus');
3775
+ $help = '';
3776
+ $slug = 'wppa_custom_style_firefox';
3777
+ $html = wppa_textarea($slug, $name);
3778
+ $clas = '';
3779
+ $tags = 'system,layout';
3780
+ wppa_setting($slug, '15.2', $name, $desc, $html, $help, $clas, $tags);
3781
+
3782
+ $name = __('Custom style Safari', 'wp-photo-album-plus');
3783
+ $desc = __('Enter browser specific custom style specs here', 'wp-photo-album-plus');
3784
+ $help = '';
3785
+ $slug = 'wppa_custom_style_safari';
3786
+ $html = wppa_textarea($slug, $name);
3787
+ $clas = '';
3788
+ $tags = 'system,layout';
3789
+ wppa_setting($slug, '15.4', $name, $desc, $html, $help, $clas, $tags);
3790
+
3791
+ $name = __('Custom style Edge', 'wp-photo-album-plus');
3792
+ $desc = __('Enter browser specific custom style specs here', 'wp-photo-album-plus');
3793
+ $help = '';
3794
+ $slug = 'wppa_custom_style_edge';
3795
+ $html = wppa_textarea($slug, $name);
3796
+ $clas = '';
3797
+ $tags = 'system,layout';
3798
+ wppa_setting($slug, '15.5', $name, $desc, $html, $help, $clas, $tags);
3799
+
3800
+ $name = __('Custom style IE', 'wp-photo-album-plus');
3801
+ $desc = __('Enter browser specific custom style specs here', 'wp-photo-album-plus');
3802
+ $help = '';
3803
+ $slug = 'wppa_custom_style_ie';
3804
+ $html = wppa_textarea($slug, $name);
3805
+ $clas = '';
3806
+ $tags = 'system,layout';
3807
+ wppa_setting($slug, '15.6', $name, $desc, $html, $help, $clas, $tags);
3808
+
3809
+ $name = __('Custom style Opera', 'wp-photo-album-plus');
3810
+ $desc = __('Enter browser specific custom style specs here', 'wp-photo-album-plus');
3811
+ $help = '';
3812
+ $slug = 'wppa_custom_style_opera';
3813
+ $html = wppa_textarea($slug, $name);
3814
+ $clas = '';
3815
+ $tags = 'system,layout';
3816
+ wppa_setting($slug, '15.7', $name, $desc, $html, $help, $clas, $tags);
3817
+
3818
  $name = __('Use customized style file', 'wp-photo-album-plus');
3819
  $desc = __('This feature is highly discouraged.', 'wp-photo-album-plus');
3820
  $help = '';
6489
  $tags = 'access,album';
6490
  wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags);
6491
 
6492
+ $name = __('Fe limts per album', 'wp-photo-album-plus');
6493
+ $desc = __('The following limits apply to individual albums', 'wp-photo-album-plus');
6494
+ $help = __('If this box is ticked, users can upload the limit on every album they have fe upload rights to', 'wp-photo-album-plus');
6495
+ $help .= '<br />'.__('If this box is unticked, the limits apply to all the users uploads in the system regardless of the album(s)');
6496
+ $slug = 'wppa_role_limit_per_album';
6497
+ $html1 = wppa_checkbox($slug);
6498
+ $html2 = '';
6499
+ $html = array( $html1, $html2 );
6500
+ $clas = '';
6501
+ $tags = 'access,upload';
6502
+ wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
6503
+
6504
  // User upload limits
6505
  $options = array( __('for ever', 'wp-photo-album-plus'),
6506
  __('per hour', 'wp-photo-album-plus'),
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 6.8.01
7
  *
8
  */
9
 
@@ -1171,6 +1171,12 @@ Hide Camera info
1171
  'wppa_defer_javascript' => 'no',
1172
  'wppa_inline_css' => 'yes',
1173
  'wppa_custom_style' => '',
 
 
 
 
 
 
1174
  'wppa_use_custom_style_file' => 'no',
1175
  'wppa_js_css_optional' => 'no',
1176
  'wppa_enable_pdf' => 'no', // IV-A30
@@ -1484,6 +1490,8 @@ Hide Camera info
1484
  'wppa_loggedout_upload_limit_count' => '0',
1485
  'wppa_loggedout_upload_limit_time' => '0',
1486
 
 
 
1487
  'wppa_blacklist_user' => '',
1488
  'wppa_un_blacklist_user' => '',
1489
  'wppa_photo_owner_change' => 'no',
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 6.8.02
7
  *
8
  */
9
 
1171
  'wppa_defer_javascript' => 'no',
1172
  'wppa_inline_css' => 'yes',
1173
  'wppa_custom_style' => '',
1174
+ 'wppa_custom_style_chrome' => '',
1175
+ 'wppa_custom_style_firefox' => '',
1176
+ 'wppa_custom_style_safari' => '',
1177
+ 'wppa_custom_style_edge' => '',
1178
+ 'wppa_custom_style_ie' => '',
1179
+ 'wppa_custom_style_opera' => '',
1180
  'wppa_use_custom_style_file' => 'no',
1181
  'wppa_js_css_optional' => 'no',
1182
  'wppa_enable_pdf' => 'no', // IV-A30
1490
  'wppa_loggedout_upload_limit_count' => '0',
1491
  'wppa_loggedout_upload_limit_time' => '0',
1492
 
1493
+ 'wppa_role_limit_per_album' => 'no',
1494
+
1495
  'wppa_blacklist_user' => '',
1496
  'wppa_un_blacklist_user' => '',
1497
  'wppa_photo_owner_change' => 'no',
wppa-statistics.php CHANGED
@@ -271,7 +271,7 @@ global $wppa_session;
271
  }
272
  }
273
 
274
- wppa_save_session();
275
  }
276
 
277
  function wppa_get_upldr_cache() {
271
  }
272
  }
273
 
274
+ // wppa_save_session();
275
  }
276
 
277
  function wppa_get_upldr_cache() {
wppa-styles.php CHANGED
@@ -3,7 +3,7 @@
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
- /* Version 6.8.01
7
  /*
8
  */
9
 
@@ -248,13 +248,6 @@ global $wppa_dynamic_css_data;
248
  ' . ( wppa_opt( 'bcolor_adminschoice' ) ? 'border-color:' . wppa_opt( 'bcolor_adminschoice' ) . '; ' : '' ) . '
249
  }';
250
 
251
- /*
252
- $content .= '
253
- .wppa-arrow {
254
- ' . ( wppa_opt( 'arrow_color' ) ? 'color:' . wppa_opt( 'arrow_color' ) . '; ' : '' ) . '
255
- }';
256
- */
257
-
258
  // Add miscellaneous styles
259
  if ( ! wppa_switch( 'ovl_fs_icons' ) ) {
260
  $content .= '
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
+ /* Version 6.8.02
7
  /*
8
  */
9
 
248
  ' . ( wppa_opt( 'bcolor_adminschoice' ) ? 'border-color:' . wppa_opt( 'bcolor_adminschoice' ) . '; ' : '' ) . '
249
  }';
250
 
 
 
 
 
 
 
 
251
  // Add miscellaneous styles
252
  if ( ! wppa_switch( 'ovl_fs_icons' ) ) {
253
  $content .= '
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.01
7
  *
8
  */
9
 
@@ -1368,8 +1368,13 @@ global $wpdb;
1368
  }
1369
  }
1370
 
1371
- // Delete sourcefile
1372
- wppa_delete_source( $photoinfo['filename'], $album);
 
 
 
 
 
1373
 
1374
  // Delete fullsize image
1375
  $file = wppa_get_photo_path( $photo );
@@ -1647,7 +1652,7 @@ global $wppa_log_file;
1647
  }
1648
  break;
1649
  case 'd':
1650
- $type = '{span style="color:orange;" }Dbg{/span}';
1651
  break;
1652
  case 'e':
1653
  $type = '{span style="color:red;" }Err{/span}';
@@ -1672,7 +1677,7 @@ global $wppa_log_file;
1672
  $type = 'Upl';
1673
  break;
1674
  case 'w':
1675
- $type = '{span style="color:yellow;" }War{/span}';
1676
  break;
1677
  default:
1678
  $type = 'Misc';
@@ -1709,7 +1714,7 @@ global $wppa_log_file;
1709
  // Write log message
1710
  $msg = strip_tags( $msg );
1711
 
1712
- @ fwrite( $file, '{b}'.$type.'{/b}: on:'.wppa_local_date(get_option('date_format', "F j, Y,").' '.get_option('time_format', "g:i a"), time()).': '.wppa_get_user().': '.$msg."\n" );
1713
 
1714
  // Log current url and stacktrace 12 levels if trace requested
1715
  if ( $trace || $type == 'Dbg' ) {
@@ -2974,6 +2979,43 @@ function wppa_is_iphoneoripad() {
2974
  return $result;
2975
  }
2976
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2977
  // Like wp_nonce_field
2978
  // To prevent duplicate id's, we externally add an id number ( e.g. album ) and internally the mocc number.
2979
  function wppa_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true, $wppa_id = '0' ) {
@@ -3595,30 +3637,6 @@ function wppa_get_mime_type( $id ) {
3595
  return $result;
3596
  }
3597
 
3598
- function wppa_is_ie() {
3599
-
3600
- $result = false;
3601
- if ( isset ( $_SERVER["HTTP_USER_AGENT"] ) ) {
3602
- if ( strpos( $_SERVER["HTTP_USER_AGENT"], 'Trident' ) !== false ) {
3603
- $result = true;
3604
- }
3605
- }
3606
-
3607
- return $result;
3608
- }
3609
-
3610
- function wppa_is_safari() {
3611
-
3612
- $result = false;
3613
- if ( isset ( $_SERVER["HTTP_USER_AGENT"] ) ) {
3614
- if ( strpos( $_SERVER["HTTP_USER_AGENT"], 'Safari' ) !== false ) {
3615
- $result = true;
3616
- }
3617
- }
3618
-
3619
- return $result;
3620
- }
3621
-
3622
  function wppa_chmod( $fso ) {
3623
 
3624
  $fso = rtrim( $fso, '/' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 6.8.02
7
  *
8
  */
9
 
1368
  }
1369
  }
1370
 
1371
+ // If still a photo with the same name exists in the original album, do not delete tge source
1372
+ $still_exists = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `filename` = %s AND `album` = %s", $photoinfo['filename'], $album ) );
1373
+ if ( ! $still_exists ) {
1374
+
1375
+ // Delete sourcefile
1376
+ wppa_delete_source( $photoinfo['filename'], $album );
1377
+ }
1378
 
1379
  // Delete fullsize image
1380
  $file = wppa_get_photo_path( $photo );
1652
  }
1653
  break;
1654
  case 'd':
1655
+ $type = '{span style="color:gray;" }Dbg{/span}';
1656
  break;
1657
  case 'e':
1658
  $type = '{span style="color:red;" }Err{/span}';
1677
  $type = 'Upl';
1678
  break;
1679
  case 'w':
1680
+ $type = '{span style="color:orange;" }War{/span}';
1681
  break;
1682
  default:
1683
  $type = 'Misc';
1714
  // Write log message
1715
  $msg = strip_tags( $msg );
1716
 
1717
+ @ fwrite( $file, '{b}'.$type.'{/b}: on:'.wppa_local_date( 'd.m.Y H:i:s', time()).': '.wppa_get_user().': '.$msg."\n" );
1718
 
1719
  // Log current url and stacktrace 12 levels if trace requested
1720
  if ( $trace || $type == 'Dbg' ) {
2979
  return $result;
2980
  }
2981
 
2982
+ function wppa_is_chrome() {
2983
+ return ( get_browser_name() == 'Chrome' );
2984
+ }
2985
+
2986
+ function wppa_is_firefox() {
2987
+ return ( get_browser_name() == 'Firefox' );
2988
+ }
2989
+
2990
+ function wppa_is_edge() {
2991
+ return ( get_browser_name() == 'Edge' );
2992
+ }
2993
+
2994
+ function wppa_is_ie() {
2995
+ return ( get_browser_name() == 'Internet Explorer' );
2996
+ }
2997
+
2998
+ function wppa_is_safari() {
2999
+ return ( get_browser_name() == 'Safari' );
3000
+ }
3001
+
3002
+ function wppa_is_opera() {
3003
+ return ( get_browser_name() == 'Opera' );
3004
+ }
3005
+
3006
+ function get_browser_name() {
3007
+ $user_agent = isset ( $_SERVER["HTTP_USER_AGENT"] ) ? $_SERVER["HTTP_USER_AGENT"] : '';
3008
+ if ( $user_agent ) {
3009
+ if (strpos($user_agent, 'Opera') || strpos($user_agent, 'OPR/')) return 'Opera';
3010
+ elseif (strpos($user_agent, 'Edge')) return 'Edge';
3011
+ elseif (strpos($user_agent, 'Chrome')) return 'Chrome';
3012
+ elseif (strpos($user_agent, 'Safari')) return 'Safari';
3013
+ elseif (strpos($user_agent, 'Firefox')) return 'Firefox';
3014
+ elseif (strpos($user_agent, 'MSIE') || strpos($user_agent, 'Trident/7')) return 'Internet Explorer';
3015
+ }
3016
+ return 'Other';
3017
+ }
3018
+
3019
  // Like wp_nonce_field
3020
  // To prevent duplicate id's, we externally add an id number ( e.g. album ) and internally the mocc number.
3021
  function wppa_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true, $wppa_id = '0' ) {
3637
  return $result;
3638
  }
3639
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3640
  function wppa_chmod( $fso ) {
3641
 
3642
  $fso = rtrim( $fso, '/' );
wppa-watermark.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-watermark.php
3
  *
4
  * Functions used for the application of watermarks
5
- * Version 6.7.01
6
  *
7
  */
8
 
@@ -416,10 +416,18 @@ function wppa_add_watermark( $id ) {
416
  $file = wppa_get_photo_path( $id );
417
 
418
  if ( ! is_file( $file ) ) return false; // File gone
 
419
  $photosize = getimagesize( $file );
420
  if ( ! is_array( $photosize ) ) {
421
  return false; // Not a valid photo
422
  }
 
 
 
 
 
 
 
423
  switch ( $photosize[2] ) {
424
  case 1: $tempimage = imagecreatefromgif( $file );
425
  $photoimage = imagecreatetruecolor( $photosize[0], $photosize[1] );
2
  /* wppa-watermark.php
3
  *
4
  * Functions used for the application of watermarks
5
+ * Version 6.8.02
6
  *
7
  */
8
 
416
  $file = wppa_get_photo_path( $id );
417
 
418
  if ( ! is_file( $file ) ) return false; // File gone
419
+
420
  $photosize = getimagesize( $file );
421
  if ( ! is_array( $photosize ) ) {
422
  return false; // Not a valid photo
423
  }
424
+
425
+ // Enough memory?
426
+ if ( ! wppa_can_resize( $file, 0, false ) ) {
427
+ wppa_log( 'War', 'Too little memory to add watermark on ' . $file );
428
+ return false;
429
+ }
430
+
431
  switch ( $photosize[2] ) {
432
  case 1: $tempimage = imagecreatefromgif( $file );
433
  $photoimage = imagecreatetruecolor( $photosize[0], $photosize[1] );
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.01.011
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 = '6801'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '6-8-01-011'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );
@@ -123,7 +123,7 @@ define( 'WPPA_DEBUG', false );
123
  add_action( 'init', 'wppa_session_start', 1 );
124
 
125
  /* Init path and url constants */
126
- add_action( 'init', 'wppa_init_path_and_url_constants', 7 );
127
 
128
  /* Load language */
129
  add_action( 'plugins_loaded', 'wppa_load_plugin_textdomain' );
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.02
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 = '6802'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '6-8-02-011'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );
123
  add_action( 'init', 'wppa_session_start', 1 );
124
 
125
  /* Init path and url constants */
126
+ add_action( 'init', 'wppa_init_path_and_url_constants', 1 );
127
 
128
  /* Load language */
129
  add_action( 'plugins_loaded', 'wppa_load_plugin_textdomain' );