WP Photo Album Plus - Version 8.0.06.004

Version Description

= 8.0.06 =

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

Release Info

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

Code changes from version 8.0.06.003 to 8.0.06.004

changelog.txt CHANGED
@@ -7,6 +7,8 @@ Enables you to select a userrole, and show the number of comments given by usert
7
  * Pagination is now switched off when a photo enumeration is given.
8
  * Fixed wrong links when photo names in urls is activated.
9
  * In case of duplicate names in 'names in urls' they will not be converted to avoid confusion.
 
 
10
 
11
  = 8.0.05 =
12
 
7
  * Pagination is now switched off when a photo enumeration is given.
8
  * Fixed wrong links when photo names in urls is activated.
9
  * In case of duplicate names in 'names in urls' they will not be converted to avoid confusion.
10
+ * When photo names in urls, slideshow always started at the first slide, also when a link expected a specific item. Fixed.
11
+ * Fix first found in cover image selection did not work. Fixed.
12
 
13
  = 8.0.05 =
14
 
wppa-album-covers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
- * Version 8.0.05.003
7
  *
8
  */
9
 
@@ -1401,8 +1401,11 @@ function wppa_get_coverphoto_id( $xalb = '' ) {
1401
  if ( ! wppa_photo_exists( $current ) ) {
1402
  wppa_update_album( array( 'id' => $xalb, 'main_photo' => '0' ) );
1403
  }
 
 
 
1404
  }
1405
-
1406
  // See if random photo needs to be saved
1407
  $save_it = false;
1408
  if ( wppa_switch( 'main_photo_random_once' ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 8.0.06.004
7
  *
8
  */
9
 
1401
  if ( ! wppa_photo_exists( $current ) ) {
1402
  wppa_update_album( array( 'id' => $xalb, 'main_photo' => '0' ) );
1403
  }
1404
+ else {
1405
+ return $current;
1406
+ }
1407
  }
1408
+
1409
  // See if random photo needs to be saved
1410
  $save_it = false;
1411
  if ( wppa_switch( 'main_photo_random_once' ) ) {
wppa-boxes-html.php CHANGED
@@ -3179,8 +3179,8 @@ static $albums_granted;
3179
  class="wppa-upload-button"
3180
  value=" "
3181
  onclick="
3182
- jQuery(\'#wppa-user-upload-' . $yalb . '-' . $mocc . '\').prop(\'capture\',true);
3183
- jQuery( \'#wppa-user-upload-' . $yalb . '-' . $mocc . '\' ).click();
3184
  "
3185
  />';
3186
  }
3179
  class="wppa-upload-button"
3180
  value=" "
3181
  onclick="
3182
+ jQuery(\'#wppa-user-upload-' . $yalb . '-' . $mocc . '\').attr(\'capture\',\'environment\');
3183
+ jQuery(\'#wppa-user-upload-' . $yalb . '-' . $mocc . '\').click();
3184
  "
3185
  />';
3186
  }
wppa-common-functions.php CHANGED
@@ -1388,7 +1388,7 @@ global $wp_roles;
1388
  else {
1389
  $roles = $wp_roles->roles;
1390
  unset ( $roles['administrator'] );
1391
- foreach ( array_keys( $roles ) as $role ) if ( ! $limits ) {
1392
  if ( current_user_can( $role ) ) {
1393
  $limits = wppa_get_option( 'wppa_'.$role.'_upload_limit_count', '0' ).'/'.wppa_get_option( 'wppa_'.$role.'_upload_limit_time', '0' );
1394
  }
1388
  else {
1389
  $roles = $wp_roles->roles;
1390
  unset ( $roles['administrator'] );
1391
+ foreach ( array_keys( $roles ) as $role ) if ( $limits == '0/0' ) {
1392
  if ( current_user_can( $role ) ) {
1393
  $limits = wppa_get_option( 'wppa_'.$role.'_upload_limit_count', '0' ).'/'.wppa_get_option( 'wppa_'.$role.'_upload_limit_time', '0' );
1394
  }
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 8.0.06.002
7
  *
8
  */
9
 
@@ -3745,9 +3745,12 @@ function wppa_get_container_style() {
3745
  if ( wppa( 'align' ) == 'left' ) {
3746
  $result .= 'clear:left; ';
3747
  }
3748
- if ( wppa( 'align' ) == 'right' ) {
3749
  $result .= 'clear:right; ';
3750
  }
 
 
 
3751
  }
3752
 
3753
  // Width
@@ -3762,7 +3765,7 @@ function wppa_get_container_style() {
3762
  }
3763
  // Responsive full width
3764
  elseif ( wppa( 'auto_colwidth' ) ) {
3765
- $result .= 'width:100%;';
3766
  }
3767
  // Static
3768
  else {
@@ -4848,12 +4851,16 @@ global $allphotos;
4848
  $pid = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE sname = %s LIMIT 1", $name ) );
4849
  }
4850
 
4851
- if ( $pid ) {
4852
- wppa_dbg_msg( 'Pid ' . $pid . ' found for ' . $name );
4853
- }
4854
- else {
4855
- wppa_dbg_msg( 'No pid found for ' . $name );
 
 
 
4856
  }
 
4857
  return $pid;
4858
  }
4859
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 8.0.06.004
7
  *
8
  */
9
 
3745
  if ( wppa( 'align' ) == 'left' ) {
3746
  $result .= 'clear:left; ';
3747
  }
3748
+ elseif ( wppa( 'align' ) == 'right' ) {
3749
  $result .= 'clear:right; ';
3750
  }
3751
+ else {
3752
+ // $result .= 'clear:both; ';
3753
+ }
3754
  }
3755
 
3756
  // Width
3765
  }
3766
  // Responsive full width
3767
  elseif ( wppa( 'auto_colwidth' ) ) {
3768
+ $result .= 'width:100%;clear:both;';
3769
  }
3770
  // Static
3771
  else {
4851
  $pid = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE sname = %s LIMIT 1", $name ) );
4852
  }
4853
 
4854
+ // Not found? Try crypt
4855
+ if ( ! $pid ) {
4856
+ if ( $alb ) {
4857
+ $pid = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE crypt = %s AND ( album = $alb ) LIMIT 1", $name ) );
4858
+ }
4859
+ else {
4860
+ $pid = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE crypt = %s LIMIT 1", $name ) );
4861
+ }
4862
  }
4863
+
4864
  return $pid;
4865
  }
4866
 
wppa-links.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Frontend links
6
 
7
- * Version 8.0.06.003
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -889,26 +889,7 @@ function wppa_compress_pretty( $uri ) {
889
  function wppa_numbers_to_names_in_uri( $xuri ) {
890
 
891
  $uri = $xuri;
892
- $uri = wppa_album_number_to_name_in_uri( $uri );
893
- $uri = wppa_photo_number_to_name_in_uri( $uri );
894
-
895
- if ( $xuri != $uri ) {
896
- // wppa_log( 'obs', $xuri . ' converted to ' . $uri );
897
- }
898
- return $uri;
899
- }
900
-
901
- // Replace album number by name in url
902
- function wppa_album_number_to_name_in_uri( $uri ) {
903
-
904
  $uri = wppa_convert_item_number_to_name_in_uri( $uri, 'album' );
905
-
906
- return $uri;
907
- }
908
-
909
- // Replace photo number by name in url
910
- function wppa_photo_number_to_name_in_uri( $uri ) {
911
-
912
  $uri = wppa_convert_item_number_to_name_in_uri( $uri, 'photo' );
913
 
914
  return $uri;
@@ -1002,7 +983,7 @@ global $wpdb;
1002
  $uri = $before . $sname . $after;
1003
  }
1004
  else {
1005
- wppa_log( 'obs', 'Uri conversion skipped due to not unique name ' . $sname );
1006
  }
1007
  }
1008
 
@@ -1608,6 +1589,7 @@ global $wpdb;
1608
  $result['is_url'] = true;
1609
  $result['url'] = wppa_get_photo_url( $id );
1610
  $result['target'] = '_blank';
 
1611
  break;
1612
  case 'photo': // slideshow
1613
  case 'single': // single image
4
  *
5
  * Frontend links
6
 
7
+ * Version 8.0.06.004
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
889
  function wppa_numbers_to_names_in_uri( $xuri ) {
890
 
891
  $uri = $xuri;
 
 
 
 
 
 
 
 
 
 
 
 
892
  $uri = wppa_convert_item_number_to_name_in_uri( $uri, 'album' );
 
 
 
 
 
 
 
893
  $uri = wppa_convert_item_number_to_name_in_uri( $uri, 'photo' );
894
 
895
  return $uri;
983
  $uri = $before . $sname . $after;
984
  }
985
  else {
986
+ // wppa_log( 'obs', 'Uri conversion skipped due to not unique name ' . $sname );
987
  }
988
  }
989
 
1589
  $result['is_url'] = true;
1590
  $result['url'] = wppa_get_photo_url( $id );
1591
  $result['target'] = '_blank';
1592
+ return $result;
1593
  break;
1594
  case 'photo': // slideshow
1595
  case 'single': // single image
wppa-slideshow.php CHANGED
@@ -3,7 +3,8 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the slideshow high level functions
6
- * Version 8.0.06.002
 
7
  *
8
  */
9
 
@@ -120,6 +121,14 @@ global $previous_page_last_id;
120
  // Any items?
121
  if ( ! $thumbs ) return;
122
 
 
 
 
 
 
 
 
 
123
  // Not on photo enumeration
124
  if ( wppa( 'start_photos' ) ) return;
125
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the slideshow high level functions
6
+ *
7
+ * Version 8.0.06.004
8
  *
9
  */
10
 
121
  // Any items?
122
  if ( ! $thumbs ) return;
123
 
124
+ // If not numeric startphoto, convert it
125
+ if ( wppa( 'start_photo' ) && ! wppa_is_int( wppa( 'start_photo' ) ) ) {
126
+ global $wpdb;
127
+ $s = wppa( 'start_photo' );
128
+ $id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE sname = %s OR crypt = %s LIMIT 1", $s, $s ) );
129
+ wppa( 'start_photo', $id );
130
+ }
131
+
132
  // Not on photo enumeration
133
  if ( wppa( 'start_photos' ) ) return;
134
 
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.0.06.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,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.0.06.003'; // 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.0.06.004
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.0.06.004'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30