WP Photo Album Plus - Version 8.2.05.007

Version Description

= 8.1.08 =

  • 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.2.05.007
Comparing to
See all releases

Code changes from version 8.2.05.006 to 8.2.05.007

changelog.txt CHANGED
@@ -9,6 +9,7 @@ WP Photo Album Plus Changelog
9
  * Reduced number of queries by better cacing option data.
10
  * Added Timstamp descending to the sub-album sequence methods.
11
  * Added import from realmedialibrary plugin categorized wp media.
 
12
 
13
  = 8.2.04 =
14
 
9
  * Reduced number of queries by better cacing option data.
10
  * Added Timstamp descending to the sub-album sequence methods.
11
  * Added import from realmedialibrary plugin categorized wp media.
12
+ * Fixed a slideshow pagination issue that resulted in serious performance degradations on large slideshows.
13
 
14
  = 8.2.04 =
15
 
wppa-admin.php CHANGED
@@ -95,7 +95,7 @@ function wppa_add_admin() {
95
  add_action( 'admin_init', 'wppa_admin_styles' );
96
 
97
  function wppa_admin_styles() {
98
- global $wppa_api_version;
99
 
100
  $ver = filemtime( WPPA_PATH . '/wppa-admin-styles.css' );
101
  wp_register_style( 'wppa_admin_style', WPPA_URL.'/wppa-admin-styles.css', '', $ver );
@@ -107,7 +107,7 @@ global $wppa_api_version;
107
  }
108
 
109
  // Standard wppa frontend styles
110
- wp_register_style('wppa_style', WPPA_URL.'/wppa-style.css', array(), $wppa_api_version);
111
  wp_enqueue_style('wppa_style');
112
 
113
  $the_css = wppa_create_wppa_dynamic_css();
@@ -156,7 +156,7 @@ function theme_styles_for_wppa() {
156
  add_action( 'admin_init', 'wppa_admin_scripts' );
157
 
158
  function wppa_admin_scripts() {
159
- global $wppa_api_version;
160
 
161
  $depts = array(
162
  'jquery',
@@ -174,16 +174,16 @@ global $wppa_api_version;
174
  $js_ver = date( "ymd-Gis", filemtime( WPPA_PATH.'/js/wppa-admin-scripts.js' ) );
175
  wp_enqueue_script( 'wppa-admin', WPPA_URL.'/js/wppa-admin-scripts.js', $depts, $js_ver, true );
176
  }
177
- wp_enqueue_script( 'wppa-upload', WPPA_URL.'/js/wppa-multifile-compressed.js', '', $wppa_api_version, true );
178
- wp_enqueue_script( 'wppa-utils', WPPA_URL . '/js/wppa-utils.js',$depts, $wppa_api_version );
179
- wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa.js', $depts, $wppa_api_version );
180
- wp_enqueue_script( 'wppa-slideshow', WPPA_URL . '/js/wppa-slideshow.js', $depts, $wppa_api_version );
181
- wp_enqueue_script( 'wppa-ajax-front', WPPA_URL . '/js/wppa-ajax-front.js', $depts, $wppa_api_version );
182
- wp_enqueue_script( 'wppa-zoom', WPPA_URL . '/js/wppa-zoom.js', $depts, $wppa_api_version );
183
- wp_enqueue_script( 'wppa-spheric', WPPA_URL . '/js/wppa-spheric.js', $depts, $wppa_api_version );
184
- wp_enqueue_script( 'wppa-three', WPPA_URL . '/vendor/three/three.min.js', $depts, $wppa_api_version );
185
  if ( wppa_can_magick() ) {
186
- wp_enqueue_script( 'cropperjs', WPPA_URL . '/vendor/cropperjs/dist/cropper.min.js', $depts, $wppa_api_version );
187
  }
188
 
189
  wp_enqueue_style( 'wp-jquery-ui-dialog' );
@@ -356,7 +356,7 @@ if ( wppa_get_option( 'wppa_enable_panorama' ) == 'yes' ) {
356
  add_action( 'admin_footer', 'wppa_load_panorama_js' );
357
  }
358
  function wppa_load_panorama_js() {
359
- global $wppa_api_version;
360
 
361
  if ( wppa( 'has_panorama' ) ) {
362
  $three_url = WPPA_URL . '/vendor/three/three.min.js';
95
  add_action( 'admin_init', 'wppa_admin_styles' );
96
 
97
  function wppa_admin_styles() {
98
+ global $wppa_version;
99
 
100
  $ver = filemtime( WPPA_PATH . '/wppa-admin-styles.css' );
101
  wp_register_style( 'wppa_admin_style', WPPA_URL.'/wppa-admin-styles.css', '', $ver );
107
  }
108
 
109
  // Standard wppa frontend styles
110
+ wp_register_style('wppa_style', WPPA_URL.'/wppa-style.css', array(), $wppa_version);
111
  wp_enqueue_style('wppa_style');
112
 
113
  $the_css = wppa_create_wppa_dynamic_css();
156
  add_action( 'admin_init', 'wppa_admin_scripts' );
157
 
158
  function wppa_admin_scripts() {
159
+ global $wppa_version;
160
 
161
  $depts = array(
162
  'jquery',
174
  $js_ver = date( "ymd-Gis", filemtime( WPPA_PATH.'/js/wppa-admin-scripts.js' ) );
175
  wp_enqueue_script( 'wppa-admin', WPPA_URL.'/js/wppa-admin-scripts.js', $depts, $js_ver, true );
176
  }
177
+ wp_enqueue_script( 'wppa-upload', WPPA_URL.'/js/wppa-multifile-compressed.js', '', $wppa_version, true );
178
+ wp_enqueue_script( 'wppa-utils', WPPA_URL . '/js/wppa-utils.js',$depts, $wppa_version );
179
+ wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa.js', $depts, $wppa_version );
180
+ wp_enqueue_script( 'wppa-slideshow', WPPA_URL . '/js/wppa-slideshow.js', $depts, $wppa_version );
181
+ wp_enqueue_script( 'wppa-ajax-front', WPPA_URL . '/js/wppa-ajax-front.js', $depts, $wppa_version );
182
+ wp_enqueue_script( 'wppa-zoom', WPPA_URL . '/js/wppa-zoom.js', $depts, $wppa_version );
183
+ wp_enqueue_script( 'wppa-spheric', WPPA_URL . '/js/wppa-spheric.js', $depts, $wppa_version );
184
+ wp_enqueue_script( 'wppa-three', WPPA_URL . '/vendor/three/three.min.js', $depts, $wppa_version );
185
  if ( wppa_can_magick() ) {
186
+ wp_enqueue_script( 'cropperjs', WPPA_URL . '/vendor/cropperjs/dist/cropper.min.js', $depts, $wppa_version );
187
  }
188
 
189
  wp_enqueue_style( 'wp-jquery-ui-dialog' );
356
  add_action( 'admin_footer', 'wppa_load_panorama_js' );
357
  }
358
  function wppa_load_panorama_js() {
359
+ global $wppa_version;
360
 
361
  if ( wppa( 'has_panorama' ) ) {
362
  $three_url = WPPA_URL . '/vendor/three/three.min.js';
wppa-common-functions.php CHANGED
@@ -13,7 +13,7 @@ function wppa_initialize_runtime( $force = false ) {
13
  global $wppa;
14
  global $wppa_opt;
15
  global $wppa_revno;
16
- global $wppa_api_version;
17
  global $wpdb;
18
  global $wppa_defaults;
19
 
@@ -80,7 +80,7 @@ global $wppa_defaults;
80
  function wppa_reset_occurrance() {
81
  global $wppa;
82
  global $wppa_revno;
83
- global $wppa_api_version;
84
  static $first_pla = true;
85
  global $wppa_current_shortcode;
86
  global $wppa_current_shortcode_atts;
@@ -112,7 +112,7 @@ global $wppa_current_shortcode_atts;
112
 
113
  $wppa = array (
114
  'revno' => $wppa_revno, // set in wppa.php
115
- 'api_version' => $wppa_api_version, // set in wppa.php
116
  'fullsize' => '',
117
  'enlarge' => false,
118
  'mocc' => $mocc,
13
  global $wppa;
14
  global $wppa_opt;
15
  global $wppa_revno;
16
+ global $wppa_version;
17
  global $wpdb;
18
  global $wppa_defaults;
19
 
80
  function wppa_reset_occurrance() {
81
  global $wppa;
82
  global $wppa_revno;
83
+ global $wppa_version;
84
  static $first_pla = true;
85
  global $wppa_current_shortcode;
86
  global $wppa_current_shortcode_atts;
112
 
113
  $wppa = array (
114
  'revno' => $wppa_revno, // set in wppa.php
115
+ 'api_version' => $wppa_version, // set in wppa.php
116
  'fullsize' => '',
117
  'enlarge' => false,
118
  'mocc' => $mocc,
wppa-filter.php CHANGED
@@ -125,7 +125,7 @@ add_shortcode( 'wppa_div', 'wppa_shortcode_div' );
125
  function wppa_shortcodes( $xatts ) {
126
  global $wppa;
127
  global $wppa_postid;
128
- global $wppa_api_version;
129
  global $wppa_revno;
130
  global $wppa_no_timer;
131
  global $wpdb;
@@ -326,7 +326,7 @@ global $other_deps;
326
  // Displatch on type
327
  switch ( $type ) {
328
  case 'version':
329
- return $wppa_api_version;
330
  break;
331
  case 'dbversion':
332
  return $wppa_revno;
125
  function wppa_shortcodes( $xatts ) {
126
  global $wppa;
127
  global $wppa_postid;
128
+ global $wppa_version;
129
  global $wppa_revno;
130
  global $wppa_no_timer;
131
  global $wpdb;
326
  // Displatch on type
327
  switch ( $type ) {
328
  case 'version':
329
+ return $wppa_version;
330
  break;
331
  case 'dbversion':
332
  return $wppa_revno;
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 8.2.05.002
7
  *
8
  */
9
 
@@ -3719,7 +3719,7 @@ function wppa_get_curpage() {
3719
  }
3720
 
3721
  function wppa_container( $action ) {
3722
- global $wppa_version; // The theme version ( wppa_theme.php )
3723
  static $auto;
3724
  global $blog_id;
3725
 
@@ -5920,10 +5920,11 @@ global $wppa_current_shortcode;
5920
  $ntime = microtime( true ) - $time;
5921
  $result = "\n" .
5922
  '<!-- End ' . $wppa_current_shortcode . ' ' . $title . ' ' .
5923
- sprintf( '%d queries in %3.1f ms. at %s',
5924
  $nqueries,
5925
  $ntime * 1000,
5926
- wppa_local_date( wppa_get_option( 'time_format' ) ) ) .
 
5927
  ( $cached ? ' (cached) ' : ' ' ) .
5928
  ( $delay ? ' (delayed) ' : ' ' ) .
5929
  '-->';
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 8.2.05.007
7
  *
8
  */
9
 
3719
  }
3720
 
3721
  function wppa_container( $action ) {
3722
+ global $wppa_version;
3723
  static $auto;
3724
  global $blog_id;
3725
 
5920
  $ntime = microtime( true ) - $time;
5921
  $result = "\n" .
5922
  '<!-- End ' . $wppa_current_shortcode . ' ' . $title . ' ' .
5923
+ sprintf( '%d queries in %3.1f ms. at %s. Max mem: %6.2f Mb.',
5924
  $nqueries,
5925
  $ntime * 1000,
5926
+ wppa_local_date( wppa_get_option( 'time_format' ) ),
5927
+ memory_get_peak_usage(true)/(1024*1024)) .
5928
  ( $cached ? ' (cached) ' : ' ' ) .
5929
  ( $delay ? ' (delayed) ' : ' ' ) .
5930
  '-->';
wppa-non-admin.php CHANGED
@@ -22,7 +22,7 @@ if ( ! is_admin() ) {
22
  add_action('wp_enqueue_scripts', 'wppa_add_style');
23
 
24
  function wppa_add_style() {
25
- global $wppa_api_version;
26
 
27
  // Are we allowed to look in theme?
28
  if ( wppa_get_option( 'wppa_use_custom_style_file', 'no' ) == 'yes' ) {
@@ -30,7 +30,7 @@ global $wppa_api_version;
30
  // In child theme?
31
  $userstyle = get_theme_root() . '/' . wppa_get_option('stylesheet') . '/wppa-style.css';
32
  if ( is_file($userstyle) ) {
33
- wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('stylesheet') . '/wppa-style.css', array(), $wppa_api_version);
34
  wp_enqueue_style('wppa_style');
35
  wp_add_inline_style( 'wppa_style', wppa_create_wppa_dynamic_css() );
36
  return;
@@ -39,7 +39,7 @@ global $wppa_api_version;
39
  // In theme?
40
  $userstyle = get_theme_root() . '/' . wppa_get_option('template') . '/wppa-style.css';
41
  if ( is_file($userstyle) ) {
42
- wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('template') . '/wppa-style.css', array(), $wppa_api_version);
43
  wp_enqueue_style('wppa_style');
44
  wp_add_inline_style( 'wppa_style', wppa_create_wppa_dynamic_css() );
45
  return;
@@ -52,7 +52,7 @@ global $wppa_api_version;
52
  $ver = date( "ymd-Gis", filemtime( $style_file ) );
53
  }
54
  else {
55
- $ver = $wppa_api_version;
56
  }
57
  wp_register_style('wppa_style', WPPA_URL.'/wppa-style.css', array(), $ver);
58
  wp_enqueue_style('wppa_style');
22
  add_action('wp_enqueue_scripts', 'wppa_add_style');
23
 
24
  function wppa_add_style() {
25
+ global $wppa_version;
26
 
27
  // Are we allowed to look in theme?
28
  if ( wppa_get_option( 'wppa_use_custom_style_file', 'no' ) == 'yes' ) {
30
  // In child theme?
31
  $userstyle = get_theme_root() . '/' . wppa_get_option('stylesheet') . '/wppa-style.css';
32
  if ( is_file($userstyle) ) {
33
+ wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('stylesheet') . '/wppa-style.css', array(), $wppa_version);
34
  wp_enqueue_style('wppa_style');
35
  wp_add_inline_style( 'wppa_style', wppa_create_wppa_dynamic_css() );
36
  return;
39
  // In theme?
40
  $userstyle = get_theme_root() . '/' . wppa_get_option('template') . '/wppa-style.css';
41
  if ( is_file($userstyle) ) {
42
+ wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('template') . '/wppa-style.css', array(), $wppa_version);
43
  wp_enqueue_style('wppa_style');
44
  wp_add_inline_style( 'wppa_style', wppa_create_wppa_dynamic_css() );
45
  return;
52
  $ver = date( "ymd-Gis", filemtime( $style_file ) );
53
  }
54
  else {
55
+ $ver = $wppa_version;
56
  }
57
  wp_register_style('wppa_style', WPPA_URL.'/wppa-style.css', array(), $ver);
58
  wp_enqueue_style('wppa_style');
wppa-scripts.php CHANGED
@@ -9,7 +9,7 @@
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
11
  function wppa_initialize_javascript() {
12
- global $wppa_api_version;
13
  global $wppa_lang;
14
  global $wppa_session;
15
  global $wpdb;
@@ -310,7 +310,7 @@ global $wpdb;
310
  wppaFsPolicy = "' . ( is_admin() ? 'none' : wppa_opt( 'fs_policy' ) ) . '",
311
  wppaNiceScroll = ' . ( wppa_is_nice() ? 'true' : 'false' ) . ',
312
  wppaNieScrollOpts = {' . wppa_opt( 'nicescroll_opts' ) . '},
313
- wppaVersion = "'.$wppa_api_version.'",
314
  wppaBackgroundColorImage = "'.wppa_opt( 'bgcolor_img' ) . '",
315
  wppaPopupLinkType = "'.wppa_opt( 'thumb_linktype' ) . '",
316
  wppaAnimationType = "'.wppa_opt( 'animation_type' ) . '",
@@ -558,7 +558,7 @@ add_action( 'init', 'wppa_add_javascripts' );
558
 
559
  // This function does the actual js enqueueing
560
  function wppa_add_javascripts() {
561
- global $wppa_api_version;
562
  global $wppa_lang;
563
  global $wppa_opt;
564
 
@@ -617,7 +617,7 @@ global $wppa_opt;
617
  wp_enqueue_script( 'wppa-geo',
618
  'https://maps.googleapis.com/maps/api/js?' . ( $key ? 'key=' . $key : 'v=3.exp' ),
619
  '',
620
- $wppa_api_version,
621
  $footer );
622
  }
623
 
@@ -643,19 +643,19 @@ global $wppa_opt;
643
  // Nicescroller
644
  if ( wppa_is_nice() || wppa_is_nice( 'window' ) || wppa_switch( 'load_nicescroller' ) ) {
645
  $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
646
- wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, $js_depts, $wppa_api_version, $footer );
647
  }
648
  }
649
 
650
  // Easing we need, borrow it from nicescroller
651
  $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
652
- wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
653
 
654
  // Panorama
655
  if ( wppa_switch( 'enable_panorama' ) ) {
656
  $three_url = WPPA_URL . '/vendor/three/three.min.js';
657
  $ver = '122';
658
- wp_enqueue_script( 'wppa-three-min-js', $three_url, $js_depts, $wppa_api_version, $footer );
659
  }
660
 
661
  // Window nicescroller
@@ -670,7 +670,7 @@ global $wppa_opt;
670
 
671
  // Pinterest
672
  if ( ( wppa_switch( 'share_on') || wppa_switch( 'share_on_widget') ) && wppa_switch( 'share_pinterest') ) {
673
- wp_enqueue_script( 'wppa-pinterest', "//assets.pinterest.com/js/pinit.js", $js_depts, $wppa_api_version, $footer );
674
  }
675
 
676
  }
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
11
  function wppa_initialize_javascript() {
12
+ global $wppa_version;
13
  global $wppa_lang;
14
  global $wppa_session;
15
  global $wpdb;
310
  wppaFsPolicy = "' . ( is_admin() ? 'none' : wppa_opt( 'fs_policy' ) ) . '",
311
  wppaNiceScroll = ' . ( wppa_is_nice() ? 'true' : 'false' ) . ',
312
  wppaNieScrollOpts = {' . wppa_opt( 'nicescroll_opts' ) . '},
313
+ wppaVersion = "'.$wppa_version.'",
314
  wppaBackgroundColorImage = "'.wppa_opt( 'bgcolor_img' ) . '",
315
  wppaPopupLinkType = "'.wppa_opt( 'thumb_linktype' ) . '",
316
  wppaAnimationType = "'.wppa_opt( 'animation_type' ) . '",
558
 
559
  // This function does the actual js enqueueing
560
  function wppa_add_javascripts() {
561
+ global $wppa_version;
562
  global $wppa_lang;
563
  global $wppa_opt;
564
 
617
  wp_enqueue_script( 'wppa-geo',
618
  'https://maps.googleapis.com/maps/api/js?' . ( $key ? 'key=' . $key : 'v=3.exp' ),
619
  '',
620
+ $wppa_version,
621
  $footer );
622
  }
623
 
643
  // Nicescroller
644
  if ( wppa_is_nice() || wppa_is_nice( 'window' ) || wppa_switch( 'load_nicescroller' ) ) {
645
  $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
646
+ wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, $js_depts, $wppa_version, $footer );
647
  }
648
  }
649
 
650
  // Easing we need, borrow it from nicescroller
651
  $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
652
+ wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_version, $footer );
653
 
654
  // Panorama
655
  if ( wppa_switch( 'enable_panorama' ) ) {
656
  $three_url = WPPA_URL . '/vendor/three/three.min.js';
657
  $ver = '122';
658
+ wp_enqueue_script( 'wppa-three-min-js', $three_url, $js_depts, $wppa_version, $footer );
659
  }
660
 
661
  // Window nicescroller
670
 
671
  // Pinterest
672
  if ( ( wppa_switch( 'share_on') || wppa_switch( 'share_on_widget') ) && wppa_switch( 'share_pinterest') ) {
673
+ wp_enqueue_script( 'wppa-pinterest', "//assets.pinterest.com/js/pinit.js", $js_depts, $wppa_version, $footer );
674
  }
675
 
676
  }
wppa-session.php CHANGED
@@ -17,8 +17,8 @@ if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
17
 
18
  // Generate a unique session id
19
  function wppa_get_session_id() {
20
- global $wppa_api_version;
21
- $id = $_SERVER["REMOTE_ADDR"] . ( isset( $_SERVER["HTTP_USER_AGENT"] ) ? $_SERVER["HTTP_USER_AGENT"] : '' ) . $wppa_api_version;
22
  $id = str_replace( array( ' ', '.', '/', ':', ')', '(', ';', '-' ), '', $id );
23
  return $id;
24
  }
17
 
18
  // Generate a unique session id
19
  function wppa_get_session_id() {
20
+ global $wppa_version;
21
+ $id = $_SERVER["REMOTE_ADDR"] . ( isset( $_SERVER["HTTP_USER_AGENT"] ) ? $_SERVER["HTTP_USER_AGENT"] : '' ) . $wppa_version;
22
  $id = str_replace( array( ' ', '.', '/', ':', ')', '(', ';', '-' ), '', $id );
23
  return $id;
24
  }
wppa-settings-autosave.php CHANGED
@@ -15,7 +15,7 @@ global $wppa;
15
  global $wppa_opt;
16
  global $blog_id;
17
  global $opts_error;
18
- global $wppa_api_version;
19
  global $wp_roles;
20
  global $wppa_revno;
21
  global $no_default;
@@ -315,7 +315,7 @@ global $wppa_subtab_names;
315
  __( 'Database revision:', 'wp-photo-album-plus' ) . ' ' . wppa_get_option( 'wppa_revision', '100') . '. ' .
316
  __( 'WP Charset:', 'wp-photo-album-plus' ) . ' ' . get_bloginfo( 'charset' ) . '. ' .
317
  __( 'Current PHP version:', 'wp-photo-album-plus' ) . ' ' . phpversion() . '. ' .
318
- __( 'WPPA+ API Version:', 'wp-photo-album-plus' ) . ' ' . $wppa_api_version . '. ' .
319
  __( 'Filesystem method:', 'wp-photo-album-plus' ) . ' ' . get_filesystem_method() );
320
  }
321
  wppa_echo( '<br>' );
15
  global $wppa_opt;
16
  global $blog_id;
17
  global $opts_error;
18
+ global $wppa_version;
19
  global $wp_roles;
20
  global $wppa_revno;
21
  global $no_default;
315
  __( 'Database revision:', 'wp-photo-album-plus' ) . ' ' . wppa_get_option( 'wppa_revision', '100') . '. ' .
316
  __( 'WP Charset:', 'wp-photo-album-plus' ) . ' ' . get_bloginfo( 'charset' ) . '. ' .
317
  __( 'Current PHP version:', 'wp-photo-album-plus' ) . ' ' . phpversion() . '. ' .
318
+ __( 'WPPA+ API Version:', 'wp-photo-album-plus' ) . ' ' . $wppa_version . '. ' .
319
  __( 'Filesystem method:', 'wp-photo-album-plus' ) . ' ' . get_filesystem_method() );
320
  }
321
  wppa_echo( '<br>' );
wppa-slideshow.php CHANGED
@@ -4,15 +4,15 @@
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
- * Version 8.2.05.006
8
  *
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
12
 
13
- function wppa_the_slideshow( $thumbs, $allthumbs ) {
14
 
15
- wppa_prepare_slideshow_pagination( $allthumbs );
16
 
17
  if ( wppa_opt( 'pagelink_pos' ) == 'top' || wppa_opt( 'pagelink_pos' ) == 'both' ) wppa_slide_page_links();
18
 
@@ -25,7 +25,7 @@ function wppa_the_slideshow( $thumbs, $allthumbs ) {
25
  wppa_start_stop('optional'); // The 'Slower | start/stop | Faster' bar
26
  break;
27
  case '1':
28
- wppa_slide_frame( $thumbs ); // The photo / slide
29
  break;
30
  case '2':
31
  wppa_slide_name_box('optional'); // Show name in a box.
@@ -69,10 +69,10 @@ function wppa_the_slideshow( $thumbs, $allthumbs ) {
69
  while ( $i < '11' ) {
70
  switch ( $indexes[$i] ) {
71
  case '0':
72
- wppa_start_stop('optional'); // The 'Slower | start/stop | Faster' bar
73
  break;
74
  case '1':
75
- wppa_slide_frame( $thumbs ); // The photo / slide
76
  break;
77
  case '2':
78
  wppa_slide_name_desc('optional'); // Show name and description in a box.
@@ -108,8 +108,11 @@ function wppa_the_slideshow( $thumbs, $allthumbs ) {
108
  }
109
  }
110
  if ( wppa_opt( 'pagelink_pos' ) == 'bottom' || wppa_opt( 'pagelink_pos' ) == 'both' ) wppa_slide_page_links();
 
 
111
  }
112
 
 
113
  function wppa_prepare_slideshow_pagination( $thumbs ) {
114
  global $thumbs_ids;
115
  global $previous_page_last_id;
@@ -118,7 +121,7 @@ global $previous_page_last_id;
118
  wppa( 'ss_pag', false );
119
 
120
  // Any items?
121
- if ( ! $thumbs ) return;
122
 
123
  $mocc = wppa( 'mocc' );
124
 
@@ -131,7 +134,7 @@ global $previous_page_last_id;
131
  }
132
 
133
  // Not on photo enumeration
134
- if ( wppa( 'start_photos' ) ) return;
135
 
136
  // Save thumb ids of full selection
137
  $thumbs_ids = array();
@@ -145,7 +148,7 @@ global $previous_page_last_id;
145
  $pagsiz = wppa_opt( 'slideonly_max' );
146
  }
147
  else {
148
- return;
149
  }
150
  }
151
 
@@ -153,14 +156,14 @@ global $previous_page_last_id;
153
  else {
154
 
155
  // Page size defined?
156
- if ( ! wppa_opt( 'slideshow_pagesize' ) ) return;
157
 
158
  // Not in a widget!
159
- if ( wppa_in_widget() ) return;
160
 
161
  // Fits in one page?
162
  $pagsiz = wppa_opt( 'slideshow_pagesize' );
163
- if ( count( $thumbs ) <= $pagsiz ) return;
164
  }
165
 
166
  // Pagination on and required
@@ -186,23 +189,13 @@ global $previous_page_last_id;
186
  }
187
  }
188
 
189
- // Compute and save sequence offset of this page.
190
- // We need this for the link back to thumbnails
191
  $offset = ( wppa( 'curpage' ) - '1' ) * wppa_opt( 'slideshow_pagesize' );
192
  wppa_js( 'wppaSlideOffset[' . $mocc . '] = ' . $offset . ';' );
193
 
194
- // Filmstrip assumes array $thumbs to start at index 0.
195
- // We shift the req'd part down to the beginning and unset the rest
196
  $skips = ( wppa( 'curpage' ) - '1' ) * $pagsiz;
197
- foreach ( array_keys( $thumbs ) as $key ) {
198
- if ( $key < $pagsiz ) {
199
- if ( isset( $thumbs[$key + $skips] ) ) {
200
- if ( $skips ) $thumbs[$key] = $thumbs[$key + $skips];
201
- }
202
- else unset( $thumbs[$key] ); // last page < pagesize
203
- }
204
- else unset ( $thumbs[$key] );
205
- }
206
 
207
  $previous_page_last_id = '0';
208
  if ( $skips && isset( $thumbs_ids[$skips - 1] ) ) {
@@ -211,6 +204,8 @@ global $previous_page_last_id;
211
  else {
212
  $previous_page_last_id = $thumbs_ids[count($thumbs_ids) - 1];
213
  }
 
 
214
  }
215
 
216
  function wppa_slide_page_links() {
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
+ * Version 8.2.05.007
8
  *
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
12
 
13
+ function wppa_the_slideshow( $thumbs ) {
14
 
15
+ $thumbs = wppa_prepare_slideshow_pagination( $thumbs );
16
 
17
  if ( wppa_opt( 'pagelink_pos' ) == 'top' || wppa_opt( 'pagelink_pos' ) == 'both' ) wppa_slide_page_links();
18
 
25
  wppa_start_stop('optional'); // The 'Slower | start/stop | Faster' bar
26
  break;
27
  case '1':
28
+ wppa_slide_frame( $thumbs ); // The photo / slide
29
  break;
30
  case '2':
31
  wppa_slide_name_box('optional'); // Show name in a box.
69
  while ( $i < '11' ) {
70
  switch ( $indexes[$i] ) {
71
  case '0':
72
+ wppa_start_stop('optional'); // The 'Slower | start/stop | Faster' bar
73
  break;
74
  case '1':
75
+ wppa_slide_frame( $thumbs ); // The photo / slide
76
  break;
77
  case '2':
78
  wppa_slide_name_desc('optional'); // Show name and description in a box.
108
  }
109
  }
110
  if ( wppa_opt( 'pagelink_pos' ) == 'bottom' || wppa_opt( 'pagelink_pos' ) == 'both' ) wppa_slide_page_links();
111
+
112
+ wppa_run_slidecontainer( $thumbs ); // Fill in the photo array and display it.
113
  }
114
 
115
+ // Prepares the pagination and returns the thumbs for the current page
116
  function wppa_prepare_slideshow_pagination( $thumbs ) {
117
  global $thumbs_ids;
118
  global $previous_page_last_id;
121
  wppa( 'ss_pag', false );
122
 
123
  // Any items?
124
+ if ( ! $thumbs ) return $thumbs;
125
 
126
  $mocc = wppa( 'mocc' );
127
 
134
  }
135
 
136
  // Not on photo enumeration
137
+ if ( wppa( 'start_photos' ) ) return $thumbs;
138
 
139
  // Save thumb ids of full selection
140
  $thumbs_ids = array();
148
  $pagsiz = wppa_opt( 'slideonly_max' );
149
  }
150
  else {
151
+ return $thumbs;
152
  }
153
  }
154
 
156
  else {
157
 
158
  // Page size defined?
159
+ if ( ! wppa_opt( 'slideshow_pagesize' ) ) return $thumbs;
160
 
161
  // Not in a widget!
162
+ if ( wppa_in_widget() ) return $thumbs;
163
 
164
  // Fits in one page?
165
  $pagsiz = wppa_opt( 'slideshow_pagesize' );
166
+ if ( count( $thumbs ) <= $pagsiz ) return $thumbs;
167
  }
168
 
169
  // Pagination on and required
189
  }
190
  }
191
 
192
+ // Extract the part of the thumbs for the current page
 
193
  $offset = ( wppa( 'curpage' ) - '1' ) * wppa_opt( 'slideshow_pagesize' );
194
  wppa_js( 'wppaSlideOffset[' . $mocc . '] = ' . $offset . ';' );
195
 
 
 
196
  $skips = ( wppa( 'curpage' ) - '1' ) * $pagsiz;
197
+
198
+ $thumbs = array_slice( $thumbs, $skips, $pagsiz );
 
 
 
 
 
 
 
199
 
200
  $previous_page_last_id = '0';
201
  if ( $skips && isset( $thumbs_ids[$skips - 1] ) ) {
204
  else {
205
  $previous_page_last_id = $thumbs_ids[count($thumbs_ids) - 1];
206
  }
207
+
208
+ return $thumbs;
209
  }
210
 
211
  function wppa_slide_page_links() {
wppa-theme.php CHANGED
@@ -3,11 +3,10 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the albums/photos/slideshow in a page or post
6
- * Version 8.2.05.006
7
  */
8
  function wppa_theme() {
9
 
10
- global $wppa_version; $wppa_version = '8.2.05.006'; // 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
  global $wppa_empty_content;
@@ -412,48 +411,11 @@ global $wppa_empty_content;
412
 
413
  elseif ( wppa_page( 'slide' ) || wppa_page( 'single' ) ) { // Page 'Slideshow' or 'Single' in browsemode requested
414
 
415
- // Get all the thumbs
416
- $allthumbs = wppa_get_photos();
417
 
418
- // Find the slideshow page
419
- $pagesize = wppa_opt( 'slideshow_pagesize' );
420
- if ( wppa( 'start_photo' ) ) {
421
- $startid = wppa( 'start_photo' );
422
- }
423
- else {
424
- $startid = -1;
425
- }
426
-
427
- if ( $pagesize ) {
428
-
429
- // If page requested, find it
430
- $slide_page = wppa_get( 'wppa-page','0','int' );
431
-
432
- // if strartphoto given, find the page it is on
433
- if ( ! $slide_page && $startid > 0 ) {
434
- $i = 0;
435
- $id = -1;
436
- while( $id < 0 && $i < count( $allthumbs ) ) {
437
- if ( $allthumbs[$i]['id'] == $startid ) {
438
- $id = $i;
439
- }
440
- $i++;
441
- }
442
- $slide_page = floor( $i / $pagesize ) + 1;
443
- }
444
-
445
- // If still nothing, assume 1
446
- if ( ! $slide_page ) {
447
- $slide_page = 1;
448
- }
449
-
450
- // Slice the requested page
451
- $thumbs = array_slice( $allthumbs, ( ( $slide_page - 1 ) * $pagesize ), $pagesize );
452
- }
453
-
454
- if ( $thumbs ) {
455
- wppa_the_slideshow( $thumbs, $allthumbs ); // Producs all the html required for the slideshow
456
- wppa_run_slidecontainer( $thumbs ); // Fill in the photo array and display it.
457
  }
458
  else {
459
  wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wp-photo-album-plus') ) );
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the albums/photos/slideshow in a page or post
6
+ * Version 8.2.05.007
7
  */
8
  function wppa_theme() {
9
 
 
10
  global $wppa;
11
  global $wppa_show_statistics; // Can be set to true by a custom page template
12
  global $wppa_empty_content;
411
 
412
  elseif ( wppa_page( 'slide' ) || wppa_page( 'single' ) ) { // Page 'Slideshow' or 'Single' in browsemode requested
413
 
414
+ // Get all the photos
415
+ $photos = wppa_get_photos();
416
 
417
+ if ( $photos ) {
418
+ wppa_the_slideshow( $photos ); // Produces all the html required for the slideshow
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
  }
420
  else {
421
  wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wp-photo-album-plus') ) );
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.2.05.006
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,11 +22,9 @@ register_activation_hook( __FILE__, 'wppa_activate_plugin' );
22
  global $wpdb;
23
  global $wp_version;
24
 
25
- /* WPPA GLOBALS */
26
- global $wppa_api_version;
27
- $wppa_api_version = '8.2.05.006'; // WPPA software version
28
- global $wppa_revno;
29
- $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
31
  /* Init page js data */
32
  global $wppa_js_page_data; $wppa_js_page_data = '';
@@ -37,7 +35,7 @@ function wppa_init_timer() {
37
  global $wppa_endtime;
38
 
39
  $met = ini_get( 'max_execution_time' );
40
- if ( $met > 55 && ! wppa_is_cron() ) {
41
  $met = 55;
42
  }
43
  else {
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.2.05.007
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 $wpdb;
23
  global $wp_version;
24
 
25
+ /* WPPA Version */
26
+ global $wppa_version; $wppa_version = '8.2.05.007'; // WPPA software version
27
+ global $wppa_revno; $wppa_revno = str_replace( '.', '', $wppa_version ); // WPPA db version
 
 
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';
35
  global $wppa_endtime;
36
 
37
  $met = ini_get( 'max_execution_time' );
38
+ if ( $met > 55 && ! wppa_is_cron() && ! defined( 'DOING_WPPA_AJAX' ) ) {
39
  $met = 55;
40
  }
41
  else {