WP Photo Album Plus - Version 7.5.11.002

Version Description

= 7.5.11 =

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

Release Info

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

Code changes from version 7.5.11.001 to 7.5.11.002

changelog.txt CHANGED
@@ -2,10 +2,15 @@ WP Photo Album Plus Changelog
2
 
3
  = 7.5.11 =
4
 
5
- * New setting: Table VI-C13: Moderate links admin/superuser/owner only.
6
- If ticked, the moderate links etc. on the frontend will only be shown to admins, superusers and the photo owners.
7
  The owners still need to have the capability moderate in Table VII-A.
8
  * Fixed links to the wp plugins page when 'gallery not album' is activated in Table IV-A36.
 
 
 
 
 
9
 
10
  = 7.5.10 =
11
 
@@ -14,7 +19,7 @@ The owners still need to have the capability moderate in Table VII-A.
14
  * Extended options for slidehow animation time in Table IV-B6.
15
  * Fixed a imagick command that could cause unwanted padding in thumbnail creation.
16
  * The availebility of ImagMagick is now detected and activated automatically on opening the settings page the first time after install/update if it was not already done manually.
17
- * New setting Table I-F15: Character sizing.
18
  You can specify 'linear' (default), 'quadratic' or 'cubic' for the formula that determines the relation between the number of items and the size of the tagcloud text.
19
  * Fixed shortcode generators. They all work back properly now, both on classic as on block editor in classic blocks as well as the wppa custom block types.
20
  * Fixed some php warnings.
2
 
3
  = 7.5.11 =
4
 
5
+ * New setting: Table VI-C13: Moderate links admin/superuser/owner only.
6
+ If ticked, the moderate links etc. on the frontend will only be shown to admins, superusers and the photo owners.
7
  The owners still need to have the capability moderate in Table VII-A.
8
  * Fixed links to the wp plugins page when 'gallery not album' is activated in Table IV-A36.
9
+ * New setting Table IX-D11.4: Grant restrict. Only create albums for users with Album Admin rights, See Table VII-A, first column. They need no upload rigts.
10
+ * New setting Table IV-A27.3: Admins Choice action. You can now select the action for Admins Choice. Either add to personal zip (default), or copy to grant album if available.
11
+ In this case, the links are only shown to users who have album admin rights.
12
+ * Non admins/superusers can only delete their own photos.
13
+ * New setting Table VII-C10: Album Admin separate. Restrict album admin to separate albums for non administrators
14
 
15
  = 7.5.10 =
16
 
19
  * Extended options for slidehow animation time in Table IV-B6.
20
  * Fixed a imagick command that could cause unwanted padding in thumbnail creation.
21
  * The availebility of ImagMagick is now detected and activated automatically on opening the settings page the first time after install/update if it was not already done manually.
22
+ * New setting Table I-F15: Character sizing.
23
  You can specify 'linear' (default), 'quadratic' or 'cubic' for the formula that determines the relation between the number of items and the size of the tagcloud text.
24
  * Fixed shortcode generators. They all work back properly now, both on classic as on block editor in classic blocks as well as the wppa custom block types.
25
  * Fixed some php warnings.
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 7.5.10
6
  *
7
  */
8
 
@@ -708,16 +708,40 @@ global $wppa;
708
 
709
  case 'addtozip':
710
 
711
- // Check if the user is allowed to do this
712
  $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
713
  $photo = strval( intval( $photo ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
714
  $choice = wppa_opt( 'admins_choice' );
715
  if ( ( wppa_user_is( 'administrator' ) && $choice != 'none' ) ||
716
  ( is_user_logged_in() && $choice == 'login' ) ) {
717
  // Its ok
718
  }
719
  else {
720
- echo 'ER||You are not allowed to do this';
721
  wppa_exit();
722
  }
723
 
@@ -1462,6 +1486,13 @@ global $wppa;
1462
  echo '||0||'.__( 'Security check failure' , 'wp-photo-album-plus');
1463
  wppa_exit(); // Nonce check failed
1464
  }
 
 
 
 
 
 
 
1465
  $album = $wpdb->get_var( $wpdb->prepare( "SELECT album FROM $wpdb->wppa_photos
1466
  WHERE id = %d", $photo ) );
1467
  wppa_delete_photo( $photo );
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 7.5.11
6
  *
7
  */
8
 
708
 
709
  case 'addtozip':
710
 
 
711
  $photo = wppa_decrypt_photo( $_REQUEST['photo-id'], false, true );
712
  $photo = strval( intval( $photo ) );
713
+
714
+ if ( wppa_opt( 'admins_choice_action' ) == 'album' ) {
715
+ if ( current_user_can( 'wppa_admin' ) ) {
716
+ $album = wppa_my_get_first_grant_album();
717
+ if ( $album ) {
718
+ $err = wppa_copy_photo( $photo, $album );
719
+ if ( $err ) {
720
+ echo 'ER||Could not copy photo';
721
+ }
722
+ else {
723
+ echo 'OK||Photo copied to album '.$album;
724
+ }
725
+ }
726
+ else {
727
+ echo 'ER||No album available to copy to';
728
+
729
+ }
730
+ }
731
+ else {
732
+ echo 'ER||You are not allowed to do this (1)';
733
+ }
734
+ wppa_exit();
735
+ }
736
+
737
+ // Check if the user is allowed to do this
738
  $choice = wppa_opt( 'admins_choice' );
739
  if ( ( wppa_user_is( 'administrator' ) && $choice != 'none' ) ||
740
  ( is_user_logged_in() && $choice == 'login' ) ) {
741
  // Its ok
742
  }
743
  else {
744
+ echo 'ER||You are not allowed to do this (2)';
745
  wppa_exit();
746
  }
747
 
1486
  echo '||0||'.__( 'Security check failure' , 'wp-photo-album-plus');
1487
  wppa_exit(); // Nonce check failed
1488
  }
1489
+
1490
+ // Non admins/superusers can only delete their own photos
1491
+ if ( ! wppa_user_is( 'administrator' ) && wppa_get_photo_item( $photo, 'owner' ) != wppa_get_user() ) {
1492
+ echo '||0||'.__( 'You do not have the rights to delete this photo' , 'wp-photo-album-plus');
1493
+ wppa_exit();
1494
+ }
1495
+
1496
  $album = $wpdb->get_var( $wpdb->prepare( "SELECT album FROM $wpdb->wppa_photos
1497
  WHERE id = %d", $photo ) );
1498
  wppa_delete_photo( $photo );
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 7.5.03
7
  *
8
  */
9
 
@@ -41,7 +41,16 @@ global $wppa_revno;
41
  // Get all albums and cache them
42
  $albs = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_albums", ARRAY_A );
43
  wppa_cache_album( 'add', $albs );
44
-
 
 
 
 
 
 
 
 
 
45
  // Fix orphan albums and deleted target pages
46
  if ( $albs ) {
47
  foreach ( $albs as $alb ) {
@@ -1746,16 +1755,16 @@ global $wpdb;
1746
  <td><a href="<?php echo($url) ?>" class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?></a></td>
1747
  <td><a href="<?php echo($url.'&amp;quick') ?>" class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?></a></td>
1748
  <td><a href="<?php echo($url.'&amp;bulk#manage-photos') ?>" class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?></a></td>
1749
-
1750
  <?php if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
1751
  ?>
1752
  <td><a href="<?php echo($url.'&amp;seq') ?>" class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?></a></td>
1753
  <?php
1754
  }
1755
  else {
1756
- echo '<td></td>';
1757
- } ?>
1758
-
1759
  <?php
1760
  $covid = max( $album['main_photo'], '0' );
1761
  if ( $covid ) {
@@ -2629,16 +2638,16 @@ global $wpdb;
2629
  <td><a href="<?php echo($url) ?>" class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?></a></td>
2630
  <td><a href="<?php echo($url.'&amp;quick') ?>" class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?></a></td>
2631
  <td><a href="<?php echo($url.'&amp;bulk#manage-photos') ?>" class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?></a></td>
2632
-
2633
  <?php if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
2634
  ?>
2635
  <td><a href="<?php echo($url.'&amp;seq') ?>" class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?></a></td>
2636
  <?php
2637
  }
2638
  else {
2639
- echo '<td></td>';
2640
- } ?>
2641
-
2642
  <?php
2643
  $covid = max( $album['main_photo'], '0' );
2644
  if ( $covid ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 7.5.11
7
  *
8
  */
9
 
41
  // Get all albums and cache them
42
  $albs = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_albums", ARRAY_A );
43
  wppa_cache_album( 'add', $albs );
44
+ /*
45
+ // If separate restricted and not admin or super, remove non-separates
46
+ if ( wppa_switch( 'admin_separate' ) && ! wppa_user_is( 'administrator') ) {
47
+ foreach( array_keys( $albs ) as $key ) {
48
+ if ( ! wppa_is_separate( $albs[$key]['id'] ) ) {
49
+ unset( $albs[$key] );
50
+ }
51
+ }
52
+ }
53
+ */
54
  // Fix orphan albums and deleted target pages
55
  if ( $albs ) {
56
  foreach ( $albs as $alb ) {
1755
  <td><a href="<?php echo($url) ?>" class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?></a></td>
1756
  <td><a href="<?php echo($url.'&amp;quick') ?>" class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?></a></td>
1757
  <td><a href="<?php echo($url.'&amp;bulk#manage-photos') ?>" class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?></a></td>
1758
+
1759
  <?php if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
1760
  ?>
1761
  <td><a href="<?php echo($url.'&amp;seq') ?>" class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?></a></td>
1762
  <?php
1763
  }
1764
  else {
1765
+ echo '<td></td>';
1766
+ } ?>
1767
+
1768
  <?php
1769
  $covid = max( $album['main_photo'], '0' );
1770
  if ( $covid ) {
2638
  <td><a href="<?php echo($url) ?>" class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?></a></td>
2639
  <td><a href="<?php echo($url.'&amp;quick') ?>" class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?></a></td>
2640
  <td><a href="<?php echo($url.'&amp;bulk#manage-photos') ?>" class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?></a></td>
2641
+
2642
  <?php if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
2643
  ?>
2644
  <td><a href="<?php echo($url.'&amp;seq') ?>" class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?></a></td>
2645
  <?php
2646
  }
2647
  else {
2648
+ echo '<td></td>';
2649
+ } ?>
2650
+
2651
  <?php
2652
  $covid = max( $album['main_photo'], '0' );
2653
  if ( $covid ) {
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 7.5.07
6
  *
7
  */
8
 
@@ -864,6 +864,20 @@ global $current_user;
864
  // Administrator has always access
865
  if ( wppa_user_is( 'administrator' ) ) return true; // Do NOT change this into 'wppa_admin', it will enable access to all albums at backend while owners only
866
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
867
  // If all albums are public
868
  if ( ! wppa_switch( 'owner_only' ) ) return true;
869
 
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 7.5.11
6
  *
7
  */
8
 
864
  // Administrator has always access
865
  if ( wppa_user_is( 'administrator' ) ) return true; // Do NOT change this into 'wppa_admin', it will enable access to all albums at backend while owners only
866
 
867
+ // Limited to separate for non admin/super?
868
+ if ( wppa_switch( 'admin_separate' ) && ! wppa_user_is( 'administrator' ) ) {
869
+
870
+ if ( is_array( $alb ) ) {
871
+ $id = $alb['id'];
872
+ }
873
+ else {
874
+ $id = $alb;
875
+ }
876
+ if ( ! wppa_is_separate( $id ) ) {
877
+ return false;
878
+ }
879
+ }
880
+
881
  // If all albums are public
882
  if ( ! wppa_switch( 'owner_only' ) ) return true;
883
 
wppa-defaults.php CHANGED
@@ -551,6 +551,7 @@ horizrailenabled:false,";
551
  'wppa_enable_admins_choice' => 'no',
552
  'wppa_admins_choice' => 'none',
553
  'wppa_admins_choice_meonly' => 'no',
 
554
  'wppa_choice_is_tag' => 'no',
555
  'wppa_owner_to_name' => 'no',
556
 
@@ -1062,6 +1063,7 @@ horizrailenabled:false,";
1062
  'wppa_grant_parent' => '-1',
1063
  'wppa_grant_cats' => '',
1064
  'wppa_grant_tags' => '',
 
1065
  'wppa_ipc025_to_tags' => 'no',
1066
  'wppa_default_parent' => '0',
1067
  'wppa_default_parent_always' => 'no',
@@ -1073,6 +1075,7 @@ horizrailenabled:false,";
1073
  'wppa_porder_restricted' => 'no',
1074
  'wppa_reup_is_restricted' => 'yes',
1075
  'wppa_newtags_is_restricted' => 'no',
 
1076
 
1077
  'wppa_newphoto_name_method' => 'filename',
1078
  'wppa_default_coverimage_name' => 'Coverphoto',
551
  'wppa_enable_admins_choice' => 'no',
552
  'wppa_admins_choice' => 'none',
553
  'wppa_admins_choice_meonly' => 'no',
554
+ 'wppa_admins_choice_action' => 'zip',
555
  'wppa_choice_is_tag' => 'no',
556
  'wppa_owner_to_name' => 'no',
557
 
1063
  'wppa_grant_parent' => '-1',
1064
  'wppa_grant_cats' => '',
1065
  'wppa_grant_tags' => '',
1066
+ 'wppa_grant_restrict' => 'no',
1067
  'wppa_ipc025_to_tags' => 'no',
1068
  'wppa_default_parent' => '0',
1069
  'wppa_default_parent_always' => 'no',
1075
  'wppa_porder_restricted' => 'no',
1076
  'wppa_reup_is_restricted' => 'yes',
1077
  'wppa_newtags_is_restricted' => 'no',
1078
+ 'wppa_admin_separate' => 'no',
1079
 
1080
  'wppa_newphoto_name_method' => 'filename',
1081
  'wppa_default_coverimage_name' => 'Coverphoto',
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 7.5.07
7
  *
8
  */
9
 
@@ -2727,38 +2727,40 @@ static $user;
2727
  ' />';
2728
  }
2729
  $choice = wppa_opt( 'admins_choice' );
2730
- if ( ( wppa_user_is( 'administrator' ) && $choice != 'none' ) ||
2731
- ( is_user_logged_in() && $choice == 'login' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2732
 
2733
- if ( wppa_is_photo_in_zip( $thumb['id'] ) ) {
2734
- $choicelink =
2735
- '<input' .
2736
- ' id="admin-choice-rem-' . wppa_encrypt_photo($thumb['id']) . '-' . wppa( 'mocc' ) . '"' .
2737
- ' type="button"' .
2738
- ' style="float:right;margin-right:6px;text-decoration:line-through;cursor:pointer;"' .
2739
- ' onclick="' .
2740
- 'wppaStopShow( ' . wppa( 'mocc' ) . ' );' .
2741
- esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to remove this photo from your selection?' , 'wp-photo-album-plus') . '" ) ) ' .
2742
- 'wppaAjaxRemovePhotoFromZip( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', false ); return false;' ).'"' .
2743
-
2744
- ' value="' . esc_attr( __( 'MyChoice', 'wp-photo-album-plus' ) ) . '"' .
2745
- ' />';
2746
-
2747
- }
2748
- else {
2749
- $choicelink =
2750
- '<input' .
2751
- ' id="admin-choice-' . wppa_encrypt_photo($thumb['id']) . '-' . wppa( 'mocc' ) . '"' .
2752
- ' type="button"' .
2753
- ' style="float:right;margin-right:6px;cursor:pointer;"' .
2754
- ' onclick="' .
2755
- 'wppaStopShow( ' . wppa( 'mocc' ) . ' );' .
2756
- esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to add this photo to your selection?' , 'wp-photo-album-plus') . '" ) ) ' .
2757
- 'wppaAjaxAddPhotoToZip( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', false ); return false;' ).'"' .
2758
-
2759
- ' value="' . esc_attr( __( 'MyChoice', 'wp-photo-album-plus' ) ) . '"' .
2760
- ' />';
2761
 
 
2762
  }
2763
  }
2764
  if ( wppa_switch( 'request_info' ) && is_user_logged_in() ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 7.5.11
7
  *
8
  */
9
 
2727
  ' />';
2728
  }
2729
  $choice = wppa_opt( 'admins_choice' );
2730
+ if ( current_user_can( 'wppa_admin' ) || wppa_opt( 'admins_choice_action' ) == 'zip' ) {
2731
+ if ( ( wppa_user_is( 'administrator' ) && $choice != 'none' ) ||
2732
+ ( is_user_logged_in() && $choice == 'login' ) ) {
2733
+
2734
+ if ( wppa_is_photo_in_zip( $thumb['id'] ) ) {
2735
+ $choicelink =
2736
+ '<input' .
2737
+ ' id="admin-choice-rem-' . wppa_encrypt_photo($thumb['id']) . '-' . wppa( 'mocc' ) . '"' .
2738
+ ' type="button"' .
2739
+ ' style="float:right;margin-right:6px;text-decoration:line-through;cursor:pointer;"' .
2740
+ ' onclick="' .
2741
+ 'wppaStopShow( ' . wppa( 'mocc' ) . ' );' .
2742
+ esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to remove this photo from your selection?' , 'wp-photo-album-plus') . '" ) ) ' .
2743
+ 'wppaAjaxRemovePhotoFromZip( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', false ); return false;' ).'"' .
2744
+
2745
+ ' value="' . esc_attr( __( 'MyChoice', 'wp-photo-album-plus' ) ) . '"' .
2746
+ ' />';
2747
 
2748
+ }
2749
+ else {
2750
+ $choicelink =
2751
+ '<input' .
2752
+ ' id="admin-choice-' . wppa_encrypt_photo($thumb['id']) . '-' . wppa( 'mocc' ) . '"' .
2753
+ ' type="button"' .
2754
+ ' style="float:right;margin-right:6px;cursor:pointer;"' .
2755
+ ' onclick="' .
2756
+ 'wppaStopShow( ' . wppa( 'mocc' ) . ' );' .
2757
+ esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to add this photo to your selection?' , 'wp-photo-album-plus') . '" ) ) ' .
2758
+ 'wppaAjaxAddPhotoToZip( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', false ); return false;' ).'"' .
2759
+
2760
+ ' value="' . esc_attr( __( 'MyChoice', 'wp-photo-album-plus' ) ) . '"' .
2761
+ ' />';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2762
 
2763
+ }
2764
  }
2765
  }
2766
  if ( wppa_switch( 'request_info' ) && is_user_logged_in() ) {
wppa-items.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions to retrieve album and photo items
6
- * Version 7.5.08
7
  *
8
  */
9
 
@@ -179,7 +179,8 @@ static $thumb_cache_2;
179
 
180
  // Error in arg?
181
  if ( ! wppa_is_int( $id ) || $id < '1' ) {
182
- wppa_dbg_msg( 'Invalid arg wppa_cache_thumb('.$id.')', 'red' );
 
183
  $thumb = false;
184
  wppa( 'current_photo', false );
185
  return false;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions to retrieve album and photo items
6
+ * Version 7.5.11
7
  *
8
  */
9
 
179
 
180
  // Error in arg?
181
  if ( ! wppa_is_int( $id ) || $id < '1' ) {
182
+ wppa_dbg_msg( 'Invalid arg wppa_cache_thumb('.serialize($id).')', 'red' );
183
+ wppa_log('err', 'Invalid arg wppa_cache_thumb('.serialize($id).')', true);
184
  $thumb = false;
185
  wppa( 'current_photo', false );
186
  return false;
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 7.5.10
7
  *
8
  */
9
 
@@ -962,20 +962,23 @@ function wppaToggleExif( id, count ) {
962
  echo ' ';
963
 
964
  // Schedule for delete
965
- $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
966
- echo
967
- __( 'Delete at', 'wp-photo-album-plus' ) .
968
- ' ' .
969
- '<input' .
970
- ' type="checkbox"' .
971
- ' id="scheduledel-' . $id . '"' .
972
- ( $scheduledel ? ' checked="checked"' : '' ) .
973
- ( $may_change ? '' : ' disabled="disabled"' ) .
974
- ' onchange="wppaTryScheduledel( ' . $id . ' );"' .
975
- ' />' .
976
- ' ' .
977
- wppa_get_date_time_select_html( 'delphoto', $id, $may_change ) .
978
- ' ';
 
 
 
979
 
980
  // Update status field
981
  echo
@@ -1480,17 +1483,19 @@ function wppaToggleExif( id, count ) {
1480
  }
1481
 
1482
  // Delete
1483
- if ( ! wppa( 'front_edit' ) ) {
1484
- echo
1485
- '<input' .
1486
- ' type="button"' .
1487
- ' style="color:red;"' .
1488
- ' onclick="wppaTry' . ( $deleted ? 'Undelete' : 'Delete' ) . '( ' . $id . ', ' . $b_is_video . ' )"' .
1489
- ( $deleted ?
1490
- ' value="' . ( $b_is_video ? esc_attr( __( 'Undelete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Undelete photo', 'wp-photo-album-plus' ) ) ) .'"' :
1491
- ' value="' . ( $b_is_video ? esc_attr( __( 'Delete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Delete photo', 'wp-photo-album-plus' ) ) ) . '"' ) .
1492
- ' />' .
1493
- ' ';
 
 
1494
  }
1495
 
1496
  // Re-upload
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 7.5.11
7
  *
8
  */
9
 
962
  echo ' ';
963
 
964
  // Schedule for delete
965
+ if ( wppa_user_is( 'administrator' ) || wppa_get_photo_item( $photo, 'owner' ) == wppa_get_user() ) {
966
+ $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
967
+
968
+ echo
969
+ __( 'Delete at', 'wp-photo-album-plus' ) .
970
+ ' ' .
971
+ '<input' .
972
+ ' type="checkbox"' .
973
+ ' id="scheduledel-' . $id . '"' .
974
+ ( $scheduledel ? ' checked="checked"' : '' ) .
975
+ ( $may_change ? '' : ' disabled="disabled"' ) .
976
+ ' onchange="wppaTryScheduledel( ' . $id . ' );"' .
977
+ ' />' .
978
+ ' ' .
979
+ wppa_get_date_time_select_html( 'delphoto', $id, $may_change ) .
980
+ ' ';
981
+ }
982
 
983
  // Update status field
984
  echo
1483
  }
1484
 
1485
  // Delete
1486
+ if ( wppa_user_is( 'administrator' ) || wppa_get_photo_item( $id, 'owner' ) == wppa_get_user() ) {
1487
+ if ( ! wppa( 'front_edit' ) ) {
1488
+ echo
1489
+ '<input' .
1490
+ ' type="button"' .
1491
+ ' style="color:red;"' .
1492
+ ' onclick="wppaTry' . ( $deleted ? 'Undelete' : 'Delete' ) . '( ' . $id . ', ' . $b_is_video . ' )"' .
1493
+ ( $deleted ?
1494
+ ' value="' . ( $b_is_video ? esc_attr( __( 'Undelete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Undelete photo', 'wp-photo-album-plus' ) ) ) .'"' :
1495
+ ' value="' . ( $b_is_video ? esc_attr( __( 'Delete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Delete photo', 'wp-photo-album-plus' ) ) ) . '"' ) .
1496
+ ' />' .
1497
+ ' ';
1498
+ }
1499
  }
1500
 
1501
  // Re-upload
wppa-settings-autosave.php CHANGED
@@ -4515,6 +4515,17 @@ global $wppa_supported_camara_brands;
4515
  $tags = 'system,meta';
4516
  wppa_setting($slug, '27.2', $name, $desc, $html, $help, $clas, $tags);
4517
 
 
 
 
 
 
 
 
 
 
 
 
4518
  $name = __('Make owner like photoname', 'wp-photo-album-plus');
4519
  $desc = __('Change the owner to the user who\'s display name equals photoname.', 'wp-photo-album-plus');
4520
  $help = '';
@@ -7634,6 +7645,17 @@ global $wppa_supported_camara_brands;
7634
  $tags = 'access,system';
7635
  wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
7636
 
 
 
 
 
 
 
 
 
 
 
 
7637
  wppa_setting_subheader('D', '2', __('Miscellaneous limiting settings', 'wp-photo-album-plus'));
7638
 
7639
  $name = __('Owners only', 'wp-photo-album-plus');
@@ -9914,6 +9936,15 @@ global $wppa_supported_camara_brands;
9914
  $tags = 'system,album';
9915
  wppa_setting($slug, '11.3', $name, $desc, $html, $help, $clas, $tags);
9916
 
 
 
 
 
 
 
 
 
 
9917
  $name = __('Iptc 025 keywords to tags', 'wp-photo-album-plus');
9918
  $desc = __('Convert IPTC025 keywords to tags during upload.', 'wp-photo-album-plus');
9919
  $help = __('Saving IPTC data must be on for this feature', 'wp-photo-album-plus');
@@ -9921,7 +9952,7 @@ global $wppa_supported_camara_brands;
9921
  $html = wppa_checkbox( $slug );
9922
  $clas = '';
9923
  $tags = 'system';
9924
- wppa_setting($slug, '11.4', $name, $desc, $html, $help, $clas, $tags);
9925
 
9926
  $name = __('Max user albums', 'wp-photo-album-plus');
9927
  $desc = __('The max number of albums a user can create.', 'wp-photo-album-plus');
4515
  $tags = 'system,meta';
4516
  wppa_setting($slug, '27.2', $name, $desc, $html, $help, $clas, $tags);
4517
 
4518
+ $name = __('Admions choice action', 'wp-photo-album-plus');
4519
+ $desc = __('Select the action to be taken after clicking the "My Choice" link', 'wp-photo-album-plus');
4520
+ $help = __('If set to album, the link is only shown to users who have album admin rights', 'wp-photo-album-plus');
4521
+ $slug = 'wppa_admins_choice_action';
4522
+ $opts = array(__('To zipfile', 'wp-photo-album-plus'), __('To album', 'wp-photo-album-plus'));
4523
+ $vals = array('zip', 'album');
4524
+ $html = wppa_select($slug, $opts, $vals);
4525
+ $clas = '';
4526
+ $tags = 'system,meta';
4527
+ wppa_setting($slug, '27.3', $name, $desc, $html, $help, $clas, $tags);
4528
+
4529
  $name = __('Make owner like photoname', 'wp-photo-album-plus');
4530
  $desc = __('Change the owner to the user who\'s display name equals photoname.', 'wp-photo-album-plus');
4531
  $help = '';
7645
  $tags = 'access,system';
7646
  wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
7647
 
7648
+ $name = __('Album Admin separate', 'wp-photo-album-plus');
7649
+ $desc = __('Restrict album admin to separate albums for non administrators', 'wp-photo-album-plus');
7650
+ $help = '';
7651
+ $slug = 'wppa_admin_separate';
7652
+ $html1 = wppa_checkbox($slug);
7653
+ $html2 = '';
7654
+ $html = array( $html1, $html2 );
7655
+ $clas = '';
7656
+ $tags = 'access,system';
7657
+ wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
7658
+
7659
  wppa_setting_subheader('D', '2', __('Miscellaneous limiting settings', 'wp-photo-album-plus'));
7660
 
7661
  $name = __('Owners only', 'wp-photo-album-plus');
9936
  $tags = 'system,album';
9937
  wppa_setting($slug, '11.3', $name, $desc, $html, $help, $clas, $tags);
9938
 
9939
+ $name = __('Grant restrict', 'wp-photo-album-plus');
9940
+ $desc = __('Only create albums for users with Album Admin rights', 'wp-photo-album-plus');
9941
+ $help = __('See Table VII-A, first column', 'wp-photo-album-plus');
9942
+ $slug = 'wppa_grant_restrict';
9943
+ $html = wppa_checkbox($slug);
9944
+ $clas = '';
9945
+ $tags = 'system,album';
9946
+ wppa_setting($slug, '11.4', $name, $desc, $html, $help, $clas, $tags);
9947
+
9948
  $name = __('Iptc 025 keywords to tags', 'wp-photo-album-plus');
9949
  $desc = __('Convert IPTC025 keywords to tags during upload.', 'wp-photo-album-plus');
9950
  $help = __('Saving IPTC data must be on for this feature', 'wp-photo-album-plus');
9952
  $html = wppa_checkbox( $slug );
9953
  $clas = '';
9954
  $tags = 'system';
9955
+ wppa_setting($slug, '11.9', $name, $desc, $html, $help, $clas, $tags);
9956
 
9957
  $name = __('Max user albums', 'wp-photo-album-plus');
9958
  $desc = __('The max number of albums a user can create.', 'wp-photo-album-plus');
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 7.4.03
7
  *
8
  */
9
 
@@ -850,8 +850,13 @@ static $user;
850
  return false;
851
  }
852
 
853
- // Can user upload?
854
- if ( ! current_user_can( 'wppa_upload' ) && ! wppa_switch( 'user_upload_on' ) ) {
 
 
 
 
 
855
  return false;
856
  }
857
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 7.5.11
7
  *
8
  */
9
 
850
  return false;
851
  }
852
 
853
+ // Restrict?
854
+ if ( wppa_switch( 'grant_restrict' ) && ! current_user_can( 'wppa_admin' ) ) {
855
+ return false;
856
+ }
857
+
858
+ // Can user upload? If restricted need no upload.
859
+ if ( ! wppa_switch( 'grant_restrict' ) && ! current_user_can( 'wppa_upload' ) && ! wppa_switch( 'user_upload_on' ) ) {
860
  return false;
861
  }
862
 
wppa-thumbnails.php CHANGED
@@ -659,30 +659,32 @@ global $wpdb;
659
 
660
  // The admins choice link
661
  $choice = wppa_opt( 'admins_choice' );
662
- if ( ( wppa_user_is( 'administrator' ) && $choice != 'none' ) ||
663
- ( is_user_logged_in() && $choice == 'login' ) ) {
 
664
 
665
- $result .=
666
- '<span' .
667
- ' id="admin-choice-' . wppa_encrypt_photo($thumb['id']) . '-' . $mocc . '"' .
668
- ' style="color:gray;"' .
669
- ' >';
670
- if ( ! wppa_is_photo_in_zip( $thumb['id'] ) ) {
671
  $result .=
672
- '<a' .
673
- ' style="color:blue;cursor:pointer;"' .
674
- ' onclick="' .
675
- esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to add this photo to your zip?' , 'wp-photo-album-plus') . '" ) ) ' .
676
- 'wppaAjaxAddPhotoToZip( '.$mocc.', \''.wppa_encrypt_photo($thumb['id']).'\', false ); return false;' ).'"' .
677
- '>' .
678
- __( 'MyChoice' , 'wp-photo-album-plus') .
679
- '</a>';
680
- }
681
- else {
682
- $result .= __('Selected', 'wp-photo-album-plus');
 
 
 
 
 
 
 
 
 
683
  }
684
- $result .=
685
- '</span>&nbsp;';
686
  }
687
 
688
  // The delete link
659
 
660
  // The admins choice link
661
  $choice = wppa_opt( 'admins_choice' );
662
+ if ( current_user_can( 'wppa_admin' ) || wppa_opt( 'admins_choice_action' ) == 'zip' ) {
663
+ if ( ( wppa_user_is( 'administrator' ) && $choice != 'none' ) ||
664
+ ( is_user_logged_in() && $choice == 'login' ) ) {
665
 
 
 
 
 
 
 
666
  $result .=
667
+ '<span' .
668
+ ' id="admin-choice-' . wppa_encrypt_photo($thumb['id']) . '-' . $mocc . '"' .
669
+ ' style="color:gray;"' .
670
+ ' >';
671
+ if ( ! wppa_is_photo_in_zip( $thumb['id'] ) ) {
672
+ $result .=
673
+ '<a' .
674
+ ' style="color:blue;cursor:pointer;"' .
675
+ ' onclick="' .
676
+ esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to add this photo to your zip?' , 'wp-photo-album-plus') . '" ) ) ' .
677
+ 'wppaAjaxAddPhotoToZip( '.$mocc.', \''.wppa_encrypt_photo($thumb['id']).'\', false ); return false;' ).'"' .
678
+ '>' .
679
+ __( 'MyChoice' , 'wp-photo-album-plus') .
680
+ '</a>';
681
+ }
682
+ else {
683
+ $result .= __('Selected', 'wp-photo-album-plus');
684
+ }
685
+ $result .=
686
+ '</span>&nbsp;';
687
  }
 
 
688
  }
689
 
690
  // The delete link
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 7.5.10
7
  *
8
  */
9
 
@@ -5117,3 +5117,20 @@ function _wppa_get_nesting_level( $id ) {
5117
  function wppa_can_magick() {
5118
  return ( wppa_opt( 'image_magick' ) && wppa_opt( 'image_magick' ) != 'none' );
5119
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 7.5.11
7
  *
8
  */
9
 
5117
  function wppa_can_magick() {
5118
  return ( wppa_opt( 'image_magick' ) && wppa_opt( 'image_magick' ) != 'none' );
5119
  }
5120
+
5121
+ // Get my first granted album
5122
+ function wppa_my_get_first_grant_album() {
5123
+ global $wpdb;
5124
+
5125
+ if ( ! wppa_switch( 'grant_an_album' ) ) return '0';
5126
+ $parents = wppa_opt( 'grant_parent' );
5127
+ if ( is_array( $parents ) ) {
5128
+ $parent = $parents[0];
5129
+ }
5130
+ else {
5131
+ $parent = $parents;
5132
+ }
5133
+ $album = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_albums WHERE owner = %s AND a_parent = %d LIMIT 1", wppa_get_user(), $parent ) );
5134
+
5135
+ return $album;
5136
+ }
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 7.5.11.001
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_revno; $wppa_revno = '7511'; // WPPA db version
27
- global $wppa_api_version; $wppa_api_version = '7.5.11.001'; // WPPA software version
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 7.5.11.002
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_revno; $wppa_revno = '7511'; // WPPA db version
27
+ global $wppa_api_version; $wppa_api_version = '7.5.11.002'; // WPPA software version
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';