WP Photo Album Plus - Version 8.1.00.009

Version Description

= 8.0.10 =

  • This version addresses various bug fixes, feature requests and security fixes.
Download this release

Release Info

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

Code changes from version 8.1.00.008 to 8.1.00.009

changelog.txt CHANGED
@@ -11,6 +11,11 @@ WP Photo Album Plus Changelog
11
  - Dropped frontend edit photo method 'Classic'.
12
  * Deleting a users 'Admins choice' zipfile will also remove his tags.
13
  * Removed Google+ share.
 
 
 
 
 
14
 
15
  = 8.0.10 =
16
 
11
  - Dropped frontend edit photo method 'Classic'.
12
  * Deleting a users 'Admins choice' zipfile will also remove his tags.
13
  * Removed Google+ share.
14
+ * Added round black share buttons. See Advanced settings -> Share -> I Items 7, 10, 11.
15
+
16
+ * Known problems:
17
+ - shortcode generator on Gutenberg editor does not work correctly.
18
+ - update addressline is temporarely disabled due to infinite looping on refresh page.
19
 
20
  = 8.0.10 =
21
 
img/linkedin.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M6.227 12.61h4.19v13.48h-4.19V12.61zm2.095-6.7a2.43 2.43 0 0 1 0 4.86c-1.344 0-2.428-1.09-2.428-2.43s1.084-2.43 2.428-2.43m4.72 6.7h4.02v1.84h.058c.56-1.058 1.927-2.176 3.965-2.176 4.238 0 5.02 2.792 5.02 6.42v7.395h-4.183v-6.56c0-1.564-.03-3.574-2.178-3.574-2.18 0-2.514 1.7-2.514 3.46v6.668h-4.187V12.61z" fill="#FFF"/></svg>
img/pinterest.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#FFF" d="M16.539 4.5c-6.277 0-9.442 4.5-9.442 8.253 0 2.272.86 4.293 2.705 5.046.303.125.574.005.662-.33.061-.231.205-.816.27-1.06.088-.331.053-.447-.191-.736-.532-.627-.873-1.439-.873-2.591 0-3.338 2.498-6.327 6.505-6.327 3.548 0 5.497 2.168 5.497 5.062 0 3.81-1.686 7.025-4.188 7.025-1.382 0-2.416-1.142-2.085-2.545.397-1.674 1.166-3.48 1.166-4.689 0-1.081-.581-1.983-1.782-1.983-1.413 0-2.548 1.462-2.548 3.419 0 1.247.421 2.091.421 2.091l-1.699 7.199c-.505 2.137-.076 4.755-.039 5.019.021.158.223.196.314.077.13-.17 1.813-2.247 2.384-4.324.162-.587.929-3.631.929-3.631.46.876 1.801 1.646 3.227 1.646 4.247 0 7.128-3.871 7.128-9.053.003-3.918-3.317-7.568-8.361-7.568z"/></svg>
img/twitter.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#FFF" d="M28 8.557a9.913 9.913 0 0 1-2.828.775 4.93 4.93 0 0 0 2.166-2.725 9.738 9.738 0 0 1-3.13 1.194 4.92 4.92 0 0 0-3.593-1.55 4.924 4.924 0 0 0-4.794 6.049c-4.09-.21-7.72-2.17-10.15-5.15a4.942 4.942 0 0 0-.665 2.477c0 1.71.87 3.214 2.19 4.1a4.968 4.968 0 0 1-2.23-.616v.06c0 2.39 1.7 4.38 3.952 4.83-.414.115-.85.174-1.297.174-.318 0-.626-.03-.928-.086a4.935 4.935 0 0 0 4.6 3.42 9.893 9.893 0 0 1-6.114 2.107c-.398 0-.79-.023-1.175-.068a13.953 13.953 0 0 0 7.55 2.213c9.056 0 14.01-7.507 14.01-14.013 0-.213-.005-.426-.015-.637.96-.695 1.795-1.56 2.455-2.55z"/></svg>
js/wppa-gutenberg-wppa.js CHANGED
@@ -1,7 +1,7 @@
1
  /* wppa-gutenberg-wppa.js
2
  * Pachkage: wp-photo-album-plus
3
  *
4
- * Version 8.1.00.008
5
  */
6
 
7
  // Global vars
@@ -44,12 +44,14 @@ jQuery(document).ready(function(){
44
  return el( 'div', {id:id} , 'Loading...' );
45
  }
46
  else {
 
47
  var Uid = 'wppa-wppa-dialog-' + wppaPhotoDialogCounter;
48
  wppaPhotoDialogCounter++;
49
  wppaPhotoDialog = el( 'div', { id: Uid, style: blockStyle }, 'placeholder' );
50
  setTimeout( function() {
51
  jQuery( '#' + Uid ).html( wppaWppaDialogHtml );
52
  }, 100 );
 
53
  setTimeout( function() {
54
 
55
  // Bind onchange handler to ready button
@@ -71,7 +73,7 @@ jQuery(document).ready(function(){
71
  var shortcode = props.attributes.shortcode || '';
72
 
73
  if ( shortcode.length ) {
74
- return shortcode.replace( /@/g, '#' );
75
  }
76
  },
77
  } );
@@ -671,9 +673,9 @@ function wppaGutenbergGalleryEvaluate() {
671
  }
672
 
673
  if ( shortcodeOk ) {
674
- result = shortcode.replace( /#/g, '@' );
675
- result = shortcode.replace( /"/g, '&quot;' );
676
- result = shortcode.replace( /'/g, '&apos;' );
677
  }
678
  else {
679
  result = '';
1
  /* wppa-gutenberg-wppa.js
2
  * Pachkage: wp-photo-album-plus
3
  *
4
+ * Version 8.1.00.009
5
  */
6
 
7
  // Global vars
44
  return el( 'div', {id:id} , 'Loading...' );
45
  }
46
  else {
47
+
48
  var Uid = 'wppa-wppa-dialog-' + wppaPhotoDialogCounter;
49
  wppaPhotoDialogCounter++;
50
  wppaPhotoDialog = el( 'div', { id: Uid, style: blockStyle }, 'placeholder' );
51
  setTimeout( function() {
52
  jQuery( '#' + Uid ).html( wppaWppaDialogHtml );
53
  }, 100 );
54
+
55
  setTimeout( function() {
56
 
57
  // Bind onchange handler to ready button
73
  var shortcode = props.attributes.shortcode || '';
74
 
75
  if ( shortcode.length ) {
76
+ return shortcode; //.replace( /@/g, '#' );
77
  }
78
  },
79
  } );
673
  }
674
 
675
  if ( shortcodeOk ) {
676
+ result = shortcode.replace( /@/g, 'HASH' );
677
+ result = result.replace( /"/g, 'QUOTE' );
678
+ result = result.replace( /'/g, 'APOS' );
679
  }
680
  else {
681
  result = '';
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
  Requires at least: 3.9
6
- Tested up to: 5.8
7
  Requires PHP: 5.5
8
- Stable tag: 8.0.10.006
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
  Requires at least: 3.9
6
+ Tested up to: 5.9
7
  Requires PHP: 5.5
8
+ Stable tag: 8.1.00.009
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
wppa-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
- * Version 8.1.00.008
7
  *
8
  */
9
 
@@ -371,7 +371,7 @@ global $wpdb;
371
  if ( is_array( $temp ) ) {
372
  foreach( array_keys( $temp ) as $key ) {
373
  $t = explode( ']', $temp[$key] );
374
- $t[0] = str_replace( ['@', '&quot;', '&apos;'], ['#', '"', "'"], $t[0] );
375
  $temp[$key] = implode( ']', $t );
376
  }
377
  $new_content = implode( '[wppa ', $temp );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
+ * Version 8.1.00.009
7
  *
8
  */
9
 
371
  if ( is_array( $temp ) ) {
372
  foreach( array_keys( $temp ) as $key ) {
373
  $t = explode( ']', $temp[$key] );
374
+ $t[0] = str_replace( ['HASH', 'QUOTE', 'APOS'], ['#', '"', "'"], $t[0] );
375
  $temp[$key] = implode( ']', $t );
376
  }
377
  $new_content = implode( '[wppa ', $temp );
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 8.1.00.008
6
  *
7
  */
8
 
@@ -495,7 +495,7 @@ global $wppa;
495
  if ( wppa_switch( 'search_comments' ) ) wppa_index_update( 'photo', $photoid );
496
  }
497
  wppa( 'no_esc', true );
498
- wppa_echo( wppa_comment_html( $photoid, $comment_allowed ) ); // Retrieve the new commentbox content
499
  wppa_exit();
500
  break;
501
 
@@ -854,9 +854,7 @@ global $wppa;
854
 
855
  // Remove user id as tag to the item if configured
856
  if ( wppa_switch( 'choice_is_tag' ) ) {
857
- $tags = preg_replace( '/,user-'.wppa_get_user( 'id' ).',/siu', ',', $tags );
858
- // $tags = strtolower( wppa_get_photo_item( $photo, 'tags' ) );
859
- // $tags = str_replace( ',user-' . wppa_get_user( 'id' ) . ',', ',', $tags );
860
  wppa_update_photo( array( 'id' => $photo, 'tags' => wppa_sanitize_tags( $tags ) ) );
861
  wppa_clear_taglist();
862
  }
@@ -880,15 +878,13 @@ global $wppa;
880
  }
881
  }
882
 
883
- // Remove all User-<userid> tags
884
  $tag = wppa_get_user( 'display' );
885
  $items = $wpdb->get_results( "SELECT id, tags FROM $wpdb->wppa_photos
886
  WHERE tags LIKE '%" . str_replace( "'", "\'", ',' . $wpdb->esc_like( $tag ) . ',' ) . "%'", ARRAY_A );
887
  foreach( $items as $item ) {
888
  $id = $item['id'];
889
- $tags = preg_replace( '/,'.$tag.',/siu', ',', $tags );
890
- // $tags = strtolower( $item['tags'] );
891
- // $tags = str_replace( $tag, '', $tags );
892
  $tags = wppa_sanitize_tags( $tags );
893
  wppa_update_photo( array( 'id' => $id, 'tags' => $tags ) );
894
  }
@@ -1039,19 +1035,19 @@ global $wppa;
1039
 
1040
  case 'tinymcedialog':
1041
  $result = wppa_make_tinymce_dialog();
1042
- wppa_echo( $result );
1043
  wppa_exit();
1044
  break;
1045
 
1046
  case 'tinymcephotodialog':
1047
  $result = wppa_make_tinymce_photo_dialog();
1048
- wppa_echo( $result );
1049
  wppa_exit();
1050
  break;
1051
 
1052
  case 'tinymcephotodialogfront':
1053
  $result = wppa_make_tinymce_photo_dialog( 'front' );
1054
- wppa_echo( $result );
1055
  wppa_exit();
1056
  break;
1057
 
@@ -1068,25 +1064,31 @@ global $wppa;
1068
  break;
1069
 
1070
  case 'getshortcodedrendered':
1071
- $shortcode = wppa_get( 'shortcode' );
1072
- $shortcode = str_replace( ['@', '&quot;', '&apos;'], ['#', '"', "'"], $shortcode );
1073
- $shortcode = stripslashes( $shortcode );
1074
-
1075
- wppa_load_theme();
1076
-
1077
- $wppa['mocc'] = wppa_get( 'occur' ) - '1'; // Will be inc'd back by do_shortcode content
1078
- $wppa_opt['wppa_lazy'] = 'none';
1079
- $result = do_shortcode( $shortcode );
1080
- $result = str_replace( 'href=', 'data-href=', $result );
1081
- $result = str_replace( 'onclick="', 'onclick="return false;', $result );
1082
-
1083
- echo ( '
1084
- <div id="wppa-gutenberg-div-' . $wppa['mocc'] . '" >
1085
- <div style="font-size:10px;color:green;margin-bottom:2px;width:100%;text-align:center;" >
1086
- <i>(' . esc_html( __('Links and buttons will not work in this preview', 'wp-photo-album-plus') ) . ')</i>
1087
- </div>' .
1088
- $result . '
1089
- </div>' );
 
 
 
 
 
 
1090
  wppa_exit();
1091
  break;
1092
 
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 8.1.00.009
6
  *
7
  */
8
 
495
  if ( wppa_switch( 'search_comments' ) ) wppa_index_update( 'photo', $photoid );
496
  }
497
  wppa( 'no_esc', true );
498
+ echo( wppa_comment_html( $photoid, $comment_allowed ) ); // Retrieve the new commentbox content
499
  wppa_exit();
500
  break;
501
 
854
 
855
  // Remove user id as tag to the item if configured
856
  if ( wppa_switch( 'choice_is_tag' ) ) {
857
+ $tags = preg_replace( '/,'.wppa_get_user( 'display' ).',/siu', ',', $tags );
 
 
858
  wppa_update_photo( array( 'id' => $photo, 'tags' => wppa_sanitize_tags( $tags ) ) );
859
  wppa_clear_taglist();
860
  }
878
  }
879
  }
880
 
881
+ // Remove all User displayname tags
882
  $tag = wppa_get_user( 'display' );
883
  $items = $wpdb->get_results( "SELECT id, tags FROM $wpdb->wppa_photos
884
  WHERE tags LIKE '%" . str_replace( "'", "\'", ',' . $wpdb->esc_like( $tag ) . ',' ) . "%'", ARRAY_A );
885
  foreach( $items as $item ) {
886
  $id = $item['id'];
887
+ $tags = preg_replace( '/,'.$tag.',/siu', ',', $item['tags'] );
 
 
888
  $tags = wppa_sanitize_tags( $tags );
889
  wppa_update_photo( array( 'id' => $id, 'tags' => $tags ) );
890
  }
1035
 
1036
  case 'tinymcedialog':
1037
  $result = wppa_make_tinymce_dialog();
1038
+ echo( $result );
1039
  wppa_exit();
1040
  break;
1041
 
1042
  case 'tinymcephotodialog':
1043
  $result = wppa_make_tinymce_photo_dialog();
1044
+ echo( $result );
1045
  wppa_exit();
1046
  break;
1047
 
1048
  case 'tinymcephotodialogfront':
1049
  $result = wppa_make_tinymce_photo_dialog( 'front' );
1050
+ echo( $result );
1051
  wppa_exit();
1052
  break;
1053
 
1064
  break;
1065
 
1066
  case 'getshortcodedrendered':
1067
+ wppa_get( 'shortcode', 'text' );
1068
+ $shortcode = str_replace( ['HASH', 'QUOTE', 'APOS'], ['#', '"', "'"], $shortcode );
1069
+ $_REQUEST['shortcode'] = $shortcode;
1070
+
1071
+ // Photo shortcode can be previewed
1072
+ // if ( substr( $shortcode, 0, 7 ) == '[photo ' ) {
1073
+ wppa_load_theme();
1074
+
1075
+ $wppa['mocc'] = wppa_get( 'occur' ) - '1'; // Will be inc'd back by do_shortcode content
1076
+ $wppa_opt['wppa_lazy'] = 'none';
1077
+ $result = do_shortcode( $shortcode );
1078
+ $result = str_replace( 'href=', 'data-href=', $result );
1079
+ $result = str_replace( 'onclick="', 'onclick="return false;', $result );
1080
+
1081
+ echo ( '
1082
+ <div id="wppa-gutenberg-div-' . $wppa['mocc'] . '" >
1083
+ <div style="font-size:10px;color:green;margin-bottom:2px;width:100%;text-align:center;" >
1084
+ <i>(' . esc_html( __('Links and buttons will not work in this preview', 'wp-photo-album-plus') ) . ')</i>
1085
+ </div>' .
1086
+ $result . '
1087
+ </div>' );
1088
+ // }
1089
+ // else {
1090
+ // wppa_echo( '<div style="text-align:center">' . esc_html( __('No preview available', 'wp-photo-album-plus' ) ) . '</div>' );
1091
+ // }
1092
  wppa_exit();
1093
  break;
1094
 
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 8.1.00.008
7
  *
8
  */
9
 
@@ -1682,8 +1682,7 @@ function wppa_get_multitag_html( $nperline = '2', $seltags = '' ) {
1682
  }
1683
  $tags = wppa_get_taglist( true );
1684
 
1685
- $result .= '
1686
- <script>
1687
  function wppaProcessMultiTagRequest'.wppa('mocc').'() {
1688
  var any = false;
1689
  var url = "' . wppa_encrypt_url( $hr ) . '";
@@ -1697,13 +1696,13 @@ function wppa_get_multitag_html( $nperline = '2', $seltags = '' ) {
1697
  ';
1698
 
1699
  if ( $or_only ) {
1700
- $result .= '
1701
  andor = "or";
1702
  sep = ";";
1703
  ';
1704
  }
1705
  else {
1706
- $result .= '
1707
  andor = "and";
1708
  sep = ",";
1709
  if ( jQuery( "#andoror-' . $mocc . '" ).prop( "checked" ) ) {
@@ -1715,7 +1714,7 @@ function wppa_get_multitag_html( $nperline = '2', $seltags = '' ) {
1715
  $selarr = $seltags ? explode( ',', $seltags ) : array();
1716
  if ( $tags ) foreach ( $tags as $tag ) {
1717
  if ( ! $seltags || in_array( $tag['tag'], $selarr ) ) {
1718
- $result .= '
1719
  if ( document.getElementById( "wppa-' . $mocc . '-' . str_replace( ' ', '_', $tag['tag'] ) . '" ).checked ) {
1720
  url+="' . urlencode( $tag['tag'] ) . '"+sep;
1721
  any = true;
@@ -1723,7 +1722,7 @@ function wppa_get_multitag_html( $nperline = '2', $seltags = '' ) {
1723
  }
1724
  }
1725
 
1726
- $result .= '
1727
  if ( any ) {
1728
  document.location = url;
1729
  }
@@ -1731,8 +1730,8 @@ function wppa_get_multitag_html( $nperline = '2', $seltags = '' ) {
1731
  alert ( "' . __( 'Please check the tag(s) that the photos must have', 'wp-photo-album-plus' ) . '" );
1732
  }
1733
  }
1734
- </script>
1735
  ';
 
1736
 
1737
  $qtag = wppa_get( 'tag', '', 'text' );
1738
  $andor = $or_only ? 'or' : 'and'; // default
@@ -2916,16 +2915,17 @@ static $albums_granted;
2916
 
2917
  // Create the return url
2918
  if ( $ajax_upload ) {
2919
- switch( wppa_opt( 'ajax_upload_method' ) ) {
2920
- case 'normal':
2921
- $returnurl = site_url() . '/wppaajax?action=wppa&amp;wppa-action=do-fe-upload';
2922
- break;
2923
- case 'backend':
 
2924
  $returnurl = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=do-fe-upload';
2925
- break;
2926
- default: // case 'extern'
2927
- $returnurl = WPPA_URL . '/wppa-ajax-front.php?action=wppa&amp;wppa-action=do-fe-upload';
2928
- break;
2929
  }
2930
  }
2931
  else {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 8.1.00.009
7
  *
8
  */
9
 
1682
  }
1683
  $tags = wppa_get_taglist( true );
1684
 
1685
+ $the_js = '
 
1686
  function wppaProcessMultiTagRequest'.wppa('mocc').'() {
1687
  var any = false;
1688
  var url = "' . wppa_encrypt_url( $hr ) . '";
1696
  ';
1697
 
1698
  if ( $or_only ) {
1699
+ $the_js .= '
1700
  andor = "or";
1701
  sep = ";";
1702
  ';
1703
  }
1704
  else {
1705
+ $the_js .= '
1706
  andor = "and";
1707
  sep = ",";
1708
  if ( jQuery( "#andoror-' . $mocc . '" ).prop( "checked" ) ) {
1714
  $selarr = $seltags ? explode( ',', $seltags ) : array();
1715
  if ( $tags ) foreach ( $tags as $tag ) {
1716
  if ( ! $seltags || in_array( $tag['tag'], $selarr ) ) {
1717
+ $the_js .= '
1718
  if ( document.getElementById( "wppa-' . $mocc . '-' . str_replace( ' ', '_', $tag['tag'] ) . '" ).checked ) {
1719
  url+="' . urlencode( $tag['tag'] ) . '"+sep;
1720
  any = true;
1722
  }
1723
  }
1724
 
1725
+ $the_js .= '
1726
  if ( any ) {
1727
  document.location = url;
1728
  }
1730
  alert ( "' . __( 'Please check the tag(s) that the photos must have', 'wp-photo-album-plus' ) . '" );
1731
  }
1732
  }
 
1733
  ';
1734
+ wp_add_inline_script( 'wppa', $the_js );
1735
 
1736
  $qtag = wppa_get( 'tag', '', 'text' );
1737
  $andor = $or_only ? 'or' : 'and'; // default
2915
 
2916
  // Create the return url
2917
  if ( $ajax_upload ) {
2918
+ if ( wppa_is_file( dirname( __FILE__ ) . '/wppa-ajax-front.php' ) && $method == 'extern' ) {
2919
+ if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=do-fe-upload';
2920
+ else $returnurl = WPPA_URL . '/wppa-ajax-front.php?action=wppa&amp;wppa-action=do-fe-upload';
2921
+ }
2922
+ else {
2923
+ if ( is_admin() || ( wppa_opt( 'ajax_upload_method' ) == 'backend' ) ) {
2924
  $returnurl = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=do-fe-upload';
2925
+ }
2926
+ else {
2927
+ $returnurl = site_url() . '/wppaajax?action=wppa&amp;wppa-action=do-fe-upload';
2928
+ }
2929
  }
2930
  }
2931
  else {
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 8.1.00.008
7
  *
8
  */
9
 
@@ -3824,7 +3824,7 @@ function wppa_get_curpage() {
3824
  if ( wppa( 'mocc' ) == wppa_get( 'occur', '1' ) ) {
3825
 
3826
  // page may be in qstring
3827
- $curpage = wppa_get( 'page', '1' );
3828
  }
3829
  else {
3830
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 8.1.00.009
7
  *
8
  */
9
 
3824
  if ( wppa( 'mocc' ) == wppa_get( 'occur', '1' ) ) {
3825
 
3826
  // page may be in qstring
3827
+ $curpage = wppa_get( 'wppa-page', '1' );
3828
  }
3829
  else {
3830
 
wppa-gutenberg-photo.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-gutenberg-photo.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.1.00.008
6
  */
7
 
8
  function wppa_gutenberg_photo_block() {
@@ -115,7 +115,7 @@ global $wpdb;
115
  // Open form
116
  '<form' .
117
  ' id="wppa-uplform"' .
118
- ' action="' . WPPA_URL . '/wppa-ajax-front.php?action=wppa&amp;wppa-action=do-fe-upload&amp;fromgutenberg=1"' .
119
  ' method="post"' .
120
  ' enctype="multipart/form-data"' .
121
  ' >' .
@@ -228,8 +228,11 @@ global $wpdb;
228
  wppaGutenbergPhotoEvaluate();
229
 
230
  },
231
- error: function() {
 
 
232
  jQuery("#message").html( \'<span style="color: red;" >\'+wppaTxtErrUnable+\'</span>\' );
 
233
  }
234
  };
235
  jQuery("#wppa-uplform").ajaxForm(options);
2
  /* wppa-gutenberg-photo.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.1.00.009
6
  */
7
 
8
  function wppa_gutenberg_photo_block() {
115
  // Open form
116
  '<form' .
117
  ' id="wppa-uplform"' .
118
+ ' action="' . site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=do-fe-upload&amp;fromgutenberg=1"' .
119
  ' method="post"' .
120
  ' enctype="multipart/form-data"' .
121
  ' >' .
228
  wppaGutenbergPhotoEvaluate();
229
 
230
  },
231
+ error: function(response) {
232
+ return;
233
+
234
  jQuery("#message").html( \'<span style="color: red;" >\'+wppaTxtErrUnable+\'</span>\' );
235
+ wppaConsoleLog(response, \'force\');
236
  }
237
  };
238
  jQuery("#wppa-uplform").ajaxForm(options);
wppa-gutenberg-wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-gutenberg-wppa.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.1.00.007
6
  */
7
 
8
  function wppa_gutenberg_wppa_block() {
@@ -644,12 +644,18 @@ global $wpdb;
644
 
645
  '</table>'.
646
  '<div id="wppagallery-shortcode-preview-container" >'.
647
- '<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="[wppa]" />'.
648
  '</div>'.
649
-
 
 
 
 
 
650
  '<input
651
  id="wppa-shortcode-wppa-ready"
652
  type="button"
 
653
  value="' . __( 'Ready', 'wp-photo-album-plus' ) . '"
654
  / >' .
655
 
2
  /* wppa-gutenberg-wppa.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.1.00.009
6
  */
7
 
8
  function wppa_gutenberg_wppa_block() {
644
 
645
  '</table>'.
646
  '<div id="wppagallery-shortcode-preview-container" >'.
647
+ '<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd;width:100%;height:26px;display:none" value="[wppa]" />'.
648
  '</div>'.
649
+ /*
650
+ '<div
651
+ id="wppa-shortcode-wppa-">' .
652
+ __('Copy this shortcode and paste it on the page/post and discard this block', 'wp-photo-album-plus') .
653
+ '</div>' .
654
+ */
655
  '<input
656
  id="wppa-shortcode-wppa-ready"
657
  type="button"
658
+ style="display:none"
659
  value="' . __( 'Ready', 'wp-photo-album-plus' ) . '"
660
  / >' .
661
 
wppa-input.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
- * Version 8.1.00.008
7
  *
8
  */
9
 
@@ -87,6 +87,8 @@ function wppa_get_get_filter( $name ) {
87
  case 'album-page-no':
88
  case 'high':
89
  case 'albumeditid':
 
 
90
  $result = 'int';
91
  break;
92
 
@@ -136,6 +138,7 @@ function wppa_get_get_filter( $name ) {
136
  case 'blogit':
137
  case 'cron':
138
  case 'seq':
 
139
  $result = 'bool';
140
  break;
141
 
@@ -225,6 +228,8 @@ function wppa_get_get_filter( $name ) {
225
  case 'onoff':
226
  case 'albumeditnonce':
227
  case 'albumeditsubmit':
 
 
228
  $result = 'text';
229
  break;
230
 
@@ -405,6 +410,10 @@ global $wppa_kses_maxi;
405
  }
406
  break;
407
 
 
 
 
 
408
  case 'raw':
409
  wppa_log( 'err', 'Unfiltered (raw) querystring arg = ' . $name . ', value = ' . sanitize_text_field( var_export( $_REQUEST[$key], true ) ) );
410
  $result = sanitize_text_field( $_REQUEST[$key] );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
+ * Version 8.1.00.009
7
  *
8
  */
9
 
87
  case 'album-page-no':
88
  case 'high':
89
  case 'albumeditid':
90
+ case 'album-parent':
91
+ case 'captcha':
92
  $result = 'int';
93
  break;
94
 
138
  case 'blogit':
139
  case 'cron':
140
  case 'seq':
141
+ case 'fe-create':
142
  $result = 'bool';
143
  break;
144
 
228
  case 'onoff':
229
  case 'albumeditnonce':
230
  case 'albumeditsubmit':
231
+ case 'album-desc':
232
+ case 'album-name':
233
  $result = 'text';
234
  break;
235
 
410
  }
411
  break;
412
 
413
+ case 'strip':
414
+ $result = strip_tags( $_REQUEST[$key] );
415
+ break;
416
+
417
  case 'raw':
418
  wppa_log( 'err', 'Unfiltered (raw) querystring arg = ' . $name . ', value = ' . sanitize_text_field( var_export( $_REQUEST[$key], true ) ) );
419
  $result = sanitize_text_field( $_REQUEST[$key] );
wppa-mailing.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains mailing functions
6
  *
7
- * Version 8.0.04.004
8
  *
9
  */
10
 
@@ -917,17 +917,17 @@ function wppa_unsubscribe_link( $user_id, $listtype ) {
917
  $user = get_user_by( 'ID', $user_id );
918
  $crypt = crypt( $listtype . $user->ID . $user->login_name, $user->display_name );
919
 
920
- switch ( wppa_opt( 'ajax_method' ) ) {
921
- case 'admin':
922
- $url = site_url() . '/wp-admin/admin-ajax.php';
923
- break;
924
- case 'extern':
925
- $url = WPPA_URL . '/wppa-ajax-front.php';
926
- break;
927
- default:
928
  $url = site_url() . '/wppaajax';
929
- break;
930
- }
931
  $url .= '?action=wppa&wppa-action=mailinglist&list=' . $listtype . '&onoff=off&user=' . $user_id . '&crypt=' . $crypt;
932
 
933
  $link = '<a href="' . $url . '" >';
4
  *
5
  * Contains mailing functions
6
  *
7
+ * Version 8.1.00.009
8
  *
9
  */
10
 
917
  $user = get_user_by( 'ID', $user_id );
918
  $crypt = crypt( $listtype . $user->ID . $user->login_name, $user->display_name );
919
 
920
+ // switch ( wppa_opt( 'ajax_method' ) ) {
921
+ // case 'admin':
922
+ // $url = site_url() . '/wp-admin/admin-ajax.php';
923
+ // break;
924
+ // case 'extern':
925
+ // $url = WPPA_URL . '/wppa-ajax-front.php';
926
+ // break;
927
+ // default:
928
  $url = site_url() . '/wppaajax';
929
+ // break;
930
+ // }
931
  $url .= '?action=wppa&wppa-action=mailinglist&list=' . $listtype . '&onoff=off&user=' . $user_id . '&crypt=' . $crypt;
932
 
933
  $link = '<a href="' . $url . '" >';
wppa-maintenance.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
- * Version 8.1.00.008
7
  *
8
  */
9
 
@@ -214,7 +214,7 @@ global $wppa_endtime;
214
  for ( $i=0; $i < $wppa_session['fun-count']; $i++ ) $status .= '.';
215
  $togo = 'all';
216
  $reload = false;
217
- echo '||'.$slug.'||'.$status.'||'.$togo.'||'.$reload;
218
  wppa_exit();
219
  }
220
  break;
@@ -227,23 +227,23 @@ global $wppa_endtime;
227
  break;
228
  case 'wppa_owner_to_name_proc':
229
  if ( ! wppa_switch( 'owner_to_name' ) ) {
230
- echo __( 'Feature must be enabled in Table IV-A28 first', 'wp-photo-album-plus' ).'||'.$slug.'||||||';
231
  wppa_exit();
232
  }
233
  break;
234
  case 'wppa_move_all_photos':
235
  $fromalb = wppa_get_option( 'wppa_move_all_photos_from' );
236
  if ( ! wppa_album_exists( $fromalb ) ) {
237
- echo sprintf(__( 'From album %d does not exist', 'wp-photo-album-plus' ), $fromalb );
238
  wppa_exit();
239
  }
240
  $toalb = wppa_get_option( 'wppa_move_all_photos_to' );
241
  if ( ! wppa_album_exists( $toalb ) ) {
242
- echo sprintf(__( 'To album %d does not exist', 'wp-photo-album-plus' ), $toalb );
243
  wppa_exit();
244
  }
245
  if ( $fromalb == $toalb ) {
246
- echo __( 'From and To albums are identical', 'wp-photo-album-plus' );
247
  wppa_exit();
248
  }
249
  break;
@@ -1687,34 +1687,33 @@ function wppa_fix_source_path() {
1687
 
1688
  function wppa_log_page() {
1689
 
1690
- echo
1691
- '<div class="wrap">' .
1692
  wppa_admin_spinner() .
1693
- wp_nonce_field( 'wppa-nonce', 'wppa-nonce', true, false ) .
1694
- '<img id="icon-album" src="' . esc_url( WPPA_URL . '/img/page_green.png' ) . '" />' .
1695
- '<h1 style="display:inline" >' . htmlspecialchars( __('WP Photo Album Plus Logfile', 'wp-photo-album-plus') ) .
1696
- '<input' .
1697
- ' class="button-secundary"' .
1698
- ' style="float:right; border-radius:3px; font-size: 16px; height: 28px; padding: 0 4px;"' .
1699
- ' value="Purge logfile"' .
1700
- ' onclick="wppaAjaxUpdateOptionValue(\'errorlog_purge\', 0);jQuery(\'#wppa-maintenance-list\').fadeOut(2000);"' .
1701
- ' type="button" >' .
1702
- '</h1>' .
1703
-
1704
- wp_nonce_field('wppa-nonce', 'wppa-nonce') .
1705
-
1706
- '&nbsp;<img' .
1707
- ' id="wppa-spinner"' .
1708
- ' src="' . wppa_get_imgdir( 'spinner.gif' ) . '"' .
1709
- ' style="display:none;"' .
1710
- ' />' .
1711
- '<div id="wppa-logbody" >' .
 
1712
 
1713
  wppa_do_maintenance_popup( 'wppa_list_errorlog' ) .
1714
 
1715
- '</div>' .
1716
- '<script>setInterval(function(){wppaAjaxReplaceLog();}, 10000);</script>' .
1717
-
1718
- '</div>';
1719
 
1720
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 8.1.00.009
7
  *
8
  */
9
 
214
  for ( $i=0; $i < $wppa_session['fun-count']; $i++ ) $status .= '.';
215
  $togo = 'all';
216
  $reload = false;
217
+ wppa_echo( '||'.$slug.'||'.$status.'||'.$togo.'||'.$reload );
218
  wppa_exit();
219
  }
220
  break;
227
  break;
228
  case 'wppa_owner_to_name_proc':
229
  if ( ! wppa_switch( 'owner_to_name' ) ) {
230
+ wppa_echo( __( 'Feature must be enabled in Advanced settings -> System -> I -> Item 32 Make owner like photoname first', 'wp-photo-album-plus' ).'||'.$slug.'||||||' );
231
  wppa_exit();
232
  }
233
  break;
234
  case 'wppa_move_all_photos':
235
  $fromalb = wppa_get_option( 'wppa_move_all_photos_from' );
236
  if ( ! wppa_album_exists( $fromalb ) ) {
237
+ wppa_echo( sprintf(__( 'From album %d does not exist', 'wp-photo-album-plus' ), $fromalb ) );
238
  wppa_exit();
239
  }
240
  $toalb = wppa_get_option( 'wppa_move_all_photos_to' );
241
  if ( ! wppa_album_exists( $toalb ) ) {
242
+ wppa_echo( sprintf(__( 'To album %d does not exist', 'wp-photo-album-plus' ), $toalb ) );
243
  wppa_exit();
244
  }
245
  if ( $fromalb == $toalb ) {
246
+ wppa_echo( __( 'From and To albums are identical', 'wp-photo-album-plus' ) );
247
  wppa_exit();
248
  }
249
  break;
1687
 
1688
  function wppa_log_page() {
1689
 
1690
+ wppa_echo( '
1691
+ <div class="wrap">' .
1692
  wppa_admin_spinner() .
1693
+ wp_nonce_field( 'wppa-nonce', 'wppa-nonce', true, false ) . '
1694
+ <img id="icon-album" src="' . esc_url( WPPA_URL . '/img/page_green.png' ) . '" />
1695
+ <h1 style="display:inline" >' . htmlspecialchars( __('WP Photo Album Plus Logfile', 'wp-photo-album-plus') ) . '
1696
+ <input
1697
+ class="button-secundary"
1698
+ style="float:right; border-radius:3px; font-size: 16px; height: 28px; padding: 0 4px;"
1699
+ value="Purge logfile"
1700
+ onclick="wppaAjaxUpdateOptionValue(\'errorlog_purge\', 0);jQuery(\'#wppa-maintenance-list\').fadeOut(2000);"
1701
+ type="button" >
1702
+ </h1>' .
1703
+
1704
+ wp_nonce_field('wppa-nonce', 'wppa-nonce') . '
1705
+
1706
+ &nbsp;<img
1707
+ id="wppa-spinner"
1708
+ src="' . wppa_get_imgdir( 'spinner.gif' ) . '"
1709
+ style="display:none;"
1710
+ onload="setInterval(function(){wppaAjaxReplaceLog();}, 10000)"
1711
+ />
1712
+ <div id="wppa-logbody" >' .
1713
 
1714
  wppa_do_maintenance_popup( 'wppa_list_errorlog' ) .
1715
 
1716
+ '</div>
1717
+ </div>' );
 
 
1718
 
1719
  }
wppa-scripts.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
- * Version 8.1.00.005
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
@@ -14,517 +14,513 @@ global $wppa_lang;
14
  global $wppa_session;
15
  global $wpdb;
16
 
17
- /* wppa-utils.js */
18
- $result = '
19
- wppaDebugCounter = 0,';
20
-
21
- /* wppa.js */
22
- $result .= '
23
- wppaIsChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime),
24
- wppaOvlActivePanorama = 0,';
25
-
26
- /* Global and slideshow vars */
27
- $result .= '
28
- wppaFullValign = [],
29
- wppaFullHalign = [],
30
- wppaFullFrameDelta = [],
31
- wppaAutoColumnWidth = [],
32
- wppaAutoColumnFrac = [],
33
- wppaFadeInAfterFadeOut = false,
34
- wppaPreambule = [],
35
- wppaThumbnailPitch = [],
36
- wppaFilmStripLength = [],
37
- wppaFilmStripMargin = [],
38
- wppaFilmStripAreaDelta = [],
39
- wppaIsMini = [],
40
- wppaPortraitOnly = [],
41
- wppaLightBox = [],
42
- wppaSlideInitRunning = [],
43
- wppaSlidePause = [],
44
- wppaSlideBlank = [],
45
- wppaFilmPageSize = [],
46
- wppaAspectRatio = [],
47
- wppaFullSize = [],
48
- wppaLightboxSingle = [],
49
- wppaSiteUrl = "' . site_url() . '",
50
- wppaMasonryCols = [],
51
- wppaVideoPlaying = [],
52
- wppaAudioPlaying = [],
53
- wppaHis = 0,
54
- wppaStartHtml = [],
55
- wppaCanAjaxRender = false,
56
- wppaCanPushState = false,
57
- wppaMaxOccur = 0,
58
- wppaFirstOccur = 0,
59
- wppaUsePhotoNamesInUrls = false,
60
- wppaShareHideWhenRunning = false,
61
- wppaCommentRequiredAfterVote = true,
62
- wppaTopMoc = 0,
63
- wppaColWidth = [],
64
- wppaMCRWidth = [],
65
- wppaFotomotoHideWhenRunning = false,
66
- wppaFotomotoMinWidth = 400,
67
- wppaPhotoView = [],
68
- wppaBackgroundColorImage = "",
69
- wppaPopupLinkType = "",
70
- wppaPopupOnclick = [],
71
- wppaThumbTargetBlank = false,
72
- wppaRel = "rel",
73
- wppaEditPhotoWidth = "960",
74
- wppaThemeStyles = "",
75
- wppaStickyHeaderHeight = 0,
76
- wppaModalBgColor = "#ffffff",
77
- wppaBoxRadius = 0,
78
- wppaUploadEdit = "none",
79
- wppaPageArg = "",
80
- wppaCoverImageResponsive = [],
81
- wppaSearchBoxSelItems = [],
82
- wppaSlideWrap = [],
83
- wppaHideRightClick = false,
84
- wppaGeoZoom = 10,
85
- wppaAreaMaxFrac = 1.0,
86
- wppaNiceScroll = false,
87
- wppaIconSizeNormal = "default",
88
- wppaIconSizeStars = 24,
89
- wppaFilmInit = [],
90
- wppaResizeEndDelay = 200,
91
- wppaScrollEndDelay = 200,
92
- wppaArtmonkeyFileNotSource = false,
93
- wppaRequestInfoDialogText = "Please specify your question",
94
- wppaGlobalFsIconSize = 32,
95
- wppaFsFillcolor = "#999999",
96
- wppaFsBgcolor = "transparent",
97
- wppaSlideLinkEqual = ' . ( wppa_opt( 'slideshow_linktype' ) == 'same' ? 'true' : 'false' ) . ',
98
- _wppaId = [],
99
- _wppaRealId = [],
100
- _wppaAvg = [],
101
- _wppaDisc = [],
102
- _wppaMyr = [],
103
- _wppaVRU = [],
104
- _wppaLinkUrl = [],
105
- _wppaLinkTitle = [],
106
- _wppaLinkTarget = [],
107
- _wppaCommentHtml = [],
108
- _wppaIptcHtml = [],
109
- _wppaExifHtml = [],
110
- _wppaToTheSame = false,
111
- _wppaSlides = [],
112
- _wppaNames = [],
113
- _wppaFilmThumbTitles = [],
114
- _wppaFullNames = [],
115
- _wppaDsc = [],
116
- _wppaOgDsc = [],
117
- _wppaCurIdx = [],
118
- _wppaNxtIdx = [],
119
- _wppaTimeOut = [],
120
- _wppaSSRuns = [],
121
- _wppaFg = [],
122
- _wppaTP = [],
123
- _wppaIsBusy = [],
124
- _wppaFirst = [],
125
- _wppaVoteInProgress = false,
126
- _wppaTextDelay = ' . wppa_opt( 'animation_speed' ) . ',
127
- _wppaUrl = [],
128
- _wppaSkipRated = [],
129
- _wppaLbTitle = [],
130
- _wppaStateCount = 0,
131
- _wppaDidGoto = [],
132
- _wppaShareUrl = [],
133
- _wppaShareHtml = [],
134
- _wppaFilmNoMove = [],
135
- _wppaHiresUrl = [],
136
- _wppaIsVideo = [],
137
- _wppaVideoHtml = [],
138
- _wppaAudioHtml = [],
139
- _wppaVideoNatWidth = [],
140
- _wppaVideoNatHeight = [],
141
- _wppaWaitTexts = [],
142
- _wppaImageAlt = [],
143
- _wppaLastIdx = [],
144
- _wppaStopping = [],
145
- _wppaFilename = [],
146
- _wppaLat = [],
147
- _wppaLon = [],
148
- __wppaOverruleRun = false,
149
- wppaOvlIdx = 0,
150
- wppaOvlFirst = true,
151
- wppaOvlKbHandler = "",
152
- wppaOvlSizeHandler = "",
153
- wppaOvlPadTop = 5,
154
- wppaOvlRunning = false,
155
- wppaOvlVideoPlaying = false,
156
- wppaOvlAudioPlaying = false,
157
- wppaOvlShowLegenda = true,
158
- wppaOvlShowStartStop = true,
159
- wppaOvlRadius = 0,
160
- wppaOvlBorderWidth = 16,
161
- wppaOvlOpen = false,
162
- wppaOvlClosing = false,
163
- wppaThumbSize = 100,
164
- wppaTfMargin = 4,
165
- wppaZoomData = [],
166
- wppaSphericData = [],
167
- wppaOvlTxtHeight = 36,
168
- wppaOvlOpacity = 0.8,
169
- wppaOvlOnclickType = "none",
170
- wppaOvlTheme = "black",
171
- wppaOvlAnimSpeed = 300,
172
- wppaOvlSlideSpeed = 3000,
173
- wppaOvlFontFamily = "Helvetica",
174
- wppaOvlFontSize = "10",
175
- wppaOvlFontColor = "",
176
- wppaOvlFontWeight = "bold",
177
- wppaOvlLineHeight = "12",
178
- wppaOvlShowCounter = true,
179
- wppaOvlIsVideo = false,
180
- wppaShowLegenda = "",
181
- wppaOvlFsPhotoId = 0,
182
- wppaPhotoId = 0,
183
- wppaOvlVideoStart = false,
184
- wppaOvlAudioStart = false,
185
- wppaLastIptc = "",
186
- wppaLastExif = "",
187
- wppaIsIpad = false,
188
- wppaSvgFillcolor = "gray",
189
- wppaSvgBgcolor = "transparent",
190
- wppaSvgCornerStyle = "light",
191
- wppaCoverSpacing = 8,
192
- wppaEasingSlide = "' . wppa_opt( 'easing_slide' ) . '",
193
- wppaEasingLightbox = "' . wppa_opt( 'easing_lightbox' ) . '",
194
- wppaEasingPopup = "' . wppa_opt( 'easing_popup' ) . '",
195
- wppaEasingDefault = "swing",';
196
-
197
- /* wppa-ajax-front.js */
198
- $result .= '
199
- wppaRenderAdd = false,
200
- wppaWaitForCounter = 0,';
201
-
202
- /* wppa-lightbox.js */
203
- $result .= '
204
- wppaIsVideo = false,
205
- wppaHasAudio = false,
206
- wppaOvlIsPdf = false,
207
- wppaOvlImgs = [],
208
- wppaKbHandlerInstalled = false,
209
- wppaOvlCurIdx = 0,
210
- wppaOvlSvgInverse = false,
211
- wppaOvlHasPanoramas = false,
212
- wppaGlobalOvlPanoramaId = 0,
213
- wppaOvlBrowseOnClick = false,
214
- wppaOvlGlobal = false,
215
- wppaWppaOverlayActivated = false,
216
- wppaOvlTimer = 0,
217
- wppaSavedContainerWidth = 0,
218
- wppaSavedContainerHeight = 0,';
219
-
220
- /* wppa-touch.js */
221
- $result .= '
222
- wppaTriggerElementID = null,
223
- wppaFingerCount = 0,
224
- wppaStartX = 0,
225
- wppaStartY = 0,
226
- wppaCurX = 0,
227
- wppaCurY = 0,
228
- wppaDeltaX = 0,
229
- wppaDeltaY = 0,
230
- wppaHorzDiff = 0,
231
- wppaVertDiff = 0,
232
- wppaMinLength = 72,
233
- wppaSwipeLength = 0,
234
- wppaSwipeAngle = null,
235
- wppaSwipeDirection = null,
236
- wppaSwipeOnLightbox = false,
237
- wppaSwipeMocc = 0,
238
- wppaMobileTimeStart = 0,';
239
-
240
- /* admin-scripts.js */
241
- $result .= '
242
- wppa_moveup_url = "#",
243
- wppa_import = "' . esc_js( __( 'Import', 'wp-photo-album-plus' ) ) . '",
244
- wppa_update = "' . esc_js( __( 'Update', 'wp-photo-album-plus' ) ) . '",
245
- wppaUploadToThisAlbum = "' . esc_js( __( 'Upload to this album', 'wp-photo-album-plus' ) ) . '",
246
- wppaCloseText = "' . esc_js( __( 'Close!', 'wp-photo-album-plus' ) ) . '",
247
- wppaCropper = [],';
248
-
249
- // Find ajax url
250
- $can_ajax = 'true';
251
- switch ( wppa_opt( 'ajax_method' ) ) {
252
- case 'normal':
253
- if ( is_admin() ) $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
254
- else $ajax_url = site_url() . '/wppaajax';
255
- break;
256
- case 'wppaajax':
257
- $ajax_url = site_url() . '/wppaajax';
258
- break;
259
- case 'admin':
260
- $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
261
- break;
262
- case 'extern':
263
- if ( is_admin() ) $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
264
- else $ajax_url = WPPA_URL . '/wppa-ajax-front.php';
265
- break;
266
- case 'none':
267
- $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
268
- $can_ajax = 'false'; // works on frontend only
269
- break;
270
- }
271
-
272
- /* Language and config specific inits */
273
- $result .= '
274
- wppaImageDirectory = "' . wppa_get_imgdir() . '",
275
- wppaWppaUrl = "' . wppa_get_wppa_url() . '",
276
- wppaIncludeUrl = "' . trim( includes_url(), '/' ) . '",
277
- wppaAjaxUrl = "' . $ajax_url . '",
278
- wppaUploadUrl = "' . WPPA_UPLOAD_URL . '",
279
- wppaIsIe = ' . ( wppa_is_ie() ? 'true' : 'false' ) . ',
280
- wppaIsSafari = ' . ( wppa_is_safari() ? 'true' : 'false' ) . ',
281
- wppaSlideshowNavigationType = "' . wppa_get_navigation_type() . '",
282
- wppaAudioHeight = ' . wppa_get_audio_control_height() . ',
283
- wppaFilmThumbTitle = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Double click to start/stop slideshow running', 'wp-photo-album-plus' ) ) . '",
284
- wppaClickToView = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Click to view', 'wp-photo-album-plus' ) ) . '",
285
- wppaLang = "' . $wppa_lang . '",
286
- wppaVoteForMe = "' . __( wppa_opt( 'vote_button_text' ), 'wp-photo-album-plus' ) . '",
287
- wppaVotedForMe = "' . __( wppa_opt( 'voted_button_text' ), 'wp-photo-album-plus' ) . '",
288
- wppaDownLoad = "' . __( 'Download', 'wp-photo-album-plus' ) . '",
289
- wppaSlideShow = "' . __( 'Slideshow', 'wp-photo-album-plus' ) . '",
290
- wppaPhoto = "' . __( 'Photo', 'wp-photo-album-plus' ) . '",
291
- wppaOf = "' . __( 'of', 'wp-photo-album-plus' ) . '",
292
- wppaNextPhoto = "' . __( 'Next photo', 'wp-photo-album-plus' ) . '",
293
- wppaPreviousPhoto = "' . __( 'Previous photo', 'wp-photo-album-plus' ) . '",
294
- wppaNextP = "' . __( 'Next', 'wp-photo-album-plus' ) . '",
295
- wppaPrevP = "' . __( 'Prev.', 'wp-photo-album-plus' ) . '",
296
- wppaAvgRating = "' . __( 'Average&nbsp;rating', 'wp-photo-album-plus' ) . '",
297
- wppaMyRating = "' . __( 'My&nbsp;rating', 'wp-photo-album-plus' ) . '",
298
- wppaAvgRat = "' . __( 'Avg.', 'wp-photo-album-plus' ) . '",
299
- wppaMyRat = "' . __( 'Mine', 'wp-photo-album-plus' ) . '",
300
- wppaDislikeMsg = "' . __( 'You marked this image as inappropriate.', 'wp-photo-album-plus' ) . '",
301
- wppaStart = "' . __( 'Start', 'wp-photo-album-plus' ) . '",
302
- wppaStop = "' . __( 'Stop', 'wp-photo-album-plus' ) . '",
303
- wppaPleaseName = "' . __( 'Please enter your name', 'wp-photo-album-plus' ) . '",
304
- wppaPleaseEmail = "' . __( 'Please enter a valid email address', 'wp-photo-album-plus' ) . '",
305
- wppaPleaseComment = "' . __( 'Please enter a comment', 'wp-photo-album-plus' ) . '",
306
- wppaProcessing = "' . __( 'Processing...', 'wp-photo-album-plus' ) . '",
307
- wppaDone = "' . __( 'Done!', 'wp-photo-album-plus' ) . '",
308
- wppaUploadFailed = "' . __( 'Upload failed', 'wp-photo-album-plus' ) . '",
309
- wppaServerError = "' . __( 'Server error.', 'wp-photo-album-plus' ) . '",
310
- wppaGlobalFsIconSize = "'.wppa_opt( 'nav_icon_size_global_fs' ) . '",
311
- wppaFsFillcolor = "'.wppa_opt( 'fs_svg_color' ) . '",
312
- wppaFsBgcolor = "'.wppa_opt( 'fs_svg_bg_color' ) . '",
313
- wppaFsPolicy = "' . ( is_admin() ? 'none' : wppa_opt( 'fs_policy' ) ) . '",
314
- wppaNiceScroll = ' . ( wppa_switch( 'nicescroll' ) && ! wppa_is_mobile() ? 'true' : 'false' ) . ',
315
- wppaNieScrollOpts = {' . wppa_opt( 'nicescroll_opts' ) . '},
316
- wppaVersion = "'.$wppa_api_version.'",
317
- wppaDebug = '.( wppa_switch( 'allow_debug' ) ? 'true' : 'false' ) . ',
318
- wppaBackgroundColorImage = "'.wppa_opt( 'bgcolor_img' ) . '",
319
- wppaPopupLinkType = "'.wppa_opt( 'thumb_linktype' ) . '",
320
- wppaAnimationType = "'.wppa_opt( 'animation_type' ) . '",
321
- wppaAnimationSpeed = '.wppa_opt( 'animation_speed' ) . ',
322
- wppaThumbnailAreaDelta = '.wppa_get_thumbnail_area_delta() . ',
323
- wppaTextFrameDelta = '.wppa_get_textframe_delta() . ',
324
- wppaBoxDelta = '.wppa_get_box_delta() . ',
325
- wppaSlideShowTimeOut = '.wppa_opt( 'slideshow_timeout' ) . ',
326
- wppaFilmShowGlue = '.( wppa_switch( 'film_show_glue' ) ? 'true' : 'false' ) . ',
327
- wppaMiniTreshold = '.( wppa_opt( 'mini_treshold' ) ? wppa_opt( 'mini_treshold' ) : '0' ) . ',
328
- wppaRatingOnce = '.( wppa_switch( 'rating_change' ) || wppa_switch( 'rating_multi' ) ? 'false' : 'true' ) . ',
329
- wppaHideWhenEmpty = '.( wppa_switch( 'hide_when_empty' ) ? 'true' : 'false' ) . ',
330
- wppaBGcolorNumbar = "'.wppa_opt( 'bgcolor_numbar' ) . '",
331
- wppaBcolorNumbar = "'.wppa_opt( 'bcolor_numbar' ) . '",
332
- wppaBGcolorNumbarActive = "'.wppa_opt( 'bgcolor_numbar_active' ) . '",
333
- wppaBcolorNumbarActive = "'.wppa_opt( 'bcolor_numbar_active' ) . '",
334
- wppaFontFamilyNumbar = "'.wppa_opt( 'fontfamily_numbar' ) . '",
335
- wppaFontSizeNumbar = "'.wppa_opt( 'fontsize_numbar' ) . 'px",
336
- wppaFontColorNumbar = "'.wppa_opt( 'fontcolor_numbar' ) . '",
337
- wppaFontWeightNumbar = "'.wppa_opt( 'fontweight_numbar' ) . '",
338
- wppaFontFamilyNumbarActive = "'.wppa_opt( 'fontfamily_numbar_active' ) . '",
339
- wppaFontSizeNumbarActive = "'.wppa_opt( 'fontsize_numbar_active' ) . 'px",
340
- wppaFontColorNumbarActive = "'.wppa_opt( 'fontcolor_numbar_active' ) . '",
341
- wppaFontWeightNumbarActive = "'.wppa_opt( 'fontweight_numbar_active' ) . '",
342
- wppaNumbarMax = "'.wppa_opt( 'numbar_max' ) . '",
343
- wppaNextOnCallback = '.( wppa_switch( 'next_on_callback' ) ? 'true' : 'false' ) . ',
344
- wppaStarOpacity = '.str_replace(',', '.',( wppa_opt( 'star_opacity' )/'100' )) . ',
345
- wppaEmailRequired = "'.wppa_opt( 'comment_email_required' ) . '",
346
- wppaSlideBorderWidth = '.wppa_fbw().',
347
- wppaAllowAjax = '.$can_ajax.',
348
- wppaUsePhotoNamesInUrls = '.( wppa_switch( 'use_photo_names_in_urls' ) ? 'true' : 'false' ) . ',
349
- wppaThumbTargetBlank = '.( wppa_switch( 'thumb_blank' ) ? 'true' : 'false' ) . ',
350
- wppaRatingMax = '.wppa_opt( 'rating_max' ) . ',
351
- wppaRatingDisplayType = "'.wppa_opt( 'rating_display_type' ) . '",
352
- wppaRatingPrec = '.wppa_opt( 'rating_prec' ) . ',
353
- wppaStretch = '.( wppa_switch( 'enlarge' ) ? 'true' : 'false' ) . ',
354
- wppaMinThumbSpace = '.wppa_opt( 'tn_margin' ) . ',
355
- wppaThumbSpaceAuto = '.( wppa_switch( 'thumb_auto' ) ? 'true' : 'false' ) . ',
356
- wppaMagnifierCursor = "'.wppa_opt( 'magnifier' ) . '",
357
- wppaArtMonkyLink = "'.wppa_opt( 'art_monkey_link' ) . '",
358
- wppaAutoOpenComments = '.( wppa_switch( 'auto_open_comments' ) ? 'true' : 'false' ) . ',
359
- wppaUpdateAddressLine = '.( wppa_switch( 'update_addressline' ) ? 'true' : 'false' ) . ',
360
- wppaSlideSwipe = '.( wppa_switch( 'slide_swipe' ) ? 'true' : 'false' ) . ',
361
- wppaMaxCoverWidth = '.wppa_opt( 'max_cover_width' ) . ',
362
- wppaSlideToFullpopup = '.( wppa_opt( 'slideshow_linktype' ) == 'fullpopup' ? 'true' : 'false' ) . ',
363
- wppaComAltSize = '.wppa_opt( 'comten_alt_thumbsize' ) . ',
364
- wppaBumpViewCount = '.( wppa_switch( 'track_viewcounts' ) ? 'true' : 'false' ) . ',
365
- wppaBumpClickCount = '.( wppa_switch( 'track_clickcounts' ) ? 'true' : 'false' ) . ',
366
- wppaShareHideWhenRunning = '.( wppa_switch( 'share_hide_when_running' ) ? 'true' : 'false' ) . ',
367
- wppaFotomoto = '.( wppa_switch( 'fotomoto_on' ) ? 'true' : 'false' ) . ',
368
- wppaArtMonkeyButton = '.( wppa_opt( 'art_monkey_display' ) == 'button' ? 'true' : 'false' ) . ',
369
- wppaFotomotoHideWhenRunning = '.( wppa_switch( 'fotomoto_hide_when_running' ) ? 'true' : 'false' ) . ',
370
- wppaCommentRequiredAfterVote = '.( wppa_switch( 'vote_needs_comment' ) ? 'true' : 'false' ) . ',
371
- wppaFotomotoMinWidth = '.wppa_opt( 'fotomoto_min_width' ) . ',
372
- wppaShortQargs = '.( wppa_switch( 'use_short_qargs' ) ? 'true' : 'false' ) . ',
373
- wppaOvlHires = '.( wppa_switch( 'lb_hres' ) ? 'true' : 'false' ) . ',
374
- wppaSlideVideoStart = '.( wppa_switch( 'start_slide_video' ) ? 'true' : 'false' ) . ',
375
- wppaSlideAudioStart = '.( wppa_switch( 'start_slide_audio' ) ? 'true' : 'false' ) . ',
376
- wppaRel = "data-rel",
377
- wppaOvlRadius = '.wppa_opt( 'ovl_border_radius' ) . ',
378
- wppaOvlBorderWidth = '.wppa_opt( 'ovl_border_width' ) . ',
379
- wppaEditPhotoWidth = "'.(wppa_opt( 'upload_edit' ) == 'new' ? 500 : 960) . '",
380
- wppaThemeStyles = "'.(wppa_switch( 'upload_edit_theme_css' ) ? get_stylesheet_uri() : '' ) . '",
381
- wppaStickyHeaderHeight = '.wppa_opt( 'sticky_header_size' ) . ',
382
- wppaRenderModal = ' . ( wppa_switch( 'ajax_render_modal' ) ? 'true' : 'false' ) . ',
383
- wppaModalQuitImg = "url(' . wppa_get_imgdir( 'smallcross-' . wppa_opt( 'ovl_theme' ) . '.gif' ) . ' )",
384
- wppaBoxRadius = "' . wppa_opt( 'bradius' ) . '",
385
- wppaModalBgColor = "' . wppa_opt( 'bgcolor_modal' ) . '",
386
- wppaUploadEdit = "' . wppa_opt( 'upload_edit' ) . '",
387
- wppaSvgFillcolor = "' . wppa_opt( 'svg_color' ) . '",
388
- wppaSvgBgcolor = "' . wppa_opt( 'svg_bg_color' ) . '",
389
- wppaOvlSvgFillcolor = "' . wppa_opt( 'ovl_svg_color' ) . '",
390
- wppaOvlSvgBgcolor = "' . wppa_opt( 'ovl_svg_bg_color' ) . '",
391
- wppaSvgCornerStyle = "' . wppa_opt( 'icon_corner_style' ) . '",
392
- wppaHideRightClick = ' . ( wppa_switch( 'no_rightclick' ) ? 'true' : 'false' ) . ',
393
- wppaGeoZoom = ' . wppa_opt( 'geo_zoom' ) . ',
394
- wppaLazyLoad = ' . ( wppa_lazy() ? 'true' : 'false' ) . ',
395
- wppaAreaMaxFrac = ' . ( wppa_opt( 'area_size' ) < 1 ? wppa_opt( 'area_size' ) : 1.0 ) . ',
396
- wppaIconSizeNormal = "' . wppa_opt( 'nav_icon_size' ) . '",
397
- wppaIconSizeSlide = "' . wppa_opt( 'nav_icon_size_slide' ) . '",
398
- wppaResponseSpeed = ' . wppa_opt( 'response_speed' ) . ',
399
- wppaExtendedResizeCount = ' . wppa_opt( 'extended_resize_count' ) . ',
400
- wppaExtendedResizeDelay = ' . wppa_opt( 'extended_resize_delay' ) . ',
401
- wppaCoverSpacing = ' . wppa_opt( 'cover_spacing' ) . ',
402
- wppaFilmonlyContinuous = ' . ( wppa_switch( 'filmonly_continuous' ) ? 'true' : 'false' ) . ',
403
- wppaNoAnimateOnMobile = ' . ( wppa_switch( 'no_animate_on_mobile' ) ? 'true' : 'false' ) . ',
404
- wppaAjaxScroll = ' . ( wppa_switch( 'ajax_scroll' ) && ! is_admin() ? 'true' : 'false' ) . ',
405
- wppaThumbSize = ' . wppa_opt( 'thumbsize' ) . ',
406
- wppaTfMargin = ' . wppa_opt( 'tn_margin' ) . ',
407
- wppaArtmonkeyFileNotSource = ' . ( wppa_opt( 'art_monkey_link' ) == 'file' &&
408
- wppa_opt( 'art_monkey_display' ) == 'text' &&
409
- ! wppa_switch( 'artmonkey_use_source' ) ? 'true' : 'false' ) . ',
410
- wppaRequestInfoDialogText = "' . wppa_opt( 'request_info_text' ) . '",
411
- wppaThumbAspect = ' . wppa_thumb_asp() . ',';
412
-
413
- /* Lightbox vars */
414
- $fontsize_lightbox = wppa_opt( 'fontsize_lightbox' ) ? wppa_opt( 'fontsize_lightbox' ) : '10';
415
- $d = wppa_switch( 'ovl_show_counter') ? 1 : 0;
416
- $ovlh = wppa_opt( 'ovl_txt_lines' ) == 'auto' ? 'auto' : ((wppa_opt( 'ovl_txt_lines' ) + $d) * ($fontsize_lightbox + 2));
417
- $lb_global = '';
418
- if ( wppa_switch( 'lightbox_global' ) && ! is_admin() ) {
419
- if ( wppa_switch( 'lightbox_global_set' ) ) {
420
- $lb_global = 'wppa[single]';
421
- }
422
- else {
423
- $lb_global = 'wppa';
424
- }
425
- }
426
-
427
- $result .= '
428
- wppaOvlTxtHeight = "'.$ovlh.'",
429
- wppaOvlOpacity = '.(wppa_opt( 'ovl_opacity' )/100).',
430
- wppaOvlOnclickType = "'.wppa_opt( 'ovl_onclick' ).'",
431
- wppaOvlTheme = "'.wppa_opt( 'ovl_theme' ).'",
432
- wppaOvlAnimSpeed = '.wppa_opt( 'ovl_anim' ).',
433
- wppaOvlSlideSpeed = '.wppa_opt( 'ovl_slide' ).',
434
- wppaVer4WindowWidth = 800,
435
- wppaVer4WindowHeight = 600,
436
- wppaOvlShowCounter = '.( wppa_switch( 'ovl_show_counter') ? 'true' : 'false' ).',
437
- '.( wppa_opt( 'fontfamily_lightbox' ) ? 'wppaOvlFontFamily = "'.wppa_opt( 'fontfamily_lightbox' ).'",' : '').'
438
- wppaOvlFontSize = "'.$fontsize_lightbox.'",
439
- '.( wppa_opt( 'fontcolor_lightbox' ) ? 'wppaOvlFontColor = "'.wppa_opt( 'fontcolor_lightbox' ).'",' : '').'
440
- '.( wppa_opt( 'fontweight_lightbox' ) ? 'wppaOvlFontWeight = "'.wppa_opt( 'fontweight_lightbox' ).'",' : '').'
441
- '.( wppa_opt( 'fontsize_lightbox' ) ? 'wppaOvlLineHeight = "'.(wppa_opt( 'fontsize_lightbox' ) + '2').'",' : '').'
442
- wppaOvlVideoStart = '.( wppa_switch( 'ovl_video_start' ) ? 'true' : 'false' ).',
443
- wppaOvlAudioStart = '.( wppa_switch( 'ovl_audio_start' ) ? 'true' : 'false' ).',
444
- wppaOvlShowStartStop = '.( wppa_switch( 'ovl_show_startstop' ) ? 'true' : 'false' ).',
445
- wppaIsMobile = '.( wppa_is_mobile() ? 'true' : 'false' ).',
446
- wppaIsIpad = '.( wppa_is_ipad() ? 'true' : 'false' ).',
447
- wppaOvlIconSize = "'.wppa_opt( 'nav_icon_size_lightbox' ).'px",
448
- wppaOvlBrowseOnClick = '.( wppa_switch( 'ovl_browse_on_click' ) ? 'true' : 'false' ).',
449
- wppaOvlGlobal = ' . ( $lb_global ? '"' . $lb_global . '"' : 'false' ) . ',
450
- wppaPhotoDirectory = "'.WPPA_UPLOAD_URL.'/",
451
- wppaThumbDirectory = "'.WPPA_UPLOAD_URL.'/thumbs/",
452
- wppaTempDirectory = "'.WPPA_UPLOAD_URL.'/temp/",
453
- wppaFontDirectory = "'.WPPA_UPLOAD_URL.'/fonts/",
454
- wppaNoPreview = "'.__('No Preview available', 'wp-photo-album-plus').'",
455
- wppaUIERR = "'.__('Unimplemented virtual album', 'wp-photo-album-plus').'",
456
- wppaTxtProcessing = "'.__('Processing...', 'wp-photo-album-plus').'",
457
- wppaTxtDone = "'.__('Done!', 'wp-photo-album-plus').'",
458
- wppaTxtErrUnable = "'.__( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ).'",
459
- wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";';
460
-
461
- // Tinymce photo
462
- if ( wppa_switch( 'photo_shortcode_enabled' ) ) {
463
- $id = $wpdb->get_var( "SELECT id FROM $wpdb->wppa_photos
464
- WHERE ext <> 'xxx'
465
- AND panorama = 0
466
- ORDER BY timestamp DESC
467
- LIMIT 1" );
468
-
469
- // Fake we are in a widget, to prevent wppa_get_picture_html() from bumping viewcount
470
- wppa( 'in_widget', true );
471
-
472
- $result .= '
473
- wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
474
- wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";';
475
-
476
- // Reset faked widget
477
- wppa( 'in_widget', false );
478
- }
479
-
480
- // The photo views cache
481
- if ( isset( $wppa_session['photo'] ) ) {
482
- foreach ( array_keys( $wppa_session['photo'] ) as $p ) {
483
- $result .= '
484
- wppaPhotoView[' . $p . '] = true;';
485
- }
486
- }
487
-
488
- // Format
489
- $result = wppa_compress_js( $result );
490
- $result = '
491
- <!-- wppa js inits -->
492
- <script>
493
- ' . $result . '
494
- </script>
495
- <!-- End wppa js inits -->
496
- ';
497
- echo $result;
498
  }
499
  add_action( 'wp_head', 'wppa_initialize_javascript', 2 );
500
  add_action( 'admin_head', 'wppa_initialize_javascript', 2 );
501
 
502
  function wppa_thumb_asp() {
503
 
504
- $aspect = 1;
505
- if ( wppa_opt( 'thumb_aspect' ) != '0:0:none' ) {
506
- $t = explode( ':', wppa_opt( 'thumb_aspect' ) );
507
- $aspect = $t[0] / $t[1];
508
- }
509
- elseif ( wppa_opt( 'resize_to' ) != '-1' && wppa_opt( 'resize_to' ) != '0' ) {
510
- $t = explode( 'x', wppa_opt( 'resize_to' ) );
511
- $aspect = $t[1] / $t[0];
512
- }
513
- else {
514
- $aspect = wppa_opt( 'maxheight' ) / wppa_opt( 'fullsize' );
515
- }
516
- return $aspect;
517
  }
518
 
519
  function wppa_fbw() {
520
 
521
- if ( is_numeric( wppa_opt( 'fullimage_border_width' ) ) ) {
522
- $fbw = wppa_opt( 'fullimage_border_width' ) + '1';
523
- }
524
- else {
525
- $fbw = '0';
526
- }
527
- return $fbw;
528
  }
529
 
530
  /* LOAD JAVASCRIPT */
@@ -536,84 +532,84 @@ global $wppa_api_version;
536
  global $wppa_lang;
537
  global $wppa_opt;
538
 
539
- $footer = wppa_is_defer();
540
-
541
- // WPPA+ Javascript files.
542
- // All wppa+ js files come in 2 flavours: the normal version and a minified version.
543
- // If the minified version is available, it will be loaded, else the normal version.
544
- // If you want to debug js, just delete the minified version; this will cause the normal
545
- // - readable - version to be loaded.
546
-
547
- // The js dependancies
548
- $js_depts = array( 'jquery',
549
- 'jquery-form',
550
- 'jquery-masonry',
551
- 'jquery-ui-dialog',
552
- );
553
-
554
- // First see if an 'all' file is present. This is to save http requests
555
- $all_file = dirname( __FILE__ ) . '/js/wppa-all.js';
556
- if ( wppa_is_file( $all_file ) ) {
557
- $js_ver = date( "ymd-Gis", filemtime( $all_file ) );
558
- wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa-all.js', $js_depts, $js_ver, $footer );
559
- }
560
-
561
- // No all file, do them one by one
562
- else {
563
- $js_files = array(
564
- 'wppa-utils',
565
- 'wppa',
566
- 'wppa-slideshow',
567
- 'wppa-ajax-front',
568
- 'wppa-lightbox',
569
- 'wppa-popup',
570
- 'wppa-touch',
571
- 'wppa-zoom',
572
- 'wppa-spheric',
573
- );
574
-
575
- foreach ( array_keys( $js_files ) as $idx ) {
576
- if ( is_file( dirname( __FILE__ ) . '/js/' . $js_files[$idx] . '.min.js' ) ) {
577
- $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.min.js' ) );
578
- wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.min.js', $js_depts, $js_ver, $footer );
579
- }
580
- else {
581
- $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.js' ) );
582
- wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.js', $js_depts, $js_ver, $footer );
583
- }
584
- }
585
- }
586
-
587
- // google maps
588
- if ( wppa_switch( 'save_gpx' ) && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false ) {
589
- $key = wppa_opt( 'map_apikey' );
590
- wp_enqueue_script( 'wppa-geo',
591
- 'https://maps.googleapis.com/maps/api/js?' . ( $key ? 'key=' . $key : 'v=3.exp' ),
592
- '',
593
- $wppa_api_version,
594
- $footer );
595
- }
596
-
597
- // Nicescroller
598
- if ( ! wppa_is_mobile() && ( wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ) || wppa_switch( 'load_nicescroller' ) ) ) {
599
- $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
600
- wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, $js_depts, $wppa_api_version, $footer );
601
- $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
602
- wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
603
- }
604
-
605
- // Easing we need, borrow it from nicescroller if not already loaded
606
- else {
607
- $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
608
- wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
609
- }
610
-
611
- // Panorama
612
- if ( wppa_switch( 'enable_panorama' ) ) {
613
- $three_url = WPPA_URL . '/vendor/three/three.min.js';
614
- $ver = '122';
615
- wp_enqueue_script( 'wppa-three-min-js', $three_url, $js_depts, $wppa_api_version, $footer );
616
- }
617
 
618
  }
619
 
@@ -623,42 +619,41 @@ function wppa_js( $txt ) {
623
  global $wppa_js_page_data;
624
  global $wppa_script_open;
625
 
626
- // Validate input
627
- if ( wppa_switch( 'allow_debug' ) ) {
628
- $i = 0;
629
- $arr = array( '[' => 0, ']' => 0, '(' => 0, ')' => 0, '{' => 0, '}' => 0 );
630
- $t = array_keys( $arr );
631
- while ( $i < strlen( $txt ) ) {
632
- $c = substr( $txt, $i, 1 );
633
- if ( in_array( $c, $t ) ) $arr[$c]++;
634
- $i++;
635
- }
636
- for ( $i = 0; $i < 6; $i += 2 ) {
637
- if ( $arr[$t[$i]] != $arr[$t[$i + 1]] ) {
638
- wppa_log( 'err', 'Unmatched ' . $t[$i] . ' - ' . $t[$i + 1] . ' in ' . $txt . ' (wppa_js)', true );
639
- }
640
- }
641
- if ( substr( $txt, -1 ) != ';' ) {
642
- wppa_log( 'err', 'Missing ; in ' . $txt . ' (wppa_js)', true );
643
- $txt .= ';';
644
- }
645
- }
646
-
647
- // Do it
648
- if ( ! wppa_is_defer() || wppa_is_caching() ) {
649
- wppa_out( '
650
- <script>' . $txt . '</script>' );
651
- return;
652
- }
653
-
654
- if ( ! $wppa_script_open ) {
655
- $wppa_js_page_data = $txt;
656
- $wppa_script_open = true;
657
- }
658
- else {
659
- $wppa_js_page_data .= '
660
- ' . $txt;
661
- }
662
  }
663
 
664
  // Output page specific script in the footer.
@@ -669,41 +664,41 @@ function wppa_print_psjs() {
669
  global $wppa_js_page_data;
670
  global $wppa_script_open;
671
 
672
- if ( $wppa_js_page_data ) {
673
- echo '
674
- <!-- WPPA Page specific js -->
675
- <script>' . wppa_compress_js( $wppa_js_page_data ) . '
676
- </script>
677
- <!-- End WPPA Page specific js -->
678
- ';
679
 
680
- $wppa_js_page_data = '';
681
- $wppa_script_open = false;
682
- }
683
  }
684
 
685
- // Compress javascript
686
  function wppa_compress_js( $txt ) {
687
 
688
- $result = $txt;
689
- $result = str_replace( "\t", "", $result );
690
- $result = str_replace( "\r\n", "", $result );
691
- $result = str_replace( " = ", "=", $result );
692
- $result = str_replace( "; ", ";", $result );
693
- $result = str_replace( "/*", "\r\n/*", $result );
694
 
695
- return $result;
696
  }
697
 
698
  // Decide if we do defer js
699
  function wppa_is_defer() {
700
 
701
- return true;
702
 
703
- if ( is_admin() ) return true;
704
- if ( ! wppa_switch( 'defer_javascript' ) ) return false;
705
- if ( wppa( 'ajax' ) ) return false;
706
- if ( wppa( 'cron' ) ) return false;
707
- if ( wppa( 'is_slide' ) || wppa( 'is_slideonly' ) || wppa( 'is_filmonly' ) ) return false;
708
- return true;
709
  }
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
+ * Version 8.1.00.009
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
14
  global $wppa_session;
15
  global $wpdb;
16
 
17
+ /* wppa-utils.js */
18
+ $result = '
19
+ wppaDebugCounter = 0,';
20
+
21
+ /* wppa.js */
22
+ $result .= '
23
+ wppaIsChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime),
24
+ wppaOvlActivePanorama = 0,';
25
+
26
+ /* Global and slideshow vars */
27
+ $result .= '
28
+ wppaFullValign = [],
29
+ wppaFullHalign = [],
30
+ wppaFullFrameDelta = [],
31
+ wppaAutoColumnWidth = [],
32
+ wppaAutoColumnFrac = [],
33
+ wppaFadeInAfterFadeOut = false,
34
+ wppaPreambule = [],
35
+ wppaThumbnailPitch = [],
36
+ wppaFilmStripLength = [],
37
+ wppaFilmStripMargin = [],
38
+ wppaFilmStripAreaDelta = [],
39
+ wppaIsMini = [],
40
+ wppaPortraitOnly = [],
41
+ wppaLightBox = [],
42
+ wppaSlideInitRunning = [],
43
+ wppaSlidePause = [],
44
+ wppaSlideBlank = [],
45
+ wppaFilmPageSize = [],
46
+ wppaAspectRatio = [],
47
+ wppaFullSize = [],
48
+ wppaLightboxSingle = [],
49
+ wppaSiteUrl = "' . site_url() . '",
50
+ wppaMasonryCols = [],
51
+ wppaVideoPlaying = [],
52
+ wppaAudioPlaying = [],
53
+ wppaHis = 0,
54
+ wppaStartHtml = [],
55
+ wppaCanAjaxRender = false,
56
+ wppaCanPushState = false,
57
+ wppaMaxOccur = 0,
58
+ wppaFirstOccur = 0,
59
+ wppaUsePhotoNamesInUrls = false,
60
+ wppaShareHideWhenRunning = false,
61
+ wppaCommentRequiredAfterVote = true,
62
+ wppaTopMoc = 0,
63
+ wppaColWidth = [],
64
+ wppaMCRWidth = [],
65
+ wppaFotomotoHideWhenRunning = false,
66
+ wppaFotomotoMinWidth = 400,
67
+ wppaPhotoView = [],
68
+ wppaBackgroundColorImage = "",
69
+ wppaPopupLinkType = "",
70
+ wppaPopupOnclick = [],
71
+ wppaThumbTargetBlank = false,
72
+ wppaRel = "rel",
73
+ wppaEditPhotoWidth = "960",
74
+ wppaThemeStyles = "",
75
+ wppaStickyHeaderHeight = 0,
76
+ wppaModalBgColor = "#ffffff",
77
+ wppaBoxRadius = 0,
78
+ wppaUploadEdit = "none",
79
+ wppaPageArg = "",
80
+ wppaCoverImageResponsive = [],
81
+ wppaSearchBoxSelItems = [],
82
+ wppaSlideWrap = [],
83
+ wppaHideRightClick = false,
84
+ wppaGeoZoom = 10,
85
+ wppaAreaMaxFrac = 1.0,
86
+ wppaNiceScroll = false,
87
+ wppaIconSizeNormal = "default",
88
+ wppaIconSizeStars = 24,
89
+ wppaFilmInit = [],
90
+ wppaResizeEndDelay = 200,
91
+ wppaScrollEndDelay = 200,
92
+ wppaArtmonkeyFileNotSource = false,
93
+ wppaRequestInfoDialogText = "Please specify your question",
94
+ wppaGlobalFsIconSize = 32,
95
+ wppaFsFillcolor = "#999999",
96
+ wppaFsBgcolor = "transparent",
97
+ wppaSlideLinkEqual = ' . ( wppa_opt( 'slideshow_linktype' ) == 'same' ? 'true' : 'false' ) . ',
98
+ _wppaId = [],
99
+ _wppaRealId = [],
100
+ _wppaAvg = [],
101
+ _wppaDisc = [],
102
+ _wppaMyr = [],
103
+ _wppaVRU = [],
104
+ _wppaLinkUrl = [],
105
+ _wppaLinkTitle = [],
106
+ _wppaLinkTarget = [],
107
+ _wppaCommentHtml = [],
108
+ _wppaIptcHtml = [],
109
+ _wppaExifHtml = [],
110
+ _wppaToTheSame = false,
111
+ _wppaSlides = [],
112
+ _wppaNames = [],
113
+ _wppaFilmThumbTitles = [],
114
+ _wppaFullNames = [],
115
+ _wppaDsc = [],
116
+ _wppaOgDsc = [],
117
+ _wppaCurIdx = [],
118
+ _wppaNxtIdx = [],
119
+ _wppaTimeOut = [],
120
+ _wppaSSRuns = [],
121
+ _wppaFg = [],
122
+ _wppaTP = [],
123
+ _wppaIsBusy = [],
124
+ _wppaFirst = [],
125
+ _wppaVoteInProgress = false,
126
+ _wppaTextDelay = ' . wppa_opt( 'animation_speed' ) . ',
127
+ _wppaUrl = [],
128
+ _wppaSkipRated = [],
129
+ _wppaLbTitle = [],
130
+ _wppaStateCount = 0,
131
+ _wppaDidGoto = [],
132
+ _wppaShareUrl = [],
133
+ _wppaShareHtml = [],
134
+ _wppaFilmNoMove = [],
135
+ _wppaHiresUrl = [],
136
+ _wppaIsVideo = [],
137
+ _wppaVideoHtml = [],
138
+ _wppaAudioHtml = [],
139
+ _wppaVideoNatWidth = [],
140
+ _wppaVideoNatHeight = [],
141
+ _wppaWaitTexts = [],
142
+ _wppaImageAlt = [],
143
+ _wppaLastIdx = [],
144
+ _wppaStopping = [],
145
+ _wppaFilename = [],
146
+ _wppaLat = [],
147
+ _wppaLon = [],
148
+ __wppaOverruleRun = false,
149
+ wppaOvlIdx = 0,
150
+ wppaOvlFirst = true,
151
+ wppaOvlKbHandler = "",
152
+ wppaOvlSizeHandler = "",
153
+ wppaOvlPadTop = 5,
154
+ wppaOvlRunning = false,
155
+ wppaOvlVideoPlaying = false,
156
+ wppaOvlAudioPlaying = false,
157
+ wppaOvlShowLegenda = true,
158
+ wppaOvlShowStartStop = true,
159
+ wppaOvlRadius = 0,
160
+ wppaOvlBorderWidth = 16,
161
+ wppaOvlOpen = false,
162
+ wppaOvlClosing = false,
163
+ wppaThumbSize = 100,
164
+ wppaTfMargin = 4,
165
+ wppaZoomData = [],
166
+ wppaSphericData = [],
167
+ wppaOvlTxtHeight = 36,
168
+ wppaOvlOpacity = 0.8,
169
+ wppaOvlOnclickType = "none",
170
+ wppaOvlTheme = "black",
171
+ wppaOvlAnimSpeed = 300,
172
+ wppaOvlSlideSpeed = 3000,
173
+ wppaOvlFontFamily = "Helvetica",
174
+ wppaOvlFontSize = "10",
175
+ wppaOvlFontColor = "",
176
+ wppaOvlFontWeight = "bold",
177
+ wppaOvlLineHeight = "12",
178
+ wppaOvlShowCounter = true,
179
+ wppaOvlIsVideo = false,
180
+ wppaShowLegenda = "",
181
+ wppaOvlFsPhotoId = 0,
182
+ wppaPhotoId = 0,
183
+ wppaOvlVideoStart = false,
184
+ wppaOvlAudioStart = false,
185
+ wppaLastIptc = "",
186
+ wppaLastExif = "",
187
+ wppaIsIpad = false,
188
+ wppaSvgFillcolor = "gray",
189
+ wppaSvgBgcolor = "transparent",
190
+ wppaSvgCornerStyle = "light",
191
+ wppaCoverSpacing = 8,
192
+ wppaEasingSlide = "' . wppa_opt( 'easing_slide' ) . '",
193
+ wppaEasingLightbox = "' . wppa_opt( 'easing_lightbox' ) . '",
194
+ wppaEasingPopup = "' . wppa_opt( 'easing_popup' ) . '",
195
+ wppaEasingDefault = "swing",';
196
+
197
+ /* wppa-ajax-front.js */
198
+ $result .= '
199
+ wppaRenderAdd = false,
200
+ wppaWaitForCounter = 0,';
201
+
202
+ /* wppa-lightbox.js */
203
+ $result .= '
204
+ wppaIsVideo = false,
205
+ wppaHasAudio = false,
206
+ wppaOvlIsPdf = false,
207
+ wppaOvlImgs = [],
208
+ wppaKbHandlerInstalled = false,
209
+ wppaOvlCurIdx = 0,
210
+ wppaOvlSvgInverse = false,
211
+ wppaOvlHasPanoramas = false,
212
+ wppaGlobalOvlPanoramaId = 0,
213
+ wppaOvlBrowseOnClick = false,
214
+ wppaOvlGlobal = false,
215
+ wppaWppaOverlayActivated = false,
216
+ wppaOvlTimer = 0,
217
+ wppaSavedContainerWidth = 0,
218
+ wppaSavedContainerHeight = 0,';
219
+
220
+ /* wppa-touch.js */
221
+ $result .= '
222
+ wppaTriggerElementID = null,
223
+ wppaFingerCount = 0,
224
+ wppaStartX = 0,
225
+ wppaStartY = 0,
226
+ wppaCurX = 0,
227
+ wppaCurY = 0,
228
+ wppaDeltaX = 0,
229
+ wppaDeltaY = 0,
230
+ wppaHorzDiff = 0,
231
+ wppaVertDiff = 0,
232
+ wppaMinLength = 72,
233
+ wppaSwipeLength = 0,
234
+ wppaSwipeAngle = null,
235
+ wppaSwipeDirection = null,
236
+ wppaSwipeOnLightbox = false,
237
+ wppaSwipeMocc = 0,
238
+ wppaMobileTimeStart = 0,';
239
+
240
+ /* admin-scripts.js */
241
+ $result .= '
242
+ wppa_moveup_url = "#",
243
+ wppa_import = "' . esc_js( __( 'Import', 'wp-photo-album-plus' ) ) . '",
244
+ wppa_update = "' . esc_js( __( 'Update', 'wp-photo-album-plus' ) ) . '",
245
+ wppaUploadToThisAlbum = "' . esc_js( __( 'Upload to this album', 'wp-photo-album-plus' ) ) . '",
246
+ wppaCloseText = "' . esc_js( __( 'Close!', 'wp-photo-album-plus' ) ) . '",
247
+ wppaCropper = [],';
248
+
249
+ // Find ajax url
250
+ $method = wppa_opt( 'ajax_method' );
251
+ $can_ajax = 'true';
252
+ if ( wppa_is_file( dirname( __FILE__ ) . '/wppa-ajax-front.php' ) && $method == 'extern' ) {
253
+ if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php';
254
+ else $al = WPPA_URL . '/wppa-ajax-front.php';
255
+ }
256
+ else switch ( $method ) {
257
+ case 'admin':
258
+ case 'none':
259
+ $al = site_url() . '/wp-admin/admin-ajax.php';
260
+ break;
261
+ default: // 'normal', and possibly 'extern' when file does not exist
262
+ if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php';
263
+ else $al = site_url() . '/wppaajax';
264
+ break;
265
+ }
266
+ $ajax_url = $al;
267
+
268
+ /* Language and config specific inits */
269
+ $result .= '
270
+ wppaImageDirectory = "' . wppa_get_imgdir() . '",
271
+ wppaWppaUrl = "' . wppa_get_wppa_url() . '",
272
+ wppaIncludeUrl = "' . trim( includes_url(), '/' ) . '",
273
+ wppaAjaxUrl = "' . $ajax_url . '",
274
+ wppaUploadUrl = "' . WPPA_UPLOAD_URL . '",
275
+ wppaIsIe = ' . ( wppa_is_ie() ? 'true' : 'false' ) . ',
276
+ wppaIsSafari = ' . ( wppa_is_safari() ? 'true' : 'false' ) . ',
277
+ wppaSlideshowNavigationType = "' . wppa_get_navigation_type() . '",
278
+ wppaAudioHeight = ' . wppa_get_audio_control_height() . ',
279
+ wppaFilmThumbTitle = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Double click to start/stop slideshow running', 'wp-photo-album-plus' ) ) . '",
280
+ wppaClickToView = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Click to view', 'wp-photo-album-plus' ) ) . '",
281
+ wppaLang = "' . $wppa_lang . '",
282
+ wppaVoteForMe = "' . __( wppa_opt( 'vote_button_text' ), 'wp-photo-album-plus' ) . '",
283
+ wppaVotedForMe = "' . __( wppa_opt( 'voted_button_text' ), 'wp-photo-album-plus' ) . '",
284
+ wppaDownLoad = "' . __( 'Download', 'wp-photo-album-plus' ) . '",
285
+ wppaSlideShow = "' . __( 'Slideshow', 'wp-photo-album-plus' ) . '",
286
+ wppaPhoto = "' . __( 'Photo', 'wp-photo-album-plus' ) . '",
287
+ wppaOf = "' . __( 'of', 'wp-photo-album-plus' ) . '",
288
+ wppaNextPhoto = "' . __( 'Next photo', 'wp-photo-album-plus' ) . '",
289
+ wppaPreviousPhoto = "' . __( 'Previous photo', 'wp-photo-album-plus' ) . '",
290
+ wppaNextP = "' . __( 'Next', 'wp-photo-album-plus' ) . '",
291
+ wppaPrevP = "' . __( 'Prev.', 'wp-photo-album-plus' ) . '",
292
+ wppaAvgRating = "' . __( 'Average&nbsp;rating', 'wp-photo-album-plus' ) . '",
293
+ wppaMyRating = "' . __( 'My&nbsp;rating', 'wp-photo-album-plus' ) . '",
294
+ wppaAvgRat = "' . __( 'Avg.', 'wp-photo-album-plus' ) . '",
295
+ wppaMyRat = "' . __( 'Mine', 'wp-photo-album-plus' ) . '",
296
+ wppaDislikeMsg = "' . __( 'You marked this image as inappropriate.', 'wp-photo-album-plus' ) . '",
297
+ wppaStart = "' . __( 'Start', 'wp-photo-album-plus' ) . '",
298
+ wppaStop = "' . __( 'Stop', 'wp-photo-album-plus' ) . '",
299
+ wppaPleaseName = "' . __( 'Please enter your name', 'wp-photo-album-plus' ) . '",
300
+ wppaPleaseEmail = "' . __( 'Please enter a valid email address', 'wp-photo-album-plus' ) . '",
301
+ wppaPleaseComment = "' . __( 'Please enter a comment', 'wp-photo-album-plus' ) . '",
302
+ wppaProcessing = "' . __( 'Processing...', 'wp-photo-album-plus' ) . '",
303
+ wppaDone = "' . __( 'Done!', 'wp-photo-album-plus' ) . '",
304
+ wppaUploadFailed = "' . __( 'Upload failed', 'wp-photo-album-plus' ) . '",
305
+ wppaServerError = "' . __( 'Server error.', 'wp-photo-album-plus' ) . '",
306
+ wppaGlobalFsIconSize = "'.wppa_opt( 'nav_icon_size_global_fs' ) . '",
307
+ wppaFsFillcolor = "'.wppa_opt( 'fs_svg_color' ) . '",
308
+ wppaFsBgcolor = "'.wppa_opt( 'fs_svg_bg_color' ) . '",
309
+ wppaFsPolicy = "' . ( is_admin() ? 'none' : wppa_opt( 'fs_policy' ) ) . '",
310
+ wppaNiceScroll = ' . ( wppa_switch( 'nicescroll' ) && ! wppa_is_mobile() ? 'true' : 'false' ) . ',
311
+ wppaNieScrollOpts = {' . wppa_opt( 'nicescroll_opts' ) . '},
312
+ wppaVersion = "'.$wppa_api_version.'",
313
+ wppaDebug = '.( wppa_switch( 'allow_debug' ) ? 'true' : 'false' ) . ',
314
+ wppaBackgroundColorImage = "'.wppa_opt( 'bgcolor_img' ) . '",
315
+ wppaPopupLinkType = "'.wppa_opt( 'thumb_linktype' ) . '",
316
+ wppaAnimationType = "'.wppa_opt( 'animation_type' ) . '",
317
+ wppaAnimationSpeed = '.wppa_opt( 'animation_speed' ) . ',
318
+ wppaThumbnailAreaDelta = '.wppa_get_thumbnail_area_delta() . ',
319
+ wppaTextFrameDelta = '.wppa_get_textframe_delta() . ',
320
+ wppaBoxDelta = '.wppa_get_box_delta() . ',
321
+ wppaSlideShowTimeOut = '.wppa_opt( 'slideshow_timeout' ) . ',
322
+ wppaFilmShowGlue = '.( wppa_switch( 'film_show_glue' ) ? 'true' : 'false' ) . ',
323
+ wppaMiniTreshold = '.( wppa_opt( 'mini_treshold' ) ? wppa_opt( 'mini_treshold' ) : '0' ) . ',
324
+ wppaRatingOnce = '.( wppa_switch( 'rating_change' ) || wppa_switch( 'rating_multi' ) ? 'false' : 'true' ) . ',
325
+ wppaHideWhenEmpty = '.( wppa_switch( 'hide_when_empty' ) ? 'true' : 'false' ) . ',
326
+ wppaBGcolorNumbar = "'.wppa_opt( 'bgcolor_numbar' ) . '",
327
+ wppaBcolorNumbar = "'.wppa_opt( 'bcolor_numbar' ) . '",
328
+ wppaBGcolorNumbarActive = "'.wppa_opt( 'bgcolor_numbar_active' ) . '",
329
+ wppaBcolorNumbarActive = "'.wppa_opt( 'bcolor_numbar_active' ) . '",
330
+ wppaFontFamilyNumbar = "'.wppa_opt( 'fontfamily_numbar' ) . '",
331
+ wppaFontSizeNumbar = "'.wppa_opt( 'fontsize_numbar' ) . 'px",
332
+ wppaFontColorNumbar = "'.wppa_opt( 'fontcolor_numbar' ) . '",
333
+ wppaFontWeightNumbar = "'.wppa_opt( 'fontweight_numbar' ) . '",
334
+ wppaFontFamilyNumbarActive = "'.wppa_opt( 'fontfamily_numbar_active' ) . '",
335
+ wppaFontSizeNumbarActive = "'.wppa_opt( 'fontsize_numbar_active' ) . 'px",
336
+ wppaFontColorNumbarActive = "'.wppa_opt( 'fontcolor_numbar_active' ) . '",
337
+ wppaFontWeightNumbarActive = "'.wppa_opt( 'fontweight_numbar_active' ) . '",
338
+ wppaNumbarMax = "'.wppa_opt( 'numbar_max' ) . '",
339
+ wppaNextOnCallback = '.( wppa_switch( 'next_on_callback' ) ? 'true' : 'false' ) . ',
340
+ wppaStarOpacity = '.str_replace(',', '.',( wppa_opt( 'star_opacity' )/'100' )) . ',
341
+ wppaEmailRequired = "'.wppa_opt( 'comment_email_required' ) . '",
342
+ wppaSlideBorderWidth = '.wppa_fbw().',
343
+ wppaAllowAjax = '.$can_ajax.',
344
+ wppaUsePhotoNamesInUrls = '.( wppa_switch( 'use_photo_names_in_urls' ) ? 'true' : 'false' ) . ',
345
+ wppaThumbTargetBlank = '.( wppa_switch( 'thumb_blank' ) ? 'true' : 'false' ) . ',
346
+ wppaRatingMax = '.wppa_opt( 'rating_max' ) . ',
347
+ wppaRatingDisplayType = "'.wppa_opt( 'rating_display_type' ) . '",
348
+ wppaRatingPrec = '.wppa_opt( 'rating_prec' ) . ',
349
+ wppaStretch = '.( wppa_switch( 'enlarge' ) ? 'true' : 'false' ) . ',
350
+ wppaMinThumbSpace = '.wppa_opt( 'tn_margin' ) . ',
351
+ wppaThumbSpaceAuto = '.( wppa_switch( 'thumb_auto' ) ? 'true' : 'false' ) . ',
352
+ wppaMagnifierCursor = "'.wppa_opt( 'magnifier' ) . '",
353
+ wppaArtMonkyLink = "'.wppa_opt( 'art_monkey_link' ) . '",
354
+ wppaAutoOpenComments = '.( wppa_switch( 'auto_open_comments' ) ? 'true' : 'false' ) . ',
355
+ wppaUpdateAddressLine = '.( wppa_switch( 'update_addressline' ) ? 'true' : 'false' ) . ',
356
+ wppaSlideSwipe = '.( wppa_switch( 'slide_swipe' ) ? 'true' : 'false' ) . ',
357
+ wppaMaxCoverWidth = '.wppa_opt( 'max_cover_width' ) . ',
358
+ wppaSlideToFullpopup = '.( wppa_opt( 'slideshow_linktype' ) == 'fullpopup' ? 'true' : 'false' ) . ',
359
+ wppaComAltSize = '.wppa_opt( 'comten_alt_thumbsize' ) . ',
360
+ wppaBumpViewCount = '.( wppa_switch( 'track_viewcounts' ) ? 'true' : 'false' ) . ',
361
+ wppaBumpClickCount = '.( wppa_switch( 'track_clickcounts' ) ? 'true' : 'false' ) . ',
362
+ wppaShareHideWhenRunning = '.( wppa_switch( 'share_hide_when_running' ) ? 'true' : 'false' ) . ',
363
+ wppaFotomoto = '.( wppa_switch( 'fotomoto_on' ) ? 'true' : 'false' ) . ',
364
+ wppaArtMonkeyButton = '.( wppa_opt( 'art_monkey_display' ) == 'button' ? 'true' : 'false' ) . ',
365
+ wppaFotomotoHideWhenRunning = '.( wppa_switch( 'fotomoto_hide_when_running' ) ? 'true' : 'false' ) . ',
366
+ wppaCommentRequiredAfterVote = '.( wppa_switch( 'vote_needs_comment' ) ? 'true' : 'false' ) . ',
367
+ wppaFotomotoMinWidth = '.wppa_opt( 'fotomoto_min_width' ) . ',
368
+ wppaShortQargs = '.( wppa_switch( 'use_short_qargs' ) ? 'true' : 'false' ) . ',
369
+ wppaOvlHires = '.( wppa_switch( 'lb_hres' ) ? 'true' : 'false' ) . ',
370
+ wppaSlideVideoStart = '.( wppa_switch( 'start_slide_video' ) ? 'true' : 'false' ) . ',
371
+ wppaSlideAudioStart = '.( wppa_switch( 'start_slide_audio' ) ? 'true' : 'false' ) . ',
372
+ wppaRel = "data-rel",
373
+ wppaOvlRadius = '.wppa_opt( 'ovl_border_radius' ) . ',
374
+ wppaOvlBorderWidth = '.wppa_opt( 'ovl_border_width' ) . ',
375
+ wppaEditPhotoWidth = "'.(wppa_opt( 'upload_edit' ) == 'new' ? 500 : 960) . '",
376
+ wppaThemeStyles = "'.(wppa_switch( 'upload_edit_theme_css' ) ? get_stylesheet_uri() : '' ) . '",
377
+ wppaStickyHeaderHeight = '.wppa_opt( 'sticky_header_size' ) . ',
378
+ wppaRenderModal = ' . ( wppa_switch( 'ajax_render_modal' ) ? 'true' : 'false' ) . ',
379
+ wppaModalQuitImg = "url(' . wppa_get_imgdir( 'smallcross-' . wppa_opt( 'ovl_theme' ) . '.gif' ) . ' )",
380
+ wppaBoxRadius = "' . wppa_opt( 'bradius' ) . '",
381
+ wppaModalBgColor = "' . wppa_opt( 'bgcolor_modal' ) . '",
382
+ wppaUploadEdit = "' . wppa_opt( 'upload_edit' ) . '",
383
+ wppaSvgFillcolor = "' . wppa_opt( 'svg_color' ) . '",
384
+ wppaSvgBgcolor = "' . wppa_opt( 'svg_bg_color' ) . '",
385
+ wppaOvlSvgFillcolor = "' . wppa_opt( 'ovl_svg_color' ) . '",
386
+ wppaOvlSvgBgcolor = "' . wppa_opt( 'ovl_svg_bg_color' ) . '",
387
+ wppaSvgCornerStyle = "' . wppa_opt( 'icon_corner_style' ) . '",
388
+ wppaHideRightClick = ' . ( wppa_switch( 'no_rightclick' ) ? 'true' : 'false' ) . ',
389
+ wppaGeoZoom = ' . wppa_opt( 'geo_zoom' ) . ',
390
+ wppaLazyLoad = ' . ( wppa_lazy() ? 'true' : 'false' ) . ',
391
+ wppaAreaMaxFrac = ' . ( wppa_opt( 'area_size' ) < 1 ? wppa_opt( 'area_size' ) : 1.0 ) . ',
392
+ wppaIconSizeNormal = "' . wppa_opt( 'nav_icon_size' ) . '",
393
+ wppaIconSizeSlide = "' . wppa_opt( 'nav_icon_size_slide' ) . '",
394
+ wppaResponseSpeed = ' . wppa_opt( 'response_speed' ) . ',
395
+ wppaExtendedResizeCount = ' . wppa_opt( 'extended_resize_count' ) . ',
396
+ wppaExtendedResizeDelay = ' . wppa_opt( 'extended_resize_delay' ) . ',
397
+ wppaCoverSpacing = ' . wppa_opt( 'cover_spacing' ) . ',
398
+ wppaFilmonlyContinuous = ' . ( wppa_switch( 'filmonly_continuous' ) ? 'true' : 'false' ) . ',
399
+ wppaNoAnimateOnMobile = ' . ( wppa_switch( 'no_animate_on_mobile' ) ? 'true' : 'false' ) . ',
400
+ wppaAjaxScroll = ' . ( wppa_switch( 'ajax_scroll' ) && ! is_admin() ? 'true' : 'false' ) . ',
401
+ wppaThumbSize = ' . wppa_opt( 'thumbsize' ) . ',
402
+ wppaTfMargin = ' . wppa_opt( 'tn_margin' ) . ',
403
+ wppaArtmonkeyFileNotSource = ' . ( wppa_opt( 'art_monkey_link' ) == 'file' &&
404
+ wppa_opt( 'art_monkey_display' ) == 'text' &&
405
+ ! wppa_switch( 'artmonkey_use_source' ) ? 'true' : 'false' ) . ',
406
+ wppaRequestInfoDialogText = "' . wppa_opt( 'request_info_text' ) . '",
407
+ wppaThumbAspect = ' . wppa_thumb_asp() . ',';
408
+
409
+ /* Lightbox vars */
410
+ $fontsize_lightbox = wppa_opt( 'fontsize_lightbox' ) ? wppa_opt( 'fontsize_lightbox' ) : '10';
411
+ $d = wppa_switch( 'ovl_show_counter') ? 1 : 0;
412
+ $ovlh = wppa_opt( 'ovl_txt_lines' ) == 'auto' ? 'auto' : ((wppa_opt( 'ovl_txt_lines' ) + $d) * ($fontsize_lightbox + 2));
413
+ $lb_global = '';
414
+ if ( wppa_switch( 'lightbox_global' ) && ! is_admin() ) {
415
+ if ( wppa_switch( 'lightbox_global_set' ) ) {
416
+ $lb_global = 'wppa[single]';
417
+ }
418
+ else {
419
+ $lb_global = 'wppa';
420
+ }
421
+ }
422
+
423
+ $result .= '
424
+ wppaOvlTxtHeight = "'.$ovlh.'",
425
+ wppaOvlOpacity = '.(wppa_opt( 'ovl_opacity' )/100).',
426
+ wppaOvlOnclickType = "'.wppa_opt( 'ovl_onclick' ).'",
427
+ wppaOvlTheme = "'.wppa_opt( 'ovl_theme' ).'",
428
+ wppaOvlAnimSpeed = '.wppa_opt( 'ovl_anim' ).',
429
+ wppaOvlSlideSpeed = '.wppa_opt( 'ovl_slide' ).',
430
+ wppaVer4WindowWidth = 800,
431
+ wppaVer4WindowHeight = 600,
432
+ wppaOvlShowCounter = '.( wppa_switch( 'ovl_show_counter') ? 'true' : 'false' ).',
433
+ '.( wppa_opt( 'fontfamily_lightbox' ) ? 'wppaOvlFontFamily = "'.wppa_opt( 'fontfamily_lightbox' ).'",' : '').'
434
+ wppaOvlFontSize = "'.$fontsize_lightbox.'",
435
+ '.( wppa_opt( 'fontcolor_lightbox' ) ? 'wppaOvlFontColor = "'.wppa_opt( 'fontcolor_lightbox' ).'",' : '').'
436
+ '.( wppa_opt( 'fontweight_lightbox' ) ? 'wppaOvlFontWeight = "'.wppa_opt( 'fontweight_lightbox' ).'",' : '').'
437
+ '.( wppa_opt( 'fontsize_lightbox' ) ? 'wppaOvlLineHeight = "'.(wppa_opt( 'fontsize_lightbox' ) + '2').'",' : '').'
438
+ wppaOvlVideoStart = '.( wppa_switch( 'ovl_video_start' ) ? 'true' : 'false' ).',
439
+ wppaOvlAudioStart = '.( wppa_switch( 'ovl_audio_start' ) ? 'true' : 'false' ).',
440
+ wppaOvlShowStartStop = '.( wppa_switch( 'ovl_show_startstop' ) ? 'true' : 'false' ).',
441
+ wppaIsMobile = '.( wppa_is_mobile() ? 'true' : 'false' ).',
442
+ wppaIsIpad = '.( wppa_is_ipad() ? 'true' : 'false' ).',
443
+ wppaOvlIconSize = "'.wppa_opt( 'nav_icon_size_lightbox' ).'px",
444
+ wppaOvlBrowseOnClick = '.( wppa_switch( 'ovl_browse_on_click' ) ? 'true' : 'false' ).',
445
+ wppaOvlGlobal = ' . ( $lb_global ? '"' . $lb_global . '"' : 'false' ) . ',
446
+ wppaPhotoDirectory = "'.WPPA_UPLOAD_URL.'/",
447
+ wppaThumbDirectory = "'.WPPA_UPLOAD_URL.'/thumbs/",
448
+ wppaTempDirectory = "'.WPPA_UPLOAD_URL.'/temp/",
449
+ wppaFontDirectory = "'.WPPA_UPLOAD_URL.'/fonts/",
450
+ wppaNoPreview = "'.__('No Preview available', 'wp-photo-album-plus').'",
451
+ wppaUIERR = "'.__('Unimplemented virtual album', 'wp-photo-album-plus').'",
452
+ wppaTxtProcessing = "'.__('Processing...', 'wp-photo-album-plus').'",
453
+ wppaTxtDone = "'.__('Done!', 'wp-photo-album-plus').'",
454
+ wppaTxtErrUnable = "'.__( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ).'",
455
+ wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";';
456
+
457
+ // Tinymce photo
458
+ if ( wppa_switch( 'photo_shortcode_enabled' ) ) {
459
+ $id = $wpdb->get_var( "SELECT id FROM $wpdb->wppa_photos
460
+ WHERE ext <> 'xxx'
461
+ AND panorama = 0
462
+ ORDER BY timestamp DESC
463
+ LIMIT 1" );
464
+
465
+ // Fake we are in a widget, to prevent wppa_get_picture_html() from bumping viewcount
466
+ wppa( 'in_widget', true );
467
+
468
+ $result .= '
469
+ wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
470
+ wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";';
471
+
472
+ // Reset faked widget
473
+ wppa( 'in_widget', false );
474
+ }
475
+
476
+ // The photo views cache
477
+ if ( isset( $wppa_session['photo'] ) ) {
478
+ foreach ( array_keys( $wppa_session['photo'] ) as $p ) {
479
+ $result .= '
480
+ wppaPhotoView[' . $p . '] = true;';
481
+ }
482
+ }
483
+
484
+ // Format
485
+ $result = wppa_compress_js( $result );
486
+ $result = '
487
+ <!-- wppa js inits -->
488
+ <script>
489
+ ' . $result . '
490
+ </script>
491
+ <!-- End wppa js inits -->
492
+ ';
493
+ echo $result;
 
 
 
 
494
  }
495
  add_action( 'wp_head', 'wppa_initialize_javascript', 2 );
496
  add_action( 'admin_head', 'wppa_initialize_javascript', 2 );
497
 
498
  function wppa_thumb_asp() {
499
 
500
+ $aspect = 1;
501
+ if ( wppa_opt( 'thumb_aspect' ) != '0:0:none' ) {
502
+ $t = explode( ':', wppa_opt( 'thumb_aspect' ) );
503
+ $aspect = $t[0] / $t[1];
504
+ }
505
+ elseif ( wppa_opt( 'resize_to' ) != '-1' && wppa_opt( 'resize_to' ) != '0' ) {
506
+ $t = explode( 'x', wppa_opt( 'resize_to' ) );
507
+ $aspect = $t[1] / $t[0];
508
+ }
509
+ else {
510
+ $aspect = wppa_opt( 'maxheight' ) / wppa_opt( 'fullsize' );
511
+ }
512
+ return $aspect;
513
  }
514
 
515
  function wppa_fbw() {
516
 
517
+ if ( is_numeric( wppa_opt( 'fullimage_border_width' ) ) ) {
518
+ $fbw = wppa_opt( 'fullimage_border_width' ) + '1';
519
+ }
520
+ else {
521
+ $fbw = '0';
522
+ }
523
+ return $fbw;
524
  }
525
 
526
  /* LOAD JAVASCRIPT */
532
  global $wppa_lang;
533
  global $wppa_opt;
534
 
535
+ $footer = wppa_is_defer();
536
+
537
+ // WPPA+ Javascript files.
538
+ // All wppa+ js files come in 2 flavours: the normal version and a minified version.
539
+ // If the minified version is available, it will be loaded, else the normal version.
540
+ // If you want to debug js, just delete the minified version; this will cause the normal
541
+ // - readable - version to be loaded.
542
+
543
+ // The js dependancies
544
+ $js_depts = array( 'jquery',
545
+ 'jquery-form',
546
+ 'jquery-masonry',
547
+ 'jquery-ui-dialog',
548
+ );
549
+
550
+ // First see if an 'all' file is present. This is to save http requests
551
+ $all_file = dirname( __FILE__ ) . '/js/wppa-all.js';
552
+ if ( wppa_is_file( $all_file ) ) {
553
+ $js_ver = date( "ymd-Gis", filemtime( $all_file ) );
554
+ wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa-all.js', $js_depts, $js_ver, $footer );
555
+ }
556
+
557
+ // No all file, do them one by one
558
+ else {
559
+ $js_files = array(
560
+ 'wppa-utils',
561
+ 'wppa',
562
+ 'wppa-slideshow',
563
+ 'wppa-ajax-front',
564
+ 'wppa-lightbox',
565
+ 'wppa-popup',
566
+ 'wppa-touch',
567
+ 'wppa-zoom',
568
+ 'wppa-spheric',
569
+ );
570
+
571
+ foreach ( array_keys( $js_files ) as $idx ) {
572
+ if ( is_file( dirname( __FILE__ ) . '/js/' . $js_files[$idx] . '.min.js' ) ) {
573
+ $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.min.js' ) );
574
+ wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.min.js', $js_depts, $js_ver, $footer );
575
+ }
576
+ else {
577
+ $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.js' ) );
578
+ wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.js', $js_depts, $js_ver, $footer );
579
+ }
580
+ }
581
+ }
582
+
583
+ // google maps
584
+ if ( wppa_switch( 'save_gpx' ) && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false ) {
585
+ $key = wppa_opt( 'map_apikey' );
586
+ wp_enqueue_script( 'wppa-geo',
587
+ 'https://maps.googleapis.com/maps/api/js?' . ( $key ? 'key=' . $key : 'v=3.exp' ),
588
+ '',
589
+ $wppa_api_version,
590
+ $footer );
591
+ }
592
+
593
+ // Nicescroller
594
+ if ( ! wppa_is_mobile() && ( wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ) || wppa_switch( 'load_nicescroller' ) ) ) {
595
+ $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
596
+ wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, $js_depts, $wppa_api_version, $footer );
597
+ $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
598
+ wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
599
+ }
600
+
601
+ // Easing we need, borrow it from nicescroller if not already loaded
602
+ else {
603
+ $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
604
+ wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
605
+ }
606
+
607
+ // Panorama
608
+ if ( wppa_switch( 'enable_panorama' ) ) {
609
+ $three_url = WPPA_URL . '/vendor/three/three.min.js';
610
+ $ver = '122';
611
+ wp_enqueue_script( 'wppa-three-min-js', $three_url, $js_depts, $wppa_api_version, $footer );
612
+ }
613
 
614
  }
615
 
619
  global $wppa_js_page_data;
620
  global $wppa_script_open;
621
 
622
+ // Validate input
623
+ if ( wppa_switch( 'allow_debug' ) ) {
624
+ $i = 0;
625
+ $arr = array( '[' => 0, ']' => 0, '(' => 0, ')' => 0, '{' => 0, '}' => 0 );
626
+ $t = array_keys( $arr );
627
+ while ( $i < strlen( $txt ) ) {
628
+ $c = substr( $txt, $i, 1 );
629
+ if ( in_array( $c, $t ) ) $arr[$c]++;
630
+ $i++;
631
+ }
632
+ for ( $i = 0; $i < 6; $i += 2 ) {
633
+ if ( $arr[$t[$i]] != $arr[$t[$i + 1]] ) {
634
+ wppa_log( 'err', 'Unmatched ' . $t[$i] . ' - ' . $t[$i + 1] . ' in ' . $txt . ' (wppa_js)', true );
635
+ }
636
+ }
637
+ if ( substr( $txt, -1 ) != ';' ) {
638
+ wppa_log( 'err', 'Missing ; in ' . $txt . ' (wppa_js)', true );
639
+ $txt .= ';';
640
+ }
641
+ }
642
+
643
+ // Do it
644
+ if ( ! wppa_is_defer() || wppa_is_caching() ) {
645
+ wppa_out( '<script>' . $txt . '</script>' );
646
+ return;
647
+ }
648
+
649
+ if ( ! $wppa_script_open ) {
650
+ $wppa_js_page_data = $txt;
651
+ $wppa_script_open = true;
652
+ }
653
+ else {
654
+ $wppa_js_page_data .= '
655
+ ' . $txt;
656
+ }
 
657
  }
658
 
659
  // Output page specific script in the footer.
664
  global $wppa_js_page_data;
665
  global $wppa_script_open;
666
 
667
+ if ( $wppa_js_page_data ) {
668
+ echo '
669
+ <!-- WPPA Page specific js -->
670
+ <script>' . wppa_compress_js( $wppa_js_page_data ) . '
671
+ </script>
672
+ <!-- End WPPA Page specific js -->
673
+ ';
674
 
675
+ $wppa_js_page_data = '';
676
+ $wppa_script_open = false;
677
+ }
678
  }
679
 
680
+ // Compress javascript
681
  function wppa_compress_js( $txt ) {
682
 
683
+ $result = $txt;
684
+ $result = str_replace( "\t", "", $result );
685
+ $result = str_replace( "\r\n", "", $result );
686
+ $result = str_replace( " = ", "=", $result );
687
+ $result = str_replace( "; ", ";", $result );
688
+ $result = str_replace( "/*", "\r\n/*", $result );
689
 
690
+ return $result;
691
  }
692
 
693
  // Decide if we do defer js
694
  function wppa_is_defer() {
695
 
696
+ return true;
697
 
698
+ if ( is_admin() ) return true;
699
+ if ( ! wppa_switch( 'defer_javascript' ) ) return false;
700
+ if ( wppa( 'ajax' ) ) return false;
701
+ if ( wppa( 'cron' ) ) return false;
702
+ if ( wppa( 'is_slide' ) || wppa( 'is_slideonly' ) || wppa( 'is_filmonly' ) ) return false;
703
+ return true;
704
  }
wppa-tinymce-common.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-tinymce-common.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.1.00.008
6
  *
7
  */
8
 
@@ -92,7 +92,7 @@ global $wpdb;
92
  // Open form
93
  '<form' .
94
  ' id="wppa-uplform"' .
95
- ' action="' . WPPA_URL . '/wppa-ajax-front.php?action=wppa&amp;wppa-action=do-fe-upload&amp;fromtinymce=1"' .
96
  ' method="post"' .
97
  ' enctype="multipart/form-data"' .
98
  ' >' .
2
  /* wppa-tinymce-common.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.1.00.009
6
  *
7
  */
8
 
92
  // Open form
93
  '<form' .
94
  ' id="wppa-uplform"' .
95
+ ' action="' . site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=do-fe-upload&amp;fromtinymce=1"' .
96
  ' method="post"' .
97
  ' enctype="multipart/form-data"' .
98
  ' >' .
wppa-wrappers.php CHANGED
@@ -771,6 +771,7 @@ static $allowed_tags;
771
  'style' => true,
772
  'placeholder' => true,
773
  'srcset' => true,
 
774
  ),
775
  'input' => array(
776
  'id' => true,
771
  'style' => true,
772
  'placeholder' => true,
773
  'srcset' => true,
774
+ 'onload' => true,
775
  ),
776
  'input' => array(
777
  'id' => true,
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: 8.1.00.008
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/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.1.00.008'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
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: 8.1.00.009
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/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.1.00.009'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30