WP Photo Album Plus - Version 7.4.00.003

Version Description

= 7.4.00 =

  • 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.4.00.003
Comparing to
See all releases

Code changes from version 7.4.00.002 to 7.4.00.003

changelog.txt CHANGED
@@ -20,6 +20,9 @@ This means that a table line like e.g.
20
  So the meaning of 'Admins Choice' can now be extended to 'Users Choice'.
21
  * You can now remove items from the MyChoice zipfile.
22
  * New setting: Table IX-A35. Enable request info. Shows a button under the slideshow image to request info by email.
 
 
 
23
 
24
  = 7.3.12 =
25
 
20
  So the meaning of 'Admins Choice' can now be extended to 'Users Choice'.
21
  * You can now remove items from the MyChoice zipfile.
22
  * New setting: Table IX-A35. Enable request info. Shows a button under the slideshow image to request info by email.
23
+ * New setting: Table IV-A27.1. Tag admins choice. The user who selected MyChoice will add the tag User-<userid> to the item.
24
+ This means that e.g. a slideshow can be generated with the seleced photos:
25
+ [wppa type="slide" album="#tags,User-1"] for admin or [wppa type="slide" album="#tags,#me"] for the current user.
26
 
27
  = 7.3.12 =
28
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
- Version: 7.4.00.002
6
  Stable tag: 7.3.12.008
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
+ Version: 7.4.00.003
6
  Stable tag: 7.3.12.008
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
wppa-ajax.php CHANGED
@@ -746,6 +746,14 @@ global $wppa_log_file;
746
  $wppa_zip->addFile( $source, wppa_fix_poster_ext( $data['filename'], $photo ) );
747
  $wppa_zip->close();
748
 
 
 
 
 
 
 
 
 
749
  echo 'OK||'.__('Selected', 'wp-photo-album-plus');
750
  wppa_exit();
751
  break;
@@ -779,6 +787,14 @@ global $wppa_log_file;
779
  $bret = $wppa_zip->deleteName( wppa_fix_poster_ext( $data['filename'], $photo ) );
780
  $wppa_zip->close();
781
 
 
 
 
 
 
 
 
 
782
  echo 'OK||'.__('Removed', 'wp-photo-album-plus');
783
  wppa_exit();
784
  break;
@@ -797,11 +813,25 @@ global $wppa_log_file;
797
  @ unlink( $zipfile );
798
  }
799
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
800
  wppa_exit();
801
  break;
802
 
803
  case 'requestinfo':
804
- wppa_log('obs', 'Request info '.$photo);
805
  // Check if the user is allowed to do this
806
  if ( ! is_user_logged_in() ) {
807
  echo 'ER||You must be logged in to request info';
@@ -1625,8 +1655,11 @@ wppa_log('obs', 'Request info '.$photo);
1625
  }
1626
  break;
1627
  case 'upload_limit_count':
1628
- wppa_ajax_check_range( $value, false, '0', false, __( 'Upload limit count' , 'wp-photo-album-plus') );
1629
- if ( wppa( 'error' ) ) wppa_exit();
 
 
 
1630
  $oldval = $wpdb->get_var( $wpdb->prepare( "SELECT upload_limit FROM $wpdb->wppa_albums
1631
  WHERE id = %d", $album ) );
1632
  $temp = explode( '/', $oldval );
746
  $wppa_zip->addFile( $source, wppa_fix_poster_ext( $data['filename'], $photo ) );
747
  $wppa_zip->close();
748
 
749
+ // Add user id as tag to the item if configured
750
+ if ( wppa_switch( 'choice_is_tag' ) ) {
751
+ $tags = wppa_get_photo_item( $photo, 'tags' );
752
+ $tags .= 'user-'.wppa_get_user( 'id' );
753
+ wppa_update_photo( array( 'id' => $photo, 'tags' => wppa_sanitize_tags( $tags ) ) );
754
+ wppa_clear_taglist();
755
+ }
756
+
757
  echo 'OK||'.__('Selected', 'wp-photo-album-plus');
758
  wppa_exit();
759
  break;
787
  $bret = $wppa_zip->deleteName( wppa_fix_poster_ext( $data['filename'], $photo ) );
788
  $wppa_zip->close();
789
 
790
+ // Remove user id as tag to the item if configured
791
+ if ( wppa_switch( 'choice_is_tag' ) ) {
792
+ $tags = wppa_get_photo_item( $photo, 'tags' );
793
+ $tags = str_replace( ',user-' . wppa_get_user( 'id' ) . ',', ',', $tags );
794
+ wppa_update_photo( array( 'id' => $photo, 'tags' => wppa_sanitize_tags( $tags ) ) );
795
+ wppa_clear_taglist();
796
+ }
797
+
798
  echo 'OK||'.__('Removed', 'wp-photo-album-plus');
799
  wppa_exit();
800
  break;
813
  @ unlink( $zipfile );
814
  }
815
  }
816
+
817
+ // Remove all User-<userid> tags
818
+ $tag1 = 'user-' . wppa_get_user( 'id' );
819
+ $tag2 = ucfirst( $tag1 );
820
+ $items = $wpdb->get_results( "SELECT id, tags FROM $wpdb->wppa_photos
821
+ WHERE tags LIKE '%," . $tag1 . ",%'", ARRAY_A );
822
+ foreach( $items as $item ) {
823
+ $id = $item['id'];
824
+ $tags = $item['tags'] ;
825
+ $tags = str_replace( array( $tag1, $tag2 ), '', $tags );
826
+ $tags = wppa_sanitize_tags( $tags );
827
+ wppa_update_photo( array( 'id' => $id, 'tags' => $tags ) );
828
+ }
829
+ wppa_clear_taglist();
830
  wppa_exit();
831
  break;
832
 
833
  case 'requestinfo':
834
+
835
  // Check if the user is allowed to do this
836
  if ( ! is_user_logged_in() ) {
837
  echo 'ER||You must be logged in to request info';
1655
  }
1656
  break;
1657
  case 'upload_limit_count':
1658
+ wppa_ajax_check_range( $value, false, '-1', false, __( 'Upload limit count' , 'wp-photo-album-plus') );
1659
+ if ( wppa( 'error' ) ) {
1660
+ echo '||7||'.__('Invalid value', 'wp-photo-album-plus');
1661
+ wppa_exit();
1662
+ }
1663
  $oldval = $wpdb->get_var( $wpdb->prepare( "SELECT upload_limit FROM $wpdb->wppa_albums
1664
  WHERE id = %d", $album ) );
1665
  $temp = explode( '/', $oldval );
wppa-defaults.php CHANGED
@@ -554,6 +554,7 @@ horizrailenabled:false,";
554
  'wppa_capitalize_tags' => 'yes',
555
  'wppa_enable_admins_choice' => 'no',
556
  'wppa_admins_choice' => 'none',
 
557
  'wppa_owner_to_name' => 'no',
558
 
559
  'wppa_nicescroll_window' => 'no',
554
  'wppa_capitalize_tags' => 'yes',
555
  'wppa_enable_admins_choice' => 'no',
556
  'wppa_admins_choice' => 'none',
557
+ 'wppa_choice_is_tag' => 'no',
558
  'wppa_owner_to_name' => 'no',
559
 
560
  'wppa_nicescroll_window' => 'no',
wppa-functions.php CHANGED
@@ -518,7 +518,7 @@ global $locale;
518
  wppa_reset_occurrance();
519
  return;
520
  }
521
- wppa( 'is_tag', wppa_sanitize_tags( substr( wppa( 'start_album' ), 6 ), true ) );
522
  $id = '0';
523
  wppa( 'photos_only', true );
524
  break;
@@ -1517,6 +1517,18 @@ global $wppa_session;
1517
  // Tagcloud or multitag? Tags do not look at album
1518
  elseif ( wppa( 'is_tag' ) ) {
1519
 
 
 
 
 
 
 
 
 
 
 
 
 
1520
  // Init
1521
  $andor = 'AND';
1522
  if ( strpos( wppa( 'is_tag' ), ';' ) ) $andor = 'OR';
@@ -2668,7 +2680,7 @@ static $user;
2668
  <input' .
2669
  ' type="button"' .
2670
  ' style="float:right; margin-right:6px;"' .
2671
- ' onclick="_wppaStop( '.wppa( 'mocc' ).' );wppaEditPhoto( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').' );"' .
2672
  ' value="' . esc_attr( __( wppa_opt( 'fe_edit_button' ) ) ) . '"' .
2673
  ' /><span></span>';
2674
  }
@@ -2680,7 +2692,7 @@ static $user;
2680
  ' type="button"' .
2681
  ' style="float:right; margin-right:6px;"' .
2682
  ' onclick="' .
2683
- '_wppaStop( ' . wppa( 'mocc' ) . ' );' .
2684
  esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to remove this photo?' , 'wp-photo-album-plus') . '" ) ) ' .
2685
  'wppaAjaxRemovePhoto( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', true );' ) .
2686
  '"' .
@@ -2698,8 +2710,8 @@ static $user;
2698
  ' type="button"' .
2699
  ' style="float:right;margin-right:6px;text-decoration:line-through;"' .
2700
  ' onclick="' .
2701
- '_wppaStop( ' . wppa( 'mocc' ) . ' );' .
2702
- esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to remove this photo from your zip?' , 'wp-photo-album-plus') . '" ) ) ' .
2703
  'wppaAjaxRemovePhotoFromZip( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', false ); return false;' ).'"' .
2704
 
2705
  ' value="' . esc_attr( __( 'MyChoice', 'wp-photo-album-plus' ) ) . '"' .
@@ -2713,8 +2725,8 @@ static $user;
2713
  ' type="button"' .
2714
  ' style="float:right;margin-right:6px;"' .
2715
  ' onclick="' .
2716
- '_wppaStop( ' . wppa( 'mocc' ) . ' );' .
2717
- esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to add this photo to your zip?' , 'wp-photo-album-plus') . '" ) ) ' .
2718
  'wppaAjaxAddPhotoToZip( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', false ); return false;' ).'"' .
2719
 
2720
  ' value="' . esc_attr( __( 'MyChoice', 'wp-photo-album-plus' ) ) . '"' .
@@ -2729,7 +2741,7 @@ static $user;
2729
  ' type="button"' .
2730
  ' style="float:right;margin-right:6px;"' .
2731
  ' onclick="' .
2732
- '_wppaStop( ' . wppa( 'mocc' ) . ' );' .
2733
  esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to ask for info on this photo?' , 'wp-photo-album-plus') . '" ) ) ' .
2734
  'wppaAjaxRequestInfo( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', false ); return false;' ).'"' .
2735
 
@@ -5623,7 +5635,7 @@ function wppa_get_lbtitle( $type, $id ) {
5623
  ' type="button"' .
5624
  ' style="float:right; margin-right:6px;"' .
5625
  ' class="wppa-ovl-button"' .
5626
- ' onclick="' . ( $type == 'slide' ? '_wppaStop( '.wppa( 'mocc' ).' );' : '' ) . 'wppaEditPhoto( '.wppa( 'mocc' ).', '.$parg.' );"' .
5627
  ' value="' . esc_attr( __( wppa_opt( 'fe_edit_button' ) ) ) . '"' .
5628
  ' />';
5629
  }
518
  wppa_reset_occurrance();
519
  return;
520
  }
521
+ wppa( 'is_tag', wppa_sanitize_tags( substr( wppa( 'start_album' ), 6 ), true, true ) );
522
  $id = '0';
523
  wppa( 'photos_only', true );
524
  break;
1517
  // Tagcloud or multitag? Tags do not look at album
1518
  elseif ( wppa( 'is_tag' ) ) {
1519
 
1520
+ // Translate #me tag to current user id
1521
+ if ( strpos( wppa( 'is_tag' ), '#me' ) !== false ) {
1522
+ $uid = wppa_get_user( 'id' );
1523
+ if ( ! is_numeric( $uid ) ) { // Not logged in?
1524
+ $uid = '';
1525
+ }
1526
+ else {
1527
+ $uid = 'user-'.$uid;
1528
+ }
1529
+ wppa( 'is_tag', str_replace( '#me', $uid, wppa( 'is_tag' ) ) );
1530
+ }
1531
+
1532
  // Init
1533
  $andor = 'AND';
1534
  if ( strpos( wppa( 'is_tag' ), ';' ) ) $andor = 'OR';
2680
  <input' .
2681
  ' type="button"' .
2682
  ' style="float:right; margin-right:6px;"' .
2683
+ ' onclick="wppaStopShow( '.wppa( 'mocc' ).' );wppaEditPhoto( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').' );"' .
2684
  ' value="' . esc_attr( __( wppa_opt( 'fe_edit_button' ) ) ) . '"' .
2685
  ' /><span></span>';
2686
  }
2692
  ' type="button"' .
2693
  ' style="float:right; margin-right:6px;"' .
2694
  ' onclick="' .
2695
+ 'wppaStopShow( ' . wppa( 'mocc' ) . ' );' .
2696
  esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to remove this photo?' , 'wp-photo-album-plus') . '" ) ) ' .
2697
  'wppaAjaxRemovePhoto( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', true );' ) .
2698
  '"' .
2710
  ' type="button"' .
2711
  ' style="float:right;margin-right:6px;text-decoration:line-through;"' .
2712
  ' onclick="' .
2713
+ 'wppaStopShow( ' . wppa( 'mocc' ) . ' );' .
2714
+ esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to remove this photo from your selection?' , 'wp-photo-album-plus') . '" ) ) ' .
2715
  'wppaAjaxRemovePhotoFromZip( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', false ); return false;' ).'"' .
2716
 
2717
  ' value="' . esc_attr( __( 'MyChoice', 'wp-photo-album-plus' ) ) . '"' .
2725
  ' type="button"' .
2726
  ' style="float:right;margin-right:6px;"' .
2727
  ' onclick="' .
2728
+ 'wppaStopShow( ' . wppa( 'mocc' ) . ' );' .
2729
+ esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to add this photo to your selection?' , 'wp-photo-album-plus') . '" ) ) ' .
2730
  'wppaAjaxAddPhotoToZip( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', false ); return false;' ).'"' .
2731
 
2732
  ' value="' . esc_attr( __( 'MyChoice', 'wp-photo-album-plus' ) ) . '"' .
2741
  ' type="button"' .
2742
  ' style="float:right;margin-right:6px;"' .
2743
  ' onclick="' .
2744
+ 'wppaStopShow( ' . wppa( 'mocc' ) . ' );' .
2745
  esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to ask for info on this photo?' , 'wp-photo-album-plus') . '" ) ) ' .
2746
  'wppaAjaxRequestInfo( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', false ); return false;' ).'"' .
2747
 
5635
  ' type="button"' .
5636
  ' style="float:right; margin-right:6px;"' .
5637
  ' class="wppa-ovl-button"' .
5638
+ ' onclick="' . ( $type == 'slide' ? 'wppaStopShow( '.wppa( 'mocc' ).' );' : '' ) . 'wppaEditPhoto( '.wppa( 'mocc' ).', '.$parg.' );"' .
5639
  ' value="' . esc_attr( __( wppa_opt( 'fe_edit_button' ) ) ) . '"' .
5640
  ' />';
5641
  }
wppa-settings-autosave.php CHANGED
@@ -4443,6 +4443,15 @@ global $wppa_supported_camara_brands;
4443
  $tags = 'system';
4444
  wppa_setting($slug, '27', $name, $desc, $html, $help, $clas, $tags);
4445
 
 
 
 
 
 
 
 
 
 
4446
  $name = __('Make owner like photoname', 'wp-photo-album-plus');
4447
  $desc = __('Change the owner to the user who\'s display name equals photoname.', 'wp-photo-album-plus');
4448
  $help = '';
4443
  $tags = 'system';
4444
  wppa_setting($slug, '27', $name, $desc, $html, $help, $clas, $tags);
4445
 
4446
+ $name = __('Tag Admins Choice', 'wp-photo-album-plus');
4447
+ $desc = __('Tag photos with Admins Choice user', 'wp-photo-album-plus');
4448
+ $help = '';
4449
+ $slug = 'wppa_choice_is_tag';
4450
+ $html = wppa_checkbox($slug);
4451
+ $clas = '';
4452
+ $tags = 'system,meta';
4453
+ wppa_setting($slug, '27.1', $name, $desc, $html, $help, $clas, $tags);
4454
+
4455
  $name = __('Make owner like photoname', 'wp-photo-album-plus');
4456
  $desc = __('Change the owner to the user who\'s display name equals photoname.', 'wp-photo-album-plus');
4457
  $help = '';
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.4.00.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,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_revno; $wppa_revno = '7400'; // WPPA db version
27
- global $wppa_api_version; $wppa_api_version = '7.4.00.002'; // 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.4.00.003
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 = '7400'; // WPPA db version
27
+ global $wppa_api_version; $wppa_api_version = '7.4.00.003'; // WPPA software version
28
 
29
  /* Init page js data */
30
  global $wppa_js_page_data; $wppa_js_page_data = '';