WP Photo Album Plus - Version 8.2.05.006

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

Code changes from version 8.2.05.005 to 8.2.05.006

Files changed (3) hide show
  1. wppa-slideshow.php +19 -27
  2. wppa-theme.php +43 -4
  3. wppa.php +2 -2
wppa-slideshow.php CHANGED
@@ -4,15 +4,15 @@
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
- * Version 8.2.05.000
8
  *
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
12
 
13
- function wppa_the_slideshow( $thumbs ) {
14
 
15
- wppa_prepare_slideshow_pagination( $thumbs );
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 ) {
25
  wppa_start_stop('optional'); // The 'Slower | start/stop | Faster' bar
26
  break;
27
  case '1':
28
- wppa_slide_frame(); // The photo / slide
29
  break;
30
  case '2':
31
  wppa_slide_name_box('optional'); // Show name in a box.
@@ -40,7 +40,7 @@ function wppa_the_slideshow( $thumbs ) {
40
  wppa_slide_rating('optional'); // Rating box
41
  break;
42
  case '6':
43
- wppa_slide_filmstrip('optional'); // Show Filmstrip
44
  break;
45
  case '7':
46
  wppa_browsebar('optional'); // The 'Previous photo | Photo n of m | Next photo' bar
@@ -72,7 +72,7 @@ function wppa_the_slideshow( $thumbs ) {
72
  wppa_start_stop('optional'); // The 'Slower | start/stop | Faster' bar
73
  break;
74
  case '1':
75
- wppa_slide_frame(); // The photo / slide
76
  break;
77
  case '2':
78
  wppa_slide_name_desc('optional'); // Show name and description in a box.
@@ -84,7 +84,7 @@ function wppa_the_slideshow( $thumbs ) {
84
  wppa_slide_rating('optional'); // Rating box
85
  break;
86
  case '5':
87
- wppa_slide_filmstrip('optional'); // Show Filmstrip
88
  break;
89
  case '6':
90
  wppa_browsebar('optional'); // The 'Previous photo | Photo n of m | Next photo' bar
@@ -417,7 +417,7 @@ function wppa_start_stop_text( $opt = '' ) {
417
  wppa_out( $result );
418
  }
419
 
420
- function wppa_slide_frame() {
421
 
422
  if ( is_feed() ) return;
423
  if ( wppa( 'is_filmonly' ) ) return;
@@ -581,7 +581,7 @@ function wppa_slide_frame() {
581
  }
582
 
583
  wppa_startstop_icons();
584
- wppa_numberbar();
585
 
586
  wppa_out( '</div>' );
587
  }
@@ -1268,28 +1268,20 @@ global $wpdb;
1268
  return $result;
1269
  }
1270
 
1271
- function wppa_slide_filmstrip( $opt = '' ) {
1272
 
1273
  // A single image slideshow needs no navigation
1274
  if ( wppa( 'is_single' ) ) return;
1275
 
1276
- $do_it = false; // Init
1277
- if ( is_feed() ) $do_it = true; // feed -> do it to indicate that there is a slideshow
1278
- else { // Not a feed
1279
- if ( $opt != 'optional' ) $do_it = true; // not optional -> do it
1280
- else { // optional
1281
- if ( wppa_switch( 'filmstrip') ) { // optional and option on
1282
- if ( ! wppa( 'is_slideonly' ) ) $do_it = true; // always except slideonly
1283
- }
1284
- if ( wppa( 'film_on' ) ) $do_it = true; // explicitly turned on
1285
- }
1286
  }
1287
- if ( ! $do_it ) return; // Don't do it
1288
-
1289
- $alb = wppa_get( 'album' );
1290
 
1291
- $thumbs = wppa_get_photos();
1292
- if ( ! $thumbs || count( $thumbs ) < 1 ) return;
1293
 
1294
  $preambule = wppa_get_preambule();
1295
 
@@ -1464,7 +1456,7 @@ function wppa_startstop_icons() {
1464
  wppa_js( 'jQuery(document).ready(jQuery(\'#wppa-startstop-icon-' . wppa( 'mocc' ) . '\').stop().fadeTo(2500,0));' );
1465
  }
1466
 
1467
- function wppa_numberbar( $opt = '' ) {
1468
 
1469
  // A single image slideshow needs no navigation
1470
  if ( wppa( 'is_single' ) ) return;
@@ -1477,7 +1469,7 @@ function wppa_numberbar( $opt = '' ) {
1477
  if( ! $do_it ) return;
1478
 
1479
  // get the data
1480
- $thumbs = wppa_get_photos();
1481
  if ( empty( $thumbs ) ) return;
1482
 
1483
  // get the sizes
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
  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.
40
  wppa_slide_rating('optional'); // Rating box
41
  break;
42
  case '6':
43
+ wppa_slide_filmstrip( $thumbs ); // Show Filmstrip
44
  break;
45
  case '7':
46
  wppa_browsebar('optional'); // The 'Previous photo | Photo n of m | Next photo' bar
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.
84
  wppa_slide_rating('optional'); // Rating box
85
  break;
86
  case '5':
87
+ wppa_slide_filmstrip( $thumbs ); // Show Filmstrip
88
  break;
89
  case '6':
90
  wppa_browsebar('optional'); // The 'Previous photo | Photo n of m | Next photo' bar
417
  wppa_out( $result );
418
  }
419
 
420
+ function wppa_slide_frame( $thumbs ) {
421
 
422
  if ( is_feed() ) return;
423
  if ( wppa( 'is_filmonly' ) ) return;
581
  }
582
 
583
  wppa_startstop_icons();
584
+ wppa_numberbar( $thumbs );
585
 
586
  wppa_out( '</div>' );
587
  }
1268
  return $result;
1269
  }
1270
 
1271
+ function wppa_slide_filmstrip( $thumbs ) {
1272
 
1273
  // A single image slideshow needs no navigation
1274
  if ( wppa( 'is_single' ) ) return;
1275
 
1276
+ $do_it = false; // Init
1277
+ if ( is_feed() ) $do_it = true; // feed -> do it to indicate that there is a slideshow
1278
+ if ( wppa_switch( 'filmstrip' ) ) { // option on
1279
+ if ( ! wppa( 'is_slideonly' ) ) $do_it = true; // always except slideonly
1280
+ if ( wppa( 'film_on' ) ) $do_it = true; // explicitly turned on
 
 
 
 
 
1281
  }
 
 
 
1282
 
1283
+ if ( ! $do_it ) return; // Don't do it
1284
+ if ( ! $thumbs || count( $thumbs ) < 1 ) return; // No items
1285
 
1286
  $preambule = wppa_get_preambule();
1287
 
1456
  wppa_js( 'jQuery(document).ready(jQuery(\'#wppa-startstop-icon-' . wppa( 'mocc' ) . '\').stop().fadeTo(2500,0));' );
1457
  }
1458
 
1459
+ function wppa_numberbar( $thumbs ) {
1460
 
1461
  // A single image slideshow needs no navigation
1462
  if ( wppa( 'is_single' ) ) return;
1469
  if( ! $do_it ) return;
1470
 
1471
  // get the data
1472
+ // $thumbs = wppa_get_photos();
1473
  if ( empty( $thumbs ) ) return;
1474
 
1475
  // get the sizes
wppa-theme.php CHANGED
@@ -3,11 +3,11 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the albums/photos/slideshow in a page or post
6
- * Version 8.2.05.000
7
  */
8
  function wppa_theme() {
9
 
10
- global $wppa_version; $wppa_version = '8.2.05.000'; // 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;
@@ -411,9 +411,48 @@ global $wppa_empty_content;
411
  } // wppa_page( 'albums' )
412
 
413
  elseif ( wppa_page( 'slide' ) || wppa_page( 'single' ) ) { // Page 'Slideshow' or 'Single' in browsemode requested
414
- $thumbs = wppa_get_photos();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  if ( $thumbs ) {
416
- wppa_the_slideshow( $thumbs ); // Producs all the html required for the slideshow
417
  wppa_run_slidecontainer( $thumbs ); // Fill in the photo array and display it.
418
  }
419
  else {
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;
411
  } // wppa_page( 'albums' )
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 {
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.005
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.2.05.004'; // 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.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/
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