WP Photo Album Plus - Version 7.3.09.005

Version Description

= 7.3.09 =

  • This version addresses various bug fixes and feature requests.

= 7.3.08 =

  • This version addresses various bug fixes and feature requests.

= 7.3.07 =

  • This version addresses various bug fixes and feature requests.

= 7.3.06 =

  • This version addresses various bug fixes and feature requests.

= 7.3.05 =

  • This version addresses various bug fixes and feature requests.

= 7.3.04 =

  • This version addresses various bug fixes and feature requests.

= 7.3.03 =

  • This version addresses various bug fixes and feature requests.

= 7.3.02 =

  • This version addresses various bug fixes and feature requests.

= 7.3.01 =

  • This version addresses various bug fixes, feature requests and performance enhancements.

= 7.3.00 =

  • This version addresses various bug fixes and performance enhancements.

= 7.2.14 =

  • This version addresses various bug fixes and feature requests.

= 7.2.13 =

  • This version addresses various bug fixes and feature requests.

= 7.2.12 =

  • This version addresses various bug fixes and feature requests.

= 7.2.11 =

  • This version addresses various bug fixes and feature requests.

= 7.2.10 =

  • This version addresses various bug fixes and feature requests.

= 7.2.09 =

  • This version addresses various bug fixes and feature requests.

= 7.2.08 =

  • This version addresses various bug fixes.

= 7.2.07 =

  • This version addresses various bug fixes.

= 7.2.06 =

  • This version addresses various bug fixes and feature requests.
  • This version addresses various security issues.

= 7.2.05 =

  • This version addresses various bug fixes and feature requests.
  • This version addresses various security issues.

= 7.2.04 =

  • This version addresses various bug fixes and feature requests.

= 7.2.03 =

  • This version addresses various bug fixes and feature requests.

= 7.2.02 =

  • This version addresses various bug fixes and feature requests.

= 7.2.01 =

  • This version addresses various bug fixes and feature requests.

= 7.2.00 =

  • This version addresses various bug fixes and feature requests.

= 7.1.11 =

  • This version addresses various bug fixes and feature requests.

= 7.1.10 =

  • This version addresses various bug fixes and feature requests.

= 7.1.09 =

  • This version addresses various bug fixes and feature requests.

= 7.1.08 =

  • This version addresses various bug fixes and feature requests.

= 7.1.07 =

  • This version addresses various bug fixes and feature requests.

= 7.1.06 =

  • This version addresses various bug fixes and feature requests.

= 7.1.05 =

  • This version addresses various security issues.
  • This version addresses various bug fixes.

= 7.1.04 =

  • This version addresses various bug fixes.

= 7.1.03 =

  • This version addresses various security issues.
  • This version addresses various bug fixes.

= 7.1.02 =

  • This version addresses various security issues.
  • This version addresses various bug fixes and feature requests.

= 7.1.01 =

  • This version addresses various bug fixes and feature requests.

= 7.1.00 =

  • This version addresses various bug fixes and feature requests.
  • The Photo Album -> Upload Photos and Import Photos admin pages have been substantially improved. Read the changelog for details.

= 7.0.11 =

  • This version addresses various bug fixes and feature requests.

= 7.0.11 =

  • This version addresses various bug fixes

= 7.0.10 =

  • This version addresses various bug fixes

= 7.0.09 =

  • This version addresses various security issues.
  • This version addresses various bug fixes and feature requests.

= 7.0.08 =

  • This version addresses various security issues.
  • This version addresses various bug fixes

= 7.0.07 =

  • This version addresses various security issues.
  • This version addresses various bug fixes

= 7.0.06 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.05 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 7.0.04 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.03 =

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

= 7.0.02 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.01 =

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

= 7.0.00 =

  • Shortcode generators for Gutenberg added.
  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.
  • To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised. Configure Table IX-M to enable various mailing lists, and use the WPPA+ Notify widget for full user flexibility.

= 6.9.21 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 6.9.20 =

  • This version addresses various bug fixes

= 6.9.19 =

  • This version addresses various minor bug fixes

= 6.9.18 =

  • This version addresses various minor bug fixes

= 6.9.17 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.16 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.15 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.14 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.13 =

  • Security release.

= 6.9.12 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.11 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.10 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.09 =

  • Panorama support phase III.

= 6.9.08 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase II.

= 6.9.07 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase I.

= 6.9.06 =

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

= 6.9.05 =

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

= 6.9.04 =

  • This version addresses various minor bug fixes and feature requests.
  • Local CDN functionality has been added.

= 6.9.03 =

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

= 6.9.02 =

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

= 6.9.01 =

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

= 6.9.00 =

  • This version includes the code for the privacy policy requirements.

= 6.8.09

  • This version addresses various bug fixes and code edits.

= 6.8.08 =

  • This version addresses various minor bug fixes and feature requests.
  • This version offers substantial performance improvements when the box in Table IV-A13: Defer Javascript is ticked. This setting is now recommended and set ticked as the default.
  • For more info on performance improvements and compatibility with optimizers: see the changelog.txt

= 6.8.07 =

  • This version addresses various minor bug fixes and enhancements, and a new widget: Statistics.

= 6.8.06 =

  • This version addresses various minor bug fixes and improved cache handling.

= 6.8.05 =

  • This version addresses various minor bug fixes and feture requests.

= 6.8.04 =

  • This version addresses various display issues and a few fixes of bugs that seldom affected the plugins behaviour.
Download this release

Release Info

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

Code changes from version 7.3.08.006 to 7.3.09.005

changelog.txt CHANGED
@@ -1,5 +1,21 @@
1
WP Photo Album Plus Changelog
2
3
= 7.3.08 =
4
5
* New feature: Setting Table IX-A17: Translate. Translate names, descriptions and other text using qTranslate rules without a language plugin.
1
WP Photo Album Plus Changelog
2
3
+ = 7.3.09 =
4
+
5
+ * Fixed a possible layout issue in the album navigator when caching was on for this widget.
6
+ * New setting Table IX-A18: Add locale. Always add locale to links. You may need this setting if you use a multilanguage plugin not being qTranslate.
7
+ * The linkpages for the tagcloud and multitag widgets/boxes have been extended with --- the same page ---.
8
+ Usefull when using multilanguage plugins not being qTranslate and intented for the box.
9
+ The behaviour for a widget depends of the specific page layout and is therefor unpredictable.
10
+ * Various cosmetic changes.
11
+ * When remake add is ticked (Table IX-H6) a duplicate photo item for a videao was created
12
+ when the button 'Remake all' was ticked on the album admin page. Fixed.
13
+ * Reverted mod from 7.3.03: 'Fixed duplicate ids in search code for certain themes.' because it caused layout issues.
14
+ * The subdir 'dynamic' is now also created at plugin activation.
15
+ * Added option 'basic' to the Membership selectionbox in Table VII-A. This effectively limits the capabilities of users.
16
+ A 'basic' member can not create/delete (sub)albums, upload, delete possibly existing own photos, enter comments and rate photos.
17
+ Setting this for an administrator or a superuser has no effect.
18
+
19
= 7.3.08 =
20
21
* New feature: Setting Table IX-A17: Translate. Translate names, descriptions and other text using qTranslate rules without a language plugin.
readme.txt CHANGED
@@ -2,12 +2,12 @@
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.3.08.006
6
- Stable tag: 7.3.07.004
7
Author: J.N. Breetvelt
8
Author URI: http://www.opajaap.nl/
9
Requires at least: 3.9
10
- Tested up to: 5.3
11
Requires PHP: 5.5
12
License: GPLv2 or later
13
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -137,6 +137,10 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
137
138
== Upgrade Notice ==
139
140
= 7.3.08 =
141
142
* This version addresses various bug fixes and feature requests.
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.3.09.005
6
+ Stable tag: 7.3.08.006
7
Author: J.N. Breetvelt
8
Author URI: http://www.opajaap.nl/
9
Requires at least: 3.9
10
+ Tested up to: 5.4
11
Requires PHP: 5.5
12
License: GPLv2 or later
13
License URI: http://www.gnu.org/licenses/gpl-2.0.html
137
138
== Upgrade Notice ==
139
140
+ = 7.3.09 =
141
+
142
+ * This version addresses various bug fixes and feature requests.
143
+
144
= 7.3.08 =
145
146
* This version addresses various bug fixes and feature requests.
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* gp admin functions
6
- * Version 7.3.07
7
*
8
*/
9
@@ -151,9 +151,16 @@ global $wpdb;
151
if ( $files ) foreach ( $files as $file ) {
152
if ( ! wppa_is_dir( $file ) ) {
153
$filename = basename( $file );
154
- $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
155
- WHERE filename = %s
156
- OR ( filename = '' AND name = %s )", $filename, $filename ), ARRAY_A );
157
158
if ( $photos ) foreach ( $photos as $photo ) { // Photo exists
159
$modified_time = $photo['modified'];
3
* Package: wp-photo-album-plus
4
*
5
* gp admin functions
6
+ * Version 7.3.09
7
*
8
*/
9
151
if ( $files ) foreach ( $files as $file ) {
152
if ( ! wppa_is_dir( $file ) ) {
153
$filename = basename( $file );
154
+ $photos =
155
+ $wpdb->get_results( $wpdb->prepare(
156
+ "SELECT * FROM $wpdb->wppa_photos
157
+ WHERE filename = %s
158
+ OR filename = %s
159
+ OR ( filename = '' AND name = %s )",
160
+ $filename,
161
+ wppa_strip_ext( $filename ) . '.xxx', // May be a multimedia iten
162
+ $filename ),
163
+ ARRAY_A );
164
165
if ( $photos ) foreach ( $photos as $photo ) { // Photo exists
166
$modified_time = $photo['modified'];
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
/* wppa-ajax.php
3
*
4
* Functions used in ajax requests
5
- * Version 7.3.08
6
*
7
*/
8
@@ -475,7 +475,7 @@ global $wppa_log_file;
475
wppa( 'comment_photo', $photoid );
476
wppa( 'comment_id', $commentid );
477
478
- $comment_allowed = ( ! wppa_switch( 'comment_login' ) || is_user_logged_in() );
479
if ( wppa_switch( 'show_comments' ) && $comment_allowed && $doit ) {
480
wppa_do_comment( $photoid ); // Process the comment
481
if ( wppa_switch( 'search_comments' ) ) wppa_index_update( 'photo', $photoid );
2
/* wppa-ajax.php
3
*
4
* Functions used in ajax requests
5
+ * Version 7.3.09
6
*
7
*/
8
475
wppa( 'comment_photo', $photoid );
476
wppa( 'comment_id', $commentid );
477
478
+ $comment_allowed = ! wppa_user_is_basic() && ( ! wppa_switch( 'comment_login' ) || is_user_logged_in() );
479
if ( wppa_switch( 'show_comments' ) && $comment_allowed && $doit ) {
480
wppa_do_comment( $photoid ); // Process the comment
481
if ( wppa_switch( 'search_comments' ) ) wppa_index_update( 'photo', $photoid );
wppa-album-navigator-widget.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* display album names linking to content
6
- * Version 7.3.06
7
*/
8
9
class AlbumNavigatorWidget extends WP_Widget {
@@ -69,15 +69,15 @@ class AlbumNavigatorWidget extends WP_Widget {
69
}
70
else {
71
if ( $parent == 'all' ) {
72
- $widget_content .= $this->do_album_navigator( '0', $page, $skip, '' );
73
- $widget_content .= $this->do_album_navigator( '-1', $page, $skip, '' );
74
}
75
elseif ( $parent == 'owner' ) {
76
- $widget_content .= $this->do_album_navigator( '0', $page, $skip, '', " AND ( owner = '--- public ---' OR owner = '".wppa_get_user()."' ) " );
77
- $widget_content .= $this->do_album_navigator( '-1', $page, $skip, '', " AND ( owner = '--- public ---' OR owner = '".wppa_get_user()."' ) " );
78
}
79
else {
80
- $widget_content .= $this->do_album_navigator( $parent, $page, $skip, '' );
81
}
82
$widget_content .= '<div style="clear:both" data-wppa="yes" ></div>';
83
}
@@ -182,7 +182,7 @@ class AlbumNavigatorWidget extends WP_Widget {
182
return $widgetid;
183
}
184
185
- function do_album_navigator( $parent, $page, $skip, $propclass, $extraclause = '' ) {
186
global $wpdb;
187
static $level;
188
static $ca;
@@ -196,6 +196,11 @@ class AlbumNavigatorWidget extends WP_Widget {
196
if ( $ca && ! wppa_album_exists( $ca ) ) {
197
$ca = '0';
198
}
199
}
200
else {
201
$level++;
@@ -350,7 +355,7 @@ class AlbumNavigatorWidget extends WP_Widget {
350
</li>';
351
$newpropclass = $propclass . ' p-'.$w.'-'.$p;
352
353
- $next_level = $this->do_album_navigator( $a, $page, $skip, $newpropclass, $extraclause );
354
if ( $next_level ) {
355
$result .= '
356
<li
3
* Package: wp-photo-album-plus
4
*
5
* display album names linking to content
6
+ * Version 7.3.09
7
*/
8
9
class AlbumNavigatorWidget extends WP_Widget {
69
}
70
else {
71
if ( $parent == 'all' ) {
72
+ $widget_content .= $this->do_album_navigator( '0', $page, $skip, '', '', $cache );
73
+ $widget_content .= $this->do_album_navigator( '-1', $page, $skip, '', '', $cache );
74
}
75
elseif ( $parent == 'owner' ) {
76
+ $widget_content .= $this->do_album_navigator( '0', $page, $skip, '', " AND ( owner = '--- public ---' OR owner = '".wppa_get_user()."' ) ", $cache );
77
+ $widget_content .= $this->do_album_navigator( '-1', $page, $skip, '', " AND ( owner = '--- public ---' OR owner = '".wppa_get_user()."' ) ", $cache );
78
}
79
else {
80
+ $widget_content .= $this->do_album_navigator( $parent, $page, $skip, '', '', $cahce );
81
}
82
$widget_content .= '<div style="clear:both" data-wppa="yes" ></div>';
83
}
182
return $widgetid;
183
}
184
185
+ function do_album_navigator( $parent, $page, $skip, $propclass, $extraclause, $cache ) {
186
global $wpdb;
187
static $level;
188
static $ca;
196
if ( $ca && ! wppa_album_exists( $ca ) ) {
197
$ca = '0';
198
}
199
+
200
+ // Ignore current album when caching, i.e. no raquo
201
+ if ( $cache ) {
202
+ $ca = '0';
203
+ }
204
}
205
else {
206
$level++;
355
</li>';
356
$newpropclass = $propclass . ' p-'.$w.'-'.$p;
357
358
+ $next_level = $this->do_album_navigator( $a, $page, $skip, $newpropclass, $extraclause, $cache );
359
if ( $next_level ) {
360
$result .= '
361
<li
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* Various wppa boxes
6
- * Version 7.3.08
7
*
8
*/
9
@@ -339,11 +339,11 @@ global $wppa_session;
339
340
// Fix id and name
341
$form_core = str_replace( 'for="s"', 'for="wppa_s-'.$mocc.'"', $form_core );
342
- $form_core = str_replace( 'for="search-input"', 'for="wppa_search-input-'.$mocc.'"', $form_core );
343
$form_core = str_replace( 'id="s"', 'id="wppa_s-'.$mocc.'"', $form_core );
344
- $form_core = str_replace( 'id="search-input"', 'id="wppa_search-input-'.$mocc.'"', $form_core );
345
$form_core = str_replace( 'name="s"', 'name="wppa-searchstring"', $form_core );
346
- $form_core = str_replace( 'id="search-submit"', 'id="wppa-search-submit"', $form_core );
347
348
// If no placeholder in form_core, add it
349
if ( strpos( $form_core, 'placeholder' ) === false ) {
@@ -1242,7 +1242,12 @@ function wppa_get_tagcloud_html( $seltags = '', $minsize = '8', $maxsize = '24'
1242
$oc = wppa_opt( 'tagcloud_linkpage_oc' );
1243
$result = '';
1244
if ( $page ) {
1245
- $hr = wppa_get_permalink( $page );
1246
if ( wppa_opt( 'tagcloud_linktype' ) == 'album' ) {
1247
$hr .= 'wppa-album=0&amp;wppa-cover=0&amp;wppa-occur='.$oc;
1248
}
@@ -1316,7 +1321,12 @@ function wppa_get_multitag_html( $nperline = '2', $seltags = '' ) {
1316
$oc = wppa_opt( 'multitag_linkpage_oc' );
1317
$result = '';
1318
if ( $page ) {
1319
- $hr = wppa_get_permalink( $page );
1320
$hr = str_replace( '&amp;', '&', $hr );
1321
if ( wppa_opt( 'multitag_linktype' ) == 'album' ) {
1322
$hr .= 'wppa-album=0&wppa-cover=0&wppa-occur='.$oc;
@@ -2133,6 +2143,11 @@ function wppa_user_create_html( $alb, $width, $where = '', $mcr = false ) {
2133
2134
function wppa_get_user_create_html( $alb, $width, $where = '', $mcr = false ) {
2135
2136
// Init
2137
$result = '';
2138
$mocc = wppa( 'mocc' );
@@ -2393,6 +2408,11 @@ global $wppa_supported_audio_extensions;
2393
static $seqno;
2394
static $albums_granted;
2395
2396
$albums_created = array();
2397
2398
// Create granted albums only if not done yet i a previous occurance,
@@ -4218,6 +4238,9 @@ global $wpdb;
4218
</form>
4219
</div>';
4220
}
4221
else {
4222
if ( wppa_switch( 'login_links' ) ) {
4223
$result .= sprintf( __( 'You must <a href="%s">login</a> to enter a comment', 'wp-photo-album-plus' ), wppa_opt( 'login_url' ) );
3
* Package: wp-photo-album-plus
4
*
5
* Various wppa boxes
6
+ * Version 7.3.09
7
*
8
*/
9
339
340
// Fix id and name
341
$form_core = str_replace( 'for="s"', 'for="wppa_s-'.$mocc.'"', $form_core );
342
+ // $form_core = str_replace( 'for="search-input"', 'for="wppa_search-input-'.$mocc.'"', $form_core );
343
$form_core = str_replace( 'id="s"', 'id="wppa_s-'.$mocc.'"', $form_core );
344
+ // $form_core = str_replace( 'id="search-input"', 'id="wppa_search-input-'.$mocc.'"', $form_core );
345
$form_core = str_replace( 'name="s"', 'name="wppa-searchstring"', $form_core );
346
+ // $form_core = str_replace( 'id="search-submit"', 'id="wppa-search-submit"', $form_core );
347
348
// If no placeholder in form_core, add it
349
if ( strpos( $form_core, 'placeholder' ) === false ) {
1242
$oc = wppa_opt( 'tagcloud_linkpage_oc' );
1243
$result = '';
1244
if ( $page ) {
1245
+ if ( $page == '-1' ) {
1246
+ $hr = wppa_get_permalink();
1247
+ }
1248
+ else {
1249
+ $hr = wppa_get_permalink( $page );
1250
+ }
1251
if ( wppa_opt( 'tagcloud_linktype' ) == 'album' ) {
1252
$hr .= 'wppa-album=0&amp;wppa-cover=0&amp;wppa-occur='.$oc;
1253
}
1321
$oc = wppa_opt( 'multitag_linkpage_oc' );
1322
$result = '';
1323
if ( $page ) {
1324
+ if ( $page == '-1' ) {
1325
+ $hr = wppa_get_permalink();
1326
+ }
1327
+ else {
1328
+ $hr = wppa_get_permalink( $page );
1329
+ }
1330
$hr = str_replace( '&amp;', '&', $hr );
1331
if ( wppa_opt( 'multitag_linktype' ) == 'album' ) {
1332
$hr .= 'wppa-album=0&wppa-cover=0&wppa-occur='.$oc;
2143
2144
function wppa_get_user_create_html( $alb, $width, $where = '', $mcr = false ) {
2145
2146
+ // Basic users are not allowed to create sub albums
2147
+ if ( wppa_user_is_basic() ) {
2148
+ return '';
2149
+ }
2150
+
2151
// Init
2152
$result = '';
2153
$mocc = wppa( 'mocc' );
2408
static $seqno;
2409
static $albums_granted;
2410
2411
+ // Basic users are not allowed to upload
2412
+ if ( wppa_user_is_basic() ) {
2413
+ return '';
2414
+ }
2415
+
2416
$albums_created = array();
2417
2418
// Create granted albums only if not done yet i a previous occurance,
4238
</form>
4239
</div>';
4240
}
4241
+ elseif ( wppa_user_is_basic() ) {
4242
+ $result .= __( 'You must upgrade your membership to enter a comment', 'wp-photo-album-plus' );
4243
+ }
4244
else {
4245
if ( wppa_switch( 'login_links' ) ) {
4246
$result .= sprintf( __( 'You must <a href="%s">login</a> to enter a comment', 'wp-photo-album-plus' ), wppa_opt( 'login_url' ) );
wppa-breadcrumb.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* Functions for breadcrumbs
6
- * Version 7.3.08
7
*
8
*/
9
@@ -598,7 +598,18 @@ global $wppa_session;
598
// If it's a link, it's not the last item
599
function wppa_bcitem( $value = '', $href = '', $title = '', $class = '', $ajax = '', $is_pname = false, $hash = '#wppa-container-' ) {
600
static $sep;
601
-
602
// Translate value
603
$value = __( $value );
604
3
* Package: wp-photo-album-plus
4
*
5
* Functions for breadcrumbs
6
+ * Version 7.3.09
7
*
8
*/
9
598
// If it's a link, it's not the last item
599
function wppa_bcitem( $value = '', $href = '', $title = '', $class = '', $ajax = '', $is_pname = false, $hash = '#wppa-container-' ) {
600
static $sep;
601
+ global $wppa_lang;
602
+
603
+ // ucfirst translatable tags
604
+ $glue = '[:' . $wppa_lang . ']';
605
+ $temp = explode( $glue, $value );
606
+ if ( count( $temp ) > 1 ) {
607
+ foreach ( array_keys( $temp ) as $key ) {
608
+ $temp[$key] = ucfirst( $temp[$key] );
609
+ }
610
+ $value = implode( $glue, $temp );
611
+ }
612
+
613
// Translate value
614
$value = __( $value );
615
wppa-defaults.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* Contains default settings
6
- * Version 7.3.08
7
*
8
*/
9
@@ -1016,6 +1016,7 @@ horizrailenabled:false,";
1016
'wppa_extended_resize_delay' => '200',
1017
'wppa_load_nicescroller' => 'no',
1018
'wppa_translate' => 'no',
1019
1020
// IX D New
1021
'wppa_max_album_newtime' => '0', // 1
3
* Package: wp-photo-album-plus
4
*
5
* Contains default settings
6
+ * Version 7.3.09
7
*
8
*/
9
1016
'wppa_extended_resize_delay' => '200',
1017
'wppa_load_nicescroller' => 'no',
1018
'wppa_translate' => 'no',
1019
+ 'wppa_add_locale' => 'no',
1020
1021
// IX D New
1022
'wppa_max_album_newtime' => '0', // 1
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* Various functions
6
- * Version 7.3.08
7
*
8
*/
9
@@ -19,12 +19,13 @@ global $wpdb;
19
global $thumbs;
20
global $wppa_session;
21
global $wppa;
22
23
wppa_occur_timer( 'init' );
24
25
// Diagnostics
26
wppa_dbg_msg( 'Entering wppa_albums' );
27
- wppa_dbg_msg( 'Lang=' . $wppa_lang . ', Locale=' . $wppa_locale . ', Ajax=' . wppa( 'ajax' ) );
28
wppa_dbg_msg( 'Get=' . serialize($_GET) );
29
wppa_dbg_msg( 'Post=' . serialize($_POST) );
30
@@ -2411,7 +2412,7 @@ static $user;
2411
2412
// Process a comment if given for this photo
2413
$comment_request = ( wppa_get_post( 'commentbtn' ) && ( $id == $photo ) );
2414
- $comment_allowed = ( ! wppa_switch( 'comment_login' ) || is_user_logged_in() );
2415
if ( wppa_switch( 'show_comments' ) && $comment_request && $comment_allowed ) {
2416
wppa_do_comment( $id );
2417
}
@@ -2456,6 +2457,11 @@ static $user;
2456
}
2457
}
2458
2459
// Find the avg rating
2460
if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
2461
@@ -4409,7 +4415,8 @@ function wppa_smx_photo( $stype ) {
4409
// The commentform on xphoto when enabled in II-B10
4410
if ( $stype == 'x' && wppa_switch( 'show_comments' ) ) {
4411
wppa_out( '<div id="wppa-comments-' . wppa( 'mocc' ) . '" >' );
4412
- wppa_out( wppa_comment_html( $id, ! wppa_switch( 'comment_login' ) || is_user_logged_in() ) );
4413
wppa_out( '</div>' );
4414
if ( wppa_switch( 'auto_open_comments' ) ) {
4415
wppa_out( '<script>jQuery(document).ready(function(){wppaOpenComments('.wppa('mocc').');});</script>' );
3
* Package: wp-photo-album-plus
4
*
5
* Various functions
6
+ * Version 7.3.09
7
*
8
*/
9
19
global $thumbs;
20
global $wppa_session;
21
global $wppa;
22
+ global $locale;
23
24
wppa_occur_timer( 'init' );
25
26
// Diagnostics
27
wppa_dbg_msg( 'Entering wppa_albums' );
28
+ wppa_dbg_msg( 'Lang=' . $wppa_lang . ', Locale=' . $wppa_locale . ', Ajax=' . wppa( 'ajax' ) . ', wp locale=' . $locale );
29
wppa_dbg_msg( 'Get=' . serialize($_GET) );
30
wppa_dbg_msg( 'Post=' . serialize($_POST) );
31
2412
2413
// Process a comment if given for this photo
2414
$comment_request = ( wppa_get_post( 'commentbtn' ) && ( $id == $photo ) );
2415
+ $comment_allowed = ! wppa_user_is_basic() && ( ! wppa_switch( 'comment_login' ) || is_user_logged_in() );
2416
if ( wppa_switch( 'show_comments' ) && $comment_request && $comment_allowed ) {
2417
wppa_do_comment( $id );
2418
}
2457
}
2458
}
2459
2460
+ // If user is restricted to 'basic', set myrat to 'void'.
2461
+ if ( wppa_user_is_basic() ) {
2462
+ $myrat = 'void';
2463
+ }
2464
+
2465
// Find the avg rating
2466
if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
2467
4415
// The commentform on xphoto when enabled in II-B10
4416
if ( $stype == 'x' && wppa_switch( 'show_comments' ) ) {
4417
wppa_out( '<div id="wppa-comments-' . wppa( 'mocc' ) . '" >' );
4418
+ $comment_allowed = ! wppa_user_is_basic() && ( ! wppa_switch( 'comment_login' ) || is_user_logged_in() );
4419
+ wppa_out( wppa_comment_html( $id, $comment_allowed ) );
4420
wppa_out( '</div>' );
4421
if ( wppa_switch( 'auto_open_comments' ) ) {
4422
wppa_out( '<script>jQuery(document).ready(function(){wppaOpenComments('.wppa('mocc').');});</script>' );
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
*
5
* This file loads required php files and contains all functions used in init actions.
6
*
7
- * Version 7.3.08
8
*/
9
10
/* LOAD SIDEBAR WIDGETS */
@@ -100,10 +100,18 @@ function wppa_load_plugin_textdomain() {
100
global $wppa_lang;
101
global $wppa_locale;
102
global $wp_version;
103
104
// 'Our' usefull language info
105
- $wppa_locale = get_locale() ? get_locale() : 'en_US';
106
- $wppa_lang = substr( $wppa_locale, 0, 2 );
107
108
// Load language if wp does not do it
109
if ( $wp_version < '4.6' || is_file( dirname( __FILE__ ) . '/languages/wp-photo-album-plus-' . $wppa_locale . '.mo' ) ) {
@@ -402,14 +410,8 @@ global $wppa_lang;
402
// Mark the one(s) we want to save
403
$text = str_replace( "[:$ln]", "[:save]", $text );
404
405
- // Replace the unwanted by [:]
406
- $old_len = 0;
407
- $new_len = strlen( $text );
408
- while ( $new_len != $old_len ) {
409
- $text = preg_replace( '/\[:..]([^\[]+)\[/', '[', $text );
410
- $old_len = $new_len;
411
- $new_len = strlen( $text );
412
- }
413
414
// Remove helpers
415
$text = str_replace( '[:]', '', $text );
4
*
5
* This file loads required php files and contains all functions used in init actions.
6
*
7
+ * Version 7.3.09
8
*/
9
10
/* LOAD SIDEBAR WIDGETS */
100
global $wppa_lang;
101
global $wppa_locale;
102
global $wp_version;
103
+ global $locale;
104
105
// 'Our' usefull language info
106
+ if ( wppa_get_get( 'wppalocale' ) ) {
107
+ $wppa_locale = wppa_get_get( 'wppalocale' );
108
+ $wppa_lang = substr( $wppa_locale, 0, 2 );
109
+ $locale = $wppa_locale;
110
+ }
111
+ else {
112
+ $wppa_locale = get_locale() ? get_locale() : 'en_US';
113
+ $wppa_lang = substr( $wppa_locale, 0, 2 );
114
+ }
115
116
// Load language if wp does not do it
117
if ( $wp_version < '4.6' || is_file( dirname( __FILE__ ) . '/languages/wp-photo-album-plus-' . $wppa_locale . '.mo' ) ) {
410
// Mark the one(s) we want to save
411
$text = str_replace( "[:$ln]", "[:save]", $text );
412
413
+ // Remove other languages
414
+ $text = preg_replace( '/\[:..]((?!\[:).)*/', '', $text );
415
416
// Remove helpers
417
$text = str_replace( '[:]', '', $text );
wppa-items.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* Contains functions to retrieve album and photo items
6
- * Version 7.3.07
7
*
8
*/
9
@@ -382,6 +382,16 @@ function wppa_translate_photo_keywords( $id, $text ) {
382
$replacement = __( trim( stripslashes( $thumb[$keyword] ) ) , 'wp-photo-album-plus');
383
if ( $keyword == 'tags' ) {
384
$replacement = trim( $replacement, ',' );
385
}
386
if ( $replacement == '' ) $replacement = '&lsaquo;'.__( 'none' , 'wp-photo-album-plus').'&rsaquo;';
387
$result = str_replace( 'w#'.$keyword, $replacement, $result );
3
* Package: wp-photo-album-plus
4
*
5
* Contains functions to retrieve album and photo items
6
+ * Version 7.3.09
7
*
8
*/
9
382
$replacement = __( trim( stripslashes( $thumb[$keyword] ) ) , 'wp-photo-album-plus');
383
if ( $keyword == 'tags' ) {
384
$replacement = trim( $replacement, ',' );
385
+
386
+ // Translated multilang tags may not be ucfirtsed
387
+ if ( $replacement ) {
388
+ $arr = explode( ',', $replacement );
389
+ foreach ( array_keys( $arr ) as $key ) {
390
+ $arr[$key] = ucfirst( $arr[$key] );
391
+ }
392
+ $replacement = implode( ',', $arr );
393
+ }
394
+
395
}
396
if ( $replacement == '' ) $replacement = '&lsaquo;'.__( 'none' , 'wp-photo-album-plus').'&rsaquo;';
397
$result = str_replace( 'w#'.$keyword, $replacement, $result );
wppa-links.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* Frontend links
6
- * Version 7.3.06
7
*/
8
9
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -11,6 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
11
// get permalink plus ? or & and possible debug switch
12
function wppa_get_permalink( $key = '', $plain = false ) {
13
global $wppa_lang;
14
15
if ( ! $key && is_search() ) $key = wppa_opt( 'search_linkpage' );
16
@@ -99,12 +100,18 @@ global $wppa_lang;
99
else $pl .= 'debug='.wppa( 'debug' ).'&amp;';
100
}
101
102
return $pl;
103
}
104
105
// Like get_permalink but for ajax use
106
function wppa_get_ajaxlink( $key = '', $deltamoccur = '0' ) {
107
global $wppa_lang;
108
109
if ( ! $key && is_search() ) $key = wppa_opt( 'search_linkpage' );
110
@@ -162,6 +169,11 @@ global $wppa_lang;
162
$al .= '&amp;debug=' . wppa( 'debug' );
163
}
164
165
return $al.'&amp;';
166
}
167
3
* Package: wp-photo-album-plus
4
*
5
* Frontend links
6
+ * Version 7.3.09
7
*/
8
9
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
11
// get permalink plus ? or & and possible debug switch
12
function wppa_get_permalink( $key = '', $plain = false ) {
13
global $wppa_lang;
14
+ global $wppa_locale;
15
16
if ( ! $key && is_search() ) $key = wppa_opt( 'search_linkpage' );
17
100
else $pl .= 'debug='.wppa( 'debug' ).'&amp;';
101
}
102
103
+ if ( wppa_opt( 'add_locale' ) ) {
104
+ if ( $key == 'js' ) $pl .= 'wppalocale=' . $wppa_locale . '&';
105
+ else $pl .= 'wppalocale=' . $wppa_locale . '&amp;';
106
+ }
107
+
108
return $pl;
109
}
110
111
// Like get_permalink but for ajax use
112
function wppa_get_ajaxlink( $key = '', $deltamoccur = '0' ) {
113
global $wppa_lang;
114
+ global $wppa_locale;
115
116
if ( ! $key && is_search() ) $key = wppa_opt( 'search_linkpage' );
117
169
$al .= '&amp;debug=' . wppa( 'debug' );
170
}
171
172
+ if ( wppa_opt( 'add_locale' ) ) {
173
+ if ( $key == 'js' ) $al .= '&wppalocale=' . $wppa_locale;
174
+ else $al .= '&amp;wppalocale=' . $wppa_locale;
175
+ }
176
+
177
return $al.'&amp;';
178
}
179
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* manage all options
6
- * Version 7.3.08
7
*
8
*/
9
@@ -6702,7 +6702,11 @@ global $wppa_supported_camara_brands;
6702
$html1 = wppa_select($slug1, $opts1, $vals1, $onchange);
6703
$clas = 'wppa_tglp';
6704
$onchange = '';
6705
- $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas);
6706
$clas = 'wppa_tglb';
6707
$html3 = wppa_checkbox($slug3, '', $clas);
6708
$html4 = '<div style="font-size:9px;foat:left;" class="'.$clas.'" >'.__('Occur', 'wp-photo-album-plus').'</div>'.wppa_select($slug4, $opts4, $vals4, '', $clas);
@@ -6736,7 +6740,11 @@ global $wppa_supported_camara_brands;
6736
$html1 = wppa_select($slug1, $opts1, $vals1, $onchange);
6737
$clas = 'wppa_tglp';
6738
$onchange = '';
6739
- $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas);
6740
$clas = 'wppa_tglb';
6741
$html3 = wppa_checkbox($slug3, '', $clas);
6742
$html4 = '<div style="font-size:9px;foat:left;" class="'.$clas.'" >'.__('Occur', 'wp-photo-album-plus').'</div>'.wppa_select($slug4, $opts4, $vals4, '', $clas);
@@ -7020,8 +7028,9 @@ global $wppa_supported_camara_brands;
7020
__('silver', 'wp-photo-album-plus'),
7021
__('gold', 'wp-photo-album-plus'),
7022
__('plus', 'wp-photo-album-plus'),
7023
);
7024
- $vals = array( 'none', 'bronze', 'silver', 'gold', 'plus' );
7025
7026
foreach (array_keys($roles) as $key) {
7027
$role = $roles[$key];
@@ -8370,8 +8379,8 @@ global $wppa_supported_camara_brands;
8370
$opts[] = $tag;
8371
$vals[] = $tag;
8372
}
8373
- $html1 = '<div><small style="float:left;margin-right:5px;" >'.__('Tag:', 'wp-photo-album-plus').'</small>'.wppa_select( $slug1, $opts, $vals ).'</div>';
8374
- $html2 = '<div style="clear:both" ><small style="float:left;margin-right:5px;" >'.__('Change to:', 'wp-photo-album-plus').'</small>'.wppa_edit( $slug2, trim( wppa_get_option( $slug2 ), ',' ), '100px' ).'</div>';
8375
$html3 = wppa_maintenance_button( $slug3 );
8376
$html4 = wppa_status_field( $slug3 );
8377
$html5 = wppa_togo_field( $slug3 );
@@ -8988,6 +8997,15 @@ global $wppa_supported_camara_brands;
8988
$tags = 'system';
8989
wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags);
8990
8991
}
8992
wppa_setting_subheader( 'B', '1', __( 'WPPA+ Admin related miscellaneous settings' , 'wp-photo-album-plus') );
8993
{
@@ -12455,8 +12473,8 @@ global $wppa_opt;
12455
return;
12456
}
12457
12458
- // A page number 0 is allowed ( same post/page )
12459
- if ( ! $wppa_opt[$xslug] ) {
12460
return;
12461
}
12462
3
* Package: wp-photo-album-plus
4
*
5
* manage all options
6
+ * Version 7.3.09
7
*
8
*/
9
6702
$html1 = wppa_select($slug1, $opts1, $vals1, $onchange);
6703
$clas = 'wppa_tglp';
6704
$onchange = '';
6705
+ $opts = $options_page_auto;
6706
+ $opts[] = __('--- the same page ---', 'wp-photo-album-plus');
6707
+ $vals = $values_page;
6708
+ $vals[] = '-1';
6709
+ $html2 = wppa_select($slug2, $opts, $vals, $onchange, $clas);
6710
$clas = 'wppa_tglb';
6711
$html3 = wppa_checkbox($slug3, '', $clas);
6712
$html4 = '<div style="font-size:9px;foat:left;" class="'.$clas.'" >'.__('Occur', 'wp-photo-album-plus').'</div>'.wppa_select($slug4, $opts4, $vals4, '', $clas);
6740
$html1 = wppa_select($slug1, $opts1, $vals1, $onchange);
6741
$clas = 'wppa_tglp';
6742
$onchange = '';
6743
+ $opts = $options_page_auto;
6744
+ $opts[] = __('--- the same page ---', 'wp-photo-album-plus');
6745
+ $vals = $values_page;
6746
+ $vals[] = '-1';
6747
+ $html2 = wppa_select($slug2, $opts, $vals, $onchange, $clas);
6748
$clas = 'wppa_tglb';
6749
$html3 = wppa_checkbox($slug3, '', $clas);
6750
$html4 = '<div style="font-size:9px;foat:left;" class="'.$clas.'" >'.__('Occur', 'wp-photo-album-plus').'</div>'.wppa_select($slug4, $opts4, $vals4, '', $clas);
7028
__('silver', 'wp-photo-album-plus'),
7029
__('gold', 'wp-photo-album-plus'),
7030
__('plus', 'wp-photo-album-plus'),
7031
+ __('basic', 'wp-photo-album-plus'),
7032
);
7033
+ $vals = array( 'none', 'bronze', 'silver', 'gold', 'plus', 'basic' );
7034
7035
foreach (array_keys($roles) as $key) {
7036
$role = $roles[$key];
8379
$opts[] = $tag;
8380
$vals[] = $tag;
8381
}
8382
+ $html1 = '<div><small style="float:left;margin-right:5px;" >'.__('Tag:', 'wp-photo-album-plus').'</small>'.wppa_select( $slug1, $opts, $vals, '', '', false, '', '600').'</div>';
8383
+ $html2 = '<div style="clear:both" ><small style="float:left;margin-right:5px;" >'.__('Change to:', 'wp-photo-album-plus').'</small>'.wppa_edit( $slug2, trim( wppa_get_option( $slug2 ), ',' ), '75%' ).'</div>';
8384
$html3 = wppa_maintenance_button( $slug3 );
8385
$html4 = wppa_status_field( $slug3 );
8386
$html5 = wppa_togo_field( $slug3 );
8997
$tags = 'system';
8998
wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags);
8999
9000
+ $name = __('Add locale', 'wp-photo-album-plus');
9001
+ $desc = __('Always add locale to links', 'wp-photo-album-plus');
9002
+ $help = __('You may need this setting if you use a multilanguage plugin not being qTranslate', 'wp-photo-album-plus');
9003
+ $slug = 'wppa_add_locale';
9004
+ $html = wppa_checkbox($slug);
9005
+ $clas = '';
9006
+ $tags = 'system';
9007
+ wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags);
9008
+
9009
}
9010
wppa_setting_subheader( 'B', '1', __( 'WPPA+ Admin related miscellaneous settings' , 'wp-photo-album-plus') );
9011
{
12473
return;
12474
}
12475
12476
+ // A page number 0 or -1 is allowed ( same post/page )
12477
+ if ( $wppa_opt[$xslug] == '0' || $wppa_opt[$xslug] == '-1' ) {
12478
return;
12479
}
12480
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* Contains all the setup stuff
6
- * Version 7.3.05
7
*
8
*/
9
@@ -787,33 +787,16 @@ function wppa_check_dirs() {
787
}
788
chmod( $dir, 0755 );
789
790
- // check if thumbs dir exists
791
- $dir = WPPA_UPLOAD_PATH . '/thumbs';
792
- if ( ! is_dir( $dir ) ) {
793
- mkdir( $dir );
794
- }
795
- chmod( $dir, 0755 );
796
-
797
- // check if watermarks dir exists
798
- $dir = WPPA_UPLOAD_PATH . '/watermarks';
799
- if ( ! is_dir( $dir ) ) {
800
- mkdir( $dir );
801
- }
802
- chmod( $dir, 0755 );
803
-
804
- // check if fonts dir exists
805
- $dir = WPPA_UPLOAD_PATH . '/fonts';
806
- if ( ! is_dir( $dir ) ) {
807
- mkdir( $dir );
808
- }
809
- chmod( $dir, 0755 );
810
811
- // The icons dir
812
- $dir = WPPA_UPLOAD_PATH . '/icons';
813
- if ( ! is_dir( $dir ) ) {
814
- mkdir( $dir );
815
}
816
- chmod( $dir, 0755 );
817
818
// check if depot dir exists
819
if ( ! is_multisite() ) {
@@ -833,13 +816,6 @@ function wppa_check_dirs() {
833
}
834
chmod( $dir, 0755 );
835
836
- // check the temp dir
837
- $dir = WPPA_UPLOAD_PATH . '/temp/';
838
- if ( ! is_dir( $dir ) ) {
839
- mkdir( $dir );
840
- }
841
- chmod( $dir, 0755 );
842
-
843
return true;
844
}
845
3
* Package: wp-photo-album-plus
4
*
5
* Contains all the setup stuff
6
+ * Version 7.3.09
7
*
8
*/
9
787
}
788
chmod( $dir, 0755 );
789
790
+ $subdirs = array( 'thumbs', 'watermarks', 'fonts', 'icons', 'temp', 'dynamic' );
791
792
+ // Check all subdirs
793
+ foreach( $subdirs as $subdir ) {
794
+ $dir = WPPA_UPLOAD_PATH . '/' . $subdir;
795
+ if ( ! is_dir( $dir ) ) {
796
+ mkdir( $dir );
797
+ }
798
+ chmod( $dir, 0755 );
799
}
800
801
// check if depot dir exists
802
if ( ! is_multisite() ) {
816
}
817
chmod( $dir, 0755 );
818
819
return true;
820
}
821
wppa-upload-widget.php CHANGED
@@ -4,7 +4,7 @@
4
*
5
* A wppa widget to upload photos
6
*
7
- * Version 7.3.03
8
*/
9
10
class WppaUploadWidget extends WP_Widget {
@@ -33,6 +33,11 @@ class WppaUploadWidget extends WP_Widget {
33
return;
34
}
35
36
// Cache?
37
if ( $cache ) {
38
4
*
5
* A wppa widget to upload photos
6
*
7
+ * Version 7.3.09
8
*/
9
10
class WppaUploadWidget extends WP_Widget {
33
return;
34
}
35
36
+ // Restricted user?
37
+ if ( wppa_user_is_basic() ) {
38
+ return;
39
+ }
40
+
41
// Cache?
42
if ( $cache ) {
43
wppa-users.php CHANGED
@@ -286,6 +286,9 @@ function wppa_may_user_fe_edit( $id ) {
286
// Superuser?
287
if ( wppa_is_user_superuser() ) return true;
288
289
// Can edit albums?
290
if ( current_user_can( 'wppa_admin' ) ) return true;
291
@@ -321,6 +324,9 @@ function wppa_may_user_fe_delete( $id ) {
321
// Superuser?
322
if ( wppa_is_user_superuser() ) return true;
323
324
// Can edit albums?
325
if ( current_user_can( 'wppa_admin' ) ) return true;
326
@@ -523,6 +529,34 @@ global $wp_roles;
523
return 'none';
524
}
525
526
// Get the html for the premium medal
527
function wppa_get_premium_html( $userid ) {
528
286
// Superuser?
287
if ( wppa_is_user_superuser() ) return true;
288
289
+ // Basic user?
290
+ if ( wppa_user_is_basic() ) return false;
291
+
292
// Can edit albums?
293
if ( current_user_can( 'wppa_admin' ) ) return true;
294
324
// Superuser?
325
if ( wppa_is_user_superuser() ) return true;
326
327
+ // Basic user?
328
+ if ( wppa_user_is_basic() ) return false;
329
+
330
// Can edit albums?
331
if ( current_user_can( 'wppa_admin' ) ) return true;
332
529
return 'none';
530
}
531
532
+ // Is current user basic level?
533
+ function wppa_user_is_basic() {
534
+ global $wp_roles;
535
+
536
+ // Admin and super can not be basic
537
+ if ( wppa_user_is( 'administrator' ) ) {
538
+ return false;
539
+ }
540
+
541
+ $roles = $wp_roles->roles;
542
+
543
+ foreach ( array_keys( $roles ) as $role ) {
544
+
545
+ // Find roles the user has
546
+ if ( current_user_can( $role ) ) {
547
+
548
+ // Is this role limited to basic?
549
+ $medal = get_option( 'wppa_medal-' . $role, 'none' );
550
+ if ( $medal == 'basic' ) {
551
+ return true;
552
+ }
553
+ }
554
+ }
555
+
556
+ // No basic userrole found for the current user
557
+ return false;
558
+ }
559
+
560
// Get the html for the premium medal
561
function wppa_get_premium_html( $userid ) {
562
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
* Package: wp-photo-album-plus
4
*
5
* Contains low-level utility routines
6
- * Version 7.3.08
7
*
8
*/
9
@@ -1279,8 +1279,16 @@ global $wpdb;
1279
}
1280
}
1281
1282
- // If still a photo with the same name exists in the original album, do not delete tge source
1283
- $still_exists = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE filename = %s AND album = %s", $photoinfo['filename'], $album ) );
1284
if ( ! $still_exists ) {
1285
1286
// Delete sourcefile
@@ -1815,8 +1823,8 @@ function wppa_get_the_landing_page( $slug, $title ) {
1815
1816
$page = wppa_opt( $slug );
1817
1818
- if ( ! $page || ! wppa_page_exists( $page ) ) {
1819
- $page = wppa_create_page( $title );
1820
wppa_update_option( 'wppa_' . $slug, $page );
1821
wppa_opt( $slug, $page );
1822
}
3
* Package: wp-photo-album-plus
4
*
5
* Contains low-level utility routines
6
+ * Version 7.3.09
7
*
8
*/
9
1279
}
1280
}
1281
1282
+ // If still a photo with the same name exists in the original album, do not delete the source
1283
+ $still_exists = $wpdb->get_var( $wpdb->prepare(
1284
+ "SELECT COUNT(*) FROM $wpdb->wppa_photos
1285
+ WHERE ( filename = %s OR filename = %s )
1286
+ AND album = %s",
1287
+ $photoinfo['filename'],
1288
+ wppa_strip_ext( $photoinfo['filename'] ) . '.xxx', // May be a multimedia iten
1289
+ $album
1290
+ ) );
1291
+
1292
if ( ! $still_exists ) {
1293
1294
// Delete sourcefile
1823
1824
$page = wppa_opt( $slug );
1825
1826
+ if ( $page != '-1' && ( ! $page || ! wppa_page_exists( $page ) ) ) {
1827
+ $page = wppa_create_page( $title );
1828
wppa_update_option( 'wppa_' . $slug, $page );
1829
wppa_opt( $slug, $page );
1830
}
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.3.08.006
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/
@@ -23,8 +23,8 @@ global $wpdb;
23
global $wp_version;
24
25
/* WPPA GLOBALS */
26
- global $wppa_revno; $wppa_revno = '7308'; // WPPA db version
27
- global $wppa_api_version; $wppa_api_version = '7.3.08.006'; // WPPA software version
28
29
/* Init page js data */
30
global $wppa_js_page_data; $wppa_js_page_data = '';
@@ -150,6 +150,9 @@ add_action( 'init', 'wppa_init_path_and_url_constants', 1 );
150
/* Load language */
151
add_action( 'plugins_loaded', 'wppa_load_plugin_textdomain' );
152
153
/* SET UP array $wppa, array $wppa_opt. Must be done after language has been set */
154
//add_action( 'init', 'wppa_initialize_runtime', 11 );
155
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.3.09.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/
23
global $wp_version;
24
25
/* WPPA GLOBALS */
26
+ global $wppa_revno; $wppa_revno = '7309'; // WPPA db version
27
+ global $wppa_api_version; $wppa_api_version = '7.3.09.005'; // WPPA software version
28
29
/* Init page js data */
30
global $wppa_js_page_data; $wppa_js_page_data = '';
150
/* Load language */
151
add_action( 'plugins_loaded', 'wppa_load_plugin_textdomain' );
152
153
+ /* May not be there yet, so try again */
154
+ add_action( 'init', 'wppa_load_plugin_textdomain', 20 );
155
+
156
/* SET UP array $wppa, array $wppa_opt. Must be done after language has been set */
157
//add_action( 'init', 'wppa_initialize_runtime', 11 );
158