WP Photo Album Plus - Version 6.6.05

Version Description

Download this release

Release Info

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

Code changes from version 6.6.04 to 6.6.05

img/thumbup.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.6.00';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
@@ -582,7 +582,7 @@ function wppaVoteThumb( mocc, photo ) {
582
 
583
  // Rate a photo
584
  function _wppaRateIt( mocc, value ) {
585
-
586
  // No value, no vote
587
  if ( value == 0 ) return;
588
 
@@ -601,7 +601,10 @@ function _wppaRateIt( mocc, value ) {
601
  }
602
 
603
  // Already rated, and once allowed only?
604
- if ( oldval != 0 && wppaRatingOnce ) return;
 
 
 
605
 
606
  // Disliked aleady?
607
  if ( oldval < 0 ) return;
@@ -628,9 +631,12 @@ function _wppaRateIt( mocc, value ) {
628
 
629
  // Fade in fully
630
  jQuery( '#wppa-rate-'+mocc+'-'+value ).stop().fadeTo( 100, 1.0 );
 
 
 
631
  },
632
  success: function( result, status, xhr ) {
633
-
634
  var ArrValues = result.split( "||" );
635
 
636
  // Error from rating algorithm?
@@ -647,18 +653,39 @@ function _wppaRateIt( mocc, value ) {
647
  // No rating error
648
  else {
649
 
650
- // Store new values
651
- _wppaMyr[ArrValues[0]][ArrValues[2]] = ArrValues[3];
652
- _wppaAvg[ArrValues[0]][ArrValues[2]] = ArrValues[4];
653
- _wppaDisc[ArrValues[0]][ArrValues[2]] = ArrValues[5];
654
 
655
- // Update display
656
- _wppaSetRatingDisplay( mocc );
 
 
 
 
 
 
 
 
 
 
 
657
 
658
- // If commenting required and not done so far...
659
- if ( wppaCommentRequiredAfterVote ) {
660
- if ( ArrValues[6] == 0 ) {
661
- alert( ArrValues[7] );
 
 
 
 
 
 
 
 
 
 
 
662
  }
663
  }
664
 
@@ -696,8 +723,14 @@ function _wppaOvlRateIt( id, value, mocc, reloadAfter ) {
696
 
697
  // Fade in fully
698
  jQuery( '.wppa-rate-'+mocc+'-'+value ).stop().fadeTo( 100, 1.0 );
 
 
 
 
699
  },
700
  success: function( result, status, xhr ) {
 
 
701
 
702
  var ArrValues = result.split( "||" );
703
 
@@ -717,6 +750,33 @@ function _wppaOvlRateIt( id, value, mocc, reloadAfter ) {
717
  // No rating error
718
  else {
719
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  // result = $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.$allavgratcombi.'||'.$distext.'||'.$hascommented.'||'.$message;
721
  // ArrValues[3] = my avg rating
722
  // ArrValues[4] = all avg rating
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsAjaxVersion = '6.6.05';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
582
 
583
  // Rate a photo
584
  function _wppaRateIt( mocc, value ) {
585
+ //alert('_wppaRateIt() called with args:'+mocc+' '+value);
586
  // No value, no vote
587
  if ( value == 0 ) return;
588
 
601
  }
602
 
603
  // Already rated, and once allowed only?
604
+ if ( oldval != 0 && wppaRatingOnce ) {
605
+ // alert('exit 2');
606
+ return;
607
+ }
608
 
609
  // Disliked aleady?
610
  if ( oldval < 0 ) return;
631
 
632
  // Fade in fully
633
  jQuery( '#wppa-rate-'+mocc+'-'+value ).stop().fadeTo( 100, 1.0 );
634
+
635
+ // Likes
636
+ jQuery( '#wppa-like-'+mocc ).attr( 'src', wppaImageDirectory+'spinner.gif' );
637
  },
638
  success: function( result, status, xhr ) {
639
+ //alert('_wppaRateIt() result='+result);
640
  var ArrValues = result.split( "||" );
641
 
642
  // Error from rating algorithm?
653
  // No rating error
654
  else {
655
 
656
+ // Is it likes sytem?
657
+ if ( ArrValues[7] && ArrValues[7] == 'likes' ) {
658
+ var likeText = ArrValues[4].split( "|" );
 
659
 
660
+ // Slide
661
+ jQuery( '#wppa-like-'+mocc ).attr( 'title', likeText[0] );
662
+ jQuery( '#wppa-liketext-'+mocc ).html( likeText[1] );
663
+ if ( ArrValues[3] == '1' ) {
664
+ jQuery( '#wppa-like-'+mocc ).attr( 'src', wppaImageDirectory+'thumbdown.png' );
665
+ }
666
+ else { // == '0'
667
+ jQuery( '#wppa-like-'+mocc ).attr( 'src', wppaImageDirectory+'thumbup.png' );
668
+ }
669
+ //alert('arv3='+ArrValues[3]);
670
+ _wppaMyr[ArrValues[0]][ArrValues[2]] = ArrValues[3];
671
+ _wppaAvg[ArrValues[0]][ArrValues[2]] = ArrValues[4];
672
+ }
673
 
674
+ // Not likes system
675
+ else {
676
+ // Store new values
677
+ _wppaMyr[ArrValues[0]][ArrValues[2]] = ArrValues[3];
678
+ _wppaAvg[ArrValues[0]][ArrValues[2]] = ArrValues[4];
679
+ _wppaDisc[ArrValues[0]][ArrValues[2]] = ArrValues[5];
680
+
681
+ // Update display
682
+ _wppaSetRatingDisplay( mocc );
683
+
684
+ // If commenting required and not done so far...
685
+ if ( wppaCommentRequiredAfterVote ) {
686
+ if ( ArrValues[6] == 0 ) {
687
+ alert( ArrValues[7] );
688
+ }
689
  }
690
  }
691
 
723
 
724
  // Fade in fully
725
  jQuery( '.wppa-rate-'+mocc+'-'+value ).stop().fadeTo( 100, 1.0 );
726
+
727
+ // Likes
728
+ jQuery( '#wppa-like-'+id+'-'+mocc ).attr( 'src', wppaImageDirectory+'spinner.gif' );
729
+ jQuery( '#wppa-like-0' ).attr( 'src', wppaImageDirectory+'spinner.gif' );
730
  },
731
  success: function( result, status, xhr ) {
732
+ // alert(result);
733
+ wppaConsoleLog(result, 'force');
734
 
735
  var ArrValues = result.split( "||" );
736
 
750
  // No rating error
751
  else {
752
 
753
+ // Is it likes sytem?
754
+ if ( ArrValues[7] && ArrValues[7] == 'likes' ) {
755
+ var likeText = ArrValues[4].split( "|" );
756
+
757
+ // Lightbox
758
+ jQuery( '#wppa-like-0' ).attr( 'title', likeText[0] );
759
+ jQuery( '#wppa-liketext-0' ).html( likeText[1] );
760
+ if ( ArrValues[3] == '1' ) {
761
+ jQuery( '#wppa-like-0' ).attr( 'src', wppaImageDirectory+'thumbdown.png' );
762
+ }
763
+ else { // == '0'
764
+ jQuery( '#wppa-like-0' ).attr( 'src', wppaImageDirectory+'thumbup.png' );
765
+ }
766
+
767
+ // Thumbnail
768
+ jQuery( '#wppa-like-'+id+'-'+mocc ).attr( 'title', likeText[0] );
769
+ jQuery( '#wppa-liketext-'+id+'-'+mocc ).html( likeText[1] );
770
+ if ( ArrValues[3] == '1' ) {
771
+ jQuery( '#wppa-like-'+id+'-'+mocc ).attr( 'src', wppaImageDirectory+'thumbdown.png' );
772
+ }
773
+ else { // == '0'
774
+ jQuery( '#wppa-like-'+id+'-'+mocc ).attr( 'src', wppaImageDirectory+'thumbup.png' );
775
+ }
776
+
777
+ return;
778
+ }
779
+
780
  // result = $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.$allavgratcombi.'||'.$distext.'||'.$hascommented.'||'.$message;
781
  // ArrValues[3] = my avg rating
782
  // ArrValues[4] = all avg rating
js/wppa-ajax-front.min.js CHANGED
@@ -4,7 +4,7 @@
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
- var wppaJsAjaxVersion='6.6.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{if(wppaRenderModal){var opt={modal:true,resizable:true,width:wppaGetContainerWidth(mocc),show:{effect:"fadeIn",duration:400},closeText:"",};jQuery('#wppa-modal-container-'+mocc).html(result).dialog(opt).dialog("open");jQuery('.ui-dialog').css({boxShadow:'0px 0px 5px 5px #aaaaaa',borderRadius:wppaBoxRadius+'px',padding:'8px',backgroundColor:wppaModalBgColor,boxSizing:'content-box',zIndex:100000,});jQuery('.ui-dialog-titlebar').css({lineHeight:'0px',height:'32px',});jQuery('.ui-button').css({backgroundImage:wppaModalQuitImg,padding:0,position:'absolute',right:'8px',top:'8px',width:'16px',height:'16px',});jQuery('.ui-button').attr('title','Close');jQuery('.ui-button').on('click',function(){_wppaStop(mocc);});}
10
  else{jQuery('#wppa-container-'+mocc).html(result);}}
@@ -41,14 +41,23 @@ return false;}
41
  function _bumpViewCount(photo){if(!wppaBumpViewCount)return;if(wppaPhotoView[photo])return;jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=bumpviewcount'+'&wppa-photo='+photo+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:60000,success:function(result,status,xhr){wppaPhotoView[photo]=true;},error:function(xhr,status,error){wppaConsoleLog('_bumpViewCount failed. Error = '+error+', status = '+status,'force');},});}
42
  function wppaVoteThumb(mocc,photo){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=rate'+'&wppa-rating=1'+'&wppa-rating-id='+photo+'&wppa-occur='+mocc+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:60000,success:function(result,status,xhr){jQuery('#wppa-vote-button-'+mocc+'-'+photo).val(wppaVotedForMe);},error:function(xhr,status,error){wppaConsoleLog('wppaVoteThumb failed. Error = '+error+', status = '+status,'force');},});}
43
  function _wppaRateIt(mocc,value){if(value==0)return;if(_wppaSSRuns[mocc])return;var photo=_wppaId[mocc][_wppaCurIdx[mocc]];var oldval=_wppaMyr[mocc][_wppaCurIdx[mocc]];var waittext=_wppaWaitTexts[mocc][_wppaCurIdx[mocc]];if(waittext.length>0){alert(waittext);return;}
44
- if(oldval!=0&&wppaRatingOnce)return;if(oldval<0)return;_wppaVoteInProgress=true;jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=rate'+'&wppa-rating='+value+'&wppa-rating-id='+photo+'&wppa-occur='+mocc+'&wppa-index='+_wppaCurIdx[mocc]+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:60000,beforeSend:function(xhr){jQuery('#wppa-rate-'+mocc+'-'+value).attr('src',wppaImageDirectory+'tick.png');jQuery('#wppa-rate-'+mocc+'-'+value).stop().fadeTo(100,1.0);},success:function(result,status,xhr){var ArrValues=result.split("||");if(ArrValues[0]==0){if(ArrValues[1]==900){alert(ArrValues[2]);_wppaSetRatingDisplay(mocc);}
 
45
  else{alert('Error Code='+ArrValues[1]+'\n\n'+ArrValues[2]);}}
46
- 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]);}}
 
 
 
47
  if(wppaNextOnCallback)_wppaNextOnCallback(mocc);}},error:function(xhr,status,error){wppaConsoleLog('_wppaRateIt failed. Error = '+error+', status = '+status,'force');},});}
48
- 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]);}
49
  else{alert('Error Code='+ArrValues[1]+'\n\n'+ArrValues[2]);}
50
  jQuery('.wppa-rate-'+mocc+'-'+value).attr('src',wppaImageDirectory+'cross.png');}
51
- else{_wppaSetRd(mocc,ArrValues[4],'.wppa-avg-');_wppaSetRd(mocc,ArrValues[3],'.wppa-rate-');if(reloadAfter){return;}
 
 
 
 
 
52
  if(wppaNextOnCallback)wppaOvlShowNext();}},error:function(xhr,status,error){wppaConsoleLog('_wppaOvlRateIt failed. Error = '+error+', status = '+status,'force');},});}
53
  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];}
54
  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){}});}
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
+ var wppaJsAjaxVersion='6.6.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{if(wppaRenderModal){var opt={modal:true,resizable:true,width:wppaGetContainerWidth(mocc),show:{effect:"fadeIn",duration:400},closeText:"",};jQuery('#wppa-modal-container-'+mocc).html(result).dialog(opt).dialog("open");jQuery('.ui-dialog').css({boxShadow:'0px 0px 5px 5px #aaaaaa',borderRadius:wppaBoxRadius+'px',padding:'8px',backgroundColor:wppaModalBgColor,boxSizing:'content-box',zIndex:100000,});jQuery('.ui-dialog-titlebar').css({lineHeight:'0px',height:'32px',});jQuery('.ui-button').css({backgroundImage:wppaModalQuitImg,padding:0,position:'absolute',right:'8px',top:'8px',width:'16px',height:'16px',});jQuery('.ui-button').attr('title','Close');jQuery('.ui-button').on('click',function(){_wppaStop(mocc);});}
10
  else{jQuery('#wppa-container-'+mocc).html(result);}}
41
  function _bumpViewCount(photo){if(!wppaBumpViewCount)return;if(wppaPhotoView[photo])return;jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=bumpviewcount'+'&wppa-photo='+photo+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:60000,success:function(result,status,xhr){wppaPhotoView[photo]=true;},error:function(xhr,status,error){wppaConsoleLog('_bumpViewCount failed. Error = '+error+', status = '+status,'force');},});}
42
  function wppaVoteThumb(mocc,photo){jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=rate'+'&wppa-rating=1'+'&wppa-rating-id='+photo+'&wppa-occur='+mocc+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:60000,success:function(result,status,xhr){jQuery('#wppa-vote-button-'+mocc+'-'+photo).val(wppaVotedForMe);},error:function(xhr,status,error){wppaConsoleLog('wppaVoteThumb failed. Error = '+error+', status = '+status,'force');},});}
43
  function _wppaRateIt(mocc,value){if(value==0)return;if(_wppaSSRuns[mocc])return;var photo=_wppaId[mocc][_wppaCurIdx[mocc]];var oldval=_wppaMyr[mocc][_wppaCurIdx[mocc]];var waittext=_wppaWaitTexts[mocc][_wppaCurIdx[mocc]];if(waittext.length>0){alert(waittext);return;}
44
+ if(oldval!=0&&wppaRatingOnce){return;}
45
+ if(oldval<0)return;_wppaVoteInProgress=true;jQuery.ajax({url:wppaAjaxUrl,data:'action=wppa'+'&wppa-action=rate'+'&wppa-rating='+value+'&wppa-rating-id='+photo+'&wppa-occur='+mocc+'&wppa-index='+_wppaCurIdx[mocc]+'&wppa-nonce='+jQuery('#wppa-nonce').val(),async:true,type:'GET',timeout:60000,beforeSend:function(xhr){jQuery('#wppa-rate-'+mocc+'-'+value).attr('src',wppaImageDirectory+'tick.png');jQuery('#wppa-rate-'+mocc+'-'+value).stop().fadeTo(100,1.0);jQuery('#wppa-like-'+mocc).attr('src',wppaImageDirectory+'spinner.gif');},success:function(result,status,xhr){var ArrValues=result.split("||");if(ArrValues[0]==0){if(ArrValues[1]==900){alert(ArrValues[2]);_wppaSetRatingDisplay(mocc);}
46
  else{alert('Error Code='+ArrValues[1]+'\n\n'+ArrValues[2]);}}
47
+ else{if(ArrValues[7]&&ArrValues[7]=='likes'){var likeText=ArrValues[4].split("|");jQuery('#wppa-like-'+mocc).attr('title',likeText[0]);jQuery('#wppa-liketext-'+mocc).html(likeText[1]);if(ArrValues[3]=='1'){jQuery('#wppa-like-'+mocc).attr('src',wppaImageDirectory+'thumbdown.png');}
48
+ else{jQuery('#wppa-like-'+mocc).attr('src',wppaImageDirectory+'thumbup.png');}
49
+ _wppaMyr[ArrValues[0]][ArrValues[2]]=ArrValues[3];_wppaAvg[ArrValues[0]][ArrValues[2]]=ArrValues[4];}
50
+ 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]);}}}
51
  if(wppaNextOnCallback)_wppaNextOnCallback(mocc);}},error:function(xhr,status,error){wppaConsoleLog('_wppaRateIt failed. Error = '+error+', status = '+status,'force');},});}
52
+ 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);jQuery('#wppa-like-'+id+'-'+mocc).attr('src',wppaImageDirectory+'spinner.gif');jQuery('#wppa-like-0').attr('src',wppaImageDirectory+'spinner.gif');},success:function(result,status,xhr){wppaConsoleLog(result,'force');var ArrValues=result.split("||");if(ArrValues[0]==0){if(ArrValues[1]==900){alert(ArrValues[2]);}
53
  else{alert('Error Code='+ArrValues[1]+'\n\n'+ArrValues[2]);}
54
  jQuery('.wppa-rate-'+mocc+'-'+value).attr('src',wppaImageDirectory+'cross.png');}
55
+ else{if(ArrValues[7]&&ArrValues[7]=='likes'){var likeText=ArrValues[4].split("|");jQuery('#wppa-like-0').attr('title',likeText[0]);jQuery('#wppa-liketext-0').html(likeText[1]);if(ArrValues[3]=='1'){jQuery('#wppa-like-0').attr('src',wppaImageDirectory+'thumbdown.png');}
56
+ else{jQuery('#wppa-like-0').attr('src',wppaImageDirectory+'thumbup.png');}
57
+ jQuery('#wppa-like-'+id+'-'+mocc).attr('title',likeText[0]);jQuery('#wppa-liketext-'+id+'-'+mocc).html(likeText[1]);if(ArrValues[3]=='1'){jQuery('#wppa-like-'+id+'-'+mocc).attr('src',wppaImageDirectory+'thumbdown.png');}
58
+ else{jQuery('#wppa-like-'+id+'-'+mocc).attr('src',wppaImageDirectory+'thumbup.png');}
59
+ return;}
60
+ _wppaSetRd(mocc,ArrValues[4],'.wppa-avg-');_wppaSetRd(mocc,ArrValues[3],'.wppa-rate-');if(reloadAfter){return;}
61
  if(wppaNextOnCallback)wppaOvlShowNext();}},error:function(xhr,status,error){wppaConsoleLog('_wppaOvlRateIt failed. Error = '+error+', status = '+status,'force');},});}
62
  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];}
63
  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){}});}
js/wppa-slideshow.js CHANGED
@@ -3,7 +3,7 @@
3
  // Contains slideshow modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
- var wppaJsSlideshowVersion = '6.6.01';
7
 
8
  // This is an entrypoint to load the slide data
9
  function wppaStoreSlideInfo(
@@ -142,8 +142,11 @@ function wppaStoreSlideInfo(
142
  _wppaOgDsc[mocc][id] = ogdsc;
143
  _wppaId[mocc][id] = photoid; // reqd for rating and comment and monkey and registering views
144
  _wppaAvg[mocc][id] = avgrat; // avg ratig value
 
145
  _wppaDisc[mocc][id] = discount; // Dislike count
 
146
  _wppaMyr[mocc][id] = myrat; // my rating
 
147
  _wppaVRU[mocc][id] = rateurl; // url that performs the vote and returns to the page
148
  _wppaLinkUrl[mocc][id] = linkurl;
149
  _wppaLinkTitle[mocc][id] = linktitle;
@@ -1487,12 +1490,32 @@ function _wppaCheckRewind( mocc ) {
1487
  }
1488
 
1489
  function _wppaSetRatingDisplay( mocc ) {
 
 
1490
 
1491
  var idx, avg, tmp, cnt, dsc, myr, dsctxt;
1492
  if ( ! document.getElementById( 'wppa-rating-'+mocc ) ) return; // No rating bar
1493
 
1494
  avg = _wppaAvg[mocc][_wppaCurIdx[mocc]];
1495
- if ( typeof( avg ) == 'undefined' ) return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1496
  tmp = avg.split( '|' );
1497
  avg = tmp[0];
1498
  cnt = tmp[1];
@@ -1604,6 +1627,7 @@ function wppaGetDislikeText( dsc,myr,incmine ) {
1604
 
1605
  function _wppaSetRd( mocc, avg, where ) {
1606
 
 
1607
  var idx1 = parseInt( avg );
1608
  var idx2 = idx1 + 1;
1609
  var frac = avg - idx1;
3
  // Contains slideshow modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsSlideshowVersion = '6.6.05';
7
 
8
  // This is an entrypoint to load the slide data
9
  function wppaStoreSlideInfo(
142
  _wppaOgDsc[mocc][id] = ogdsc;
143
  _wppaId[mocc][id] = photoid; // reqd for rating and comment and monkey and registering views
144
  _wppaAvg[mocc][id] = avgrat; // avg ratig value
145
+ wppaConsoleLog( '_wppaAvg[mocc][id]='+_wppaAvg[mocc][id], 'force' );
146
  _wppaDisc[mocc][id] = discount; // Dislike count
147
+ wppaConsoleLog( 'discount='+discount, 'force' );
148
  _wppaMyr[mocc][id] = myrat; // my rating
149
+ wppaConsoleLog( 'myrat='+myrat, 'force' );
150
  _wppaVRU[mocc][id] = rateurl; // url that performs the vote and returns to the page
151
  _wppaLinkUrl[mocc][id] = linkurl;
152
  _wppaLinkTitle[mocc][id] = linktitle;
1490
  }
1491
 
1492
  function _wppaSetRatingDisplay( mocc ) {
1493
+ wppaConsoleLog( '_wppaSetRatingDisplay() called with arg '+mocc, 'force');
1494
+ wppaConsoleLog( '_wppaAvg[mocc][_wppaCurIdx[mocc]]='+_wppaAvg[mocc][_wppaCurIdx[mocc]]+' _wppaCurIdx[mocc]='+_wppaCurIdx[mocc], 'force');
1495
 
1496
  var idx, avg, tmp, cnt, dsc, myr, dsctxt;
1497
  if ( ! document.getElementById( 'wppa-rating-'+mocc ) ) return; // No rating bar
1498
 
1499
  avg = _wppaAvg[mocc][_wppaCurIdx[mocc]];
1500
+ if ( typeof( avg ) == 'undefined' ) return;
1501
+
1502
+ // Likes system
1503
+ if ( wppaRatingDisplayType == 'likes' ) {
1504
+
1505
+ var likeText = avg.split( "|" );
1506
+
1507
+ jQuery( '#wppa-like-'+mocc ).attr( 'title', likeText[0] );
1508
+ jQuery( '#wppa-liketext-'+mocc ).html( likeText[1] );
1509
+ if ( _wppaMyr[mocc][_wppaCurIdx[mocc]] == '1' ) {
1510
+ jQuery( '#wppa-like-'+mocc ).attr( 'src', wppaImageDirectory+'thumbdown.png' );
1511
+ }
1512
+ else { // == '0'
1513
+ jQuery( '#wppa-like-'+mocc ).attr( 'src', wppaImageDirectory+'thumbup.png' );
1514
+ }
1515
+ return;
1516
+ }
1517
+
1518
+ // Not likes system
1519
  tmp = avg.split( '|' );
1520
  avg = tmp[0];
1521
  cnt = tmp[1];
1627
 
1628
  function _wppaSetRd( mocc, avg, where ) {
1629
 
1630
+ //alert( '_wppaSetRd() called with args:'+mocc+' '+avg+' '+where );
1631
  var idx1 = parseInt( avg );
1632
  var idx2 = idx1 + 1;
1633
  var frac = avg - idx1;
js/wppa-slideshow.min.js CHANGED
@@ -4,7 +4,7 @@
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
- var wppaJsSlideshowVersion='6.6.01';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 ';}
@@ -13,7 +13,7 @@ else{_wppaSlides[mocc][id]=' src="'+url+'" alt="'+imagealt+'" class="theimg thei
13
  if(wppaSlideSwipe){_wppaSlides[mocc][id]+=' ontouchstart="wppaTouchStart( event, this.id, '+mocc+' );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );" ';}
14
  if(!wppaAutoColumnWidth[mocc])_wppaSlides[mocc][id]+='width="'+width+'" height="'+height+'" ';if(_wppaIsVideo[mocc][id]){var controls;controls='wppa'==wppaLightBox[mocc]?'':'controls';_wppaSlides[mocc][id]+='style="'+size+'; cursor:'+cursor+'; display:none;" '+controls+'>'+videohtml+'</video>';}
15
  else{_wppaSlides[mocc][id]+='style="'+size+'; cursor:'+cursor+'; display:none; vertical-align:middle;">';}
16
- _wppaFullNames[mocc][id]=fullname;_wppaNames[mocc][id]=name;_wppaDsc[mocc][id]=desc;_wppaOgDsc[mocc][id]=ogdsc;_wppaId[mocc][id]=photoid;_wppaAvg[mocc][id]=avgrat;_wppaDisc[mocc][id]=discount;_wppaMyr[mocc][id]=myrat;_wppaVRU[mocc][id]=rateurl;_wppaLinkUrl[mocc][id]=linkurl;_wppaLinkTitle[mocc][id]=linktitle;if(linktarget!=''){_wppaLinkTarget[mocc][id]=linktarget;}
17
  else if(wppaSlideBlank[mocc]){_wppaLinkTarget[mocc][id]='_blank';}
18
  else{_wppaLinkTarget[mocc][id]='_self';}
19
  _wppaCommentHtml[mocc][id]=commenthtml;_wppaIptcHtml[mocc][id]=iptchtml;_wppaExifHtml[mocc][id]=exifhtml;_wppaUrl[mocc][id]=url;_wppaLbTitle[mocc][id]=wppaRepairScriptTags(lbtitle);_wppaShareUrl[mocc][id]=shareurl;_wppaShareHtml[mocc][id]=wppaRepairScriptTags(smhtml);_wppaHiresUrl[mocc][id]=hiresurl;_wppaVideoHtml[mocc][id]=videohtml;_wppaAudioHtml[mocc][id]=audiohtml;_wppaVideoNatWidth[mocc][id]=width;_wppaVideoNatHeight[mocc][id]=height;_wppaWaitTexts[mocc][id]=waittext;_wppaImageAlt[mocc][id]=imagealt;}
@@ -157,7 +157,10 @@ function _wppaUnloadSpinner(mocc){jQuery('#spinner-'+mocc).html('');}
157
  function _wppaCheckRewind(mocc){var n_images;var n_diff;var l_substrate;var x_marg;if(!document.getElementById('wppa-filmstrip-'+mocc))return;n_diff=Math.abs(_wppaCurIdx[mocc]-_wppaNxtIdx[mocc]);if(n_diff<=wppaFilmPageSize[mocc])return;var n_images=wppaFilmStripLength[mocc]/wppaThumbnailPitch[mocc];if(n_diff>=((n_images+1)/2)){l_substrate=wppaThumbnailPitch[mocc]*_wppaSlides[mocc].length;if(wppaFilmShowGlue)l_substrate+=(2+2*wppaFilmStripMargin[mocc]);x_marg=parseInt(jQuery('#wppa-filmstrip-'+mocc).css('margin-left'));if(_wppaNxtIdx[mocc]>_wppaCurIdx[mocc]){x_marg-=l_substrate;}
158
  else{x_marg+=l_substrate;}
159
  jQuery('#wppa-filmstrip-'+mocc).css('margin-left',x_marg+'px');}}
160
- function _wppaSetRatingDisplay(mocc){var idx,avg,tmp,cnt,dsc,myr,dsctxt;if(!document.getElementById('wppa-rating-'+mocc))return;avg=_wppaAvg[mocc][_wppaCurIdx[mocc]];if(typeof(avg)=='undefined')return;tmp=avg.split('|');avg=tmp[0];cnt=tmp[1];dsc=_wppaDisc[mocc][_wppaCurIdx[mocc]];myr=_wppaMyr[mocc][_wppaCurIdx[mocc]];wppaConsoleLog('avg='+avg+' cnt='+cnt+' dsc='+dsc+' myr='+myr);if(wppaRatingDisplayType=='graphic'){_wppaSetRd(mocc,avg,'#wppa-avg-');_wppaSetRd(mocc,myr,'#wppa-rate-');if(myr==0){jQuery('#wppa-dislike-'+mocc).css('display','inline');jQuery('#wppa-dislike-imgdiv-'+mocc).css('display','inline');if(document.getElementById('wppa-dislike-'+mocc))jQuery('#wppa-filler-'+mocc).css('display','none');jQuery('#wppa-dislike-'+mocc).stop().fadeTo(100,wppaStarOpacity);}
 
 
 
161
  else{jQuery('#wppa-dislike-'+mocc).css('display','none');jQuery('#wppa-dislike-imgdiv-'+mocc).css('display','none');jQuery('#wppa-filler-'+mocc).css('display','inline');jQuery('#wppa-filler-'+mocc).stop().fadeTo(100,wppaStarOpacity);jQuery('#wppa-filler-'+mocc).attr('title',dsc);}}
162
  else{jQuery('#wppa-numrate-avg-'+mocc).html(avg+' ( '+cnt+' ) ');if(wppaRatingOnce&&myr>0){jQuery('#wppa-numrate-mine-'+mocc).html(myr);}
163
  else if(myr<0){jQuery('#wppa-numrate-mine-'+mocc).html(' dislike');}
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
+ var wppaJsSlideshowVersion='6.6.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 ';}
13
  if(wppaSlideSwipe){_wppaSlides[mocc][id]+=' ontouchstart="wppaTouchStart( event, this.id, '+mocc+' );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );" ';}
14
  if(!wppaAutoColumnWidth[mocc])_wppaSlides[mocc][id]+='width="'+width+'" height="'+height+'" ';if(_wppaIsVideo[mocc][id]){var controls;controls='wppa'==wppaLightBox[mocc]?'':'controls';_wppaSlides[mocc][id]+='style="'+size+'; cursor:'+cursor+'; display:none;" '+controls+'>'+videohtml+'</video>';}
15
  else{_wppaSlides[mocc][id]+='style="'+size+'; cursor:'+cursor+'; display:none; vertical-align:middle;">';}
16
+ _wppaFullNames[mocc][id]=fullname;_wppaNames[mocc][id]=name;_wppaDsc[mocc][id]=desc;_wppaOgDsc[mocc][id]=ogdsc;_wppaId[mocc][id]=photoid;_wppaAvg[mocc][id]=avgrat;wppaConsoleLog('_wppaAvg[mocc][id]='+_wppaAvg[mocc][id],'force');_wppaDisc[mocc][id]=discount;wppaConsoleLog('discount='+discount,'force');_wppaMyr[mocc][id]=myrat;wppaConsoleLog('myrat='+myrat,'force');_wppaVRU[mocc][id]=rateurl;_wppaLinkUrl[mocc][id]=linkurl;_wppaLinkTitle[mocc][id]=linktitle;if(linktarget!=''){_wppaLinkTarget[mocc][id]=linktarget;}
17
  else if(wppaSlideBlank[mocc]){_wppaLinkTarget[mocc][id]='_blank';}
18
  else{_wppaLinkTarget[mocc][id]='_self';}
19
  _wppaCommentHtml[mocc][id]=commenthtml;_wppaIptcHtml[mocc][id]=iptchtml;_wppaExifHtml[mocc][id]=exifhtml;_wppaUrl[mocc][id]=url;_wppaLbTitle[mocc][id]=wppaRepairScriptTags(lbtitle);_wppaShareUrl[mocc][id]=shareurl;_wppaShareHtml[mocc][id]=wppaRepairScriptTags(smhtml);_wppaHiresUrl[mocc][id]=hiresurl;_wppaVideoHtml[mocc][id]=videohtml;_wppaAudioHtml[mocc][id]=audiohtml;_wppaVideoNatWidth[mocc][id]=width;_wppaVideoNatHeight[mocc][id]=height;_wppaWaitTexts[mocc][id]=waittext;_wppaImageAlt[mocc][id]=imagealt;}
157
  function _wppaCheckRewind(mocc){var n_images;var n_diff;var l_substrate;var x_marg;if(!document.getElementById('wppa-filmstrip-'+mocc))return;n_diff=Math.abs(_wppaCurIdx[mocc]-_wppaNxtIdx[mocc]);if(n_diff<=wppaFilmPageSize[mocc])return;var n_images=wppaFilmStripLength[mocc]/wppaThumbnailPitch[mocc];if(n_diff>=((n_images+1)/2)){l_substrate=wppaThumbnailPitch[mocc]*_wppaSlides[mocc].length;if(wppaFilmShowGlue)l_substrate+=(2+2*wppaFilmStripMargin[mocc]);x_marg=parseInt(jQuery('#wppa-filmstrip-'+mocc).css('margin-left'));if(_wppaNxtIdx[mocc]>_wppaCurIdx[mocc]){x_marg-=l_substrate;}
158
  else{x_marg+=l_substrate;}
159
  jQuery('#wppa-filmstrip-'+mocc).css('margin-left',x_marg+'px');}}
160
+ function _wppaSetRatingDisplay(mocc){wppaConsoleLog('_wppaSetRatingDisplay() called with arg '+mocc,'force');wppaConsoleLog('_wppaAvg[mocc][_wppaCurIdx[mocc]]='+_wppaAvg[mocc][_wppaCurIdx[mocc]]+' _wppaCurIdx[mocc]='+_wppaCurIdx[mocc],'force');var idx,avg,tmp,cnt,dsc,myr,dsctxt;if(!document.getElementById('wppa-rating-'+mocc))return;avg=_wppaAvg[mocc][_wppaCurIdx[mocc]];if(typeof(avg)=='undefined')return;if(wppaRatingDisplayType=='likes'){var likeText=avg.split("|");jQuery('#wppa-like-'+mocc).attr('title',likeText[0]);jQuery('#wppa-liketext-'+mocc).html(likeText[1]);if(_wppaMyr[mocc][_wppaCurIdx[mocc]]=='1'){jQuery('#wppa-like-'+mocc).attr('src',wppaImageDirectory+'thumbdown.png');}
161
+ else{jQuery('#wppa-like-'+mocc).attr('src',wppaImageDirectory+'thumbup.png');}
162
+ return;}
163
+ tmp=avg.split('|');avg=tmp[0];cnt=tmp[1];dsc=_wppaDisc[mocc][_wppaCurIdx[mocc]];myr=_wppaMyr[mocc][_wppaCurIdx[mocc]];wppaConsoleLog('avg='+avg+' cnt='+cnt+' dsc='+dsc+' myr='+myr);if(wppaRatingDisplayType=='graphic'){_wppaSetRd(mocc,avg,'#wppa-avg-');_wppaSetRd(mocc,myr,'#wppa-rate-');if(myr==0){jQuery('#wppa-dislike-'+mocc).css('display','inline');jQuery('#wppa-dislike-imgdiv-'+mocc).css('display','inline');if(document.getElementById('wppa-dislike-'+mocc))jQuery('#wppa-filler-'+mocc).css('display','none');jQuery('#wppa-dislike-'+mocc).stop().fadeTo(100,wppaStarOpacity);}
164
  else{jQuery('#wppa-dislike-'+mocc).css('display','none');jQuery('#wppa-dislike-imgdiv-'+mocc).css('display','none');jQuery('#wppa-filler-'+mocc).css('display','inline');jQuery('#wppa-filler-'+mocc).stop().fadeTo(100,wppaStarOpacity);jQuery('#wppa-filler-'+mocc).attr('title',dsc);}}
165
  else{jQuery('#wppa-numrate-avg-'+mocc).html(avg+' ( '+cnt+' ) ');if(wppaRatingOnce&&myr>0){jQuery('#wppa-numrate-mine-'+mocc).html(myr);}
166
  else if(myr<0){jQuery('#wppa-numrate-mine-'+mocc).html(' dislike');}
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.6.04
6
- Stable tag: 6.6.03
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -180,6 +180,14 @@ 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.6.04 =
184
 
185
  = Bug Fixes =
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
5
+ Version: 6.6.05
6
+ Stable tag: 6.6.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.6.05 =
184
+
185
+ = New Features =
186
+
187
+ * Table IV-E11: <i>Rating display type</i> can now be set to 'Likes'. Works on thumbnails (II-D4), slideshow (II-B7) and lightbox (II-G21).
188
+ * Table IX-F8.2 and IX-F8.3 The color of textual watermarks can now be set.
189
+ * Table VI-A6: LasTen widget linktype: added option: 'the thumbnails album in a slideshow'. Shows the slideshow of the album where the thumbnail belongs. Starting at the pointed image.
190
+
191
  = 6.6.04 =
192
 
193
  = Bug Fixes =
theme/wppa-style.css CHANGED
@@ -8,7 +8,7 @@
8
  /*
9
  /* You may always look into a newer version of this file to see what new classes and id's come with an upgrade
10
  /*
11
- /* This is version 6.6.03
12
  */
13
 
14
  .wppa-container, .wppa-cover-box, .wppa-thumb-area {
@@ -49,6 +49,9 @@
49
  -webkit-box-sizing:border-box;
50
  box-sizing: border-box;
51
  }
 
 
 
52
  .wppa-mini-box {
53
  }
54
  /* Boxes in a list like album covers. Admin settings page defines background and border color */
8
  /*
9
  /* You may always look into a newer version of this file to see what new classes and id's come with an upgrade
10
  /*
11
+ /* This is version 6.6.05
12
  */
13
 
14
  .wppa-container, .wppa-cover-box, .wppa-thumb-area {
49
  -webkit-box-sizing:border-box;
50
  box-sizing: border-box;
51
  }
52
+ .wppa-filmstrip-box {
53
+ box-sizing: content-box;
54
+ }
55
  .wppa-mini-box {
56
  }
57
  /* Boxes in a list like album covers. Admin settings page defines background and border color */
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 6.6.00
6
  *
7
  */
8
 
@@ -717,8 +717,33 @@ global $wppa_log_file;
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
 
@@ -2580,6 +2605,14 @@ global $wppa_log_file;
2580
  }
2581
  break;
2582
 
 
 
 
 
 
 
 
 
2583
  default:
2584
 
2585
  wppa( 'error', '0' );
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 6.6.05
6
  *
7
  */
8
 
717
  // Error message format: '0||<errcode>||<errtext>
718
  // errcode = 900: user error, other codes: real errors
719
 
720
+ // Case -1: Likes only
721
+ if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
722
+
723
+ // If i liked this, i do no longer like this
724
+ if ( $mylast ) {
725
+
726
+ // Remove my like
727
+ $wpdb->query( $wpdb->prepare( "DELETE FROM `" . WPPA_RATING . "` WHERE `photo` = %s AND `user` = %s", $photo, $user ) );
728
+ $myavgrat = '0';
729
+ }
730
+ else {
731
+
732
+ // Add my like
733
+ wppa_create_rating_entry( array( 'photo' => $photo, 'value' => '1', 'user' => $user ) );
734
+ $myavgrat = '1';
735
+ }
736
+ $lt = wppa_get_like_title_a( $photo );
737
+ $allavgratcombi = $lt['title'] . '|' . $lt['display'];
738
+
739
+ // Update photo data
740
+ wppa_rate_photo( $photo );
741
+ echo $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.esc_attr( $allavgratcombi ).'||||||likes';
742
+ wppa_exit();
743
+ }
744
+
745
  // 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
746
+ elseif ( $mylast ) {
747
 
748
  // I did vote already
749
 
2605
  }
2606
  break;
2607
 
2608
+ case 'wppa_rating_display_type':
2609
+ if ( $value == 'likes' ) {
2610
+ wppa_update_option( 'wppa_rating_multi', 'yes' );
2611
+ wppa_update_option( 'wppa_rating_dayly', 'no' );
2612
+ wppa_update_option( 'wppa_vote_needs_comment', 'no' );
2613
+ }
2614
+ break;
2615
+
2616
  default:
2617
 
2618
  wppa( 'error', '0' );
wppa-breadcrumb.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for breadcrumbs
6
- * Version 6.6.04
7
  *
8
  */
9
 
@@ -86,7 +86,7 @@ global $wppa_session;
86
  // Open the breadcrumb box
87
  wppa_out( '<div' .
88
  ' id="wppa-bc-'.wppa( 'mocc' ) . '"' .
89
- ' class="wppa-nav wppa-box wppa-nav-text" ' .
90
  'style="' .
91
  __wcs( 'wppa-nav' ) .
92
  __wcs( 'wppa-box' ) .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for breadcrumbs
6
+ * Version 6.6.05
7
  *
8
  */
9
 
86
  // Open the breadcrumb box
87
  wppa_out( '<div' .
88
  ' id="wppa-bc-'.wppa( 'mocc' ) . '"' .
89
+ ' class="wppa-nav wppa-box wppa-nav-text wppa-bc"' .
90
  'style="' .
91
  __wcs( 'wppa-nav' ) .
92
  __wcs( 'wppa-box' ) .
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 6.6.04
7
  *
8
  */
9
 
@@ -1937,30 +1937,46 @@ static $user;
1937
  if ( wppa_switch( 'rating_on' ) && ! wppa( 'is_slideonly' ) && ! wppa( 'is_filmonly' ) ) {
1938
 
1939
  // Find my ( avg ) rating
1940
- $rats = $wpdb->get_results( $wpdb->prepare( "SELECT `value`, `timestamp` FROM `".WPPA_RATING."` " .
1941
- "WHERE `photo` = %s AND `user` = %s AND `status` = 'publish'", $id, $user ), ARRAY_A );
1942
- if ( $rats ) {
1943
- $n = 0;
1944
- $accu = 0;
1945
- foreach ( $rats as $rat ) {
1946
- $accu += $rat['value'];
1947
- $n++;
1948
- $my_youngest_rating_dtm = $rat['timestamp'];
1949
- }
1950
- $myrat = $accu / $n;
1951
- $i = wppa_opt( 'rating_prec' );
1952
- $j = $i + '1';
1953
- $myrat = sprintf( '%'.$j.'.'.$i.'f', $myrat );
1954
  }
1955
  else {
1956
- $myrat = '0';
1957
- $my_youngest_rating_dtm = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1958
  }
1959
 
1960
  // Find the avg rating
1961
- $avgrat = wppa_get_rating_by_id( $id, 'nolabel' );
1962
- if ( ! $avgrat ) $avgrat = '0';
1963
- $avgrat .= '|'.wppa_get_rating_count_by_id( $id );
 
 
 
 
 
 
 
 
 
1964
 
1965
  // Find the dislike count
1966
  $discount = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `".WPPA_RATING."` WHERE `photo` = %s AND `value` = -1 AND `status` = %s", $id, 'publish' ) );
@@ -4758,6 +4774,9 @@ function wppa_get_lbtitle( $type, $id ) {
4758
  if ( wppa_opt( 'rating_max' ) != '1' && wppa_opt( 'rating_display_type' ) == 'graphic' ) {
4759
  $result .= wppa_get_rating_range_html( $id, true );
4760
  }
 
 
 
4761
 
4762
  if ( $do_sm ) $result .= wppa_get_share_html( $thumb['id'], 'lightbox' );
4763
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 6.6.05
7
  *
8
  */
9
 
1937
  if ( wppa_switch( 'rating_on' ) && ! wppa( 'is_slideonly' ) && ! wppa( 'is_filmonly' ) ) {
1938
 
1939
  // Find my ( avg ) rating
1940
+ if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
1941
+ $lt = wppa_get_like_title_a( $id );
1942
+ $myrat = $lt['mine'];
1943
+ $my_youngest_rating_dtm = 0;
 
 
 
 
 
 
 
 
 
 
1944
  }
1945
  else {
1946
+ $rats = $wpdb->get_results( $wpdb->prepare( "SELECT `value`, `timestamp` FROM `".WPPA_RATING."` " .
1947
+ "WHERE `photo` = %s AND `user` = %s AND `status` = 'publish'", $id, $user ), ARRAY_A );
1948
+ if ( $rats ) {
1949
+ $n = 0;
1950
+ $accu = 0;
1951
+ foreach ( $rats as $rat ) {
1952
+ $accu += $rat['value'];
1953
+ $n++;
1954
+ $my_youngest_rating_dtm = $rat['timestamp'];
1955
+ }
1956
+ $myrat = $accu / $n;
1957
+ $i = wppa_opt( 'rating_prec' );
1958
+ $j = $i + '1';
1959
+ $myrat = sprintf( '%'.$j.'.'.$i.'f', $myrat );
1960
+ }
1961
+ else {
1962
+ $myrat = '0';
1963
+ $my_youngest_rating_dtm = 0;
1964
+ }
1965
  }
1966
 
1967
  // Find the avg rating
1968
+ if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
1969
+
1970
+ $avgrat = esc_js( $lt['title'] . '|' . $lt['display'] );
1971
+
1972
+ }
1973
+ else {
1974
+ $avgrat = wppa_get_rating_by_id( $id, 'nolabel' );
1975
+ if ( ! $avgrat ) {
1976
+ $avgrat = '0';
1977
+ }
1978
+ $avgrat .= '|'.wppa_get_rating_count_by_id( $id );
1979
+ }
1980
 
1981
  // Find the dislike count
1982
  $discount = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `".WPPA_RATING."` WHERE `photo` = %s AND `value` = -1 AND `status` = %s", $id, 'publish' ) );
4774
  if ( wppa_opt( 'rating_max' ) != '1' && wppa_opt( 'rating_display_type' ) == 'graphic' ) {
4775
  $result .= wppa_get_rating_range_html( $id, true );
4776
  }
4777
+ elseif ( wppa_opt( 'rating_display_type' ) == 'likes' && wppa_opt( 'ovl_rating' ) ) {
4778
+ $result .= wppa_get_slide_rating_vote_only( 'always', $id, 'is_lightbox' );
4779
+ }
4780
 
4781
  if ( $do_sm ) $result .= wppa_get_share_html( $thumb['id'], 'lightbox' );
4782
 
wppa-links.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Frontend links
6
- * Version 6.6.04
7
  *
8
  */
9
 
@@ -1626,6 +1626,27 @@ global $wpdb;
1626
  $result['is_url'] = true;
1627
  $result['is_lightbox'] = false;
1628
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1629
  case 'autopage':
1630
  if ( ! wppa_switch( 'auto_page' ) ) {
1631
  wppa_dbg_msg( 'Auto page has been switched off, but there are still links to it (' . $wich . ')', 'red', 'force' );
@@ -1651,7 +1672,7 @@ global $wpdb;
1651
  break;
1652
  }
1653
 
1654
- if ( $type != 'thumbalbum' ) {
1655
 
1656
  if ( wppa( 'calendar' ) ) {
1657
  $result['url'] .= '&amp;wppa-calendar=' . wppa( 'calendar' ) . '&amp;wppa-caldate=' . wppa( 'caldate' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Frontend links
6
+ * Version 6.6.05
7
  *
8
  */
9
 
1626
  $result['is_url'] = true;
1627
  $result['is_lightbox'] = false;
1628
  break;
1629
+ case 'slidealbum': // for lasten widget, slide of the photos in te thumbs album
1630
+ $album = $thumb['album'];
1631
+ $album_name = wppa_get_album_name( $album );
1632
+ switch ( $page ) {
1633
+ case '-1':
1634
+ return false;
1635
+ break;
1636
+ case '0':
1637
+ $result['url'] = wppa_encrypt_url( wppa_get_permalink() . 'wppa-album=' . $album . '&amp;wppa-photo=' . $thumb['id'] );
1638
+ $result['title'] = $album_name;
1639
+ $result['is_url'] = true;
1640
+ $result['is_lightbox'] = false;
1641
+ break;
1642
+ default:
1643
+ $result['url'] = wppa_encrypt_url( wppa_get_permalink( $page ) . 'wppa-album=' . $album . '&amp;wppa-photo=' . $thumb['id'] );
1644
+ $result['title'] = $album_name;//'a++';
1645
+ $result['is_url'] = true;
1646
+ $result['is_lightbox'] = false;
1647
+ break;
1648
+ }
1649
+ break;
1650
  case 'autopage':
1651
  if ( ! wppa_switch( 'auto_page' ) ) {
1652
  wppa_dbg_msg( 'Auto page has been switched off, but there are still links to it (' . $wich . ')', 'red', 'force' );
1672
  break;
1673
  }
1674
 
1675
+ if ( $type != 'thumbalbum' && $type != 'slidealbum' ) {
1676
 
1677
  if ( wppa( 'calendar' ) ) {
1678
  $result['url'] .= '&amp;wppa-calendar=' . wppa( 'calendar' ) . '&amp;wppa-caldate=' . wppa( 'caldate' );
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 6.6.04
7
  *
8
  */
9
 
@@ -654,14 +654,22 @@ function wppaTryWatermark( id ) {
654
  // Rating
655
  $entries = wppa_get_rating_count_by_id( $id );
656
  if ( $entries ) {
657
- echo
658
- __( 'Rating:', 'wp-photo-album-plus' ) . ' ' .
659
- __( 'Entries:', 'wp-photo-album-plus' ) . ' ' . $entries .
660
- ', ' .
661
- __( 'Mean value:', 'wp-photo-album-plus' ) .
662
- ' ' .
663
- wppa_get_rating_by_id( $id, 'nolabel' ) .
664
- '. ';
 
 
 
 
 
 
 
 
665
  }
666
  else {
667
  echo
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 6.6.05
7
  *
8
  */
9
 
654
  // Rating
655
  $entries = wppa_get_rating_count_by_id( $id );
656
  if ( $entries ) {
657
+
658
+ if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
659
+ echo __( 'Likes:', 'wp-photo-album-plus' ) . ' ' .
660
+ $entries .
661
+ '. ';
662
+ }
663
+ else {
664
+ echo
665
+ __( 'Rating:', 'wp-photo-album-plus' ) . ' ' .
666
+ __( 'Entries:', 'wp-photo-album-plus' ) . ' ' . $entries .
667
+ ', ' .
668
+ __( 'Mean value:', 'wp-photo-album-plus' ) .
669
+ ' ' .
670
+ wppa_get_rating_by_id( $id, 'nolabel' ) .
671
+ '. ';
672
+ }
673
  }
674
  else {
675
  echo
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 6.6.04
7
  *
8
  */
9
 
@@ -4221,25 +4221,29 @@ global $wp_version;
4221
  $tags = 'rating';
4222
  wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
4223
 
4224
- $name = __('Rating multi', 'wp-photo-album-plus');
4225
- $desc = __('Users may give multiple votes.', 'wp-photo-album-plus');
4226
- $help = esc_js(__('Users may give multiple votes. (This has no effect when users may change their votes.)', 'wp-photo-album-plus'));
4227
- $slug = 'wppa_rating_multi';
4228
- $html = wppa_checkbox($slug);
4229
- $clas = 'wppa_rating_';
4230
- $tags = 'rating';
4231
- wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags);
 
 
4232
 
4233
- $name = __('Rating daily', 'wp-photo-album-plus');
4234
- $desc = __('Users may rate only once per period', 'wp-photo-album-plus');
4235
- $help = '';
4236
- $slug = 'wppa_rating_dayly';
4237
- $opts = array(__('--- off ---', 'wp-photo-album-plus'), __('Week', 'wp-photo-album-plus'), __('Day', 'wp-photo-album-plus'), __('Hour', 'wp-photo-album-plus') );
4238
- $vals = array(0, 7*24*60*60, 24*60*60, 60*60);
4239
- $html = wppa_select($slug, $opts, $vals);
4240
- $clas = 'wppa_rating_';
4241
- $tags = 'rating';
4242
- wppa_setting($slug, '3.0', $name, $desc, $html, $help, $clas, $tags);
 
 
4243
 
4244
  $name = __('Rate own photos', 'wp-photo-album-plus');
4245
  $desc = __('It is allowed to rate photos by the uploader himself.', 'wp-photo-album-plus');
@@ -4250,14 +4254,16 @@ global $wp_version;
4250
  $tags = 'rating';
4251
  wppa_setting($slug, '3.1', $name, $desc, $html, $help, $clas, $tags);
4252
 
4253
- $name = __('Rating requires comment', 'wp-photo-album-plus');
4254
- $desc = __('Users must clarify their vote in a comment.', 'wp-photo-album-plus');
4255
- $help = '';
4256
- $slug = 'wppa_vote_needs_comment';
4257
- $html = wppa_checkbox($slug);
4258
- $clas = 'wppa_rating_';
4259
- $tags = 'rating';
4260
- wppa_setting($slug, '3.2', $name, $desc, $html, $help, $clas, $tags);
 
 
4261
 
4262
  $name = __('Dislike value', 'wp-photo-album-plus');
4263
  $desc = __('This value counts dislike rating.', 'wp-photo-album-plus');
@@ -4333,11 +4339,12 @@ global $wp_version;
4333
 
4334
  $name = __('Rating display type', 'wp-photo-album-plus');
4335
  $desc = __('Specify the type of the rating display.', 'wp-photo-album-plus');
4336
- $help = esc_js(__('If "One button vote" is selected in Table I-E1, this setting has no meaning', 'wp-photo-album-plus'));
4337
  $slug = 'wppa_rating_display_type';
4338
- $options = array(__('Graphic', 'wp-photo-album-plus'), __('Numeric', 'wp-photo-album-plus'));
4339
- $values = array('graphic', 'numeric');
4340
- $html = wppa_select($slug, $options, $values);
 
4341
  $clas = 'wppa_rating_';
4342
  $tags = 'rating,layout';
4343
  wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
@@ -5263,6 +5270,7 @@ global $wp_version;
5263
  __('the content of the virtual lasten album.', 'wp-photo-album-plus'),
5264
  __('the content of the thumbnails album.', 'wp-photo-album-plus'),
5265
  __('the full size photo in a slideshow.', 'wp-photo-album-plus'),
 
5266
  __('the fullsize photo on its own.', 'wp-photo-album-plus'),
5267
  __('the single photo in the style of a slideshow.', 'wp-photo-album-plus'),
5268
  __('the fs photo with download and print buttons.', 'wp-photo-album-plus'),
@@ -5275,6 +5283,7 @@ global $wp_version;
5275
  'album',
5276
  'thumbalbum',
5277
  'photo',
 
5278
  'single',
5279
  'slphoto',
5280
  'fullpopup',
@@ -8648,7 +8657,27 @@ global $wp_version;
8648
  $html = wppa_input($slug, '50px', '', 'points');
8649
  $clas = 'wppa_watermark';
8650
  $tags = 'water';
8651
- wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8652
 
8653
  $name = __('Upload watermark font', 'wp-photo-album-plus');
8654
  $desc = __('Upload a new watermark font file', 'wp-photo-album-plus');
@@ -9856,6 +9885,26 @@ global $wppa_opt;
9856
  return $html;
9857
  }
9858
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9859
  function wppa_edit($xslug, $value, $width = '90%', $minwidth = '', $text = '', $onchange = '') {
9860
 
9861
  $slug = substr( $xslug, 5 );
@@ -10326,4 +10375,5 @@ global $wppa_opt;
10326
  if ( ! $iret ) {
10327
  wppa_update_option($slug, '0');
10328
  }
10329
- }
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 6.6.05
7
  *
8
  */
9
 
4221
  $tags = 'rating';
4222
  wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
4223
 
4224
+ if ( wppa_opt( 'rating_display_type' ) != 'likes' ) {
4225
+ $name = __('Rating multi', 'wp-photo-album-plus');
4226
+ $desc = __('Users may give multiple votes.', 'wp-photo-album-plus');
4227
+ $help = esc_js(__('Users may give multiple votes. (This has no effect when users may change their votes.)', 'wp-photo-album-plus'));
4228
+ $slug = 'wppa_rating_multi';
4229
+ $html = wppa_checkbox($slug);
4230
+ $clas = 'wppa_rating_';
4231
+ $tags = 'rating';
4232
+ wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags);
4233
+ }
4234
 
4235
+ if ( wppa_opt( 'rating_display_type' ) != 'likes' ) {
4236
+ $name = __('Rating daily', 'wp-photo-album-plus');
4237
+ $desc = __('Users may rate only once per period', 'wp-photo-album-plus');
4238
+ $help = '';
4239
+ $slug = 'wppa_rating_dayly';
4240
+ $opts = array(__('--- off ---', 'wp-photo-album-plus'), __('Week', 'wp-photo-album-plus'), __('Day', 'wp-photo-album-plus'), __('Hour', 'wp-photo-album-plus') );
4241
+ $vals = array(0, 7*24*60*60, 24*60*60, 60*60);
4242
+ $html = wppa_select($slug, $opts, $vals);
4243
+ $clas = 'wppa_rating_';
4244
+ $tags = 'rating';
4245
+ wppa_setting($slug, '3.0', $name, $desc, $html, $help, $clas, $tags);
4246
+ }
4247
 
4248
  $name = __('Rate own photos', 'wp-photo-album-plus');
4249
  $desc = __('It is allowed to rate photos by the uploader himself.', 'wp-photo-album-plus');
4254
  $tags = 'rating';
4255
  wppa_setting($slug, '3.1', $name, $desc, $html, $help, $clas, $tags);
4256
 
4257
+ if ( wppa_opt( 'rating_display_type' ) != 'likes' ) {
4258
+ $name = __('Rating requires comment', 'wp-photo-album-plus');
4259
+ $desc = __('Users must clarify their vote in a comment.', 'wp-photo-album-plus');
4260
+ $help = '';
4261
+ $slug = 'wppa_vote_needs_comment';
4262
+ $html = wppa_checkbox($slug);
4263
+ $clas = 'wppa_rating_';
4264
+ $tags = 'rating';
4265
+ wppa_setting($slug, '3.2', $name, $desc, $html, $help, $clas, $tags);
4266
+ }
4267
 
4268
  $name = __('Dislike value', 'wp-photo-album-plus');
4269
  $desc = __('This value counts dislike rating.', 'wp-photo-album-plus');
4339
 
4340
  $name = __('Rating display type', 'wp-photo-album-plus');
4341
  $desc = __('Specify the type of the rating display.', 'wp-photo-album-plus');
4342
+ $help = esc_js(__('If you select "Likes" you must also select "One button vote" in Table I-E1', 'wp-photo-album-plus'));
4343
  $slug = 'wppa_rating_display_type';
4344
+ $opts = array(__('Graphic', 'wp-photo-album-plus'), __('Numeric', 'wp-photo-album-plus'), __('Likes', 'wp-photo-album-plus'));
4345
+ $vals = array('graphic', 'numeric', 'likes');
4346
+ $postaction = 'setTimeout(\'document.location.reload(true)\', 2000)';
4347
+ $html = wppa_select($slug, $opts, $vals, '', '', false, $postaction);
4348
  $clas = 'wppa_rating_';
4349
  $tags = 'rating,layout';
4350
  wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
5270
  __('the content of the virtual lasten album.', 'wp-photo-album-plus'),
5271
  __('the content of the thumbnails album.', 'wp-photo-album-plus'),
5272
  __('the full size photo in a slideshow.', 'wp-photo-album-plus'),
5273
+ __('the thumbnails album in a slideshow.', 'wp-photo-album-plus'),
5274
  __('the fullsize photo on its own.', 'wp-photo-album-plus'),
5275
  __('the single photo in the style of a slideshow.', 'wp-photo-album-plus'),
5276
  __('the fs photo with download and print buttons.', 'wp-photo-album-plus'),
5283
  'album',
5284
  'thumbalbum',
5285
  'photo',
5286
+ 'slidealbum',
5287
  'single',
5288
  'slphoto',
5289
  'fullpopup',
8657
  $html = wppa_input($slug, '50px', '', 'points');
8658
  $clas = 'wppa_watermark';
8659
  $tags = 'water';
8660
+ wppa_setting($slug, '8.1', $name, $desc, $html, $help, $clas, $tags);
8661
+
8662
+ $name = __('Foreground color', 'wp-photo-album-plus');
8663
+ $desc = __('Textual watermark foreground color (black).', 'wp-photo-album-plus');
8664
+ $help = '';
8665
+ $slug = 'wppa_watermark_fgcol_text';
8666
+ $onch = 'wppaRefreshAfter();';
8667
+ $html = wppa_input_color($slug, '100px;', '', '', $onch );
8668
+ $clas = 'wppa_watermark';
8669
+ $tags = 'water';
8670
+ wppa_setting($slug, '8.2', $name, $desc, $html, $help, $clas, $tags);
8671
+
8672
+ $name = __('Background color', 'wp-photo-album-plus');
8673
+ $desc = __('Textual watermark background color (white).', 'wp-photo-album-plus');
8674
+ $help = '';
8675
+ $slug = 'wppa_watermark_bgcol_text';
8676
+ $onch = 'wppaRefreshAfter();';
8677
+ $html = wppa_input_color($slug, '100px;', '', '', $onch );
8678
+ $clas = 'wppa_watermark';
8679
+ $tags = 'water';
8680
+ wppa_setting($slug, '8.3', $name, $desc, $html, $help, $clas, $tags);
8681
 
8682
  $name = __('Upload watermark font', 'wp-photo-album-plus');
8683
  $desc = __('Upload a new watermark font file', 'wp-photo-album-plus');
9885
  return $html;
9886
  }
9887
 
9888
+ function wppa_input_color($xslug, $width, $minwidth = '', $text = '', $onchange = '', $placeholder = '') {
9889
+ global $wppa_opt;
9890
+
9891
+ $slug = substr( $xslug, 5 );
9892
+ $tit = __('Slug =', 'wp-photo-album-plus').' '.$xslug;
9893
+ $title = wppa_switch( 'enable_shortcode_wppa_set' ) ? ' title="'.esc_attr( $tit ).'"' : '';
9894
+ $val = isset ( $wppa_opt[ $xslug ] ) ? esc_attr( $wppa_opt[ $xslug ] ) : get_option( $xslug, '' );
9895
+ $html = '<input'.$title.' type="color" style="float:left; width: '.$width.'; height:20px;';
9896
+ if ($minwidth != '') $html .= ' min-width:'.$minwidth.';';
9897
+ $html .= ' font-size: 11px; margin: 0px; padding: 0px;" type="text" id="'.$slug.'"';
9898
+ if ($onchange != '') $html .= ' onchange="'.$onchange.';wppaAjaxUpdateOptionValue(\''.$slug.'\', this)"';
9899
+ else $html .= ' onchange="wppaAjaxUpdateOptionValue(\''.$slug.'\', this)"';
9900
+ if ( $placeholder ) $html .= ' placeholder="'.$placeholder.'"';
9901
+ $html .= ' value="'.$val.'" />';
9902
+ $html .= '<img id="img_'.$slug.'" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
9903
+ $html .= '<span style="float:left">'.$text.'</span>';
9904
+
9905
+ return $html;
9906
+ }
9907
+
9908
  function wppa_edit($xslug, $value, $width = '90%', $minwidth = '', $text = '', $onchange = '') {
9909
 
9910
  $slug = substr( $xslug, 5 );
10375
  if ( ! $iret ) {
10376
  wppa_update_option($slug, '0');
10377
  }
10378
+ }
10379
+
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 6.6.04
7
  *
8
  */
9
 
@@ -1566,6 +1566,8 @@ Hide Camera info
1566
  'wppa_textual_watermark_text' => "Copyright (c) 2014 w#site \n w#filename (w#owner)",
1567
  'wppa_textual_watermark_font' => 'system',
1568
  'wppa_textual_watermark_size' => '10',
 
 
1569
  'wppa_watermark_upload' => '',
1570
  'wppa_watermark_opacity' => '20',
1571
  'wppa_watermark_opacity_text' => '80',
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 6.6.05
7
  *
8
  */
9
 
1566
  'wppa_textual_watermark_text' => "Copyright (c) 2014 w#site \n w#filename (w#owner)",
1567
  'wppa_textual_watermark_font' => 'system',
1568
  'wppa_textual_watermark_size' => '10',
1569
+ 'wppa_watermark_fgcol_text' => '#000000',
1570
+ 'wppa_watermark_bgcol_text' => '#ffffff',
1571
  'wppa_watermark_upload' => '',
1572
  'wppa_watermark_opacity' => '20',
1573
  'wppa_watermark_opacity_text' => '80',
wppa-slideshow.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the slideshow high level functions
6
- * Version 6.6.00
7
  *
8
  */
9
 
@@ -641,55 +641,129 @@ function wppa_slide_rating( $opt = '' ) {
641
  }
642
  }
643
 
644
- function wppa_slide_rating_vote_only( $opt ) {
645
 
646
- if ( $opt == 'optional' && ! wppa_switch( 'rating_on' ) ) return;
647
- if ( wppa( 'is_slideonly' ) ) return; /* Not when slideonly */
648
- if ( is_feed() ) return;
 
 
 
 
 
 
 
 
 
649
 
650
  // Open the voting box
651
- wppa_out( '<div' .
652
- ' id="wppa-rating-'.wppa( 'mocc' ).'"' .
653
- ' class="wppa-box wppa-nav wppa-nav-text"' .
654
- ' style="' .
655
- __wcs( 'wppa-box' ) .
656
- __wcs( 'wppa-nav' ) .
657
- __wcs( 'wppa-nav-text' ) .
658
- 'text-align:center;' .
659
- '"' .
660
- '>'
661
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
662
 
663
- // Logged in or don't care ?
664
- if ( ! wppa_switch( 'rating_login' ) || is_user_logged_in() ) {
665
- $cnt = '0';
666
- if ( wppa_switch( 'show_avg_rating' ) ) {
667
- wppa_out( sprintf(__('Number of votes: <span id="wppa-vote-count-%s" >%s</span>&nbsp;', 'wp-photo-album-plus'), wppa( 'mocc' ), $cnt) );
668
  }
669
- wppa_out( '<input' .
670
- ' id="wppa-vote-button-'.wppa( 'mocc' ).'"' .
671
- ' class="wppa-vote-button"' .
672
- ' style="margin:0;"' .
673
- ' type="button"' .
674
- ' onclick="wppa'.$ovl.'RateIt('.wppa( 'mocc' ).', 1)"' .
675
- ' value="'.wppa_opt( 'vote_button_text' ) . '"' .
676
- ' />'
677
- );
678
  }
679
 
680
- // Must login to vote
681
  else {
682
- if ( wppa_switch( 'login_links' ) ) {
683
- wppa_out( sprintf( __( 'You must <a href="%s">login</a> to vote' , 'wp-photo-album-plus' ), site_url( 'wp-login.php', 'login' ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
684
  }
 
 
685
  else {
686
- wppa_out( __( 'You must login to vote' , 'wp-photo-album-plus' ) );
 
 
 
 
 
687
  }
688
  }
689
 
690
  // Close the voting box
691
- wppa_out( '</div>' );
 
 
692
 
 
693
  }
694
 
695
  function wppa_slide_rating_range( $opt ) {
@@ -1086,7 +1160,7 @@ function wppa_slide_filmstrip( $opt = '' ) {
1086
  else {
1087
 
1088
  wppa_out( '<div' .
1089
- ' class="wppa-box wppa-nav"' .
1090
  ' style="text-align:center; '.__wcs('wppa-box').__wcs('wppa-nav').'height:'.$height.'px;"' .
1091
  ' >' .
1092
  '<div' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the slideshow high level functions
6
+ * Version 6.6.05
7
  *
8
  */
9
 
641
  }
642
  }
643
 
644
+ function wppa_slide_rating_vote_only( $opt, $id = '0', $is_lightbox = false ) {
645
 
646
+ wppa_out( wppa_get_slide_rating_vote_only( $opt, $id, $is_lightbox ) );
647
+ }
648
+
649
+ function wppa_get_slide_rating_vote_only( $opt, $id = '0', $is_lightbox = false ) {
650
+
651
+ if ( ! $is_lightbox ) {
652
+ if ( $opt == 'optional' && ! wppa_switch( 'rating_on' ) ) return;
653
+ if ( wppa( 'is_slideonly' ) ) return ''; /* Not when slideonly */
654
+ if ( is_feed() ) return '';
655
+ }
656
+
657
+ $result = '';
658
 
659
  // Open the voting box
660
+ if ( ! $is_lightbox ) {
661
+ $result .=
662
+ '<div' .
663
+ ' id="wppa-rating-'.wppa( 'mocc' ).'"' .
664
+ ' class="wppa-box wppa-nav wppa-nav-text"' .
665
+ ' style="' .
666
+ __wcs( 'wppa-box' ) .
667
+ __wcs( 'wppa-nav' ) .
668
+ __wcs( 'wppa-nav-text' ) .
669
+ 'text-align:center;' .
670
+ '"' .
671
+ '>';
672
+ }
673
+
674
+ // Likes
675
+ if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
676
+
677
+ // Logged in or don't care
678
+ if ( ! wppa_switch( 'rating_login' ) || is_user_logged_in() ) {
679
+ $fs = '16';
680
+ $pad = '4';
681
+ if ( $id ) {
682
+ $liketitle = wppa_get_like_title_a( $id );
683
+ $my = $liketitle['mine'];
684
+ $title = $liketitle['title'];
685
+ $display = $liketitle['display'];
686
+ }
687
+ else {
688
+ $my = '';
689
+ $title = '';
690
+ $display = '';
691
+
692
+ }
693
+ $result .= '<div' .
694
+ ' id="wppa-like-imgdiv-'.wppa( 'mocc' ).'"' .
695
+ ' style="display:inline"' .
696
+ ' >' .
697
+
698
+ '<img' .
699
+ ( $is_lightbox ? ' id="wppa-like-0"' : ' id="wppa-like-'.wppa( 'mocc' ).'"' ) .
700
+ ( $my ? ' src="'.wppa_get_imgdir().'thumbdown.png"' : ' src="'.wppa_get_imgdir().'thumbup.png"' ) .
701
+ ( $my ? ' alt="down"' : ' alt="up"' ) .
702
+ ' style="height:'.$fs.'px; margin:0 0 -3px 0; padding:0 '.$pad.'px; box-shadow:none; display:inline;"' .
703
+ ' class="no-shadow"' .
704
+ ' onmouseover="jQuery(this).stop().fadeTo(100, 1.0)"' .
705
+ ' onmouseout="jQuery(this).stop().fadeTo(100, wppaStarOpacity)"' .
706
+ ( $is_lightbox ? ' onclick="wppaOvlRateIt(\''.wppa_encrypt_photo($id).'\', 1, 0 )"' : ' onclick="wppaRateIt( ' . wppa( 'mocc' ) . ', 1);"' ) .
707
+ ' onload="jQuery(this).trigger(\'onmouseout\');"' .
708
+ ' />';
709
+
710
+ $result .= '</div>';
711
+
712
+ if ( wppa_opt( 'show_avg_rating' ) ) {
713
+ $result .= '<span' .
714
+ ( $is_lightbox ? ' id="wppa-liketext-0"' : ' id="wppa-liketext-'.wppa( 'mocc' ).'"' ) .
715
+ ' style="cursor:default;"' .
716
+ ' >' .
717
+ $display .
718
+ '</span>';
719
+ }
720
 
 
 
 
 
 
721
  }
722
+ else {
723
+ if ( wppa_switch( 'login_links' ) ) {
724
+ $result .= sprintf(__( 'You must <a href="%s">login</a> to vote', 'wp-photo-album-plus' ), site_url( 'wp-login.php', 'login' ) );
725
+ }
726
+ else {
727
+ $result .= __( 'You must login to vote', 'wp-photo-album-plus' );
728
+ }
729
+ }
 
730
  }
731
 
 
732
  else {
733
+
734
+ // Logged in or don't care ?
735
+ if ( ! wppa_switch( 'rating_login' ) || is_user_logged_in() ) {
736
+ $cnt = '0';
737
+ if ( wppa_switch( 'show_avg_rating' ) ) {
738
+ $result .= sprintf( __('Number of votes: <span id="wppa-vote-count-%s" >%s</span>&nbsp;', 'wp-photo-album-plus'), wppa( 'mocc' ), $cnt);
739
+ }
740
+ $result .= '<input' .
741
+ ' id="wppa-vote-button-'.wppa( 'mocc' ).'"' .
742
+ ' class="wppa-vote-button"' .
743
+ ' style="margin:0;"' .
744
+ ' type="button"' .
745
+ ' onclick="wppa'.$ovl.'RateIt('.wppa( 'mocc' ).', 1)"' .
746
+ ' value="'.wppa_opt( 'vote_button_text' ) . '"' .
747
+ ' />';
748
  }
749
+
750
+ // Must login to vote
751
  else {
752
+ if ( wppa_switch( 'login_links' ) ) {
753
+ $result .= sprintf( __( 'You must <a href="%s">login</a> to vote' , 'wp-photo-album-plus' ), site_url( 'wp-login.php', 'login' ) );
754
+ }
755
+ else {
756
+ $result .= __( 'You must login to vote' , 'wp-photo-album-plus' );
757
+ }
758
  }
759
  }
760
 
761
  // Close the voting box
762
+ if ( ! $is_lightbox ) {
763
+ $result .= '</div>';
764
+ }
765
 
766
+ return $result;
767
  }
768
 
769
  function wppa_slide_rating_range( $opt ) {
1160
  else {
1161
 
1162
  wppa_out( '<div' .
1163
+ ' class="wppa-box wppa-nav wppa-filmstrip-box"' .
1164
  ' style="text-align:center; '.__wcs('wppa-box').__wcs('wppa-nav').'height:'.$height.'px;"' .
1165
  ' >' .
1166
  '<div' .
wppa-thumbnails.php CHANGED
@@ -5,7 +5,7 @@
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
- * Version 6.6.00
9
  *
10
  */
11
 
@@ -536,15 +536,55 @@ global $wpdb;
536
  // Single button voting system
537
  if ( wppa_opt( 'rating_max' ) == '1' && wppa_switch( 'vote_thumb' ) ) {
538
  $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 );
539
- $buttext = $mylast ? __( wppa_opt( 'voted_button_text' ) , 'wp-photo-album-plus') : __( wppa_opt( 'vote_button_text' ) , 'wp-photo-album-plus');
540
- $result .= '<input' .
541
- ' id="wppa-vote-button-' . wppa( 'mocc' ) . '-' . $xid . '"' .
542
- ' class="wppa-vote-button-thumb"' .
543
- ' style="margin:0;"' .
544
- ' type="button"' .
545
- ' onclick="wppaVoteThumb( ' . wppa( 'mocc' ) . ', \'' . $xid . '\' )"' .
546
- ' value="'.$buttext.'"' .
547
- ' />';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
  }
549
 
550
  // Name
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
+ * Version 6.6.05
9
  *
10
  */
11
 
536
  // Single button voting system
537
  if ( wppa_opt( 'rating_max' ) == '1' && wppa_switch( 'vote_thumb' ) ) {
538
  $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 );
539
+
540
+ // Likes
541
+ if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
542
+ $lt = wppa_get_like_title_a( $id );
543
+ $src = $lt['mine'] ? wppa_get_imgdir() . 'thumbdown.png' : wppa_get_imgdir() . 'thumbup.png';
544
+ $result .= '<div' .
545
+ ' id="wppa-like-imgdiv-'.wppa( 'mocc' ).'"' .
546
+ ' style="display:inline"' .
547
+ ' >' .
548
+
549
+ '<img' .
550
+ ' id="wppa-like-' . $id . '-' . wppa( 'mocc' ) . '"' .
551
+ ' src="' . $src . '"' .
552
+ ' alt="up"' .
553
+ ' title="' . esc_attr( $lt['title'] ) . '"' .
554
+ ' style="height:16px; margin:0 0 -3px 0; padding:0 4px; box-shadow:none; display:inline;"' .
555
+ ' class="no-shadow"' .
556
+ ' onmouseover="jQuery(this).stop().fadeTo(100, 1.0);"' .
557
+ ' onmouseout="jQuery(this).stop().fadeTo(100, wppaStarOpacity);"' .
558
+ ' onclick="wppaOvlRateIt( \'' . wppa_encrypt_photo( $id ) . '\', 1, ' . wppa( 'mocc' ) . ' );' . '"' .
559
+ ' onload="jQuery(this).trigger(\'onmouseout\');"' .
560
+ ' />';
561
+
562
+ if ( wppa_opt( 'show_avg_rating' ) ) {
563
+ $result .=
564
+ '<span' .
565
+ ' id="wppa-liketext-' . $id . '-' . wppa( 'mocc' ) . '"' .
566
+ ' class="wppa-thumb-text"' .
567
+ ' style="'.__wcs( 'wppa-thumb-text' ).'"' .
568
+ '> ' .
569
+ $lt['display'] .
570
+ '</span>';
571
+ }
572
+ $result .= '</div>';
573
+
574
+ }
575
+
576
+ // Button
577
+ else {
578
+ $buttext = $mylast ? __( wppa_opt( 'voted_button_text' ) , 'wp-photo-album-plus') : __( wppa_opt( 'vote_button_text' ) , 'wp-photo-album-plus');
579
+ $result .= '<input' .
580
+ ' id="wppa-vote-button-' . wppa( 'mocc' ) . '-' . $xid . '"' .
581
+ ' class="wppa-vote-button-thumb"' .
582
+ ' style="margin:0;"' .
583
+ ' type="button"' .
584
+ ' onclick="wppaVoteThumb( ' . wppa( 'mocc' ) . ', \'' . $xid . '\' )"' .
585
+ ' value="'.$buttext.'"' .
586
+ ' />';
587
+ }
588
  }
589
 
590
  // Name
wppa-topten-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
- * Version 6.4.17
7
  */
8
 
9
  class TopTenWidget extends WP_Widget {
@@ -72,6 +72,13 @@ class TopTenWidget extends WP_Widget {
72
 
73
  wppa( 'medals_only', $medalsonly );
74
 
 
 
 
 
 
 
 
75
  // Album specified?
76
  if ( $album ) {
77
 
@@ -179,6 +186,9 @@ class TopTenWidget extends WP_Widget {
179
  }
180
 
181
  // Display the rating
 
 
 
182
  switch ( $instance['sortby'] ) {
183
 
184
  case 'mean_rating':
@@ -210,7 +220,7 @@ class TopTenWidget extends WP_Widget {
210
  $n = wppa_get_rating_count_by_id( $image['id'] );
211
  $widget_content .=
212
  '<div>' .
213
- sprintf( _n( '%d vote', '%d votes', $n, 'wp-photo-album-plus' ), $n ) .
214
  '</div>';
215
  }
216
  if ( $meanrat == 'yes' ) {
@@ -246,7 +256,7 @@ class TopTenWidget extends WP_Widget {
246
  $n = wppa_get_rating_count_by_id( $image['id'] );
247
  $widget_content .=
248
  '<div>' .
249
- sprintf( _n( '%d vote', '%d votes', $n, 'wp-photo-album-plus' ), $n ) .
250
  '</div>';
251
  }
252
  break;
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
+ * Version 6.6.05
7
  */
8
 
9
  class TopTenWidget extends WP_Widget {
72
 
73
  wppa( 'medals_only', $medalsonly );
74
 
75
+ $likes = wppa_opt( 'rating_display_type' ) == 'likes';
76
+
77
+ // When likes only, mean rating has no meaning, chan to (rating)(like)count
78
+ if ( $likes && $instance['sortby'] == 'mean_rating' ) {
79
+ $instance['sortby'] = 'rating_count';
80
+ }
81
+
82
  // Album specified?
83
  if ( $album ) {
84
 
186
  }
187
 
188
  // Display the rating
189
+ if ( $likes ) {
190
+ $lt = wppa_get_like_title_a( $image['id'] );
191
+ }
192
  switch ( $instance['sortby'] ) {
193
 
194
  case 'mean_rating':
220
  $n = wppa_get_rating_count_by_id( $image['id'] );
221
  $widget_content .=
222
  '<div>' .
223
+ ( $likes ? $lt['display'] : sprintf( _n( '%d vote', '%d votes', $n, 'wp-photo-album-plus' ), $n ) ) .
224
  '</div>';
225
  }
226
  if ( $meanrat == 'yes' ) {
256
  $n = wppa_get_rating_count_by_id( $image['id'] );
257
  $widget_content .=
258
  '<div>' .
259
+ ( $likes ? $lt['display'] : sprintf( _n( '%d vote', '%d votes', $n, 'wp-photo-album-plus' ), $n ) ) .
260
  '</div>';
261
  }
262
  break;
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 6.6.04
7
  *
8
  */
9
 
@@ -2385,20 +2385,27 @@ function wppa_mkdir( $path ) {
2385
  function wppa_rate_photo( $id ) {
2386
  global $wpdb;
2387
 
2388
- $ratings = $wpdb->get_results( $wpdb->prepare( "SELECT `value` FROM `".WPPA_RATING."` WHERE `photo` = %s AND `status` = %s", $id, 'publish' ), ARRAY_A );
2389
- $the_value = '0';
2390
- $the_count = '0';
2391
- if ( $ratings ) foreach ($ratings as $rating) {
2392
- if ( $rating['value'] == '-1' ) $the_value += wppa_opt( 'dislike_value' );
2393
- else $the_value += $rating['value'];
2394
- $the_count++;
 
 
 
 
 
 
 
 
 
 
 
 
 
2395
  }
2396
- if ( $the_count ) $the_value /= $the_count;
2397
- if ( $the_value == '10' ) $the_value = '9.9999999'; // mean_rating is a text field. for sort order reasons we make 10 into 9.99999
2398
- $wpdb->query( $wpdb->prepare( "UPDATE `".WPPA_PHOTOS."` SET `mean_rating` = %s WHERE `id` = %s", $the_value, $id ) );
2399
- $ratcount = count($ratings);
2400
- $wpdb->query( $wpdb->prepare( "UPDATE `".WPPA_PHOTOS."` SET `rating_count` = %s WHERE `id` = %s", $ratcount, $id ) );
2401
- wppa_test_for_medal( $id );
2402
  }
2403
 
2404
  function wppa_strip_ext( $file ) {
@@ -3356,5 +3363,38 @@ function wppa_serialize( $array ) {
3356
  $result = trim( $result, ' |' );
3357
  $result = html_entity_decode( $result, ENT_QUOTES );
3358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3359
  return $result;
3360
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 6.6.05
7
  *
8
  */
9
 
2385
  function wppa_rate_photo( $id ) {
2386
  global $wpdb;
2387
 
2388
+ if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
2389
+ $count = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_RATING . "` WHERE `photo` = $id" );
2390
+ $wpdb->query( "UPDATE `" . WPPA_PHOTOS . "` SET `rating_count` = '$count', `mean_rating` = '0' WHERE `id` = $id" );
2391
+ }
2392
+ else {
2393
+ $ratings = $wpdb->get_results( $wpdb->prepare( "SELECT `value` FROM `".WPPA_RATING."` WHERE `photo` = %s AND `status` = %s", $id, 'publish' ), ARRAY_A );
2394
+ $the_value = '0';
2395
+ $the_count = '0';
2396
+ if ( $ratings ) foreach ($ratings as $rating) {
2397
+ if ( $rating['value'] == '-1' ) $the_value += wppa_opt( 'dislike_value' );
2398
+ else $the_value += $rating['value'];
2399
+ $the_count++;
2400
+ }
2401
+ if ( $the_count ) $the_value /= $the_count;
2402
+ if ( wppa_opt( 'rating_max' ) == '1' ) $the_value = '0';
2403
+ if ( $the_value == '10' ) $the_value = '9.9999999'; // mean_rating is a text field. for sort order reasons we make 10 into 9.99999
2404
+ $wpdb->query( $wpdb->prepare( "UPDATE `".WPPA_PHOTOS."` SET `mean_rating` = %s WHERE `id` = %s", $the_value, $id ) );
2405
+ $ratcount = count($ratings);
2406
+ $wpdb->query( $wpdb->prepare( "UPDATE `".WPPA_PHOTOS."` SET `rating_count` = %s WHERE `id` = %s", $ratcount, $id ) );
2407
+ wppa_test_for_medal( $id );
2408
  }
 
 
 
 
 
 
2409
  }
2410
 
2411
  function wppa_strip_ext( $file ) {
3363
  $result = trim( $result, ' |' );
3364
  $result = html_entity_decode( $result, ENT_QUOTES );
3365
 
3366
+ return $result;
3367
+ }
3368
+
3369
+ function wppa_get_like_title_a( $id ) {
3370
+ global $wpdb;
3371
+
3372
+ $me = wppa_get_user();
3373
+ $likes = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_RATING . "` WHERE `photo` = $id" );
3374
+ $mylike = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_RATING . "` WHERE `photo` = $id AND `user` = '$me'" );
3375
+
3376
+ if ( $mylike ) {
3377
+ if ( $likes > 1 ) {
3378
+ $text = sprintf( _n( 'You and %d other person like this', 'You and %d other people like this', $likes - 1 ), $likes - 1 );
3379
+ }
3380
+ else {
3381
+ $text = __( 'You are the first one who likes this', 'wp-photo-album-plus' );
3382
+ }
3383
+ $text .= "\n"
3384
+ . __( 'Click again if you do no longer like this', 'wp-photo-album-plus' );
3385
+ }
3386
+ else {
3387
+ if ( $likes ) {
3388
+ $text = sprintf( _n( '%d person likes this', '%d people like this', $likes, 'wp-photo-album-plus' ), $likes );
3389
+ }
3390
+ else {
3391
+ $text = __( 'Be the first one to like this', 'wp-photo-album-plus' );
3392
+ }
3393
+ }
3394
+ $result['title'] = $text;
3395
+ $result['mine'] = $mylike;
3396
+ $result['total'] = $likes;
3397
+ $result['display'] = sprintf( _n( '%d like', '%d likes', $likes ), $likes );
3398
+
3399
  return $result;
3400
  }
wppa-watermark.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-watermark.php
3
  *
4
  * Functions used for the application of watermarks
5
- * Version 6.6.02
6
  *
7
  */
8
 
@@ -208,10 +208,18 @@ function wppa_create_textual_watermark_file( $args ) {
208
  }
209
 
210
  // Create canvas
 
 
 
 
 
 
 
 
211
  $canvas = imagecreatetruecolor( $canvas_width, $canvas_height );
212
  $bgcolor = imagecolorallocatealpha( $canvas, 0, 0, 0, 127 ); // Transparent
213
- $white = imagecolorallocatealpha( $canvas, 255, 255, 255, $args['transp'] );
214
- $black = imagecolorallocatealpha( $canvas, 0, 0, 0, $args['transp'] );
215
 
216
  imagefill( $canvas, 0, 0, $bgcolor );
217
  // imagerectangle( $canvas, 0, 0, $canvas_width-1, $canvas_height-1, $white ); // debug
2
  /* wppa-watermark.php
3
  *
4
  * Functions used for the application of watermarks
5
+ * Version 6.6.05
6
  *
7
  */
8
 
208
  }
209
 
210
  // Create canvas
211
+ $fg = wppa_opt( 'watermark_fgcol_text' );
212
+ $fgr = hexdec( substr( $fg, 1, 2 ) );
213
+ $fgg = hexdec( substr( $fg, 3, 2 ) );
214
+ $fgb = hexdec( substr( $fg, 5, 2 ) );
215
+ $bg = wppa_opt( 'watermark_bgcol_text' );
216
+ $bgr = hexdec( substr( $bg, 1, 2 ) );
217
+ $bgg = hexdec( substr( $bg, 3, 2 ) );
218
+ $bgb = hexdec( substr( $bg, 5, 2 ) );
219
  $canvas = imagecreatetruecolor( $canvas_width, $canvas_height );
220
  $bgcolor = imagecolorallocatealpha( $canvas, 0, 0, 0, 127 ); // Transparent
221
+ $white = imagecolorallocatealpha( $canvas, $bgr, $bgg, $bgb, $args['transp'] );
222
+ $black = imagecolorallocatealpha( $canvas, $fgr, $fgg, $fgb, $args['transp'] );
223
 
224
  imagefill( $canvas, 0, 0, $bgcolor );
225
  // imagerectangle( $canvas, 0, 0, $canvas_width-1, $canvas_height-1, $white ); // debug
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 6.6.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 = '6604'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '6-6-04-003'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime(true);
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 6.6.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 = '6605'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '6-6-05-003'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime(true);