WP Photo Album Plus - Version 6.5.04

Version Description

Download this release

Release Info

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

Code changes from version 6.5.03 to 6.5.04

js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 6.4.19
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -147,7 +147,7 @@ function wppaInitSettings() {
147
  wppaCheckLinkPageErr('mphoto');
148
  wppaCheckLinkPageErr('topten_widget');
149
  wppaCheckLinkPageErr('slideonly_widget');
150
- wppaCheckLinkPageErr('widget');
151
  wppaCheckLinkPageErr('comment_widget');
152
  wppaCheckLinkPageErr('thumbnail_widget');
153
  wppaCheckLinkPageErr('lasten_widget');
@@ -792,7 +792,7 @@ function wppaCheckCoverImg() {
792
  }
793
 
794
  function wppaCheckPotdLink() {
795
- var lvalue = document.getElementById('widget_linktype').value;
796
  if (lvalue == 'none' || lvalue == 'lightbox' || lvalue == 'file' || lvalue == 'custom') {
797
  jQuery('.wppa_potdlp').css('visibility', 'hidden');
798
  }
@@ -1791,7 +1791,10 @@ function wppaAjaxUpdateOptionValue(slug, elem, multisel) {
1791
  data += '&wppa-nonce='+document.getElementById('wppa-nonce').value;
1792
 
1793
  if ( elem != 0 ) {
1794
- if ( multisel ) {
 
 
 
1795
  data += '&value='+wppaGetSelectionEnumByClass('.'+slug, ',');
1796
  }
1797
  else {
@@ -1900,6 +1903,7 @@ function wppaPhotoStatusChange(id) {
1900
  }
1901
 
1902
  function wppaCheckLinkPageErr(slug) {
 
1903
  var type = 'nil';
1904
  if ( document.getElementById(slug+'_linktype') ) type = document.getElementById(slug+'_linktype').value;
1905
  var page = document.getElementById(slug+'_linkpage').value;
@@ -2125,5 +2129,5 @@ function wppaDismissAdminNotice(notice, elm) {
2125
 
2126
  wppaAjaxUpdateOptionCheckBox(notice, elm);
2127
  jQuery('#wppa-wr-').css('display','none');
2128
-
2129
  }
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 6.5.04
5
  /* Various js routines used in admin pages
6
  */
7
 
147
  wppaCheckLinkPageErr('mphoto');
148
  wppaCheckLinkPageErr('topten_widget');
149
  wppaCheckLinkPageErr('slideonly_widget');
150
+ wppaCheckLinkPageErr('potd');
151
  wppaCheckLinkPageErr('comment_widget');
152
  wppaCheckLinkPageErr('thumbnail_widget');
153
  wppaCheckLinkPageErr('lasten_widget');
792
  }
793
 
794
  function wppaCheckPotdLink() {
795
+ var lvalue = document.getElementById('potd_linktype').value;
796
  if (lvalue == 'none' || lvalue == 'lightbox' || lvalue == 'file' || lvalue == 'custom') {
797
  jQuery('.wppa_potdlp').css('visibility', 'hidden');
798
  }
1791
  data += '&wppa-nonce='+document.getElementById('wppa-nonce').value;
1792
 
1793
  if ( elem != 0 ) {
1794
+ if ( typeof( elem ) == 'number' ) {
1795
+ data += '&value='+elem;
1796
+ }
1797
+ else if ( multisel ) {
1798
  data += '&value='+wppaGetSelectionEnumByClass('.'+slug, ',');
1799
  }
1800
  else {
1903
  }
1904
 
1905
  function wppaCheckLinkPageErr(slug) {
1906
+
1907
  var type = 'nil';
1908
  if ( document.getElementById(slug+'_linktype') ) type = document.getElementById(slug+'_linktype').value;
1909
  var page = document.getElementById(slug+'_linkpage').value;
2129
 
2130
  wppaAjaxUpdateOptionCheckBox(notice, elm);
2131
  jQuery('#wppa-wr-').css('display','none');
2132
+
2133
  }
js/wppa-lightbox.js CHANGED
@@ -3,7 +3,7 @@
3
  // Conatins lightbox modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
- var wppaLightboxVersion = '6.4.19';
7
 
8
  // Global inits
9
  var wppaNormsBtnOpac = 1;
@@ -210,6 +210,7 @@ wppaConsoleLog( 'wppaOvlShow arg='+arg );
210
  // Init the set
211
  wppaOvlUrls = [];
212
  wppaOvlTitles = [];
 
213
  wppaOvlVideoHtmls = [];
214
  wppaOvlAudioHtmls = [];
215
  wppaOvlVideoNaturalWidths = [];
@@ -257,6 +258,7 @@ wppaConsoleLog( 'wppaOvlShow arg='+arg );
257
  else {
258
  wppaOvlTitles[j] = wppaRepairScriptTags( anchor.title );
259
  }
 
260
  wppaOvlVideoHtmls[j] = jQuery( anchor ).attr( 'data-videohtml' ) ? decodeURI( jQuery( anchor ).attr( 'data-videohtml' ) ) : '';
261
  wppaOvlAudioHtmls[j] = jQuery( anchor ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( anchor ).attr( 'data-audiohtml' ) ) : '';
262
  wppaOvlVideoNaturalWidths[j] = jQuery( anchor ).attr( 'data-videonatwidth' ) ? jQuery( anchor ).attr( 'data-videonatwidth' ) : '';
@@ -279,6 +281,7 @@ wppaConsoleLog( 'wppaOvlShow arg='+arg );
279
  else {
280
  wppaOvlTitles[0] = wppaRepairScriptTags( arg.title );
281
  }
 
282
  wppaOvlVideoHtmls[0] = jQuery( arg ).attr( 'data-videohtml' ) ? decodeURI( jQuery( arg ).attr( 'data-videohtml' ) ) : '';
283
  wppaOvlAudioHtmls[0] = jQuery( arg ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( arg ).attr( 'data-audiohtml' ) ) : '';
284
  wppaOvlVideoNaturalWidths[0] = jQuery( arg ).attr( 'data-videonatwidth' ) ? jQuery( arg ).attr( 'data-videonatwidth' ) : '';
@@ -303,7 +306,7 @@ wppaConsoleLog( 'wppaOvlShow arg='+arg );
303
  function _wppaOvlShow( idx ) {
304
  wppaConsoleLog( '_wppaOvlShow, idx='+idx );
305
 
306
- // Globalize indesx
307
  wppaOvlCurIdx = idx;
308
 
309
  // Show spinner
@@ -383,7 +386,9 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
383
  ' ontouchcancel="wppaTouchCancel( event );"' +
384
  ' onpause="wppaOvlVideoPlaying = false;"' +
385
  ' onplay="wppaOvlVideoPlaying = true;"' +
386
- ' style="border:none; width:'+jQuery( window ).width()+'px; box-shadow:none; position:absolute;" >'+
 
 
387
  wppaOvlVideoHtmls[idx]+
388
  '</video>'+
389
  '<div style="height: 20px; width: 100%; position:absolute; top:0; left:0;" onmouseover="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'visible\');" onmouseout="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'hidden\');wppaShowLegenda=\'hidden\';" >';
@@ -408,6 +413,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
408
  ' ontouchcancel="wppaTouchCancel( event );"'+
409
  ' src="'+wppaOvlUrls[idx]+'"'+
410
  ' style="border:none; width:'+jQuery( window ).width()+'px; visibility:hidden; box-shadow:none; position:absolute;"'+
 
411
  ' />';
412
  if ( wppaHasAudio ) {
413
  html += '<audio' +
@@ -517,8 +523,8 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
517
 
518
  html += '<video' +
519
  ' id="wppa-overlay-img"' +
520
- ' onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);"' +
521
- ' onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);"' +
522
  ' preload="metadata"' +
523
  ( wppaOvlVideoStart ? ' autoplay' : '' ) +
524
  ' onpause="wppaOvlVideoPlaying = false;"' +
@@ -542,6 +548,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
542
  'margin:0;' +
543
  'padding:0;' +
544
  '"' +
 
545
  ' >' +
546
  wppaOvlVideoHtmls[idx] +
547
  '</video>';
@@ -553,8 +560,8 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
553
  else {
554
  html += '<img' +
555
  ' id="wppa-overlay-img"'+
556
- ' onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);"' +
557
- ' onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);"' +
558
  ' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"' +
559
  ' ontouchend="wppaTouchEnd( event );"' +
560
  ' ontouchmove="wppaTouchMove( event );"' +
@@ -574,6 +581,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
574
  'margin:0;' +
575
  'padding:0;' +
576
  '"' +
 
577
  ' />';
578
 
579
  // Audio on not fullsize
3
  // Conatins lightbox modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaLightboxVersion = '6.5.04';
7
 
8
  // Global inits
9
  var wppaNormsBtnOpac = 1;
210
  // Init the set
211
  wppaOvlUrls = [];
212
  wppaOvlTitles = [];
213
+ wppaOvlAlts = [];
214
  wppaOvlVideoHtmls = [];
215
  wppaOvlAudioHtmls = [];
216
  wppaOvlVideoNaturalWidths = [];
258
  else {
259
  wppaOvlTitles[j] = wppaRepairScriptTags( anchor.title );
260
  }
261
+ wppaOvlAlts[j] = jQuery( anchor ).attr( 'data-alt' ) ? jQuery( anchor ).attr( 'data-alt' ) : '';
262
  wppaOvlVideoHtmls[j] = jQuery( anchor ).attr( 'data-videohtml' ) ? decodeURI( jQuery( anchor ).attr( 'data-videohtml' ) ) : '';
263
  wppaOvlAudioHtmls[j] = jQuery( anchor ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( anchor ).attr( 'data-audiohtml' ) ) : '';
264
  wppaOvlVideoNaturalWidths[j] = jQuery( anchor ).attr( 'data-videonatwidth' ) ? jQuery( anchor ).attr( 'data-videonatwidth' ) : '';
281
  else {
282
  wppaOvlTitles[0] = wppaRepairScriptTags( arg.title );
283
  }
284
+ wppaOvlAlts[0] = jQuery( arg ).attr( 'data-alt' ) ? jQuery( arg ).attr( 'data-alt' ) : '';
285
  wppaOvlVideoHtmls[0] = jQuery( arg ).attr( 'data-videohtml' ) ? decodeURI( jQuery( arg ).attr( 'data-videohtml' ) ) : '';
286
  wppaOvlAudioHtmls[0] = jQuery( arg ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( arg ).attr( 'data-audiohtml' ) ) : '';
287
  wppaOvlVideoNaturalWidths[0] = jQuery( arg ).attr( 'data-videonatwidth' ) ? jQuery( arg ).attr( 'data-videonatwidth' ) : '';
306
  function _wppaOvlShow( idx ) {
307
  wppaConsoleLog( '_wppaOvlShow, idx='+idx );
308
 
309
+ // Globalize index
310
  wppaOvlCurIdx = idx;
311
 
312
  // Show spinner
386
  ' ontouchcancel="wppaTouchCancel( event );"' +
387
  ' onpause="wppaOvlVideoPlaying = false;"' +
388
  ' onplay="wppaOvlVideoPlaying = true;"' +
389
+ ' style="border:none; width:'+jQuery( window ).width()+'px; box-shadow:none; position:absolute;"' +
390
+ ' alt="'+wppaOvlAlts[idx]+'"' +
391
+ ' >'+
392
  wppaOvlVideoHtmls[idx]+
393
  '</video>'+
394
  '<div style="height: 20px; width: 100%; position:absolute; top:0; left:0;" onmouseover="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'visible\');" onmouseout="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'hidden\');wppaShowLegenda=\'hidden\';" >';
413
  ' ontouchcancel="wppaTouchCancel( event );"'+
414
  ' src="'+wppaOvlUrls[idx]+'"'+
415
  ' style="border:none; width:'+jQuery( window ).width()+'px; visibility:hidden; box-shadow:none; position:absolute;"'+
416
+ ' alt="'+wppaOvlAlts[idx]+'"'+
417
  ' />';
418
  if ( wppaHasAudio ) {
419
  html += '<audio' +
523
 
524
  html += '<video' +
525
  ' id="wppa-overlay-img"' +
526
+ ' onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);"' +
527
+ ' onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);"' +
528
  ' preload="metadata"' +
529
  ( wppaOvlVideoStart ? ' autoplay' : '' ) +
530
  ' onpause="wppaOvlVideoPlaying = false;"' +
548
  'margin:0;' +
549
  'padding:0;' +
550
  '"' +
551
+ ' alt="'+wppaOvlAlts[idx]+'"' +
552
  ' >' +
553
  wppaOvlVideoHtmls[idx] +
554
  '</video>';
560
  else {
561
  html += '<img' +
562
  ' id="wppa-overlay-img"'+
563
+ ' onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);"' +
564
+ ' onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);"' +
565
  ' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"' +
566
  ' ontouchend="wppaTouchEnd( event );"' +
567
  ' ontouchmove="wppaTouchMove( event );"' +
581
  'margin:0;' +
582
  'padding:0;' +
583
  '"' +
584
+ ' alt="'+wppaOvlAlts[idx]+'"' +
585
  ' />';
586
 
587
  // Audio on not fullsize
js/wppa-lightbox.min.js CHANGED
@@ -4,7 +4,7 @@
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
- var wppaLightboxVersion='6.4.19';var wppaNormsBtnOpac=1;var wppaIsVideo=false;var wppaHasAudio=false;var wppaOvlImgs=[];var wppaKbHandlerInstalled=false;var wppaOvlMode='normal';var wppaOvlCurIdx=0;var wppaSavedContainerWidth;var wppaSavedContainerHeight;var wppaSavedMarginLeft;var wppaSavedMarginTop;var wppaSavedImageWidth;var wppaSavedImageHeight;jQuery(document).ready(function(e){wppaInitOverlay();});jQuery(window).resize(function(){jQuery("#wppa-overlay-bg").css({height:window.innerHeight,width:window.innerWidth,});wppaOvlResize();});function wppaDoOnOrientationChange(e){if(wppaOvlMode!='normal'&&document.getElementById('wppa-overlay-img')){setTimeout('wppaOvlShow( '+wppaOvlIdx+' )',100);return;}}
8
  function wppaOvlKeyboardHandler(e){var keycode;var escapeKey;if(e==null){keycode=event.keyCode;escapeKey=27;}else{keycode=e.keyCode;escapeKey=27;}
9
  var key=String.fromCharCode(keycode).toLowerCase();switch(keycode){case escapeKey:wppaStopVideo(mocc);if(wppaOvlMode!='normal'){wppaOvlNorm(true);}
10
  wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext();break;}
@@ -21,18 +21,18 @@ if(exit){wppaOvlMode=wppaOvlModeInitial;return;}
21
  setTimeout('wppaOvlShow( '+wppaOvlIdx+' )',1000);}
22
  function wppaOvlShow(arg){wppaConsoleLog('wppaOvlShow arg='+arg);if(wppaOvlFirst){jQuery('#weaver-final').removeClass('wvr-hide-bang');jQuery('#wppa-overlay-bg').fadeTo(3,wppaOvlOpacity);if(!wppaKbHandlerInstalled){jQuery(document).on('keydown',wppaOvlKeyboardHandler);wppaKbHandlerInstalled=true;}
23
  jQuery('#wppa-overlay-bg').css({width:window.innerWidth,height:window.innerHeight,});if(wppaOvlModeInitial!='normal'){wppaOvlFull(true);}}
24
- if(typeof(arg)=='object'){wppaOvlUrls=[];wppaOvlTitles=[];wppaOvlVideoHtmls=[];wppaOvlAudioHtmls=[];wppaOvlVideoNaturalWidths=[];wppaOvlVideoNaturalHeights=[];wppaOvlImgs=[];wppaOvlIdx=0;var rel;if(arg.rel){rel=arg.rel;}
25
  else if(jQuery(arg).attr('data-rel')){rel=jQuery(arg).attr('data-rel');}
26
  else{rel=false;}
27
  var temp=rel.split('[');if(temp[1]){var setname=temp[1];var anchors=jQuery('a');var anchor;var i,j=0;for(i=0;i<anchors.length;i++){anchor=anchors[i];if(jQuery(anchor).attr('data-rel')){temp=jQuery(anchor).attr('data-rel').split("[");}
28
  else{temp=false;}
29
  if(temp.length>1){if(temp[0]=='wppa'&&temp[1]==setname){wppaOvlUrls[j]=anchor.href;if(jQuery(anchor).attr('data-lbtitle')){wppaOvlTitles[j]=wppaRepairScriptTags(jQuery(anchor).attr('data-lbtitle'));}
30
  else{wppaOvlTitles[j]=wppaRepairScriptTags(anchor.title);}
31
- wppaOvlVideoHtmls[j]=jQuery(anchor).attr('data-videohtml')?decodeURI(jQuery(anchor).attr('data-videohtml')):'';wppaOvlAudioHtmls[j]=jQuery(anchor).attr('data-audiohtml')?decodeURI(jQuery(anchor).attr('data-audiohtml')):'';wppaOvlVideoNaturalWidths[j]=jQuery(anchor).attr('data-videonatwidth')?jQuery(anchor).attr('data-videonatwidth'):'';wppaOvlVideoNaturalHeights[j]=jQuery(anchor).attr('data-videonatheight')?jQuery(anchor).attr('data-videonatheight'):'';if(anchor.href==arg.href){wppaOvlIdx=j;}
32
  j++;}}}}
33
  else{wppaOvlUrls[0]=arg.href;if(jQuery(arg).attr('data-lbtitle')){wppaOvlTitles[0]=wppaRepairScriptTags(jQuery(arg).attr('data-lbtitle'));}
34
  else{wppaOvlTitles[0]=wppaRepairScriptTags(arg.title);}
35
- wppaOvlVideoHtmls[0]=jQuery(arg).attr('data-videohtml')?decodeURI(jQuery(arg).attr('data-videohtml')):'';wppaOvlAudioHtmls[0]=jQuery(arg).attr('data-audiohtml')?decodeURI(jQuery(arg).attr('data-audiohtml')):'';wppaOvlVideoNaturalWidths[0]=jQuery(arg).attr('data-videonatwidth')?jQuery(arg).attr('data-videonatwidth'):'';wppaOvlVideoNaturalHeights[0]=jQuery(arg).attr('data-videonatheight')?jQuery(arg).attr('data-videonatheight'):'';wppaOvlImgs[0]
36
  wppaOvlIdx=0;}}
37
  else{wppaOvlIdx=arg;}
38
  setTimeout(function(){_wppaOvlShow(wppaOvlIdx)},100);}
@@ -44,10 +44,10 @@ if(!wppaOvlRunning){if(wppaOvlIdx==0){prev=wppaOvlUrls.length-1;}
44
  else{prev=wppaOvlIdx-1;}
45
  if(wppaOvlVideoHtmls[prev]==''){wppaOvlImgs[prev]=new Image();wppaOvlImgs[prev].src=wppaOvlUrls[prev];wppaConsoleLog('Preloading < '+(prev+1));}}
46
  wppaPhotoId=wppaUrlToId(wppaOvlUrls[idx]);_bumpViewCount(wppaPhotoId);wppaOvlIsSingle=(wppaOvlUrls.length==1);if(wppaOvlMode!='normal'){var html;if(wppaIsVideo){html='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+jQuery(window).width()+'px; height:'+jQuery(window).height()+'px; left:0px; top:0px; text-align:center;" >'+'<video id="wppa-overlay-img" controls preload="metadata"'+
47
- (wppaOvlVideoStart?' autoplay':'')+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );"'+' onpause="wppaOvlVideoPlaying = false;"'+' onplay="wppaOvlVideoPlaying = true;"'+' style="border:none; width:'+jQuery(window).width()+'px; box-shadow:none; position:absolute;" >'+
48
  wppaOvlVideoHtmls[idx]+'</video>'+'<div style="height: 20px; width: 100%; position:absolute; top:0; left:0;" onmouseover="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'visible\');" onmouseout="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'hidden\');wppaShowLegenda=\'hidden\';" >';if(wppaOvlShowLegenda){html+='<div id="wppa-ovl-legenda-2" style="position:fixed; left:0; top:0; background-color:'+(wppaOvlTheme=='black'?'#272727':'#a7a7a7')+'; color:'+(wppaOvlTheme=='black'?'#a7a7a7':'#272727')+'; visibility:'+wppaShowLegenda+';" >'+'Mode='+wppaOvlMode+'. '+(wppaOvlIsSingle?wppaOvlFullLegendaSingle:wppaOvlFullLegenda)+'</div>';}
49
  html+='</div>';'</div>';}
50
- else{html='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+jQuery(window).width()+'px; height:'+jQuery(window).height()+'px; left:0px; top:0px; text-align:center;" >'+'<img id="wppa-overlay-img"'+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );"'+' src="'+wppaOvlUrls[idx]+'"'+' style="border:none; width:'+jQuery(window).width()+'px; visibility:hidden; box-shadow:none; position:absolute;"'+' />';if(wppaHasAudio){html+='<audio'+' id="wppa-overlay-audio"'+' class="wppa-overlay-audio"'+' data-from="wppa"'+' preload="metadata"'+
51
  ((wppaOvlAudioStart)?' autoplay':'')+' onpause="wppaOvlAudioPlaying = false;"'+' onplay="wppaOvlAudioPlaying = true;"'+' style="'+'width:100%;'+'position:absolute;'+'left:0px;'+'bottom:0px;'+'padding:0;'+'"'+' controls'+' >'+
52
  wppaOvlAudioHtmls[idx]+'</audio>';}
53
  html+='<div style="height: 20px; width: 100%; position:absolute; top:0; left:0;" onmouseover="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'visible\');" onmouseout="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'hidden\');wppaShowLegenda=\'hidden\';" >';if(wppaOvlShowLegenda){html+='<div id="wppa-ovl-legenda-2" style="position:fixed; left:0; top:0; background-color:'+(wppaOvlTheme=='black'?'#272727':'#a7a7a7')+'; color:'+(wppaOvlTheme=='black'?'#a7a7a7':'#272727')+'; visibility:'+wppaShowLegenda+';" >'+'Mode='+wppaOvlMode+'. '+(wppaOvlIsSingle?wppaOvlFullLegendaSingle:wppaOvlFullLegenda)+'</div>';}
@@ -60,9 +60,9 @@ else{wppaOvlFsPhotoId=0;}
60
  wppaOvlFirst=false;return false;}
61
  else{wppaOvlFsPhotoId=0;wppaPhotoId=0;wppaStopVideo(0);var txtcol=wppaOvlTheme=='black'?'#a7a7a7':'#272727';if(wppaOvlFontColor){txtcol=wppaOvlFontColor;}
62
  var showNav=wppaOvlUrls.length>1;jQuery('#wppa-overlay-ic').css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop,});var html='';html+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >';if(wppaIsVideo){html+='<video'+' id="wppa-overlay-img"'+' onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);"'+' onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);"'+' preload="metadata"'+
63
- (wppaOvlVideoStart?' autoplay':'')+' onpause="wppaOvlVideoPlaying = false;"'+' onplay="wppaOvlVideoPlaying = true;"'+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );" '+' controls'+' style="'+'border-width:'+wppaOvlBorderWidth+'px '+wppaOvlBorderWidth+'px 0;'+'border-style:solid;'+'border-color:'+wppaOvlTheme+';'+'width:'+wppaSavedImageWidth+'px;'+'height:'+wppaSavedImageHeight+'px;'+'box-shadow:none;'+'box-sizing:content-box;'+'position:relative;'+'border-top-left-radius:'+wppaOvlRadius+'px;'+'border-top-right-radius:'+wppaOvlRadius+'px;'+'margin:0;'+'padding:0;'+'"'+' >'+
64
  wppaOvlVideoHtmls[idx]+'</video>';wppaOvlIsVideo=true;}
65
- else{html+='<img'+' id="wppa-overlay-img"'+' onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);"'+' onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);"'+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );"'+' src="'+wppaOvlUrls[idx]+'"'+' style="'+'border-width:'+wppaOvlBorderWidth+'px '+wppaOvlBorderWidth+'px 0;'+'border-style:solid;'+'border-color:'+wppaOvlTheme+';'+'width:'+wppaSavedImageWidth+'px;'+'height:'+wppaSavedImageHeight+'px;'+'box-shadow:none;'+'box-sizing:content-box;'+'position:relative;'+'border-top-left-radius:'+wppaOvlRadius+'px;'+'border-top-right-radius:'+wppaOvlRadius+'px;'+'margin:0;'+'padding:0;'+'"'+' />';if(wppaHasAudio){html+='<audio'+' id="wppa-overlay-audio"'+' class="wppa-overlay-audio"'+' data-from="wppa"'+' preload="metadata"'+' onpause="wppaOvlAudioPlaying = false;"'+' onplay="wppaOvlAudioPlaying = true;"'+' style="'+'width:100%;'+'position:absolute;'+'box-shadow:none;'+'left:0;'+'bottom:0;'+'padding:0 '+wppaOvlBorderWidth+'px;'+'margin:0;'+'background-color:transparent;'+'box-sizing:border-box;'+'"'+' controls'+' >'+
66
  wppaOvlAudioHtmls[idx]+'</audio>';}
67
  wppaOvlIsVideo=false;}
68
  html+='<img'+' id="wppa-overlay-qt-img"'+' class="wppa-ovl-nav-btn"'+' src="'+wppaStopSymbolUrl+'"'+' style="'+'position:absolute;'+'z-index:100101;'+'right:'+wppaOvlBorderWidth+'px;'+'top:'+wppaOvlBorderWidth+'px;'+'box-shadow:none;'+'cursor:pointer;'+'height:'+wppaStopSymbolSize+'px;'+
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
+ var wppaLightboxVersion='6.5.04';var wppaNormsBtnOpac=1;var wppaIsVideo=false;var wppaHasAudio=false;var wppaOvlImgs=[];var wppaKbHandlerInstalled=false;var wppaOvlMode='normal';var wppaOvlCurIdx=0;var wppaSavedContainerWidth;var wppaSavedContainerHeight;var wppaSavedMarginLeft;var wppaSavedMarginTop;var wppaSavedImageWidth;var wppaSavedImageHeight;jQuery(document).ready(function(e){wppaInitOverlay();});jQuery(window).resize(function(){jQuery("#wppa-overlay-bg").css({height:window.innerHeight,width:window.innerWidth,});wppaOvlResize();});function wppaDoOnOrientationChange(e){if(wppaOvlMode!='normal'&&document.getElementById('wppa-overlay-img')){setTimeout('wppaOvlShow( '+wppaOvlIdx+' )',100);return;}}
8
  function wppaOvlKeyboardHandler(e){var keycode;var escapeKey;if(e==null){keycode=event.keyCode;escapeKey=27;}else{keycode=e.keyCode;escapeKey=27;}
9
  var key=String.fromCharCode(keycode).toLowerCase();switch(keycode){case escapeKey:wppaStopVideo(mocc);if(wppaOvlMode!='normal'){wppaOvlNorm(true);}
10
  wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext();break;}
21
  setTimeout('wppaOvlShow( '+wppaOvlIdx+' )',1000);}
22
  function wppaOvlShow(arg){wppaConsoleLog('wppaOvlShow arg='+arg);if(wppaOvlFirst){jQuery('#weaver-final').removeClass('wvr-hide-bang');jQuery('#wppa-overlay-bg').fadeTo(3,wppaOvlOpacity);if(!wppaKbHandlerInstalled){jQuery(document).on('keydown',wppaOvlKeyboardHandler);wppaKbHandlerInstalled=true;}
23
  jQuery('#wppa-overlay-bg').css({width:window.innerWidth,height:window.innerHeight,});if(wppaOvlModeInitial!='normal'){wppaOvlFull(true);}}
24
+ if(typeof(arg)=='object'){wppaOvlUrls=[];wppaOvlTitles=[];wppaOvlAlts=[];wppaOvlVideoHtmls=[];wppaOvlAudioHtmls=[];wppaOvlVideoNaturalWidths=[];wppaOvlVideoNaturalHeights=[];wppaOvlImgs=[];wppaOvlIdx=0;var rel;if(arg.rel){rel=arg.rel;}
25
  else if(jQuery(arg).attr('data-rel')){rel=jQuery(arg).attr('data-rel');}
26
  else{rel=false;}
27
  var temp=rel.split('[');if(temp[1]){var setname=temp[1];var anchors=jQuery('a');var anchor;var i,j=0;for(i=0;i<anchors.length;i++){anchor=anchors[i];if(jQuery(anchor).attr('data-rel')){temp=jQuery(anchor).attr('data-rel').split("[");}
28
  else{temp=false;}
29
  if(temp.length>1){if(temp[0]=='wppa'&&temp[1]==setname){wppaOvlUrls[j]=anchor.href;if(jQuery(anchor).attr('data-lbtitle')){wppaOvlTitles[j]=wppaRepairScriptTags(jQuery(anchor).attr('data-lbtitle'));}
30
  else{wppaOvlTitles[j]=wppaRepairScriptTags(anchor.title);}
31
+ wppaOvlAlts[j]=jQuery(anchor).attr('data-alt')?jQuery(anchor).attr('data-alt'):'';wppaOvlVideoHtmls[j]=jQuery(anchor).attr('data-videohtml')?decodeURI(jQuery(anchor).attr('data-videohtml')):'';wppaOvlAudioHtmls[j]=jQuery(anchor).attr('data-audiohtml')?decodeURI(jQuery(anchor).attr('data-audiohtml')):'';wppaOvlVideoNaturalWidths[j]=jQuery(anchor).attr('data-videonatwidth')?jQuery(anchor).attr('data-videonatwidth'):'';wppaOvlVideoNaturalHeights[j]=jQuery(anchor).attr('data-videonatheight')?jQuery(anchor).attr('data-videonatheight'):'';if(anchor.href==arg.href){wppaOvlIdx=j;}
32
  j++;}}}}
33
  else{wppaOvlUrls[0]=arg.href;if(jQuery(arg).attr('data-lbtitle')){wppaOvlTitles[0]=wppaRepairScriptTags(jQuery(arg).attr('data-lbtitle'));}
34
  else{wppaOvlTitles[0]=wppaRepairScriptTags(arg.title);}
35
+ wppaOvlAlts[0]=jQuery(arg).attr('data-alt')?jQuery(arg).attr('data-alt'):'';wppaOvlVideoHtmls[0]=jQuery(arg).attr('data-videohtml')?decodeURI(jQuery(arg).attr('data-videohtml')):'';wppaOvlAudioHtmls[0]=jQuery(arg).attr('data-audiohtml')?decodeURI(jQuery(arg).attr('data-audiohtml')):'';wppaOvlVideoNaturalWidths[0]=jQuery(arg).attr('data-videonatwidth')?jQuery(arg).attr('data-videonatwidth'):'';wppaOvlVideoNaturalHeights[0]=jQuery(arg).attr('data-videonatheight')?jQuery(arg).attr('data-videonatheight'):'';wppaOvlImgs[0]
36
  wppaOvlIdx=0;}}
37
  else{wppaOvlIdx=arg;}
38
  setTimeout(function(){_wppaOvlShow(wppaOvlIdx)},100);}
44
  else{prev=wppaOvlIdx-1;}
45
  if(wppaOvlVideoHtmls[prev]==''){wppaOvlImgs[prev]=new Image();wppaOvlImgs[prev].src=wppaOvlUrls[prev];wppaConsoleLog('Preloading < '+(prev+1));}}
46
  wppaPhotoId=wppaUrlToId(wppaOvlUrls[idx]);_bumpViewCount(wppaPhotoId);wppaOvlIsSingle=(wppaOvlUrls.length==1);if(wppaOvlMode!='normal'){var html;if(wppaIsVideo){html='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+jQuery(window).width()+'px; height:'+jQuery(window).height()+'px; left:0px; top:0px; text-align:center;" >'+'<video id="wppa-overlay-img" controls preload="metadata"'+
47
+ (wppaOvlVideoStart?' autoplay':'')+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );"'+' onpause="wppaOvlVideoPlaying = false;"'+' onplay="wppaOvlVideoPlaying = true;"'+' style="border:none; width:'+jQuery(window).width()+'px; box-shadow:none; position:absolute;"'+' alt="'+wppaOvlAlts[idx]+'"'+' >'+
48
  wppaOvlVideoHtmls[idx]+'</video>'+'<div style="height: 20px; width: 100%; position:absolute; top:0; left:0;" onmouseover="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'visible\');" onmouseout="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'hidden\');wppaShowLegenda=\'hidden\';" >';if(wppaOvlShowLegenda){html+='<div id="wppa-ovl-legenda-2" style="position:fixed; left:0; top:0; background-color:'+(wppaOvlTheme=='black'?'#272727':'#a7a7a7')+'; color:'+(wppaOvlTheme=='black'?'#a7a7a7':'#272727')+'; visibility:'+wppaShowLegenda+';" >'+'Mode='+wppaOvlMode+'. '+(wppaOvlIsSingle?wppaOvlFullLegendaSingle:wppaOvlFullLegenda)+'</div>';}
49
  html+='</div>';'</div>';}
50
+ else{html='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+jQuery(window).width()+'px; height:'+jQuery(window).height()+'px; left:0px; top:0px; text-align:center;" >'+'<img id="wppa-overlay-img"'+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );"'+' src="'+wppaOvlUrls[idx]+'"'+' style="border:none; width:'+jQuery(window).width()+'px; visibility:hidden; box-shadow:none; position:absolute;"'+' alt="'+wppaOvlAlts[idx]+'"'+' />';if(wppaHasAudio){html+='<audio'+' id="wppa-overlay-audio"'+' class="wppa-overlay-audio"'+' data-from="wppa"'+' preload="metadata"'+
51
  ((wppaOvlAudioStart)?' autoplay':'')+' onpause="wppaOvlAudioPlaying = false;"'+' onplay="wppaOvlAudioPlaying = true;"'+' style="'+'width:100%;'+'position:absolute;'+'left:0px;'+'bottom:0px;'+'padding:0;'+'"'+' controls'+' >'+
52
  wppaOvlAudioHtmls[idx]+'</audio>';}
53
  html+='<div style="height: 20px; width: 100%; position:absolute; top:0; left:0;" onmouseover="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'visible\');" onmouseout="jQuery(\'#wppa-ovl-legenda-2\').css(\'visibility\',\'hidden\');wppaShowLegenda=\'hidden\';" >';if(wppaOvlShowLegenda){html+='<div id="wppa-ovl-legenda-2" style="position:fixed; left:0; top:0; background-color:'+(wppaOvlTheme=='black'?'#272727':'#a7a7a7')+'; color:'+(wppaOvlTheme=='black'?'#a7a7a7':'#272727')+'; visibility:'+wppaShowLegenda+';" >'+'Mode='+wppaOvlMode+'. '+(wppaOvlIsSingle?wppaOvlFullLegendaSingle:wppaOvlFullLegenda)+'</div>';}
60
  wppaOvlFirst=false;return false;}
61
  else{wppaOvlFsPhotoId=0;wppaPhotoId=0;wppaStopVideo(0);var txtcol=wppaOvlTheme=='black'?'#a7a7a7':'#272727';if(wppaOvlFontColor){txtcol=wppaOvlFontColor;}
62
  var showNav=wppaOvlUrls.length>1;jQuery('#wppa-overlay-ic').css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop,});var html='';html+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >';if(wppaIsVideo){html+='<video'+' id="wppa-overlay-img"'+' onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);"'+' onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);"'+' preload="metadata"'+
63
+ (wppaOvlVideoStart?' autoplay':'')+' onpause="wppaOvlVideoPlaying = false;"'+' onplay="wppaOvlVideoPlaying = true;"'+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );" '+' controls'+' style="'+'border-width:'+wppaOvlBorderWidth+'px '+wppaOvlBorderWidth+'px 0;'+'border-style:solid;'+'border-color:'+wppaOvlTheme+';'+'width:'+wppaSavedImageWidth+'px;'+'height:'+wppaSavedImageHeight+'px;'+'box-shadow:none;'+'box-sizing:content-box;'+'position:relative;'+'border-top-left-radius:'+wppaOvlRadius+'px;'+'border-top-right-radius:'+wppaOvlRadius+'px;'+'margin:0;'+'padding:0;'+'"'+' alt="'+wppaOvlAlts[idx]+'"'+' >'+
64
  wppaOvlVideoHtmls[idx]+'</video>';wppaOvlIsVideo=true;}
65
+ else{html+='<img'+' id="wppa-overlay-img"'+' onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);"'+' onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);"'+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );"'+' src="'+wppaOvlUrls[idx]+'"'+' style="'+'border-width:'+wppaOvlBorderWidth+'px '+wppaOvlBorderWidth+'px 0;'+'border-style:solid;'+'border-color:'+wppaOvlTheme+';'+'width:'+wppaSavedImageWidth+'px;'+'height:'+wppaSavedImageHeight+'px;'+'box-shadow:none;'+'box-sizing:content-box;'+'position:relative;'+'border-top-left-radius:'+wppaOvlRadius+'px;'+'border-top-right-radius:'+wppaOvlRadius+'px;'+'margin:0;'+'padding:0;'+'"'+' alt="'+wppaOvlAlts[idx]+'"'+' />';if(wppaHasAudio){html+='<audio'+' id="wppa-overlay-audio"'+' class="wppa-overlay-audio"'+' data-from="wppa"'+' preload="metadata"'+' onpause="wppaOvlAudioPlaying = false;"'+' onplay="wppaOvlAudioPlaying = true;"'+' style="'+'width:100%;'+'position:absolute;'+'box-shadow:none;'+'left:0;'+'bottom:0;'+'padding:0 '+wppaOvlBorderWidth+'px;'+'margin:0;'+'background-color:transparent;'+'box-sizing:border-box;'+'"'+' controls'+' >'+
66
  wppaOvlAudioHtmls[idx]+'</audio>';}
67
  wppaOvlIsVideo=false;}
68
  html+='<img'+' id="wppa-overlay-qt-img"'+' class="wppa-ovl-nav-btn"'+' src="'+wppaStopSymbolUrl+'"'+' style="'+'position:absolute;'+'z-index:100101;'+'right:'+wppaOvlBorderWidth+'px;'+'top:'+wppaOvlBorderWidth+'px;'+'box-shadow:none;'+'cursor:pointer;'+'height:'+wppaStopSymbolSize+'px;'+
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.02';
7
 
8
  // This is an entrypoint to load the slide data
9
  function wppaStoreSlideInfo(
@@ -36,7 +36,9 @@ function wppaStoreSlideInfo(
36
  hiresurl, // The url to the hi res ( source ) image file
37
  videohtml, // The html for the video, or ''
38
  audiohtml,
39
- waittext // The time you have to wait before you can vote again on the photo
 
 
40
  ) {
41
 
42
  var cursor;
@@ -86,6 +88,7 @@ function wppaStoreSlideInfo(
86
  wppaVideoPlaying[mocc] = false;
87
  wppaAudioPlaying[mocc] = false;
88
  _wppaWaitTexts[mocc] = [];
 
89
  }
90
 
91
  // Cursor
@@ -102,13 +105,16 @@ function wppaStoreSlideInfo(
102
 
103
  // Fill _wppaSlides[mocc][id]
104
  if ( _wppaIsVideo[mocc][id] ) {
105
- _wppaSlides[mocc][id] = ' alt="' + wppaTrimAlt( name ) + '" class="theimg theimg-'+mocc+' big" ';
106
  if ( wppaSlideVideoStart && wppaLightBox[mocc] == '' ) {
107
  _wppaSlides[mocc][id] += ' autoplay ';
108
  }
 
 
 
109
  }
110
  else {
111
- _wppaSlides[mocc][id] = ' src="' + url + '" alt="' + wppaTrimAlt( name ) + '" class="theimg theimg-'+mocc+' big stereo" ';
112
  }
113
 
114
  // Add swipe
@@ -176,6 +182,7 @@ function wppaStoreSlideInfo(
176
  _wppaVideoNatWidth[mocc][id] = width;
177
  _wppaVideoNatHeight[mocc][id] = height;
178
  _wppaWaitTexts[mocc][id] = waittext;
 
179
  }
180
 
181
  // These functions check the validity and store the users request to be executed later if busy and if applicable.
@@ -1790,7 +1797,7 @@ function _wppaShowMetaData( mocc, key ) {
1790
  }
1791
 
1792
  function wppaGetSlideshowTimeout( mocc ) {
1793
-
1794
  var time;
1795
  if ( _wppaTimeOut[mocc] == 'random' ) {
1796
  var min = 2 * wppaAnimationSpeed;
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(
36
  hiresurl, // The url to the hi res ( source ) image file
37
  videohtml, // The html for the video, or ''
38
  audiohtml,
39
+ waittext, // The time you have to wait before you can vote again on the photo
40
+ imagealt,
41
+ posterurl
42
  ) {
43
 
44
  var cursor;
88
  wppaVideoPlaying[mocc] = false;
89
  wppaAudioPlaying[mocc] = false;
90
  _wppaWaitTexts[mocc] = [];
91
+ _wppaImageAlt[mocc] = [];
92
  }
93
 
94
  // Cursor
105
 
106
  // Fill _wppaSlides[mocc][id]
107
  if ( _wppaIsVideo[mocc][id] ) {
108
+ _wppaSlides[mocc][id] = ' alt="' + imagealt + '" class="theimg theimg-'+mocc+' big" ';
109
  if ( wppaSlideVideoStart && wppaLightBox[mocc] == '' ) {
110
  _wppaSlides[mocc][id] += ' autoplay ';
111
  }
112
+ if ( posterurl.length > 0 ) {
113
+ _wppaSlides[mocc][id] += ' poster="' + posterurl + '" ';
114
+ }
115
  }
116
  else {
117
+ _wppaSlides[mocc][id] = ' src="' + url + '" alt="' + imagealt + '" class="theimg theimg-'+mocc+' big stereo" ';
118
  }
119
 
120
  // Add swipe
182
  _wppaVideoNatWidth[mocc][id] = width;
183
  _wppaVideoNatHeight[mocc][id] = height;
184
  _wppaWaitTexts[mocc][id] = waittext;
185
+ _wppaImageAlt[mocc][id] = imagealt;
186
  }
187
 
188
  // These functions check the validity and store the users request to be executed later if busy and if applicable.
1797
  }
1798
 
1799
  function wppaGetSlideshowTimeout( mocc ) {
1800
+
1801
  var time;
1802
  if ( _wppaTimeOut[mocc] == 'random' ) {
1803
  var min = 2 * wppaAnimationSpeed;
js/wppa-slideshow.min.js CHANGED
@@ -4,18 +4,19 @@
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
 
7
- var wppaJsSlideshowVersion='6.5.02';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){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]=[];}
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="'+wppaTrimAlt(name)+'" class="theimg theimg-'+mocc+' big" ';if(wppaSlideVideoStart&&wppaLightBox[mocc]==''){_wppaSlides[mocc][id]+=' autoplay ';}}
11
- else{_wppaSlides[mocc][id]=' src="'+url+'" alt="'+wppaTrimAlt(name)+'" class="theimg theimg-'+mocc+' big stereo" ';}
 
12
  if(wppaSlideSwipe){_wppaSlides[mocc][id]+='ontouchstart="wppaTouchStart( event, this.id, '+mocc+' );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" ';}
13
  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>';}
14
  else{_wppaSlides[mocc][id]+='style="'+size+'; cursor:'+cursor+'; display:none; vertical-align:middle;">';}
15
  _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;}
16
  else if(wppaSlideBlank[mocc]){_wppaLinkTarget[mocc][id]='_blank';}
17
  else{_wppaLinkTarget[mocc][id]='_self';}
18
- _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;}
19
  function wppaSpeed(mocc,faster){if(_wppaSSRuns[mocc]){_wppaSpeed(mocc,faster);}}
20
  function wppaStopShow(mocc){if(_wppaSSRuns[mocc]){_wppaStop(mocc);}}
21
  function wppaStartStop(mocc,index){if(_wppaIsBusy[mocc]){_wppaTP[mocc]=index;}
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 ';}
11
+ if(posterurl.length>0){_wppaSlides[mocc][id]+=' poster="'+posterurl+'" ';}}
12
+ else{_wppaSlides[mocc][id]=' src="'+url+'" alt="'+imagealt+'" class="theimg theimg-'+mocc+' big stereo" ';}
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;}
20
  function wppaSpeed(mocc,faster){if(_wppaSSRuns[mocc]){_wppaSpeed(mocc,faster);}}
21
  function wppaStopShow(mocc){if(_wppaSSRuns[mocc]){_wppaStop(mocc);}}
22
  function wppaStartStop(mocc,index){if(_wppaIsBusy[mocc]){_wppaTP[mocc]=index;}
js/wppa.js CHANGED
@@ -2,7 +2,7 @@
2
  //
3
  // conatins common vars and functions
4
  //
5
- var wppaJsVersion = '6.5.03';
6
 
7
  // Important notice:
8
  // All external vars that may be given a value in wppa-non-admin.php must be declared here and not in other front-end js files!!
@@ -190,11 +190,13 @@ var _wppaAudioHtml = [];
190
  var _wppaVideoNatWidth = [];
191
  var _wppaVideoNatHeight = [];
192
  var _wppaWaitTexts = [];
 
193
 
194
  var __wppaOverruleRun = false;
195
 
196
  var wppaOvlUrls;
197
  var wppaOvlTitles;
 
198
  var wppaOvlIdx = 0;
199
  var wppaOvlFirst = true;
200
  var wppaOvlKbHandler = '';
@@ -248,7 +250,7 @@ var wppaIsMobile = false;
248
  // Init at dom ready
249
  jQuery( document ).ready(function() {
250
  wppaDoInit( false );
251
-
252
  // For browsers that signal domready too early for autocol, redo autocol
253
  setTimeout( function() { wppaDoInit( true ); }, 1000 );
254
  });
2
  //
3
  // conatins common vars and functions
4
  //
5
+ var wppaJsVersion = '6.5.04';
6
 
7
  // Important notice:
8
  // All external vars that may be given a value in wppa-non-admin.php must be declared here and not in other front-end js files!!
190
  var _wppaVideoNatWidth = [];
191
  var _wppaVideoNatHeight = [];
192
  var _wppaWaitTexts = [];
193
+ var _wppaImageAlt = [];
194
 
195
  var __wppaOverruleRun = false;
196
 
197
  var wppaOvlUrls;
198
  var wppaOvlTitles;
199
+ var wppaOvlAlts;
200
  var wppaOvlIdx = 0;
201
  var wppaOvlFirst = true;
202
  var wppaOvlKbHandler = '';
250
  // Init at dom ready
251
  jQuery( document ).ready(function() {
252
  wppaDoInit( false );
253
+
254
  // For browsers that signal domready too early for autocol, redo autocol
255
  setTimeout( function() { wppaDoInit( true ); }, 1000 );
256
  });
js/wppa.min.js CHANGED
@@ -3,7 +3,7 @@
3
  // conatins common vars and functions
4
  //
5
 
6
- var wppaJsVersion='6.5.03';var wppaVersion='0';var wppaDebug;var wppaFullValign=[];var wppaFullHalign=[];var wppaFullFrameDelta=[];var wppaAnimationSpeed;var wppaImageDirectory;var wppaAutoColumnWidth=[];var wppaAutoColumnFrac=[];var wppaThumbnailAreaDelta;var wppaSlideShowTimeOut=2500;var wppaFadeInAfterFadeOut=false;var wppaTextFrameDelta=0;var wppaBoxDelta=0;var wppaPreambule;var wppaHideWhenEmpty=false;var wppaThumbnailPitch=[];var wppaFilmStripLength=[];var wppaFilmStripMargin=[];var wppaFilmStripAreaDelta=[];var wppaFilmShowGlue=false;var wppaIsMini=[];var wppaPortraitOnly=[];var wppaSlideShow;var wppaPhoto;var wppaOf;var wppaNextPhoto;var wppaPreviousPhoto;var wppaSlower;var wppaFaster;var wppaNextP;var wppaPrevP;var wppaAvgRating;var wppaMyRating;var wppaAvgRat;var wppaMyRat;var wppaDislikeMsg;var wppaMiniTreshold=300;var wppaStart='Start';var wppaStop='Stop';var wppaPleaseName;var wppaPleaseEmail;var wppaPleaseComment;var wppaRatingOnce=true;var wppaBGcolorNumbar='transparent';var wppaBcolorNumbar='transparent';var wppaBGcolorNumbarActive='transparent';var wppaBcolorNumbarActive='transparent';var wppaFontFamilyNumbar='';var wppaFontSizeNumbar='';var wppaFontColorNumbar='';var wppaFontWeightNumbar='';var wppaFontFamilyNumbarActive='';var wppaFontSizeNumbarActive='';var wppaFontColorNumbarActive='';var wppaFontWeightNumbarActive='';var wppaNumbarMax='10';var wppaAjaxUrl='';var wppaLang='';var wppaNextOnCallback=false;var wppaStarOpacity=0.2;var wppaSlideWrap=true;var wppaLightBox=[];var wppaEmailRequired='required';var wppaSlideBorderWidth=0;var wppaSlideInitRunning=[];var wppaAnimationType='fadeover';var wppaSlidePause=[];var wppaSlideBlank=[];var wppaRatingMax=5;var wppaRatingDisplayType='graphic';var wppaRatingPrec=2;var wppaFilmPageSize=[];var wppaAspectRatio=[];var wppaFullSize=[];var wppaStretch=false;var wppaThumbSpaceAuto=false;var wppaMinThumbSpace=4;var wppaMagnifierCursor='';var wppaArtMonkyLink='none';var wppaAutoOpenComments=false;var wppaUpdateAddressLine=false;var wppaFilmThumbTitle='';var wppaUploadUrl='';var wppaVoteForMe='';var wppaVotedForMe='';var wppaSlideSwipe=true;var wppaLightboxSingle=[];var wppaMaxCoverWidth=300;var wppaDownLoad='Download';var wppaSiteUrl='';var wppaWppaUrl='';var wppaIncludeUrl='';var wppaSlideToFullpopup=false;var wppaComAltSize=75;var wppaBumpViewCount=true;var wppaFotomoto=false;var wppaArtMonkeyButton=true;var wppaShortQargs=false;var wppaOvlHires=false;var wppaMasonryCols=[];var wppaVideoPlaying=[];var wppaAudioPlaying=[];var wppaSlideVideoStart=false;var wppaSlideAudioStart=false;var wppaAudioHeight=28;var wppaHis=0;var wppaStartHtml=[];var wppaCanAjaxRender=false;var wppaCanPushState=false;var wppaAllowAjax=true;var wppaMaxOccur=0;var wppaFirstOccur=0;var wppaUsePhotoNamesInUrls=false;var wppaShareHideWhenRunning=false;var wppaCommentRequiredAfterVote=true;var wppaTopMoc=0;var wppaColWidth=[];var wppaFotomotoHideWhenRunning=false;var wppaFotomotoMinWidth=400;var wppaPhotoView=[];var wppaBackgroundColorImage='';var wppaPopupLinkType='';var wppaPopupOnclick=[];var wppaThumbTargetBlank=false;var wppaRel='rel';var wppaStartSymbolUrl='';var wppaPauseSymbolUrl='';var wppaStopSymbolUrl='';var wppaStartPauseSymbolSize='64';var wppaStartPauseSymbolBradius='32';var wppaStopSymbolSize='48';var wppaStopSumbolBradius='24';var wppaEditPhotoWidth='960';var wppaThemeStyles='';var wppaStickyHeaderHeight=0;var _wppaId=[];var _wppaAvg=[];var _wppaDisc=[];var _wppaMyr=[];var _wppaVRU=[];var _wppaLinkUrl=[];var _wppaLinkTitle=[];var _wppaLinkTarget=[];var _wppaCommentHtml=[];var _wppaIptcHtml=[];var _wppaExifHtml=[];var _wppaToTheSame=false;var _wppaSlides=[];var _wppaNames=[];var _wppaFullNames=[];var _wppaDsc=[];var _wppaOgDsc=[];var _wppaCurIdx=[];var _wppaNxtIdx=[];var _wppaTimeOut=[];var _wppaSSRuns=[];var _wppaFg=[];var _wppaTP=[];var _wppaIsBusy=[];var _wppaFirst=[];var _wppaVoteInProgress=false;var _wppaTextDelay;var _wppaUrl=[];var _wppaSkipRated=[];var _wppaLbTitle=[];var _wppaStateCount=0;var _wppaDidGoto=[];var _wppaShareUrl=[];var _wppaShareHtml=[];var _wppaFilmNoMove=[];var _wppaHiresUrl=[];var _wppaIsVideo=[];var _wppaVideoHtml=[];var _wppaAudioHtml=[];var _wppaVideoNatWidth=[];var _wppaVideoNatHeight=[];var _wppaWaitTexts=[];var __wppaOverruleRun=false;var wppaOvlUrls;var wppaOvlTitles;var wppaOvlIdx=0;var wppaOvlFirst=true;var wppaOvlKbHandler='';var wppaOvlSizeHandler='';var wppaOvlPadTop=5;var wppaOvlIsSingle;var wppaOvlRunning=false;var wppaOvlVideoHtmls;var wppaOvlAudioHtmls;var wppaOvlVideoNaturalWidths;var wppaOvlVideoNaturalHeights;var wppaOvlModeInitial='normal';var wppaOvlVideoPlaying=false;var wppaOvlAudioPlaying=false;var wppaOvlShowLegenda=true;var wppaOvlShowStartStop=true;var wppaOvlRadius=0;var wppaOvlBorderWidth=16;var wppaOvlLeftSymbolUrl;var wppaOvlRightSymbolUrl;var wppaLeftRightSymbolSize=32;var wppaLeftRightSymbolBradius=4;var wppaOvlTxtHeight=36;var wppaOvlOpacity=0.8;var wppaOvlOnclickType='none';var wppaOvlTheme='black';var wppaOvlAnimSpeed=300;var wppaOvlSlideSpeed=3000;var wppaVer4WindowWidth=800;var wppaVer4WindowHeight=600;var wppaOvlFontFamily='Helvetica';var wppaOvlFontSize='10';var wppaOvlFontColor='';var wppaOvlFontWeight='bold';var wppaOvlLineHeight='12';var wppaOvlShowCounter=true;var wppaOvlIsVideo=false;var wppaShowLegenda='';var wppaOvlFsPhotoId=0;var wppaPhotoId=0;var wppaOvlVideoStart=false;var wppaOvlAudioStart=false;var wppaLastIptc='';var wppaLastExif='';var wppaIsMobile=false;jQuery(document).ready(function(){wppaDoInit(false);setTimeout(function(){wppaDoInit(true);},1000);});function wppaDoInit(autoOnly){var anyAutocol=false;for(mocc=1;mocc<=wppaTopMoc;mocc++){if(wppaAutoColumnWidth[mocc]){wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);anyAutocol=true;}}
7
  if(!autoOnly){_wppaTextDelay=wppaAnimationSpeed;if(wppaFadeInAfterFadeOut)_wppaTextDelay*=2;if(anyAutocol){jQuery(window).resize(function(){for(mocc=1;mocc<=wppaTopMoc;mocc++){if(wppaAutoColumnWidth[mocc]){wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);}}});}}}
8
  jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax){wppaCanAjaxRender=true;}
9
  if(typeof(history.pushState)!='undefined'){var i=1;while(i<=wppaMaxOccur){wppaStartHtml[i]=jQuery('#wppa-container-'+i).html();i++;}
3
  // conatins common vars and functions
4
  //
5
 
6
+ var wppaJsVersion='6.5.04';var wppaVersion='0';var wppaDebug;var wppaFullValign=[];var wppaFullHalign=[];var wppaFullFrameDelta=[];var wppaAnimationSpeed;var wppaImageDirectory;var wppaAutoColumnWidth=[];var wppaAutoColumnFrac=[];var wppaThumbnailAreaDelta;var wppaSlideShowTimeOut=2500;var wppaFadeInAfterFadeOut=false;var wppaTextFrameDelta=0;var wppaBoxDelta=0;var wppaPreambule;var wppaHideWhenEmpty=false;var wppaThumbnailPitch=[];var wppaFilmStripLength=[];var wppaFilmStripMargin=[];var wppaFilmStripAreaDelta=[];var wppaFilmShowGlue=false;var wppaIsMini=[];var wppaPortraitOnly=[];var wppaSlideShow;var wppaPhoto;var wppaOf;var wppaNextPhoto;var wppaPreviousPhoto;var wppaSlower;var wppaFaster;var wppaNextP;var wppaPrevP;var wppaAvgRating;var wppaMyRating;var wppaAvgRat;var wppaMyRat;var wppaDislikeMsg;var wppaMiniTreshold=300;var wppaStart='Start';var wppaStop='Stop';var wppaPleaseName;var wppaPleaseEmail;var wppaPleaseComment;var wppaRatingOnce=true;var wppaBGcolorNumbar='transparent';var wppaBcolorNumbar='transparent';var wppaBGcolorNumbarActive='transparent';var wppaBcolorNumbarActive='transparent';var wppaFontFamilyNumbar='';var wppaFontSizeNumbar='';var wppaFontColorNumbar='';var wppaFontWeightNumbar='';var wppaFontFamilyNumbarActive='';var wppaFontSizeNumbarActive='';var wppaFontColorNumbarActive='';var wppaFontWeightNumbarActive='';var wppaNumbarMax='10';var wppaAjaxUrl='';var wppaLang='';var wppaNextOnCallback=false;var wppaStarOpacity=0.2;var wppaSlideWrap=true;var wppaLightBox=[];var wppaEmailRequired='required';var wppaSlideBorderWidth=0;var wppaSlideInitRunning=[];var wppaAnimationType='fadeover';var wppaSlidePause=[];var wppaSlideBlank=[];var wppaRatingMax=5;var wppaRatingDisplayType='graphic';var wppaRatingPrec=2;var wppaFilmPageSize=[];var wppaAspectRatio=[];var wppaFullSize=[];var wppaStretch=false;var wppaThumbSpaceAuto=false;var wppaMinThumbSpace=4;var wppaMagnifierCursor='';var wppaArtMonkyLink='none';var wppaAutoOpenComments=false;var wppaUpdateAddressLine=false;var wppaFilmThumbTitle='';var wppaUploadUrl='';var wppaVoteForMe='';var wppaVotedForMe='';var wppaSlideSwipe=true;var wppaLightboxSingle=[];var wppaMaxCoverWidth=300;var wppaDownLoad='Download';var wppaSiteUrl='';var wppaWppaUrl='';var wppaIncludeUrl='';var wppaSlideToFullpopup=false;var wppaComAltSize=75;var wppaBumpViewCount=true;var wppaFotomoto=false;var wppaArtMonkeyButton=true;var wppaShortQargs=false;var wppaOvlHires=false;var wppaMasonryCols=[];var wppaVideoPlaying=[];var wppaAudioPlaying=[];var wppaSlideVideoStart=false;var wppaSlideAudioStart=false;var wppaAudioHeight=28;var wppaHis=0;var wppaStartHtml=[];var wppaCanAjaxRender=false;var wppaCanPushState=false;var wppaAllowAjax=true;var wppaMaxOccur=0;var wppaFirstOccur=0;var wppaUsePhotoNamesInUrls=false;var wppaShareHideWhenRunning=false;var wppaCommentRequiredAfterVote=true;var wppaTopMoc=0;var wppaColWidth=[];var wppaFotomotoHideWhenRunning=false;var wppaFotomotoMinWidth=400;var wppaPhotoView=[];var wppaBackgroundColorImage='';var wppaPopupLinkType='';var wppaPopupOnclick=[];var wppaThumbTargetBlank=false;var wppaRel='rel';var wppaStartSymbolUrl='';var wppaPauseSymbolUrl='';var wppaStopSymbolUrl='';var wppaStartPauseSymbolSize='64';var wppaStartPauseSymbolBradius='32';var wppaStopSymbolSize='48';var wppaStopSumbolBradius='24';var wppaEditPhotoWidth='960';var wppaThemeStyles='';var wppaStickyHeaderHeight=0;var _wppaId=[];var _wppaAvg=[];var _wppaDisc=[];var _wppaMyr=[];var _wppaVRU=[];var _wppaLinkUrl=[];var _wppaLinkTitle=[];var _wppaLinkTarget=[];var _wppaCommentHtml=[];var _wppaIptcHtml=[];var _wppaExifHtml=[];var _wppaToTheSame=false;var _wppaSlides=[];var _wppaNames=[];var _wppaFullNames=[];var _wppaDsc=[];var _wppaOgDsc=[];var _wppaCurIdx=[];var _wppaNxtIdx=[];var _wppaTimeOut=[];var _wppaSSRuns=[];var _wppaFg=[];var _wppaTP=[];var _wppaIsBusy=[];var _wppaFirst=[];var _wppaVoteInProgress=false;var _wppaTextDelay;var _wppaUrl=[];var _wppaSkipRated=[];var _wppaLbTitle=[];var _wppaStateCount=0;var _wppaDidGoto=[];var _wppaShareUrl=[];var _wppaShareHtml=[];var _wppaFilmNoMove=[];var _wppaHiresUrl=[];var _wppaIsVideo=[];var _wppaVideoHtml=[];var _wppaAudioHtml=[];var _wppaVideoNatWidth=[];var _wppaVideoNatHeight=[];var _wppaWaitTexts=[];var _wppaImageAlt=[];var __wppaOverruleRun=false;var wppaOvlUrls;var wppaOvlTitles;var wppaOvlAlts;var wppaOvlIdx=0;var wppaOvlFirst=true;var wppaOvlKbHandler='';var wppaOvlSizeHandler='';var wppaOvlPadTop=5;var wppaOvlIsSingle;var wppaOvlRunning=false;var wppaOvlVideoHtmls;var wppaOvlAudioHtmls;var wppaOvlVideoNaturalWidths;var wppaOvlVideoNaturalHeights;var wppaOvlModeInitial='normal';var wppaOvlVideoPlaying=false;var wppaOvlAudioPlaying=false;var wppaOvlShowLegenda=true;var wppaOvlShowStartStop=true;var wppaOvlRadius=0;var wppaOvlBorderWidth=16;var wppaOvlLeftSymbolUrl;var wppaOvlRightSymbolUrl;var wppaLeftRightSymbolSize=32;var wppaLeftRightSymbolBradius=4;var wppaOvlTxtHeight=36;var wppaOvlOpacity=0.8;var wppaOvlOnclickType='none';var wppaOvlTheme='black';var wppaOvlAnimSpeed=300;var wppaOvlSlideSpeed=3000;var wppaVer4WindowWidth=800;var wppaVer4WindowHeight=600;var wppaOvlFontFamily='Helvetica';var wppaOvlFontSize='10';var wppaOvlFontColor='';var wppaOvlFontWeight='bold';var wppaOvlLineHeight='12';var wppaOvlShowCounter=true;var wppaOvlIsVideo=false;var wppaShowLegenda='';var wppaOvlFsPhotoId=0;var wppaPhotoId=0;var wppaOvlVideoStart=false;var wppaOvlAudioStart=false;var wppaLastIptc='';var wppaLastExif='';var wppaIsMobile=false;jQuery(document).ready(function(){wppaDoInit(false);setTimeout(function(){wppaDoInit(true);},1000);});function wppaDoInit(autoOnly){var anyAutocol=false;for(mocc=1;mocc<=wppaTopMoc;mocc++){if(wppaAutoColumnWidth[mocc]){wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);anyAutocol=true;}}
7
  if(!autoOnly){_wppaTextDelay=wppaAnimationSpeed;if(wppaFadeInAfterFadeOut)_wppaTextDelay*=2;if(anyAutocol){jQuery(window).resize(function(){for(mocc=1;mocc<=wppaTopMoc;mocc++){if(wppaAutoColumnWidth[mocc]){wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);}}});}}}
8
  jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax){wppaCanAjaxRender=true;}
9
  if(typeof(history.pushState)!='undefined'){var i=1;while(i<=wppaMaxOccur){wppaStartHtml[i]=jQuery('#wppa-container-'+i).html();i++;}
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.03
6
- Stable tag: 6.5.02
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -180,6 +180,20 @@ 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.5.03 =
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.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
 
181
  See for additional information: http://www.wppa.nl/changelog/
182
 
183
+ = 6.4.04 =
184
+
185
+ = Bug Fixes =
186
+
187
+ * The spinner while waiting for album download did not work when encryoted links was active. Fixed.
188
+ * Fixed alt attribute in slideshows and lightbox.
189
+ * Poster images for videos are now also applied to videos in a slideshow.
190
+
191
+ = Other Changes =
192
+
193
+ * Various textual enhancements.
194
+ * The photo of the day admin page has been rewritten and is now in the style of the settings page. Includes a few enhancements to the settings.
195
+ * Incomplete comments are marked as spam. To avoid eventual auto deletion when they are correct, they will now also be reported as requiring moderation on the main menu.
196
+
197
  = 6.5.03 =
198
 
199
  = Bug Fixes =
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 6.4.20
7
  *
8
  */
9
 
@@ -53,7 +53,7 @@ function wppa_restore_settings( $fname, $type = '' ) {
53
  'wppa_allow_debug',
54
  'wppa_thumb_linkpage',
55
  'wppa_mphoto_linkpage',
56
- 'wppa_widget_linkpage',
57
  'wppa_slideonly_widget_linkpage',
58
  'wppa_topten_widget_linkpage',
59
  'wppa_coverimg_linkpage',
@@ -462,11 +462,11 @@ global $wppa_supported_audio_extensions;
462
  wppa_error_message( sprintf( __( 'File %s is of an unsupported filetype and has been removed.' , 'wp-photo-album-plus'), basename( wppa_sanitize_file_name( $file ) ) ) );
463
  $count++;
464
  }
465
-
466
  // Sanitize filename
467
  $dirname = dirname( $file );
468
  $filename = basename( $file );
469
-
470
  // Can not use sanitize_file_name() because it removes spaces that are not illegal in most servers.
471
  $filename = strip_tags( stripslashes( $filename ) ); //sanitize_text_field( $filename );
472
  if ( ! seems_utf8( $filename ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 6.5.04
7
  *
8
  */
9
 
53
  'wppa_allow_debug',
54
  'wppa_thumb_linkpage',
55
  'wppa_mphoto_linkpage',
56
+ 'wppa_potd_linkpage',
57
  'wppa_slideonly_widget_linkpage',
58
  'wppa_topten_widget_linkpage',
59
  'wppa_coverimg_linkpage',
462
  wppa_error_message( sprintf( __( 'File %s is of an unsupported filetype and has been removed.' , 'wp-photo-album-plus'), basename( wppa_sanitize_file_name( $file ) ) ) );
463
  $count++;
464
  }
465
+
466
  // Sanitize filename
467
  $dirname = dirname( $file );
468
  $filename = basename( $file );
469
+
470
  // Can not use sanitize_file_name() because it removes spaces that are not illegal in most servers.
471
  $filename = strip_tags( stripslashes( $filename ) ); //sanitize_text_field( $filename );
472
  if ( ! seems_utf8( $filename ) ) {
wppa-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
- * Version 6.5.03
7
  *
8
  */
9
 
@@ -35,7 +35,7 @@ function wppa_add_admin() {
35
 
36
  // See if there are comments pending moderation
37
  $com_pending = '';
38
- $com_pending_count = $wpdb->get_var( "SELECT COUNT(*) FROM `".WPPA_COMMENTS."` WHERE `status` = 'pending'" );
39
  if ( $com_pending_count ) $com_pending = '<span class="update-plugins"><span class="plugin-count">'.$com_pending_count.'</span></span>';
40
 
41
  // See if there are uploads pending moderation
@@ -145,7 +145,7 @@ function wppa_page_options() {
145
  }
146
  // Photo of the day admin page
147
  function wppa_sidebar_page_options() {
148
- require_once 'wppa-widget-admin.php';
149
  wppa_publish_scheduled();
150
  _wppa_sidebar_page_options();
151
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
+ * Version 6.5.04
7
  *
8
  */
9
 
35
 
36
  // See if there are comments pending moderation
37
  $com_pending = '';
38
+ $com_pending_count = $wpdb->get_var( "SELECT COUNT(*) FROM `".WPPA_COMMENTS."` WHERE `status` = 'pending' OR `status` = 'spam'" );
39
  if ( $com_pending_count ) $com_pending = '<span class="update-plugins"><span class="plugin-count">'.$com_pending_count.'</span></span>';
40
 
41
  // See if there are uploads pending moderation
145
  }
146
  // Photo of the day admin page
147
  function wppa_sidebar_page_options() {
148
+ require_once 'wppa-potd-admin.php';
149
  wppa_publish_scheduled();
150
  _wppa_sidebar_page_options();
151
  }
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 6.5.00
6
  *
7
  */
8
 
@@ -1671,6 +1671,7 @@ global $wppa_log_file;
1671
 
1672
  // The wppa-settings page calls ajax with $wppa_action == 'update-option';
1673
  case 'update-option':
 
1674
  // Verify that we are legally here
1675
  $nonce = $_REQUEST['wppa-nonce'];
1676
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
@@ -1688,6 +1689,39 @@ global $wppa_log_file;
1688
  wppa( 'error', '0' ); //
1689
  $title = ''; //
1690
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1691
  // If it is a font family, change all double quotes into single quotes as this destroys much more than you would like
1692
  if ( strpos( $option, 'wppa_fontfamily_' ) !== false ) $value = str_replace( '"', "'", $value );
1693
 
@@ -1770,6 +1804,26 @@ global $wppa_log_file;
1770
  }
1771
  else switch ( $option ) {
1772
  //wppa_log('obs', 'option '.$option.' attempt to set to '.$value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1773
  case 'wppa_colwidth': // ?? fixed low high title
1774
  wppa_ajax_check_range( $value, 'auto', '100', false, __( 'Column width.' , 'wp-photo-album-plus') );
1775
  break;
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 6.5.04
6
  *
7
  */
8
 
1671
 
1672
  // The wppa-settings page calls ajax with $wppa_action == 'update-option';
1673
  case 'update-option':
1674
+
1675
  // Verify that we are legally here
1676
  $nonce = $_REQUEST['wppa-nonce'];
1677
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
1689
  wppa( 'error', '0' ); //
1690
  $title = ''; //
1691
 
1692
+ // Check for potd settings
1693
+ $potdarr = array( 'wppa_potd_title',
1694
+ 'wppa_potd_widget_width',
1695
+ 'wppa_potd_align',
1696
+ 'wppa_potd_linkurl',
1697
+ 'wppa_potd_linktitle',
1698
+ 'wppa_potd_subtitle',
1699
+ 'wppa_potd_counter',
1700
+ 'wppa_potd_counter_link',
1701
+ 'wppa_potd_album_type',
1702
+ 'wppa_potd_album',
1703
+ 'wppa_potd_include_subs',
1704
+ 'wppa_potd_status_filter',
1705
+ 'wppa_potd_inverse',
1706
+ 'wppa_potd_method',
1707
+ 'wppa_potd_period',
1708
+ 'wppa_potd_offset',
1709
+ 'wppa_potd_photo',
1710
+ );
1711
+
1712
+ if ( in_array( $option, $potdarr ) ) {
1713
+ if ( ! current_user_can( 'wppa_potd' ) ) {
1714
+ echo '||1||'.__( 'You do not have the rights to update photo of the day settings' , 'wp-photo-album-plus');
1715
+ wppa_exit();
1716
+ }
1717
+ }
1718
+ else {
1719
+ if ( ! current_user_can( 'wppa_settings' ) ) {
1720
+ echo '||1||'.__( 'You do not have the rights to update settings' , 'wp-photo-album-plus');
1721
+ wppa_exit();
1722
+ }
1723
+ }
1724
+
1725
  // If it is a font family, change all double quotes into single quotes as this destroys much more than you would like
1726
  if ( strpos( $option, 'wppa_fontfamily_' ) !== false ) $value = str_replace( '"', "'", $value );
1727
 
1804
  }
1805
  else switch ( $option ) {
1806
  //wppa_log('obs', 'option '.$option.' attempt to set to '.$value);
1807
+
1808
+ // Changing potd_album_type ( physical / virtual ) also clears potd_album
1809
+ case 'wppa_potd_album_type':
1810
+ if ( ! in_array( $value, array( 'physical', 'virtual' ) ) ) {
1811
+ echo '||1||Invalid value: '.$value.'||';
1812
+ wppa_exit();
1813
+ }
1814
+ if ( $value == 'physical' ) {
1815
+ wppa_update_option( 'wppa_potd_album', '' );
1816
+ }
1817
+ else {
1818
+ wppa_update_option( 'wppa_potd_album', 'all' );
1819
+ }
1820
+ break;
1821
+ case 'wppa_potd_album':
1822
+ if ( wppa_opt( 'potd_album_type' ) == 'physical' ) {
1823
+ $value = str_replace( '.', ',', ( wppa_expand_enum( str_replace( ',', '.', $value ) ) ) );
1824
+ }
1825
+ break;
1826
+
1827
  case 'wppa_colwidth': // ?? fixed low high title
1828
  wppa_ajax_check_range( $value, 'auto', '100', false, __( 'Column width.' , 'wp-photo-album-plus') );
1829
  break;
wppa-album-covers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
- * Version 6.5.02
7
  *
8
  */
9
 
@@ -896,6 +896,7 @@ global $wpdb;
896
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
897
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
898
  ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' .
 
899
  ' >' );
900
 
901
  // the cover image
@@ -1051,6 +1052,7 @@ global $wpdb;
1051
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $thumb['id'] ) ) . '"' : '' ) .
1052
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
1053
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
 
1054
  ' >'
1055
  );
1056
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 6.5.04
7
  *
8
  */
9
 
896
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
897
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
898
  ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' .
899
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
900
  ' >' );
901
 
902
  // the cover image
1052
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $thumb['id'] ) ) . '"' : '' ) .
1053
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
1054
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
1055
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $thumb['id'], true ) ) . '"' .
1056
  ' >'
1057
  );
1058
 
wppa-album-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
- * Version 6.4.17
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -172,13 +172,15 @@ class AlbumWidget extends WP_Widget {
172
  $has_audio = wppa_has_audio( $thumb['id'] );
173
 
174
  $widget_content .= "\n\t" .
175
- '<a href="'.$link.'"' .
176
  ( $is_video ? ' data-videohtml="' . esc_attr( wppa_get_video_body( $thumb['id'] ) ) . '"' .
177
  ' data-videonatwidth="'.wppa_get_videox( $thumb['id'] ).'"' .
178
  ' data-videonatheight="'.wppa_get_videoy( $thumb['id'] ).'"' : '' ) .
179
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $thumb['id'] ) ) . '"' : '' ) .
180
  ' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'[alw-'.wppa( 'mocc' ).'-'.$album['id'].']"' .
181
- ' ' . wppa( 'lbtitle' ) . '="'.$title.'" >';
 
 
182
  if ( $thumb['id'] == $image['id'] ) { // the cover image
183
  if ( wppa_is_video( $image['id'] ) ) {
184
  $widget_content .= wppa_get_video_html( array( 'id' => $image['id'],
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
+ * Version 6.5.04
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
172
  $has_audio = wppa_has_audio( $thumb['id'] );
173
 
174
  $widget_content .= "\n\t" .
175
+ '<a href="'.$link.'"' .
176
  ( $is_video ? ' data-videohtml="' . esc_attr( wppa_get_video_body( $thumb['id'] ) ) . '"' .
177
  ' data-videonatwidth="'.wppa_get_videox( $thumb['id'] ).'"' .
178
  ' data-videonatheight="'.wppa_get_videoy( $thumb['id'] ).'"' : '' ) .
179
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $thumb['id'] ) ) . '"' : '' ) .
180
  ' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'[alw-'.wppa( 'mocc' ).'-'.$album['id'].']"' .
181
+ ' ' . wppa( 'lbtitle' ) . '="'.$title.'"' .
182
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $thumb['id'], true ) ) . '"' .
183
+ ' >';
184
  if ( $thumb['id'] == $image['id'] ) { // the cover image
185
  if ( wppa_is_video( $image['id'] ) ) {
186
  $widget_content .= wppa_get_video_html( array( 'id' => $image['id'],
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 6.5.03
7
  *
8
  */
9
 
@@ -1652,10 +1652,10 @@ function wppa_user_destroy_html( $alb, $width, $where, $rsp ) {
1652
  ' onclick="' .
1653
  'jQuery(this).html(\'' . __( 'Working...', 'wp-photo-album-plus' ) . '\');' .
1654
  'wppaAjaxDestroyAlbum(' . $alb . ',\'' . wp_create_nonce( 'wppa_nonce_' . $alb ) . '\');' .
1655
- 'jQuery(this).html(\'' . __( 'Delete album', 'wp-photo-album-plus' ) . '\');' .
1656
  '"' .
1657
  ' >' .
1658
- __( 'Delete album', 'wp-photo-album-plus' ) .
1659
  '</a>' .
1660
  '</div>'
1661
  );
@@ -1747,7 +1747,7 @@ function wppa_get_user_create_html( $alb, $width, $where = '', $mcr = false ) {
1747
  '"' .
1748
  ' style="float:left; cursor:pointer;"' .
1749
  '> ' .
1750
- __( 'Create Album', 'wp-photo-album-plus' ) .
1751
  '</a>' .
1752
  '<a' .
1753
  ' id="_wppa-cr-' . str_replace('.','-',$alb) . '-' . $mocc . '"' .
@@ -2590,7 +2590,7 @@ function wppa_user_albumedit_html( $alb, $width, $where = '', $mcr = false ) {
2590
  'jQuery( \'#_wppa-ea-'.str_replace('.','-',$alb).'-'.wppa( 'mocc' ).'\' ).css( \'display\',\'block\' );'. // Show backlink
2591
  '_wppaDoAutocol( ' . wppa( 'mocc' ) . ' )' . // Trigger autocol
2592
  '" style="float:left; cursor:pointer;">
2593
- '.__( 'Edit albuminfo', 'wp-photo-album-plus' ).'
2594
  </a>
2595
  <a id="_wppa-ea-'.str_replace('.','-',$alb).'-'.wppa( 'mocc' ).'" class="wppa-aedit-'.$where.' wppa-album-'.$where.'-link" onclick="'.
2596
  'jQuery( \'#wppa-fe-div-'.str_replace('.','-',$alb).'-'.wppa( 'mocc' ).'\' ).css( \'display\',\'none\' );'. // Hide the Edit form
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 6.5.04
7
  *
8
  */
9
 
1652
  ' onclick="' .
1653
  'jQuery(this).html(\'' . __( 'Working...', 'wp-photo-album-plus' ) . '\');' .
1654
  'wppaAjaxDestroyAlbum(' . $alb . ',\'' . wp_create_nonce( 'wppa_nonce_' . $alb ) . '\');' .
1655
+ 'jQuery(this).html(\'' . __( 'Delete Album', 'wp-photo-album-plus' ) . '\');' .
1656
  '"' .
1657
  ' >' .
1658
+ __( 'Delete Album', 'wp-photo-album-plus' ) .
1659
  '</a>' .
1660
  '</div>'
1661
  );
1747
  '"' .
1748
  ' style="float:left; cursor:pointer;"' .
1749
  '> ' .
1750
+ ( $alb ? __( 'Create Sub Album', 'wp-photo-album-plus' ) : __( 'Create Album', 'wp-photo-album-plus' ) ) .
1751
  '</a>' .
1752
  '<a' .
1753
  ' id="_wppa-cr-' . str_replace('.','-',$alb) . '-' . $mocc . '"' .
2590
  'jQuery( \'#_wppa-ea-'.str_replace('.','-',$alb).'-'.wppa( 'mocc' ).'\' ).css( \'display\',\'block\' );'. // Show backlink
2591
  '_wppaDoAutocol( ' . wppa( 'mocc' ) . ' )' . // Trigger autocol
2592
  '" style="float:left; cursor:pointer;">
2593
+ '.__( 'Edit Album Info', 'wp-photo-album-plus' ).'
2594
  </a>
2595
  <a id="_wppa-ea-'.str_replace('.','-',$alb).'-'.wppa( 'mocc' ).'" class="wppa-aedit-'.$where.' wppa-album-'.$where.'-link" onclick="'.
2596
  'jQuery( \'#wppa-fe-div-'.str_replace('.','-',$alb).'-'.wppa( 'mocc' ).'\' ).css( \'display\',\'none\' );'. // Hide the Edit form
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.03
6
  *
7
  */
8
 
@@ -1584,6 +1584,7 @@ global $wpdb;
1584
  'sort' => true,
1585
  'checkarray' => false,
1586
  'array' => array(),
 
1587
  ) );
1588
 
1589
  // Provide default selection if no selected given
@@ -1698,13 +1699,21 @@ global $wpdb;
1698
  __( '--- a selection box ---' , 'wp-photo-album-plus' ) .
1699
  '</option>';
1700
 
 
 
 
 
 
 
 
 
1701
  if ( $albums ) foreach ( $albums as $album ) {
1702
  if ( ( $args['disabled'] == $album['id'] ) ||
1703
  ( $args['exclude'] == $album['id'] ) ||
1704
  ( $args['checkupload'] && ! wppa_allow_uploads( $album['id'] ) ) ||
1705
  ( $args['disableancestors'] && wppa_is_ancestor( $args['exclude'], $album['id'] ) )
1706
  ) $disabled = ' disabled="disabled"'; else $disabled = '';
1707
- if ( $args['selected'] == $album['id'] && ! $disabled ) $selected = ' selected="selected"'; else $selected = '';
1708
 
1709
  $ok = true; // Assume this will be in the list
1710
  if ( $args['checkaccess'] && ! wppa_have_access( $album['id'] ) ) {
@@ -1727,7 +1736,7 @@ global $wpdb;
1727
  }
1728
  if ( $ok ) {
1729
  if ( $args['addnumbers'] ) $number = ' ( '.$album['id'].' )'; else $number = '';
1730
- $result .= '<option value="' . $album['id'] . '" ' . $selected . $disabled . '>' . $album['name'] . $number . '</option>';
1731
  }
1732
  }
1733
 
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 6.5.04
6
  *
7
  */
8
 
1584
  'sort' => true,
1585
  'checkarray' => false,
1586
  'array' => array(),
1587
+ 'optionclass' => '',
1588
  ) );
1589
 
1590
  // Provide default selection if no selected given
1699
  __( '--- a selection box ---' , 'wp-photo-album-plus' ) .
1700
  '</option>';
1701
 
1702
+ // In case multiple
1703
+ if ( strpos( $args['selected'], ',' ) !== false ) {
1704
+ $selarr = explode( ',', $args['selected'] );
1705
+ }
1706
+ else {
1707
+ $selarr = array( $args['selected'] );
1708
+ }
1709
+
1710
  if ( $albums ) foreach ( $albums as $album ) {
1711
  if ( ( $args['disabled'] == $album['id'] ) ||
1712
  ( $args['exclude'] == $album['id'] ) ||
1713
  ( $args['checkupload'] && ! wppa_allow_uploads( $album['id'] ) ) ||
1714
  ( $args['disableancestors'] && wppa_is_ancestor( $args['exclude'], $album['id'] ) )
1715
  ) $disabled = ' disabled="disabled"'; else $disabled = '';
1716
+ if ( in_array( $album['id'], $selarr, true ) && ! $disabled ) $selected = ' selected="selected"'; else $selected = '';
1717
 
1718
  $ok = true; // Assume this will be in the list
1719
  if ( $args['checkaccess'] && ! wppa_have_access( $album['id'] ) ) {
1736
  }
1737
  if ( $ok ) {
1738
  if ( $args['addnumbers'] ) $number = ' ( '.$album['id'].' )'; else $number = '';
1739
+ $result .= '<option class="' . $args['optionclass']. '" value="' . $album['id'] . '" ' . $selected . $disabled . '>' . $album['name'] . $number . '</option>';
1740
  }
1741
  }
1742
 
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 6.5.03
7
  *
8
  */
9
 
@@ -2154,6 +2154,17 @@ static $user;
2154
  // Audio html
2155
  $audiohtml = wppa_get_audio_body( $id );
2156
 
 
 
 
 
 
 
 
 
 
 
 
2157
  // Produce final result
2158
  $result = "'".wppa( 'mocc' )."','";
2159
  $result .= $index."','";
@@ -2185,7 +2196,9 @@ static $user;
2185
  $result .= $hiresurl."','";
2186
  $result .= $videohtml."','";
2187
  $result .= $audiohtml."','";
2188
- $result .= $wait_text."'";
 
 
2189
 
2190
  // This is an ingenious line of code that is going to prevent us from very much trouble.
2191
  // Created by OpaJaap on Jan 15 2012, 14:36 local time. Thanx.
@@ -3692,6 +3705,7 @@ function wppa_mphoto() {
3692
  ( $link['target'] ? ' target="' . $link['target'] . '"' : '' ) .
3693
  ' class="thumb-img"' .
3694
  ' id="a-' . $id . '-' . wppa( 'mocc' ) . '"' .
 
3695
  ' >'
3696
  );
3697
  }
@@ -3880,6 +3894,7 @@ function wppa_sphoto() {
3880
  ( $link['target'] ? ' target="' . $link['target'] . '"' : '' ) .
3881
  ' class="thumb-img"' .
3882
  ' id="a-' . $id . '-' . wppa( 'mocc' ) . '"' .
 
3883
  ' >'
3884
  );
3885
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 6.5.04
7
  *
8
  */
9
 
2154
  // Audio html
2155
  $audiohtml = wppa_get_audio_body( $id );
2156
 
2157
+ // Image alt
2158
+ $image_alt = esc_js( wppa_get_imgalt( $id, true ) );
2159
+
2160
+ // Poster url if video
2161
+ $poster_url = '';
2162
+ if ( wppa_is_video( $id ) ) {
2163
+ if ( is_file( wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id ) ) ) {
2164
+ $poster_url = wppa_fix_poster_ext( wppa_get_photo_url( $id ), $id );
2165
+ }
2166
+ }
2167
+
2168
  // Produce final result
2169
  $result = "'".wppa( 'mocc' )."','";
2170
  $result .= $index."','";
2196
  $result .= $hiresurl."','";
2197
  $result .= $videohtml."','";
2198
  $result .= $audiohtml."','";
2199
+ $result .= $wait_text."','";
2200
+ $result .= $image_alt."','";
2201
+ $result .= $poster_url."'";
2202
 
2203
  // This is an ingenious line of code that is going to prevent us from very much trouble.
2204
  // Created by OpaJaap on Jan 15 2012, 14:36 local time. Thanx.
3705
  ( $link['target'] ? ' target="' . $link['target'] . '"' : '' ) .
3706
  ' class="thumb-img"' .
3707
  ' id="a-' . $id . '-' . wppa( 'mocc' ) . '"' .
3708
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
3709
  ' >'
3710
  );
3711
  }
3894
  ( $link['target'] ? ' target="' . $link['target'] . '"' : '' ) .
3895
  ' class="thumb-img"' .
3896
  ' id="a-' . $id . '-' . wppa( 'mocc' ) . '"' .
3897
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
3898
  ' >'
3899
  );
3900
  }
wppa-links.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Frontend links
6
- * Version 6.5.00
7
  *
8
  */
9
 
@@ -155,20 +155,20 @@ global $wppa_lang;
155
  }
156
 
157
  // get page url of current album image
158
- function wppa_get_image_page_url_by_id( $id, $single = false, $alb = false ) {
159
 
160
  if ( ! is_numeric( $id ) || $id < '1' ) wppa_dbg_msg( 'Invalid arg wppa_get_image_page_url_by_id(' . $id . ')', 'red' );
161
 
162
  $thumb = wppa_cache_thumb( $id );
163
 
164
  $occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' );
165
- $w = wppa_in_widget() ? 'w' : '';
166
 
167
  if ( ! $alb ) $alb = $thumb['album'];
168
 
169
  if ( ! $occur ) $occur = '1';
170
 
171
- $result = wppa_get_permalink().'wppa-album='.$alb.'&amp;wppa-photo='.$thumb['id'].'&amp;wppa-cover=0&amp;wppa-'.$w.'occur='.$occur;
172
  if ( $single ) $result .= '&amp;wppa-single=1';
173
 
174
  return wppa_encrypt_url( $result );
@@ -1097,9 +1097,24 @@ function wppa_album_download_link( $albumid ) {
1097
 
1098
  if ( ! wppa_switch( 'allow_download_album' ) ) return; // Not enabled
1099
 
1100
- wppa_out( '<div style="clear:both;" ></div>' );
1101
- wppa_out( '<a onclick="wppaAjaxDownloadAlbum('.wppa( 'mocc' ).', \''.wppa_encrypt_album($albumid).'\' );" style="cursor:pointer;" class="wppa-album-cover-link" title="'.__('Download', 'wp-photo-album-plus').'">'.__('Download album', 'wp-photo-album-plus').'</a>' );
1102
- wppa_out( '<img id="dwnspin-'.wppa( 'mocc' ).'-'.$albumid.'" src="'.wppa_get_imgdir().'wpspin.gif" style="margin-left:6px; display:none;" alt="spin" />' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1103
  }
1104
 
1105
  function wppa_get_imglnk_a( $wich, $id, $lnk = '', $tit = '', $onc = '', $noalb = false, $album = '' ) {
@@ -1200,8 +1215,8 @@ global $wpdb;
1200
  }
1201
  break;
1202
  case 'potdwidget':
1203
- $type = wppa_opt( 'widget_linktype' );
1204
- $page = wppa_opt( 'widget_linkpage' );
1205
  if ( $page == '0' ) $page = '-1';
1206
  if ( wppa_switch( 'potd_blank' ) ) $result['target'] = '_blank';
1207
  break;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Frontend links
6
+ * Version 6.5.04
7
  *
8
  */
9
 
155
  }
156
 
157
  // get page url of current album image
158
+ function wppa_get_image_page_url_by_id( $id, $single = false, $alb = false, $page = null ) {
159
 
160
  if ( ! is_numeric( $id ) || $id < '1' ) wppa_dbg_msg( 'Invalid arg wppa_get_image_page_url_by_id(' . $id . ')', 'red' );
161
 
162
  $thumb = wppa_cache_thumb( $id );
163
 
164
  $occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' );
165
+ $w = wppa_in_widget() && ! $page ? 'w' : '';
166
 
167
  if ( ! $alb ) $alb = $thumb['album'];
168
 
169
  if ( ! $occur ) $occur = '1';
170
 
171
+ $result = wppa_get_permalink($page).'wppa-album='.$alb.'&amp;wppa-photo='.$thumb['id'].'&amp;wppa-cover=0&amp;wppa-'.$w.'occur='.$occur;
172
  if ( $single ) $result .= '&amp;wppa-single=1';
173
 
174
  return wppa_encrypt_url( $result );
1097
 
1098
  if ( ! wppa_switch( 'allow_download_album' ) ) return; // Not enabled
1099
 
1100
+ $result =
1101
+ '<div style="clear:both;" ></div>' .
1102
+ '<a' .
1103
+ ' onclick="wppaAjaxDownloadAlbum(' . wppa( 'mocc' ) . ', \'' . wppa_encrypt_album( $albumid ) . '\' );"' .
1104
+ ' style="cursor:pointer;"' .
1105
+ ' class="wppa-album-cover-link"' .
1106
+ ' title="' . esc_attr( __('Download', 'wp-photo-album-plus') ).'" ' .
1107
+ '>' .
1108
+ __( 'Download Album', 'wp-photo-album-plus' ) .
1109
+ '</a>' .
1110
+ '<img' .
1111
+ ' id="dwnspin-' . wppa( 'mocc' ) . '-' . wppa_encrypt_album( $albumid ) . '"' .
1112
+ ' src="' . wppa_get_imgdir() . 'wpspin.gif"' .
1113
+ ' style="margin-left:6px; display:none;"' .
1114
+ ' alt="spin"' .
1115
+ ' />';
1116
+
1117
+ wppa_out( $result );
1118
  }
1119
 
1120
  function wppa_get_imglnk_a( $wich, $id, $lnk = '', $tit = '', $onc = '', $noalb = false, $album = '' ) {
1215
  }
1216
  break;
1217
  case 'potdwidget':
1218
+ $type = wppa_opt( 'potd_linktype' );
1219
+ $page = wppa_opt( 'potd_linkpage' );
1220
  if ( $page == '0' ) $page = '-1';
1221
  if ( wppa_switch( 'potd_blank' ) ) $result['target'] = '_blank';
1222
  break;
wppa-non-admin.php CHANGED
@@ -71,6 +71,9 @@ global $wpdb;
71
 
72
  // Share info for sm that uses og
73
  $id = wppa_get_get( 'photo' );
 
 
 
74
  if ( $id ) {
75
 
76
  // SM may not accept images from the cloud.
@@ -150,7 +153,7 @@ global $wpdb;
150
  }
151
  }
152
 
153
- // To make sure we are on a page that contains at least %%wppa%% we check for Get var 'wppa-album'.
154
  // This also narrows the selection of featured photos to those that exist in the current album.
155
  $done = array();
156
  $album = '';
71
 
72
  // Share info for sm that uses og
73
  $id = wppa_get_get( 'photo' );
74
+ if ( ! wppa_photo_exists( $id ) ) {
75
+ $id = false;
76
+ }
77
  if ( $id ) {
78
 
79
  // SM may not accept images from the cloud.
153
  }
154
  }
155
 
156
+ // To make sure we are on a page that contains at least [wppa] we check for Get var 'wppa-album'.
157
  // This also narrows the selection of featured photos to those that exist in the current album.
158
  $done = array();
159
  $album = '';
wppa-photo-admin-autosave.php CHANGED
@@ -101,7 +101,7 @@ global $wpdb;
101
  }
102
  else {
103
  // Photos with pending comments?
104
- $cmt = $wpdb->get_results( "SELECT `photo` FROM `".WPPA_COMMENTS."` WHERE `status` = 'pending'", ARRAY_A );
105
 
106
  if ( $cmt ) {
107
  $orphotois = '';
101
  }
102
  else {
103
  // Photos with pending comments?
104
+ $cmt = $wpdb->get_results( "SELECT `photo` FROM `".WPPA_COMMENTS."` WHERE `status` = 'pending' OR `status` = 'spam'", ARRAY_A );
105
 
106
  if ( $cmt ) {
107
  $orphotois = '';
wppa-potd-admin.php ADDED
@@ -0,0 +1,712 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* wppa-potd-admin.php
3
+ * Pachkage: wp-photo-album-plus
4
+ *
5
+ * admin photo of the day widget
6
+ * version 6.5.04
7
+ *
8
+ */
9
+
10
+ function _wppa_sidebar_page_options() {
11
+ global $wpdb;
12
+ global $wppa_defaults;
13
+
14
+ wppa_set_defaults();
15
+
16
+ $onch = 'myReload()';
17
+
18
+ // Handle spinner js and declare functions
19
+ echo
20
+ '<script type="text/javascript" >' .
21
+ 'var didsome=false;' .
22
+ 'jQuery(document).ready(function() {' .
23
+ 'jQuery(\'#wppa-spinner\').css(\'display\', \'none\');' .
24
+ '});' .
25
+ 'function myReload() {' .
26
+ 'jQuery(\'#wppa-spinner\').css(\'display\', \'block\');' .
27
+ '_wppaRefreshAfter = true;' .
28
+ '};' .
29
+ 'function wppaSetFixed(id) {' .
30
+ 'if (jQuery(\'#wppa-widget-photo-\' + id).attr(\'checked\') == \'checked\' ) {' .
31
+ '_wppaRefreshAfter = true;' .
32
+ 'wppaAjaxUpdateOptionValue(\'potd_photo\', id);' .
33
+ '}' .
34
+ '};' .
35
+ '</script>';
36
+
37
+ // The spinner
38
+ echo
39
+ '<img' .
40
+ ' id="wppa-spinner"' .
41
+ ' style="position:fixed;top:50%;left:50%;z-index:1000;margin-top:-33px;margin-left:-33px;display:block;"' .
42
+ ' src="' . wppa_get_imgdir( 'loader.gif' ) . '"' .
43
+ '/>';
44
+
45
+ // Open wrapper
46
+ echo
47
+ '<div class="wrap">';
48
+
49
+ // The settings icon
50
+ echo
51
+ '<img src="' . wppa_get_imgdir( 'settings32.png' ) . '" />';
52
+
53
+ // The Page title
54
+ echo
55
+ '<h1 style="display:inline;" >' . __( 'Photo of the Day (Widget) Settings', 'wp-photo-album-plus' ) . '</h1>' .
56
+ __( 'Changes are updated immediately. The page will reload if required.', 'wp-photo-album-plus' ) .
57
+ '<br />&nbsp;';
58
+
59
+ // The nonce
60
+ wp_nonce_field( 'wppa-nonce', 'wppa-nonce' );
61
+
62
+ // The settings table
63
+ echo
64
+ '<table class="widefat wppa-table wppa-setting-table">';
65
+
66
+ // The header
67
+ echo
68
+ '<thead style="font-weight: bold; " class="wppa_table_1">' .
69
+ '<tr>' .
70
+ '<td>' . __( '#', 'wp-photo-album-plus' ) . '</td>' .
71
+ '<td>' . __( 'Name', 'wp-photo-album-plus' ) . '</td>' .
72
+ '<td>' . __( 'Description', 'wp-photo-album-plus') . '</td>' .
73
+ '<td>' . __( 'Setting', 'wp-photo-album-plus') . '</td>' .
74
+ '<td>' . __( 'Help', 'wp-photo-album-plus' ) . '</td>' .
75
+ '</tr>' .
76
+ '</thead>';
77
+
78
+ // Open the table body
79
+ echo
80
+ '<tbody class="wppa_table" >';
81
+
82
+ $name = __('Widget Title:', 'wp-photo-album-plus');
83
+ $desc = __('The title of the widget.', 'wp-photo-album-plus');
84
+ $help = esc_js(__('Enter/modify the title for the widget. This is a default and can be overriden at widget activation.', 'wp-photo-album-plus'));
85
+ $slug = 'wppa_potd_title';
86
+ $html = wppa_input($slug, '85%');
87
+ wppa_setting($slug, '1', $name, $desc, $html, $help);
88
+
89
+ $name = __('Widget Photo Width:', 'wp-photo-album-plus');
90
+ $desc = __('Enter the desired display width of the photo in the sidebar.', 'wp-photo-album-plus');
91
+ $help = '';
92
+ $slug = 'wppa_potd_widget_width';
93
+ $html = wppa_input($slug, '40px', '', __('pixels wide', 'wp-photo-album-plus'));
94
+ wppa_setting($slug, '2', $name, $desc, $html, $help);
95
+
96
+ $name = __('Horizontal alignment:', 'wp-photo-album-plus');
97
+ $desc = __('Enter the desired display alignment of the photo in the sidebar.', 'wp-photo-album-plus');
98
+ $help = '';
99
+ $slug = 'wppa_potd_align';
100
+ $opts = array(__('--- none ---', 'wp-photo-album-plus'), __('left', 'wp-photo-album-plus'), __('center', 'wp-photo-album-plus'), __('right', 'wp-photo-album-plus'));
101
+ $vals = array('none', 'left', 'center', 'right');
102
+ $html = wppa_select($slug, $opts, $vals);
103
+ wppa_setting($slug, '3', $name, $desc, $html, $help);
104
+
105
+ $linktype = wppa_opt( 'potd_linktype' );
106
+ if ( $linktype == 'custom' ) {
107
+
108
+ $name = __('Link to:', 'wp-photo-album-plus');
109
+ $desc = __('Enter the url. Do\'nt forget the HTTP://', 'wp-photo-album-plus');
110
+ $help = '';
111
+ $slug = 'wppa_potd_linkurl';
112
+ $html = wppa_input($slug, '85%');
113
+ wppa_setting($slug, '4', $name, $desc, $html, $help);
114
+
115
+ $name = __('Link Title:', 'wp-photo-album-plus');
116
+ $desc = __('The balloon text when hovering over the photo.', 'wp-photo-album-plus');
117
+ $help = '';
118
+ $slug = 'wppa_potd_linktitle';
119
+ $html = wppa_input($slug, '85%');
120
+ wppa_setting($slug, '4a', $name, $desc, $html, $help);
121
+
122
+ }
123
+ else {
124
+ $name = __('Link to:', 'wp-photo-album-plus');
125
+ $desc = __('Links are set on the <b>Photo Albums -> Settings</b> screen.', 'wp-photo-album-plus');
126
+ $help = '';
127
+ $slug = 'wppa_potd_linkurl';
128
+ $html = '';
129
+ wppa_setting($slug, '4', $name, $desc, $html, $help);
130
+ }
131
+
132
+ $name = __('Subtitle:', 'wp-photo-album-plus');
133
+ $desc = __('Select the content of the subtitle.', 'wp-photo-album-plus');
134
+ $help = '';
135
+ $slug = 'wppa_potd_subtitle';
136
+ $opts = array( __('--- none ---', 'wp-photo-album-plus'),
137
+ __('Photo Name', 'wp-photo-album-plus'),
138
+ __('Description', 'wp-photo-album-plus'),
139
+ __('Owner', 'wp-photo-album-plus')
140
+ );
141
+ $vals = array( 'none', 'name', 'desc', 'owner' );
142
+ $html = wppa_select($slug, $opts, $vals);
143
+ wppa_setting($slug, '5', $name, $desc, $html, $help);
144
+
145
+ $name = __('Counter:', 'wp-photo-album-plus');
146
+ $desc = __('Display a counter of other photos in the album.', 'wp-photo-album-plus');
147
+ $help = '';
148
+ $slug = 'wppa_potd_counter';
149
+ $html = wppa_checkbox($slug);
150
+ wppa_setting($slug, '6', $name, $desc, $html, $help);
151
+
152
+ $name = __('Link to:', 'wp-photo-album-plus');
153
+ $desc = __('The counter links to.', 'wp-photo-album-plus');
154
+ $help = '';
155
+ $slug = 'wppa_potd_counter_link';
156
+ $opts = array(__( 'thumbnails', 'wp-photo-album-plus' ), __( 'slideshow', 'wp-photo-album-plus' ), __('single image', 'wp-photo-album-plus'));
157
+ $vals = array( 'thumbs', 'slide', 'single' );
158
+ $html = wppa_select($slug, $opts, $vals);
159
+ wppa_setting($slug, '7', $name, $desc, $html, $help);
160
+
161
+ $name = __('Type of album(s) to use:', 'wp-photo-album-plus');
162
+ $desc = __('Select physical or virtual.', 'wp-photo-album-plus');
163
+ $help = '';
164
+ $slug = 'wppa_potd_album_type';
165
+ $opts = array(__('physical albums', 'wp-photo-album-plus'), __('virtual albums', 'wp-photo-album-plus'));
166
+ $vals = array('physical', 'virtual');
167
+ $html = wppa_select($slug, $opts, $vals, $onch);
168
+ wppa_setting($slug, '8', $name, $desc, $html, $help);
169
+
170
+ $name = __('Albums to use:', 'wp-photo-album-plus');
171
+ $desc = __('Select the albums to use for the photo of the day.', 'wp-photo-album-plus');
172
+ $help = '';
173
+ $slug = 'wppa_potd_album';
174
+ if ( get_option( 'wppa_potd_album_type' ) == 'physical' ) {
175
+ $html = '<select' .
176
+ ' id="wppa_potd_album"' .
177
+ ' name="wppa_potd_album"' .
178
+ ' style="float:left; max-width: 100%;"' .
179
+ ' multiple="multiple"' .
180
+ ' onchange="didsome=true;wppaAjaxUpdateOptionValue(\'potd_album\', this, true)"' .
181
+ // ' onblur="document.location.reload(true);"' .
182
+ ' onmouseout="if(didsome)document.location.reload(true);"' .
183
+ ' size="10"' .
184
+ ' >' .
185
+ wppa_album_select_a( array ( 'path' => true,
186
+ 'optionclass' => 'potd_album',
187
+ 'selected' => get_option( 'wppa_potd_album' ),
188
+ ) ) .
189
+ '</select>' .
190
+ '<img id="img_potd_album" class="" src="'.wppa_get_imgdir().'star.png" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
191
+ wppa_setting($slug, '9', $name, $desc, $html, $help);
192
+ }
193
+ else {
194
+ $desc = __('Select the albums to use for the photo of the day.', 'wp-photo-album-plus');
195
+ $opts = array( __( '- all albums -' , 'wp-photo-album-plus' ),
196
+ __( '- all -separate- albums -' , 'wp-photo-album-plus' ),
197
+ __( '- all albums except -separate-' , 'wp-photo-album-plus' ),
198
+ __( '- top rated photos -' , 'wp-photo-album-plus' ),
199
+ );
200
+ $vals = array( 'all', 'sep', 'all-sep', 'topten' );
201
+ $html = wppa_select($slug, $opts, $vals);
202
+ wppa_setting($slug, '9', $name, $desc, $html, $help);
203
+ }
204
+
205
+ if ( get_option( 'wppa_potd_album_type' ) == 'physical' ) {
206
+ $name = __('Include (grand)children:', 'wp-photo-album-plus');
207
+ $desc = __('Include the photos of all sub albums?', 'wp-photo-album-plus');
208
+ $help = '';
209
+ $slug = 'wppa_potd_include_subs';
210
+ $html = wppa_checkbox($slug, $onch);
211
+ wppa_setting($slug, '9a', $name, $desc, $html, $help);
212
+
213
+ $name = __('Inverse selection:', 'wp-photo-album-plus');
214
+ $desc = __('Use any album, except the selection made above.', 'wp-photo-album-plus');
215
+ $help = '';
216
+ $slug = 'wppa_potd_inverse';
217
+ $html = wppa_checkbox($slug, $onch);
218
+ wppa_setting($slug, '9b', $name, $desc, $html, $help);
219
+ }
220
+
221
+ $name = __('Status filter:', 'wp-photo-album-plus');
222
+ $desc = __('Use only photos with a certain status.', 'wp-photo-album-plus');
223
+ $help = esc_js(__('Select - none - if you want no filtering on status.', 'wp-photo-album-plus'));
224
+ $slug = 'wppa_potd_status_filter';
225
+ $opts = array( __('- none -', 'wp-photo-album-plus'),
226
+ __( 'Publish' , 'wp-photo-album-plus'),
227
+ __( 'Featured' , 'wp-photo-album-plus'),
228
+ __( 'Gold' , 'wp-photo-album-plus'),
229
+ __( 'Silver' , 'wp-photo-album-plus'),
230
+ __( 'Bronze' , 'wp-photo-album-plus'),
231
+ __( 'Any medal' , 'wp-photo-album-plus'),
232
+ );
233
+ $vals = array( 'none',
234
+ 'publish',
235
+ 'featured',
236
+ 'gold',
237
+ 'silver',
238
+ 'bronze',
239
+ 'anymedal',
240
+ );
241
+ $html = wppa_select($slug, $opts, $vals);
242
+ wppa_setting($slug, '10', $name, $desc, $html, $help);
243
+
244
+ $name = __('Display method:', 'wp-photo-album-plus');
245
+ $desc = __('Select the way a photo will be selected.', 'wp-photo-album-plus');
246
+ $help = '';
247
+ $slug = 'wppa_potd_method';
248
+ $opts = array( __('Fixed photo', 'wp-photo-album-plus'),
249
+ __('Random', 'wp-photo-album-plus'),
250
+ __('Last upload', 'wp-photo-album-plus'),
251
+ __('Change every', 'wp-photo-album-plus'),
252
+ );
253
+ $vals = array( '1', '2', '3', '4', );
254
+ $html = wppa_select($slug, $opts, $vals, $onch);
255
+ wppa_setting($slug, '11', $name, $desc, $html, $help);
256
+
257
+ if ( get_option( 'wppa_potd_method' ) == '4' ) { // Change every
258
+ $name = __('Change every period:', 'wp-photo-album-plus');
259
+ $desc = __('The time period a certain photo is used.', 'wp-photo-album-plus');
260
+ $help = '';
261
+ $slug = 'wppa_potd_period';
262
+ $opts = array( __('pageview.', 'wp-photo-album-plus'),
263
+ __('hour.', 'wp-photo-album-plus'),
264
+ __('day.', 'wp-photo-album-plus'),
265
+ __('week.', 'wp-photo-album-plus'),
266
+ __('month.', 'wp-photo-album-plus'),
267
+ __('day of week is order#', 'wp-photo-album-plus'),
268
+ __('day of month is order#', 'wp-photo-album-plus'),
269
+ __('day of year is order#', 'wp-photo-album-plus')
270
+ );
271
+ $vals = array( '0', '1', '24', '168', '736', 'day-of-week', 'day-of-month', 'day-of-year' );
272
+ $html = wppa_select($slug, $opts, $vals, $onch);
273
+ wppa_setting($slug, '11a', $name, $desc, $html, $help);
274
+
275
+ $wppa_widget_period = get_option( 'wppa_potd_period' );
276
+ if ( substr( $wppa_widget_period, 0, 7 ) == 'day-of-' ) {
277
+ switch( substr( $wppa_widget_period, 7 ) ) {
278
+ case 'week':
279
+ $n_days = '7';
280
+ $date_key = 'w';
281
+ break;
282
+ case 'month':
283
+ $n_days = '31';
284
+ $date_key = 'd';
285
+ break;
286
+ case 'year':
287
+ $n_days = '366';
288
+ $date_key = 'z';
289
+ break;
290
+ }
291
+ while ( get_option( 'wppa_potd_offset', '0' ) > $n_days ) update_option( 'wppa_potd_offset', get_option( 'wppa_potd_offset') - $n_days );
292
+ while ( get_option( 'wppa_potd_offset', '0' ) < '0' ) update_option( 'wppa_potd_offset', get_option( 'wppa_potd_offset') + $n_days );
293
+
294
+ $name = __('Day offset:', 'wp-photo-album-plus');
295
+ $desc = __('The difference between daynumber and photo order number.', 'wp-photo-album-plus');
296
+ $help = '';
297
+ $slug = 'wppa_potd_offset';
298
+ $opts = array();
299
+ $day = '0';
300
+ while ( $day < $n_days ) {
301
+ $opts[] = $day;
302
+ $day++;
303
+ }
304
+ $vals = $opts;
305
+ $html = '<span style="float:left;" >' .
306
+ sprintf( __('Current day# = %s, offset =', 'wp-photo-album-plus'), wppa_local_date( $date_key ) ) .
307
+ '</span> ' .
308
+ wppa_select($slug, $opts, $vals, $onch);
309
+
310
+ $photo_order = wppa_local_date( $date_key ) - get_option( 'wppa_potd_offset', '0' );
311
+ while ( $photo_order < '0' ) {
312
+ $photo_order += $n_days;
313
+ }
314
+
315
+ $html .= sprintf( __('Todays photo order# = %s.', 'wp-photo-album-plus'), $photo_order );
316
+ wppa_setting($slug, '11b', $name, $desc, $html, $help);
317
+
318
+ }
319
+ }
320
+
321
+ $name = __('Preview', 'wp-photo-album-plus');
322
+ $desc = __('Current "photo of the day":', 'wp-photo-album-plus');
323
+ $help = '';
324
+ $slug = 'wppa_potd_photo';
325
+ $photo = wppa_get_potd();
326
+ if ( $photo ) {
327
+ $html = '<div style="display:inline-block;width:25%;text-align:center;vertical-align:middle;">' .
328
+ '<img src="' . wppa_fix_poster_ext(wppa_get_thumb_url( $photo['id'] ), $photo['id'] ) . '" />' .
329
+ '</div>' .
330
+ '<div style="display:inline-block;width:75%;text-align:center;vertical-align:middle;" >' .
331
+ __('Album', 'wp-photo-album-plus') . ': ' . wppa_get_album_name( $photo['album'] ) .
332
+ '<br />' .
333
+ __('Uploader', 'wp-photo-album-plus') . ': ' . $photo['owner'] .
334
+ '</div>';
335
+
336
+ }
337
+ else {
338
+ $html = __('Not found.', 'wp-photo-album-plus');
339
+ }
340
+ wppa_setting($slug, '12', $name, $desc, $html, $help);
341
+
342
+ $name = __('Show selection', 'wp-photo-album-plus');
343
+ $desc = __('Show the photos in the current selection.', 'wp-photo-album-plus');
344
+ $help = '';
345
+ $slug = 'wppa_potd_preview';
346
+ $html = wppa_checkbox($slug, $onch);
347
+ wppa_setting($slug, '13', $name, $desc, $html, $help);
348
+
349
+ // Cose table body
350
+ echo
351
+ '</tbody>';
352
+
353
+ // Table footer
354
+ echo
355
+ '<tfoot style="font-weight: bold;" >' .
356
+ '<tr>' .
357
+ '<td>' . __( '#', 'wp-photo-album-plus' ) . '</td>' .
358
+ '<td>' . __( 'Name', 'wp-photo-album-plus' ) . '</td>' .
359
+ '<td>' . __( 'Description', 'wp-photo-album-plus') . '</td>' .
360
+ '<td>' . __( 'Setting', 'wp-photo-album-plus') . '</td>' .
361
+ '<td>' . __( 'Help', 'wp-photo-album-plus' ) . '</td>' .
362
+ '</tr>' .
363
+ '</tfoot>' .
364
+ '</table>';
365
+
366
+ // Diagnostic
367
+ // echo
368
+ // 'Diagnostic: wppa_potd_album = ' . get_option( 'wppa_potd_album' ) . ' wppa_potd_photo = ' . get_option( 'wppa_potd_photo' );
369
+
370
+ // Status star must be here for js
371
+ echo
372
+ '<img' .
373
+ ' id="img_potd_photo"' .
374
+ ' src="' . wppa_get_imgdir( 'star.png' ) . '" style="height:12px;display:none;"' .
375
+ ' />';
376
+
377
+ // The potd photo pool
378
+ echo
379
+ '<table class="widefat wppa-table wppa-setting-table" >';
380
+
381
+ // Table header
382
+ echo
383
+ '<thead>' .
384
+ '<tr>' .
385
+ '<td>' .
386
+ __( 'Photos in the current selection', 'wp-photo-album-plus' ) .
387
+ '</td>' .
388
+ '</tr>' .
389
+ '</thead>';
390
+
391
+ // Table body
392
+ if ( wppa_switch( 'potd_preview' ) ) {
393
+ echo
394
+ '<tbody>' .
395
+ '<tr>' .
396
+ '<td>';
397
+
398
+ // Get the photos
399
+ $alb = wppa_opt( 'potd_album' );
400
+ $opt = wppa_is_int( $alb ) ? ' ' . wppa_get_photo_order( $alb ) . ' ' : '';
401
+ $photos = wppa_get_widgetphotos( $alb, $opt );
402
+
403
+ // Count them
404
+ $cnt = count( $photos );
405
+
406
+ // Find current
407
+ $curid = wppa_opt( 'potd_photo' );
408
+
409
+ // See if we do this
410
+ if ( empty( $photos ) ) {
411
+ _e( 'No photos in the selection', 'wp-photo-album-plus' );
412
+ }
413
+ elseif ( $cnt > '5000' ) {
414
+ echo sprintf( __( 'There are too many photos in the selection to show a preview ( %d )', 'wp-photo-album-plus' ), $cnt );
415
+ }
416
+ else {
417
+
418
+ // Yes, display the pool
419
+ foreach ( $photos as $photo ) {
420
+ $id = $photo['id'];
421
+
422
+ // Open container div
423
+ echo
424
+ '<div' .
425
+ ' class="photoselect"' .
426
+ ' style="' .
427
+ 'width:180px;' .
428
+ 'height:300px;' .
429
+ '" >';
430
+
431
+ // Open image container div
432
+ echo
433
+ '<div' .
434
+ ' style="' .
435
+ 'width:180px;' .
436
+ 'height:135px;' .
437
+ 'overflow:hidden;' .
438
+ 'text-align:center;' .
439
+ '" >';
440
+
441
+ // The image if a video
442
+ if ( wppa_is_video( $id ) ) {
443
+ echo wppa_get_video_html( array( 'id' => $id,
444
+ 'style' => 'width:180px;'
445
+ ));
446
+ }
447
+
448
+ // The image if a photo
449
+ else {
450
+ echo '<img' .
451
+ ' src=" '. wppa_fix_poster_ext( wppa_get_thumb_url( $id ), $id ) . '"' .
452
+ ' style="' .
453
+ 'max-width:180px;' .
454
+ 'max-height:135px;' .
455
+ 'margin:auto;' .
456
+ '"' .
457
+ ' alt="' . esc_attr( wppa_get_photo_name( $id ) ) .'" />';
458
+
459
+ // Audio ?
460
+ if ( wppa_has_audio( $id ) ) {
461
+ echo wppa_get_audio_html( array( 'id' => $id,
462
+ 'style' => 'width:180px;' .
463
+ 'position:relative;' .
464
+ 'bottom:' . ( wppa_get_audio_control_height() + 4 ) .'px;'
465
+ ));
466
+ }
467
+ }
468
+
469
+ // Close image container div
470
+ echo
471
+ '</div>';
472
+
473
+ // The order# and select radio box
474
+ echo
475
+ '<div style="clear:both;width:100%;margin:3px 0;position:relative;top:5px;" >' .
476
+ '<div style="font-size:9px; line-height:10px;float:left;">(#' . $photo['p_order'] . ')</div>';
477
+
478
+ if ( get_option( 'wppa_potd_method' ) == '1' ) { // Only if fixed photo
479
+ echo
480
+ '<input' .
481
+ ' style="float:right;"' .
482
+ ' type="radio"' .
483
+ ' name="wppa-widget-photo"' .
484
+ ' id="wppa-widget-photo-' . $id . '"' .
485
+ ' value="' . $id . '"' .
486
+ ( $id == $curid ? 'checked="checked"' : '' ) .
487
+ ' onchange="wppaSetFixed(' . $id . ');"' .
488
+ ' />';
489
+ }
490
+
491
+ echo
492
+ '</div>';
493
+
494
+ // The name/desc boxecho
495
+ echo
496
+ '<div style="clear:both;overflow:hidden;height:150px;position:relative;top:10px;" >' .
497
+ '<div style="font-size:11px; overflow:hidden;">' .
498
+ wppa_get_photo_name( $id ) .
499
+ '</div>' .
500
+ '<div style="font-size:9px; line-height:10px;">' .
501
+ wppa_get_photo_desc( $id ) .
502
+ '</div>' .
503
+ '</div>';
504
+
505
+ // Close container
506
+ echo
507
+ '</div>';
508
+ }
509
+ echo
510
+ '<div class="clear"></div>';
511
+ }
512
+
513
+ // Close the table
514
+ echo
515
+ '</td>' .
516
+ '</tr>' .
517
+ '</tbody>';
518
+ }
519
+ echo
520
+ '</table>';
521
+
522
+ // Close wrap
523
+ echo
524
+ '</div>';
525
+ }
526
+
527
+ // The functions below this line are different from the ones with the same names in the Settings page!!!
528
+ function wppa_setting( $slug, $num, $name, $desc, $html, $help) {
529
+ global $wppa_status;
530
+ global $wppa_defaults;
531
+ global $wppa_table;
532
+ global $wppa_subtable;
533
+ global $no_default;
534
+ global $wppa_opt;
535
+
536
+ if ( is_array($slug) ) $slugs = $slug;
537
+ else {
538
+ $slugs = false;
539
+ if ( $slug ) $slugs[] = $slug;
540
+ }
541
+ if ( is_array($html) ) $htmls = $html;
542
+ else {
543
+ $htmls = false;
544
+ if ( $html ) $htmls[] = $html;
545
+ }
546
+ if ( strpos($num, ',') !== false ) {
547
+ $nums = explode(',', $num);
548
+ $nums[0] = substr($nums[0], 1);
549
+ }
550
+ else {
551
+ $nums = false;
552
+ if ( $num ) $nums[] = $num;
553
+ }
554
+
555
+ // Build the html
556
+ $result = "\n";
557
+ $result .= '<tr id="potd-setting" class="" style="color:#333;">';
558
+ $result .= '<td>'.$num.'</td>';
559
+ $result .= '<td>'.$name.'</td>';
560
+ $result .= '<td><small>'.$desc.'</small></td>';
561
+ if ( $htmls ) foreach ( $htmls as $html ) {
562
+ $result .= '<td>'.$html.'</td>';
563
+ }
564
+ else {
565
+ $result .= '<td></td>';
566
+ }
567
+
568
+ if ( $help || ( defined( 'WP_DEBUG') && WP_DEBUG ) ) {
569
+ $is_dflt = true;
570
+ $hlp = esc_js($name).':\n\n'.$help;
571
+ if ( ! $no_default ) {
572
+ if ( $slugs ) {
573
+ $hlp .= '\n\n'.__('The default for this setting is:', 'wp-photo-album-plus');
574
+ if ( count($slugs) == 1) {
575
+ if ( $slugs[0] != '' ) {
576
+ $hlp .= ' '.esc_js(wppa_dflt($slugs[0]));
577
+ if ( $wppa_opt[$slugs[0]] != $wppa_defaults[$slugs[0]] ) {
578
+ $is_dflt = false;
579
+ }
580
+ }
581
+ }
582
+ else foreach ( array_keys($slugs) as $slugidx ) {
583
+ if ( $slugs[$slugidx] != '' && isset($nums[$slugidx]) ) $hlp .= ' '.$nums[$slugidx].'. '.esc_js(wppa_dflt($slugs[$slugidx]));
584
+ if ( $slugs[$slugidx] != '' && $wppa_opt[$slugs[$slugidx]] != $wppa_defaults[$slugs[$slugidx]] ) {
585
+ $is_dflt = false;
586
+ }
587
+ }
588
+ }
589
+ }
590
+ $result .= '<td><input type="button" style="font-size: 11px; height:20px; padding:0; cursor: pointer;" title="'.__('Click for help', 'wp-photo-album-plus').'" onclick="alert('."'".$hlp."'".')" value="&nbsp;' . ( $is_dflt ? '?' : '!' ) . '&nbsp;"></td>';
591
+ }
592
+ else {
593
+ $result .= '<td></td>';//$hlp = __('No help available');
594
+ }
595
+
596
+ $result .= '</tr>';
597
+
598
+ echo $result;
599
+
600
+ }
601
+
602
+
603
+ function wppa_dflt($slug) {
604
+ global $wppa_defaults;
605
+ global $no_default;
606
+
607
+ if ( $slug == '' ) return '';
608
+ if ( $no_default ) return '';
609
+
610
+ $dflt = isset( $wppa_defaults[$slug] ) ? $wppa_defaults[$slug] : '';
611
+
612
+ $dft = $dflt;
613
+ switch ($dflt) {
614
+ case 'yes': $dft .= ': '.__('Checked', 'wp-photo-album-plus'); break;
615
+ case 'no': $dft .= ': '.__('Unchecked', 'wp-photo-album-plus'); break;
616
+ case 'none': $dft .= ': '.__('no link at all.', 'wp-photo-album-plus'); break;
617
+ case 'file': $dft .= ': '.__('the plain photo (file).', 'wp-photo-album-plus'); break;
618
+ case 'photo': $dft .= ': '.__('the full size photo in a slideshow.', 'wp-photo-album-plus'); break;
619
+ case 'single': $dft .= ': '.__('the fullsize photo on its own.', 'wp-photo-album-plus'); break;
620
+ case 'indiv': $dft .= ': '.__('the photo specific link.', 'wp-photo-album-plus'); break;
621
+ case 'album': $dft .= ': '.__('the content of the album.', 'wp-photo-album-plus'); break;
622
+ case 'widget': $dft .= ': '.__('defined at widget activation.', 'wp-photo-album-plus'); break;
623
+ case 'custom': $dft .= ': '.__('defined on widget admin page.', 'wp-photo-album-plus'); break;
624
+ case 'same': $dft .= ': '.__('same as title.', 'wp-photo-album-plus'); break;
625
+ default:
626
+ }
627
+
628
+ return $dft;
629
+ }
630
+
631
+ function wppa_checkbox($xslug, $onchange = '', $class = '') {
632
+ global $wppa_defaults;
633
+ global $wppa_opt;
634
+
635
+ $slug = substr( $xslug, 5 );
636
+ $tit = __('Slug =', 'wp-photo-album-plus').' '.$xslug."\n".__('Values = yes, no', 'wp-photo-album-plus');
637
+ $title = wppa_switch( 'enable_shortcode_wppa_set' ) ? ' title="'.esc_attr( $tit ).'"' : '';
638
+ $html = '<input style="float:left; height: 15px; margin: 0px; padding: 0px;" type="checkbox" id="'.$slug.'"'.$title;
639
+ if ( wppa_switch( $slug ) ) $html .= ' checked="checked"';
640
+ if ($onchange != '') $html .= ' onchange="'.$onchange.';wppaAjaxUpdateOptionCheckBox(\''.$slug.'\', this)"';
641
+ else $html .= ' onchange="wppaAjaxUpdateOptionCheckBox(\''.$slug.'\', this)"';
642
+
643
+ if ($class != '') $html .= ' class="'.$class.'"';
644
+ $html .= ' /><img id="img_'.$slug.'" src="'.wppa_get_imgdir().'star.png" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding-left:4px; float:left; height:16px; width:16px;"';
645
+ if ($class != '') $html .= ' class="'.$class.'"';
646
+ $html .= ' />';
647
+
648
+ if ( substr( $onchange, 0, 10 ) == 'wppaFollow' ) {
649
+ $html .= '<script type="text/javascript" >jQuery(document).ready(function(){'.$onchange.'})</script>';
650
+ }
651
+
652
+ return $html;
653
+ }
654
+
655
+ function wppa_input($xslug, $width, $minwidth = '', $text = '', $onchange = '', $placeholder = '') {
656
+ global $wppa_opt;
657
+
658
+ $slug = substr( $xslug, 5 );
659
+ $tit = __('Slug =', 'wp-photo-album-plus').' '.$xslug;
660
+ $title = wppa_switch( 'enable_shortcode_wppa_set' ) ? ' title="'.esc_attr( $tit ).'"' : '';
661
+ $val = isset ( $wppa_opt[ $xslug ] ) ? esc_attr( $wppa_opt[ $xslug ] ) : get_option( $xslug, '' );
662
+ $html = '<input'.$title.' style="float:left; width: '.$width.'; height:20px;';
663
+ if ($minwidth != '') $html .= ' min-width:'.$minwidth.';';
664
+ $html .= ' font-size: 11px; margin: 0px; padding: 0px;" type="text" id="'.$slug.'"';
665
+ if ($onchange != '') $html .= ' onchange="'.$onchange.';wppaAjaxUpdateOptionValue(\''.$slug.'\', this)"';
666
+ else $html .= ' onchange="wppaAjaxUpdateOptionValue(\''.$slug.'\', this)"';
667
+ if ( $placeholder ) $html .= ' placeholder="'.$placeholder.'"';
668
+ $html .= ' value=" '.$val.'" />';
669
+ $html .= '<img id="img_'.$slug.'" src="'.wppa_get_imgdir().'star.png" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
670
+ $html .= '<span style="float:left">'.$text.'</span>';
671
+
672
+ return $html;
673
+ }
674
+
675
+ function wppa_select($xslug, $options, $values, $onchange = '', $class = '', $first_disable = false, $postaction = '', $max_width = '220' ) {
676
+ global $wppa_opt;
677
+
678
+ $slug = substr( $xslug, 5 );
679
+
680
+ $tit = __('Slug =', 'wp-photo-album-plus').' '.$xslug."\n".__('Values = ', 'wp-photo-album-plus');
681
+ foreach( $values as $val ) $tit.= $val.', ';
682
+ $tit = trim( $tit, ', ');
683
+ $title = wppa_switch( 'enable_shortcode_wppa_set' ) ? ' title="'.esc_attr( $tit ).'"' : '';
684
+
685
+ $html = '<select style="float:left; font-size: 11px; height: 20px; margin: 0px; padding: 0px; max-width:'.$max_width.'px;" id="'.$slug.'"'.$title;
686
+ $html .= ' onchange="'.$onchange.';wppaAjaxUpdateOptionValue(\''.$slug.'\', this);'.$postaction.'"';
687
+
688
+ if ($class != '') $html .= ' class="'.$class.'"';
689
+ $html .= '>';
690
+
691
+ $val = get_option( $xslug ); // value can be yes or no in Table 0 !! so do not use wppa_opt()
692
+ $idx = 0;
693
+ $cnt = count($options);
694
+ while ($idx < $cnt) {
695
+ $html .= "\n";
696
+ $html .= '<option value="'.$values[$idx].'" ';
697
+ $dis = false;
698
+ if ($idx == 0 && $first_disable) $dis = true;
699
+ $opt = trim($options[$idx], '|');
700
+ if ($opt != $options[$idx]) $dis = true;
701
+ if ($val == $values[$idx]) $html .= ' selected="selected"';
702
+ if ($dis) $html .= ' disabled="disabled"';
703
+ $html .= '>'.$opt.'</option>';
704
+ $idx++;
705
+ }
706
+ $html .= '</select>';
707
+ $html .= '<img id="img_'.$slug.'" class="'.$class.'" src="'.wppa_get_imgdir().'star.png" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
708
+
709
+ return $html;
710
+ }
711
+
712
+ require_once ('wppa-widget-functions.php');
wppa-potd-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the widget
6
- * Version 6.5.00
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -54,10 +54,10 @@ class PhotoOfTheDay extends WP_Widget {
54
  $w = wppa_opt( 'potd_widget_width' );
55
  $ratio = wppa_get_photoy( $id ) / wppa_get_photox( $id );
56
  $h = round( $w * $ratio );
57
- $usethumb = wppa_use_thumb_file( $id, wppa_opt( 'widget_width' ), '0' );
58
  $imgurl = wppa_fix_poster_ext( $usethumb ? wppa_get_thumb_url( $id, '', $w, $h ) : wppa_get_photo_url( $id, '', $w, $h ), $id );
59
  $name = wppa_get_photo_name( $id );
60
- $page = ( in_array( wppa_opt( 'widget_linktype' ), wppa( 'links_no_page' ) ) && ! wppa_switch( 'widget_counter' ) ) ? '' : wppa_get_the_landing_page( 'widget_linkpage', __('Photo of the day', 'wp-photo-album-plus') );
61
  $link = wppa_get_imglnk_a( 'potdwidget' , $id );
62
  $is_video = wppa_is_video( $id );
63
  $has_audio = wppa_has_audio( $id );
@@ -67,7 +67,8 @@ class PhotoOfTheDay extends WP_Widget {
67
  ' data-videonatwidth="'.wppa_get_videox( $id ).'"' .
68
  ' data-videonatheight="'.wppa_get_videoy( $id ).'"' : '' ) .
69
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
70
- ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '"';
 
71
  }
72
  else {
73
  $lightbox = '';
@@ -101,7 +102,7 @@ class PhotoOfTheDay extends WP_Widget {
101
  $widget_content .= "\n\t\t".wppa_get_video_html( array ( 'id' => $id,
102
  'width' => wppa_opt( 'potd_widget_width' ),
103
  'title' => $title,
104
- 'controls' => ( wppa_opt( 'widget_linktype' ) == 'none' ),
105
  'cursor' => $cursor
106
  ));
107
  }
@@ -115,23 +116,30 @@ class PhotoOfTheDay extends WP_Widget {
115
  }
116
 
117
  // Close the link
118
- if ($link) $widget_content .= "\n\t".'</a>';
119
 
120
  // The medal if at the bottom
121
  $widget_content .= wppa_get_medal_html_a( array( 'id' => $id, 'size' => 'M', 'where' => 'bot' ) );
122
 
123
  // The counter
124
- if ( wppa_switch( 'widget_counter' ) ) { // If we want this
125
  $alb = wppa_get_photo_item( $id, 'album' );
126
  $c = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `album` = " . $alb ) - 1;
127
  if ( $c > 0 ) {
128
  if ( wppa_opt( 'potd_counter_link' ) == 'thumbs' ) {
129
  $lnk = wppa_get_album_url( $alb, $page, 'thumbs', '1' );
130
  }
131
- else {
132
  $lnk = wppa_get_slideshow_url( $alb, $page, $id, '1' );
133
  }
134
- $lnk =
 
 
 
 
 
 
 
135
  $widget_content .= '<a href="' . $lnk . '" >' .
136
  '<div style="font-size:12px;position:absolute;right:4px;bottom:4px;" >+' . $c . '</div>' .
137
  '</a>';
@@ -153,26 +161,25 @@ class PhotoOfTheDay extends WP_Widget {
153
  $widget_content .= "\n".'</div>';
154
 
155
  // Add subtitle, if any
156
- switch ( wppa_opt( 'widget_subtitle' ) ) {
157
- case 'none':
158
- break;
159
- case 'name':
160
- if ($image && $image['name'] != '') {
161
- $widget_content .= "\n".'<div class="wppa-widget-text wppa-potd-text" style="'.$align.'">' . wppa_get_photo_name( $id ) . '</div>';
162
- }
163
- break;
164
- case 'desc':
165
- if ($image && $image['description'] != '') {
166
  $widget_content .= "\n".'<div class="wppa-widget-text wppa-potd-text" style="'.$align.'">' . wppa_get_photo_desc( $id ) . '</div>';
167
- }
168
- break;
169
- case 'owner':
170
- if ( $image ) {
171
  $owner = $image['owner'];
172
  $user = get_user_by('login', $owner);
173
  $owner = $user->display_name;
174
  $widget_content .= "\n".'<div class="wppa-widget-text wppa-potd-text" style="'.$align.'">'.__('By:', 'wp-photo-album-plus').' ' . $owner . '</div>';
175
- }
 
 
 
176
  }
177
 
178
  $widget_content .= '<div style="clear:both;" ></div>';
@@ -187,18 +194,18 @@ class PhotoOfTheDay extends WP_Widget {
187
  }
188
 
189
  /** @see WP_Widget::update */
190
- function update($new_instance, $old_instance) {
191
  $instance = $old_instance;
192
- $instance['title'] = strip_tags($new_instance['title']);
193
 
194
  return $instance;
195
  }
196
 
197
  /** @see WP_Widget::form */
198
- function form($instance) {
199
 
200
  //Defaults
201
- $instance = wp_parse_args( (array) $instance, array( 'title' => wppa_opt( 'widgettitle') ) );
202
  $widget_title = $instance['title'];
203
  ?>
204
  <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'wp-photo-album-plus'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $widget_title; ?>" /></p>
@@ -208,11 +215,11 @@ class PhotoOfTheDay extends WP_Widget {
208
 
209
  } // class PhotoOfTheDay
210
 
211
- require_once ('wppa-widget-functions.php');
212
 
213
  // register PhotoOfTheDay widget
214
- add_action('widgets_init', 'wppa_register_PhotoOfTheDay' );
215
 
216
  function wppa_register_PhotoOfTheDay() {
217
- register_widget("PhotoOfTheDay");
218
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the widget
6
+ * Version 6.5.04
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
54
  $w = wppa_opt( 'potd_widget_width' );
55
  $ratio = wppa_get_photoy( $id ) / wppa_get_photox( $id );
56
  $h = round( $w * $ratio );
57
+ $usethumb = wppa_use_thumb_file( $id, wppa_opt( 'potd_widget_width' ), '0' );
58
  $imgurl = wppa_fix_poster_ext( $usethumb ? wppa_get_thumb_url( $id, '', $w, $h ) : wppa_get_photo_url( $id, '', $w, $h ), $id );
59
  $name = wppa_get_photo_name( $id );
60
+ $page = ( in_array( wppa_opt( 'potd_linktype' ), wppa( 'links_no_page' ) ) && ! wppa_switch( 'potd_counter' ) ) ? '' : wppa_get_the_landing_page( 'potd_linkpage', __('Photo of the day', 'wp-photo-album-plus') );
61
  $link = wppa_get_imglnk_a( 'potdwidget' , $id );
62
  $is_video = wppa_is_video( $id );
63
  $has_audio = wppa_has_audio( $id );
67
  ' data-videonatwidth="'.wppa_get_videox( $id ).'"' .
68
  ' data-videonatheight="'.wppa_get_videoy( $id ).'"' : '' ) .
69
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
70
+ ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '"' .
71
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"';
72
  }
73
  else {
74
  $lightbox = '';
102
  $widget_content .= "\n\t\t".wppa_get_video_html( array ( 'id' => $id,
103
  'width' => wppa_opt( 'potd_widget_width' ),
104
  'title' => $title,
105
+ 'controls' => ( wppa_opt( 'potd_linktype' ) == 'none' ),
106
  'cursor' => $cursor
107
  ));
108
  }
116
  }
117
 
118
  // Close the link
119
+ if ( $link ) $widget_content .= '</a>';
120
 
121
  // The medal if at the bottom
122
  $widget_content .= wppa_get_medal_html_a( array( 'id' => $id, 'size' => 'M', 'where' => 'bot' ) );
123
 
124
  // The counter
125
+ if ( wppa_switch( 'potd_counter' ) ) { // If we want this
126
  $alb = wppa_get_photo_item( $id, 'album' );
127
  $c = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `album` = " . $alb ) - 1;
128
  if ( $c > 0 ) {
129
  if ( wppa_opt( 'potd_counter_link' ) == 'thumbs' ) {
130
  $lnk = wppa_get_album_url( $alb, $page, 'thumbs', '1' );
131
  }
132
+ elseif ( wppa_opt( 'potd_counter_link' ) == 'slide' ) {
133
  $lnk = wppa_get_slideshow_url( $alb, $page, $id, '1' );
134
  }
135
+ elseif ( wppa_opt( 'potd_counter_link' ) == 'single' ) {
136
+ $lnk = wppa_encrypt_url( get_permalink( $page ) . '?occur=1&photo=' . $id );
137
+ // wppa_get_image_page_url_by_id( $id, true, false, $page );
138
+ }
139
+ else {
140
+ wppa_log( 'Err', 'Unimplemented counter link type in wppa-potd-widget: ' . wppa_opt( 'potd_counter_link' ) );
141
+ }
142
+
143
  $widget_content .= '<a href="' . $lnk . '" >' .
144
  '<div style="font-size:12px;position:absolute;right:4px;bottom:4px;" >+' . $c . '</div>' .
145
  '</a>';
161
  $widget_content .= "\n".'</div>';
162
 
163
  // Add subtitle, if any
164
+ if ( $image ) {
165
+ switch ( wppa_opt( 'potd_subtitle' ) ) {
166
+ case 'none':
167
+ break;
168
+ case 'name':
169
+ $widget_content .= '<div class="wppa-widget-text wppa-potd-text" style="'.$align.'">' . wppa_get_photo_name( $id ) . '</div>';
170
+ break;
171
+ case 'desc':
 
 
172
  $widget_content .= "\n".'<div class="wppa-widget-text wppa-potd-text" style="'.$align.'">' . wppa_get_photo_desc( $id ) . '</div>';
173
+ break;
174
+ case 'owner':
 
 
175
  $owner = $image['owner'];
176
  $user = get_user_by('login', $owner);
177
  $owner = $user->display_name;
178
  $widget_content .= "\n".'<div class="wppa-widget-text wppa-potd-text" style="'.$align.'">'.__('By:', 'wp-photo-album-plus').' ' . $owner . '</div>';
179
+ break;
180
+ default:
181
+ wppa_log( 'Err', 'Unimplemented potd_subtitle found in wppa-potd-widget: ' . wppa_opt( 'potd_subtitle' ) );
182
+ }
183
  }
184
 
185
  $widget_content .= '<div style="clear:both;" ></div>';
194
  }
195
 
196
  /** @see WP_Widget::update */
197
+ function update( $new_instance, $old_instance ) {
198
  $instance = $old_instance;
199
+ $instance['title'] = strip_tags( $new_instance['title'] );
200
 
201
  return $instance;
202
  }
203
 
204
  /** @see WP_Widget::form */
205
+ function form( $instance ) {
206
 
207
  //Defaults
208
+ $instance = wp_parse_args( (array) $instance, array( 'title' => wppa_opt( 'potd_title') ) );
209
  $widget_title = $instance['title'];
210
  ?>
211
  <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'wp-photo-album-plus'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $widget_title; ?>" /></p>
215
 
216
  } // class PhotoOfTheDay
217
 
218
+ require_once 'wppa-widget-functions.php';
219
 
220
  // register PhotoOfTheDay widget
221
+ add_action( 'widgets_init', 'wppa_register_PhotoOfTheDay' );
222
 
223
  function wppa_register_PhotoOfTheDay() {
224
+ register_widget( 'PhotoOfTheDay' );
225
  }
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 6.5.03
7
  *
8
  */
9
 
@@ -270,10 +270,8 @@ global $wp_version;
270
  <div class="wrap">
271
  <?php wppa_admin_spinner() ?>
272
  <?php $iconurl = WPPA_URL.'/images/settings32.png'; ?>
273
- <div id="icon-album" class="icon32" style="background: transparent url(<?php echo($iconurl); ?>) no-repeat">
274
- <br />
275
- </div>
276
- <h2><?php _e('WP Photo Album Plus Settings', 'wp-photo-album-plus'); ?> <span style="color:blue;"><?php _e('Auto Save', 'wp-photo-album-plus') ?></span></h2>
277
  <?php _e('Database revision:', 'wp-photo-album-plus'); ?> <?php echo(get_option('wppa_revision', '100')) ?>. <?php _e('WP Charset:', 'wp-photo-album-plus'); ?> <?php echo(get_bloginfo('charset')); ?>. <?php echo 'Current PHP version: ' . phpversion() ?>. <?php echo 'WPPA+ API Version: '.$wppa_api_version ?>.
278
  <br /><?php if ( is_multisite() ) {
279
  if ( WPPA_MULTISITE_GLOBAL ) {
@@ -5010,8 +5008,8 @@ global $wp_version;
5010
  $desc = __('Photo Of The Day widget link.', 'wp-photo-album-plus');
5011
  $help = esc_js(__('Select the type of link the photo of the day points to.', 'wp-photo-album-plus'));
5012
  $help .= '\n\n'.esc_js(__('If you select \'defined on widget admin page\' you can manually enter a link and title on the Photo of the day Widget Admin page.', 'wp-photo-album-plus'));
5013
- $slug1 = 'wppa_widget_linktype';
5014
- $slug2 = 'wppa_widget_linkpage';
5015
  wppa_verify_page($slug2);
5016
  $slug3 = 'wppa_potd_blank';
5017
  $slug4 = 'wppa_potdwidget_overrule';
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 6.5.04
7
  *
8
  */
9
 
270
  <div class="wrap">
271
  <?php wppa_admin_spinner() ?>
272
  <?php $iconurl = WPPA_URL.'/images/settings32.png'; ?>
273
+ <img id="icon-album" src="<?php echo $iconurl ?>" />
274
+ <h1 style="display:inline" ><?php _e('WP Photo Album Plus Settings', 'wp-photo-album-plus'); ?> <span style="color:blue;"><?php _e('Auto Save', 'wp-photo-album-plus') ?></span></h1>
 
 
275
  <?php _e('Database revision:', 'wp-photo-album-plus'); ?> <?php echo(get_option('wppa_revision', '100')) ?>. <?php _e('WP Charset:', 'wp-photo-album-plus'); ?> <?php echo(get_bloginfo('charset')); ?>. <?php echo 'Current PHP version: ' . phpversion() ?>. <?php echo 'WPPA+ API Version: '.$wppa_api_version ?>.
276
  <br /><?php if ( is_multisite() ) {
277
  if ( WPPA_MULTISITE_GLOBAL ) {
5008
  $desc = __('Photo Of The Day widget link.', 'wp-photo-album-plus');
5009
  $help = esc_js(__('Select the type of link the photo of the day points to.', 'wp-photo-album-plus'));
5010
  $help .= '\n\n'.esc_js(__('If you select \'defined on widget admin page\' you can manually enter a link and title on the Photo of the day Widget Admin page.', 'wp-photo-album-plus'));
5011
+ $slug1 = 'wppa_potd_linktype';
5012
+ $slug2 = 'wppa_potd_linkpage';
5013
  wppa_verify_page($slug2);
5014
  $slug3 = 'wppa_potd_blank';
5015
  $slug4 = 'wppa_potdwidget_overrule';
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.03
7
  *
8
  */
9
 
@@ -444,6 +444,18 @@ global $silent;
444
  }
445
  update_option( 'wppa_album_crypt_9', wppa_get_unique_album_crypt() );
446
  }
 
 
 
 
 
 
 
 
 
 
 
 
447
  }
448
 
449
  // Set Defaults
@@ -1204,8 +1216,8 @@ Hide Camera info
1204
  'wppa_sswidget_blank' => 'no',
1205
  'wppa_sswidget_overrule' => 'no',
1206
 
1207
- 'wppa_widget_linktype' => 'single',
1208
- 'wppa_widget_linkpage' => '0',
1209
  'wppa_potd_blank' => 'no',
1210
  'wppa_potdwidget_overrule' => 'no',
1211
 
@@ -1566,20 +1578,27 @@ Hide Camera info
1566
  'wppa_fotomoto_min_width' => '400',
1567
 
1568
  // Photo of the day widget
1569
- 'wppa_widgettitle' => __('Photo of the day', 'wp-photo-album-plus'),
1570
- 'wppa_widget_linkurl' => __('Type your custom url here', 'wp-photo-album-plus'),
1571
- 'wppa_widget_linktitle' => __('Type the title here', 'wp-photo-album-plus'),
1572
- 'wppa_widget_subtitle' => 'none',
1573
- 'wppa_widget_album' => 'all', // All albums
1574
- 'wppa_widget_photo' => '',
1575
- 'wppa_potd_align' => 'center',
1576
- 'wppa_widget_method' => '4', // Change every
1577
- 'wppa_widget_period' => '24', // Day
1578
- 'wppa_widget_width' => '200',
1579
  'wppa_potd_widget_width' => '200',
1580
- 'wppa_widget_status_filter' => 'none',
1581
- 'wppa_widget_counter' => 'no',
 
 
 
1582
  'wppa_potd_counter_link' => 'thumbs',
 
 
 
 
 
 
 
 
 
 
 
 
 
1583
 
1584
  // Topten widget
1585
  'wppa_toptenwidgettitle' => __('Top Ten Photos', 'wp-photo-album-plus'),
@@ -1777,7 +1796,7 @@ global $wpdb;
1777
  $desc = __( 'Default photo album for' , 'wp-photo-album-plus').' '.$user;
1778
  $id = wppa_create_album_entry( array ( 'name' => $name, 'description' => $desc, 'a_parent' => $parent ) );
1779
  if ( $id ) {
1780
- wppa_log( 'Obs', 'Album ' . $id . ' for ' . $user . 'created.' );
1781
  }
1782
  else {
1783
  wppa_log( 'Err', 'Could not create subalbum of ' . $parent . ' for ' . $user );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 6.5.04
7
  *
8
  */
9
 
444
  }
445
  update_option( 'wppa_album_crypt_9', wppa_get_unique_album_crypt() );
446
  }
447
+
448
+ if ( $old_rev <= '6504' ) {
449
+ wppa_rename_setting( 'wppa_widgettitle', 'wppa_potd_title' );
450
+ wppa_rename_setting( 'wppa_widget_linkurl', 'wppa_potd_linkurl' );
451
+ wppa_rename_setting( 'wppa_widget_linktitle', 'wppa_potd_linktitle' );
452
+ wppa_rename_setting( 'wppa_widget_subtitle', 'wppa_potd_subtitle' );
453
+ wppa_rename_setting( 'wppa_widget_counter', 'wppa_potd_counter' );
454
+ wppa_rename_setting( 'wppa_widget_album', 'wppa_potd_album' );
455
+ wppa_rename_setting( 'wppa_widget_status_filter', 'wppa_potd_status_filter' );
456
+ wppa_rename_setting( 'wppa_widget_method', 'wppa_potd_method' );
457
+ wppa_rename_setting( 'wppa_widget_period', 'wppa_potd_period' );
458
+ }
459
  }
460
 
461
  // Set Defaults
1216
  'wppa_sswidget_blank' => 'no',
1217
  'wppa_sswidget_overrule' => 'no',
1218
 
1219
+ 'wppa_potd_linktype' => 'single',
1220
+ 'wppa_potd_linkpage' => '0',
1221
  'wppa_potd_blank' => 'no',
1222
  'wppa_potdwidget_overrule' => 'no',
1223
 
1578
  'wppa_fotomoto_min_width' => '400',
1579
 
1580
  // Photo of the day widget
1581
+ 'wppa_potd_title' => __('Photo of the day', 'wp-photo-album-plus'),
 
 
 
 
 
 
 
 
 
1582
  'wppa_potd_widget_width' => '200',
1583
+ 'wppa_potd_align' => 'center',
1584
+ 'wppa_potd_linkurl' => __('Type your custom url here', 'wp-photo-album-plus'),
1585
+ 'wppa_potd_linktitle' => __('Type the title here', 'wp-photo-album-plus'),
1586
+ 'wppa_potd_subtitle' => 'none',
1587
+ 'wppa_potd_counter' => 'no',
1588
  'wppa_potd_counter_link' => 'thumbs',
1589
+ 'wppa_potd_album_type' => 'physical',
1590
+ 'wppa_potd_album' => 'all', // All albums
1591
+ 'wppa_potd_include_subs' => 'no',
1592
+ 'wppa_potd_status_filter' => 'none',
1593
+ 'wppa_potd_inverse' => 'no',
1594
+ 'wppa_potd_method' => '4', // Change every
1595
+ 'wppa_potd_period' => '24', // Day
1596
+ 'wppa_potd_offset' => '0',
1597
+ 'wppa_potd_photo' => '',
1598
+ 'wppa_potd_preview' => 'no',
1599
+
1600
+
1601
+ 'wppa_widget_width' => '200', // Do we use this somewhere still?
1602
 
1603
  // Topten widget
1604
  'wppa_toptenwidgettitle' => __('Top Ten Photos', 'wp-photo-album-plus'),
1796
  $desc = __( 'Default photo album for' , 'wp-photo-album-plus').' '.$user;
1797
  $id = wppa_create_album_entry( array ( 'name' => $name, 'description' => $desc, 'a_parent' => $parent ) );
1798
  if ( $id ) {
1799
+ wppa_log( 'Obs', 'Album ' . wppa_get_album_name( $parent ) . ' -> ' . $id . ' for ' . $user . ' created.' );
1800
  }
1801
  else {
1802
  wppa_log( 'Err', 'Could not create subalbum of ' . $parent . ' for ' . $user );
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.5.00
9
  *
10
  */
11
 
@@ -308,7 +308,9 @@ global $wpdb;
308
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
309
  ' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'[occ'.wppa( 'mocc' ).']"' .
310
  ' ' . wppa( 'lbtitle' ) . '="'.$title.'" ' .
311
- ' class="thumb-img" id="x-'.$xid.'-'.wppa( 'mocc' ).'">';
 
 
312
  if ( $is_video ) {
313
  $result .= wppa_get_video_html( array(
314
  'id' => $id,
@@ -862,6 +864,7 @@ function wppa_the_thumbascoverphoto( $id, $src, $photo_left, $link, $imgattr_a,
862
  ' href="' . $href . '"' .
863
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ). '[occ' . wppa( 'mocc' ) . ']"' .
864
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
 
865
  ' >';
866
 
867
  if ( wppa_is_video( $id ) ) {
@@ -1254,7 +1257,9 @@ global $wpdb;
1254
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[occ'.wppa( 'mocc' ) . ']"' .
1255
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
1256
  ' class="thumb-img"' .
1257
- ' id="x-' . $xid . '-' . wppa( 'mocc' ) . '">';
 
 
1258
 
1259
  // The image
1260
  $title = wppa_zoom_in( $id );
@@ -1573,7 +1578,9 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
1573
  ( $audiohtml ? ' data-audiohtml="' . $audiohtml . '"' : '' ) .
1574
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[' . $type . '-' . $album . '-' . wppa( 'mocc' ) . ']"' .
1575
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
1576
- ' target="' . $link['target'] . '" >';
 
 
1577
  $result .= "\n\t\t";
1578
  if ( $display == 'thumbs' ) {
1579
  $title = wppa_zoom_in( $id );
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
+ * Version 6.5.04
9
  *
10
  */
11
 
308
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
309
  ' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'[occ'.wppa( 'mocc' ).']"' .
310
  ' ' . wppa( 'lbtitle' ) . '="'.$title.'" ' .
311
+ ' class="thumb-img" id="x-'.$xid.'-'.wppa( 'mocc' ).'"' .
312
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
313
+ ' >';
314
  if ( $is_video ) {
315
  $result .= wppa_get_video_html( array(
316
  'id' => $id,
864
  ' href="' . $href . '"' .
865
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ). '[occ' . wppa( 'mocc' ) . ']"' .
866
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
867
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
868
  ' >';
869
 
870
  if ( wppa_is_video( $id ) ) {
1257
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[occ'.wppa( 'mocc' ) . ']"' .
1258
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
1259
  ' class="thumb-img"' .
1260
+ ' id="x-' . $xid . '-' . wppa( 'mocc' ) . '"' .
1261
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
1262
+ ' >';
1263
 
1264
  // The image
1265
  $title = wppa_zoom_in( $id );
1578
  ( $audiohtml ? ' data-audiohtml="' . $audiohtml . '"' : '' ) .
1579
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[' . $type . '-' . $album . '-' . wppa( 'mocc' ) . ']"' .
1580
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
1581
+ ' target="' . $link['target'] . '"' .
1582
+ ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
1583
+ ' >';
1584
  $result .= "\n\t\t";
1585
  if ( $display == 'thumbs' ) {
1586
  $title = wppa_zoom_in( $id );
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.03
7
  *
8
  */
9
 
@@ -914,9 +914,9 @@ static $existing_albums;
914
  return in_array( $id, $existing_albums );
915
  }
916
 
917
- function wppa_photo_exists($id) {
918
  global $wpdb;
919
- return $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `".WPPA_PHOTOS."` WHERE `id` = %s", $id));
920
  }
921
 
922
  function wppa_albumphoto_exists($alb, $photo) {
@@ -1115,27 +1115,41 @@ function wppa_send_mail( $to, $subj, $cont, $photo, $email = '' ) {
1115
 
1116
  }
1117
 
1118
- function wppa_get_imgalt( $id ) {
1119
 
1120
- $thumb = wppa_cache_thumb($id);
 
 
 
1121
  switch ( wppa_opt( 'alt_type' ) ) {
1122
  case 'fullname':
1123
- $result = esc_attr( wppa_get_photo_name( $id ) );
1124
  break;
1125
  case 'namenoext':
1126
- $temp = wppa_get_photo_name( $id );
1127
- $temp = preg_replace( '/\.[^.]*$/', '', $temp ); // Remove file extension
1128
- $result = esc_attr( $temp );
1129
  break;
1130
  case 'custom':
1131
- $result = esc_attr( $thumb['alt'] );
1132
  break;
1133
  default:
1134
  $result = $id;
1135
  break;
1136
  }
1137
- if ( ! $result ) $result = '0';
1138
- return ' alt="'.$result.'" ';
 
 
 
 
 
 
 
 
 
 
 
 
 
1139
  }
1140
 
1141
  // Flush treecounts of album $alb, default: clear all
@@ -1388,29 +1402,15 @@ function wppa_strip_tags($text, $key = '') {
1388
  }
1389
 
1390
  // set last album
1391
- function wppa_set_last_album($id = '') {
1392
- global $albumid;
1393
-
1394
- $opt = 'wppa_last_album_used-'.wppa_get_user('login');
1395
 
1396
- if ( is_numeric($id) && wppa_have_access($id) ) $albumid = $id; else $albumid = '';
1397
-
1398
- wppa_update_option($opt, $albumid);
1399
  }
1400
 
1401
  // get last album
1402
  function wppa_get_last_album() {
1403
- global $albumid;
1404
-
1405
- if ( is_numeric( $albumid ) ) $result = $albumid;
1406
- else {
1407
- $opt = 'wppa_last_album_used-'.wppa_get_user('login');
1408
- $result = get_option($opt, get_option('wppa_last_album_used', ''));
1409
- }
1410
- if ( !is_numeric( $result ) ) $result = '';
1411
- else $albumid = $result;
1412
 
1413
- return $result;
1414
  }
1415
 
1416
  // Combine margin or padding style
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 6.5.04
7
  *
8
  */
9
 
914
  return in_array( $id, $existing_albums );
915
  }
916
 
917
+ function wppa_photo_exists( $id ) {
918
  global $wpdb;
919
+ return $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM `".WPPA_PHOTOS."` WHERE `id` = %s", $id ) );
920
  }
921
 
922
  function wppa_albumphoto_exists($alb, $photo) {
1115
 
1116
  }
1117
 
1118
+ function wppa_get_imgalt( $id, $lb = false ) {
1119
 
1120
+ // Get photo data
1121
+ $thumb = wppa_cache_thumb( $id );
1122
+
1123
+ // Get raw image alt data
1124
  switch ( wppa_opt( 'alt_type' ) ) {
1125
  case 'fullname':
1126
+ $result = wppa_get_photo_name( $id );
1127
  break;
1128
  case 'namenoext':
1129
+ $result = wppa_strip_ext( wppa_get_photo_name( $id ) );
 
 
1130
  break;
1131
  case 'custom':
1132
+ $result = $thumb['alt'];
1133
  break;
1134
  default:
1135
  $result = $id;
1136
  break;
1137
  }
1138
+
1139
+ // Default if empty result
1140
+ if ( ! $result ) {
1141
+ $result = '0';
1142
+ }
1143
+
1144
+ // Format for use in lightbox or direct use html
1145
+ if ( $lb ) {
1146
+ $result = esc_attr( str_replace( '"', "'", $result ) );
1147
+ }
1148
+ else {
1149
+ $result = ' alt="' . esc_attr( $result ) . '" ';
1150
+ }
1151
+
1152
+ return $result;
1153
  }
1154
 
1155
  // Flush treecounts of album $alb, default: clear all
1402
  }
1403
 
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
wppa-widget-admin.php DELETED
@@ -1,382 +0,0 @@
1
- <?php
2
- /* wppa-widget-admin.php
3
- * Pachkage: wp-photo-album-plus
4
- *
5
- * admin sidebar widget
6
- * version 6.5.00
7
- *
8
- */
9
-
10
- function _wppa_sidebar_page_options() {
11
- global $wpdb;
12
-
13
- $options_error = false;
14
-
15
- if (isset($_GET['walbum'])) {
16
- $walbum = wppa_walbum_sanitize($_GET['walbum']);
17
- wppa_update_option('wppa_widget_album', $walbum);
18
- }
19
- if (isset($_REQUEST['wppa-set-submit'])) {
20
- if ( ! wp_verify_nonce( $_REQUEST['wppa-update-check'], 'wppa-update-check' ) ) {
21
- echo 'Trying:'.$_REQUEST['wppa-update-check'];
22
- }
23
-
24
- if ( isset ( $_POST['widget_counter'] ) ) {
25
- wppa_update_option( 'wppa_widget_counter', 'yes' );
26
- }
27
- else {
28
- wppa_update_option( 'wppa_widget_counter', 'no' );
29
- }
30
- if ( isset( $_REQUEST['wppa_potd_counter_link'] ) ) wppa_update_option( 'wppa_potd_counter_link', $_REQUEST['wppa_potd_counter_link'] );
31
- if (isset($_POST['wppa-widgettitle'])) wppa_update_option('wppa_widgettitle', $_POST['wppa-widgettitle']);
32
- if (isset($_POST['wppa-potd-align'])) wppa_update_option('wppa_potd_align', $_POST['wppa-potd-align']);
33
- if (isset($_POST['wppa-widget-albums'])) wppa_update_option('wppa_widget_album', wppa_walbum_sanitize($_POST['wppa-widget-albums']));
34
- if (isset($_POST['wppa-widget-photo'])) wppa_update_option('wppa_widget_photo', $_POST['wppa-widget-photo']);
35
- if (isset($_POST['wppa-widget-method'])) wppa_update_option('wppa_widget_method', $_POST['wppa-widget-method']);
36
- if (isset($_REQUEST['wppa-widget-period'])) wppa_update_option('wppa_widget_period', $_REQUEST['wppa-widget-period']);
37
- if (isset($_POST['wppa-widget-subtitle'])) wppa_update_option('wppa_widget_subtitle', $_POST['wppa-widget-subtitle']);
38
- if (isset($_POST['wppa-widget-linkpage'])) wppa_update_option('wppa_widget_linkpage', $_POST['wppa-widget-linkpage']);
39
- if (isset($_POST['wppa-widget-linkurl'])) wppa_update_option('wppa_widget_linkurl', $_POST['wppa-widget-linkurl']);
40
- if (isset($_POST['wppa-widget-linktitle'])) wppa_update_option('wppa_widget_linktitle', $_POST['wppa-widget-linktitle']);
41
- if (isset($_POST['wppa-widget-linktype'])) wppa_update_option('wppa_widget_linktype', $_POST['wppa-widget-linktype']);
42
- if (isset($_POST['wppa-widget-status-filter'])) wppa_update_option('wppa_widget_status_filter', $_POST['wppa-widget-status-filter']);
43
- if (isset($_POST['wppa-potd-offset'])) wppa_update_option('wppa_potd_offset', $_POST['wppa-potd-offset']);
44
- if ( isset($_POST['wppa-potd-widget-width']) ) {
45
- if (wppa_check_numeric($_POST['wppa-potd-widget-width'], '100', __( 'Widget Photo Width.', 'wp-photo-album-plus' ))) {
46
- wppa_update_option('wppa_potd_widget_width', $_POST['wppa-potd-widget-width']);
47
- } else {
48
- $options_error = true;
49
- }
50
- }
51
- if (!$options_error && isset($_POST['wppa-set-submit'])) wppa_update_message(__('Changes Saved. Don\'t forget to activate the widget!', 'wp-photo-album-plus'));
52
- }
53
- wppa_initialize_runtime('force');
54
- ?>
55
-
56
- <div class="wrap">
57
- <?php $iconurl = WPPA_URL.'/images/settings32.png'; ?>
58
- <div id="icon-album" class="icon32" style="background: transparent url(<?php echo($iconurl); ?>) no-repeat">
59
- <br />
60
- </div>
61
- <h2><?php _e('Photo of the Day Widget Settings', 'wp-photo-album-plus'); ?></h2>
62
-
63
- <?php $action_url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_photo_of_the_day') ?>
64
-
65
- <form action="<?php echo $action_url ?>" method="post">
66
- <?php echo wp_nonce_field('wppa-update-check', 'wppa-update-check'); ?>
67
-
68
- <table class="form-table wppa-table wppa-photo-table">
69
- <tbody>
70
- <tr valign="top">
71
- <th scope="row">
72
- <label ><?php _e('Widget Title:', 'wp-photo-album-plus'); ?></label>
73
- </th>
74
- <td>
75
- <input type="text" name="wppa-widgettitle" id="wppa-widgettitle" value="<?php echo wppa_opt( 'widgettitle' ) ?>" />
76
- <span class="description"><br/><?php _e('Enter/modify the title for the widget. This is a default and can be overriden at widget activation.', 'wp-photo-album-plus'); ?></span>
77
- </td>
78
- </tr>
79
-
80
- <tr valign="top">
81
- <th scope="row">
82
- <label ><?php _e('Widget Photo Width:', 'wp-photo-album-plus'); ?></label>
83
- </th>
84
- <td>
85
- <input type="text" name="wppa-potd-widget-width" id="wppa-potd-widget-width" value="<?php echo wppa_opt( 'potd_widget_width' ) ?>" style="width: 50px;" />
86
- <?php _e('pixels.', 'wp-photo-album-plus'); echo(' '); _e('Horizontal alignment:', 'wp-photo-album-plus'); ?>
87
- <select name="wppa-potd-align" id="wppa-potd-align">
88
- <?php $ali = wppa_opt( 'potd_align' ) ?>
89
- <?php $sel = 'selected="selected"'; ?>
90
- <option value="none" <?php if ($ali == 'none') echo($sel) ?>><?php _e('--- none ---', 'wp-photo-album-plus') ?></option>
91
- <option value="left" <?php if ($ali == 'left') echo($sel) ?>><?php _e('left', 'wp-photo-album-plus') ?></option>
92
- <option value="center" <?php if ($ali == 'center') echo($sel) ?>><?php _e('center', 'wp-photo-album-plus') ?></option>
93
- <option value="right" <?php if ($ali == 'right') echo($sel) ?>><?php _e('right', 'wp-photo-album-plus') ?></option>
94
- </select>
95
- <span class="description"><br/><?php _e('Enter the desired display width and alignment of the photo in the sidebar.', 'wp-photo-album-plus'); ?></span>
96
- </td>
97
- </tr>
98
-
99
- <tr valign="top">
100
- <th scope="row">
101
- <label ><?php _e('Use album(s):', 'wp-photo-album-plus'); ?></label>
102
- </th>
103
- <td>
104
- <script type="text/javascript">
105
- /* <![CDATA[ */
106
- function wppaCheckWa() {
107
- document.getElementById('wppa-spin').style.visibility = 'visible';
108
- document.getElementById('wppa-upd').style.visibility = 'hidden';
109
- var album = document.getElementById('wppa-wa').value;
110
- if ( album != 'all' && album != 'sep' && album != 'all-sep' && album != 'topten' && album != 'clr' )
111
- album = document.getElementById('wppa-was').value + ',' + album;
112
- var url = "<?php echo(wppa_dbg_url(get_admin_url().'admin.php?page=wppa_photo_of_the_day')) ?>&walbum=" + album;
113
- document.location.href = url;
114
- }
115
- /* ]]> */
116
- </script>
117
- <?php _e('Select:', 'wp-photo-album-plus'); ?><select name="wppa-widget-album" id="wppa-wa" onchange="wppaCheckWa()" ><?php echo wppa_walbum_select( wppa_opt( 'widget_album' ) ) ?></select>
118
- <img id="wppa-spin" src="<?php echo(wppa_get_imgdir()); ?>wpspin.gif" style="visibility:hidden;"/>
119
- <?php _e('Or Edit:', 'wp-photo-album-plus'); ?><input type="text" name="wppa-widget-albums" id="wppa-was" value="<?php echo wppa_opt( 'widget_album' ) ?>" />
120
- <input class="button-primary" name="wppa-upd" id="wppa-upd" value="<?php _e('Update thumbnails', 'wp-photo-album-plus'); ?>" onclick="wppaCheckWa()" />
121
- <span class="description"><br/>
122
- <?php _e('Select or edit the album(s) you want to use the photos of for the widget.', 'wp-photo-album-plus'); ?>
123
- <br />
124
- <?php _e('If you want a <b>- special -</b> selection or get rid of it, you may need to use <b>- start over -</b> first.', 'wp-photo-album-plus'); ?>
125
- </span>
126
- </td>
127
- </tr>
128
- <!-- Status filter -->
129
- <tr valign="top" >
130
- <th scope="row" >
131
- <label ><?php _e('Status filter:', 'wp-photo-album-plus') ?></label>
132
- </th>
133
- <td>
134
- <?php $sel = 'selected="selected"'; ?>
135
- <?php $filter = wppa_opt( 'widget_status_filter') ?>
136
- <select name="wppa-widget-status-filter" >
137
- <option value="" <?php if ( $filter == 'none' ) echo $sel ?>><?php _e('- none -', 'wp-photo-album-plus'); ?></option>
138
- <option value="publish" <?php if ( $filter == 'publish' ) echo $sel ?> ><?php _e( 'Publish' , 'wp-photo-album-plus') ?></option>
139
- <option value="featured" <?php if ( $filter == 'featured' ) echo $sel ?> ><?php _e( 'Featured' , 'wp-photo-album-plus') ?></option>
140
- <option value="gold" <?php if ( $filter == 'gold' ) echo $sel ?> ><?php _e( 'Gold' , 'wp-photo-album-plus') ?></option>
141
- <option value="silver" <?php if ( $filter == 'silver' ) echo $sel ?> ><?php _e( 'Silver' , 'wp-photo-album-plus') ?></option>
142
- <option value="bronze" <?php if ( $filter == 'bronze' ) echo $sel ?> ><?php _e( 'Bronze' , 'wp-photo-album-plus') ?></option>
143
- <option value="anymedal" <?php if ( $filter == 'anymedal' ) echo $sel ?> ><?php _e( 'Any medal' , 'wp-photo-album-plus') ?></option>
144
- </select>
145
- </td>
146
- </tr>
147
- <tr valign="top" >
148
- <th scope="row">
149
- <label ><?php _e('Display method:', 'wp-photo-album-plus'); ?></label>
150
- </th>
151
- <td>
152
- <?php $sel = 'selected="selected"'; ?>
153
- <?php $method = wppa_opt( 'widget_method' ); ?>
154
- <select name="wppa-widget-method" id="wppa-wm" onchange="wppaCheckWidgetMethod()" >
155
- <option value="1" <?php if ($method == '1') echo($sel); ?>><?php _e('Fixed photo', 'wp-photo-album-plus'); ?></option>
156
- <option value="2" <?php if ($method == '2') echo($sel); ?>><?php _e('Random', 'wp-photo-album-plus'); ?></option>
157
- <option value="3" <?php if ($method == '3') echo($sel); ?>><?php _e('Last upload', 'wp-photo-album-plus'); ?></option>
158
- <option value="4" <?php if ($method == '4') echo($sel); ?>><?php _e('Change every', 'wp-photo-album-plus'); ?></option>
159
- </select>
160
- <?php $period = wppa_opt( 'widget_period' );
161
- $text = esc_attr(__('The page will now be reloaded', 'wp-photo-album-plus' ));
162
- $onchange = esc_attr('alert(\''.$text.'\');wppaPotdChangePeriod()');
163
- ?>
164
- <script type="text/javascript" >
165
- function wppaPotdChangePeriod() {
166
- var url = '<?php echo $action_url ?>';
167
- url += '&wppa-set-submit=1';
168
- url += '&wppa-update-check='+jQuery('#wppa-update-check').val();
169
- url += '&wppa-widget-period='+jQuery('#wppa-wp').val();
170
- document.location.href = url;
171
- }
172
- </script>
173
- <select name="wppa-widget-period" id="wppa-wp" onchange="<?php echo $onchange ?>" >
174
- <option value="0" <?php if ($period == '0') echo($sel); ?>><?php _e('pageview.', 'wp-photo-album-plus'); ?></option>
175
- <option value="1" <?php if ($period == '1') echo($sel); ?>><?php _e('hour.', 'wp-photo-album-plus'); ?></option>
176
- <option value="24" <?php if ($period == '24') echo($sel); ?>><?php _e('day.', 'wp-photo-album-plus'); ?></option>
177
- <option value="168" <?php if ($period == '168') echo($sel); ?>><?php _e('week.', 'wp-photo-album-plus'); ?></option>
178
- <option value="736" <?php if ($period == '736') echo($sel); ?>><?php _e('month.', 'wp-photo-album-plus'); ?></option>
179
- <option value="day-of-week" <?php if ($period == 'day-of-week') echo($sel); ?>><?php _e('day of week is order#', 'wp-photo-album-plus'); ?></option>
180
- <option value="day-of-month" <?php if ($period == 'day-of-month') echo($sel); ?>><?php _e('day of month is order#', 'wp-photo-album-plus'); ?></option>
181
- <option value="day-of-year" <?php if ($period == 'day-of-year') echo($sel); ?>><?php _e('day of year is order#', 'wp-photo-album-plus'); ?></option>
182
- </select>
183
- <span class="description"><br/><?php _e('Select how the widget should display.', 'wp-photo-album-plus'); ?></span>
184
- <div class="wppa-order" >
185
- <?php
186
- if ( substr( wppa_opt( 'widget_period' ), 0, 7 ) == 'day-of-' ) {
187
- switch( substr( wppa_opt( 'widget_period' ), 7 ) ) {
188
- case 'week':
189
- $n_days = '7';
190
- $date_key = 'w';
191
- break;
192
- case 'month':
193
- $n_days = '31';
194
- $date_key = 'd';
195
- break;
196
- case 'year':
197
- $n_days = '366';
198
- $date_key = 'z';
199
- break;
200
- }
201
- while ( get_option( 'wppa_potd_offset', '0' ) > $n_days ) update_option('wppa_potd_offset', get_option( 'wppa_potd_offset') - $n_days );
202
- echo sprintf( __('Current day# = %s, offset =', 'wp-photo-album-plus'), date_i18n( $date_key ) ) . ' ';
203
- echo '<select name="wppa-potd-offset" >';
204
- $day = '0';
205
- while ( $day < $n_days ) {
206
- echo '<option value="'.$day.'" '.(get_option( 'wppa_potd_offset', '0' ) == $day ? 'selected="selected"' : '').' >'.$day.'</option>';
207
- $day++;
208
- }
209
- echo '</select>';
210
- $photo_order = date_i18n( $date_key ) - get_option( 'wppa_potd_offset', '0' );
211
- while ( $photo_order < '0' ) {
212
- $photo_order += $n_days;
213
- }
214
- echo '. '.sprintf( __('Todays photo order# = %s.', 'wp-photo-album-plus'), $photo_order );
215
- $photo = wppa_get_potd();
216
- if ( $photo ) {
217
- echo ' <img src="'.wppa_fix_poster_ext(wppa_get_thumb_url($photo['id']), $photo['id']).'" style="width:100px;" />';
218
- }
219
- else {
220
- echo ' '.__('Not found.', 'wp-photo-album-plus');
221
- }
222
- }
223
- ?>
224
- </div>
225
- </td>
226
- </tr>
227
- <?php
228
- $linktype = wppa_opt( 'widget_linktype' );
229
- if ($linktype != 'custom') { ?>
230
- <tr>
231
- <th scope="row">
232
- <label ><?php _e('Link to:', 'wp-photo-album-plus'); ?></label>
233
- </th>
234
- <td>
235
- <?php _e('Links are set on the <b>Photo Albums -> Settings</b> screen.', 'wp-photo-album-plus'); ?>
236
- </td>
237
- </tr>
238
- <?php }
239
- else { ?>
240
- <tr class="wppa-wlu" >
241
- <th scope="row">
242
- <label ><?php _e('Link to:', 'wp-photo-album-plus'); ?></label>
243
- </th>
244
- <td>
245
- <?php _e('Title:', 'wp-photo-album-plus') ?>
246
- <input type="text" name="wppa-widget-linktitle" id="wppa-widget-linktitle" value="<?php echo wppa_opt( 'widget_linktitle' ) ?>"style="width:20%" />
247
- <?php _e('Url:', 'wp-photo-album-plus') ?>
248
- <input type="text" name="wppa-widget-linkurl" id="wppa-widget-linkurl" value="<?php echo wppa_opt( 'widget_linkurl' ) ?>" style="width:50%" />
249
- <span class="description"><br/><?php _e('Enter the title and the url. Do\'nt forget the HTTP://', 'wp-photo-album-plus') ?></span>
250
- </td>
251
- </tr>
252
- <?php } ?>
253
- <!--<script type="text/javascript">wppaCheckWidgetLink()</script>-->
254
- <tr>
255
- <th scope="row">
256
- <label ><?php _e('Subtitle:', 'wp-photo-album-plus'); ?></label>
257
- </th>
258
- <td>
259
- <?php $subtit = wppa_opt( 'widget_subtitle' ) ?>
260
- <select name="wppa-widget-subtitle" id="wppa-st" >
261
- <option value="none" <?php if ($subtit == 'none') echo($sel); ?>><?php _e('--- none ---', 'wp-photo-album-plus'); ?></option>
262
- <option value="name" <?php if ($subtit == 'name') echo($sel); ?>><?php _e('Photo Name', 'wp-photo-album-plus'); ?></option>
263
- <option value="desc" <?php if ($subtit == 'desc') echo($sel); ?>><?php _e('Description', 'wp-photo-album-plus'); ?></option>
264
- <option value="owner" <?php if ( $subtit == 'owner' ) echo $sel ?>><?php _e('Owner', 'wp-photo-album-plus'); ?></option>
265
- </select>
266
- <span class="description"><br/><?php _e('Select the content of the subtitle.', 'wp-photo-album-plus'); ?></span>
267
- </td>
268
- </tr>
269
- <!-- Counter -->
270
- <tr>
271
- <th scope="row">
272
- <label ><?php _e('Counter:', 'wp-photo-album-plus') ?></label>
273
- </th>
274
- <td>
275
- <?php $counter = wppa_switch( 'widget_counter' ) ?>
276
- <input name="widget_counter" type="checkbox" <?php echo ( $counter ? 'checked="checked"' : '' ) ?> />
277
- <?php echo '&nbsp;&nbsp;' . __( 'Link to:', 'wp-photo-album-plus' ) ?>
278
- <select name="wppa_potd_counter_link" >
279
- <option value="thumbs" <?php if ( wppa_opt( 'potd_counter_link' ) == 'thumbs' ) echo 'selected="selected"' ?>><?php _e( 'thumbnails', 'wp-photo-album-plus' ) ?></option>
280
- <option value="slide" <?php if ( wppa_opt( 'potd_counter_link' ) == 'slide' ) echo 'selected="selected"' ?>><?php _e( 'slideshow', 'wp-photo-album-plus' ) ?></option>
281
- </select>
282
-
283
- </td>
284
- </tr>
285
- </tbody>
286
- </table>
287
- <p>
288
- <input type="submit" class="button-primary" name="wppa-set-submit" value="<?php _e('Save Changes', 'wp-photo-album-plus'); ?>" />
289
- </p>
290
- <?php
291
- $alb = wppa_opt( 'widget_album' );
292
- $opt = wppa_is_int( $alb ) ? ' ' . wppa_get_photo_order( $alb ) . ' ' : '';
293
- $photos = wppa_get_widgetphotos( $alb, $opt );
294
- $cnt = count( $photos );
295
- if ( empty( $photos ) ) {
296
- echo '<p>' . __('No photos yet in this album.', 'wp-photo-album-plus') . '</p>';
297
- }
298
- elseif ( $cnt > '5000' ) {
299
- echo '<p>' . sprintf( __( 'There are too many photos in the selection to show a preview ( %d )', 'wp-photo-album-plus' ), $cnt ) . '</p>';
300
- }
301
- else {
302
- $curid = wppa_opt( 'widget_photo' );
303
-
304
- // Process photos
305
- foreach ( $photos as $photo ) {
306
- $id = $photo['id'];
307
-
308
- // Open container div
309
- echo '<div' .
310
- ' class="photoselect"' .
311
- ' style="' .
312
- 'width:180px;' .
313
- 'height:300px;' .
314
- // 'overflow:auto;' .
315
- '" >';
316
-
317
- // Open image container div
318
- echo '<div' .
319
- ' style="' .
320
- 'width:180px;' .
321
- 'height:135px;' .
322
- 'overflow:hidden;' .
323
- 'text-align:center;' .
324
- '" >';
325
-
326
- // The image if a video
327
- if ( wppa_is_video( $id ) ) {
328
- echo wppa_get_video_html( array( 'id' => $id,
329
- 'style' => 'width:180px;'
330
- ));
331
- }
332
-
333
- // The image if a photo
334
- else {
335
- echo '<img' .
336
- ' src=" '. wppa_fix_poster_ext( wppa_get_thumb_url( $id ), $id ) . '"' .
337
- ' style="' .
338
- 'max-width:180px;' .
339
- 'max-height:135px;' .
340
- 'margin:auto;' .
341
- '"' .
342
- ' alt="' . esc_attr( wppa_get_photo_name( $photo['id'] ) ) .'" />';
343
-
344
- // Audio ?
345
- if ( wppa_has_audio( $id ) ) {
346
- echo wppa_get_audio_html( array( 'id' => $id,
347
- 'style' => 'width:180px;' .
348
- 'position:relative;' .
349
- 'bottom:' . ( wppa_get_audio_control_height() + 4 ) .'px;'
350
- ));
351
- }
352
- }
353
-
354
- // Close image container div
355
- echo '</div>'
356
-
357
-
358
- ?>
359
- <div style="clear:both;width:100%;margin:3px 0;" >
360
- <div style="font-size:9px; line-height:10px;float:left;"><?php echo '(#'.$photo['p_order'].')' ?></div>
361
- <input style="float:right;" type="radio" name="wppa-widget-photo" id="wppa-widget-photo<?php echo $id ?>" value="<?php echo $id ?>" <?php if ( $id == $curid ) echo 'checked="checked"'; ?>/>
362
- </div>
363
- <div style="clear:both;overflow:auto;height:150px" >
364
- <div style="font-size:11px; overflow:hidden;"><?php echo wppa_get_photo_name($photo['id']) ?></div>
365
- <div style="font-size:9px; line-height:10px;"><?php echo wppa_get_photo_desc($photo['id']) ?></div>
366
- </div>
367
- </div>
368
- <?php
369
- }
370
- echo '<div class="clear"></div>';
371
- } ?>
372
- <script type="text/javascript">wppaCheckWidgetMethod();</script>
373
- <br />
374
- <p>
375
- <input type="submit" class="button-primary" name="wppa-set-submit" value="<?php _e('Save Changes', 'wp-photo-album-plus'); ?>" />
376
- </p>
377
- </form>
378
- </div>
379
- <?php
380
- }
381
-
382
- require_once ('wppa-widget-functions.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wppa-widget-functions.php CHANGED
@@ -2,19 +2,39 @@
2
  /* wppa-widget-functions.php
3
  /* Package: wp-photo-album-plus
4
  /*
5
- /* Version 6.4.16
6
  /*
7
  */
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  // This function returns an array of photos that meet the current photo of the day selection criteria
10
  function wppa_get_widgetphotos( $alb, $option = '' ) {
11
  global $wpdb;
12
 
 
 
13
  $photos = false;
14
  $query = '';
15
 
16
  // Compile status clause
17
- switch( wppa_opt( 'widget_status_filter' ) ) {
18
  case 'publish':
19
  $statusclause = " `status` = 'publish' ";
20
  break;
@@ -40,27 +60,49 @@ global $wpdb;
40
  }
41
  }
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  // Is it a single album?
44
  if ( wppa_is_int( $alb ) ) {
45
- $query = $wpdb->prepare( "SELECT `id`, `p_order` FROM `" . WPPA_PHOTOS . "` WHERE `album` = %s " . " AND " . $statusclause . $option, $alb );
 
 
 
 
46
  }
47
 
48
  // Is it an enumeration of album ids?
49
  elseif ( strchr( $alb, ',' ) ) {
50
  $alb = trim( $alb, ',' );
51
 
52
- // Test for numeric only ( security test )
53
- $t = str_replace( ',', '', $alb);
54
- if ( is_numeric( $t ) ) {
55
- $query = "SELECT `id`, `p_order` FROM `" . WPPA_PHOTOS . "` " .
56
- "WHERE `album` IN ( " . $alb . " ) " .
57
- "AND " . $statusclause . $option;
58
- }
59
  }
60
 
 
61
  // Is it ALL?
62
  elseif ( $alb == 'all' ) {
63
- $query = "SELECT `id`, `p_order` FROM `" . WPPA_PHOTOS . "` " . " WHERE " . $statusclause . $option;
 
 
64
  }
65
 
66
  // Is it SEP?
@@ -126,133 +168,43 @@ global $wpdb;
126
  return $photos;
127
  }
128
 
129
- // get select form element listing albums
130
- // Special version for widget
131
- function wppa_walbum_select( $sel = '' ) {
132
- global $wpdb;
133
-
134
- $albums = $wpdb->get_results( "SELECT * FROM `" . WPPA_ALBUMS . "` ORDER BY `name`", ARRAY_A );
135
- wppa_cache_album( 'add', $albums );
136
-
137
- if ( is_numeric( $sel ) ) $type = 1; // Single number
138
- elseif ( strchr( $sel, ',' ) ) {
139
- $type = 2; // Array
140
- $albs = explode( ',', $sel );
141
- }
142
- elseif ( $sel == 'all' ) $type = 3; // All
143
- elseif ( $sel == 'sep' ) $type = 4; // Separate only
144
- elseif ( $sel == 'all-sep' ) $type = 5; // All minus separate
145
- elseif ( $sel == 'topten' ) $type = 6; // Topten
146
-
147
- else $type = 0; // Nothing yet
148
-
149
- $result = '<option value="" >' . __( '- select (another) album or a set -' , 'wp-photo-album-plus' ) . '</option>';
150
-
151
- foreach ( $albums as $album ) {
152
- switch ( $type ) {
153
- case 1:
154
- $dis = ( $album['id'] == $sel );
155
- break;
156
- case 2:
157
- $dis = in_array( $album['id'], $albs );
158
- break;
159
- case 3:
160
- $dis = true;
161
- break;
162
- case 4:
163
- $dis = ( $album['a_parent'] == '-1' );
164
- break;
165
- case 5:
166
- $dis = ( $album['a_parent'] != '-1' );
167
- break;
168
- case 6:
169
- $dis = false;
170
- break;
171
-
172
- default:
173
- $dis = false;
174
- }
175
- if ( $dis ) $dis = 'disabled="disabled"';
176
- else $dis = '';
177
- $result .= '<option ' . $dis . ' value="' . $album['id'] . '">( ' . $album['id'] . ' )';
178
- if ( $album['id'] < '1000' ) $result .= '&nbsp;';
179
- if ( $album['id'] < '100' ) $result .= '&nbsp;';
180
- if ( $album['id'] < '10' ) $result .= '&nbsp;';
181
- $result .= __( stripslashes( $album['name'] ) ) . '</option>';
182
- }
183
- $sel = $type == 3 ? 'selected="selected"' : '';
184
- $result .= '<option value="all" ' . $sel . ' >' . __( '- all albums -' , 'wp-photo-album-plus' ) . '</option>';
185
- $sel = $type == 4 ? 'selected="selected"' : '';
186
- $result .= '<option value="sep" ' . $sel . ' >' . __( '- all -separate- albums -' , 'wp-photo-album-plus' ) . '</option>';
187
- $sel = $type == 5 ? 'selected="selected"' : '';
188
- $result .= '<option value="all-sep" ' . $sel . ' >' . __( '- all albums except -separate-' , 'wp-photo-album-plus' ) . '</option>';
189
- $sel = $type == 6 ? 'selected="selected"' : '';
190
- $result .= '<option value="topten" ' . $sel . ' >' . __( '- top rated photos -' , 'wp-photo-album-plus' ) . '</option>';
191
- $result .= '<option value="clr" >' . __( '- start over -' , 'wp-photo-album-plus' ) . '</option>';
192
- return $result;
193
- }
194
-
195
- function wppa_walbum_sanitize( $walbum ) {
196
-
197
- $result = strtolower( $walbum );
198
- $result = strip_tags( $result );
199
-
200
- if ( strstr( $result, 'all-sep' ) ) $result = 'all-sep';
201
- elseif ( strstr( $result, 'all' ) ) $result = 'all';
202
- elseif ( strstr( $result, 'sep' ) ) $result = 'sep';
203
- elseif ( strstr( $result, 'topten' ) ) $result = 'topten';
204
- elseif ( strstr( $result, 'clr' ) ) $result = '';
205
- else {
206
-
207
- // Change multiple commas to one
208
- while ( substr_count( $result, ',,' ) ) $result = str_replace( ',,', ',', $result );
209
-
210
- // remove leading and trailing commas
211
- $result = trim( $result, ',' );
212
-
213
- // Check for illegal chars
214
- $temp = str_replace( ',', '', $result );
215
- if ( $temp && ! wppa_is_int( $temp ) ) {
216
- // $result contains other chars than numbers and comma's
217
- $result = 'clr';
218
- }
219
- }
220
- return $result;
221
- }
222
 
223
  // get the photo of the day
224
  function wppa_get_potd() {
225
  global $wpdb;
226
 
227
- $image = '';
228
- switch ( wppa_opt( 'widget_method' ) ) {
229
- case '1': // Fixed photo
230
- $id = wppa_opt( 'widget_photo' );
231
- if ( $id != '' ) {
232
- $image = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `id` = %s LIMIT 0,1", $id ), ARRAY_A );
233
- wppa_cache_photo( 'add', $image );
234
- }
235
  break;
236
- case '2': // Random
237
- $album = wppa_opt( 'widget_album' );
 
 
238
  if ( $album == 'topten' ) {
239
  $images = wppa_get_widgetphotos( $album );
240
  if ( count( $images ) > 1 ) { // Select a random first from the current selection
241
  $idx = rand( 0, count( $images ) - 1 );
242
- $image = $images[$idx];
243
  }
244
  }
245
  elseif ( $album != '' ) {
246
  $images = wppa_get_widgetphotos( $album, "ORDER BY RAND() LIMIT 0,1" );
247
- $image = $images[0];
248
  }
249
  break;
250
- case '3': // Last upload
251
- $album = wppa_opt( 'widget_album' );
 
 
252
  if ( $album == 'topten' ) {
253
  $images = wppa_get_widgetphotos( $album );
254
  if ( $images ) {
255
- // fid last uploaded image in the $images pool
 
256
  $temp = 0;
257
  foreach( $images as $img ) {
258
  if ( $img['timestamp'] > $temp ) {
@@ -260,54 +212,53 @@ global $wpdb;
260
  $image = $img;
261
  }
262
  }
 
263
  }
264
  }
265
  elseif ( $album != '' ) {
266
  $images = wppa_get_widgetphotos( $album, "ORDER BY timestamp DESC LIMIT 0,1" );
267
- $image = $images[0];
268
  }
269
  break;
270
- case '4': // Change every
271
- $album = wppa_opt( 'widget_album' );
 
 
272
  if ( $album != '' ) {
273
- $per = wppa_opt( 'widget_period' );
274
  $photos = wppa_get_widgetphotos( $album );
275
  if ( $per == '0' ) {
276
  if ( $photos ) {
277
- $image = $photos[rand( 0, count( $photos )-1 )];
278
  }
279
- else $image = '';
280
  }
281
  elseif ( $per == 'day-of-week' ) {
282
- $image = '';
283
  if ( $photos ) {
284
  $d = date_i18n( "w" );
285
  $d -= get_option( 'wppa_potd_offset', '0' );
286
  while ( $d < '1' ) $d += '7';
287
  foreach ( $photos as $img ) {
288
- if ( $img['p_order'] == $d ) $image = $img;
289
  }
290
  }
291
  }
292
  elseif ( $per == 'day-of-month' ) {
293
- $image = '';
294
  if ( $photos ) {
295
  $d = strval(intval(date_i18n( "d" )));
296
  $d -= get_option( 'wppa_potd_offset', '0' );
297
  while ( $d < '1' ) $d += '31';
298
  foreach ( $photos as $img ) {
299
- if ( $img['p_order'] == $d ) $image = $img;
300
  }
301
  }
302
  }
303
  elseif ( $per == 'day-of-year' ) {
304
- $image = '';
305
  if ( $photos ) {
306
  $d = strval(intval(date_i18n( "z" )));
307
  $d -= get_option( 'wppa_potd_offset', '0' );
308
  while ( $d < '0' ) $d += '366';
309
  foreach ( $photos as $img ) {
310
- if ( $img['p_order'] == $d ) $image = $img;
311
  }
312
  }
313
  }
@@ -348,24 +299,19 @@ global $wpdb;
348
  }
349
 
350
  // Image found
351
- $image = $photos[$idn];
352
- }
353
- else {
354
- $image = '';
355
  }
356
  }
357
- } else {
358
- $image = '';
359
  }
360
  break;
361
 
362
- default:
363
- $image = '';
364
  }
365
 
366
- if ( $image ) {
367
- $image = wppa_cache_photo( $image['id'] );
368
  }
369
- return $image;
 
 
 
370
  }
371
-
2
  /* wppa-widget-functions.php
3
  /* Package: wp-photo-album-plus
4
  /*
5
+ /* Version 6.5.04
6
  /*
7
  */
8
 
9
+ /*
10
+
11
+ This file contans functions to get the photo of the day selection pool and to get THE photo of the day.
12
+
13
+ Related settings are:
14
+
15
+ 'wppa_potd_album_type',
16
+ 'wppa_potd_album',
17
+ 'wppa_potd_include_subs',
18
+ 'wppa_potd_status_filter',
19
+ 'wppa_potd_inverse',
20
+ 'wppa_potd_method',
21
+ 'wppa_potd_period',
22
+ 'wppa_potd_offset',
23
+ 'wppa_potd_photo',
24
+
25
+ */
26
+
27
  // This function returns an array of photos that meet the current photo of the day selection criteria
28
  function wppa_get_widgetphotos( $alb, $option = '' ) {
29
  global $wpdb;
30
 
31
+ if ( ! $alb ) return false;
32
+
33
  $photos = false;
34
  $query = '';
35
 
36
  // Compile status clause
37
+ switch( wppa_opt( 'potd_status_filter' ) ) {
38
  case 'publish':
39
  $statusclause = " `status` = 'publish' ";
40
  break;
60
  }
61
  }
62
 
63
+ // If physical album(s) and include subalbums is active, make it an enumeration(with ',' as seperator)
64
+ if ( wppa_opt( 'potd_album_type' ) == 'physical' && wppa_switch( 'potd_include_subs' ) ) {
65
+ $alb = str_replace( ',', '.', $alb );
66
+ $alb = wppa_expand_enum( wppa_alb_to_enum_children( $alb ) );
67
+ $alb = str_replace( '.', ',', $alb );
68
+ }
69
+
70
+ // If physical albums and inverse selection is active, invert selection
71
+ if ( wppa_opt( 'potd_album_type' ) == 'physical' && wppa_switch( 'potd_inverse' ) ) {
72
+ $albs = explode( ',', $alb );
73
+ $all = $wpdb->get_col( "SELECT `id` FROM `" . WPPA_ALBUMS . "` " );
74
+ $alb = implode( ',', array_diff( $all, $albs ) );
75
+ }
76
+
77
+ /* Now find out the final query */
78
+
79
+ /* Physical albums */
80
+
81
  // Is it a single album?
82
  if ( wppa_is_int( $alb ) ) {
83
+ $query = $wpdb->prepare( "SELECT `id`, `p_order` " .
84
+ "FROM `" . WPPA_PHOTOS . "` " .
85
+ "WHERE `album` = %s " .
86
+ "AND " . $statusclause . $option,
87
+ $alb );
88
  }
89
 
90
  // Is it an enumeration of album ids?
91
  elseif ( strchr( $alb, ',' ) ) {
92
  $alb = trim( $alb, ',' );
93
 
94
+ $query = "SELECT `id`, `p_order` " .
95
+ "FROM `" . WPPA_PHOTOS . "` " .
96
+ "WHERE `album` IN ( " . $alb . " ) " .
97
+ "AND " . $statusclause . $option;
 
 
 
98
  }
99
 
100
+ /* Virtual albums */
101
  // Is it ALL?
102
  elseif ( $alb == 'all' ) {
103
+ $query = "SELECT `id`, `p_order` " .
104
+ "FROM `" . WPPA_PHOTOS . "` " .
105
+ "WHERE " . $statusclause . $option;
106
  }
107
 
108
  // Is it SEP?
168
  return $photos;
169
  }
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
 
172
  // get the photo of the day
173
  function wppa_get_potd() {
174
  global $wpdb;
175
 
176
+ $id = 0;
177
+ switch ( wppa_opt( 'potd_method' ) ) {
178
+
179
+ // Fixed photo
180
+ case '1':
181
+ $id = wppa_opt( 'potd_photo' );
 
 
182
  break;
183
+
184
+ // Random
185
+ case '2':
186
+ $album = wppa_opt( 'potd_album' );
187
  if ( $album == 'topten' ) {
188
  $images = wppa_get_widgetphotos( $album );
189
  if ( count( $images ) > 1 ) { // Select a random first from the current selection
190
  $idx = rand( 0, count( $images ) - 1 );
191
+ $id = $images[$idx]['id'];
192
  }
193
  }
194
  elseif ( $album != '' ) {
195
  $images = wppa_get_widgetphotos( $album, "ORDER BY RAND() LIMIT 0,1" );
196
+ $id = $images[0]['id'];
197
  }
198
  break;
199
+
200
+ // Last upload
201
+ case '3':
202
+ $album = wppa_opt( 'potd_album' );
203
  if ( $album == 'topten' ) {
204
  $images = wppa_get_widgetphotos( $album );
205
  if ( $images ) {
206
+
207
+ // find last uploaded image in the $images pool
208
  $temp = 0;
209
  foreach( $images as $img ) {
210
  if ( $img['timestamp'] > $temp ) {
212
  $image = $img;
213
  }
214
  }
215
+ $id = $image['id'];
216
  }
217
  }
218
  elseif ( $album != '' ) {
219
  $images = wppa_get_widgetphotos( $album, "ORDER BY timestamp DESC LIMIT 0,1" );
220
+ $id = $images[0]['id'];
221
  }
222
  break;
223
+
224
+ // Change every
225
+ case '4':
226
+ $album = wppa_opt( 'potd_album' );
227
  if ( $album != '' ) {
228
+ $per = wppa_opt( 'potd_period' );
229
  $photos = wppa_get_widgetphotos( $album );
230
  if ( $per == '0' ) {
231
  if ( $photos ) {
232
+ $id = $photos[rand( 0, count( $photos )-1 )]['id'];
233
  }
 
234
  }
235
  elseif ( $per == 'day-of-week' ) {
 
236
  if ( $photos ) {
237
  $d = date_i18n( "w" );
238
  $d -= get_option( 'wppa_potd_offset', '0' );
239
  while ( $d < '1' ) $d += '7';
240
  foreach ( $photos as $img ) {
241
+ if ( $img['p_order'] == $d ) $id = $img['id'];
242
  }
243
  }
244
  }
245
  elseif ( $per == 'day-of-month' ) {
 
246
  if ( $photos ) {
247
  $d = strval(intval(date_i18n( "d" )));
248
  $d -= get_option( 'wppa_potd_offset', '0' );
249
  while ( $d < '1' ) $d += '31';
250
  foreach ( $photos as $img ) {
251
+ if ( $img['p_order'] == $d ) $id = $img['id'];
252
  }
253
  }
254
  }
255
  elseif ( $per == 'day-of-year' ) {
 
256
  if ( $photos ) {
257
  $d = strval(intval(date_i18n( "z" )));
258
  $d -= get_option( 'wppa_potd_offset', '0' );
259
  while ( $d < '0' ) $d += '366';
260
  foreach ( $photos as $img ) {
261
+ if ( $img['p_order'] == $d ) $id = $img['id'];
262
  }
263
  }
264
  }
299
  }
300
 
301
  // Image found
302
+ $id = $photos[$idn]['id'];
 
 
 
303
  }
304
  }
 
 
305
  }
306
  break;
307
 
 
 
308
  }
309
 
310
+ if ( $id ) {
311
+ $result = wppa_cache_photo( $id );
312
  }
313
+ else {
314
+ $result = false;
315
+ }
316
+ return $result;
317
  }
 
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.03
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 = '6503'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '6-5-03-012'; // 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.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
  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);