WP Photo Album Plus - Version 6.3.7

Version Description

Download this release

Release Info

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

Code changes from version 6.3.6 to 6.3.7

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.3.0';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
@@ -27,7 +27,7 @@ function wppaDoAjaxRender( mocc, ajaxurl, newurl, add, waitfor ) {
27
  jQuery.ajax( { url: ajaxurl,
28
  async: true,
29
  type: 'GET',
30
- timeout: 30000,
31
  beforeSend: function( xhr ) {
32
 
33
  // If it is a slideshow: Stop slideshow before pushing it on the stack
@@ -132,7 +132,7 @@ function wppaAjaxApprovePhoto( photo ) {
132
  '&photo-id=' + photo,
133
  async: true,
134
  type: 'GET',
135
- timeout: 10000,
136
  success: function( result, status, xhr ) {
137
  if ( result == 'OK' ) {
138
  jQuery( '.wppa-approve-' + photo ).css( 'display', 'none' );
@@ -156,7 +156,7 @@ function wppaAjaxRemovePhoto( mocc, photo, isslide ) {
156
  '&photo-id=' + photo,
157
  async: true,
158
  type: 'GET',
159
- timeout: 10000,
160
  success: function( result, status, xhr ) {
161
 
162
  // Remove succeeded?
@@ -199,7 +199,7 @@ function wppaAjaxApproveComment( comment ) {
199
  '&comment-id=' + comment,
200
  async: true,
201
  type: 'GET',
202
- timeout: 10000,
203
  success: function( result, status, xhr ) {
204
 
205
  // Approve succeeded?
@@ -228,7 +228,7 @@ function wppaAjaxRemoveComment( comment ) {
228
  '&comment-id=' + comment,
229
  async: true,
230
  type: 'GET',
231
- timeout: 10000,
232
  success: function( result, status, xhr ) {
233
 
234
  // Remove succeeded?
@@ -266,7 +266,7 @@ function wppaEditPhoto( mocc, id ) {
266
  '&moccur=' + mocc,
267
  async: true,
268
  type: 'POST',
269
- timeout: 30000,
270
  beforeSend: function( xhr ) {
271
  wnd.document.write( '<! DOCTYPE html>' );
272
  wnd.document.write( '<html>' );
@@ -337,7 +337,7 @@ function wppaPrevTags( tagsSel, tagsEdit, tagsAlbum, tagsPrev ) {
337
  '&album=' + album,
338
  async: true,
339
  type: 'GET',
340
- timeout: 10000,
341
  beforeSend: function( xhr ) {
342
  jQuery( '#'+tagsPrev ).html( 'Working...' );
343
  },
@@ -365,7 +365,7 @@ function wppaAjaxDestroyAlbum( album, nonce ) {
365
  '&nonce=' + nonce,
366
  async: true,
367
  type: 'GET',
368
- timeout: 10000,
369
  success: function( result, status, xhr ) {
370
  alert( result+'\n'+'Page will be reloaded' );
371
  document.location.reload( true );
@@ -394,7 +394,7 @@ function _bumpViewCount( photo ) {
394
  '&wppa-nonce=' + jQuery( '#wppa-nonce' ).val(),
395
  async: true,
396
  type: 'GET',
397
- timeout: 10000,
398
  success: function( result, status, xhr ) {
399
  wppaPhotoView[photo] = true;
400
  },
@@ -416,7 +416,7 @@ function wppaVoteThumb( mocc, photo ) {
416
  '&wppa-nonce=' + jQuery( '#wppa-nonce' ).val(),
417
  async: true,
418
  type: 'GET',
419
- timeout: 10000,
420
  success: function( result, status, xhr ) {
421
  jQuery( '#wppa-vote-button-'+mocc+'-'+photo ).val( wppaVotedForMe );
422
  },
@@ -459,7 +459,7 @@ function _wppaRateIt( mocc, value ) {
459
  '&wppa-nonce=' + jQuery( '#wppa-nonce' ).val(),
460
  async: true,
461
  type: 'GET',
462
- timeout: 10000,
463
  beforeSend: function( xhr ) {
464
 
465
  // Set icon
@@ -521,7 +521,7 @@ function wppaAjaxMakeOrigName( mocc, photo ) {
521
  '&from=fsname',
522
  async: true,
523
  type: 'GET',
524
- timeout: 10000,
525
  beforeSend: function( xhr ) {
526
 
527
  },
@@ -541,7 +541,7 @@ function wppaAjaxMakeOrigName( mocc, photo ) {
541
  }
542
  },
543
  error: function( xhr, status, error ) {
544
- wppaConsoleLog( 'wppa.. failed. Error = ' + error + ', status = ' + status, 'force' );
545
  },
546
  complete: function( xhr, status, newurl ) {
547
 
@@ -558,7 +558,7 @@ function wppaAjaxDownloadAlbum( mocc, id ) {
558
  '&album-id=' + id,
559
  async: true,
560
  type: 'GET',
561
- timeout: 10000,
562
  beforeSend: function( xhr ) {
563
 
564
  // Show spinner
@@ -583,7 +583,8 @@ function wppaAjaxDownloadAlbum( mocc, id ) {
583
  }
584
  },
585
  error: function( xhr, status, error ) {
586
- wppaConsoleLog( 'wppa.. failed. Error = ' + error + ', status = ' + status, 'force' );
 
587
  },
588
  complete: function( xhr, status, newurl ) {
589
 
@@ -624,7 +625,7 @@ function wppaAjaxComment( mocc, id ) {
624
  // '&wppa-action=',
625
  async: true,
626
  type: 'POST',
627
- timeout: 10000,
628
  beforeSend: function( xhr ) {
629
 
630
  // Show spinner
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsAjaxVersion = '6.3.7';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
27
  jQuery.ajax( { url: ajaxurl,
28
  async: true,
29
  type: 'GET',
30
+ timeout: 60000,
31
  beforeSend: function( xhr ) {
32
 
33
  // If it is a slideshow: Stop slideshow before pushing it on the stack
132
  '&photo-id=' + photo,
133
  async: true,
134
  type: 'GET',
135
+ timeout: 60000,
136
  success: function( result, status, xhr ) {
137
  if ( result == 'OK' ) {
138
  jQuery( '.wppa-approve-' + photo ).css( 'display', 'none' );
156
  '&photo-id=' + photo,
157
  async: true,
158
  type: 'GET',
159
+ timeout: 60000,
160
  success: function( result, status, xhr ) {
161
 
162
  // Remove succeeded?
199
  '&comment-id=' + comment,
200
  async: true,
201
  type: 'GET',
202
+ timeout: 60000,
203
  success: function( result, status, xhr ) {
204
 
205
  // Approve succeeded?
228
  '&comment-id=' + comment,
229
  async: true,
230
  type: 'GET',
231
+ timeout: 60000,
232
  success: function( result, status, xhr ) {
233
 
234
  // Remove succeeded?
266
  '&moccur=' + mocc,
267
  async: true,
268
  type: 'POST',
269
+ timeout: 60000,
270
  beforeSend: function( xhr ) {
271
  wnd.document.write( '<! DOCTYPE html>' );
272
  wnd.document.write( '<html>' );
337
  '&album=' + album,
338
  async: true,
339
  type: 'GET',
340
+ timeout: 60000,
341
  beforeSend: function( xhr ) {
342
  jQuery( '#'+tagsPrev ).html( 'Working...' );
343
  },
365
  '&nonce=' + nonce,
366
  async: true,
367
  type: 'GET',
368
+ timeout: 60000,
369
  success: function( result, status, xhr ) {
370
  alert( result+'\n'+'Page will be reloaded' );
371
  document.location.reload( true );
394
  '&wppa-nonce=' + jQuery( '#wppa-nonce' ).val(),
395
  async: true,
396
  type: 'GET',
397
+ timeout: 60000,
398
  success: function( result, status, xhr ) {
399
  wppaPhotoView[photo] = true;
400
  },
416
  '&wppa-nonce=' + jQuery( '#wppa-nonce' ).val(),
417
  async: true,
418
  type: 'GET',
419
+ timeout: 60000,
420
  success: function( result, status, xhr ) {
421
  jQuery( '#wppa-vote-button-'+mocc+'-'+photo ).val( wppaVotedForMe );
422
  },
459
  '&wppa-nonce=' + jQuery( '#wppa-nonce' ).val(),
460
  async: true,
461
  type: 'GET',
462
+ timeout: 60000,
463
  beforeSend: function( xhr ) {
464
 
465
  // Set icon
521
  '&from=fsname',
522
  async: true,
523
  type: 'GET',
524
+ timeout: 60000,
525
  beforeSend: function( xhr ) {
526
 
527
  },
541
  }
542
  },
543
  error: function( xhr, status, error ) {
544
+ wppaConsoleLog( 'wppaAjaxMakeOrigName failed. Error = ' + error + ', status = ' + status, 'force' );
545
  },
546
  complete: function( xhr, status, newurl ) {
547
 
558
  '&album-id=' + id,
559
  async: true,
560
  type: 'GET',
561
+ timeout: 60000,
562
  beforeSend: function( xhr ) {
563
 
564
  // Show spinner
583
  }
584
  },
585
  error: function( xhr, status, error ) {
586
+ //wppaConsoleLog( 'wppaAjaxDownloadAlbum failed. Error = ' + error + ', status = ' + status, 'force' );
587
+ alert( 'An error occurred:\n'+error+'\nPlease try again' );
588
  },
589
  complete: function( xhr, status, newurl ) {
590
 
625
  // '&wppa-action=',
626
  async: true,
627
  type: 'POST',
628
+ timeout: 60000,
629
  beforeSend: function( xhr ) {
630
 
631
  // Show spinner
js/wppa-ajax-front.min.js CHANGED
@@ -3,10 +3,9 @@
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
- var wppaJsAjaxVersion = '6.3.0';
7
 
8
- var wppaJsAjaxVersion='6.3.0';var wppaRenderAdd=false;var wppaWaitForCounter=0;function wppaDoAjaxRender(mocc,ajaxurl,newurl,add,waitfor){if(parseInt(waitfor)>0&&waitfor!=wppaWaitForCounter){setTimeout('wppaDoAjaxRender( '+mocc+', \''+ajaxurl+'\', \''+newurl+'\', \''+add+'\', '+waitfor+' )',100);return;}
9
- wppaRenderAdd=add;if(wppaLang!='')ajaxurl+='&lang='+wppaLang;if(wppaCanAjaxRender){jQuery.ajax({url:ajaxurl,async:true,type:'GET',timeout:30000,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');}
10
  else{jQuery('#wppa-container-'+mocc).html(result);}
11
  if(wppaCanPushState&&wppaUpdateAddressLine){wppaHis++;try{history.pushState({page:wppaHis,occur:mocc,type:'html',html:result},"",newurl);wppaConsoleLog('Ajax rendering: History stack pushed','force');}
12
  catch(err){try{history.replaceState({page:wppaHis,occur:mocc,type:'html'},"",newurl);wppaConsoleLog('Ajax rendering: History stack updated','force');}
@@ -15,34 +14,34 @@ if(wppaFirstOccur==0)wppaFirstOccur=mocc;}
15
  wppaUpdateLightboxes();if(typeof(wppaQRUpdate)!='undefined')wppaQRUpdate(newurl);wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);jQuery('#speed0-'+mocc).html(wppaSlower);jQuery('#speed1-'+mocc).html(wppaFaster);jQuery('#wppa-ajax-spin-'+mocc).css('display','none');var scriptPos=result.indexOf('<script');var scriptPosLast=result.lastIndexOf('<script');if(scriptPos==-1){wppaConsoleLog('Ajax render did NOT contain a script tag','force');}
16
  else{wppaConsoleLog('Ajax render did contain a script tag at position '+scriptPos+' last at '+scriptPosLast,'force');}},error:function(xhr,status,error){wppaConsoleLog('wppaDoAjaxRender failed. Error = '+error+', status = '+status,'force');document.location.href=newurl;wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);},complete:function(xhr,status,newurl){wppaWaitForCounter++;jQuery('html, body').animate({scrollTop:jQuery("#wppa-container-"+mocc).offset().top-32},1000);}});}
17
  else{document.location.href=newurl;wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);}}
18
- function wppaAjaxApprovePhoto(photo){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=approve'+'&photo-id='+photo,async:true,type:'GET',timeout:10000,success:function(result,status,xhr){if(result=='OK'){jQuery('.wppa-approve-'+photo).css('display','none');}
19
  else{alert(result);}},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxApprovePhoto failed. Error = '+error+', status = '+status,'force');},});}
20
- function wppaAjaxRemovePhoto(mocc,photo,isslide){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=remove'+'&photo-id='+photo,async:true,type:'GET',timeout:10000,success:function(result,status,xhr){rtxt=result.split('||');if(rtxt[0]=='OK'){if(isslide){jQuery('#wppa-film-'+_wppaCurIdx[mocc]+'-'+mocc).attr('src','');jQuery('#wppa-pre-'+_wppaCurIdx[mocc]+'-'+mocc).attr('src','');jQuery('#wppa-film-'+_wppaCurIdx[mocc]+'-'+mocc).attr('alt','removed');jQuery('#wppa-pre-'+_wppaCurIdx[mocc]+'-'+mocc).attr('alt','removed');wppaNext(mocc);}
21
  else{jQuery('.wppa-approve-'+photo).css('display','none');jQuery('.thumbnail-frame-photo-'+photo).css('display','none');}}
22
  else{alert(result);}},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxRemovePhoto failed. Error = '+error+', status = '+status,'force');}});}
23
- function wppaAjaxApproveComment(comment){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=approve'+'&comment-id='+comment,async:true,type:'GET',timeout:10000,success:function(result,status,xhr){if(result=='OK'){jQuery('.wppa-approve-'+comment).css('display','none');}
24
  else{alert(result);}},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxApproveComment failed. Error = '+error+', status = '+status,'force');}});}
25
- function wppaAjaxRemoveComment(comment){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=remove'+'&comment-id='+comment,async:true,type:'GET',timeout:10000,success:function(result,status,xhr){var rtxt=result.split('||');if(rtxt[0]=='OK'){jQuery('.wppa-approve-'+comment).css('display','none');jQuery('.wppa-comment-'+comment).css('display','none');}
26
  else{alert(result);}},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxRemoveComment failed. Error = '+error+', status = '+status,'force');},});}
27
- function wppaEditPhoto(mocc,id){var name='Edit Photo '+id;var desc='';var width=960;var height=512;if(screen.availWidth<width)width=screen.availWidth;var wnd=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width="+width+", height="+height,true);jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=front-edit'+'&photo-id='+id+'&moccur='+mocc,async:true,type:'POST',timeout:30000,beforeSend:function(xhr){wnd.document.write('<! DOCTYPE html>');wnd.document.write('<html>');wnd.document.write('<head>');wnd.document.write('<link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+'/wppa-admin-styles.css?ver='+wppaVersion+'" type="text/css" media="all" />'+'<style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style>'+'<script type="text/javascript" src="'+wppaIncludeUrl+'/js/jquery/jquery.js?ver='+wppaVersion+'"></script>'+'<script type="text/javascript" src="'+wppaWppaUrl+'/js/wppa-utils.js?ver='+wppaVersion+'"></script>'+'<script type="text/javascript" src="'+wppaWppaUrl+'/js/wppa-admin-scripts.js?ver='+wppaVersion+'"></script>'+'<title>'+name+'</title>'+'<script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";</script>');wnd.document.write('</head>');wnd.document.write('<body>');},success:function(result,status,xhr){wnd.document.write(result);},error:function(xhr,status,error){wnd.document.write(status+' '+error);wppaConsoleLog('wppaEditPhoto failed. Error = '+error+', status = '+status,'force');},complete:function(xhr,status,newurl){wnd.document.write('<script>wppaPhotoStatusChange( '+id+' )</script>');wnd.document.write('</body>');wnd.document.write('</html>');}});}
28
  function wppaPrevTags(tagsSel,tagsEdit,tagsAlbum,tagsPrev){var sel=jQuery('.'+tagsSel);var selArr=[];var editTag='';var album=jQuery('#'+tagsAlbum).val();var i=0;var j=0;var tags='';while(i<sel.length){if(sel[i].selected){selArr[j]=sel[i].value;j++;}
29
  i++;}
30
  editTag=jQuery('#'+tagsEdit).val();if(editTag!=''){selArr[j]=editTag;}
31
- tags=selArr.join();if(editTag!=''||tagsAlbum!=''){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=sanitizetags'+'&tags='+tags+'&album='+album,async:true,type:'GET',timeout:10000,beforeSend:function(xhr){jQuery('#'+tagsPrev).html('Working...');},success:function(result,status,xhr){jQuery('#'+tagsPrev).html(wppaTrim(result,','));},error:function(xhr,status,error){jQuery('#'+tagsPrev).html('<span style="color:red" >'+error+'</span>');wppaConsoleLog('wppaPrevTags failed. Error = '+error+', status = '+status,'force');},});}}
32
- function wppaAjaxDestroyAlbum(album,nonce){if(confirm('Are you sure you want to delete this album?')){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=destroyalbum'+'&album='+album+'&nonce='+nonce,async:true,type:'GET',timeout:10000,success:function(result,status,xhr){alert(result+'\n'+'Page will be reloaded');document.location.reload(true);},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxDestroyAlbum failed. Error = '+error+', status = '+status,'force');},});}
33
  return false;}
34
- function _bumpViewCount(photo){if(!wppaBumpViewCount)return;if(wppaPhotoView[photo])return;jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=bumpviewcount'+'&wppa-photo='+photo+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:10000,success:function(result,status,xhr){wppaPhotoView[photo]=true;},error:function(xhr,status,error){wppaConsoleLog('_bumpViewCount failed. Error = '+error+', status = '+status,'force');},});}
35
- function wppaVoteThumb(mocc,photo){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=rate'+'&wppa-rating=1'+'&wppa-rating-id='+photo+'&wppa-occur='+mocc+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:10000,success:function(result,status,xhr){jQuery('#wppa-vote-button-'+mocc+'-'+photo).val(wppaVotedForMe);},error:function(xhr,status,error){wppaConsoleLog('wppaVoteThumb failed. Error = '+error+', status = '+status,'force');},});}
36
- function _wppaRateIt(mocc,value){if(value==0)return;if(_wppaSSRuns[mocc])return;var photo=_wppaId[mocc][_wppaCurIdx[mocc]];var oldval=_wppaMyr[mocc][_wppaCurIdx[mocc]];if(oldval!=0&&wppaRatingOnce)return;if(oldval<0)return;_wppaVoteInProgress=true;jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=rate'+'&wppa-rating='+value+'&wppa-rating-id='+photo+'&wppa-occur='+mocc+'&wppa-index='+_wppaCurIdx[mocc]+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:10000,beforeSend:function(xhr){jQuery('#wppa-rate-'+mocc+'-'+value).attr('src',wppaImageDirectory+'tick.png');jQuery('#wppa-rate-'+mocc+'-'+value).stop().fadeTo(100,1.0);},success:function(result,status,xhr){var ArrValues=result.split("||");if(ArrValues[0]==0){if(ArrValues[1]==900){alert(ArrValues[2]);_wppaSetRatingDisplay(mocc);}
37
  else{alert('Error Code='+ArrValues[1]+'\n\n'+ArrValues[2]);}}
38
  else{_wppaMyr[ArrValues[0]][ArrValues[2]]=ArrValues[3];_wppaAvg[ArrValues[0]][ArrValues[2]]=ArrValues[4];_wppaDisc[ArrValues[0]][ArrValues[2]]=ArrValues[5];_wppaSetRatingDisplay(mocc);if(wppaCommentRequiredAfterVote){if(ArrValues[6]==0){alert(ArrValues[7]);}}
39
  if(wppaNextOnCallback)_wppaNextOnCallback(mocc);}},error:function(xhr,status,error){wppaConsoleLog('_wppaRateIt failed. Error = '+error+', status = '+status,'force');},});}
40
- function wppaAjaxMakeOrigName(mocc,photo){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=makeorigname'+'&photo-id='+photo+'&from=fsname',async:true,type:'GET',timeout:10000,beforeSend:function(xhr){},success:function(result,status,xhr){var ArrValues=result.split("||");if(ArrValues[1]=='0'){if(wppaArtMonkyLink=='file')window.open(ArrValues[2]);if(wppaArtMonkyLink=='zip')document.location=ArrValues[2];}
41
- else{alert('Error: '+ArrValues[1]+'\n\n'+ArrValues[2]);}},error:function(xhr,status,error){wppaConsoleLog('wppa.. failed. Error = '+error+', status = '+status,'force');},complete:function(xhr,status,newurl){}});}
42
- function wppaAjaxDownloadAlbum(mocc,id){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=downloadalbum'+'&album-id='+id,async:true,type:'GET',timeout:10000,beforeSend:function(xhr){jQuery('#dwnspin-'+mocc+'-'+id).css('display','');},success:function(result,status,xhr){var ArrValues=result.split("||");var url=ArrValues[0];var erok=ArrValues[1];var text=ArrValues[2];if(ArrValues.length==3&&text!='')alert('Attention:\n\n'+text);if(erok=='OK'){document.location=url;}
43
- else{alert('The server could not complete the request.\nPlease try again.');}},error:function(xhr,status,error){wppaConsoleLog('wppa.. failed. Error = '+error+', status = '+status,'force');},complete:function(xhr,status,newurl){jQuery('#dwnspin-'+mocc+'-'+id).css('display','none');}});}
44
  function wppaAjaxComment(mocc,id){if(!_wppaValidateComment(mocc))return;var data='action=wppa'+'&wppa-action=do-comment'+'&photo-id='+id+'&comname='+jQuery("#wppa-comname-"+mocc).val()+'&comment='+wppaEncode(jQuery("#wppa-comment-"+mocc).val())+'&wppa-captcha='+jQuery("#wppa-captcha-"+mocc).val()+'&wppa-nonce='+jQuery("#wppa-nonce-"+mocc).val()+'&moccur='+mocc;if(typeof(jQuery("#wppa-comemail-"+mocc).val())!='undefined'){data+='&comemail='+jQuery("#wppa-comemail-"+mocc).val();}
45
  if(typeof(jQuery("#wppa-comment-edit-"+mocc).val())!='undefined'){data+='&comment-edit='+jQuery("#wppa-comment-edit-"+mocc).val();}
46
  if(typeof(jQuery("#wppa-returnurl-"+mocc).val())!='undefined'){data+='&returnurl='+encodeURIComponent(jQuery("#wppa-returnurl-"+mocc).val());}
47
- jQuery.ajax({url:wppaAjaxUrl,data:data,async:true,type:'POST',timeout:10000,beforeSend:function(xhr){jQuery("#wppa-comment-spin-"+mocc).css('display','inline');},success:function(result,status,xhr){result=result.replace(/\\/g,'');jQuery("#wppa-comments-"+mocc).html(result);_wppaCommentHtml[mocc][_wppaCurIdx[mocc]]=result;wppaOpenComments(mocc);},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxComment failed. Error = '+error+', status = '+status,'force');},complete:function(xhr,status,newurl){jQuery("#wppa-comment-spin-"+mocc).css('display','none');}});}
48
  wppaConsoleLog('wppa-ajax-front.js version '+wppaJsAjaxVersion+' loaded.','force');
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
 
6
 
7
+ var wppaJsAjaxVersion='6.3.7';var wppaRenderAdd=false;var wppaWaitForCounter=0;function wppaDoAjaxRender(mocc,ajaxurl,newurl,add,waitfor){if(parseInt(waitfor)>0&&waitfor!=wppaWaitForCounter){setTimeout('wppaDoAjaxRender( '+mocc+', \''+ajaxurl+'\', \''+newurl+'\', \''+add+'\', '+waitfor+' )',100);return;}
8
+ wppaRenderAdd=add;if(wppaLang!='')ajaxurl+='&lang='+wppaLang;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{jQuery('#wppa-container-'+mocc).html(result);}
10
  if(wppaCanPushState&&wppaUpdateAddressLine){wppaHis++;try{history.pushState({page:wppaHis,occur:mocc,type:'html',html:result},"",newurl);wppaConsoleLog('Ajax rendering: History stack pushed','force');}
11
  catch(err){try{history.replaceState({page:wppaHis,occur:mocc,type:'html'},"",newurl);wppaConsoleLog('Ajax rendering: History stack updated','force');}
14
  wppaUpdateLightboxes();if(typeof(wppaQRUpdate)!='undefined')wppaQRUpdate(newurl);wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);jQuery('#speed0-'+mocc).html(wppaSlower);jQuery('#speed1-'+mocc).html(wppaFaster);jQuery('#wppa-ajax-spin-'+mocc).css('display','none');var scriptPos=result.indexOf('<script');var scriptPosLast=result.lastIndexOf('<script');if(scriptPos==-1){wppaConsoleLog('Ajax render did NOT contain a script tag','force');}
15
  else{wppaConsoleLog('Ajax render did contain a script tag at position '+scriptPos+' last at '+scriptPosLast,'force');}},error:function(xhr,status,error){wppaConsoleLog('wppaDoAjaxRender failed. Error = '+error+', status = '+status,'force');document.location.href=newurl;wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);},complete:function(xhr,status,newurl){wppaWaitForCounter++;jQuery('html, body').animate({scrollTop:jQuery("#wppa-container-"+mocc).offset().top-32},1000);}});}
16
  else{document.location.href=newurl;wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);}}
17
+ function wppaAjaxApprovePhoto(photo){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=approve'+'&photo-id='+photo,async:true,type:'GET',timeout:60000,success:function(result,status,xhr){if(result=='OK'){jQuery('.wppa-approve-'+photo).css('display','none');}
18
  else{alert(result);}},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxApprovePhoto failed. Error = '+error+', status = '+status,'force');},});}
19
+ function wppaAjaxRemovePhoto(mocc,photo,isslide){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=remove'+'&photo-id='+photo,async:true,type:'GET',timeout:60000,success:function(result,status,xhr){rtxt=result.split('||');if(rtxt[0]=='OK'){if(isslide){jQuery('#wppa-film-'+_wppaCurIdx[mocc]+'-'+mocc).attr('src','');jQuery('#wppa-pre-'+_wppaCurIdx[mocc]+'-'+mocc).attr('src','');jQuery('#wppa-film-'+_wppaCurIdx[mocc]+'-'+mocc).attr('alt','removed');jQuery('#wppa-pre-'+_wppaCurIdx[mocc]+'-'+mocc).attr('alt','removed');wppaNext(mocc);}
20
  else{jQuery('.wppa-approve-'+photo).css('display','none');jQuery('.thumbnail-frame-photo-'+photo).css('display','none');}}
21
  else{alert(result);}},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxRemovePhoto failed. Error = '+error+', status = '+status,'force');}});}
22
+ function wppaAjaxApproveComment(comment){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=approve'+'&comment-id='+comment,async:true,type:'GET',timeout:60000,success:function(result,status,xhr){if(result=='OK'){jQuery('.wppa-approve-'+comment).css('display','none');}
23
  else{alert(result);}},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxApproveComment failed. Error = '+error+', status = '+status,'force');}});}
24
+ function wppaAjaxRemoveComment(comment){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=remove'+'&comment-id='+comment,async:true,type:'GET',timeout:60000,success:function(result,status,xhr){var rtxt=result.split('||');if(rtxt[0]=='OK'){jQuery('.wppa-approve-'+comment).css('display','none');jQuery('.wppa-comment-'+comment).css('display','none');}
25
  else{alert(result);}},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxRemoveComment failed. Error = '+error+', status = '+status,'force');},});}
26
+ function wppaEditPhoto(mocc,id){var name='Edit Photo '+id;var desc='';var width=960;var height=512;if(screen.availWidth<width)width=screen.availWidth;var wnd=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width="+width+", height="+height,true);jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=front-edit'+'&photo-id='+id+'&moccur='+mocc,async:true,type:'POST',timeout:60000,beforeSend:function(xhr){wnd.document.write('<! DOCTYPE html>');wnd.document.write('<html>');wnd.document.write('<head>');wnd.document.write('<link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+'/wppa-admin-styles.css?ver='+wppaVersion+'" type="text/css" media="all" />'+'<style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style>'+'<script type="text/javascript" src="'+wppaIncludeUrl+'/js/jquery/jquery.js?ver='+wppaVersion+'"></script>'+'<script type="text/javascript" src="'+wppaWppaUrl+'/js/wppa-utils.js?ver='+wppaVersion+'"></script>'+'<script type="text/javascript" src="'+wppaWppaUrl+'/js/wppa-admin-scripts.js?ver='+wppaVersion+'"></script>'+'<title>'+name+'</title>'+'<script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";</script>');wnd.document.write('</head>');wnd.document.write('<body>');},success:function(result,status,xhr){wnd.document.write(result);},error:function(xhr,status,error){wnd.document.write(status+' '+error);wppaConsoleLog('wppaEditPhoto failed. Error = '+error+', status = '+status,'force');},complete:function(xhr,status,newurl){wnd.document.write('<script>wppaPhotoStatusChange( '+id+' )</script>');wnd.document.write('</body>');wnd.document.write('</html>');}});}
27
  function wppaPrevTags(tagsSel,tagsEdit,tagsAlbum,tagsPrev){var sel=jQuery('.'+tagsSel);var selArr=[];var editTag='';var album=jQuery('#'+tagsAlbum).val();var i=0;var j=0;var tags='';while(i<sel.length){if(sel[i].selected){selArr[j]=sel[i].value;j++;}
28
  i++;}
29
  editTag=jQuery('#'+tagsEdit).val();if(editTag!=''){selArr[j]=editTag;}
30
+ tags=selArr.join();if(editTag!=''||tagsAlbum!=''){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=sanitizetags'+'&tags='+tags+'&album='+album,async:true,type:'GET',timeout:60000,beforeSend:function(xhr){jQuery('#'+tagsPrev).html('Working...');},success:function(result,status,xhr){jQuery('#'+tagsPrev).html(wppaTrim(result,','));},error:function(xhr,status,error){jQuery('#'+tagsPrev).html('<span style="color:red" >'+error+'</span>');wppaConsoleLog('wppaPrevTags failed. Error = '+error+', status = '+status,'force');},});}}
31
+ function wppaAjaxDestroyAlbum(album,nonce){if(confirm('Are you sure you want to delete this album?')){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=destroyalbum'+'&album='+album+'&nonce='+nonce,async:true,type:'GET',timeout:60000,success:function(result,status,xhr){alert(result+'\n'+'Page will be reloaded');document.location.reload(true);},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxDestroyAlbum failed. Error = '+error+', status = '+status,'force');},});}
32
  return false;}
33
+ function _bumpViewCount(photo){if(!wppaBumpViewCount)return;if(wppaPhotoView[photo])return;jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=bumpviewcount'+'&wppa-photo='+photo+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:60000,success:function(result,status,xhr){wppaPhotoView[photo]=true;},error:function(xhr,status,error){wppaConsoleLog('_bumpViewCount failed. Error = '+error+', status = '+status,'force');},});}
34
+ function wppaVoteThumb(mocc,photo){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=rate'+'&wppa-rating=1'+'&wppa-rating-id='+photo+'&wppa-occur='+mocc+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:60000,success:function(result,status,xhr){jQuery('#wppa-vote-button-'+mocc+'-'+photo).val(wppaVotedForMe);},error:function(xhr,status,error){wppaConsoleLog('wppaVoteThumb failed. Error = '+error+', status = '+status,'force');},});}
35
+ function _wppaRateIt(mocc,value){if(value==0)return;if(_wppaSSRuns[mocc])return;var photo=_wppaId[mocc][_wppaCurIdx[mocc]];var oldval=_wppaMyr[mocc][_wppaCurIdx[mocc]];if(oldval!=0&&wppaRatingOnce)return;if(oldval<0)return;_wppaVoteInProgress=true;jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=rate'+'&wppa-rating='+value+'&wppa-rating-id='+photo+'&wppa-occur='+mocc+'&wppa-index='+_wppaCurIdx[mocc]+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:60000,beforeSend:function(xhr){jQuery('#wppa-rate-'+mocc+'-'+value).attr('src',wppaImageDirectory+'tick.png');jQuery('#wppa-rate-'+mocc+'-'+value).stop().fadeTo(100,1.0);},success:function(result,status,xhr){var ArrValues=result.split("||");if(ArrValues[0]==0){if(ArrValues[1]==900){alert(ArrValues[2]);_wppaSetRatingDisplay(mocc);}
36
  else{alert('Error Code='+ArrValues[1]+'\n\n'+ArrValues[2]);}}
37
  else{_wppaMyr[ArrValues[0]][ArrValues[2]]=ArrValues[3];_wppaAvg[ArrValues[0]][ArrValues[2]]=ArrValues[4];_wppaDisc[ArrValues[0]][ArrValues[2]]=ArrValues[5];_wppaSetRatingDisplay(mocc);if(wppaCommentRequiredAfterVote){if(ArrValues[6]==0){alert(ArrValues[7]);}}
38
  if(wppaNextOnCallback)_wppaNextOnCallback(mocc);}},error:function(xhr,status,error){wppaConsoleLog('_wppaRateIt failed. Error = '+error+', status = '+status,'force');},});}
39
+ function wppaAjaxMakeOrigName(mocc,photo){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=makeorigname'+'&photo-id='+photo+'&from=fsname',async:true,type:'GET',timeout:60000,beforeSend:function(xhr){},success:function(result,status,xhr){var ArrValues=result.split("||");if(ArrValues[1]=='0'){if(wppaArtMonkyLink=='file')window.open(ArrValues[2]);if(wppaArtMonkyLink=='zip')document.location=ArrValues[2];}
40
+ else{alert('Error: '+ArrValues[1]+'\n\n'+ArrValues[2]);}},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxMakeOrigName failed. Error = '+error+', status = '+status,'force');},complete:function(xhr,status,newurl){}});}
41
+ function wppaAjaxDownloadAlbum(mocc,id){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=downloadalbum'+'&album-id='+id,async:true,type:'GET',timeout:60000,beforeSend:function(xhr){jQuery('#dwnspin-'+mocc+'-'+id).css('display','');},success:function(result,status,xhr){var ArrValues=result.split("||");var url=ArrValues[0];var erok=ArrValues[1];var text=ArrValues[2];if(ArrValues.length==3&&text!='')alert('Attention:\n\n'+text);if(erok=='OK'){document.location=url;}
42
+ else{alert('The server could not complete the request.\nPlease try again.');}},error:function(xhr,status,error){alert('An error occurred:\n'+error+'\nPlease try again');},complete:function(xhr,status,newurl){jQuery('#dwnspin-'+mocc+'-'+id).css('display','none');}});}
43
  function wppaAjaxComment(mocc,id){if(!_wppaValidateComment(mocc))return;var data='action=wppa'+'&wppa-action=do-comment'+'&photo-id='+id+'&comname='+jQuery("#wppa-comname-"+mocc).val()+'&comment='+wppaEncode(jQuery("#wppa-comment-"+mocc).val())+'&wppa-captcha='+jQuery("#wppa-captcha-"+mocc).val()+'&wppa-nonce='+jQuery("#wppa-nonce-"+mocc).val()+'&moccur='+mocc;if(typeof(jQuery("#wppa-comemail-"+mocc).val())!='undefined'){data+='&comemail='+jQuery("#wppa-comemail-"+mocc).val();}
44
  if(typeof(jQuery("#wppa-comment-edit-"+mocc).val())!='undefined'){data+='&comment-edit='+jQuery("#wppa-comment-edit-"+mocc).val();}
45
  if(typeof(jQuery("#wppa-returnurl-"+mocc).val())!='undefined'){data+='&returnurl='+encodeURIComponent(jQuery("#wppa-returnurl-"+mocc).val());}
46
+ jQuery.ajax({url:wppaAjaxUrl,data:data,async:true,type:'POST',timeout:60000,beforeSend:function(xhr){jQuery("#wppa-comment-spin-"+mocc).css('display','inline');},success:function(result,status,xhr){result=result.replace(/\\/g,'');jQuery("#wppa-comments-"+mocc).html(result);_wppaCommentHtml[mocc][_wppaCurIdx[mocc]]=result;wppaOpenComments(mocc);},error:function(xhr,status,error){wppaConsoleLog('wppaAjaxComment failed. Error = '+error+', status = '+status,'force');},complete:function(xhr,status,newurl){jQuery("#wppa-comment-spin-"+mocc).css('display','none');}});}
47
  wppaConsoleLog('wppa-ajax-front.js version '+wppaJsAjaxVersion+' loaded.','force');
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
5
- Version: 6.3.6
6
- Stable tag: 6.3.5
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -187,7 +187,23 @@ Oh, just Google on 'picture resizer' and you will find a bunch of free programs
187
 
188
  == Changelog ==
189
 
190
- See for additional information: http://wppa.opajaap.nl/?page_id=1459
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
 
192
  = 6.3.6 =
193
 
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
5
+ Version: 6.3.7
6
+ Stable tag: 6.3.6
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
187
 
188
  == Changelog ==
189
 
190
+ See for additional information: http://wppa.opajaap.nl/changelog/
191
+
192
+ = 6.3.7 =
193
+
194
+ = Bug Fixes =
195
+
196
+ * Stereo images were not correctly displayed when Fotomoto or Cloudinary was active. Fixed.
197
+ * Selecting any stereomode on photo admin page now always recreates thumbnail.
198
+ * If download album fails you will see a proper errormessage most of the time.
199
+ * The display of tags is now trimmed from comma's when converted from w#tags.
200
+
201
+ = Other Changes =
202
+
203
+ * Email notifications are now sent in plain text if the server can not handle emails containing html code.
204
+ * All ajax timeouts are now set to 60 seconds.
205
+ * Changed the minimum thumbnails for Imagefactory covers from 2 to 1.
206
+ * Cosmetic changes to the logfile ( Table VIII-C1 ).
207
 
208
  = 6.3.6 =
209
 
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * version 6.3.6
6
  *
7
  */
8
 
@@ -305,20 +305,29 @@ global $wppa_session;
305
  }
306
 
307
  // Add photos to zip
 
308
  foreach ( $photos as $p ) {
309
- $id = $p['id'];
310
- if ( ! wppa_is_multi( $id ) ) {
311
- $source = ( wppa_switch( 'wppa_download_album_source' ) && is_file( wppa_get_source_path( $id ) ) ) ? wppa_get_source_path( $id ) : wppa_get_photo_path( $id );
312
- if ( is_file( $source ) ) {
313
- $dest = $p['filename'] ? wppa_sanitize_file_name( $p['filename'] ) : wppa_sanitize_file_name( wppa_strip_ext( $p['name'] ).'.'.$p['ext'] );
314
- $dest = wppa_fix_poster_ext( $dest, $id );
315
- $iret = $wppa_zip->addFile( $source, $dest );
316
-
317
- // To prevent too may files open, and to have at least a file when there are too many photos, close and re-open
318
- $wppa_zip->close();
319
- $wppa_zip->open( $zipfilepath );
 
 
 
 
 
 
 
320
  }
321
  }
 
322
  }
323
 
324
  // Close zip and return
@@ -1645,7 +1654,7 @@ global $wppa_session;
1645
  }
1646
  break;
1647
  case 'wppa_imgfact_count':
1648
- wppa_ajax_check_range( $value, false, '2', '24', __( 'Number of coverphotos' , 'wp-photo-album-plus') );
1649
  break;
1650
  case 'wppa_dislike_value':
1651
  wppa_ajax_check_range( $value, false, '-10', '0', __( 'Dislike value' , 'wp-photo-album-plus') );
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * version 6.3.7
6
  *
7
  */
8
 
305
  }
306
 
307
  // Add photos to zip
308
+ $stop = false;
309
  foreach ( $photos as $p ) {
310
+ if ( wppa_is_time_up() ) {
311
+ wppa_log( 'dbg', 'Time up during album to zip creation' );
312
+ $stop = true;
313
+ }
314
+ else {
315
+ $id = $p['id'];
316
+ if ( ! wppa_is_multi( $id ) ) {
317
+ $source = ( wppa_switch( 'wppa_download_album_source' ) && is_file( wppa_get_source_path( $id ) ) ) ? wppa_get_source_path( $id ) : wppa_get_photo_path( $id );
318
+ if ( is_file( $source ) ) {
319
+ $dest = $p['filename'] ? wppa_sanitize_file_name( $p['filename'] ) : wppa_sanitize_file_name( wppa_strip_ext( $p['name'] ).'.'.$p['ext'] );
320
+ $dest = wppa_fix_poster_ext( $dest, $id );
321
+ $iret = $wppa_zip->addFile( $source, $dest );
322
+
323
+ // To prevent too may files open, and to have at least a file when there are too many photos, close and re-open
324
+ $wppa_zip->close();
325
+ $wppa_zip->open( $zipfilepath );
326
+ wppa_log( 'dbg', 'Added ' . basename($source) . ' to ' . basename($zipfilepath));
327
+ }
328
  }
329
  }
330
+ if ( $stop ) break;
331
  }
332
 
333
  // Close zip and return
1654
  }
1655
  break;
1656
  case 'wppa_imgfact_count':
1657
+ wppa_ajax_check_range( $value, false, '1', '24', __( 'Number of coverphotos' , 'wp-photo-album-plus') );
1658
  break;
1659
  case 'wppa_dislike_value':
1660
  wppa_ajax_check_range( $value, false, '-10', '0', __( 'Dislike value' , 'wp-photo-album-plus') );
wppa-album-navigator-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display album names linking to content
6
- * Version 6.3.2
7
  */
8
 
9
  class AlbumNavigatorWidget extends WP_Widget {
@@ -134,6 +134,10 @@ class AlbumNavigatorWidget extends WP_Widget {
134
  elseif ( isset( $_REQUEST['album'] ) ) $ca = $_REQUEST['album'];
135
  else $ca = '0';
136
  $ca = wppa_force_numeric_else( $ca, '0' );
 
 
 
 
137
  }
138
  else {
139
  $level++;
3
  * Package: wp-photo-album-plus
4
  *
5
  * display album names linking to content
6
+ * Version 6.3.7
7
  */
8
 
9
  class AlbumNavigatorWidget extends WP_Widget {
134
  elseif ( isset( $_REQUEST['album'] ) ) $ca = $_REQUEST['album'];
135
  else $ca = '0';
136
  $ca = wppa_force_numeric_else( $ca, '0' );
137
+ if ( $ca && ! wppa_album_exists( $ca ) ) {
138
+ wppa_log('dbg', 'Non-existent album '.$ca.' in url. Referrer= '.$_ENV["HTTP_REFERER"].', Request uri= '.$_ENV["REQUEST_URI"]);
139
+ $ca = '0';
140
+ }
141
  }
142
  else {
143
  $level++;
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various funcions
6
- * Version 6.3.6
7
  *
8
  */
9
 
@@ -1821,10 +1821,10 @@ static $user;
1821
  }
1822
 
1823
  // Find image url
1824
- if ( wppa_switch( 'fotomoto_on' ) ) {
1825
  $photourl = wppa_get_hires_url( $id );
1826
  }
1827
- elseif ( wppa_use_thumb_file( $id, $style_a['width'], $style_a['height'] ) ) {
1828
  $photourl = wppa_get_thumb_url( $id, '', $style_a['width'], $style_a['height'] );
1829
  }
1830
  else {
@@ -2103,7 +2103,7 @@ global $wppa_done;
2103
 
2104
  // Setup standard content
2105
  $cont['0'] = $usr.' '.__( 'wrote on photo' , 'wp-photo-album-plus').' '.wppa_get_photo_name( $id ).':';
2106
- $cont['1'] = '<blockquote><em> '.stripslashes($comment).'</em></blockquote>';
2107
  $cont['2'] = $returnurl ? '<a href="'.$returnurl.'" >'.__( 'Reply' , 'wp-photo-album-plus').'</a>' : '';
2108
  $cont2 = '<a href="'.get_admin_url().'admin.php?page=wppa_manage_comments&commentid='.$key.'" >' .
2109
  __( 'Moderate comment admin' , 'wp-photo-album-plus') .
@@ -3965,6 +3965,9 @@ global $wppa;
3965
  function wppa_do_frontend_file_upload( $file, $alb ) {
3966
  global $wpdb;
3967
 
 
 
 
3968
  $album = wppa_cache_album( $alb );
3969
 
3970
  if ( ! wppa_allow_uploads( $alb ) || ! wppa_allow_user_uploads() ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various funcions
6
+ * Version 6.3.7
7
  *
8
  */
9
 
1821
  }
1822
 
1823
  // Find image url
1824
+ if ( wppa_switch( 'fotomoto_on' ) && ! wppa_is_stereo( $id ) ) {
1825
  $photourl = wppa_get_hires_url( $id );
1826
  }
1827
+ elseif ( wppa_use_thumb_file( $id, $style_a['width'], $style_a['height'] ) && ! wppa_is_stereo( $id ) ) {
1828
  $photourl = wppa_get_thumb_url( $id, '', $style_a['width'], $style_a['height'] );
1829
  }
1830
  else {
2103
 
2104
  // Setup standard content
2105
  $cont['0'] = $usr.' '.__( 'wrote on photo' , 'wp-photo-album-plus').' '.wppa_get_photo_name( $id ).':';
2106
+ $cont['1'] = '<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" ><em> '.stripslashes($comment).'</em></blockquote>';
2107
  $cont['2'] = $returnurl ? '<a href="'.$returnurl.'" >'.__( 'Reply' , 'wp-photo-album-plus').'</a>' : '';
2108
  $cont2 = '<a href="'.get_admin_url().'admin.php?page=wppa_manage_comments&commentid='.$key.'" >' .
2109
  __( 'Moderate comment admin' , 'wp-photo-album-plus') .
3965
  function wppa_do_frontend_file_upload( $file, $alb ) {
3966
  global $wpdb;
3967
 
3968
+ // Log upload attempt
3969
+ wppa_log( 'Upl', 'FE Upload attempt of file '.$file['name'].', size='.filesize($file['tmp_name']) );
3970
+
3971
  $album = wppa_cache_album( $alb );
3972
 
3973
  if ( ! wppa_allow_uploads( $alb ) || ! wppa_allow_user_uploads() ) {
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.3.0
7
  *
8
  */
9
 
@@ -271,6 +271,9 @@ function wppa_get_photo_desc( $id, $do_shortcodes = false, $do_geo = false ) {
271
  $keywords = array('name', 'filename', 'owner', 'id', 'tags', 'views', 'album');
272
  foreach ( $keywords as $keyword ) {
273
  $replacement = __( trim( stripslashes( $thumb[$keyword] ) ) , 'wp-photo-album-plus');
 
 
 
274
  if ( $replacement == '' ) $replacement = '&lsaquo;'.__( 'none' , 'wp-photo-album-plus').'&rsaquo;';
275
  $desc = str_replace( 'w#'.$keyword, $replacement, $desc );
276
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions to retrieve album and photo items
6
+ * Version 6.3.7
7
  *
8
  */
9
 
271
  $keywords = array('name', 'filename', 'owner', 'id', 'tags', 'views', 'album');
272
  foreach ( $keywords as $keyword ) {
273
  $replacement = __( trim( stripslashes( $thumb[$keyword] ) ) , 'wp-photo-album-plus');
274
+ if ( $keyword == 'tags' ) {
275
+ $replacement = trim( $replacement, ',' );
276
+ }
277
  if ( $replacement == '' ) $replacement = '&lsaquo;'.__( 'none' , 'wp-photo-album-plus').'&rsaquo;';
278
  $desc = str_replace( 'w#'.$keyword, $replacement, $desc );
279
  }
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.3.5
7
  *
8
  */
9
 
@@ -94,6 +94,7 @@ global $wppa_supported_audio_extensions;
94
 
95
  // Pre-processing needed?
96
  if ( $lastid == '0' ) {
 
97
  switch ( $slug ) {
98
  case 'wppa_remake_index_albums':
99
  $wpdb->query( "UPDATE `".WPPA_INDEX."` SET `albums` = ''" );
@@ -692,6 +693,9 @@ global $wppa_supported_audio_extensions;
692
  unset( $wppa_session['cloudinary_ids'] );
693
  break;
694
  }
 
 
 
695
  }
696
  return $errtxt.'||'.$slug.'||'.$status.'||'.$togo.'||'.$reload;
697
  }
@@ -748,24 +752,19 @@ global $wpdb;
748
  case 'wppa_list_errorlog':
749
  $filename = WPPA_CONTENT_PATH.'/wppa-depot/admin/error.log';
750
  $result .= '
751
- <h2>List of WPPA+ error messages <small>( Newest first )</small></h2>
752
  <div style="float:left; clear:both; width:100%; overflow:auto; word-wrap:none; background-color:#f1f1f1; border:1px solid #ddd;" >';
753
 
754
  if ( ! $file = @ fopen( $filename, 'r' ) ) {
755
  $result .= __('There are no error log messages', 'wp-photo-album-plus');
756
  }
757
  else {
758
- $size = filesize( $filename );
759
- $data = fread( $file, $size );
760
- $messages = explode( "\n", $data );
761
- $count = count( $messages );
762
- $idx = $count - '2';
763
- while ( $idx >= '0' ) {
764
- $msg = $messages[$idx];
765
- $msg = htmlspecialchars( strip_tags( $msg ) ); // Security fix
766
- $result .= $msg.'<br />';
767
- $idx--;
768
- }
769
  }
770
 
771
  $result .= '
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 6.3.7
7
  *
8
  */
9
 
94
 
95
  // Pre-processing needed?
96
  if ( $lastid == '0' ) {
97
+ wppa_log( 'Obs', 'Maintenance proc '.$slug.' started.' );
98
  switch ( $slug ) {
99
  case 'wppa_remake_index_albums':
100
  $wpdb->query( "UPDATE `".WPPA_INDEX."` SET `albums` = ''" );
693
  unset( $wppa_session['cloudinary_ids'] );
694
  break;
695
  }
696
+
697
+ wppa_log( 'Obs', 'Maintenance proc '.$slug.' completed' );
698
+
699
  }
700
  return $errtxt.'||'.$slug.'||'.$status.'||'.$togo.'||'.$reload;
701
  }
752
  case 'wppa_list_errorlog':
753
  $filename = WPPA_CONTENT_PATH.'/wppa-depot/admin/error.log';
754
  $result .= '
755
+ <h2>List of WPPA+ error messages</h2>
756
  <div style="float:left; clear:both; width:100%; overflow:auto; word-wrap:none; background-color:#f1f1f1; border:1px solid #ddd;" >';
757
 
758
  if ( ! $file = @ fopen( $filename, 'r' ) ) {
759
  $result .= __('There are no error log messages', 'wp-photo-album-plus');
760
  }
761
  else {
762
+ $size = filesize( $filename );
763
+ $data = fread( $file, $size );
764
+ $data = htmlspecialchars( strip_tags( $data ) );
765
+ $data = str_replace( array( '{b}', '{/b}', "\n" ), array( '<b>', '</b>', '<br />' ), $data );
766
+ $result .= $data;
767
+ fclose( $file );
 
 
 
 
 
768
  }
769
 
770
  $result .= '
wppa-stereo.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the stereo stuff
6
- * Version 6.3.6
7
  *
8
  */
9
 
@@ -47,14 +47,18 @@ global $wppa_supported_stereo_glasses;
47
  // Feature enabled?
48
  if ( ! wppa_switch( 'enable_stereo' ) ) return;
49
 
 
 
 
50
  // Is it a stereo poto?
51
  if ( ! wppa_is_stereo( $id ) ) {
52
 
53
- // Maybe no longer, delete any
54
  wppa_delete_stereo_images( $id );
55
  return;
56
  }
57
 
 
58
  foreach( $wppa_supported_stereo_types as $type ) {
59
  foreach( $wppa_supported_stereo_glasses as $glas ) {
60
  wppa_create_stereo_image( $id, $type, $glas );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the stereo stuff
6
+ * Version 6.3.7
7
  *
8
  */
9
 
47
  // Feature enabled?
48
  if ( ! wppa_switch( 'enable_stereo' ) ) return;
49
 
50
+ // First create new thumbnail
51
+ wppa_create_thumbnail( $id );
52
+
53
  // Is it a stereo poto?
54
  if ( ! wppa_is_stereo( $id ) ) {
55
 
56
+ // Maybe no longer, delete any anaglyphs
57
  wppa_delete_stereo_images( $id );
58
  return;
59
  }
60
 
61
+ // Now the anaglyphs
62
  foreach( $wppa_supported_stereo_types as $type ) {
63
  foreach( $wppa_supported_stereo_glasses as $glas ) {
64
  wppa_create_stereo_image( $id, $type, $glas );
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 6.3.6
7
  *
8
  */
9
 
@@ -26,7 +26,7 @@ global $blog_id;
26
 
27
  // If in the cloud...
28
  $is_old = wppa_too_old_for_cloud( $id );
29
- if ( wppa_cdn( 'front' ) && ! wppa_is_multi( $id ) && ! $is_old ) {
30
  if ( $x && $y ) { // Only when size is given !! To prevent download of the fullsize image
31
  switch ( wppa_cdn( 'front' ) ) {
32
  case 'cloudinary':
@@ -110,7 +110,7 @@ global $wppa_supported_stereo_types;
110
  // Get type from cookie
111
  $st = isset( $_COOKIE["stereotype"] ) ? $_COOKIE["stereotype"] : 'color';
112
  if ( ! in_array( $st, $wppa_supported_stereo_types ) ) {
113
- $st = 'flat';
114
  }
115
 
116
  // Get glass from cookie
@@ -237,7 +237,7 @@ static $prev_album_id;
237
 
238
  $album = wppa_cache_album($id);
239
  if ( $album === false ) {
240
- wppa_dbg_msg('Album '.$id.' no longer exists, but is still set as a parent of '.$prev_album_id.'. Please correct this.', 'red');
241
  return '-9'; // Album does not exist
242
  }
243
  $prev_album_id = $id;
@@ -852,6 +852,12 @@ function wppa_send_mail($to, $subj, $cont, $photo, $email = '') {
852
 
853
  wppa_dbg_msg('Sending mail to '.$to.' !');
854
 
 
 
 
 
 
 
855
  $site = home_url();
856
  $site = str_replace( 'https://www.', '', $site );
857
  $site = str_replace( 'http://www.', '', $site );
@@ -863,50 +869,105 @@ function wppa_send_mail($to, $subj, $cont, $photo, $email = '') {
863
  }
864
 
865
  $from = 'From: noreply@'.$site;
866
- $extraheaders = "\n" . 'MIME-Version: 1.0' . "\n" . 'Content-Transfer-Encoding: 8bit' . "\n" . 'Content-Type: text/html; charset="UTF-8"';
867
- $message = '
868
- <html>
869
- <head>
870
- <title>'.$subj.'</title>
871
- <style>blockquote { color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;} </style>
872
- </head>
873
- <body>
874
- <h3>'.$subj.'</h3>
875
- <p><img src="'.wppa_get_thumb_url($photo).'" '.wppa_get_imgalt($photo).'/></p>';
876
  if ( is_array($cont) ) {
877
  foreach ( $cont as $c ) if ( $c ) {
878
- $message .= '
879
- <p>'.$c.'</p>';
880
  }
881
  }
882
  else {
883
- $message .= '
884
- <p>'.$cont.'</p>';
885
  }
 
886
  if ( $email != 'void' ) {
887
  if ( is_user_logged_in() ) {
888
  global $current_user;
889
  get_currentuserinfo();
890
  $e = $current_user->user_email;
891
  $eml = sprintf(__('The visitors email address is: <a href="mailto:%s">%s</a>', 'wp-photo-album-plus'), $e, $e);
892
- $message .= '
893
- <p>'.$eml.'</p>';
894
  }
895
  elseif ( $email ) {
896
  $e = $email;
897
  $eml = sprintf(__('The visitor says his email address is: <a href="mailto:%s">%s</a>', 'wp-photo-album-plus'), $e, $e);
898
- $message .= '
899
- <p>'.$eml.'</p>';
900
  }
901
  }
902
- $message .= '
903
- <p><small>'.sprintf(__('This message is automaticly generated at %s. It is useless to respond to it.', 'wp-photo-album-plus'), '<a href="'.home_url().'" >'.home_url().'</a>').'</small></p>';
904
- $message .= '
905
- </body>
906
- </html>';
907
 
908
- $iret = mail( $to , '['.str_replace('&#039;', '', get_bloginfo('name')).'] '.$subj , $message , $from . $extraheaders, '' );
909
- if ( ! $iret ) echo 'Mail sending Failed';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
910
  }
911
 
912
  function wppa_get_imgalt( $id ) {
@@ -1531,20 +1592,44 @@ function wppa_is_enum( $var ) {
1531
  return '' === str_replace( array( '0','1','2','3','4','5','6','7','8','9','.' ), '', $var );
1532
  }
1533
 
1534
- function wppa_log( $type, $msg ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1535
 
1536
  // Log debug messages only if WP_DEBUG is defined as true
1537
- if ( $type == 'dbg' ) {
1538
  if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
1539
  return;
1540
  }
1541
  }
1542
 
 
1543
  @ wppa_mktree( WPPA_CONTENT_PATH.'/wppa-depot/admin' ); // Just in case...
1544
  $filename = WPPA_CONTENT_PATH.'/wppa-depot/admin/error.log';
 
 
1545
  if ( is_file( $filename ) ) {
1546
  $filesize = filesize( $filename );
1547
- if ( $filesize > 1024000 ) { // File > 1000kB
 
 
1548
  $file = fopen( $filename, 'rb' );
1549
  if ( $file ) {
1550
  $buffer = @ fread( $file, $filesize );
@@ -1556,14 +1641,17 @@ function wppa_log( $type, $msg ) {
1556
  }
1557
  }
1558
  }
 
 
1559
  if ( ! $file = fopen( $filename, 'ab' ) ) return; // Unable to open log file
1560
 
1561
- @ fwrite( $file, $type.': on:'.wppa_local_date(get_option('date_format', "F j, Y,").' '.get_option('time_format', "g:i a"), time()).': '.wppa_get_user().' '.$msg."\n" );
1562
- // To prevent recursive error reporting, do not use wppa_switch!!!
1563
- //if ( wppa_switch( 'wppa_debug_trace_on' ) ) {
1564
- if ( get_option( 'wppa_debug_trace_on' ) == 'yes' ) {
 
1565
  ob_start();
1566
- debug_print_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 3 );
1567
  $trace = ob_get_contents();
1568
  ob_end_clean();
1569
  @ fwrite( $file, $trace."\n" );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 6.3.7
7
  *
8
  */
9
 
26
 
27
  // If in the cloud...
28
  $is_old = wppa_too_old_for_cloud( $id );
29
+ if ( wppa_cdn( 'front' ) && ! wppa_is_multi( $id ) && ! $is_old && ! wppa_is_stereo( $id ) ) {
30
  if ( $x && $y ) { // Only when size is given !! To prevent download of the fullsize image
31
  switch ( wppa_cdn( 'front' ) ) {
32
  case 'cloudinary':
110
  // Get type from cookie
111
  $st = isset( $_COOKIE["stereotype"] ) ? $_COOKIE["stereotype"] : 'color';
112
  if ( ! in_array( $st, $wppa_supported_stereo_types ) ) {
113
+ $st = '_flat';
114
  }
115
 
116
  // Get glass from cookie
237
 
238
  $album = wppa_cache_album($id);
239
  if ( $album === false ) {
240
+ wppa_log( 'error', 'Album '.$id.' no longer exists, but is still set as a parent of '.$prev_album_id.'. Please correct this.' );
241
  return '-9'; // Album does not exist
242
  }
243
  $prev_album_id = $id;
852
 
853
  wppa_dbg_msg('Sending mail to '.$to.' !');
854
 
855
+ $debug = false;
856
+
857
+ $message_part_1 = '';
858
+ $message_part_2 = '';
859
+ $message_part_3 = '';
860
+
861
  $site = home_url();
862
  $site = str_replace( 'https://www.', '', $site );
863
  $site = str_replace( 'http://www.', '', $site );
869
  }
870
 
871
  $from = 'From: noreply@'.$site;
872
+ $extraheaders = "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-Type: text/html; charset="UTF-8"' . "\r\n" . 'Content-Transfer-Encoding: 8bit';
873
+ $message_part_1 .=
874
+ '<html>' .
875
+ '<head>' .
876
+ '<title>'.$subj.'</title>' .
877
+ '</head>' .
878
+ '<body>' .
879
+ '<h3>'.$subj.'</h3>' .
880
+ '<p><img src="'.wppa_get_thumb_url($photo).'" '.wppa_get_imgalt($photo).'/></p>';
 
881
  if ( is_array($cont) ) {
882
  foreach ( $cont as $c ) if ( $c ) {
883
+ $message_part_1 .= '<p>'.$c.'</p>';
 
884
  }
885
  }
886
  else {
887
+ $message_part_1 .= '<p>'.$cont.'</p>';
 
888
  }
889
+
890
  if ( $email != 'void' ) {
891
  if ( is_user_logged_in() ) {
892
  global $current_user;
893
  get_currentuserinfo();
894
  $e = $current_user->user_email;
895
  $eml = sprintf(__('The visitors email address is: <a href="mailto:%s">%s</a>', 'wp-photo-album-plus'), $e, $e);
896
+ $message_part_2 .= '<p>'.$eml.'</p>';
 
897
  }
898
  elseif ( $email ) {
899
  $e = $email;
900
  $eml = sprintf(__('The visitor says his email address is: <a href="mailto:%s">%s</a>', 'wp-photo-album-plus'), $e, $e);
901
+ $message_part_2 .= '<p>'.$eml.'</p>';
 
902
  }
903
  }
 
 
 
 
 
904
 
905
+ $message_part_3 .=
906
+ '<p>' .
907
+ '<small>' .
908
+ sprintf(__('This message is automaticly generated at %s. It is useless to respond to it.', 'wp-photo-album-plus'), '<a href="'.home_url().'" >'.home_url().'</a>') .
909
+ '</small>' .
910
+ '</p>' .
911
+ '</body>' .
912
+ '</html>';
913
+
914
+ $subject = '['.str_replace('&#039;', '', get_bloginfo('name') ).'] '.$subj;
915
+ $headers = $from . $extraheaders;
916
+
917
+ // Send it
918
+ $iret = mail( $to,
919
+ $subject . ( $debug ? ' (1)' : '' ),
920
+ $message_part_1 . $message_part_2 . $message_part_3,
921
+ $headers,
922
+ '' );
923
+ if ( ! $iret || $debug ) {
924
+
925
+ // Failed. Try with newlines only
926
+ $iret = mail( $to,
927
+ $subject . ( $debug ? ' (2)' : '' ),
928
+ $message_part_1 . $message_part_2 . $message_part_3,
929
+ str_replace( "\r\n", "\n", $headers ),
930
+ '' );
931
+ if ( ! $iret || $debug ) {
932
+
933
+ // Failed. Then try as plain text
934
+ $message_part_1 = str_replace( '<p>', "\n<p>", $message_part_1 );
935
+ $message_part_1 = str_replace( '<blockquote', "\n<blockquote", $message_part_1 );
936
+ $message_part_1 = str_replace( '</blockquote>', "</blockquote>\n", $message_part_1 );
937
+ $message_part_1 = strip_tags( $message_part_1, '<a>' );
938
+ $message_part_1 = str_replace( array( "\t", '<a href="', '</a>', $subj ), ' ', $message_part_1 );
939
+ $message_part_1 = str_replace( array( '" >', '">' ), ' ', $message_part_1 );
940
+ $message_part_2 = str_replace( '<p>', "\n<p>", $message_part_2 );
941
+ $message_part_2 = strip_tags( $message_part_2 );
942
+ $message_part_2 = str_replace( array( "\t", '<a href="', '</a>', $subj ), ' ', $message_part_2 );
943
+ $message_part_2 = str_replace( array( '" >', '">' ), ' ', $message_part_2 );
944
+ $message_part_3 = str_replace( '<p>', "\n<p>", $message_part_3 );
945
+ $message_part_3 = strip_tags( $message_part_3 );
946
+ $message_part_3 = str_replace( array( "\t", '<a href="', '</a>', $subj ), ' ', $message_part_3 );
947
+ $message_part_3 = str_replace( array( '" >', '">' ), ' ', $message_part_3 );
948
+
949
+ $headers = $from . str_replace( 'text/html', 'text/plain', $extraheaders );
950
+ $iret = mail( $to,
951
+ $subject . ( $debug ? ' (3)' : '' ),
952
+ $message_part_1 . $message_part_2 . $message_part_3,
953
+ $headers,
954
+ '' );
955
+ if ( ! $iret || $debug ) {
956
+
957
+ // Failed, try as plain text with newlines only
958
+ $iret = mail( $to,
959
+ $subject . ( $debug ? ' (4)' : '' ),
960
+ $message_part_1 . $message_part_2 . $message_part_3,
961
+ str_replace( "\r\n", "\n", $headers ),
962
+ '' );
963
+ if ( ! $iret ) {
964
+
965
+ // Give up
966
+ echo 'Mail sending Failed';
967
+ }
968
+ }
969
+ }
970
+ }
971
  }
972
 
973
  function wppa_get_imgalt( $id ) {
1592
  return '' === str_replace( array( '0','1','2','3','4','5','6','7','8','9','.' ), '', $var );
1593
  }
1594
 
1595
+ function wppa_log( $xtype, $msg ) {
1596
+
1597
+ // Sanitize type
1598
+ $t = strtolower( substr( $xtype, 0, 1 ) );
1599
+ switch ( $t ) {
1600
+ case 'd':
1601
+ $type = 'Dbg';
1602
+ break;
1603
+ case 'e':
1604
+ $type = 'Err';
1605
+ break;
1606
+ case 'o':
1607
+ $type = 'Obs';
1608
+ break;
1609
+ case 'u':
1610
+ $type = 'Upl';
1611
+ break;
1612
+ default:
1613
+ $type = 'Misc';
1614
+ }
1615
 
1616
  // Log debug messages only if WP_DEBUG is defined as true
1617
+ if ( $type == 'Dbg' ) {
1618
  if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
1619
  return;
1620
  }
1621
  }
1622
 
1623
+ // Make path to logfile
1624
  @ wppa_mktree( WPPA_CONTENT_PATH.'/wppa-depot/admin' ); // Just in case...
1625
  $filename = WPPA_CONTENT_PATH.'/wppa-depot/admin/error.log';
1626
+
1627
+ // See if max size exceeded
1628
  if ( is_file( $filename ) ) {
1629
  $filesize = filesize( $filename );
1630
+ if ( $filesize > 1024000 ) {
1631
+
1632
+ // File > 1000kB, shorten it
1633
  $file = fopen( $filename, 'rb' );
1634
  if ( $file ) {
1635
  $buffer = @ fread( $file, $filesize );
1641
  }
1642
  }
1643
  }
1644
+
1645
+ // Open for append
1646
  if ( ! $file = fopen( $filename, 'ab' ) ) return; // Unable to open log file
1647
 
1648
+ // Write log message
1649
+ @ fwrite( $file, '{b}'.$type.'{/b}: on:'.wppa_local_date(get_option('date_format', "F j, Y,").' '.get_option('time_format', "g:i a"), time()).': '.wppa_get_user().': '.$msg."\n" );
1650
+
1651
+ // Trace 3 levels for error logs
1652
+ if ( $type == 'Err' || $type == 'Dbg' ) {
1653
  ob_start();
1654
+ debug_print_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 4 );
1655
  $trace = ob_get_contents();
1656
  ob_end_clean();
1657
  @ fwrite( $file, $trace."\n" );
wppa-widget-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-widget-functions.php
3
  /* Package: wp-photo-album-plus
4
  /*
5
- /* Version 6.3.0
6
  /*
7
  */
8
 
@@ -36,10 +36,10 @@ global $wpdb;
36
  default:
37
  $statusclause = " `status` <> 'scheduled' ";
38
  if ( ! is_user_logged_in() ) {
39
- $statusclause .= " AND `status` <> 'private' ";
40
  }
41
  }
42
-
43
  // Is it a single album?
44
  if ( is_numeric( $alb ) ) {
45
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `album` = %s " . " AND " . $statusclause . $option, $alb );
@@ -48,7 +48,7 @@ global $wpdb;
48
  // Is it an enumeration of album ids?
49
  elseif ( strchr( $alb, ',' ) ) {
50
  $alb = trim( $alb, ',' );
51
-
52
  // Test for numeric only ( security test )
53
  $t = str_replace( ',', '', $alb);
54
  if ( is_numeric( $t ) ) {
@@ -79,13 +79,13 @@ global $wpdb;
79
  // Is it ALL-SEP?
80
  elseif ( $alb == 'all-sep' ) {
81
  $albs = $wpdb->get_results( "SELECT `id`, `a_parent` FROM `" . WPPA_ALBUMS . "`", ARRAY_A );
82
- $query = "SELECT * FROM `" . WPPA_PHOTOS . "` WHERE ( `album` = '0' ";
83
  foreach ( $albs as $a ) {
84
  if ( $a['a_parent'] != '-1' ) {
85
- $query .= "OR `album` = '" . $a['id'] . "' ";
86
  }
87
  }
88
- $query .= ") AND " . $statusclause . $option;
89
  }
90
 
91
  // Is it Topten?
2
  /* wppa-widget-functions.php
3
  /* Package: wp-photo-album-plus
4
  /*
5
+ /* Version 6.3.7
6
  /*
7
  */
8
 
36
  default:
37
  $statusclause = " `status` <> 'scheduled' ";
38
  if ( ! is_user_logged_in() ) {
39
+ $statusclause .= " AND `status` <> 'private' ";
40
  }
41
  }
42
+
43
  // Is it a single album?
44
  if ( is_numeric( $alb ) ) {
45
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `album` = %s " . " AND " . $statusclause . $option, $alb );
48
  // Is it an enumeration of album ids?
49
  elseif ( strchr( $alb, ',' ) ) {
50
  $alb = trim( $alb, ',' );
51
+
52
  // Test for numeric only ( security test )
53
  $t = str_replace( ',', '', $alb);
54
  if ( is_numeric( $t ) ) {
79
  // Is it ALL-SEP?
80
  elseif ( $alb == 'all-sep' ) {
81
  $albs = $wpdb->get_results( "SELECT `id`, `a_parent` FROM `" . WPPA_ALBUMS . "`", ARRAY_A );
82
+ $query = "SELECT * FROM `" . WPPA_PHOTOS . "` WHERE ( `album` IN ('0'";
83
  foreach ( $albs as $a ) {
84
  if ( $a['a_parent'] != '-1' ) {
85
+ $query .= ",'" . $a['id'] . "'";
86
  }
87
  }
88
+ $query .= ") ) AND " . $statusclause . $option;
89
  }
90
 
91
  // Is it Topten?
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.3.6
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/
@@ -26,12 +26,12 @@ global $wpdb;
26
  /* when new options are added and when the wppa_setup() routine
27
  /* must be called right after update for any other reason.
28
  */
29
- global $wppa_revno; $wppa_revno = '6306';
30
 
31
  /* This is the api interface version number
32
  /* It is incremented at any code change.
33
  */
34
- global $wppa_api_version; $wppa_api_version = '6-3-06-000';
35
 
36
  /* start timers */
37
  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.3.7
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/
26
  /* when new options are added and when the wppa_setup() routine
27
  /* must be called right after update for any other reason.
28
  */
29
+ global $wppa_revno; $wppa_revno = '6307';
30
 
31
  /* This is the api interface version number
32
  /* It is incremented at any code change.
33
  */
34
+ global $wppa_api_version; $wppa_api_version = '6-3-07-000';
35
 
36
  /* start timers */
37
  global $wppa_starttime; $wppa_starttime = microtime(true);