Version Description
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 6.8.03 |
Comparing to | |
See all releases |
Code changes from version 6.8.02 to 6.8.03
- readme.txt +20 -3
- wppa-admin.php +83 -5
- wppa-album-admin-autosave.php +18 -27
- wppa-boxes-html.php +7 -1
- wppa-common-functions.php +8 -1
- wppa-cron.php +5 -5
- wppa-exif-iptc-common.php +20 -10
- wppa-functions.php +4 -1
- wppa-photo-admin-autosave.php +28 -16
- wppa-potd-admin.php +17 -1
- wppa-setup.php +14 -10
- wppa-widget-functions.php +34 -1
- wppa.php +3 -3
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
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¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
-
Version: 6.8.
|
6 |
-
Stable tag: 6.8.
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -127,6 +127,23 @@ If this happens, make sure (ask your hosting provider) that you have all the rig
|
|
127 |
|
128 |
See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
= 6.8.02 =
|
131 |
|
132 |
= Bug Fixes =
|
@@ -136,7 +153,7 @@ This happened when there were two or more photos with the same name in an album
|
|
136 |
This also happened when a photo was deleted and re-uploaded before the background process actually removed the files of the deleted photo.
|
137 |
This issue has been fixed.
|
138 |
* w#hrurl and w#pl in photo descriptions got wrong results when the filename contained spaces or brackets. Fixed.
|
139 |
-
* Fixes for compatibility with plugin Simple Cart & By Now. This plugin is not maintained for over three years.
|
140 |
If you update to wppa version 6.8.02 and use SCABN, you MUST install the special - fixed - version to maintain compatibility.
|
141 |
|
142 |
= New Features =
|
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¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
+
Version: 6.8.03
|
6 |
+
Stable tag: 6.8.02
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
127 |
|
128 |
See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
129 |
|
130 |
+
= 6.8.03 =
|
131 |
+
|
132 |
+
= Bug Fixes =
|
133 |
+
|
134 |
+
* Due to a left-over from testing, switching to flat album table did no longer work. Fixed.
|
135 |
+
* On the album admin page: if the album is full, two - inactive - upload/import buttons were displayed. Fixed.
|
136 |
+
* On the photo admin screen: the caption of the exif table was not translatable. Fixed.
|
137 |
+
|
138 |
+
= New Features =
|
139 |
+
|
140 |
+
* You can keep a history log of the photo of the day. See the photo of the day admin page. It will show up at the admin dashboard.
|
141 |
+
|
142 |
+
= Other Changes =
|
143 |
+
|
144 |
+
* If the default photo description (Table IX-D5) contains HTML code, it will no longer be shown on the frontend upload dialog.
|
145 |
+
* Wppa will no longer crash the sites admin at activation time when the PHP EXIF functions are not activated.
|
146 |
+
|
147 |
= 6.8.02 =
|
148 |
|
149 |
= Bug Fixes =
|
153 |
This also happened when a photo was deleted and re-uploaded before the background process actually removed the files of the deleted photo.
|
154 |
This issue has been fixed.
|
155 |
* w#hrurl and w#pl in photo descriptions got wrong results when the filename contained spaces or brackets. Fixed.
|
156 |
+
* Fixes for compatibility with plugin Simple Cart & By Now. This plugin is not maintained for over three years.
|
157 |
If you update to wppa version 6.8.02 and use SCABN, you MUST install the special - fixed - version to maintain compatibility.
|
158 |
|
159 |
= New Features =
|
wppa-admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
-
* Version 6.8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -230,14 +230,21 @@ global $wpdb;
|
|
230 |
// Recently uploaded photos
|
231 |
echo '<h3>' . __( 'Recently uploaded photos', 'wp-photo-album-plus' ) . '</h3>';
|
232 |
$photos = $wpdb->get_results( "SELECT * FROM `" . WPPA_PHOTOS . "` ORDER BY `timestamp` DESC LIMIT 5", ARRAY_A );
|
|
|
233 |
if ( ! empty( $photos ) ) {
|
234 |
echo
|
235 |
'<table>';
|
236 |
foreach( $photos as $photo ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
echo
|
238 |
'<tr>' .
|
239 |
'<td>' .
|
240 |
-
'<a href="' .
|
241 |
'<img src="' . wppa_get_thumb_url( $photo['id'] ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
242 |
'</a>' .
|
243 |
'</td>' .
|
@@ -257,7 +264,7 @@ global $wpdb;
|
|
257 |
'<br />' .
|
258 |
wppa_local_date( '', $photo['timestamp'] ) .
|
259 |
'</td>' .
|
260 |
-
'</tr
|
261 |
}
|
262 |
echo
|
263 |
'</table>';
|
@@ -274,14 +281,21 @@ global $wpdb;
|
|
274 |
echo '<h3>' . __( 'Recent comments on photos', 'wp-photo-album-plus' ) . '</h3>';
|
275 |
$comments = $wpdb->get_results( "SELECT * FROM `" . WPPA_COMMENTS . "` ORDER BY `timestamp` DESC LIMIT 5", ARRAY_A );
|
276 |
if ( ! empty( $comments ) ) {
|
|
|
277 |
echo
|
278 |
'<table>';
|
279 |
foreach( $comments as $comment ) {
|
280 |
$photo = wppa_cache_photo( $comment['photo'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
echo
|
282 |
'<tr>' .
|
283 |
'<td>' .
|
284 |
-
'<a href="' .
|
285 |
'<img src="' . wppa_get_thumb_url( $photo['id'] ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
286 |
'</a>' .
|
287 |
'</td>' .
|
@@ -299,7 +313,7 @@ global $wpdb;
|
|
299 |
sprintf( __( 'by %s', 'wp-photo-album-plus' ),
|
300 |
'<b>' . $usr . '</b>' ) .
|
301 |
'<br />' .
|
302 |
-
wppa_local_date( '', $
|
303 |
'</td>' .
|
304 |
'</tr>';
|
305 |
}
|
@@ -313,4 +327,68 @@ global $wpdb;
|
|
313 |
'</p>';
|
314 |
}
|
315 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
+
* Version 6.8.03
|
7 |
*
|
8 |
*/
|
9 |
|
230 |
// Recently uploaded photos
|
231 |
echo '<h3>' . __( 'Recently uploaded photos', 'wp-photo-album-plus' ) . '</h3>';
|
232 |
$photos = $wpdb->get_results( "SELECT * FROM `" . WPPA_PHOTOS . "` ORDER BY `timestamp` DESC LIMIT 5", ARRAY_A );
|
233 |
+
|
234 |
if ( ! empty( $photos ) ) {
|
235 |
echo
|
236 |
'<table>';
|
237 |
foreach( $photos as $photo ) {
|
238 |
+
if ( wppa_user_is( 'administrator' ) ) {
|
239 |
+
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
240 |
+
}
|
241 |
+
else {
|
242 |
+
$href = wppa_get_photo_url( $photo['id'] );
|
243 |
+
}
|
244 |
echo
|
245 |
'<tr>' .
|
246 |
'<td>' .
|
247 |
+
'<a href="' . $href . '" target="_blank" >' .
|
248 |
'<img src="' . wppa_get_thumb_url( $photo['id'] ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
249 |
'</a>' .
|
250 |
'</td>' .
|
264 |
'<br />' .
|
265 |
wppa_local_date( '', $photo['timestamp'] ) .
|
266 |
'</td>' .
|
267 |
+
'</tr>';
|
268 |
}
|
269 |
echo
|
270 |
'</table>';
|
281 |
echo '<h3>' . __( 'Recent comments on photos', 'wp-photo-album-plus' ) . '</h3>';
|
282 |
$comments = $wpdb->get_results( "SELECT * FROM `" . WPPA_COMMENTS . "` ORDER BY `timestamp` DESC LIMIT 5", ARRAY_A );
|
283 |
if ( ! empty( $comments ) ) {
|
284 |
+
|
285 |
echo
|
286 |
'<table>';
|
287 |
foreach( $comments as $comment ) {
|
288 |
$photo = wppa_cache_photo( $comment['photo'] );
|
289 |
+
if ( wppa_user_is( 'administrator' ) ) {
|
290 |
+
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
291 |
+
}
|
292 |
+
else {
|
293 |
+
$href = wppa_get_photo_url( $photo['id'] );
|
294 |
+
}
|
295 |
echo
|
296 |
'<tr>' .
|
297 |
'<td>' .
|
298 |
+
'<a href="' . $href . '" target="_blank" >' .
|
299 |
'<img src="' . wppa_get_thumb_url( $photo['id'] ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
300 |
'</a>' .
|
301 |
'</td>' .
|
313 |
sprintf( __( 'by %s', 'wp-photo-album-plus' ),
|
314 |
'<b>' . $usr . '</b>' ) .
|
315 |
'<br />' .
|
316 |
+
wppa_local_date( '', $comment['timestamp'] ) .
|
317 |
'</td>' .
|
318 |
'</tr>';
|
319 |
}
|
327 |
'</p>';
|
328 |
}
|
329 |
|
330 |
+
}
|
331 |
+
|
332 |
+
// Photo of the day history
|
333 |
+
if ( get_option( 'wppa_potd_log', 'no' ) == 'yes' ) {
|
334 |
+
add_action( 'do_meta_boxes', 'wppa_potdlog' );
|
335 |
+
}
|
336 |
+
function wppa_potdlog() {
|
337 |
+
if ( function_exists( 'wp_add_dashboard_widget' ) ) {
|
338 |
+
wp_add_dashboard_widget( 'wppa-potdlog', __( 'Photo of the day history', 'wp-photo-album-plus' ), 'wppa_show_potd_log' );
|
339 |
+
}
|
340 |
+
}
|
341 |
+
function wppa_show_potd_log() {
|
342 |
+
|
343 |
+
// Get data
|
344 |
+
$his = get_option( 'wppa_potd_log_data', array() );
|
345 |
+
if ( ! empty( $his ) ) {
|
346 |
+
echo
|
347 |
+
'<table>';
|
348 |
+
foreach( $his as $item ) {
|
349 |
+
if ( wppa_photo_exists( $item['id'] ) ) {
|
350 |
+
$photo = wppa_cache_photo( $item['id'] );
|
351 |
+
$time = $item['tm'];
|
352 |
+
if ( wppa_user_is( 'administrator' ) ) {
|
353 |
+
$href = get_admin_url() . 'admin.php?page=wppa_moderate_photos&photo=' . $photo['id'] . '&just-edit';
|
354 |
+
}
|
355 |
+
else {
|
356 |
+
$href = wppa_get_photo_url( $photo['id'] );
|
357 |
+
}
|
358 |
+
echo
|
359 |
+
'<tr style="border-bottom:1px solid #444;" >' .
|
360 |
+
'<td>' .
|
361 |
+
'<a href="' . $href . '" target="_blank" >' .
|
362 |
+
'<img src="' . wppa_get_thumb_url( $photo['id'] ) . '" style="max-width:50px;max-height:50px;" /> ' .
|
363 |
+
'</a>' .
|
364 |
+
'</td>' .
|
365 |
+
'<td>' .
|
366 |
+
__( 'First displayed at', 'wp-photo-album-plus' ) . ': ' . wppa_local_date( '', $time ) . '<br />' .
|
367 |
+
__( 'Name', 'wp-photo-album-plus' ) . ': ' . wppa_get_photo_name( $photo['id'] ) . '<br />' .
|
368 |
+
__( 'Description', 'wp-photo-album-plus' ) . ':<br />' .
|
369 |
+
wppa_get_photo_desc( $photo['id'] ) .
|
370 |
+
'</td>' .
|
371 |
+
'</tr>';
|
372 |
+
}
|
373 |
+
else {
|
374 |
+
echo
|
375 |
+
'<tr style="border-bottom:1px solid #444;" >' .
|
376 |
+
'<td>' .
|
377 |
+
sprintf( __( 'Photo %d has been removed' ), $item['id'] ) .
|
378 |
+
'</td>' .
|
379 |
+
'<td>' .
|
380 |
+
__( 'First displayed at', 'wp-photo-album-plus' ) . ': ' . wppa_local_date( '', $item['tm'] ) . '<br />' .
|
381 |
+
'</td>' .
|
382 |
+
'</tr>';
|
383 |
+
}
|
384 |
+
}
|
385 |
+
echo
|
386 |
+
'</table>';
|
387 |
+
}
|
388 |
+
else {
|
389 |
+
echo
|
390 |
+
'<p>' .
|
391 |
+
__( 'There is no photo of the day history', 'wp-photo-album-plus' ) .
|
392 |
+
'</p>';
|
393 |
+
}
|
394 |
}
|
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 6.8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1098,22 +1098,24 @@ function wppaTryScheduleAll( id ) {
|
|
1098 |
' />';
|
1099 |
}
|
1100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1101 |
// Goto Upload
|
1102 |
if ( current_user_can( 'wppa_upload' ) ) {
|
1103 |
-
|
1104 |
-
if ( $a ) {
|
1105 |
-
$full = false;
|
1106 |
-
}
|
1107 |
-
else {
|
1108 |
-
$full = true;
|
1109 |
-
}
|
1110 |
$onc = ( $full ?
|
1111 |
'alert(\''.__('Change the upload limit or remove photos to enable new uploads.', 'wp-photo-album-plus').'\')' :
|
1112 |
'document.location = \''.wppa_dbg_url(get_admin_url()).'/admin.php?page=wppa_upload_photos&wppa-set-album='.$id.'\''
|
1113 |
);
|
1114 |
$val = ( $full ?
|
1115 |
__( 'Album is full', 'wp-photo-album-plus' ) :
|
1116 |
-
__( 'Upload to this album', 'wp-photo-album-plus' ) .
|
1117 |
);
|
1118 |
echo
|
1119 |
'<input' .
|
@@ -1124,22 +1126,10 @@ function wppaTryScheduleAll( id ) {
|
|
1124 |
}
|
1125 |
|
1126 |
// Goto Import
|
1127 |
-
if ( current_user_can( 'wppa_import' ) ) {
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
}
|
1132 |
-
else {
|
1133 |
-
$full = true;
|
1134 |
-
}
|
1135 |
-
$onc = ( $full ?
|
1136 |
-
'alert(\''.__('Change the upload limit or remove photos to enable new imports.', 'wp-photo-album-plus').'\')' :
|
1137 |
-
'document.location = \''.wppa_dbg_url(get_admin_url()).'/admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\''
|
1138 |
-
);
|
1139 |
-
$val = ( $full ?
|
1140 |
-
__( 'Album is full', 'wp-photo-album-plus' ) :
|
1141 |
-
__( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' )
|
1142 |
-
);
|
1143 |
echo
|
1144 |
'<input' .
|
1145 |
' type="button"' .
|
@@ -1289,11 +1279,12 @@ function wppaTryScheduleAll( id ) {
|
|
1289 |
}
|
1290 |
|
1291 |
if ( wppa_extended_access() ) {
|
1292 |
-
if ( isset($_REQUEST['switchto']
|
|
|
|
|
1293 |
$style = get_option('wppa_album_table_'.wppa_get_user(), 'flat');
|
1294 |
}
|
1295 |
else $style = 'flat';
|
1296 |
-
$style='tree'; // debug
|
1297 |
// The Manage Album page
|
1298 |
?>
|
1299 |
<div class="wrap">
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* create, edit and delete albums
|
6 |
+
* Version 6.8.03
|
7 |
*
|
8 |
*/
|
9 |
|
1098 |
' />';
|
1099 |
}
|
1100 |
|
1101 |
+
$a = wppa_allow_uploads( $id );
|
1102 |
+
if ( $a ) {
|
1103 |
+
$full = false;
|
1104 |
+
}
|
1105 |
+
else {
|
1106 |
+
$full = true;
|
1107 |
+
}
|
1108 |
+
|
1109 |
// Goto Upload
|
1110 |
if ( current_user_can( 'wppa_upload' ) ) {
|
1111 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
1112 |
$onc = ( $full ?
|
1113 |
'alert(\''.__('Change the upload limit or remove photos to enable new uploads.', 'wp-photo-album-plus').'\')' :
|
1114 |
'document.location = \''.wppa_dbg_url(get_admin_url()).'/admin.php?page=wppa_upload_photos&wppa-set-album='.$id.'\''
|
1115 |
);
|
1116 |
$val = ( $full ?
|
1117 |
__( 'Album is full', 'wp-photo-album-plus' ) :
|
1118 |
+
__( 'Upload to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' )
|
1119 |
);
|
1120 |
echo
|
1121 |
'<input' .
|
1126 |
}
|
1127 |
|
1128 |
// Goto Import
|
1129 |
+
if ( current_user_can( 'wppa_import' ) && ! $full ) {
|
1130 |
+
|
1131 |
+
$onc = 'document.location = \''.wppa_dbg_url(get_admin_url()).'/admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\'';
|
1132 |
+
$val = __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1133 |
echo
|
1134 |
'<input' .
|
1135 |
' type="button"' .
|
1279 |
}
|
1280 |
|
1281 |
if ( wppa_extended_access() ) {
|
1282 |
+
if ( isset($_REQUEST['switchto'] ) ) {
|
1283 |
+
update_option( 'wppa_album_table_'.wppa_get_user(), $_REQUEST['switchto'] );
|
1284 |
+
}
|
1285 |
$style = get_option('wppa_album_table_'.wppa_get_user(), 'flat');
|
1286 |
}
|
1287 |
else $style = 'flat';
|
|
|
1288 |
// The Manage Album page
|
1289 |
?>
|
1290 |
<div class="wrap">
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 6.8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -2920,6 +2920,12 @@ static $albums_granted;
|
|
2920 |
$head .= '<sup style="color:red;" >*</sup>';
|
2921 |
}
|
2922 |
$desc = wppa_switch( 'apply_newphoto_desc_user' ) ? stripslashes( wppa_opt( 'newphoto_description' ) ) : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
2923 |
$body =
|
2924 |
'<textarea' .
|
2925 |
' id="wppa-desc-user-' . $mocc . '-' . $seqno . '"' .
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 6.8.03
|
7 |
*
|
8 |
*/
|
9 |
|
2920 |
$head .= '<sup style="color:red;" >*</sup>';
|
2921 |
}
|
2922 |
$desc = wppa_switch( 'apply_newphoto_desc_user' ) ? stripslashes( wppa_opt( 'newphoto_description' ) ) : '';
|
2923 |
+
|
2924 |
+
// Do NOT show newphoto des if it contains html
|
2925 |
+
if ( $desc != strip_tags( $desc ) ) {
|
2926 |
+
$desc = '';
|
2927 |
+
}
|
2928 |
+
|
2929 |
$body =
|
2930 |
'<textarea' .
|
2931 |
' id="wppa-desc-user-' . $mocc . '-' . $seqno . '"' .
|
wppa-common-functions.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-common-functions.php
|
3 |
*
|
4 |
* Functions used in admin and in themes
|
5 |
-
* Version 6.8.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -995,6 +995,11 @@ global $wppa;
|
|
995 |
// Return the allowed number to upload in an album. -1 = unlimited ( the limit on the album info screen, possibly set by Table IX-D6 )
|
996 |
function wppa_allow_uploads( $alb = '0' ) {
|
997 |
global $wpdb;
|
|
|
|
|
|
|
|
|
|
|
998 |
|
999 |
if ( ! $alb ) return '-1';//'0';
|
1000 |
|
@@ -1020,6 +1025,8 @@ global $wpdb;
|
|
1020 |
if ( $curcount >= $limit_max ) $result = '0'; // No more allowed
|
1021 |
else $result = $limit_max - $curcount;
|
1022 |
|
|
|
|
|
1023 |
return $result;
|
1024 |
}
|
1025 |
|
2 |
/* wppa-common-functions.php
|
3 |
*
|
4 |
* Functions used in admin and in themes
|
5 |
+
* Version 6.8.03
|
6 |
*
|
7 |
*/
|
8 |
|
995 |
// Return the allowed number to upload in an album. -1 = unlimited ( the limit on the album info screen, possibly set by Table IX-D6 )
|
996 |
function wppa_allow_uploads( $alb = '0' ) {
|
997 |
global $wpdb;
|
998 |
+
static $result_cache;
|
999 |
+
|
1000 |
+
if ( isset( $result_cache[$alb] ) ) {
|
1001 |
+
return $result_cache[$alb];
|
1002 |
+
}
|
1003 |
|
1004 |
if ( ! $alb ) return '-1';//'0';
|
1005 |
|
1025 |
if ( $curcount >= $limit_max ) $result = '0'; // No more allowed
|
1026 |
else $result = $limit_max - $curcount;
|
1027 |
|
1028 |
+
$result_cache[$alb] = $result;
|
1029 |
+
|
1030 |
return $result;
|
1031 |
}
|
1032 |
|
wppa-cron.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all cron functions
|
6 |
-
* Version 6.8.
|
7 |
*
|
8 |
*
|
9 |
*/
|
@@ -38,11 +38,11 @@ global $is_reschedule;
|
|
38 |
$delay = 5;
|
39 |
}
|
40 |
else switch ( $slug ) {
|
41 |
-
case 'wppa_remake_index_photos': // one
|
42 |
-
$delay =
|
43 |
break;
|
44 |
-
case 'wppa_cleanup_index': //
|
45 |
-
$delay =
|
46 |
break;
|
47 |
default:
|
48 |
$delay = 30; // 30 sec.
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all cron functions
|
6 |
+
* Version 6.8.03
|
7 |
*
|
8 |
*
|
9 |
*/
|
38 |
$delay = 5;
|
39 |
}
|
40 |
else switch ( $slug ) {
|
41 |
+
case 'wppa_remake_index_photos': // one minute
|
42 |
+
$delay = 60;
|
43 |
break;
|
44 |
+
case 'wppa_cleanup_index': // 1 hour
|
45 |
+
$delay = 3600;
|
46 |
break;
|
47 |
default:
|
48 |
$delay = 30; // 30 sec.
|
wppa-exif-iptc-common.php
CHANGED
@@ -3324,14 +3324,19 @@ static $wppa_inv_filetags;
|
|
3324 |
|
3325 |
// Setup inverted matrix standard tags
|
3326 |
if ( ! is_array( $wppa_inv_exiftags ) ) {
|
3327 |
-
|
3328 |
-
|
3329 |
-
|
3330 |
-
|
3331 |
-
$
|
|
|
|
|
|
|
|
|
3332 |
}
|
3333 |
-
|
3334 |
-
|
|
|
3335 |
}
|
3336 |
}
|
3337 |
|
@@ -4247,10 +4252,15 @@ if ( strlen($tag) != 6 ) {
|
|
4247 |
|
4248 |
// Not found? Find generic tag name
|
4249 |
if ( ! $result ) {
|
4250 |
-
$hextag = hexdec( substr( $tag, 2,4 ) );
|
4251 |
-
|
|
|
|
|
|
|
|
|
|
|
4252 |
if ( ! $result ) {
|
4253 |
-
// wppa_log( 'dbg', 'exif_tagname found nothing for ' . $tag );
|
4254 |
$result = sprintf( 'UndefinedTag:0x%04X', $hextag );
|
4255 |
}
|
4256 |
}
|
3324 |
|
3325 |
// Setup inverted matrix standard tags
|
3326 |
if ( ! is_array( $wppa_inv_exiftags ) ) {
|
3327 |
+
if ( function_exists( 'exif_tagname' ) ) {
|
3328 |
+
$key = 0;
|
3329 |
+
while ( $key < 65536 ) {
|
3330 |
+
$tag = @ exif_tagname( $key );
|
3331 |
+
if ( $tag != '' ) {
|
3332 |
+
$wppa_inv_exiftags[$tag] = $key;
|
3333 |
+
}
|
3334 |
+
$key++;
|
3335 |
+
if ( ! $key ) break; // 16 bit server wrap around ( do they still exist??? )
|
3336 |
}
|
3337 |
+
}
|
3338 |
+
else {
|
3339 |
+
$wppa_inv_exiftags = array();
|
3340 |
}
|
3341 |
}
|
3342 |
|
4252 |
|
4253 |
// Not found? Find generic tag name
|
4254 |
if ( ! $result ) {
|
4255 |
+
$hextag = hexdec( substr( $tag, 2, 4 ) );
|
4256 |
+
if ( function_exists( 'exif_tagname' ) ) {
|
4257 |
+
$result = @ exif_tagname( $hextag );
|
4258 |
+
}
|
4259 |
+
else {
|
4260 |
+
$result = '';
|
4261 |
+
}
|
4262 |
if ( ! $result ) {
|
4263 |
+
// wppa_log( 'dbg', 'exif_tagname found nothing for ' . $tag, true );
|
4264 |
$result = sprintf( 'UndefinedTag:0x%04X', $hextag );
|
4265 |
}
|
4266 |
}
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
-
* Version 6.8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -4797,6 +4797,9 @@ global $wppa_alert;
|
|
4797 |
// Sanitize input
|
4798 |
$name = wppa_sanitize_photo_name( $name );
|
4799 |
$desc = balanceTags( wppa_get_post( 'user-desc' ), true );
|
|
|
|
|
|
|
4800 |
|
4801 |
// If BlogIt! and no descrption given, use name field - this is for the shortcode used: typ"mphoto"
|
4802 |
if ( ! $desc && isset( $_POST['wppa-blogit'] ) ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
+
* Version 6.8.03
|
7 |
*
|
8 |
*/
|
9 |
|
4797 |
// Sanitize input
|
4798 |
$name = wppa_sanitize_photo_name( $name );
|
4799 |
$desc = balanceTags( wppa_get_post( 'user-desc' ), true );
|
4800 |
+
if ( ! $desc && wppa_switch( 'apply_newphoto_desc' ) ) {
|
4801 |
+
$desc = wppa_opt( 'newphoto_description' );
|
4802 |
+
}
|
4803 |
|
4804 |
// If BlogIt! and no descrption given, use name field - this is for the shortcode used: typ"mphoto"
|
4805 |
if ( ! $desc && isset( $_POST['wppa-blogit'] ) ) {
|
wppa-photo-admin-autosave.php
CHANGED
@@ -53,18 +53,30 @@ function _wppa_moderate_photos() {
|
|
53 |
$photo = $_GET['photo'];
|
54 |
}
|
55 |
else $photo = '';
|
|
|
|
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
'<
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
'</div>';
|
|
|
68 |
}
|
69 |
|
70 |
// The photo edit list. Also used in wppa-album-admin-autosave.php
|
@@ -558,7 +570,7 @@ function wppaToggleExif( id, count ) {
|
|
558 |
'botlft' => __( 'bottom - left' , 'wp-photo-album-plus'), 'botcen' => __( 'bottom - center' , 'wp-photo-album-plus'), 'botrht' => __( 'bottom - right' , 'wp-photo-album-plus'), );
|
559 |
|
560 |
// Album for moderate
|
561 |
-
if ( $modalbum != $album ) {
|
562 |
echo '<h3>' . sprintf( __( 'Edit/Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
|
563 |
'<i>' . wppa_get_album_name( $album ) . '</i>',
|
564 |
'<i>' . wppa_get_album_item( $album, 'owner' ) . '</i>' ) . '</h3>';
|
@@ -2052,11 +2064,11 @@ function wppaToggleExif( id, count ) {
|
|
2052 |
' >' .
|
2053 |
'<thead>' .
|
2054 |
'<tr style="font-weight:bold;" >' .
|
2055 |
-
'<td style="padding:0 4px;" >Exif tag</td>' .
|
2056 |
-
'<td style="padding:0 4px;" >Brand</td>' .
|
2057 |
-
'<td style="padding:0 4px;" >Description</td>' .
|
2058 |
-
'<td style="padding:0 4px;" >Raw value</td>' .
|
2059 |
-
'<td style="padding:0 4px;" >Formatted value</td>' .
|
2060 |
'</tr>' .
|
2061 |
'</thead>' .
|
2062 |
'<tbody>';
|
53 |
$photo = $_GET['photo'];
|
54 |
}
|
55 |
else $photo = '';
|
56 |
+
|
57 |
+
$just_edit = isset( $_GET['just-edit'] );
|
58 |
|
59 |
+
if ( $photo && $just_edit && wppa_user_is( 'administrator' ) ) {
|
60 |
+
echo
|
61 |
+
'<div class="wrap">' .
|
62 |
+
'<h2>' . __( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>';
|
63 |
+
wppa_album_photos( '', $photo, '', false );
|
64 |
+
echo
|
65 |
+
'</div>';
|
66 |
+
}
|
67 |
+
else {
|
68 |
+
echo
|
69 |
+
'<div class="wrap">' .
|
70 |
+
'<h2>' . __( 'Moderate photos' , 'wp-photo-album-plus') . '</h2>';
|
71 |
+
if ( wppa_switch( 'moderate_bulk' ) ) {
|
72 |
+
wppa_album_photos_bulk( 'moderate' );
|
73 |
+
}
|
74 |
+
else {
|
75 |
+
wppa_album_photos( '', $photo, '', true );
|
76 |
+
}
|
77 |
+
echo
|
78 |
'</div>';
|
79 |
+
}
|
80 |
}
|
81 |
|
82 |
// The photo edit list. Also used in wppa-album-admin-autosave.php
|
570 |
'botlft' => __( 'bottom - left' , 'wp-photo-album-plus'), 'botcen' => __( 'bottom - center' , 'wp-photo-album-plus'), 'botrht' => __( 'bottom - right' , 'wp-photo-album-plus'), );
|
571 |
|
572 |
// Album for moderate
|
573 |
+
if ( $modalbum != $album && ! isset( $_GET['just-edit'] ) ) {
|
574 |
echo '<h3>' . sprintf( __( 'Edit/Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
|
575 |
'<i>' . wppa_get_album_name( $album ) . '</i>',
|
576 |
'<i>' . wppa_get_album_item( $album, 'owner' ) . '</i>' ) . '</h3>';
|
2064 |
' >' .
|
2065 |
'<thead>' .
|
2066 |
'<tr style="font-weight:bold;" >' .
|
2067 |
+
'<td style="padding:0 4px;" >' . __( 'Exif tag', 'wp-photo-album-plus' ) . '</td>' .
|
2068 |
+
'<td style="padding:0 4px;" >' . __( 'Brand', 'wp-photo-album-plus' ) . '</td>' .
|
2069 |
+
'<td style="padding:0 4px;" >' . __( 'Description', 'wp-photo-album-plus' ) . '</td>' .
|
2070 |
+
'<td style="padding:0 4px;" >' . __( 'Raw value', 'wp-photo-album-plus' ) . '</td>' .
|
2071 |
+
'<td style="padding:0 4px;" >' . __( 'Formatted value', 'wp-photo-album-plus' ) . '</td>' .
|
2072 |
'</tr>' .
|
2073 |
'</thead>' .
|
2074 |
'<tbody>';
|
wppa-potd-admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
* admin photo of the day widget
|
6 |
-
* version 6.8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -346,6 +346,22 @@ global $wppa_defaults;
|
|
346 |
$html = wppa_checkbox($slug, $onch);
|
347 |
wppa_setting($slug, '13', $name, $desc, $html, $help);
|
348 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
// Cose table body
|
350 |
echo
|
351 |
'</tbody>';
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
* admin photo of the day widget
|
6 |
+
* version 6.8.03
|
7 |
*
|
8 |
*/
|
9 |
|
346 |
$html = wppa_checkbox($slug, $onch);
|
347 |
wppa_setting($slug, '13', $name, $desc, $html, $help);
|
348 |
|
349 |
+
$name = __('Log potd', 'wp-photo-album-plus');
|
350 |
+
$desc = __('Keep track of the potd history', 'wp-photo-album-plus');
|
351 |
+
$help = '';
|
352 |
+
$slug = 'wppa_potd_log';
|
353 |
+
$html = wppa_checkbox($slug);
|
354 |
+
wppa_setting($slug, '14', $name, $desc, $html, $help);
|
355 |
+
|
356 |
+
$name = __('Log potd max', 'wp-photo-album-plus');
|
357 |
+
$desc = __('Max length of the potd history (items)', 'wp-photo-album-plus');
|
358 |
+
$help = '';
|
359 |
+
$slug = 'wppa_potd_log_max';
|
360 |
+
$opts = array( '5', '10', '15', '20', '30', '50', '100' );
|
361 |
+
$html = wppa_select($slug, $opts, $opts);
|
362 |
+
wppa_setting($slug, '15', $name, $desc, $html, $help);
|
363 |
+
|
364 |
+
|
365 |
// Cose table body
|
366 |
echo
|
367 |
'</tbody>';
|
wppa-setup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
-
* Version 6.8.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -566,15 +566,17 @@ global $silent;
|
|
566 |
|
567 |
// Fix exiflables that were undefined so far but have a known description by now
|
568 |
if ( $old_rev <= '6801' ) {
|
569 |
-
|
570 |
-
|
571 |
-
$
|
572 |
-
|
573 |
-
|
574 |
-
|
|
|
|
|
575 |
}
|
|
|
576 |
}
|
577 |
-
wppa_schedule_maintenance_proc( 'wppa_recup' );
|
578 |
}
|
579 |
}
|
580 |
|
@@ -1805,11 +1807,13 @@ Hide Camera info
|
|
1805 |
'wppa_potd_include_subs' => 'no',
|
1806 |
'wppa_potd_status_filter' => 'none',
|
1807 |
'wppa_potd_inverse' => 'no',
|
1808 |
-
'wppa_potd_method'
|
1809 |
-
'wppa_potd_period'
|
1810 |
'wppa_potd_offset' => '0',
|
1811 |
'wppa_potd_photo' => '',
|
1812 |
'wppa_potd_preview' => 'no',
|
|
|
|
|
1813 |
|
1814 |
|
1815 |
'wppa_widget_width' => '200', // Do we use this somewhere still?
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
+
* Version 6.8.03
|
7 |
*
|
8 |
*/
|
9 |
|
566 |
|
567 |
// Fix exiflables that were undefined so far but have a known description by now
|
568 |
if ( $old_rev <= '6801' ) {
|
569 |
+
if ( function_exists( 'exif_tagname' ) && function_exists( 'exif_read_data' ) ) {
|
570 |
+
$exif_labels = $wpdb->get_results( "SELECT * FROM `" . WPPA_EXIF . "` WHERE `photo` = 0 AND `description` LIKE 'UndefinedTag%'", ARRAY_A );
|
571 |
+
if ( ! empty( $exif_labels ) ) foreach( $exif_labels as $label ) {
|
572 |
+
$newdesc = wppa_exif_tagname( $label['tag'] );
|
573 |
+
if ( $newdesc != $label['description'] ) {
|
574 |
+
$wpdb->query( $wpdb->prepare( "UPDATE `" . WPPA_EXIF . "` SET `description` = %s WHERE `photo` = 0 AND `tag` = %s", $newdesc, $label['tag'] ) );
|
575 |
+
wppa_log( 'obs', 'There is a new desc for '.$label['tag'].' being: '.$newdesc );
|
576 |
+
}
|
577 |
}
|
578 |
+
wppa_schedule_maintenance_proc( 'wppa_recup' );
|
579 |
}
|
|
|
580 |
}
|
581 |
}
|
582 |
|
1807 |
'wppa_potd_include_subs' => 'no',
|
1808 |
'wppa_potd_status_filter' => 'none',
|
1809 |
'wppa_potd_inverse' => 'no',
|
1810 |
+
'wppa_potd_method' => '4', // Change every
|
1811 |
+
'wppa_potd_period' => '24', // Day
|
1812 |
'wppa_potd_offset' => '0',
|
1813 |
'wppa_potd_photo' => '',
|
1814 |
'wppa_potd_preview' => 'no',
|
1815 |
+
'wppa_potd_log' => 'no',
|
1816 |
+
'wppa_potd_log_max' => '5',
|
1817 |
|
1818 |
|
1819 |
'wppa_widget_width' => '200', // Do we use this somewhere still?
|
wppa-widget-functions.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-widget-functions.php
|
3 |
/* Package: wp-photo-album-plus
|
4 |
/*
|
5 |
-
/* Version 6.
|
6 |
/*
|
7 |
*/
|
8 |
|
@@ -316,6 +316,7 @@ static $potd;
|
|
316 |
|
317 |
if ( $id ) {
|
318 |
$result = wppa_cache_photo( $id );
|
|
|
319 |
}
|
320 |
else {
|
321 |
$result = false;
|
@@ -505,4 +506,36 @@ function wppa_checked( $arg ) {
|
|
505 |
}
|
506 |
|
507 |
return $result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
508 |
}
|
2 |
/* wppa-widget-functions.php
|
3 |
/* Package: wp-photo-album-plus
|
4 |
/*
|
5 |
+
/* Version 6.8.03
|
6 |
/*
|
7 |
*/
|
8 |
|
316 |
|
317 |
if ( $id ) {
|
318 |
$result = wppa_cache_photo( $id );
|
319 |
+
wppa_log_potd( $id );
|
320 |
}
|
321 |
else {
|
322 |
$result = false;
|
506 |
}
|
507 |
|
508 |
return $result;
|
509 |
+
}
|
510 |
+
|
511 |
+
function wppa_log_potd( $id ) {
|
512 |
+
|
513 |
+
// Feature enabled?
|
514 |
+
if ( wppa_switch( 'potd_log' ) ) {
|
515 |
+
|
516 |
+
// Get existig history
|
517 |
+
$his = get_option( 'wppa_potd_log_data', array() );
|
518 |
+
|
519 |
+
// If history exists and last one is current id, quit
|
520 |
+
if ( ! empty( $his ) ) {
|
521 |
+
if ( $his[0]['id'] == $id ) {
|
522 |
+
return;
|
523 |
+
}
|
524 |
+
}
|
525 |
+
|
526 |
+
// Compose current entry
|
527 |
+
$now = array( 'id' => $id, 'tm' => time() );
|
528 |
+
|
529 |
+
// Log current potd at the beginning of the existing array
|
530 |
+
$cnt = array_unshift( $his, $now );
|
531 |
+
|
532 |
+
// Truncate array if larger than max
|
533 |
+
$max = wppa_opt( 'potd_log_max' );
|
534 |
+
if ( $cnt > $max ) {
|
535 |
+
$his = array_slice( $his, 0, $max );
|
536 |
+
}
|
537 |
+
|
538 |
+
// Save result
|
539 |
+
update_option( 'wppa_potd_log_data', $his );
|
540 |
+
}
|
541 |
}
|
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: 6.8.
|
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/
|
@@ -22,8 +22,8 @@ global $wpdb;
|
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
-
global $wppa_revno; $wppa_revno = '
|
26 |
-
global $wppa_api_version; $wppa_api_version = '6-8-
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|
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: 6.8.03
|
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/
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
+
global $wppa_revno; $wppa_revno = '6803'; // WPPA db version
|
26 |
+
global $wppa_api_version; $wppa_api_version = '6-8-03-003'; // WPPA software version
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|