WP Photo Album Plus - Version 6.5.05

Version Description

Download this release

Release Info

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

Code changes from version 6.5.04 to 6.5.05

images/page_edit.png ADDED
Binary file
images/page_green.png ADDED
Binary file
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.5.00';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
@@ -578,7 +578,7 @@ function _wppaRateIt( mocc, value ) {
578
  }
579
 
580
  // Rate from lightbox
581
- function _wppaOvlRateIt( id, value ) {
582
 
583
  // No value, no vote
584
  if ( value == 0 ) return;
@@ -597,10 +597,10 @@ function _wppaOvlRateIt( id, value ) {
597
  beforeSend: function( xhr ) {
598
 
599
  // Set icon
600
- jQuery( '#wppa-rate-'+value ).attr( 'src', wppaImageDirectory+'tick.png' );
601
 
602
  // Fade in fully
603
- jQuery( '#wppa-rate-'+value ).stop().fadeTo( 100, 1.0 );
604
  },
605
  success: function( result, status, xhr ) {
606
 
@@ -616,12 +616,27 @@ function _wppaOvlRateIt( id, value ) {
616
  }
617
 
618
  // Set icon
619
- jQuery( '#wppa-rate-'+value ).attr( 'src', wppaImageDirectory+'cross.png' );
620
  }
621
 
622
  // No rating error
623
  else {
624
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
625
  // Shift to next slide?
626
  if ( wppaNextOnCallback ) wppaOvlShowNext();
627
  }
@@ -720,7 +735,7 @@ function wppaAjaxDownloadAlbum( mocc, id ) {
720
  function wppaAjaxComment( mocc, id ) {
721
 
722
  // Validate comment else return
723
- if ( ! _wppaValidateComment( mocc ) ) return;
724
 
725
  // Make the Ajax send data
726
  var data = 'action=wppa' +
@@ -754,9 +769,19 @@ function wppaAjaxComment( mocc, id ) {
754
  jQuery( "#wppa-comment-spin-"+mocc ).css( 'display', 'inline' );
755
  },
756
  success: function( result, status, xhr ) {
 
 
757
  result = result.replace( /\\/g, '' );
 
 
758
  jQuery( "#wppa-comments-"+mocc ).html( result );
759
- _wppaCommentHtml[mocc][_wppaCurIdx[mocc]] = result;
 
 
 
 
 
 
760
  wppaOpenComments( mocc );
761
  },
762
  error: function( xhr, status, error ) {
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsAjaxVersion = '6.5.05';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
578
  }
579
 
580
  // Rate from lightbox
581
+ function _wppaOvlRateIt( id, value, mocc, reloadAfter ) {
582
 
583
  // No value, no vote
584
  if ( value == 0 ) return;
597
  beforeSend: function( xhr ) {
598
 
599
  // Set icon
600
+ jQuery( '.wppa-rate-'+mocc+'-'+value ).attr( 'src', wppaImageDirectory+'tick.png' );
601
 
602
  // Fade in fully
603
+ jQuery( '.wppa-rate-'+mocc+'-'+value ).stop().fadeTo( 100, 1.0 );
604
  },
605
  success: function( result, status, xhr ) {
606
 
616
  }
617
 
618
  // Set icon
619
+ jQuery( '.wppa-rate-'+mocc+'-'+value ).attr( 'src', wppaImageDirectory+'cross.png' );
620
  }
621
 
622
  // No rating error
623
  else {
624
 
625
+ // result = $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.$allavgratcombi.'||'.$distext.'||'.$hascommented.'||'.$message;
626
+ // ArrValues[3] = my avg rating
627
+ // ArrValues[4] = all avg rating
628
+ //
629
+ // All avg stars have class .wppa-avg-'+mocc+'-'+value
630
+ // My stars have class .wppa-rate-'+mocc+'-'+value
631
+ _wppaSetRd( mocc, ArrValues[4], '.wppa-avg-' );
632
+ _wppaSetRd( mocc, ArrValues[3], '.wppa-rate-' );
633
+
634
+ // Reload?
635
+ if ( reloadAfter ) {
636
+ // document.location.reload(true);
637
+ return;
638
+ }
639
+
640
  // Shift to next slide?
641
  if ( wppaNextOnCallback ) wppaOvlShowNext();
642
  }
735
  function wppaAjaxComment( mocc, id ) {
736
 
737
  // Validate comment else return
738
+ if ( ! _wppaValidateComment( mocc, id ) ) return;
739
 
740
  // Make the Ajax send data
741
  var data = 'action=wppa' +
769
  jQuery( "#wppa-comment-spin-"+mocc ).css( 'display', 'inline' );
770
  },
771
  success: function( result, status, xhr ) {
772
+
773
+ // sanitize
774
  result = result.replace( /\\/g, '' );
775
+
776
+ // Show result
777
  jQuery( "#wppa-comments-"+mocc ).html( result );
778
+
779
+ // if from slideshow, update memory data array
780
+ if ( _wppaCurIdx[mocc] ) {
781
+ _wppaCommentHtml[mocc][_wppaCurIdx[mocc]] = result;
782
+ }
783
+
784
+ // Make sure comments are visible
785
  wppaOpenComments( mocc );
786
  },
787
  error: function( xhr, status, error ) {
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.5.00';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(wppaAutoColumnWidth[mocc])ajaxurl+='&resp=1';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');}
@@ -41,16 +41,18 @@ if(oldval!=0&&wppaRatingOnce)return;if(oldval<0)return;_wppaVoteInProgress=true;
41
  else{alert('Error Code='+ArrValues[1]+'\n\n'+ArrValues[2]);}}
42
  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]);}}
43
  if(wppaNextOnCallback)_wppaNextOnCallback(mocc);}},error:function(xhr,status,error){wppaConsoleLog('_wppaRateIt failed. Error = '+error+', status = '+status,'force');},});}
44
- function _wppaOvlRateIt(id,value){if(value==0)return;jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=rate'+'&wppa-rating='+value+'&wppa-rating-id='+id+'&wppa-occur=1'+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:60000,beforeSend:function(xhr){jQuery('#wppa-rate-'+value).attr('src',wppaImageDirectory+'tick.png');jQuery('#wppa-rate-'+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]);}
45
  else{alert('Error Code='+ArrValues[1]+'\n\n'+ArrValues[2]);}
46
- jQuery('#wppa-rate-'+value).attr('src',wppaImageDirectory+'cross.png');}
47
- else{if(wppaNextOnCallback)wppaOvlShowNext();}},error:function(xhr,status,error){wppaConsoleLog('_wppaOvlRateIt failed. Error = '+error+', status = '+status,'force');},});}
 
48
  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];}
49
  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){}});}
50
  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;}
51
  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');}});}
52
- 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();}
53
  if(typeof(jQuery("#wppa-comment-edit-"+mocc).val())!='undefined'){data+='&comment-edit='+jQuery("#wppa-comment-edit-"+mocc).val();}
54
  if(typeof(jQuery("#wppa-returnurl-"+mocc).val())!='undefined'){data+='&returnurl='+encodeURIComponent(jQuery("#wppa-returnurl-"+mocc).val());}
55
- 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');}});}
 
56
  wppaConsoleLog('wppa-ajax-front.js version '+wppaJsAjaxVersion+' loaded.','force');
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
+ var wppaJsAjaxVersion='6.5.05';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(wppaAutoColumnWidth[mocc])ajaxurl+='&resp=1';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');}
41
  else{alert('Error Code='+ArrValues[1]+'\n\n'+ArrValues[2]);}}
42
  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]);}}
43
  if(wppaNextOnCallback)_wppaNextOnCallback(mocc);}},error:function(xhr,status,error){wppaConsoleLog('_wppaRateIt failed. Error = '+error+', status = '+status,'force');},});}
44
+ function _wppaOvlRateIt(id,value,mocc,reloadAfter){if(value==0)return;jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=rate'+'&wppa-rating='+value+'&wppa-rating-id='+id+'&wppa-occur=1'+'&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]);}
45
  else{alert('Error Code='+ArrValues[1]+'\n\n'+ArrValues[2]);}
46
+ jQuery('.wppa-rate-'+mocc+'-'+value).attr('src',wppaImageDirectory+'cross.png');}
47
+ else{_wppaSetRd(mocc,ArrValues[4],'.wppa-avg-');_wppaSetRd(mocc,ArrValues[3],'.wppa-rate-');if(reloadAfter){return;}
48
+ if(wppaNextOnCallback)wppaOvlShowNext();}},error:function(xhr,status,error){wppaConsoleLog('_wppaOvlRateIt failed. Error = '+error+', status = '+status,'force');},});}
49
  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];}
50
  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){}});}
51
  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;}
52
  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');}});}
53
+ function wppaAjaxComment(mocc,id){if(!_wppaValidateComment(mocc,id))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();}
54
  if(typeof(jQuery("#wppa-comment-edit-"+mocc).val())!='undefined'){data+='&comment-edit='+jQuery("#wppa-comment-edit-"+mocc).val();}
55
  if(typeof(jQuery("#wppa-returnurl-"+mocc).val())!='undefined'){data+='&returnurl='+encodeURIComponent(jQuery("#wppa-returnurl-"+mocc).val());}
56
+ 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);if(_wppaCurIdx[mocc]){_wppaCommentHtml[mocc][_wppaCurIdx[mocc]]=result;}
57
+ 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');}});}
58
  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.5.04';
7
 
8
  // This is an entrypoint to load the slide data
9
  function wppaStoreSlideInfo(
@@ -239,8 +239,8 @@ function wppaRateIt( mocc, value ) {
239
  _wppaRateIt( mocc, value );
240
  }
241
 
242
- function wppaOvlRateIt( id, value ) {
243
- _wppaOvlRateIt( id, value );
244
  }
245
 
246
  function wppaPrev( mocc ) {
@@ -360,10 +360,14 @@ function _wppaNextSlide( mocc, mode ) {
360
  if ( 'auto' == mode ) {
361
  if ( wppaSlidePause[mocc] ) {
362
  jQuery( '#theimg'+fg+'-'+mocc ).attr( "title", wppaSlidePause[mocc] );
 
363
  setTimeout( '_wppaNextSlide( '+mocc+', "auto" )', 250 ); // Retry after 250 ms.
364
  return;
365
  }
366
  }
 
 
 
367
  // Kill an old timed request, while stopped
368
  if ( ! _wppaSSRuns[mocc] && 'auto' == mode ) return;
369
  // Empty slideshow?
@@ -1538,7 +1542,7 @@ function _wppaSetRd( mocc, avg, where ) {
1538
  var ihigh = wppaRatingMax;
1539
 
1540
  for ( idx=ilow;idx<=ihigh;idx++ ) {
1541
- if ( where == '#wppa-rate-' ) {
1542
  jQuery( where+mocc+'-'+idx ).attr( 'src', wppaImageDirectory+'star.png' );
1543
  }
1544
  if ( idx <= idx1 ) {
@@ -1564,6 +1568,11 @@ function _wppaFollowMe( mocc, idx ) {
1564
  _wppaSetRd( mocc, idx, '#wppa-rate-' );
1565
  }
1566
 
 
 
 
 
 
1567
  function _wppaLeaveMe( mocc, idx ) {
1568
 
1569
  if ( _wppaSSRuns[mocc] ) return; // Do not rate on a running show, what only works properly in Firefox
@@ -1574,10 +1583,13 @@ function _wppaLeaveMe( mocc, idx ) {
1574
  _wppaSetRd( mocc, _wppaMyr[mocc][_wppaCurIdx[mocc]], '#wppa-rate-' );
1575
  }
1576
 
 
 
 
1577
 
1578
- function _wppaValidateComment( mocc ) {
1579
 
1580
- var photoid = _wppaId[mocc][_wppaCurIdx[mocc]];
1581
 
1582
  // Process name
1583
  var name = jQuery( '#wppa-comname-'+mocc ).val( );
3
  // Contains slideshow modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsSlideshowVersion = '6.5.05';
7
 
8
  // This is an entrypoint to load the slide data
9
  function wppaStoreSlideInfo(
239
  _wppaRateIt( mocc, value );
240
  }
241
 
242
+ function wppaOvlRateIt( id, value, mocc, reloadAfter ) {
243
+ _wppaOvlRateIt( id, value, mocc, reloadAfter );
244
  }
245
 
246
  function wppaPrev( mocc ) {
360
  if ( 'auto' == mode ) {
361
  if ( wppaSlidePause[mocc] ) {
362
  jQuery( '#theimg'+fg+'-'+mocc ).attr( "title", wppaSlidePause[mocc] );
363
+ jQuery( '#slide_frame-'+mocc ).attr( "title", wppaSlidePause[mocc] );
364
  setTimeout( '_wppaNextSlide( '+mocc+', "auto" )', 250 ); // Retry after 250 ms.
365
  return;
366
  }
367
  }
368
+ else {
369
+ jQuery( '#slide_frame-'+mocc ).removeAttr( "title" );
370
+ }
371
  // Kill an old timed request, while stopped
372
  if ( ! _wppaSSRuns[mocc] && 'auto' == mode ) return;
373
  // Empty slideshow?
1542
  var ihigh = wppaRatingMax;
1543
 
1544
  for ( idx=ilow;idx<=ihigh;idx++ ) {
1545
+ if ( where == '#wppa-rate-' || where == '.wppa-rate-' ) {
1546
  jQuery( where+mocc+'-'+idx ).attr( 'src', wppaImageDirectory+'star.png' );
1547
  }
1548
  if ( idx <= idx1 ) {
1568
  _wppaSetRd( mocc, idx, '#wppa-rate-' );
1569
  }
1570
 
1571
+ function wppaOvlFollowMe( mocc, idx, val ) {
1572
+ if ( val ) return; // Already rated
1573
+ _wppaSetRd( mocc, idx, '.wppa-rate-' );
1574
+ }
1575
+
1576
  function _wppaLeaveMe( mocc, idx ) {
1577
 
1578
  if ( _wppaSSRuns[mocc] ) return; // Do not rate on a running show, what only works properly in Firefox
1583
  _wppaSetRd( mocc, _wppaMyr[mocc][_wppaCurIdx[mocc]], '#wppa-rate-' );
1584
  }
1585
 
1586
+ function wppaOvlLeaveMe( mocc, idx, val ) {
1587
+ _wppaSetRd( mocc, val, '.wppa-rate-' );
1588
+ }
1589
 
1590
+ function _wppaValidateComment( mocc, photoid ) {
1591
 
1592
+ if ( ! photoid ) photoid = _wppaId[mocc][_wppaCurIdx[mocc]];
1593
 
1594
  // Process name
1595
  var name = jQuery( '#wppa-comname-'+mocc ).val( );
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.5.04';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 ';}
@@ -25,7 +25,7 @@ else{_wppaStart(mocc,index);if(index==-1){jQuery('#wppa-startstop-icon-'+mocc).a
25
  function wppaBbb(mocc,where,act){if(!_wppaSSRuns[mocc]){_wppaBbb(mocc,where,act);}}
26
  function wppaUbb(mocc,where,act){_wppaUbb(mocc,where,act);}
27
  function wppaRateIt(mocc,value){_wppaRateIt(mocc,value);}
28
- function wppaOvlRateIt(id,value){_wppaOvlRateIt(id,value);}
29
  function wppaPrev(mocc){_wppaDidGoto[mocc]=true;if(!_wppaSSRuns[mocc]){_wppaPrev(mocc);}}
30
  function wppaPrevN(mocc,n){_wppaDidGoto[mocc]=true;if(!_wppaSSRuns[mocc]){_wppaPrevN(mocc,n);}}
31
  function wppaFirst(mocc){_wppaDidGoto[mocc]=true;if(!_wppaSSRuns[mocc]){_wppaGoto(mocc,0);}}
@@ -42,7 +42,8 @@ else{_wppaGoto(mocc,idx);}}
42
  function wppaGotoRunning(mocc,idx){_wppaDidGoto[mocc]=true;_wppaGotoRunning(mocc,idx);}
43
  function wppaValidateComment(mocc){return _wppaValidateComment(mocc);}
44
  function _wppaNextSlide(mocc,mode){var fg=_wppaFg[mocc];var bg=1-fg;if((wppaVideoPlaying[mocc]||wppaAudioPlaying[mocc])&&_wppaSSRuns[mocc]){setTimeout('_wppaNextSlide( '+mocc+', \''+mode+'\' )',500);return;}
45
- wppaStopVideo(mocc);wppaStopAudio();if('auto'==mode){if(wppaSlidePause[mocc]){jQuery('#theimg'+fg+'-'+mocc).attr("title",wppaSlidePause[mocc]);setTimeout('_wppaNextSlide( '+mocc+', "auto" )',250);return;}}
 
46
  if(!_wppaSSRuns[mocc]&&'auto'==mode)return;if(!_wppaSlides[mocc])return;if(_wppaSlides[mocc].length<2&&!_wppaFirst[mocc])return;if(!_wppaSSRuns[mocc]&&'reset'==mode){_wppaSSRuns[mocc]=true;__wppaOverruleRun=false;}
47
  _wppaVoteInProgress=false;_wppaIsBusy[mocc]=true;if(_wppaSSRuns[mocc])_wppaShowMetaData(mocc,'hide');if(_wppaSSRuns[mocc]){_wppaNxtIdx[mocc]=_wppaCurIdx[mocc]+1;if(_wppaNxtIdx[mocc]==_wppaSlides[mocc].length)_wppaNxtIdx[mocc]=0;}
48
  jQuery('#geodiv-'+mocc+'-'+_wppaId[mocc][_wppaCurIdx[mocc]]).css({display:'none'});jQuery('#geodiv-'+mocc+'-'+_wppaId[mocc][_wppaNxtIdx[mocc]]).css({display:''});if(typeof(_wppaLat)!='undefined'){if(_wppaLat[mocc]){if(_wppaLat[mocc][_wppaId[mocc][_wppaNxtIdx[mocc]]]){jQuery('#map-canvas-'+mocc).css('display','');wppaGeoInit(mocc,_wppaLat[mocc][_wppaId[mocc][_wppaNxtIdx[mocc]]],_wppaLon[mocc][_wppaId[mocc][_wppaNxtIdx[mocc]]]);}
@@ -167,13 +168,15 @@ if(myr==0){jQuery('#wppa-vote-button-'+mocc).val(wppaVoteForMe);}
167
  else{jQuery('#wppa-vote-button-'+mocc).val(wppaVotedForMe);}
168
  jQuery('#wppa-vote-count-'+mocc).html(cnt);}
169
  function wppaGetDislikeText(dsc,myr,incmine){return dsc;}
170
- function _wppaSetRd(mocc,avg,where){var idx1=parseInt(avg);var idx2=idx1+1;var frac=avg-idx1;var opac=wppaStarOpacity+frac*(1.0-wppaStarOpacity);var ilow=1;var ihigh=wppaRatingMax;for(idx=ilow;idx<=ihigh;idx++){if(where=='#wppa-rate-'){jQuery(where+mocc+'-'+idx).attr('src',wppaImageDirectory+'star.png');}
171
  if(idx<=idx1){jQuery(where+mocc+'-'+idx).stop().fadeTo(100,1.0);}
172
  else if(idx==idx2){jQuery(where+mocc+'-'+idx).stop().fadeTo(100,opac);}
173
  else{jQuery(where+mocc+'-'+idx).stop().fadeTo(100,wppaStarOpacity);}}}
174
  function _wppaFollowMe(mocc,idx){if(_wppaSSRuns[mocc])return;if(_wppaMyr[mocc][_wppaCurIdx[mocc]]!=0&&wppaRatingOnce)return;if(_wppaMyr[mocc][_wppaCurIdx[mocc]]<0)return;if(_wppaVoteInProgress)return;_wppaSetRd(mocc,idx,'#wppa-rate-');}
 
175
  function _wppaLeaveMe(mocc,idx){if(_wppaSSRuns[mocc])return;if(_wppaMyr[mocc][_wppaCurIdx[mocc]]!=0&&wppaRatingOnce)return;if(_wppaMyr[mocc][_wppaCurIdx[mocc]]<0)return;if(_wppaVoteInProgress)return;_wppaSetRd(mocc,_wppaMyr[mocc][_wppaCurIdx[mocc]],'#wppa-rate-');}
176
- function _wppaValidateComment(mocc){var photoid=_wppaId[mocc][_wppaCurIdx[mocc]];var name=jQuery('#wppa-comname-'+mocc).val();if(name.length<1){alert(wppaPleaseName);return false;}
 
177
  if(wppaEmailRequired=='required'||wppaEmailRequired=='optional'){var email=jQuery('#wppa-comemail-'+mocc).val();if(wppaEmailRequired=='optional'&&email.length==0){return true;}
178
  var atpos=email.indexOf("@");var dotpos=email.lastIndexOf(".");if(atpos<1||dotpos<atpos+2||dotpos+2>=email.length){alert(wppaPleaseEmail);return false;}}
179
  var text=jQuery('#wppa-comment-'+mocc).val();if(text.length<1){alert(wppaPleaseComment);return false;}
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
+ var wppaJsSlideshowVersion='6.5.05';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 ';}
25
  function wppaBbb(mocc,where,act){if(!_wppaSSRuns[mocc]){_wppaBbb(mocc,where,act);}}
26
  function wppaUbb(mocc,where,act){_wppaUbb(mocc,where,act);}
27
  function wppaRateIt(mocc,value){_wppaRateIt(mocc,value);}
28
+ function wppaOvlRateIt(id,value,mocc,reloadAfter){_wppaOvlRateIt(id,value,mocc,reloadAfter);}
29
  function wppaPrev(mocc){_wppaDidGoto[mocc]=true;if(!_wppaSSRuns[mocc]){_wppaPrev(mocc);}}
30
  function wppaPrevN(mocc,n){_wppaDidGoto[mocc]=true;if(!_wppaSSRuns[mocc]){_wppaPrevN(mocc,n);}}
31
  function wppaFirst(mocc){_wppaDidGoto[mocc]=true;if(!_wppaSSRuns[mocc]){_wppaGoto(mocc,0);}}
42
  function wppaGotoRunning(mocc,idx){_wppaDidGoto[mocc]=true;_wppaGotoRunning(mocc,idx);}
43
  function wppaValidateComment(mocc){return _wppaValidateComment(mocc);}
44
  function _wppaNextSlide(mocc,mode){var fg=_wppaFg[mocc];var bg=1-fg;if((wppaVideoPlaying[mocc]||wppaAudioPlaying[mocc])&&_wppaSSRuns[mocc]){setTimeout('_wppaNextSlide( '+mocc+', \''+mode+'\' )',500);return;}
45
+ wppaStopVideo(mocc);wppaStopAudio();if('auto'==mode){if(wppaSlidePause[mocc]){jQuery('#theimg'+fg+'-'+mocc).attr("title",wppaSlidePause[mocc]);jQuery('#slide_frame-'+mocc).attr("title",wppaSlidePause[mocc]);setTimeout('_wppaNextSlide( '+mocc+', "auto" )',250);return;}}
46
+ else{jQuery('#slide_frame-'+mocc).removeAttr("title");}
47
  if(!_wppaSSRuns[mocc]&&'auto'==mode)return;if(!_wppaSlides[mocc])return;if(_wppaSlides[mocc].length<2&&!_wppaFirst[mocc])return;if(!_wppaSSRuns[mocc]&&'reset'==mode){_wppaSSRuns[mocc]=true;__wppaOverruleRun=false;}
48
  _wppaVoteInProgress=false;_wppaIsBusy[mocc]=true;if(_wppaSSRuns[mocc])_wppaShowMetaData(mocc,'hide');if(_wppaSSRuns[mocc]){_wppaNxtIdx[mocc]=_wppaCurIdx[mocc]+1;if(_wppaNxtIdx[mocc]==_wppaSlides[mocc].length)_wppaNxtIdx[mocc]=0;}
49
  jQuery('#geodiv-'+mocc+'-'+_wppaId[mocc][_wppaCurIdx[mocc]]).css({display:'none'});jQuery('#geodiv-'+mocc+'-'+_wppaId[mocc][_wppaNxtIdx[mocc]]).css({display:''});if(typeof(_wppaLat)!='undefined'){if(_wppaLat[mocc]){if(_wppaLat[mocc][_wppaId[mocc][_wppaNxtIdx[mocc]]]){jQuery('#map-canvas-'+mocc).css('display','');wppaGeoInit(mocc,_wppaLat[mocc][_wppaId[mocc][_wppaNxtIdx[mocc]]],_wppaLon[mocc][_wppaId[mocc][_wppaNxtIdx[mocc]]]);}
168
  else{jQuery('#wppa-vote-button-'+mocc).val(wppaVotedForMe);}
169
  jQuery('#wppa-vote-count-'+mocc).html(cnt);}
170
  function wppaGetDislikeText(dsc,myr,incmine){return dsc;}
171
+ function _wppaSetRd(mocc,avg,where){var idx1=parseInt(avg);var idx2=idx1+1;var frac=avg-idx1;var opac=wppaStarOpacity+frac*(1.0-wppaStarOpacity);var ilow=1;var ihigh=wppaRatingMax;for(idx=ilow;idx<=ihigh;idx++){if(where=='#wppa-rate-'||where=='.wppa-rate-'){jQuery(where+mocc+'-'+idx).attr('src',wppaImageDirectory+'star.png');}
172
  if(idx<=idx1){jQuery(where+mocc+'-'+idx).stop().fadeTo(100,1.0);}
173
  else if(idx==idx2){jQuery(where+mocc+'-'+idx).stop().fadeTo(100,opac);}
174
  else{jQuery(where+mocc+'-'+idx).stop().fadeTo(100,wppaStarOpacity);}}}
175
  function _wppaFollowMe(mocc,idx){if(_wppaSSRuns[mocc])return;if(_wppaMyr[mocc][_wppaCurIdx[mocc]]!=0&&wppaRatingOnce)return;if(_wppaMyr[mocc][_wppaCurIdx[mocc]]<0)return;if(_wppaVoteInProgress)return;_wppaSetRd(mocc,idx,'#wppa-rate-');}
176
+ function wppaOvlFollowMe(mocc,idx,val){if(val)return;_wppaSetRd(mocc,idx,'.wppa-rate-');}
177
  function _wppaLeaveMe(mocc,idx){if(_wppaSSRuns[mocc])return;if(_wppaMyr[mocc][_wppaCurIdx[mocc]]!=0&&wppaRatingOnce)return;if(_wppaMyr[mocc][_wppaCurIdx[mocc]]<0)return;if(_wppaVoteInProgress)return;_wppaSetRd(mocc,_wppaMyr[mocc][_wppaCurIdx[mocc]],'#wppa-rate-');}
178
+ function wppaOvlLeaveMe(mocc,idx,val){_wppaSetRd(mocc,val,'.wppa-rate-');}
179
+ function _wppaValidateComment(mocc,photoid){if(!photoid)photoid=_wppaId[mocc][_wppaCurIdx[mocc]];var name=jQuery('#wppa-comname-'+mocc).val();if(name.length<1){alert(wppaPleaseName);return false;}
180
  if(wppaEmailRequired=='required'||wppaEmailRequired=='optional'){var email=jQuery('#wppa-comemail-'+mocc).val();if(wppaEmailRequired=='optional'&&email.length==0){return true;}
181
  var atpos=email.indexOf("@");var dotpos=email.lastIndexOf(".");if(atpos<1||dotpos<atpos+2||dotpos+2>=email.length){alert(wppaPleaseEmail);return false;}}
182
  var text=jQuery('#wppa-comment-'+mocc).val();if(text.length<1){alert(wppaPleaseComment);return false;}
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.5.04
6
- Stable tag: 6.5.04
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -180,7 +180,25 @@ Oh, just Google on 'picture resizer' and you will find a bunch of free programs
180
 
181
  See for additional information: http://www.wppa.nl/changelog/
182
 
183
- = 6.4.04 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
 
185
  = Bug Fixes =
186
 
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.5.05
6
+ Stable tag: 6.5.05
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
180
 
181
  See for additional information: http://www.wppa.nl/changelog/
182
 
183
+ = 6.5.05 =
184
+
185
+ = Bug Fixes =
186
+
187
+ * Rating display on lightbox is now updated directly.
188
+ * Fixed inconsistent behaviour of 'last album used'.
189
+ * Title 'paused' is now also displayed on the slideframearea outside the image.
190
+ * Fixed initial displaysize of single responsive photos.
191
+
192
+ = New Features =
193
+
194
+ * New shortcode type="xphoto". Extended media type photo. Like type="mphoto" but also displays rating, share buttons and commentform if enabled in Table II-B7, B10 and C1.
195
+ * Up/down arrows on the album sortable list.
196
+
197
+ = Other Changes =
198
+
199
+ * Blog it! is now a button. Makes it easier to blog a photo from a smartphone.
200
+
201
+ = 6.5.04 =
202
 
203
  = Bug Fixes =
204
 
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 6.5.04
6
  *
7
  */
8
 
@@ -672,14 +672,17 @@ global $wppa_log_file;
672
  }
673
 
674
  // Get other data
675
- if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `".WPPA_PHOTOS."` WHERE `id` = %s", $photo ) ) ) {
676
  echo '0||999||'.__( 'Photo has been removed.' , 'wp-photo-album-plus');
677
  wppa_exit();
678
  }
679
- $user = wppa_get_user();
680
- $mylast = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM `'.WPPA_RATING.'` WHERE `photo` = %s AND `user` = %s ORDER BY `id` DESC LIMIT 1', $photo, $user ), ARRAY_A );
 
681
  $myavgrat = '0'; // Init
682
 
 
 
683
  // Rate own photo?
684
  if ( wppa_get_photo_item( $photo, 'owner' ) == $user && ! wppa_switch( 'allow_owner_votes' ) ) {
685
  echo '0||900||'.__( 'Sorry, you can not rate your own photos' , 'wp-photo-album-plus');
@@ -711,33 +714,56 @@ global $wppa_log_file;
711
 
712
  // When done, we have to echo $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.$allavgrat.'||'.$discount.'||'.$hascommented.'||'.$message;
713
  // So we have to do: process rating and find new $myavgrat, $allavgrat and $discount ( $occur, $photo and $index are known )
 
 
714
 
715
- // Case 0: Illegal second vote. Frontend takes care of this, but a hacker could enter an ajaxlink manually
716
- if ( $mylast && ( // I did vote already
717
- ( ! ( wppa_switch( 'rating_change' ) || wppa_switch( 'rating_multi' ) ) ) || // No rating change or rating multi
718
- ( $mylast['value'] < '0' ) || // I did a dislike, can not modify
719
- ( $mylast['value'] > '0' && $rating == '-1' ) // I did a rating, can not change into dislike
720
- )
721
- ) {
722
- echo '0||109||'.__( 'Security check failure.' , 'wp-photo-album-plus');
723
- wppa_exit();
 
 
 
 
 
 
 
 
 
 
 
 
 
724
  }
 
725
  // Case 1: value = -1 this is a legal dislike vote
726
  if ( $rating == '-1' ) {
 
727
  // Add my dislike
728
  $iret = wppa_create_rating_entry( array( 'photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus ) );
729
  if ( ! $iret ) {
730
  echo '0||101||'.$errtxt;
731
  wppa_exit(); // Fail on storing vote
732
  }
 
733
  // Add points
734
  wppa_add_credit_points( wppa_opt( 'cp_points_rating' ), __( 'Photo rated' , 'wp-photo-album-plus'), $photo, $rating );
735
- wppa_dislike_check( $photo ); // Check for email to be sent every .. dislikes
736
- if ( ! is_file( wppa_get_thumb_path( $photo ) ) ) { // Photo is removed
 
 
 
 
737
  echo $occur.'||'.$photo.'||'.$index.'||-1||-1|0||'.wppa_opt( 'dislike_delete' );
738
  wppa_exit();
739
  }
740
  }
 
741
  // Case 2: This is my first vote for this photo
742
  elseif ( ! $mylast ) {
743
  // Add my vote
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 6.5.05
6
  *
7
  */
8
 
672
  }
673
 
674
  // Get other data
675
+ if ( ! wppa_photo_exists( $photo ) ) {
676
  echo '0||999||'.__( 'Photo has been removed.' , 'wp-photo-album-plus');
677
  wppa_exit();
678
  }
679
+
680
+ $mylast = wppa_get_my_last_vote( $photo );
681
+
682
  $myavgrat = '0'; // Init
683
 
684
+ $user = wppa_get_user();
685
+
686
  // Rate own photo?
687
  if ( wppa_get_photo_item( $photo, 'owner' ) == $user && ! wppa_switch( 'allow_owner_votes' ) ) {
688
  echo '0||900||'.__( 'Sorry, you can not rate your own photos' , 'wp-photo-album-plus');
714
 
715
  // When done, we have to echo $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.$allavgrat.'||'.$discount.'||'.$hascommented.'||'.$message;
716
  // So we have to do: process rating and find new $myavgrat, $allavgrat and $discount ( $occur, $photo and $index are known )
717
+ // Error message format: '0||<errcode>||<errtext>
718
+ // errcode = 900: user error, other codes: real errors
719
 
720
+ // Case 0: Test for Illegal second vote. Frontend takes care of this, but a hacker could enter an ajaxlink manually or a program error cause this to happen
721
+ if ( $mylast ) {
722
+
723
+ // I did vote already
724
+
725
+ // Can vote only once
726
+ if ( ! wppa_switch( 'rating_change' ) && ! wppa_switch( 'rating_multi' ) ) {
727
+ echo '0||900||'.__('You can not change your vote', 'wp-photo-album-plus');
728
+ wppa_exit();
729
+ }
730
+
731
+ // I did a dislike, can not modify
732
+ if ( $mylast < '0' ) {
733
+ echo '0||900||'.__('You can not change a dislike', 'wp-photo-album-plus');
734
+ wppa_exit();
735
+ }
736
+
737
+ // I did a rating, can not change into dislike
738
+ if ( $mylast > '0' && $rating == '-1' ) {
739
+ echo '0||900||'.__('You can not change your vote into a dislike', 'wp-photo-album-plus');
740
+ wppa_exit();
741
+ }
742
  }
743
+
744
  // Case 1: value = -1 this is a legal dislike vote
745
  if ( $rating == '-1' ) {
746
+
747
  // Add my dislike
748
  $iret = wppa_create_rating_entry( array( 'photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus ) );
749
  if ( ! $iret ) {
750
  echo '0||101||'.$errtxt;
751
  wppa_exit(); // Fail on storing vote
752
  }
753
+
754
  // Add points
755
  wppa_add_credit_points( wppa_opt( 'cp_points_rating' ), __( 'Photo rated' , 'wp-photo-album-plus'), $photo, $rating );
756
+
757
+ // Check for email to be sent every .. dislikes
758
+ wppa_dislike_check( $photo );
759
+
760
+ // Photo is removed?
761
+ if ( ! is_file( wppa_get_thumb_path( $photo ) ) ) {
762
  echo $occur.'||'.$photo.'||'.$index.'||-1||-1|0||'.wppa_opt( 'dislike_delete' );
763
  wppa_exit();
764
  }
765
  }
766
+
767
  // Case 2: This is my first vote for this photo
768
  elseif ( ! $mylast ) {
769
  // Add my vote
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.5.00
7
  *
8
  */
9
 
@@ -173,7 +173,8 @@ function _wppa_admin() {
173
 
174
  <div class="wrap">
175
  <?php wppa_admin_spinner() ?>
176
- <h2><?php echo __('Edit Album Information', 'wp-photo-album-plus').' <span style="color:blue">'.__('Auto Save', 'wp-photo-album-plus').'</span>' ?></h2>
 
177
  <p class="description">
178
  <?php echo __('All modifications are instantly updated on the server, except for those that require a button push.', 'wp-photo-album-plus');
179
  echo ' '.__('The <b style="color:#070" >Remark</b> fields keep you informed on the actions taken at the background.', 'wp-photo-album-plus');
@@ -813,12 +814,13 @@ function _wppa_admin() {
813
  <?php wppa_album_sequence( $edit_id ) ?>
814
 
815
  <a name="manage-photos" id="manage-photos" ></a>
816
- <h2><?php _e('Manage Photos', 'wp-photo-album-plus');
 
817
  if ( isset($_REQUEST['bulk']) ) echo ' - <small><i>'.__('Copy / move / delete / edit name / edit description / change status', 'wp-photo-album-plus').'</i></small>';
818
  elseif ( isset($_REQUEST['seq']) ) echo ' - <small><i>'.__('Change sequence order by drag and drop', 'wp-photo-album-plus').'</i></small>';
819
  elseif ( isset($_REQUEST['quick']) ) echo ' - <small><i>'.__('Edit photo information except copy and move', 'wp-photo-album-plus').'</i></small>';
820
  else echo ' - <small><i>'.__('Edit photo information', 'wp-photo-album-plus').'</i></small>';
821
- ?></h2>
822
  <?php
823
  if ( isset($_REQUEST['bulk']) ) wppa_album_photos_bulk($edit_id);
824
  elseif ( isset($_REQUEST['seq']) ) wppa_album_photos_sequence($edit_id);
@@ -834,8 +836,9 @@ function _wppa_admin() {
834
  $alb = wppa_get_album_id_by_photo_id($photo);
835
  if ( current_user_can('wppa_comments') && wppa_have_access($alb) ) { ?>
836
  <div class="wrap">
837
- <h2><?php _e('Moderate comment', 'wp-photo-album-plus') ?></h2>
838
- <?php // <input type="hidden" id="album-nonce-<?php echo $edit_id ?><?//" value="<?php echo wp_create_nonce('wppa_nonce_'.$edit_id); ?><?//" /> ?>
 
839
  <?php wppa_album_photos('', $photo) ?>
840
  </div>
841
  <?php }
@@ -850,9 +853,10 @@ function _wppa_admin() {
850
  $alb = wppa_get_album_id_by_photo_id($photo);
851
  if ( current_user_can('wppa_admin') && wppa_have_access($alb) ) { ?>
852
  <div class="wrap">
853
- <h2><?php if ( $_REQUEST['tab'] == 'pmod' ) _e('Moderate photo', 'wp-photo-album-plus');
 
854
  else _e('Edit photo', 'wp-photo-album-plus'); ?>
855
- </h2>
856
  <?php wppa_album_photos('', $photo) ?>
857
  </div>
858
  <?php }
@@ -870,12 +874,8 @@ function _wppa_admin() {
870
  }
871
  ?>
872
  <div class="wrap">
873
- <?php $iconurl = WPPA_URL.'/images/albumdel32.png'; ?>
874
- <div id="icon-albumdel" class="icon32" style="background: transparent url(<?php echo($iconurl); ?>) no-repeat">
875
- <br />
876
- </div>
877
-
878
- <h2><?php _e('Delete Album', 'wp-photo-album-plus'); ?></h2>
879
 
880
  <p><?php _e('Album:', 'wp-photo-album-plus'); ?> <b><?php echo wppa_get_album_name($_REQUEST['edit_id']); ?>.</b></p>
881
  <p><?php _e('Are you sure you want to delete this album?', 'wp-photo-album-plus'); ?><br />
@@ -941,13 +941,9 @@ function _wppa_admin() {
941
  ?>
942
  <div class="wrap">
943
  <?php wppa_admin_spinner() ?>
944
- <?php $iconurl = WPPA_URL.'/images/album32.png'; ?>
945
- <div id="icon-album" class="icon32" style="background: transparent url(<?php echo($iconurl); ?>) no-repeat">
946
- <br />
947
- </div>
948
-
949
- <h2><?php _e('Manage Albums', 'wp-photo-album-plus'); ?></h2>
950
- <br />
951
  <?php
952
  // The Create new album button
953
  if ( wppa_can_create_top_album() ) {
@@ -1978,31 +1974,37 @@ global $wpdb;
1978
  border-radius:3px;
1979
  float: left;
1980
  }
 
 
 
 
 
1981
  </style>
1982
  <script>
1983
  jQuery( function() {
1984
  jQuery( "#sortable-albums" ).sortable( {
1985
- cursor: "move",
1986
- placeholder: "sortable-placeholder-albums",
1987
- stop: function( event, ui ) {
1988
- var ids = jQuery( ".wppa-sort-item-albums" );
1989
- var seq = jQuery( ".wppa-sort-seqn-albums" );
1990
- var idx = 0;
1991
- var descend = <?php if ( $is_descending ) echo 'true'; else echo 'false' ?>;
1992
- while ( idx < ids.length ) {
1993
- var newvalue;
1994
- if ( descend ) newvalue = ids.length - idx;
1995
- else newvalue = idx + 1;
1996
- var oldvalue = seq[idx].value;
1997
- var album = ids[idx].value;
1998
- if ( newvalue != oldvalue ) {
1999
- wppaDoSeqUpdateAlbum( album, newvalue );
2000
- }
2001
- idx++;
2002
- }
2003
- }
2004
  } );
2005
  } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2006
  function wppaDoSeqUpdateAlbum( album, seqno ) {
2007
  var data = 'action=wppa' +
2008
  '&wppa-action=update-album' +
@@ -2037,7 +2039,7 @@ global $wpdb;
2037
  }
2038
  </script>
2039
 
2040
- <div class="widefat" style="max-width:500px;" >
2041
  <div id="sortable-albums">
2042
  <?php foreach ( $albums as $album ) {
2043
  echo '
@@ -2054,11 +2056,59 @@ global $wpdb;
2054
  ' style="max-height:50px; margin: 5px;"' .
2055
  ' />' .
2056
  '</div>' .
2057
- '<div style="height:100%;width:50%;float:left;font-size:12px;overflow:hidden;" >' .
2058
  '<b>' . wppa_get_album_name( $album['id'] ) . '</b>' .
2059
  '<br />' .
2060
  wppa_get_album_desc( $album['id'] ) .
2061
  '</div>' .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2062
  '<div style="float:right; width:25%;" >' .
2063
  '<span style=""> ' . __( 'Id:' , 'wp-photo-album-plus' ) . ' ' . $album['id'] . '</span>' .
2064
  '<span style=""> - ' . __( 'Ord:' , 'wp-photo-album-plus' ) . '</span>' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 6.5.05
7
  *
8
  */
9
 
173
 
174
  <div class="wrap">
175
  <?php wppa_admin_spinner() ?>
176
+ <img src="<?php echo WPPA_URL.'/images/album32.png' ?>" />
177
+ <h1 style="display:inline;" ><?php echo __('Edit Album Information', 'wp-photo-album-plus').' <span style="color:blue">'.__('Auto Save', 'wp-photo-album-plus').'</span>' ?></h1>
178
  <p class="description">
179
  <?php echo __('All modifications are instantly updated on the server, except for those that require a button push.', 'wp-photo-album-plus');
180
  echo ' '.__('The <b style="color:#070" >Remark</b> fields keep you informed on the actions taken at the background.', 'wp-photo-album-plus');
814
  <?php wppa_album_sequence( $edit_id ) ?>
815
 
816
  <a name="manage-photos" id="manage-photos" ></a>
817
+ <img src="<?php echo WPPA_URL.'/images/camera32.png' ?>" />
818
+ <h1 style="display:inline;" ><?php _e('Manage Photos', 'wp-photo-album-plus');
819
  if ( isset($_REQUEST['bulk']) ) echo ' - <small><i>'.__('Copy / move / delete / edit name / edit description / change status', 'wp-photo-album-plus').'</i></small>';
820
  elseif ( isset($_REQUEST['seq']) ) echo ' - <small><i>'.__('Change sequence order by drag and drop', 'wp-photo-album-plus').'</i></small>';
821
  elseif ( isset($_REQUEST['quick']) ) echo ' - <small><i>'.__('Edit photo information except copy and move', 'wp-photo-album-plus').'</i></small>';
822
  else echo ' - <small><i>'.__('Edit photo information', 'wp-photo-album-plus').'</i></small>';
823
+ ?></h1><div style="clear:both;" >&nbsp;</div>
824
  <?php
825
  if ( isset($_REQUEST['bulk']) ) wppa_album_photos_bulk($edit_id);
826
  elseif ( isset($_REQUEST['seq']) ) wppa_album_photos_sequence($edit_id);
836
  $alb = wppa_get_album_id_by_photo_id($photo);
837
  if ( current_user_can('wppa_comments') && wppa_have_access($alb) ) { ?>
838
  <div class="wrap">
839
+ <img src="<?php echo WPPA_URL.'/images/page_green.png' ?>" />
840
+ <h1 style="display:inline;" ><?php _e('Moderate comment', 'wp-photo-album-plus') ?></h1>
841
+ <div style="clear:both;" >&nbsp;</div>
842
  <?php wppa_album_photos('', $photo) ?>
843
  </div>
844
  <?php }
853
  $alb = wppa_get_album_id_by_photo_id($photo);
854
  if ( current_user_can('wppa_admin') && wppa_have_access($alb) ) { ?>
855
  <div class="wrap">
856
+ <img src="<?php echo WPPA_URL.'/images/page_green.png' ?>" />
857
+ <h1 style="display:inline;" ><?php if ( $_REQUEST['tab'] == 'pmod' ) _e('Moderate photo', 'wp-photo-album-plus');
858
  else _e('Edit photo', 'wp-photo-album-plus'); ?>
859
+ </h1><div style="clear:both;" >&nbsp;</div>
860
  <?php wppa_album_photos('', $photo) ?>
861
  </div>
862
  <?php }
874
  }
875
  ?>
876
  <div class="wrap">
877
+ <img src="<?php echo WPPA_URL.'/images/albumdel32.png' ?>" />
878
+ <h1 style="display:inline;" ><?php _e('Delete Album', 'wp-photo-album-plus'); ?></h1>
 
 
 
 
879
 
880
  <p><?php _e('Album:', 'wp-photo-album-plus'); ?> <b><?php echo wppa_get_album_name($_REQUEST['edit_id']); ?>.</b></p>
881
  <p><?php _e('Are you sure you want to delete this album?', 'wp-photo-album-plus'); ?><br />
941
  ?>
942
  <div class="wrap">
943
  <?php wppa_admin_spinner() ?>
944
+ <img src="<?php echo WPPA_URL.'/images/album32.png' ?>" />
945
+ <h1 style="display:inline;" ><?php _e('Manage Albums', 'wp-photo-album-plus'); ?></h1>
946
+ <div style="clear:both;" >&nbsp;</div>
 
 
 
 
947
  <?php
948
  // The Create new album button
949
  if ( wppa_can_create_top_album() ) {
1974
  border-radius:3px;
1975
  float: left;
1976
  }
1977
+ .ui-state-default-albums td {
1978
+ padding:0;
1979
+ line-height:12px;
1980
+ text-align:center;
1981
+ }
1982
  </style>
1983
  <script>
1984
  jQuery( function() {
1985
  jQuery( "#sortable-albums" ).sortable( {
1986
+ cursor: "move",
1987
+ placeholder: "sortable-placeholder-albums",
1988
+ stop: function( event, ui ) { wppaDoRenumber(); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1989
  } );
1990
  } );
1991
+ function wppaDoRenumber() {
1992
+ var ids = jQuery( ".wppa-sort-item-albums" );
1993
+ var seq = jQuery( ".wppa-sort-seqn-albums" );
1994
+ var idx = 0;
1995
+ var descend = <?php if ( $is_descending ) echo 'true'; else echo 'false' ?>;
1996
+ while ( idx < ids.length ) {
1997
+ var newvalue;
1998
+ if ( descend ) newvalue = ids.length - idx;
1999
+ else newvalue = idx + 1;
2000
+ var oldvalue = seq[idx].value;
2001
+ var album = ids[idx].value;
2002
+ if ( newvalue != oldvalue ) {
2003
+ wppaDoSeqUpdateAlbum( album, newvalue );
2004
+ }
2005
+ idx++;
2006
+ }
2007
+ }
2008
  function wppaDoSeqUpdateAlbum( album, seqno ) {
2009
  var data = 'action=wppa' +
2010
  '&wppa-action=update-album' +
2039
  }
2040
  </script>
2041
 
2042
+ <div class="widefat" style="max-width:600px;" >
2043
  <div id="sortable-albums">
2044
  <?php foreach ( $albums as $album ) {
2045
  echo '
2056
  ' style="max-height:50px; margin: 5px;"' .
2057
  ' />' .
2058
  '</div>' .
2059
+ '<div style="height:100%;width:40%;float:left;font-size:12px;overflow:hidden;" >' .
2060
  '<b>' . wppa_get_album_name( $album['id'] ) . '</b>' .
2061
  '<br />' .
2062
  wppa_get_album_desc( $album['id'] ) .
2063
  '</div>' .
2064
+ '<div style="float:right;width:10%;" >' .
2065
+ '<table>' .
2066
+ '<tr><td>' .
2067
+ '<img' .
2068
+ ' src="' . wppa_get_imgdir( 'up.png' ) . '"' .
2069
+ ' title="' . esc_attr( __( 'To top', 'wp-photo-album-plus' ) ) . '"' .
2070
+ ' style="cursor:pointer;"' .
2071
+ ' onclick="' .
2072
+ 'jQuery( \'#albumitem-' . $album['id'] . '\' ).parent().prepend(jQuery( \'#albumitem-' . $album['id'] . '\' ));' .
2073
+ 'wppaDoRenumber();' .
2074
+ '"' .
2075
+ ' />' .
2076
+ '</td></tr>' .
2077
+ '<tr><td>' .
2078
+ '<img' .
2079
+ ' src="' . wppa_get_imgdir( 'up.png' ) . '"' .
2080
+ ' title="' . esc_attr( __( 'One up', 'wp-photo-album-plus' ) ) . '"' .
2081
+ ' style="cursor:pointer;width:24px;"' .
2082
+ ' onclick="' .
2083
+ 'jQuery( \'#albumitem-' . $album['id'] . '\' ).prev().before(jQuery( \'#albumitem-' . $album['id'] . '\' ));' .
2084
+ 'wppaDoRenumber();' .
2085
+ '"' .
2086
+ ' />' .
2087
+ '</td></tr>' .
2088
+ '<tr><td>' .
2089
+ '<img' .
2090
+ ' src="' . wppa_get_imgdir( 'down.png' ) . '"' .
2091
+ ' title="' . esc_attr( __( 'One down', 'wp-photo-album-plus' ) ) . '"' .
2092
+ ' style="cursor:pointer;width:24px;"' .
2093
+ ' onclick="' .
2094
+ 'jQuery( \'#albumitem-' . $album['id'] . '\' ).next().after(jQuery( \'#albumitem-' . $album['id'] . '\' ));' .
2095
+ 'wppaDoRenumber();' .
2096
+ '"' .
2097
+ ' />' .
2098
+ '</td></tr>' .
2099
+ '<tr><td>' .
2100
+ '<img' .
2101
+ ' src="' . wppa_get_imgdir( 'down.png' ) . '"' .
2102
+ ' title="' . esc_attr( __( 'To bottom', 'wp-photo-album-plus' ) ) . '"' .
2103
+ ' style="cursor:pointer;"' .
2104
+ ' onclick="' .
2105
+ 'jQuery( \'#albumitem-' . $album['id'] . '\' ).parent().append(jQuery( \'#albumitem-' . $album['id'] . '\' ));' .
2106
+ 'wppaDoRenumber();' .
2107
+ '"' .
2108
+ ' />' .
2109
+ '</td></tr>' .
2110
+ '</table>' .
2111
+ '</div>' .
2112
  '<div style="float:right; width:25%;" >' .
2113
  '<span style=""> ' . __( 'Id:' , 'wp-photo-album-plus' ) . ' ' . $album['id'] . '</span>' .
2114
  '<span style=""> - ' . __( 'Ord:' , 'wp-photo-album-plus' ) . '</span>' .
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 6.5.04
7
  *
8
  */
9
 
@@ -1346,7 +1346,7 @@ global $wppa_locale;
1346
  }
1347
  }
1348
  $tweet = urlencode( $share_url );
1349
- $tw = '<div style="float:left; padding:0 2px;" >' .
1350
  '<a' .
1351
  ' title="' . sprintf( __( 'Tweet %s on Twitter', 'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"' .
1352
  ' href="https://twitter.com/intent/tweet?text='.$tweet.'"' .
@@ -1366,7 +1366,7 @@ $tweet = urlencode( $share_url );
1366
 
1367
  // Google
1368
  if ( wppa_switch( 'share_google' ) ) {
1369
- $go = '<div style="float:left; padding:0 2px;" >' .
1370
  '<a' .
1371
  ' title="' . sprintf( __( 'Share %s on Google+', 'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"' .
1372
  ' href="https://plus.google.com/share?url=' . urlencode( $share_url ) . '"' .
@@ -1389,7 +1389,7 @@ $tweet = urlencode( $share_url );
1389
  $desc = urlencode( $see_on_site ).': '.urlencode( $photo_desc );
1390
  if ( strlen( $desc ) > 500 ) $desc = substr( $desc, 0, 495 ).'...';
1391
  if ( wppa_switch( 'share_pinterest' ) ) {
1392
- $pi = '<div style="float:left; padding:0 2px;" >' .
1393
  '<a' .
1394
  ' title="' . sprintf( __( 'Share %s on Pinterest' ,'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"' .
1395
  ' href="http://pinterest.com/pin/create/button/?url=' . urlencode( $share_url ) .
@@ -1431,7 +1431,7 @@ $tweet = urlencode( $share_url );
1431
  }
1432
  */
1433
  // New style under development
1434
- $li = '<div style="float:left; padding:0 2px;" >' .
1435
  '<a' .
1436
  ' href="https://www.linkedin.com/shareArticle?mini=true&url=' . urlencode( $share_url ) . '" >' .
1437
  '<img src="' . wppa_get_imgdir() . 'linkedin.png" style="height:' . $s . 'px;vertical-align:top;" />' .
@@ -2406,20 +2406,25 @@ static $albums_granted;
2406
  if ( ( $where == 'widget' || $where == 'uploadbox' ) && current_user_can( 'edit_posts' ) && wppa_switch( 'blog_it' ) ) {
2407
  $result .=
2408
  '<div>' .
2409
- '<h6>' .
2410
- __( 'Blog it?', 'wp-photo-album-plus' ) .
2411
- ' <input' .
2412
- ' type="checkbox"' .
2413
- ' id="wppa-blogit-'.$yalb.'-'.$mocc.'"' .
2414
- ' name="wppa-blogit"' .
2415
- ' onchange="if ( jQuery(this).attr(\'checked\') ) { ' .
2416
- 'jQuery(\'#blog-div-'.$yalb.'-'.$mocc.'\').css(\'display\',\'block\'); ' .
2417
- '} ' .
2418
- 'else { ' .
2419
- 'jQuery(\'#blog-div-'.$yalb.'-'.$mocc.'\').css(\'display\',\'none\'); ' .
2420
- '} "' .
2421
- ' />' .
2422
- '</h6>' .
 
 
 
 
 
2423
  '<div' .
2424
  ' id="blog-div-'.$yalb.'-'.$mocc.'"' .
2425
  ' style="display:none;"' .
@@ -2480,7 +2485,7 @@ static $albums_granted;
2480
  $onclick .
2481
  ' style="display:none; margin: 6px 0; float:right;"' .
2482
  ' class="wppa-user-submit"' .
2483
- ' name="wppa-user-submit-'.$yalb.'-'.$mocc.'" value="'.__( 'Upload photo', 'wp-photo-album-plus' ).'"' .
2484
  ' />' .
2485
  '<div style="height:6px;clear:both;"></div>';
2486
 
@@ -2734,24 +2739,21 @@ $result .= '<input' .
2734
  // Build the html for the comment box
2735
  function wppa_comment_html( $id, $comment_allowed ) {
2736
  global $wpdb;
2737
- global $wppa_first_comment_html;
2738
 
2739
  $result = '';
2740
  if ( wppa_in_widget() ) return $result; // NOT in a widget
2741
 
2742
  // Find out who we are either logged in or not
2743
  $vis = is_user_logged_in() ? 'display:none; ' : '';
2744
- if ( ! $wppa_first_comment_html ) {
2745
- $wppa_first_comment_html = true;
2746
-
2747
- // Find user
2748
- if ( wppa_get_post( 'comname' ) ) wppa( 'comment_user', wppa_get_post( 'comname' ) );
2749
- if ( wppa_get_post( 'comemail' ) ) wppa( 'comment_email', wppa_get_post( 'comemail' ) );
2750
- elseif ( is_user_logged_in() ) {
2751
- $current_user = wp_get_current_user();
2752
- wppa( 'comment_user', $current_user->display_name ); //user_login;
2753
- wppa( 'comment_email', $current_user->user_email );
2754
- }
2755
  }
2756
 
2757
  // Loop the comments already there
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 6.5.05
7
  *
8
  */
9
 
1346
  }
1347
  }
1348
  $tweet = urlencode( $share_url );
1349
+ $tw = '<div class="wppa-share-icon" style="float:left; padding:0 2px;" >' .
1350
  '<a' .
1351
  ' title="' . sprintf( __( 'Tweet %s on Twitter', 'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"' .
1352
  ' href="https://twitter.com/intent/tweet?text='.$tweet.'"' .
1366
 
1367
  // Google
1368
  if ( wppa_switch( 'share_google' ) ) {
1369
+ $go = '<div class="wppa-share-icon" style="float:left; padding:0 2px;" >' .
1370
  '<a' .
1371
  ' title="' . sprintf( __( 'Share %s on Google+', 'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"' .
1372
  ' href="https://plus.google.com/share?url=' . urlencode( $share_url ) . '"' .
1389
  $desc = urlencode( $see_on_site ).': '.urlencode( $photo_desc );
1390
  if ( strlen( $desc ) > 500 ) $desc = substr( $desc, 0, 495 ).'...';
1391
  if ( wppa_switch( 'share_pinterest' ) ) {
1392
+ $pi = '<div class="wppa-share-icon" style="float:left; padding:0 2px;" >' .
1393
  '<a' .
1394
  ' title="' . sprintf( __( 'Share %s on Pinterest' ,'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"' .
1395
  ' href="http://pinterest.com/pin/create/button/?url=' . urlencode( $share_url ) .
1431
  }
1432
  */
1433
  // New style under development
1434
+ $li = '<div class="wppa-share-icon" style="float:left; padding:0 2px;" >' .
1435
  '<a' .
1436
  ' href="https://www.linkedin.com/shareArticle?mini=true&url=' . urlencode( $share_url ) . '" >' .
1437
  '<img src="' . wppa_get_imgdir() . 'linkedin.png" style="height:' . $s . 'px;vertical-align:top;" />' .
2406
  if ( ( $where == 'widget' || $where == 'uploadbox' ) && current_user_can( 'edit_posts' ) && wppa_switch( 'blog_it' ) ) {
2407
  $result .=
2408
  '<div>' .
2409
+ '<input' .
2410
+ ' type="button"' .
2411
+ ' value="' . esc_attr( __( 'Blog it?', 'wp-photo-album-plus' ) ) . '"' .
2412
+ ' onclick="jQuery(\'#wppa-blogit-'.$yalb.'-'.$mocc.'\').trigger(\'click\')"' .
2413
+ ' />' .
2414
+ ' <input' .
2415
+ ' type="checkbox"' .
2416
+ ' id="wppa-blogit-'.$yalb.'-'.$mocc.'"' .
2417
+ ' name="wppa-blogit"' .
2418
+ ' style="display:none;"' .
2419
+ ' onchange="if ( jQuery(this).attr(\'checked\') ) { ' .
2420
+ 'jQuery(\'#blog-div-'.$yalb.'-'.$mocc.'\').css(\'display\',\'block\'); ' .
2421
+ 'jQuery(\'#wppa-user-submit-' . $yalb . '-' . $mocc . '\').attr(\'value\', \'' . esc_js(__( 'Upload and blog', 'wp-photo-album-plus' )) . '\'); ' .
2422
+ '} ' .
2423
+ 'else { ' .
2424
+ 'jQuery(\'#blog-div-'.$yalb.'-'.$mocc.'\').css(\'display\',\'none\'); ' .
2425
+ 'jQuery(\'#wppa-user-submit-' . $yalb . '-' . $mocc . '\').attr(\'value\', \'' . esc_js(__( 'Upload photo', 'wp-photo-album-plus' )) . '\'); ' .
2426
+ '} "' .
2427
+ ' />' .
2428
  '<div' .
2429
  ' id="blog-div-'.$yalb.'-'.$mocc.'"' .
2430
  ' style="display:none;"' .
2485
  $onclick .
2486
  ' style="display:none; margin: 6px 0; float:right;"' .
2487
  ' class="wppa-user-submit"' .
2488
+ ' name="wppa-user-submit-'.$yalb.'-'.$mocc.'" value="' . esc_attr( __( 'Upload photo', 'wp-photo-album-plus' ) ) . '"' .
2489
  ' />' .
2490
  '<div style="height:6px;clear:both;"></div>';
2491
 
2739
  // Build the html for the comment box
2740
  function wppa_comment_html( $id, $comment_allowed ) {
2741
  global $wpdb;
2742
+ //global $wppa_first_comment_html;
2743
 
2744
  $result = '';
2745
  if ( wppa_in_widget() ) return $result; // NOT in a widget
2746
 
2747
  // Find out who we are either logged in or not
2748
  $vis = is_user_logged_in() ? 'display:none; ' : '';
2749
+
2750
+ // Find user
2751
+ if ( wppa_get_post( 'comname' ) ) wppa( 'comment_user', wppa_get_post( 'comname' ) );
2752
+ if ( wppa_get_post( 'comemail' ) ) wppa( 'comment_email', wppa_get_post( 'comemail' ) );
2753
+ elseif ( is_user_logged_in() ) {
2754
+ $current_user = wp_get_current_user();
2755
+ wppa( 'comment_user', $current_user->display_name ); //user_login;
2756
+ wppa( 'comment_email', $current_user->user_email );
 
 
 
2757
  }
2758
 
2759
  // Loop the comments already there
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 6.5.04
6
  *
7
  */
8
 
@@ -141,6 +141,7 @@ global $thumbs;
141
  'numbar_on' => '0',
142
  'single_photo' => '',
143
  'is_mphoto' => '0',
 
144
  'start_album' => '',
145
  'align' => '',
146
  'src' => false,
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 6.5.05
6
  *
7
  */
8
 
141
  'numbar_on' => '0',
142
  'single_photo' => '',
143
  'is_mphoto' => '0',
144
+ 'is_xphoto' => '0',
145
  'start_album' => '',
146
  'align' => '',
147
  'src' => false,
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via filter
6
- * Version 6.5.03
7
  *
8
  */
9
 
@@ -367,6 +367,10 @@ global $wppa_revno;
367
  $wppa['single_photo'] = $atts['photo'];
368
  $wppa['is_mphoto'] = '1';
369
  break;
 
 
 
 
370
  case 'slphoto':
371
  $wppa['is_slide'] = '1';
372
  $wppa['single_photo'] = $atts['photo'];
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via filter
6
+ * Version 6.5.05
7
  *
8
  */
9
 
367
  $wppa['single_photo'] = $atts['photo'];
368
  $wppa['is_mphoto'] = '1';
369
  break;
370
+ case 'xphoto':
371
+ $wppa['single_photo'] = $atts['photo'];
372
+ $wppa['is_xphoto'] = '1';
373
+ break;
374
  case 'slphoto':
375
  $wppa['is_slide'] = '1';
376
  $wppa['single_photo'] = $atts['photo'];
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 6.5.04
7
  *
8
  */
9
 
@@ -201,7 +201,7 @@ global $wppa_session;
201
  wppa( 'is_slideonly', true );
202
  }
203
 
204
- if ( $type == 'photo' || $type == 'mphoto' || $type == 'slphoto' ) { // Any type of single photo? id given is photo id
205
  if ( $id ) wppa( 'single_photo', $id );
206
  }
207
  else { // Not single photo: id given is album id
@@ -245,6 +245,9 @@ global $wppa_session;
245
  case 'mphoto':
246
  wppa( 'is_mphoto', true );
247
  break;
 
 
 
248
  case 'slphoto':
249
  wppa( 'is_slide', true );
250
  wppa( 'start_photo', wppa( 'single_photo' ) );
@@ -777,6 +780,12 @@ global $wppa_session;
777
  elseif ( wppa( 'is_supersearch' ) ) {
778
  wppa_supersearch_box();
779
  }
 
 
 
 
 
 
780
  // Is it newstyle single photo mediastyle?
781
  elseif ( wppa( 'is_mphoto' ) == '1' ) {
782
  if ( wppa( 'is_autopage' ) ) wppa_auto_page_links( 'top' );
@@ -3632,8 +3641,15 @@ function wppa_force_balance_pee( $xtext ) {
3632
  return $text;
3633
  }
3634
 
 
3635
  function wppa_mphoto() {
3636
 
 
 
 
 
 
 
3637
  $id = wppa( 'single_photo' );
3638
  $width = wppa_get_container_width();
3639
  $height = floor( $width / wppa_get_ratio( $id ) );
@@ -3744,7 +3760,7 @@ function wppa_mphoto() {
3744
  }
3745
  else {
3746
  wppa_out( wppa_get_video_html( array( 'id' => $id,
3747
- 'width' => $width,
3748
  'height' => $height,
3749
  'controls' => ! $link['is_lightbox'],
3750
  'style' => $style,
@@ -3761,7 +3777,7 @@ function wppa_mphoto() {
3761
  ' style="' . $style . '"' .
3762
  ' class="size-medium wppa-mphoto wppa-mimg-' . wppa( 'mocc' ) . '"' .
3763
  ( $title ? ' title="' . $title . '"' : '' ) .
3764
- ' width="' . $width . '"' .
3765
  ' height="' . $height . '"' .
3766
  ' />'
3767
  );
@@ -3796,11 +3812,23 @@ function wppa_mphoto() {
3796
  // The subtitle
3797
  wppa_out( '<p class="wp-caption-text">' . wppa_get_photo_desc( $id ) . '</p>' );
3798
 
3799
- // The share buttons
3800
- if ( wppa_switch( 'share_on_mphoto' ) ) {
 
 
 
 
 
3801
  wppa_out( wppa_get_share_html( $id, 'mphoto', false ) );
3802
  }
3803
 
 
 
 
 
 
 
 
3804
  wppa_out( '</div>' );
3805
 
3806
  // Maximized auto
@@ -3929,7 +3957,7 @@ function wppa_sphoto() {
3929
  }
3930
  else {
3931
  wppa_out( wppa_get_video_html( array( 'id' => $id,
3932
- 'width' => $width,
3933
  'height' => $height,
3934
  'controls' => ! $link['is_lightbox'],
3935
  'style' => $style,
@@ -3947,7 +3975,7 @@ function wppa_sphoto() {
3947
  ' ' . wppa_get_imgalt( $id ) .
3948
  ( $title ? ' title="' . $title . '" ' : '' ) .
3949
  ' style="' . $style . '"' .
3950
- ( $autocol ? '' : ' width="' . $width . '" height="' . $height . '" ' ) .
3951
  '/ >'
3952
  );
3953
  }
@@ -4939,7 +4967,7 @@ function wppa_get_lbtitle( $type, $id ) {
4939
  if ( ( $do_name || $do_desc ) && $do_sm ) $result .= '<br />';
4940
 
4941
  if ( wppa_opt( 'rating_max' ) != '1' && wppa_opt( 'rating_display_type' ) == 'graphic' ) {
4942
- $result .= wppa_get_slide_rating_range_html( '', true, $id );
4943
  }
4944
 
4945
  if ( $do_sm ) $result .= wppa_get_share_html( $thumb['id'], 'lightbox' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 6.5.05
7
  *
8
  */
9
 
201
  wppa( 'is_slideonly', true );
202
  }
203
 
204
+ if ( $type == 'photo' || $type == 'mphoto' || $type == 'slphoto' || $type == 'xphoto' ) { // Any type of single photo? id given is photo id
205
  if ( $id ) wppa( 'single_photo', $id );
206
  }
207
  else { // Not single photo: id given is album id
245
  case 'mphoto':
246
  wppa( 'is_mphoto', true );
247
  break;
248
+ case 'xphoto':
249
+ wppa( 'is_xphoto', true );
250
+ break;
251
  case 'slphoto':
252
  wppa( 'is_slide', true );
253
  wppa( 'start_photo', wppa( 'single_photo' ) );
780
  elseif ( wppa( 'is_supersearch' ) ) {
781
  wppa_supersearch_box();
782
  }
783
+ // Is it newstyle single photo xtended mediastyle?
784
+ elseif ( wppa( 'is_xphoto' ) == '1' ) {
785
+ if ( wppa( 'is_autopage' ) ) wppa_auto_page_links( 'top' );
786
+ wppa_xphoto();
787
+ if ( wppa( 'is_autopage' ) ) wppa_auto_page_links( 'bottom' );
788
+ }
789
  // Is it newstyle single photo mediastyle?
790
  elseif ( wppa( 'is_mphoto' ) == '1' ) {
791
  if ( wppa( 'is_autopage' ) ) wppa_auto_page_links( 'top' );
3641
  return $text;
3642
  }
3643
 
3644
+ // Mphoto ( photo in wp media photo style ) is now a subset of extended media style photo (xphoto).
3645
  function wppa_mphoto() {
3646
 
3647
+ wppa_xphoto( false );
3648
+ }
3649
+
3650
+ // Extended media style photo
3651
+ function wppa_xphoto( $extended = true ) {
3652
+
3653
  $id = wppa( 'single_photo' );
3654
  $width = wppa_get_container_width();
3655
  $height = floor( $width / wppa_get_ratio( $id ) );
3760
  }
3761
  else {
3762
  wppa_out( wppa_get_video_html( array( 'id' => $id,
3763
+ 'width' => $contwidth,
3764
  'height' => $height,
3765
  'controls' => ! $link['is_lightbox'],
3766
  'style' => $style,
3777
  ' style="' . $style . '"' .
3778
  ' class="size-medium wppa-mphoto wppa-mimg-' . wppa( 'mocc' ) . '"' .
3779
  ( $title ? ' title="' . $title . '"' : '' ) .
3780
+ ' width="' . $contwidth . '"' .
3781
  ' height="' . $height . '"' .
3782
  ' />'
3783
  );
3812
  // The subtitle
3813
  wppa_out( '<p class="wp-caption-text">' . wppa_get_photo_desc( $id ) . '</p>' );
3814
 
3815
+ // The rating, only on xphoto when enabled in II-B7
3816
+ if ( wppa( 'is_xphoto' ) && wppa_switch( 'rating_on' ) ) {
3817
+ wppa_out( wppa_get_rating_range_html( $id, false, 'wp-caption-text' ) );
3818
+ }
3819
+
3820
+ // The share buttons on mphoto if enabled in II-C6, and on xphoto when enabled in II-C1
3821
+ if ( wppa_switch( 'share_on_mphoto' ) || wppa( 'is_xphoto' ) ) {
3822
  wppa_out( wppa_get_share_html( $id, 'mphoto', false ) );
3823
  }
3824
 
3825
+ // The commentform on xphoto when enabled in II-B10
3826
+ if ( wppa( 'is_xphoto' ) && wppa_switch( 'show_comments' ) ) {
3827
+ wppa_out( '<div id="wppa-comments-' . wppa( 'mocc' ) . '" >' );
3828
+ wppa_out( wppa_comment_html( $id, ! wppa_switch( 'comment_login' ) || is_user_logged_in() ) );
3829
+ wppa_out( '</div>' );
3830
+ }
3831
+
3832
  wppa_out( '</div>' );
3833
 
3834
  // Maximized auto
3957
  }
3958
  else {
3959
  wppa_out( wppa_get_video_html( array( 'id' => $id,
3960
+ 'width' => $contwidth,
3961
  'height' => $height,
3962
  'controls' => ! $link['is_lightbox'],
3963
  'style' => $style,
3975
  ' ' . wppa_get_imgalt( $id ) .
3976
  ( $title ? ' title="' . $title . '" ' : '' ) .
3977
  ' style="' . $style . '"' .
3978
+ ' width="' . $contwidth . '" height="' . $height . '" ' .
3979
  '/ >'
3980
  );
3981
  }
4967
  if ( ( $do_name || $do_desc ) && $do_sm ) $result .= '<br />';
4968
 
4969
  if ( wppa_opt( 'rating_max' ) != '1' && wppa_opt( 'rating_display_type' ) == 'graphic' ) {
4970
+ $result .= wppa_get_rating_range_html( $id, true );
4971
  }
4972
 
4973
  if ( $do_sm ) $result .= wppa_get_share_html( $thumb['id'], 'lightbox' );
wppa-import.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
- * Version 6.5.02
7
  *
8
  */
9
 
@@ -512,7 +512,7 @@ global $wppa_session;
512
  if ( $photocount ) {
513
  echo
514
  '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >';
515
-
516
  // Display the number of photos
517
  '<p><b>';
518
 
@@ -538,7 +538,7 @@ global $wppa_session;
538
 
539
  echo
540
  '</b></p>';
541
-
542
  // The album selection
543
  echo
544
  '<p class="hideifupdate" >' .
@@ -802,13 +802,13 @@ global $wppa_session;
802
  if ( $videocount && wppa_switch( 'enable_video' ) ) {
803
  echo
804
  '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >';
805
-
806
  // Display available files
807
  echo
808
  '<p><b>' .
809
  sprintf( _n( 'There is %d video in the depot', 'There are %d videos in the depot', $videocount, 'wp-photo-album-plus' ), $videocount ) .
810
  '</b></p>';
811
-
812
  // Album to import to
813
  echo
814
  '<p class="hideifupdate" >' .
@@ -822,7 +822,7 @@ global $wppa_session;
822
  ) ) .
823
  '</select>' .
824
  '</p>';
825
-
826
  // Header of video list
827
  echo
828
  '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' .
@@ -841,7 +841,7 @@ global $wppa_session;
841
  '</b>' .
842
  '</td>';
843
  if ( $is_sub_depot ) {
844
- echo
845
  '<td>' .
846
  '<input' .
847
  ' type="checkbox"' .
@@ -859,7 +859,7 @@ global $wppa_session;
859
  '</tr>' .
860
  '</thead>' .
861
  '</table>';
862
-
863
  // Video list
864
  echo
865
  '<table class="form-table wppa-table widefat" style="margin-top:0;" >' .
@@ -906,13 +906,13 @@ global $wppa_session;
906
  if ( $audiocount && wppa_switch( 'enable_audio' ) ) {
907
  echo
908
  '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >';
909
-
910
  // Display available files
911
  echo
912
  '<p><b>' .
913
  sprintf( _n( 'There is %d audio in the depot', 'There are %d audios in the depot', $audiocount, 'wp-photo-album-plus' ), $audiocount ) .
914
  '</b></p>';
915
-
916
  // Album to import to
917
  echo
918
  '<p class="hideifupdate" >' .
@@ -926,7 +926,7 @@ global $wppa_session;
926
  ) ) .
927
  '</select>' .
928
  '</p>';
929
-
930
  // Header of audio list
931
  echo
932
  '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' .
@@ -944,7 +944,7 @@ global $wppa_session;
944
  __( 'Check/uncheck all', 'wp-photo-album-plus') .
945
  '</b>' .
946
  '</td>';
947
-
948
  // The remove box
949
  if ( $is_sub_depot ) {
950
  echo
@@ -965,7 +965,7 @@ global $wppa_session;
965
  '</tr>' .
966
  '</thead>' .
967
  '</table>';
968
-
969
  // Audio list
970
  echo
971
  '<table class="form-table wppa-table widefat" style="margin-top:0;" >' .
@@ -977,7 +977,7 @@ global $wppa_session;
977
  if ( in_array( strtolower($ext), $wppa_supported_audio_extensions ) ) {
978
  echo
979
  '<td>' .
980
- '<input' .
981
  ' type="checkbox"' .
982
  ' id="file-' . $idx . '"' .
983
  ' name="file-' . $idx . '"' .
@@ -1012,13 +1012,13 @@ global $wppa_session;
1012
  if ( $is_depot && $dircount ) {
1013
  echo
1014
  '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >';
1015
-
1016
  // Display number of dirs
1017
  echo
1018
  '<p><b>' .
1019
  sprintf( _n( 'There is %d albumdirectory in the depot', 'There are %d albumdirectories in the depot', $dircount, 'wp-photo-album-plus' ), $dircount ) .
1020
  '</b></p>';
1021
-
1022
  // Header of dirlist
1023
  echo
1024
  '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' .
@@ -1039,7 +1039,7 @@ global $wppa_session;
1039
  '</tr>' .
1040
  '</thead>' .
1041
  '</table>';
1042
-
1043
  // Dirlist
1044
  echo
1045
  '<table class="form-table wppa-table widefat" style="margin-top:0;" >';
@@ -1073,7 +1073,7 @@ global $wppa_session;
1073
  }
1074
  }
1075
  $sfcount = empty( $subfiles ) ? '0' : wppa_get_photocount( $subfiles );
1076
- echo ' ' .
1077
  sprintf( _n( 'Contains %d file', 'Contains %d files', $sfcount, 'wp-photo-album-plus' ), $sfcount );
1078
  if ( $subdircount ) {
1079
  echo ' ' .
@@ -1093,13 +1093,13 @@ global $wppa_session;
1093
  if ( $is_depot && $csvcount ) {
1094
  echo
1095
  '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >';
1096
-
1097
  // Display number of files
1098
  echo
1099
  '<p><b>' .
1100
  sprintf( _n( 'There is %d .csv file in the depot', 'There are %d .csv files in the depot', $csvcount, 'wp-photo-album-plus' ), $csvcount ) .
1101
  '</b></p>';
1102
-
1103
  // Header of .csv file list
1104
  echo
1105
  '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' .
@@ -1114,7 +1114,7 @@ global $wppa_session;
1114
  ' />' .
1115
  '<b>' .
1116
  '&nbsp;&nbsp;' .
1117
- __( 'Check/uncheck all', 'wp-photo-album-plus') .
1118
  '</b>' .
1119
  '</td>' .
1120
  '<td>' .
@@ -1133,7 +1133,7 @@ global $wppa_session;
1133
  '</tr>' .
1134
  '</thead>' .
1135
  '</table>';
1136
-
1137
  // CSV file list
1138
  echo
1139
  '<table class="form-table wppa-table widefat" style="margin-top:0;" >';
@@ -1153,7 +1153,7 @@ global $wppa_session;
1153
  ' />' .
1154
  '&nbsp;&nbsp;' .
1155
  '<b>' .
1156
- wppa_sanitize_file_name( basename( $csv ) ) .
1157
  ' (' . sprintf( '%5.1f', filesize( $csv ) / 1024 ) . ' kb)' .
1158
  '</b>' .
1159
  '</td>' .
@@ -1165,7 +1165,7 @@ global $wppa_session;
1165
  '</table>' .
1166
  '</div>';
1167
  }
1168
-
1169
  // The submit button
1170
  ?>
1171
  <p>
@@ -1367,7 +1367,7 @@ global $wppa_session;
1367
  wppa_warning_message( __( 'Trying to continue...', 'wp-photo-album-plus') );
1368
  echo '<script type="text/javascript">document.location=\''.get_admin_url().'admin.php?page=wppa_import_photos&continue&nonce='.wp_create_nonce( 'dirimport' ).'\';</script>';
1369
  }
1370
-
1371
  echo
1372
  '</div><!-- .wrap -->';
1373
  }
@@ -1743,8 +1743,8 @@ global $wppa_supported_audio_extensions;
1743
  $old_photo = wppa_strip_ext( wppa_get_photo_path( $is_poster ) );
1744
  $old_thumb = wppa_strip_ext( wppa_get_thumb_path( $is_poster ) );
1745
  foreach ( $wppa_supported_photo_extensions as $pext ) {
1746
- @ unlink( $old_photo . '.' . $pext );
1747
- @ unlink( $old_thumb . '.' . $pext );
1748
  }
1749
 
1750
  // Clear sizes on db
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
+ * Version 6.5.05
7
  *
8
  */
9
 
512
  if ( $photocount ) {
513
  echo
514
  '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >';
515
+
516
  // Display the number of photos
517
  '<p><b>';
518
 
538
 
539
  echo
540
  '</b></p>';
541
+
542
  // The album selection
543
  echo
544
  '<p class="hideifupdate" >' .
802
  if ( $videocount && wppa_switch( 'enable_video' ) ) {
803
  echo
804
  '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >';
805
+
806
  // Display available files
807
  echo
808
  '<p><b>' .
809
  sprintf( _n( 'There is %d video in the depot', 'There are %d videos in the depot', $videocount, 'wp-photo-album-plus' ), $videocount ) .
810
  '</b></p>';
811
+
812
  // Album to import to
813
  echo
814
  '<p class="hideifupdate" >' .
822
  ) ) .
823
  '</select>' .
824
  '</p>';
825
+
826
  // Header of video list
827
  echo
828
  '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' .
841
  '</b>' .
842
  '</td>';
843
  if ( $is_sub_depot ) {
844
+ echo
845
  '<td>' .
846
  '<input' .
847
  ' type="checkbox"' .
859
  '</tr>' .
860
  '</thead>' .
861
  '</table>';
862
+
863
  // Video list
864
  echo
865
  '<table class="form-table wppa-table widefat" style="margin-top:0;" >' .
906
  if ( $audiocount && wppa_switch( 'enable_audio' ) ) {
907
  echo
908
  '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >';
909
+
910
  // Display available files
911
  echo
912
  '<p><b>' .
913
  sprintf( _n( 'There is %d audio in the depot', 'There are %d audios in the depot', $audiocount, 'wp-photo-album-plus' ), $audiocount ) .
914
  '</b></p>';
915
+
916
  // Album to import to
917
  echo
918
  '<p class="hideifupdate" >' .
926
  ) ) .
927
  '</select>' .
928
  '</p>';
929
+
930
  // Header of audio list
931
  echo
932
  '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' .
944
  __( 'Check/uncheck all', 'wp-photo-album-plus') .
945
  '</b>' .
946
  '</td>';
947
+
948
  // The remove box
949
  if ( $is_sub_depot ) {
950
  echo
965
  '</tr>' .
966
  '</thead>' .
967
  '</table>';
968
+
969
  // Audio list
970
  echo
971
  '<table class="form-table wppa-table widefat" style="margin-top:0;" >' .
977
  if ( in_array( strtolower($ext), $wppa_supported_audio_extensions ) ) {
978
  echo
979
  '<td>' .
980
+ '<input' .
981
  ' type="checkbox"' .
982
  ' id="file-' . $idx . '"' .
983
  ' name="file-' . $idx . '"' .
1012
  if ( $is_depot && $dircount ) {
1013
  echo
1014
  '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >';
1015
+
1016
  // Display number of dirs
1017
  echo
1018
  '<p><b>' .
1019
  sprintf( _n( 'There is %d albumdirectory in the depot', 'There are %d albumdirectories in the depot', $dircount, 'wp-photo-album-plus' ), $dircount ) .
1020
  '</b></p>';
1021
+
1022
  // Header of dirlist
1023
  echo
1024
  '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' .
1039
  '</tr>' .
1040
  '</thead>' .
1041
  '</table>';
1042
+
1043
  // Dirlist
1044
  echo
1045
  '<table class="form-table wppa-table widefat" style="margin-top:0;" >';
1073
  }
1074
  }
1075
  $sfcount = empty( $subfiles ) ? '0' : wppa_get_photocount( $subfiles );
1076
+ echo ' ' .
1077
  sprintf( _n( 'Contains %d file', 'Contains %d files', $sfcount, 'wp-photo-album-plus' ), $sfcount );
1078
  if ( $subdircount ) {
1079
  echo ' ' .
1093
  if ( $is_depot && $csvcount ) {
1094
  echo
1095
  '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >';
1096
+
1097
  // Display number of files
1098
  echo
1099
  '<p><b>' .
1100
  sprintf( _n( 'There is %d .csv file in the depot', 'There are %d .csv files in the depot', $csvcount, 'wp-photo-album-plus' ), $csvcount ) .
1101
  '</b></p>';
1102
+
1103
  // Header of .csv file list
1104
  echo
1105
  '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' .
1114
  ' />' .
1115
  '<b>' .
1116
  '&nbsp;&nbsp;' .
1117
+ __( 'Check/uncheck all', 'wp-photo-album-plus') .
1118
  '</b>' .
1119
  '</td>' .
1120
  '<td>' .
1133
  '</tr>' .
1134
  '</thead>' .
1135
  '</table>';
1136
+
1137
  // CSV file list
1138
  echo
1139
  '<table class="form-table wppa-table widefat" style="margin-top:0;" >';
1153
  ' />' .
1154
  '&nbsp;&nbsp;' .
1155
  '<b>' .
1156
+ wppa_sanitize_file_name( basename( $csv ) ) .
1157
  ' (' . sprintf( '%5.1f', filesize( $csv ) / 1024 ) . ' kb)' .
1158
  '</b>' .
1159
  '</td>' .
1165
  '</table>' .
1166
  '</div>';
1167
  }
1168
+
1169
  // The submit button
1170
  ?>
1171
  <p>
1367
  wppa_warning_message( __( 'Trying to continue...', 'wp-photo-album-plus') );
1368
  echo '<script type="text/javascript">document.location=\''.get_admin_url().'admin.php?page=wppa_import_photos&continue&nonce='.wp_create_nonce( 'dirimport' ).'\';</script>';
1369
  }
1370
+
1371
  echo
1372
  '</div><!-- .wrap -->';
1373
  }
1743
  $old_photo = wppa_strip_ext( wppa_get_photo_path( $is_poster ) );
1744
  $old_thumb = wppa_strip_ext( wppa_get_thumb_path( $is_poster ) );
1745
  foreach ( $wppa_supported_photo_extensions as $pext ) {
1746
+ if ( is_file( $old_photo . '.' . $pext ) ) unlink( $old_photo . '.' . $pext );
1747
+ if ( is_file( $old_thumb . '.' . $pext ) ) unlink( $old_thumb . '.' . $pext );
1748
  }
1749
 
1750
  // Clear sizes on db
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 6.5.04
7
  *
8
  */
9
 
@@ -263,8 +263,10 @@ global $wp_version;
263
  wppa_check_database(true);
264
 
265
  // Cleanup obsolete settings
266
- $iret = $wpdb->query( "DELETE FROM `".$wpdb->prefix.'options'."` WHERE `option_name` LIKE 'wppa_last_album_used-%'" );
267
- if ( $iret > '10' ) wppa_update_message( sprintf( __( '%s obsolete settings removed.', 'wp-photo-album-plus'), $iret ) );
 
 
268
 
269
  ?>
270
  <div class="wrap">
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 6.5.05
7
  *
8
  */
9
 
263
  wppa_check_database(true);
264
 
265
  // Cleanup obsolete settings
266
+ if ( $wpdb->get_var( "SELECT COUNT(*) FROM `".$wpdb->prefix.'options'."` WHERE `option_name` LIKE 'wppa_last_album_used-%'" ) > 100 ) {
267
+ $iret = $wpdb->query( "DELETE FROM `".$wpdb->prefix.'options'."` WHERE `option_name` LIKE 'wppa_last_album_used-%'" );
268
+ wppa_update_message( sprintf( __( '%s last album used settings removed.', 'wp-photo-album-plus'), $iret ) );
269
+ }
270
 
271
  ?>
272
  <div class="wrap">
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 6.5.04
7
  *
8
  */
9
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 6.5.05
7
  *
8
  */
9
 
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.5.01
7
  *
8
  */
9
 
@@ -703,36 +703,54 @@ function wppa_slide_rating_vote_only( $opt ) {
703
 
704
  function wppa_slide_rating_range( $opt ) {
705
 
706
- $result = wppa_get_slide_rating_range_html( $opt );
 
 
 
 
 
 
 
 
 
 
707
  wppa_out( $result );
708
  }
709
 
710
- function wppa_get_slide_rating_range_html( $opt, $is_lightbox = false, $id = 0 ) {
711
  global $wpdb;
712
 
 
 
 
 
713
  if ( $is_lightbox ) {
714
  if ( ! wppa_switch( 'ovl_rating' ) ) {
715
  return '';
716
  }
 
 
 
717
  $wait_text = wppa_get_rating_wait_text( $id, wppa_get_user() );
718
  if ( $wait_text ) {
719
- return '<span style="color:red" >'.$wait_text.'</span>';
720
  }
721
  if ( wppa_get_photo_item( $id, 'owner' ) == wppa_get_user() && ! wppa_switch( 'allow_owner_votes' ) ) {
722
- return __( 'Sorry, you can not rate your own photos' , 'wp-photo-album-plus');
723
  }
724
  $mylast = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM `'.WPPA_RATING.'` WHERE `photo` = %s AND `user` = %s ORDER BY `id` DESC LIMIT 1', $id, wppa_get_user() ), ARRAY_A );
725
  if ( $mylast && ! wppa_switch( 'rating_change' ) && ! wppa_switch( 'rating_multi' ) ) {
726
- return __( 'Sorry, you can rate a photo only once', 'wp-photo-album-plus' );
727
  }
728
- $ovl = 'Ovl';
729
- }
730
- else {
731
- if ( $opt == 'optional' && ! wppa_switch( 'rating_on' ) ) return '';
732
- if ( wppa( 'is_slideonly' ) ) return ''; /* Not when slideonly */
733
- $ovl = '';
734
  }
735
- if ( is_feed() ) return '';
 
 
 
 
 
 
 
736
 
737
  $result = '';
738
 
@@ -744,9 +762,9 @@ global $wpdb;
744
  // Open the rating box
745
  $result .= '<div' .
746
  ' id="wppa-rating-'.wppa( 'mocc' ).'"' .
747
- ' class="' . ( $ovl ? '' : 'wppa-box wppa-nav wppa-nav-text' ) . '"' .
748
  ' style="' .
749
- ( $ovl ? 'padding:4px;' : __wcs( 'wppa-box' ) . __wcs( 'wppa-nav' ) . __wcs( 'wppa-nav-text' ) ) .
750
  $size .
751
  ' text-align:center;"' .
752
  '> ';
@@ -768,7 +786,7 @@ global $wpdb;
768
  // Display avg rating
769
  if ( wppa_switch( 'show_avg_rating' ) ) {
770
 
771
- if ( $ovl ) {
772
  $avgrat = wppa_get_rating_by_id( $id, 'nolabel' );
773
  $opac = array();
774
  $i = '1';
@@ -785,7 +803,10 @@ global $wpdb;
785
  $i++;
786
  }
787
  }
788
- $result .= '<span id="wppa-avg-rat-' . wppa( 'mocc' ) . '" >' .
 
 
 
789
  __( 'Average&nbsp;rating', 'wp-photo-album-plus' ) .
790
  '</span>&nbsp;';
791
 
@@ -793,10 +814,10 @@ global $wpdb;
793
  while ( $i <= wppa_opt( 'rating_max' ) ) {
794
  $result .= '<img' .
795
  ' id="wppa-avg-' . wppa( 'mocc' ) . '-' . $i . '"' .
796
- ' class="wppa-avg-'.wppa( 'mocc' ).' no-shadow"' .
797
  ' style="' .
798
  $style .
799
- ( $ovl ? $opac[$i] : '' ) .
800
  '"' .
801
  ' src="' . wppa_get_imgdir() . $icon . '"' .
802
  ' alt=" ' . $i . '"' .
@@ -822,6 +843,7 @@ global $wpdb;
822
  if ( $pad < 5 ) $pad = '5';
823
  if ( wppa_opt( 'dislike_mail_every' ) ) {
824
 
 
825
  $result .= '<img' .
826
  ' id="wppa-dislike-'.wppa( 'mocc' ).'"' .
827
  ' title="'.__('Click this if you do NOT like this image!', 'wp-photo-album-plus').'"' .
@@ -831,12 +853,27 @@ global $wpdb;
831
  ' class="no-shadow"' .
832
  ' onmouseover="jQuery(this).stop().fadeTo(100, 1.0)"' .
833
  ' onmouseout="jQuery(this).stop().fadeTo(100, wppaStarOpacity)"' .
834
- ' onclick="if (confirm(\'' .
835
- __('Are you sure you want to mark this image as inappropriate?', 'wp-photo-album-plus') .
836
- '\'))' . ( $ovl ? 'wppaOvlRateIt( \''.wppa_encrypt_photo($id).'\', -1)'
837
- : 'wppaRateIt('.wppa( 'mocc' ).', -1)' ) . '"' .
 
 
 
 
838
  ' />';
839
 
 
 
 
 
 
 
 
 
 
 
 
840
  if ( wppa_switch( 'dislike_show_count' ) ) {
841
  $result .= '<span' .
842
  ' id="wppa-discount-' . wppa( 'mocc' ) . '"' .
@@ -853,7 +890,7 @@ global $wpdb;
853
  }
854
 
855
  // Display the my rating stars
856
- if ( $ovl ) {
857
  $myavgrat = wppa_get_my_rating_by_id( $id, 'nolabel' );
858
  $opac = array();
859
  $i = '1';
@@ -874,18 +911,24 @@ global $wpdb;
874
  $i = '1';
875
  while ( $i <= wppa_opt( 'rating_max' ) ) {
876
  $result .= '<img' .
877
- ' id="wppa-rate-'.( $ovl ? '' : wppa( 'mocc' ).'-').$i.'"' .
878
- ' class="wppa-rate-'.wppa( 'mocc' ).' no-shadow"' .
879
  ' style="' .
880
  $style .
881
- ( $ovl ? $opac[$i] : '' ) .
882
  '"' .
883
  ' src="'.wppa_get_imgdir().$icon.'"' .
884
  ' alt="'.$i.'"' .
885
  ' title="'.__('My&nbsp;rating', 'wp-photo-album-plus').': '.$r[$i].'"' .
 
 
 
 
 
886
  ' onmouseover="wppaFollowMe('.wppa( 'mocc' ).', '.$i.')"' .
887
- ' onmouseout="wppaLeaveMe('.wppa( 'mocc' ).', '.$i.')"' .
888
- ( $ovl ? ' onclick="wppaOvlRateIt(\''.wppa_encrypt_photo($id).'\', '.$i.')"' :
 
889
  ' onclick="wppaRateIt('.wppa( 'mocc' ).', '.$i.')"' ) .
890
  ' />';
891
  $i++;
@@ -893,7 +936,13 @@ global $wpdb;
893
 
894
  // Text right if avg rating diaplayed
895
  if ( wppa_switch( 'show_avg_rating' ) ) {
896
- $result .= '&nbsp;'.'<span id="wppa-my-rat-'.wppa( 'mocc' ).'">'.__('My&nbsp;rating', 'wp-photo-album-plus').'</span>';
 
 
 
 
 
 
897
  }
898
  }
899
  else {
@@ -928,8 +977,10 @@ global $wpdb;
928
  $result .= '<div' .
929
  ' id="wppa-dislike-imgdiv-'.wppa( 'mocc' ).'"' .
930
  ' style="display:inline"' .
931
- ' >' .
932
- '<img' .
 
 
933
  ' id="wppa-dislike-'.wppa( 'mocc' ).'"' .
934
  ' title="'.__('Click this if you do NOT like this image!', 'wp-photo-album-plus').'"' .
935
  ' src="'.wppa_get_imgdir().'thumbdown.png"' .
@@ -938,11 +989,17 @@ global $wpdb;
938
  ' class="no-shadow"' .
939
  ' onmouseover="jQuery(this).stop().fadeTo(100, 1.0)"' .
940
  ' onmouseout="jQuery(this).stop().fadeTo(100, wppaStarOpacity)"' .
941
- ' onclick="if (confirm(\'' .
942
- __('Are you sure you want to mark this image as inappropriate?', 'wp-photo-album-plus') .
943
- '\')) wppa'.$ovl.'RateIt('.wppa( 'mocc' ).', -1)"' .
944
- ' />' .
945
- '</div>';
 
 
 
 
 
 
946
 
947
  if ( wppa_switch( 'dislike_show_count') ) {
948
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the slideshow high level functions
6
+ * Version 6.5.05
7
  *
8
  */
9
 
703
 
704
  function wppa_slide_rating_range( $opt ) {
705
 
706
+ // On a slide: depending on slide visibility settings
707
+ if ( $opt == 'optional' && ! wppa_switch( 'rating_on' ) ) {
708
+ return '';
709
+ }
710
+
711
+ // Not on a slideonly
712
+ if ( wppa( 'is_slideonly' ) ) {
713
+ return '';
714
+ }
715
+
716
+ $result = wppa_get_rating_range_html();
717
  wppa_out( $result );
718
  }
719
 
720
+ function wppa_get_rating_range_html( $id = 0, $is_lightbox = false, $class = '' ) {
721
  global $wpdb;
722
 
723
+ // Not on a feed
724
+ if ( is_feed() ) return '';
725
+
726
+ // On lightbox: only if in visibility settings set.
727
  if ( $is_lightbox ) {
728
  if ( ! wppa_switch( 'ovl_rating' ) ) {
729
  return '';
730
  }
731
+ }
732
+
733
+ if ( $id ) {
734
  $wait_text = wppa_get_rating_wait_text( $id, wppa_get_user() );
735
  if ( $wait_text ) {
736
+ return '<span class="'.$class.'" style="color:red" >'.$wait_text.'</span>';
737
  }
738
  if ( wppa_get_photo_item( $id, 'owner' ) == wppa_get_user() && ! wppa_switch( 'allow_owner_votes' ) ) {
739
+ return '<span class="'.$class.'" >' . __( 'Sorry, you can not rate your own photos' , 'wp-photo-album-plus') . '</span>';
740
  }
741
  $mylast = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM `'.WPPA_RATING.'` WHERE `photo` = %s AND `user` = %s ORDER BY `id` DESC LIMIT 1', $id, wppa_get_user() ), ARRAY_A );
742
  if ( $mylast && ! wppa_switch( 'rating_change' ) && ! wppa_switch( 'rating_multi' ) ) {
743
+ return '<span class="'.$class.'" >' . __( 'Sorry, you can rate a photo only once', 'wp-photo-album-plus' ) . '</span>';
744
  }
 
 
 
 
 
 
745
  }
746
+
747
+ // Mphoto, xphoto and lightbox use a different js function than slideshow.
748
+ // In slideshow the id is not known and retrieved from _wppaCurIdx[mocc].
749
+ // There is also a difference in css.
750
+ $idorlb = $id || $is_lightbox;
751
+
752
+ // If on xphoto, reload after
753
+ $reload = ( wppa( 'is_xphoto' ) ? 'true' : 'false' );
754
 
755
  $result = '';
756
 
762
  // Open the rating box
763
  $result .= '<div' .
764
  ' id="wppa-rating-'.wppa( 'mocc' ).'"' .
765
+ ' class="' . ( $idorlb ? $class : 'wppa-box wppa-nav wppa-nav-text' ) . '"' .
766
  ' style="' .
767
+ ( $idorlb ? 'padding:4px;' : __wcs( 'wppa-box' ) . __wcs( 'wppa-nav' ) . __wcs( 'wppa-nav-text' ) ) .
768
  $size .
769
  ' text-align:center;"' .
770
  '> ';
786
  // Display avg rating
787
  if ( wppa_switch( 'show_avg_rating' ) ) {
788
 
789
+ if ( $id ) {
790
  $avgrat = wppa_get_rating_by_id( $id, 'nolabel' );
791
  $opac = array();
792
  $i = '1';
803
  $i++;
804
  }
805
  }
806
+ $result .= '<span'.
807
+ ' id="wppa-avg-rat-' . wppa( 'mocc' ) . '"' .
808
+ ' class="wppa-rating-label"' .
809
+ ' >' .
810
  __( 'Average&nbsp;rating', 'wp-photo-album-plus' ) .
811
  '</span>&nbsp;';
812
 
814
  while ( $i <= wppa_opt( 'rating_max' ) ) {
815
  $result .= '<img' .
816
  ' id="wppa-avg-' . wppa( 'mocc' ) . '-' . $i . '"' .
817
+ ' class="wppa-avg-' . wppa( 'mocc' ) . '-' . $i . ' wppa-avg-'.wppa( 'mocc' ).' no-shadow"' .
818
  ' style="' .
819
  $style .
820
+ ( $id ? $opac[$i] : '' ) .
821
  '"' .
822
  ' src="' . wppa_get_imgdir() . $icon . '"' .
823
  ' alt=" ' . $i . '"' .
843
  if ( $pad < 5 ) $pad = '5';
844
  if ( wppa_opt( 'dislike_mail_every' ) ) {
845
 
846
+ $confirm = esc_attr( str_replace( '"', "'", __('Are you sure you want to mark this image as inappropriate?', 'wp-photo-album-plus') ) );
847
  $result .= '<img' .
848
  ' id="wppa-dislike-'.wppa( 'mocc' ).'"' .
849
  ' title="'.__('Click this if you do NOT like this image!', 'wp-photo-album-plus').'"' .
853
  ' class="no-shadow"' .
854
  ' onmouseover="jQuery(this).stop().fadeTo(100, 1.0)"' .
855
  ' onmouseout="jQuery(this).stop().fadeTo(100, wppaStarOpacity)"' .
856
+ ' onclick="';
857
+ if ( $idorlb ) {
858
+ $result .= 'if (confirm(\'' . $confirm . '\')) { wppaOvlRateIt( \'' . wppa_encrypt_photo($id) . '\', -1, ' . ( $id ? wppa('mocc') : '0' ) . ' ); }';
859
+ }
860
+ else {
861
+ $result .= 'if (confirm(\'' . $confirm . '\')) { wppaRateIt( ' . wppa( 'mocc' ) . ', -1); }';
862
+ }
863
+ $result .= '"' .
864
  ' />';
865
 
866
+ if ( $idorlb ) {
867
+ $mylast = wppa_get_my_last_vote( $id );
868
+
869
+ if ( $mylast == '-1' ) {
870
+ $result .= '<script type="text/javascript" >jQuery(\'#wppa-dislike-'.wppa( 'mocc' ).'\').css(\'display\'. \'none\');</script>';
871
+ }
872
+ else {
873
+ $result .= '<script type="text/javascript" >jQuery(\'#wppa-dislike-'.wppa( 'mocc' ).'\').fadeTo(100,'.(wppa_opt('star_opacity')/100).');</script>';
874
+ }
875
+ }
876
+
877
  if ( wppa_switch( 'dislike_show_count' ) ) {
878
  $result .= '<span' .
879
  ' id="wppa-discount-' . wppa( 'mocc' ) . '"' .
890
  }
891
 
892
  // Display the my rating stars
893
+ if ( $id ) {
894
  $myavgrat = wppa_get_my_rating_by_id( $id, 'nolabel' );
895
  $opac = array();
896
  $i = '1';
911
  $i = '1';
912
  while ( $i <= wppa_opt( 'rating_max' ) ) {
913
  $result .= '<img' .
914
+ ' id="wppa-rate-' . wppa( 'mocc' ) . '-' . $i . '"' .
915
+ ' class="wppa-rate-' . wppa( 'mocc' ) . '-' . $i . ' wppa-rate-'.wppa( 'mocc' ).' no-shadow"' .
916
  ' style="' .
917
  $style .
918
+ ( $id ? $opac[$i] : '' ) .
919
  '"' .
920
  ' src="'.wppa_get_imgdir().$icon.'"' .
921
  ' alt="'.$i.'"' .
922
  ' title="'.__('My&nbsp;rating', 'wp-photo-album-plus').': '.$r[$i].'"' .
923
+
924
+ // Follow and leave are different for slideshw and lightbox et al
925
+ ( $id ?
926
+ ' onmouseover="wppaOvlFollowMe('.wppa( 'mocc' ).', '.$i.', '.$myavgrat.' )"' .
927
+ ' onmouseout="wppaOvlLeaveMe('.wppa( 'mocc' ).', '.$i.', '.$myavgrat.' )"' :
928
  ' onmouseover="wppaFollowMe('.wppa( 'mocc' ).', '.$i.')"' .
929
+ ' onmouseout="wppaLeaveMe('.wppa( 'mocc' ).', '.$i.')"' ) .
930
+
931
+ ( $idorlb ? ' onclick="wppaOvlRateIt(\''.wppa_encrypt_photo($id).'\', '.$i.', ' . ( $id ? wppa('mocc') : '0' ) . ', ' . $reload . ' )"' :
932
  ' onclick="wppaRateIt('.wppa( 'mocc' ).', '.$i.')"' ) .
933
  ' />';
934
  $i++;
936
 
937
  // Text right if avg rating diaplayed
938
  if ( wppa_switch( 'show_avg_rating' ) ) {
939
+ $result .= '&nbsp;' .
940
+ '<span' .
941
+ ' id="wppa-my-rat-'.wppa( 'mocc' ).'" ' .
942
+ ' class="wppa-rating-label"' .
943
+ '>' .
944
+ __('My&nbsp;rating', 'wp-photo-album-plus') .
945
+ '</span>';
946
  }
947
  }
948
  else {
977
  $result .= '<div' .
978
  ' id="wppa-dislike-imgdiv-'.wppa( 'mocc' ).'"' .
979
  ' style="display:inline"' .
980
+ ' >';
981
+
982
+ $confirm = esc_attr( str_replace( '"', "'", __('Are you sure you want to mark this image as inappropriate?', 'wp-photo-album-plus') ) );
983
+ $result .= '<img' .
984
  ' id="wppa-dislike-'.wppa( 'mocc' ).'"' .
985
  ' title="'.__('Click this if you do NOT like this image!', 'wp-photo-album-plus').'"' .
986
  ' src="'.wppa_get_imgdir().'thumbdown.png"' .
989
  ' class="no-shadow"' .
990
  ' onmouseover="jQuery(this).stop().fadeTo(100, 1.0)"' .
991
  ' onmouseout="jQuery(this).stop().fadeTo(100, wppaStarOpacity)"' .
992
+ ' onclick="';
993
+ if ( $idorlb ) {
994
+ $result .= 'if (confirm(\'' . $confirm . '\')) { wppaOvlRateIt( \'' . wppa_encrypt_photo($id) . '\', -1, ' . ( $id ? wppa('mocc') : '0' ) . ' ); }';
995
+ }
996
+ else {
997
+ $result .= 'if (confirm(\'' . $confirm . '\')) { wppaRateIt( ' . wppa( 'mocc' ) . ', -1); }';
998
+ }
999
+ $result .= '"' .
1000
+ ' />';
1001
+
1002
+ $result .= '</div>';
1003
 
1004
  if ( wppa_switch( 'dislike_show_count') ) {
1005
 
wppa-tinymce-shortcodes.php CHANGED
@@ -3,7 +3,7 @@
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  *
6
- * Version 6.5.02
7
  *
8
  */
9
 
@@ -173,6 +173,7 @@ global $wpdb;
173
  '<option value="" selected="selected" disabled="disabled" style="color:#700" >-- '.__('Please select a single image type', 'wp-photo-album-plus').' --</option>'.
174
  '<option value="photo" style="color:#070" >'.__('A plain single photo', 'wp-photo-album-plus').'</option>'.
175
  '<option value="mphoto" style="color:#070" >'.__('A single photo with caption', 'wp-photo-album-plus').'</option>'.
 
176
  '<option value="slphoto" style="color:#070" >'.__('A single photo in the style of a slideshow', 'wp-photo-album-plus').'</option>'.
177
  '</select>'.
178
  '</td>'.
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  *
6
+ * Version 6.5.05
7
  *
8
  */
9
 
173
  '<option value="" selected="selected" disabled="disabled" style="color:#700" >-- '.__('Please select a single image type', 'wp-photo-album-plus').' --</option>'.
174
  '<option value="photo" style="color:#070" >'.__('A plain single photo', 'wp-photo-album-plus').'</option>'.
175
  '<option value="mphoto" style="color:#070" >'.__('A single photo with caption', 'wp-photo-album-plus').'</option>'.
176
+ '<option value="xphoto" style="color:#070" >'.__('A single photo with extended caption', 'wp-photo-album-plus').'</option>'.
177
  '<option value="slphoto" style="color:#070" >'.__('A single photo in the style of a slideshow', 'wp-photo-album-plus').'</option>'.
178
  '</select>'.
179
  '</td>'.
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 6.5.04
7
  *
8
  */
9
 
@@ -316,7 +316,7 @@ global $wpdb;
316
  $rating /= count( $my_ratings );
317
  }
318
  else {
319
- $rating = '';
320
  }
321
  if ( $rating ) {
322
  $i = wppa_opt( 'rating_prec' );
@@ -325,7 +325,7 @@ global $wpdb;
325
  if ($opt == 'nolabel') $result = $val;
326
  else $result = sprintf(__('Rating: %s', 'wp-photo-album-plus'), $val);
327
  }
328
- else $result = '';
329
  return $result;
330
  }
331
 
@@ -1404,13 +1404,15 @@ function wppa_strip_tags($text, $key = '') {
1404
  // set last album
1405
  function wppa_set_last_album( $id = '' ) {
1406
 
1407
- update_option( 'wppa_last_album_used-' . wppa_get_user( 'login' ), $albumid );
 
 
1408
  }
1409
 
1410
  // get last album
1411
  function wppa_get_last_album() {
1412
 
1413
- return get_option( 'wppa_last_album_used-' . wppa_get_user( 'login' ) );
1414
  }
1415
 
1416
  // Combine margin or padding style
@@ -3311,3 +3313,18 @@ static $usercache;
3311
  return false;
3312
  }
3313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 6.5.05
7
  *
8
  */
9
 
316
  $rating /= count( $my_ratings );
317
  }
318
  else {
319
+ $rating = '0';
320
  }
321
  if ( $rating ) {
322
  $i = wppa_opt( 'rating_prec' );
325
  if ($opt == 'nolabel') $result = $val;
326
  else $result = sprintf(__('Rating: %s', 'wp-photo-album-plus'), $val);
327
  }
328
+ else $result = '0';
329
  return $result;
330
  }
331
 
1404
  // set last album
1405
  function wppa_set_last_album( $id = '' ) {
1406
 
1407
+ if ( wppa_is_int( $id ) ) {
1408
+ update_option( 'wppa_last_album_used-' . wppa_get_user( 'login' ), $id );
1409
+ }
1410
  }
1411
 
1412
  // get last album
1413
  function wppa_get_last_album() {
1414
 
1415
+ return get_option( 'wppa_last_album_used-' . wppa_get_user( 'login' ), '0' );
1416
  }
1417
 
1418
  // Combine margin or padding style
3313
  return false;
3314
  }
3315
 
3316
+ // Get my last vote for a certain photo
3317
+ function wppa_get_my_last_vote( $id ) {
3318
+ global $wpdb;
3319
+
3320
+ $result = $wpdb->get_var( $wpdb->prepare( "SELECT `value` FROM `" . WPPA_RATING . "` " .
3321
+ "WHERE `photo` = %s " .
3322
+ "AND `user` = %s " .
3323
+ "ORDER BY `id` DESC " .
3324
+ "LIMIT 1 ",
3325
+ $id,
3326
+ wppa_get_user()
3327
+ )
3328
+ );
3329
+ return $result;
3330
+ }
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.5.04
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 = '6504'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '6-5-04-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.5.05
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 = '6505'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '6-5-05-007'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime(true);