WP Photo Album Plus - Version 8.0.03.005

Version Description

= 8.0.03 =

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

Release Info

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

Code changes from version 8.0.03.004 to 8.0.03.005

Files changed (4) hide show
  1. theme/wppa-theme.php +23 -6
  2. wppa-encrypt.php +4 -4
  3. wppa-functions.php +28 -2
  4. wppa.php +2 -2
theme/wppa-theme.php CHANGED
@@ -3,11 +3,11 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the albums/photos/slideshow in a page or post
6
- * Version 8.0.00.003
7
  */
8
  function wppa_theme() {
9
 
10
- global $wppa_version; $wppa_version = '8.0.00.003'; // 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
 
@@ -18,7 +18,7 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
18
  $mocc = wppa( 'mocc' );
19
 
20
  // Delayed displsy?
21
- if ( wppa( 'delay' ) && wppa_switch( 'allow_ajax' ) && ! wppa_switch( 'defer_javascript' ) ) {
22
 
23
  // Open container
24
  wppa_container( 'open' );
@@ -55,7 +55,7 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
55
  // Close container
56
  wppa_container( 'close' );
57
 
58
- } // Delaed
59
 
60
  // Not delayed
61
  else {
@@ -441,12 +441,15 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
441
  if ( ! $didsome && ! $wanted_empty ) {
442
  if ( wppa( 'photos_only' ) ) {
443
  wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wp-photo-album-plus' ) ) );
 
444
  }
445
  elseif ( wppa( 'albums_only' ) ) {
446
  wppa_out( wppa_errorbox( __( 'No albums found matching your search criteria.', 'wp-photo-album-plus' ) ) );
 
447
  }
448
  else {
449
  wppa_out( wppa_errorbox( __( 'No albums or photos found matching your search criteria.', 'wp-photo-album-plus' ) ) );
 
450
  }
451
  }
452
  } // wppa_page( 'albums' )
@@ -459,7 +462,8 @@ global $wppa_show_statistics; // Can be set to true by a custom page templa
459
  wppa_run_slidecontainer( 'slideshow' ); // Fill in the photo array and display it.
460
  }
461
  else {
462
- wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wppa_theme' , 'wp-photo-album-plus') ) );
 
463
  }
464
  } // wppa_page( 'slide' )
465
 
@@ -579,4 +583,17 @@ function wppa_get_extra_url() {
579
  if ( wppa( 'is_inverse' ) ) $extra_url .= '&wppa-inv=1';
580
 
581
  return $extra_url;
582
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the albums/photos/slideshow in a page or post
6
+ * Version 8.0.03.005
7
  */
8
  function wppa_theme() {
9
 
10
+ global $wppa_version; $wppa_version = '8.0.03.005'; // 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
 
18
  $mocc = wppa( 'mocc' );
19
 
20
  // Delayed displsy?
21
+ if ( wppa( 'delay' ) && ! wppa_switch( 'defer_javascript' ) ) {
22
 
23
  // Open container
24
  wppa_container( 'open' );
55
  // Close container
56
  wppa_container( 'close' );
57
 
58
+ } // Delayed
59
 
60
  // Not delayed
61
  else {
441
  if ( ! $didsome && ! $wanted_empty ) {
442
  if ( wppa( 'photos_only' ) ) {
443
  wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wp-photo-album-plus' ) ) );
444
+ wppa_report_nothing(1);
445
  }
446
  elseif ( wppa( 'albums_only' ) ) {
447
  wppa_out( wppa_errorbox( __( 'No albums found matching your search criteria.', 'wp-photo-album-plus' ) ) );
448
+ wppa_report_nothing(2);
449
  }
450
  else {
451
  wppa_out( wppa_errorbox( __( 'No albums or photos found matching your search criteria.', 'wp-photo-album-plus' ) ) );
452
+ wppa_report_nothing(3);
453
  }
454
  }
455
  } // wppa_page( 'albums' )
462
  wppa_run_slidecontainer( 'slideshow' ); // Fill in the photo array and display it.
463
  }
464
  else {
465
+ wppa_out( wppa_errorbox( __( 'No photos found matching your search criteria.', 'wp-photo-album-plus') ) );
466
+ wppa_report_nothing(4);
467
  }
468
  } // wppa_page( 'slide' )
469
 
583
  if ( wppa( 'is_inverse' ) ) $extra_url .= '&wppa-inv=1';
584
 
585
  return $extra_url;
586
+ }
587
+
588
+ function wppa_report_nothing( $where ) {
589
+ global $wppa;
590
+
591
+ $t = $wppa;
592
+ foreach ( array_keys( $t ) as $key ) {
593
+ if ( ! $t[$key] ) unset ( $t[$key] );
594
+ }
595
+ $s = var_export( $t, true );
596
+ $result = "Nothing found. Location: $where. Dynamic settings: $s";
597
+ wppa_log( 'war', $result, true );
598
+ }
599
+
wppa-encrypt.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all ecryption/decryption logic
6
- * Version 7.3.00
7
  *
8
  */
9
 
@@ -166,7 +166,7 @@ global $wpdb;
166
  if ( strlen( $photo ) < 12 ) {
167
  if ( wppa_switch( 'refuse_unencrypted' ) && ! $no_refuse ) {
168
  wppa_dbg_msg( 'Invalid photo identifier (1): ' . $photo, 'red', 'force' );
169
- wppa_log( 'dbg', 'Invalid photo identifier (1): ' . $photo, true );
170
  return false;
171
  }
172
  return intval( $photo );
@@ -177,7 +177,7 @@ global $wpdb;
177
  if ( ! $id ) {
178
  if ( $report_error ) {
179
  wppa_dbg_msg( 'Invalid photo identifier (2): ' . $photo, 'red', 'force' );
180
- wppa_log( 'dbg', 'Invalid photo identifier (2): ' . $photo, true );
181
  }
182
  }
183
 
@@ -238,7 +238,7 @@ global $wpdb;
238
  else {
239
  $id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_albums WHERE crypt = %s", substr( $crypt, 0, 12 ) ) );
240
  if ( ! $id ) {
241
- wppa_log( 'Dbg', 'Invalid album identifier: ' . $crypt . ' found in: ' . $album . ' (wppa_decrypt_album)' );
242
  $id = '-9';
243
  }
244
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all ecryption/decryption logic
6
+ * Version 8.0.03.005
7
  *
8
  */
9
 
166
  if ( strlen( $photo ) < 12 ) {
167
  if ( wppa_switch( 'refuse_unencrypted' ) && ! $no_refuse ) {
168
  wppa_dbg_msg( 'Invalid photo identifier (1): ' . $photo, 'red', 'force' );
169
+ wppa_log( 'war', 'Could not decrypt photo (1): ' . $photo, true );
170
  return false;
171
  }
172
  return intval( $photo );
177
  if ( ! $id ) {
178
  if ( $report_error ) {
179
  wppa_dbg_msg( 'Invalid photo identifier (2): ' . $photo, 'red', 'force' );
180
+ wppa_log( 'war', 'Could not decrypt photo (2): ' . $photo, true );
181
  }
182
  }
183
 
238
  else {
239
  $id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_albums WHERE crypt = %s", substr( $crypt, 0, 12 ) ) );
240
  if ( ! $id ) {
241
+ wppa_log( 'war', 'Could not decrypt album: ' . $crypt . ' found in: ' . $album . ' (wppa_decrypt_album)' );
242
  $id = '-9';
243
  }
244
  }
wppa-functions.php CHANGED
@@ -959,7 +959,7 @@ global $wppa_current_shortcode_atts;
959
  }
960
  else wppa_out( '<span style="color:red">ERROR: Missing function wppa_theme(), check the installation of WPPA+. Remove customized wppa_theme.php</span>' );
961
  global $wppa_version;
962
- $expected_version = '8.0.00.003';
963
  if ( $wppa_version != $expected_version ) {
964
  wppa_dbg_msg( 'WARNING: customized wppa-theme.php is out of rev. Expected version: ' . $expected_version . ' found: ' . $wppa_version, 'red' );
965
  }
@@ -1071,7 +1071,16 @@ function wppa_get_albums() {
1071
  global $wpdb;
1072
  global $wppa_session;
1073
 
1074
- wppa_dbg_msg( 'get_albums entered: ' . wppa( 'mocc' ) . ' Start_album=' . wppa('start_album') . ', Cover=' . wppa( 'is_cover' ) );
 
 
 
 
 
 
 
 
 
1075
 
1076
  if ( wppa( 'is_topten' ) ) return false;
1077
  if ( wppa( 'is_lasten' ) ) return false;
@@ -1327,6 +1336,15 @@ global $wppa_session;
1327
  // Make Album clause if album given
1328
  if ( wppa( 'start_album' ) ) {
1329
 
 
 
 
 
 
 
 
 
 
1330
  // See if album is an enumeration or range
1331
  $fullalb = wppa( 'start_album' );
1332
 
@@ -1360,6 +1378,14 @@ global $wppa_session;
1360
 
1361
  // Single image slideshow?
1362
  if ( wppa( 'start_photo' ) && wppa( 'is_single' ) ) {
 
 
 
 
 
 
 
 
1363
  $query = $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
1364
  WHERE id = %s", wppa( 'start_photo' ) );
1365
  }
959
  }
960
  else wppa_out( '<span style="color:red">ERROR: Missing function wppa_theme(), check the installation of WPPA+. Remove customized wppa_theme.php</span>' );
961
  global $wppa_version;
962
+ $expected_version = '8.0.03.005';
963
  if ( $wppa_version != $expected_version ) {
964
  wppa_dbg_msg( 'WARNING: customized wppa-theme.php is out of rev. Expected version: ' . $expected_version . ' found: ' . $wppa_version, 'red' );
965
  }
1071
  global $wpdb;
1072
  global $wppa_session;
1073
 
1074
+ wppa_dbg_msg( 'get_albums entered: ' . wppa( 'mocc' ) . ' Start_album=' . wppa( 'start_album' ) . ', Cover=' . wppa( 'is_cover' ) );
1075
+
1076
+ // Check encryption
1077
+ if ( wppa( 'start_album' ) ) {
1078
+ $t = wppa_decrypt_album( wppa( 'start_album' ), true, true );
1079
+ if ( $t != wppa( 'start_album' ) ) {
1080
+ wppa_log( 'err', 'Encrypted album id founc in wppa_get_albums() ' . wppa( 'start_album' ) . ' jit fixed', true );
1081
+ wppa( 'start_album', $t );
1082
+ }
1083
+ }
1084
 
1085
  if ( wppa( 'is_topten' ) ) return false;
1086
  if ( wppa( 'is_lasten' ) ) return false;
1336
  // Make Album clause if album given
1337
  if ( wppa( 'start_album' ) ) {
1338
 
1339
+ // Check encryption
1340
+ if ( wppa( 'start_album' ) ) {
1341
+ $t = wppa_decrypt_album( wppa( 'start_album' ), true, true );
1342
+ if ( $t != wppa( 'start_album' ) ) {
1343
+ wppa_log( 'err', 'Encrypted album id founc in wppa_get_thumbs() ' . wppa( 'start_album' ) . ' jit fixed', true );
1344
+ wppa( 'start_album', $t );
1345
+ }
1346
+ }
1347
+
1348
  // See if album is an enumeration or range
1349
  $fullalb = wppa( 'start_album' );
1350
 
1378
 
1379
  // Single image slideshow?
1380
  if ( wppa( 'start_photo' ) && wppa( 'is_single' ) ) {
1381
+
1382
+ // Check encryption
1383
+ $t = wppa_decrypt_photo( wppa( 'start_photo' ), true, true );
1384
+ if ( $t != wppa( 'start_photo' ) ) {
1385
+ wppa_log( 'err', 'Encrypted photo id founc in wppa_get_thumbs() ' . wppa( 'start_album' ) . ' jit fixed' );
1386
+ wppa( 'start_photo', $t );
1387
+ }
1388
+
1389
  $query = $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
1390
  WHERE id = %s", wppa( 'start_photo' ) );
1391
  }
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.0.03.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,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.0.03.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.0.03.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
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.0.03.005'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30