WP Photo Album Plus - Version 7.3.13.008

Version Description

= 7.3.13 =

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

Release Info

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

Code changes from version 7.3.13.007 to 7.3.13.008

changelog.txt CHANGED
@@ -7,6 +7,11 @@ WP Photo Album Plus Changelog
7
  * You can now add some exif/iptc tags as default for the photo custom datafields.
8
  They will be filled in with the corresponding data at upload/import if available.
9
  For backward compatibility, Table VII-B4,2: Apply New Photodesc, will also fill in the data for existing items if available.
 
 
 
 
 
10
 
11
  = 7.3.12 =
12
 
7
  * You can now add some exif/iptc tags as default for the photo custom datafields.
8
  They will be filled in with the corresponding data at upload/import if available.
9
  For backward compatibility, Table VII-B4,2: Apply New Photodesc, will also fill in the data for existing items if available.
10
+ When there is no value for an w#cd-keyword, an 2#-iptc item or a E#-exif item,
11
+ the corresponding label value will also be empty when the photo description is filtered for keywords.
12
+ This means that a table line like e.g.
13
+ <tr><td>w#cc0</td><td>w#cd0</td></tr> will show nothing as long as there is no css that forces the height of it to be > 0.
14
+ * Added chackbox to Table IX-D5 to autmatically remove linebreaks and redundant space when new the photo description is updated.
15
 
16
  = 7.3.12 =
17
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
- Version: 7.3.13.007
6
  Stable tag: 7.3.12.008
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
+ Version: 7.3.13.008
6
  Stable tag: 7.3.12.008
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 7.3.12
6
  *
7
  */
8
 
@@ -3096,6 +3096,9 @@ global $wppa_log_file;
3096
  wppa( 'error', '1' );
3097
  }
3098
  else {
 
 
 
3099
  wppa_update_option( $option, $value );
3100
  wppa( 'error', '0' );
3101
  $alert = '';
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 7.3.13
6
  *
7
  */
8
 
3096
  wppa( 'error', '1' );
3097
  }
3098
  else {
3099
+ if ( wppa_switch( 'wppa_compress_newdesc' ) ) {
3100
+ $value = wppa_compress_html( $value );
3101
+ }
3102
  wppa_update_option( $option, $value );
3103
  wppa( 'error', '0' );
3104
  $alert = '';
wppa-defaults.php CHANGED
@@ -1050,6 +1050,7 @@ horizrailenabled:false,";
1050
  'wppa_mod_label_url' => wppa_get_imgdir('new.png'),
1051
  'wppa_apply_newphoto_desc' => 'no', // IX-D3
1052
  'wppa_newphoto_description' => $npd, // IX-D5
 
1053
  'wppa_newphoto_owner' => '', // IX-D5.1
1054
  'wppa_upload_limit_count' => '0', // IX-D6a
1055
  'wppa_upload_limit_time' => '0', // IX-D6b
1050
  'wppa_mod_label_url' => wppa_get_imgdir('new.png'),
1051
  'wppa_apply_newphoto_desc' => 'no', // IX-D3
1052
  'wppa_newphoto_description' => $npd, // IX-D5
1053
+ 'wppa_compress_newdesc' => 'no',
1054
  'wppa_newphoto_owner' => '', // IX-D5.1
1055
  'wppa_upload_limit_count' => '0', // IX-D6a
1056
  'wppa_upload_limit_time' => '0', // IX-D6b
wppa-exif-iptc-common.php CHANGED
@@ -14,12 +14,13 @@ global $wppa_supported_camara_brands;
14
  $wppa_supported_camara_brands = array( 'CANON', 'NIKON', 'SAMSUNG' );
15
 
16
  // Translate iptc tags into photo dependant data inside a text
17
- function wppa_filter_iptc($desc, $photo) {
18
  global $wpdb;
19
  global $wppa_iptc_labels;
20
  global $wppa_iptc_cache;
21
 
22
- if ( strpos($desc, '2#') === false ) return $desc; // No tags in desc: Nothing to do
 
23
 
24
  // Get te labels if not yet present
25
  if ( ! is_array( $wppa_iptc_labels ) ) {
@@ -65,6 +66,13 @@ global $wppa_iptc_cache;
65
 
66
  // Process last
67
  $temp = str_replace( $tag, $combined, $temp );
 
 
 
 
 
 
 
68
  }
69
 
70
  // Process all labels
@@ -82,7 +90,7 @@ global $wppa_iptc_cache;
82
  // Remove untranslated
83
  $pos = strpos($temp, '2#');
84
  while ( $pos !== false ) {
85
- $tmp = substr($temp, 0, $pos).__( 'n.a.', 'wp-photo-album-plus' ).substr($temp, $pos+5);
86
  $temp = $tmp;
87
  $pos = strpos($temp, '2#');
88
  }
@@ -91,7 +99,7 @@ global $wppa_iptc_cache;
91
  }
92
 
93
  // Translate exif tags into photo dependant data inside a text
94
- function wppa_filter_exif( $desc, $photo ) {
95
  global $wpdb;
96
  global $wppa_exif_labels;
97
  global $wppa_exif_cache;
@@ -143,6 +151,13 @@ global $wppa_exif_cache;
143
 
144
  // Process last
145
  $temp = str_replace( $tag, $combined, $temp );
 
 
 
 
 
 
 
146
  }
147
 
148
  // Process all labels
@@ -163,7 +178,9 @@ global $wppa_exif_cache;
163
  foreach( $groups as $group ) {
164
  $pos = strpos( $temp, $group );
165
  while ( $pos !== false ) {
166
- $tmp = substr( $temp, 0, $pos ) . '<span title="' . esc_attr( __( 'No data', 'wp-photo-album-plus' ) ) . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>' . substr( $temp, $pos+6 );
 
 
167
  $temp = $tmp;
168
  $pos = strpos( $temp, $group );
169
  }
14
  $wppa_supported_camara_brands = array( 'CANON', 'NIKON', 'SAMSUNG' );
15
 
16
  // Translate iptc tags into photo dependant data inside a text
17
+ function wppa_filter_iptc( $desc, $photo, $hide_empty = false ) {
18
  global $wpdb;
19
  global $wppa_iptc_labels;
20
  global $wppa_iptc_cache;
21
 
22
+ // Anything to do here?
23
+ if ( strpos($desc, '2#') === false ) return $desc;
24
 
25
  // Get te labels if not yet present
26
  if ( ! is_array( $wppa_iptc_labels ) ) {
66
 
67
  // Process last
68
  $temp = str_replace( $tag, $combined, $temp );
69
+
70
+ // If no content, remove label also if required
71
+ if ( ! $combined && $hide_empty ) {
72
+ $t = substr( $tag, 0, 2 ) . 'L' . substr( $tag, 2 );
73
+ $tag = $t;
74
+ $temp = str_replace( $tag, '', $temp );
75
+ }
76
  }
77
 
78
  // Process all labels
90
  // Remove untranslated
91
  $pos = strpos($temp, '2#');
92
  while ( $pos !== false ) {
93
+ $tmp = substr($temp, 0, $pos).( $hide_empty ? '' : __( 'n.a.', 'wp-photo-album-plus' ) ).substr($temp, $pos+5);
94
  $temp = $tmp;
95
  $pos = strpos($temp, '2#');
96
  }
99
  }
100
 
101
  // Translate exif tags into photo dependant data inside a text
102
+ function wppa_filter_exif( $desc, $photo, $hide_empty = false ) {
103
  global $wpdb;
104
  global $wppa_exif_labels;
105
  global $wppa_exif_cache;
151
 
152
  // Process last
153
  $temp = str_replace( $tag, $combined, $temp );
154
+
155
+ // If no content, remove label also if required
156
+ if ( ! $combined && $hide_empty ) {
157
+ $t = substr( $tag, 0, 2 ) . 'L' . substr( $tag, 2 );
158
+ $tag = $t;
159
+ $temp = str_replace( $tag, '', $temp );
160
+ }
161
  }
162
 
163
  // Process all labels
178
  foreach( $groups as $group ) {
179
  $pos = strpos( $temp, $group );
180
  while ( $pos !== false ) {
181
+ $tmp = substr( $temp, 0, $pos ) .
182
+ ( $hide_empty ? '' : '<span title="' . esc_attr( __( 'No data', 'wp-photo-album-plus' ) ) . '" style="cursor:pointer;" >' . __( 'n.a.', 'wp-photo-album-plus' ) . '</span>' ) .
183
+ substr( $temp, $pos+6 );
184
  $temp = $tmp;
185
  $pos = strpos( $temp, $group );
186
  }
wppa-items.php CHANGED
@@ -345,15 +345,16 @@ function wppa_get_photo_desc( $id, $xargs = array() ) {
345
 
346
  // Shortcodes
347
  if ( $args['doshortcodes'] ) $desc = do_shortcode( $desc ); // Do shortcodes if wanted
348
- else $desc = strip_shortcodes( $desc ); // Remove shortcodes if not wanted
349
 
350
  // Other keywords
351
- $desc = wppa_translate_photo_keywords( $id, $desc );
 
 
352
 
 
353
  $desc = wppa_html( $desc ); // Enable html
354
  $desc = balanceTags( $desc, true ); // Balance tags
355
- $desc = wppa_filter_iptc( $desc, $id ); // Render IPTC tags
356
- $desc = wppa_filter_exif( $desc, $id ); // Render EXIF tags
357
  $desc = make_clickable( $desc ); // Auto make a tags for links
358
  $desc = convert_smilies( $desc ); // Make smilies visible
359
 
@@ -410,7 +411,7 @@ function wppa_translate_photo_keywords( $id, $text ) {
410
  }
411
 
412
  }
413
- if ( $replacement == '' ) $replacement = '&lsaquo;'.__( 'none' , 'wp-photo-album-plus').'&rsaquo;';
414
  $result = str_replace( 'w#'.$keyword, $replacement, $result );
415
  }
416
 
@@ -464,7 +465,7 @@ function wppa_translate_photo_keywords( $id, $text ) {
464
  $result = str_replace( 'w#'.$timestamp, wppa_local_date( wppa_get_option( 'date_format', "F j, Y," ).' '.wppa_get_option( 'time_format', "g:i a" ), $thumb[$timestamp] ), $result );
465
  }
466
  else {
467
- $result = str_replace( 'w#'.$timestamp, '&lsaquo;'.__( 'unknown' , 'wp-photo-album-plus').'&rsaquo;', $result );
468
  }
469
  }
470
 
@@ -473,19 +474,17 @@ function wppa_translate_photo_keywords( $id, $text ) {
473
  $custom = $thumb['custom'];
474
  $custom_data = $custom ? wppa_unserialize( $custom ) : array( '', '', '', '', '', '', '', '', '', '' );
475
  for ( $i = '0'; $i < '10'; $i++ ) {
476
- if ( wppa_opt( 'custom_caption_'.$i ) ) { // Field defined
477
- if ( wppa_switch( 'custom_visible_'.$i ) ) { // May be displayed
478
- $result = str_replace( 'w#cc'.$i, __( wppa_opt( 'custom_caption_'.$i ) , 'wp-photo-album-plus') . ':', $result ); // Caption
479
- $result = str_replace( 'w#cd'.$i, __( stripslashes( $custom_data[$i] ) , 'wp-photo-album-plus'), $result ); // Data
480
- }
481
- else { // May not be displayed
482
- $result = str_replace( 'w#cc'.$i, '', $result ); // Remove
483
- $result = str_replace( 'w#cd'.$i, '', $result ); // Remove
484
- }
485
  }
486
- else { // Field not defined
487
- $result = str_replace( 'w#cc'.$i, '', $result ); // Remove
488
- $result = str_replace( 'w#cd'.$i, '', $result ); // Remove
489
  }
490
  }
491
  }
@@ -500,6 +499,12 @@ function wppa_translate_photo_keywords( $id, $text ) {
500
  $result = str_replace( 'w#duration', __( 'n.a.', 'wp-photo-album-plus' ), $result );
501
  }
502
  }
 
 
 
 
 
 
503
  return $result;
504
  }
505
 
@@ -732,7 +737,7 @@ function wppa_translate_album_keywords( $id, $text, $translate = true ) {
732
  $replacement = __( $replacement );
733
  }
734
 
735
- if ( $replacement == '' ) $replacement = '&lsaquo;' . __( 'none' , 'wp-photo-album-plus' ) . '&rsaquo;';
736
  $result = str_replace( 'w#'.$keyword, $replacement, $result );
737
  }
738
 
@@ -751,7 +756,7 @@ function wppa_translate_album_keywords( $id, $text, $translate = true ) {
751
  $result = str_replace( 'w#'.$timestamp, wppa_local_date( wppa_get_option( 'date_format', "F j, Y," ).' '.wppa_get_option( 'time_format', "g:i a" ), $album['timestamp'] ), $result );
752
  }
753
  else {
754
- $result = str_replace( 'w#'.$timestamp, '&lsaquo;' . __( 'unknown', 'wp-photo-album-plus' ) . '&rsaquo;', $result );
755
  }
756
  }
757
 
345
 
346
  // Shortcodes
347
  if ( $args['doshortcodes'] ) $desc = do_shortcode( $desc ); // Do shortcodes if wanted
348
+ else $desc = strip_shortcodes( $desc ); // Remove shortcodes if not wanted
349
 
350
  // Other keywords
351
+ $desc = wppa_translate_photo_keywords( $id, $desc ); // w# keywords
352
+ $desc = wppa_filter_iptc( $desc, $id, true ); // 2# tags
353
+ $desc = wppa_filter_exif( $desc, $id, true ); // E# tags
354
 
355
+ // Other filters
356
  $desc = wppa_html( $desc ); // Enable html
357
  $desc = balanceTags( $desc, true ); // Balance tags
 
 
358
  $desc = make_clickable( $desc ); // Auto make a tags for links
359
  $desc = convert_smilies( $desc ); // Make smilies visible
360
 
411
  }
412
 
413
  }
414
+ // if ( $replacement == '' ) $replacement = '&lsaquo;'.__( 'none' , 'wp-photo-album-plus').'&rsaquo;';
415
  $result = str_replace( 'w#'.$keyword, $replacement, $result );
416
  }
417
 
465
  $result = str_replace( 'w#'.$timestamp, wppa_local_date( wppa_get_option( 'date_format', "F j, Y," ).' '.wppa_get_option( 'time_format', "g:i a" ), $thumb[$timestamp] ), $result );
466
  }
467
  else {
468
+ $result = str_replace( 'w#'.$timestamp, '', $result );
469
  }
470
  }
471
 
474
  $custom = $thumb['custom'];
475
  $custom_data = $custom ? wppa_unserialize( $custom ) : array( '', '', '', '', '', '', '', '', '', '' );
476
  for ( $i = '0'; $i < '10'; $i++ ) {
477
+ $rep = __( stripslashes( $custom_data[$i] ) ); // Replacement
478
+ $cap = wppa_opt( 'custom_caption_'.$i ); // Caption
479
+ $dis = wppa_switch( 'custom_visible_'.$i ); // Visible
480
+
481
+ if ( $cap && $rep && $dis ) { // Field defined and not empty and may be displayed
482
+ $result = str_replace( 'w#cc'.$i, $cap, $result ); // Caption
483
+ $result = str_replace( 'w#cd'.$i, $rep, $result ); // Data
 
 
484
  }
485
+ else { // Not defined or empty or not displayable
486
+ $result = str_replace( 'w#cc'.$i, '', $result ); // Remove
487
+ $result = str_replace( 'w#cd'.$i, '', $result ); // Remove
488
  }
489
  }
490
  }
499
  $result = str_replace( 'w#duration', __( 'n.a.', 'wp-photo-album-plus' ), $result );
500
  }
501
  }
502
+
503
+ // for Rasada
504
+ $result = preg_replace( array ( '@<tr><td[^>]*?>[^<]*?</td><td[^>]*?></td></tr>@siu',
505
+ '@<tr><td[^>]*?>[^<]*?</td><td[^>]*?>' . __( 'n.a.', 'wp-photo-album-plus' ) . '</td></tr>@siu' ),
506
+ array ( '', '' ), $result );
507
+
508
  return $result;
509
  }
510
 
737
  $replacement = __( $replacement );
738
  }
739
 
740
+ // if ( $replacement == '' ) $replacement = '&lsaquo;' . __( 'none' , 'wp-photo-album-plus' ) . '&rsaquo;';
741
  $result = str_replace( 'w#'.$keyword, $replacement, $result );
742
  }
743
 
756
  $result = str_replace( 'w#'.$timestamp, wppa_local_date( wppa_get_option( 'date_format', "F j, Y," ).' '.wppa_get_option( 'time_format', "g:i a" ), $album['timestamp'] ), $result );
757
  }
758
  else {
759
+ $result = str_replace( 'w#'.$timestamp, '', $result );
760
  }
761
  }
762
 
wppa-settings-autosave.php CHANGED
@@ -9520,9 +9520,14 @@ global $wppa_supported_camara_brands;
9520
  $name = __('New photo desc', 'wp-photo-album-plus');
9521
  $desc = __('The description (template) to add to a new photo.', 'wp-photo-album-plus');
9522
  $help = (__('Enter the default description.', 'wp-photo-album-plus'));
9523
- $help .= '<br />'.(__('If you use html, please check item B-1 of this table.', 'wp-photo-album-plus'));
 
9524
  $slug = 'wppa_newphoto_description';
9525
- $html = wppa_textarea($slug, $name);
 
 
 
 
9526
  $clas = '';
9527
  $tags = 'system,meta';
9528
  wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
9520
  $name = __('New photo desc', 'wp-photo-album-plus');
9521
  $desc = __('The description (template) to add to a new photo.', 'wp-photo-album-plus');
9522
  $help = (__('Enter the default description.', 'wp-photo-album-plus'));
9523
+ $help .= '<br />'.__('If you use html, please check item B-1 of this table.', 'wp-photo-album-plus');
9524
+ $help .= '<br />'.__('If you tick the checkbox, linebreaks and redundand spaces will be removed.', 'wp-photo-album-plus');
9525
  $slug = 'wppa_newphoto_description';
9526
+ $slug2 = 'wppa_compress_newdesc';
9527
+ $html = wppa_textarea($slug, $name) .
9528
+ '<br />' .
9529
+ __('Compress', 'wp-photo-album-plus') .
9530
+ wppa_checkbox($slug2);
9531
  $clas = '';
9532
  $tags = 'system,meta';
9533
  wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 7.3.13.007
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_revno; $wppa_revno = '7313'; // WPPA db version
27
- global $wppa_api_version; $wppa_api_version = '7.3.13.007'; // WPPA software version
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 7.3.13.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/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_revno; $wppa_revno = '7313'; // WPPA db version
27
+ global $wppa_api_version; $wppa_api_version = '7.3.13.009'; // WPPA software version
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';