Version Description
= 7.1.06 =
- This version addresses various bug fixes and feature requests.
= 7.1.05 =
- This version addresses various security issues.
- This version addresses various bug fixes.
= 7.1.04 =
- This version addresses various bug fixes.
= 7.1.03 =
- This version addresses various security issues.
- This version addresses various bug fixes.
= 7.1.02 =
- This version addresses various security issues.
- This version addresses various bug fixes and feature requests.
= 7.1.01 =
- This version addresses various bug fixes and feature requests.
= 7.1.00 =
- This version addresses various bug fixes and feature requests.
- The Photo Album -> Upload Photos and Import Photos admin pages have been substantially improved. Read the changelog for details.
= 7.0.11 =
- This version addresses various bug fixes and feature requests.
= 7.0.11 =
- This version addresses various bug fixes
= 7.0.10 =
- This version addresses various bug fixes
= 7.0.09 =
- This version addresses various security issues.
- This version addresses various bug fixes and feature requests.
= 7.0.08 =
- This version addresses various security issues.
- This version addresses various bug fixes
= 7.0.07 =
- This version addresses various security issues.
- This version addresses various bug fixes
= 7.0.06 =
- This version addresses various bug fixes
- This version addresses various security issues.
= 7.0.05 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 7.0.04 =
- This version addresses various bug fixes
- This version addresses various security issues.
= 7.0.03 =
- This version addresses various minor bug fixes and feature requests.
= 7.0.02 =
- This version addresses various bug fixes
- This version addresses various security issues.
= 7.0.01 =
- This version addresses various minor bug fixes and feature requests.
= 7.0.00 =
- Shortcode generators for Gutenberg added.
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
- To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised. Configure Table IX-M to enable various mailing lists, and use the WPPA+ Notify widget for full user flexibility.
= 6.9.21 =
- This version addresses various bug fixes
- This version addresses various security issues.
= 6.9.20 =
- This version addresses various bug fixes
= 6.9.19 =
- This version addresses various minor bug fixes
= 6.9.18 =
- This version addresses various minor bug fixes
= 6.9.17 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.16 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.15 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.14 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.13 =
- Security release.
= 6.9.12 =
- This version addresses various minor bug fixes and performance improvements.
= 6.9.11 =
- This version addresses various minor bug fixes and performance improvements.
= 6.9.10 =
- This version addresses various minor bug fixes and performance improvements.
= 6.9.09 =
- Panorama support phase III.
= 6.9.08 =
- This version addresses various minor bug fixes and feature requests.
- Panorama support phase II.
= 6.9.07 =
- This version addresses various minor bug fixes and feature requests.
- Panorama support phase I.
= 6.9.06 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.05 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.04 =
- This version addresses various minor bug fixes and feature requests.
- Local CDN functionality has been added.
= 6.9.03 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.02 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.01 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.00 =
- This version includes the code for the privacy policy requirements.
= 6.8.09
- This version addresses various bug fixes and code edits.
= 6.8.08 =
- This version addresses various minor bug fixes and feature requests.
- This version offers substantial performance improvements when the box in Table IV-A13: Defer Javascript is ticked. This setting is now recommended and set ticked as the default.
- For more info on performance improvements and compatibility with optimizers: see the changelog.txt
= 6.8.07 =
- This version addresses various minor bug fixes and enhancements, and a new widget: Statistics.
= 6.8.06 =
- This version addresses various minor bug fixes and improved cache handling.
= 6.8.05 =
- This version addresses various minor bug fixes and feture requests.
= 6.8.04 =
- This version addresses various display issues and a few fixes of bugs that seldom affected the plugins behaviour.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 7.1.06.012 |
Comparing to | |
See all releases |
Code changes from version 7.1.05.006 to 7.1.06.012
- changelog.txt +12 -1
- js/wppa.js +89 -50
- js/wppa.min.js +1 -1
- readme.txt +6 -2
- theme/wppa-theme.php +440 -298
- wppa-admin-functions.php +3 -23
- wppa-boxes-html.php +12 -7
- wppa-common-functions.php +52 -34
- wppa-dashboard-widgets.php +26 -4
- wppa-filter.php +5 -1
- wppa-functions.php +17 -7
- wppa-maintenance.php +1 -1
- wppa-non-admin.php +38 -52
- wppa-session.php +4 -1
- wppa-settings-autosave.php +12 -6
- wppa-tinymce-photo-front.php +11 -15
- wppa-utils.php +24 -7
- wppa.php +6 -3
changelog.txt
CHANGED
@@ -1,12 +1,23 @@
|
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 7.1.05 =
|
4 |
|
5 |
* Various security fixes.
|
6 |
* Additinal lazy load process during resize handler.
|
7 |
* Fixed a few 'undefined var' warnings.
|
8 |
* Comment request mderation emails were not sent when comment notify emails was disabled. Fixed.
|
9 |
-
* Unused depot folders will now automatically be deleted.
|
10 |
* User depot dirs will now be created the moment the user opens the import admin page for the first time.
|
11 |
|
12 |
= 7.1.04 =
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
3 |
+
= 7.1.06 =
|
4 |
+
|
5 |
+
* Added shortcode argument delay="yes" to fill the wppa container by ajax after document.ready.
|
6 |
+
Use it when you have a random photo order and html caching. Does NOT work when defer javascript is active (Table IV-A13).
|
7 |
+
* Page specific js data is now printed in the page itsself, no longer by loading a page specific script file.
|
8 |
+
This saves a http request, and the page dependant data has to be loaded anyway.
|
9 |
+
* Fixed a layout issue in multicolumn responsive covers display.
|
10 |
+
* Videos did not display in the wppa recent activity dashboard widget. Fixed.
|
11 |
+
* Added 'infifite' as selection option in Table IX-A15.1
|
12 |
+
* Fixed a spurious warning message above wppa displays.
|
13 |
+
|
14 |
= 7.1.05 =
|
15 |
|
16 |
* Various security fixes.
|
17 |
* Additinal lazy load process during resize handler.
|
18 |
* Fixed a few 'undefined var' warnings.
|
19 |
* Comment request mderation emails were not sent when comment notify emails was disabled. Fixed.
|
20 |
+
* Unused depot folders will now automatically be deleted.
|
21 |
* User depot dirs will now be created the moment the user opens the import admin page for the first time.
|
22 |
|
23 |
= 7.1.04 =
|
js/wppa.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
//
|
3 |
// conatins common vars and functions
|
4 |
//
|
5 |
-
var wppaJsVersion = '7.1.
|
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!!
|
@@ -128,6 +128,7 @@ var wppaShareHideWhenRunning = false;
|
|
128 |
var wppaCommentRequiredAfterVote = true;
|
129 |
var wppaTopMoc = 0; // Set by wppa_functions.php -> function wppa_container( 'open' );
|
130 |
if ( ! wppaColWidth ) var wppaColWidth = []; // [mocc] Set by wppa_functions.php -> function wppa_container( 'open' );
|
|
|
131 |
var wppaFotomotoHideWhenRunning = false; // Set by wppa-non-admin.php -> wppa_create_wppa_init_js();
|
132 |
var wppaFotomotoMinWidth = 400; // Set by wppa-non-admin.php -> wppa_create_wppa_init_js();
|
133 |
var wppaPhotoView = []; // [id] Set to true by a bump viewcount to prevent duplicate bumps.
|
@@ -331,29 +332,38 @@ function wppaSizeAutoDiv() {
|
|
331 |
});
|
332 |
}
|
333 |
|
|
|
334 |
// Do the auto cols
|
335 |
function wppaDoAllAutocols(i) {
|
336 |
|
337 |
-
if ( typeof(i) != 'number' ) i =
|
338 |
else i++;
|
|
|
|
|
|
|
|
|
|
|
339 |
|
340 |
-
wppaConsoleLog('Doing wppaDoAllAutocols('+i+')'
|
341 |
|
342 |
// Do occurrences that are responsive
|
343 |
-
|
|
|
344 |
if ( wppaAutoColumnWidth[mocc] ) {
|
345 |
_wppaDoAutocol( mocc, i);
|
346 |
}
|
|
|
347 |
}
|
348 |
|
349 |
// Do lazy, just to be sure, for Ale
|
350 |
wppaMakeLazyVisible();
|
351 |
|
352 |
// Do retries if configured
|
353 |
-
if ( i < wppaExtendedResizeCount ) {
|
354 |
setTimeout(function(){wppaDoAllAutocols(i)}, wppaExtendedResizeDelay);
|
355 |
}
|
356 |
|
|
|
357 |
}
|
358 |
|
359 |
// If disable right mouseclick
|
@@ -513,76 +523,105 @@ function wppaGetContainerWidth( mocc ) {
|
|
513 |
function _wppaDoAutocol( mocc, i ) {
|
514 |
|
515 |
// Log we are in
|
516 |
-
wppaConsoleLog('Enter auto. mocc = '+mocc+' retry = '+i
|
517 |
|
518 |
// Auto?
|
519 |
if ( ! wppaAutoColumnWidth[mocc] ) return true;
|
520 |
var w;
|
521 |
var h;
|
|
|
|
|
522 |
|
523 |
// Container
|
524 |
-
w =
|
525 |
|
526 |
-
//
|
527 |
-
wppaColWidth[mocc]
|
528 |
|
529 |
-
//
|
530 |
-
|
531 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
532 |
}
|
533 |
else {
|
534 |
-
jQuery( ".
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
}
|
540 |
-
|
541 |
// Covers
|
542 |
if ( wppaCoverImageResponsive[mocc] ) {
|
543 |
}
|
544 |
else {
|
545 |
-
|
546 |
-
|
547 |
-
jQuery(
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
|
|
|
|
|
|
|
|
|
|
552 |
}
|
553 |
}
|
554 |
|
555 |
// Multi Column Responsive covers
|
556 |
-
|
557 |
-
var MCRWidth;
|
558 |
if ( exists.length > 1 ) { // Yes there are
|
559 |
-
|
560 |
-
var
|
561 |
-
|
562 |
-
var
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
574 |
}
|
575 |
-
idx++;
|
576 |
-
}
|
577 |
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
|
|
|
|
|
|
582 |
}
|
583 |
-
jQuery( ".wppa-cover-box-mcr-"+mocc ).stop().animate( {width:MCRWidth}, wppaResponseSpeed );
|
584 |
}
|
585 |
-
else { // One cover: full width, 0 covers don't care
|
586 |
if ( wppaCoverImageResponsive[mocc] ) {
|
587 |
}
|
588 |
else {
|
2 |
//
|
3 |
// conatins common vars and functions
|
4 |
//
|
5 |
+
var wppaJsVersion = '7.1.06';
|
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!!
|
128 |
var wppaCommentRequiredAfterVote = true;
|
129 |
var wppaTopMoc = 0; // Set by wppa_functions.php -> function wppa_container( 'open' );
|
130 |
if ( ! wppaColWidth ) var wppaColWidth = []; // [mocc] Set by wppa_functions.php -> function wppa_container( 'open' );
|
131 |
+
if ( ! wppaMCRWidth ) var wppaMCRWidth = [];
|
132 |
var wppaFotomotoHideWhenRunning = false; // Set by wppa-non-admin.php -> wppa_create_wppa_init_js();
|
133 |
var wppaFotomotoMinWidth = 400; // Set by wppa-non-admin.php -> wppa_create_wppa_init_js();
|
134 |
var wppaPhotoView = []; // [id] Set to true by a bump viewcount to prevent duplicate bumps.
|
332 |
});
|
333 |
}
|
334 |
|
335 |
+
var wppaDoAllAutocolsLastI = 0;
|
336 |
// Do the auto cols
|
337 |
function wppaDoAllAutocols(i) {
|
338 |
|
339 |
+
if ( typeof(i) != 'number' ) i = 1;
|
340 |
else i++;
|
341 |
+
if ( wppaDoAllAutocolsLastI >= i ) {
|
342 |
+
wppaDoAllAutocolsLastI = 0; // reset and wait for new event
|
343 |
+
return;
|
344 |
+
}
|
345 |
+
wppaDoAllAutocolsLastI = i;
|
346 |
|
347 |
+
wppaConsoleLog('Doing wppaDoAllAutocols('+i+')');
|
348 |
|
349 |
// Do occurrences that are responsive
|
350 |
+
var mocc = 1;
|
351 |
+
while ( mocc <= wppaAutoColumnWidth.length ) {
|
352 |
if ( wppaAutoColumnWidth[mocc] ) {
|
353 |
_wppaDoAutocol( mocc, i);
|
354 |
}
|
355 |
+
mocc++;
|
356 |
}
|
357 |
|
358 |
// Do lazy, just to be sure, for Ale
|
359 |
wppaMakeLazyVisible();
|
360 |
|
361 |
// Do retries if configured
|
362 |
+
if ( i < wppaExtendedResizeCount || wppaExtendedResizeCount == -1 ) {
|
363 |
setTimeout(function(){wppaDoAllAutocols(i)}, wppaExtendedResizeDelay);
|
364 |
}
|
365 |
|
366 |
+
return true;
|
367 |
}
|
368 |
|
369 |
// If disable right mouseclick
|
523 |
function _wppaDoAutocol( mocc, i ) {
|
524 |
|
525 |
// Log we are in
|
526 |
+
wppaConsoleLog('Enter auto. mocc = '+mocc+' retry = '+i);
|
527 |
|
528 |
// Auto?
|
529 |
if ( ! wppaAutoColumnWidth[mocc] ) return true;
|
530 |
var w;
|
531 |
var h;
|
532 |
+
var old;
|
533 |
+
var exists;
|
534 |
|
535 |
// Container
|
536 |
+
w = jQuery('#wppa-container-'+mocc).width();
|
537 |
|
538 |
+
// Anything to do here?
|
539 |
+
// if ( w == wppaColWidth[mocc] ) return true;
|
540 |
|
541 |
+
// Update current width
|
542 |
+
// wppaColWidth[mocc] = w;
|
543 |
+
|
544 |
+
/*
|
545 |
+
// Adjust container, only if it differs from current width
|
546 |
+
if ( ! wppaRenderModal ) {
|
547 |
+
old = jQuery( "#wppa-container-"+mocc ).width();
|
548 |
+
// wppaConsoleLog( 'container old='+old+', new='+w, 'force' );
|
549 |
+
if ( w != old ) {
|
550 |
+
if ( wppaResponseSpeed == 0 ) {
|
551 |
+
jQuery( ".wppa-container-"+mocc ).css( {width:w} );
|
552 |
+
}
|
553 |
+
else {
|
554 |
+
jQuery( ".wppa-container-"+mocc ).stop().animate( {width:w}, wppaResponseSpeed );
|
555 |
+
}
|
556 |
+
}
|
557 |
}
|
558 |
else {
|
559 |
+
old = jQuery( ".ui-dialog" ).css( 'width' );
|
560 |
+
if ( parseInt( w ) != parseInt( old ) ) {
|
561 |
+
jQuery( ".ui-dialog" ).css( 'width', w );
|
562 |
+
jQuery( ".ui-dialog" ).attr( 'height', 'auto' );
|
563 |
+
}
|
564 |
}
|
565 |
+
/**/
|
566 |
// Covers
|
567 |
if ( wppaCoverImageResponsive[mocc] ) {
|
568 |
}
|
569 |
else {
|
570 |
+
exists = jQuery( ".wppa-asym-text-frame-"+mocc );
|
571 |
+
if ( exists.length > 1 ) {
|
572 |
+
old = jQuery( exists[0] ).width();
|
573 |
+
|
574 |
+
if ( wppaResponseSpeed == 0 ) {
|
575 |
+
jQuery( ".wppa-asym-text-frame-"+mocc ).css( {width:(w - wppaTextFrameDelta)} );
|
576 |
+
jQuery( ".wppa-cover-box-"+mocc ).css( {width:w} );
|
577 |
+
}
|
578 |
+
else {
|
579 |
+
jQuery( ".wppa-asym-text-frame-"+mocc ).stop().animate( {width:(w - wppaTextFrameDelta)}, wppaResponseSpeed );
|
580 |
+
jQuery( ".wppa-cover-box-"+mocc ).stop().animate( {width:w}, wppaResponseSpeed );
|
581 |
+
}
|
582 |
}
|
583 |
}
|
584 |
|
585 |
// Multi Column Responsive covers
|
586 |
+
exists = jQuery( ".wppa-cover-box-mcr-"+mocc );
|
|
|
587 |
if ( exists.length > 1 ) { // Yes there are
|
588 |
+
|
589 |
+
var cw = document.getElementById( 'wppa-albumlist-' + mocc ).clientWidth;
|
590 |
+
var nCovers = parseInt( ( cw + 8 )/( wppaMaxCoverWidth+8 ) ) + 1;
|
591 |
+
var coverMax1 = nCovers - 1;
|
592 |
+
var MCRWidth = parseInt( ( ( cw + 8 )/nCovers ) - 8 );
|
593 |
+
|
594 |
+
if ( wppaColWidth[mocc] != cw || wppaMCRWidth[mocc] != MCRWidth ) {
|
595 |
+
|
596 |
+
wppaColWidth[mocc] = cw;
|
597 |
+
wppaMCRWidth[mocc] = MCRWidth;
|
598 |
+
|
599 |
+
var idx = 0;
|
600 |
+
while ( idx < exists.length ) {
|
601 |
+
var col = idx % nCovers;
|
602 |
+
switch ( col ) {
|
603 |
+
case 0: /* left */
|
604 |
+
jQuery( exists[idx] ).css( {'marginLeft': '0px', 'clear': 'both', 'float': 'left'});
|
605 |
+
break;
|
606 |
+
case coverMax1: /* right */
|
607 |
+
jQuery( exists[idx] ).css( {'marginLeft': '0px', 'clear': 'none', 'float': 'right'});
|
608 |
+
break;
|
609 |
+
default:
|
610 |
+
jQuery( exists[idx] ).css( {'marginLeft': '8px', 'clear': 'none', 'float': 'left'});
|
611 |
+
}
|
612 |
+
idx++;
|
613 |
}
|
|
|
|
|
614 |
|
615 |
+
if ( wppaCoverImageResponsive[mocc] ) {
|
616 |
+
}
|
617 |
+
else {
|
618 |
+
jQuery( ".wppa-asym-text-frame-mcr-"+mocc ).stop().animate( {width: (MCRWidth - wppaTextFrameDelta)}, wppaResponseSpeed );
|
619 |
+
}
|
620 |
+
old = jQuery( exists[0] ).width();
|
621 |
+
jQuery( ".wppa-cover-box-mcr-"+mocc ).stop().animate( {width:MCRWidth}, wppaResponseSpeed );
|
622 |
}
|
|
|
623 |
}
|
624 |
+
else if ( exists.length == 1 ) { // One cover: full width, 0 covers don't care
|
625 |
if ( wppaCoverImageResponsive[mocc] ) {
|
626 |
}
|
627 |
else {
|
js/wppa.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wppaJsVersion="7.1.05",wppaVersion="0",wppaIsIe=!1,wppaUseSvg=!0,wppaDebug,wppaFullValign=[],wppaFullHalign=[],wppaFullFrameDelta=[],wppaAnimationSpeed,wppaImageDirectory,wppaThumbnailAreaDelta;if(!wppaAutoColumnWidth)var wppaAutoColumnWidth=[];if(!wppaAutoColumnFrac)var wppaAutoColumnFrac=[];var wppaSlideShowTimeOut=2500,wppaFadeInAfterFadeOut=!1,wppaTextFrameDelta=0,wppaBoxDelta=0,wppaPreambule=[],wppaHideWhenEmpty=!1,wppaThumbnailPitch=[],wppaFilmStripLength=[],wppaFilmStripMargin=[],wppaFilmStripAreaDelta=[],wppaFilmShowGlue=!1,wppaIsMini=[],wppaPortraitOnly=[],wppaSlideShow,wppaPhoto,wppaOf,wppaNextPhoto,wppaPreviousPhoto,wppaNextP,wppaPrevP,wppaAvgRating,wppaMyRating,wppaAvgRat,wppaMyRat,wppaDislikeMsg,wppaMiniTreshold=300,wppaStart="Start",wppaStop="Stop",wppaPleaseName,wppaPleaseEmail,wppaPleaseComment,wppaRatingOnce=!0,wppaBGcolorNumbar="transparent",wppaBcolorNumbar="transparent",wppaBGcolorNumbarActive="transparent",wppaBcolorNumbarActive="transparent",wppaFontFamilyNumbar="",wppaFontSizeNumbar="",wppaFontColorNumbar="",wppaFontWeightNumbar="",wppaFontFamilyNumbarActive="",wppaFontSizeNumbarActive="",wppaFontColorNumbarActive="",wppaFontWeightNumbarActive="",wppaNumbarMax="10",wppaAjaxUrl="",wppaLang="",wppaNextOnCallback=!1,wppaStarOpacity=.2,wppaLightBox=[],wppaEmailRequired="required",wppaSlideBorderWidth=0,wppaSlideInitRunning=[],wppaAnimationType="fadeover",wppaSlidePause=[],wppaSlideBlank=[],wppaRatingMax=5,wppaRatingDisplayType="graphic",wppaRatingPrec=2,wppaFilmPageSize=[],wppaAspectRatio=[],wppaFullSize=[],wppaStretch=!1,wppaThumbSpaceAuto=!1,wppaMinThumbSpace=4,wppaMagnifierCursor="",wppaArtMonkyLink="none",wppaAutoOpenComments=!1,wppaUpdateAddressLine=!1,wppaFilmThumbTitle="",wppaClickToView="",wppaUploadUrl="",wppaVoteForMe="",wppaVotedForMe="",wppaSlideSwipe=!0,wppaLightboxSingle=[],wppaMaxCoverWidth=300,wppaDownLoad="Download",wppaSiteUrl="",wppaWppaUrl="",wppaIncludeUrl="",wppaSlideToFullpopup=!1,wppaComAltSize=75,wppaBumpViewCount=!0,wppaBumpClickCount=!1,wppaFotomoto=!1,wppaArtMonkeyButton=!0,wppaShortQargs=!1,wppaOvlHires=!1,wppaMasonryCols=[],wppaVideoPlaying=[],wppaAudioPlaying=[],wppaSlideVideoStart=!1,wppaSlideAudioStart=!1,wppaAudioHeight=28,wppaHis=0,wppaStartHtml=[],wppaCanAjaxRender=!1,wppaCanPushState=!1,wppaAllowAjax=!0,wppaMaxOccur=0,wppaFirstOccur=0,wppaUsePhotoNamesInUrls=!1,wppaShareHideWhenRunning=!1,wppaCommentRequiredAfterVote=!0,wppaTopMoc=0;if(!wppaColWidth)var wppaColWidth=[];var wppaFotomotoHideWhenRunning=!1,wppaFotomotoMinWidth=400,wppaPhotoView=[],wppaBackgroundColorImage="",wppaPopupLinkType="",wppaPopupOnclick=[],wppaThumbTargetBlank=!1,wppaRel="rel",wppaEditPhotoWidth="960",wppaThemeStyles="",wppaStickyHeaderHeight=0,wppaRenderModal=!1,wppaModalBgColor="#ffffff",wppaBoxRadius=0,wppaModalQuitImg,wppaUploadEdit="none",wppaPageArg="",wppaSlideshowNavigationType="icons",wppaCoverImageResponsive=[],wppaSearchBoxSelItems=[],wppaSlideWrap=[],wppaHideRightClick=!1,wppaProcessing="Processing...",wppaDone="Done!",wppaUploadFailed="Upload failed",wppaServerError="Server error",wppaGeoZoom=10,wppaLazyLoad=!0,wppaAreaMaxFrac=1,wppaNiceScroll=!1,wppaIconSizeNormal="default",wppaIconSizeSlide=48,wppaIconSizeStars=24,wppaResponseSpeed=500,wppaExtendedResizeCount=0,wppaExtendedResizeDelay=200,_wppaId=[],_wppaAvg=[],_wppaDisc=[],_wppaMyr=[],_wppaVRU=[],_wppaLinkUrl=[],_wppaLinkTitle=[],_wppaLinkTarget=[],_wppaCommentHtml=[],_wppaIptcHtml=[],_wppaExifHtml=[],_wppaToTheSame=!1,_wppaSlides=[],_wppaNames=[],_wppaFullNames=[],_wppaDsc=[],_wppaOgDsc=[],_wppaCurIdx=[],_wppaNxtIdx=[],_wppaTimeOut=[],_wppaSSRuns=[],_wppaFg=[],_wppaTP=[],_wppaIsBusy=[],_wppaFirst=[],_wppaVoteInProgress=!1,_wppaTextDelay,_wppaUrl=[],_wppaSkipRated=[],_wppaLbTitle=[],_wppaStateCount=0,_wppaDidGoto=[],_wppaShareUrl=[],_wppaShareHtml=[],_wppaFilmNoMove=[],_wppaHiresUrl=[],_wppaIsVideo=[],_wppaVideoHtml=[],_wppaAudioHtml=[],_wppaVideoNatWidth=[],_wppaVideoNatHeight=[],_wppaWaitTexts=[],_wppaImageAlt=[],__wppaOverruleRun=!1,wppaOvlUrls,wppaOvlTitles,wppaOvlAlts,wppaOvlIdx=0,wppaOvlFirst=!0,wppaOvlKbHandler="",wppaOvlSizeHandler="",wppaOvlPadTop=5,wppaOvlIsSingle,wppaOvlRunning=!1,wppaOvlVideoHtmls,wppaOvlAudioHtmls,wppaOvlPdfHtmls,wppaOvlVideoNaturalWidths,wppaOvlVideoNaturalHeights,wppaOvlModeInitial="normal",wppaOvlVideoPlaying=!1,wppaOvlAudioPlaying=!1,wppaOvlShowLegenda=!0,wppaOvlShowStartStop=!0,wppaOvlRadius=0,wppaOvlBorderWidth=16,wppaOvlOpen=!1,wppaOvlTxtHeight=36,wppaOvlOpacity=.8,wppaOvlOnclickType="none",wppaOvlTheme="black",wppaOvlAnimSpeed=300,wppaOvlSlideSpeed=3e3,wppaVer4WindowWidth=800,wppaVer4WindowHeight=600,wppaOvlFontFamily="Helvetica",wppaOvlFontSize="10",wppaOvlFontColor="",wppaOvlFontWeight="bold",wppaOvlLineHeight="12",wppaOvlShowCounter=!0,wppaOvlIsVideo=!1,wppaShowLegenda="",wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlVideoStart=!1,wppaOvlAudioStart=!1,wppaLastIptc="",wppaLastExif="",wppaIsMobile=!1,wppaSvgFillcolor="gray",wppaSvgBgcolor="transparent",wppaSvgCornerStyle="light";function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),jQuery(".wppa-ajax-spin").stop().fadeOut(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){for(var p=1;p<wppaTopMoc;)jQuery("#ubb-"+p+"-l")&&(wppaUbb(p,"l","hide"),wppaUbb(p,"r","hide")),p++},3e3),jQuery(window).on("DOMContentLoaded load resize orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize scroll wheel",wppaMakeLazyVisible),jQuery(".wppa-divnicewrap").on("resize scroll wheel",wppaMakeLazyVisible),jQuery(window).trigger("resize"),wppaProtect()}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(p){var a=jQuery(window).height(),e=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:a*e})})}function wppaDoAllAutocols(p){for("number"!=typeof p?p=0:p++,wppaConsoleLog("Doing wppaDoAllAutocols("+p+")","force"),mocc=1;mocc<=wppaTopMoc;mocc++)wppaAutoColumnWidth[mocc]&&_wppaDoAutocol(mocc,p);wppaMakeLazyVisible(),p<wppaExtendedResizeCount&&setTimeout(function(){wppaDoAllAutocols(p)},wppaExtendedResizeDelay)}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(p){return!1}),jQuery("video").bind("contextmenu",function(p){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(p){var a,e,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+p,t[3]="theimg1-"+p,e=0;e<3;)1==++e&&0!=p||(a=document.getElementById(t[e]))&&"function"==typeof a.pause&&(a.pause(),wppaConsoleLog("Video "+t[e]+" paused","force"))}function wppaStopAudio(p){if("number"==typeof p)jQuery("#audio-"+p).pause&&jQuery("#audio-"+p).pause();else{var a=jQuery("audio");if(0<a.length)for(var e=0;e<a.length;)"wppa"==jQuery(a[e]).attr("data-from")&&a[e].pause(),e++}}function wppaMakeFullsizeUrl(p){var a,e;p=(a=(p=p.replace("/thumbs/","/")).split("//"))[1]?(e=a[1].split("/"),a[0]+"//"):(e=a[0].split("/"),"");for(var t=0;t<e.length;){var o=e[t];"w"!=o.split("_")[0]&&(0!=t&&(p+="/"),p+=o),t++}return p}function wppaGetContainerWidth(p){var a=document.getElementById("wppa-container-"+p),e=0;if(!wppaAutoColumnWidth[p])return a.clientWidth;for(;0==e;)a=a.parentNode,e=jQuery(a).width();return parseInt(e*wppaAutoColumnFrac[p])}function _wppaDoAutocol(p,a){if(wppaConsoleLog("Enter auto. mocc = "+p+" retry = "+a,"force"),!wppaAutoColumnWidth[p])return!0;var e;e=wppaGetContainerWidth(p),wppaColWidth[p]=e,0==wppaResponseSpeed?jQuery(".wppa-container-"+p).css({width:e}):jQuery(".wppa-container-"+p).stop().animate({width:e},wppaResponseSpeed),wppaRenderModal&&(jQuery(".ui-dialog").css("width",e),jQuery(".ui-dialog").attr("height","auto")),wppaCoverImageResponsive[p]||(0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+p).css({width:e-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+p).css({width:e})):(jQuery(".wppa-asym-text-frame-"+p).stop().animate({width:e-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-"+p).stop().animate({width:e},wppaResponseSpeed)));var t,o=jQuery(".wppa-cover-box-mcr-"+p);if(1<o.length){var r=parseInt((e+8)/(wppaMaxCoverWidth+8))+1,s=r-1;t=parseInt((e+8)/r-8);for(var i=0;i<o.length;){switch(i%r){case 0:jQuery(o[i]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(o[i]).css({marginLeft:"8px",clear:"none",float:"right"});break;default:jQuery(o[i]).css({marginLeft:"8px",clear:"none",float:"left"})}i++}wppaCoverImageResponsive[p]||jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:t-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-mcr-"+p).stop().animate({width:t},wppaResponseSpeed)}else if(wppaCoverImageResponsive[p]);else{jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:e-wppaTextFrameDelta},wppaResponseSpeed);jQuery(".wppa-cover-box-mcr-"+p).css({marginLeft:"0px",float:"left"})}if(wppaThumbSpaceAuto){var n=parseInt(jQuery(".thumbnail-frame-"+p).css("width"));if(n){var w=wppaMinThumbSpace,l=e-wppaThumbnailAreaDelta-7,u=Math.max(1,parseInt(l/(n+w))),c=parseInt(.5+(l-u*n)/(u+1));jQuery(".thumbnail-frame-"+p).css({marginLeft:c})}}jQuery(".thumbnail-frame-comalt-"+p).css("width",e-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+p).css("width",e-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var d,y=1,m=jQuery("#wppa-mas-h-"+y+"-"+p).attr("data-height-perc");m;)d=m*(e-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+y+"-"+p).css("height",d),y++,m=jQuery("#wppa-mas-h-"+y+"-"+p).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(p),wppaFormatSlide(p),jQuery("#audio-slide-"+p).css("width",e-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+p).css("width",.7*e),wppaFilmStripLength[p]=e-wppaFilmStripAreaDelta[p],jQuery("#filmwindow-"+p).css("width",wppaFilmStripLength[p]),_wppaAdjustFilmstrip(p),wppaIsMini[p]||void 0===_wppaSlides[p]||(wppaColWidth[p]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat),jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating),jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length))),jQuery(".wppa-sphoto-"+p).css("width",e),jQuery(".wppa-simg-"+p).css("width",e-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+p).css("height",""),jQuery(".wppa-mphoto-"+p).css("width",e+10),jQuery(".wppa-mimg-"+p).css("width",e),jQuery(".wppa-mimg-"+p).css("height",""),jQuery(".smxpdf-"+p).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[p]&&(e/wppaSearchBoxSelItems[p]<125?jQuery(".wppa-searchsel-item-"+p).css("width","100%"):jQuery(".wppa-searchsel-item-"+p).css("width",100/wppaSearchBoxSelItems[p]+"%")),jQuery(".wppa-upload-album-"+p).css("maxWidth",.6*e),!0}function wppaSetMasHorFrameWidthsForIeAndChrome(p){for(var a=jQuery(".wppa-mas-h-"+p),e=wppaMinThumbSpace,t=0;t<a.length;t++){var o=wppaGetChildI(a[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+p+" )",400);var r=o.naturalWidth/o.naturalHeight*o.height+e;jQuery(a[t]).css({width:r})}}}function wppaGetChildI(p){var a,e=p.childNodes;for(a=0;a<e.length;a++){var t=e[a];if(t.id&&"i-"==t.id.substr(0,2))return t;var o=wppaGetChildI(t);if(o)return o}return!1}jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",wppaSizeAutoDiv)}),jQuery(document).ready(function(p){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var a=1;a<=wppaMaxOccur;)wppaStartHtml[a]=jQuery("#wppa-container-"+a).html(),a++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(p,a){if(!(wppaColWidth[p]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+p).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+p).css("display","none");jQuery("#wppa-fotomoto-container-"+p).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+p)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(a),wppaFotomotoToolbarIds[p]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+p,a)):(setTimeout("wppaFotomotoToolbar( "+p+',"'+a+'" )',200),wppaConsoleLog("Waiting for Fotomoto")))}function wppaFotomotoHide(p){jQuery("#wppa-fotomoto-container-"+p).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","none")}function wppaStringContainsForbiddenChars(p){for(var a=["?","&","#","/",'"',"'"],e=0;e<a.length;){if(-1!=p.indexOf(a[e]))return!0;e++}return!1}function wppaPushStateSlide(p,a,e){if(!wppaIsMini[p]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=e)try{history.pushState({page:wppaHis,occur:p,type:"slide",slide:a},"---",e),wppaConsoleLog("Slide history stack updated")}catch(p){wppaConsoleLog("Slide history stack update failed")}}function wppaRepairScriptTags(p){if(void 0===p)return"";for(;-1!=p.indexOf("[script");)p=p.replace("[script","<script");for(;-1!=p.indexOf("[/script");)p=p.replace("[/script","</script");return p}function wppaRepairBrTags(p){return void 0===p?"":p.replace("[br /]","<br />").replace("[a","<a").replace(""",'"').replace('"]','">').replace("[/a]","</a>")}function wppaTrimAlt(p){return void 0===p?"":13<p.length?p.substr(0,10)+"...":p}window.onpopstate=function(p){var a=0;if(wppaCanPushState){if(p.state)switch(a=p.state.occur,p.state.type){case"html":jQuery("#wppa-container-"+a).html(p.state.html);break;case"slide":_wppaGoto(a,p.state.slide)}else if(wppaUpdateAddressLine){if(a=wppaFirstOccur,jQuery("#wppa-container-"+a).html(wppaStartHtml[a]),(wppaFirstOccur=0)==a){var e=document.location.href.split("&wppa-occur=");a=parseInt(e[1])}e=document.location.href.split("&wppa-photo=");var t=parseInt(e[1]);if(0<t){for(var o=0;o<_wppaId[a].length&&_wppaId[a][o]!=t;)o++;o<_wppaId[a].length&&_wppaGoto(a,o)}}document.getElementById("theslide0-"+a)&&_wppaStop(a)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy?wppaConsoleLog("Fb Init busy"):"undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):(wppaConsoleLog("Fb wait"),setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(p,a){if(document.selection)p.focus(),sel=document.selection.createRange(),sel.text=a;else if(p.selectionStart||"0"==p.selectionStart){var e=p.selectionStart,t=p.selectionEnd;p.value=p.value.substring(0,e)+a+p.value.substring(t,p.value.length),p.selectionStart=e+a.length,p.selectionEnd=e+a.length}else p.value+=a}function wppaGeoInit(p,a,e){var t=new google.maps.LatLng(a,e),o={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:t},r=new google.maps.Map(document.getElementById("map-canvas-"+p),o),s=new google.maps.Marker({position:t,map:r,title:""});google.maps.event.addListener(r,"center_changed",function(){window.setTimeout(function(){r.panTo(s.getPosition())},1e3)})}function wppaEncode(p){var a;if(void 0!==p){var e=(a=(a=String(p).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),t=0;for(a="";t<e.length;)a+=e[t],++t<e.length&&(a+="||PLUS||");return a}}function wppaUrlToId(p){var a=p.split("/wppa/");return 1==a.length&&(a=p.split("/upload/")),1==a.length?0:a=(a=(a=(a=(a=(a=(a=a[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(p,a){jQuery("#wppa-ss-albumopt-"+p).css("display","none"),jQuery("#wppa-ss-albumcat-"+p).css("display","none"),jQuery("#wppa-ss-albumname-"+p).css("display","none"),jQuery("#wppa-ss-albumtext-"+p).css("display","none"),jQuery("#wppa-ss-photoopt-"+p).css("display","none"),jQuery("#wppa-ss-photoname-"+p).css("display","none"),jQuery("#wppa-ss-photoowner-"+p).css("display","none"),jQuery("#wppa-ss-phototag-"+p).css("display","none"),jQuery("#wppa-ss-phototext-"+p).css("display","none"),jQuery("#wppa-ss-photoexif-"+p).css("display","none"),jQuery("#wppa-ss-photoiptc-"+p).css("display","none"),jQuery("#wppa-ss-exifopts-"+p).css("display","none"),jQuery("#wppa-ss-iptcopts-"+p).css("display","none"),jQuery("#wppa-ss-spinner-"+p).css("display","none"),jQuery("#wppa-ss-button-"+p).css("display","none");var e=jQuery("#wppa-ss-pa-"+p).val(),t="",o="",r="";switch(e){case"a":switch(jQuery("#wppa-ss-albumopt-"+p).css("display",""),t=jQuery("#wppa-ss-albumopt-"+p).val()){case"c":jQuery("#wppa-ss-albumcat-"+p).css("display","");var s=jQuery(".wppa-ss-albumcat-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+p).css("display","");s=jQuery(".wppa-ss-albumtext-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+p).css("display",""),t=jQuery("#wppa-ss-photoopt-"+p).val()){case"n":jQuery("#wppa-ss-photoname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+p).css("display","");s=jQuery(".wppa-ss-phototag-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+p).css("display","");var i;s=jQuery(".wppa-ss-phototext-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+p).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(p,o,"wppa-ss-iptcopts-"+p),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+p).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(p,o,"wppa-ss-exifopts-"+p),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")))}}if(a){var n=jQuery("#wppa-ss-pageurl-"+p).val();-1==n.indexOf("?")?n+="?":n+="&",n+="occur=1&wppa-supersearch="+e+","+t+","+o+","+r,document.location.href=n}}function wppaAjaxGetSsIptcList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssiptclist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,a,e){jQuery("#"+o).html(p),jQuery("#wppa-ss-iptcopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-iptclist-'+t+'", "#'+o+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsIptcList failed. Error = "+e+", status = "+a,"force")},complete:function(p,a,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaAjaxGetSsExifList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssexiflist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,a,e){jQuery("#"+o).html(p),jQuery("#wppa-ss-exifopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-exiflist-'+t+'", "#'+o+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsExifList failed. Error = "+e+", status = "+a,"force")},complete:function(p,a,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaSetIptcExifSize(p,a){var e=jQuery(p).length;6<e&&(e=6),e<2&&(e=2),jQuery(a).attr("size",e)}function wppaUpdateSearchRoot(p,a){for(var e=jQuery(".wppa-search-root"),t=0;t<e.length;)jQuery(e[t]).html(p),t++;for(e=jQuery(".wppa-rootbox"),t=0;t<e.length;)a?(jQuery(e[t]).prop("checked",!1),jQuery(e[t]).prop("disabled",!1)):(jQuery(e[t]).prop("checked",!0),jQuery(e[t]).prop("disabled",!0)),t++;for(e=jQuery(".wppa-search-root-id"),t=0;t<e.length;)jQuery(e[t]).val(a),t++}function wppaSubboxChange(p){jQuery(p).prop("checked")&&jQuery(".wppa-rootbox").each(function(p){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var p=jQuery(".wppa-display-searchstring"),a=0;a<p.length;)jQuery(p[a]).html(""),a++;for(p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).attr("disabled","disabled"),a++}function wppaEnableSubsearch(){for(var p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).removeAttr("disabled"),a++}function wppaDisplaySelectedFiles(p){for(var a=jQuery("#"+p),e=0,t="";e<a[0].files.length;)t+=a[0].files[e].name+" ",e++;jQuery("#"+p+"-display").val(t)}function wppaIsEmpty(p){return null==p||(void 0===p||(""==p||(0==p||(0==p||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(p,a,e,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}wppaConsoleLog("wppa.js version "+wppaJsVersion+" loaded.","force");
|
1 |
+
var wppaJsVersion="7.1.06",wppaVersion="0",wppaIsIe=!1,wppaUseSvg=!0,wppaDebug,wppaFullValign=[],wppaFullHalign=[],wppaFullFrameDelta=[],wppaAnimationSpeed,wppaImageDirectory,wppaThumbnailAreaDelta;if(!wppaAutoColumnWidth)var wppaAutoColumnWidth=[];if(!wppaAutoColumnFrac)var wppaAutoColumnFrac=[];var wppaSlideShowTimeOut=2500,wppaFadeInAfterFadeOut=!1,wppaTextFrameDelta=0,wppaBoxDelta=0,wppaPreambule=[],wppaHideWhenEmpty=!1,wppaThumbnailPitch=[],wppaFilmStripLength=[],wppaFilmStripMargin=[],wppaFilmStripAreaDelta=[],wppaFilmShowGlue=!1,wppaIsMini=[],wppaPortraitOnly=[],wppaSlideShow,wppaPhoto,wppaOf,wppaNextPhoto,wppaPreviousPhoto,wppaNextP,wppaPrevP,wppaAvgRating,wppaMyRating,wppaAvgRat,wppaMyRat,wppaDislikeMsg,wppaMiniTreshold=300,wppaStart="Start",wppaStop="Stop",wppaPleaseName,wppaPleaseEmail,wppaPleaseComment,wppaRatingOnce=!0,wppaBGcolorNumbar="transparent",wppaBcolorNumbar="transparent",wppaBGcolorNumbarActive="transparent",wppaBcolorNumbarActive="transparent",wppaFontFamilyNumbar="",wppaFontSizeNumbar="",wppaFontColorNumbar="",wppaFontWeightNumbar="",wppaFontFamilyNumbarActive="",wppaFontSizeNumbarActive="",wppaFontColorNumbarActive="",wppaFontWeightNumbarActive="",wppaNumbarMax="10",wppaAjaxUrl="",wppaLang="",wppaNextOnCallback=!1,wppaStarOpacity=.2,wppaLightBox=[],wppaEmailRequired="required",wppaSlideBorderWidth=0,wppaSlideInitRunning=[],wppaAnimationType="fadeover",wppaSlidePause=[],wppaSlideBlank=[],wppaRatingMax=5,wppaRatingDisplayType="graphic",wppaRatingPrec=2,wppaFilmPageSize=[],wppaAspectRatio=[],wppaFullSize=[],wppaStretch=!1,wppaThumbSpaceAuto=!1,wppaMinThumbSpace=4,wppaMagnifierCursor="",wppaArtMonkyLink="none",wppaAutoOpenComments=!1,wppaUpdateAddressLine=!1,wppaFilmThumbTitle="",wppaClickToView="",wppaUploadUrl="",wppaVoteForMe="",wppaVotedForMe="",wppaSlideSwipe=!0,wppaLightboxSingle=[],wppaMaxCoverWidth=300,wppaDownLoad="Download",wppaSiteUrl="",wppaWppaUrl="",wppaIncludeUrl="",wppaSlideToFullpopup=!1,wppaComAltSize=75,wppaBumpViewCount=!0,wppaBumpClickCount=!1,wppaFotomoto=!1,wppaArtMonkeyButton=!0,wppaShortQargs=!1,wppaOvlHires=!1,wppaMasonryCols=[],wppaVideoPlaying=[],wppaAudioPlaying=[],wppaSlideVideoStart=!1,wppaSlideAudioStart=!1,wppaAudioHeight=28,wppaHis=0,wppaStartHtml=[],wppaCanAjaxRender=!1,wppaCanPushState=!1,wppaAllowAjax=!0,wppaMaxOccur=0,wppaFirstOccur=0,wppaUsePhotoNamesInUrls=!1,wppaShareHideWhenRunning=!1,wppaCommentRequiredAfterVote=!0,wppaTopMoc=0;if(!wppaColWidth)var wppaColWidth=[];if(!wppaMCRWidth)var wppaMCRWidth=[];var wppaFotomotoHideWhenRunning=!1,wppaFotomotoMinWidth=400,wppaPhotoView=[],wppaBackgroundColorImage="",wppaPopupLinkType="",wppaPopupOnclick=[],wppaThumbTargetBlank=!1,wppaRel="rel",wppaEditPhotoWidth="960",wppaThemeStyles="",wppaStickyHeaderHeight=0,wppaRenderModal=!1,wppaModalBgColor="#ffffff",wppaBoxRadius=0,wppaModalQuitImg,wppaUploadEdit="none",wppaPageArg="",wppaSlideshowNavigationType="icons",wppaCoverImageResponsive=[],wppaSearchBoxSelItems=[],wppaSlideWrap=[],wppaHideRightClick=!1,wppaProcessing="Processing...",wppaDone="Done!",wppaUploadFailed="Upload failed",wppaServerError="Server error",wppaGeoZoom=10,wppaLazyLoad=!0,wppaAreaMaxFrac=1,wppaNiceScroll=!1,wppaIconSizeNormal="default",wppaIconSizeSlide=48,wppaIconSizeStars=24,wppaResponseSpeed=500,wppaExtendedResizeCount=0,wppaExtendedResizeDelay=200,_wppaId=[],_wppaAvg=[],_wppaDisc=[],_wppaMyr=[],_wppaVRU=[],_wppaLinkUrl=[],_wppaLinkTitle=[],_wppaLinkTarget=[],_wppaCommentHtml=[],_wppaIptcHtml=[],_wppaExifHtml=[],_wppaToTheSame=!1,_wppaSlides=[],_wppaNames=[],_wppaFullNames=[],_wppaDsc=[],_wppaOgDsc=[],_wppaCurIdx=[],_wppaNxtIdx=[],_wppaTimeOut=[],_wppaSSRuns=[],_wppaFg=[],_wppaTP=[],_wppaIsBusy=[],_wppaFirst=[],_wppaVoteInProgress=!1,_wppaTextDelay,_wppaUrl=[],_wppaSkipRated=[],_wppaLbTitle=[],_wppaStateCount=0,_wppaDidGoto=[],_wppaShareUrl=[],_wppaShareHtml=[],_wppaFilmNoMove=[],_wppaHiresUrl=[],_wppaIsVideo=[],_wppaVideoHtml=[],_wppaAudioHtml=[],_wppaVideoNatWidth=[],_wppaVideoNatHeight=[],_wppaWaitTexts=[],_wppaImageAlt=[],__wppaOverruleRun=!1,wppaOvlUrls,wppaOvlTitles,wppaOvlAlts,wppaOvlIdx=0,wppaOvlFirst=!0,wppaOvlKbHandler="",wppaOvlSizeHandler="",wppaOvlPadTop=5,wppaOvlIsSingle,wppaOvlRunning=!1,wppaOvlVideoHtmls,wppaOvlAudioHtmls,wppaOvlPdfHtmls,wppaOvlVideoNaturalWidths,wppaOvlVideoNaturalHeights,wppaOvlModeInitial="normal",wppaOvlVideoPlaying=!1,wppaOvlAudioPlaying=!1,wppaOvlShowLegenda=!0,wppaOvlShowStartStop=!0,wppaOvlRadius=0,wppaOvlBorderWidth=16,wppaOvlOpen=!1,wppaOvlTxtHeight=36,wppaOvlOpacity=.8,wppaOvlOnclickType="none",wppaOvlTheme="black",wppaOvlAnimSpeed=300,wppaOvlSlideSpeed=3e3,wppaVer4WindowWidth=800,wppaVer4WindowHeight=600,wppaOvlFontFamily="Helvetica",wppaOvlFontSize="10",wppaOvlFontColor="",wppaOvlFontWeight="bold",wppaOvlLineHeight="12",wppaOvlShowCounter=!0,wppaOvlIsVideo=!1,wppaShowLegenda="",wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlVideoStart=!1,wppaOvlAudioStart=!1,wppaLastIptc="",wppaLastExif="",wppaIsMobile=!1,wppaSvgFillcolor="gray",wppaSvgBgcolor="transparent",wppaSvgCornerStyle="light";function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),jQuery(".wppa-ajax-spin").stop().fadeOut(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){for(var p=1;p<wppaTopMoc;)jQuery("#ubb-"+p+"-l")&&(wppaUbb(p,"l","hide"),wppaUbb(p,"r","hide")),p++},3e3),jQuery(window).on("DOMContentLoaded load resize orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize scroll wheel",wppaMakeLazyVisible),jQuery(".wppa-divnicewrap").on("resize scroll wheel",wppaMakeLazyVisible),jQuery(window).trigger("resize"),wppaProtect()}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(p){var a=jQuery(window).height(),e=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:a*e})})}jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",wppaSizeAutoDiv)});var wppaDoAllAutocolsLastI=0;function wppaDoAllAutocols(p){if("number"!=typeof p?p=1:p++,!(p<=wppaDoAllAutocolsLastI)){wppaDoAllAutocolsLastI=p,wppaConsoleLog("Doing wppaDoAllAutocols("+p+")");for(var a=1;a<=wppaAutoColumnWidth.length;)wppaAutoColumnWidth[a]&&_wppaDoAutocol(a,p),a++;return wppaMakeLazyVisible(),(p<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){wppaDoAllAutocols(p)},wppaExtendedResizeDelay),!0}wppaDoAllAutocolsLastI=0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(p){return!1}),jQuery("video").bind("contextmenu",function(p){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(p){var a,e,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+p,t[3]="theimg1-"+p,e=0;e<3;)1==++e&&0!=p||(a=document.getElementById(t[e]))&&"function"==typeof a.pause&&(a.pause(),wppaConsoleLog("Video "+t[e]+" paused","force"))}function wppaStopAudio(p){if("number"==typeof p)jQuery("#audio-"+p).pause&&jQuery("#audio-"+p).pause();else{var a=jQuery("audio");if(0<a.length)for(var e=0;e<a.length;)"wppa"==jQuery(a[e]).attr("data-from")&&a[e].pause(),e++}}function wppaMakeFullsizeUrl(p){var a,e;p=(a=(p=p.replace("/thumbs/","/")).split("//"))[1]?(e=a[1].split("/"),a[0]+"//"):(e=a[0].split("/"),"");for(var t=0;t<e.length;){var o=e[t];"w"!=o.split("_")[0]&&(0!=t&&(p+="/"),p+=o),t++}return p}function wppaGetContainerWidth(p){var a=document.getElementById("wppa-container-"+p),e=0;if(!wppaAutoColumnWidth[p])return a.clientWidth;for(;0==e;)a=a.parentNode,e=jQuery(a).width();return parseInt(e*wppaAutoColumnFrac[p])}function _wppaDoAutocol(p,a){if(wppaConsoleLog("Enter auto. mocc = "+p+" retry = "+a),!wppaAutoColumnWidth[p])return!0;var e,t;if(e=jQuery("#wppa-container-"+p).width(),wppaCoverImageResponsive[p]||1<(t=jQuery(".wppa-asym-text-frame-"+p)).length&&(jQuery(t[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+p).css({width:e-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+p).css({width:e})):(jQuery(".wppa-asym-text-frame-"+p).stop().animate({width:e-wppaTextFrameDelta},wppaResponseSpeed),jQuery(".wppa-cover-box-"+p).stop().animate({width:e},wppaResponseSpeed))),1<(t=jQuery(".wppa-cover-box-mcr-"+p)).length){var o=document.getElementById("wppa-albumlist-"+p).clientWidth,r=parseInt((o+8)/(wppaMaxCoverWidth+8))+1,s=r-1,i=parseInt((o+8)/r-8);if(wppaColWidth[p]!=o||wppaMCRWidth[p]!=i){wppaColWidth[p]=o,wppaMCRWidth[p]=i;for(var n=0;n<t.length;){switch(n%r){case 0:jQuery(t[n]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(t[n]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(t[n]).css({marginLeft:"8px",clear:"none",float:"left"})}n++}wppaCoverImageResponsive[p]||jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:i-wppaTextFrameDelta},wppaResponseSpeed),jQuery(t[0]).width(),jQuery(".wppa-cover-box-mcr-"+p).stop().animate({width:i},wppaResponseSpeed)}}else if(1==t.length)if(wppaCoverImageResponsive[p]);else{jQuery(".wppa-asym-text-frame-mcr-"+p).stop().animate({width:e-wppaTextFrameDelta},wppaResponseSpeed);jQuery(".wppa-cover-box-mcr-"+p).css({marginLeft:"0px",float:"left"})}if(wppaThumbSpaceAuto){var w=parseInt(jQuery(".thumbnail-frame-"+p).css("width"));if(w){var l=wppaMinThumbSpace,u=e-wppaThumbnailAreaDelta-7,c=Math.max(1,parseInt(u/(w+l))),d=parseInt(.5+(u-c*w)/(c+1));jQuery(".thumbnail-frame-"+p).css({marginLeft:d})}}jQuery(".thumbnail-frame-comalt-"+p).css("width",e-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+p).css("width",e-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var y,m=1,h=jQuery("#wppa-mas-h-"+m+"-"+p).attr("data-height-perc");h;)y=h*(e-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+m+"-"+p).css("height",y),m++,h=jQuery("#wppa-mas-h-"+m+"-"+p).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(p),wppaFormatSlide(p),jQuery("#audio-slide-"+p).css("width",e-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+p).css("width",.7*e),wppaFilmStripLength[p]=e-wppaFilmStripAreaDelta[p],jQuery("#filmwindow-"+p).css("width",wppaFilmStripLength[p]),_wppaAdjustFilmstrip(p),wppaIsMini[p]||void 0===_wppaSlides[p]||(wppaColWidth[p]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat),jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating),jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length))),jQuery(".wppa-sphoto-"+p).css("width",e),jQuery(".wppa-simg-"+p).css("width",e-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+p).css("height",""),jQuery(".wppa-mphoto-"+p).css("width",e+10),jQuery(".wppa-mimg-"+p).css("width",e),jQuery(".wppa-mimg-"+p).css("height",""),jQuery(".smxpdf-"+p).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[p]&&(e/wppaSearchBoxSelItems[p]<125?jQuery(".wppa-searchsel-item-"+p).css("width","100%"):jQuery(".wppa-searchsel-item-"+p).css("width",100/wppaSearchBoxSelItems[p]+"%")),jQuery(".wppa-upload-album-"+p).css("maxWidth",.6*e),!0}function wppaSetMasHorFrameWidthsForIeAndChrome(p){for(var a=jQuery(".wppa-mas-h-"+p),e=wppaMinThumbSpace,t=0;t<a.length;t++){var o=wppaGetChildI(a[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+p+" )",400);var r=o.naturalWidth/o.naturalHeight*o.height+e;jQuery(a[t]).css({width:r})}}}function wppaGetChildI(p){var a,e=p.childNodes;for(a=0;a<e.length;a++){var t=e[a];if(t.id&&"i-"==t.id.substr(0,2))return t;var o=wppaGetChildI(t);if(o)return o}return!1}jQuery(document).ready(function(p){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var a=1;a<=wppaMaxOccur;)wppaStartHtml[a]=jQuery("#wppa-container-"+a).html(),a++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(p,a){if(!(wppaColWidth[p]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+p).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+p).css("display","none");jQuery("#wppa-fotomoto-container-"+p).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+p)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(a),wppaFotomotoToolbarIds[p]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+p,a)):(setTimeout("wppaFotomotoToolbar( "+p+',"'+a+'" )',200),wppaConsoleLog("Waiting for Fotomoto")))}function wppaFotomotoHide(p){jQuery("#wppa-fotomoto-container-"+p).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","none")}function wppaStringContainsForbiddenChars(p){for(var a=["?","&","#","/",'"',"'"],e=0;e<a.length;){if(-1!=p.indexOf(a[e]))return!0;e++}return!1}function wppaPushStateSlide(p,a,e){if(!wppaIsMini[p]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=e)try{history.pushState({page:wppaHis,occur:p,type:"slide",slide:a},"---",e),wppaConsoleLog("Slide history stack updated")}catch(p){wppaConsoleLog("Slide history stack update failed")}}function wppaRepairScriptTags(p){if(void 0===p)return"";for(;-1!=p.indexOf("[script");)p=p.replace("[script","<script");for(;-1!=p.indexOf("[/script");)p=p.replace("[/script","</script");return p}function wppaRepairBrTags(p){return void 0===p?"":p.replace("[br /]","<br />").replace("[a","<a").replace(""",'"').replace('"]','">').replace("[/a]","</a>")}function wppaTrimAlt(p){return void 0===p?"":13<p.length?p.substr(0,10)+"...":p}window.onpopstate=function(p){var a=0;if(wppaCanPushState){if(p.state)switch(a=p.state.occur,p.state.type){case"html":jQuery("#wppa-container-"+a).html(p.state.html);break;case"slide":_wppaGoto(a,p.state.slide)}else if(wppaUpdateAddressLine){if(a=wppaFirstOccur,jQuery("#wppa-container-"+a).html(wppaStartHtml[a]),(wppaFirstOccur=0)==a){var e=document.location.href.split("&wppa-occur=");a=parseInt(e[1])}e=document.location.href.split("&wppa-photo=");var t=parseInt(e[1]);if(0<t){for(var o=0;o<_wppaId[a].length&&_wppaId[a][o]!=t;)o++;o<_wppaId[a].length&&_wppaGoto(a,o)}}document.getElementById("theslide0-"+a)&&_wppaStop(a)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy?wppaConsoleLog("Fb Init busy"):"undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):(wppaConsoleLog("Fb wait"),setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(p,a){if(document.selection)p.focus(),sel=document.selection.createRange(),sel.text=a;else if(p.selectionStart||"0"==p.selectionStart){var e=p.selectionStart,t=p.selectionEnd;p.value=p.value.substring(0,e)+a+p.value.substring(t,p.value.length),p.selectionStart=e+a.length,p.selectionEnd=e+a.length}else p.value+=a}function wppaGeoInit(p,a,e){var t=new google.maps.LatLng(a,e),o={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:t},r=new google.maps.Map(document.getElementById("map-canvas-"+p),o),s=new google.maps.Marker({position:t,map:r,title:""});google.maps.event.addListener(r,"center_changed",function(){window.setTimeout(function(){r.panTo(s.getPosition())},1e3)})}function wppaEncode(p){var a;if(void 0!==p){var e=(a=(a=String(p).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),t=0;for(a="";t<e.length;)a+=e[t],++t<e.length&&(a+="||PLUS||");return a}}function wppaUrlToId(p){var a=p.split("/wppa/");return 1==a.length&&(a=p.split("/upload/")),1==a.length?0:a=(a=(a=(a=(a=(a=(a=a[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(p,a){jQuery("#wppa-ss-albumopt-"+p).css("display","none"),jQuery("#wppa-ss-albumcat-"+p).css("display","none"),jQuery("#wppa-ss-albumname-"+p).css("display","none"),jQuery("#wppa-ss-albumtext-"+p).css("display","none"),jQuery("#wppa-ss-photoopt-"+p).css("display","none"),jQuery("#wppa-ss-photoname-"+p).css("display","none"),jQuery("#wppa-ss-photoowner-"+p).css("display","none"),jQuery("#wppa-ss-phototag-"+p).css("display","none"),jQuery("#wppa-ss-phototext-"+p).css("display","none"),jQuery("#wppa-ss-photoexif-"+p).css("display","none"),jQuery("#wppa-ss-photoiptc-"+p).css("display","none"),jQuery("#wppa-ss-exifopts-"+p).css("display","none"),jQuery("#wppa-ss-iptcopts-"+p).css("display","none"),jQuery("#wppa-ss-spinner-"+p).css("display","none"),jQuery("#wppa-ss-button-"+p).css("display","none");var e=jQuery("#wppa-ss-pa-"+p).val(),t="",o="",r="";switch(e){case"a":switch(jQuery("#wppa-ss-albumopt-"+p).css("display",""),t=jQuery("#wppa-ss-albumopt-"+p).val()){case"c":jQuery("#wppa-ss-albumcat-"+p).css("display","");var s=jQuery(".wppa-ss-albumcat-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+p).css("display","");s=jQuery(".wppa-ss-albumtext-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+p).css("display",""),t=jQuery("#wppa-ss-photoopt-"+p).val()){case"n":jQuery("#wppa-ss-photoname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+p).css("display","");s=jQuery(".wppa-ss-phototag-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+p).css("display","");var i;s=jQuery(".wppa-ss-phototext-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+p).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(p,o,"wppa-ss-iptcopts-"+p),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+p).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(p,o,"wppa-ss-exifopts-"+p),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")))}}if(a){var n=jQuery("#wppa-ss-pageurl-"+p).val();-1==n.indexOf("?")?n+="?":n+="&",n+="occur=1&wppa-supersearch="+e+","+t+","+o+","+r,document.location.href=n}}function wppaAjaxGetSsIptcList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssiptclist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,a,e){jQuery("#"+o).html(p),jQuery("#wppa-ss-iptcopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-iptclist-'+t+'", "#'+o+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsIptcList failed. Error = "+e+", status = "+a,"force")},complete:function(p,a,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaAjaxGetSsExifList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssexiflist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,a,e){jQuery("#"+o).html(p),jQuery("#wppa-ss-exifopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-exiflist-'+t+'", "#'+o+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsExifList failed. Error = "+e+", status = "+a,"force")},complete:function(p,a,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaSetIptcExifSize(p,a){var e=jQuery(p).length;6<e&&(e=6),e<2&&(e=2),jQuery(a).attr("size",e)}function wppaUpdateSearchRoot(p,a){for(var e=jQuery(".wppa-search-root"),t=0;t<e.length;)jQuery(e[t]).html(p),t++;for(e=jQuery(".wppa-rootbox"),t=0;t<e.length;)a?(jQuery(e[t]).prop("checked",!1),jQuery(e[t]).prop("disabled",!1)):(jQuery(e[t]).prop("checked",!0),jQuery(e[t]).prop("disabled",!0)),t++;for(e=jQuery(".wppa-search-root-id"),t=0;t<e.length;)jQuery(e[t]).val(a),t++}function wppaSubboxChange(p){jQuery(p).prop("checked")&&jQuery(".wppa-rootbox").each(function(p){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var p=jQuery(".wppa-display-searchstring"),a=0;a<p.length;)jQuery(p[a]).html(""),a++;for(p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).attr("disabled","disabled"),a++}function wppaEnableSubsearch(){for(var p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).removeAttr("disabled"),a++}function wppaDisplaySelectedFiles(p){for(var a=jQuery("#"+p),e=0,t="";e<a[0].files.length;)t+=a[0].files[e].name+" ",e++;jQuery("#"+p+"-display").val(t)}function wppaIsEmpty(p){return null==p||(void 0===p||(""==p||(0==p||(0==p||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(p,a,e,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}wppaConsoleLog("wppa.js version "+wppaJsVersion+" loaded.","force");
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
-
Version: 7.1.
|
6 |
-
Stable tag: 7.1.
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -137,6 +137,10 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
|
|
137 |
|
138 |
== Upgrade Notice ==
|
139 |
|
|
|
|
|
|
|
|
|
140 |
= 7.1.05 =
|
141 |
|
142 |
* This version addresses various security issues.
|
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¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
+
Version: 7.1.06
|
6 |
+
Stable tag: 7.1.05.006
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
137 |
|
138 |
== Upgrade Notice ==
|
139 |
|
140 |
+
= 7.1.06 =
|
141 |
+
|
142 |
+
* This version addresses various bug fixes and feature requests.
|
143 |
+
|
144 |
= 7.1.05 =
|
145 |
|
146 |
* This version addresses various security issues.
|
theme/wppa-theme.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the albums/photos/slideshow in a page or post
|
6 |
-
* Version
|
7 |
*/
|
8 |
function wppa_theme() {
|
9 |
|
10 |
-
global $wppa_version; $wppa_version = '
|
11 |
global $wppa;
|
12 |
global $wppa_show_statistics; // Can be set to true by a custom page template
|
13 |
|
@@ -16,340 +16,385 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
|
|
16 |
$n_album_pages = '0'; // "
|
17 |
$n_thumb_pages = '0'; // "
|
18 |
|
19 |
-
//
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
|
|
|
|
27 |
|
|
|
|
|
|
|
28 |
|
29 |
-
|
|
|
|
|
30 |
|
31 |
-
//
|
32 |
-
$
|
33 |
-
$
|
34 |
-
$alb_id = wppa( 'start_album' );
|
35 |
-
if ( wppa_is_int( $alb_id ) && $alb_id > '0' ) {
|
36 |
-
$is_alt_thumbsize = wppa_get_album_item( $alb_id, 'alt_thumbsize' ) == 'yes';
|
37 |
-
}
|
38 |
|
39 |
-
//
|
40 |
-
$
|
41 |
-
$n_album_pages = wppa_get_npages( 'albums', $albums ); // Get the number of album pages
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
} else $thumbs = false;
|
46 |
|
47 |
-
|
|
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
if ( $wanted_empty ) $n_thumb_pages = '1';
|
52 |
|
53 |
-
//
|
54 |
-
|
55 |
-
else $totpag = $n_album_pages + $n_thumb_pages;
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
if ( $
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
$didsome = true;
|
|
|
72 |
} // End if on page
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
-
wppa_album_list( 'close' ); // Close Albums sub-container
|
75 |
-
} // If albums
|
76 |
-
}
|
77 |
-
|
78 |
-
if ( $didsome && wppa_is_pagination() ) $thumbs = false; // Pag on and didsome: force a pagebreak by faking no thumbs
|
79 |
-
if ( is_array( $thumbs ) && count( $thumbs ) <= wppa_get_mincount() && ! $wanted_empty ) $thumbs = false; // Less than treshold value
|
80 |
-
if ( wppa_switch( 'thumbs_first' ) && $curpage > $n_thumb_pages ) $thumbs = false; // If thumbs done, do not display an empty thumbarea
|
81 |
-
|
82 |
-
// Process the thumbs
|
83 |
-
if ( $thumbs || $wanted_empty )
|
84 |
-
if ( ! $wanted_empty || ! wppa_switch( 'thumbs_first' ) || wppa_get_curpage() == '1' )
|
85 |
-
if ( ! $wanted_empty || wppa_switch( 'thumbs_first' ) || wppa_get_curpage() == $totpag ) {
|
86 |
-
|
87 |
-
// As covers
|
88 |
-
if ( wppa_opt( 'thumbtype' ) == 'ascovers' ||
|
89 |
-
wppa_opt( 'thumbtype' ) == 'ascovers-mcr' ) { // Do the thumbs As covers
|
90 |
-
wppa_thumb_list( 'open' ); // Open Thumblist sub-container
|
91 |
-
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
92 |
-
foreach ( $thumbs as $tt ) : global $thumb; $thumb = $tt; // Loop the Thumbs
|
93 |
-
$counter_thumbs++;
|
94 |
-
if ( wppa_onpage( 'thumbs', $counter_thumbs, $relpage ) ) {
|
95 |
-
$didsome = true;
|
96 |
-
wppa_thumb_ascover( $thumb['id'] ); // Show Thumb as cover
|
97 |
-
} // End if on page
|
98 |
-
endforeach;
|
99 |
-
wppa_thumb_list( 'close' ); // Close Thumblist sub-container
|
100 |
-
} // As covers
|
101 |
-
|
102 |
-
// Masonry vertical
|
103 |
-
elseif ( wppa_opt( 'thumbtype' ) == 'masonry-v' ) { // Masonry
|
104 |
-
|
105 |
-
// The header
|
106 |
-
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
107 |
-
wppa_popup(); // Prepare Popup box
|
108 |
-
wppa_album_name( 'top' ); // Optionally display album name
|
109 |
-
wppa_album_desc( 'top' ); // Optionally display album description
|
110 |
-
|
111 |
-
// Init
|
112 |
-
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
113 |
-
$cont_width = wppa_get_container_width();
|
114 |
-
$count_cols = ceil( $cont_width / ( wppa_opt( $is_alt_thumbsize ? 'thumbsize_alt' : 'thumbsize' ) + wppa_opt( 'tn_margin' ) ) );
|
115 |
-
$correction = wppa_opt( 'tn_margin' ) * ( $cont_width / $count_cols ) / 100;
|
116 |
-
|
117 |
-
// Init the table
|
118 |
-
wppa_out( '<table class="wppa-masonry" style="margin-top:3px;" ><tbody class="wppa-masonry" ><tr class="wppa-masonry" >' );
|
119 |
-
|
120 |
-
// Init the columns
|
121 |
-
$col_headers = array();
|
122 |
-
$col_contents = array();
|
123 |
-
$col_heights = array();
|
124 |
-
$col_widths = array();
|
125 |
-
|
126 |
-
for ( $col = 0; $col < $count_cols; $col++ ) {
|
127 |
-
$col_headers[$col] = '';
|
128 |
-
$col_contents[$col] = '';
|
129 |
-
$col_heights[$col] = 0;
|
130 |
-
$col_widths[$col] = 100;
|
131 |
-
}
|
132 |
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
|
|
|
|
144 |
}
|
145 |
-
$didsome = true;
|
146 |
}
|
147 |
-
}
|
148 |
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
}
|
154 |
-
|
155 |
-
// Adjust column widths to resize lengths to equal lengths
|
156 |
-
for ( $col = 0; $col < $count_cols; $col++ ) {
|
157 |
-
if ( $col_heights[$col] ) {
|
158 |
-
$col_widths[$col] = $long / $col_heights[$col] * $col_widths[$col];
|
159 |
}
|
160 |
-
}
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
$col_widths[$col] = $col_widths[$col] * 100 / $wide;
|
169 |
-
}
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
$
|
174 |
-
|
|
|
|
|
|
|
|
|
175 |
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
wppa_out( '</td>' );
|
181 |
-
}
|
182 |
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
wppa_album_desc( 'bottom' ); // Optionally display album description
|
189 |
-
wppa_thumb_area( 'close' ); // Close Thumbarea sub-container
|
190 |
-
} // Masonry-v
|
191 |
-
|
192 |
-
// Masonry horizontal
|
193 |
-
elseif ( wppa_opt( 'thumbtype' ) == 'masonry-h' ) { // Masonry
|
194 |
-
|
195 |
-
// The header
|
196 |
-
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
197 |
-
wppa_popup(); // Prepare Popup box
|
198 |
-
wppa_album_name( 'top' ); // Optionally display album name
|
199 |
-
wppa_album_desc( 'top' ); // Optionally display album description
|
200 |
-
|
201 |
-
// Init
|
202 |
-
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
203 |
-
$cont_width = wppa_get_container_width( 'netto' );
|
204 |
-
$correction = wppa_opt( 'tn_margin' );
|
205 |
-
|
206 |
-
// Init the table
|
207 |
-
wppa_out( '<table class="wppa-masonry wppa-masonry-h" style="margin-top:3px;" ><tbody class="wppa-masonry" >' );
|
208 |
-
|
209 |
-
// Process the thumbnails
|
210 |
-
$row_content = '';
|
211 |
-
$row_width = 0;
|
212 |
-
$target_row_height = wppa_opt( $is_alt_thumbsize ? 'thumbsize_alt' : 'thumbsize' ) * 0.75 + $correction;
|
213 |
-
$rw_count = 0;
|
214 |
-
$tr_count = '1';
|
215 |
-
$done_count = 0;
|
216 |
-
$last = false;
|
217 |
-
$max_row_height = $target_row_height * 0.8; // Init keep track for last
|
218 |
-
if ( $thumbs ) foreach ( $thumbs as $tt ) {
|
219 |
-
$id = $tt['id'];
|
220 |
-
$counter_thumbs++;
|
221 |
-
if ( wppa_onpage( 'thumbs', $counter_thumbs, $relpage ) ) {
|
222 |
-
$row_content .= wppa_get_thumb_masonry( $tt['id'] );
|
223 |
-
$rw_count += 1;
|
224 |
-
$row_width += wppa_get_thumbratioxy( $id ) * ( $target_row_height - $correction );
|
225 |
-
$didsome = true;
|
226 |
}
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
}
|
235 |
-
|
236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
}
|
238 |
-
$row_height_p = $row_height / $cont_width * 100;
|
239 |
-
wppa_out( '<tr class="wppa-masonry" >' .
|
240 |
-
'<td style="border:none;padding:0;margin:0" >' .
|
241 |
-
'<div' .
|
242 |
-
' id="wppa-mas-h-'.$tr_count.'-'.wppa( 'mocc' ).'"' .
|
243 |
-
' style="height:'.$row_height.'px;"' .
|
244 |
-
' class="wppa-masonry"' .
|
245 |
-
' data-height-perc="'.$row_height_p.'"' .
|
246 |
-
' >');
|
247 |
-
wppa_out( $row_content );
|
248 |
-
wppa_out( '</div></td></tr>' );
|
249 |
-
$row_content = '';
|
250 |
-
$row_width = 0;
|
251 |
-
$row_height = wppa_opt( 'thumbsize' );
|
252 |
-
$rw_count = 0;
|
253 |
-
$tr_count += '1';
|
254 |
}
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
'
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
}
|
287 |
-
}
|
288 |
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
|
295 |
-
|
296 |
-
|
297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
}
|
299 |
-
} // If thumbs
|
300 |
-
|
301 |
-
if ( $didsome && wppa_is_pagination() ) $albums = false; // Pag on and didsome: force a pagebreak by faking no albums
|
302 |
-
if ( ! wppa_is_pagination() ) $n_thumb_pages = '0'; // Still on page one
|
303 |
-
|
304 |
-
// Process the albums
|
305 |
-
if ( wppa_switch( 'thumbs_first' ) ) {
|
306 |
-
if ( $albums ) {
|
307 |
-
$counter_albums = '0';
|
308 |
-
wppa_album_list( 'open' ); // Open Albums sub-container
|
309 |
-
foreach ( $albums as $album ) { // Loop the albums
|
310 |
-
$counter_albums++;
|
311 |
-
if ( wppa_onpage( 'albums', $counter_albums, $curpage - $n_thumb_pages ) ) {
|
312 |
-
wppa_album_cover( $album['id'] ); // Show the cover
|
313 |
-
$didsome = true;
|
314 |
-
} // End if on page
|
315 |
-
}
|
316 |
-
wppa_album_list( 'close' ); // Close Albums sub-container
|
317 |
-
} // If albums
|
318 |
-
}
|
319 |
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
}
|
330 |
-
|
331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
}
|
333 |
else {
|
334 |
-
wppa_out( wppa_errorbox( __( 'No
|
335 |
}
|
336 |
-
}
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
$thumbs = wppa_get_thumbs();
|
341 |
-
wppa_dbg_msg( 'From theme: #thumbs='.( $thumbs ? count( $thumbs ) : '0' ) );
|
342 |
-
if ( $thumbs ) {
|
343 |
-
wppa_the_slideshow(); // Producs all the html required for the slideshow
|
344 |
-
wppa_run_slidecontainer( 'slideshow' ); // Fill in the photo array and display it.
|
345 |
-
}
|
346 |
-
else {
|
347 |
-
wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wppa_theme' , 'wp-photo-album-plus') ) );
|
348 |
-
}
|
349 |
-
} // wppa_page( 'slide' )
|
350 |
|
351 |
-
//
|
352 |
-
wppa_container( 'close' );
|
353 |
}
|
354 |
|
355 |
function wppa_is_wanted_empty( $thumbs ) {
|
@@ -366,3 +411,100 @@ function wppa_is_wanted_empty( $thumbs ) {
|
|
366 |
|
367 |
return true;
|
368 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the albums/photos/slideshow in a page or post
|
6 |
+
* Version 7.1.06
|
7 |
*/
|
8 |
function wppa_theme() {
|
9 |
|
10 |
+
global $wppa_version; $wppa_version = '7.1.06.001'; // The version number of this file
|
11 |
global $wppa;
|
12 |
global $wppa_show_statistics; // Can be set to true by a custom page template
|
13 |
|
16 |
$n_album_pages = '0'; // "
|
17 |
$n_thumb_pages = '0'; // "
|
18 |
|
19 |
+
// Delayed displsy?
|
20 |
+
if ( wppa( 'delay' ) && wppa_switch( 'allow_ajax' ) && ! wppa_switch( 'defer_javascript' ) ) {
|
21 |
|
22 |
+
// Open container
|
23 |
+
wppa_container( 'open' );
|
24 |
|
25 |
+
// Get basic urls
|
26 |
+
$link_url = wppa_get_permalink();
|
27 |
+
$ajax_url = wppa_get_ajaxlink();
|
28 |
+
$extra_url = wppa_get_extra_url();
|
29 |
|
30 |
+
// Almost ready
|
31 |
+
$link_url .= $extra_url;
|
32 |
+
$ajax_url .= $extra_url;
|
33 |
|
34 |
+
// Compress
|
35 |
+
$link_url = wppa_trim_wppa_( $link_url );
|
36 |
+
$ajax_url = wppa_trim_wppa_( $ajax_url );
|
37 |
|
38 |
+
// Encrypt
|
39 |
+
$link_url = wppa_encrypt_url( $link_url );
|
40 |
+
$ajax_url = wppa_encrypt_url( $ajax_url );
|
|
|
|
|
|
|
|
|
41 |
|
42 |
+
// Pretty
|
43 |
+
$link_url = wppa_convert_to_pretty( $link_url );
|
|
|
44 |
|
45 |
+
$link_url = str_replace( '&', '&', $link_url );
|
46 |
+
$ajax_url = str_replace( '&', '&', $ajax_url );
|
|
|
47 |
|
48 |
+
// Create script tag
|
49 |
+
$html = "\n" . '<script>jQuery(document).ready(function(){wppaDoAjaxRender(' . wppa( 'mocc' ) . ', \'' . $ajax_url . '\', \'' . $link_url . '\');});</script>';
|
50 |
|
51 |
+
// Output the results
|
52 |
+
wppa_out( $html );
|
|
|
53 |
|
54 |
+
// Close container
|
55 |
+
wppa_container( 'close' );
|
|
|
56 |
|
57 |
+
} // Delaed
|
58 |
+
|
59 |
+
// Not delayed
|
60 |
+
else {
|
61 |
+
|
62 |
+
// Open container
|
63 |
+
wppa_container( 'open' );
|
64 |
+
|
65 |
+
// Show statistics if set so by the page template
|
66 |
+
if ( $wppa_show_statistics ) wppa_statistics();
|
67 |
+
|
68 |
+
// Display breadcrumb navigation only if it is set in the settings page
|
69 |
+
wppa_breadcrumb( 'optional' );
|
70 |
+
|
71 |
+
|
72 |
+
if ( wppa_page( 'albums' ) ) { // Page 'Albums' requested
|
73 |
+
|
74 |
+
// Init for possible alt thumbsize on masonry
|
75 |
+
$counter_thumbs = '0';
|
76 |
+
$is_alt_thumbsize = false;
|
77 |
+
$alb_id = wppa( 'start_album' );
|
78 |
+
if ( wppa_is_int( $alb_id ) && $alb_id > '0' ) {
|
79 |
+
$is_alt_thumbsize = wppa_get_album_item( $alb_id, 'alt_thumbsize' ) == 'yes';
|
80 |
+
}
|
81 |
+
|
82 |
+
// Get the albums and the thumbs and the number of pages for each set
|
83 |
+
$albums = wppa_get_albums(); // Get the albums
|
84 |
+
$n_album_pages = wppa_get_npages( 'albums', $albums ); // Get the number of album pages
|
85 |
+
|
86 |
+
if ( wppa_opt( 'thumbtype' ) != 'none' ) {
|
87 |
+
$thumbs = wppa_get_thumbs(); // Get the Thumbs
|
88 |
+
} else $thumbs = false;
|
89 |
+
|
90 |
+
$wanted_empty = wppa_is_wanted_empty( $thumbs ); // See if we need to display an empty thumbnail area
|
91 |
+
|
92 |
+
$n_thumb_pages = wppa_get_npages( 'thumbs', $thumbs ); // Get the number of thumb pages
|
93 |
+
if ( $n_thumb_pages == '0' && ! $wanted_empty ) $thumbs = false; // No pages: no thumbs. Maybe want covers only
|
94 |
+
if ( $wanted_empty ) $n_thumb_pages = '1';
|
95 |
+
|
96 |
+
// Get total number of pages
|
97 |
+
if ( ! wppa_is_pagination() ) $totpag = '1'; // If both pagination is off, there is only one page
|
98 |
+
else $totpag = $n_album_pages + $n_thumb_pages;
|
99 |
+
|
100 |
+
// Make pagelinkbar if requested on top
|
101 |
+
if ( wppa_opt( 'pagelink_pos' ) == 'top' || wppa_opt( 'pagelink_pos' ) == 'both' ) {
|
102 |
+
wppa_page_links( $totpag, $curpage );
|
103 |
+
}
|
104 |
+
|
105 |
+
// Process the albums
|
106 |
+
if ( ! wppa_switch( 'thumbs_first' ) ) {
|
107 |
+
if ( $albums ) {
|
108 |
+
$counter_albums = '0';
|
109 |
+
wppa_album_list( 'open' ); // Open Albums sub-container
|
110 |
+
foreach ( $albums as $album ) { // Loop the albums
|
111 |
+
$counter_albums++;
|
112 |
+
if ( wppa_onpage( 'albums', $counter_albums, $curpage ) ) {
|
113 |
+
wppa_album_cover( $album['id'] ); // Show the cover
|
114 |
+
$didsome = true;
|
115 |
+
} // End if on page
|
116 |
+
}
|
117 |
+
wppa_album_list( 'close' ); // Close Albums sub-container
|
118 |
+
} // If albums
|
119 |
+
}
|
120 |
|
121 |
+
if ( $didsome && wppa_is_pagination() ) $thumbs = false; // Pag on and didsome: force a pagebreak by faking no thumbs
|
122 |
+
if ( is_array( $thumbs ) && count( $thumbs ) <= wppa_get_mincount() && ! $wanted_empty ) $thumbs = false; // Less than treshold value
|
123 |
+
if ( wppa_switch( 'thumbs_first' ) && $curpage > $n_thumb_pages ) $thumbs = false; // If thumbs done, do not display an empty thumbarea
|
124 |
+
|
125 |
+
// Process the thumbs
|
126 |
+
if ( $thumbs || $wanted_empty )
|
127 |
+
if ( ! $wanted_empty || ! wppa_switch( 'thumbs_first' ) || wppa_get_curpage() == '1' )
|
128 |
+
if ( ! $wanted_empty || wppa_switch( 'thumbs_first' ) || wppa_get_curpage() == $totpag ) {
|
129 |
+
|
130 |
+
// As covers
|
131 |
+
if ( wppa_opt( 'thumbtype' ) == 'ascovers' ||
|
132 |
+
wppa_opt( 'thumbtype' ) == 'ascovers-mcr' ) { // Do the thumbs As covers
|
133 |
+
wppa_thumb_list( 'open' ); // Open Thumblist sub-container
|
134 |
+
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
135 |
+
foreach ( $thumbs as $tt ) : global $thumb; $thumb = $tt; // Loop the Thumbs
|
136 |
+
$counter_thumbs++;
|
137 |
+
if ( wppa_onpage( 'thumbs', $counter_thumbs, $relpage ) ) {
|
138 |
$didsome = true;
|
139 |
+
wppa_thumb_ascover( $thumb['id'] ); // Show Thumb as cover
|
140 |
} // End if on page
|
141 |
+
endforeach;
|
142 |
+
wppa_thumb_list( 'close' ); // Close Thumblist sub-container
|
143 |
+
} // As covers
|
144 |
+
|
145 |
+
// Masonry vertical
|
146 |
+
elseif ( wppa_opt( 'thumbtype' ) == 'masonry-v' ) { // Masonry
|
147 |
+
|
148 |
+
// The header
|
149 |
+
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
150 |
+
wppa_popup(); // Prepare Popup box
|
151 |
+
wppa_album_name( 'top' ); // Optionally display album name
|
152 |
+
wppa_album_desc( 'top' ); // Optionally display album description
|
153 |
+
|
154 |
+
// Init
|
155 |
+
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
156 |
+
$cont_width = wppa_get_container_width();
|
157 |
+
$count_cols = ceil( $cont_width / ( wppa_opt( $is_alt_thumbsize ? 'thumbsize_alt' : 'thumbsize' ) + wppa_opt( 'tn_margin' ) ) );
|
158 |
+
$correction = wppa_opt( 'tn_margin' ) * ( $cont_width / $count_cols ) / 100;
|
159 |
+
|
160 |
+
// Init the table
|
161 |
+
wppa_out( '<table class="wppa-masonry" style="margin-top:3px;" ><tbody class="wppa-masonry" ><tr class="wppa-masonry" >' );
|
162 |
+
|
163 |
+
// Init the columns
|
164 |
+
$col_headers = array();
|
165 |
+
$col_contents = array();
|
166 |
+
$col_heights = array();
|
167 |
+
$col_widths = array();
|
168 |
+
|
169 |
+
for ( $col = 0; $col < $count_cols; $col++ ) {
|
170 |
+
$col_headers[$col] = '';
|
171 |
+
$col_contents[$col] = '';
|
172 |
+
$col_heights[$col] = 0;
|
173 |
+
$col_widths[$col] = 100;
|
174 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
+
// Process the thumbnails
|
177 |
+
$col = '0';
|
178 |
+
if ( $thumbs ) foreach ( $thumbs as $tt ) {
|
179 |
+
$id = $tt['id'];
|
180 |
+
$counter_thumbs++;
|
181 |
+
if ( wppa_onpage( 'thumbs', $counter_thumbs, $relpage ) ) {
|
182 |
+
$col_contents[$col] .= wppa_get_thumb_masonry( $id );
|
183 |
+
$col_heights[$col] += ( $correction + wppa_get_thumby( $id ) ) / ( $correction + wppa_get_thumbx( $id ) ) * $col_widths[$col];
|
184 |
+
$col += '1';
|
185 |
+
if ( $col == $count_cols ) {
|
186 |
+
$col = '0';
|
187 |
+
}
|
188 |
+
$didsome = true;
|
189 |
}
|
|
|
190 |
}
|
|
|
191 |
|
192 |
+
// Find longest column
|
193 |
+
$long = 0;
|
194 |
+
for ( $col = 0; $col < $count_cols; $col++ ) {
|
195 |
+
if ( $col_heights[$col] > $long ) $long = $col_heights[$col];
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
}
|
|
|
197 |
|
198 |
+
// Adjust column widths to resize lengths to equal lengths
|
199 |
+
for ( $col = 0; $col < $count_cols; $col++ ) {
|
200 |
+
if ( $col_heights[$col] ) {
|
201 |
+
$col_widths[$col] = $long / $col_heights[$col] * $col_widths[$col];
|
202 |
+
}
|
203 |
+
}
|
|
|
|
|
204 |
|
205 |
+
// Adjust column widths to total 100
|
206 |
+
$wide = 0;
|
207 |
+
for ( $col = 0; $col < $count_cols; $col++ ) {
|
208 |
+
$wide += $col_widths[$col];
|
209 |
+
}
|
210 |
+
for ( $col = 0; $col < $count_cols; $col++ ) {
|
211 |
+
$col_widths[$col] = $col_widths[$col] * 100 / $wide;
|
212 |
+
}
|
213 |
|
214 |
+
// Make column headers
|
215 |
+
for ( $col = 0; $col < $count_cols; $col++ ) {
|
216 |
+
$col_headers[$col] = '<td style="width: '.$col_widths[$col].'%; vertical-align:top;" class="wppa-masonry" >';
|
217 |
+
}
|
|
|
|
|
218 |
|
219 |
+
// Add the columns to the output stream
|
220 |
+
for ( $col = 0; $col < $count_cols; $col++ ) {
|
221 |
+
wppa_out( $col_headers[$col] );
|
222 |
+
wppa_out( $col_contents[$col] );
|
223 |
+
wppa_out( '</td>' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
}
|
225 |
+
|
226 |
+
// Close the table
|
227 |
+
wppa_out( '</tr></tbody></table>' );
|
228 |
+
|
229 |
+
// The footer
|
230 |
+
wppa_album_name( 'bottom' ); // Optionally display album name
|
231 |
+
wppa_album_desc( 'bottom' ); // Optionally display album description
|
232 |
+
wppa_thumb_area( 'close' ); // Close Thumbarea sub-container
|
233 |
+
} // Masonry-v
|
234 |
+
|
235 |
+
// Masonry horizontal
|
236 |
+
elseif ( wppa_opt( 'thumbtype' ) == 'masonry-h' ) { // Masonry
|
237 |
+
|
238 |
+
// The header
|
239 |
+
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
240 |
+
wppa_popup(); // Prepare Popup box
|
241 |
+
wppa_album_name( 'top' ); // Optionally display album name
|
242 |
+
wppa_album_desc( 'top' ); // Optionally display album description
|
243 |
+
|
244 |
+
// Init
|
245 |
+
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
246 |
+
$cont_width = wppa_get_container_width( 'netto' );
|
247 |
+
$correction = wppa_opt( 'tn_margin' );
|
248 |
+
|
249 |
+
// Init the table
|
250 |
+
wppa_out( '<table class="wppa-masonry wppa-masonry-h" style="margin-top:3px;" ><tbody class="wppa-masonry" >' );
|
251 |
+
|
252 |
+
// Process the thumbnails
|
253 |
+
$row_content = '';
|
254 |
+
$row_width = 0;
|
255 |
+
$target_row_height = wppa_opt( $is_alt_thumbsize ? 'thumbsize_alt' : 'thumbsize' ) * 0.75 + $correction;
|
256 |
+
$rw_count = 0;
|
257 |
+
$tr_count = '1';
|
258 |
+
$done_count = 0;
|
259 |
+
$last = false;
|
260 |
+
$max_row_height = $target_row_height * 0.8; // Init keep track for last
|
261 |
+
if ( $thumbs ) foreach ( $thumbs as $tt ) {
|
262 |
+
$id = $tt['id'];
|
263 |
+
$counter_thumbs++;
|
264 |
+
if ( wppa_onpage( 'thumbs', $counter_thumbs, $relpage ) ) {
|
265 |
+
$row_content .= wppa_get_thumb_masonry( $tt['id'] );
|
266 |
+
$rw_count += 1;
|
267 |
+
$row_width += wppa_get_thumbratioxy( $id ) * ( $target_row_height - $correction );
|
268 |
+
$didsome = true;
|
269 |
}
|
270 |
+
$done_count += 1;
|
271 |
+
$last = $done_count == count( $thumbs );
|
272 |
+
if ( $row_width > $cont_width || $last ) {
|
273 |
+
$tot_marg = $rw_count * $correction;
|
274 |
+
$row_height = $row_width ? ( ( $target_row_height - $correction ) * ( $cont_width - $tot_marg ) / ( $row_width ) + $correction ) : '0';
|
275 |
+
if ( ! $last ) {
|
276 |
+
$max_row_height = max( $max_row_height, $row_height );
|
277 |
+
}
|
278 |
+
if ( $last && $row_height > wppa_get_thumby( $id ) ) {
|
279 |
+
$row_height = $max_row_height;
|
280 |
+
}
|
281 |
+
$row_height_p = $row_height / $cont_width * 100;
|
282 |
+
wppa_out( '<tr class="wppa-masonry" >' .
|
283 |
+
'<td style="border:none;padding:0;margin:0" >' .
|
284 |
+
'<div' .
|
285 |
+
' id="wppa-mas-h-'.$tr_count.'-'.wppa( 'mocc' ).'"' .
|
286 |
+
' style="height:'.$row_height.'px;"' .
|
287 |
+
' class="wppa-masonry"' .
|
288 |
+
' data-height-perc="'.$row_height_p.'"' .
|
289 |
+
' >');
|
290 |
+
wppa_out( $row_content );
|
291 |
+
wppa_out( '</div></td></tr>' );
|
292 |
+
$row_content = '';
|
293 |
+
$row_width = 0;
|
294 |
+
$row_height = wppa_opt( 'thumbsize' );
|
295 |
+
$rw_count = 0;
|
296 |
+
$tr_count += '1';
|
297 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
}
|
299 |
+
wppa_out( '</tbody></table>' );
|
300 |
+
|
301 |
+
// The footer
|
302 |
+
wppa_album_name( 'bottom' ); // Optionally display album name
|
303 |
+
wppa_album_desc( 'bottom' ); // Optionally display album description
|
304 |
+
wppa_out( '<script type="text/javascript" >' . // Fix bug in IE and Chrome
|
305 |
+
'wppaSetMasHorFrameWidthsForIeAndChrome(' . wppa( 'mocc' ) . ');' .
|
306 |
+
'</script>' );
|
307 |
+
wppa_thumb_area( 'close' ); // Close Thumbarea sub-container
|
308 |
+
|
309 |
+
} // Masonry-h
|
310 |
+
|
311 |
+
// Default
|
312 |
+
elseif ( wppa_opt( 'thumbtype' ) == 'default' ) { // Do the thumbs As default
|
313 |
+
|
314 |
+
// The header
|
315 |
+
wppa_thumb_area( 'open' ); // Open Thumbarea sub-container
|
316 |
+
wppa_popup(); // Prepare Popup box
|
317 |
+
wppa_album_name( 'top' ); // Optionally display album name
|
318 |
+
wppa_album_desc( 'top' ); // Optionally display album description
|
319 |
+
|
320 |
+
// Init
|
321 |
+
$relpage = wppa_switch( 'thumbs_first' ) ? $curpage : $curpage - $n_album_pages;
|
322 |
+
|
323 |
+
// Process the thumbnails
|
324 |
+
if ( $thumbs ) foreach ( $thumbs as $tt ) {
|
325 |
+
$counter_thumbs++;
|
326 |
+
if ( wppa_onpage( 'thumbs', $counter_thumbs, $relpage ) ) {
|
327 |
+
$didsome = true;
|
328 |
+
wppa_thumb_default( $tt['id'] ); // Show Thumb as default
|
329 |
+
} // End if on page
|
330 |
+
}
|
|
|
331 |
|
332 |
+
// The footer
|
333 |
+
wppa_album_name( 'bottom' ); // Optionally display album name
|
334 |
+
wppa_album_desc( 'bottom' ); // Optionally display album description
|
335 |
+
wppa_thumb_area( 'close' ); // Close Thumbarea sub-container
|
336 |
+
} // As default
|
337 |
|
338 |
+
// Unimplemented thumbnail type
|
339 |
+
else {
|
340 |
+
wppa_out( 'Unimplemented thumbnail type' );
|
341 |
+
}
|
342 |
+
} // If thumbs
|
343 |
+
|
344 |
+
if ( $didsome && wppa_is_pagination() ) $albums = false; // Pag on and didsome: force a pagebreak by faking no albums
|
345 |
+
if ( ! wppa_is_pagination() ) $n_thumb_pages = '0'; // Still on page one
|
346 |
+
|
347 |
+
// Process the albums
|
348 |
+
if ( wppa_switch( 'thumbs_first' ) ) {
|
349 |
+
if ( $albums ) {
|
350 |
+
$counter_albums = '0';
|
351 |
+
wppa_album_list( 'open' ); // Open Albums sub-container
|
352 |
+
foreach ( $albums as $album ) { // Loop the albums
|
353 |
+
$counter_albums++;
|
354 |
+
if ( wppa_onpage( 'albums', $counter_albums, $curpage - $n_thumb_pages ) ) {
|
355 |
+
wppa_album_cover( $album['id'] ); // Show the cover
|
356 |
+
$didsome = true;
|
357 |
+
} // End if on page
|
358 |
+
}
|
359 |
+
wppa_album_list( 'close' ); // Close Albums sub-container
|
360 |
+
} // If albums
|
361 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
362 |
|
363 |
+
// Make pagelinkbar if requested on bottom
|
364 |
+
if ( wppa_opt( 'pagelink_pos' ) == 'bottom' || wppa_opt( 'pagelink_pos' ) == 'both' ) {
|
365 |
+
wppa_page_links( $totpag, $curpage );
|
366 |
+
}
|
367 |
|
368 |
+
// Empty results?
|
369 |
+
if ( ! $didsome && ! $wanted_empty ) {
|
370 |
+
if ( wppa( 'photos_only' ) ) {
|
371 |
+
wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wp-photo-album-plus' ) ) );
|
372 |
+
}
|
373 |
+
elseif ( wppa( 'albums_only' ) ) {
|
374 |
+
wppa_out( wppa_errorbox( __( 'No albums found matching your search criteria.', 'wp-photo-album-plus' ) ) );
|
375 |
+
}
|
376 |
+
else {
|
377 |
+
wppa_out( wppa_errorbox( __( 'No albums or photos found matching your search criteria.', 'wp-photo-album-plus' ) ) );
|
378 |
+
}
|
379 |
}
|
380 |
+
} // wppa_page( 'albums' )
|
381 |
+
|
382 |
+
elseif ( wppa_page( 'slide' ) || wppa_page( 'single' ) ) { // Page 'Slideshow' or 'Single' in browsemode requested
|
383 |
+
$thumbs = wppa_get_thumbs();
|
384 |
+
wppa_dbg_msg( 'From theme: #thumbs='.( $thumbs ? count( $thumbs ) : '0' ) );
|
385 |
+
if ( $thumbs ) {
|
386 |
+
wppa_the_slideshow(); // Producs all the html required for the slideshow
|
387 |
+
wppa_run_slidecontainer( 'slideshow' ); // Fill in the photo array and display it.
|
388 |
}
|
389 |
else {
|
390 |
+
wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wppa_theme' , 'wp-photo-album-plus') ) );
|
391 |
}
|
392 |
+
} // wppa_page( 'slide' )
|
393 |
+
|
394 |
+
// Close container
|
395 |
+
wppa_container( 'close' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
|
397 |
+
} // Not delaed
|
|
|
398 |
}
|
399 |
|
400 |
function wppa_is_wanted_empty( $thumbs ) {
|
411 |
|
412 |
return true;
|
413 |
}
|
414 |
+
|
415 |
+
function wppa_get_extra_url() {
|
416 |
+
|
417 |
+
$extra_url = '';
|
418 |
+
|
419 |
+
// cover
|
420 |
+
if ( wppa_get_get( 'cover' ) ) $ic = wppa_get_get( 'cover' );
|
421 |
+
else {
|
422 |
+
if ( wppa( 'is_cover' ) == '1' ) $ic = '1'; else $ic = '0';
|
423 |
+
}
|
424 |
+
$extra_url .= 'wppa-cover='.$ic;
|
425 |
+
|
426 |
+
// occur
|
427 |
+
$occur = wppa_in_widget() ? wppa_get_get('woccur') : wppa_get_get('occur');
|
428 |
+
$ref_occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' );
|
429 |
+
|
430 |
+
// album
|
431 |
+
if ( ( $occur == $ref_occur || wppa( 'ajax' ) ) && wppa_get_get('album') ) {
|
432 |
+
$alb = wppa_get_get( 'album' );
|
433 |
+
}
|
434 |
+
elseif ( wppa( 'start_album' ) ) {
|
435 |
+
$alb = wppa( 'start_album' );
|
436 |
+
}
|
437 |
+
else {
|
438 |
+
$alb = '0';
|
439 |
+
}
|
440 |
+
$extra_url .= '&wppa-album='.$alb;
|
441 |
+
|
442 |
+
// slide or photo
|
443 |
+
if ( wppa( 'is_slide' ) ) {
|
444 |
+
$extra_url .= '&wppa-slide=1';
|
445 |
+
}
|
446 |
+
elseif ( wppa_get_get( 'photo' ) ) {
|
447 |
+
$extra_url .= '&wppa-photo=' . wppa_get_get( 'photo' );
|
448 |
+
}
|
449 |
+
|
450 |
+
// occur
|
451 |
+
if ( ! wppa( 'ajax' ) ) {
|
452 |
+
$occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' );
|
453 |
+
$w = wppa_in_widget() ? 'w' : '';
|
454 |
+
$extra_url .= '&wppa-' . $w . 'occur=' . $occur;
|
455 |
+
}
|
456 |
+
else {
|
457 |
+
if ( wppa_get_get( 'occur' ) ) {
|
458 |
+
$occur = wppa_get_get( 'occur' );
|
459 |
+
$extra_url .= '&wppa-occur=' . strval( intval( $occur ) );
|
460 |
+
}
|
461 |
+
elseif ( wppa_get_get( 'woccur' ) ) {
|
462 |
+
$occur = wppa_get_get( 'woccur' );
|
463 |
+
$extra_url .= '&wppa-woccur=' . strval( intval( $occur ) );
|
464 |
+
}
|
465 |
+
else {
|
466 |
+
$extra_url .= '&wppa-occur=' . wppa( 'occur' ); // Should never get here?
|
467 |
+
}
|
468 |
+
}
|
469 |
+
|
470 |
+
// Topten?
|
471 |
+
if ( wppa( 'is_topten' ) ) $extra_url .= '&wppa-topten='.wppa( 'topten_count' );
|
472 |
+
|
473 |
+
// Lasten?
|
474 |
+
if ( wppa( 'is_lasten' ) ) $extra_url .= '&wppa-lasten='.wppa( 'lasten_count' );
|
475 |
+
|
476 |
+
// Comten?
|
477 |
+
if ( wppa( 'is_comten' ) ) $extra_url .= '&wppa-comten='.wppa( 'comten_count' );
|
478 |
+
|
479 |
+
// Featen?
|
480 |
+
if ( wppa( 'is_featen' ) ) $extra_url .= '&wppa-featen='.wppa( 'featen_count' );
|
481 |
+
|
482 |
+
// Tag?
|
483 |
+
if ( wppa( 'is_tag' ) && ! wppa( 'is_related' ) ) $extra_url .= '&wppa-tag='.wppa( 'is_tag' );
|
484 |
+
|
485 |
+
// Search?
|
486 |
+
if ( wppa( 'src' ) && ! wppa( 'is_related' ) ) $extra_url .= '&wppa-searchstring='.urlencode( wppa( 'searchstring' ) );
|
487 |
+
|
488 |
+
// Supersearch?
|
489 |
+
if ( wppa( 'supersearch' ) ) $extra_url .= '&wppa-supersearch=' . str_replace( '/', '%2F', urlencode( wppa( 'supersearch' ) ) );
|
490 |
+
|
491 |
+
// Related
|
492 |
+
if ( wppa( 'is_related' ) ) $extra_url .= '&wppa-rel='.wppa( 'is_related' ).'&wppa-relcount='.wppa( 'related_count' );
|
493 |
+
|
494 |
+
// Uploader?
|
495 |
+
if ( wppa( 'is_upldr' ) ) $extra_url .= '&wppa-upldr='.wppa( 'is_upldr' );
|
496 |
+
|
497 |
+
// Calendar ?
|
498 |
+
if ( wppa( 'calendar' ) ) $extra_url .= '&wppa-calendar='.wppa( 'calendar' ).'&wppa-caldate='.wppa( 'caldate' );
|
499 |
+
|
500 |
+
// Photos only?
|
501 |
+
if ( wppa( 'photos_only' ) ) $extra_url .= '&wppa-photos-only=1';
|
502 |
+
|
503 |
+
// Albums only?
|
504 |
+
if ( wppa( 'albums_only' ) ) $extra_url .= '&wppa-albums-only=1';
|
505 |
+
|
506 |
+
// Inverse?
|
507 |
+
if ( wppa( 'is_inverse' ) ) $extra_url .= '&wppa-inv=1';
|
508 |
+
|
509 |
+
return $extra_url;
|
510 |
+
}
|
wppa-admin-functions.php
CHANGED
@@ -478,6 +478,7 @@ global $wpdb;
|
|
478 |
return false;
|
479 |
}
|
480 |
|
|
|
481 |
function wppa_sanitize_files() {
|
482 |
|
483 |
// Get this users depot directory
|
@@ -498,17 +499,10 @@ function _wppa_sanitze_files( $root ) {
|
|
498 |
$count = '0';
|
499 |
if ( $files ) foreach ( $files as $file ) {
|
500 |
|
501 |
-
// Make sure file ext is downcase, and name is sanitized
|
502 |
-
$dfile = wppa_down_ext( $file );
|
503 |
-
$dfile = dirname( $dfile ) . '/' . sanitize_file_name( basename( $dfile ) );
|
504 |
-
if ( $dfile != $file ) {
|
505 |
-
wppa_rename( $file, $dfile );
|
506 |
-
$file = $dfile;
|
507 |
-
}
|
508 |
-
|
509 |
if ( is_file( $file ) ) {
|
510 |
|
511 |
-
|
|
|
512 |
if ( ! in_array( $ext, $allowed_types ) ) {
|
513 |
if ( basename( $file ) != 'index.php' ) {
|
514 |
unlink( $file );
|
@@ -516,20 +510,6 @@ function _wppa_sanitze_files( $root ) {
|
|
516 |
}
|
517 |
$count++;
|
518 |
}
|
519 |
-
|
520 |
-
// Sanitize filename
|
521 |
-
$dirname = dirname( $file );
|
522 |
-
$filename = basename( $file );
|
523 |
-
|
524 |
-
// Can not use sanitize_file_name() because it removes spaces that are not illegal in most servers.
|
525 |
-
$filename = strip_tags( stripslashes( $filename ) ); //sanitize_text_field( $filename );
|
526 |
-
if ( ! seems_utf8( $filename ) ) {
|
527 |
-
$filename = utf8_encode( $filename );
|
528 |
-
}
|
529 |
-
$newname = $dirname . '/' . $filename;
|
530 |
-
if ( $newname != $file ) {
|
531 |
-
rename( $file, $newname );
|
532 |
-
}
|
533 |
}
|
534 |
elseif ( wppa_is_dir( $file ) ) {
|
535 |
$entry = basename( $file );
|
478 |
return false;
|
479 |
}
|
480 |
|
481 |
+
// Remove illegal files in WPPA_DEPOT_PATH
|
482 |
function wppa_sanitize_files() {
|
483 |
|
484 |
// Get this users depot directory
|
499 |
$count = '0';
|
500 |
if ( $files ) foreach ( $files as $file ) {
|
501 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
502 |
if ( is_file( $file ) ) {
|
503 |
|
504 |
+
// Check extension
|
505 |
+
$ext = strtolower( wppa_get_ext( $file ) );
|
506 |
if ( ! in_array( $ext, $allowed_types ) ) {
|
507 |
if ( basename( $file ) != 'index.php' ) {
|
508 |
unlink( $file );
|
510 |
}
|
511 |
$count++;
|
512 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
}
|
514 |
elseif ( wppa_is_dir( $file ) ) {
|
515 |
$entry = basename( $file );
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 7.1.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -13,11 +13,16 @@ if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
|
13 |
function wppa_thumb_area( $action ) {
|
14 |
|
15 |
// Init
|
16 |
-
$result
|
17 |
-
$mocc
|
18 |
-
$alt
|
19 |
-
$maxh
|
20 |
-
$nice
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
// Open thumbnail area box
|
23 |
if ( $action == 'open' ) {
|
@@ -41,7 +46,7 @@ function wppa_thumb_area( $action ) {
|
|
41 |
wppa_wcs( 'wppa-box' ) .
|
42 |
wppa_wcs( 'wppa-' . $alt ) .
|
43 |
( $maxh > '1' ? 'max-height:' . $maxh . 'px;' : '' ) .
|
44 |
-
|
45 |
'"' .
|
46 |
' onscroll="wppaMakeLazyVisible();" ' .
|
47 |
' >';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 7.1.06
|
7 |
*
|
8 |
*/
|
9 |
|
13 |
function wppa_thumb_area( $action ) {
|
14 |
|
15 |
// Init
|
16 |
+
$result = '';
|
17 |
+
$mocc = wppa( 'mocc' );
|
18 |
+
$alt = wppa( 'alt' );
|
19 |
+
$maxh = wppa_opt( 'area_size' );
|
20 |
+
$nice = wppa_switch( 'nicescroll' );
|
21 |
+
$overflow = 'visible';
|
22 |
+
if ( $maxh ) {
|
23 |
+
if ( $nice ) $overflow = 'hidden';
|
24 |
+
else $overflow = 'auto';
|
25 |
+
}
|
26 |
|
27 |
// Open thumbnail area box
|
28 |
if ( $action == 'open' ) {
|
46 |
wppa_wcs( 'wppa-box' ) .
|
47 |
wppa_wcs( 'wppa-' . $alt ) .
|
48 |
( $maxh > '1' ? 'max-height:' . $maxh . 'px;' : '' ) .
|
49 |
+
'overflow:' . $overflow . ';' .
|
50 |
'"' .
|
51 |
' onscroll="wppaMakeLazyVisible();" ' .
|
52 |
' >';
|
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 7.1.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -224,14 +224,15 @@ global $thumbs;
|
|
224 |
'unsanitized_filename' => '',
|
225 |
'fromp' => '',
|
226 |
'is_combinedsearch' => false,
|
|
|
227 |
|
228 |
);
|
229 |
}
|
230 |
|
231 |
function wppa_get_randseed( $type = '' ) {
|
232 |
global $wppa_session;
|
233 |
-
|
234 |
-
|
235 |
|
236 |
switch ( $type ) {
|
237 |
|
@@ -243,11 +244,16 @@ static $randseed_modified;
|
|
243 |
// This randseed is for one pageload only
|
244 |
case 'page':
|
245 |
|
|
|
|
|
|
|
246 |
// Not Been here before?
|
247 |
-
if ( ! $
|
248 |
-
|
|
|
|
|
249 |
}
|
250 |
-
$result = $
|
251 |
break;
|
252 |
|
253 |
// This randseed is new for each pagelad and all subsequent ajax calls.
|
@@ -273,34 +279,58 @@ static $randseed_modified;
|
|
273 |
$renew = true;
|
274 |
|
275 |
// The following conditions make we do not need to renew
|
276 |
-
if ( $
|
277 |
if ( wppa( 'ajax' ) ) $renew = false; // Not during ajax call
|
278 |
if ( strpos( $_SERVER['REQUEST_URI'], 'wp-content' ) !== false ) $renew = false; // Url to a content item needs no renew
|
279 |
if ( isset( $_REQUEST['wppa-page'] ) ) $renew = false; // A subsequent wppa page needs the same sequence
|
280 |
-
if ( isset( $wppa_session['randseedtime'] ) && $wppa_session['randseedtime'] > ( time() -
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
|
282 |
// Make new
|
283 |
if ( $renew ) {
|
284 |
-
|
285 |
-
$result = time() % 4721;
|
286 |
-
$wppa_session['randseed'] = $result;
|
287 |
-
$wppa_session['randseedtime'] = time();
|
288 |
-
|
289 |
-
// Indicaate we found a new randseed during this pageload
|
290 |
-
$randseed_modified = true;
|
291 |
-
|
292 |
-
// Make sure we save it
|
293 |
-
wppa_save_session();
|
294 |
}
|
295 |
}
|
296 |
|
297 |
// Log
|
298 |
-
|
|
|
|
|
|
|
|
|
299 |
|
300 |
// Return the randseed
|
301 |
return $result;
|
302 |
}
|
303 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
// get the url to the plugins image directory
|
305 |
function wppa_get_imgdir( $file = '', $rel = false ) {
|
306 |
|
@@ -1969,28 +1999,16 @@ global $wpdb;
|
|
1969 |
// Add script to the page specific temp js file, stripped from <script> tags.
|
1970 |
// If admin or no file (i.e. no defer js) return untouched
|
1971 |
function wppa_js( $txt ) {
|
1972 |
-
global $
|
1973 |
global $wppa;
|
1974 |
|
1975 |
-
if (
|
1976 |
-
return $txt;
|
1977 |
-
}
|
1978 |
-
|
1979 |
-
if ( $wppa_js_page_data_file && ! $wppa['ajax'] ) {
|
1980 |
-
$handle = wppa_fopen( $wppa_js_page_data_file, 'ab' );
|
1981 |
-
}
|
1982 |
-
else {
|
1983 |
-
$handle = false;
|
1984 |
-
}
|
1985 |
-
|
1986 |
-
if ( $handle ) {
|
1987 |
$txt = str_replace( '<script type="text/javascript" >', '', $txt );
|
1988 |
$txt = str_replace( '<script>', '', $txt );
|
1989 |
$txt = str_replace( '</script>', '', $txt );
|
1990 |
$txt = str_replace( "\t", '', $txt );
|
1991 |
$txt = trim( $txt );
|
1992 |
-
|
1993 |
-
fclose( $handle );
|
1994 |
return '';
|
1995 |
}
|
1996 |
else {
|
2 |
/* wppa-common-functions.php
|
3 |
*
|
4 |
* Functions used in admin and in themes
|
5 |
+
* Version 7.1.06
|
6 |
*
|
7 |
*/
|
8 |
|
224 |
'unsanitized_filename' => '',
|
225 |
'fromp' => '',
|
226 |
'is_combinedsearch' => false,
|
227 |
+
'delay' => false,
|
228 |
|
229 |
);
|
230 |
}
|
231 |
|
232 |
function wppa_get_randseed( $type = '' ) {
|
233 |
global $wppa_session;
|
234 |
+
global $wppa_volitile_randseed;
|
235 |
+
global $wppa_randseed_modified;
|
236 |
|
237 |
switch ( $type ) {
|
238 |
|
244 |
// This randseed is for one pageload only
|
245 |
case 'page':
|
246 |
|
247 |
+
// Reset the default randseed
|
248 |
+
wppa_renew_randseed();
|
249 |
+
|
250 |
// Not Been here before?
|
251 |
+
if ( ! $wppa_volitile_randseed ) {
|
252 |
+
|
253 |
+
// Make new pageload specific rsandseed
|
254 |
+
$wppa_volitile_randseed = time() % 7487;
|
255 |
}
|
256 |
+
$result = $wppa_volitile_randseed;
|
257 |
break;
|
258 |
|
259 |
// This randseed is new for each pagelad and all subsequent ajax calls.
|
279 |
$renew = true;
|
280 |
|
281 |
// The following conditions make we do not need to renew
|
282 |
+
if ( $wppa_randseed_modified ) $renew = false; // Already renewed this pageload
|
283 |
if ( wppa( 'ajax' ) ) $renew = false; // Not during ajax call
|
284 |
if ( strpos( $_SERVER['REQUEST_URI'], 'wp-content' ) !== false ) $renew = false; // Url to a content item needs no renew
|
285 |
if ( isset( $_REQUEST['wppa-page'] ) ) $renew = false; // A subsequent wppa page needs the same sequence
|
286 |
+
if ( isset( $wppa_session['randseedtime'] ) && $wppa_session['randseedtime'] > ( time() - 10 ) ) $renew = false; // Not within 10 seconds
|
287 |
+
|
288 |
+
// Still renew if the current wp page differs from the last
|
289 |
+
$wp_page = isset( $_REQUEST['wppa-fromp'] ) ? $_REQUEST['wppa-fromp'] : get_the_ID();
|
290 |
+
if ( isset( $wppa_session['randpage'] ) && $wp_page && $wp_page != $wppa_session['randpage'] ) {
|
291 |
+
$renew = true;
|
292 |
+
}
|
293 |
|
294 |
// Make new
|
295 |
if ( $renew ) {
|
296 |
+
$result = wppa_renew_randseed();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
}
|
298 |
}
|
299 |
|
300 |
// Log
|
301 |
+
if($type=='')
|
302 |
+
wppa_log( 'obs', 'wppa_get_randseed returned {b}' . $result . '{/b}, ' .
|
303 |
+
'type= {b}' . ( $type ? $type : 'default' ) . '{/b}, ' .
|
304 |
+
'wp-page= {b}' . ( isset( $wppa_session['randpage'] ) ? $wppa_session['randpage'] : 'unknown' ) . '{/b}, ' .
|
305 |
+
'uri= ' . $_SERVER['REQUEST_URI'] );
|
306 |
|
307 |
// Return the randseed
|
308 |
return $result;
|
309 |
}
|
310 |
|
311 |
+
function wppa_renew_randseed() {
|
312 |
+
global $wppa_session;
|
313 |
+
global $wppa_volitile_randseed;
|
314 |
+
global $wppa_randseed_modified;
|
315 |
+
|
316 |
+
// Make new saved randseed
|
317 |
+
$result = time() % 4721;
|
318 |
+
$wppa_session['randseed'] = $result;
|
319 |
+
$wppa_session['randseedtime'] = time();
|
320 |
+
$p = isset( $_REQUEST['wppa-fromp'] ) ? $_REQUEST['wppa-fromp'] : get_the_ID();
|
321 |
+
if ( $p ) {
|
322 |
+
$wppa_session['randpage'] = $p;
|
323 |
+
}
|
324 |
+
|
325 |
+
// Indicaate we found a new randseed during this pageload
|
326 |
+
$wppa_randseed_modified = true;
|
327 |
+
|
328 |
+
// Make sure we save it
|
329 |
+
wppa_save_session();
|
330 |
+
|
331 |
+
return $result;
|
332 |
+
}
|
333 |
+
|
334 |
// get the url to the plugins image directory
|
335 |
function wppa_get_imgdir( $file = '', $rel = false ) {
|
336 |
|
1999 |
// Add script to the page specific temp js file, stripped from <script> tags.
|
2000 |
// If admin or no file (i.e. no defer js) return untouched
|
2001 |
function wppa_js( $txt ) {
|
2002 |
+
global $wppa_js_page_data;
|
2003 |
global $wppa;
|
2004 |
|
2005 |
+
if ( wppa_js_in_footer() ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006 |
$txt = str_replace( '<script type="text/javascript" >', '', $txt );
|
2007 |
$txt = str_replace( '<script>', '', $txt );
|
2008 |
$txt = str_replace( '</script>', '', $txt );
|
2009 |
$txt = str_replace( "\t", '', $txt );
|
2010 |
$txt = trim( $txt );
|
2011 |
+
$wppa_js_page_data .= $txt;
|
|
|
2012 |
return '';
|
2013 |
}
|
2014 |
else {
|
wppa-dashboard-widgets.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Contains dashboard widgets code
|
6 |
*
|
7 |
-
* Version 7.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -274,17 +274,39 @@ global $wpdb;
|
|
274 |
echo
|
275 |
'<table>';
|
276 |
foreach( $photos as $photo ) {
|
|
|
277 |
if ( wppa_user_is( 'administrator' ) ) {
|
278 |
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
279 |
}
|
280 |
else {
|
281 |
-
$href = wppa_get_photo_url( $
|
282 |
}
|
283 |
echo
|
284 |
'<tr>' .
|
285 |
'<td>' .
|
286 |
-
'<a href="' . esc_url( $href ) . '" target="_blank" >'
|
287 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
'</a>' .
|
289 |
'</td>' .
|
290 |
'<td>';
|
4 |
*
|
5 |
* Contains dashboard widgets code
|
6 |
*
|
7 |
+
* Version 7.1.06
|
8 |
*
|
9 |
*/
|
10 |
|
274 |
echo
|
275 |
'<table>';
|
276 |
foreach( $photos as $photo ) {
|
277 |
+
$id = $photo['id'];
|
278 |
if ( wppa_user_is( 'administrator' ) ) {
|
279 |
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
280 |
}
|
281 |
else {
|
282 |
+
$href = wppa_get_photo_url( $id );
|
283 |
}
|
284 |
echo
|
285 |
'<tr>' .
|
286 |
'<td>' .
|
287 |
+
'<a href="' . esc_url( $href ) . '" target="_blank" >';
|
288 |
+
|
289 |
+
if ( wppa_is_video( $id ) ) {
|
290 |
+
echo
|
291 |
+
'<div style="position:relative;" >';
|
292 |
+
echo wppa_get_video_html( array( 'id' => $id,
|
293 |
+
'width' => '50',
|
294 |
+
'controls' => false,
|
295 |
+
'preload' => 'metadata',
|
296 |
+
'use_thumb' => true,
|
297 |
+
'autoplay' => false
|
298 |
+
) );
|
299 |
+
$url = WPPA_UPLOAD_URL . '/icons/' . wppa_opt( 'video_icon' );
|
300 |
+
echo
|
301 |
+
'<img src="' . esc_url( $url ) . '" style="width:16px;height:16px;position:absolute;right:0;bottom:0;z-index:100;" />' .
|
302 |
+
'</div>';
|
303 |
+
}
|
304 |
+
else {
|
305 |
+
echo
|
306 |
+
'<img src="' . esc_url( wppa_get_thumb_url( $id ) ) . '" style="max-width:50px;max-height:50px;" /> ';
|
307 |
+
}
|
308 |
+
|
309 |
+
echo
|
310 |
'</a>' .
|
311 |
'</td>' .
|
312 |
'<td>';
|
wppa-filter.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
-
* Version 7.1.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -125,6 +125,7 @@ global $wppa_revno;
|
|
125 |
'alt' => '',
|
126 |
'timeout' => '',
|
127 |
'button' => '',
|
|
|
128 |
), $xatts );
|
129 |
|
130 |
// Sanitize input
|
@@ -393,6 +394,9 @@ global $wppa_revno;
|
|
393 |
// Find align
|
394 |
$wppa['align'] = $atts['align'];
|
395 |
|
|
|
|
|
|
|
396 |
// Ready to render ???
|
397 |
$do_it = false;
|
398 |
if ( wppa( 'rendering_enabled' ) ) $do_it = true; // NOT in a head section (in a meta tag or so)
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
+
* Version 7.1.06
|
7 |
*
|
8 |
*/
|
9 |
|
125 |
'alt' => '',
|
126 |
'timeout' => '',
|
127 |
'button' => '',
|
128 |
+
'delay' => '',
|
129 |
), $xatts );
|
130 |
|
131 |
// Sanitize input
|
394 |
// Find align
|
395 |
$wppa['align'] = $atts['align'];
|
396 |
|
397 |
+
// Delay
|
398 |
+
$wppa['delay'] = $atts['delay'] == 'yes';
|
399 |
+
|
400 |
// Ready to render ???
|
401 |
$do_it = false;
|
402 |
if ( wppa( 'rendering_enabled' ) ) $do_it = true; // NOT in a head section (in a meta tag or so)
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
-
* Version 7.1.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -696,7 +696,11 @@ global $wppa_session;
|
|
696 |
}
|
697 |
|
698 |
// Subsearch or rootsearch?
|
699 |
-
if ( wppa( 'occur' ) == wppa_opt( 'search_oc' ) &&
|
|
|
|
|
|
|
|
|
700 |
|
701 |
// Is it a search now?
|
702 |
if ( wppa( 'src' ) ) {
|
@@ -827,7 +831,7 @@ global $wppa_session;
|
|
827 |
}
|
828 |
else wppa_out( '<span style="color:red">ERROR: Missing function wppa_theme(), check the installation of WPPA+. Remove customized wppa_theme.php</span>' );
|
829 |
global $wppa_version;
|
830 |
-
$expected_version = '
|
831 |
if ( $wppa_version != $expected_version ) {
|
832 |
wppa_dbg_msg( 'WARNING: customized wppa-theme.php is out of rev. Expected version: ' . $expected_version . ' found: ' . $wppa_version, 'red' );
|
833 |
}
|
@@ -3236,6 +3240,7 @@ global $blog_id;
|
|
3236 |
wppa_out( wppa_js( "\n" . 'wppaAutoColumnFrac['.wppa( 'mocc' ).'] = 1.0;' ) );
|
3237 |
}
|
3238 |
wppa_out( wppa_js( "\n" . 'wppaColWidth['.wppa( 'mocc' ).'] = 0;' ) );
|
|
|
3239 |
}
|
3240 |
else {
|
3241 |
wppa_out( wppa_js( "\n" . 'wppaAutoColumnWidth['.wppa( 'mocc' ).'] = false;' ) );
|
@@ -3410,8 +3415,13 @@ function wppa_album_list( $action ) {
|
|
3410 |
global $cover_count;
|
3411 |
global $cover_count_key;
|
3412 |
|
3413 |
-
$nice
|
3414 |
-
$maxh
|
|
|
|
|
|
|
|
|
|
|
3415 |
|
3416 |
if ( $action == 'open' ) {
|
3417 |
|
@@ -3420,9 +3430,9 @@ global $cover_count_key;
|
|
3420 |
wppa_out( '
|
3421 |
<div
|
3422 |
id="wppa-albumlist-' . wppa( 'mocc' ) . '"
|
3423 |
-
style=' .
|
3424 |
( $maxh > '1' ? 'max-height:' . $maxh . 'px;' : '' ) .
|
3425 |
-
|
3426 |
'"' . '
|
3427 |
class="albumlist"
|
3428 |
onscroll="wppaMakeLazyVisible();"
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
+
* Version 7.1.06
|
7 |
*
|
8 |
*/
|
9 |
|
696 |
}
|
697 |
|
698 |
// Subsearch or rootsearch?
|
699 |
+
if ( wppa( 'occur' ) == wppa_opt( 'search_oc' ) &&
|
700 |
+
! wppa( 'in_widget' ) &&
|
701 |
+
( ( isset( $wppa_session['has_searchbox'] ) && $wppa_session['has_searchbox'] ) ||
|
702 |
+
isset( $_REQUEST['wppa-forceroot'] )
|
703 |
+
) ) {
|
704 |
|
705 |
// Is it a search now?
|
706 |
if ( wppa( 'src' ) ) {
|
831 |
}
|
832 |
else wppa_out( '<span style="color:red">ERROR: Missing function wppa_theme(), check the installation of WPPA+. Remove customized wppa_theme.php</span>' );
|
833 |
global $wppa_version;
|
834 |
+
$expected_version = '7.1.06.001';
|
835 |
if ( $wppa_version != $expected_version ) {
|
836 |
wppa_dbg_msg( 'WARNING: customized wppa-theme.php is out of rev. Expected version: ' . $expected_version . ' found: ' . $wppa_version, 'red' );
|
837 |
}
|
3240 |
wppa_out( wppa_js( "\n" . 'wppaAutoColumnFrac['.wppa( 'mocc' ).'] = 1.0;' ) );
|
3241 |
}
|
3242 |
wppa_out( wppa_js( "\n" . 'wppaColWidth['.wppa( 'mocc' ).'] = 0;' ) );
|
3243 |
+
wppa_out( wppa_js( "\n" . 'wppaMCRWidth['.wppa( 'mocc' ).'] = 0;' ) );
|
3244 |
}
|
3245 |
else {
|
3246 |
wppa_out( wppa_js( "\n" . 'wppaAutoColumnWidth['.wppa( 'mocc' ).'] = false;' ) );
|
3415 |
global $cover_count;
|
3416 |
global $cover_count_key;
|
3417 |
|
3418 |
+
$nice = wppa_switch( 'nicescroll' );
|
3419 |
+
$maxh = wppa_opt( 'area_size' );
|
3420 |
+
$overflow = 'visible';
|
3421 |
+
if ( $maxh ) {
|
3422 |
+
if ( $nice ) $overflow = 'hidden';
|
3423 |
+
else $overflow = 'auto';
|
3424 |
+
}
|
3425 |
|
3426 |
if ( $action == 'open' ) {
|
3427 |
|
3430 |
wppa_out( '
|
3431 |
<div
|
3432 |
id="wppa-albumlist-' . wppa( 'mocc' ) . '"
|
3433 |
+
style="' .
|
3434 |
( $maxh > '1' ? 'max-height:' . $maxh . 'px;' : '' ) .
|
3435 |
+
'overflow:' . $overflow . ';' .
|
3436 |
'"' . '
|
3437 |
class="albumlist"
|
3438 |
onscroll="wppaMakeLazyVisible();"
|
wppa-maintenance.php
CHANGED
@@ -205,7 +205,7 @@ global $wppa_endtime;
|
|
205 |
break;
|
206 |
case 'wppa_cleanup':
|
207 |
$orphan_album = get_option( 'wppa_orphan_album', '0' );
|
208 |
-
$album_exists = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM$wpdb->wppa_albums WHERE id = %s", $orphan_album ) );
|
209 |
if ( ! $album_exists ) $orphan_album = false;
|
210 |
if ( ! $orphan_album ) {
|
211 |
$orphan_album = wppa_create_album_entry( array( 'name' => __('Orphan photos', 'wp-photo-album-plus'), 'a_parent' => '-1', 'description' => __('This album contains refound lost photos', 'wp-photo-album-plus') ) );
|
205 |
break;
|
206 |
case 'wppa_cleanup':
|
207 |
$orphan_album = get_option( 'wppa_orphan_album', '0' );
|
208 |
+
$album_exists = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_albums WHERE id = %s", $orphan_album ) );
|
209 |
if ( ! $album_exists ) $orphan_album = false;
|
210 |
if ( ! $orphan_album ) {
|
211 |
$orphan_album = wppa_create_album_entry( array( 'name' => __('Orphan photos', 'wp-photo-album-plus'), 'a_parent' => '-1', 'description' => __('This album contains refound lost photos', 'wp-photo-album-plus') ) );
|
wppa-non-admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
-
* Version 7.1.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -273,54 +273,35 @@ echo '
|
|
273 |
}
|
274 |
|
275 |
/* LOAD JAVASCRIPT */
|
276 |
-
add_action( 'init', 'wppa_add_javascript'
|
277 |
function wppa_add_javascript() {
|
278 |
-
global $wppa_js_page_data_file;
|
279 |
|
280 |
-
$in_footer =
|
281 |
-
if ( wppa( 'ajax' ) || wppa( 'cron' ) ) {
|
282 |
-
$in_footer = false;
|
283 |
-
}
|
284 |
-
|
285 |
-
if ( $in_footer ) {
|
286 |
-
|
287 |
-
// If the user wants the js in the footer, try to open a tempfile to collect the js data during processing the page
|
288 |
-
// If opening a tempfile fails, revert to js in the header.
|
289 |
-
$wppa_js_page_data_file = WPPA_UPLOAD_PATH . '/temp/wppa.' . wppa_get_unique_crypt() . '.js';
|
290 |
-
|
291 |
-
$tempdir = WPPA_UPLOAD_PATH.'/temp';
|
292 |
-
if ( ! wppa_is_dir( $tempdir ) ) @ wppa_mktree( $tempdir );
|
293 |
-
|
294 |
-
$handle = wppa_fopen( $wppa_js_page_data_file, 'wb' );
|
295 |
|
296 |
-
|
297 |
-
fwrite( $handle, '/* WPPA+ Generated Page dependant javascript */'."\n" );
|
298 |
-
fclose( $handle );
|
299 |
-
}
|
300 |
-
else {
|
301 |
-
$wppa_js_page_data_file = '';
|
302 |
-
$in_footer = false;
|
303 |
-
}
|
304 |
-
}
|
305 |
-
|
306 |
-
// If still in footer...
|
307 |
if ( $in_footer ) {
|
308 |
add_action( 'wp_footer', 'wppa_add_javascripts' );
|
309 |
}
|
310 |
else {
|
311 |
add_action( 'wp_enqueue_scripts', 'wppa_add_javascripts' );
|
312 |
-
$wppa_js_page_data_file = '';
|
313 |
}
|
314 |
}
|
315 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
// This function does the actual js enqueueing
|
317 |
function wppa_add_javascripts() {
|
318 |
global $wppa_api_version;
|
319 |
global $wppa_lang;
|
320 |
-
global $wppa_js_page_data_file;
|
321 |
global $wppa_opt;
|
322 |
|
323 |
-
$footer =
|
324 |
|
325 |
// If in footer and no wppa on the page found? Quit
|
326 |
if ( $footer && ! wppa( 'mocc' ) && ! wppa_switch( 'load_nicescroller' ) ) {
|
@@ -346,7 +327,6 @@ global $wppa_opt;
|
|
346 |
'wppa-popup',
|
347 |
'wppa-touch',
|
348 |
'wppa-utils',
|
349 |
-
// 'jquery.nicescroll',
|
350 |
);
|
351 |
|
352 |
$js_dept1 = array( 'jquery', 'jquery-form', 'wppa-utils' );
|
@@ -361,7 +341,6 @@ global $wppa_opt;
|
|
361 |
array( 'jquery' ),
|
362 |
array( 'jquery' ),
|
363 |
array( 'jquery' ),
|
364 |
-
// array( 'jquery' ),
|
365 |
);
|
366 |
|
367 |
$js_doits = array ( true,
|
@@ -371,7 +350,6 @@ global $wppa_opt;
|
|
371 |
true,
|
372 |
wppa_switch( 'slide_swipe' ) || $any_lightbox,
|
373 |
true,
|
374 |
-
// wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ),
|
375 |
);
|
376 |
|
377 |
$js_footer = array ( $footer,
|
@@ -381,7 +359,6 @@ global $wppa_opt;
|
|
381 |
$footer,
|
382 |
$footer,
|
383 |
$footer,
|
384 |
-
// $footer,
|
385 |
);
|
386 |
|
387 |
foreach ( array_keys( $js_files ) as $idx ) {
|
@@ -458,9 +435,21 @@ global $wppa_opt;
|
|
458 |
wp_enqueue_script( 'wppa-init', WPPA_URL.'/dynamic/wppa-init.'.$wppa_lang.'.js', array( 'wppa' ), get_option( 'wppa_ini_js_version_'.$wppa_lang, $footer ) );
|
459 |
}
|
460 |
|
461 |
-
// wppa
|
462 |
if ( $footer ) {
|
463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
}
|
465 |
}
|
466 |
|
@@ -487,7 +476,6 @@ add_action('wp_footer', 'wppa_load_footer');
|
|
487 |
function wppa_load_footer() {
|
488 |
global $wpdb;
|
489 |
global $wppa_session;
|
490 |
-
global $wppa_js_page_data_file;
|
491 |
|
492 |
// If no wppa on the page, quit
|
493 |
if ( ! wppa( 'mocc' ) && ! wppa_switch( 'lightbox_global' ) ) {
|
@@ -783,7 +771,7 @@ function wppa_redirect() {
|
|
783 |
add_action( 'wp_head', 'wppa_add_page_specific_urls', '99' );
|
784 |
|
785 |
function wppa_add_page_specific_urls() {
|
786 |
-
global $
|
787 |
|
788 |
$result = '
|
789 |
wppaImageDirectory = "' . wppa_get_imgdir() . '";
|
@@ -795,25 +783,23 @@ wppaIsIe = ' . ( wppa_is_ie() ? 'true' : 'false' ) . ';
|
|
795 |
wppaIsSafari = ' . ( wppa_is_safari() ? 'true' : 'false' ) . ';
|
796 |
wppaUseSvg = ' . ( wppa_use_svg() ? 'true' : 'false' ) . ';
|
797 |
wppaSlideshowNavigationType = "' . wppa_get_navigation_type() . '";
|
798 |
-
wppaAudioHeight = '.wppa_get_audio_control_height().';
|
|
|
799 |
|
800 |
// Relative urls?
|
801 |
$result = wppa_make_relative( $result );
|
802 |
|
803 |
-
if (
|
804 |
-
$
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
}
|
809 |
}
|
810 |
else {
|
811 |
echo '
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
</script>
|
816 |
-
<!-- WPPA+ END Page specific urls -->';
|
817 |
}
|
818 |
}
|
819 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
+
* Version 7.1.06
|
7 |
*
|
8 |
*/
|
9 |
|
273 |
}
|
274 |
|
275 |
/* LOAD JAVASCRIPT */
|
276 |
+
add_action( 'init', 'wppa_add_javascript' );
|
277 |
function wppa_add_javascript() {
|
|
|
278 |
|
279 |
+
$in_footer = wppa_js_in_footer();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
|
281 |
+
// If in footer...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
if ( $in_footer ) {
|
283 |
add_action( 'wp_footer', 'wppa_add_javascripts' );
|
284 |
}
|
285 |
else {
|
286 |
add_action( 'wp_enqueue_scripts', 'wppa_add_javascripts' );
|
|
|
287 |
}
|
288 |
}
|
289 |
|
290 |
+
// Decide if we want js in the footer
|
291 |
+
function wppa_js_in_footer() {
|
292 |
+
|
293 |
+
$result = wppa_switch( 'defer_javascript' ) && ! wppa( 'ajax' ) && ! is_admin() && ! wppa( 'cron' );
|
294 |
+
|
295 |
+
return $result;
|
296 |
+
}
|
297 |
+
|
298 |
// This function does the actual js enqueueing
|
299 |
function wppa_add_javascripts() {
|
300 |
global $wppa_api_version;
|
301 |
global $wppa_lang;
|
|
|
302 |
global $wppa_opt;
|
303 |
|
304 |
+
$footer = wppa_js_in_footer();
|
305 |
|
306 |
// If in footer and no wppa on the page found? Quit
|
307 |
if ( $footer && ! wppa( 'mocc' ) && ! wppa_switch( 'load_nicescroller' ) ) {
|
327 |
'wppa-popup',
|
328 |
'wppa-touch',
|
329 |
'wppa-utils',
|
|
|
330 |
);
|
331 |
|
332 |
$js_dept1 = array( 'jquery', 'jquery-form', 'wppa-utils' );
|
341 |
array( 'jquery' ),
|
342 |
array( 'jquery' ),
|
343 |
array( 'jquery' ),
|
|
|
344 |
);
|
345 |
|
346 |
$js_doits = array ( true,
|
350 |
true,
|
351 |
wppa_switch( 'slide_swipe' ) || $any_lightbox,
|
352 |
true,
|
|
|
353 |
);
|
354 |
|
355 |
$js_footer = array ( $footer,
|
359 |
$footer,
|
360 |
$footer,
|
361 |
$footer,
|
|
|
362 |
);
|
363 |
|
364 |
foreach ( array_keys( $js_files ) as $idx ) {
|
435 |
wp_enqueue_script( 'wppa-init', WPPA_URL.'/dynamic/wppa-init.'.$wppa_lang.'.js', array( 'wppa' ), get_option( 'wppa_ini_js_version_'.$wppa_lang, $footer ) );
|
436 |
}
|
437 |
|
438 |
+
// wppa-pagedata
|
439 |
if ( $footer ) {
|
440 |
+
add_action( 'wp_footer', 'wppa_print_psjs', 99 );
|
441 |
+
}
|
442 |
+
}
|
443 |
+
|
444 |
+
function wppa_print_psjs() {
|
445 |
+
global $wppa_js_page_data;
|
446 |
+
|
447 |
+
if ( $wppa_js_page_data ) {
|
448 |
+
echo
|
449 |
+
"\n<!-- wppa page data -->" .
|
450 |
+
"\n<script>\n" .
|
451 |
+
$wppa_js_page_data .
|
452 |
+
"\n</script>\n";
|
453 |
}
|
454 |
}
|
455 |
|
476 |
function wppa_load_footer() {
|
477 |
global $wpdb;
|
478 |
global $wppa_session;
|
|
|
479 |
|
480 |
// If no wppa on the page, quit
|
481 |
if ( ! wppa( 'mocc' ) && ! wppa_switch( 'lightbox_global' ) ) {
|
771 |
add_action( 'wp_head', 'wppa_add_page_specific_urls', '99' );
|
772 |
|
773 |
function wppa_add_page_specific_urls() {
|
774 |
+
global $wppa_js_page_data;
|
775 |
|
776 |
$result = '
|
777 |
wppaImageDirectory = "' . wppa_get_imgdir() . '";
|
783 |
wppaIsSafari = ' . ( wppa_is_safari() ? 'true' : 'false' ) . ';
|
784 |
wppaUseSvg = ' . ( wppa_use_svg() ? 'true' : 'false' ) . ';
|
785 |
wppaSlideshowNavigationType = "' . wppa_get_navigation_type() . '";
|
786 |
+
wppaAudioHeight = '.wppa_get_audio_control_height().';
|
787 |
+
';
|
788 |
|
789 |
// Relative urls?
|
790 |
$result = wppa_make_relative( $result );
|
791 |
|
792 |
+
if ( wppa_js_in_footer() ) {
|
793 |
+
$wppa_js_page_data .=
|
794 |
+
"\n/* START Page specific urls and browser dependant data */" .
|
795 |
+
$result .
|
796 |
+
"\n/* END Page specific urls and browser dependant data */\n";
|
|
|
797 |
}
|
798 |
else {
|
799 |
echo '
|
800 |
+
<!-- WPPA+ START Page specific urls and browser dependant data -->
|
801 |
+
<script type="text/javascript" >' . $result . '</script>
|
802 |
+
<!-- WPPA+ END Page specific urls -->';
|
|
|
|
|
803 |
}
|
804 |
}
|
805 |
|
wppa-session.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
-
* Version 7.
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
@@ -166,6 +166,9 @@ global $wppa_session;
|
|
166 |
}
|
167 |
}
|
168 |
|
|
|
|
|
|
|
169 |
wppa_save_session();
|
170 |
|
171 |
return true;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
+
* Version 7.1.06
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
166 |
}
|
167 |
}
|
168 |
|
169 |
+
// Reset default randseed conditionally (if wp page id changed)
|
170 |
+
wppa_get_randseed();
|
171 |
+
|
172 |
wppa_save_session();
|
173 |
|
174 |
return true;
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 7.1.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -172,7 +172,7 @@ global $wppa_supported_camara_brands;
|
|
172 |
break;
|
173 |
|
174 |
case 'wppa_audiostub_upload':
|
175 |
-
if ( isset( $_FILES['file_3'] ) ) {
|
176 |
$file = $_FILES['file_3'];
|
177 |
if ( $file['error'] ) {
|
178 |
wppa_error_message(sprintf(__('Upload error %s', 'wp-photo-album-plus'), $file['error']));
|
@@ -206,7 +206,7 @@ global $wppa_supported_camara_brands;
|
|
206 |
break;
|
207 |
|
208 |
case 'wppa_documentstub_upload':
|
209 |
-
if ( isset( $_FILES['file_4'] ) ) {
|
210 |
$file = $_FILES['file_4'];
|
211 |
if ( $file['error'] ) {
|
212 |
wppa_error_message(sprintf(__('Upload error %s', 'wp-photo-album-plus'), $file['error']));
|
@@ -240,7 +240,7 @@ global $wppa_supported_camara_brands;
|
|
240 |
break;
|
241 |
|
242 |
case 'wppa_multimedia_icon_upload':
|
243 |
-
if ( isset( $_FILES['file_5'] ) ) {
|
244 |
$file = $_FILES['file_5'];
|
245 |
if ( $file['error'] ) {
|
246 |
wppa_error_message(sprintf(__('Upload error %s', 'wp-photo-album-plus'), $file['error']));
|
@@ -299,6 +299,9 @@ global $wppa_supported_camara_brands;
|
|
299 |
}
|
300 |
break;
|
301 |
|
|
|
|
|
|
|
302 |
default: wppa_error_message( 'Unimplemnted action key: ' . htmlentities( $key ) );
|
303 |
}
|
304 |
|
@@ -501,6 +504,9 @@ global $wppa_supported_camara_brands;
|
|
501 |
<form enctype="multipart/form-data" action="<?php echo(wppa_dbg_url(get_admin_url().'admin.php?page=wppa_options')) ?>" method="post">
|
502 |
|
503 |
<?php wp_nonce_field('wppa-nonce', 'wppa-nonce'); ?>
|
|
|
|
|
|
|
504 |
<input type="hidden" name="wppa-key" id="wppa-key" value="" />
|
505 |
<input type="hidden" name="wppa-sub" id="wppa-sub" value="" />
|
506 |
<?php if ( get_option('wppa_i_done') == 'done' ) { ?>
|
@@ -8609,8 +8615,8 @@ global $wppa_supported_camara_brands;
|
|
8609 |
$desc = __('Number of extra resize handler actions', 'wp-photo-album-plus');
|
8610 |
$help = '';
|
8611 |
$slug = 'wppa_extended_resize_count';
|
8612 |
-
$opts = array('0','1','2','3','4','5','6','10','15','20');
|
8613 |
-
$vals =
|
8614 |
$html = wppa_select($slug, $opts, $vals).' '.__('times', 'wp-photo-album-plus');
|
8615 |
$clas = '';
|
8616 |
$tags = 'system';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 7.1.06
|
7 |
*
|
8 |
*/
|
9 |
|
172 |
break;
|
173 |
|
174 |
case 'wppa_audiostub_upload':
|
175 |
+
if ( isset( $_FILES['file_3'] ) && $_FILES['file_3']['error'] != 4 ) {
|
176 |
$file = $_FILES['file_3'];
|
177 |
if ( $file['error'] ) {
|
178 |
wppa_error_message(sprintf(__('Upload error %s', 'wp-photo-album-plus'), $file['error']));
|
206 |
break;
|
207 |
|
208 |
case 'wppa_documentstub_upload':
|
209 |
+
if ( isset( $_FILES['file_4'] ) && $_FILES['file_4']['error'] != 4 ) {
|
210 |
$file = $_FILES['file_4'];
|
211 |
if ( $file['error'] ) {
|
212 |
wppa_error_message(sprintf(__('Upload error %s', 'wp-photo-album-plus'), $file['error']));
|
240 |
break;
|
241 |
|
242 |
case 'wppa_multimedia_icon_upload':
|
243 |
+
if ( isset( $_FILES['file_5'] ) && $_FILES['file_5']['error'] != 4 ) {
|
244 |
$file = $_FILES['file_5'];
|
245 |
if ( $file['error'] ) {
|
246 |
wppa_error_message(sprintf(__('Upload error %s', 'wp-photo-album-plus'), $file['error']));
|
299 |
}
|
300 |
break;
|
301 |
|
302 |
+
case 'dummy':
|
303 |
+
break;
|
304 |
+
|
305 |
default: wppa_error_message( 'Unimplemnted action key: ' . htmlentities( $key ) );
|
306 |
}
|
307 |
|
504 |
<form enctype="multipart/form-data" action="<?php echo(wppa_dbg_url(get_admin_url().'admin.php?page=wppa_options')) ?>" method="post">
|
505 |
|
506 |
<?php wp_nonce_field('wppa-nonce', 'wppa-nonce'); ?>
|
507 |
+
<div style="display:none;" >
|
508 |
+
<?php echo wppa_doit_button( 'dummy', 'dummy' ); ?>
|
509 |
+
</div>
|
510 |
<input type="hidden" name="wppa-key" id="wppa-key" value="" />
|
511 |
<input type="hidden" name="wppa-sub" id="wppa-sub" value="" />
|
512 |
<?php if ( get_option('wppa_i_done') == 'done' ) { ?>
|
8615 |
$desc = __('Number of extra resize handler actions', 'wp-photo-album-plus');
|
8616 |
$help = '';
|
8617 |
$slug = 'wppa_extended_resize_count';
|
8618 |
+
$opts = array('0','1','2','3','4','5','6','10','15','20',__( 'infinite', 'wp-photo-album-plus' ) );
|
8619 |
+
$vals = array('0','1','2','3','4','5','6','10','15','20','-1');
|
8620 |
$html = wppa_select($slug, $opts, $vals).' '.__('times', 'wp-photo-album-plus');
|
8621 |
$clas = '';
|
8622 |
$tags = 'system';
|
wppa-tinymce-photo-front.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-tinymce-photo-front.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
-
* Version
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -46,7 +46,7 @@ function wppa_inject_3_js() {
|
|
46 |
global $wppa_api_version;
|
47 |
static $done;
|
48 |
global $wpdb;
|
49 |
-
global $
|
50 |
|
51 |
|
52 |
if ( wppa_switch( 'photo_shortcode_enabled' ) && ! $done ) {
|
@@ -58,7 +58,8 @@ global $wppa_js_page_data_file;
|
|
58 |
wppa( 'in_widget', true );
|
59 |
|
60 |
// Things that wppa-tinymce.js AND OTHER MODULES!!! need to know
|
61 |
-
$
|
|
|
62 |
wppaImageDirectory = "' . wppa_get_imgdir() . '";
|
63 |
wppaPhotoDirectory = "' . WPPA_UPLOAD_URL . '/";
|
64 |
wppaNoPreview = "' . __( 'No Preview available', 'wp-photo-album-plus' ) . '";
|
@@ -68,19 +69,15 @@ wppaTxtErrUnable = "' . __( 'ERROR: unable to upload files.', 'wp-photo-album-pl
|
|
68 |
wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";
|
69 |
wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
|
70 |
wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";
|
71 |
-
';
|
72 |
-
|
73 |
-
if (
|
74 |
-
$
|
75 |
-
if ( $handle ) {
|
76 |
-
fwrite( $handle, "\n/* START PHOTO sc and TynyMce fe vars */" . $body . "/* END PHOTO and TynMce */\n" );
|
77 |
-
fclose( $handle );
|
78 |
-
}
|
79 |
}
|
80 |
else {
|
81 |
-
echo
|
82 |
-
<script
|
83 |
-
$
|
84 |
</script>';
|
85 |
}
|
86 |
|
@@ -88,6 +85,5 @@ $body . '
|
|
88 |
wppa( 'in_widget', false );
|
89 |
|
90 |
$done = true;
|
91 |
-
|
92 |
}
|
93 |
}
|
2 |
/* wppa-tinymce-photo-front.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
+
* Version 7.1.06
|
6 |
*
|
7 |
*/
|
8 |
|
46 |
global $wppa_api_version;
|
47 |
static $done;
|
48 |
global $wpdb;
|
49 |
+
global $wppa_js_page_data;
|
50 |
|
51 |
|
52 |
if ( wppa_switch( 'photo_shortcode_enabled' ) && ! $done ) {
|
58 |
wppa( 'in_widget', true );
|
59 |
|
60 |
// Things that wppa-tinymce.js AND OTHER MODULES!!! need to know
|
61 |
+
$result =
|
62 |
+
'/* START PHOTO sc and TynyMce fe vars */
|
63 |
wppaImageDirectory = "' . wppa_get_imgdir() . '";
|
64 |
wppaPhotoDirectory = "' . WPPA_UPLOAD_URL . '/";
|
65 |
wppaNoPreview = "' . __( 'No Preview available', 'wp-photo-album-plus' ) . '";
|
69 |
wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";
|
70 |
wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
|
71 |
wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";
|
72 |
+
/* END PHOTO and TynMce */';
|
73 |
+
|
74 |
+
if ( wppa_js_in_footer() ) {
|
75 |
+
$wppa_js_page_data .= $result;
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
else {
|
78 |
+
echo
|
79 |
+
'<script>
|
80 |
+
' . $result . '
|
81 |
</script>';
|
82 |
}
|
83 |
|
85 |
wppa( 'in_widget', false );
|
86 |
|
87 |
$done = true;
|
|
|
88 |
}
|
89 |
}
|
wppa-utils.php
CHANGED
@@ -4732,27 +4732,44 @@ function wppa_rename_files_sanitized( $root ) {
|
|
4732 |
|
4733 |
foreach( $my_import_files as $path ) {
|
4734 |
|
|
|
|
|
|
|
4735 |
// Process files
|
4736 |
-
if (
|
4737 |
-
|
4738 |
-
|
4739 |
-
|
4740 |
-
|
4741 |
-
wppa_log( 'fso', 'Sanitized import filename ' . $path . ' to ' . $root . '/' . $new_name );
|
4742 |
}
|
4743 |
}
|
4744 |
|
4745 |
// Process directories
|
4746 |
-
|
|
|
4747 |
$file = basename( $path );
|
4748 |
|
4749 |
// Only process real subfolders
|
4750 |
if ( $file != '.' && $file != '..' ) {
|
4751 |
|
|
|
|
|
|
|
|
|
|
|
4752 |
// Recursively one level deeper
|
4753 |
wppa_rename_files_sanitized( $path );
|
4754 |
}
|
4755 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4756 |
}
|
4757 |
}
|
4758 |
}
|
4732 |
|
4733 |
foreach( $my_import_files as $path ) {
|
4734 |
|
4735 |
+
// Sanitize path
|
4736 |
+
$new_path = dirname( $path ) . '/' . wppa_down_ext( sanitize_file_name( basename( $path ) ) );
|
4737 |
+
|
4738 |
// Process files
|
4739 |
+
if ( wppa_is_file( $path ) ) {
|
4740 |
+
|
4741 |
+
if ( $new_path != $path ) {
|
4742 |
+
wppa_rename( $path, $new_path );
|
4743 |
+
wppa_log( 'fso', 'Sanitized import filename ' . $path . ' to ' . $new_path );
|
|
|
4744 |
}
|
4745 |
}
|
4746 |
|
4747 |
// Process directories
|
4748 |
+
elseif ( wppa_is_dir( $path ) ) {
|
4749 |
+
|
4750 |
$file = basename( $path );
|
4751 |
|
4752 |
// Only process real subfolders
|
4753 |
if ( $file != '.' && $file != '..' ) {
|
4754 |
|
4755 |
+
if ( $new_path != $path ) {
|
4756 |
+
wppa_rename( $path, $new_path );
|
4757 |
+
wppa_log( 'fso', 'Sanitized import folder ' . $path . ' to ' . $new_path );
|
4758 |
+
}
|
4759 |
+
|
4760 |
// Recursively one level deeper
|
4761 |
wppa_rename_files_sanitized( $path );
|
4762 |
}
|
4763 |
}
|
4764 |
+
|
4765 |
+
// File system object found with weird characters
|
4766 |
+
else {
|
4767 |
+
if ( substr( $new_path, -1 ) == '/' ) {
|
4768 |
+
wppa_log( 'fso', 'Removed illegal filename that could not be sanitized or renamed: ' . $path );
|
4769 |
+
wppa_error_message( 'Removed illegal filename that could not be sanitized or renamed: ' . $path );
|
4770 |
+
unlink( $path );
|
4771 |
+
}
|
4772 |
+
}
|
4773 |
}
|
4774 |
}
|
4775 |
}
|
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: 7.1.
|
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,11 @@ global $wpdb;
|
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
-
global $wppa_revno; $wppa_revno = '
|
26 |
-
global $wppa_api_version; $wppa_api_version = '7.1.
|
|
|
|
|
|
|
27 |
|
28 |
/* start timers */
|
29 |
add_action( 'plugins_loaded', 'wppa_init_timer' );
|
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: 7.1.06.012
|
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 = '7106'; // WPPA db version
|
26 |
+
global $wppa_api_version; $wppa_api_version = '7.1.06.012'; // WPPA software version
|
27 |
+
|
28 |
+
/* Init page js data */
|
29 |
+
global $wppa_js_page_data; $wppa_js_page_data = '';
|
30 |
|
31 |
/* start timers */
|
32 |
add_action( 'plugins_loaded', 'wppa_init_timer' );
|