WP Photo Album Plus - Version 7.3.12.004

Version Description

= 7.3.11 =

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

Release Info

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

Code changes from version 7.3.12.003 to 7.3.12.004

Files changed (4) hide show
  1. changelog.txt +1 -0
  2. readme.txt +1 -1
  3. wppa-filter.php +30 -20
  4. wppa.php +2 -2
changelog.txt CHANGED
@@ -9,6 +9,7 @@ to the album cover image selection on the album admin and on the settings page;
9
  Added '--- default --- See Table IV-D2' to the cover image selection box on the album admin page.
10
  These changes make it simpler to change the selection method for all -default- albums at once,
11
  provided that the settings on the album admin pages are set to the default, previously being random.
 
12
 
13
  = 7.3.11 =
14
 
9
  Added '--- default --- See Table IV-D2' to the cover image selection box on the album admin page.
10
  These changes make it simpler to change the selection method for all -default- albums at once,
11
  provided that the settings on the album admin pages are set to the default, previously being random.
12
+ * The album and parent attributes in the wppa shortcodes with type="acount" and type="pcount" can now also be an album enumeration.
13
 
14
  = 7.3.11 =
15
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
- Version: 7.3.12.003
6
  Stable tag: 7.3.11.006
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
+ Version: 7.3.12.004
6
  Stable tag: 7.3.11.006
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
wppa-filter.php CHANGED
@@ -357,8 +357,8 @@ global $wppa_revno;
357
  case 'pcount':
358
  $is_acount = ( $atts['type'] == 'acount' );
359
  $is_pcount = ( $atts['type'] == 'pcount' );
360
- $is_album = ( isset( $xatts['album'] ) && ! isset( $xatts['parent'] ) && strval( intval( $xatts['album'] ) ) === $xatts['album'] );
361
- $is_parent = ( isset( $xatts['parent'] ) && ! isset( $xatts['album'] ) && strval( intval( $xatts['parent'] ) ) === $xatts['parent'] );
362
  if ( $is_album ) {
363
  $alb = $xatts['album'];
364
  }
@@ -368,29 +368,39 @@ global $wppa_revno;
368
  else {
369
  $alb = '0';
370
  }
371
- if ( $alb < '1' ) {
372
- $err = '<span style="color:red;" >Error in shortcode spec for type="' . $atts['type'] . '": either attribute album="" or parent="" should supply a positive integer';
 
 
 
 
373
  return $err;
374
  }
375
 
376
- $counts = wppa_get_treecounts_a( $alb );
377
-
378
- if ( $is_album ) {
379
- if ( $is_acount ) {
380
- return $counts['selfalbums'];
381
- }
382
- else {
383
- return $counts['selfphotos'];
384
- }
385
- }
386
- else {
387
- if ( $is_acount ) {
388
- return $counts['treealbums'];
389
- }
390
- else {
391
- return $counts['treephotos'];
 
 
 
 
 
392
  }
393
  }
 
394
  break;
395
  case 'share':
396
  $result = wppa_get_share_page_html();
357
  case 'pcount':
358
  $is_acount = ( $atts['type'] == 'acount' );
359
  $is_pcount = ( $atts['type'] == 'pcount' );
360
+ $is_album = ( isset( $xatts['album'] ) && ! isset( $xatts['parent'] ) && wppa_is_enum( $xatts['album'] ) );
361
+ $is_parent = ( isset( $xatts['parent'] ) && ! isset( $xatts['album'] ) && wppa_is_enum( $xatts['parent'] ) );
362
  if ( $is_album ) {
363
  $alb = $xatts['album'];
364
  }
368
  else {
369
  $alb = '0';
370
  }
371
+ if ( ! $alb || $alb < '1' ) {
372
+ $err = '
373
+ <span style="color:red;" >
374
+ Error in shortcode spec for type="' . $atts['type'] . '":
375
+ either attribute album="" or parent="" should supply a positive integer or enumeration
376
+ </span>';
377
  return $err;
378
  }
379
 
380
+ $albs = explode( '.', wppa_expand_enum( $alb ) );
381
+ $total = 0;
382
+ foreach( $albs as $alb ) {
383
+ $counts = wppa_get_treecounts_a( $alb );
384
+ if ( is_array( $counts ) ) {
385
+ if ( $is_album ) {
386
+ if ( $is_acount ) {
387
+ $total += $counts['selfalbums'];
388
+ }
389
+ else {
390
+ $total += $counts['selfphotos'];
391
+ }
392
+ }
393
+ else {
394
+ if ( $is_acount ) {
395
+ $total += $counts['treealbums'];
396
+ }
397
+ else {
398
+ $total += $counts['treephotos'];
399
+ }
400
+ }
401
  }
402
  }
403
+ return $total;
404
  break;
405
  case 'share':
406
  $result = wppa_get_share_page_html();
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 7.3.12.003
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_revno; $wppa_revno = '7311'; // WPPA db version
27
- global $wppa_api_version; $wppa_api_version = '7.3.12.003'; // WPPA software version
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 7.3.12.004
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_revno; $wppa_revno = '7311'; // WPPA db version
27
+ global $wppa_api_version; $wppa_api_version = '7.3.12.004'; // WPPA software version
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';