WP Photo Album Plus - Version 8.1.02.001

Version Description

= 8.1.01 =

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

Release Info

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

Code changes from version 8.1.01.005 to 8.1.02.001

changelog.txt CHANGED
@@ -1,5 +1,11 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
 
3
  = 8.1.01 =
4
 
5
  * Lightbox on slide images did not always show the full list of items. Fixed.
1
  WP Photo Album Plus Changelog
2
 
3
+ = 8.2.01 =
4
+
5
+ * Re-enabled update addressline.
6
+ * Nicescroll options are now sanitized to prevent js crash after wrong edits.
7
+
8
+
9
  = 8.1.01 =
10
 
11
  * Lightbox on slide images did not always show the full list of items. Fixed.
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 8.1.01.001
6
  *
7
  */
8
 
@@ -3812,6 +3812,9 @@ global $wppa;
3812
  $value = 'no';
3813
  $alert = __('All album cover images set to default', 'wp-photo-album-plus');
3814
  break;
 
 
 
3815
 
3816
  default:
3817
 
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 8.1.02.001
6
  *
7
  */
8
 
3812
  $value = 'no';
3813
  $alert = __('All album cover images set to default', 'wp-photo-album-plus');
3814
  break;
3815
+ case 'wppa_nicescroll_opts':
3816
+ $value = wppa_sanitize_nso( $value );
3817
+ break;
3818
 
3819
  default:
3820
 
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 8.1.01.004
7
  *
8
  */
9
 
@@ -277,7 +277,6 @@ global $wppa_revno;
277
  $pano = wppa_get( 'pano-val', '9' );
278
  if ( in_array( $pano, array( '0', '1', '2' ) ) ) {
279
 
280
- // $last = get_option( 'wppa_last_pano_set', '0' );
281
  $done = '0';
282
  $todo = $wpdb->get_results( $wpdb->prepare( "SELECT id, photox, photoy, panorama, angle FROM $wpdb->wppa_photos
283
  WHERE album = %d
@@ -341,7 +340,6 @@ global $wppa_revno;
341
  wppa_remake_files( '', $id );
342
  wppa_get_photox( $id, true );
343
  wppa_get_photoy( $id, true );
344
- // update_option( 'wppa_last_pano_set', $id );
345
  $done++;
346
 
347
  if ( ! in_array( $pano, array( '0', '1', '2' ) ) ) {
@@ -349,7 +347,6 @@ global $wppa_revno;
349
  }
350
  elseif ( $done == $tot ) {
351
  $remark = __( 'All applicable items processed', 'wp-photo-album-plus' );
352
- // delete_option( 'wppa_last_pano_set' );
353
  }
354
  else {
355
  $remark = sprintf( __( '%1d items out of %2d processed', 'wp-photo-album-plus' ), $done, $tot );
@@ -499,7 +496,7 @@ global $wppa_revno;
499
  />' );
500
 
501
  // The edit albuminfo panel
502
- echo '
503
  <div
504
  id="albumitem-' . $id . '"
505
  class="wppa-table-wrap"
@@ -507,7 +504,7 @@ global $wppa_revno;
507
  >';
508
  {
509
  // Section 1
510
- echo '
511
  <!-- Album Section 1 -->
512
  <table class="wppa-table wppa-album-table" >
513
  <tbody>
@@ -515,39 +512,31 @@ global $wppa_revno;
515
  <td>';
516
 
517
  // More or less static data
518
- // Album number
519
- echo
520
  __( 'Album number:', 'wp-photo-album-plus' ) . ' ' .
521
- $id . '. ';
522
 
523
- // Crypt
524
- echo
525
  __( 'Crypt:', 'wp-photo-album-plus' ) . ' ' .
526
- $crypt . '. ';
527
 
528
- // Created
529
- echo
530
  __( 'Created:', 'wp-photo-album-plus' ) . ' ' .
531
- wppa_local_date( '', $timestamp ) . ' ' . __( 'local time' , 'wp-photo-album-plus') . '. ';
532
 
533
- // Modified
534
- echo
535
  __( 'Modified:', 'wp-photo-album-plus' ) . ' ';
536
  if ( $modified > $timestamp ) {
537
- echo wppa_local_date( '', $modified ) . ' ' . __( 'local time' , 'wp-photo-album-plus' ) . '. ';
538
  }
539
  else {
540
- echo __( 'Not modified', 'wp-photo-album-plus' ) . '. ';
541
  }
542
 
543
  // Views
544
  if ( wppa_switch( 'track_viewcounts' ) ) {
545
- echo
546
- __( 'Album Views:', 'wp-photo-album-plus' ) . ' ' . $views . ', ';
547
- echo
548
  __( 'Photo views:', 'wp-photo-album-plus' ) . ' ' . $pviews . '. ';
549
  if ( $nsub ) {
550
- echo
551
  __( 'Photo views inc sub albums:', 'wp-photo-album-plus' ) . ' ' . $tpviews . '. ';
552
  }
553
  }
@@ -555,27 +544,26 @@ global $wppa_revno;
555
  // Clicks
556
  if ( wppa_switch( 'track_clickcounts' ) ) {
557
  $click_arr = $wpdb->get_col( "SELECT clicks FROM $wpdb->wppa_photos WHERE album = $id" );
558
- echo
559
  __( 'Clicks:', 'wp-photo-album-plus' ) . ' ' . array_sum( $click_arr ) . '. ';
560
  }
561
 
562
- // Newline
563
- echo '<br />';
564
 
565
  // Owner
566
- echo
567
  __( 'Owned by:', 'wp-photo-album-plus' ) . ' ';
568
  if ( ! wppa_user_is( 'administrator' ) ) {
569
  if ( $owner == '--- public ---' ) {
570
- echo __( '--- public ---', 'wp-photo-album-plus' ) . ' ';
571
  }
572
  else {
573
- echo $owner . '. ';
574
  }
575
  }
576
  else {
577
  if ( wppa_get_user_count() > wppa_opt( 'max_users' ) ) {
578
- echo '
579
  <input
580
  type="text"
581
  value="' . esc_attr( $owner ) . '"
@@ -594,7 +582,7 @@ global $wppa_revno;
594
  else {
595
  $title = '';
596
  }
597
- echo '
598
  <select
599
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
600
  title="' . esc_attr( $title ) . '"
@@ -605,7 +593,7 @@ global $wppa_revno;
605
  }
606
 
607
  // Order # -->
608
- echo
609
  __( 'Album sequence number', 'wp-photo-album-plus' ) . ':&nbsp;
610
  <input
611
  type="text"
@@ -614,7 +602,7 @@ global $wppa_revno;
614
  style="width:50px;"
615
  />&nbsp;';
616
  if ( wppa_opt( 'list_albums_by' ) != '1' && $a_order != '0' ) {
617
- echo
618
  '<small class="description" style="color:red" >' .
619
  __( 'Album sequence number has only effect if you set the album sort order method to <b>Order #</b> in the Photo Albums -> Settings screen.<br />', 'wp-photo-album-plus' ) .
620
  '</small>' . ' ';
@@ -623,7 +611,7 @@ global $wppa_revno;
623
  // Status
624
  $title = __( 'Set the frontend visibility of the album cover and items not including sub-albums.', 'wp-photo-album-plus' ) . ' ' .
625
  __( 'Publish: visible for all, Private: visible for logged in only, Hidden: visible for admin only', 'wp-photo-album-plus' );
626
- echo
627
  __( 'Status', 'wp-photo-album-plus' ) . ':&nbsp;
628
  <select
629
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'status\', this )"
@@ -640,10 +628,10 @@ global $wppa_revno;
640
  </select>&nbsp;';
641
 
642
  // Parent
643
- echo
644
  __( 'Parent album', 'wp-photo-album-plus' ) . ':&nbsp;';
645
  if ( wppa_extended_access() ) {
646
- echo
647
  wppa_album_select_a( array( 'checkaccess' => true,
648
  'exclude' => $id,
649
  'selected' => $a_parent,
@@ -666,7 +654,7 @@ global $wppa_revno;
666
  '</select>';
667
  }
668
  else {
669
- echo '
670
  <select
671
  id="wppa-parsel"
672
  style="max-width:300px;"
@@ -684,11 +672,11 @@ global $wppa_revno;
684
  ) .
685
  '</select>';
686
  }
687
- echo '&nbsp;';
688
 
689
  // P-order-by
690
  if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
691
- echo
692
  __( 'Photo order:', 'wp-photo-album-plus' ) . ' ';
693
  $options = array( __( '--- default ---', 'wp-photo-album-plus' ),
694
  __( 'Order #', 'wp-photo-album-plus' ),
@@ -731,16 +719,16 @@ global $wppa_revno;
731
  }
732
  $title = sprintf( __( 'The default is set in Basic settings -> Misc -> I -> Item 2 and is currently %s', 'wp-photo-album-plus' ), $dflt );
733
 
734
- echo '
735
  <select
736
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'p_order_by\', this )"
737
  title="' . esc_attr( $title ) . '"
738
  >';
739
  foreach ( array_keys( $options ) as $key ) {
740
  $sel = $values[$key] == $p_order_by ? ' selected="selected"' : '';
741
- echo '<option value="' . $values[$key] . '"' . $sel . ' >' . $options[$key] . '</option>';
742
  }
743
- echo '
744
  </select>&nbsp;';
745
  }
746
 
@@ -767,23 +755,23 @@ global $wppa_revno;
767
  }
768
 
769
  $title = sprintf( __( 'The default is set in Basic settings -> Misc -> I -> Item 1, currently %s', 'wp-photo-album-plus' ), $dflt );
770
- echo
771
  __( 'Sub album sort order', 'wp-photo-album-plus' ) . ':&nbsp;
772
  <select
773
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'suba_order_by\', this )"
774
  title="' . esc_attr( $title ) . '"
775
  >';
776
  for ( $i = 0; $i < 7; $i++ ) {
777
- echo '<option value="' . esc_attr( $vals[$i] ) . '" ' . ( $suba_order_by == $vals[$i] ? $sel : '' ) . ' >' . $opts[$i] . '</option>';
778
  }
779
- echo '
780
  </select>&nbsp;';
781
 
782
  // Alternative thumbnail size
783
  if ( ! wppa_switch( 'alt_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
784
  $title = sprintf( __( 'Alternate thumbnail size is set in Basic settings -> Thumbnails -> I -> Item 2 and is currently set to %s', 'wp-photo-album-plus' ), wppa_opt( 'thumbsize_alt' ) );
785
  $sel = ' selected="selected"';
786
- echo __( 'Use alt thumbsize', 'wp-photo-album-plus' ) . ':&nbsp;
787
  <select
788
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'alt_thumbsize\', this )"
789
  title="' . esc_attr( $title ) . '"
@@ -801,7 +789,7 @@ global $wppa_revno;
801
  if ( ! wppa_switch( 'covertype_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
802
  $sel = ' selected="selected"';
803
  $title = sprintf( __( 'The default is set in Basic settings -> Albums -> III -> Item 4 and is set to %s', 'wp-photo-album-plus' ), wppa_opt( 'cover_type' ) );
804
- echo
805
  __( 'Cover&nbsp;Type', 'wp-photo-album-plus' ) . ':&nbsp;
806
  <select
807
  onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_type\', this )"
@@ -832,12 +820,12 @@ global $wppa_revno;
832
  }
833
 
834
  // Cover photo
835
- echo
836
  __( 'Cover&nbsp;Photo:', 'wp-photo-album-plus' ) . '&nbsp;' .
837
  wppa_main_photo( $main_photo, $cover_type ) . '&nbsp;';
838
 
839
  // Upload limit
840
- echo
841
  __( 'Upload limit:', 'wp-photo-album-plus' ) . '&nbsp;';
842
  $lims = explode( '/', $upload_limit );
843
  if ( ! is_array( $lims ) ) {
@@ -846,7 +834,7 @@ global $wppa_revno;
846
  if ( wppa_user_is( 'administrator' ) ) {
847
  $sel = ' selected="selected"';
848
  $title = __( 'Set the upload limit (0 means unlimited).', 'wp-photo-album-plus' );
849
- echo '
850
  <input
851
  type="text"
852
  id="upload_limit_count"
@@ -866,27 +854,27 @@ global $wppa_revno;
866
  }
867
  else {
868
  if ( $lims[0] == '0' ) {
869
- _e( 'Unlimited', 'wp-photo-album-plus' );
870
  }
871
  else {
872
- echo $lims[0] . '&nbsp;';
873
  switch ( $lims[1] ) {
874
- case '3600': _e( 'per hour', 'wp-photo-album-plus' ); break;
875
- case '86400': _e( 'per day', 'wp-photo-album-plus' ); break;
876
- case '604800': _e( 'per week', 'wp-photo-album-plus' ); break;
877
- case '2592000': _e( 'per month', 'wp-photo-album-plus' ); break;
878
- case '31536000': _e( 'per year', 'wp-photo-album-plus' ); break;
879
- default: echo sprintf( 'per %d seconds', $lims[1] );
880
  }
881
  }
882
- echo '. ';
883
  }
884
 
885
  // Tree limit
886
  $title = __( 'The upload limit for this album and all its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
887
  __( 'This setting overrules all other limits that may apply to this album or its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
888
  __( '0 means no limit.', 'wp-photo-album-plus' );
889
- echo __( 'Tree upload limit', 'wp-photo-album-plus' ) . ':
890
  <input
891
  type="number"
892
  min="0"
@@ -894,9 +882,9 @@ global $wppa_revno;
894
  value="' . $tree_limit . '"
895
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_tree\', this )"
896
  style="cursor:pointer;"
897
- />';
898
 
899
- echo '<br />';
900
 
901
  // Need this the next 5 items
902
  $yes = __( 'yes', 'wp-photo-album-plus' );
@@ -907,7 +895,7 @@ global $wppa_revno;
907
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
908
  __( 'The default is set in Basic settings -> Photos -> I -> Item 4 and is currently set to', 'wp-photo-album-plus' ) . ' ' .
909
  ( wppa_switch( 'zoom_on' ) ? $yes : $no ) . '.';
910
- echo
911
  __( 'Photos are zoomable:', 'wp-photo-album-plus' ) . '
912
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'zoomable\', this )" title="' . esc_attr( $title ) . '" >
913
  <option value="" '.($zoomable==''?'selected="selected"': '').' >' . $def . '</option>
@@ -929,7 +917,7 @@ global $wppa_revno;
929
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
930
  sprintf( __( 'The defaults are set in Basic settings -> Slideshow -> I -> Item 17 (%s), Basic settings -> Thumbnails -> II -> Item 1 (%s) and Basic settings -> Lightbox -> I -> Item 3 (%s).', 'wp-photo-album-plus' ),
931
  ( wppa_switch( 'show_full_name' ) ? $yes : $no ), ( wppa_switch( 'thumb_text_name' ) ? $yes : $no ), ( wppa_switch( 'ovl_name' ) ? $yes : $no ) );
932
- echo
933
  __( 'Display photo names:', 'wp-photo-album-plus' ) . '
934
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt0\', this )" title="' . esc_attr( $title ) . '" >
935
  <option value="0" '.($disp_opt[0]=='0'?'selected="selected"': '').' >' . $def . '</option>
@@ -941,7 +929,7 @@ global $wppa_revno;
941
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
942
  sprintf( __( 'The defaults are set in Basic settings -> Slideshow -> I -> Item 20 (%s), Basic settings -> Thumbnails -> II -> Item 3 (%s) and Basic settings -> Lightbox -> I -> Item 4 (%s).', 'wp-photo-album-plus' ),
943
  ( wppa_switch( 'show_full_desc' ) ? $yes : $no ), ( wppa_switch( 'thumb_text_desc' ) ? $yes : $no ), ( wppa_switch( 'ovl_desc' ) ? $yes : $no ) );
944
- echo
945
  __( 'Display photo descriptions:', 'wp-photo-album-plus' ) . '
946
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt1\', this )" title="' . esc_attr( $title ) . '" >
947
  <option value="0" '.($disp_opt[1]=='0'?'selected="selected"': '').' >' . $def . '</option>
@@ -953,7 +941,7 @@ global $wppa_revno;
953
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
954
  sprintf( __( 'The defaults are set in Basic settings -> General -> I -> Item 5 (%s), Basic settings -> Thumbnails -> II -> Item 3 (%s) and Basic settings -> Lightbox -> I -> Item 5 (%s).', 'wp-photo-album-plus' ),
955
  ( wppa_switch( 'rating_on' ) ? $yes : $no ), ( wppa_switch( 'thumb_text_rating' ) ? $yes : $no ), ( wppa_switch( 'ovl_rating' ) ? $yes : $no ) );
956
- echo
957
  __( 'Display rating:', 'wp-photo-album-plus' ) . '
958
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt2\', this )" title="' . esc_attr( $title ) . '" >
959
  <option value="0" '.($disp_opt[2]=='0'?'selected="selected"': '').' >' . $def . '</option>
@@ -965,7 +953,7 @@ global $wppa_revno;
965
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
966
  sprintf( __( 'The defaults are set in Basic settings -> General -> I -> Item 4 (%s) and Basic settings -> Thumbnails -> II -> Item 4, count only (%s).', 'wp-photo-album-plus' ),
967
  ( wppa_switch( 'show_comments' ) ? $yes : $no ), ( wppa_switch( 'thumb_text_comcount' ) ? $yes : $no ) );
968
- echo
969
  __( 'Display comments:', 'wp-photo-album-plus' ) . '
970
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt3\', this )" title="' . esc_attr( $title ) . '" >
971
  <option value="0" '.($disp_opt[3]=='0'?'selected="selected"': '').' >' . $def . '</option>
@@ -977,9 +965,8 @@ global $wppa_revno;
977
  if ( wppa_switch( 'watermark_on' ) ) {
978
 
979
  // Newline
980
- echo '<br />';
981
 
982
- echo
983
  __( 'Watermark file:', 'wp-photo-album-plus' ) . '
984
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmfile\', this )" >' .
985
  wppa_watermark_file_select( 'album', $id ) . '
@@ -994,29 +981,29 @@ global $wppa_revno;
994
  if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
995
  $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
996
 
997
- echo
998
  __( 'Delete at', 'wp-photo-album-plus' ) .
999
- ' ' .
1000
- '<input' .
1001
- ' type="checkbox"' .
1002
- ' id="scheduledel"' .
1003
  ( $scheduledel ? ' checked="checked"' : '' ) .
1004
- ( $may_change ? '' : ' disabled="disabled"' ) .
1005
- ' onchange="wppaChangeScheduleDelAlbum( ' . $id . ', this );"' .
1006
- ' />' .
1007
- ' ' .
1008
- '<input type="hidden" value="" id="wppa-dummy-del" />' .
1009
- '<span
1010
  class="wppa-datetimedel-' . $id . '"' .
1011
- ( $albuminfo['scheduledel'] ? '' : ' style="display:none;"' ) .
1012
- ' >' .
1013
- wppa_get_date_time_select_html( 'delalbum', $id, $may_change ) .
1014
- '</span>' .
1015
- ' ';
1016
  }
1017
 
1018
  // Status
1019
- echo '<br />' .
1020
  __( 'Remark', 'wp-photo-album-plus' ) . ':&nbsp;
1021
  <span
1022
  id="albumstatus-' . $id . '"
@@ -1026,21 +1013,20 @@ global $wppa_revno;
1026
  </span>';
1027
 
1028
 
1029
- echo '
1030
  </td>
1031
  </tr>
1032
  </tbody>
1033
  </table>';
 
1034
  }
1035
  {
1036
  // Section 2
1037
- echo '
1038
  <!-- Album Section 2 -->
1039
  <table class="wppa-table wppa-album-table" >
1040
- <tbody>';
1041
 
1042
- // Name
1043
- echo '
1044
  <tr>
1045
  <td>' .
1046
  __( 'Name:', 'wp-photo-album-plus' ) . '
@@ -1061,32 +1047,24 @@ global $wppa_revno;
1061
  </td>
1062
  <td>
1063
  </td>
1064
- </tr>';
1065
 
1066
- // Description
1067
- echo '
1068
  <tr>
1069
  <td>' .
1070
  __( 'Description:', 'wp-photo-album-plus' ) . '
1071
- </td>';
1072
-
1073
- echo '
1074
  <td>
1075
  <textarea
1076
  style="width:100%;height:60px;"
1077
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', this )"
1078
  >' .
1079
- esc_textarea( stripslashes( $description ) ) .
1080
- '</textarea>
1081
- </td>';
1082
-
1083
- echo '
1084
  <td>
1085
  </td>
1086
- </tr>';
1087
 
1088
- // Categories
1089
- echo '
1090
  <tr>
1091
  <td>' .
1092
  __( 'Categories:', 'wp-photo-album-plus' ) . '
@@ -1108,26 +1086,24 @@ global $wppa_revno;
1108
  >';
1109
  $catlist = wppa_get_catlist();
1110
  if ( is_array( $catlist ) ) {
1111
- echo '
1112
  <option value="" >' . __( '- select to add -', 'wp-photo-album-plus' ) . '</option>';
1113
  foreach ( $catlist as $cat ) {
1114
- echo '
1115
  <option value="' . esc_attr( $cat['cat'] ) . '" >' . htmlspecialchars( $cat['cat'] ) . '</option>';
1116
  }
1117
  }
1118
  else {
1119
- echo '
1120
  <option value="0" >' . __( 'No categories yet', 'wp-photo-album-plus') . '</option>';
1121
  }
1122
- echo '
1123
  </select>
1124
  </td>
1125
  <td>
1126
  </td>
1127
- </tr>';
1128
 
1129
- // Default tags
1130
- echo '
1131
  <tr>
1132
  <td>
1133
  ' . __( 'Default photo tags:', 'wp-photo-album-plus' ) . '
@@ -1160,7 +1136,7 @@ global $wppa_revno;
1160
  }
1161
  foreach( array_keys( $custom_data ) as $key ) {
1162
  if ( wppa_opt( 'album_custom_caption_' . $key ) ) {
1163
- echo '
1164
  <tr>
1165
  <td>
1166
  ' . apply_filters( 'translate_text', wppa_opt( 'album_custom_caption_' . $key ) ) . '
@@ -1188,7 +1164,7 @@ global $wppa_revno;
1188
  }
1189
 
1190
  // Link type
1191
- echo '
1192
  <tr>
1193
  <td>
1194
  ' . __( 'Link type:', 'wp-photo-album-plus' ) . '
@@ -1196,7 +1172,7 @@ global $wppa_revno;
1196
  <td>';
1197
  $sel = ' selected="selected"';
1198
  $lt = $cover_linktype;
1199
- echo '
1200
  <select onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_linktype\', this )" >
1201
  <option value="content"' . ( $lt == 'content' ? $sel : '' ) . ' >' . __( 'the sub-albums and thumbnails', 'wp-photo-album-plus' ) . '</option>
1202
  <option value="albums"' . ( $lt == 'albums' ? $sel : '' ) . ' >' . __( 'the sub-albums', 'wp-photo-album-plus' ) . '</option>
@@ -1208,12 +1184,12 @@ global $wppa_revno;
1208
  <br />
1209
  <span class="description">';
1210
  if ( wppa_switch( 'auto_page' ) ) {
1211
- _e( 'If you select "the link page with a clean url", select an Auto Page of one of the photos in this album.', 'wp-photo-album-plus' );
1212
  }
1213
  else {
1214
- _e( 'If you select "the link page with a clean url", make sure you enter the correct shortcode on the target page.', 'wp-photo-album-plus' );
1215
  }
1216
- echo '
1217
  </span>
1218
  </td>
1219
  <td>
@@ -1222,7 +1198,7 @@ global $wppa_revno;
1222
 
1223
  // Link page
1224
  if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1225
- echo '
1226
  <tr>
1227
  <td>
1228
  ' . __( 'Link to:', 'wp-photo-album-plus' ) . '
@@ -1242,7 +1218,7 @@ global $wppa_revno;
1242
  $linkpage = '0';
1243
  }
1244
 
1245
- echo '
1246
  <select
1247
  onchange="wppaAjaxUpdateAlbum( '. $id . ' , \'cover_linkpage\', this )"
1248
  style="max-width:100%;"
@@ -1251,7 +1227,7 @@ global $wppa_revno;
1251
  __( '--- the same page or post ---', 'wp-photo-album-plus' ) .
1252
  '</option>';
1253
  foreach ( $pages as $page ) {
1254
- echo '
1255
  <option
1256
  value="' . $page['ID'] . '"' .
1257
  ( $linkpage == $page['ID'] ? ' selected="selected"' : '' ) .
@@ -1260,14 +1236,14 @@ global $wppa_revno;
1260
  ( $page['post_type'] == 'post' ? ' (' . htmlspecialchars( $page['post_date'] ) . ')' : '' ) .
1261
  '</option>';
1262
  }
1263
- echo '
1264
  </select>
1265
  <br />
1266
  <span class="description" >' .
1267
  __( 'If you want, you can link the title to a WP page or post instead of the album\'s content. If so, select the page the title links to.', 'wp-photo-album-plus' ) .
1268
  '</span>';
1269
  }
1270
- echo '
1271
  </td>
1272
  <td>
1273
  </td>
@@ -1275,7 +1251,7 @@ global $wppa_revno;
1275
  }
1276
 
1277
  // Schedule
1278
- echo '
1279
  <tr>
1280
  <td>' .
1281
  __( 'Schedule:', 'wp-photo-album-plus' ) . ' ' .
@@ -1303,91 +1279,92 @@ global $wppa_revno;
1303
  </td>
1304
  </tr>';
1305
 
1306
- echo '
1307
  </tbody>
1308
  </table>';
1309
- } /*hbi*/
 
1310
  {
1311
  // Section 3, Actions
1312
- echo
1313
- "\n" . '<!-- Album Section 3 -->' .
1314
- '<table' .
1315
- ' class="wppa-table wppa-album-table"' .
1316
- ' >' .
1317
- '<tbody>' .
1318
- '<tr>' .
1319
- '<td>';
1320
 
1321
  // Inherit cats
1322
- echo
1323
- '<input' .
1324
- ' type="button"' .
1325
- ' title="' . esc_attr( __( 'Apply categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"' .
1326
- ' onclick="wppaTryInheritCats( ' . $id . ' )"' .
1327
- ' value="' . esc_attr( __( 'Apply Cats to subalbums', 'wp-photo-album-plus' ) ) . '"' .
1328
- ' />' .
1329
- '<input' .
1330
- ' type="button"' .
1331
- ' title="' . esc_attr( __( 'Add categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"' .
1332
- ' onclick="wppaTryAddCats( ' . $id . ' )"' .
1333
- ' value="' . esc_attr( __( 'Add Cats to subalbums', 'wp-photo-album-plus' ) ) . '"' .
1334
- ' />';
1335
 
1336
  // Apply default tags
1337
- echo
1338
- '<input' .
1339
- ' type="button"' .
1340
- ' title="' . esc_attr( __( 'Tag all photos in this album with the default tags.', 'wp-photo-album-plus' ) ) . '"' .
1341
- ' onclick="wppaTryApplyDeftags( ' . $id . ' )"' .
1342
- ' value="' . esc_attr( __( 'Apply default tags', 'wp-photo-album-plus' ) ) . '"' .
1343
- ' />' .
1344
- '<input' .
1345
- ' type="button"' .
1346
- ' title="' . esc_attr( __( 'Add the default tags to all photos in this album.', 'wp-photo-album-plus' ) ) . '"' .
1347
- ' onclick="wppaTryAddDeftags( ' . $id . ' )"' .
1348
- ' value="' . esc_attr( __( 'Add default tags', 'wp-photo-album-plus' ) ) . '"' .
1349
- ' />';
1350
 
1351
  // Schedule all
1352
- echo
1353
- '<input' .
1354
- ' type="button"' .
1355
- ' title="' . esc_attr( __( 'Schedule all photos in this album for later publishing.', 'wp-photo-album-plus' ) ) . '"' .
1356
- ' onclick="wppaTryScheduleAll( ' . $id . ' )"' .
1357
- ' value="' . esc_attr( __( 'Schedule all', 'wp-photo-album-plus' ) ) . '"' .
1358
- ' />';
1359
 
1360
  // Reset Ratings
1361
  if ( wppa_switch( 'rating_on') ) {
1362
  $onc = 'if (confirm(\''.__( 'Are you sure you want to clear the ratings in this album?', 'wp-photo-album-plus' ).'\')) { wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'clear_ratings\', 0 ); }';
1363
- echo
1364
- '<input' .
1365
- ' type="button"' .
1366
- ' onclick="' . $onc . '"' .
1367
- ' value="' . esc_attr( __( 'Reset ratings', 'wp-photo-album-plus' ) ) . '"' .
1368
- ' />';
1369
  }
1370
 
1371
  // Apply New photo desc
1372
  if ( wppa_switch( 'apply_newphoto_desc') ) {
1373
  $onc = 'if ( confirm(\'Are you sure you want to set the description of all photos to \n\n'.esc_js(wppa_opt( 'newphoto_description')).'\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&applynewdesc=1\'';
1374
- echo
1375
- '<input' .
1376
- ' type="button"' .
1377
- ' onclick="' . $onc . '"' .
1378
- ' value="' . esc_attr( __( 'Apply new photo desc', 'wp-photo-album-plus' ) ) . '"' .
1379
- ' />';
1380
  }
1381
 
1382
  // Remake all
1383
  if ( wppa_user_is( 'administrator' ) ) {
1384
  $onc = 'if ( confirm(\'Are you sure you want to remake the files for all photos in this album?\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&remakealbum=1\'';
1385
- echo
1386
- '<input' .
1387
- ' type="button"' .
1388
- ' onclick="' . $onc . '"' .
1389
- ' value="' . esc_attr( __( 'Remake all', 'wp-photo-album-plus' ) ) . '"' .
1390
- ' />';
1391
  }
1392
 
1393
  // Create subalbum
@@ -1395,12 +1372,12 @@ global $wppa_revno;
1395
  $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $albuminfo['id'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1396
  $onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
1397
 
1398
- echo
1399
- '<input' .
1400
- ' type="button"' .
1401
- ' onclick="' . $onc . '"' .
1402
- ' value="' . esc_attr( __( 'Create child', 'wp-photo-album-plus' ) ) . '"' .
1403
- ' />';
1404
  }
1405
 
1406
  // Create sibling
@@ -1416,24 +1393,24 @@ global $wppa_revno;
1416
  '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1417
  $onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
1418
 
1419
- echo
1420
- '<input' .
1421
- ' type="button"' .
1422
- ' onclick="' . $onc . '"' .
1423
- ' value="' . esc_attr( __( 'Create sibling', 'wp-photo-album-plus' ) ) . '"' .
1424
- ' />';
1425
  }
1426
 
1427
  // Edit parent
1428
  if ( $albuminfo['a_parent'] > '0' && wppa_album_exists( $albuminfo['a_parent'] ) && wppa_have_access( $albuminfo['a_parent'] ) ) {
1429
  $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $albuminfo['a_parent'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1430
  $onc = 'document.location=\''.$url.'\';';
1431
- echo
1432
- '<input' .
1433
- ' type="button"' .
1434
- ' onclick="' . $onc . '"' .
1435
- ' value="' . esc_attr( __( 'Edit parent', 'wp-photo-album-plus' ) ) . '"' .
1436
- ' />';
1437
  }
1438
 
1439
  $a = wppa_allow_uploads( $id );
@@ -1455,12 +1432,12 @@ global $wppa_revno;
1455
  __( 'Album is full', 'wp-photo-album-plus' ) :
1456
  __( 'Upload to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' )
1457
  );
1458
- echo
1459
- '<input' .
1460
- ' type="button"' .
1461
- ' onclick="' . $onc . '"' .
1462
- ' value="' . $val .'"' .
1463
- ' />';
1464
  }
1465
 
1466
  // Goto Import
@@ -1468,105 +1445,117 @@ global $wppa_revno;
1468
 
1469
  $onc = 'document.location = \''.wppa_dbg_url(get_admin_url()).'admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\'';
1470
  $val = __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' );
1471
- echo
1472
- '<input' .
1473
- ' type="button"' .
1474
- ' onclick="' . $onc . '"' .
1475
- ' value="' . $val .'"' .
1476
- ' />';
1477
  }
1478
 
1479
  // Download album
1480
  if ( wppa_switch( 'allow_download_album' ) && ( ! wppa_switch( 'download_album_is_restricted' ) || wppa_user_is( 'administrator' ) ) ) {
1481
 
1482
- echo
1483
- '<input' .
1484
- ' type="button"' .
1485
- ' onclick="wppaAjaxDownloadAlbum( 0, ' . $albuminfo['id'] . ' );"' .
1486
- ' value="' . esc_attr( __('Download album', 'wp-photo-album-plus') ).'" ' .
1487
- ' />' .
1488
- '<img' .
1489
- ' id="dwnspin-0-' . $albuminfo['id'] . '"' .
1490
- ' src="' . wppa_get_imgdir() . 'spinner.gif"' .
1491
- ' style="margin-left:6px; display:none; height: 18px; position: relative; bottom: -6px;"' .
1492
- ' alt="spinner"' .
1493
- ' />';
1494
  }
1495
 
1496
  // Set all to pano
1497
  if ( wppa_switch( 'enable_panorama' ) ) {
1498
 
1499
- echo
1500
- '<input' .
1501
- ' type="button"' .
1502
- ' onclick="wppaTrySetAllPanorama(' . $albuminfo['id'] . ')"' .
1503
- ' value="' . esc_attr( __('Set all to panorama', 'wp-photo-album-plus') ).':" ' .
1504
- ' />' .
1505
-
1506
- '<select id="pano-opt" >' .
1507
- '<option value="9" disabled selected >' . __( 'Select a mode', 'wp-photo-album-plus' ) . '</option>' .
1508
- '<option value="0" >' . __( '- none -', 'wp-photo-album-plus' ) . '</option>' .
1509
- '<option value="1" >' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>' .
1510
- '<option value="2" >' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>' .
1511
- '</select>';
1512
 
 
 
 
 
 
 
1513
  }
1514
 
1515
- echo
1516
- '</td>' .
1517
- '</tr>' .
1518
- '</tbody>' .
1519
- '</table>';
 
1520
  }
1521
 
 
 
1522
 
1523
- ?>
1524
- </div>
1525
-
1526
- <?php wppa_album_sequence( $edit_id ) ?>
1527
-
1528
- <a id="manage-photos" ></a>
1529
- <img src="<?php echo WPPA_URL.'/img/camera32.png' ?>" alt="Camera icon" />
1530
- <h1 style="display:inline;" ><?php _e('Manage Photos', 'wp-photo-album-plus');
1531
- if ( wppa_get( 'bulk' ) ) echo ' - <small><i>'.__('Copy / move / delete / edit name / edit description / change status', 'wp-photo-album-plus').'</i></small>';
1532
- elseif ( wppa_get( 'seq' ) ) echo ' - <small><i>'.__('Change sequence order by drag and drop', 'wp-photo-album-plus').'</i></small>';
1533
- elseif ( wppa_get( 'quick' ) ) echo ' - <small><i>'.__('Edit photo information except copy and move', 'wp-photo-album-plus').'</i></small>';
1534
- else echo ' - <small><i>'.__('Edit photo information', 'wp-photo-album-plus').'</i></small>';
1535
- ?></h1><div style="clear:both;" >&nbsp;</div>
1536
- <?php
1537
- if ( wppa_get( 'bulk' ) ) wppa_album_photos_bulk($edit_id);
1538
- elseif ( wppa_get( 'seq' ) ) wppa_album_photos_sequence($edit_id);
1539
- else wppa_album_photos($edit_id);
 
 
 
1540
 
 
 
 
 
 
 
1541
 
1542
- // $back_url = get_admin_url() . 'admin.php?page=wppa_admin_menu';
1543
- echo '
1544
- <br />
1545
- <a href="' . $back_url . '" >' .
1546
- $back_title .
1547
- '</a>';
1548
 
1549
- ?>
1550
  <a href="#manage-photos">
1551
- <div style="position:fixed;right:30px;bottom:30px;background-color:lightblue;" >&nbsp;<?php _e('Top of page', 'wp-photo-album-plus') ?>&nbsp;</div>
1552
  </a>
1553
- </div>
1554
- <?php }
 
1555
 
1556
  // Comment moderate
1557
  elseif ( wppa_get( 'tab' ) == 'cmod' ) {
1558
  $photo = wppa_get( 'photo', '0', 'int' );
1559
  $alb = wppa_get_album_id_by_photo_id( $photo );
1560
- if ( current_user_can('wppa_comments') && wppa_have_access( $alb ) ) { ?>
 
1561
  <div class="wrap">
1562
- <img src="<?php echo WPPA_URL.'/img/page_green.png' ?>" />
1563
- <h1 style="display:inline;" ><?php _e('Moderate comment', 'wp-photo-album-plus') ?></h1>
1564
- <div style="clear:both;" >&nbsp;</div>
1565
- <?php wppa_album_photos('', $photo) ?>
1566
- </div>
1567
- <?php }
 
1568
  else {
1569
- wp_die('You do not have the rights to do this');
1570
  }
1571
  }
1572
 
@@ -1574,17 +1563,21 @@ global $wppa_revno;
1574
  elseif ( wppa_get( 'tab' ) == 'pmod' || wppa_get( 'tab' ) == 'pedit' ) {
1575
  $photo = wppa_get( 'photo', '0', 'int' );
1576
  $alb = wppa_get_album_id_by_photo_id( $photo );
1577
- if ( current_user_can( 'wppa_admin' ) && wppa_have_access( $alb ) ) { ?>
 
1578
  <div class="wrap">
1579
- <img src="<?php echo WPPA_URL.'/img/page_green.png' ?>" />
1580
- <h1 style="display:inline;" ><?php if ( wppa_get( 'tab' ) == 'pmod' ) _e('Moderate photo', 'wp-photo-album-plus');
1581
- else _e('Edit photo', 'wp-photo-album-plus'); ?>
1582
- </h1><div style="clear:both;" >&nbsp;</div>
1583
- <?php wppa_album_photos('', $photo) ?>
1584
- </div>
1585
- <?php }
 
 
 
1586
  else {
1587
- wp_die('You do not have the rights to do this');
1588
  }
1589
  }
1590
 
@@ -1592,42 +1585,57 @@ global $wppa_revno;
1592
  elseif ( wppa_get( 'tab' ) == 'del' ) {
1593
 
1594
  $album_owner = $wpdb->get_var($wpdb->prepare( "SELECT owner FROM $wpdb->wppa_albums WHERE id = %s", wppa_get( 'edit-id' ) ) );
1595
- if ( ( $album_owner == '--- public ---' && ! current_user_can('administrator') ) || ! wppa_have_access( wppa_get( 'edit-id' ) ) ) {
1596
- wp_die('You do not have the rights to delete this album');
1597
  }
1598
- ?>
 
1599
  <div class="wrap">
1600
- <img src="<?php echo WPPA_URL.'/img/albumdel32.png' ?>" />
1601
- <h1 style="display:inline;" ><?php _e('Delete Album', 'wp-photo-album-plus'); ?></h1>
1602
 
1603
- <p><?php _e('Album:', 'wp-photo-album-plus'); ?> <b><?php echo htmlspecialchars( wppa_get_album_name( wppa_get( 'edit-id' ) ) ); ?>.</b></p>
1604
- <p><?php _e('Are you sure you want to delete this album?', 'wp-photo-album-plus'); ?><br />
1605
- <?php _e('Press Delete to continue, and Cancel to go back.', 'wp-photo-album-plus'); ?>
1606
  </p>
1607
- <form name="wppa-del-form" action="<?php echo( esc_url( wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu'))) ?>" method="post">
1608
- <?php wp_nonce_field('$wppa_nonce', WPPA_NONCE) ?>
1609
- <p>
1610
- <?php _e('What would you like to do with photos currently in the album?', 'wp-photo-album-plus'); ?><br />
1611
- <input type="radio" name="wppa-del-photos" value="delete" checked="checked" /> <?php _e('Delete', 'wp-photo-album-plus'); ?><br />
1612
- <input type="radio" name="wppa-del-photos" value="move" /> <?php _e('Move to:', 'wp-photo-album-plus'); ?>
1613
- <select name="wppa-move-album">
1614
- <?php echo wppa_album_select_a( array( 'checkaccess' => true,
1615
- 'path' => true,
1616
- 'selected' => '0',
1617
- 'exclude' => strval( intval( wppa_get( 'edit-id' ) ) ),
1618
- 'addpleaseselect' => true,
1619
- 'sort' => true,
1620
- ) )
1621
- ?>
1622
  </select>
1623
  </p>
1624
 
1625
- <input type="hidden" name="wppa-del-id" value="<?php echo strval( intval( wppa_get( 'edit-id' ) ) ) ?>" />
1626
- <input type="button" class="button-primary" value="<?php _e('Cancel', 'wp-photo-album-plus'); ?>" onclick="parent.history.back()" />
1627
- <input type="submit" class="button-primary" style="color: red" name="wppa-del-confirm" value="<?php _e('Delete', 'wp-photo-album-plus'); ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1628
  </form>
1629
- </div>
1630
- <?php
1631
  }
1632
  else {
1633
  wppa_error_message( sprintf( __( 'Album admin action %s is not implemented', 'wp-photo-album-plus' ),
@@ -1653,7 +1661,7 @@ global $wppa_revno;
1653
  wppa_del_album( wppa_get( 'del-id' ), $move );
1654
  }
1655
  else {
1656
- wppa_error_message(__('Unable to move photos. Album not deleted.', 'wp-photo-album-plus'));
1657
  }
1658
  } else {
1659
  wppa_del_album( wppa_get( 'del-id' ) );
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.1.02.001
7
  *
8
  */
9
 
277
  $pano = wppa_get( 'pano-val', '9' );
278
  if ( in_array( $pano, array( '0', '1', '2' ) ) ) {
279
 
 
280
  $done = '0';
281
  $todo = $wpdb->get_results( $wpdb->prepare( "SELECT id, photox, photoy, panorama, angle FROM $wpdb->wppa_photos
282
  WHERE album = %d
340
  wppa_remake_files( '', $id );
341
  wppa_get_photox( $id, true );
342
  wppa_get_photoy( $id, true );
 
343
  $done++;
344
 
345
  if ( ! in_array( $pano, array( '0', '1', '2' ) ) ) {
347
  }
348
  elseif ( $done == $tot ) {
349
  $remark = __( 'All applicable items processed', 'wp-photo-album-plus' );
 
350
  }
351
  else {
352
  $remark = sprintf( __( '%1d items out of %2d processed', 'wp-photo-album-plus' ), $done, $tot );
496
  />' );
497
 
498
  // The edit albuminfo panel
499
+ $result = '
500
  <div
501
  id="albumitem-' . $id . '"
502
  class="wppa-table-wrap"
504
  >';
505
  {
506
  // Section 1
507
+ $result .= '
508
  <!-- Album Section 1 -->
509
  <table class="wppa-table wppa-album-table" >
510
  <tbody>
512
  <td>';
513
 
514
  // More or less static data
515
+ $result .=
 
516
  __( 'Album number:', 'wp-photo-album-plus' ) . ' ' .
517
+ $id . '. ' .
518
 
 
 
519
  __( 'Crypt:', 'wp-photo-album-plus' ) . ' ' .
520
+ $crypt . '. ' .
521
 
 
 
522
  __( 'Created:', 'wp-photo-album-plus' ) . ' ' .
523
+ wppa_local_date( '', $timestamp ) . ' ' . __( 'local time' , 'wp-photo-album-plus') . '. ' .
524
 
 
 
525
  __( 'Modified:', 'wp-photo-album-plus' ) . ' ';
526
  if ( $modified > $timestamp ) {
527
+ $result .= wppa_local_date( '', $modified ) . ' ' . __( 'local time' , 'wp-photo-album-plus' ) . '. ';
528
  }
529
  else {
530
+ $result .= __( 'Not modified', 'wp-photo-album-plus' ) . '. ';
531
  }
532
 
533
  // Views
534
  if ( wppa_switch( 'track_viewcounts' ) ) {
535
+ $result .=
536
+ __( 'Album Views:', 'wp-photo-album-plus' ) . ' ' . $views . ', ' .
 
537
  __( 'Photo views:', 'wp-photo-album-plus' ) . ' ' . $pviews . '. ';
538
  if ( $nsub ) {
539
+ $result .=
540
  __( 'Photo views inc sub albums:', 'wp-photo-album-plus' ) . ' ' . $tpviews . '. ';
541
  }
542
  }
544
  // Clicks
545
  if ( wppa_switch( 'track_clickcounts' ) ) {
546
  $click_arr = $wpdb->get_col( "SELECT clicks FROM $wpdb->wppa_photos WHERE album = $id" );
547
+ $result .=
548
  __( 'Clicks:', 'wp-photo-album-plus' ) . ' ' . array_sum( $click_arr ) . '. ';
549
  }
550
 
551
+ $result .= '<br />';
 
552
 
553
  // Owner
554
+ $result .=
555
  __( 'Owned by:', 'wp-photo-album-plus' ) . ' ';
556
  if ( ! wppa_user_is( 'administrator' ) ) {
557
  if ( $owner == '--- public ---' ) {
558
+ $result .= __( '--- public ---', 'wp-photo-album-plus' ) . ' ';
559
  }
560
  else {
561
+ $result .= $owner . '. ';
562
  }
563
  }
564
  else {
565
  if ( wppa_get_user_count() > wppa_opt( 'max_users' ) ) {
566
+ $result .= '
567
  <input
568
  type="text"
569
  value="' . esc_attr( $owner ) . '"
582
  else {
583
  $title = '';
584
  }
585
+ $result .= '
586
  <select
587
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
588
  title="' . esc_attr( $title ) . '"
593
  }
594
 
595
  // Order # -->
596
+ $result .=
597
  __( 'Album sequence number', 'wp-photo-album-plus' ) . ':&nbsp;
598
  <input
599
  type="text"
602
  style="width:50px;"
603
  />&nbsp;';
604
  if ( wppa_opt( 'list_albums_by' ) != '1' && $a_order != '0' ) {
605
+ $result .=
606
  '<small class="description" style="color:red" >' .
607
  __( 'Album sequence number has only effect if you set the album sort order method to <b>Order #</b> in the Photo Albums -> Settings screen.<br />', 'wp-photo-album-plus' ) .
608
  '</small>' . ' ';
611
  // Status
612
  $title = __( 'Set the frontend visibility of the album cover and items not including sub-albums.', 'wp-photo-album-plus' ) . ' ' .
613
  __( 'Publish: visible for all, Private: visible for logged in only, Hidden: visible for admin only', 'wp-photo-album-plus' );
614
+ $result .=
615
  __( 'Status', 'wp-photo-album-plus' ) . ':&nbsp;
616
  <select
617
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'status\', this )"
628
  </select>&nbsp;';
629
 
630
  // Parent
631
+ $result .=
632
  __( 'Parent album', 'wp-photo-album-plus' ) . ':&nbsp;';
633
  if ( wppa_extended_access() ) {
634
+ $result .=
635
  wppa_album_select_a( array( 'checkaccess' => true,
636
  'exclude' => $id,
637
  'selected' => $a_parent,
654
  '</select>';
655
  }
656
  else {
657
+ $result .= '
658
  <select
659
  id="wppa-parsel"
660
  style="max-width:300px;"
672
  ) .
673
  '</select>';
674
  }
675
+ $result .= '&nbsp;';
676
 
677
  // P-order-by
678
  if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
679
+ $result .=
680
  __( 'Photo order:', 'wp-photo-album-plus' ) . ' ';
681
  $options = array( __( '--- default ---', 'wp-photo-album-plus' ),
682
  __( 'Order #', 'wp-photo-album-plus' ),
719
  }
720
  $title = sprintf( __( 'The default is set in Basic settings -> Misc -> I -> Item 2 and is currently %s', 'wp-photo-album-plus' ), $dflt );
721
 
722
+ $result .= '
723
  <select
724
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'p_order_by\', this )"
725
  title="' . esc_attr( $title ) . '"
726
  >';
727
  foreach ( array_keys( $options ) as $key ) {
728
  $sel = $values[$key] == $p_order_by ? ' selected="selected"' : '';
729
+ $result .= '<option value="' . $values[$key] . '"' . $sel . ' >' . $options[$key] . '</option>';
730
  }
731
+ $result .= '
732
  </select>&nbsp;';
733
  }
734
 
755
  }
756
 
757
  $title = sprintf( __( 'The default is set in Basic settings -> Misc -> I -> Item 1, currently %s', 'wp-photo-album-plus' ), $dflt );
758
+ $result .=
759
  __( 'Sub album sort order', 'wp-photo-album-plus' ) . ':&nbsp;
760
  <select
761
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'suba_order_by\', this )"
762
  title="' . esc_attr( $title ) . '"
763
  >';
764
  for ( $i = 0; $i < 7; $i++ ) {
765
+ $result .= '<option value="' . esc_attr( $vals[$i] ) . '" ' . ( $suba_order_by == $vals[$i] ? $sel : '' ) . ' >' . $opts[$i] . '</option>';
766
  }
767
+ $result .= '
768
  </select>&nbsp;';
769
 
770
  // Alternative thumbnail size
771
  if ( ! wppa_switch( 'alt_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
772
  $title = sprintf( __( 'Alternate thumbnail size is set in Basic settings -> Thumbnails -> I -> Item 2 and is currently set to %s', 'wp-photo-album-plus' ), wppa_opt( 'thumbsize_alt' ) );
773
  $sel = ' selected="selected"';
774
+ $result .= __( 'Use alt thumbsize', 'wp-photo-album-plus' ) . ':&nbsp;
775
  <select
776
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'alt_thumbsize\', this )"
777
  title="' . esc_attr( $title ) . '"
789
  if ( ! wppa_switch( 'covertype_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
790
  $sel = ' selected="selected"';
791
  $title = sprintf( __( 'The default is set in Basic settings -> Albums -> III -> Item 4 and is set to %s', 'wp-photo-album-plus' ), wppa_opt( 'cover_type' ) );
792
+ $result .=
793
  __( 'Cover&nbsp;Type', 'wp-photo-album-plus' ) . ':&nbsp;
794
  <select
795
  onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_type\', this )"
820
  }
821
 
822
  // Cover photo
823
+ $result .=
824
  __( 'Cover&nbsp;Photo:', 'wp-photo-album-plus' ) . '&nbsp;' .
825
  wppa_main_photo( $main_photo, $cover_type ) . '&nbsp;';
826
 
827
  // Upload limit
828
+ $result .=
829
  __( 'Upload limit:', 'wp-photo-album-plus' ) . '&nbsp;';
830
  $lims = explode( '/', $upload_limit );
831
  if ( ! is_array( $lims ) ) {
834
  if ( wppa_user_is( 'administrator' ) ) {
835
  $sel = ' selected="selected"';
836
  $title = __( 'Set the upload limit (0 means unlimited).', 'wp-photo-album-plus' );
837
+ $result .= '
838
  <input
839
  type="text"
840
  id="upload_limit_count"
854
  }
855
  else {
856
  if ( $lims[0] == '0' ) {
857
+ $result .= __( 'Unlimited', 'wp-photo-album-plus' );
858
  }
859
  else {
860
+ $result .= $lims[0] . '&nbsp;';
861
  switch ( $lims[1] ) {
862
+ case '3600': $result .= __( 'per hour', 'wp-photo-album-plus' ); break;
863
+ case '86400': $result .= __( 'per day', 'wp-photo-album-plus' ); break;
864
+ case '604800': $result .= __( 'per week', 'wp-photo-album-plus' ); break;
865
+ case '2592000': $result .= __( 'per month', 'wp-photo-album-plus' ); break;
866
+ case '31536000': $result .= __( 'per year', 'wp-photo-album-plus' ); break;
867
+ default: $result .= sprintf( 'per %d seconds', $lims[1] );
868
  }
869
  }
870
+ $result .= '. ';
871
  }
872
 
873
  // Tree limit
874
  $title = __( 'The upload limit for this album and all its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
875
  __( 'This setting overrules all other limits that may apply to this album or its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
876
  __( '0 means no limit.', 'wp-photo-album-plus' );
877
+ $result .= __( 'Tree upload limit', 'wp-photo-album-plus' ) . ':
878
  <input
879
  type="number"
880
  min="0"
882
  value="' . $tree_limit . '"
883
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_tree\', this )"
884
  style="cursor:pointer;"
885
+ />' .
886
 
887
+ '<br />';
888
 
889
  // Need this the next 5 items
890
  $yes = __( 'yes', 'wp-photo-album-plus' );
895
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
896
  __( 'The default is set in Basic settings -> Photos -> I -> Item 4 and is currently set to', 'wp-photo-album-plus' ) . ' ' .
897
  ( wppa_switch( 'zoom_on' ) ? $yes : $no ) . '.';
898
+ $result .=
899
  __( 'Photos are zoomable:', 'wp-photo-album-plus' ) . '
900
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'zoomable\', this )" title="' . esc_attr( $title ) . '" >
901
  <option value="" '.($zoomable==''?'selected="selected"': '').' >' . $def . '</option>
917
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
918
  sprintf( __( 'The defaults are set in Basic settings -> Slideshow -> I -> Item 17 (%s), Basic settings -> Thumbnails -> II -> Item 1 (%s) and Basic settings -> Lightbox -> I -> Item 3 (%s).', 'wp-photo-album-plus' ),
919
  ( wppa_switch( 'show_full_name' ) ? $yes : $no ), ( wppa_switch( 'thumb_text_name' ) ? $yes : $no ), ( wppa_switch( 'ovl_name' ) ? $yes : $no ) );
920
+ $result .=
921
  __( 'Display photo names:', 'wp-photo-album-plus' ) . '
922
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt0\', this )" title="' . esc_attr( $title ) . '" >
923
  <option value="0" '.($disp_opt[0]=='0'?'selected="selected"': '').' >' . $def . '</option>
929
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
930
  sprintf( __( 'The defaults are set in Basic settings -> Slideshow -> I -> Item 20 (%s), Basic settings -> Thumbnails -> II -> Item 3 (%s) and Basic settings -> Lightbox -> I -> Item 4 (%s).', 'wp-photo-album-plus' ),
931
  ( wppa_switch( 'show_full_desc' ) ? $yes : $no ), ( wppa_switch( 'thumb_text_desc' ) ? $yes : $no ), ( wppa_switch( 'ovl_desc' ) ? $yes : $no ) );
932
+ $result .=
933
  __( 'Display photo descriptions:', 'wp-photo-album-plus' ) . '
934
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt1\', this )" title="' . esc_attr( $title ) . '" >
935
  <option value="0" '.($disp_opt[1]=='0'?'selected="selected"': '').' >' . $def . '</option>
941
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
942
  sprintf( __( 'The defaults are set in Basic settings -> General -> I -> Item 5 (%s), Basic settings -> Thumbnails -> II -> Item 3 (%s) and Basic settings -> Lightbox -> I -> Item 5 (%s).', 'wp-photo-album-plus' ),
943
  ( wppa_switch( 'rating_on' ) ? $yes : $no ), ( wppa_switch( 'thumb_text_rating' ) ? $yes : $no ), ( wppa_switch( 'ovl_rating' ) ? $yes : $no ) );
944
+ $result .=
945
  __( 'Display rating:', 'wp-photo-album-plus' ) . '
946
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt2\', this )" title="' . esc_attr( $title ) . '" >
947
  <option value="0" '.($disp_opt[2]=='0'?'selected="selected"': '').' >' . $def . '</option>
953
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
954
  sprintf( __( 'The defaults are set in Basic settings -> General -> I -> Item 4 (%s) and Basic settings -> Thumbnails -> II -> Item 4, count only (%s).', 'wp-photo-album-plus' ),
955
  ( wppa_switch( 'show_comments' ) ? $yes : $no ), ( wppa_switch( 'thumb_text_comcount' ) ? $yes : $no ) );
956
+ $result .=
957
  __( 'Display comments:', 'wp-photo-album-plus' ) . '
958
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt3\', this )" title="' . esc_attr( $title ) . '" >
959
  <option value="0" '.($disp_opt[3]=='0'?'selected="selected"': '').' >' . $def . '</option>
965
  if ( wppa_switch( 'watermark_on' ) ) {
966
 
967
  // Newline
968
+ $result .= '<br />' .
969
 
 
970
  __( 'Watermark file:', 'wp-photo-album-plus' ) . '
971
  <select onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmfile\', this )" >' .
972
  wppa_watermark_file_select( 'album', $id ) . '
981
  if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
982
  $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
983
 
984
+ $result .=
985
  __( 'Delete at', 'wp-photo-album-plus' ) .
986
+ ' ' . '
987
+ <input
988
+ type="checkbox"
989
+ id="scheduledel"' .
990
  ( $scheduledel ? ' checked="checked"' : '' ) .
991
+ ( $may_change ? '' : ' disabled="disabled"' ) . '
992
+ onchange="wppaChangeScheduleDelAlbum( ' . $id . ', this );"
993
+ />
994
+
995
+ <input type="hidden" value="" id="wppa-dummy-del" />
996
+ <span
997
  class="wppa-datetimedel-' . $id . '"' .
998
+ ( $albuminfo['scheduledel'] ? '' : ' style="display:none;"' ) . '
999
+ >' .
1000
+ wppa_get_date_time_select_html( 'delalbum', $id, $may_change ) . '
1001
+ </span>
1002
+ ';
1003
  }
1004
 
1005
  // Status
1006
+ $result .= '<br />' .
1007
  __( 'Remark', 'wp-photo-album-plus' ) . ':&nbsp;
1008
  <span
1009
  id="albumstatus-' . $id . '"
1013
  </span>';
1014
 
1015
 
1016
+ $result .= '
1017
  </td>
1018
  </tr>
1019
  </tbody>
1020
  </table>';
1021
+ wppa_echo( $result );
1022
  }
1023
  {
1024
  // Section 2
1025
+ $result = '
1026
  <!-- Album Section 2 -->
1027
  <table class="wppa-table wppa-album-table" >
1028
+ <tbody>
1029
 
 
 
1030
  <tr>
1031
  <td>' .
1032
  __( 'Name:', 'wp-photo-album-plus' ) . '
1047
  </td>
1048
  <td>
1049
  </td>
1050
+ </tr>
1051
 
 
 
1052
  <tr>
1053
  <td>' .
1054
  __( 'Description:', 'wp-photo-album-plus' ) . '
1055
+ </td>
 
 
1056
  <td>
1057
  <textarea
1058
  style="width:100%;height:60px;"
1059
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', this )"
1060
  >' .
1061
+ esc_textarea( stripslashes( $description ) ) . '
1062
+ </textarea>
1063
+ </td>
 
 
1064
  <td>
1065
  </td>
1066
+ </tr>
1067
 
 
 
1068
  <tr>
1069
  <td>' .
1070
  __( 'Categories:', 'wp-photo-album-plus' ) . '
1086
  >';
1087
  $catlist = wppa_get_catlist();
1088
  if ( is_array( $catlist ) ) {
1089
+ $result .= '
1090
  <option value="" >' . __( '- select to add -', 'wp-photo-album-plus' ) . '</option>';
1091
  foreach ( $catlist as $cat ) {
1092
+ $result .= '
1093
  <option value="' . esc_attr( $cat['cat'] ) . '" >' . htmlspecialchars( $cat['cat'] ) . '</option>';
1094
  }
1095
  }
1096
  else {
1097
+ $result .= '
1098
  <option value="0" >' . __( 'No categories yet', 'wp-photo-album-plus') . '</option>';
1099
  }
1100
+ $result .= '
1101
  </select>
1102
  </td>
1103
  <td>
1104
  </td>
1105
+ </tr>
1106
 
 
 
1107
  <tr>
1108
  <td>
1109
  ' . __( 'Default photo tags:', 'wp-photo-album-plus' ) . '
1136
  }
1137
  foreach( array_keys( $custom_data ) as $key ) {
1138
  if ( wppa_opt( 'album_custom_caption_' . $key ) ) {
1139
+ $result .= '
1140
  <tr>
1141
  <td>
1142
  ' . apply_filters( 'translate_text', wppa_opt( 'album_custom_caption_' . $key ) ) . '
1164
  }
1165
 
1166
  // Link type
1167
+ $result .= '
1168
  <tr>
1169
  <td>
1170
  ' . __( 'Link type:', 'wp-photo-album-plus' ) . '
1172
  <td>';
1173
  $sel = ' selected="selected"';
1174
  $lt = $cover_linktype;
1175
+ $result .= '
1176
  <select onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_linktype\', this )" >
1177
  <option value="content"' . ( $lt == 'content' ? $sel : '' ) . ' >' . __( 'the sub-albums and thumbnails', 'wp-photo-album-plus' ) . '</option>
1178
  <option value="albums"' . ( $lt == 'albums' ? $sel : '' ) . ' >' . __( 'the sub-albums', 'wp-photo-album-plus' ) . '</option>
1184
  <br />
1185
  <span class="description">';
1186
  if ( wppa_switch( 'auto_page' ) ) {
1187
+ $result .= __( 'If you select "the link page with a clean url", select an Auto Page of one of the photos in this album.', 'wp-photo-album-plus' );
1188
  }
1189
  else {
1190
+ $result .= __( 'If you select "the link page with a clean url", make sure you enter the correct shortcode on the target page.', 'wp-photo-album-plus' );
1191
  }
1192
+ $result .= '
1193
  </span>
1194
  </td>
1195
  <td>
1198
 
1199
  // Link page
1200
  if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1201
+ $result .= '
1202
  <tr>
1203
  <td>
1204
  ' . __( 'Link to:', 'wp-photo-album-plus' ) . '
1218
  $linkpage = '0';
1219
  }
1220
 
1221
+ $result .= '
1222
  <select
1223
  onchange="wppaAjaxUpdateAlbum( '. $id . ' , \'cover_linkpage\', this )"
1224
  style="max-width:100%;"
1227
  __( '--- the same page or post ---', 'wp-photo-album-plus' ) .
1228
  '</option>';
1229
  foreach ( $pages as $page ) {
1230
+ $result .= '
1231
  <option
1232
  value="' . $page['ID'] . '"' .
1233
  ( $linkpage == $page['ID'] ? ' selected="selected"' : '' ) .
1236
  ( $page['post_type'] == 'post' ? ' (' . htmlspecialchars( $page['post_date'] ) . ')' : '' ) .
1237
  '</option>';
1238
  }
1239
+ $result .= '
1240
  </select>
1241
  <br />
1242
  <span class="description" >' .
1243
  __( 'If you want, you can link the title to a WP page or post instead of the album\'s content. If so, select the page the title links to.', 'wp-photo-album-plus' ) .
1244
  '</span>';
1245
  }
1246
+ $result .= '
1247
  </td>
1248
  <td>
1249
  </td>
1251
  }
1252
 
1253
  // Schedule
1254
+ $result .= '
1255
  <tr>
1256
  <td>' .
1257
  __( 'Schedule:', 'wp-photo-album-plus' ) . ' ' .
1279
  </td>
1280
  </tr>';
1281
 
1282
+ $result .= '
1283
  </tbody>
1284
  </table>';
1285
+ wppa_echo( $result );
1286
+ }
1287
  {
1288
  // Section 3, Actions
1289
+ $result = '
1290
+ <!-- Album Section 3 -->
1291
+ <table
1292
+ class="wppa-table wppa-album-table"
1293
+ >
1294
+ <tbody>
1295
+ <tr>
1296
+ <td>';
1297
 
1298
  // Inherit cats
1299
+ $result .= '
1300
+ <input
1301
+ type="button"
1302
+ title="' . esc_attr( __( 'Apply categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1303
+ onclick="wppaTryInheritCats( ' . $id . ' )"
1304
+ value="' . esc_attr( __( 'Apply Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1305
+ />
1306
+ <input
1307
+ type="button"
1308
+ title="' . esc_attr( __( 'Add categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1309
+ onclick="wppaTryAddCats( ' . $id . ' )"
1310
+ value="' . esc_attr( __( 'Add Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1311
+ />';
1312
 
1313
  // Apply default tags
1314
+ $result .= '
1315
+ <input
1316
+ type="button"
1317
+ title="' . esc_attr( __( 'Tag all photos in this album with the default tags.', 'wp-photo-album-plus' ) ) . '"
1318
+ onclick="wppaTryApplyDeftags( ' . $id . ' )"
1319
+ value="' . esc_attr( __( 'Apply default tags', 'wp-photo-album-plus' ) ) . '"
1320
+ />
1321
+ <input
1322
+ type="button"
1323
+ title="' . esc_attr( __( 'Add the default tags to all photos in this album.', 'wp-photo-album-plus' ) ) . '"
1324
+ onclick="wppaTryAddDeftags( ' . $id . ' )"
1325
+ value="' . esc_attr( __( 'Add default tags', 'wp-photo-album-plus' ) ) . '"
1326
+ />';
1327
 
1328
  // Schedule all
1329
+ $result .= '
1330
+ <input
1331
+ type="button"
1332
+ title="' . esc_attr( __( 'Schedule all photos in this album for later publishing.', 'wp-photo-album-plus' ) ) . '"
1333
+ onclick="wppaTryScheduleAll( ' . $id . ' )"
1334
+ value="' . esc_attr( __( 'Schedule all', 'wp-photo-album-plus' ) ) . '"
1335
+ />';
1336
 
1337
  // Reset Ratings
1338
  if ( wppa_switch( 'rating_on') ) {
1339
  $onc = 'if (confirm(\''.__( 'Are you sure you want to clear the ratings in this album?', 'wp-photo-album-plus' ).'\')) { wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'clear_ratings\', 0 ); }';
1340
+ $result .= '
1341
+ <input
1342
+ type="button"
1343
+ onclick="' . $onc . '"
1344
+ value="' . esc_attr( __( 'Reset ratings', 'wp-photo-album-plus' ) ) . '"
1345
+ />';
1346
  }
1347
 
1348
  // Apply New photo desc
1349
  if ( wppa_switch( 'apply_newphoto_desc') ) {
1350
  $onc = 'if ( confirm(\'Are you sure you want to set the description of all photos to \n\n'.esc_js(wppa_opt( 'newphoto_description')).'\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&applynewdesc=1\'';
1351
+ $result .= '
1352
+ <input
1353
+ type="button"
1354
+ onclick="' . $onc . '"
1355
+ value="' . esc_attr( __( 'Apply new photo desc', 'wp-photo-album-plus' ) ) . '"
1356
+ />';
1357
  }
1358
 
1359
  // Remake all
1360
  if ( wppa_user_is( 'administrator' ) ) {
1361
  $onc = 'if ( confirm(\'Are you sure you want to remake the files for all photos in this album?\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&remakealbum=1\'';
1362
+ $result .= '
1363
+ <input
1364
+ type="button"
1365
+ onclick="' . $onc . '"
1366
+ value="' . esc_attr( __( 'Remake all', 'wp-photo-album-plus' ) ) . '"
1367
+ />';
1368
  }
1369
 
1370
  // Create subalbum
1372
  $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $albuminfo['id'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1373
  $onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
1374
 
1375
+ $result .= '
1376
+ <input
1377
+ type="button"
1378
+ onclick="' . $onc . '"
1379
+ value="' . esc_attr( __( 'Create child', 'wp-photo-album-plus' ) ) . '"
1380
+ />';
1381
  }
1382
 
1383
  // Create sibling
1393
  '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1394
  $onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
1395
 
1396
+ $result .= '
1397
+ <input
1398
+ type="button"
1399
+ onclick="' . $onc . '"
1400
+ value="' . esc_attr( __( 'Create sibling', 'wp-photo-album-plus' ) ) . '"
1401
+ />';
1402
  }
1403
 
1404
  // Edit parent
1405
  if ( $albuminfo['a_parent'] > '0' && wppa_album_exists( $albuminfo['a_parent'] ) && wppa_have_access( $albuminfo['a_parent'] ) ) {
1406
  $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $albuminfo['a_parent'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1407
  $onc = 'document.location=\''.$url.'\';';
1408
+ $result .= '
1409
+ <input
1410
+ type="button"
1411
+ onclick="' . $onc . '"
1412
+ value="' . esc_attr( __( 'Edit parent', 'wp-photo-album-plus' ) ) . '"
1413
+ />';
1414
  }
1415
 
1416
  $a = wppa_allow_uploads( $id );
1432
  __( 'Album is full', 'wp-photo-album-plus' ) :
1433
  __( 'Upload to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' )
1434
  );
1435
+ $result .= '
1436
+ <input
1437
+ type="button"
1438
+ onclick="' . $onc . '"
1439
+ value="' . $val .'"
1440
+ />';
1441
  }
1442
 
1443
  // Goto Import
1445
 
1446
  $onc = 'document.location = \''.wppa_dbg_url(get_admin_url()).'admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\'';
1447
  $val = __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' );
1448
+ $result .= '
1449
+ <input
1450
+ type="button"
1451
+ onclick="' . $onc . '"
1452
+ value="' . $val .'"
1453
+ />';
1454
  }
1455
 
1456
  // Download album
1457
  if ( wppa_switch( 'allow_download_album' ) && ( ! wppa_switch( 'download_album_is_restricted' ) || wppa_user_is( 'administrator' ) ) ) {
1458
 
1459
+ $result .= '
1460
+ <input
1461
+ type="button"
1462
+ onclick="wppaAjaxDownloadAlbum( 0, ' . $albuminfo['id'] . ' );"
1463
+ value="' . esc_attr( __('Download album', 'wp-photo-album-plus') ).'"
1464
+ />
1465
+ <img
1466
+ id="dwnspin-0-' . $albuminfo['id'] . '"
1467
+ src="' . wppa_get_imgdir() . 'spinner.gif"
1468
+ style="margin-left:6px; display:none; height: 18px; position: relative; bottom: -6px;"
1469
+ alt="spinner"
1470
+ />';
1471
  }
1472
 
1473
  // Set all to pano
1474
  if ( wppa_switch( 'enable_panorama' ) ) {
1475
 
1476
+ $result .= '
1477
+ <input
1478
+ type="button"
1479
+ onclick="wppaTrySetAllPanorama(' . $albuminfo['id'] . ')"
1480
+ value="' . esc_attr( __('Set all to panorama', 'wp-photo-album-plus') ).':"
1481
+ />
 
 
 
 
 
 
 
1482
 
1483
+ <select id="pano-opt" >
1484
+ <option value="9" disabled selected >' . __( 'Select a mode', 'wp-photo-album-plus' ) . '</option>
1485
+ <option value="0" >' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1486
+ <option value="1" >' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1487
+ <option value="2" >' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1488
+ </select>';
1489
  }
1490
 
1491
+ $result .= '
1492
+ </td>
1493
+ </tr>
1494
+ </tbody>
1495
+ </table>';
1496
+ wppa_echo( $result );
1497
  }
1498
 
1499
+ // End edit album info panel
1500
+ wppa_echo( '</div>' );
1501
 
1502
+ // Subalbums sequence
1503
+ wppa_album_sequence( $edit_id );
1504
+
1505
+
1506
+ // Manage photos section
1507
+ $result = '
1508
+ <a id="manage-photos" ></a>
1509
+ <img src="' . WPPA_URL . '/img/camera32.png" alt="Camera icon" />
1510
+ <h1 style="display:inline;" >' . __( 'Manage Photos', 'wp-photo-album-plus' );
1511
+ if ( wppa_get( 'bulk' ) )
1512
+ $result .= ' - <small><i>' . __( 'Copy / move / delete / edit name / edit description / change status', 'wp-photo-album-plus' ) . '</i></small>';
1513
+ elseif ( wppa_get( 'seq' ) )
1514
+ $result .= ' - <small><i>' . __( 'Change sequence order by drag and drop', 'wp-photo-album-plus' ) . '</i></small>';
1515
+ elseif ( wppa_get( 'quick' ) )
1516
+ $result .= ' - <small><i>' . __( 'Edit photo information except copy and move', 'wp-photo-album-plus' ) . '</i></small>';
1517
+ else
1518
+ $result .= ' - <small><i>' . __( 'Edit photo information', 'wp-photo-album-plus' ) . '</i></small>';
1519
+ $result .= '
1520
+ </h1>
1521
+ <div style="clear:both;" ></div>';
1522
 
1523
+ if ( wppa_get( 'bulk' ) )
1524
+ wppa_album_photos_bulk( $edit_id );
1525
+ elseif ( wppa_get( 'seq' ) )
1526
+ wppa_album_photos_sequence( $edit_id );
1527
+ else
1528
+ wppa_album_photos( $edit_id );
1529
 
1530
+ $result .= '
1531
+ <br />
1532
+ <a href="' . $back_url . '" >' .
1533
+ $back_title .
1534
+ '</a>
 
1535
 
 
1536
  <a href="#manage-photos">
1537
+ <div style="position:fixed;right:30px;bottom:30px;background-color:lightblue;" >&nbsp;' . __( 'Top of page', 'wp-photo-album-plus' ) . '&nbsp;</div>
1538
  </a>
1539
+ </div>';
1540
+ wppa_echo( $result );
1541
+ }
1542
 
1543
  // Comment moderate
1544
  elseif ( wppa_get( 'tab' ) == 'cmod' ) {
1545
  $photo = wppa_get( 'photo', '0', 'int' );
1546
  $alb = wppa_get_album_id_by_photo_id( $photo );
1547
+ if ( current_user_can( 'wppa_comments' ) && wppa_have_access( $alb ) ) {
1548
+ $result = '
1549
  <div class="wrap">
1550
+ <img src="' . WPPA_URL . '/img/page_green.png" />
1551
+ <h1 style="display:inline;" >' . __( 'Moderate comment', 'wp-photo-album-plus' ) . '</h1>
1552
+ <div style="clear:both;" ></div>' .
1553
+ wppa_album_photos( '', $photo ) . '
1554
+ </div>';
1555
+ wppa_echo( $result );
1556
+ }
1557
  else {
1558
+ wp_die( 'You do not have the rights to do this' );
1559
  }
1560
  }
1561
 
1563
  elseif ( wppa_get( 'tab' ) == 'pmod' || wppa_get( 'tab' ) == 'pedit' ) {
1564
  $photo = wppa_get( 'photo', '0', 'int' );
1565
  $alb = wppa_get_album_id_by_photo_id( $photo );
1566
+ if ( current_user_can( 'wppa_admin' ) && wppa_have_access( $alb ) ) {
1567
+ $result = '
1568
  <div class="wrap">
1569
+ <img src="' . WPPA_URL . '/img/page_green.png" />
1570
+ <h1 style="display:inline;" >' . ( wppa_get( 'tab' ) == 'pmod' ?
1571
+ __( 'Moderate photo', 'wp-photo-album-plus' ) :
1572
+ __( 'Edit photo', 'wp-photo-album-plus' ) ) . '
1573
+ </h1>
1574
+ <div style="clear:both;" ></div>';
1575
+ wppa_album_photos( '', $photo ) . '
1576
+ </div>';
1577
+ wppa_echo( $result );
1578
+ }
1579
  else {
1580
+ wp_die( 'You do not have the rights to do this' );
1581
  }
1582
  }
1583
 
1585
  elseif ( wppa_get( 'tab' ) == 'del' ) {
1586
 
1587
  $album_owner = $wpdb->get_var($wpdb->prepare( "SELECT owner FROM $wpdb->wppa_albums WHERE id = %s", wppa_get( 'edit-id' ) ) );
1588
+ if ( ( $album_owner == '--- public ---' && ! current_user_can( 'administrator' ) ) || ! wppa_have_access( wppa_get( 'edit-id' ) ) ) {
1589
+ wp_die( 'You do not have the rights to delete this album' );
1590
  }
1591
+
1592
+ $result = '
1593
  <div class="wrap">
1594
+ <img src="' . WPPA_URL . '/img/albumdel32.png" />
1595
+ <h1 style="display:inline;" >' . __( 'Delete Album', 'wp-photo-album-plus' ) . '</h1>
1596
 
1597
+ <p>' . __( 'Album:', 'wp-photo-album-plus' ) . '<b>' . htmlspecialchars( wppa_get_album_name( wppa_get( 'edit-id' ) ) ) . '</b></p>
1598
+ <p>' . __( 'Are you sure you want to delete this album?', 'wp-photo-album-plus' ) . '<br />' .
1599
+ __( 'Press Delete to continue, and Cancel to go back.', 'wp-photo-album-plus' ) . '
1600
  </p>
1601
+ <form name="wppa-del-form" action="' . esc_url( wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu' ) ) . '" method="post">' .
1602
+ wp_nonce_field( '$wppa_nonce', WPPA_NONCE ) . '
1603
+ <p>' .
1604
+ __( 'What would you like to do with photos currently in the album?', 'wp-photo-album-plus' ) . '<br />
1605
+ <input type="radio" name="wppa-del-photos" value="delete" checked="checked" />' . __( 'Delete', 'wp-photo-album-plus' ) . '<br />
1606
+ <input type="radio" name="wppa-del-photos" value="move" />' . __( 'Move to:', 'wp-photo-album-plus' ) . '
1607
+ <select name="wppa-move-album">' .
1608
+ wppa_album_select_a( array( 'checkaccess' => true,
1609
+ 'path' => true,
1610
+ 'selected' => '0',
1611
+ 'exclude' => strval( intval( wppa_get( 'edit-id' ) ) ),
1612
+ 'addpleaseselect' => true,
1613
+ 'sort' => true,
1614
+ ) ) . '
 
1615
  </select>
1616
  </p>
1617
 
1618
+ <input
1619
+ type="hidden"
1620
+ name="wppa-del-id"
1621
+ value="' . wppa_get( 'edit-id' ) . '"
1622
+ />
1623
+ <input
1624
+ type="button"
1625
+ class="button-primary"
1626
+ value="' . __( 'Cancel', 'wp-photo-album-plus' ) . '"
1627
+ onclick="parent.history.back()"
1628
+ />
1629
+ <input
1630
+ type="submit"
1631
+ class="button-primary"
1632
+ style="color: red"
1633
+ name="wppa-del-confirm"
1634
+ value="' . __( 'Delete', 'wp-photo-album-plus' ) . '"
1635
+ />
1636
  </form>
1637
+ </div>';
1638
+ wooa_echo( $result );
1639
  }
1640
  else {
1641
  wppa_error_message( sprintf( __( 'Album admin action %s is not implemented', 'wp-photo-album-plus' ),
1661
  wppa_del_album( wppa_get( 'del-id' ), $move );
1662
  }
1663
  else {
1664
+ wppa_error_message( __( 'Unable to move photos. Album not deleted.', 'wp-photo-album-plus' ) );
1665
  }
1666
  } else {
1667
  wppa_del_album( wppa_get( 'del-id' ) );
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 8.1.01.005
7
  *
8
  */
9
 
@@ -2197,7 +2197,7 @@ global $wppa_locale;
2197
 
2198
  // Need init?
2199
  if ( $need_fb_init ) {
2200
-
2201
  wppa_js( 'wppaFbInit();' );
2202
  // if ( $js && $key != 'thumb' ) {
2203
  // $fb .= '[script>wppaFbInit();[/script>';
@@ -2921,7 +2921,7 @@ static $albums_granted;
2921
 
2922
  // Create the return url
2923
  if ( $ajax_upload ) {
2924
- if ( wppa_is_file( dirname( __FILE__ ) . '/wppa-ajax-front.php' ) && $method == 'extern' ) {
2925
  if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=do-fe-upload';
2926
  else $returnurl = WPPA_URL . '/wppa-ajax-front.php?action=wppa&amp;wppa-action=do-fe-upload';
2927
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 8.1.02.001
7
  *
8
  */
9
 
2197
 
2198
  // Need init?
2199
  if ( $need_fb_init ) {
2200
+
2201
  wppa_js( 'wppaFbInit();' );
2202
  // if ( $js && $key != 'thumb' ) {
2203
  // $fb .= '[script>wppaFbInit();[/script>';
2921
 
2922
  // Create the return url
2923
  if ( $ajax_upload ) {
2924
+ if ( wppa_is_file( dirname( __FILE__ ) . '/wppa-ajax-front.php' ) && wppa_opt( 'ajax_method' ) == 'extern' ) {
2925
  if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=do-fe-upload';
2926
  else $returnurl = WPPA_URL . '/wppa-ajax-front.php?action=wppa&amp;wppa-action=do-fe-upload';
2927
  }
wppa-scripts.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
- * Version 8.1.01.002
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
@@ -352,7 +352,7 @@ global $wpdb;
352
  wppaMagnifierCursor = "'.wppa_opt( 'magnifier' ) . '",
353
  wppaArtMonkyLink = "'.wppa_opt( 'art_monkey_link' ) . '",
354
  wppaAutoOpenComments = '.( wppa_switch( 'auto_open_comments' ) ? 'true' : 'false' ) . ',
355
- wppaUpdateAddressLine = '.( wppa_switch( 'update_addressline' ) ? 'false' : 'false' ) . ', /* temp disabled */
356
  wppaSlideSwipe = '.( wppa_switch( 'slide_swipe' ) ? 'true' : 'false' ) . ',
357
  wppaMaxCoverWidth = '.wppa_opt( 'max_cover_width' ) . ',
358
  wppaSlideToFullpopup = '.( wppa_opt( 'slideshow_linktype' ) == 'fullpopup' ? 'true' : 'false' ) . ',
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
+ * Version 8.1.02.001
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
352
  wppaMagnifierCursor = "'.wppa_opt( 'magnifier' ) . '",
353
  wppaArtMonkyLink = "'.wppa_opt( 'art_monkey_link' ) . '",
354
  wppaAutoOpenComments = '.( wppa_switch( 'auto_open_comments' ) ? 'true' : 'false' ) . ',
355
+ wppaUpdateAddressLine = '.( wppa_switch( 'update_addressline' ) ? 'true' : 'false' ) . ',
356
  wppaSlideSwipe = '.( wppa_switch( 'slide_swipe' ) ? 'true' : 'false' ) . ',
357
  wppaMaxCoverWidth = '.wppa_opt( 'max_cover_width' ) . ',
358
  wppaSlideToFullpopup = '.( wppa_opt( 'slideshow_linktype' ) == 'fullpopup' ? 'true' : 'false' ) . ',
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 8.1.01.005
7
  *
8
  */
9
 
@@ -299,6 +299,12 @@ global $wppa_error;
299
 
300
  }
301
 
 
 
 
 
 
 
302
  // Check required directories
303
  if ( ! wppa_check_dirs() ) $wppa_error = true;
304
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 8.1.02.001
7
  *
8
  */
9
 
299
 
300
  }
301
 
302
+ // Sanitize nicescroll opts
303
+ $nso = get_option( 'wppa_nicescroll_opts', '' );
304
+ if ( $nso ) {
305
+ update_option( 'wppa_nicescroll_opts', wppa_sanitize_nso( $nso ) );
306
+ }
307
+
308
  // Check required directories
309
  if ( ! wppa_check_dirs() ) $wppa_error = true;
310
 
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 8.1.00.008
7
  *
8
  */
9
 
@@ -1434,6 +1434,45 @@ function wppa_sanitize_tags( $value, $keepsemi = false, $keephash = false ) {
1434
  return $value;
1435
  }
1436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1437
  // Does the same as wppa_index_string_to_array() but with format validation and error reporting
1438
  function wppa_series_to_array($xtxt) {
1439
  if ( is_array( $xtxt ) ) return false;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 8.1.02.001
7
  *
8
  */
9
 
1434
  return $value;
1435
  }
1436
 
1437
+ // Sanitize nice scroll options
1438
+ // Must be a valid js object content
1439
+ //
1440
+ // Defaults:
1441
+ //
1442
+ // cursorwidth:'8px',
1443
+ // cursoropacitymin:0.4,
1444
+ // cursorcolor:'#777777',
1445
+ // cursorborder:'none',
1446
+ // cursorborderradius:'6px',
1447
+ // autohidemode:'leave',
1448
+ // nativeparentscrolling:false,
1449
+ // preservenativescrolling:false,
1450
+ // bouncescroll:false,
1451
+ // smoothscroll:true,
1452
+ // cursorborder:'2px solid transparent',
1453
+ // horizrailenabled:false,
1454
+ function wppa_sanitize_nso( $nso ) {
1455
+
1456
+ $result = array();
1457
+ $nso = str_replace( "'", '', $nso );
1458
+ $nso = str_replace( "\n", '', $nso );
1459
+ $nso_arr = explode( ',', $nso );
1460
+ foreach ( $nso_arr as $item ) {
1461
+ $n_v = explode( ':', $item );
1462
+ if ( count( $n_v ) == 2 ) {
1463
+ $name = trim( $n_v[0] );
1464
+ $value = trim( $n_v[1] );
1465
+ if ( in_array( $value, ['true','false'] ) || is_numeric( $value ) ) {
1466
+ $result[] = $name . ':' . $value . ",\n";
1467
+ }
1468
+ else {
1469
+ $result[] = $name . ':' . "'" . $value . "',\n";
1470
+ }
1471
+ }
1472
+ }
1473
+ return implode( '', $result );
1474
+ }
1475
+
1476
  // Does the same as wppa_index_string_to_array() but with format validation and error reporting
1477
  function wppa_series_to_array($xtxt) {
1478
  if ( is_array( $xtxt ) ) return false;
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: 8.1.01.005
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_api_version;
27
- $wppa_api_version = '8.1.01.005'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
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: 8.1.02.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
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.1.02.001'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30