WP Photo Album Plus - Version 6.6.19

Version Description

Download this release

Release Info

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

Code changes from version 6.6.18 to 6.6.19

js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 6.6.18
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -1014,8 +1014,18 @@ function wppaAjaxDeletePhoto(photo, bef, aft) {
1014
 
1015
  var before = '';
1016
  var after = '';
1017
- if ( bef ) before = bef;
1018
- if ( aft ) after = aft;
 
 
 
 
 
 
 
 
 
 
1019
 
1020
  wppaFeAjaxLog('in');
1021
 
@@ -1068,6 +1078,58 @@ function wppaAjaxDeletePhoto(photo, bef, aft) {
1068
  }
1069
  }
1070
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1071
  function wppaAjaxApplyWatermark(photo, file, pos) {
1072
 
1073
  wppaFeAjaxLog('in');
@@ -2308,6 +2370,10 @@ function wppaEditSearch( url, id ) {
2308
  }
2309
  }
2310
 
 
 
 
 
2311
  function wppaExportDbTable( table ) {
2312
  jQuery.ajax( { url: wppaAjaxUrl,
2313
  data: 'action=wppa' +
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 6.6.19
5
  /* Various js routines used in admin pages
6
  */
7
 
1014
 
1015
  var before = '';
1016
  var after = '';
1017
+ if ( bef ) {
1018
+ before = bef;
1019
+ }
1020
+ else {
1021
+ before = '<div style="padding-left:5px;" >';
1022
+ }
1023
+ if ( aft ) {
1024
+ after = aft;
1025
+ }
1026
+ else {
1027
+ aftrer = '</div>';
1028
+ }
1029
 
1030
  wppaFeAjaxLog('in');
1031
 
1078
  }
1079
  }
1080
 
1081
+ function wppaAjaxUndeletePhoto(photo) {
1082
+
1083
+ wppaFeAjaxLog('in');
1084
+
1085
+ var xmlhttp = wppaGetXmlHttp();
1086
+
1087
+ // Make the Ajax url
1088
+ var url = wppaAjaxUrl+'?action=wppa&wppa-action=undelete-photo&photo-id='+photo;
1089
+ url += '&wppa-nonce='+document.getElementById('photo-nonce-'+photo).value;
1090
+
1091
+ // Do the Ajax action
1092
+ xmlhttp.open('GET',url,true);
1093
+ xmlhttp.send();
1094
+
1095
+ // Process the result
1096
+ xmlhttp.onreadystatechange=function() {
1097
+ switch (xmlhttp.readyState) {
1098
+ case 1:
1099
+ document.getElementById('photostatus-'+photo).innerHTML = 'server connection established';
1100
+ break;
1101
+ case 2:
1102
+ document.getElementById('photostatus-'+photo).innerHTML = 'request received';
1103
+ break;
1104
+ case 3:
1105
+ document.getElementById('photostatus-'+photo).innerHTML = 'processing request';
1106
+ break;
1107
+ case 4:
1108
+ if ( xmlhttp.status == 200 ) {
1109
+
1110
+ var str = wppaTrim(xmlhttp.responseText);
1111
+ var ArrValues = str.split("||");
1112
+ if ( ArrValues[0] == 'ER' ) {
1113
+ alert(ArrValues[3]);
1114
+ jQuery('#wppa-delete-'+photo).css('text-decoration','line-through');
1115
+ }
1116
+ else if (ArrValues[0] != '') {
1117
+ alert('The server returned unexpected output:\n'+ArrValues[0]);
1118
+ }
1119
+
1120
+ if ( ArrValues[1] == 0 ) document.getElementById('photostatus-'+photo).innerHTML = ArrValues[2]; // Error
1121
+ else {
1122
+ document.getElementById('photoitem-'+photo).innerHTML = '<div style="padding-left:5px;" >' + ArrValues[2] + '</div>'; // OK
1123
+ }
1124
+ wppaFeAjaxLog('out');
1125
+ }
1126
+ else { // status != 200
1127
+ document.getElementById('photoitem-'+photo).innerHTML = before+'<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>'+after;
1128
+ }
1129
+ }
1130
+ }
1131
+ }
1132
+
1133
  function wppaAjaxApplyWatermark(photo, file, pos) {
1134
 
1135
  wppaFeAjaxLog('in');
2370
  }
2371
  }
2372
 
2373
+ function wppaEditTrash( url ) {
2374
+ document.location.href = url;
2375
+ }
2376
+
2377
  function wppaExportDbTable( table ) {
2378
  jQuery.ajax( { url: wppaAjaxUrl,
2379
  data: 'action=wppa' +
js/wppa-ajax-front.js CHANGED
@@ -3,7 +3,7 @@
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
- var wppaJsAjaxVersion = '6.6.13';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
@@ -1046,7 +1046,28 @@ function wppaUpdatePhotoNew(id) {
1046
 
1047
  }
1048
  } );
 
 
 
 
 
 
 
 
 
1049
 
 
 
 
 
 
 
 
 
 
 
 
 
1050
  }
1051
 
1052
  // Log we're in.
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsAjaxVersion = '6.6.19';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
1046
 
1047
  }
1048
  } );
1049
+ }
1050
+
1051
+ // Get qrcode and put it as src in elm
1052
+ function wppaAjaxSetQrCodeSrc( url, elm ) {
1053
+
1054
+ var myData = 'action=wppa' +
1055
+ '&wppa-action=getqrcode' +
1056
+ '&wppa-qr-nonce=' + jQuery( '#wppa-qr-nonce' ).val() +
1057
+ '&url=' + encodeURIComponent( url );
1058
 
1059
+ jQuery.ajax( { url: wppaAjaxUrl,
1060
+ data: myData,
1061
+ async: true,
1062
+ type: 'POST',
1063
+ timeout: 10000,
1064
+ success: function( result, status, xhr ) {
1065
+ document.getElementById( elm ).src = result;
1066
+ },
1067
+ error: function( xhr, status, error ) {
1068
+ wppaConsoleLog( 'wppaAjaxSetQrCodeSrc failed. Error = ' + error + ', status = ' + status, 'force' );
1069
+ }
1070
+ } );
1071
  }
1072
 
1073
  // Log we're in.
js/wppa-ajax-front.min.js CHANGED
@@ -4,7 +4,7 @@
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
- var wppaJsAjaxVersion='6.6.13';var wppaRenderAdd=false;var wppaWaitForCounter=0;function wppaDoAjaxRender(mocc,ajaxurl,newurl,add,waitfor,addHilite){if(parseInt(waitfor)>0&&waitfor!=wppaWaitForCounter){setTimeout('wppaDoAjaxRender( '+mocc+', \''+ajaxurl+'\', \''+newurl+'\', \''+add+'\', '+waitfor+' )',100);return;}
8
  wppaRenderAdd=add;if(wppaLang!='')ajaxurl+='&lang='+wppaLang;if(wppaAutoColumnWidth[mocc])ajaxurl+='&resp=1';if(addHilite&&_wppaCurIdx[mocc]&&_wppaId[mocc][_wppaCurIdx[mocc]])ajaxurl+='&wppa-hilite='+_wppaId[mocc][_wppaCurIdx[mocc]];if(wppaCanAjaxRender){jQuery.ajax({url:ajaxurl,async:true,type:'GET',timeout:60000,beforeSend:function(xhr){if(_wppaSSRuns[mocc])_wppaStop(mocc);jQuery('#wppa-ajax-spin-'+mocc).css('display','');},success:function(result,status,xhr){if(wppaRenderAdd){jQuery(wppaRenderAdd+result).insertBefore('#wppa-container-'+mocc+'-end');}
9
  else{if(wppaRenderModal){var opt={modal:true,resizable:true,width:wppaGetContainerWidth(mocc),show:{effect:"fadeIn",duration:400},closeText:"",};jQuery('#wppa-modal-container-'+mocc).html(result).dialog(opt).dialog("open");jQuery('.ui-dialog').css({boxShadow:'0px 0px 5px 5px #aaaaaa',borderRadius:wppaBoxRadius+'px',padding:'8px',backgroundColor:wppaModalBgColor,boxSizing:'content-box',zIndex:100000,});jQuery('.ui-dialog-titlebar').css({lineHeight:'0px',height:'32px',});jQuery('.ui-button').css({backgroundImage:wppaModalQuitImg,padding:0,position:'absolute',right:'8px',top:'8px',width:'16px',height:'16px',});jQuery('.ui-button').attr('title','Close');jQuery('.ui-button').on('click',function(){_wppaStop(mocc);});}
10
  else{jQuery('#wppa-container-'+mocc).html(result);}}
@@ -74,4 +74,5 @@ wppaOpenComments(mocc);},error:function(xhr,status,error){wppaConsoleLog('wppaAj
74
  function wppaUpdatePhotoNew(id){var myItems=['name','description','tags','custom_0','custom_1','custom_2','custom_3','custom_4','custom_5','custom_6','custom_7','custom_8','custom_9'];var myData='action=wppa'+'&wppa-action=update-photo-new'+'&photo-id='+id+'&wppa-nonce='+jQuery('#wppa-nonce-'+id).val();var i=0;while(i<myItems.length){if(typeof(jQuery('#'+myItems[i]).val())!='undefined'){myData+='&'+myItems[i]+'='+jQuery('#'+myItems[i]).val();}
75
  i++;}
76
  jQuery.ajax({url:wppaAjaxUrl,data:myData,async:false,type:'POST',timeout:10000,beforeSend:function(xhr){},success:function(result,status,xhr){if(result.length>0){alert(result);}},error:function(xhr,status,error){alert(result);wppaConsoleLog('wppaUpdatePhotoNew failed. Error = '+error+', status = '+status,'force');},complete:function(xhr,status,newurl){}});}
 
77
  wppaConsoleLog('wppa-ajax-front.js version '+wppaJsAjaxVersion+' loaded.','force');
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
+ var wppaJsAjaxVersion='6.6.19';var wppaRenderAdd=false;var wppaWaitForCounter=0;function wppaDoAjaxRender(mocc,ajaxurl,newurl,add,waitfor,addHilite){if(parseInt(waitfor)>0&&waitfor!=wppaWaitForCounter){setTimeout('wppaDoAjaxRender( '+mocc+', \''+ajaxurl+'\', \''+newurl+'\', \''+add+'\', '+waitfor+' )',100);return;}
8
  wppaRenderAdd=add;if(wppaLang!='')ajaxurl+='&lang='+wppaLang;if(wppaAutoColumnWidth[mocc])ajaxurl+='&resp=1';if(addHilite&&_wppaCurIdx[mocc]&&_wppaId[mocc][_wppaCurIdx[mocc]])ajaxurl+='&wppa-hilite='+_wppaId[mocc][_wppaCurIdx[mocc]];if(wppaCanAjaxRender){jQuery.ajax({url:ajaxurl,async:true,type:'GET',timeout:60000,beforeSend:function(xhr){if(_wppaSSRuns[mocc])_wppaStop(mocc);jQuery('#wppa-ajax-spin-'+mocc).css('display','');},success:function(result,status,xhr){if(wppaRenderAdd){jQuery(wppaRenderAdd+result).insertBefore('#wppa-container-'+mocc+'-end');}
9
  else{if(wppaRenderModal){var opt={modal:true,resizable:true,width:wppaGetContainerWidth(mocc),show:{effect:"fadeIn",duration:400},closeText:"",};jQuery('#wppa-modal-container-'+mocc).html(result).dialog(opt).dialog("open");jQuery('.ui-dialog').css({boxShadow:'0px 0px 5px 5px #aaaaaa',borderRadius:wppaBoxRadius+'px',padding:'8px',backgroundColor:wppaModalBgColor,boxSizing:'content-box',zIndex:100000,});jQuery('.ui-dialog-titlebar').css({lineHeight:'0px',height:'32px',});jQuery('.ui-button').css({backgroundImage:wppaModalQuitImg,padding:0,position:'absolute',right:'8px',top:'8px',width:'16px',height:'16px',});jQuery('.ui-button').attr('title','Close');jQuery('.ui-button').on('click',function(){_wppaStop(mocc);});}
10
  else{jQuery('#wppa-container-'+mocc).html(result);}}
74
  function wppaUpdatePhotoNew(id){var myItems=['name','description','tags','custom_0','custom_1','custom_2','custom_3','custom_4','custom_5','custom_6','custom_7','custom_8','custom_9'];var myData='action=wppa'+'&wppa-action=update-photo-new'+'&photo-id='+id+'&wppa-nonce='+jQuery('#wppa-nonce-'+id).val();var i=0;while(i<myItems.length){if(typeof(jQuery('#'+myItems[i]).val())!='undefined'){myData+='&'+myItems[i]+'='+jQuery('#'+myItems[i]).val();}
75
  i++;}
76
  jQuery.ajax({url:wppaAjaxUrl,data:myData,async:false,type:'POST',timeout:10000,beforeSend:function(xhr){},success:function(result,status,xhr){if(result.length>0){alert(result);}},error:function(xhr,status,error){alert(result);wppaConsoleLog('wppaUpdatePhotoNew failed. Error = '+error+', status = '+status,'force');},complete:function(xhr,status,newurl){}});}
77
+ function wppaAjaxSetQrCodeSrc(url,elm){var myData='action=wppa'+'&wppa-action=getqrcode'+'&wppa-qr-nonce='+jQuery('#wppa-qr-nonce').val()+'&url='+encodeURIComponent(url);jQuery.ajax({url:wppaAjaxUrl,data:myData,async:true,type:'POST',timeout:10000,success:function(result,status,xhr){document.getElementById(elm).src=result;},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxSetQrCodeSrc failed. Error = '+error+', status = '+status,'force');}});}
78
  wppaConsoleLog('wppa-ajax-front.js version '+wppaJsAjaxVersion+' loaded.','force');
js/wppa-slideshow.js CHANGED
@@ -3,7 +3,7 @@
3
  // Contains slideshow modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
- var wppaJsSlideshowVersion = '6.6.16';
7
 
8
  // This is an entrypoint to load the slide data
9
  function wppaStoreSlideInfo(
@@ -800,11 +800,11 @@ function _wppaNextSlide_5( mocc ) {
800
  }
801
 
802
  // Push state if not slphoto
803
- if ( ! _wppaSSRuns[mocc] ) { // This is not running
804
  if ( _wppaSlides[mocc].length > 1 ) {
805
  wppaPushStateSlide( mocc, _wppaCurIdx[mocc], visurl );
806
  }
807
- }
808
  }
809
 
810
  // If running: Wait for next slide
3
  // Contains slideshow modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsSlideshowVersion = '6.6.19';
7
 
8
  // This is an entrypoint to load the slide data
9
  function wppaStoreSlideInfo(
800
  }
801
 
802
  // Push state if not slphoto
803
+ // if ( ! _wppaSSRuns[mocc] ) { // This is not running
804
  if ( _wppaSlides[mocc].length > 1 ) {
805
  wppaPushStateSlide( mocc, _wppaCurIdx[mocc], visurl );
806
  }
807
+ // }
808
  }
809
 
810
  // If running: Wait for next slide
js/wppa-slideshow.min.js CHANGED
@@ -4,7 +4,7 @@
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
- var wppaJsSlideshowVersion='6.6.16';function wppaStoreSlideInfo(mocc,id,url,size,width,height,fullname,name,desc,photoid,avgrat,discount,myrat,rateurl,linkurl,linktitle,linktarget,iwtimeout,commenthtml,iptchtml,exifhtml,lbtitle,shareurl,smhtml,ogdsc,hiresurl,videohtml,audiohtml,waittext,imagealt,posterurl){var cursor;desc=wppaRepairScriptTags(desc);if(!_wppaSlides[mocc]||'0'==id){_wppaSlides[mocc]=[];_wppaNames[mocc]=[];_wppaFullNames[mocc]=[];_wppaDsc[mocc]=[];_wppaOgDsc[mocc]=[];_wppaCurIdx[mocc]=-1;_wppaNxtIdx[mocc]=0;if(parseInt(iwtimeout)>0)_wppaTimeOut[mocc]=parseInt(iwtimeout);else _wppaTimeOut[mocc]=wppaSlideShowTimeOut;_wppaSSRuns[mocc]=false;_wppaTP[mocc]=-2;_wppaFg[mocc]=0;_wppaIsBusy[mocc]=false;_wppaFirst[mocc]=true;_wppaId[mocc]=[];_wppaAvg[mocc]=[];_wppaDisc[mocc]=[];_wppaMyr[mocc]=[];_wppaVRU[mocc]=[];_wppaLinkUrl[mocc]=[];_wppaLinkTitle[mocc]=[];_wppaLinkTarget[mocc]=[];_wppaCommentHtml[mocc]=[];_wppaIptcHtml[mocc]=[];_wppaExifHtml[mocc]=[];_wppaUrl[mocc]=[];_wppaSkipRated[mocc]=false;_wppaLbTitle[mocc]=[];_wppaDidGoto[mocc]=false;wppaSlidePause[mocc]=false;_wppaShareUrl[mocc]=[];_wppaShareHtml[mocc]=[];_wppaFilmNoMove[mocc]=false;_wppaHiresUrl[mocc]=[];_wppaIsVideo[mocc]=[];_wppaVideoHtml[mocc]=[];_wppaAudioHtml[mocc]=[];_wppaVideoNatWidth[mocc]=[];_wppaVideoNatHeight[mocc]=[];wppaVideoPlaying[mocc]=false;wppaAudioPlaying[mocc]=false;_wppaWaitTexts[mocc]=[];_wppaImageAlt[mocc]=[];}
8
  cursor='default';if(linkurl!=''){cursor='pointer';}
9
  else if(wppaLightBox[mocc]!=''){cursor='url( '+wppaImageDirectory+wppaMagnifierCursor+' ),pointer';}
10
  _wppaIsVideo[mocc][id]=(''!=videohtml);if(_wppaIsVideo[mocc][id]){_wppaSlides[mocc][id]=' alt="'+imagealt+'" class="theimg theimg-'+mocc+' big" ';if(wppaSlideVideoStart&&wppaLightBox[mocc]==''){_wppaSlides[mocc][id]+=' autoplay ';}
@@ -79,7 +79,7 @@ _wppaShowMetaData(mocc,'show');if(_wppaTP[mocc]!=-2){var index=_wppaTP[mocc];_wp
79
  _wppaDoAutocol(mocc);wppaStartStop(mocc,index);return;}
80
  else{wppaUpdateLightboxes();if(!wppaIsMini[mocc]){var visurl=wppaGetCurrentFullUrl(mocc,_wppaCurIdx[mocc]);if(''==visurl){visurl=_wppaShareUrl[mocc][_wppaCurIdx[mocc]];}
81
  if(typeof(wppaQRUpdate)!='undefined'){wppaQRUpdate(_wppaShareUrl[mocc][_wppaCurIdx[mocc]]);}
82
- if(!_wppaSSRuns[mocc]){if(_wppaSlides[mocc].length>1){wppaPushStateSlide(mocc,_wppaCurIdx[mocc],visurl);}}}
83
  if(_wppaSSRuns[mocc]){setTimeout('_wppaNextSlide( '+mocc+', "auto" )',wppaGetSlideshowTimeout(mocc));}}
84
  jQuery(document).trigger('glossaryTooltipReady');_wppaDidGoto[mocc]=false;_wppaIsBusy[mocc]=false;if(!wppaIsMini[mocc]){_bumpViewCount(_wppaId[mocc][_wppaCurIdx[mocc]]);}
85
  _wppaDoAutocol(mocc);wppaStopAudio(mocc);if(wppaSlideAudioStart){var elms=jQuery('.wppa-audio-'+_wppaId[mocc][_wppaCurIdx[mocc]]+'-'+mocc);if(elms.length>0){var audio=elms[elms.length-1];if(audio){if(!wppaAudioPlaying[mocc]){audio.play();}}}}}
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
+ var wppaJsSlideshowVersion='6.6.19';function wppaStoreSlideInfo(mocc,id,url,size,width,height,fullname,name,desc,photoid,avgrat,discount,myrat,rateurl,linkurl,linktitle,linktarget,iwtimeout,commenthtml,iptchtml,exifhtml,lbtitle,shareurl,smhtml,ogdsc,hiresurl,videohtml,audiohtml,waittext,imagealt,posterurl){var cursor;desc=wppaRepairScriptTags(desc);if(!_wppaSlides[mocc]||'0'==id){_wppaSlides[mocc]=[];_wppaNames[mocc]=[];_wppaFullNames[mocc]=[];_wppaDsc[mocc]=[];_wppaOgDsc[mocc]=[];_wppaCurIdx[mocc]=-1;_wppaNxtIdx[mocc]=0;if(parseInt(iwtimeout)>0)_wppaTimeOut[mocc]=parseInt(iwtimeout);else _wppaTimeOut[mocc]=wppaSlideShowTimeOut;_wppaSSRuns[mocc]=false;_wppaTP[mocc]=-2;_wppaFg[mocc]=0;_wppaIsBusy[mocc]=false;_wppaFirst[mocc]=true;_wppaId[mocc]=[];_wppaAvg[mocc]=[];_wppaDisc[mocc]=[];_wppaMyr[mocc]=[];_wppaVRU[mocc]=[];_wppaLinkUrl[mocc]=[];_wppaLinkTitle[mocc]=[];_wppaLinkTarget[mocc]=[];_wppaCommentHtml[mocc]=[];_wppaIptcHtml[mocc]=[];_wppaExifHtml[mocc]=[];_wppaUrl[mocc]=[];_wppaSkipRated[mocc]=false;_wppaLbTitle[mocc]=[];_wppaDidGoto[mocc]=false;wppaSlidePause[mocc]=false;_wppaShareUrl[mocc]=[];_wppaShareHtml[mocc]=[];_wppaFilmNoMove[mocc]=false;_wppaHiresUrl[mocc]=[];_wppaIsVideo[mocc]=[];_wppaVideoHtml[mocc]=[];_wppaAudioHtml[mocc]=[];_wppaVideoNatWidth[mocc]=[];_wppaVideoNatHeight[mocc]=[];wppaVideoPlaying[mocc]=false;wppaAudioPlaying[mocc]=false;_wppaWaitTexts[mocc]=[];_wppaImageAlt[mocc]=[];}
8
  cursor='default';if(linkurl!=''){cursor='pointer';}
9
  else if(wppaLightBox[mocc]!=''){cursor='url( '+wppaImageDirectory+wppaMagnifierCursor+' ),pointer';}
10
  _wppaIsVideo[mocc][id]=(''!=videohtml);if(_wppaIsVideo[mocc][id]){_wppaSlides[mocc][id]=' alt="'+imagealt+'" class="theimg theimg-'+mocc+' big" ';if(wppaSlideVideoStart&&wppaLightBox[mocc]==''){_wppaSlides[mocc][id]+=' autoplay ';}
79
  _wppaDoAutocol(mocc);wppaStartStop(mocc,index);return;}
80
  else{wppaUpdateLightboxes();if(!wppaIsMini[mocc]){var visurl=wppaGetCurrentFullUrl(mocc,_wppaCurIdx[mocc]);if(''==visurl){visurl=_wppaShareUrl[mocc][_wppaCurIdx[mocc]];}
81
  if(typeof(wppaQRUpdate)!='undefined'){wppaQRUpdate(_wppaShareUrl[mocc][_wppaCurIdx[mocc]]);}
82
+ if(_wppaSlides[mocc].length>1){wppaPushStateSlide(mocc,_wppaCurIdx[mocc],visurl);}}
83
  if(_wppaSSRuns[mocc]){setTimeout('_wppaNextSlide( '+mocc+', "auto" )',wppaGetSlideshowTimeout(mocc));}}
84
  jQuery(document).trigger('glossaryTooltipReady');_wppaDidGoto[mocc]=false;_wppaIsBusy[mocc]=false;if(!wppaIsMini[mocc]){_bumpViewCount(_wppaId[mocc][_wppaCurIdx[mocc]]);}
85
  _wppaDoAutocol(mocc);wppaStopAudio(mocc);if(wppaSlideAudioStart){var elms=jQuery('.wppa-audio-'+_wppaId[mocc][_wppaCurIdx[mocc]]+'-'+mocc);if(elms.length>0){var audio=elms[elms.length-1];if(audio){if(!wppaAudioPlaying[mocc]){audio.play();}}}}}
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, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick
5
- Version: 6.6.18
6
- Stable tag: 6.6.18
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -180,11 +180,24 @@ Oh, just Google on 'picture resizer' and you will find a bunch of free programs
180
 
181
  See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  = 6.6.18 =
184
 
185
  = Bug Fixes =
186
 
187
- * The max photo pixelsize message in the frontend upload dialog now also checks for the setting in Table VII-B10.
188
  If this value is set, it has precedence over the memory check.
189
  Make sure you do not set this value larger than the memory can handle.
190
  * Improved background indexing to ensure faster update of indexes in all cases.
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, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick
5
+ Version: 6.6.19
6
+ Stable tag: 6.6.19
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
180
 
181
  See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
182
 
183
+ = 6.6.19 =
184
+
185
+ = New Features =
186
+
187
+ * Table IV-E12.1 Rating on two lines. Works only with graphic display when show average is on.
188
+ * Deleted photos can be undeleted during at least one hour by the admin or any wppa super user. See the Album table after one or more photos have been deleted.
189
+ * Table IV-F11. Enable clickable links in comments.
190
+
191
+ = Other Changes =
192
+
193
+ * Source file deletion is now also done at the background.
194
+ * QR codes can be cached. This reduces the load on the qrserver and hence prevents DoS. Default off, Setting: Table IX-K1.4. Qrcodes are svg images in this case.
195
+
196
  = 6.6.18 =
197
 
198
  = Bug Fixes =
199
 
200
+ * The max photo pixelsize message in the frontend upload dialog now also checks for the setting in Table VII-B10.
201
  If this value is set, it has precedence over the memory check.
202
  Make sure you do not set this value larger than the memory can handle.
203
  * Improved background indexing to ensure faster update of indexes in all cases.
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 6.6.18
6
  *
7
  */
8
 
@@ -49,6 +49,20 @@ global $wppa_log_file;
49
  $wppa_action = $_REQUEST['wppa-action'];
50
 
51
  switch ( $wppa_action ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  case 'gettogo':
53
  $slug = strip_tags( $_REQUEST['slug'] );
54
  $result = get_option( $slug . '_togo', '' ) .
@@ -997,6 +1011,31 @@ global $wppa_log_file;
997
  else echo 'notfull||'.$a;
998
  break;
999
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1000
  case 'update-album':
1001
  $album = $_REQUEST['album-id'];
1002
  $nonce = $_REQUEST['wppa-nonce'];
@@ -2099,8 +2138,30 @@ global $wppa_log_file;
2099
  wppa_exit();
2100
  }
2101
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2102
  else switch ( $option ) {
2103
- //wppa_log('obs', 'option '.$option.' attempt to set to '.$value);
2104
 
2105
  // Changing potd_album_type ( physical / virtual ) also clears potd_album
2106
  case 'wppa_potd_album_type':
@@ -2751,6 +2812,12 @@ global $wppa_log_file;
2751
  update_option( 'wppa_create_o1_files_last', $skip );
2752
  break;
2753
 
 
 
 
 
 
 
2754
  case 'wppa_errorlog_purge':
2755
  if ( is_file( $wppa_log_file ) ) {
2756
  unlink( $wppa_log_file );
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 6.6.19
6
  *
7
  */
8
 
49
  $wppa_action = $_REQUEST['wppa-action'];
50
 
51
  switch ( $wppa_action ) {
52
+ case 'getqrcode':
53
+ $nonce = $_REQUEST['wppa-qr-nonce'];
54
+ if ( ! wp_verify_nonce( $nonce, 'wppa-qr-nonce' ) ) {
55
+ die( 'Security check falure' );
56
+ }
57
+ $url = strip_tags( $_REQUEST['url'] );
58
+ if ( wppa_switch( 'qr_cache' ) ) {
59
+ echo wppa_create_qrcode_cache( urldecode( $url ) );
60
+ }
61
+ else {
62
+ echo $url;
63
+ }
64
+ wppa_exit();
65
+ break;
66
  case 'gettogo':
67
  $slug = strip_tags( $_REQUEST['slug'] );
68
  $result = get_option( $slug . '_togo', '' ) .
1011
  else echo 'notfull||'.$a;
1012
  break;
1013
 
1014
+ case 'undelete-photo':
1015
+ $photo = $_REQUEST['photo-id'];
1016
+ $nonce = $_REQUEST['wppa-nonce'];
1017
+
1018
+ // Check validity
1019
+ if ( ! wp_verify_nonce( $nonce, 'wppa_nonce_'.$photo ) ) {
1020
+ echo '||0||'.__( 'You do not have the rights to undelete a photo' , 'wp-photo-album-plus');
1021
+ wppa_exit(); // Nonce check failed
1022
+ }
1023
+ if ( ! is_numeric( $photo ) ) {
1024
+ echo '||0||'.__( 'Security check failure' , 'wp-photo-album-plus');
1025
+ wppa_exit(); // Nonce check failed
1026
+ }
1027
+ $album = $wpdb->get_var( $wpdb->prepare( 'SELECT `album` FROM `'.WPPA_PHOTOS.'` WHERE `id` = %s', $photo ) );
1028
+ if ( wppa_is_int( $album ) && $album < '-9' ) {
1029
+ wppa_update_photo( array( 'id' => $photo, 'album' => - ( $album + '9' ) ) );
1030
+ wppa_invalidate_treecounts( - ( $album + '9' ) );
1031
+ echo '||1||<span style="color:red" >'.sprintf( __( 'Photo %s has been undeleted' , 'wp-photo-album-plus'), $photo ).'</span>';
1032
+ }
1033
+ else {
1034
+ echo '||1||<span style="color:red" >'.sprintf( __( 'Could not undelete photo %s' , 'wp-photo-album-plus'), $photo ).'</span>';
1035
+ }
1036
+ wppa_clear_cache();
1037
+ break;
1038
+
1039
  case 'update-album':
1040
  $album = $_REQUEST['album-id'];
1041
  $nonce = $_REQUEST['wppa-nonce'];
2138
  wppa_exit();
2139
  }
2140
  }
2141
+ elseif ( substr( $option, 0, 8 ) == 'wppa_qr_' ) { // Is qr code setting
2142
+ if ( is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
2143
+ $caches = glob( WPPA_UPLOAD_PATH . '/qr/*.svg' );
2144
+ if ( $caches ) foreach ( $caches as $cache ) {
2145
+ unlink( $cache );
2146
+ }
2147
+ }
2148
+ update_option( 'wppa_qr_cache_hits', '0' );
2149
+ update_option( 'wppa_qr_cache_miss', '0' );
2150
+ wppa_update_option( $option, $value );
2151
+ $title = sprintf( __( 'Setting %s updated to %s', 'wp-photo-album-plus'), $option, $value );
2152
+
2153
+ // Something to do after changing the setting?
2154
+ wppa_initialize_runtime( true ); // force reload new values
2155
+
2156
+ // Produce the response text
2157
+ $output = '||0||'.esc_attr( $title ).'||';
2158
+
2159
+ echo $output;
2160
+ wppa_clear_cache();
2161
+ wppa_exit();
2162
+ break; // End update qr setting
2163
+ }
2164
  else switch ( $option ) {
 
2165
 
2166
  // Changing potd_album_type ( physical / virtual ) also clears potd_album
2167
  case 'wppa_potd_album_type':
2812
  update_option( 'wppa_create_o1_files_last', $skip );
2813
  break;
2814
 
2815
+ case 'wppa_optimize_ewww_skip_one':
2816
+ $last = get_option( 'wppa_optimize_ewww_last', '0' );
2817
+ $skip = $last + '1';
2818
+ update_option( 'wppa_optimize_ewww_last', $skip );
2819
+ break;
2820
+
2821
  case 'wppa_errorlog_purge':
2822
  if ( is_file( $wppa_log_file ) ) {
2823
  unlink( $wppa_log_file );
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.6.18
7
  *
8
  */
9
 
@@ -45,7 +45,7 @@ function _wppa_admin() {
45
 
46
  if ( $albs ) {
47
  foreach ($albs as $alb) {
48
- if ( $alb['a_parent'] > '0' && wppa_get_parentalbumid($alb['a_parent']) == '-9' ) { // Parent died?
49
  $wpdb->query("UPDATE `".WPPA_ALBUMS."` SET `a_parent` = '-1' WHERE `id` = '".$alb['id']."'");
50
  }
51
  if ( $alb['cover_linkpage'] > '0' ) {
@@ -62,7 +62,7 @@ function _wppa_admin() {
62
  if ($_REQUEST['tab'] == 'edit'){
63
  if ( isset($_REQUEST['edit_id']) ) {
64
  $ei = $_REQUEST['edit_id'];
65
- if ( $ei != 'new' && $ei != 'search' && ! is_numeric($ei) ) {
66
  wp_die('Security check failure 1');
67
  }
68
  }
@@ -96,6 +96,18 @@ function _wppa_admin() {
96
  return;
97
  }
98
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
  if ($_REQUEST['edit_id'] == 'new') {
101
  if ( ! wppa_can_create_album() ) wp_die('No rights to create an album');
@@ -1543,6 +1555,7 @@ global $wpdb;
1543
  }
1544
 
1545
  wppa_search_edit();
 
1546
 
1547
  ?>
1548
  </tbody>
@@ -1868,6 +1881,7 @@ global $wpdb;
1868
  <?php }
1869
 
1870
  wppa_search_edit( true );
 
1871
 
1872
  ?>
1873
  </tbody>
@@ -1984,57 +1998,113 @@ global $wpdb;
1984
  function wppa_search_edit( $collapsable = false ) {
1985
 
1986
  $doit = false;
1987
- // if ( wppa_user_is( 'administrator' ) ) $doit = true;
1988
  if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
1989
  if ( wppa_opt( 'upload_edit' ) != 'none' ) $doit = true;
1990
 
1991
  if ( ! $doit ) return;
1992
- ?>
1993
- <tr>
1994
- <td colspan="<?php echo ( $collapsable ? 19 : 13 )?>" >
1995
- <em><?php _e('Search for photos to edit', 'wp-photo-album-plus'); ?></em>
1996
- <small><?php _e('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') ?></small>
1997
- </td>
1998
- </tr>
1999
- <tr class="alternate" >
2000
- <?php if ( $collapsable ) echo '<td></td>' ?>
2001
- <td>
2002
- <?php _e('Any','wppa', 'wp-photo-album-plus') ?>
2003
- </td>
2004
- <?php if ( $collapsable ) echo '<td></td><td></td><td></td><td></td><td></td>' ?>
2005
- <td>
2006
- <?php _e('Search for', 'wp-photo-album-plus') ?>
2007
- </td>
2008
- <td colspan="4" >
2009
- <?php /* if ( wppa_switch( 'indexed_search' ) ) { */ ?>
2010
- <?php $value = isset( $_REQUEST['wppa-searchstring'] ) ? wppa_sanitize_searchstring( $_REQUEST['wppa-searchstring'] ) : '' ?>
2011
- <a id="wppa-edit-search-tag" />
2012
- <input type="text" id="wppa-edit-search" name="wppa-edit-search" style="width:100%; padding:2px; color:black; background-color:#ccffcc;" value="<?php echo $value ?>" />
2013
- <?php /* } else { ?>
2014
- <small style="color:red;" ><?php _e('To use this feature, enable indexed search in Table IX-E7') ?></small>
2015
- <?php } */ ?>
2016
-
2017
- </td>
2018
- <?php if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) echo '<td></td>' ?>
2019
- <td>
2020
- <a class="wppaedit" onclick="wppaEditSearch('<?php echo wppa_ea_url('search') ?>', 'wppa-edit-search' )" >
2021
- <b><?php _e('Edit', 'wp-photo-album-plus') ?></b>
2022
- </a>
2023
- </td>
2024
- <td>
2025
- <a class="wppaedit" onclick="wppaEditSearch('<?php echo wppa_ea_url('search').'&amp;quick' ?>', 'wppa-edit-search' )" >
2026
- <b><?php _e('Quick', 'wp-photo-album-plus') ?></b>
2027
- </a>
2028
- </td>
2029
- <td>
2030
- <a class="wppaedit" onclick="wppaEditSearch('<?php echo wppa_ea_url('search').'&amp;bulk' ?>', 'wppa-edit-search' )" >
2031
- <b><?php _e('Bulk', 'wp-photo-album-plus') ?></b>
2032
- </a>
2033
- </td>
2034
- <td></td><td></td><td></td>
2035
- </tr>
2036
 
2037
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2038
  }
2039
 
2040
  function wppa_album_table_pagination( $page, $count ) {
@@ -2212,6 +2282,10 @@ global $wpdb;
2212
  return false;
2213
  }
2214
 
 
 
 
 
2215
  // Photos in the album
2216
  $photos = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM `' . WPPA_PHOTOS . '` WHERE `album` = %s', $id ), ARRAY_A );
2217
 
@@ -2220,7 +2294,7 @@ global $wpdb;
2220
  $wpdb->query( $wpdb->prepare( 'UPDATE `' . WPPA_PHOTOS . '` SET `album` = %s WHERE `id` = %s', $move, $photo['id'] ) );
2221
 
2222
  // Move to trash?
2223
- if ( $move != '-9' ) {
2224
  wppa_move_source( $photo['filename'], $photo['album'], $move );
2225
  }
2226
  if ( wppa_is_time_up() ) {
@@ -2228,8 +2302,11 @@ global $wpdb;
2228
  wppa_invalidate_treecounts( $move );
2229
  return;
2230
  }
 
 
 
 
2231
  }
2232
- wppa_invalidate_treecounts( $move );
2233
  }
2234
 
2235
  // First flush treecounts, otherwise we do not know the parent if any
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 6.6.19
7
  *
8
  */
9
 
45
 
46
  if ( $albs ) {
47
  foreach ($albs as $alb) {
48
+ if ( $alb['a_parent'] > '0' && wppa_get_parentalbumid($alb['a_parent']) <= '-9' ) { // Parent died?
49
  $wpdb->query("UPDATE `".WPPA_ALBUMS."` SET `a_parent` = '-1' WHERE `id` = '".$alb['id']."'");
50
  }
51
  if ( $alb['cover_linkpage'] > '0' ) {
62
  if ($_REQUEST['tab'] == 'edit'){
63
  if ( isset($_REQUEST['edit_id']) ) {
64
  $ei = $_REQUEST['edit_id'];
65
+ if ( $ei != 'new' && $ei != 'search' && $ei != 'trash' && ! is_numeric($ei) ) {
66
  wp_die('Security check failure 1');
67
  }
68
  }
96
  return;
97
  }
98
 
99
+ if ($_REQUEST['edit_id'] == 'trash' ) {
100
+ ?>
101
+ <h2><?php _e('Manage Trashed Photos', 'wp-photo-album-plus');
102
+ echo ' - <small><i>'.__('Edit photo information', 'wp-photo-album-plus').'</i></small>';
103
+ ?>
104
+ </h2>
105
+ <?php
106
+ wppa_album_photos($ei);
107
+
108
+ return;
109
+ }
110
+
111
 
112
  if ($_REQUEST['edit_id'] == 'new') {
113
  if ( ! wppa_can_create_album() ) wp_die('No rights to create an album');
1555
  }
1556
 
1557
  wppa_search_edit();
1558
+ wppa_trash_edit();
1559
 
1560
  ?>
1561
  </tbody>
1881
  <?php }
1882
 
1883
  wppa_search_edit( true );
1884
+ wppa_trash_edit( true );
1885
 
1886
  ?>
1887
  </tbody>
1998
  function wppa_search_edit( $collapsable = false ) {
1999
 
2000
  $doit = false;
 
2001
  if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
2002
  if ( wppa_opt( 'upload_edit' ) != 'none' ) $doit = true;
2003
 
2004
  if ( ! $doit ) return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2005
 
2006
+ $result =
2007
+ '<tr>' .
2008
+ '<td colspan="' . ( $collapsable ? 19 : 13 ) . '" >' .
2009
+ '<em>' .
2010
+ __( 'Search for photos to edit', 'wp-photo-album-plus' ) .
2011
+ '</em>' .
2012
+ '<small>' .
2013
+ __( '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' ) .
2014
+ '</small>' .
2015
+ '</td>' .
2016
+ '</tr>' .
2017
+ '<tr class="alternate" >' .
2018
+ ( $collapsable ? '<td></td>' : '' ) .
2019
+ '<td>' .
2020
+ __( 'Any', 'wp-photo-album-plus' ) .
2021
+ '</td>' .
2022
+ ( $collapsable ? '<td></td><td></td><td></td><td></td><td></td>' : '' ) .
2023
+ '<td>' .
2024
+ __( 'Search for', 'wp-photo-album-plus' ) .
2025
+ '</td>' .
2026
+ '<td colspan="4" >';
2027
+ $value = isset( $_REQUEST['wppa-searchstring'] ) ? wppa_sanitize_searchstring( $_REQUEST['wppa-searchstring'] ) : '';
2028
+ $result .=
2029
+ '<a id="wppa-edit-search-tag" />' .
2030
+ '<input' .
2031
+ ' type="text"' .
2032
+ ' id="wppa-edit-search"' .
2033
+ ' name="wppa-edit-search"' .
2034
+ ' style="width:100%;padding:2px;color:black;background-color:#ccffcc;"' .
2035
+ ' value="' . $value . '"' .
2036
+ ' />' .
2037
+ '</td>';
2038
+ if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) {
2039
+ $result .= '<td></td>';
2040
+ }
2041
+ $result .=
2042
+ '<td>' .
2043
+ '<a class="wppaedit" onclick="wppaEditSearch(\'' . wppa_ea_url( 'search' ) . '\', \'wppa-edit-search\' )" >' .
2044
+ '<b>' . __( 'Edit', 'wp-photo-album-plus' ) . '</b>' .
2045
+ '</a>' .
2046
+ '</td>' .
2047
+ '<td>' .
2048
+ '<a class="wppaedit" onclick="wppaEditSearch(\'' . wppa_ea_url( 'search' ) . '&amp;quick' . '\', \'wppa-edit-search\' )" >' .
2049
+ '<b>' . __( 'Quick', 'wp-photo-album-plus' ) . '</b>' .
2050
+ '</a>' .
2051
+ '</td>' .
2052
+ '<td>' .
2053
+ '<a class="wppaedit" onclick="wppaEditSearch(\'' . wppa_ea_url( 'search' ) . '&amp;bulk' . '\', \'wppa-edit-search\' )" >' .
2054
+ '<b>' . __( 'Bulk', 'wp-photo-album-plus' ) . '</b>' .
2055
+ '</a>' .
2056
+ '</td>' .
2057
+ '<td></td><td></td><td></td>' .
2058
+ '</tr>';
2059
+
2060
+ echo $result;
2061
+ }
2062
+
2063
+ function wppa_trash_edit( $collapsable = false ) {
2064
+ global $wpdb;
2065
+
2066
+ $doit = false;
2067
+ if ( wppa_user_is( 'administrator' ) ) $doit = true;
2068
+
2069
+ $trashed = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `album` < '0'" );
2070
+
2071
+ if ( ! $trashed ) $doit = false;
2072
+
2073
+ if ( ! $doit ) return;
2074
+
2075
+ $result =
2076
+ '<tr>';
2077
+ if ( $collapsable ) {
2078
+ $result .= '<td></td>';
2079
+ }
2080
+ $result .=
2081
+ '<td>' .
2082
+ __( 'Any', 'wp-photo-album-plus' ) .
2083
+ '</td>';
2084
+ if ( $collapsable ) {
2085
+ $result .= '<td></td><td></td><td></td><td></td><td></td>';
2086
+ }
2087
+ $result .=
2088
+ '<td colspan="4" >' .
2089
+ sprintf( __( 'There are %s trashed photos that can be rescued', 'wp-photo-album-plus' ), $trashed ) .
2090
+ '</td>' .
2091
+ '<td>' .
2092
+ '</td>' .
2093
+ '<td></td>' .
2094
+ '<td>' .
2095
+ '<a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '\' );" >' .
2096
+ '<b>' . __( 'Edit', 'wp-photo-album-plus' ) . '</b>' .
2097
+ '</a>' .
2098
+ '</td>' .
2099
+ '<td>' .
2100
+ '<a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '&amp;quick' . '\' );" >' .
2101
+ '<b>' . __( 'Quick', 'wp-photo-album-plus' ) . '</b>' .
2102
+ '</a>' .
2103
+ '</td>' .
2104
+ '<td></td><td></td><td></td><td></td>' .
2105
+ '</tr>';
2106
+
2107
+ echo $result;
2108
  }
2109
 
2110
  function wppa_album_table_pagination( $page, $count ) {
2282
  return false;
2283
  }
2284
 
2285
+ if ( $move == '-9' ) {
2286
+ $move = - ( $id + '9' );
2287
+ }
2288
+
2289
  // Photos in the album
2290
  $photos = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM `' . WPPA_PHOTOS . '` WHERE `album` = %s', $id ), ARRAY_A );
2291
 
2294
  $wpdb->query( $wpdb->prepare( 'UPDATE `' . WPPA_PHOTOS . '` SET `album` = %s WHERE `id` = %s', $move, $photo['id'] ) );
2295
 
2296
  // Move to trash?
2297
+ if ( $move > '0' ) {
2298
  wppa_move_source( $photo['filename'], $photo['album'], $move );
2299
  }
2300
  if ( wppa_is_time_up() ) {
2302
  wppa_invalidate_treecounts( $move );
2303
  return;
2304
  }
2305
+
2306
+ }
2307
+ if ( $move > '0' ) {
2308
+ wppa_invalidate_treecounts( $move );
2309
  }
 
2310
  }
2311
 
2312
  // First flush treecounts, otherwise we do not know the parent if any
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 6.6.18
7
  *
8
  */
9
 
@@ -1299,10 +1299,12 @@ global $wppa_locale;
1299
  // qr code
1300
  if ( wppa_switch( 'share_qr' ) && $key != 'thumb' ) {
1301
  $src = 'http://api.qrserver.com/v1/create-qr-code/' .
1302
- '?data=' . urlencode( $share_url ) .
1303
  '&size=80x80' .
1304
  '&color=' . trim( wppa_opt( 'qr_color' ), '#' ) .
1305
- '&bgcolor=' . trim( wppa_opt( 'qr_bgcolor' ), '#' );
 
 
1306
  $qr = '<div style="float:left; padding:2px;" >' .
1307
  '<img' .
1308
  ' src="' . $src . '"' .
@@ -3218,8 +3220,17 @@ global $wpdb;
3218
  __wcs( 'wppa-box-text' ) .
3219
  __wcs( 'wppa-td' ) .
3220
  '"' .
3221
- ' >'.
3222
- html_entity_decode( esc_js( stripslashes( wppa_convert_smilies( $comment['comment'] ) ) ) );
 
 
 
 
 
 
 
 
 
3223
 
3224
  if ( $comment['status'] != 'approved' && ( current_user_can( 'wppa_moderate' ) || current_user_can( 'wppa_comments' ) ) ) {
3225
  if ( wppa( 'no_esc' ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 6.6.19
7
  *
8
  */
9
 
1299
  // qr code
1300
  if ( wppa_switch( 'share_qr' ) && $key != 'thumb' ) {
1301
  $src = 'http://api.qrserver.com/v1/create-qr-code/' .
1302
+ '?format=svg' .
1303
  '&size=80x80' .
1304
  '&color=' . trim( wppa_opt( 'qr_color' ), '#' ) .
1305
+ '&bgcolor=' . trim( wppa_opt( 'qr_bgcolor' ), '#' ) .
1306
+ '&data=' . urlencode( $share_url );
1307
+ $src = wppa_create_qrcode_cache( $src );
1308
  $qr = '<div style="float:left; padding:2px;" >' .
1309
  '<img' .
1310
  ' src="' . $src . '"' .
3220
  __wcs( 'wppa-box-text' ) .
3221
  __wcs( 'wppa-td' ) .
3222
  '"' .
3223
+ ' >';
3224
+
3225
+ $c = $comment['comment'];
3226
+ $c = wppa_convert_smilies( $c );
3227
+ $c = stripslashes( $c );
3228
+ $c = esc_js( $c );
3229
+ $c = html_entity_decode( $c );
3230
+ if ( wppa_switch( 'comment_clickable' ) ) {
3231
+ $c = make_clickable( $c );
3232
+ }
3233
+ $result .= $c;
3234
 
3235
  if ( $comment['status'] != 'approved' && ( current_user_can( 'wppa_moderate' ) || current_user_can( 'wppa_comments' ) ) ) {
3236
  if ( wppa( 'no_esc' ) ) {
wppa-cron.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
- * Version 6.6.18
7
  *
8
  *
9
  */
@@ -106,6 +106,8 @@ function wppa_do_cleanup() {
106
  global $wpdb;
107
  global $wppa_all_maintenance_slugs;
108
 
 
 
109
  // Cleanup session db table
110
  $lifetime = 3600; // Sessions expire after one hour
111
  $savetime = 86400; // Save session data for 24 hour
@@ -136,11 +138,11 @@ global $wppa_all_maintenance_slugs;
136
  // Find lost photos, update their album to -9, meaning trashed
137
  $album_ids = $wpdb->get_col( "SELECT `id` FROM `" . WPPA_ALBUMS . "`" );
138
  if ( ! empty( $album_ids ) ) {
139
- $lost = $wpdb->query( "UPDATE `" . WPPA_PHOTOS . "` SET `album` = '-9' WHERE `album` NOT IN ( " . implode( ',', $album_ids ) . " ) " );
140
  }
141
 
142
  // Remove 'deleted' photos from system
143
- $dels = $wpdb->get_col( "SELECT `id` FROM `".WPPA_PHOTOS."` WHERE `album` = '-9'" );
144
  foreach( $dels as $del ) {
145
  wppa_delete_photo( $del );
146
  wppa_log( 'Cron', 'Removed photo {b}' . $del . '{/b} from system' );
@@ -189,6 +191,8 @@ global $wppa_all_maintenance_slugs;
189
  // Store updated failed mails
190
  update_option( 'wppa_failed_mails', $failed_mails );
191
  }
 
 
192
  }
193
 
194
  // Activate treecount update proc
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
+ * Version 6.6.19
7
  *
8
  *
9
  */
106
  global $wpdb;
107
  global $wppa_all_maintenance_slugs;
108
 
109
+ wppa_log( 'Cron', 'Cron job {b}wppa_cleanup{/b} started.' );
110
+
111
  // Cleanup session db table
112
  $lifetime = 3600; // Sessions expire after one hour
113
  $savetime = 86400; // Save session data for 24 hour
138
  // Find lost photos, update their album to -9, meaning trashed
139
  $album_ids = $wpdb->get_col( "SELECT `id` FROM `" . WPPA_ALBUMS . "`" );
140
  if ( ! empty( $album_ids ) ) {
141
+ $lost = $wpdb->query( "UPDATE `" . WPPA_PHOTOS . "` SET `album` = '-9' WHERE `album` > '0' AND `album` NOT IN ( " . implode( ',', $album_ids ) . " ) " );
142
  }
143
 
144
  // Remove 'deleted' photos from system
145
+ $dels = $wpdb->get_col( "SELECT `id` FROM `".WPPA_PHOTOS."` WHERE `album` <= '-9' AND `modified` < " . ( time() - 3600 ) );
146
  foreach( $dels as $del ) {
147
  wppa_delete_photo( $del );
148
  wppa_log( 'Cron', 'Removed photo {b}' . $del . '{/b} from system' );
191
  // Store updated failed mails
192
  update_option( 'wppa_failed_mails', $failed_mails );
193
  }
194
+
195
+ wppa_log( 'Cron', 'Cron job {b}wppa_cleanup{/b} completed.' );
196
  }
197
 
198
  // Activate treecount update proc
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 6.6.18
7
  *
8
  */
9
 
@@ -106,8 +106,6 @@ global $wppa_session;
106
 
107
  // Test validity of album arg
108
  wppa( 'start_album', wppa_get_get( 'album' ) );
109
- // if ( wppa( 'start_album' ) == '-9' ) exit;
110
- // echo 'sa='.wppa( 'start_album' ).'<br />';
111
 
112
  wppa( 'is_cover', wppa_get_get( 'cover' ) );
113
  wppa( 'is_slide', wppa_get_get( 'slide' ) || ( wppa_get_get( 'album' ) !== false && wppa_get_get( 'photo' ) ) );
@@ -1191,7 +1189,7 @@ global $wppa_session;
1191
  // No album given, make sure trashed photos are not found
1192
  else {
1193
  $fullalb = '';
1194
- $album_clause = " `album` <> '-9' ";
1195
  }
1196
 
1197
  // For upload link on thumbarea: if startalbum is a single real album, put it in current album
@@ -1333,7 +1331,7 @@ global $wppa_session;
1333
  // To keep the sequence ok ( in sequence of comments desc ), do the queries one by one
1334
  $thumbs = array();
1335
  if ( is_array( $photo_ids ) ) foreach( $photo_ids as $id ) {
1336
- $temp = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM `".WPPA_PHOTOS."` WHERE ".$status." AND `album` <> '-9' AND `id` = %s", $id ), ARRAY_A );
1337
  if ( $temp ) {
1338
  $thumbs[] = $temp;
1339
  }
@@ -1377,7 +1375,7 @@ global $wppa_session;
1377
  $fac = ' AND ' . $album_clause . ' ';
1378
  }
1379
  else {
1380
- $fac = " AND `album` <> '-9' ";
1381
  }
1382
 
1383
  // Prepare the query
@@ -1424,13 +1422,13 @@ global $wppa_session;
1424
  if ( current_user_can( 'wppa_moderate' ) ) {
1425
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1426
  "WHERE `name` " . $is . " %s " .
1427
- "AND `album` <> '-9' " .
1428
  wppa_get_photo_order( '0' ), $data );
1429
  }
1430
  else {
1431
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1432
  "WHERE `name` " . $is . " %s " .
1433
- "AND `album` <> '-9' " .
1434
  "AND " . $status . " " .
1435
  wppa_get_photo_order( '0' ), $data );
1436
  }
@@ -1441,13 +1439,13 @@ global $wppa_session;
1441
  if ( current_user_can( 'wppa_moderate' ) ) {
1442
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1443
  "WHERE `owner` = %s " .
1444
- "AND `album` <> '-9' " .
1445
  wppa_get_photo_order( '0' ), $data );
1446
  }
1447
  else {
1448
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1449
  "WHERE `owner` = %s " .
1450
- "AND `album` <> '-9' " .
1451
  "AND " . $status . " " .
1452
  wppa_get_photo_order( '0' ), $data );
1453
  }
@@ -1472,7 +1470,7 @@ global $wppa_session;
1472
  $query = "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1473
  "WHERE ".$status." " .
1474
  "AND `id` IN (" . implode( ',',$tagids ) . ") " .
1475
- "AND `album` <> '-9' ";
1476
  }
1477
  break;
1478
 
@@ -1537,7 +1535,7 @@ global $wppa_session;
1537
  }
1538
  $query = "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1539
  "WHERE ".$status." " .
1540
- "AND `album` <> '-9' " .
1541
  "AND `id` IN (" . trim( implode( ',', $ids ), ',' ) . ")";
1542
  break;
1543
 
@@ -1554,7 +1552,7 @@ global $wppa_session;
1554
  }
1555
  $query = "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1556
  "WHERE ".$status." " .
1557
- "AND `album` <> '-9' " .
1558
  "AND `id` IN (" . $ids . ")";
1559
  break;
1560
 
@@ -1571,7 +1569,7 @@ global $wppa_session;
1571
  }
1572
  $query = "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1573
  "WHERE ".$status." " .
1574
- "AND `album` <> '-9' " .
1575
  "AND `id` IN (" . $ids . ")";
1576
  break;
1577
  }
@@ -1628,7 +1626,7 @@ global $wppa_session;
1628
 
1629
  // Remove scheduled and pending and trashed when not can moderate
1630
  if ( ! current_user_can( 'wppa_moderate' ) ) {
1631
- $needmod = $wpdb->get_results( "SELECT `id` FROM `".WPPA_PHOTOS."` WHERE `status` = 'scheduled' OR `status` = 'pending' OR `album` = '-9'", ARRAY_A );
1632
  if ( is_array( $needmod ) ) {
1633
  $delta = array();
1634
  foreach ( $needmod as $item ) {
@@ -1640,7 +1638,7 @@ global $wppa_session;
1640
 
1641
  // Remove private and trashed when not logged in
1642
  if ( ! is_user_logged_in() ) {
1643
- $needlogin = $wpdb->get_results( "SELECT `id` FROM `".WPPA_PHOTOS."` WHERE `status` = 'private' OR `album` = '-9'", ARRAY_A );
1644
  if ( is_array( $needlogin ) ) {
1645
  $delta = array();
1646
  foreach ( $needlogin as $item ) {
@@ -1764,7 +1762,7 @@ global $wppa_session;
1764
  else {
1765
  $query = $wpdb->prepare( "SELECT * FROM `".WPPA_PHOTOS."` " .
1766
  "WHERE ( ( " . $status . " ) OR `owner` = %s ) " .
1767
- "AND `album` <> '-9' " .
1768
  wppa_get_photo_order( '0' ), wppa_get_user() );
1769
  }
1770
  }
@@ -2389,8 +2387,12 @@ global $wppa_done;
2389
  $sentto = array();
2390
 
2391
  // Setup standard content
 
 
 
 
2392
  $cont['0'] = $usr.' '.__( 'wrote on photo' , 'wp-photo-album-plus').' '.wppa_get_photo_name( $id ).':';
2393
- $cont['1'] = '<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" ><em> '.stripslashes($comment).'</em></blockquote>';
2394
  $cont['2'] = $returnurl ? '<a href="'.$returnurl.'" >'.__( 'Reply' , 'wp-photo-album-plus').'</a>' : '';
2395
  $cont2 = '<a href="'.get_admin_url().'admin.php?page=wppa_manage_comments&commentid='.$key.'" >' .
2396
  __( 'Moderate comment admin' , 'wp-photo-album-plus') .
@@ -2581,7 +2583,7 @@ global $wpdb;
2581
  if ( wppa_opt( 'thumb_linktype' ) != 'lightbox' ) {
2582
 
2583
  $name = wppa_switch( 'popup_text_name' ) || wppa_switch( 'popup_text_owner' ) ?
2584
- wppa_get_photo_name( $id, wppa_switch( 'popup_text_owner' ), false, false, wppa_switch( 'popup_text_name' ) ) :
2585
  '';
2586
  $name = esc_js( $name );
2587
 
@@ -4821,7 +4823,7 @@ function wppa_get_lbtitle( $type, $id ) {
4821
  ' class="wppa-download-button wppa-ovl-button"' .
4822
  ' onclick="' . ( wppa_is_safari() && ( wppa_opt( 'art_monkey_link' ) == 'file' ) ? 'wppaWindowReference = window.open();' : '' ) . 'wppaAjaxMakeOrigName( ' . wppa( 'mocc' ) . ', \'' . wppa_encrypt_photo($id) .'\' );"' .
4823
  ' value="' . rtrim( __( 'Download' , 'wp-photo-album-plus') . ' ' .
4824
- wppa_get_photo_name( $id, wppa_switch( 'ovl_add_owner' ), false, false, wppa_switch( 'ovl_'.$type.'_name' ) ) ) .
4825
  '"' .
4826
  ' />';
4827
  }
@@ -4832,12 +4834,12 @@ function wppa_get_lbtitle( $type, $id ) {
4832
  ' onclick="' . ( wppa_is_safari() && ( wppa_opt( 'art_monkey_link' ) == 'file' ) ? 'wppaWindowReference = window.open();' : '' ) . 'wppaAjaxMakeOrigName( '.wppa( 'mocc' ).', \''.wppa_encrypt_photo($id).'\' );"' .
4833
  ' >' .
4834
  rtrim( __( 'Download' , 'wp-photo-album-plus') . ' ' .
4835
- wppa_get_photo_name( $id, wppa_switch( 'ovl_add_owner' ), false, false, wppa_switch( 'ovl_'.$type.'_name' ) ) ) .
4836
  '</a>';
4837
  }
4838
  }
4839
  else {
4840
- if ( $do_name ) $result .= wppa_get_photo_name( $id, wppa_switch( 'ovl_add_owner' ), false, false, wppa_switch( 'ovl_'.$type.'_name' ) );
4841
  }
4842
  if ( $do_name && $do_desc ) $result .= '<br />';
4843
  if ( $do_desc ) $result .= wppa_get_photo_desc( $thumb['id'] );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 6.6.19
7
  *
8
  */
9
 
106
 
107
  // Test validity of album arg
108
  wppa( 'start_album', wppa_get_get( 'album' ) );
 
 
109
 
110
  wppa( 'is_cover', wppa_get_get( 'cover' ) );
111
  wppa( 'is_slide', wppa_get_get( 'slide' ) || ( wppa_get_get( 'album' ) !== false && wppa_get_get( 'photo' ) ) );
1189
  // No album given, make sure trashed photos are not found
1190
  else {
1191
  $fullalb = '';
1192
+ $album_clause = " `album` > '0' ";
1193
  }
1194
 
1195
  // For upload link on thumbarea: if startalbum is a single real album, put it in current album
1331
  // To keep the sequence ok ( in sequence of comments desc ), do the queries one by one
1332
  $thumbs = array();
1333
  if ( is_array( $photo_ids ) ) foreach( $photo_ids as $id ) {
1334
+ $temp = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM `".WPPA_PHOTOS."` WHERE ".$status." AND `album` > '0' AND `id` = %s", $id ), ARRAY_A );
1335
  if ( $temp ) {
1336
  $thumbs[] = $temp;
1337
  }
1375
  $fac = ' AND ' . $album_clause . ' ';
1376
  }
1377
  else {
1378
+ $fac = " AND `album` > '0' ";
1379
  }
1380
 
1381
  // Prepare the query
1422
  if ( current_user_can( 'wppa_moderate' ) ) {
1423
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1424
  "WHERE `name` " . $is . " %s " .
1425
+ "AND `album` > '0' " .
1426
  wppa_get_photo_order( '0' ), $data );
1427
  }
1428
  else {
1429
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1430
  "WHERE `name` " . $is . " %s " .
1431
+ "AND `album` > '0' " .
1432
  "AND " . $status . " " .
1433
  wppa_get_photo_order( '0' ), $data );
1434
  }
1439
  if ( current_user_can( 'wppa_moderate' ) ) {
1440
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1441
  "WHERE `owner` = %s " .
1442
+ "AND `album` > '0' " .
1443
  wppa_get_photo_order( '0' ), $data );
1444
  }
1445
  else {
1446
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1447
  "WHERE `owner` = %s " .
1448
+ "AND `album` > '0' " .
1449
  "AND " . $status . " " .
1450
  wppa_get_photo_order( '0' ), $data );
1451
  }
1470
  $query = "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1471
  "WHERE ".$status." " .
1472
  "AND `id` IN (" . implode( ',',$tagids ) . ") " .
1473
+ "AND `album` > '0' ";
1474
  }
1475
  break;
1476
 
1535
  }
1536
  $query = "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1537
  "WHERE ".$status." " .
1538
+ "AND `album` > '0' " .
1539
  "AND `id` IN (" . trim( implode( ',', $ids ), ',' ) . ")";
1540
  break;
1541
 
1552
  }
1553
  $query = "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1554
  "WHERE ".$status." " .
1555
+ "AND `album` > '0' " .
1556
  "AND `id` IN (" . $ids . ")";
1557
  break;
1558
 
1569
  }
1570
  $query = "SELECT * FROM `" . WPPA_PHOTOS . "` " .
1571
  "WHERE ".$status." " .
1572
+ "AND `album` > '0' " .
1573
  "AND `id` IN (" . $ids . ")";
1574
  break;
1575
  }
1626
 
1627
  // Remove scheduled and pending and trashed when not can moderate
1628
  if ( ! current_user_can( 'wppa_moderate' ) ) {
1629
+ $needmod = $wpdb->get_results( "SELECT `id` FROM `".WPPA_PHOTOS."` WHERE `status` = 'scheduled' OR `status` = 'pending' OR `album` <= '-9'", ARRAY_A );
1630
  if ( is_array( $needmod ) ) {
1631
  $delta = array();
1632
  foreach ( $needmod as $item ) {
1638
 
1639
  // Remove private and trashed when not logged in
1640
  if ( ! is_user_logged_in() ) {
1641
+ $needlogin = $wpdb->get_results( "SELECT `id` FROM `".WPPA_PHOTOS."` WHERE `status` = 'private' OR `album` <= '-9'", ARRAY_A );
1642
  if ( is_array( $needlogin ) ) {
1643
  $delta = array();
1644
  foreach ( $needlogin as $item ) {
1762
  else {
1763
  $query = $wpdb->prepare( "SELECT * FROM `".WPPA_PHOTOS."` " .
1764
  "WHERE ( ( " . $status . " ) OR `owner` = %s ) " .
1765
+ "AND `album` > '0' " .
1766
  wppa_get_photo_order( '0' ), wppa_get_user() );
1767
  }
1768
  }
2387
  $sentto = array();
2388
 
2389
  // Setup standard content
2390
+ $the_comment = stripslashes( $comment );
2391
+ if ( wppa_switch( 'comment_clickable' ) ) {
2392
+ $the_comment = make_clickable( $the_comment );
2393
+ }
2394
  $cont['0'] = $usr.' '.__( 'wrote on photo' , 'wp-photo-album-plus').' '.wppa_get_photo_name( $id ).':';
2395
+ $cont['1'] = '<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" ><em> '.$the_comment.'</em></blockquote>';
2396
  $cont['2'] = $returnurl ? '<a href="'.$returnurl.'" >'.__( 'Reply' , 'wp-photo-album-plus').'</a>' : '';
2397
  $cont2 = '<a href="'.get_admin_url().'admin.php?page=wppa_manage_comments&commentid='.$key.'" >' .
2398
  __( 'Moderate comment admin' , 'wp-photo-album-plus') .
2583
  if ( wppa_opt( 'thumb_linktype' ) != 'lightbox' ) {
2584
 
2585
  $name = wppa_switch( 'popup_text_name' ) || wppa_switch( 'popup_text_owner' ) ?
2586
+ wppa_get_photo_name( $id, array( 'addowner' => wppa_switch( 'popup_text_owner' ), 'showname' => wppa_switch( 'popup_text_name' ) ) ) :
2587
  '';
2588
  $name = esc_js( $name );
2589
 
4823
  ' class="wppa-download-button wppa-ovl-button"' .
4824
  ' onclick="' . ( wppa_is_safari() && ( wppa_opt( 'art_monkey_link' ) == 'file' ) ? 'wppaWindowReference = window.open();' : '' ) . 'wppaAjaxMakeOrigName( ' . wppa( 'mocc' ) . ', \'' . wppa_encrypt_photo($id) .'\' );"' .
4825
  ' value="' . rtrim( __( 'Download' , 'wp-photo-album-plus') . ' ' .
4826
+ wppa_get_photo_name( $id, array( 'addowner' => wppa_switch( 'ovl_add_owner' ), 'showname' => wppa_switch( 'ovl_'.$type.'_name' ) ) ) ) .
4827
  '"' .
4828
  ' />';
4829
  }
4834
  ' onclick="' . ( wppa_is_safari() && ( wppa_opt( 'art_monkey_link' ) == 'file' ) ? 'wppaWindowReference = window.open();' : '' ) . 'wppaAjaxMakeOrigName( '.wppa( 'mocc' ).', \''.wppa_encrypt_photo($id).'\' );"' .
4835
  ' >' .
4836
  rtrim( __( 'Download' , 'wp-photo-album-plus') . ' ' .
4837
+ wppa_get_photo_name( $id, array( 'addowner' => wppa_switch( 'ovl_add_owner' ), 'showname' => wppa_switch( 'ovl_'.$type.'_name' ) ) ) ) .
4838
  '</a>';
4839
  }
4840
  }
4841
  else {
4842
+ if ( $do_name ) $result .= wppa_get_photo_name( $id, array( 'addowner' => wppa_switch( 'ovl_add_owner' ), 'showname' => wppa_switch( 'ovl_'.$type.'_name' ) ) );
4843
  }
4844
  if ( $do_name && $do_desc ) $result .= '<br />';
4845
  if ( $do_desc ) $result .= wppa_get_photo_desc( $thumb['id'] );
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.6.18
7
  *
8
  */
9
 
@@ -16,7 +16,7 @@ global $wpdb;
16
  static $album;
17
  static $album_cache_2;
18
 
19
- if ( $id == '-9' ) {
20
  return false;
21
  }
22
 
@@ -73,9 +73,6 @@ static $album_cache_2;
73
  if ( wppa_is_enum( $id ) && ! wppa_is_int( $id ) ) {
74
  return false; // enums not supporte yet
75
  }
76
- if ( $id == '-9' ) {
77
- return false;
78
- }
79
  if ( ! wppa_is_int( $id ) || $id < '1' ) {
80
  $album = false;
81
  wppa_dbg_msg( 'Invalid arg wppa_cache_album('.$id.')', 'red' );
@@ -499,7 +496,7 @@ function wppa_get_album_name( $id, $xargs = array() ) { // $extended = false ) {
499
  }
500
  return $name;
501
  }
502
- if ( $id == '-9' ) {
503
  if ( $args['translate'] ) {
504
  $name = __( '--- deleted ---', 'wp-photo-album-plus' );
505
  }
@@ -534,7 +531,7 @@ function wppa_get_album_name( $id, $xargs = array() ) { // $extended = false ) {
534
  }
535
 
536
  if ( ! $id ) return '';
537
- elseif ( $id == '-9' ) {
538
  return '';
539
  }
540
  elseif ( ! is_numeric( $id ) || $id < '1' ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions to retrieve album and photo items
6
+ * Version 6.6.19
7
  *
8
  */
9
 
16
  static $album;
17
  static $album_cache_2;
18
 
19
+ if ( $id <= '-9' ) {
20
  return false;
21
  }
22
 
73
  if ( wppa_is_enum( $id ) && ! wppa_is_int( $id ) ) {
74
  return false; // enums not supporte yet
75
  }
 
 
 
76
  if ( ! wppa_is_int( $id ) || $id < '1' ) {
77
  $album = false;
78
  wppa_dbg_msg( 'Invalid arg wppa_cache_album('.$id.')', 'red' );
496
  }
497
  return $name;
498
  }
499
+ if ( $id <= '-9' ) {
500
  if ( $args['translate'] ) {
501
  $name = __( '--- deleted ---', 'wp-photo-album-plus' );
502
  }
531
  }
532
 
533
  if ( ! $id ) return '';
534
+ elseif ( $id <= '-9' ) {
535
  return '';
536
  }
537
  elseif ( ! is_numeric( $id ) || $id < '1' ) {
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.6.18
7
  *
8
  */
9
 
@@ -114,6 +114,7 @@ global $wppa_timestamp_start;
114
  $topid = '0';
115
  $reload = '';
116
  $to_delete_from_cloudinary = array();
 
117
 
118
  if ( ! isset( $wppa_session ) ) $wppa_session = array();
119
  if ( ! isset( $wppa_session[$slug.'_fixed'] ) ) $wppa_session[$slug.'_fixed'] = '0';
@@ -868,7 +869,7 @@ global $wppa_timestamp_start;
868
 
869
  if ( is_array( $photos ) ) foreach( array_keys( $photos ) as $pidx ) {
870
 
871
- if ( $pidx < $last ) continue;
872
  if ( $last && $pidx == $last ) {
873
  wppa_log('Cron', 'Continuing cleanup index at slug = {b}' . $indexes[$idx]['slug'] . '{/b}, element # = {b}' . $last . '{/b}' );
874
  }
@@ -892,7 +893,10 @@ global $wppa_timestamp_start;
892
  wppa_cache_thumb( 'invalidate' ); // Prevent cache overflow
893
  }
894
  }
895
- else break;
 
 
 
896
  }
897
  if ( $cp && $pidx != ( $cp - 1 ) ) {
898
  wppa_log( 'Cron', 'Could not complete scan of index item # {b}' . $indexes[$idx]['id'] . '{/b},' .
@@ -924,7 +928,7 @@ global $wppa_timestamp_start;
924
  break;
925
  }
926
 
927
- // Test for timeout / ready
928
  if ( wppa_is_cron() ) {
929
  if ( ( time() > $endtime ) || ( memory_get_usage() >= ( 0.9 * wppa_memry_limit() ) ) ) {
930
  update_option( $slug.'_status', __('Scheduled cron job', 'wp-photo-album-plus'));
@@ -934,7 +938,9 @@ global $wppa_timestamp_start;
934
  }
935
  }
936
 
937
- if ( ( time() > $endtime ) || ( memory_get_usage() >= ( 0.9 * wppa_memry_limit() ) ) ) break; // Time out
 
 
938
  }
939
 
940
  break; // End process index
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 6.6.19
7
  *
8
  */
9
 
114
  $topid = '0';
115
  $reload = '';
116
  $to_delete_from_cloudinary = array();
117
+ $aborted = false;
118
 
119
  if ( ! isset( $wppa_session ) ) $wppa_session = array();
120
  if ( ! isset( $wppa_session[$slug.'_fixed'] ) ) $wppa_session[$slug.'_fixed'] = '0';
869
 
870
  if ( is_array( $photos ) ) foreach( array_keys( $photos ) as $pidx ) {
871
 
872
+ if ( $pidx < $last ) continue; // Skip already done
873
  if ( $last && $pidx == $last ) {
874
  wppa_log('Cron', 'Continuing cleanup index at slug = {b}' . $indexes[$idx]['slug'] . '{/b}, element # = {b}' . $last . '{/b}' );
875
  }
893
  wppa_cache_thumb( 'invalidate' ); // Prevent cache overflow
894
  }
895
  }
896
+ else {
897
+ $aborted = true;
898
+ }
899
+ if ( $aborted ) break;
900
  }
901
  if ( $cp && $pidx != ( $cp - 1 ) ) {
902
  wppa_log( 'Cron', 'Could not complete scan of index item # {b}' . $indexes[$idx]['id'] . '{/b},' .
928
  break;
929
  }
930
 
931
+ // Update status
932
  if ( wppa_is_cron() ) {
933
  if ( ( time() > $endtime ) || ( memory_get_usage() >= ( 0.9 * wppa_memry_limit() ) ) ) {
934
  update_option( $slug.'_status', __('Scheduled cron job', 'wp-photo-album-plus'));
938
  }
939
  }
940
 
941
+ if ( time() > $endtime ) break;
942
+ if ( memory_get_usage() >= ( 0.9 * wppa_memry_limit() ) ) break;
943
+ if ( $aborted ) break;
944
  }
945
 
946
  break; // End process index
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.6.18
7
  *
8
  */
9
 
@@ -566,7 +566,8 @@ global $wppa_session;
566
  echo '
567
  <!-- Nonce for various wppa actions -->';
568
  // Nonce field for Ajax bump view counter from lightbox, and rating
569
- wp_nonce_field('wppa-check' , 'wppa-nonce', false, true);
 
570
 
571
  echo '
572
  <!-- Do user upload -->';
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
+ * Version 6.6.19
7
  *
8
  */
9
 
566
  echo '
567
  <!-- Nonce for various wppa actions -->';
568
  // Nonce field for Ajax bump view counter from lightbox, and rating
569
+ wp_nonce_field( 'wppa-check', 'wppa-nonce', false, true );
570
+ wp_nonce_field( 'wppa-qr-nonce', 'wppa-qr-nonce', false, true );
571
 
572
  echo '
573
  <!-- Do user upload -->';
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.6.18
7
  *
8
  */
9
 
@@ -86,6 +86,13 @@ global $wpdb;
86
  );
87
  }
88
 
 
 
 
 
 
 
 
89
  // A physical album
90
  else {
91
  $counts = wppa_get_treecounts_a( $album, true );
@@ -340,10 +347,14 @@ function wppaTryDelete( id, video ) {
340
  }
341
 
342
  if ( confirm( query ) ) {
343
- wppaAjaxDeletePhoto( id )
344
  }
345
  }
346
 
 
 
 
 
347
  function wppaTryRotLeft( id ) {
348
 
349
  var query = '<?php echo esc_js( __( 'Are you sure you want to rotate this photo left?', 'wp-photo-album-plus' ) ) ?>';
@@ -612,20 +623,34 @@ function wppaToggleHorizon() {
612
  ' />';
613
  }
614
  echo
615
- ' ' .
616
 
617
  // Album
 
 
 
 
 
 
618
  sprintf( __( 'Album: %d (%s).' , 'wp-photo-album-plus'), $album, wppa_get_album_name( $album ) );
619
 
620
  // Modified
621
- if ( $modified > $timestamp ) {
622
  echo
623
- ' ' . __( 'Modified:', 'wp-photo-album-plus' ) . ' ' .
624
- wppa_local_date( '', $modified ) . ' ' . __( 'local time', 'wp-photo-album-plus' );
 
625
  }
626
  else {
627
- echo
628
- ' ' . __( 'Not modified', 'wp-photo-album-plus' );
 
 
 
 
 
 
 
629
  }
630
  echo
631
  '. ' .
@@ -1206,8 +1231,10 @@ function wppaToggleHorizon() {
1206
  '<input' .
1207
  ' type="button"' .
1208
  ' style="color:red;"' .
1209
- ' onclick="wppaTryDelete( ' . $id . ', ' . $b_is_video . ' )"' .
1210
- ' value="' . ( $b_is_video ? esc_attr( __( 'Delete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Delete photo', 'wp-photo-album-plus' ) ) ) . '"' .
 
 
1211
  ' />' .
1212
  ' ';
1213
  }
@@ -1260,7 +1287,7 @@ function wppaToggleHorizon() {
1260
  '</table>';
1261
 
1262
  // Section 3a ImageMagick editing commands
1263
- if ( wppa_can_admin_magick( $id ) ) {
1264
 
1265
  echo
1266
  '<table' .
@@ -1499,44 +1526,44 @@ function wppaToggleHorizon() {
1499
  ' />' .
1500
  '</td>' .
1501
  '</tr>';
1502
- if ( ! $quick ) {
1503
- // Fake 'for social media' to use the local file here, not cloudinary. Files from cloudinary do not reload, even with ?ver=...
1504
- wppa( 'for_sm', true );
1505
- echo
1506
- '<tr>' .
1507
- '<td>' .
1508
- '<img' .
1509
- ' id="fs-img-' . $id . '"' .
1510
- ' src="' . wppa_get_photo_url( $id ) . '"' .
1511
- ' style="float:left;max-width:90%;" ' .
 
 
 
 
 
 
 
 
 
1512
  ' />' .
1513
- '<div' .
1514
- ' style="display:inline-block;vertical-align:middle;margin-left:4px;margin-top:' . ( wppa_get_photoy( $id ) / 2 - 30 ) . 'px;"' .
1515
- ' >' .
1516
- '<input' .
1517
- ' type="button"' .
1518
- ' onclick="wppaTryMagick( ' . $id . ', \'skyleft\' );"' .
1519
- ' value="' . esc_attr( 'Up', 'wp-photo-album-plus' ) . '"' .
1520
- ' title="' . esc_attr( 'Turn horizon up by 0.5&deg;', 'wp-photo-album-plus' ) . '"' .
1521
- ' />' .
1522
- '<br />' .
1523
- '<input' .
1524
- ' type="button"' .
1525
- ' onclick="wppaToggleHorizon()"' .
1526
- ' value="' . esc_attr( 'Hor', 'wp-photo-album-plus' ) . '"' .
1527
- ' title="' . esc_attr( 'Toggle horizon reference line on/off', 'wp-photo-album-plus' ) . '"' .
1528
- ' />' .
1529
- '<br />' .
1530
- '<input' .
1531
- ' type="button"' .
1532
- ' onclick="wppaTryMagick( ' . $id . ', \'skyright\' );"' .
1533
- ' value="' . esc_attr( 'Down', 'wp-photo-album-plus' ) . '"' .
1534
- ' title="' . esc_attr( 'Turn horizon down by 0.5&deg;', 'wp-photo-album-plus' ) . '"' .
1535
- ' />' .
1536
- '</div>' .
1537
- '</td>' .
1538
- '</tr>';
1539
- }
1540
  echo
1541
  '</tbody>' .
1542
  '</table>';
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 6.6.19
7
  *
8
  */
9
 
86
  );
87
  }
88
 
89
+ // Edit trased photos
90
+ elseif ( $album == 'trash' ) {
91
+ $photos = $wpdb->get_results( "SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `album` < '0' ORDER BY `modified` DESC", ARRAY_A );
92
+ $count = count( $photos );
93
+ $link = '';
94
+ }
95
+
96
  // A physical album
97
  else {
98
  $counts = wppa_get_treecounts_a( $album, true );
347
  }
348
 
349
  if ( confirm( query ) ) {
350
+ wppaAjaxDeletePhoto( id );
351
  }
352
  }
353
 
354
+ function wppaTryUndelete ( id ) {
355
+ wppaAjaxUndeletePhoto( id );
356
+ }
357
+
358
  function wppaTryRotLeft( id ) {
359
 
360
  var query = '<?php echo esc_js( __( 'Are you sure you want to rotate this photo left?', 'wp-photo-album-plus' ) ) ?>';
623
  ' />';
624
  }
625
  echo
626
+ ' ';
627
 
628
  // Album
629
+ $deleted = false;
630
+ if ( $album <= '-9' ) {
631
+ $album = - ( $album + '9' );
632
+ $deleted = true;
633
+ }
634
+ echo
635
  sprintf( __( 'Album: %d (%s).' , 'wp-photo-album-plus'), $album, wppa_get_album_name( $album ) );
636
 
637
  // Modified
638
+ if ( $deleted ) {
639
  echo
640
+ '<span style="color:red;" >' .
641
+ __( 'Trashed', 'wp-photo-album-plus' ) .
642
+ '</span>';
643
  }
644
  else {
645
+ if ( $modified > $timestamp ) {
646
+ echo
647
+ ' ' . __( 'Modified:', 'wp-photo-album-plus' ) . ' ' .
648
+ wppa_local_date( '', $modified ) . ' ' . __( 'local time', 'wp-photo-album-plus' );
649
+ }
650
+ else {
651
+ echo
652
+ ' ' . __( 'Not modified', 'wp-photo-album-plus' );
653
+ }
654
  }
655
  echo
656
  '. ' .
1231
  '<input' .
1232
  ' type="button"' .
1233
  ' style="color:red;"' .
1234
+ ' onclick="wppaTry' . ( $deleted ? 'Undelete' : 'Delete' ) . '( ' . $id . ', ' . $b_is_video . ' )"' .
1235
+ ( $deleted ?
1236
+ ' value="' . ( $b_is_video ? esc_attr( __( 'Undelete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Undelete photo', 'wp-photo-album-plus' ) ) ) .'"' :
1237
+ ' value="' . ( $b_is_video ? esc_attr( __( 'Delete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Delete photo', 'wp-photo-album-plus' ) ) ) . '"' ) .
1238
  ' />' .
1239
  ' ';
1240
  }
1287
  '</table>';
1288
 
1289
  // Section 3a ImageMagick editing commands
1290
+ if ( wppa_can_admin_magick( $id ) && ! $quick ) {
1291
 
1292
  echo
1293
  '<table' .
1526
  ' />' .
1527
  '</td>' .
1528
  '</tr>';
1529
+
1530
+ // Fake 'for social media' to use the local file here, not cloudinary. Files from cloudinary do not reload, even with ?ver=...
1531
+ wppa( 'for_sm', true );
1532
+ echo
1533
+ '<tr>' .
1534
+ '<td>' .
1535
+ '<img' .
1536
+ ' id="fs-img-' . $id . '"' .
1537
+ ' src="' . wppa_get_photo_url( $id ) . '"' .
1538
+ ' style="float:left;max-width:90%;" ' .
1539
+ ' />' .
1540
+ '<div' .
1541
+ ' style="display:inline-block;vertical-align:middle;margin-left:4px;margin-top:' . ( wppa_get_photoy( $id ) / 2 - 30 ) . 'px;"' .
1542
+ ' >' .
1543
+ '<input' .
1544
+ ' type="button"' .
1545
+ ' onclick="wppaTryMagick( ' . $id . ', \'skyleft\' );"' .
1546
+ ' value="' . esc_attr( 'Up', 'wp-photo-album-plus' ) . '"' .
1547
+ ' title="' . esc_attr( 'Turn horizon up by 0.5&deg;', 'wp-photo-album-plus' ) . '"' .
1548
  ' />' .
1549
+ '<br />' .
1550
+ '<input' .
1551
+ ' type="button"' .
1552
+ ' onclick="wppaToggleHorizon()"' .
1553
+ ' value="' . esc_attr( 'Hor', 'wp-photo-album-plus' ) . '"' .
1554
+ ' title="' . esc_attr( 'Toggle horizon reference line on/off', 'wp-photo-album-plus' ) . '"' .
1555
+ ' />' .
1556
+ '<br />' .
1557
+ '<input' .
1558
+ ' type="button"' .
1559
+ ' onclick="wppaTryMagick( ' . $id . ', \'skyright\' );"' .
1560
+ ' value="' . esc_attr( 'Down', 'wp-photo-album-plus' ) . '"' .
1561
+ ' title="' . esc_attr( 'Turn horizon down by 0.5&deg;', 'wp-photo-album-plus' ) . '"' .
1562
+ ' />' .
1563
+ '</div>' .
1564
+ '</td>' .
1565
+ '</tr>';
1566
+
 
 
 
 
 
 
 
 
 
1567
  echo
1568
  '</tbody>' .
1569
  '</table>';
wppa-qr-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display qr code
6
- * Version 6.6.18
7
  */
8
 
9
 
@@ -32,16 +32,22 @@ class wppaQRWidget extends WP_Widget {
32
 
33
  $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'QR Widget' , 'wp-photo-album-plus') : $instance['title']);
34
  $qrsrc = 'http' . ( is_ssl() ? 's' : '' ) . '://api.qrserver.com/v1/create-qr-code/' .
35
- '?data=' . site_url() .
36
- '&amp;size='. wppa_opt( 'qr_size' ).'x'.wppa_opt( 'qr_size' ) .
37
- '&amp;color='.trim( wppa_opt( 'qr_color' ), '#' ) .
38
- '&amp;bgcolor='.trim( wppa_opt( 'qr_bgcolor' ) );
39
- $widget_content = '
40
- <div style="text-align:center;" ><img id="wppa-qr-img" src="' . $qrsrc . '" title="" alt="' . __('QR code', 'wp-photo-album-plus') . '" /></div>
41
- <div style="clear:both" ></div>';
42
-
43
- $widget_content .= '
44
- <script type="text/javascript">
 
 
 
 
 
 
45
  /*[CDATA[*/
46
  var wppaQRData = document.location.href;
47
  var wppaQRDataOld = "";
@@ -55,14 +61,14 @@ class wppaQRWidget extends WP_Widget {
55
  if ( wppaQRData != wppaQRDataOld ) {
56
  wppaQRDataOld = wppaQRData;
57
  workData = wppaQRData;
58
- wppaQRSrc = "http' . ( is_ssl() ? 's' : '' ) . '://api.qrserver.com/v1/create-qr-code/?data=" +
59
- encodeURIComponent( workData ) +
60
- "&size=' . wppa_opt( 'qr_size' ) .
61
  'x' . wppa_opt( 'qr_size' ) .
62
  '&color=' . trim( wppa_opt( 'qr_color' ), '#' ) .
63
- '&bgcolor='.trim( wppa_opt( 'qr_bgcolor' ), '#' ) .
64
- '";
65
- document.getElementById( "wppa-qr-img" ).src = wppaQRSrc;
 
66
  document.getElementById( "wppa-qr-img" ).title = workData;
67
  }
68
  return;
3
  * Package: wp-photo-album-plus
4
  *
5
  * display qr code
6
+ * Version 6.6.19
7
  */
8
 
9
 
32
 
33
  $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'QR Widget' , 'wp-photo-album-plus') : $instance['title']);
34
  $qrsrc = 'http' . ( is_ssl() ? 's' : '' ) . '://api.qrserver.com/v1/create-qr-code/' .
35
+ '?format=svg' .
36
+ '&size='. wppa_opt( 'qr_size' ).'x'.wppa_opt( 'qr_size' ) .
37
+ '&color='.trim( wppa_opt( 'qr_color' ), '#' ) .
38
+ '&bgcolor='.trim( wppa_opt( 'qr_bgcolor' ) ) .
39
+ '&data=' . site_url();
40
+
41
+ // Get the qrcode
42
+ $qrsrc = wppa_create_qrcode_cache( $qrsrc );
43
+ $widget_content =
44
+ '<div style="text-align:center;" >' .
45
+ '<img id="wppa-qr-img" src="' . $qrsrc . '" title="" alt="' . __('QR code', 'wp-photo-album-plus') . '" />' .
46
+ '</div>' .
47
+ '<div style="clear:both" ></div>';
48
+
49
+ $widget_content .=
50
+ '<script type="text/javascript">
51
  /*[CDATA[*/
52
  var wppaQRData = document.location.href;
53
  var wppaQRDataOld = "";
61
  if ( wppaQRData != wppaQRDataOld ) {
62
  wppaQRDataOld = wppaQRData;
63
  workData = wppaQRData;
64
+ wppaQRSrc = "http' . ( is_ssl() ? 's' : '' ) . '://api.qrserver.com/v1/create-qr-code/' .
65
+ '?format=svg&size=' . wppa_opt( 'qr_size' ) .
 
66
  'x' . wppa_opt( 'qr_size' ) .
67
  '&color=' . trim( wppa_opt( 'qr_color' ), '#' ) .
68
+ '&bgcolor=' . trim( wppa_opt( 'qr_bgcolor' ), '#' ) .
69
+ '&data=" + encodeURIComponent( workData );
70
+
71
+ wppaAjaxSetQrCodeSrc( wppaQRSrc, "wppa-qr-img" );
72
  document.getElementById( "wppa-qr-img" ).title = workData;
73
  }
74
  return;
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 6.6.18
7
  *
8
  */
9
 
@@ -26,10 +26,7 @@ global $wppa_tags;
26
  global $wp_version;
27
 
28
  // Start test area
29
- //$files = array( 'Pietje.puk', 'http://www.pieje.nl/content/pietje.puck', 'Pietje.pu', 'Pietje.p', 'Pietje.pukje ' );
30
- //foreach ( $files as $file ) {
31
- // echo wppa_strip_ext( $file ) . ' | ' . wppa_get_ext( $file ) . '<br />';
32
- //}
33
  // End test area
34
 
35
  // Initialize
@@ -4444,6 +4441,15 @@ global $wp_version;
4444
  $tags = 'rating,layout';
4445
  wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags);
4446
 
 
 
 
 
 
 
 
 
 
4447
  $name = __('Single vote button text', 'wp-photo-album-plus');
4448
  $desc = __('The text on the voting button.', 'wp-photo-album-plus');
4449
  $help = __('This text may contain qTranslate compatible language tags.', 'wp-photo-album-plus');
@@ -4706,6 +4712,16 @@ global $wp_version;
4706
  $clas = 'wppa_comment_';
4707
  $tags = 'comment,layout,mail';
4708
  wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
 
 
 
 
 
 
 
 
 
 
4709
  }
4710
  wppa_setting_subheader( 'G', '1', __( 'Lightbox related settings. These settings have effect only when Table IX-J3 is set to wppa' , 'wp-photo-album-plus') );
4711
  {
@@ -7407,7 +7423,7 @@ global $wp_version;
7407
  $desc = __('Optimize with EWWW image optimizer', 'wp-photo-album-plus');
7408
  $help = '';
7409
  $slug2 = 'wppa_optimize_ewww';
7410
- $html1 = '';
7411
  $html2 = wppa_maintenance_button( $slug2 );
7412
  $html3 = wppa_status_field( $slug2 );
7413
  $html4 = wppa_togo_field( $slug2 );
@@ -9301,7 +9317,7 @@ if ( strpos( $_SERVER['SERVER_NAME'], 'opajaap' ) !== false ) {
9301
  $html = wppa_input($slug, '50px', '', __('pixels', 'wp-photo-album-plus'));
9302
  $clas = '';
9303
  $tags = 'system';
9304
- wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
9305
 
9306
  $name = __('QR color', 'wp-photo-album-plus');
9307
  $desc = __('The display color of the qr code (dark)', 'wp-photo-album-plus');
@@ -9310,7 +9326,7 @@ if ( strpos( $_SERVER['SERVER_NAME'], 'opajaap' ) !== false ) {
9310
  $html = wppa_input($slug, '100px', '', '', "checkColor('".$slug."')") . wppa_color_box($slug);
9311
  $clas = '';
9312
  $tags = 'system';
9313
- wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
9314
 
9315
  $name = __('QR background color', 'wp-photo-album-plus');
9316
  $desc = __('The background color of the qr code (light)', 'wp-photo-album-plus');
@@ -9319,7 +9335,16 @@ if ( strpos( $_SERVER['SERVER_NAME'], 'opajaap' ) !== false ) {
9319
  $html = wppa_input($slug, '100px', '', '', "checkColor('".$slug."')") . wppa_color_box($slug);
9320
  $clas = '';
9321
  $tags = 'system';
9322
- wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags);
 
 
 
 
 
 
 
 
 
9323
 
9324
  $name = __('CDN Service', 'wp-photo-album-plus');
9325
  $desc = __('Select a CDN Service you want to use.', 'wp-photo-album-plus');
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 6.6.19
7
  *
8
  */
9
 
26
  global $wp_version;
27
 
28
  // Start test area
29
+
 
 
 
30
  // End test area
31
 
32
  // Initialize
4441
  $tags = 'rating,layout';
4442
  wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags);
4443
 
4444
+ $name = __('Avg and Mine on 2 lines', 'wp-photo-album-plus');
4445
+ $desc = __('Display avarage and my rating on different lines', 'wp-photo-album-plus');
4446
+ $help = '';
4447
+ $slug = 'wppa_show_avg_mine_2';
4448
+ $html = wppa_checkbox($slug);
4449
+ $clas = 'wppa_rating_';
4450
+ $tags = 'rating,layout';
4451
+ wppa_setting($slug, '12.1', $name, $desc, $html, $help, $clas, $tags);
4452
+
4453
  $name = __('Single vote button text', 'wp-photo-album-plus');
4454
  $desc = __('The text on the voting button.', 'wp-photo-album-plus');
4455
  $help = __('This text may contain qTranslate compatible language tags.', 'wp-photo-album-plus');
4712
  $clas = 'wppa_comment_';
4713
  $tags = 'comment,layout,mail';
4714
  wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
4715
+
4716
+ $name = __('Allow clickable links', 'wp-photo-album-plus');
4717
+ $desc = __('Make links in comments clickable', 'wp-photo-album-plus');
4718
+ $help = '';
4719
+ $slug = 'wppa_comment_clickable';
4720
+ $html = wppa_checkbox($slug);
4721
+ $clas = 'wppa_comment_';
4722
+ $tags = 'comment,layout';
4723
+ wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
4724
+
4725
  }
4726
  wppa_setting_subheader( 'G', '1', __( 'Lightbox related settings. These settings have effect only when Table IX-J3 is set to wppa' , 'wp-photo-album-plus') );
4727
  {
7423
  $desc = __('Optimize with EWWW image optimizer', 'wp-photo-album-plus');
7424
  $help = '';
7425
  $slug2 = 'wppa_optimize_ewww';
7426
+ $html1 = wppa_ajax_button(__('Skip one', 'wp-photo-album-plus'), 'optimize_ewww_skip_one', '0', true );
7427
  $html2 = wppa_maintenance_button( $slug2 );
7428
  $html3 = wppa_status_field( $slug2 );
7429
  $html4 = wppa_togo_field( $slug2 );
9317
  $html = wppa_input($slug, '50px', '', __('pixels', 'wp-photo-album-plus'));
9318
  $clas = '';
9319
  $tags = 'system';
9320
+ wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags);
9321
 
9322
  $name = __('QR color', 'wp-photo-album-plus');
9323
  $desc = __('The display color of the qr code (dark)', 'wp-photo-album-plus');
9326
  $html = wppa_input($slug, '100px', '', '', "checkColor('".$slug."')") . wppa_color_box($slug);
9327
  $clas = '';
9328
  $tags = 'system';
9329
+ wppa_setting($slug, '1.2', $name, $desc, $html, $help, $clas, $tags);
9330
 
9331
  $name = __('QR background color', 'wp-photo-album-plus');
9332
  $desc = __('The background color of the qr code (light)', 'wp-photo-album-plus');
9335
  $html = wppa_input($slug, '100px', '', '', "checkColor('".$slug."')") . wppa_color_box($slug);
9336
  $clas = '';
9337
  $tags = 'system';
9338
+ wppa_setting($slug, '1.3', $name, $desc, $html, $help, $clas, $tags);
9339
+
9340
+ $name = __('QR cache', 'wp-photo-album-plus');
9341
+ $desc = __('Enable caching QR codes', 'wp-photo-album-plus') . ' ' . sprintf( __('So far %d cache hits, %d miss', 'wp-photo-album-plus'), get_option('wppa_qr_cache_hits', '0'), get_option('wppa_qr_cache_miss', '0'));
9342
+ $help = esc_js('Enable this to avoid DoS on heavy loads on the qrserver', 'wp-photo-album-plus');
9343
+ $slug = 'wppa_qr_cache';
9344
+ $html = wppa_checkbox($slug);
9345
+ $clas = '';
9346
+ $tags = 'system';
9347
+ wppa_setting($slug, '1.4', $name, $desc, $html, $help, $clas, $tags);
9348
 
9349
  $name = __('CDN Service', 'wp-photo-album-plus');
9350
  $desc = __('Select a CDN Service you want to use.', '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.6.18
7
  *
8
  */
9
 
@@ -831,6 +831,7 @@ Hide Camera info
831
  'wppa_dislike_show_count' => 'yes', // 7.2
832
  'wppa_rating_display_type' => 'graphic', // 8
833
  'wppa_show_avg_rating' => 'yes', // 9
 
834
  'wppa_show_comments' => 'yes', // 10
835
  'wppa_comment_gravatar' => 'monsterid', // 11
836
  'wppa_comment_gravatar_url' => 'http://', // 12
@@ -1212,6 +1213,7 @@ Hide Camera info
1212
  'wppa_comten_alt_thumbsize' => '75',
1213
  'wppa_comment_smiley_picker' => 'no',
1214
  'wppa_mail_upl_email' => 'yes',
 
1215
 
1216
  // G Overlay
1217
  'wppa_ovl_opacity' => '80',
@@ -1485,6 +1487,7 @@ Hide Camera info
1485
  'wppa_leading_zeros' => '',
1486
  'wppa_add_gpx_tag' => '',
1487
  'wppa_optimize_ewww' => '',
 
1488
  'wppa_tag_to_edit' => '',
1489
  'wppa_new_tag_value' => '',
1490
  'wppa_edit_tag' => '',
@@ -1734,6 +1737,7 @@ Hide Camera info
1734
  'wppa_qr_size' => '200',
1735
  'wppa_qr_color' => '#000000',
1736
  'wppa_qr_bgcolor' => '#FFFFFF',
 
1737
 
1738
  'wppa_dismiss_admin_notice_scripts_are_obsolete' => 'no',
1739
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 6.6.19
7
  *
8
  */
9
 
831
  'wppa_dislike_show_count' => 'yes', // 7.2
832
  'wppa_rating_display_type' => 'graphic', // 8
833
  'wppa_show_avg_rating' => 'yes', // 9
834
+ 'wppa_show_avg_mine_2' => 'no',
835
  'wppa_show_comments' => 'yes', // 10
836
  'wppa_comment_gravatar' => 'monsterid', // 11
837
  'wppa_comment_gravatar_url' => 'http://', // 12
1213
  'wppa_comten_alt_thumbsize' => '75',
1214
  'wppa_comment_smiley_picker' => 'no',
1215
  'wppa_mail_upl_email' => 'yes',
1216
+ 'wppa_comment_clickable' => 'no',
1217
 
1218
  // G Overlay
1219
  'wppa_ovl_opacity' => '80',
1487
  'wppa_leading_zeros' => '',
1488
  'wppa_add_gpx_tag' => '',
1489
  'wppa_optimize_ewww' => '',
1490
+ 'wppa_optimize_ewww_skip_one' => '',
1491
  'wppa_tag_to_edit' => '',
1492
  'wppa_new_tag_value' => '',
1493
  'wppa_edit_tag' => '',
1737
  'wppa_qr_size' => '200',
1738
  'wppa_qr_color' => '#000000',
1739
  'wppa_qr_bgcolor' => '#FFFFFF',
1740
+ 'wppa_qr_cache' => 'no',
1741
 
1742
  'wppa_dismiss_admin_notice_scripts_are_obsolete' => 'no',
1743
 
wppa-slideshow.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the slideshow high level functions
6
- * Version 6.6.14
7
  *
8
  */
9
 
@@ -987,6 +987,21 @@ global $wpdb;
987
  // Logged in or don't care
988
  if ( ! wppa_switch( 'rating_login' ) || is_user_logged_in() ) {
989
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
990
  // Show dislike icon?
991
  $pad = round( ( wppa_opt( 'ratspacing' ) - $fs ) / 2 );
992
  if ( $pad < 5 ) $pad = '5';
@@ -1033,11 +1048,6 @@ global $wpdb;
1033
  }
1034
  }
1035
 
1036
- // Text left if no avg rating
1037
- if ( ! wppa_switch( 'show_avg_rating') ) {
1038
- $result .= $myrat_label . ':&nbsp;';
1039
- }
1040
-
1041
  // Display the my rating stars
1042
  if ( $id ) {
1043
  $myavgrat = wppa_get_my_rating_by_id( $id, 'nolabel' );
@@ -1083,8 +1093,8 @@ global $wpdb;
1083
  $i++;
1084
  }
1085
 
1086
- // Text right if avg rating diaplayed
1087
- if ( wppa_switch( 'show_avg_rating' ) ) {
1088
  $result .= '&nbsp;' .
1089
  '<span' .
1090
  ' id="wppa-my-rat-'.wppa( 'mocc' ).'" ' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the slideshow high level functions
6
+ * Version 6.6.19
7
  *
8
  */
9
 
987
  // Logged in or don't care
988
  if ( ! wppa_switch( 'rating_login' ) || is_user_logged_in() ) {
989
 
990
+ // Rating on 2 lines?
991
+ if ( wppa_switch( 'show_avg_mine_2' ) && wppa_switch( 'show_avg_rating' ) ) {
992
+ $result .= '<br />';
993
+ }
994
+
995
+ // Text left if no avg rating OR on 2 lines
996
+ if ( ! wppa_switch( 'show_avg_rating' ) || wppa_switch( 'show_avg_mine_2' ) ) {
997
+ $result .= '<span' .
998
+ ' id="wppa-my-rat-'.wppa( 'mocc' ).'" ' .
999
+ ' class="wppa-rating-label"' .
1000
+ '>' .
1001
+ $myrat_label .
1002
+ '</span>&nbsp';
1003
+ }
1004
+
1005
  // Show dislike icon?
1006
  $pad = round( ( wppa_opt( 'ratspacing' ) - $fs ) / 2 );
1007
  if ( $pad < 5 ) $pad = '5';
1048
  }
1049
  }
1050
 
 
 
 
 
 
1051
  // Display the my rating stars
1052
  if ( $id ) {
1053
  $myavgrat = wppa_get_my_rating_by_id( $id, 'nolabel' );
1093
  $i++;
1094
  }
1095
 
1096
+ // Text right if avg rating diaplayed AND not on two lines
1097
+ if ( wppa_switch( 'show_avg_rating' ) && ! wppa_switch( 'show_avg_mine_2' ) ) {
1098
  $result .= '&nbsp;' .
1099
  '<span' .
1100
  ' id="wppa-my-rat-'.wppa( 'mocc' ).'" ' .
wppa-topten-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
- * Version 6.6.18
7
  */
8
 
9
  class TopTenWidget extends WP_Widget {
@@ -128,13 +128,13 @@ class TopTenWidget extends WP_Widget {
128
  if ( $medalsonly ) {
129
  $thumbs = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` " .
130
  "WHERE `status` IN ( 'gold', 'silver', 'bronze' ) " .
131
- "AND `album` <> '-9' " .
132
  "ORDER BY " . $sortby . " " .
133
  "LIMIT " . $max, ARRAY_A );
134
  }
135
  else {
136
  $thumbs = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` " .
137
- "WHERE `album` <> '-9' " .
138
  "ORDER BY " . $sortby . " " .
139
  "LIMIT " . $max, ARRAY_A );
140
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
+ * Version 6.6.19
7
  */
8
 
9
  class TopTenWidget extends WP_Widget {
128
  if ( $medalsonly ) {
129
  $thumbs = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` " .
130
  "WHERE `status` IN ( 'gold', 'silver', 'bronze' ) " .
131
+ "AND `album` > '0' " .
132
  "ORDER BY " . $sortby . " " .
133
  "LIMIT " . $max, ARRAY_A );
134
  }
135
  else {
136
  $thumbs = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` " .
137
+ "WHERE `album` > '0' " .
138
  "ORDER BY " . $sortby . " " .
139
  "LIMIT " . $max, ARRAY_A );
140
  }
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 6.6.18
7
  *
8
  */
9
 
@@ -1315,15 +1315,18 @@ global $wpdb;
1315
 
1316
  // Really delete only as cron job
1317
  if ( ! wppa_is_cron() ) {
1318
- wppa_update_photo( array( 'id' => $photo, 'album' => '-9' ) );
1319
-
1320
- // Delete sourcefile
1321
- wppa_delete_source( $photoinfo['filename'], $album);
1322
- wppa_mark_treecounts( $album );
1323
- wppa_schedule_cleanup( 'now' );
1324
  return;
1325
  }
1326
 
 
 
 
1327
  // Delete multimedia files
1328
  if ( wppa_is_multi( $photo ) ) {
1329
  $mmfile = wppa_strip_ext( wppa_get_photo_path( $photo, false ) );
@@ -1335,6 +1338,9 @@ global $wpdb;
1335
  }
1336
  }
1337
 
 
 
 
1338
  // Delete fullsize image
1339
  $file = wppa_get_photo_path( $photo );
1340
  if ( is_file( $file ) ) unlink( $file );
@@ -1869,6 +1875,12 @@ global $wppa_supported_photo_extensions;
1869
  $supext = array_merge( $wppa_supported_photo_extensions, $temp );
1870
 
1871
  $thumb = wppa_cache_thumb( $id );
 
 
 
 
 
 
1872
 
1873
  $multi = is_multisite();
1874
  if ( $multi && ! WPPA_MULTISITE_GLOBAL ) {
@@ -1877,7 +1889,7 @@ global $wppa_supported_photo_extensions;
1877
  else {
1878
  $blog = '';
1879
  }
1880
- $source_path = wppa_opt( 'source_dir' ).$blog.'/album-'.$thumb['album'].'/'.$thumb['filename'];
1881
  if ( wppa_is_multi( $id ) ) {
1882
  $path = wppa_strip_ext( $source_path );
1883
  foreach ( $supext as $ext ) {
@@ -3438,11 +3450,9 @@ function wppa_serialize( $array ) {
3438
 
3439
  function wppa_get_like_title_a( $id ) {
3440
  global $wpdb;
3441
- //static $c;
3442
- //wppa_log('obs', 'wppa_get_like_title_a', true);
3443
- //$c++;
3444
  $me = wppa_get_user();
3445
- $likes = wppa_get_photo_item( $id, 'rating_count'); //$wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_RATING . "` WHERE `photo` = $id" );
3446
  $mylike = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_RATING . "` WHERE `photo` = $id AND `user` = '$me'" );
3447
 
3448
  if ( $mylike ) {
@@ -3550,4 +3560,57 @@ function wppa_memry_limit() {
3550
  }
3551
 
3552
  return $memory_limit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3553
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 6.6.19
7
  *
8
  */
9
 
1315
 
1316
  // Really delete only as cron job
1317
  if ( ! wppa_is_cron() ) {
1318
+ if ( $album > '0' ) {
1319
+ $newalb = - ( $album + '9' );
1320
+ wppa_update_photo( array( 'id' => $photo, 'album' => $newalb, 'modified' => time() ) );
1321
+ wppa_mark_treecounts( $album );
1322
+ wppa_schedule_cleanup( 'now' );
1323
+ }
1324
  return;
1325
  }
1326
 
1327
+ // Restore orig album #
1328
+ $album = - ( $album + '9' );
1329
+
1330
  // Delete multimedia files
1331
  if ( wppa_is_multi( $photo ) ) {
1332
  $mmfile = wppa_strip_ext( wppa_get_photo_path( $photo, false ) );
1338
  }
1339
  }
1340
 
1341
+ // Delete sourcefile
1342
+ wppa_delete_source( $photoinfo['filename'], $album);
1343
+
1344
  // Delete fullsize image
1345
  $file = wppa_get_photo_path( $photo );
1346
  if ( is_file( $file ) ) unlink( $file );
1875
  $supext = array_merge( $wppa_supported_photo_extensions, $temp );
1876
 
1877
  $thumb = wppa_cache_thumb( $id );
1878
+ $album = $thumb['album'];
1879
+
1880
+ // Trashed?
1881
+ if ( $album < '0' ) {
1882
+ $album = - ( $album + '9' );
1883
+ }
1884
 
1885
  $multi = is_multisite();
1886
  if ( $multi && ! WPPA_MULTISITE_GLOBAL ) {
1889
  else {
1890
  $blog = '';
1891
  }
1892
+ $source_path = wppa_opt( 'source_dir' ).$blog.'/album-'.$album.'/'.$thumb['filename'];
1893
  if ( wppa_is_multi( $id ) ) {
1894
  $path = wppa_strip_ext( $source_path );
1895
  foreach ( $supext as $ext ) {
3450
 
3451
  function wppa_get_like_title_a( $id ) {
3452
  global $wpdb;
3453
+
 
 
3454
  $me = wppa_get_user();
3455
+ $likes = wppa_get_photo_item( $id, 'rating_count');
3456
  $mylike = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_RATING . "` WHERE `photo` = $id AND `user` = '$me'" );
3457
 
3458
  if ( $mylike ) {
3560
  }
3561
 
3562
  return $memory_limit;
3563
+ }
3564
+
3565
+ // Create qr code cache and return its url
3566
+ function wppa_create_qrcode_cache( $qrsrc ) {
3567
+
3568
+ // Init
3569
+ $key = md5( $qrsrc );
3570
+
3571
+ // Make sure the data portion is url encoded
3572
+ $temp = explode( 'data=', $qrsrc );
3573
+ $qrsrc = $temp[0] . 'data=' . urlencode( urldecode( $temp[1] ) );
3574
+
3575
+ // Anything to do here?
3576
+ if ( ! wppa_switch( 'qr_cache' ) ) {
3577
+ return str_replace( 'format=svg', 'format=png', $qrsrc );
3578
+ }
3579
+
3580
+ // Make sure we have .../uploads/wppa/qr
3581
+ if ( ! is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
3582
+ mkdir( WPPA_UPLOAD_PATH . '/qr' );
3583
+ }
3584
+
3585
+ // In cache already?
3586
+ if ( is_file( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg' ) ) {
3587
+
3588
+ // Bump cache found counter
3589
+ update_option( 'wppa_qr_cache_hits', get_option( 'wppa_qr_cache_hits', 0 ) + 1 );
3590
+ return WPPA_UPLOAD_URL . '/qr/' . $key . '.svg';
3591
+ }
3592
+
3593
+ // Bump cache miss counter
3594
+ update_option( 'wppa_qr_cache_miss', get_option( 'wppa_qr_cache_miss', 0 ) + 1 );
3595
+
3596
+ // Catch the qr image
3597
+ $curl = curl_init();
3598
+ curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
3599
+ curl_setopt( $curl, CURLOPT_URL, $qrsrc );
3600
+ $contents = curl_exec( $curl );
3601
+ curl_close( $curl );
3602
+
3603
+ // Save the image
3604
+ $file = fopen( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg', 'w' );
3605
+ if ( $file ) {
3606
+ fwrite( $file, $contents, strlen( $contents ) );
3607
+ fclose( $file );
3608
+ }
3609
+
3610
+ if ( is_file( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg' ) ) {
3611
+ return WPPA_UPLOAD_URL . '/qr/' . $key . '.svg';
3612
+ }
3613
+ else {
3614
+ return $qrsrc;
3615
+ }
3616
  }
wppa-wpdb-update.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that update records
6
- * Version 6.6.18
7
  *
8
  */
9
 
@@ -173,11 +173,7 @@ global $wpdb;
173
  $doit = true;
174
  break;
175
  case 'album':
176
- // Album id is > 0. -9 means: marked for deletion
177
- if ( ( wppa_is_int($itemvalue) && $itemvalue > 0 ) || $itemvalue = '-9' ) {
178
- $doit = true;
179
- }
180
- else wppa_log('err', 'Invalid album id found in wppa_update_album(): '.$itemvalue);
181
  break;
182
  case 'magickstack':
183
  $doit = true;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that update records
6
+ * Version 6.6.19
7
  *
8
  */
9
 
173
  $doit = true;
174
  break;
175
  case 'album':
176
+ $doit = true;
 
 
 
 
177
  break;
178
  case 'magickstack':
179
  $doit = true;
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.6.18
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 = '6618'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '6-6-18-007'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime(true);
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 6.6.19
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 = '6619'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '6-6-19-006'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime(true);