WP Photo Album Plus - Version 7.2.06.009

Version Description

= 7.2.06 =

  • This version addresses various bug fixes and feature requests.
  • This version addresses various security issues.

= 7.2.05 =

  • This version addresses various bug fixes and feature requests.
  • This version addresses various security issues.

= 7.2.04 =

  • This version addresses various bug fixes and feature requests.

= 7.2.03 =

  • This version addresses various bug fixes and feature requests.

= 7.2.02 =

  • This version addresses various bug fixes and feature requests.

= 7.2.01 =

  • This version addresses various bug fixes and feature requests.

= 7.2.00 =

  • This version addresses various bug fixes and feature requests.

= 7.1.11 =

  • This version addresses various bug fixes and feature requests.

= 7.1.10 =

  • This version addresses various bug fixes and feature requests.

= 7.1.09 =

  • This version addresses various bug fixes and feature requests.

= 7.1.08 =

  • This version addresses various bug fixes and feature requests.

= 7.1.07 =

  • This version addresses various bug fixes and feature requests.

= 7.1.06 =

  • This version addresses various bug fixes and feature requests.

= 7.1.05 =

  • This version addresses various security issues.
  • This version addresses various bug fixes.

= 7.1.04 =

  • This version addresses various bug fixes.

= 7.1.03 =

  • This version addresses various security issues.
  • This version addresses various bug fixes.

= 7.1.02 =

  • This version addresses various security issues.
  • This version addresses various bug fixes and feature requests.

= 7.1.01 =

  • This version addresses various bug fixes and feature requests.

= 7.1.00 =

  • This version addresses various bug fixes and feature requests.
  • The Photo Album -> Upload Photos and Import Photos admin pages have been substantially improved. Read the changelog for details.

= 7.0.11 =

  • This version addresses various bug fixes and feature requests.

= 7.0.11 =

  • This version addresses various bug fixes

= 7.0.10 =

  • This version addresses various bug fixes

= 7.0.09 =

  • This version addresses various security issues.
  • This version addresses various bug fixes and feature requests.

= 7.0.08 =

  • This version addresses various security issues.
  • This version addresses various bug fixes

= 7.0.07 =

  • This version addresses various security issues.
  • This version addresses various bug fixes

= 7.0.06 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.05 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 7.0.04 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.03 =

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

= 7.0.02 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.01 =

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

= 7.0.00 =

  • Shortcode generators for Gutenberg added.
  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.
  • To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised. Configure Table IX-M to enable various mailing lists, and use the WPPA+ Notify widget for full user flexibility.

= 6.9.21 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 6.9.20 =

  • This version addresses various bug fixes

= 6.9.19 =

  • This version addresses various minor bug fixes

= 6.9.18 =

  • This version addresses various minor bug fixes

= 6.9.17 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.16 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.15 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.14 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.13 =

  • Security release.

= 6.9.12 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.11 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.10 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.09 =

  • Panorama support phase III.

= 6.9.08 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase II.

= 6.9.07 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase I.

= 6.9.06 =

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

= 6.9.05 =

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

= 6.9.04 =

  • This version addresses various minor bug fixes and feature requests.
  • Local CDN functionality has been added.

= 6.9.03 =

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

= 6.9.02 =

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

= 6.9.01 =

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

= 6.9.00 =

  • This version includes the code for the privacy policy requirements.

= 6.8.09

  • This version addresses various bug fixes and code edits.

= 6.8.08 =

  • This version addresses various minor bug fixes and feature requests.
  • This version offers substantial performance improvements when the box in Table IV-A13: Defer Javascript is ticked. This setting is now recommended and set ticked as the default.
  • For more info on performance improvements and compatibility with optimizers: see the changelog.txt

= 6.8.07 =

  • This version addresses various minor bug fixes and enhancements, and a new widget: Statistics.

= 6.8.06 =

  • This version addresses various minor bug fixes and improved cache handling.

= 6.8.05 =

  • This version addresses various minor bug fixes and feture requests.

= 6.8.04 =

  • This version addresses various display issues and a few fixes of bugs that seldom affected the plugins behaviour.
Download this release

Release Info

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

Code changes from version 7.2.05.008 to 7.2.06.009

changelog.txt CHANGED
@@ -1,5 +1,11 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
 
3
  = 7.2.05 =
4
 
5
  * Various minor security issues fixed.
1
  WP Photo Album Plus Changelog
2
 
3
+ = 7.2.06 =
4
+
5
+ * Fixed a few issues with user display names with accented characters.
6
+ * New setting: Table IX-E22: Placeholder text for the search photos box/widget.
7
+ * Various security and code quality issues fixed.
8
+
9
  = 7.2.05 =
10
 
11
  * Various minor security issues fixed.
readme.txt CHANGED
@@ -2,8 +2,8 @@
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.2.05.008
6
- Stable tag: 7.2.04.005
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -137,6 +137,11 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
137
 
138
  == Upgrade Notice ==
139
 
 
 
 
 
 
140
  = 7.2.05 =
141
 
142
  * This version addresses various bug fixes and feature requests.
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.2.06.009
6
+ Stable tag: 7.2.05.008
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
137
 
138
  == Upgrade Notice ==
139
 
140
+ = 7.2.06 =
141
+
142
+ * This version addresses various bug fixes and feature requests.
143
+ * This version addresses various security issues.
144
+
145
  = 7.2.05 =
146
 
147
  * This version addresses various bug fixes and feature requests.
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 7.2.03
7
  *
8
  */
9
 
@@ -231,7 +231,7 @@ function wppa_user_select( $select = '' ) {
231
  foreach ( $users as $usr ) {
232
  if ( $usr['user_login'] == $iam ) $sel = 'selected="selected"';
233
  else $sel = '';
234
- $result .= '<option value="' . esc_attr( $usr['user_login'] ) . '" ' . $sel . '>' . htmlentities( $usr['display_name'] ) . '</option>';
235
  }
236
  echo ( $result );
237
  }
@@ -428,6 +428,8 @@ global $wpdb;
428
  }
429
  $rotate = $source;
430
  break;
 
 
431
  }
432
 
433
  // Save the image
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 7.2.06
7
  *
8
  */
9
 
231
  foreach ( $users as $usr ) {
232
  if ( $usr['user_login'] == $iam ) $sel = 'selected="selected"';
233
  else $sel = '';
234
+ $result .= '<option value="' . esc_attr( $usr['user_login'] ) . '" ' . $sel . '>' . htmlspecialchars( $usr['display_name'] ) . '</option>';
235
  }
236
  echo ( $result );
237
  }
428
  }
429
  $rotate = $source;
430
  break;
431
+ default:
432
+ return $err;
433
  }
434
 
435
  // Save the image
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 7.2.03
7
  *
8
  */
9
 
@@ -328,7 +328,7 @@ global $wpdb;
328
  $post = strval( intval ( $_GET['post'] ) );
329
 
330
  // Get posts with wppa block_categories
331
- $posts = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->posts}
332
  WHERE ID = %d
333
  AND ( post_content LIKE %s
334
  OR post_content LIKE %s )",
@@ -339,7 +339,7 @@ global $wpdb;
339
  if ( ! empty( $posts ) ) {
340
  foreach( $posts as $post ) {
341
  $new_content = str_replace( array( 'wp:wppa/gutenberg-photo', 'wp:wppa/gutenberg-wppa' ), 'wp:shortcode', $post['post_content'] );
342
- $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->posts}
343
  SET post_content = %s
344
  WHERE ID = %d", $new_content, $post['ID'] ) );
345
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
+ * Version 7.2.06
7
  *
8
  */
9
 
328
  $post = strval( intval ( $_GET['post'] ) );
329
 
330
  // Get posts with wppa block_categories
331
+ $posts = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts
332
  WHERE ID = %d
333
  AND ( post_content LIKE %s
334
  OR post_content LIKE %s )",
339
  if ( ! empty( $posts ) ) {
340
  foreach( $posts as $post ) {
341
  $new_content = str_replace( array( 'wp:wppa/gutenberg-photo', 'wp:wppa/gutenberg-wppa' ), 'wp:shortcode', $post['post_content'] );
342
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts
343
  SET post_content = %s
344
  WHERE ID = %d", $new_content, $post['ID'] ) );
345
  }
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 7.2.05
6
  *
7
  */
8
 
@@ -1758,6 +1758,9 @@ global $wppa_log_file;
1758
  $err = '3';
1759
  }
1760
  break;
 
 
 
1761
  }
1762
  }
1763
 
@@ -1876,6 +1879,7 @@ global $wppa_log_file;
1876
  break;
1877
  case 'flip':
1878
  case 'flop':
 
1879
  $dir = '';
1880
  break;
1881
  }
@@ -2017,6 +2021,8 @@ global $wppa_log_file;
2017
  case 'crop':
2018
  $command = '-crop ' . $value;
2019
  break;
 
 
2020
  }
2021
 
2022
  $path = wppa_get_photo_path( $id );
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 7.2.06
6
  *
7
  */
8
 
1758
  $err = '3';
1759
  }
1760
  break;
1761
+ default:
1762
+ $err = '9';
1763
+ break;
1764
  }
1765
  }
1766
 
1879
  break;
1880
  case 'flip':
1881
  case 'flop':
1882
+ default:
1883
  $dir = '';
1884
  break;
1885
  }
2021
  case 'crop':
2022
  $command = '-crop ' . $value;
2023
  break;
2024
+ default:
2025
+ break;
2026
  }
2027
 
2028
  $path = wppa_get_photo_path( $id );
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 7.2.05
7
  *
8
  */
9
 
@@ -52,7 +52,7 @@ global $wppa_revno;
52
  }
53
  if ( $alb['cover_linkpage'] > '0' ) {
54
  $iret = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*)
55
- FROM {$wpdb->posts}
56
  WHERE ID = %d
57
  AND post_type = 'page'
58
  AND post_status = 'publish'", $alb['cover_linkpage'] ) );
@@ -1533,9 +1533,7 @@ global $wpdb;
1533
  $albums = array();
1534
  $i = 0;
1535
  foreach( $temp as $item ) {
1536
- if ( $i < $skips ) {}
1537
- elseif ( $i >= ( $skips + $pagesize ) ) {}
1538
- else {
1539
  $albums[] = $item;
1540
  }
1541
  $i++;
@@ -1959,9 +1957,7 @@ global $wpdb;
1959
  $albums = array();
1960
  $i = 0;
1961
  foreach( $temp as $item ) {
1962
- if ( $i < $skips ) {}
1963
- elseif ( $i >= ( $skips + $pagesize ) ) {}
1964
- else {
1965
  $albums[] = $item;
1966
  }
1967
  $i++;
@@ -2607,10 +2603,7 @@ global $wpdb;
2607
  return false;
2608
  }
2609
 
2610
- if ( wppa_user_is( 'administrator' ) || wppa_get_album_item( $id, 'owner' ) == wppa_get_user() ) {
2611
- // Ok to delete
2612
- }
2613
- else {
2614
  wppa_error_message( sprintf( __( 'You do not have sufficient rights to delete album %s. Album not deleted.', 'wp-photo-album-plus' ), $id ) );
2615
  return false;
2616
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 7.2.06
7
  *
8
  */
9
 
52
  }
53
  if ( $alb['cover_linkpage'] > '0' ) {
54
  $iret = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*)
55
+ FROM $wpdb->posts
56
  WHERE ID = %d
57
  AND post_type = 'page'
58
  AND post_status = 'publish'", $alb['cover_linkpage'] ) );
1533
  $albums = array();
1534
  $i = 0;
1535
  foreach( $temp as $item ) {
1536
+ if ( $i >= $skips && $i < ( $skips + $pagesize ) ) {
 
 
1537
  $albums[] = $item;
1538
  }
1539
  $i++;
1957
  $albums = array();
1958
  $i = 0;
1959
  foreach( $temp as $item ) {
1960
+ if ( $i >= $skips && $i < ( $skips + $pagesize ) ) {
 
 
1961
  $albums[] = $item;
1962
  }
1963
  $i++;
2603
  return false;
2604
  }
2605
 
2606
+ if ( ! wppa_user_is( 'administrator' ) && ! wppa_get_album_item( $id, 'owner' ) == wppa_get_user() ) {
 
 
 
2607
  wppa_error_message( sprintf( __( 'You do not have sufficient rights to delete album %s. Album not deleted.', 'wp-photo-album-plus' ), $id ) );
2608
  return false;
2609
  }
wppa-album-covers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
- * Version 7.2.05
7
  *
8
  */
9
 
@@ -2087,6 +2087,8 @@ global $wpdb;
2087
  );
2088
  }
2089
  break;
 
 
2090
  }
2091
 
2092
  // Go deeper for grandchildren
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 7.2.06
7
  *
8
  */
9
 
2087
  );
2088
  }
2089
  break;
2090
+ default:
2091
+ break;
2092
  }
2093
 
2094
  // Go deeper for grandchildren
wppa-album-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
- * Version 7.2.01
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -108,7 +108,7 @@ class AlbumWidget extends WP_Widget {
108
 
109
  $imageid = wppa_get_coverphoto_id( $album['id'] );
110
  $image = $imageid ? wppa_cache_thumb( $imageid ) : false;
111
- $imgcount = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM '.WPPA_PHOTOS.' WHERE album = %s', $album['id'] ) );
112
  $subalbumcount = wppa_has_children( $album['id'] );
113
  $thumb = $image;
114
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
+ * Version 7.2.06
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
108
 
109
  $imageid = wppa_get_coverphoto_id( $album['id'] );
110
  $image = $imageid ? wppa_cache_thumb( $imageid ) : false;
111
+ $imgcount = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE album = %s", $album['id'] ) );
112
  $subalbumcount = wppa_has_children( $album['id'] );
113
  $thumb = $image;
114
 
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 7.2.04
7
  *
8
  */
9
 
@@ -344,7 +344,7 @@ global $wppa_session;
344
  $form_core = str_replace( 'value=""', 'value="' . esc_attr( isset( $_REQUEST['wppa-searchstring'] ) ? $_REQUEST['wppa-searchstring'] : '' ) . '"', $form_core );
345
 
346
  // Fix placeholder
347
- $form_core = preg_replace( '/placeholder=\"[^\"]*/', 'placeholder="' . esc_attr( __( 'Search photos &hellip;', 'wp-photo-album-plus' ) ), $form_core );
348
 
349
  // Insert
350
  $result .= $form_core;
@@ -2179,8 +2179,9 @@ wppa_log('obs', 'pubic');
2179
  elseif ( $where == 'thumb' ) {
2180
  $returnurl .= 'wppa-album=' . $parent . '&amp;wppa-cover=0&amp;wppa-occur=' . $occur;
2181
  }
2182
- elseif ( $where == 'widget' || $where == 'uploadbox' ) {
2183
- }
 
2184
  if ( wppa( 'page' ) ) $returnurl .= '&amp;wppa-page=' . wppa( 'page' );
2185
  $returnurl = trim( $returnurl, '?' );
2186
 
@@ -2587,8 +2588,8 @@ static $albums_granted;
2587
  elseif ( $where == 'thumb' ) {
2588
  $returnurl .= 'wppa-album=' . $alb . '&amp;wppa-cover=0&amp;wppa-occur=' . $occur;
2589
  }
2590
- elseif ( $where == 'widget' || $where == 'uploadbox' ) {
2591
- }
2592
  if ( wppa( 'page' ) ) $returnurl .= '&amp;wppa-page=' . wppa( 'page' );
2593
  $returnurl = trim( $returnurl, '?' );
2594
 
@@ -3363,8 +3364,8 @@ function wppa_user_albumedit_html( $alb, $width, $where = '', $mcr = false ) {
3363
  elseif ( $where == 'thumb' ) {
3364
  $returnurl .= 'wppa-album=' . $alb . '&amp;wppa-cover=0&amp;wppa-occur=' . wppa( 'occur' );
3365
  }
3366
- elseif ( $where == 'widget' || $where == 'uploadbox' ) {
3367
- }
3368
  if ( wppa( 'page' ) ) $returnurl .= '&amp;wppa-page=' . wppa( 'page' );
3369
  $returnurl = trim( $returnurl, '?' );
3370
 
@@ -4565,6 +4566,11 @@ function wppa_bestof_html( $args, $widget = true ) {
4565
  $href = wppa_get_permalink( $page ).'wppa-cover=0&amp;wppa-upldr='.$data[$author]['owner'].'&amp;wppa-occur=1';
4566
  $title = __( 'See all the authors photos' , 'wp-photo-album-plus');
4567
  break;
 
 
 
 
 
4568
  }
4569
  $result .= '<a href="'.$href.'" title="'.$title.'" >';
4570
  }
@@ -4858,6 +4864,9 @@ global $wpdb;
4858
  }
4859
  }
4860
  break;
 
 
 
4861
  }
4862
 
4863
  $result .= wppa_js(
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 7.2.06
7
  *
8
  */
9
 
344
  $form_core = str_replace( 'value=""', 'value="' . esc_attr( isset( $_REQUEST['wppa-searchstring'] ) ? $_REQUEST['wppa-searchstring'] : '' ) . '"', $form_core );
345
 
346
  // Fix placeholder
347
+ $form_core = preg_replace( '/placeholder=\"[^\"]*/', 'placeholder="' . esc_attr( wppa_opt( 'search_placeholder' ) ) . '"', $form_core );
348
 
349
  // Insert
350
  $result .= $form_core;
2179
  elseif ( $where == 'thumb' ) {
2180
  $returnurl .= 'wppa-album=' . $parent . '&amp;wppa-cover=0&amp;wppa-occur=' . $occur;
2181
  }
2182
+ // elseif ( $where == 'widget' || $where == 'uploadbox' ) {
2183
+ // Do nothing
2184
+ // }
2185
  if ( wppa( 'page' ) ) $returnurl .= '&amp;wppa-page=' . wppa( 'page' );
2186
  $returnurl = trim( $returnurl, '?' );
2187
 
2588
  elseif ( $where == 'thumb' ) {
2589
  $returnurl .= 'wppa-album=' . $alb . '&amp;wppa-cover=0&amp;wppa-occur=' . $occur;
2590
  }
2591
+ // elseif ( $where == 'widget' || $where == 'uploadbox' ) {
2592
+ // }
2593
  if ( wppa( 'page' ) ) $returnurl .= '&amp;wppa-page=' . wppa( 'page' );
2594
  $returnurl = trim( $returnurl, '?' );
2595
 
3364
  elseif ( $where == 'thumb' ) {
3365
  $returnurl .= 'wppa-album=' . $alb . '&amp;wppa-cover=0&amp;wppa-occur=' . wppa( 'occur' );
3366
  }
3367
+ // elseif ( $where == 'widget' || $where == 'uploadbox' ) {
3368
+ // }
3369
  if ( wppa( 'page' ) ) $returnurl .= '&amp;wppa-page=' . wppa( 'page' );
3370
  $returnurl = trim( $returnurl, '?' );
3371
 
4566
  $href = wppa_get_permalink( $page ).'wppa-cover=0&amp;wppa-upldr='.$data[$author]['owner'].'&amp;wppa-occur=1';
4567
  $title = __( 'See all the authors photos' , 'wp-photo-album-plus');
4568
  break;
4569
+ default:
4570
+ $href = '';
4571
+ $title = '';
4572
+ wppa_log( 'err', 'Unimplemented linktype: ' . $linktype . ' in wppa_bestof_html()' );
4573
+ break;
4574
  }
4575
  $result .= '<a href="'.$href.'" title="'.$title.'" >';
4576
  }
4864
  }
4865
  }
4866
  break;
4867
+
4868
+ default:
4869
+ break;
4870
  }
4871
 
4872
  $result .= wppa_js(
wppa-breadcrumb.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for breadcrumbs
6
- * Version 6.9.21
7
  *
8
  */
9
 
@@ -171,6 +171,9 @@ global $wppa_session;
171
  case 't':
172
  $value .= ' ' . __('with words:', 'wp-photo-album-plus');
173
  break;
 
 
 
174
  }
175
  $value .= ' <b>' . str_replace( '.', '</b> ' . __('and', 'wp-photo-album-plus') . ' <b>', $ss_data['3'] ) . '</b>';
176
  break;
@@ -208,8 +211,12 @@ global $wppa_session;
208
  $label = trim( $label, ':' );
209
  $value .= ' ' . __('with exif tag:', 'wp-photo-album-plus') . ' <b>' . __($label, 'wp-photo-album-plus') . '</b> ' . __('with content:', 'wp-photo-album-plus') .' <b>' . $ss_data['3'] . '</b>';
210
  break;
 
 
211
  }
212
  break;
 
 
213
  }
214
 
215
  if ( wppa( 'is_slide' ) ) {
@@ -285,6 +292,9 @@ global $wppa_session;
285
  $value = __( 'Photos by date last modified' , 'wp-photo-album-plus') . ': ' . date( 'M d D Y', wppa( 'caldate' ) * 24*60*60 );
286
  break;
287
 
 
 
 
288
  }
289
  $thumbhref = '#';
290
  $title = 'T8';
@@ -303,6 +313,10 @@ global $wppa_session;
303
  $value = __( 'Photos by date last modified' , 'wp-photo-album-plus') . ': ' . date( 'M d D Y', wppa( 'caldate' ) * 24*60*60 );
304
  break;
305
 
 
 
 
 
306
  }
307
  $href = '';
308
  $title = '';
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for breadcrumbs
6
+ * Version 7.2.06
7
  *
8
  */
9
 
171
  case 't':
172
  $value .= ' ' . __('with words:', 'wp-photo-album-plus');
173
  break;
174
+ default:
175
+ $value = '';
176
+ break;
177
  }
178
  $value .= ' <b>' . str_replace( '.', '</b> ' . __('and', 'wp-photo-album-plus') . ' <b>', $ss_data['3'] ) . '</b>';
179
  break;
211
  $label = trim( $label, ':' );
212
  $value .= ' ' . __('with exif tag:', 'wp-photo-album-plus') . ' <b>' . __($label, 'wp-photo-album-plus') . '</b> ' . __('with content:', 'wp-photo-album-plus') .' <b>' . $ss_data['3'] . '</b>';
213
  break;
214
+ default:
215
+ break;
216
  }
217
  break;
218
+ default:
219
+ break;
220
  }
221
 
222
  if ( wppa( 'is_slide' ) ) {
292
  $value = __( 'Photos by date last modified' , 'wp-photo-album-plus') . ': ' . date( 'M d D Y', wppa( 'caldate' ) * 24*60*60 );
293
  break;
294
 
295
+ default:
296
+ break;
297
+
298
  }
299
  $thumbhref = '#';
300
  $title = 'T8';
313
  $value = __( 'Photos by date last modified' , 'wp-photo-album-plus') . ': ' . date( 'M d D Y', wppa( 'caldate' ) * 24*60*60 );
314
  break;
315
 
316
+ default:
317
+ $value = '';
318
+ wppa_log( 'err', sprintf( 'Unimplemented calender type %s encountered in wppa_breadcrumb()', wppa( 'calendar' ) ) );
319
+
320
  }
321
  $href = '';
322
  $title = '';
wppa-comment-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
- * Version 7.0.10
7
  *
8
  */
9
 
@@ -324,6 +324,8 @@ class WPPA_Comment_table extends WP_List_Table {
324
  case 'approved':
325
  $filter = "WHERE status = 'approved'";
326
  break;
 
 
327
  }
328
  }
329
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
+ * Version 7.2.06
7
  *
8
  */
9
 
324
  case 'approved':
325
  $filter = "WHERE status = 'approved'";
326
  break;
327
+ default:
328
+ break;
329
  }
330
  }
331
  }
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 7.1.07
6
  *
7
  */
8
 
@@ -1111,12 +1111,14 @@ function wppa_tree_empty( $dir ) {
1111
  $files = wppa_glob( $dir.'/*' );
1112
  if ( is_array( $files ) ) foreach ( $files as $file ) {
1113
  $name = basename( $file );
1114
- if ( $name == '.' || $name == '..' ) {}
1115
- elseif ( wppa_is_dir( $file ) ) {
1116
- wppa_tree_empty( $file );
1117
- // @ unlink( $file );
 
 
 
1118
  }
1119
- else @ unlink( $file );
1120
  }
1121
  }
1122
 
@@ -1925,8 +1927,6 @@ global $wpdb;
1925
 
1926
  function wppa_delete_obsolete_tempfiles( $force = false ) {
1927
 
1928
- wppa_log( 'dbg', 'wppa_delete_obsolete_tempfiles()', true );
1929
-
1930
  // To prevent filling up diskspace, divide lifetime by 2 and repeat removing obsolete files until count <= 10
1931
  $filecount = 51;
1932
  $lifetime = 3600;
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 7.2.06
6
  *
7
  */
8
 
1111
  $files = wppa_glob( $dir.'/*' );
1112
  if ( is_array( $files ) ) foreach ( $files as $file ) {
1113
  $name = basename( $file );
1114
+ if ( $name != '.' && $name != '..' ) {
1115
+ if ( wppa_is_dir( $file ) ) {
1116
+ wppa_tree_empty( $file );
1117
+ }
1118
+ else {
1119
+ @ unlink( $file );
1120
+ }
1121
  }
 
1122
  }
1123
  }
1124
 
1927
 
1928
  function wppa_delete_obsolete_tempfiles( $force = false ) {
1929
 
 
 
1930
  // To prevent filling up diskspace, divide lifetime by 2 and repeat removing obsolete files until count <= 10
1931
  $filecount = 51;
1932
  $lifetime = 3600;
wppa-cron.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
- * Version 7.1.09
7
  *
8
  *
9
  */
@@ -283,7 +283,7 @@ global $wppa_endtime;
283
  wppa_log( 'Cron', 'Phase 9, time left = '.($wppa_endtime-time()) );
284
 
285
  // Add url-sanitized names to new albums
286
- $albs = $wpdb->get_results( "SELECT id, name FROM {$wpdb->wppa_albums} WHERE sname = ''", ARRAY_A );
287
  if ( ! empty( $albs ) ) {
288
  foreach( $albs as $alb ) {
289
  wppa_update_album( array( 'id' => $alb['id'], 'sname' => wppa_sanitize_album_photo_name( $alb['name'] ) ) );
@@ -298,7 +298,7 @@ global $wppa_endtime;
298
  wppa_log( 'Cron', 'Phase 10, time left = '.($wppa_endtime-time()) );
299
 
300
  // Add url-sanitized names to new photos
301
- $photos = $wpdb->get_results( "SELECT id, name FROM {$wpdb->wppa_photos} WHERE sname = '' AND name <> '' LIMIT 10000", ARRAY_A );
302
  if ( ! empty( $photos ) ) {
303
  foreach( $photos as $photo ) {
304
  wppa_update_photo( array( 'id' => $photo['id'], 'sname' => wppa_sanitize_album_photo_name( $photo['name'] ) ) );
@@ -414,28 +414,29 @@ static $did_tempfiles;
414
  $fsos = wppa_glob( $dir . '/*' );
415
  if ( is_array( $fsos ) ) foreach ( $fsos as $fso ) {
416
  $name = basename( $fso );
417
- if ( $name == '.' || $name == '..' ) {}
418
- elseif ( wppa_is_dir( $fso ) ) {
419
- _wppa_do_clear_cache( $fso );
420
- }
421
- else {
422
- $file = wppa_fopen( $fso, 'rb' );
423
- if ( $file ) {
424
- $size = filesize( $fso );
425
- if ( $size ) {
426
- $haystack = fread( $file, $size );
427
- if ( strpos( $haystack, $needle ) !== false ) {
428
- fclose( $file );
429
- unlink( $fso );
430
- wppa_log( 'fso', 'Cron removed cachefile: {b}' . str_replace( WPPA_CONTENT_PATH, '', $fso ) . '{/b}' );
 
 
 
 
431
  }
432
  else {
433
  fclose( $file );
434
  }
435
  }
436
- else {
437
- fclose( $file );
438
- }
439
  }
440
  }
441
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
+ * Version 7.2.06
7
  *
8
  *
9
  */
283
  wppa_log( 'Cron', 'Phase 9, time left = '.($wppa_endtime-time()) );
284
 
285
  // Add url-sanitized names to new albums
286
+ $albs = $wpdb->get_results( "SELECT id, name FROM $wpdb->wppa_albums WHERE sname = ''", ARRAY_A );
287
  if ( ! empty( $albs ) ) {
288
  foreach( $albs as $alb ) {
289
  wppa_update_album( array( 'id' => $alb['id'], 'sname' => wppa_sanitize_album_photo_name( $alb['name'] ) ) );
298
  wppa_log( 'Cron', 'Phase 10, time left = '.($wppa_endtime-time()) );
299
 
300
  // Add url-sanitized names to new photos
301
+ $photos = $wpdb->get_results( "SELECT id, name FROM $wpdb->wppa_photos WHERE sname = '' AND name <> '' LIMIT 10000", ARRAY_A );
302
  if ( ! empty( $photos ) ) {
303
  foreach( $photos as $photo ) {
304
  wppa_update_photo( array( 'id' => $photo['id'], 'sname' => wppa_sanitize_album_photo_name( $photo['name'] ) ) );
414
  $fsos = wppa_glob( $dir . '/*' );
415
  if ( is_array( $fsos ) ) foreach ( $fsos as $fso ) {
416
  $name = basename( $fso );
417
+ if ( $name != '.' && $name != '..' ) {
418
+ if ( wppa_is_dir( $fso ) ) {
419
+ _wppa_do_clear_cache( $fso );
420
+ }
421
+ else {
422
+ $file = wppa_fopen( $fso, 'rb' );
423
+ if ( $file ) {
424
+ $size = filesize( $fso );
425
+ if ( $size ) {
426
+ $haystack = fread( $file, $size );
427
+ if ( strpos( $haystack, $needle ) !== false ) {
428
+ fclose( $file );
429
+ unlink( $fso );
430
+ wppa_log( 'fso', 'Cron removed cachefile: {b}' . str_replace( WPPA_CONTENT_PATH, '', $fso ) . '{/b}' );
431
+ }
432
+ else {
433
+ fclose( $file );
434
+ }
435
  }
436
  else {
437
  fclose( $file );
438
  }
439
  }
 
 
 
440
  }
441
  }
442
  }
wppa-date-time.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
- * Version 6.8.07
7
  *
8
  */
9
 
@@ -111,6 +111,10 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
111
  $curval = $thumb['scheduledel'];
112
  $class = 'wppa-del-datetime-' . $id;
113
  break;
 
 
 
 
114
  }
115
 
116
  if ( ! $curval ) $curval = wppa_get_default_scheduledtm();
@@ -193,9 +197,9 @@ function wppa_local_date( $format, $timestamp = false ) {
193
 
194
  // Correct $time according to gmt_offset
195
  $current_offset = get_option( 'gmt_offset', 0 );
196
-
197
  $tzstring = 'UTC';
198
-
199
  if ( is_numeric( $current_offset ) ) {
200
  $time += $current_offset * 3600;
201
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
+ * Version 7.2.06
7
  *
8
  */
9
 
111
  $curval = $thumb['scheduledel'];
112
  $class = 'wppa-del-datetime-' . $id;
113
  break;
114
+ default:
115
+ $curval = '';
116
+ $class = '';
117
+ break;
118
  }
119
 
120
  if ( ! $curval ) $curval = wppa_get_default_scheduledtm();
197
 
198
  // Correct $time according to gmt_offset
199
  $current_offset = get_option( 'gmt_offset', 0 );
200
+
201
  $tzstring = 'UTC';
202
+
203
  if ( is_numeric( $current_offset ) ) {
204
  $time += $current_offset * 3600;
205
  }
wppa-encrypt.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all ecryption/decryption logic
6
- * Version 7.0.07
7
  *
8
  */
9
 
@@ -315,6 +315,8 @@ function wppa_encrypt_url( $url ) {
315
  exit;
316
  }
317
  break;
 
 
318
  }
319
  }
320
  $item = implode( '=', $t );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all ecryption/decryption logic
6
+ * Version 7.2.06
7
  *
8
  */
9
 
315
  exit;
316
  }
317
  break;
318
+ default:
319
+ break;
320
  }
321
  }
322
  $item = implode( '=', $t );
wppa-exif-iptc-common.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * exif and iptc common functions
6
- * Version 6.9.21
7
  *
8
  *
9
  */
@@ -204,7 +204,7 @@ global $wppa_exif_error_output;
204
 
205
  case 'E#0001': // InteropIndex / CanonCameraSettings (Canon)
206
  if ( $brand == 'CANON' ) { // CanonCameraSettings (Canon)
207
-
208
  }
209
  else { // InteropIndex
210
  switch( $data ) {
@@ -254,7 +254,7 @@ global $wppa_exif_error_output;
254
 
255
  case 'E#0003': // CanonFlashInfo? / SamsungModelID
256
  if ( $brand == 'CANON' ) { // CanonFlashInfo?
257
-
258
  }
259
  if ( $brand == 'SAMSUNG' ) { // SamsungModelID
260
  switch( $data ) {
@@ -658,7 +658,7 @@ global $wppa_exif_error_output;
658
  }
659
  }
660
  if ( $brand == 'NIKON' ) { // DataDump (Nikon)
661
-
662
  }
663
  return $result;
664
 
@@ -3319,7 +3319,7 @@ global $wppa;
3319
  $photo = $id;
3320
  $status = 'default';
3321
  $bret = wppa_create_exif_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
3322
- if ( ! $bret ) {} /* wppa_log( 'Warning 3', 'Could not add EXIF tag '.$tag.' for photo '.$photo.', desc = '.$desc ); */ // Is junk, dont care
3323
 
3324
  }
3325
 
@@ -4202,10 +4202,8 @@ if ( strlen($tag) != 6 ) {
4202
  );
4203
  }
4204
 
4205
- // Init
4206
- $result = '';
4207
-
4208
  // If brand given, try to find brand dependant tagname
 
4209
  switch( $brand ) {
4210
 
4211
  case 'CANON':
@@ -4224,7 +4222,10 @@ if ( strlen($tag) != 6 ) {
4224
  if ( isset( $samsungtags[$tag] ) ) {
4225
  $result = $samsungtags[$tag];
4226
  }
 
4227
 
 
 
4228
  }
4229
 
4230
  // If brand only requested, return result, even when blank
3
  * Package: wp-photo-album-plus
4
  *
5
  * exif and iptc common functions
6
+ * Version 7.2.06
7
  *
8
  *
9
  */
204
 
205
  case 'E#0001': // InteropIndex / CanonCameraSettings (Canon)
206
  if ( $brand == 'CANON' ) { // CanonCameraSettings (Canon)
207
+ $result = $data;
208
  }
209
  else { // InteropIndex
210
  switch( $data ) {
254
 
255
  case 'E#0003': // CanonFlashInfo? / SamsungModelID
256
  if ( $brand == 'CANON' ) { // CanonFlashInfo?
257
+ $result = $data;
258
  }
259
  if ( $brand == 'SAMSUNG' ) { // SamsungModelID
260
  switch( $data ) {
658
  }
659
  }
660
  if ( $brand == 'NIKON' ) { // DataDump (Nikon)
661
+ $result = $data;
662
  }
663
  return $result;
664
 
3319
  $photo = $id;
3320
  $status = 'default';
3321
  $bret = wppa_create_exif_entry( array( 'photo' => $photo, 'tag' => $tag, 'description' => $desc, 'status' => $status ) );
3322
+ // if ( ! $bret ) {} /* wppa_log( 'Warning 3', 'Could not add EXIF tag '.$tag.' for photo '.$photo.', desc = '.$desc ); */ // Is junk, dont care
3323
 
3324
  }
3325
 
4202
  );
4203
  }
4204
 
 
 
 
4205
  // If brand given, try to find brand dependant tagname
4206
+ $result = '';
4207
  switch( $brand ) {
4208
 
4209
  case 'CANON':
4222
  if ( isset( $samsungtags[$tag] ) ) {
4223
  $result = $samsungtags[$tag];
4224
  }
4225
+ break;
4226
 
4227
+ default:
4228
+ break;
4229
  }
4230
 
4231
  // If brand only requested, return result, even when blank
wppa-export.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the export functions
6
- * Version 6.9.20
7
  *
8
  */
9
 
@@ -173,7 +173,7 @@ global $wppa_temp_idx;
173
  if (fwrite($file, "prnt=".wppa_get_album_name( $album['a_parent'], array( 'raw' => true ) ) . "\n") !== FALSE) {
174
  if (fwrite($file, "pord=".$album['p_order_by']."\n") !== FALSE) {
175
  if (fwrite($file, "ownr=".$album['owner']."\n") !== FALSE) {
176
-
177
  /*
178
  main_photo bigint(20) NOT NULL,
179
  cover_linktype tinytext NOT NULL,
@@ -239,6 +239,7 @@ global $wppa_temp_idx;
239
  if (fwrite($file, "albm=".wppa_get_album_name($photo['album'], array( 'raw' => true ) )."\n") !== FALSE) {
240
  if (fwrite($file, "lnku=".$photo['linkurl']."\n") !== FALSE) {
241
  if (fwrite($file, "lnkt=".$photo['linktitle']."\n") !== FALSE) {
 
242
 
243
  /*
244
  ext tinytext NOT NULL,
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the export functions
6
+ * Version 7.2.06
7
  *
8
  */
9
 
173
  if (fwrite($file, "prnt=".wppa_get_album_name( $album['a_parent'], array( 'raw' => true ) ) . "\n") !== FALSE) {
174
  if (fwrite($file, "pord=".$album['p_order_by']."\n") !== FALSE) {
175
  if (fwrite($file, "ownr=".$album['owner']."\n") !== FALSE) {
176
+ $err = false;
177
  /*
178
  main_photo bigint(20) NOT NULL,
179
  cover_linktype tinytext NOT NULL,
239
  if (fwrite($file, "albm=".wppa_get_album_name($photo['album'], array( 'raw' => true ) )."\n") !== FALSE) {
240
  if (fwrite($file, "lnku=".$photo['linkurl']."\n") !== FALSE) {
241
  if (fwrite($file, "lnkt=".$photo['linktitle']."\n") !== FALSE) {
242
+ $err = false;
243
 
244
  /*
245
  ext tinytext NOT NULL,
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version 7.1.11
7
  *
8
  */
9
 
@@ -686,6 +686,9 @@ static $seed;
686
  $wppa['start_photo'] = $photo;
687
  $wppa['is_single'] = '1';
688
  break;
 
 
 
689
  }
690
 
691
  // Process size
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 7.2.06
7
  *
8
  */
9
 
686
  $wppa['start_photo'] = $photo;
687
  $wppa['is_single'] = '1';
688
  break;
689
+ default:
690
+ wppa_log( 'err', 'Unimplemented photo_shortcode_type: ' . $type . ' in wppa_photo_shortcodes()' );
691
+ break;
692
  }
693
 
694
  // Process size
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 7.2.01
7
  *
8
  */
9
 
@@ -193,9 +193,9 @@ global $wppa_session;
193
  // Do NOT Set internal defaults here, they may be set before the call
194
 
195
  // Interprete function args
196
- if ( $type == 'album' ) {
197
- }
198
- elseif ( $type == 'cover' ) {
199
  wppa( 'is_cover', true );
200
  }
201
  elseif ( $type == 'slide' ) {
@@ -998,6 +998,10 @@ global $wppa_session;
998
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE id IN (" . implode( ',', $ids ) . ")";
999
  $albums = $wpdb->get_results( $query, ARRAY_A );
1000
  break;
 
 
 
 
1001
  }
1002
  }
1003
 
@@ -1587,6 +1591,9 @@ global $wppa_session;
1587
  "AND album > '0' " .
1588
  "AND id IN (" . $ids . ")";
1589
  break;
 
 
 
1590
  }
1591
  }
1592
 
@@ -1721,6 +1728,9 @@ global $wppa_session;
1721
  $query = "SELECT * FROM $wpdb->wppa_photos " .
1722
  "WHERE " . $selection . $alb_clause . $order;
1723
  break;
 
 
 
1724
  }
1725
  }
1726
 
@@ -2074,7 +2084,7 @@ global $wpdb;
2074
  $it2 = wppa_cache_photo( $xit2['id'] );
2075
 
2076
  $score = 0;
2077
-
2078
  // Name
2079
  if ( wppa_looks_equal( $it1['name'], $it2['name'] ) && $it1['name'] ) $score++; // equal and not empty
2080
 
@@ -2138,7 +2148,7 @@ global $wpdb;
2138
  }
2139
  }
2140
  if ( $score >= 4 ) return true;
2141
-
2142
  // Equal display file content?
2143
  if ( wppa_is_file( $d1 ) && wppa_is_file( $d2 ) ) {
2144
  if ( wppa_get_contents( $d1 ) == wppa_get_contents( $d2 ) ) {
@@ -2572,7 +2582,7 @@ global $wppa_done;
2572
  if ( ! $photo ) die( 'Photo id missing while processing a comment' );
2573
 
2574
  $user = isset( $_REQUEST['comname'] ) ? $_REQUEST['comname'] : 'Anonymus';
2575
- $user = sanitize_user( $user );
2576
  if ( ! $user ) die( 'Illegal attempt to enter a comment 1' );
2577
  $email = sanitize_email( wppa_get_post( 'comemail' ) );
2578
 
@@ -2603,6 +2613,9 @@ global $wppa_done;
2603
  case 'wprules':
2604
  $status = wppa_check_comment( $user, $email, $comment );
2605
  break;
 
 
 
2606
  }
2607
  if ( current_user_can( 'wppa_moderate' ) ) $status = 'approved'; // Need not moderate comments issued by moderator
2608
 
@@ -2664,6 +2677,9 @@ global $wppa_done;
2664
  case 'approved':
2665
  wppa_log( 'Com', 'Comment {i}' . $comment . '{/i} added with status approved' );
2666
  break;
 
 
 
2667
  }
2668
  }
2669
  }
@@ -3047,15 +3063,15 @@ function wppa_get_slide_frame_style() {
3047
  if ( $gfs == $fs ) {
3048
  if ( $fs != $cs ) {
3049
  switch ( $hor ) {
3050
- case 'left':
3051
- $result .= 'margin-left: 0px;';
3052
- break;
3053
- case 'center':
3054
- $result .= 'margin-left: ' . floor( ( $cs - $fs ) / 2 ) . 'px;';
3055
- break;
3056
- case 'right':
3057
- $result .= 'margin-left: ' . ( $cs - $fs ) . 'px;';
3058
- break;
3059
  }
3060
  }
3061
  }
@@ -3554,16 +3570,15 @@ function wppa_container_wrapper( $key ) {
3554
  'max-width:' . wppa( 'max_width' ) . 'px;'
3555
  );
3556
  switch( wppa( 'align' ) ) {
3557
- case '':
3558
- case 'center':
3559
- wppa_out( 'clear:both;margin:auto;' );
3560
- break;
3561
  case 'left':
3562
  wppa_out( 'clear:left;float:left;' );
3563
  break;
3564
  case 'right':
3565
  wppa_out( 'clear:right;float:right;' );
3566
  break;
 
 
 
3567
  }
3568
 
3569
  wppa_out( '"' .
@@ -4892,6 +4907,7 @@ global $wppa_alert;
4892
  case 1: $ext = 'gif'; break;
4893
  case 2: $ext = 'jpg'; break;
4894
  case 3: $ext = 'png'; break;
 
4895
  }
4896
 
4897
  // Did the user supply a photoname?
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 7.2.06
7
  *
8
  */
9
 
193
  // Do NOT Set internal defaults here, they may be set before the call
194
 
195
  // Interprete function args
196
+ // if ( $type == 'album' ) {
197
+ // }
198
+ if ( $type == 'cover' ) {
199
  wppa( 'is_cover', true );
200
  }
201
  elseif ( $type == 'slide' ) {
998
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE id IN (" . implode( ',', $ids ) . ")";
999
  $albums = $wpdb->get_results( $query, ARRAY_A );
1000
  break;
1001
+
1002
+ default:
1003
+ wppa_log( 'err', 'Unimplemented supersearch album selection method: ' . $ss_data['1'] . ' in wppa_get_albums()' );
1004
+ break;
1005
  }
1006
  }
1007
 
1591
  "AND album > '0' " .
1592
  "AND id IN (" . $ids . ")";
1593
  break;
1594
+
1595
+ default:
1596
+ break;
1597
  }
1598
  }
1599
 
1728
  $query = "SELECT * FROM $wpdb->wppa_photos " .
1729
  "WHERE " . $selection . $alb_clause . $order;
1730
  break;
1731
+
1732
+ default:
1733
+ break;
1734
  }
1735
  }
1736
 
2084
  $it2 = wppa_cache_photo( $xit2['id'] );
2085
 
2086
  $score = 0;
2087
+
2088
  // Name
2089
  if ( wppa_looks_equal( $it1['name'], $it2['name'] ) && $it1['name'] ) $score++; // equal and not empty
2090
 
2148
  }
2149
  }
2150
  if ( $score >= 4 ) return true;
2151
+
2152
  // Equal display file content?
2153
  if ( wppa_is_file( $d1 ) && wppa_is_file( $d2 ) ) {
2154
  if ( wppa_get_contents( $d1 ) == wppa_get_contents( $d2 ) ) {
2582
  if ( ! $photo ) die( 'Photo id missing while processing a comment' );
2583
 
2584
  $user = isset( $_REQUEST['comname'] ) ? $_REQUEST['comname'] : 'Anonymus';
2585
+ $user = htmlspecialchars( $user ); //sanitize_user( $user );
2586
  if ( ! $user ) die( 'Illegal attempt to enter a comment 1' );
2587
  $email = sanitize_email( wppa_get_post( 'comemail' ) );
2588
 
2613
  case 'wprules':
2614
  $status = wppa_check_comment( $user, $email, $comment );
2615
  break;
2616
+ default:
2617
+ $status = 'approved';
2618
+ break;
2619
  }
2620
  if ( current_user_can( 'wppa_moderate' ) ) $status = 'approved'; // Need not moderate comments issued by moderator
2621
 
2677
  case 'approved':
2678
  wppa_log( 'Com', 'Comment {i}' . $comment . '{/i} added with status approved' );
2679
  break;
2680
+ default:
2681
+ wppa_log( 'Err', 'Comment {i}' . $comment . '{/i} added with status ' . $status );
2682
+ break;
2683
  }
2684
  }
2685
  }
3063
  if ( $gfs == $fs ) {
3064
  if ( $fs != $cs ) {
3065
  switch ( $hor ) {
3066
+ case 'left':
3067
+ $result .= 'margin-left: 0px;';
3068
+ break;
3069
+ case 'right':
3070
+ $result .= 'margin-left: ' . ( $cs - $fs ) . 'px;';
3071
+ break;
3072
+ default: // case 'center':
3073
+ $result .= 'margin-left: ' . floor( ( $cs - $fs ) / 2 ) . 'px;';
3074
+ break;
3075
  }
3076
  }
3077
  }
3570
  'max-width:' . wppa( 'max_width' ) . 'px;'
3571
  );
3572
  switch( wppa( 'align' ) ) {
 
 
 
 
3573
  case 'left':
3574
  wppa_out( 'clear:left;float:left;' );
3575
  break;
3576
  case 'right':
3577
  wppa_out( 'clear:right;float:right;' );
3578
  break;
3579
+ default:
3580
+ wppa_out( 'clear:both;margin:auto;' );
3581
+ break;
3582
  }
3583
 
3584
  wppa_out( '"' .
4907
  case 1: $ext = 'gif'; break;
4908
  case 2: $ext = 'jpg'; break;
4909
  case 3: $ext = 'png'; break;
4910
+ default: $ext = ''; break;
4911
  }
4912
 
4913
  // Did the user supply a photoname?
wppa-import.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
- * Version 7.1.11
7
  *
8
  */
9
 
@@ -1355,9 +1355,9 @@ global $wppa_session;
1355
  $ct = 0;
1356
  $idx = '0';
1357
  foreach( $files as $dir ) {
1358
- if ( basename( $dir ) == '.' ) {}
1359
- elseif ( basename( $dir ) == '..' ) {}
1360
- elseif ( wppa_is_dir( $dir ) ) {
1361
  echo
1362
  '<tr>' .
1363
  '<td>' .
@@ -1897,6 +1897,8 @@ global $wppa_session;
1897
  case 'ownr=':
1898
  $owner = $data;
1899
  break;
 
 
1900
  }
1901
  }
1902
 
@@ -2635,6 +2637,9 @@ global $wppa_session;
2635
  case 'name':
2636
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos WHERE name = %s OR filename = %s", $data_arr[0], $data_arr[0] ), ARRAY_A );
2637
  break;
 
 
 
2638
  }
2639
  if ( $photos ) {
2640
  foreach( $photos as $photo ) {
@@ -2751,6 +2756,8 @@ global $wppa_session;
2751
  wppa_wrong_value( $value, $field );
2752
  }
2753
  break;
 
 
2754
  }
2755
  }
2756
  }
@@ -2941,9 +2948,11 @@ function wppa_get_dircount( $files ) {
2941
  $result = 0;
2942
  if ( $files ) {
2943
  foreach ( $files as $file ) {
2944
- if ( basename( $file ) == '.' ) {}
2945
- elseif ( basename( $file ) == '..' ) {}
2946
- elseif ( wppa_is_dir( $file ) ) $result++;
 
 
2947
  }
2948
  }
2949
  return $result;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
+ * Version 7.2.06
7
  *
8
  */
9
 
1355
  $ct = 0;
1356
  $idx = '0';
1357
  foreach( $files as $dir ) {
1358
+ if ( basename( $dir ) != '.' &&
1359
+ basename( $dir ) != '..' &&
1360
+ wppa_is_dir( $dir ) ) {
1361
  echo
1362
  '<tr>' .
1363
  '<td>' .
1897
  case 'ownr=':
1898
  $owner = $data;
1899
  break;
1900
+ default:
1901
+ break;
1902
  }
1903
  }
1904
 
2637
  case 'name':
2638
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos WHERE name = %s OR filename = %s", $data_arr[0], $data_arr[0] ), ARRAY_A );
2639
  break;
2640
+ default:
2641
+ wppa_log( 'err', 'Unimplemented captions[0]: ' . strtolower( $captions[0] ) . ' in wppa_import_photos()' );
2642
+ break;
2643
  }
2644
  if ( $photos ) {
2645
  foreach( $photos as $photo ) {
2756
  wppa_wrong_value( $value, $field );
2757
  }
2758
  break;
2759
+ default:
2760
+ break;
2761
  }
2762
  }
2763
  }
2948
  $result = 0;
2949
  if ( $files ) {
2950
  foreach ( $files as $file ) {
2951
+ if ( basename( $file ) != '.' &&
2952
+ basename( $file ) != '..' &&
2953
+ wppa_is_dir( $file ) ) {
2954
+ $result++;
2955
+ }
2956
  }
2957
  }
2958
  return $result;
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
- * Version 7.1.09
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
@@ -322,8 +322,8 @@ global $wpdb;
322
 
323
  // Album names in urls
324
  if ( wppa_switch( 'use_album_names_in_urls' ) ) {
325
- $nalbs = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->wppa_albums}" );
326
- $ualbs = $wpdb->get_col( "SELECT DISTINCT name FROM {$wpdb->wppa_albums}" );
327
  if ( $nalbs > count ( $ualbs ) ) {
328
  $text .= '<br />' . __( 'Table IV-A4: Album names in urls is activated, but there are duplicate album names.', 'wp-photo-album-plus' );
329
  $any = true;
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
+ * Version 7.2.06
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
322
 
323
  // Album names in urls
324
  if ( wppa_switch( 'use_album_names_in_urls' ) ) {
325
+ $nalbs = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_albums" );
326
+ $ualbs = $wpdb->get_col( "SELECT DISTINCT name FROM $wpdb->wppa_albums" );
327
  if ( $nalbs > count ( $ualbs ) ) {
328
  $text .= '<br />' . __( 'Table IV-A4: Album names in urls is activated, but there are duplicate album names.', 'wp-photo-album-plus' );
329
  $any = true;
wppa-links.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Frontend links
6
- * Version 7.1.00
7
  *
8
  */
9
 
@@ -673,6 +673,7 @@ function wppa_convert_to_pretty( $xuri, $no_names = false, $overrule = false ) {
673
  case 'inv': $newuri .= 'in'; break;
674
  case 'vt': $newuri .= 'vt'; break;
675
  case 'catbox': $newuri .= 'cb'; break;
 
676
  }
677
  if ( $val !== false ) {
678
  if ( $code == 'searchstring' ) $newuri .= str_replace(' ', '_', $val);
@@ -853,6 +854,7 @@ function wppa_compress_pretty( $uri ) {
853
  case 'in': $support['inv'] = $data; break;
854
  case 'vt': $support['vt'] = $data; break;
855
  case 'cb': $support['catbox'] = $data; break;
 
856
  }
857
  }
858
 
@@ -1821,7 +1823,7 @@ global $wpdb;
1821
  else {
1822
  $wid = wppa_get_photox( $id );
1823
  $hig = wppa_get_photoy( $id );
1824
-
1825
  if ( wppa_is_pdf( $id ) ) {
1826
  $url = wppa_get_hires_url( $id );
1827
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Frontend links
6
+ * Version 7.2.06
7
  *
8
  */
9
 
673
  case 'inv': $newuri .= 'in'; break;
674
  case 'vt': $newuri .= 'vt'; break;
675
  case 'catbox': $newuri .= 'cb'; break;
676
+ default: wppa_log( 'err', sprintf( 'err', 'Unimplemented code %s encountered in wppa_convert_to_pretty()', $code ) );
677
  }
678
  if ( $val !== false ) {
679
  if ( $code == 'searchstring' ) $newuri .= str_replace(' ', '_', $val);
854
  case 'in': $support['inv'] = $data; break;
855
  case 'vt': $support['vt'] = $data; break;
856
  case 'cb': $support['catbox'] = $data; break;
857
+ default: break;
858
  }
859
  }
860
 
1823
  else {
1824
  $wid = wppa_get_photox( $id );
1825
  $hig = wppa_get_photoy( $id );
1826
+
1827
  if ( wppa_is_pdf( $id ) ) {
1828
  $url = wppa_get_hires_url( $id );
1829
  }
wppa-local-cdn.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains routines for local cdn implementation
6
- * Version 7.1.11
7
  *
8
  */
9
 
@@ -153,6 +153,12 @@ function wppa_cdn_make( $id, $x, $y ) {
153
 
154
  break;
155
 
 
 
 
 
 
 
156
  }
157
 
158
  // Cleanup
@@ -161,7 +167,9 @@ function wppa_cdn_make( $id, $x, $y ) {
161
  if ( $tmp ) imagedestroy( $tmp );
162
 
163
  // Optimize
164
- wppa_optimize_image_file( $topath );
 
 
165
 
166
  // Log what we did
167
  if ( $bret ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains routines for local cdn implementation
6
+ * Version 7.2.06
7
  *
8
  */
9
 
153
 
154
  break;
155
 
156
+ default: // Not implemented mimetype
157
+
158
+ // Indicat error
159
+ $bret = false;
160
+
161
+ break;
162
  }
163
 
164
  // Cleanup
167
  if ( $tmp ) imagedestroy( $tmp );
168
 
169
  // Optimize
170
+ if ( wppa_is_file( $topath ) ) {
171
+ wppa_optimize_image_file( $topath );
172
+ }
173
 
174
  // Log what we did
175
  if ( $bret ) {
wppa-mailing.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains mailing functions
6
  *
7
- * Version 7.2.00
8
  *
9
  */
10
 
@@ -55,7 +55,7 @@ global $wpdb;
55
  if ( wppa_opt( 'mailinglist_policy' ) == 'opt-out' ) {
56
 
57
  $from = get_option( 'wppa_mailinglist_highest_user_auto_subscribed', 0 );
58
- $to = $wpdb->get_var( "SELECT ID from {$wpdb->users} ORDER BY ID DESC LIMIT 1" );
59
 
60
  if ( $to > $from ) {
61
 
@@ -111,7 +111,7 @@ global $wpdb;
111
  case 'newalbumnotify':
112
  {
113
  // If album removed, quit
114
- $album = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->wppa_albums} WHERE id = %d", $alb ), ARRAY_A );
115
  if ( ! $album ) {
116
  wppa_log( 'Eml', 'Mailing skipped: album ' . $alb . ' vanished' );
117
  wppa_exit();
@@ -274,7 +274,7 @@ global $wpdb;
274
  case 'commentnotify':
275
  {
276
  // Get the comment
277
- $comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->wppa_comments} WHERE id = %d", $com ), ARRAY_A );
278
 
279
  // Get the photo id
280
  if ( ! $pho ) {
@@ -442,7 +442,7 @@ global $wpdb;
442
  case 'commentapproved':
443
  {
444
  // Get the comment
445
- $comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->wppa_comments} WHERE id = %d", $com ), ARRAY_A );
446
 
447
  // The photo
448
  if ( ! $pho ) {
@@ -532,7 +532,7 @@ global $wpdb;
532
  case 'commentprevious':
533
  {
534
  // Get the comment
535
- $comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->wppa_comments} WHERE id = %d", $com ), ARRAY_A );
536
 
537
  // Get the photo
538
  if ( ! $pho ) {
@@ -549,7 +549,7 @@ global $wpdb;
549
  }
550
 
551
  // Get the users who commented on the photo
552
- $users = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT user FROM {$wpdb->wppa_comments} WHERE photo = %d", $pho ) );
553
 
554
  // If the current author is in the list: remove him, he is most likely already notified
555
  if ( isset( $usres[$comment['user']] ) ) {
@@ -670,7 +670,7 @@ global $wpdb;
670
  case 'moderatecomment':
671
  {
672
  // The comment
673
- $comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->wppa_comments} WHERE id = %d", $com ), ARRAY_A );
674
 
675
  // The photo
676
  if ( ! $pho ) {
4
  *
5
  * Contains mailing functions
6
  *
7
+ * Version 7.2.06
8
  *
9
  */
10
 
55
  if ( wppa_opt( 'mailinglist_policy' ) == 'opt-out' ) {
56
 
57
  $from = get_option( 'wppa_mailinglist_highest_user_auto_subscribed', 0 );
58
+ $to = $wpdb->get_var( "SELECT ID from $wpdb->users ORDER BY ID DESC LIMIT 1" );
59
 
60
  if ( $to > $from ) {
61
 
111
  case 'newalbumnotify':
112
  {
113
  // If album removed, quit
114
+ $album = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_albums WHERE id = %d", $alb ), ARRAY_A );
115
  if ( ! $album ) {
116
  wppa_log( 'Eml', 'Mailing skipped: album ' . $alb . ' vanished' );
117
  wppa_exit();
274
  case 'commentnotify':
275
  {
276
  // Get the comment
277
+ $comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments WHERE id = %d", $com ), ARRAY_A );
278
 
279
  // Get the photo id
280
  if ( ! $pho ) {
442
  case 'commentapproved':
443
  {
444
  // Get the comment
445
+ $comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments WHERE id = %d", $com ), ARRAY_A );
446
 
447
  // The photo
448
  if ( ! $pho ) {
532
  case 'commentprevious':
533
  {
534
  // Get the comment
535
+ $comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments WHERE id = %d", $com ), ARRAY_A );
536
 
537
  // Get the photo
538
  if ( ! $pho ) {
549
  }
550
 
551
  // Get the users who commented on the photo
552
+ $users = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT user FROM $wpdb->wppa_comments WHERE photo = %d", $pho ) );
553
 
554
  // If the current author is in the list: remove him, he is most likely already notified
555
  if ( isset( $usres[$comment['user']] ) ) {
670
  case 'moderatecomment':
671
  {
672
  // The comment
673
+ $comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments WHERE id = %d", $com ), ARRAY_A );
674
 
675
  // The photo
676
  if ( ! $pho ) {
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 7.1.09
7
  *
8
  */
9
 
@@ -257,7 +257,8 @@ global $wppa_endtime;
257
  wppa_exit();
258
  }
259
  break;
260
-
 
261
  }
262
  }
263
 
@@ -341,6 +342,9 @@ global $wppa_endtime;
341
  include $file;
342
  break;
343
 
 
 
 
344
  }
345
  // Test for timeout / ready
346
  $lastid = $id;
@@ -506,10 +510,7 @@ global $wppa_endtime;
506
  $rawpath = wppa_strip_ext( wppa_get_photo_path( $id, false ) );
507
  $rawthumb = wppa_strip_ext( wppa_get_thumb_path( $id, false ) );
508
  $fixed_this = false;
509
- if ( wppa_is_multi( $id ) ) {
510
-
511
- }
512
- else {
513
  if ( is_file( $rawpath . '.' . $EXT ) ) {
514
  if ( is_file( $rawpath . '.' . $ext ) ) {
515
  wppa_unlink( $rawpath . '.' . $EXT );
@@ -844,6 +845,8 @@ global $wppa_endtime;
844
  include $file;
845
  break;
846
 
 
 
847
  }
848
 
849
  // Test for timeout / ready
@@ -975,6 +978,9 @@ global $wppa_endtime;
975
  // Just example to make extensions easy
976
  // So you know here to out the code
977
  break;
 
 
 
978
  }
979
 
980
  // Update status
@@ -1008,6 +1014,8 @@ global $wppa_endtime;
1008
  }
1009
  break;
1010
 
 
 
1011
  }
1012
 
1013
  // Register lastid
@@ -1117,6 +1125,8 @@ global $wppa_endtime;
1117
  case 'wppa_sync_cloud':
1118
  unset( $wppa_session['cloudinary_ids'] );
1119
  break;
 
 
1120
  }
1121
 
1122
  if ( wppa_is_cron() ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 7.2.06
7
  *
8
  */
9
 
257
  wppa_exit();
258
  }
259
  break;
260
+ default:
261
+ break;
262
  }
263
  }
264
 
342
  include $file;
343
  break;
344
 
345
+ default:
346
+ break;
347
+
348
  }
349
  // Test for timeout / ready
350
  $lastid = $id;
510
  $rawpath = wppa_strip_ext( wppa_get_photo_path( $id, false ) );
511
  $rawthumb = wppa_strip_ext( wppa_get_thumb_path( $id, false ) );
512
  $fixed_this = false;
513
+ if ( ! wppa_is_multi( $id ) ) {
 
 
 
514
  if ( is_file( $rawpath . '.' . $EXT ) ) {
515
  if ( is_file( $rawpath . '.' . $ext ) ) {
516
  wppa_unlink( $rawpath . '.' . $EXT );
845
  include $file;
846
  break;
847
 
848
+ default:
849
+ break;
850
  }
851
 
852
  // Test for timeout / ready
978
  // Just example to make extensions easy
979
  // So you know here to out the code
980
  break;
981
+
982
+ default:
983
+ break;
984
  }
985
 
986
  // Update status
1014
  }
1015
  break;
1016
 
1017
+ default: // Nothing to postprocess
1018
+ break;
1019
  }
1020
 
1021
  // Register lastid
1125
  case 'wppa_sync_cloud':
1126
  unset( $wppa_session['cloudinary_ids'] );
1127
  break;
1128
+ default:
1129
+ break;
1130
  }
1131
 
1132
  if ( wppa_is_cron() ) {
wppa-non-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
- * Version 7.2.05
7
  *
8
  */
9
 
@@ -203,61 +203,6 @@ echo '
203
  }
204
  }
205
 
206
- // No photo id and no album known yet. Also: not all featured.
207
- // Examine the page (if any) on an album id in the shortcode
208
- elseif ( wppa_switch( 'og_tags_on' ) ) {
209
- $page = wppa_get_the_ID();
210
- if ( $page ) {
211
- $page_content = $wpdb->get_var( "SELECT post_content FROM " . $wpdb->prefix . 'posts' . " WHERE ID = " . $page );
212
- if ( strpos( $page_content, '[wppa' ) !== false ) {
213
- $a_pos = strpos( $page_content, 'album="' );
214
- $album = substr( $page_content, $a_pos + 7, 20 );
215
- $album = substr( $album, 0, strpos( $album, '"' ) );
216
- if ( is_numeric( $album ) ) {
217
-
218
- $title = wppa_get_album_name( $album );
219
- $desc = strip_tags( wppa_get_album_desc( $album ) );
220
- $url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
221
- $url = wppa_convert_to_pretty( $url, false, true );
222
- $site = get_bloginfo('name');
223
- $id = wppa_get_coverphoto_id( $album );
224
- $mime = wppa_get_mime_type( $id );
225
-
226
- echo '
227
- <!-- WPPA+ meta tags -->
228
- <meta name="title" content="' . esc_attr( sanitize_text_field( $title ) ) . '" />';
229
- /* RIPS does not like this because of possible Xsite scripting
230
- echo
231
- <meta name="description" content="' . esc_attr( $desc ) . '" />;
232
- */
233
- echo '
234
- <!-- WPPA+ Og Share data -->
235
- <meta property="og:site_name" content="' . esc_attr( sanitize_text_field( $site ) ) . '" />
236
- <meta property="og:type" content="article" />
237
- <meta property="og:url" content="' . esc_url( $url ) . '" />
238
- <meta property="og:title" content="' . esc_attr( sanitize_text_field( $title ) ) . '" />';
239
- /* RIPS does not like this because of possible Xsite scripting
240
- if ( $desc ) {
241
- echo '
242
- <meta property="og:description" content="' . esc_attr( sanitize_text_field( $desc ) ) . '" />';
243
- }
244
- */
245
- if ( $id ) {
246
- echo '
247
- <meta property="og:image" content="' . esc_url( wppa_get_photo_url( $id ) ) . '" />
248
- <meta property="og:image:type" content="' . esc_attr( $mime ) . '" />
249
- <meta property="og:image:width" content="' . esc_attr( wppa_get_photox( $id ) ) . '" />
250
- <meta property="og:image:height" content="' . esc_attr( wppa_get_photoy( $id ) ) . '" />';
251
- }
252
- echo '
253
- <!-- WPPA+ End Og Share data -->
254
- ';
255
-
256
- }
257
- }
258
- }
259
- }
260
-
261
  // Facebook Admin and App
262
  if ( ( wppa_switch( 'share_on' ) || wppa_switch( 'share_on_widget' ) ) &&
263
  ( wppa_switch( 'facebook_comments' ) || wppa_switch( 'facebook_like' ) || wppa_switch( 'share_facebook' ) ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
+ * Version 7.2.06
7
  *
8
  */
9
 
203
  }
204
  }
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  // Facebook Admin and App
207
  if ( ( wppa_switch( 'share_on' ) || wppa_switch( 'share_on_widget' ) ) &&
208
  ( wppa_switch( 'facebook_comments' ) || wppa_switch( 'facebook_like' ) || wppa_switch( 'share_facebook' ) ) ) {
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 7.2.05
7
  *
8
  */
9
 
@@ -691,7 +691,7 @@ function wppaToggleExif( id, count ) {
691
  __( 'Crypt:', 'wp-photo-album-plus' ) . ' ' . htmlentities( $crypt ) . '. ' .
692
 
693
  // Filename
694
- __( 'Filename:', 'wp-photo-album-plus' ) . ' ' . htmlentities( $filename ) . '. ' .
695
 
696
  // Upload
697
  __( 'Upload:', 'wp-photo-album-plus' ) . ' ' . htmlentities( wppa_local_date( '', $timestamp ) ) . ' ' . __( 'local time' , 'wp-photo-album-plus') . '. ';
@@ -865,12 +865,12 @@ function wppaToggleExif( id, count ) {
865
  }
866
 
867
  // Downloads
868
- if ( true ) {
869
  echo
870
  __( 'Downloads', 'wp-photo-album-plus' ) . ': ' .
871
  htmlentities( $dlcount ) .
872
  '. ';
873
- }
874
 
875
  // Status
876
  echo '<br />' .
@@ -2752,7 +2752,7 @@ function wppaSetConfirmMove( id ) {
2752
  <?php
2753
 
2754
  foreach ( $users as $user ) {
2755
- echo '<option value="' . esc_attr( $user['user_login'] ) . '" >' . htmlentities( $user['display_name'] ) . ' (' . htmlentities( $user['user_login'] ) . ')</option>';
2756
  }
2757
  ?>
2758
  </select>
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 7.2.06
7
  *
8
  */
9
 
691
  __( 'Crypt:', 'wp-photo-album-plus' ) . ' ' . htmlentities( $crypt ) . '. ' .
692
 
693
  // Filename
694
+ __( 'Filename:', 'wp-photo-album-plus' ) . ' ' . htmlspecialchars( $filename ) . '. ' .
695
 
696
  // Upload
697
  __( 'Upload:', 'wp-photo-album-plus' ) . ' ' . htmlentities( wppa_local_date( '', $timestamp ) ) . ' ' . __( 'local time' , 'wp-photo-album-plus') . '. ';
865
  }
866
 
867
  // Downloads
868
+ // if ( true ) {
869
  echo
870
  __( 'Downloads', 'wp-photo-album-plus' ) . ': ' .
871
  htmlentities( $dlcount ) .
872
  '. ';
873
+ // }
874
 
875
  // Status
876
  echo '<br />' .
2752
  <?php
2753
 
2754
  foreach ( $users as $user ) {
2755
+ echo '<option value="' . esc_attr( $user['user_login'] ) . '" >' . htmlspecialchars( $user['display_name'] ) . ' (' . htmlentities( $user['user_login'] ) . ')</option>';
2756
  }
2757
  ?>
2758
  </select>
wppa-photo-files.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-photo-files.php
3
  *
4
  * Functions used to create/manipulate photofiles
5
- * Version 7.2.03
6
  *
7
  */
8
 
@@ -126,6 +126,8 @@ function wppa_orientate_image_file( $file, $ori ) {
126
  case '8':
127
  $orientate = imagerotate( $source, 90, 0 );
128
  break;
 
 
129
  }
130
 
131
  // Output
@@ -282,6 +284,9 @@ wppa_log('dbg', 'make called with'.$file.' '.$id.' '.$ext.' '.$do_thumb. ' exist
282
  case 3: // png
283
  $src = @ wppa_imagecreatefrompng( $file );
284
  break;
 
 
 
285
  }
286
 
287
  if ( ! $src ) {
@@ -323,6 +328,8 @@ wppa_log('dbg', 'make called with'.$file.' '.$id.' '.$ext.' '.$do_thumb. ' exist
323
  case 3:
324
  wppa_imagepng( $dst, $newimage, 6 );
325
  break;
 
 
326
  }
327
 
328
  // Remove destination image
@@ -405,10 +412,10 @@ wppa_log('dbg', 'make called with'.$file.' '.$id.' '.$ext.' '.$do_thumb. ' exist
405
  wppa_get_photoy( $id, true );
406
  wppa_get_thumbx( $id, true );
407
  wppa_get_thumby( $id, true );
408
-
409
  // Clear magickstack
410
  wppa_update_photo( array( 'id' => $id, 'magickstack' => '' ) );
411
-
412
  // Clear (super)cache
413
  wppa_clear_cache();
414
  return true;
@@ -523,6 +530,9 @@ function wppa_create_thumbnail( $id, $use_source = true ) {
523
  case 3: // png
524
  $src = @ wppa_imagecreatefrompng( $file );
525
  break;
 
 
 
526
  }
527
  if ( ! $src ) {
528
  wppa_log( 'Error', 'Image file '.$file.' is corrupt while creating thmbnail' );
@@ -644,6 +654,8 @@ function wppa_create_thumbnail( $id, $use_source = true ) {
644
  $full_thumbpath = $thumbpath . '.png';
645
  wppa_imagepng( $dst, $full_thumbpath, 6 );
646
  break;
 
 
647
  }
648
  $thumbpath = $full_thumbpath;
649
 
2
  /* wppa-photo-files.php
3
  *
4
  * Functions used to create/manipulate photofiles
5
+ * Version 7.2.06
6
  *
7
  */
8
 
126
  case '8':
127
  $orientate = imagerotate( $source, 90, 0 );
128
  break;
129
+ default:
130
+ break;
131
  }
132
 
133
  // Output
284
  case 3: // png
285
  $src = @ wppa_imagecreatefrompng( $file );
286
  break;
287
+ default:
288
+ wppa_log( 'err', 'Unimplemented mime type: ' . $mime . ' in wppa_make_the_photo_files()' );
289
+ break;
290
  }
291
 
292
  if ( ! $src ) {
328
  case 3:
329
  wppa_imagepng( $dst, $newimage, 6 );
330
  break;
331
+ default:
332
+ wppa_log( 'err', sprintf( 'Unimplemented mime type %s encountered in wppa_create_thumbnail()', $mime ) );
333
  }
334
 
335
  // Remove destination image
412
  wppa_get_photoy( $id, true );
413
  wppa_get_thumbx( $id, true );
414
  wppa_get_thumby( $id, true );
415
+
416
  // Clear magickstack
417
  wppa_update_photo( array( 'id' => $id, 'magickstack' => '' ) );
418
+
419
  // Clear (super)cache
420
  wppa_clear_cache();
421
  return true;
530
  case 3: // png
531
  $src = @ wppa_imagecreatefrompng( $file );
532
  break;
533
+ default:
534
+ $src = null;
535
+ break;
536
  }
537
  if ( ! $src ) {
538
  wppa_log( 'Error', 'Image file '.$file.' is corrupt while creating thmbnail' );
654
  $full_thumbpath = $thumbpath . '.png';
655
  wppa_imagepng( $dst, $full_thumbpath, 6 );
656
  break;
657
+ default:
658
+ wppa_log( 'err', sprintf( 'Unimplemented mime type %s encountered in wppa_create_thumbnail()', $mime ) );
659
  }
660
  $thumbpath = $full_thumbpath;
661
 
wppa-potd-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  * admin photo of the day widget
6
- * Version 7.1.10
7
  *
8
  */
9
 
@@ -315,6 +315,10 @@ global $wppa_defaults;
315
  $n_days = '366';
316
  $date_key = 'z';
317
  break;
 
 
 
 
318
  }
319
  while ( get_option( 'wppa_potd_offset', '0' ) > $n_days ) {
320
  update_option( 'wppa_potd_offset', get_option( 'wppa_potd_offset') - $n_days );
@@ -346,9 +350,6 @@ global $wppa_defaults;
346
  $html .= sprintf( __( 'Todays photo order# = %s.', 'wp-photo-album-plus' ), $photo_order );
347
  wppa_potd_setting( $slug, '11b', $name, $desc, $html );
348
 
349
- }
350
- elseif ( $wppa_widget_period == 'week' ) {
351
-
352
  }
353
  }
354
 
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  * admin photo of the day widget
6
+ * Version 7.2.06
7
  *
8
  */
9
 
315
  $n_days = '366';
316
  $date_key = 'z';
317
  break;
318
+ default:
319
+ $n_days = '';
320
+ $date_key = '';
321
+ break;
322
  }
323
  while ( get_option( 'wppa_potd_offset', '0' ) > $n_days ) {
324
  update_option( 'wppa_potd_offset', get_option( 'wppa_potd_offset') - $n_days );
350
  $html .= sprintf( __( 'Todays photo order# = %s.', 'wp-photo-album-plus' ), $photo_order );
351
  wppa_potd_setting( $slug, '11b', $name, $desc, $html );
352
 
 
 
 
353
  }
354
  }
355
 
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 7.2.05
7
  *
8
  */
9
 
@@ -7424,7 +7424,7 @@ global $wppa_supported_camara_brands;
7424
  foreach ( $users as $usr ) {
7425
  if ( ! wppa_user_is( 'administrator', $usr['ID'] ) ) { // an administrator can not be blacklisted
7426
  if ( ! in_array( $usr['user_login'], $blacklist ) ) { // skip already on blacklist
7427
- $options[] = $usr['display_name'].' ('.$usr['user_login'].')';
7428
  $values[] = $usr['user_login'];
7429
  }
7430
  }
@@ -7452,7 +7452,7 @@ global $wppa_supported_camara_brands;
7452
  $values = array( '0' );
7453
  foreach ( $blacklist as $usr ) {
7454
  $u = wppa_get_user_by( 'login', $usr );
7455
- $options[] = $u->display_name.' ('.$u->user_login.')';
7456
  $values[] = $u->user_login;
7457
  }
7458
  $onchange = 'alert(\''.__('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus').'\');wppaRefreshAfter();';
@@ -7488,7 +7488,7 @@ global $wppa_supported_camara_brands;
7488
  foreach ( $users as $usr ) {
7489
  if ( ! wppa_user_is( 'administrator', $usr['ID'] ) ) { // an administrator can not be made superuser
7490
  if ( ! in_array( $usr['user_login'], $superlist ) ) { // skip already on superlist
7491
- $options[] = $usr['display_name'].' ('.$usr['user_login'].')';
7492
  $values[] = $usr['user_login'];
7493
  }
7494
  }
@@ -7516,7 +7516,7 @@ global $wppa_supported_camara_brands;
7516
  $values = array( '0' );
7517
  foreach ( $superlist as $usr ) {
7518
  $u = wppa_get_user_by( 'login', $usr );
7519
- $options[] = $u->display_name.' ('.$u->user_login.')';
7520
  $values[] = $u->user_login;
7521
  }
7522
  $onchange = 'alert(\''.__('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus').'\');wppaRefreshAfter();';
@@ -9351,6 +9351,10 @@ global $wppa_supported_camara_brands;
9351
  $tags = 'system,album';
9352
  wppa_setting($slug, '11.1', $name, $desc, $html, $help, $clas, $tags);
9353
  break;
 
 
 
 
9354
  }
9355
 
9356
  $name = __('Grant categories', 'wp-photo-album-plus');
@@ -9807,6 +9811,15 @@ global $wppa_supported_camara_brands;
9807
  $tags = 'system,search';
9808
  wppa_setting($slug, '21', $name, $desc, $html, $help, $clas, $tags);
9809
 
 
 
 
 
 
 
 
 
 
9810
  }
9811
  wppa_setting_subheader( 'F', '1', __( 'Watermark related settings' , 'wp-photo-album-plus') );
9812
  {
@@ -12072,13 +12085,13 @@ function wppa_cronjob_button( $slug ) {
12072
  ' style="float:left;border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0 6px;' . ( $crashed ? 'color:red;': '' ) . '"' .
12073
  ' value="' . esc_attr( $label ) . '"';
12074
  if ( ! $locked ) {
12075
- $result .= ' onclick="if ( jQuery(\'#'.$slug.'_status\').html() != \'\' || confirm(\'Are you sure ?\') ) wppaMaintenanceProc(\''.$slug.'\', false, true);" />';
12076
  }
12077
  else {
12078
  if ( $crashed ) {
12079
  $result .= ' title="' . esc_attr( __( 'Click me to resume', 'wp-photo-album-plus' ) ) . '"';
12080
  }
12081
- $result .= ' onclick="if ( confirm(\'Are you sure you want to unlock and resume cron job?\') ) wppaMaintenanceProc(\''.$slug.'\', false, true); " />';
12082
  }
12083
 
12084
  return $result;
@@ -12099,7 +12112,7 @@ function wppa_maintenance_button( $slug ) {
12099
 
12100
  $result = '<input id="'.$slug.'_button" type="button" class="button-secundary" style="float:left; border-radius:3px; font-size: 11px; height: 18px; margin: 0 4px; padding: 0 6px;" value="'.esc_attr($label).'"';
12101
  if ( ! $locked ) {
12102
- $result .= ' onclick="if ( jQuery(\'#'.$slug.'_status\').html() != \'\' || confirm(\'Are you sure ?\') ) wppaMaintenanceProc(\''.$slug.'\', false);" />';
12103
  }
12104
  else {
12105
  $result .= ' onclick="alert(\'Is currently being executed by '.$user.'.\')" />';
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 7.2.06
7
  *
8
  */
9
 
7424
  foreach ( $users as $usr ) {
7425
  if ( ! wppa_user_is( 'administrator', $usr['ID'] ) ) { // an administrator can not be blacklisted
7426
  if ( ! in_array( $usr['user_login'], $blacklist ) ) { // skip already on blacklist
7427
+ $options[] = htmlspecialchars( $usr['display_name'] ).' ('.$usr['user_login'].')';
7428
  $values[] = $usr['user_login'];
7429
  }
7430
  }
7452
  $values = array( '0' );
7453
  foreach ( $blacklist as $usr ) {
7454
  $u = wppa_get_user_by( 'login', $usr );
7455
+ $options[] = htmlspecialchars( $u->display_name ).' ('.$u->user_login.')';
7456
  $values[] = $u->user_login;
7457
  }
7458
  $onchange = 'alert(\''.__('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus').'\');wppaRefreshAfter();';
7488
  foreach ( $users as $usr ) {
7489
  if ( ! wppa_user_is( 'administrator', $usr['ID'] ) ) { // an administrator can not be made superuser
7490
  if ( ! in_array( $usr['user_login'], $superlist ) ) { // skip already on superlist
7491
+ $options[] = htmlspecialchars( $usr['display_name'] ).' ('.$usr['user_login'].')';
7492
  $values[] = $usr['user_login'];
7493
  }
7494
  }
7516
  $values = array( '0' );
7517
  foreach ( $superlist as $usr ) {
7518
  $u = wppa_get_user_by( 'login', $usr );
7519
+ $options[] = htmlspecialchars( $u->display_name ).' ('.$u->user_login.')';
7520
  $values[] = $u->user_login;
7521
  }
7522
  $onchange = 'alert(\''.__('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus').'\');wppaRefreshAfter();';
9351
  $tags = 'system,album';
9352
  wppa_setting($slug, '11.1', $name, $desc, $html, $help, $clas, $tags);
9353
  break;
9354
+
9355
+ default:
9356
+ wppa_log( 'err', 'Unimplemented grant_parent_sel_method in settings page' );
9357
+ break;
9358
  }
9359
 
9360
  $name = __('Grant categories', 'wp-photo-album-plus');
9811
  $tags = 'system,search';
9812
  wppa_setting($slug, '21', $name, $desc, $html, $help, $clas, $tags);
9813
 
9814
+ $name = __('Search field placeholder', 'wp-photo-album-plus');
9815
+ $desc = __('The text of the placeholder', 'wp-photo-album-plus');
9816
+ $help = '';
9817
+ $slug = 'wppa_search_placeholder';
9818
+ $html = wppa_input($slug, '150px;');
9819
+ $clas = '';
9820
+ $tags = 'system,search';
9821
+ wppa_setting($slug, '22', $name, $desc, $html, $help, $clas, $tags);
9822
+
9823
  }
9824
  wppa_setting_subheader( 'F', '1', __( 'Watermark related settings' , 'wp-photo-album-plus') );
9825
  {
12085
  ' style="float:left;border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0 6px;' . ( $crashed ? 'color:red;': '' ) . '"' .
12086
  ' value="' . esc_attr( $label ) . '"';
12087
  if ( ! $locked ) {
12088
+ $result .= ' onclick="if ( jQuery(\'#'.$slug.'_status\').html() != \'\' || confirm(\''.__('Are you sure?', 'wp-photo-album-plus').'\') ) wppaMaintenanceProc(\''.$slug.'\', false, true);" />';
12089
  }
12090
  else {
12091
  if ( $crashed ) {
12092
  $result .= ' title="' . esc_attr( __( 'Click me to resume', 'wp-photo-album-plus' ) ) . '"';
12093
  }
12094
+ $result .= ' onclick="if ( confirm(\''.__('Are you sure you want to unlock and resume cron job?', 'wp-photo-album-plus').'\') ) wppaMaintenanceProc(\''.$slug.'\', false, true); " />';
12095
  }
12096
 
12097
  return $result;
12112
 
12113
  $result = '<input id="'.$slug.'_button" type="button" class="button-secundary" style="float:left; border-radius:3px; font-size: 11px; height: 18px; margin: 0 4px; padding: 0 6px;" value="'.esc_attr($label).'"';
12114
  if ( ! $locked ) {
12115
+ $result .= ' onclick="if ( jQuery(\'#'.$slug.'_status\').html() != \'\' || confirm(\''.__('Are you sure?', 'wp-photo-album-plus').'\') ) wppaMaintenanceProc(\''.$slug.'\', false);" />';
12116
  }
12117
  else {
12118
  $result .= ' onclick="alert(\'Is currently being executed by '.$user.'.\')" />';
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 7.2.05
7
  *
8
  */
9
 
@@ -413,10 +413,6 @@ global $wppa_error;
413
  }
414
  }
415
 
416
- if ( $old_rev <= '6410' ) {
417
- // @ $wpdb->query( "UPDATE wp_options SET autoload = 'no' WHERE option_name LIKE 'wppa_%'");
418
- }
419
-
420
  if ( $old_rev <= '6411' ) {
421
  $old = get_option( 'wppa_upload_edit', 'no' );
422
  if ( $old == 'no' ) {
@@ -1818,8 +1814,8 @@ cursorborder:'2px solid transparent',";
1818
  'wppa_ss_name_max' => '0',
1819
  'wppa_ss_text_max' => '0',
1820
  'wppa_search_toptext' => '',
1821
- 'wppa_search_in_section' => __( 'Search in current section' , 'wp-photo-album-plus'),
1822
- 'wppa_search_in_results' => __( 'Search in current results' , 'wp-photo-album-plus'),
1823
  'wppa_search_min_length' => '2', // 18
1824
  'wppa_search_user_void' => 'times,views,wp-content,wp,content,wppa-pl,wppa,pl',
1825
  'wppa_search_numbers_void' => 'no',
@@ -1834,6 +1830,7 @@ cursorborder:'2px solid transparent',";
1834
  'wppa_search_caption_2' => '',
1835
  'wppa_search_selbox_2' => '',
1836
  'wppa_extended_duplicate_remove' => 'no',
 
1837
 
1838
  // F Watermark
1839
  'wppa_watermark_on' => 'no',
@@ -2144,6 +2141,9 @@ static $user;
2144
  }
2145
  break;
2146
 
 
 
 
2147
  }
2148
  }
2149
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 7.2.06
7
  *
8
  */
9
 
413
  }
414
  }
415
 
 
 
 
 
416
  if ( $old_rev <= '6411' ) {
417
  $old = get_option( 'wppa_upload_edit', 'no' );
418
  if ( $old == 'no' ) {
1814
  'wppa_ss_name_max' => '0',
1815
  'wppa_ss_text_max' => '0',
1816
  'wppa_search_toptext' => '',
1817
+ 'wppa_search_in_section' => __( 'Search in current section', 'wp-photo-album-plus' ),
1818
+ 'wppa_search_in_results' => __( 'Search in current results', 'wp-photo-album-plus' ),
1819
  'wppa_search_min_length' => '2', // 18
1820
  'wppa_search_user_void' => 'times,views,wp-content,wp,content,wppa-pl,wppa,pl',
1821
  'wppa_search_numbers_void' => 'no',
1830
  'wppa_search_caption_2' => '',
1831
  'wppa_search_selbox_2' => '',
1832
  'wppa_extended_duplicate_remove' => 'no',
1833
+ 'wppa_search_placeholder' => __( 'Search photos &hellip;', 'wp-photo-album-plus' ),
1834
 
1835
  // F Watermark
1836
  'wppa_watermark_on' => 'no',
2141
  }
2142
  break;
2143
 
2144
+ default:
2145
+ wppa_log( 'err', 'Unimplemented grant_parent_sel_method: ' . wppa_opt( 'grant_parent_sel_method' ) . ' in wppa_grant_albums()' );
2146
+ break;
2147
  }
2148
  }
2149
 
wppa-styles.php CHANGED
@@ -3,7 +3,7 @@
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
- /* Version 7.0.09
7
  /*
8
  */
9
 
@@ -523,7 +523,6 @@ function wppa_get_imgstyle_a( $id, $file, $xmax_size, $xvalign = '', $type = ''
523
  }
524
 
525
  // Cursor
526
- $linktyp = '';
527
  switch ( $type ) {
528
  case 'thumb': // Normal
529
  $linktyp = wppa_opt( 'thumb_linktype' );
@@ -545,6 +544,10 @@ function wppa_get_imgstyle_a( $id, $file, $xmax_size, $xvalign = '', $type = ''
545
  break;
546
  case 'albthumb': // Album widget
547
  $linktyp = wppa_opt( 'album_widget_linktype' );
 
 
 
 
548
  }
549
  if ( $linktyp == 'none' ) {
550
  $result['cursor'] = ' cursor:default;';
@@ -616,10 +619,6 @@ function wppa_get_imgstyle_a( $id, $file, $xmax_size, $xvalign = '', $type = ''
616
  $delta = '0';
617
  if ( ! wppa( 'auto_colwidth' ) && ! wppa_page( 'oneofone' ) ) {
618
  switch ( $valign ) {
619
- case 'top':
620
- case 'fit':
621
- $delta = '0';
622
- break;
623
  case 'center':
624
  $delta = round( ( $max_height - $height ) / 2 );
625
  if ( $delta < '0' ) $delta = '0';
@@ -628,6 +627,9 @@ function wppa_get_imgstyle_a( $id, $file, $xmax_size, $xvalign = '', $type = ''
628
  $delta = $max_height - $height;
629
  if ( $delta < '0' ) $delta = '0';
630
  break;
 
 
 
631
  }
632
  }
633
  $m_top = $delta;
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
+ /* Version 7.2.06
7
  /*
8
  */
9
 
523
  }
524
 
525
  // Cursor
 
526
  switch ( $type ) {
527
  case 'thumb': // Normal
528
  $linktyp = wppa_opt( 'thumb_linktype' );
544
  break;
545
  case 'albthumb': // Album widget
546
  $linktyp = wppa_opt( 'album_widget_linktype' );
547
+ break;
548
+ default:
549
+ $linktyp = '';
550
+ break;
551
  }
552
  if ( $linktyp == 'none' ) {
553
  $result['cursor'] = ' cursor:default;';
619
  $delta = '0';
620
  if ( ! wppa( 'auto_colwidth' ) && ! wppa_page( 'oneofone' ) ) {
621
  switch ( $valign ) {
 
 
 
 
622
  case 'center':
623
  $delta = round( ( $max_height - $height ) / 2 );
624
  if ( $delta < '0' ) $delta = '0';
627
  $delta = $max_height - $height;
628
  if ( $delta < '0' ) $delta = '0';
629
  break;
630
+ default: // case 'top': case 'fit':
631
+ $delta = '0';
632
+ break;
633
  }
634
  }
635
  $m_top = $delta;
wppa-thumbnails.php CHANGED
@@ -5,7 +5,7 @@
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
- * Version 7.2.01
9
  *
10
  */
11
 
@@ -61,17 +61,19 @@ global $wpdb;
61
  }
62
 
63
  // If no image to display, die gracefully
64
- $imgsrc = wppa_get_thumb_path( $id );
65
- if ( ! wppa_is_video( $id ) && ! is_file( $imgsrc ) && ! wppa_has_audio( $id ) ) {
66
- $result .= '<div' .
67
- ' class="' . $class . '"' .
68
- ' style="' . $framestyle . '; color:red;" >' .
69
- 'Missing thumbnail image #' . $id .
70
- '</div>';
71
- return $result;
72
- }
73
 
74
  // Find image attributes
 
 
75
  $alt = $album['alt_thumbsize'] == 'yes' ? '_alt' : '';
76
  $imgattr_a = wppa_get_imgstyle_a( $id, $imgsrc, wppa_opt( 'thumbsize'.$alt ), 'optional', 'thumb' );
77
  $imgstyle = $imgattr_a['style'];
@@ -1085,21 +1087,21 @@ global $wpdb;
1085
  $imgsrc = wppa_get_thumb_path( $id );
1086
  $is_pdf = wppa_is_pdf( $id );
1087
 
1088
- if ( ! wppa_is_video( $id ) && ! is_file( $imgsrc ) ) {
1089
- $result .= '<div' .
1090
- ' class=""' .
1091
- ' style="' .
1092
- 'font-size:10px;' .
1093
- 'color:red;' .
1094
- 'width:' . wppa_opt( 'thumbsize' ) . 'px;' .
1095
- 'position:static;' .
1096
- 'float:left;' .
1097
- '"' .
1098
- ' >' .
1099
- sprintf( __( 'Missing thumbnail image #%s' , 'wp-photo-album-plus'), $id ) .
1100
- '</div>';
1101
- return $result;
1102
- }
1103
 
1104
  $alt = $album['alt_thumbsize'] == 'yes' ? '_alt' : '';
1105
  $imgattr_a = wppa_get_imgstyle_a( $id, $imgsrc, wppa_opt( 'thumbsize'.$alt ), 'optional', 'thumb' );
@@ -1831,10 +1833,7 @@ function wppa_do_filmthumb( $id, $idx, $do_for_feed = false, $glue = false ) {
1831
  $imgalt = wppa_get_imgalt( $thumb['id'] );
1832
  $is_pdf = wppa_is_pdf( $id );
1833
 
1834
- if ( wppa_opt( 'film_linktype' ) == 'lightbox' ) {
1835
- // $title = esc_attr( wppa_zoom_in( $thumb['id'] ) );
1836
- }
1837
- else {
1838
  $events .= ' onclick="wppaGotoKeepState( '.wppa( 'mocc' ).', '.$idx.' )"';
1839
  $events .= ' ondblclick="wppaStartStop( '.wppa( 'mocc' ).', -1 )"';
1840
  }
@@ -2045,6 +2044,7 @@ function wppa_get_medal_html_a( $args ) {
2045
  case 'pdf': $url = WPPA_UPLOAD_URL . '/icons/' . wppa_opt( 'document_icon' ); break;
2046
  case 'audio': $url = WPPA_UPLOAD_URL . '/icons/' . wppa_opt( 'audio_icon' ); break;
2047
  case 'video': $url = WPPA_UPLOAD_URL . '/icons/' . wppa_opt( 'video_icon' ); break;
 
2048
  }
2049
  $result .= '<img' .
2050
  ' src="' . esc_attr( $url ) . '"' .
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
+ * Version 7.2.06
9
  *
10
  */
11
 
61
  }
62
 
63
  // If no image to display, die gracefully
64
+ // $imgsrc = wppa_get_thumb_path( $id );
65
+ // if ( ! wppa_is_video( $id ) && ! is_file( $imgsrc ) && ! wppa_has_audio( $id ) ) {
66
+ // $result .= '<div' .
67
+ // ' class="' . $class . '"' .
68
+ // ' style="' . $framestyle . '; color:red;" >' .
69
+ // 'Missing thumbnail image #' . $id .
70
+ // '</div>';
71
+ // return $result;
72
+ // }
73
 
74
  // Find image attributes
75
+ $imgsrc = wppa_get_thumb_path( $id );
76
+ if ( ! is_file( $imgsrc ) ) wppa_create_thumbnail( $id );
77
  $alt = $album['alt_thumbsize'] == 'yes' ? '_alt' : '';
78
  $imgattr_a = wppa_get_imgstyle_a( $id, $imgsrc, wppa_opt( 'thumbsize'.$alt ), 'optional', 'thumb' );
79
  $imgstyle = $imgattr_a['style'];
1087
  $imgsrc = wppa_get_thumb_path( $id );
1088
  $is_pdf = wppa_is_pdf( $id );
1089
 
1090
+ // if ( ! wppa_is_video( $id ) && ! is_file( $imgsrc ) ) {
1091
+ // $result .= '<div' .
1092
+ // ' class=""' .
1093
+ // ' style="' .
1094
+ // 'font-size:10px;' .
1095
+ // 'color:red;' .
1096
+ // 'width:' . wppa_opt( 'thumbsize' ) . 'px;' .
1097
+ // 'position:static;' .
1098
+ // 'float:left;' .
1099
+ // '"' .
1100
+ // ' >' .
1101
+ // sprintf( __( 'Missing thumbnail image #%s' , 'wp-photo-album-plus'), $id ) .
1102
+ // '</div>';
1103
+ // return $result;
1104
+ // }
1105
 
1106
  $alt = $album['alt_thumbsize'] == 'yes' ? '_alt' : '';
1107
  $imgattr_a = wppa_get_imgstyle_a( $id, $imgsrc, wppa_opt( 'thumbsize'.$alt ), 'optional', 'thumb' );
1833
  $imgalt = wppa_get_imgalt( $thumb['id'] );
1834
  $is_pdf = wppa_is_pdf( $id );
1835
 
1836
+ if ( wppa_opt( 'film_linktype' ) != 'lightbox' ) {
 
 
 
1837
  $events .= ' onclick="wppaGotoKeepState( '.wppa( 'mocc' ).', '.$idx.' )"';
1838
  $events .= ' ondblclick="wppaStartStop( '.wppa( 'mocc' ).', -1 )"';
1839
  }
2044
  case 'pdf': $url = WPPA_UPLOAD_URL . '/icons/' . wppa_opt( 'document_icon' ); break;
2045
  case 'audio': $url = WPPA_UPLOAD_URL . '/icons/' . wppa_opt( 'audio_icon' ); break;
2046
  case 'video': $url = WPPA_UPLOAD_URL . '/icons/' . wppa_opt( 'video_icon' ); break;
2047
+ default: $url = ''; // Should never get here
2048
  }
2049
  $result .= '<img' .
2050
  ' src="' . esc_attr( $url ) . '"' .
wppa-topten-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
- * Version 7.2.04
7
  */
8
 
9
  class TopTenWidget extends WP_Widget {
@@ -490,6 +490,10 @@ class TopTenWidget extends WP_Widget {
490
  '</div>';
491
  }
492
  break;
 
 
 
 
493
  }
494
  $widget_content .= '</div>';
495
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the top rated photos
6
+ * Version 7.2.06
7
  */
8
 
9
  class TopTenWidget extends WP_Widget {
490
  '</div>';
491
  }
492
  break;
493
+
494
+ default:
495
+ wppa_log( 'err', 'Unimplemented sortby: '. $instance['sortby'] .' in topten widget' );
496
+ break;
497
  }
498
  $widget_content .= '</div>';
499
  }
wppa-upload-common.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains common upload functions
6
- * Version 7.1.00
7
  *
8
  */
9
 
@@ -351,6 +351,9 @@ function wppa_upload_common_error( $error, $from ) {
351
  case 'upload':
352
  wppa_error_message( $error );
353
  break;
 
 
 
354
  }
355
  }
356
 
@@ -360,6 +363,9 @@ function wppa_upload_common_ok( $error, $from ) {
360
  case 'upload':
361
  wppa_ok_message( $error );
362
  break;
 
 
 
363
  }
364
  }
365
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains common upload functions
6
+ * Version 7.2.06
7
  *
8
  */
9
 
351
  case 'upload':
352
  wppa_error_message( $error );
353
  break;
354
+ default:
355
+ wppa_log( 'err', 'Unimplemented from: ' . $from . ' in wppa_upload_common_error()' );
356
+ break;
357
  }
358
  }
359
 
363
  case 'upload':
364
  wppa_ok_message( $error );
365
  break;
366
+ default:
367
+ wppa_log( 'err', 'Unimplemented from: ' . $from . ' in wppa_upload_common_ok()' );
368
+ break;
369
  }
370
  }
371
 
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 7.2.05
7
  *
8
  */
9
 
@@ -35,10 +35,10 @@ global $blog_id;
35
 
36
  // If in the cloud...
37
  $is_old = wppa_too_old_for_cloud( $id );
38
- if ( wppa_cdn( 'front' ) &&
39
- ! wppa_is_multi( $id ) &&
40
- ! $is_old &&
41
- ! wppa_is_stereo( $id ) &&
42
  ! wppa_is_pdf( $id ) &&
43
  ! $use_thumbfile ) {
44
  if ( $x && $y ) { // Only when size is given !! To prevent download of the fullsize image
@@ -63,6 +63,8 @@ global $blog_id;
63
  return $url;
64
  break;
65
 
 
 
66
  }
67
  }
68
  }
@@ -163,6 +165,9 @@ global $wppa_supported_stereo_types;
163
  $url = 'http'.$s.'://res.cloudinary.com/'.get_option('wppa_cdn_cloud_name').'/image/upload/'.$sizespec.$prefix.$thumb['id'].'.'.$thumb['ext'];
164
  return $url;
165
  break;
 
 
 
166
  }
167
  }
168
  }
@@ -309,6 +314,11 @@ global $wppa;
309
  $wppa['geo'] .= '
310
  <script type="text/javascript" >_wppaLat[' . wppa( 'mocc' ) . '][' . $id . '] = ' . $lat.'; _wppaLon[' . wppa( 'mocc' ) . '][' . $id.'] = ' . $lon . ';</script>';
311
  break; // End native
 
 
 
 
 
312
  }
313
  }
314
 
@@ -621,13 +631,13 @@ function wppa_array_sort( $array, $on, $order = SORT_ASC ) {
621
  }
622
 
623
  switch ( $order ) {
624
- case SORT_ASC:
625
- asort( $sortable_array );
626
- break;
627
  case SORT_DESC:
628
  arsort( $sortable_array );
629
  break;
630
- }
 
 
 
631
 
632
  foreach ( $sortable_array as $k => $v ) {
633
  $new_array[$k] = $array[$k];
@@ -871,7 +881,7 @@ global $wpdb;
871
  function wppa_dislike_check($photo) {
872
  global $wpdb;
873
 
874
- $count = $wpdb->get_var($wpdb->prepare( "SELECT COUNT(*) FROM ".WPPA_RATING." WHERE photo = %s AND value = -1", $photo ));
875
 
876
  if ( wppa_opt( 'dislike_mail_every' ) > '0') { // Feature enabled?
877
  if ( $count % wppa_opt( 'dislike_mail_every' ) == '0' ) { // Mail the admin
@@ -1275,12 +1285,12 @@ global $wpdb;
1275
 
1276
  // Delete db entries
1277
  $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_photos WHERE id = %d", $photo ) );
1278
- $wpdb->query($wpdb->prepare('DELETE FROM '.WPPA_RATING.' WHERE photo = %s', $photo));
1279
- $wpdb->query($wpdb->prepare('DELETE FROM '.WPPA_COMMENTS.' WHERE photo = %s', $photo));
1280
- $wpdb->query($wpdb->prepare('DELETE FROM '.WPPA_IPTC.' WHERE photo = %s', $photo));
1281
- $wpdb->query($wpdb->prepare('DELETE FROM '.WPPA_EXIF.' WHERE photo = %s', $photo));
1282
- wppa_invalidate_treecounts($album);
1283
- wppa_flush_upldr_cache('photoid', $photo);
1284
 
1285
  // Clear taglist to trigger recreata
1286
  wppa_clear_taglist();
@@ -1553,6 +1563,10 @@ static $busy;
1553
  }
1554
  $type = '{span style="color:cyan;" }Com{/span}';
1555
  break;
 
 
 
 
1556
  }
1557
  break;
1558
  case 'd':
@@ -1574,6 +1588,10 @@ static $busy;
1574
  }
1575
  $type = '{span style="color:blue;" }Eml{/span}';
1576
  break;
 
 
 
 
1577
  }
1578
  break;
1579
  case 'f':
@@ -1588,6 +1606,10 @@ static $busy;
1588
  case 'i':
1589
  $type = 'Fix';
1590
  break;
 
 
 
 
1591
  }
1592
  break;
1593
  case 'o':
@@ -2103,6 +2125,9 @@ global $wpdb;
2103
  case 'Photo w#id':
2104
  $name = __( 'Photo w#id', 'wp-photo-album-plus' );
2105
  break;
 
 
 
2106
  }
2107
  if ( ( $name ) || $method == 'none' ) { // Update name
2108
  wppa_update_photo( array( 'id' => $id, 'name' => $name ) );
@@ -2195,7 +2220,10 @@ global $wpdb;
2195
 
2196
  // Phase 2, get the ratings of the period
2197
  // find $ratings, ordered by photo id
2198
- $ratings = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM ".WPPA_RATING." WHERE timestamp >= %s AND timestamp < %s ORDER BY photo", $start, $end ), ARRAY_A );
 
 
 
2199
 
2200
  // Phase 3, set up an array with data we need
2201
  // There are two methods: photo oriented and owner oriented, depending on
@@ -2713,9 +2741,9 @@ global $wpdb;
2713
  $max_count = wppa_opt( 'comten_count' );
2714
  }
2715
 
2716
- $photo_ids = $wpdb->get_results( $wpdb->prepare( "SELECT photo FROM ".WPPA_COMMENTS." " .
2717
- "WHERE status = 'approved' " .
2718
- "ORDER BY timestamp DESC LIMIT %d", 100 * $max_count ), ARRAY_A );
2719
  $result = array();
2720
 
2721
  if ( is_array( $photo_ids ) ) {
@@ -3339,10 +3367,6 @@ $border = false; // debug
3339
 
3340
  // Find the border radius
3341
  switch( wppa_opt( 'icon_corner_style' ) ) {
3342
- case 'gif':
3343
- case 'none':
3344
- $bradius = $none;
3345
- break;
3346
  case 'light':
3347
  $bradius = $light;
3348
  break;
@@ -3352,6 +3376,9 @@ $border = false; // debug
3352
  case 'heavy':
3353
  $bradius = $heavy;
3354
  break;
 
 
 
3355
  }
3356
 
3357
  $use_svg = wppa_use_svg();
@@ -3400,6 +3427,7 @@ $border = false; // debug
3400
  ' xml:space="preserve"' .
3401
  ' >' .
3402
  '<g>';
 
3403
  switch ( $name ) {
3404
 
3405
  case 'Next-Button':
@@ -3567,6 +3595,8 @@ $border = false; // debug
3567
  '"' .
3568
  '/>';
3569
  break;
 
 
3570
  }
3571
 
3572
  $result .= '</g>' .
@@ -3963,10 +3993,7 @@ function wppa_get_spinner_svg_html( $xargs = array() ) {
3963
  }
3964
 
3965
  switch ( $corner ) {
3966
- case 'gif':
3967
- case 'none':
3968
- $bradius = '0';
3969
- break;
3970
  case 'light':
3971
  $bradius = round( $args['size'] / 10 );
3972
  break;
@@ -3976,6 +4003,9 @@ function wppa_get_spinner_svg_html( $xargs = array() ) {
3976
  case 'heavy':
3977
  $bradius = round( $args['size'] / 2 );
3978
  break;
 
 
 
3979
  }
3980
 
3981
  $result =
@@ -4744,15 +4774,15 @@ function wppa_wait() {
4744
  function wppa_icon_size( $default = '', $type = 0, $factor = 1 ) {
4745
 
4746
  switch ( $type ) {
4747
- case 0:
4748
- $opt = wppa_opt( 'nav_icon_size' );
4749
- break;
4750
  case 1:
4751
  $opt = wppa_opt( 'nav_icon_size_slide' );
4752
  break;
4753
  case 2:
4754
  $opt = wppa_opt( 'icon_size_rating' );
4755
  break;
 
 
 
4756
  }
4757
 
4758
  if ( $opt === 'default' ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 7.2.06
7
  *
8
  */
9
 
35
 
36
  // If in the cloud...
37
  $is_old = wppa_too_old_for_cloud( $id );
38
+ if ( wppa_cdn( 'front' ) &&
39
+ ! wppa_is_multi( $id ) &&
40
+ ! $is_old &&
41
+ ! wppa_is_stereo( $id ) &&
42
  ! wppa_is_pdf( $id ) &&
43
  ! $use_thumbfile ) {
44
  if ( $x && $y ) { // Only when size is given !! To prevent download of the fullsize image
63
  return $url;
64
  break;
65
 
66
+ default:
67
+ break;
68
  }
69
  }
70
  }
165
  $url = 'http'.$s.'://res.cloudinary.com/'.get_option('wppa_cdn_cloud_name').'/image/upload/'.$sizespec.$prefix.$thumb['id'].'.'.$thumb['ext'];
166
  return $url;
167
  break;
168
+
169
+ default:
170
+ break;
171
  }
172
  }
173
  }
314
  $wppa['geo'] .= '
315
  <script type="text/javascript" >_wppaLat[' . wppa( 'mocc' ) . '][' . $id . '] = ' . $lat.'; _wppaLon[' . wppa( 'mocc' ) . '][' . $id.'] = ' . $lon . ';</script>';
316
  break; // End native
317
+ case 'none':
318
+ break;
319
+ default:
320
+ wppa_log( 'err', 'Unimplemented gpx_implementation: ' . $type . ' in wppa_do_geo()' );
321
+ break;
322
  }
323
  }
324
 
631
  }
632
 
633
  switch ( $order ) {
 
 
 
634
  case SORT_DESC:
635
  arsort( $sortable_array );
636
  break;
637
+ default: // case SORT_ASC:
638
+ asort( $sortable_array );
639
+ break;
640
+ }
641
 
642
  foreach ( $sortable_array as $k => $v ) {
643
  $new_array[$k] = $array[$k];
881
  function wppa_dislike_check($photo) {
882
  global $wpdb;
883
 
884
+ $count = $wpdb->get_var($wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_rating WHERE photo = %s AND value = -1", $photo ));
885
 
886
  if ( wppa_opt( 'dislike_mail_every' ) > '0') { // Feature enabled?
887
  if ( $count % wppa_opt( 'dislike_mail_every' ) == '0' ) { // Mail the admin
1285
 
1286
  // Delete db entries
1287
  $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_photos WHERE id = %d", $photo ) );
1288
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_rating WHERE photo = %s", $photo ) );
1289
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_comments WHERE photo = %s", $photo ) );
1290
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_iptc WHERE photo = %s", $photo ) );
1291
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_exif WHERE photo = %s", $photo ) );
1292
+ wppa_invalidate_treecounts( $album );
1293
+ wppa_flush_upldr_cache( 'photoid', $photo );
1294
 
1295
  // Clear taglist to trigger recreata
1296
  wppa_clear_taglist();
1563
  }
1564
  $type = '{span style="color:cyan;" }Com{/span}';
1565
  break;
1566
+ default: // Should never get here
1567
+ $busy = false;
1568
+ return;
1569
+ break;
1570
  }
1571
  break;
1572
  case 'd':
1588
  }
1589
  $type = '{span style="color:blue;" }Eml{/span}';
1590
  break;
1591
+ default: // Should never get here
1592
+ $busy = false;
1593
+ return;
1594
+ break;
1595
  }
1596
  break;
1597
  case 'f':
1606
  case 'i':
1607
  $type = 'Fix';
1608
  break;
1609
+ default: // Should never get here
1610
+ $busy = false;
1611
+ return;
1612
+ break;
1613
  }
1614
  break;
1615
  case 'o':
2125
  case 'Photo w#id':
2126
  $name = __( 'Photo w#id', 'wp-photo-album-plus' );
2127
  break;
2128
+ default:
2129
+ $name = '';
2130
+ break;
2131
  }
2132
  if ( ( $name ) || $method == 'none' ) { // Update name
2133
  wppa_update_photo( array( 'id' => $id, 'name' => $name ) );
2220
 
2221
  // Phase 2, get the ratings of the period
2222
  // find $ratings, ordered by photo id
2223
+ $ratings = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_rating
2224
+ WHERE timestamp >= %s
2225
+ AND timestamp < %s
2226
+ ORDER BY photo", $start, $end ), ARRAY_A );
2227
 
2228
  // Phase 3, set up an array with data we need
2229
  // There are two methods: photo oriented and owner oriented, depending on
2741
  $max_count = wppa_opt( 'comten_count' );
2742
  }
2743
 
2744
+ $photo_ids = $wpdb->get_results( $wpdb->prepare( "SELECT photo FROM $wpdb->wppa_comments
2745
+ WHERE status = 'approved'
2746
+ ORDER BY timestamp DESC LIMIT %d", 100 * $max_count ), ARRAY_A );
2747
  $result = array();
2748
 
2749
  if ( is_array( $photo_ids ) ) {
3367
 
3368
  // Find the border radius
3369
  switch( wppa_opt( 'icon_corner_style' ) ) {
 
 
 
 
3370
  case 'light':
3371
  $bradius = $light;
3372
  break;
3376
  case 'heavy':
3377
  $bradius = $heavy;
3378
  break;
3379
+ default:
3380
+ $bradius = $none;
3381
+ break;
3382
  }
3383
 
3384
  $use_svg = wppa_use_svg();
3427
  ' xml:space="preserve"' .
3428
  ' >' .
3429
  '<g>';
3430
+
3431
  switch ( $name ) {
3432
 
3433
  case 'Next-Button':
3595
  '"' .
3596
  '/>';
3597
  break;
3598
+ default:
3599
+ break;
3600
  }
3601
 
3602
  $result .= '</g>' .
3993
  }
3994
 
3995
  switch ( $corner ) {
3996
+
 
 
 
3997
  case 'light':
3998
  $bradius = round( $args['size'] / 10 );
3999
  break;
4003
  case 'heavy':
4004
  $bradius = round( $args['size'] / 2 );
4005
  break;
4006
+ default: // case 'gif': case 'none':
4007
+ $bradius = '0';
4008
+ break;
4009
  }
4010
 
4011
  $result =
4774
  function wppa_icon_size( $default = '', $type = 0, $factor = 1 ) {
4775
 
4776
  switch ( $type ) {
 
 
 
4777
  case 1:
4778
  $opt = wppa_opt( 'nav_icon_size_slide' );
4779
  break;
4780
  case 2:
4781
  $opt = wppa_opt( 'icon_size_rating' );
4782
  break;
4783
+ default:
4784
+ $opt = wppa_opt( 'nav_icon_size' );
4785
+ break;
4786
  }
4787
 
4788
  if ( $opt === 'default' ) {
wppa-watermark.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-watermark.php
3
  *
4
  * Functions used for the application of watermarks
5
- * Version 7.1.02
6
  *
7
  */
8
 
@@ -246,6 +246,10 @@ function wppa_create_textual_watermark_file( $args ) {
246
  $fg = $black;
247
  $bg = $bgcolor;
248
  break;
 
 
 
 
249
  }
250
 
251
  // Plot the text
@@ -295,6 +299,9 @@ function wppa_create_textual_watermark_file( $args ) {
295
  imagettftext ( $canvas, $fontsize, 0, $lft, $bot-1, $fg, $fontfile, $lines[$lineno] );
296
  }
297
  break;
 
 
 
298
  }
299
  }
300
  imagesavealpha( $canvas, true );
@@ -473,6 +480,9 @@ function wppa_add_watermark( $id ) {
473
  break;
474
  case 3: $photoimage = wppa_imagecreatefrompng( $file );
475
  break;
 
 
 
476
  }
477
  if ( empty( $photoimage ) or ( ! $photoimage ) ) return false; // No image
478
 
@@ -534,10 +544,14 @@ function wppa_add_watermark( $id ) {
534
  break;
535
  case 3: wppa_imagepng( $photoimage, $file, 7 );
536
  break;
 
 
537
  }
538
 
539
  // Optimized
540
- wppa_optimize_image_file( $file );
 
 
541
 
542
  // Cleanup
543
  imagedestroy( $photoimage );
2
  /* wppa-watermark.php
3
  *
4
  * Functions used for the application of watermarks
5
+ * Version 7.2.06
6
  *
7
  */
8
 
246
  $fg = $black;
247
  $bg = $bgcolor;
248
  break;
249
+ default:
250
+ $fg = $black;
251
+ $bg = $bgcolor;
252
+ break;
253
  }
254
 
255
  // Plot the text
299
  imagettftext ( $canvas, $fontsize, 0, $lft, $bot-1, $fg, $fontfile, $lines[$lineno] );
300
  }
301
  break;
302
+ default:
303
+ wppa_log( 'err', 'Unimplemented textstyle: ' . $args['style'] . ' in wppa_create_textual_watermark_file()' );
304
+ break;
305
  }
306
  }
307
  imagesavealpha( $canvas, true );
480
  break;
481
  case 3: $photoimage = wppa_imagecreatefrompng( $file );
482
  break;
483
+ default:
484
+ $photoimage = NULL;
485
+ break;
486
  }
487
  if ( empty( $photoimage ) or ( ! $photoimage ) ) return false; // No image
488
 
544
  break;
545
  case 3: wppa_imagepng( $photoimage, $file, 7 );
546
  break;
547
+ default:
548
+ break;
549
  }
550
 
551
  // Optimized
552
+ if ( wppa_is_file( $file ) ) {
553
+ wppa_optimize_image_file( $file );
554
+ }
555
 
556
  // Cleanup
557
  imagedestroy( $photoimage );
wppa-widget-functions.php CHANGED
@@ -182,12 +182,7 @@ static $potd;
182
 
183
  $id = 0;
184
  switch ( wppa_opt( 'potd_method' ) ) {
185
-
186
- // Fixed photo
187
- case '1':
188
- $id = wppa_opt( 'potd_photo' );
189
- break;
190
-
191
  // Random
192
  case '2':
193
  $album = wppa_opt( 'potd_album' );
@@ -319,7 +314,11 @@ static $potd;
319
  }
320
  }
321
  break;
322
-
 
 
 
 
323
  }
324
 
325
  if ( $id ) {
182
 
183
  $id = 0;
184
  switch ( wppa_opt( 'potd_method' ) ) {
185
+
 
 
 
 
 
186
  // Random
187
  case '2':
188
  $album = wppa_opt( 'potd_album' );
314
  }
315
  }
316
  break;
317
+
318
+ // Fixed photo
319
+ default:
320
+ $id = wppa_opt( 'potd_photo' );
321
+ break;
322
  }
323
 
324
  if ( $id ) {
wppa-wrappers.php CHANGED
@@ -5,7 +5,7 @@
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
- * Version 7.2.05
9
  *
10
  */
11
 
@@ -153,10 +153,10 @@ function wppa_move_uploaded_file( $from, $to ) {
153
  else {
154
 
155
  $bret = copy( $from, $to ); // Do NOT use wppa_copy here to prevent inf recursion from wppa_copy and wppa_move_uploaded_file
156
- if ( $bret ) {
157
  // unlink( $from ); // RIPS does not believe that this is safe (7 msgs), although path is checked agains traversal.
158
  // // So, just do not cleanup our garbage
159
- }
160
  }
161
  if ( $bret ) {
162
  wppa_log( 'Fso', 'Uploaded file ' . wppa_shortpath( $from ) . ' moved to ' . wppa_shortpath( $to ) );
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 7.2.06
9
  *
10
  */
11
 
153
  else {
154
 
155
  $bret = copy( $from, $to ); // Do NOT use wppa_copy here to prevent inf recursion from wppa_copy and wppa_move_uploaded_file
156
+ // if ( $bret ) {
157
  // unlink( $from ); // RIPS does not believe that this is safe (7 msgs), although path is checked agains traversal.
158
  // // So, just do not cleanup our garbage
159
+ // }
160
  }
161
  if ( $bret ) {
162
  wppa_log( 'Fso', 'Uploaded file ' . wppa_shortpath( $from ) . ' moved to ' . wppa_shortpath( $to ) );
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.2.05.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/
@@ -22,8 +22,8 @@ global $wpdb;
22
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
- global $wppa_revno; $wppa_revno = '7205'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '7.2.05.008'; // WPPA software version
27
 
28
  /* Init page js data */
29
  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.2.06.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/
22
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
+ global $wppa_revno; $wppa_revno = '7206'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '7.2.06.009'; // WPPA software version
27
 
28
  /* Init page js data */
29
  global $wppa_js_page_data; $wppa_js_page_data = '';