WP Photo Album Plus - Version 6.6.11

Version Description

Download this release

Release Info

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

Code changes from version 6.6.10 to 6.6.11

js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 6.6.10
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -2310,4 +2310,27 @@ function wppaDismissAdminNotice(notice, elm) {
2310
  wppaAjaxUpdateOptionCheckBox(notice, elm);
2311
  jQuery('#wppa-wr-').css('display','none');
2312
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2313
  }
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 6.6.11
5
  /* Various js routines used in admin pages
6
  */
7
 
2310
  wppaAjaxUpdateOptionCheckBox(notice, elm);
2311
  jQuery('#wppa-wr-').css('display','none');
2312
 
2313
+ }
2314
+
2315
+ function wppaAjaxUpdateTogo(slug) {
2316
+ jQuery.ajax( { url: wppaAjaxUrl,
2317
+ data: 'action=wppa' +
2318
+ '&wppa-action=gettogo' +
2319
+ '&slug=' + slug,
2320
+ async: true,
2321
+ type: 'GET',
2322
+ timeout: 100000,
2323
+ beforesend: function( xhr ) {
2324
+ },
2325
+ success: function( result, status, xhr ) {
2326
+ var data = result.split('|');
2327
+ jQuery( '#' + slug + '_togo' ).html( data[0] );
2328
+ jQuery( '#' + slug + '_status' ).html( data[1] );
2329
+ setTimeout( function() {wppaAjaxUpdateTogo(slug);}, 5000 );
2330
+ },
2331
+ error: function( xhr ) {
2332
+ },
2333
+ complete: function( xhr ) {
2334
+ }
2335
+ } );
2336
  }
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, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
5
- Version: 6.6.10
6
- Stable tag: 6.6.09
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -180,6 +180,28 @@ Oh, just Google on 'picture resizer' and you will find a bunch of free programs
180
 
181
  See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  = 6.6.10 =
184
 
185
  = Bug Fixes =
@@ -188,7 +210,7 @@ See for additional information: <a href="http://www.wppa.nl/changelog/" >The doc
188
 
189
  = New Features =
190
 
191
- * New shortcode attribute: alt="...". The alt attrinute may conatin an existing photo id number.
192
  In case the shortcode can not be rendered, you used to see the 'placeholder' [WPPA+ Photo display (fsh)].
193
  In some circumstances this is not due to a configuration issue, but you can e.g. have plugin AMP installed and AMP applies to the content.
194
  When the alt attribute is added to the shortcode, a plain photo will be displayed. If you do not want anything to be displayed (no photo and no errormessage)
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, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
5
+ Version: 6.6.11
6
+ Stable tag: 6.6.11
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
180
 
181
  See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
182
 
183
+ = 6.6.11 =
184
+
185
+ = Bug Fixes =
186
+
187
+ * Adjusted the calculation for the size of the thumbnail image files to take into account when responsive cover images are used.
188
+ * Responsive cover images not always worked. Fixed.
189
+ * When VII-B-12 (Fe alert) was unchecked and the fe upload is blogged, the redirect to the blog post failed. Fixed.
190
+ * Max one alertbox on fe upload/blog. Select when in Table VII-B12.
191
+ * Fixed a possible errormessage on fe delete photo.
192
+
193
+ = New Features =
194
+
195
+ * Table VIII-B12.2 Add HD tags. All photoa that are available in resolution >= 1920 x 1080 px get tag HD.
196
+ * Albums can have their own watermark settings. New uploaded photos will have that watermark in stead of the system default as specified in Table IX-F.
197
+
198
+ = Other Changes =
199
+
200
+ * You can disable the shortcode generator in Table IX-B19 for users who are neither administrator nor wppa superuser.
201
+ * Tags GPX and HD will always be in capital letters. Existing tags can be fixed using Table VIII-B16 Fix Tags.
202
+ * The caching of wppa options has been removed to avoid problems on systems that do not allow db fields > 64kB.
203
+ * The togo-field of running cron jobs (Table VIII) is now being updated every 5 seconds.
204
+
205
  = 6.6.10 =
206
 
207
  = Bug Fixes =
210
 
211
  = New Features =
212
 
213
+ * New shortcode attribute: alt="...". The alt attrinute may conatin an existing photo id number.
214
  In case the shortcode can not be rendered, you used to see the 'placeholder' [WPPA+ Photo display (fsh)].
215
  In some circumstances this is not due to a configuration issue, but you can e.g. have plugin AMP installed and AMP applies to the content.
216
  When the alt attribute is added to the shortcode, a plain photo will be displayed. If you do not want anything to be displayed (no photo and no errormessage)
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 6.6.10
6
  *
7
  */
8
 
@@ -49,6 +49,14 @@ global $wppa_log_file;
49
  $wppa_action = $_REQUEST['wppa-action'];
50
 
51
  switch ( $wppa_action ) {
 
 
 
 
 
 
 
 
52
  case 'getssiptclist':
53
  $tag = str_replace( 'H', '#', $_REQUEST['tag'] );
54
  $mocc = $_REQUEST['moccur'];
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 6.6.11
6
  *
7
  */
8
 
49
  $wppa_action = $_REQUEST['wppa-action'];
50
 
51
  switch ( $wppa_action ) {
52
+ case 'gettogo':
53
+ $slug = strip_tags( $_REQUEST['slug'] );
54
+ $result = get_option( $slug . '_togo', '' ) .
55
+ '|' .
56
+ get_option( $slug . '_status', '' );
57
+ echo $result;
58
+ wppa_exit();
59
+ break;
60
  case 'getssiptclist':
61
  $tag = str_replace( 'H', '#', $_REQUEST['tag'] );
62
  $mocc = $_REQUEST['moccur'];
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 6.6.09
7
  *
8
  */
9
 
@@ -599,6 +599,28 @@ function wppaTryScheduleAll( id ) {
599
  echo '. ';
600
  }
601
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  // Status
603
  echo '<br />' .
604
  __( 'Remark:', 'wp-photo-album-plus' ) . ' ' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 6.6.11
7
  *
8
  */
9
 
599
  echo '. ';
600
  }
601
 
602
+ // Watermark
603
+ if ( wppa_switch( 'watermark_on' ) ) {
604
+
605
+ // Newline
606
+ echo '<br />';
607
+
608
+ echo
609
+ __( 'Watermark file:', 'wp-photo-album-plus' ) .
610
+ '<select' .
611
+ ' onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmfile\', this )"' .
612
+ ' >' .
613
+ wppa_watermark_file_select( 'album', $id ) .
614
+ '</select>' .
615
+ ' ' .
616
+ __( 'Watermark pos:', 'wp-photo-album-plus' ) .
617
+ '<select' .
618
+ ' onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmpos\', this )"' .
619
+ ' >' .
620
+ wppa_watermark_pos_select( 'album', $id ) .
621
+ '</select>';
622
+ }
623
+
624
  // Status
625
  echo '<br />' .
626
  __( 'Remark:', 'wp-photo-album-plus' ) . ' ' .
wppa-album-covers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
- * Version 6.6.10
7
  *
8
  */
9
 
@@ -963,18 +963,32 @@ global $wpdb;
963
  // A video?
964
  if ( wppa_is_video( $image['id'] ) ) {
965
  wppa_out(
966
- '<video preload="metadata" title="' . $title . '" class="image wppa-img" width="' . $imgwidth . '" height="' .
967
- $imgheight . '" style="' . __wcs( 'wppa-img' ) . $imgattr . '" ' . $events . ' >' .
968
- wppa_get_video_body( $image['id'] ) . '</video>'
 
 
 
 
 
 
 
 
969
  );
970
  }
971
 
972
  // A photo
973
  else {
974
  wppa_out(
975
- '<img src="' . $src . '" ' . wppa_get_imgalt( $image['id'] ) . ' class="image wppa-img" width="' .
976
- $imgwidth . '" height="' . $imgheight . '" style="' . __wcs( 'wppa-img' ) .
977
- $imgattr . '" ' . $events . ' />'
 
 
 
 
 
 
978
  );
979
  }
980
  wppa_out( '</a>' );
@@ -987,18 +1001,31 @@ global $wpdb;
987
  // A video?
988
  if ( wppa_is_video( $image['id'] ) ) {
989
  wppa_out(
990
- '<video preload="metadata" class="image wppa-img" width="' . $imgwidth . '" height="' .
991
- $imgheight . '" style="' . __wcs( 'wppa-img' ) . $imgattr . '" ' . $events . ' >' .
992
- wppa_get_video_body( $image['id'] ) . '</video>'
 
 
 
 
 
 
 
993
  );
994
  }
995
 
996
  // A photo
997
  else {
998
  wppa_out(
999
- '<img src="' . $src . '" ' . wppa_get_imgalt( $image['id'] ) . ' class="image wppa-img" width="' .
1000
- $imgwidth . '" height="' . $imgheight . '" style="' . __wcs( 'wppa-img' ) .
1001
- $imgattr . '" ' . $events . ' />'
 
 
 
 
 
 
1002
  );
1003
  }
1004
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 6.6.11
7
  *
8
  */
9
 
963
  // A video?
964
  if ( wppa_is_video( $image['id'] ) ) {
965
  wppa_out(
966
+ '<video' .
967
+ ' preload="metadata"' .
968
+ ' title="' . $title . '"' .
969
+ ' class="image wppa-img"' .
970
+ // ' width="' . $imgwidth . '"' .
971
+ // ' height="' . $imgheight . '"' .
972
+ ' style="' . __wcs( 'wppa-img' ) . $imgattr . '"' .
973
+ ' ' . $events .
974
+ ' >' .
975
+ wppa_get_video_body( $image['id'] ) .
976
+ '</video>'
977
  );
978
  }
979
 
980
  // A photo
981
  else {
982
  wppa_out(
983
+ '<img' .
984
+ ' src="' . $src . '"' .
985
+ ' ' . wppa_get_imgalt( $image['id'] ) .
986
+ ' class="image wppa-img"' .
987
+ // ' width="' . $imgwidth . '"' .
988
+ // ' height="' . $imgheight . '"' .
989
+ ' style="' . __wcs( 'wppa-img' ) . $imgattr . '"' .
990
+ ' ' . $events .
991
+ ' />'
992
  );
993
  }
994
  wppa_out( '</a>' );
1001
  // A video?
1002
  if ( wppa_is_video( $image['id'] ) ) {
1003
  wppa_out(
1004
+ '<video' .
1005
+ ' preload="metadata"' .
1006
+ ' class="image wppa-img"' .
1007
+ // ' width="' . $imgwidth . '"' .
1008
+ // ' height="' . $imgheight . '"' .
1009
+ ' style="' . __wcs( 'wppa-img' ) . $imgattr . '"' .
1010
+ ' ' . $events .
1011
+ ' >' .
1012
+ wppa_get_video_body( $image['id'] ) .
1013
+ '</video>'
1014
  );
1015
  }
1016
 
1017
  // A photo
1018
  else {
1019
  wppa_out(
1020
+ '<img' .
1021
+ ' src="' . $src . '"' .
1022
+ ' ' . wppa_get_imgalt( $image['id'] ) .
1023
+ ' class="image wppa-img"' .
1024
+ // ' width="' . $imgwidth . '"' .
1025
+ // ' height="' . $imgheight . '"' .
1026
+ ' style="' . __wcs( 'wppa-img' ) . $imgattr . '"' .
1027
+ ' ' . $events .
1028
+ ' />'
1029
  );
1030
  }
1031
  }
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 6.6.09
7
  *
8
  */
9
 
@@ -2505,7 +2505,7 @@ static $albums_granted;
2505
  ' name="wppa-watermark-file"' .
2506
  ' id="wppa-watermark-file"' .
2507
  ' >' .
2508
- wppa_watermark_file_select() .
2509
  '</select>' .
2510
  '</td>' .
2511
  '</tr>' .
@@ -2526,7 +2526,7 @@ static $albums_granted;
2526
  ' name="wppa-watermark-pos"' .
2527
  ' id="wppa-watermark-pos"' .
2528
  ' >' .
2529
- wppa_watermark_pos_select() .
2530
  '</select>' .
2531
  '</td>' .
2532
  '</tr>' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 6.6.11
7
  *
8
  */
9
 
2505
  ' name="wppa-watermark-file"' .
2506
  ' id="wppa-watermark-file"' .
2507
  ' >' .
2508
+ wppa_watermark_file_select( 'user' ) .
2509
  '</select>' .
2510
  '</td>' .
2511
  '</tr>' .
2526
  ' name="wppa-watermark-pos"' .
2527
  ' id="wppa-watermark-pos"' .
2528
  ' >' .
2529
+ wppa_watermark_pos_select( 'user' ) .
2530
  '</select>' .
2531
  '</td>' .
2532
  '</tr>' .
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 6.6.10
6
  *
7
  */
8
 
@@ -23,10 +23,10 @@ global $wppa_defaults;
23
  if ( $force ) {
24
  $wppa = false; // destroy existing arrays
25
  $wppa_opt = false;
26
- delete_option( 'wppa_cached_options' );
27
  }
28
 
29
- if ( is_array( $wppa ) && ! $force ) {
30
  return; // Done already
31
  }
32
 
@@ -34,6 +34,7 @@ global $wppa_defaults;
34
  wppa_reset_occurrance();
35
  }
36
 
 
37
  // Get the cache version of all settings
38
  $wppa_opt = get_option( 'wppa_cached_options', false );
39
 
@@ -63,6 +64,7 @@ global $wppa_defaults;
63
  $wppa_opt = false;
64
  }
65
  }
 
66
 
67
  // Rebuild cached options if required, i.e. when not yet existing or deleted.
68
  if ( ! is_array( $wppa_opt ) ) {
@@ -70,10 +72,15 @@ global $wppa_defaults;
70
  $wppa_opt = $wppa_defaults;
71
  foreach ( array_keys( $wppa_opt ) as $option ) {
72
  $optval = get_option( $option, 'nil' );
73
- if ( $optval !== 'nil' ) {
 
 
 
74
  $wppa_opt[$option] = $optval;
75
  }
76
  }
 
 
77
  update_option( 'wppa_cached_options', $wppa_opt, true );
78
  update_option( 'wppa_md5_options', md5( serialize( $wppa_opt ) ), true );
79
 
@@ -83,6 +90,7 @@ global $wppa_defaults;
83
  if ( md5( serialize( $temp ) ) != $hash ) {
84
  wppa_log( 'Err', 'Discrepancy found. Count='.count($temp) );
85
  }
 
86
  }
87
 
88
  if ( isset( $_GET['debug'] ) && wppa_switch( 'allow_debug' ) ) {
@@ -777,14 +785,26 @@ function wppa_get_minisize() {
777
  'album_widget_size',
778
  'featen_size',
779
  'popupsize',
780
- 'smallsize',
781
  'film_thumbsize',
782
  );
783
 
784
  // Find the max
785
  foreach ( $things as $thing ) {
786
  $tmp = wppa_opt( $thing );
787
- if ( is_numeric( $tmp ) && $tmp > $result ) $result = $tmp;
 
 
 
 
 
 
 
 
 
 
 
 
 
788
  }
789
 
790
  // Optionally correct for 'size=height' for album cover images
@@ -1222,7 +1242,7 @@ function wppa_tree_empty( $dir ) {
1222
  if ( $name == '.' || $name == '..' ) {}
1223
  elseif ( is_dir( $file ) ) {
1224
  wppa_tree_empty( $file );
1225
- @ unlink( $file );
1226
  }
1227
  else @ unlink( $file );
1228
  }
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 6.6.11
6
  *
7
  */
8
 
23
  if ( $force ) {
24
  $wppa = false; // destroy existing arrays
25
  $wppa_opt = false;
26
+ // delete_option( 'wppa_cached_options' );
27
  }
28
 
29
+ if ( is_array( $wppa ) && is_array( $wppa_opt ) && ! $force ) {
30
  return; // Done already
31
  }
32
 
34
  wppa_reset_occurrance();
35
  }
36
 
37
+ /* Caching disabled due to MySql versions that do not allow fields > 64 kB
38
  // Get the cache version of all settings
39
  $wppa_opt = get_option( 'wppa_cached_options', false );
40
 
64
  $wppa_opt = false;
65
  }
66
  }
67
+ */
68
 
69
  // Rebuild cached options if required, i.e. when not yet existing or deleted.
70
  if ( ! is_array( $wppa_opt ) ) {
72
  $wppa_opt = $wppa_defaults;
73
  foreach ( array_keys( $wppa_opt ) as $option ) {
74
  $optval = get_option( $option, 'nil' );
75
+ if ( $optval == 'nil' ) {
76
+ update_option( $option, $wppa_defaults[$option] );
77
+ }
78
+ else {
79
  $wppa_opt[$option] = $optval;
80
  }
81
  }
82
+
83
+ /*
84
  update_option( 'wppa_cached_options', $wppa_opt, true );
85
  update_option( 'wppa_md5_options', md5( serialize( $wppa_opt ) ), true );
86
 
90
  if ( md5( serialize( $temp ) ) != $hash ) {
91
  wppa_log( 'Err', 'Discrepancy found. Count='.count($temp) );
92
  }
93
+ */
94
  }
95
 
96
  if ( isset( $_GET['debug'] ) && wppa_switch( 'allow_debug' ) ) {
785
  'album_widget_size',
786
  'featen_size',
787
  'popupsize',
 
788
  'film_thumbsize',
789
  );
790
 
791
  // Find the max
792
  foreach ( $things as $thing ) {
793
  $tmp = wppa_opt( $thing );
794
+ if ( is_numeric( $tmp ) && $tmp > $result ) {
795
+ $result = $tmp;
796
+ }
797
+ }
798
+
799
+ // Cover image size
800
+ if ( wppa_switch( 'coverphoto_responsive' ) ) {
801
+ $tmp = wppa_opt( 'smallsize_percentage' ) * wppa_opt( 'initial_colwidth' ) / 100;
802
+ }
803
+ else {
804
+ $tmp = wppa_opt( 'smallsize' );
805
+ }
806
+ if ( is_numeric( $tmp ) && $tmp > $result ) {
807
+ $result = $tmp;
808
  }
809
 
810
  // Optionally correct for 'size=height' for album cover images
1242
  if ( $name == '.' || $name == '..' ) {}
1243
  elseif ( is_dir( $file ) ) {
1244
  wppa_tree_empty( $file );
1245
+ // @ unlink( $file );
1246
  }
1247
  else @ unlink( $file );
1248
  }
wppa-cron.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
- * Version 6.6.09
7
  *
8
  *
9
  */
@@ -21,7 +21,7 @@ add_action( 'wppa_cron_event', 'wppa_do_maintenance_proc', 10, 1 );
21
  function wppa_schedule_maintenance_proc( $slug, $first = false ) {
22
 
23
  // Schedule cron job
24
- wp_schedule_single_event( time() + ( $first ? 10 : 120 ), 'wppa_cron_event', array( $slug ) );
25
 
26
  // Update appropriate options
27
  update_option( $slug . '_status', 'Scheduled cron job' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
+ * Version 6.6.11
7
  *
8
  *
9
  */
21
  function wppa_schedule_maintenance_proc( $slug, $first = false ) {
22
 
23
  // Schedule cron job
24
+ wp_schedule_single_event( time() + ( $first ? 10 : 30 ), 'wppa_cron_event', array( $slug ) );
25
 
26
  // Update appropriate options
27
  update_option( $slug . '_status', 'Scheduled cron job' );
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version 6.6.10
7
  *
8
  */
9
 
@@ -71,6 +71,12 @@ global $wppa_revno;
71
  // Whatever is entered between [wppa ...] and [/wppa]
72
  $wppa['shortcode_content'] = $content;
73
 
 
 
 
 
 
 
74
  // Find type
75
  switch ( $atts['type'] ) {
76
  case 'version':
@@ -416,7 +422,8 @@ global $wppa_opt;
416
 
417
  // Reset?
418
  elseif ( ! $atts['name'] ) {
419
- $wppa_opt = get_option( 'wppa_cached_options', false );
 
420
  wppa_reset_occurrance();
421
  }
422
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 6.6.11
7
  *
8
  */
9
 
71
  // Whatever is entered between [wppa ...] and [/wppa]
72
  $wppa['shortcode_content'] = $content;
73
 
74
+ // Check for inconsistency
75
+ if ( $atts['alt'] && wppa_switch( 'render_shortcode_always' ) ) {
76
+ wppa_dbg_msg( 'ERROR! Either untick Table IV-A8: Render shortcode always, or remove the alt="'.$atts['alt'].'" attribute from the shortcode on this page/post', 'red', 'force' );
77
+ return '';
78
+ }
79
+
80
  // Find type
81
  switch ( $atts['type'] ) {
82
  case 'version':
422
 
423
  // Reset?
424
  elseif ( ! $atts['name'] ) {
425
+ $wppa_opt = false;
426
+ wppa_initialize_runtime();
427
  wppa_reset_occurrance();
428
  }
429
 
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 6.6.10
7
  *
8
  */
9
 
@@ -4084,11 +4084,13 @@ global $allalbums;
4084
  function wppa_user_upload() {
4085
  global $wpdb;
4086
  static $done;
 
4087
 
4088
  wppa_dbg_msg( 'Usr_upl entered' );
4089
 
4090
  if ( $done ) return; // Already done
4091
  $done = true; // Mark as done
 
4092
 
4093
  // Upload possible?
4094
  $may_upload = wppa_switch( 'user_upload_on' );
@@ -4139,7 +4141,7 @@ static $done;
4139
  'owner' => wppa_switch( 'frontend_album_public' ) ? '--- public ---' : wppa_get_user()
4140
  ) );
4141
  if ( $album ) {
4142
- if ( wppa_switch( 'fe_alert' ) ) {
4143
  wppa_alert( sprintf( __( 'Album #%s created' , 'wp-photo-album-plus'), $album ) );
4144
  }
4145
  wppa_invalidate_treecounts( $parent );
@@ -4164,7 +4166,7 @@ static $done;
4164
  $alb = wppa_get_post( 'wppa-upload-album' );
4165
  $alb = strval( intval( $alb ) ); // Force numeric
4166
  if ( ! wppa_album_exists( $alb ) ) {
4167
- $alert = sprintf( __( 'Album %s does not exist', 'wp-photo-album-plus' ), $alb );
4168
  wppa_alert( $alert );
4169
  return;
4170
  }
@@ -4207,9 +4209,11 @@ static $done;
4207
  }
4208
  }
4209
  $points = '0';
4210
- $alert = '';
4211
  $reload = wppa_switch( 'home_after_upload' ) && $done ? 'home' : false;
4212
 
 
 
 
4213
  if ( $done ) {
4214
 
4215
  // SUCCESSFUL UPLOAD, Blog It?
@@ -4238,43 +4242,57 @@ static $done;
4238
  }
4239
  }
4240
 
 
 
 
 
 
4241
  // ADD POINTS
4242
  $points = wppa_opt( 'cp_points_upload' ) * $done;
4243
  $bret = wppa_add_credit_points( $points, __( 'Photo upload' ,'wp-photo-album-plus' ) );
4244
- $alert .= sprintf( _n( '%d photo successfully uploaded', '%d photos successfully uploaded', $done, 'wp-photo-album-plus' ), $done );
4245
- if ( $bret ) $alert .= ' ' . sprintf( __( '%s points added' ,'wp-photo-album-plus'), $points );
4246
- if ( wppa_switch( 'fe_alert' ) ) {
4247
- wppa_alert( $alert, $reload );
4248
- }
4249
- else {
4250
- wppa_alert( '', $reload );
4251
- }
4252
 
4253
- // Blogged?
4254
- if ( $blogged ) {
 
 
4255
 
4256
- if ( wppa_switch( 'fe_alert' ) ) {
4257
- if ( $status == 'pending' ) {
4258
- wppa_alert( __( 'Your post is awaiting moderation.', 'wp-photo-album-plus' ) );
4259
- }
4260
- else {
4261
- wppa_alert( __( 'Your post is published.', 'wp-photo-album-plus' ) );
4262
- }
4263
  }
4264
- echo '<script type="text/javascript" >setTimeout( function() { document.location.href=\'' . get_permalink( $post_id ) . '\'; }, 2000 )</script>';
4265
- return;
4266
- // wppa_exit();
4267
  }
4268
  }
 
 
4269
  if ( $fail ) {
4270
  if ( ! $done ) {
4271
- $alert .= __( 'Upload failed' , 'wp-photo-album-plus');
4272
  }
4273
  else {
4274
- $alert .= sprintf( _n( '%d upload failed', '%d uploads failed', $fail, 'wp-photo-album-plus' ), $fail );
4275
  }
 
 
 
 
 
 
 
 
4276
  wppa_alert( $alert, $reload );
4277
  }
 
 
 
 
 
 
 
 
4278
  }
4279
  }
4280
  }
@@ -4285,7 +4303,7 @@ static $done;
4285
  if ( wppa_get_post( 'wppa-albumeditsubmit' ) ) {
4286
 
4287
  // Get album id
4288
- $alb = wppa_get_post( 'wppa-albumeditid' );
4289
  if ( ! $alb || ! wppa_album_exists( $alb ) ) {
4290
  die( 'Security check failure' );
4291
  }
@@ -4338,21 +4356,22 @@ function wppa_do_frontend_file_upload( $file, $alb ) {
4338
  global $wpdb;
4339
  global $wppa_supported_video_extensions;
4340
  global $wppa_supported_audio_extensions;
 
4341
 
4342
  // Log upload attempt
4343
- wppa_log( 'Upl', 'FE Upload attempt of file '.$file['name'].', size='.filesize($file['tmp_name']) );
4344
 
4345
  $album = wppa_cache_album( $alb );
4346
 
4347
  // Legal here?
4348
  if ( ! wppa_allow_uploads( $alb ) || ! wppa_allow_user_uploads() ) {
4349
- wppa_alert( __( 'Max uploads reached' , 'wp-photo-album-plus') );
4350
  return false;
4351
  }
4352
 
4353
  // No error during upload?
4354
  if ( $file['error'] != '0' ) {
4355
- wppa_alert( __( 'Error during upload' , 'wp-photo-album-plus') );
4356
  return false;
4357
  }
4358
 
@@ -4408,7 +4427,7 @@ global $wppa_supported_audio_extensions;
4408
  ) );
4409
 
4410
  if ( ! $id ) {
4411
- wppa_alert( __( 'Could not insert media into db.' , 'wp-photo-album-plus') );
4412
  return false;
4413
  }
4414
  }
@@ -4448,13 +4467,13 @@ global $wppa_supported_audio_extensions;
4448
  // Is it an image?
4449
  $imgsize = getimagesize( $file['tmp_name'] );
4450
  if ( !is_array( $imgsize ) ) {
4451
- wppa_alert( __( 'Uploaded file is not an image' , 'wp-photo-album-plus') );
4452
  return false;
4453
  }
4454
 
4455
  // Is it a supported image filetype?
4456
  if ( $imgsize[2] != IMAGETYPE_GIF && $imgsize[2] != IMAGETYPE_JPEG && $imgsize[2] != IMAGETYPE_PNG ) {
4457
- wppa_alert( sprintf( __( 'Only gif, jpg and png image files are supported. Returned info = %s.' , 'wp-photo-album-plus'), wppa_serialize( $imgsize ) ), false, false );
4458
  return false;
4459
  }
4460
 
@@ -4462,7 +4481,7 @@ global $wppa_supported_audio_extensions;
4462
  $ms = wppa_opt( 'upload_fronend_maxsize' );
4463
  if ( $ms ) { // Max size configured
4464
  if ( $imgsize[0] > $ms || $imgsize[1] > $ms ) {
4465
- wppa_alert( sprintf( __( 'Uploaded file is larger than the allowed maximum of %d x %d pixels.' , 'wp-photo-album-plus'), $ms, $ms ) );
4466
  return false;
4467
  }
4468
  }
@@ -4470,7 +4489,7 @@ global $wppa_supported_audio_extensions;
4470
  // Check for already exists
4471
  if ( wppa_switch( 'void_dups' ) ) {
4472
  if ( wppa_file_is_in_album( wppa_sanitize_file_name( $file['name'] ), $alb ) ) {
4473
- wppa_alert( sprintf( __( 'Uploaded file %s already exists in this album.' , 'wp-photo-album-plus'), wppa_sanitize_file_name( $file['name'] ) ) );
4474
  return false;
4475
  }
4476
  }
@@ -4480,7 +4499,7 @@ global $wppa_supported_audio_extensions;
4480
  if ( $mayupload === false ) {
4481
  $maxsize = wppa_check_memory_limit( false );
4482
  if ( is_array( $maxsize ) ) {
4483
- wppa_alert( sprintf( __( 'The image is too big. Max photo size: %d x %d (%2.1f MegaPixel)' , 'wp-photo-album-plus'), $maxsize['maxx'], $maxsize['maxy'], $maxsize['maxp']/( 1024*1024 ) ) );
4484
  return false;
4485
  }
4486
  }
@@ -4523,7 +4542,7 @@ global $wppa_supported_audio_extensions;
4523
  }
4524
 
4525
  if ( ! $id ) {
4526
- wppa_alert( __( 'Could not insert photo into db.' , 'wp-photo-album-plus') );
4527
  return false;
4528
  }
4529
  else {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 6.6.11
7
  *
8
  */
9
 
4084
  function wppa_user_upload() {
4085
  global $wpdb;
4086
  static $done;
4087
+ global $wppa_alert;
4088
 
4089
  wppa_dbg_msg( 'Usr_upl entered' );
4090
 
4091
  if ( $done ) return; // Already done
4092
  $done = true; // Mark as done
4093
+ $wppa_alert = '';
4094
 
4095
  // Upload possible?
4096
  $may_upload = wppa_switch( 'user_upload_on' );
4141
  'owner' => wppa_switch( 'frontend_album_public' ) ? '--- public ---' : wppa_get_user()
4142
  ) );
4143
  if ( $album ) {
4144
+ if ( wppa_opt( 'fe_alert' ) == 'upcre' || wppa_opt( 'fe_alert' ) == 'all' ) {
4145
  wppa_alert( sprintf( __( 'Album #%s created' , 'wp-photo-album-plus'), $album ) );
4146
  }
4147
  wppa_invalidate_treecounts( $parent );
4166
  $alb = wppa_get_post( 'wppa-upload-album' );
4167
  $alb = strval( intval( $alb ) ); // Force numeric
4168
  if ( ! wppa_album_exists( $alb ) ) {
4169
+ $alert = esc_js( sprintf( __( 'Album %s does not exist', 'wp-photo-album-plus' ), $alb ) );
4170
  wppa_alert( $alert );
4171
  return;
4172
  }
4209
  }
4210
  }
4211
  $points = '0';
 
4212
  $reload = wppa_switch( 'home_after_upload' ) && $done ? 'home' : false;
4213
 
4214
+ // Init alert text with possible results from wppa_do_frontend_file_upload()
4215
+ $alert = $wppa_alert;
4216
+
4217
  if ( $done ) {
4218
 
4219
  // SUCCESSFUL UPLOAD, Blog It?
4242
  }
4243
  }
4244
 
4245
+ // Alert text for upload
4246
+ if ( wppa_opt( 'fe_alert' ) == 'upcre' || wppa_opt( 'fe_alert' ) == 'all' ) {
4247
+ $alert .= ' ' . esc_js( sprintf( _n( '%d photo successfully uploaded', '%d photos successfully uploaded', $done, 'wp-photo-album-plus' ), $done ) ) . '.';
4248
+ }
4249
+
4250
  // ADD POINTS
4251
  $points = wppa_opt( 'cp_points_upload' ) * $done;
4252
  $bret = wppa_add_credit_points( $points, __( 'Photo upload' ,'wp-photo-album-plus' ) );
 
 
 
 
 
 
 
 
4253
 
4254
+ // Alert text for points
4255
+ if ( $bret && wppa_opt( 'fe_alert' ) != '-none-' ) {
4256
+ $alert .= ' ' . esc_js( sprintf( __( '%s points added' ,'wp-photo-album-plus' ), $points ) ) . '.';
4257
+ }
4258
 
4259
+ // Alert text for blogged
4260
+ if ( $blogged && ( wppa_opt( 'fe_alert' ) == 'blog' || wppa_opt( 'fe_alert' ) == 'all' ) ) {
4261
+ if ( $status == 'pending' ) {
4262
+ $alert .= ' ' . esc_js( __( 'Your post is awaiting moderation.', 'wp-photo-album-plus' ) );
4263
+ }
4264
+ else {
4265
+ $alert .= ' ' . esc_js( __( 'Your post is published.', 'wp-photo-album-plus' ) );
4266
  }
 
 
 
4267
  }
4268
  }
4269
+
4270
+ // Alert text for failed upload
4271
  if ( $fail ) {
4272
  if ( ! $done ) {
4273
+ $alert .= ' ' . __( 'Upload failed', 'wp-photo-album-plus' ) . '.';
4274
  }
4275
  else {
4276
+ $alert .= ' ' . sprintf( _n( '%d upload failed', '%d uploads failed', $fail, 'wp-photo-album-plus' ), $fail ) . '.';
4277
  }
4278
+
4279
+ }
4280
+
4281
+ // Clean alert text
4282
+ $alert = trim( $alert );
4283
+
4284
+ // Alert only when requested or fail
4285
+ if ( wppa_opt( 'fe_alert' ) != '-none-' || $fail ) {
4286
  wppa_alert( $alert, $reload );
4287
  }
4288
+ elseif( ! $blogged ) {
4289
+ wppa_alert( '', $reload );
4290
+ }
4291
+
4292
+ // Redirect to blogpost
4293
+ if ( $blogged ) {
4294
+ wppa_out( '<script type="text/javascript" >setTimeout( function() { document.location.href=\'' . get_permalink( $post_id ) . '\'; }, 2000 )</script>' );
4295
+ }
4296
  }
4297
  }
4298
  }
4303
  if ( wppa_get_post( 'wppa-albumeditsubmit' ) ) {
4304
 
4305
  // Get album id
4306
+ $alb = wppa_get_post( 'wppa-albumeditid' );
4307
  if ( ! $alb || ! wppa_album_exists( $alb ) ) {
4308
  die( 'Security check failure' );
4309
  }
4356
  global $wpdb;
4357
  global $wppa_supported_video_extensions;
4358
  global $wppa_supported_audio_extensions;
4359
+ global $wppa_alert;
4360
 
4361
  // Log upload attempt
4362
+ wppa_log( 'Upl', 'FE Upload attempt of file ' . $file['name'] . ', size=' . filesize( $file['tmp_name'] ) );
4363
 
4364
  $album = wppa_cache_album( $alb );
4365
 
4366
  // Legal here?
4367
  if ( ! wppa_allow_uploads( $alb ) || ! wppa_allow_user_uploads() ) {
4368
+ $wppa_alert .= esc_js( __( 'Max uploads reached' , 'wp-photo-album-plus') ) . '.';
4369
  return false;
4370
  }
4371
 
4372
  // No error during upload?
4373
  if ( $file['error'] != '0' ) {
4374
+ $wppa_alert .= esc_js( __( 'Error during upload' , 'wp-photo-album-plus') ) . '.';
4375
  return false;
4376
  }
4377
 
4427
  ) );
4428
 
4429
  if ( ! $id ) {
4430
+ $wppa_alert .= esc_js( __( 'Could not insert media into db.', 'wp-photo-album-plus' ) );
4431
  return false;
4432
  }
4433
  }
4467
  // Is it an image?
4468
  $imgsize = getimagesize( $file['tmp_name'] );
4469
  if ( !is_array( $imgsize ) ) {
4470
+ $wppa_alert .= esc_js( __( 'Uploaded file is not an image' , 'wp-photo-album-plus') ) . '.';
4471
  return false;
4472
  }
4473
 
4474
  // Is it a supported image filetype?
4475
  if ( $imgsize[2] != IMAGETYPE_GIF && $imgsize[2] != IMAGETYPE_JPEG && $imgsize[2] != IMAGETYPE_PNG ) {
4476
+ $wppa_alert .= esc_js( sprintf( __( 'Only gif, jpg and png image files are supported. Returned info = %s.' , 'wp-photo-album-plus'), wppa_serialize( $imgsize ) ), false, false );
4477
  return false;
4478
  }
4479
 
4481
  $ms = wppa_opt( 'upload_fronend_maxsize' );
4482
  if ( $ms ) { // Max size configured
4483
  if ( $imgsize[0] > $ms || $imgsize[1] > $ms ) {
4484
+ $wppa_alert .= esc_js( sprintf( __( 'Uploaded file is larger than the allowed maximum of %d x %d pixels.' , 'wp-photo-album-plus'), $ms, $ms ) );
4485
  return false;
4486
  }
4487
  }
4489
  // Check for already exists
4490
  if ( wppa_switch( 'void_dups' ) ) {
4491
  if ( wppa_file_is_in_album( wppa_sanitize_file_name( $file['name'] ), $alb ) ) {
4492
+ $wppa_alert .= esc_js( sprintf( __( 'Uploaded file %s already exists in this album.' , 'wp-photo-album-plus'), wppa_sanitize_file_name( $file['name'] ) ) );
4493
  return false;
4494
  }
4495
  }
4499
  if ( $mayupload === false ) {
4500
  $maxsize = wppa_check_memory_limit( false );
4501
  if ( is_array( $maxsize ) ) {
4502
+ $wppa_alert .= esc_js( sprintf( __( 'The image is too big. Max photo size: %d x %d (%2.1f MegaPixel)' , 'wp-photo-album-plus'), $maxsize['maxx'], $maxsize['maxy'], $maxsize['maxp']/( 1024*1024 ) ) );
4503
  return false;
4504
  }
4505
  }
4542
  }
4543
 
4544
  if ( ! $id ) {
4545
+ $wppa_alert .= esc_js( __( 'Could not insert photo into db.' , 'wp-photo-album-plus') );
4546
  return false;
4547
  }
4548
  else {
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 6.6.09
7
  *
8
  */
9
 
@@ -560,11 +560,11 @@ global $wppa_session;
560
  '<p>' .
561
  __( 'Apply watermark file:', 'wp-photo-album-plus') .
562
  '<select name="wppa-watermark-file" id="wppa-watermark-file" >' .
563
- wppa_watermark_file_select() .
564
  '</select>' .
565
  __( 'Position:', 'wp-photo-album-plus') .
566
  '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' .
567
- wppa_watermark_pos_select() .
568
  '</select>' .
569
  '</p>';
570
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
+ * Version 6.6.11
7
  *
8
  */
9
 
560
  '<p>' .
561
  __( 'Apply watermark file:', 'wp-photo-album-plus') .
562
  '<select name="wppa-watermark-file" id="wppa-watermark-file" >' .
563
+ wppa_watermark_file_select( 'user' ) .
564
  '</select>' .
565
  __( 'Position:', 'wp-photo-album-plus') .
566
  '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' .
567
+ wppa_watermark_pos_select( 'user' ) .
568
  '</select>' .
569
  '</p>';
570
  }
wppa-init.php CHANGED
@@ -206,8 +206,8 @@ function wppa_verify_multisite_config() {
206
 
207
  function wppa_admin_bar_init() {
208
 
209
- if ( ( is_admin() && wppa_switch( 'adminbarmenu_admin') ) ||
210
- ( ! is_admin() && wppa_switch( 'adminbarmenu_frontend') ) ) {
211
 
212
  if ( current_user_can('wppa_admin') ||
213
  current_user_can('wppa_upload') ||
206
 
207
  function wppa_admin_bar_init() {
208
 
209
+ if ( ( is_admin() && get_option( 'wppa_adminbarmenu_admin' ) == 'yes' ) ||
210
+ ( ! is_admin() && get_option( 'wppa_adminbarmenu_frontend' ) == 'yes' ) ) {
211
 
212
  if ( current_user_can('wppa_admin') ||
213
  current_user_can('wppa_upload') ||
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 6.6.09
7
  *
8
  */
9
 
@@ -49,6 +49,7 @@ global $wppa_supported_audio_extensions;
49
  'wppa_delete_all_autopages',
50
  'wppa_leading_zeros',
51
  'wppa_add_gpx_tag',
 
52
  'wppa_optimize_ewww',
53
  'wppa_comp_sizes',
54
  'wppa_edit_tag',
@@ -289,6 +290,7 @@ global $wppa_supported_audio_extensions;
289
  case 'wppa_delete_all_autopages':
290
  case 'wppa_leading_zeros':
291
  case 'wppa_add_gpx_tag':
 
292
  case 'wppa_optimize_ewww':
293
  case 'wppa_comp_sizes':
294
  case 'wppa_edit_tag':
@@ -579,7 +581,7 @@ global $wppa_supported_audio_extensions;
579
  break;
580
 
581
  case 'wppa_add_gpx_tag':
582
- $tags = $photo['tags'];
583
  $temp = explode( '/', $photo['location'] );
584
  if ( ! isset( $temp['2'] ) ) $temp['2'] = false;
585
  if ( ! isset( $temp['3'] ) ) $temp['3'] = false;
@@ -589,14 +591,19 @@ global $wppa_supported_audio_extensions;
589
  $lat = false;
590
  $lon = false;
591
  }
592
- if ( $photo['location'] && strpos( $tags, 'Gpx' ) === false && $lat && $lon ) { // Add it
593
- $tags = wppa_sanitize_tags( $tags . ',Gpx' );
594
  wppa_update_photo( array( 'id' => $photo['id'], 'tags' => $tags ) );
595
  wppa_index_update( 'photo', $photo['id'] );
596
  wppa_clear_taglist();
597
  }
598
- elseif ( strpos( $tags, 'Gpx' ) !== false && ! $lat && ! $lon ) { // Remove it
599
- $tags = wppa_sanitize_tags( str_replace( 'Gpx', '', $tags ) );
 
 
 
 
 
600
  wppa_update_photo( array( 'id' => $photo['id'], 'tags' => $tags ) );
601
  wppa_index_update( 'photo', $photo['id'] );
602
  wppa_clear_taglist();
@@ -678,9 +685,10 @@ global $wppa_supported_audio_extensions;
678
  break;
679
 
680
  case 'wppa_sanitize_tags':
681
- $tags = $photo['tags'];
682
- if ( $tags ) {
683
- wppa_update_photo( array( 'id' => $photo['id'], 'tags' => wppa_sanitize_tags( $tags ) ) );
 
684
  }
685
  break;
686
 
@@ -716,23 +724,63 @@ global $wppa_supported_audio_extensions;
716
  break;
717
 
718
  case 'wppa_test_proc':
 
719
  $tags = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  $albid = $photo['album'];
721
  $albnam = wppa_get_album_item( $albid, 'name' );
722
- $tags .= $albnam;
723
  while ( $albid > '0' ) {
724
  $albid = wppa_get_album_item( $albid, 'a_parent' );
725
  if ( $albid > '0' ) {
726
  $tags .= ',' . wppa_get_album_item( $albid, 'name' );
727
  }
728
  }
729
- wppa_update_photo( array( 'id' => $photo['id'], 'tags' => wppa_sanitize_tags( $tags ) ) );
 
 
 
 
 
 
 
 
730
  break;
731
 
732
  }
733
  // Test for timeout / ready
734
  $lastid = $id;
735
  update_option( $slug.'_last', $lastid );
 
 
 
 
 
 
 
 
 
 
 
 
736
  if ( time() > $endtime ) break; // Time out
737
  }
738
  else { // Nothing to do, Done anyway
@@ -890,6 +938,9 @@ global $wppa_supported_audio_extensions;
890
 
891
  if ( wppa_is_cron() ) {
892
  wppa_log( 'obs', $errtxt.'||'.$slug.'||'.$status.'||'.$togo.'||'.$reload );
 
 
 
893
  }
894
  return $errtxt.'||'.$slug.'||'.$status.'||'.$togo.'||'.$reload;
895
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 6.6.11
7
  *
8
  */
9
 
49
  'wppa_delete_all_autopages',
50
  'wppa_leading_zeros',
51
  'wppa_add_gpx_tag',
52
+ 'wppa_add_hd_tag',
53
  'wppa_optimize_ewww',
54
  'wppa_comp_sizes',
55
  'wppa_edit_tag',
290
  case 'wppa_delete_all_autopages':
291
  case 'wppa_leading_zeros':
292
  case 'wppa_add_gpx_tag':
293
+ case 'wppa_add_hd_tag':
294
  case 'wppa_optimize_ewww':
295
  case 'wppa_comp_sizes':
296
  case 'wppa_edit_tag':
581
  break;
582
 
583
  case 'wppa_add_gpx_tag':
584
+ $tags = wppa_sanitize_tags( $photo['tags'] );
585
  $temp = explode( '/', $photo['location'] );
586
  if ( ! isset( $temp['2'] ) ) $temp['2'] = false;
587
  if ( ! isset( $temp['3'] ) ) $temp['3'] = false;
591
  $lat = false;
592
  $lon = false;
593
  }
594
+ if ( $photo['location'] && $lat && $lon ) { // Add it
595
+ $tags = wppa_sanitize_tags( $tags . ',GPX' );
596
  wppa_update_photo( array( 'id' => $photo['id'], 'tags' => $tags ) );
597
  wppa_index_update( 'photo', $photo['id'] );
598
  wppa_clear_taglist();
599
  }
600
+ break;
601
+
602
+ case 'wppa_add_hd_tag':
603
+ $tags = wppa_sanitize_tags( $photo['tags'] );
604
+ $size = wppa_get_artmonkey_size_a( $photo['id'] );
605
+ if ( is_array( $size ) && $size['x'] >= 1920 && $size['y'] >= 1080 ) {
606
+ $tags = wppa_sanitize_tags( $tags . ',HD' );
607
  wppa_update_photo( array( 'id' => $photo['id'], 'tags' => $tags ) );
608
  wppa_index_update( 'photo', $photo['id'] );
609
  wppa_clear_taglist();
685
  break;
686
 
687
  case 'wppa_sanitize_tags':
688
+ $tags = wppa_sanitize_tags( $photo['tags'] );
689
+ // If raw data exists, update with sanitized data
690
+ if ( $photo['tags'] ) {
691
+ wppa_update_photo( array( 'id' => $photo['id'], 'tags' => $tags ) );
692
  }
693
  break;
694
 
724
  break;
725
 
726
  case 'wppa_test_proc':
727
+ $old_tags = $photo['tags'];
728
  $tags = '';
729
+ // Location
730
+ $temp = explode( '/', $photo['location'] );
731
+ if ( ! isset( $temp['2'] ) ) $temp['2'] = false;
732
+ if ( ! isset( $temp['3'] ) ) $temp['3'] = false;
733
+ $lat = $temp['2'];
734
+ $lon = $temp['3'];
735
+ if ( $lat < 0.01 && $lat > -0.01 && $lon < 0.01 && $lon > -0.01 ) {
736
+ $lat = false;
737
+ $lon = false;
738
+ }
739
+ if ( $photo['location'] && $lat && $lon ) {
740
+ $tags .= ',GPX';
741
+ }
742
+ // HD?
743
+ $size = wppa_get_artmonkey_size_a( $photo['id'] );
744
+ if ( is_array( $size ) && $size['x'] >= 1920 && $size['y'] >= 1080 ) {
745
+ $tags .= ',HD';
746
+ }
747
+ // Album names
748
  $albid = $photo['album'];
749
  $albnam = wppa_get_album_item( $albid, 'name' );
750
+ $tags .= ',' . $albnam;
751
  while ( $albid > '0' ) {
752
  $albid = wppa_get_album_item( $albid, 'a_parent' );
753
  if ( $albid > '0' ) {
754
  $tags .= ',' . wppa_get_album_item( $albid, 'name' );
755
  }
756
  }
757
+ $tags = wppa_sanitize_tags( $tags );
758
+
759
+ // Update only if new data differs from existing data
760
+ if ( $old_tags != $tags ) {
761
+ wppa_update_photo( array( 'id' => $photo['id'], 'tags' => $tags ) );
762
+ wppa_index_update( 'photo', $photo['id'] );
763
+ wppa_clear_taglist();
764
+ }
765
+
766
  break;
767
 
768
  }
769
  // Test for timeout / ready
770
  $lastid = $id;
771
  update_option( $slug.'_last', $lastid );
772
+ if ( wppa_is_cron() ) {
773
+ $togo = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `id` > %s ", $lastid ) );
774
+ if ( $togo ) {
775
+ update_option( $slug.'_togo', $togo );
776
+ }
777
+ if ( time() > $endtime ) {
778
+ update_option( $slug.'_status', __('Scheduled cron job', 'wp-photo-album-plus'));
779
+ }
780
+ else {
781
+ update_option( $slug.'_status', __('Running cron job', 'wp-photo-album-plus'));
782
+ }
783
+ }
784
  if ( time() > $endtime ) break; // Time out
785
  }
786
  else { // Nothing to do, Done anyway
938
 
939
  if ( wppa_is_cron() ) {
940
  wppa_log( 'obs', $errtxt.'||'.$slug.'||'.$status.'||'.$togo.'||'.$reload );
941
+ if ( get_option( $slug . '_ad_inf' ) == 'yes' ) {
942
+ wppa_schedule_maintenance_proc( $slug );
943
+ }
944
  }
945
  return $errtxt.'||'.$slug.'||'.$status.'||'.$togo.'||'.$reload;
946
 
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 6.6.10
7
  *
8
  */
9
 
@@ -399,13 +399,6 @@ function wppaTryWatermark( id ) {
399
  </script>
400
  <?php
401
 
402
- // Get the current watermark file settings
403
- $wms = array( 'toplft' => __( 'top - left' , 'wp-photo-album-plus'), 'topcen' => __( 'top - center' , 'wp-photo-album-plus'), 'toprht' => __( 'top - right' , 'wp-photo-album-plus'),
404
- 'cenlft' => __( 'center - left' , 'wp-photo-album-plus'), 'cencen' => __( 'center - center' , 'wp-photo-album-plus'), 'cenrht' => __( 'center - right' , 'wp-photo-album-plus'),
405
- 'botlft' => __( 'bottom - left' , 'wp-photo-album-plus'), 'botcen' => __( 'bottom - center' , 'wp-photo-album-plus'), 'botrht' => __( 'bottom - right' , 'wp-photo-album-plus'), );
406
- $temp = wppa_get_water_file_and_pos( '0' );
407
- $wmfile = isset( $temp['select'] ) ? $temp['select'] : '';
408
- $wmpos = isset( $temp['pos'] ) && isset ( $wms[$temp['pos']] ) ? $wms[$temp['pos']] : '';
409
 
410
  $mvt = esc_attr( __( 'Move video', 'wp-photo-album-plus' ) );
411
  $mpt = esc_attr( __( 'Move photo', 'wp-photo-album-plus' ) );
@@ -454,6 +447,9 @@ function wppaTryWatermark( id ) {
454
  // Various usefull vars
455
  $owner_editable = wppa_switch( 'photo_owner_change' ) && wppa_user_is( 'administrator' );
456
  $sortby_orderno = wppa_get_album_item( $album, 'p_order_by' ) == '1' || wppa_get_album_item( $album, 'p_order_by' ) == '-1';
 
 
 
457
 
458
  echo // Anchor for scroll to
459
  "\n" . '<a id="photo_' . $id . '" ></a>';
@@ -961,53 +957,61 @@ function wppaTryWatermark( id ) {
961
  }
962
 
963
  // Watermark
964
- if ( ! $is_multi || is_file( wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id ) ) ) {
965
- echo
966
- __( 'Watermark:', 'wp-photo-album-plus') . ' ';
967
- if ( wppa_switch( 'watermark_on' ) ) {
968
- $user = wppa_get_user();
969
- if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
970
  echo
971
- '<select' .
972
- ' id="wmfsel_' . $id . '"' .
973
- ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_file_' . $user . '\', this );"' .
974
- ' >' .
975
- wppa_watermark_file_select() .
976
- '</select>' .
977
- __( 'Pos:', 'wp-photo-album-plus' ) . ' ' .
978
- '<select' .
979
- ' id="wmpsel_' . $id . '"' .
980
- ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_pos_' . $user . '\', this );"' .
981
- ' >' .
982
- wppa_watermark_pos_select() .
983
- '</select>' .
984
- '<input' .
985
- ' type="button"' .
986
- ' class="button-secundary"' .
987
- ' value="' . esc_attr( __( 'Apply watermark', 'wp-photo-album-plus' ) ) . '"' .
988
- ' onclick="wppaTryWatermark( ' . $id . ' )"' .
989
  ' />';
990
  }
991
  else {
992
  echo
993
- __( 'File:', 'wp-photo-album-plus' ) . ' ' . __( $wmfile, 'wp-photo-album-plus' ) . ' ';
994
- if ( $wmfile != '--- none ---' ) {
995
- echo __( 'Pos:', 'wp-photo-album-plus') . ' ' . $wmpos;
996
- }
997
  }
998
- echo
999
- '<img' .
1000
- ' id="wppa-water-spin-' . $id . '"' .
1001
- ' src="' . wppa_get_imgdir() . 'spinner.gif' . '"' .
1002
- ' alt="Spin"' .
1003
- ' style="visibility:hidden"' .
1004
- ' />';
1005
- }
1006
- else {
1007
- echo
1008
- __( 'Not configured', 'wp-photo-album-plus' );
1009
  }
1010
- echo ' ';
1011
  }
1012
 
1013
  echo
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 6.6.11
7
  *
8
  */
9
 
399
  </script>
400
  <?php
401
 
 
 
 
 
 
 
 
402
 
403
  $mvt = esc_attr( __( 'Move video', 'wp-photo-album-plus' ) );
404
  $mpt = esc_attr( __( 'Move photo', 'wp-photo-album-plus' ) );
447
  // Various usefull vars
448
  $owner_editable = wppa_switch( 'photo_owner_change' ) && wppa_user_is( 'administrator' );
449
  $sortby_orderno = wppa_get_album_item( $album, 'p_order_by' ) == '1' || wppa_get_album_item( $album, 'p_order_by' ) == '-1';
450
+ $wms = array( 'toplft' => __( 'top - left' , 'wp-photo-album-plus'), 'topcen' => __( 'top - center' , 'wp-photo-album-plus'), 'toprht' => __( 'top - right' , 'wp-photo-album-plus'),
451
+ 'cenlft' => __( 'center - left' , 'wp-photo-album-plus'), 'cencen' => __( 'center - center' , 'wp-photo-album-plus'), 'cenrht' => __( 'center - right' , 'wp-photo-album-plus'),
452
+ 'botlft' => __( 'bottom - left' , 'wp-photo-album-plus'), 'botcen' => __( 'bottom - center' , 'wp-photo-album-plus'), 'botrht' => __( 'bottom - right' , 'wp-photo-album-plus'), );
453
 
454
  echo // Anchor for scroll to
455
  "\n" . '<a id="photo_' . $id . '" ></a>';
957
  }
958
 
959
  // Watermark
960
+ if ( wppa_switch( 'watermark_on' ) ) {
961
+ if ( ! $is_multi || is_file( wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id ) ) ) {
962
+
963
+ // Get the current watermark file settings
964
+ $temp = wppa_get_water_file_and_pos( $id );
965
+ $wmfile = isset( $temp['file'] ) ? $temp['file'] : '';
966
+ $wmpos = isset( $temp['pos'] ) && isset ( $wms[$temp['pos']] ) ? $wms[$temp['pos']] : '';
967
+
968
+ echo
969
+ __( 'Watermark:', 'wp-photo-album-plus') . ' ';
970
+ if ( wppa_switch( 'watermark_on' ) ) {
971
+ $user = wppa_get_user();
972
+ if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) {
973
+ echo
974
+ '<select' .
975
+ ' id="wmfsel_' . $id . '"' .
976
+ ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_file_' . $user . '\', this );"' .
977
+ ' >' .
978
+ wppa_watermark_file_select( 'user', $album ) .
979
+ '</select>' .
980
+ __( 'Pos:', 'wp-photo-album-plus' ) . ' ' .
981
+ '<select' .
982
+ ' id="wmpsel_' . $id . '"' .
983
+ ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_pos_' . $user . '\', this );"' .
984
+ ' >' .
985
+ wppa_watermark_pos_select( 'user', $album ) .
986
+ '</select>' .
987
+ '<input' .
988
+ ' type="button"' .
989
+ ' class="button-secundary"' .
990
+ ' value="' . esc_attr( __( 'Apply watermark', 'wp-photo-album-plus' ) ) . '"' .
991
+ ' onclick="wppaTryWatermark( ' . $id . ' )"' .
992
+ ' />';
993
+ }
994
+ else {
995
+ echo
996
+ __( 'File:', 'wp-photo-album-plus' ) . ' ' . __( $wmfile, 'wp-photo-album-plus' ) . ' ';
997
+ if ( $wmfile != '--- none ---' ) {
998
+ echo __( 'Pos:', 'wp-photo-album-plus') . ' ' . $wmpos;
999
+ }
1000
+ }
1001
  echo
1002
+ '<img' .
1003
+ ' id="wppa-water-spin-' . $id . '"' .
1004
+ ' src="' . wppa_get_imgdir() . 'spinner.gif' . '"' .
1005
+ ' alt="Spin"' .
1006
+ ' style="visibility:hidden"' .
 
 
 
 
 
 
 
 
 
 
 
 
 
1007
  ' />';
1008
  }
1009
  else {
1010
  echo
1011
+ __( 'Not configured', 'wp-photo-album-plus' );
 
 
 
1012
  }
1013
+ echo ' ';
 
 
 
 
 
 
 
 
 
 
1014
  }
 
1015
  }
1016
 
1017
  echo
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 6.6.10
7
  *
8
  */
9
 
@@ -3440,7 +3440,7 @@ global $wp_version;
3440
  $clas = '-svg';
3441
  $tags = 'layout,navi';
3442
  wppa_setting($slug, '15.2', $name, $desc, $html, $help, $clas, $tags);
3443
- */
3444
  }
3445
  ?>
3446
  </tbody>
@@ -6390,10 +6390,20 @@ global $wp_version;
6390
  wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
6391
 
6392
  $name = __('Fe alert', 'wp-photo-album-plus');
6393
- $desc = __('Show alertbox on successful front-end upload/create.', 'wp-photo-album-plus');
6394
- $help = '';
6395
  $slug = 'wppa_fe_alert';
6396
- $html1 = wppa_checkbox($slug);
 
 
 
 
 
 
 
 
 
 
6397
  $html2 = '';
6398
  $html = array( $html1, $html2 );
6399
  $clas = '';
@@ -7346,7 +7356,20 @@ global $wp_version;
7346
  $html = array($html1, $html2, $html3, $html4);
7347
  $clas = '';
7348
  $tags = 'system,meta';
7349
- wppa_setting(false, '12', $name, $desc, $html, $help, $clas, $tags);
 
 
 
 
 
 
 
 
 
 
 
 
 
7350
 
7351
  if ( function_exists( 'ewww_image_optimizer') ) {
7352
  $name = __('Optimize files', 'wp-photo-album-plus');
@@ -7537,7 +7560,7 @@ global $wp_version;
7537
  $desc = __('For OpaJaap only');
7538
  $help = '';
7539
  $slug2 = 'wppa_test_proc';
7540
- $html1 = '';
7541
  $html2 = wppa_maintenance_button( $slug2 );
7542
  $html3 = wppa_status_field( $slug2 );
7543
  $html4 = wppa_togo_field( $slug2 );
@@ -7971,6 +7994,14 @@ global $wp_version;
7971
  $tags = 'system,upload';
7972
  wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags);
7973
 
 
 
 
 
 
 
 
 
7974
  }
7975
  wppa_setting_subheader( 'C', '1', __( 'SEO related settings' , 'wp-photo-album-plus') );
7976
  {
@@ -8228,7 +8259,7 @@ global $wp_version;
8228
  $slug = 'wppa_default_parent';
8229
  $opts = array( __('--- none ---', 'wp-photo-album-plus'), __('--- separate ---', 'wp-photo-album-plus') );
8230
  $vals = array( '0', '-1');
8231
- $albs = $wpdb->get_results( "SELECT `id`, `name` FROM`" . WPPA_ALBUMS . "` ORDER BY `name`", ARRAY_A );
8232
  if ( $albs ) {
8233
  foreach ( $albs as $alb ) {
8234
  $opts[] = __(stripslashes($alb['name']), 'wp-photo-album-plus');
@@ -8653,9 +8684,9 @@ global $wp_version;
8653
  $help .= '\n'.esc_js(__(sprintf('The watermark image will be overlaying the photo with %s%% transparency.', (100-wppa_opt( 'watermark_opacity' ))), 'wp-photo-album-plus'));
8654
  $help .= '\n\n'.esc_js(__('You may also select one of the textual watermark types at the bottom of the selection list.', 'wp-photo-album-plus'));
8655
  $slug = 'wppa_watermark_file';
8656
- $html = '<select style="float:left; font-size:11px; height:20px; margin:0 4px 0 0; padding:0; " id="wppa_watermark_file" onchange="wppaAjaxUpdateOptionValue(\'watermark_file\', this)" >' . wppa_watermark_file_select('default') . '</select>';
8657
  $html .= '<img id="img_watermark_file" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding-left:4px; float:left; height:16px; width:16px;" />';
8658
- $html .= '<span style="float:left; margin-left:12px;" >'.__('position:', 'wp-photo-album-plus').'</span><select style="float:left; font-size:11px; height:20px; margin:0 0 0 20px; padding:0; " id="wppa_watermark_pos" onchange="wppaAjaxUpdateOptionValue(\'watermark_pos\', this)" >' . wppa_watermark_pos_select('default') . '</select>';
8659
  $html .= '<img id="img_watermark_pos" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding-left:4px; float:left; height:16px; width:16px;" />';
8660
  $clas = 'wppa_watermark';
8661
  $tags = 'water';
@@ -10405,7 +10436,11 @@ function wppa_status_field( $slug ) {
10405
  return $result;
10406
  }
10407
  function wppa_togo_field( $slug ) {
10408
- $result = '<span id="'.$slug.'_togo" >'.get_option($slug.'_togo', '' ).'</span>';
 
 
 
 
10409
  return $result;
10410
  }
10411
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 6.6.11
7
  *
8
  */
9
 
3440
  $clas = '-svg';
3441
  $tags = 'layout,navi';
3442
  wppa_setting($slug, '15.2', $name, $desc, $html, $help, $clas, $tags);
3443
+ */
3444
  }
3445
  ?>
3446
  </tbody>
6390
  wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
6391
 
6392
  $name = __('Fe alert', 'wp-photo-album-plus');
6393
+ $desc = __('Show alertbox on front-end.', 'wp-photo-album-plus');
6394
+ $help = esc_js(__('Errors are always reported, credit points only when --- none --- is not selected', 'wp-photo-album-plus'));
6395
  $slug = 'wppa_fe_alert';
6396
+ $opts = array( __('--- none ---', 'wp-photo-album-plus'),
6397
+ __('uploads and create albums', 'wp-photo-album-plus'),
6398
+ __('blog it', 'wp-photo-album-plus'),
6399
+ __('all', 'wp-photo-album-plus'),
6400
+ );
6401
+ $vals = array( '-none-',
6402
+ 'upcre',
6403
+ 'blog',
6404
+ 'all',
6405
+ );
6406
+ $html1 = wppa_select($slug, $opts, $vals);
6407
  $html2 = '';
6408
  $html = array( $html1, $html2 );
6409
  $clas = '';
7356
  $html = array($html1, $html2, $html3, $html4);
7357
  $clas = '';
7358
  $tags = 'system,meta';
7359
+ wppa_setting(false, '12.1', $name, $desc, $html, $help, $clas, $tags);
7360
+
7361
+ $name = __('Add HD tag', 'wp-photo-album-plus');
7362
+ $desc = __('Make sure photos >= 1920 x 1080 have a HD tag', 'wp-photo-album-plus');
7363
+ $help = '';
7364
+ $slug2 = 'wppa_add_hd_tag';
7365
+ $html1 = wppa_cronjob_button( $slug2 );
7366
+ $html2 = wppa_maintenance_button( $slug2 );
7367
+ $html3 = wppa_status_field( $slug2 );
7368
+ $html4 = wppa_togo_field( $slug2 );
7369
+ $html = array($html1, $html2, $html3, $html4);
7370
+ $clas = '';
7371
+ $tags = 'system,meta';
7372
+ wppa_setting(false, '12.2', $name, $desc, $html, $help, $clas, $tags);
7373
 
7374
  if ( function_exists( 'ewww_image_optimizer') ) {
7375
  $name = __('Optimize files', 'wp-photo-album-plus');
7560
  $desc = __('For OpaJaap only');
7561
  $help = '';
7562
  $slug2 = 'wppa_test_proc';
7563
+ $html1 = wppa_cronjob_button( $slug2 ) . __('ad inf', 'wp-photo-album-plus') . wppa_checkbox( 'wppa_test_proc_ad_inf' );
7564
  $html2 = wppa_maintenance_button( $slug2 );
7565
  $html3 = wppa_status_field( $slug2 );
7566
  $html4 = wppa_togo_field( $slug2 );
7994
  $tags = 'system,upload';
7995
  wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags);
7996
 
7997
+ $name = __('Enable shortcode generator', 'wp-photo-album-plus');
7998
+ $desc = __('Show album icon above page/post edit window', 'wp-photo-album-plus');
7999
+ $help = esc_js(__('Administrators and wppa super users will always have the shortcode generator available.', 'wp-photo-album-plus'));
8000
+ $slug = 'wppa_enable_generator';
8001
+ $html = wppa_checkbox($slug);
8002
+ $clas = '';
8003
+ $tags = 'system';
8004
+ wppa_setting($slug, '19', $name, $desc, $html, $help, $clas, $tags);
8005
  }
8006
  wppa_setting_subheader( 'C', '1', __( 'SEO related settings' , 'wp-photo-album-plus') );
8007
  {
8259
  $slug = 'wppa_default_parent';
8260
  $opts = array( __('--- none ---', 'wp-photo-album-plus'), __('--- separate ---', 'wp-photo-album-plus') );
8261
  $vals = array( '0', '-1');
8262
+ $albs = $wpdb->get_results( "SELECT `id`, `name` FROM `" . WPPA_ALBUMS . "` ORDER BY `name`", ARRAY_A );
8263
  if ( $albs ) {
8264
  foreach ( $albs as $alb ) {
8265
  $opts[] = __(stripslashes($alb['name']), 'wp-photo-album-plus');
8684
  $help .= '\n'.esc_js(__(sprintf('The watermark image will be overlaying the photo with %s%% transparency.', (100-wppa_opt( 'watermark_opacity' ))), 'wp-photo-album-plus'));
8685
  $help .= '\n\n'.esc_js(__('You may also select one of the textual watermark types at the bottom of the selection list.', 'wp-photo-album-plus'));
8686
  $slug = 'wppa_watermark_file';
8687
+ $html = '<select style="float:left; font-size:11px; height:20px; margin:0 4px 0 0; padding:0; " id="wppa_watermark_file" onchange="wppaAjaxUpdateOptionValue(\'watermark_file\', this)" >' . wppa_watermark_file_select( 'system' ) . '</select>';
8688
  $html .= '<img id="img_watermark_file" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding-left:4px; float:left; height:16px; width:16px;" />';
8689
+ $html .= '<span style="float:left; margin-left:12px;" >'.__('position:', 'wp-photo-album-plus').'</span><select style="float:left; font-size:11px; height:20px; margin:0 0 0 20px; padding:0; " id="wppa_watermark_pos" onchange="wppaAjaxUpdateOptionValue(\'watermark_pos\', this)" >' . wppa_watermark_pos_select( 'system' ) . '</select>';
8690
  $html .= '<img id="img_watermark_pos" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding-left:4px; float:left; height:16px; width:16px;" />';
8691
  $clas = 'wppa_watermark';
8692
  $tags = 'water';
10436
  return $result;
10437
  }
10438
  function wppa_togo_field( $slug ) {
10439
+ $togo = get_option($slug.'_togo', '' );
10440
+ $result = '<span id="'.$slug.'_togo" >' . $togo . '</span>';
10441
+ if ( $togo ) {
10442
+ $result .= '<script>wppaAjaxUpdateTogo(\'' . $slug . '\');</script>';
10443
+ }
10444
  return $result;
10445
  }
10446
 
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 6.6.10
7
  *
8
  */
9
 
@@ -72,6 +72,8 @@ global $silent;
72
  custom longtext NOT NULL,
73
  crypt tinytext NOT NULL,
74
  treecounts text NOT NULL,
 
 
75
  PRIMARY KEY (id)
76
  ) DEFAULT CHARACTER SET utf8;";
77
 
@@ -201,8 +203,8 @@ global $silent;
201
  }
202
 
203
  // Clear Session
204
- $wpdb->query( "TRUNCATE TABLE `".WPPA_SESSION."`" );
205
- wppa_session_start();
206
 
207
  // Convert any changed and remove obsolete setting options
208
  if ( $old_rev > '100' ) { // On update only
@@ -416,7 +418,7 @@ global $silent;
416
  }
417
 
418
  if ( $old_rev <= '6410' ) {
419
- @ $wpdb->query( "UPDATE `wp_options` SET `autoload` = 'no' WHERE `option_name` LIKE 'wppa_%'");
420
  }
421
 
422
  if ( $old_rev <= '6411' ) {
@@ -509,6 +511,18 @@ global $silent;
509
  }
510
  }
511
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  }
513
 
514
  // Set Defaults
@@ -637,7 +651,7 @@ function wppa_revalue_setting($oldname, $oldvalue, $newvalue) {
637
  }
638
 
639
  // Set default option values in global $wppa_defaults
640
- // With $force = true, all non default options will be deleted, so everything is set to the default except: revision, rating_max and filesystem
641
  function wppa_set_defaults($force = false) {
642
  global $wppa_defaults;
643
 
@@ -1389,7 +1403,7 @@ Hide Camera info
1389
  'wppa_upload_fronend_maxsize' => '0',
1390
  'wppa_void_dups' => 'no',
1391
  'wppa_home_after_upload' => 'no',
1392
- 'wppa_fe_alert' => 'yes',
1393
  'wppa_fe_upload_max_albums' => '200', // VII-B13
1394
 
1395
  'wppa_editor_upload_limit_count' => '0',
@@ -1465,6 +1479,7 @@ Hide Camera info
1465
  'wppa_sanitize_tags' => '',
1466
  'wppa_sanitize_cats' => '',
1467
  'wppa_test_proc' => '',
 
1468
  'wppa_move_all_photos' => '',
1469
  'wppa_move_all_photos_from' => '',
1470
  'wppa_move_all_photos_to' => '',
@@ -1517,6 +1532,7 @@ Hide Camera info
1517
  'wppa_confirm_create' => 'yes',
1518
  'wppa_import_root' => ABSPATH . 'wp-content',
1519
  'wppa_allow_import_source' => 'no',
 
1520
 
1521
 
1522
  // IX D New
@@ -1692,28 +1708,24 @@ Hide Camera info
1692
  'wppa_qr_color' => '#000000',
1693
  'wppa_qr_bgcolor' => '#FFFFFF',
1694
 
1695
-
1696
  'wppa_dismiss_admin_notice_scripts_are_obsolete' => 'no',
1697
 
1698
  );
1699
 
1700
- array_walk( $wppa_defaults, 'wppa_set_default', $force );
 
 
1701
 
1702
  return true;
1703
  }
1704
- function wppa_set_default($value, $key, $force) {
1705
  $void_these = array(
1706
  'wppa_revision',
1707
  'wppa_rating_max',
1708
  'wppa_file_system'
1709
  );
1710
 
1711
- if ( $force ) {
1712
- if ( ! in_array($key, $void_these) ) wppa_update_option($key, $value);
1713
- }
1714
- else {
1715
- if ( get_option($key, 'nil') == 'nil' ) wppa_update_option($key, $value);
1716
- }
1717
  }
1718
 
1719
  // Check if the required directories exist, if not, try to create them and optionally report it
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 6.6.11
7
  *
8
  */
9
 
72
  custom longtext NOT NULL,
73
  crypt tinytext NOT NULL,
74
  treecounts text NOT NULL,
75
+ wmfile tinytext NOT NULL,
76
+ wmpos tinytext NOT NULL,
77
  PRIMARY KEY (id)
78
  ) DEFAULT CHARACTER SET utf8;";
79
 
203
  }
204
 
205
  // Clear Session
206
+ // $wpdb->query( "TRUNCATE TABLE `".WPPA_SESSION."`" );
207
+ // wppa_session_start();
208
 
209
  // Convert any changed and remove obsolete setting options
210
  if ( $old_rev > '100' ) { // On update only
418
  }
419
 
420
  if ( $old_rev <= '6410' ) {
421
+ // @ $wpdb->query( "UPDATE `wp_options` SET `autoload` = 'no' WHERE `option_name` LIKE 'wppa_%'");
422
  }
423
 
424
  if ( $old_rev <= '6411' ) {
511
  }
512
  }
513
 
514
+ if ( $old_rev <= '6611' ) {
515
+ delete_option( 'wppa_cached_options' );
516
+ delete_option( 'wppa_md5_options' );
517
+ @ $wpdb->query( "UPDATE `" . $wpdb->options . "` SET `autoload` = 'yes' WHERE `option_name` LIKE 'wppa_%'");
518
+ if ( get_option( 'wppa_fe_alert' ) == 'no' ) {
519
+ update_option( 'wppa_fe_alert', '-none-' );
520
+ }
521
+ if ( get_option( 'wppa_fe_alert' ) == 'yes' ) {
522
+ update_option( 'wppa_fe_alert', 'all' );
523
+ }
524
+ }
525
+
526
  }
527
 
528
  // Set Defaults
651
  }
652
 
653
  // Set default option values in global $wppa_defaults
654
+ // With $force = true, all non default options will be reset to default, so everything is set to the default except: revision, rating_max and filesystem
655
  function wppa_set_defaults($force = false) {
656
  global $wppa_defaults;
657
 
1403
  'wppa_upload_fronend_maxsize' => '0',
1404
  'wppa_void_dups' => 'no',
1405
  'wppa_home_after_upload' => 'no',
1406
+ 'wppa_fe_alert' => 'all',
1407
  'wppa_fe_upload_max_albums' => '200', // VII-B13
1408
 
1409
  'wppa_editor_upload_limit_count' => '0',
1479
  'wppa_sanitize_tags' => '',
1480
  'wppa_sanitize_cats' => '',
1481
  'wppa_test_proc' => '',
1482
+ 'wppa_test_proc_ad_inf' => 'no',
1483
  'wppa_move_all_photos' => '',
1484
  'wppa_move_all_photos_from' => '',
1485
  'wppa_move_all_photos_to' => '',
1532
  'wppa_confirm_create' => 'yes',
1533
  'wppa_import_root' => ABSPATH . 'wp-content',
1534
  'wppa_allow_import_source' => 'no',
1535
+ 'wppa_enable_generator' => 'yes',
1536
 
1537
 
1538
  // IX D New
1708
  'wppa_qr_color' => '#000000',
1709
  'wppa_qr_bgcolor' => '#FFFFFF',
1710
 
 
1711
  'wppa_dismiss_admin_notice_scripts_are_obsolete' => 'no',
1712
 
1713
  );
1714
 
1715
+ if ( $force ) {
1716
+ array_walk( $wppa_defaults, 'wppa_set_default' );
1717
+ }
1718
 
1719
  return true;
1720
  }
1721
+ function wppa_set_default( $value, $key ) {
1722
  $void_these = array(
1723
  'wppa_revision',
1724
  'wppa_rating_max',
1725
  'wppa_file_system'
1726
  );
1727
 
1728
+ if ( ! in_array($key, $void_these) ) wppa_update_option($key, $value);
 
 
 
 
 
1729
  }
1730
 
1731
  // Check if the required directories exist, if not, try to create them and optionally report it
wppa-source.php CHANGED
@@ -58,12 +58,15 @@ function wppa_delete_source( $name, $alb ) {
58
  $path = wppa_get_source_album_dir( $alb ).'/'.$name;
59
  $path = wppa_strip_ext( $path );
60
 
61
- $paths = glob( $path . '.*' );
62
  $o1paths = glob( $path . '-o1.*' );
63
- $all_paths = array_merge( $paths, $o1paths );
 
 
 
64
 
65
  // Delete all possible file-extensions
66
- foreach( $all_paths as $p ) if ( is_file( $p ) ) {
67
  unlink( $p ); // Ignore error
68
  }
69
 
58
  $path = wppa_get_source_album_dir( $alb ).'/'.$name;
59
  $path = wppa_strip_ext( $path );
60
 
61
+ $all_paths = glob( $path . '.*' );
62
  $o1paths = glob( $path . '-o1.*' );
63
+
64
+ if ( is_array( $all_paths ) && is_array( $o1paths ) ) {
65
+ $all_paths = array_merge( $all_paths, $o1paths );
66
+ }
67
 
68
  // Delete all possible file-extensions
69
+ if ( is_array( $all_paths ) ) foreach( $all_paths as $p ) if ( is_file( $p ) ) {
70
  unlink( $p ); // Ignore error
71
  }
72
 
wppa-tinymce-shortcodes.php CHANGED
@@ -3,7 +3,7 @@
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  *
6
- * Version 6.5.08
7
  *
8
  */
9
 
@@ -18,8 +18,8 @@ class wppaGallery
18
 
19
  function action_admin_init() {
20
  // only hook up these filters if we're in the admin panel, and the current user has permission
21
- // to edit posts or pages
22
- if ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) {
23
  add_filter( 'mce_buttons', array( $this, 'filter_mce_button' ) );
24
  add_filter( 'mce_external_plugins', array( $this, 'filter_mce_plugin' ) );
25
  }
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  *
6
+ * Version 6.6.11
7
  *
8
  */
9
 
18
 
19
  function action_admin_init() {
20
  // only hook up these filters if we're in the admin panel, and the current user has permission
21
+ // to edit posts or pages, and the feature is enabled
22
+ if ( wppa_user_is( 'administrator' ) || ( wppa_switch( 'enable_generator' ) && ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) ) ) {
23
  add_filter( 'mce_buttons', array( $this, 'filter_mce_button' ) );
24
  add_filter( 'mce_external_plugins', array( $this, 'filter_mce_plugin' ) );
25
  }
wppa-upload.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
- * Version 6.6.09
7
  *
8
  */
9
 
@@ -188,11 +188,11 @@ global $upload_album;
188
  '<p>' .
189
  __( 'Apply watermark file:' , 'wp-photo-album-plus' ) .
190
  '<select name="wppa-watermark-file" id="wppa-watermark-file" >' .
191
- wppa_watermark_file_select() .
192
  '</select>' .
193
  __( 'Position:' , 'wp-photo-album-plus' ) .
194
  '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' .
195
- wppa_watermark_pos_select() .
196
  '</select>' .
197
  '</p>';
198
  }
@@ -330,11 +330,11 @@ global $upload_album;
330
  '<p>' .
331
  __( 'Apply watermark file:' , 'wp-photo-album-plus' ) .
332
  '<select name="wppa-watermark-file" id="wppa-watermark-file" >' .
333
- wppa_watermark_file_select() .
334
  '</select>' .
335
  __( 'Position:' , 'wp-photo-album-plus' ) .
336
  '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' .
337
- wppa_watermark_pos_select() .
338
  '</select>' .
339
  '</p>';
340
  }
@@ -404,11 +404,11 @@ global $upload_album;
404
  '<p>' .
405
  __( 'Apply watermark file:' , 'wp-photo-album-plus' ) .
406
  '<select name="wppa-watermark-file" id="wppa-watermark-file" >' .
407
- wppa_watermark_file_select() .
408
  '</select>' .
409
  __( 'Position:' , 'wp-photo-album-plus' ) .
410
  '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' .
411
- wppa_watermark_pos_select() .
412
  '</select>' .
413
  '</p>';
414
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
+ * Version 6.6.11
7
  *
8
  */
9
 
188
  '<p>' .
189
  __( 'Apply watermark file:' , 'wp-photo-album-plus' ) .
190
  '<select name="wppa-watermark-file" id="wppa-watermark-file" >' .
191
+ wppa_watermark_file_select( 'user' ) .
192
  '</select>' .
193
  __( 'Position:' , 'wp-photo-album-plus' ) .
194
  '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' .
195
+ wppa_watermark_pos_select( 'user' ) .
196
  '</select>' .
197
  '</p>';
198
  }
330
  '<p>' .
331
  __( 'Apply watermark file:' , 'wp-photo-album-plus' ) .
332
  '<select name="wppa-watermark-file" id="wppa-watermark-file" >' .
333
+ wppa_watermark_file_select( 'user' ) .
334
  '</select>' .
335
  __( 'Position:' , 'wp-photo-album-plus' ) .
336
  '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' .
337
+ wppa_watermark_pos_select( 'user' ) .
338
  '</select>' .
339
  '</p>';
340
  }
404
  '<p>' .
405
  __( 'Apply watermark file:' , 'wp-photo-album-plus' ) .
406
  '<select name="wppa-watermark-file" id="wppa-watermark-file" >' .
407
+ wppa_watermark_file_select( 'user' ) .
408
  '</select>' .
409
  __( 'Position:' , 'wp-photo-album-plus' ) .
410
  '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' .
411
+ wppa_watermark_pos_select( 'user' ) .
412
  '</select>' .
413
  '</p>';
414
  }
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 6.6.10
7
  *
8
  */
9
 
@@ -714,13 +714,13 @@ function wppa_update_option( $option, $value ) {
714
  global $wppa_opt;
715
 
716
  // Update the option
717
- update_option( $option, $value, false );
718
 
719
  // Update the local cache
720
  $wppa_opt[$option] = $value;
721
 
722
  // Delete the cached options
723
- delete_option( 'wppa_cached_options' );
724
 
725
  // Remove init.js files, they will be auto re-created
726
  $files = glob( WPPA_PATH.'/wppa-init.*.js' );
@@ -1225,7 +1225,7 @@ global $wpdb;
1225
  $photoinfo = $wpdb->get_row($wpdb->prepare('SELECT * FROM `'.WPPA_PHOTOS.'` WHERE `id` = %s', $photo), ARRAY_A);
1226
 
1227
  // If still in use, refuse deletion
1228
- $in_use = $wpdb->get_row( "SELECT `ID`, `post_title` FROM `" . $wpdb->posts . "` WHERE `post_content` LIKE '%photo=\"$photo\"%' LIMIT 1", ARRAY_A );
1229
 
1230
  if ( is_array( $in_use ) ) {
1231
  if ( defined( 'DOING_AJAX' ) ) {
@@ -1373,8 +1373,15 @@ function wppa_sanitize_tags($value, $keepsemi = false, $keephash = false ) {
1373
  }
1374
  }
1375
 
 
 
 
 
 
 
 
1376
  // Sort
1377
- asort($temp);
1378
 
1379
  // Remove dups and recombine
1380
  $value = '';
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 6.6.11
7
  *
8
  */
9
 
714
  global $wppa_opt;
715
 
716
  // Update the option
717
+ update_option( $option, $value );
718
 
719
  // Update the local cache
720
  $wppa_opt[$option] = $value;
721
 
722
  // Delete the cached options
723
+ // delete_option( 'wppa_cached_options' );
724
 
725
  // Remove init.js files, they will be auto re-created
726
  $files = glob( WPPA_PATH.'/wppa-init.*.js' );
1225
  $photoinfo = $wpdb->get_row($wpdb->prepare('SELECT * FROM `'.WPPA_PHOTOS.'` WHERE `id` = %s', $photo), ARRAY_A);
1226
 
1227
  // If still in use, refuse deletion
1228
+ $in_use = $wpdb->get_row( "SELECT `ID`, `post_title` FROM `" . $wpdb->posts . "` WHERE `post_content` LIKE '%photo=\"$photo\"%' AND `post_status` = 'publish' LIMIT 1", ARRAY_A );
1229
 
1230
  if ( is_array( $in_use ) ) {
1231
  if ( defined( 'DOING_AJAX' ) ) {
1373
  }
1374
  }
1375
 
1376
+ // Capitalize GPX and HD tags
1377
+ foreach ( array_keys( $temp ) as $idx ) {
1378
+ if ( in_array( $temp[$idx], array( 'Gpx', 'Hd' ) ) ) {
1379
+ $temp[$idx] = strtoupper( $temp[$idx] );
1380
+ }
1381
+ }
1382
+
1383
  // Sort
1384
+ asort( $temp );
1385
 
1386
  // Remove dups and recombine
1387
  $value = '';
wppa-watermark.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-watermark.php
3
  *
4
  * Functions used for the application of watermarks
5
- * Version 6.6.05
6
  *
7
  */
8
 
@@ -81,6 +81,7 @@ function wppa_create_textual_watermark_file( $args ) {
81
  $text = str_replace( 'w#site', get_bloginfo( 'url' ), $text );
82
  $usr = get_user_by( 'login', wppa_get_photo_item( $id, 'owner' ) );
83
  $text = wppa_translate_photo_keywords( $id, $text );
 
84
  $text = wppa_filter_iptc( $text, $id ); // Render IPTC tags
85
  $text = wppa_filter_exif( $text, $id ); // Render EXIF tags
86
 
@@ -316,12 +317,26 @@ function wppa_array_max( $array ) {
316
 
317
  function wppa_get_water_file_and_pos( $id ) {
318
 
 
319
  $result['file'] = wppa_opt( 'watermark_file' ); // default
320
- $result['pos'] = wppa_opt( 'watermark_pos' ); // default
321
-
322
- $user = wppa_get_user();
 
 
 
 
 
 
 
 
 
 
 
323
 
324
- if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) { // user overrule?
 
 
325
  if ( isset( $_POST['wppa-watermark-file'] ) ) {
326
  $result['file'] = $_POST['wppa-watermark-file'];
327
  update_option( 'wppa_watermark_file_' . $user, $_POST['wppa-watermark-file'] );
@@ -513,7 +528,7 @@ function wppa_imagecopymerge_alpha( $dst_im, $src_im, $dst_x, $dst_y, $src_x, $s
513
  imagecopy( $dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h );
514
  }
515
 
516
- function wppa_watermark_file_select( $default = false ) {
517
 
518
  // Init
519
  $result = '';
@@ -523,14 +538,40 @@ function wppa_watermark_file_select( $default = false ) {
523
  $paths = WPPA_UPLOAD_PATH . '/watermarks/*.png';
524
  $files = glob( $paths );
525
 
526
- // Find current selection
527
- $select = wppa_opt( 'watermark_file' ); // default
528
- if ( ! $default && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) && get_option( 'wppa_watermark_file_' . $user, 'nil' ) !== 'nil' ) {
529
- $select = get_option( 'wppa_watermark_file_' . $user );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  }
 
531
 
532
- // Produce the html
533
- $result .= '<option value="--- none ---">'.__( '--- none ---' , 'wp-photo-album-plus' ).'</option>';
 
 
 
 
 
 
 
534
  if ( $files ) foreach ( $files as $file ) {
535
  $sel = $select == basename( $file ) ? 'selected="selected"' : '';
536
  $result .= '<option value="'.basename( $file ).'" '.$sel.'>'.basename( $file ).'</option>';
@@ -538,18 +579,18 @@ function wppa_watermark_file_select( $default = false ) {
538
 
539
  // Text based watermarks
540
  $sel = $select == '---name---' ? 'selected="selected"' : '';
541
- $result .= '<option value="---name---" '.$sel.'>'.__( '--- text: name ---' , 'wp-photo-album-plus' ).'</option>';
542
  $sel = $select == '---filename---' ? 'selected="selected"' : '';
543
- $result .= '<option value="---filename---" '.$sel.'>'.__( '--- text: filename ---' , 'wp-photo-album-plus' ).'</option>';
544
  $sel = $select == '---description---' ? 'selected="selected"' : '';
545
- $result .= '<option value="---description---" '.$sel.'>'.__( '--- text: description ---' , 'wp-photo-album-plus' ).'</option>';
546
  $sel = $select == '---predef---' ? 'selected="selected"' : '';
547
- $result .= '<option value="---predef---" '.$sel.'>'.__( '--- text: pre-defined ---' , 'wp-photo-album-plus' ).'</option>';
548
 
549
  return $result;
550
  }
551
 
552
- function wppa_watermark_pos_select( $default = false ) {
553
 
554
  // Init
555
  $user = wppa_get_user();
@@ -562,13 +603,37 @@ function wppa_watermark_pos_select( $default = false ) {
562
  'botlft', 'botcen', 'botrht', );
563
  $idx = 0;
564
 
565
- // Find current selection
566
- $select = wppa_opt( 'watermark_pos' ); // default
567
- if ( ! $default && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) && get_option( 'wppa_watermark_pos_' . $user, 'nil' ) !== 'nil' ) {
568
- $select = get_option( 'wppa_watermark_pos_' . $user );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
  }
570
 
571
- // Produce the html
572
  while ( $idx < 9 ) {
573
  $sel = $select == $val[$idx] ? 'selected="selected"' : '';
574
  $result .= '<option value="'.$val[$idx].'" '.$sel.'>'.$opt[$idx].'</option>';
2
  /* wppa-watermark.php
3
  *
4
  * Functions used for the application of watermarks
5
+ * Version 6.6.11
6
  *
7
  */
8
 
81
  $text = str_replace( 'w#site', get_bloginfo( 'url' ), $text );
82
  $usr = get_user_by( 'login', wppa_get_photo_item( $id, 'owner' ) );
83
  $text = wppa_translate_photo_keywords( $id, $text );
84
+ $text = wppa_translate_album_keywords( wppa_get_photo_item( $id, 'album' ), $text );
85
  $text = wppa_filter_iptc( $text, $id ); // Render IPTC tags
86
  $text = wppa_filter_exif( $text, $id ); // Render EXIF tags
87
 
317
 
318
  function wppa_get_water_file_and_pos( $id ) {
319
 
320
+ // System defaults
321
  $result['file'] = wppa_opt( 'watermark_file' ); // default
322
+ $result['pos'] = wppa_opt( 'watermark_pos' ); // default
323
+
324
+ // Album specific overrule?
325
+ if ( $id ) {
326
+ $alb = wppa_get_photo_item( $id, 'album' );
327
+ $albfile = wppa_get_album_item( $alb, 'wmfile' );
328
+ if ( $albfile ) {
329
+ $result['file'] = $albfile;
330
+ }
331
+ $albpos = wppa_get_album_item( $alb, 'wmpos' );
332
+ if ( $albpos ) {
333
+ $result['pos'] = $albpos;
334
+ }
335
+ }
336
 
337
+ // User overrule?
338
+ if ( wppa_switch( 'watermark_user' ) || isset( $_POST['wppa-watermark-file'] ) ) {
339
+ $user = wppa_get_user();
340
  if ( isset( $_POST['wppa-watermark-file'] ) ) {
341
  $result['file'] = $_POST['wppa-watermark-file'];
342
  update_option( 'wppa_watermark_file_' . $user, $_POST['wppa-watermark-file'] );
528
  imagecopy( $dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h );
529
  }
530
 
531
+ function wppa_watermark_file_select( $key, $album = '0' ) {
532
 
533
  // Init
534
  $result = '';
538
  $paths = WPPA_UPLOAD_PATH . '/watermarks/*.png';
539
  $files = glob( $paths );
540
 
541
+ /* Find current selection */
542
+ // System default
543
+ $select = wppa_opt( 'watermark_file' );
544
+ $default = $select;
545
+
546
+ // Selection for album default requested?
547
+ if ( $album ) {
548
+ $temp = wppa_get_album_item( $album, 'wmfile' );
549
+ if ( $temp || $key == 'album' ) {
550
+ $select = $temp;
551
+ }
552
+ }
553
+
554
+ // User specific overruleable?
555
+ elseif ( $key == 'user' ) {
556
+ $default = $select;
557
+ if ( wppa_switch( 'watermark_user' ) ) {
558
+ $temp = get_option( 'wppa_watermark_file_' . $user );
559
+ if ( $temp ) {
560
+ $select = $temp;
561
+ }
562
+ }
563
  }
564
+ /* $select now contains appropriate current selection */
565
 
566
+ /* Produce the html */
567
+ // If not system, allow blank entry for system/album default
568
+ if ( $key != 'system' ) {
569
+ $result .= '<option value="" >' . __( '--- default ---', 'wp-photo-album-plus' ) . '</option>';
570
+ }
571
+ // None
572
+ $result .= '<option value="--- none ---" >'.__( '--- none ---' , 'wp-photo-album-plus' ).'</option>';
573
+
574
+ // Picture based watermarks
575
  if ( $files ) foreach ( $files as $file ) {
576
  $sel = $select == basename( $file ) ? 'selected="selected"' : '';
577
  $result .= '<option value="'.basename( $file ).'" '.$sel.'>'.basename( $file ).'</option>';
579
 
580
  // Text based watermarks
581
  $sel = $select == '---name---' ? 'selected="selected"' : '';
582
+ $result .= '<option value="---name---" '.$sel.' >'.__( '--- text: name ---' , 'wp-photo-album-plus' ).'</option>';
583
  $sel = $select == '---filename---' ? 'selected="selected"' : '';
584
+ $result .= '<option value="---filename---" '.$sel.' >'.__( '--- text: filename ---' , 'wp-photo-album-plus' ).'</option>';
585
  $sel = $select == '---description---' ? 'selected="selected"' : '';
586
+ $result .= '<option value="---description---" '.$sel.' >'.__( '--- text: description ---' , 'wp-photo-album-plus' ).'</option>';
587
  $sel = $select == '---predef---' ? 'selected="selected"' : '';
588
+ $result .= '<option value="---predef---" '.$sel.' >'.__( '--- text: pre-defined ---' , 'wp-photo-album-plus' ).'</option>';
589
 
590
  return $result;
591
  }
592
 
593
+ function wppa_watermark_pos_select( $key, $album = '0' ) {
594
 
595
  // Init
596
  $user = wppa_get_user();
603
  'botlft', 'botcen', 'botrht', );
604
  $idx = 0;
605
 
606
+ /* Find current selection */
607
+ // System default
608
+ $select = wppa_opt( 'watermark_pos' );
609
+ $default = $select;
610
+
611
+ // Selection for album default requested?
612
+ if ( $album ) {
613
+ $temp = wppa_get_album_item( $album, 'wmpos' );
614
+ if ( $temp || $key == 'album' ) {
615
+ $select = $temp;
616
+ }
617
+ }
618
+
619
+ // User specific overruleable?
620
+ elseif ( $key == 'user' ) {
621
+ $default = $select;
622
+ if ( wppa_switch( 'watermark_user' ) ) {
623
+ $temp = get_option( 'wppa_watermark_pos_' . $user );
624
+ if ( $temp ) {
625
+ $select = $temp;
626
+ }
627
+ }
628
+ }
629
+ /* $select now contains appropriate current selection */
630
+
631
+ /* Produce the html */
632
+ // If not system, allow blank entry for system/album default
633
+ if ( $key != 'system' ) {
634
+ $result .= '<option value="" >' . __( '--- default ---', 'wp-photo-album-plus' ) . '</option>';
635
  }
636
 
 
637
  while ( $idx < 9 ) {
638
  $sel = $select == $val[$idx] ? 'selected="selected"' : '';
639
  $result .= '<option value="'.$val[$idx].'" '.$sel.'>'.$opt[$idx].'</option>';
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: 6.6.10
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 = '6610'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '6-6-10-005'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime(true);
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: 6.6.11
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 = '6611'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '6-6-11-009'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime(true);