WP Photo Album Plus - Version 6.4.14

Version Description

Download this release

Release Info

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

Code changes from version 6.4.13 to 6.4.14

js/wppa-admin-scripts.js CHANGED
@@ -2034,13 +2034,16 @@ function wppaGetSelEnumToId( cls, id ) {
2034
  jQuery( '#'+id ).attr( 'value', wppaArrayToEnum( pararr, '.' ) );
2035
  }
2036
 
2037
- function wppaGetSelectionEnumByClass( clas ) {
2038
  var p;
2039
  var parr = [];
2040
  var i = 0;
2041
  var j = 0;
2042
  var result = '';
2043
 
 
 
 
2044
  p = jQuery( clas );
2045
  i = 0;
2046
  j = 0;
@@ -2051,7 +2054,7 @@ var result = '';
2051
  }
2052
  i++;
2053
  }
2054
- result = wppaArrayToEnum( parr, '.' );
2055
 
2056
  return result;
2057
  }
2034
  jQuery( '#'+id ).attr( 'value', wppaArrayToEnum( pararr, '.' ) );
2035
  }
2036
 
2037
+ function wppaGetSelectionEnumByClass( clas, sep ) {
2038
  var p;
2039
  var parr = [];
2040
  var i = 0;
2041
  var j = 0;
2042
  var result = '';
2043
 
2044
+ if ( ! sep ) {
2045
+ sep = '.';
2046
+ }
2047
  p = jQuery( clas );
2048
  i = 0;
2049
  j = 0;
2054
  }
2055
  i++;
2056
  }
2057
+ result = wppaArrayToEnum( parr, sep );
2058
 
2059
  return result;
2060
  }
js/wppa-tinymce-shortcodes.js CHANGED
@@ -2,7 +2,7 @@
2
  * Pachkage: wp-photo-album-plus
3
  *
4
  *
5
- * Version 6.4.05
6
  *
7
  */
8
 
@@ -97,6 +97,7 @@ function wppaGalleryEvaluate() {
97
  jQuery('#wppagallery-tags-cats-tr').hide();
98
  jQuery('#wppagallery-landing-tr').hide();
99
  jQuery('#wppagallery-rootalbum-tr').hide();
 
100
 
101
  // Init shortcode parts
102
  var shortcode = '[wppa';
@@ -137,6 +138,7 @@ function wppaGalleryEvaluate() {
137
  var sep = '';
138
  var landing = '0';
139
  var rootalbum = '0';
 
140
 
141
  // Type
142
  topType = jQuery('#wppagallery-top-type').attr('value');
@@ -259,6 +261,11 @@ function wppaGalleryEvaluate() {
259
  case 'stereo':
260
  miscType = type;
261
  break;
 
 
 
 
 
262
  default:
263
  }
264
  jQuery('#wppagallery-top-type').css('color', '#070');
@@ -285,25 +292,12 @@ function wppaGalleryEvaluate() {
285
  case 'real':
286
  jQuery('#wppagallery-album-real-tr').show();
287
  album = wppaGetSelectionEnumByClass('.wppagallery-album-r');
288
- /*
289
- t = jQuery('.wppagallery-album-r');
290
- var albumarr = [];
291
- i = 0;
292
- j = 0;
293
- while ( i < t.length ) {
294
- if ( t[i].selected ) {
295
- albumarr[j] = t[i].value;
296
- j++;
297
- }
298
- i++;
299
- }
300
- album = wppaArrayToEnum( albumarr, '.' );
301
- */
302
  if ( album != '' ) {
303
  jQuery('#wppagallery-album-type').css('color', '#070');
304
  }
305
  break;
306
  case 'virtual':
 
307
  // Open the right selection box dependant of type is cover or not
308
  // and get the album identifier
309
  if ( type == 'cover') {
@@ -314,6 +308,7 @@ function wppaGalleryEvaluate() {
314
  jQuery('#wppagallery-album-virt-tr').show();
315
  album = jQuery('#wppagallery-album-virt').attr('value');
316
  }
 
317
  // Now displatch on album identifier found
318
  // and get the (optional) additional data
319
  if ( album != '' ) {
@@ -323,7 +318,7 @@ function wppaGalleryEvaluate() {
323
  case '#featen':
324
  case '#comten':
325
  jQuery('#wppagallery-album-realopt-tr').show();
326
- // parent = jQuery('#wppagallery-album-real').attr('value');
327
  // We use parent here for optional album(s), because album is already used for virtual album type
328
  parent = wppaGetSelectionEnumByClass('.wppagallery-album-ropt');
329
  if ( parent == '' ) parent = '0';
@@ -488,6 +483,13 @@ function wppaGalleryEvaluate() {
488
  }
489
  }
490
 
 
 
 
 
 
 
 
491
  // Size
492
  var size = document.getElementById('wppagallery-size').value;
493
  if ( size != '' && size != 'auto' ) {
2
  * Pachkage: wp-photo-album-plus
3
  *
4
  *
5
+ * Version 6.4.14
6
  *
7
  */
8
 
97
  jQuery('#wppagallery-tags-cats-tr').hide();
98
  jQuery('#wppagallery-landing-tr').hide();
99
  jQuery('#wppagallery-rootalbum-tr').hide();
100
+ jQuery('#wppagallery-admins-tr').hide();
101
 
102
  // Init shortcode parts
103
  var shortcode = '[wppa';
138
  var sep = '';
139
  var landing = '0';
140
  var rootalbum = '0';
141
+ var admins = '';
142
 
143
  // Type
144
  topType = jQuery('#wppagallery-top-type').attr('value');
261
  case 'stereo':
262
  miscType = type;
263
  break;
264
+ case 'choice':
265
+ miscType = type;
266
+ jQuery('#wppagallery-admins-tr').show();
267
+ admins = wppaGetSelectionEnumByClass('.wppagallery-admin', ',');
268
+ break;
269
  default:
270
  }
271
  jQuery('#wppagallery-top-type').css('color', '#070');
292
  case 'real':
293
  jQuery('#wppagallery-album-real-tr').show();
294
  album = wppaGetSelectionEnumByClass('.wppagallery-album-r');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  if ( album != '' ) {
296
  jQuery('#wppagallery-album-type').css('color', '#070');
297
  }
298
  break;
299
  case 'virtual':
300
+
301
  // Open the right selection box dependant of type is cover or not
302
  // and get the album identifier
303
  if ( type == 'cover') {
308
  jQuery('#wppagallery-album-virt-tr').show();
309
  album = jQuery('#wppagallery-album-virt').attr('value');
310
  }
311
+
312
  // Now displatch on album identifier found
313
  // and get the (optional) additional data
314
  if ( album != '' ) {
318
  case '#featen':
319
  case '#comten':
320
  jQuery('#wppagallery-album-realopt-tr').show();
321
+
322
  // We use parent here for optional album(s), because album is already used for virtual album type
323
  parent = wppaGetSelectionEnumByClass('.wppagallery-album-ropt');
324
  if ( parent == '' ) parent = '0';
483
  }
484
  }
485
 
486
+ // Admins choice
487
+ if ( type == 'choice' ) {
488
+ if ( admins.length > 0 ) {
489
+ shortcode += ' admin="'+admins+'"';
490
+ }
491
+ }
492
+
493
  // Size
494
  var size = document.getElementById('wppagallery-size').value;
495
  if ( size != '' && size != 'auto' ) {
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.4.13
6
- Stable tag: 6.4.12
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -180,6 +180,25 @@ Oh, just Google on 'picture resizer' and you will find a bunch of free programs
180
 
181
  See for additional information: http://wppa.opajaap.nl/changelog/
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  = 6.4.13 =
184
 
185
  = Bug Fixes =
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.4.14
6
+ Stable tag: 6.4.13
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
180
 
181
  See for additional information: http://wppa.opajaap.nl/changelog/
182
 
183
+ = 6.4.14 =
184
+
185
+ = Bug Fixes =
186
+
187
+ * In shortcode type="search" root="#{album-id}" the search was not always limited to the photos below the album root. Fixed.
188
+
189
+ = New Features =
190
+
191
+ * New shortcode type="choice" admin="admin1,admin2,..." Displayes a box like the admins choice widget, with only the zips from the listed adminstrators/superusers.
192
+ If the admin="" arg is omitted, all available zips are being displayed. Background colors settable in Table III-B12.
193
+ * Send Email to photo owner when comment is approved. Table IV-F5.2.
194
+ * Set owner to the user who's display name equals photoname. Table IV-A28 to set the feature, and Table VIII-B18 to fix existing items.
195
+ * The ability to delete photos at the front-end is now separately settable in Table VII-D2.7, and no longer coupled to the right to edit.
196
+
197
+ = Other Changes =
198
+
199
+ * Reduced number of queries during upload/import.
200
+ * Changed selecions of Table VII-D2.2.
201
+
202
  = 6.4.13 =
203
 
204
  = Bug Fixes =
wppa-admins-choice-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the admins-choice widget
6
- * Version 6.4.10
7
  *
8
  */
9
 
@@ -44,7 +44,7 @@ class AdminsChoice extends WP_Widget {
44
  echo __('This feature is not enabled', 'wp-photo-album-plus');
45
  }
46
  else {
47
- echo '<div class="wppa-admins-choice-widget" >'.wppa_get_admins_choice_html().'</div>';
48
  }
49
 
50
  echo '<div style="clear:both"></div>';
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the admins-choice widget
6
+ * Version 6.4.14
7
  *
8
  */
9
 
44
  echo __('This feature is not enabled', 'wp-photo-album-plus');
45
  }
46
  else {
47
+ echo '<div class="wppa-admins-choice-widget" >'.wppa_get_admins_choice_html( false ).'</div>';
48
  }
49
 
50
  echo '<div style="clear:both"></div>';
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 6.4.11
6
  *
7
  */
8
 
@@ -218,7 +218,7 @@ global $wppa_session;
218
  $tags = wppa_sanitize_tags( $_POST['tags'] );
219
  wppa_update_photo( array( 'id' => $photo, 'tags' => $_POST['tags'] ) );
220
  }
221
-
222
  // Custom fields
223
  $custom = wppa_get_photo_item( $photo, 'custom' );
224
  if ( $custom ) {
@@ -294,6 +294,9 @@ global $wppa_session;
294
  }
295
  if ( isset( $_REQUEST['comment-id'] ) ) {
296
  $iret = $wpdb->query( $wpdb->prepare( "UPDATE `".WPPA_COMMENTS."` SET `status` = 'approved' WHERE `id` = %s", $_REQUEST['comment-id'] ) );
 
 
 
297
  }
298
  if ( $iret ) {
299
  echo 'OK';
@@ -1153,11 +1156,13 @@ global $wppa_session;
1153
  wppa_exit(); // Nonce check failed
1154
  }
1155
 
1156
- // if ( wppa_switch( 'search_comments' ) ) wppa_index_remove( 'photo', $photo );
1157
  $iret = $wpdb->query( $wpdb->prepare( 'UPDATE `'.WPPA_COMMENTS.'` SET `status` = %s WHERE `id` = %s', $comstat, $comid ) );
1158
  if ( wppa_switch( 'search_comments' ) ) wppa_index_update( 'photo', $photo );
1159
 
1160
  if ( $iret !== false ) {
 
 
 
1161
  echo '||0||'.sprintf( __( 'Status of comment #%s updated' , 'wp-photo-album-plus'), $comid );
1162
  }
1163
  else {
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 6.4.14
6
  *
7
  */
8
 
218
  $tags = wppa_sanitize_tags( $_POST['tags'] );
219
  wppa_update_photo( array( 'id' => $photo, 'tags' => $_POST['tags'] ) );
220
  }
221
+
222
  // Custom fields
223
  $custom = wppa_get_photo_item( $photo, 'custom' );
224
  if ( $custom ) {
294
  }
295
  if ( isset( $_REQUEST['comment-id'] ) ) {
296
  $iret = $wpdb->query( $wpdb->prepare( "UPDATE `".WPPA_COMMENTS."` SET `status` = 'approved' WHERE `id` = %s", $_REQUEST['comment-id'] ) );
297
+ if ( $iret ) {
298
+ wppa_send_comment_approved_email( $_REQUEST['comment-id'] );
299
+ }
300
  }
301
  if ( $iret ) {
302
  echo 'OK';
1156
  wppa_exit(); // Nonce check failed
1157
  }
1158
 
 
1159
  $iret = $wpdb->query( $wpdb->prepare( 'UPDATE `'.WPPA_COMMENTS.'` SET `status` = %s WHERE `id` = %s', $comstat, $comid ) );
1160
  if ( wppa_switch( 'search_comments' ) ) wppa_index_update( 'photo', $photo );
1161
 
1162
  if ( $iret !== false ) {
1163
+ if ( $comstat == 'approved' ) {
1164
+ wppa_send_comment_approved_email( $comid );
1165
+ }
1166
  echo '||0||'.sprintf( __( 'Status of comment #%s updated' , 'wp-photo-album-plus'), $comid );
1167
  }
1168
  else {
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 6.4.12
7
  *
8
  */
9
 
@@ -847,8 +847,30 @@ global $wppa_session;
847
  return $result;
848
  }
849
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
850
  // The admins choice html
851
- function wppa_get_admins_choice_html() {
852
 
853
  // Find zip dir
854
  $zipsdir = WPPA_UPLOAD_PATH.'/zips/';
@@ -856,9 +878,19 @@ function wppa_get_admins_choice_html() {
856
  // Find all zipfiles
857
  $zipfiles = glob($zipsdir.'*.zip');
858
 
 
 
 
 
 
 
 
 
859
  if ( $zipfiles ) {
860
 
861
- $result = '<ul>';
 
 
862
 
863
  // Compose the current users zip filename
864
  $myzip = $zipsdir.wppa_get_user().'.zip';
@@ -868,33 +900,37 @@ function wppa_get_admins_choice_html() {
868
  // Find zipfiles user
869
  $user = wppa_strip_ext( basename( $zipfile ) );
870
 
871
- // Check file existance
872
- if ( is_file( $zipfile ) ) {
873
 
874
- // Open zip
875
- $wppa_zip = new ZipArchive;
876
- $wppa_zip->open( $zipfile );
877
- if ( $wppa_zip ) {
878
 
879
- // Look photos up in zip
880
- $title = '';
881
- for( $i = 0; $i < $wppa_zip->numFiles; $i++ ) {
882
- $stat = $wppa_zip->statIndex( $i );
883
- $title .= esc_attr($stat['name']) . "\n";
884
- }
885
- $result .= '<li title="'.$title.'" >' .
886
- '<a href="'. WPPA_UPLOAD_URL.'/zips/'.basename($zipfile).'" >' .
887
- $user .
888
- '</a>';
889
- if ( $zipfile == $myzip ) {
890
- $result .=
891
- '<a' .
892
- ' onclick="wppaAjaxDeleteMyZip();"' .
893
- ' style="float:right;cursor:pointer;" >' .
894
- __('Delete', 'wp-photo-album-plus') .
895
  '</a>';
896
- }
897
- $result .= '</li>';
 
 
 
 
 
 
 
 
898
  }
899
  }
900
  }
@@ -3850,3 +3886,4 @@ function wppa_get_responsive_widget_js_html( $mocc ) {
3850
 
3851
  return $result;
3852
  }
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 6.4.14
7
  *
8
  */
9
 
847
  return $result;
848
  }
849
 
850
+ // The admins choice box
851
+ function wppa_admins_choice_box( $admins ) {
852
+
853
+ if ( is_feed() ) return;
854
+
855
+ wppa_container( 'open' );
856
+
857
+ wppa_out(
858
+ '<div' .
859
+ ' id="wppa-adminschoice-' . wppa( 'mocc' ) . '"' .
860
+ ' class="wppa-box wppa-adminschoice"' .
861
+ ' style="' . __wcs( 'wppa-box' ) . __wcs( 'wppa-adminschoice' ) . '"' .
862
+ ' >' .
863
+ wppa_get_admins_choice_html( $admins ) .
864
+ '<div class="wppa-clear" style="'.__wis( 'clear:both;' ).'" >' .
865
+ '</div>' .
866
+ '</div>'
867
+ );
868
+
869
+ wppa_container( 'close' );
870
+ }
871
+
872
  // The admins choice html
873
+ function wppa_get_admins_choice_html( $admins ) {
874
 
875
  // Find zip dir
876
  $zipsdir = WPPA_UPLOAD_PATH.'/zips/';
878
  // Find all zipfiles
879
  $zipfiles = glob($zipsdir.'*.zip');
880
 
881
+ // admins specified?
882
+ if ( $admins ) {
883
+ $admin_arr = explode( ',', $admins );
884
+ }
885
+ else {
886
+ $admin_arr = false;
887
+ }
888
+
889
  if ( $zipfiles ) {
890
 
891
+ $result = '<ul' .
892
+ ( ! wppa( 'in_widget' ) ? ' style="list-style-position:inside;margin:0;padding:0;"' : '' ) .
893
+ ' >';
894
 
895
  // Compose the current users zip filename
896
  $myzip = $zipsdir.wppa_get_user().'.zip';
900
  // Find zipfiles user
901
  $user = wppa_strip_ext( basename( $zipfile ) );
902
 
903
+ // Do we need this one?
904
+ if ( ! $admin_arr || in_array( $user, $admin_arr ) ) {
905
 
906
+ // Check file existance
907
+ if ( is_file( $zipfile ) ) {
 
 
908
 
909
+ // Open zip
910
+ $wppa_zip = new ZipArchive;
911
+ $wppa_zip->open( $zipfile );
912
+ if ( $wppa_zip ) {
913
+
914
+ // Look photos up in zip
915
+ $title = '';
916
+ for( $i = 0; $i < $wppa_zip->numFiles; $i++ ) {
917
+ $stat = $wppa_zip->statIndex( $i );
918
+ $title .= esc_attr($stat['name']) . "\n";
919
+ }
920
+ $result .= '<li title="'.$title.'" >' .
921
+ '<a href="'. WPPA_UPLOAD_URL.'/zips/'.basename($zipfile).'" >' .
922
+ $user .
 
 
923
  '</a>';
924
+ if ( $zipfile == $myzip ) {
925
+ $result .=
926
+ '<a' .
927
+ ' onclick="wppaAjaxDeleteMyZip();"' .
928
+ ' style="float:right;cursor:pointer;" >' .
929
+ __('Delete', 'wp-photo-album-plus') .
930
+ '</a>';
931
+ }
932
+ $result .= '</li>';
933
+ }
934
  }
935
  }
936
  }
3886
 
3887
  return $result;
3888
  }
3889
+
wppa-comment-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
- * Version 6.3.11
7
  *
8
  */
9
 
@@ -122,12 +122,20 @@ global $wpdb;
122
  // Bulk actions
123
  if (isset($_POST['bulkaction'])) switch ($_POST['bulkaction']) {
124
  case 'approveall':
 
125
  $query = "UPDATE " . WPPA_COMMENTS . " SET status = 'approved' WHERE status = 'pending'";
126
  if ( $wpdb->query($query) === false ) {
127
  wppa_error_message(__('Could not bulk update status', 'wp-photo-album-plus'));
128
  $iret = false;
129
  }
130
- else $iret = true;
 
 
 
 
 
 
 
131
  break;
132
  case 'spamall':
133
  $query = "UPDATE " . WPPA_COMMENTS . " SET status = 'spam' WHERE status = 'pending'";
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
+ * Version 6.4.14
7
  *
8
  */
9
 
122
  // Bulk actions
123
  if (isset($_POST['bulkaction'])) switch ($_POST['bulkaction']) {
124
  case 'approveall':
125
+ $coms_to_proc = $wpdb->get_results( "SELECT `id` FROM `" . WPPA_COMMENTS . "` WHERE status = 'pending'", ARRAY_A );
126
  $query = "UPDATE " . WPPA_COMMENTS . " SET status = 'approved' WHERE status = 'pending'";
127
  if ( $wpdb->query($query) === false ) {
128
  wppa_error_message(__('Could not bulk update status', 'wp-photo-album-plus'));
129
  $iret = false;
130
  }
131
+ else {
132
+ if ( $coms_to_proc ) {
133
+ foreach( $coms_to_proc as $item ) {
134
+ wppa_send_comment_approved_email( $item['id'] );
135
+ }
136
+ }
137
+ $iret = true;
138
+ }
139
  break;
140
  case 'spamall':
141
  $query = "UPDATE " . WPPA_COMMENTS . " SET status = 'spam' WHERE status = 'pending'";
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.4.10
6
  *
7
  */
8
 
@@ -268,6 +268,9 @@ global $thumbs;
268
  'coverphoto_pos' => '',
269
  'forceroot' => '',
270
  'landingpage' => '',
 
 
 
271
  );
272
  }
273
 
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 6.4.14
6
  *
7
  */
8
 
268
  'coverphoto_pos' => '',
269
  'forceroot' => '',
270
  'landingpage' => '',
271
+ 'is_admins_choice' => false,
272
+ 'admins_choice_users' => '',
273
+
274
  );
275
  }
276
 
wppa-encrypt.php CHANGED
@@ -192,7 +192,7 @@ global $wpdb;
192
  else {
193
  $id = $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `" . WPPA_ALBUMS . "` WHERE `crypt` = %s", $crypt ) );
194
  if ( ! $id ) {
195
- wppa_log( 'Err', 'Invalid album identifier: ' . $album, true );
196
  $id = '-9';
197
  }
198
  }
192
  else {
193
  $id = $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `" . WPPA_ALBUMS . "` WHERE `crypt` = %s", $crypt ) );
194
  if ( ! $id ) {
195
+ wppa_log( 'Err', 'Invalid album identifier: ' . $album );
196
  $id = '-9';
197
  }
198
  }
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via filter
6
- * Version 6.4.03
7
  *
8
  */
9
 
@@ -263,6 +263,7 @@ global $wppa_postid;
263
  'all' => '',
264
  'reverse' => '',
265
  'landing' => '',
 
266
  ), $xatts );
267
 
268
  // Find occur
@@ -295,6 +296,8 @@ global $wppa_postid;
295
  $wppa['is_url'] = false;
296
  $wppa['forceroot'] = '';
297
  $wppa['landingpage'] = '';
 
 
298
 
299
  // Find type
300
  switch ( $atts['type'] ) {
@@ -418,6 +421,10 @@ global $wppa_postid;
418
  $wppa['is_url'] = true;
419
  $wppa['single_photo'] = $atts['photo'];
420
  break;
 
 
 
 
421
 
422
  default:
423
  wppa_dbg_msg ( 'Invalid type: '.$atts['type'].' in wppa shortcode.', 'red', 'force' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via filter
6
+ * Version 6.4.14
7
  *
8
  */
9
 
263
  'all' => '',
264
  'reverse' => '',
265
  'landing' => '',
266
+ 'admin' => '',
267
  ), $xatts );
268
 
269
  // Find occur
296
  $wppa['is_url'] = false;
297
  $wppa['forceroot'] = '';
298
  $wppa['landingpage'] = '';
299
+ $wppa['is_admins_choice'] = false;
300
+ $wppa['admins_choice_users'] = '';
301
 
302
  // Find type
303
  switch ( $atts['type'] ) {
421
  $wppa['is_url'] = true;
422
  $wppa['single_photo'] = $atts['photo'];
423
  break;
424
+ case 'choice':
425
+ $wppa['is_admins_choice'] = true;
426
+ $wppa['admins_choice_users'] = $atts['admin'];
427
+ break;
428
 
429
  default:
430
  wppa_dbg_msg ( 'Invalid type: '.$atts['type'].' in wppa shortcode.', 'red', 'force' );
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various funcions
6
- * Version 6.4.12
7
  *
8
  */
9
 
@@ -210,6 +210,13 @@ global $wppa_session;
210
 
211
  // 3. The filter supplied the data
212
  else {
 
 
 
 
 
 
 
213
  if ( wppa( 'bestof' ) ) {
214
  $args = wppa( 'bestof_args' );
215
  wppa_bestof_box ( $args );
@@ -663,7 +670,7 @@ global $wppa_session;
663
  }
664
 
665
  // Subsearch or rootsearch?
666
- if ( wppa( 'occur' ) == '1' && $wppa_session['has_searchbox'] && ! wppa( 'in_widget' ) ) {
667
 
668
  // Is it a search now?
669
  if ( wppa( 'src' ) ) {
@@ -688,6 +695,7 @@ global $wppa_session;
688
  wppa_save_session();
689
  }
690
 
 
691
  }
692
 
693
  // It is not a search now
@@ -1828,7 +1836,7 @@ global $wpdb;
1828
 
1829
  // Log query
1830
  wppa_dbg_q( 'Q-TG' );
1831
- wppa_dbg_msg( $query );
1832
  wppa( 'thumb_count', $count );
1833
  $time += microtime( true );
1834
  wppa_dbg_msg( 'Get thumbs query took ' . $time . ' seconds. ' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various funcions
6
+ * Version 6.4.14
7
  *
8
  */
9
 
210
 
211
  // 3. The filter supplied the data
212
  else {
213
+ if ( wppa( 'is_admins_choice' ) ) {
214
+ $args = wppa( 'admins_choice_users' );
215
+ wppa_admins_choice_box( $args );
216
+ $out = wppa( 'out' );
217
+ wppa_reset_occurrance();
218
+ return $out;
219
+ }
220
  if ( wppa( 'bestof' ) ) {
221
  $args = wppa( 'bestof_args' );
222
  wppa_bestof_box ( $args );
670
  }
671
 
672
  // Subsearch or rootsearch?
673
+ if ( wppa( 'occur' ) == '1' && ! wppa( 'in_widget' ) && ( $wppa_session['has_searchbox'] || isset( $_REQUEST['wppa-forceroot'] ) ) ) {
674
 
675
  // Is it a search now?
676
  if ( wppa( 'src' ) ) {
695
  wppa_save_session();
696
  }
697
 
698
+ wppa_dbg_msg( 'Forceroot='.(isset( $_REQUEST['wppa-forceroot'] )?$_REQUEST['wppa-forceroot']:'none').', is_rootsearch='.wppa('is_rootsearch').', start_album='.wppa('start_album'), 'red');
699
  }
700
 
701
  // It is not a search now
1836
 
1837
  // Log query
1838
  wppa_dbg_q( 'Q-TG' );
1839
+ wppa_dbg_msg( $query, 'red' );
1840
  wppa( 'thumb_count', $count );
1841
  $time += microtime( true );
1842
  wppa_dbg_msg( 'Get thumbs query took ' . $time . ' seconds. ' .
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.4.10
7
  *
8
  */
9
 
@@ -55,6 +55,7 @@ global $wppa_supported_audio_extensions;
55
  'wppa_crypt_photos',
56
  'wppa_crypt_albums',
57
  'wppa_create_o1_files',
 
58
 
59
 
60
  );
@@ -146,6 +147,11 @@ global $wppa_supported_audio_extensions;
146
  update_option( 'wppa_album_crypt_2', wppa_get_unique_photo_crypt() );
147
  update_option( 'wppa_album_crypt_3', wppa_get_unique_photo_crypt() );
148
  break;
 
 
 
 
 
149
 
150
 
151
  }
@@ -237,6 +243,7 @@ global $wppa_supported_audio_extensions;
237
  case 'wppa_crypt_photos':
238
  case 'wppa_test_proc':
239
  case 'wppa_create_o1_files':
 
240
 
241
  // Process photos
242
  $table = WPPA_PHOTOS;
@@ -578,6 +585,21 @@ global $wppa_supported_audio_extensions;
578
  wppa_update_photo( array( 'id' => $photo['id'], 'crypt' => wppa_get_unique_photo_crypt() ) );
579
  break;
580
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
581
  case 'wppa_test_proc':
582
  $tags = '';
583
  $albid = $photo['album'];
@@ -592,10 +614,6 @@ global $wppa_supported_audio_extensions;
592
  wppa_update_photo( array( 'id' => $photo['id'], 'tags' => wppa_sanitize_tags( $tags ) ) );
593
  break;
594
 
595
- case 'wppa_create_o1_files':
596
- wppa_make_o1_source( $photo['id'] );
597
- break;
598
-
599
  }
600
  // Test for timeout / ready
601
  $lastid = $id;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 6.4.14
7
  *
8
  */
9
 
55
  'wppa_crypt_photos',
56
  'wppa_crypt_albums',
57
  'wppa_create_o1_files',
58
+ 'wppa_owner_to_name_proc',
59
 
60
 
61
  );
147
  update_option( 'wppa_album_crypt_2', wppa_get_unique_photo_crypt() );
148
  update_option( 'wppa_album_crypt_3', wppa_get_unique_photo_crypt() );
149
  break;
150
+ case 'wppa_owner_to_name_proc':
151
+ if ( ! wppa_switch( 'owner_to_name' ) ) {
152
+ echo __( 'Feature must be enabled in Table IV-A28 first', 'wp-photo-album-plus' ).'||'.$slug.'||||||';
153
+ wppa_exit();
154
+ }
155
 
156
 
157
  }
243
  case 'wppa_crypt_photos':
244
  case 'wppa_test_proc':
245
  case 'wppa_create_o1_files':
246
+ case 'wppa_owner_to_name_proc':
247
 
248
  // Process photos
249
  $table = WPPA_PHOTOS;
585
  wppa_update_photo( array( 'id' => $photo['id'], 'crypt' => wppa_get_unique_photo_crypt() ) );
586
  break;
587
 
588
+ case 'wppa_create_o1_files':
589
+ wppa_make_o1_source( $photo['id'] );
590
+ break;
591
+
592
+ case 'wppa_owner_to_name_proc':
593
+ $iret = wppa_set_owner_to_name( $id );
594
+ if ( $iret === true ) {
595
+ $wppa_session[$slug.'_fixed']++;
596
+ }
597
+ if ( $iret === '0' ) {
598
+ $wppa_session[$slug.'_skipped']++;
599
+ }
600
+
601
+
602
+
603
  case 'wppa_test_proc':
604
  $tags = '';
605
  $albid = $photo['album'];
614
  wppa_update_photo( array( 'id' => $photo['id'], 'tags' => wppa_sanitize_tags( $tags ) ) );
615
  break;
616
 
 
 
 
 
617
  }
618
  // Test for timeout / ready
619
  $lastid = $id;
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.4.13
7
  *
8
  */
9
 
@@ -134,7 +134,7 @@ global $wpdb;
134
 
135
  if ( empty( $photos ) ) {
136
  if ( $photo ) {
137
- echo '<div id="photoitem-'.$photo.'" class="photoitem" style="width: 99%; background-color: rgb( 255, 255, 224 ); border-color: rgb( 230, 219, 85 );">
138
  <span style="color:red">'.sprintf( __( 'Photo %s has been removed.' , 'wp-photo-album-plus'), $photo ).'</span>
139
  </div>';
140
  }
@@ -163,10 +163,10 @@ global $wpdb;
163
  $has_audio = wppa_has_audio( $photo['id'] );
164
  ?>
165
  <a id="photo_<?php echo $photo['id'] ?>" name="photo_<?php echo $photo['id'] ?>"></a>
166
- <div class="widefat wppa-table-wrap" id="photoitem-<?php echo $photo['id'] ?>" style="width:99%; position: relative;" >
167
 
168
  <!-- Left half starts here -->
169
- <div style="width:49.5%; float:left; border-right:1px solid #ccc; margin-right:0;">
170
  <input type="hidden" id="photo-nonce-<?php echo $photo['id'] ?>" value="<?php echo wp_create_nonce( 'wppa_nonce_'.$photo['id'] ); ?>" />
171
  <table class="wppa-table wppa-photo-table" style="width:98%" >
172
  <tbody>
@@ -362,9 +362,9 @@ global $wpdb;
362
  style=""
363
  <?php $q = wppa_is_video( $photo['id'] ) ? esc_js( __( 'Are you sure you want to move this video?' , 'wp-photo-album-plus') ) : esc_js( __( 'Are you sure you want to move this photo?' , 'wp-photo-album-plus') ) ?>
364
  onclick="if( document.getElementById( 'moveto-<?php echo( $photo['id'] ) ?>' ).value != 0 ) { if ( confirm( '<?php echo $q ?>' ) ) wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'moveto', document.getElementById( 'moveto-<?php echo( $photo['id'] ) ?>' ) ) } else { alert( '<?php echo esc_js( __( 'Please select an album to move to first.' , 'wp-photo-album-plus') ) ?>' ); return false;}"
365
- value="<?php
366
- echo ( wppa_is_video( $photo['id'] ) ?
367
- esc_attr( __( 'Move video to' , 'wp-photo-album-plus') ) :
368
  esc_attr( __( 'Move photo to' , 'wp-photo-album-plus') ) ) ?>"
369
  />
370
  </th>
@@ -379,10 +379,10 @@ global $wpdb;
379
  style=""
380
  <?php $q = wppa_is_video( $photo['id'] ) ? esc_js( __( 'Are you sure you want to copy this video?' , 'wp-photo-album-plus') ) : esc_js( __( 'Are you sure you want to copy this photo?' , 'wp-photo-album-plus') ) ?>
381
  onclick="if ( document.getElementById( 'copyto-<?php echo( $photo['id'] ) ?>' ).value != 0 ) { if ( confirm( '<?php echo $q ?>' ) ) wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'copyto', document.getElementById( 'copyto-<?php echo( $photo['id'] ) ?>' ) ) } else { alert( '<?php echo esc_js( __( 'Please select an album to copy to first.' , 'wp-photo-album-plus') ) ?>' ); return false;}"
382
- value="<?php
383
- echo ( wppa_is_video( $photo['id'] ) ?
384
- esc_attr( __( 'Copy video to' , 'wp-photo-album-plus') ) :
385
- esc_attr( __( 'Copy photo to' , 'wp-photo-album-plus') ) ) ?>"
386
  />
387
  </th>
388
  <td >
@@ -398,9 +398,9 @@ global $wpdb;
398
  <input
399
  type="button"
400
  style="color:red;"
401
- <?php
402
- $q = wppa_is_video( $photo['id'] ) ?
403
- __( 'Are you sure you want to delete this video?' , 'wp-photo-album-plus') :
404
  __( 'Are you sure you want to delete this photo?' , 'wp-photo-album-plus') ?>
405
  onclick="if ( confirm( '<?php echo $q ?>' ) ) wppaAjaxDeletePhoto( <?php echo $photo['id'] ?> )"
406
  value="<?php echo ( wppa_is_video( $photo['id'] ) ? esc_attr( __( 'Delete video' , 'wp-photo-album-plus') ) : esc_attr( __( 'Delete photo' , 'wp-photo-album-plus') ) ) ?>"
@@ -474,7 +474,7 @@ global $wpdb;
474
  </div>
475
 
476
  <!-- Right half starts here -->
477
- <div style="width:50%; float:left; border-left:1px solid #ccc; margin-left:-1px;">
478
  <table class="wppa-table wppa-photo-table" >
479
  <tbody>
480
 
@@ -1007,7 +1007,7 @@ global $wpdb;
1007
  $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_COMMENTS."` WHERE `photo` = %s ORDER BY `timestamp` DESC", $photo['id'] ), ARRAY_A );
1008
  if ( $comments ) {
1009
  ?>
1010
- <div class="widefat" style="width:99%; font-size:11px;" >
1011
  <table class="wppa-table widefat wppa-setting-table" >
1012
  <thead>
1013
  <tr style="font-weight:bold;" >
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 6.4.14
7
  *
8
  */
9
 
134
 
135
  if ( empty( $photos ) ) {
136
  if ( $photo ) {
137
+ echo '<div id="photoitem-'.$photo.'" class="photoitem" style="width:100%; background-color: rgb( 255, 255, 224 ); border-color: rgb( 230, 219, 85 );">
138
  <span style="color:red">'.sprintf( __( 'Photo %s has been removed.' , 'wp-photo-album-plus'), $photo ).'</span>
139
  </div>';
140
  }
163
  $has_audio = wppa_has_audio( $photo['id'] );
164
  ?>
165
  <a id="photo_<?php echo $photo['id'] ?>" name="photo_<?php echo $photo['id'] ?>"></a>
166
+ <div class="widefat wppa-table-wrap" id="photoitem-<?php echo $photo['id'] ?>" style="width:100%; position: relative;" >
167
 
168
  <!-- Left half starts here -->
169
+ <div style="width:50%; float:left; border-right:1px solid #ccc; margin-right:-1px;">
170
  <input type="hidden" id="photo-nonce-<?php echo $photo['id'] ?>" value="<?php echo wp_create_nonce( 'wppa_nonce_'.$photo['id'] ); ?>" />
171
  <table class="wppa-table wppa-photo-table" style="width:98%" >
172
  <tbody>
362
  style=""
363
  <?php $q = wppa_is_video( $photo['id'] ) ? esc_js( __( 'Are you sure you want to move this video?' , 'wp-photo-album-plus') ) : esc_js( __( 'Are you sure you want to move this photo?' , 'wp-photo-album-plus') ) ?>
364
  onclick="if( document.getElementById( 'moveto-<?php echo( $photo['id'] ) ?>' ).value != 0 ) { if ( confirm( '<?php echo $q ?>' ) ) wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'moveto', document.getElementById( 'moveto-<?php echo( $photo['id'] ) ?>' ) ) } else { alert( '<?php echo esc_js( __( 'Please select an album to move to first.' , 'wp-photo-album-plus') ) ?>' ); return false;}"
365
+ value="<?php
366
+ echo ( wppa_is_video( $photo['id'] ) ?
367
+ esc_attr( __( 'Move video to' , 'wp-photo-album-plus') ) :
368
  esc_attr( __( 'Move photo to' , 'wp-photo-album-plus') ) ) ?>"
369
  />
370
  </th>
379
  style=""
380
  <?php $q = wppa_is_video( $photo['id'] ) ? esc_js( __( 'Are you sure you want to copy this video?' , 'wp-photo-album-plus') ) : esc_js( __( 'Are you sure you want to copy this photo?' , 'wp-photo-album-plus') ) ?>
381
  onclick="if ( document.getElementById( 'copyto-<?php echo( $photo['id'] ) ?>' ).value != 0 ) { if ( confirm( '<?php echo $q ?>' ) ) wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'copyto', document.getElementById( 'copyto-<?php echo( $photo['id'] ) ?>' ) ) } else { alert( '<?php echo esc_js( __( 'Please select an album to copy to first.' , 'wp-photo-album-plus') ) ?>' ); return false;}"
382
+ value="<?php
383
+ echo ( wppa_is_video( $photo['id'] ) ?
384
+ esc_attr( __( 'Copy video to' , 'wp-photo-album-plus') ) :
385
+ esc_attr( __( 'Copy photo to' , 'wp-photo-album-plus') ) ) ?>"
386
  />
387
  </th>
388
  <td >
398
  <input
399
  type="button"
400
  style="color:red;"
401
+ <?php
402
+ $q = wppa_is_video( $photo['id'] ) ?
403
+ __( 'Are you sure you want to delete this video?' , 'wp-photo-album-plus') :
404
  __( 'Are you sure you want to delete this photo?' , 'wp-photo-album-plus') ?>
405
  onclick="if ( confirm( '<?php echo $q ?>' ) ) wppaAjaxDeletePhoto( <?php echo $photo['id'] ?> )"
406
  value="<?php echo ( wppa_is_video( $photo['id'] ) ? esc_attr( __( 'Delete video' , 'wp-photo-album-plus') ) : esc_attr( __( 'Delete photo' , 'wp-photo-album-plus') ) ) ?>"
474
  </div>
475
 
476
  <!-- Right half starts here -->
477
+ <div style="width:50%; float:left; border-left:0px solid #ccc; margin-left:0px;">
478
  <table class="wppa-table wppa-photo-table" >
479
  <tbody>
480
 
1007
  $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_COMMENTS."` WHERE `photo` = %s ORDER BY `timestamp` DESC", $photo['id'] ), ARRAY_A );
1008
  if ( $comments ) {
1009
  ?>
1010
+ <div class="widefat" style="width:100%; font-size:11px;" >
1011
  <table class="wppa-table widefat wppa-setting-table" >
1012
  <thead>
1013
  <tr style="font-weight:bold;" >
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 6.4.12
7
  *
8
  */
9
 
@@ -35,7 +35,12 @@ global $wppa_tags;
35
  //wppa_fe_edit_new_style(4145);
36
  // Test area
37
  // echo '<!-- Start Test area ---><br />';
38
-
 
 
 
 
 
39
  // To demonstrate wpautop() destructifies inline script:
40
 
41
  // Large version:
@@ -3254,6 +3259,19 @@ global $wppa_tags;
3254
  $tags = 'layout';
3255
  wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
3256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3257
  }
3258
  ?>
3259
  </tbody>
@@ -3588,6 +3606,15 @@ global $wppa_tags;
3588
  $tags = 'system';
3589
  wppa_setting($slug, '27', $name, $desc, $html, $help, $clas, $tags);
3590
 
 
 
 
 
 
 
 
 
 
3591
  }
3592
  wppa_setting_subheader( 'B', '1', __( 'Slideshow related settings' , 'wp-photo-album-plus') );
3593
  {
@@ -4351,6 +4378,15 @@ global $wppa_tags;
4351
  $tags = 'comment';
4352
  wppa_setting($slug, '5.1', $name, $desc, $html, $help, $clas, $tags);
4353
 
 
 
 
 
 
 
 
 
 
4354
  $name = __('Comment ntfy added', 'wp-photo-album-plus');
4355
  $desc = __('Show "Comment added" after successfull adding a comment.', 'wp-photo-album-plus');
4356
  $help = '';
@@ -6176,8 +6212,8 @@ global $wppa_tags;
6176
  $desc = __('The criteria the user must meet to edit photo info', 'wp-photo-album-plus');
6177
  $help = '';
6178
  $slug = 'wppa_upload_edit_users';
6179
- $opts = array( __('The uploader', 'wp-photo-album-plus'), __('Username equals photoname', 'wp-photo-album-plus' ) );
6180
- $vals = array( 'owner','equalname' );
6181
  $html1 = wppa_select($slug, $opts, $vals);
6182
  $html2 = '';
6183
  $html = array( $html1, $html2 );
@@ -6233,6 +6269,17 @@ global $wppa_tags;
6233
  $tags = 'layout,system,upload';
6234
  wppa_setting($slug1, '2.6', $name, $desc, $html, $help, $clas, $tags);
6235
 
 
 
 
 
 
 
 
 
 
 
 
6236
  $name = __('Uploader Moderate Comment', 'wp-photo-album-plus');
6237
  $desc = __('The owner of the photo can moderate the photos comments.', 'wp-photo-album-plus');
6238
  $help = esc_js(__('This setting requires "Uploader edit" to be enabled also.', 'wp-photo-album-plus'));
@@ -6736,7 +6783,6 @@ global $wppa_tags;
6736
  $tags = 'system';
6737
  wppa_setting(false, '15', $name, $desc, $html, $help, $clas, $tags);
6738
 
6739
-
6740
  wppa_setting_subheader('B', '4', __('Clearing and other irreverseable actions', 'wp-photo-album-plus'));
6741
 
6742
  $name = __('Clear ratings', 'wp-photo-album-plus');
@@ -7019,6 +7065,19 @@ global $wppa_tags;
7019
  $tags = 'system';
7020
  wppa_setting(false, '17', $name, $desc, $html, $help, $clas, $tags);
7021
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7022
  /*
7023
  $name = __('Test proc');
7024
  $desc = __('For OpaJaap only');
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 6.4.14
7
  *
8
  */
9
 
35
  //wppa_fe_edit_new_style(4145);
36
  // Test area
37
  // echo '<!-- Start Test area ---><br />';
38
+ //$users = get_users( array( 'role' => 'administrator' ) );
39
+ //foreach( $users as $user ) {
40
+ // echo $user->data->user_login,'<br />';
41
+ // $us = get_user_by('ID', $user['data']['id']);
42
+ //}
43
+ //var_dump($users);
44
  // To demonstrate wpautop() destructifies inline script:
45
 
46
  // Large version:
3259
  $tags = 'layout';
3260
  wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
3261
 
3262
+ $name = __('Admins choice', 'wp-photo-album-plus');
3263
+ $desc = __('Admins choice box background.', 'wp-photo-album-plus');
3264
+ $help = esc_js(__('Enter valid CSS colors for admins choice box backgrounds and borders.', 'wp-photo-album-plus'));
3265
+ $slug1 = 'wppa_bgcolor_adminschoice';
3266
+ $slug2 = 'wppa_bcolor_adminschoice';
3267
+ $slug = array($slug1, $slug2);
3268
+ $html1 = wppa_input($slug1, '100px', '', '', "checkColor('".$slug1."')") . '</td><td>' . wppa_color_box($slug1);
3269
+ $html2 = wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2);
3270
+ $html = array($html1, $html2);
3271
+ $clas = '';
3272
+ $tags = 'layout';
3273
+ wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags);
3274
+
3275
  }
3276
  ?>
3277
  </tbody>
3606
  $tags = 'system';
3607
  wppa_setting($slug, '27', $name, $desc, $html, $help, $clas, $tags);
3608
 
3609
+ $name = __('Make owner like photoname', 'wp-photo-album-plus');
3610
+ $desc = __('Change the owner to the user who\'s display name equals photoname.', 'wp-photo-album-plus');
3611
+ $help = '';
3612
+ $slug = 'wppa_owner_to_name';
3613
+ $html = wppa_checkbox($slug);
3614
+ $clas = '';
3615
+ $tags = 'system';
3616
+ wppa_setting($slug, '28', $name, $desc, $html, $help, $clas, $tags);
3617
+
3618
  }
3619
  wppa_setting_subheader( 'B', '1', __( 'Slideshow related settings' , 'wp-photo-album-plus') );
3620
  {
4378
  $tags = 'comment';
4379
  wppa_setting($slug, '5.1', $name, $desc, $html, $help, $clas, $tags);
4380
 
4381
+ $name = __('Comment notify approved', 'wp-photo-album-plus');
4382
+ $desc = __('Notify photo owner of approved comment.', 'wp-photo-album-plus');
4383
+ $help = '';
4384
+ $slug = 'wppa_com_notify_approved';
4385
+ $html = wppa_checkbox($slug);
4386
+ $clas = 'wppa_comment_';
4387
+ $tags = 'comment';
4388
+ wppa_setting($slug, '5.2', $name, $desc, $html, $help, $clas, $tags);
4389
+
4390
  $name = __('Comment ntfy added', 'wp-photo-album-plus');
4391
  $desc = __('Show "Comment added" after successfull adding a comment.', 'wp-photo-album-plus');
4392
  $help = '';
6212
  $desc = __('The criteria the user must meet to edit photo info', 'wp-photo-album-plus');
6213
  $help = '';
6214
  $slug = 'wppa_upload_edit_users';
6215
+ $opts = array( __('Admin and superuser', 'wp-photo-album-plus'), __('Owner, admin and superuser', 'wp-photo-album-plus' ) );
6216
+ $vals = array( 'admin', 'owner' );//array( 'owner','equalname' );
6217
  $html1 = wppa_select($slug, $opts, $vals);
6218
  $html2 = '';
6219
  $html = array( $html1, $html2 );
6269
  $tags = 'layout,system,upload';
6270
  wppa_setting($slug1, '2.6', $name, $desc, $html, $help, $clas, $tags);
6271
 
6272
+ $name = __('Frontend Delete', 'wp-photo-album-plus');
6273
+ $desc = __('Allow the uploader to delete the photo', 'wp-photo-album-plus');
6274
+ $help = '';
6275
+ $slug = 'wppa_upload_delete';
6276
+ $html1 = wppa_checkbox($slug);
6277
+ $html2 = '';
6278
+ $html = array( $html1, $html2 );
6279
+ $clas = '';
6280
+ $tags = 'access,system,upload';
6281
+ wppa_setting($slug, '2.7', $name, $desc, $html, $help, $clas, $tags);
6282
+
6283
  $name = __('Uploader Moderate Comment', 'wp-photo-album-plus');
6284
  $desc = __('The owner of the photo can moderate the photos comments.', 'wp-photo-album-plus');
6285
  $help = esc_js(__('This setting requires "Uploader edit" to be enabled also.', 'wp-photo-album-plus'));
6783
  $tags = 'system';
6784
  wppa_setting(false, '15', $name, $desc, $html, $help, $clas, $tags);
6785
 
 
6786
  wppa_setting_subheader('B', '4', __('Clearing and other irreverseable actions', 'wp-photo-album-plus'));
6787
 
6788
  $name = __('Clear ratings', 'wp-photo-album-plus');
7065
  $tags = 'system';
7066
  wppa_setting(false, '17', $name, $desc, $html, $help, $clas, $tags);
7067
 
7068
+ $name = __('Set owner to name', 'wp-photo-album-plus');
7069
+ $desc = __('If photoname equals user display name, set him owner.', 'wp-photo-album-plus');
7070
+ $help = '';
7071
+ $slug2 = 'wppa_owner_to_name_proc';
7072
+ $html1 = '';
7073
+ $html2 = wppa_maintenance_button( $slug2 );
7074
+ $html3 = wppa_status_field( $slug2 );
7075
+ $html4 = wppa_togo_field( $slug2 );
7076
+ $html = array($html1, $html2, $html3, $html4);
7077
+ $clas = '';
7078
+ $tags = 'system';
7079
+ wppa_setting(false, '18', $name, $desc, $html, $help, $clas, $tags);
7080
+
7081
  /*
7082
  $name = __('Test proc');
7083
  $desc = __('For OpaJaap only');
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 6.4.12
7
  *
8
  */
9
 
@@ -426,6 +426,15 @@ global $silent;
426
  }
427
  }
428
 
 
 
 
 
 
 
 
 
 
429
  }
430
 
431
  // Set Defaults
@@ -951,6 +960,8 @@ Hide Camera info
951
  'wppa_bcolor_bestof' => '#bbbbbb',
952
  'wppa_bgcolor_stereo' => '#dddddd',
953
  'wppa_bcolor_stereo' => '#bbbbbb',
 
 
954
 
955
  // Table IV: Behaviour
956
  // A System
@@ -986,6 +997,7 @@ Hide Camera info
986
 
987
  'wppa_capitalize_tags' => 'yes',
988
  'wppa_enable_admins_choice' => 'no',
 
989
 
990
  // B Full size and Slideshow
991
  'wppa_fullvalign' => 'center',
@@ -1051,6 +1063,7 @@ Hide Camera info
1051
  'wppa_comment_email_required' => 'required',
1052
  'wppa_comment_notify' => 'none',
1053
  'wppa_com_notify_previous' => 'no',
 
1054
  'wppa_comment_notify_added' => 'yes',
1055
  'wppa_comten_alt_display' => 'no',
1056
  'wppa_comten_alt_thumbsize' => '75',
@@ -1224,13 +1237,14 @@ Hide Camera info
1224
  'wppa_user_album_edit_on' => 'no',
1225
  'wppa_upload_moderate' => 'no',
1226
  'wppa_upload_edit' => 'none',
1227
- 'wppa_upload_edit_users' => 'owner',
1228
  'wppa_upload_edit_theme_css' => 'no',
1229
  'wppa_fe_edit_name' => 'yes',
1230
  'wppa_fe_edit_desc' => 'yes',
1231
  'wppa_fe_edit_tags' => 'yes',
1232
  'wppa_fe_edit_button' => __( 'Edit', 'wp-photo-album-plus' ),
1233
  'wppa_fe_edit_caption' => __( 'Edit photo information', 'wp-photo-album-plus' ),
 
1234
  'wppa_owner_moderate_comment' => 'no',
1235
  'wppa_upload_notify' => 'no',
1236
  'wppa_upload_backend_notify' => 'no',
@@ -1285,6 +1299,7 @@ Hide Camera info
1285
  'wppa_crypt_albums' => '',
1286
  'wppa_create_o1_files' => '',
1287
  'wppa_create_o1_files_skip_one' => '',
 
1288
 
1289
  // B Irreversable
1290
  'wppa_rating_clear' => 'no',
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 6.4.14
7
  *
8
  */
9
 
426
  }
427
  }
428
 
429
+ if ( $old_rev <= '6414' ) {
430
+ if ( get_option( 'wppa_upload_edit', 'no' ) != 'no' ) {
431
+ update_option( 'wppa_upload_delete', 'yes' );
432
+ }
433
+ if ( get_option( 'wppa_upload_edit_users' ) == 'equalname' ) {
434
+ update_option( 'wppa_upload_edit_users', 'owner' );
435
+ }
436
+ }
437
+
438
  }
439
 
440
  // Set Defaults
960
  'wppa_bcolor_bestof' => '#bbbbbb',
961
  'wppa_bgcolor_stereo' => '#dddddd',
962
  'wppa_bcolor_stereo' => '#bbbbbb',
963
+ 'wppa_bgcolor_adminschoice' => '#dddddd',
964
+ 'wppa_bcolor_adminschoice' => '#bbbbbb',
965
 
966
  // Table IV: Behaviour
967
  // A System
997
 
998
  'wppa_capitalize_tags' => 'yes',
999
  'wppa_enable_admins_choice' => 'no',
1000
+ 'wppa_owner_to_name' => 'no',
1001
 
1002
  // B Full size and Slideshow
1003
  'wppa_fullvalign' => 'center',
1063
  'wppa_comment_email_required' => 'required',
1064
  'wppa_comment_notify' => 'none',
1065
  'wppa_com_notify_previous' => 'no',
1066
+ 'wppa_com_notify_approved' => 'no',
1067
  'wppa_comment_notify_added' => 'yes',
1068
  'wppa_comten_alt_display' => 'no',
1069
  'wppa_comten_alt_thumbsize' => '75',
1237
  'wppa_user_album_edit_on' => 'no',
1238
  'wppa_upload_moderate' => 'no',
1239
  'wppa_upload_edit' => 'none',
1240
+ 'wppa_upload_edit_users' => 'admin',
1241
  'wppa_upload_edit_theme_css' => 'no',
1242
  'wppa_fe_edit_name' => 'yes',
1243
  'wppa_fe_edit_desc' => 'yes',
1244
  'wppa_fe_edit_tags' => 'yes',
1245
  'wppa_fe_edit_button' => __( 'Edit', 'wp-photo-album-plus' ),
1246
  'wppa_fe_edit_caption' => __( 'Edit photo information', 'wp-photo-album-plus' ),
1247
+ 'wppa_upload_delete' => 'no',
1248
  'wppa_owner_moderate_comment' => 'no',
1249
  'wppa_upload_notify' => 'no',
1250
  'wppa_upload_backend_notify' => 'no',
1299
  'wppa_crypt_albums' => '',
1300
  'wppa_create_o1_files' => '',
1301
  'wppa_create_o1_files_skip_one' => '',
1302
+ 'wppa_owner_to_name_proc' => '',
1303
 
1304
  // B Irreversable
1305
  'wppa_rating_clear' => 'no',
wppa-source.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains photo source file management routines
6
- * Version 6.4.10
7
  *
8
  */
9
 
@@ -89,8 +89,8 @@ global $wppa_supported_photo_extensions;
89
  if ( is_file( $frompath.'.'.$ext ) ) {
90
 
91
  // rename. Will fail if target already exists
92
- @ rename( $frompath.'.'.$ext, $topath.'.'.$ext );
93
- @ rename( $frompath.'-o1.'.$ext, $topath.'-o1.'.$ext );
94
 
95
  // therefor delete if still exists
96
  if ( is_file( $frompath.'.'.$ext ) ) {
@@ -104,6 +104,19 @@ global $wppa_supported_photo_extensions;
104
  }
105
  }
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  function wppa_copy_source( $name, $from, $to ) {
108
  global $wppa_supported_photo_extensions;
109
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains photo source file management routines
6
+ * Version 6.4.14
7
  *
8
  */
9
 
89
  if ( is_file( $frompath.'.'.$ext ) ) {
90
 
91
  // rename. Will fail if target already exists
92
+ wppa_rename( $frompath.'.'.$ext, $topath.'.'.$ext );
93
+ wppa_rename( $frompath.'-o1.'.$ext, $topath.'-o1.'.$ext );
94
 
95
  // therefor delete if still exists
96
  if ( is_file( $frompath.'.'.$ext ) ) {
104
  }
105
  }
106
 
107
+ // rename without warnings
108
+ function wppa_rename( $from, $to ) {
109
+ if ( is_file( $from ) ) {
110
+ if ( is_file( $to ) ) {
111
+ copy( $from, $to );
112
+ unlink( $from );
113
+ }
114
+ else {
115
+ rename( $from, $to );
116
+ }
117
+ }
118
+ }
119
+
120
  function wppa_copy_source( $name, $from, $to ) {
121
  global $wppa_supported_photo_extensions;
122
 
wppa-statistics.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Functions for counts etc
6
  * Common use front and admin
7
- * Version 6.4.00
8
  *
9
  */
10
 
@@ -180,6 +180,11 @@ global $wppa_session;
180
 
181
  $wpdb->query("UPDATE `".$table."` SET `views` = ".$count." WHERE `id` = ".$id);
182
  wppa_dbg_msg('Bumped viewcount for '.$type.' '.$id.' to '.$count, 'red');
 
 
 
 
 
183
  }
184
 
185
  wppa_save_session();
4
  *
5
  * Functions for counts etc
6
  * Common use front and admin
7
+ * Version 6.4.14
8
  *
9
  */
10
 
180
 
181
  $wpdb->query("UPDATE `".$table."` SET `views` = ".$count." WHERE `id` = ".$id);
182
  wppa_dbg_msg('Bumped viewcount for '.$type.' '.$id.' to '.$count, 'red');
183
+
184
+ // If 'wppa_owner_to_name'
185
+ if ( $type == 'photo' ) {
186
+ wppa_set_owner_to_name( $id );
187
+ }
188
  }
189
 
190
  wppa_save_session();
wppa-styles.php CHANGED
@@ -3,7 +3,7 @@
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
- /* Version 6.4.12
7
  /*
8
  */
9
 
@@ -251,6 +251,12 @@ global $wppa_dynamic_css_data;
251
  ' . ( wppa_opt( 'bcolor_calendar' ) ? 'border-color:' . wppa_opt( 'bcolor_calendar' ) . '; ' : '' ) . '
252
  }';
253
 
 
 
 
 
 
 
254
  $content .= '
255
  .wppa-arrow {
256
  ' . ( wppa_opt( 'arrow_color' ) ? 'color:' . wppa_opt( 'arrow_color' ) . '; ' : '' ) . '
@@ -907,6 +913,13 @@ function __wcs( $class ) {
907
  $opt = wppa_opt( 'bcolor_calendar' );
908
  if ( $opt ) $result .= 'border-color:' . $opt . '; ';
909
  break;
 
 
 
 
 
 
 
910
  case 'wppa-black':
911
  // $opt = wppa_opt( 'black' );
912
  // if ( $opt ) $result .= 'color:' . $opt . '; ';
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
+ /* Version 6.4.14
7
  /*
8
  */
9
 
251
  ' . ( wppa_opt( 'bcolor_calendar' ) ? 'border-color:' . wppa_opt( 'bcolor_calendar' ) . '; ' : '' ) . '
252
  }';
253
 
254
+ $content .= '
255
+ .wppa-adminschoice {
256
+ ' . ( wppa_opt( 'bgcolor_adminschoice' ) ? 'background-color:' . wppa_opt( 'bgcolor_adminschoice' ) . '; ' : '' ) . '
257
+ ' . ( wppa_opt( 'bcolor_adminschoice' ) ? 'border-color:' . wppa_opt( 'bcolor_adminschoice' ) . '; ' : '' ) . '
258
+ }';
259
+
260
  $content .= '
261
  .wppa-arrow {
262
  ' . ( wppa_opt( 'arrow_color' ) ? 'color:' . wppa_opt( 'arrow_color' ) . '; ' : '' ) . '
913
  $opt = wppa_opt( 'bcolor_calendar' );
914
  if ( $opt ) $result .= 'border-color:' . $opt . '; ';
915
  break;
916
+ case 'wppa-adminschoice':
917
+ $opt = wppa_opt( 'bgcolor_adminschoice' );
918
+ if ( $opt ) $result .= 'background-color:' . $opt . '; ';
919
+ $opt = wppa_opt( 'bcolor_adminschoice' );
920
+ if ( $opt ) $result .= 'border-color:' . $opt . '; ';
921
+ break;
922
+
923
  case 'wppa-black':
924
  // $opt = wppa_opt( 'black' );
925
  // if ( $opt ) $result .= 'color:' . $opt . '; ';
wppa-tinymce-shortcodes.php CHANGED
@@ -3,7 +3,7 @@
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  *
6
- * Version 6.4.05
7
  *
8
  */
9
 
@@ -105,6 +105,12 @@ global $wpdb;
105
  $pages = wppa_array_sort( $pages, 'post_title' );
106
  }
107
 
 
 
 
 
 
 
108
  // Make the html
109
  $result =
110
  '<style>#TB_ajaxContent {box-sizing:border-box; width:100% !important;}</style>'.
@@ -198,6 +204,27 @@ global $wpdb;
198
  '<option value="upload">'.__('An upload box', 'wp-photo-album-plus').'</option>'.
199
  '<option value="landing">'.__('A landing page shortcode', 'wp-photo-album-plus').'</option>'.
200
  '<option value="stereo">'.__('A 3D stereo settings box', 'wp-photo-album-plus').'</option>'.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  '</select>'.
202
  '</td>'.
203
  '</tr>'.
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  *
6
+ * Version 6.4.14
7
  *
8
  */
9
 
105
  $pages = wppa_array_sort( $pages, 'post_title' );
106
  }
107
 
108
+ $admins = array();
109
+
110
+ if ( wppa_user_is( 'administrator' ) ) {
111
+ $users = get_users( array( 'role' => 'administrator' ) );
112
+ }
113
+
114
  // Make the html
115
  $result =
116
  '<style>#TB_ajaxContent {box-sizing:border-box; width:100% !important;}</style>'.
204
  '<option value="upload">'.__('An upload box', 'wp-photo-album-plus').'</option>'.
205
  '<option value="landing">'.__('A landing page shortcode', 'wp-photo-album-plus').'</option>'.
206
  '<option value="stereo">'.__('A 3D stereo settings box', 'wp-photo-album-plus').'</option>'.
207
+ '<option value="choice">'.__('An admins choice box', 'wp-photo-album-plus').'</option>'.
208
+ '</select>'.
209
+ '</td>'.
210
+ '</tr>'.
211
+
212
+ // Administrators ( for admins choice, show admin only if current user is an admin or superuser )
213
+ '<tr id="wppagallery-admins-tr" style="display:none;" >'.
214
+ '<th><label for="wppagallery-admins">'.__('Users:', 'wp-photo-album-plus').'</label></th>'.
215
+ '<td>'.
216
+ '<select id="wppagallery-admins" name="admins" style="color:#070;" multiple="multiple" onchange="wppaGalleryEvaluate()">'.
217
+ '<option value="" selected="selected" style="color:#070;" >-- '.__('All', 'wp-photo-album-plus').' --</option>';
218
+ foreach( $users as $user ) {
219
+ $result .=
220
+ '<option value="'.$user->data->user_login.'" class="wppagallery-admin" style="color:#070;" >'.$user->data->user_login.'</option>';
221
+ }
222
+ $users = get_option( 'wppa_super_users', array() );
223
+ foreach( $users as $user ) {
224
+ $result .=
225
+ '<option value="'.$user.'" class="wppagallery-admin" style="color:#070" >'.$user.'</option>';
226
+ }
227
+ $result .=
228
  '</select>'.
229
  '</td>'.
230
  '</tr>'.
wppa-users.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains user and capabilities related routines
6
- * Version 6.4.11
7
  *
8
  */
9
 
@@ -273,13 +273,6 @@ function wppa_may_user_fe_edit( $id ) {
273
  if ( wppa_get_user() == wppa_get_photo_owner( $id ) ) return true;
274
  break;
275
 
276
- case 'equalname':
277
- $name = wppa_get_photo_item( $id, 'name' );
278
- if ( strpos( $name, '.' ) !== false ) {
279
- $name = wppa_strip_ext( $name );
280
- }
281
- if ( strcasecmp( $name, wppa_get_user( 'display' ) ) == 0 ) return true;
282
- break;
283
  }
284
 
285
  return false;
@@ -287,18 +280,22 @@ function wppa_may_user_fe_edit( $id ) {
287
 
288
  // See if the current user may delete a given photo
289
  function wppa_may_user_fe_delete( $id ) {
290
-
291
  // If not allowed to edit, also deny deletion
292
- if ( ! wppa_may_user_fe_edit( $id ) ) return false;
293
-
294
  // Superuser?
295
  if ( wppa_is_user_superuser() ) return true;
296
 
297
  // Can edit albums?
298
  if ( current_user_can( 'wppa_admin' ) ) return true;
299
 
300
- // If owner and may edit, may also delete
301
- if ( wppa_get_user() == wppa_get_photo_owner( $id ) ) return true;
302
-
 
 
 
 
303
  return false;
304
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains user and capabilities related routines
6
+ * Version 6.4.14
7
  *
8
  */
9
 
273
  if ( wppa_get_user() == wppa_get_photo_owner( $id ) ) return true;
274
  break;
275
 
 
 
 
 
 
 
 
276
  }
277
 
278
  return false;
280
 
281
  // See if the current user may delete a given photo
282
  function wppa_may_user_fe_delete( $id ) {
283
+
284
  // If not allowed to edit, also deny deletion
285
+ // if ( ! wppa_may_user_fe_edit( $id ) ) return false;
286
+
287
  // Superuser?
288
  if ( wppa_is_user_superuser() ) return true;
289
 
290
  // Can edit albums?
291
  if ( current_user_can( 'wppa_admin' ) ) return true;
292
 
293
+ // If owner and owners may delete?
294
+ if ( wppa_get_user() == wppa_get_photo_owner( $id ) ) {
295
+ if ( wppa_switch( 'upload_delete' ) ) {
296
+ return true;
297
+ }
298
+ }
299
+
300
  return false;
301
  }
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 6.4.11
7
  *
8
  */
9
 
@@ -853,6 +853,8 @@ global $wppa_opt;
853
  'wppa_cover_minheight',
854
  'wppa_head_and_text_frame_height',
855
  'wppa_ovl_fs_icons',
 
 
856
  );
857
  if ( in_array( $option, $dynamic_css_critical ) ) {
858
  @ unlink ( WPPA_PATH.'/wppa-dynamic.css' ); // Will be auto re-created
@@ -923,6 +925,45 @@ global $wpdb;
923
  return $count;
924
  }
925
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
926
  function wppa_send_mail( $to, $subj, $cont, $photo, $email = '' ) {
927
 
928
  $message_part_1 = '';
@@ -2085,11 +2126,14 @@ global $wpdb;
2085
  }
2086
  if ( ( $name && $name != $filename ) || $method == 'none' ) { // Update name
2087
  $wpdb->query( $wpdb->prepare( "UPDATE `".WPPA_PHOTOS."` SET `name` = %s WHERE `id` = %s", $name, $id ) );
2088
- $thumb['name'] = $name; // Update cache
2089
  }
2090
  if ( ! wppa_switch('wppa_save_iptc') ) { // He doesn't want to keep the iptc data, so...
2091
  $wpdb->query($wpdb->prepare( "DELETE FROM `".WPPA_IPTC."` WHERE `photo` = %s", $id ) );
2092
  }
 
 
 
2093
  }
2094
 
2095
  function wppa_set_default_tags( $id ) {
@@ -3127,4 +3171,36 @@ function wppa_convert_uri_to_get( $uri ) {
3127
  // wppa_log('dbg',$item);
3128
  }
3129
  }
3130
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 6.4.14
7
  *
8
  */
9
 
853
  'wppa_cover_minheight',
854
  'wppa_head_and_text_frame_height',
855
  'wppa_ovl_fs_icons',
856
+ 'wppa_bgcolor_adminschoice',
857
+ 'wppa_bcolor_adminschoice',
858
  );
859
  if ( in_array( $option, $dynamic_css_critical ) ) {
860
  @ unlink ( WPPA_PATH.'/wppa-dynamic.css' ); // Will be auto re-created
925
  return $count;
926
  }
927
 
928
+ // Send the owner of a photo an email telling he has a new approved comment
929
+ // $id is comment id.
930
+ function wppa_send_comment_approved_email( $id ) {
931
+ global $wpdb;
932
+
933
+ // Feature enabled?
934
+ if ( ! wppa_switch( 'com_notify_approved' ) ) return;
935
+
936
+ // Get comment
937
+ $com = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM `" . WPPA_COMMENTS . "` WHERE `id` = %d", $id ), ARRAY_A );
938
+ if ( ! $com ) return;
939
+
940
+ // Get photo owner
941
+ $owner = wppa_get_photo_item( $com['photo'], 'owner' );
942
+ if ( ! $owner ) return;
943
+
944
+ // Get email
945
+ $user = get_user_by( 'login', $owner );
946
+ if ( ! $user ) return;
947
+
948
+ // Make email text
949
+ $content =
950
+ '<h3>' .
951
+ __('Your photo has a new approved comment', 'wp-photo-album-plus') .
952
+ '</h3>' .
953
+ '<h3>' .
954
+ __('From:', 'wp-photo-album-plus') . ' ' . $com['user'] .
955
+ '</h3>' .
956
+ '<h3>' .
957
+ __('Comment:', 'wp-photo-album-plus') .
958
+ '</h3>' .
959
+ '<blockquote style="color:#000077; background-color: #dddddd; border:1px solid black; padding: 6px; border-radius 4px;" ><em> '.stripslashes($com['comment']).'</em></blockquote>';
960
+
961
+ // Send mail
962
+ wppa_send_mail( $user->user_email, __( 'Approved comment on photo', 'wp-photo-album-plus' ), $content, $com['photo'], 'void' );
963
+
964
+ }
965
+
966
+
967
  function wppa_send_mail( $to, $subj, $cont, $photo, $email = '' ) {
968
 
969
  $message_part_1 = '';
2126
  }
2127
  if ( ( $name && $name != $filename ) || $method == 'none' ) { // Update name
2128
  $wpdb->query( $wpdb->prepare( "UPDATE `".WPPA_PHOTOS."` SET `name` = %s WHERE `id` = %s", $name, $id ) );
2129
+ wppa_cache_thumb( 'invalidate', $id ); // Invalidate cache
2130
  }
2131
  if ( ! wppa_switch('wppa_save_iptc') ) { // He doesn't want to keep the iptc data, so...
2132
  $wpdb->query($wpdb->prepare( "DELETE FROM `".WPPA_IPTC."` WHERE `photo` = %s", $id ) );
2133
  }
2134
+
2135
+ // In case owner must be set to name.
2136
+ wppa_set_owner_to_name( $id );
2137
  }
2138
 
2139
  function wppa_set_default_tags( $id ) {
3171
  // wppa_log('dbg',$item);
3172
  }
3173
  }
3174
+ }
3175
+
3176
+ // Set owner to login name if photo name is user display_name
3177
+ // Return true if owner changed, return 0 if already set, return false if not a username
3178
+ function wppa_set_owner_to_name( $id ) {
3179
+ global $wpdb;
3180
+
3181
+ // Feature enabled?
3182
+ if ( wppa_switch( 'wppa_owner_to_name' ) ) {
3183
+
3184
+ // Find name
3185
+ $name = wppa_get_photo_item( $id, 'name' );
3186
+
3187
+ // Find user
3188
+ $user = $wpdb->get_var( $wpdb->prepare( "SELECT `user_login` FROM `".$wpdb->users."` WHERE `display_name` = %s", $name ) );
3189
+
3190
+ if ( $user ) {
3191
+
3192
+ // If owner != user, change owner
3193
+ if ( wppa_get_photo_item( $id, 'owner' ) != $user ) {
3194
+ wppa_update_photo( array( 'id' => $id, 'owner' => $user ) );
3195
+ wppa_log( 'Obs', 'Owner of photo '.$id.' in album '.wppa_get_photo_item( $id, 'album' ).' set to: '.$user );
3196
+ return true;
3197
+ }
3198
+ else {
3199
+ return '0';
3200
+ }
3201
+ }
3202
+ }
3203
+
3204
+ return false;
3205
+ }
3206
+
wppa-wpdb-insert.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that add new records
6
- * Version 6.4.00
7
  *
8
  */
9
 
@@ -429,7 +429,7 @@ global $wpdb;
429
  while ( ! wppa_is_id_free( $table, $result ) ) {
430
  $result++;
431
  }
432
- wppa_update_option( $name, $result );
433
  return $result;
434
  }
435
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that add new records
6
+ * Version 6.4.14
7
  *
8
  */
9
 
429
  while ( ! wppa_is_id_free( $table, $result ) ) {
430
  $result++;
431
  }
432
+ update_option( $name, $result );
433
  return $result;
434
  }
435
 
wppa-wpdb-update.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that update records
6
- * Version 6.4.00
7
  *
8
  */
9
 
@@ -162,6 +162,9 @@ global $wpdb;
162
  case 'crypt':
163
  $doit = true;
164
  break;
 
 
 
165
 
166
  default:
167
  wppa_log( 'Error', 'Not implemented in wppa_update_photo(): '.$itemname );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that update records
6
+ * Version 6.4.14
7
  *
8
  */
9
 
162
  case 'crypt':
163
  $doit = true;
164
  break;
165
+ case 'owner':
166
+ $doit = true;
167
+ break;
168
 
169
  default:
170
  wppa_log( 'Error', 'Not implemented in wppa_update_photo(): '.$itemname );
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.4.13
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/
@@ -29,12 +29,12 @@ global $wpdb;
29
  /* when new options are added and when the wppa_setup() routine
30
  /* must be called right after update for any other reason.
31
  */
32
- global $wppa_revno; $wppa_revno = '6413';
33
 
34
  /* This is the api interface version number
35
  /* It is incremented at any code change.
36
  */
37
- global $wppa_api_version; $wppa_api_version = '6-4-13-000';
38
 
39
  /* start timers */
40
  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.4.14
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/
29
  /* when new options are added and when the wppa_setup() routine
30
  /* must be called right after update for any other reason.
31
  */
32
+ global $wppa_revno; $wppa_revno = '6414';
33
 
34
  /* This is the api interface version number
35
  /* It is incremented at any code change.
36
  */
37
+ global $wppa_api_version; $wppa_api_version = '6-4-14-003';
38
 
39
  /* start timers */
40
  global $wppa_starttime; $wppa_starttime = microtime(true);