Version Description
= 8.1.08 =
- This version addresses various bug fixes, feature requests and security fixes.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 8.2.07.003 |
Comparing to | |
See all releases |
Code changes from version 8.2.07.002 to 8.2.07.003
- changelog.txt +4 -2
- readme.txt +1 -1
- wppa-ajax.php +14 -2
- wppa-boxes-html.php +4 -2
- wppa-cron.php +15 -15
- wppa-defaults.php +2 -1
- wppa-export.php +167 -45
- wppa-filter.php +16 -3
- wppa-settings-autosave.php +16 -2
- wppa-statistics.php +6 -1
- wppa-utils.php +1 -1
- wppa-widget-functions.php +2 -2
- wppa.php +3 -3
changelog.txt
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
3 |
-
= 8.2.07
|
4 |
|
5 |
* New virtual album shortcode specification: #posttitle. Example: [wppa type="cover" album="#posttitle"]
|
6 |
-
Shows the album(s) with their names eaqual to the title of the post/page. If such an album does not exist,
|
|
|
7 |
* Fixed ajax method 'none' at the frontend.
|
|
|
8 |
|
9 |
= 8.2.06 =
|
10 |
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
3 |
+
= 8.2.07 =
|
4 |
|
5 |
* New virtual album shortcode specification: #posttitle. Example: [wppa type="cover" album="#posttitle"]
|
6 |
+
Shows the album(s) with their names eaqual to the title of the post/page. If such an album does not exist,
|
7 |
+
it will be created with the owner set to the post/page author or ---public---, dependant of setting Advanced settings -> New -> I -> Item 39: Owner of #posttitle album.
|
8 |
* Fixed ajax method 'none' at the frontend.
|
9 |
+
* When the skip empty album switch is ticked and frontend uploads are enabled, empty albums with status --- public --- will be visible to enable uploading.
|
10 |
|
11 |
= 8.2.06 =
|
12 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, f
|
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 6.0
|
7 |
Requires PHP: 5.5
|
8 |
-
Stable tag: 8.2.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 6.0
|
7 |
Requires PHP: 5.5
|
8 |
+
Stable tag: 8.2.07.003
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 8.2.07.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -184,6 +184,12 @@ global $wppa;
|
|
184 |
if ( $files ) {
|
185 |
foreach( $files as $file ) {
|
186 |
wppa_unlink( $file );
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
}
|
188 |
}
|
189 |
wppa_exit();
|
@@ -1486,6 +1492,7 @@ global $wppa;
|
|
1486 |
break;
|
1487 |
|
1488 |
case 'render':
|
|
|
1489 |
$tim_1 = microtime( true );
|
1490 |
$nq_1 = get_num_queries();
|
1491 |
|
@@ -1518,9 +1525,14 @@ global $wppa;
|
|
1518 |
// Compress js
|
1519 |
$js = wppa_compress_js( $js );
|
1520 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1521 |
// Output
|
1522 |
$the_result = wp_json_encode( ['html' => $html, 'js' => $js] );
|
1523 |
-
wppa_log( 'dbg', 'Result of ajax render starts with: ' . str_replace( '&', '8', htmlspecialchars( substr( $the_result, 0, 100 ) ) ) );
|
1524 |
echo $the_result;
|
1525 |
|
1526 |
$tim_2 = microtime( true );
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 8.2.07.003
|
6 |
*
|
7 |
*/
|
8 |
|
184 |
if ( $files ) {
|
185 |
foreach( $files as $file ) {
|
186 |
wppa_unlink( $file );
|
187 |
+
// album-' . $id . '.zip
|
188 |
+
$id = substr( wppa_strip_ext( basename( $file ) ), 6 );
|
189 |
+
$usr = wppa_get_user();
|
190 |
+
$tr = "wppa-album-$id-last-export-$usr";
|
191 |
+
wppa_log('obs',"Deleting transient $tr");
|
192 |
+
delete_transient( $tr );
|
193 |
}
|
194 |
}
|
195 |
wppa_exit();
|
1492 |
break;
|
1493 |
|
1494 |
case 'render':
|
1495 |
+
ob_start();
|
1496 |
$tim_1 = microtime( true );
|
1497 |
$nq_1 = get_num_queries();
|
1498 |
|
1525 |
// Compress js
|
1526 |
$js = wppa_compress_js( $js );
|
1527 |
|
1528 |
+
// Get possible premature output
|
1529 |
+
$unexpected = ob_get_clean();
|
1530 |
+
if ( $unexpected ) {
|
1531 |
+
wppa_log( 'err', strlen( $unexpected ) . ' chars of unexpected output captured while doing ajax render: ' . str_replace( '&', '8', htmlspecialchars( $unexpected ) ) );
|
1532 |
+
}
|
1533 |
+
|
1534 |
// Output
|
1535 |
$the_result = wp_json_encode( ['html' => $html, 'js' => $js] );
|
|
|
1536 |
echo $the_result;
|
1537 |
|
1538 |
$tim_2 = microtime( true );
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -849,13 +849,15 @@ global $photos_used;
|
|
849 |
|
850 |
// Check for empty albums
|
851 |
if ( wppa_switch( 'skip_empty_albums' ) ) {
|
|
|
852 |
$user = wppa_get_user();
|
853 |
if ( is_array( $albums ) ) foreach ( array_keys( $albums ) as $albumkey ) {
|
854 |
$albumid = $albums[$albumkey]['id'];
|
855 |
$albumowner = $albums[$albumkey]['owner'];
|
856 |
$treecount = wppa_get_treecounts_a( $albums[$albumkey]['id'] );
|
857 |
$photocount = $treecount['treephotos'];
|
858 |
-
|
|
|
859 |
unset( $albums[$albumkey] );
|
860 |
}
|
861 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 8.2.07.003
|
7 |
*
|
8 |
*/
|
9 |
|
849 |
|
850 |
// Check for empty albums
|
851 |
if ( wppa_switch( 'skip_empty_albums' ) ) {
|
852 |
+
|
853 |
$user = wppa_get_user();
|
854 |
if ( is_array( $albums ) ) foreach ( array_keys( $albums ) as $albumkey ) {
|
855 |
$albumid = $albums[$albumkey]['id'];
|
856 |
$albumowner = $albums[$albumkey]['owner'];
|
857 |
$treecount = wppa_get_treecounts_a( $albums[$albumkey]['id'] );
|
858 |
$photocount = $treecount['treephotos'];
|
859 |
+
$icanupload = wppa_switch( 'user_upload_on' ) && $albumowner == '--- public ---';
|
860 |
+
if ( ! $photocount && ! wppa_user_is_admin() && $user != $albumowner && ! $icanupload ) {
|
861 |
unset( $albums[$albumkey] );
|
862 |
}
|
863 |
}
|
wppa-cron.php
CHANGED
@@ -182,7 +182,7 @@ global $wppa_endtime;
|
|
182 |
wppa_update_option( 'wppa_crypt_albums_lasttimestamp', time() );
|
183 |
}
|
184 |
}
|
185 |
-
wppa_log( 'Cron', 'Phase 1, time left = '.($wppa_endtime-time()) );
|
186 |
if ( wppa_opt( 'crypt_photos_every' ) ) {
|
187 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} renew photocrypt.' );
|
188 |
$last = wppa_get_option( 'wppa_crypt_photos_lasttimestamp', '0' );
|
@@ -191,7 +191,7 @@ global $wppa_endtime;
|
|
191 |
wppa_update_option( 'wppa_crypt_photos_lasttimestamp', time() );
|
192 |
}
|
193 |
}
|
194 |
-
wppa_log( 'Cron', 'Phase 2, time left = '.($wppa_endtime-time()) );
|
195 |
|
196 |
// Cleanup session db table
|
197 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} cleanup sessions.' );
|
@@ -201,7 +201,7 @@ global $wppa_endtime;
|
|
201 |
$purge = time() - $savetime;
|
202 |
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_session SET status = 'expired' WHERE timestamp < %s", $expire ) );
|
203 |
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_session WHERE timestamp < %s", $purge ) );
|
204 |
-
wppa_log( 'Cron', 'Phase 3, time left = '.($wppa_endtime-time()) );
|
205 |
|
206 |
// Delete obsolete spam
|
207 |
$spammaxage = wppa_opt( 'spam_maxage' );
|
@@ -212,12 +212,12 @@ global $wppa_endtime;
|
|
212 |
$iret = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_comments WHERE status = 'spam' AND timestamp < %s", $obsolete ) );
|
213 |
if ( $iret ) wppa_update_option( 'wppa_spam_auto_delcount', wppa_get_option( 'wppa_spam_auto_delcount', '0' ) + $iret );
|
214 |
}
|
215 |
-
wppa_log( 'Cron', 'Phase 4, time left = '.($wppa_endtime-time()) );
|
216 |
|
217 |
// Re-animate crashed cronjobs
|
218 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} reanimate cron.' );
|
219 |
wppa_re_animate_cron();
|
220 |
-
wppa_log( 'Cron', 'Phase 5, time left = '.($wppa_endtime-time()) );
|
221 |
|
222 |
// Remove 'deleted' photos from system
|
223 |
$dels = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_photos WHERE album <= '-9' AND modified < " . ( time() - 3600 ) );
|
@@ -225,12 +225,12 @@ global $wppa_endtime;
|
|
225 |
wppa_delete_photo( $del );
|
226 |
wppa_log( 'Cron', 'Removed photo {b}' . $del . '{/b} from system' );
|
227 |
}
|
228 |
-
wppa_log( 'Cron', 'Phase 6, time left = '.($wppa_endtime-time()) );
|
229 |
|
230 |
// Re-create permalink htaccess file
|
231 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} creating pl htaccess.' );
|
232 |
wppa_create_pl_htaccess();
|
233 |
-
wppa_log( 'Cron', 'Phase 7, time left = '.($wppa_endtime-time()) );
|
234 |
|
235 |
// Retry failed mails
|
236 |
if ( wppa_opt( 'retry_mails' ) ) {
|
@@ -278,7 +278,7 @@ global $wppa_endtime;
|
|
278 |
// Store updated failed mails
|
279 |
wppa_update_option( 'wppa_failed_mails', $failed_mails );
|
280 |
}
|
281 |
-
wppa_log( 'Cron', 'Phase 8, time left = '.($wppa_endtime-time()) );
|
282 |
|
283 |
// Cleanup qr cache
|
284 |
if ( wppa_is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
|
@@ -291,7 +291,7 @@ global $wppa_endtime;
|
|
291 |
}
|
292 |
}
|
293 |
}
|
294 |
-
wppa_log( 'Cron', 'Phase 9, time left = '.($wppa_endtime-time()) );
|
295 |
|
296 |
// Add url-sanitized names to new albums
|
297 |
$albs = $wpdb->get_results( "SELECT id, name FROM $wpdb->wppa_albums WHERE sname = ''", ARRAY_A );
|
@@ -306,7 +306,7 @@ global $wppa_endtime;
|
|
306 |
}
|
307 |
}
|
308 |
}
|
309 |
-
wppa_log( 'Cron', 'Phase 10, time left = '.($wppa_endtime-time()) );
|
310 |
|
311 |
// Add url-sanitized names to new photos
|
312 |
$photos = $wpdb->get_results( "SELECT id, name FROM $wpdb->wppa_photos WHERE sname = '' AND name <> '' LIMIT 10000", ARRAY_A );
|
@@ -321,11 +321,11 @@ global $wppa_endtime;
|
|
321 |
}
|
322 |
}
|
323 |
}
|
324 |
-
wppa_log( 'Cron', 'Phase 11, time left = '.($wppa_endtime-time()) );
|
325 |
|
326 |
// Cleanup tempfiles
|
327 |
wppa_delete_obsolete_tempfiles();
|
328 |
-
wppa_log( 'Cron', 'Phase 12, time left = '.($wppa_endtime-time()) );
|
329 |
|
330 |
// Cleanup unused depot dirs
|
331 |
$root = is_user_logged_in() ? dirname( WPPA_DEPOT_PATH ) : WPPA_DEPOT_PATH;
|
@@ -346,7 +346,7 @@ global $wppa_endtime;
|
|
346 |
wppa_log( 'err', 'No depot found ' . $root );
|
347 |
}
|
348 |
|
349 |
-
wppa_log( 'Cron', 'Phase 13, time left = '.($wppa_endtime-time()) );
|
350 |
|
351 |
// Cleanup empty source dirs
|
352 |
$dirs = wppa_glob( wppa_opt( 'source_dir' ) . '/*', WPPA_ONLYDIRS );
|
@@ -354,10 +354,10 @@ global $wppa_endtime;
|
|
354 |
wppa_rmdir( $dir, true ); // when empty
|
355 |
}
|
356 |
|
357 |
-
wppa_log( 'Cron', 'Phase 14, time left = '.($wppa_endtime-time()) );
|
358 |
|
359 |
// Done?
|
360 |
-
wppa_log( 'Cron', 'Phase 15, time left = '.($wppa_endtime-time()) );
|
361 |
|
362 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} completed.' );
|
363 |
|
182 |
wppa_update_option( 'wppa_crypt_albums_lasttimestamp', time() );
|
183 |
}
|
184 |
}
|
185 |
+
// wppa_log( 'Cron', 'Phase 1, time left = '.($wppa_endtime-time()) );
|
186 |
if ( wppa_opt( 'crypt_photos_every' ) ) {
|
187 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} renew photocrypt.' );
|
188 |
$last = wppa_get_option( 'wppa_crypt_photos_lasttimestamp', '0' );
|
191 |
wppa_update_option( 'wppa_crypt_photos_lasttimestamp', time() );
|
192 |
}
|
193 |
}
|
194 |
+
// wppa_log( 'Cron', 'Phase 2, time left = '.($wppa_endtime-time()) );
|
195 |
|
196 |
// Cleanup session db table
|
197 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} cleanup sessions.' );
|
201 |
$purge = time() - $savetime;
|
202 |
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_session SET status = 'expired' WHERE timestamp < %s", $expire ) );
|
203 |
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_session WHERE timestamp < %s", $purge ) );
|
204 |
+
// wppa_log( 'Cron', 'Phase 3, time left = '.($wppa_endtime-time()) );
|
205 |
|
206 |
// Delete obsolete spam
|
207 |
$spammaxage = wppa_opt( 'spam_maxage' );
|
212 |
$iret = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_comments WHERE status = 'spam' AND timestamp < %s", $obsolete ) );
|
213 |
if ( $iret ) wppa_update_option( 'wppa_spam_auto_delcount', wppa_get_option( 'wppa_spam_auto_delcount', '0' ) + $iret );
|
214 |
}
|
215 |
+
// wppa_log( 'Cron', 'Phase 4, time left = '.($wppa_endtime-time()) );
|
216 |
|
217 |
// Re-animate crashed cronjobs
|
218 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} reanimate cron.' );
|
219 |
wppa_re_animate_cron();
|
220 |
+
// wppa_log( 'Cron', 'Phase 5, time left = '.($wppa_endtime-time()) );
|
221 |
|
222 |
// Remove 'deleted' photos from system
|
223 |
$dels = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_photos WHERE album <= '-9' AND modified < " . ( time() - 3600 ) );
|
225 |
wppa_delete_photo( $del );
|
226 |
wppa_log( 'Cron', 'Removed photo {b}' . $del . '{/b} from system' );
|
227 |
}
|
228 |
+
// wppa_log( 'Cron', 'Phase 6, time left = '.($wppa_endtime-time()) );
|
229 |
|
230 |
// Re-create permalink htaccess file
|
231 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} creating pl htaccess.' );
|
232 |
wppa_create_pl_htaccess();
|
233 |
+
// wppa_log( 'Cron', 'Phase 7, time left = '.($wppa_endtime-time()) );
|
234 |
|
235 |
// Retry failed mails
|
236 |
if ( wppa_opt( 'retry_mails' ) ) {
|
278 |
// Store updated failed mails
|
279 |
wppa_update_option( 'wppa_failed_mails', $failed_mails );
|
280 |
}
|
281 |
+
// wppa_log( 'Cron', 'Phase 8, time left = '.($wppa_endtime-time()) );
|
282 |
|
283 |
// Cleanup qr cache
|
284 |
if ( wppa_is_dir( WPPA_UPLOAD_PATH . '/qr' ) ) {
|
291 |
}
|
292 |
}
|
293 |
}
|
294 |
+
// wppa_log( 'Cron', 'Phase 9, time left = '.($wppa_endtime-time()) );
|
295 |
|
296 |
// Add url-sanitized names to new albums
|
297 |
$albs = $wpdb->get_results( "SELECT id, name FROM $wpdb->wppa_albums WHERE sname = ''", ARRAY_A );
|
306 |
}
|
307 |
}
|
308 |
}
|
309 |
+
// wppa_log( 'Cron', 'Phase 10, time left = '.($wppa_endtime-time()) );
|
310 |
|
311 |
// Add url-sanitized names to new photos
|
312 |
$photos = $wpdb->get_results( "SELECT id, name FROM $wpdb->wppa_photos WHERE sname = '' AND name <> '' LIMIT 10000", ARRAY_A );
|
321 |
}
|
322 |
}
|
323 |
}
|
324 |
+
// wppa_log( 'Cron', 'Phase 11, time left = '.($wppa_endtime-time()) );
|
325 |
|
326 |
// Cleanup tempfiles
|
327 |
wppa_delete_obsolete_tempfiles();
|
328 |
+
// wppa_log( 'Cron', 'Phase 12, time left = '.($wppa_endtime-time()) );
|
329 |
|
330 |
// Cleanup unused depot dirs
|
331 |
$root = is_user_logged_in() ? dirname( WPPA_DEPOT_PATH ) : WPPA_DEPOT_PATH;
|
346 |
wppa_log( 'err', 'No depot found ' . $root );
|
347 |
}
|
348 |
|
349 |
+
// wppa_log( 'Cron', 'Phase 13, time left = '.($wppa_endtime-time()) );
|
350 |
|
351 |
// Cleanup empty source dirs
|
352 |
$dirs = wppa_glob( wppa_opt( 'source_dir' ) . '/*', WPPA_ONLYDIRS );
|
354 |
wppa_rmdir( $dir, true ); // when empty
|
355 |
}
|
356 |
|
357 |
+
// wppa_log( 'Cron', 'Phase 14, time left = '.($wppa_endtime-time()) );
|
358 |
|
359 |
// Done?
|
360 |
+
// wppa_log( 'Cron', 'Phase 15, time left = '.($wppa_endtime-time()) );
|
361 |
|
362 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} completed.' );
|
363 |
|
wppa-defaults.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains default settings
|
6 |
-
* Version 8.2.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1044,6 +1044,7 @@ horizrailenabled:false,";
|
|
1044 |
'wppa_sanitize_import' => 'no',
|
1045 |
'wppa_remove_accents' => 'yes',
|
1046 |
'wppa_status_new' => 'publish',
|
|
|
1047 |
|
1048 |
// E Search
|
1049 |
'wppa_search_linkpage' => '0', // 1
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains default settings
|
6 |
+
* Version 8.2.07.003
|
7 |
*
|
8 |
*/
|
9 |
|
1044 |
'wppa_sanitize_import' => 'no',
|
1045 |
'wppa_remove_accents' => 'yes',
|
1046 |
'wppa_status_new' => 'publish',
|
1047 |
+
'wppa_posttitle_owner' => '--- postauthor ---',
|
1048 |
|
1049 |
// E Search
|
1050 |
'wppa_search_linkpage' => '0', // 1
|
wppa-export.php
CHANGED
@@ -3,17 +3,18 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the export functions
|
6 |
-
* Version 8.2.07.
|
7 |
*
|
8 |
*/
|
9 |
|
10 |
function _wppa_page_export() {
|
11 |
global $wpdb;
|
|
|
12 |
|
13 |
// Export Photos admin page
|
14 |
$can_zip = PHP_VERSION_ID >= 50207 && class_exists( 'ZipArchive' );
|
15 |
|
16 |
-
// See if our depot dir
|
17 |
if ( ! wppa_is_dir( WPPA_DEPOT_PATH ) ) {
|
18 |
wppa_mktree( WPPA_DEPOT_PATH );
|
19 |
if ( ! wppa_is_dir( WPPA_DEPOT_PATH ) ) {
|
@@ -25,11 +26,26 @@ global $wpdb;
|
|
25 |
}
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
// Do the export if requested
|
29 |
if ( wppa_get( 'export-submit' ) ) {
|
30 |
check_admin_referer( '$wppa_nonce', WPPA_NONCE );
|
31 |
wppa_export_photos();
|
32 |
}
|
|
|
|
|
33 |
$the_js = '
|
34 |
function wppaToggleExportBoxes(elm) {
|
35 |
if (jQuery(elm).prop("checked")) {
|
@@ -49,9 +65,7 @@ global $wpdb;
|
|
49 |
|
50 |
$albums = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_albums ORDER BY name", ARRAY_A );
|
51 |
foreach( array_keys( $albums ) as $key ) {
|
52 |
-
wppa_log('obs', 'Album '.$albums[$key]['id'].' '.$albums[$key]['name'].' '.$albums[$key]['status'].' '.wppa_is_album_visible( $albums[$key]['id'] ));
|
53 |
if ( ! wppa_is_album_visible( $albums[$key]['id'] ) ) {
|
54 |
-
wppa_log('obs', "Album ".$albums[$key]['id'].' is not visible for '.wppa_get_user() );
|
55 |
unset( $albums[$key] );
|
56 |
}
|
57 |
}
|
@@ -85,12 +99,7 @@ global $wpdb;
|
|
85 |
}
|
86 |
|
87 |
wppa_echo( '
|
88 |
-
|
89 |
-
<h2>' .
|
90 |
-
__( 'Export Photos', 'wp-photo-album-plus' ) . '
|
91 |
-
</h2>
|
92 |
-
<br>
|
93 |
-
<div style="border:1px solid gray;padding:4px;margin: 3px 0">' );
|
94 |
|
95 |
wppa_echo(
|
96 |
sprintf( __( 'Photos will be exported to: <b>%s</b>.', 'wp-photo-album-plus' ), WPPA_DEPOT ) . '
|
@@ -144,15 +153,17 @@ global $wpdb;
|
|
144 |
"SELECT COUNT(*)
|
145 |
FROM $wpdb->wppa_photos
|
146 |
WHERE album = %d
|
147 |
-
AND ext
|
|
|
148 |
}
|
149 |
else {
|
150 |
$numphotos = $wpdb->get_var( $wpdb->prepare(
|
151 |
"SELECT COUNT(*)
|
152 |
FROM $wpdb->wppa_photos
|
153 |
WHERE album = %d
|
154 |
-
AND ext
|
155 |
-
AND
|
|
|
156 |
}
|
157 |
|
158 |
|
@@ -209,7 +220,41 @@ global $wpdb;
|
|
209 |
</tbody>
|
210 |
</table>
|
211 |
<p>
|
212 |
-
<input type="submit" class="button-primary" name="wppa-export-submit" value="' . esc_attr( __( 'Export', 'wp-photo-album-plus' ) ) . '">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
</p>
|
214 |
</form>
|
215 |
</div>
|
@@ -222,14 +267,41 @@ global $wpdb;
|
|
222 |
global $wppa_zip;
|
223 |
global $wppa_temp;
|
224 |
global $wppa_temp_idx;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
-
$wppa_temp_idx = 0;
|
227 |
-
|
228 |
-
wppa_echo( __( 'Exporting', 'wp-photo-album-plus' ) . '...<br>' );
|
229 |
-
|
230 |
-
$expected_endtime = wppa_local_date( 'h:i:s', time() + wppa_time_left() );
|
231 |
-
|
232 |
-
wppa_echo( sprintf( __( 'If you do not get a message like "nn Albums exported" within %d seconds, your browser may be timed out. In that case, just redo the export after %s', 'wp-photo-album-plus' ), wppa_time_left(), $expected_endtime ) );
|
233 |
if ( PHP_VERSION_ID >= 50207 && class_exists('ZipArchive') ) {
|
234 |
$can_zip = true;
|
235 |
}
|
@@ -239,6 +311,20 @@ global $wppa_temp_idx;
|
|
239 |
if ( ! class_exists('ZipArchive') ) wppa_warning_message(__('Can export albums and photos, but cannot make a zipfile. Your php version does not support ZipArchive.', 'wp-photo-album-plus' ));
|
240 |
}
|
241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
$albums = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums ORDER BY id" );
|
243 |
|
244 |
$done = 0;
|
@@ -249,12 +335,14 @@ global $wppa_temp_idx;
|
|
249 |
if ( wppa_get( 'album-' . $id, '0', 'text' ) ) {
|
250 |
|
251 |
if ( $can_zip ) {
|
252 |
-
echo('<
|
253 |
$wppa_zip = new ZipArchive;
|
254 |
|
255 |
$zipfile = WPPA_DEPOT_PATH . '/album-' . $id . '.zip';
|
256 |
if ( $wppa_zip->open( $zipfile, 1 ) === TRUE ) {
|
257 |
-
|
|
|
|
|
258 |
wppa_write_album_file_by_id( $id );
|
259 |
$wppa_zip->close();
|
260 |
} else {
|
@@ -263,30 +351,51 @@ global $wppa_temp_idx;
|
|
263 |
}
|
264 |
}
|
265 |
else {
|
266 |
-
wppa_write_album_file_by_id( $id );
|
267 |
$wppa_zip = false;
|
|
|
268 |
}
|
269 |
|
270 |
-
wppa_echo( '<br>' . sprintf( __( 'Processing album %d. Time left: %
|
271 |
|
272 |
$usr = wppa_get_user();
|
273 |
$from = get_transient( "wppa-album-$id-last-export-$usr" );
|
274 |
if ( ! $from ) $from = '0';
|
275 |
|
276 |
if ( wppa_user_is_admin() ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
$photos = $wpdb->get_results( $wpdb->prepare(
|
278 |
"SELECT * FROM $wpdb->wppa_photos
|
279 |
WHERE album = %d
|
280 |
AND id > %d
|
281 |
-
AND ext
|
|
|
|
|
282 |
}
|
283 |
else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
$photos = $wpdb->get_results( $wpdb->prepare(
|
285 |
"SELECT * FROM $wpdb->wppa_photos
|
286 |
WHERE album = %d
|
287 |
AND id > %d
|
288 |
-
AND ext
|
289 |
-
AND
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
}
|
291 |
|
292 |
$cnt = 0;
|
@@ -323,9 +432,6 @@ global $wppa_temp_idx;
|
|
323 |
}
|
324 |
else {
|
325 |
$wppa_zip->addFile( $from, basename( $to ) );
|
326 |
-
// wppa_write_photo_file( $photo );
|
327 |
-
// wppa_export_photo_csv( $photo_id, $id );
|
328 |
-
// wppa_echo( '.' );
|
329 |
}
|
330 |
|
331 |
// Close zip
|
@@ -336,33 +442,46 @@ global $wppa_temp_idx;
|
|
336 |
// No zipfile, just copy to depot
|
337 |
else {
|
338 |
wppa_copy( $from, $to );
|
339 |
-
// wppa_write_photo_file( $photo );
|
340 |
-
// wppa_export_photo_csv( $photo_id, $id );
|
341 |
}
|
342 |
|
|
|
343 |
if ( ! $alreadyin ) {
|
344 |
|
345 |
-
//
|
346 |
-
|
347 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
return false;
|
349 |
}
|
350 |
-
|
|
|
|
|
|
|
|
|
351 |
}
|
352 |
|
|
|
353 |
wppa_echo( '.' );
|
354 |
|
355 |
-
if ( wppa_is_time_up() ) {
|
356 |
$abort = true;
|
357 |
}
|
358 |
|
359 |
-
|
360 |
|
361 |
-
|
362 |
}
|
363 |
|
364 |
-
if ( $abort && $cnt <
|
365 |
-
wppa_echo( ' ' . sprintf( __( 'failed. Only %d out of %d photos processed', 'wp-photo-album-plus' ), $cnt,
|
|
|
366 |
}
|
367 |
else {
|
368 |
wppa_echo( ' '. sprintf( __( 'done. %d photos processed', 'wp-photo-album-plus' ), $cnt ) );
|
@@ -378,20 +497,23 @@ global $wppa_temp_idx;
|
|
378 |
|
379 |
if ( ! $abort ) {
|
380 |
wppa_echo( '
|
381 |
-
|
|
|
382 |
<a
|
383 |
href="' . esc_attr( WPPA_DEPOT_URL . '/album-' . $id . '.zip' ) . '"
|
384 |
download="' . esc_attr( wppa_get_album_name( $id ) ) . '">
|
385 |
<input type="button" class="button-primary" value="' . esc_attr( sprintf( __( 'Download album %s', 'wp-photo-album-plus' ), wppa_get_album_name( $id ) ) ) . '">
|
386 |
</a>' );
|
|
|
387 |
$done++;
|
388 |
}
|
389 |
|
390 |
-
if ( wppa_is_time_up() ) break;
|
391 |
}
|
392 |
}
|
393 |
|
394 |
wppa_echo( '<p>' . sprintf( _n( '%d Album exported', '%d Albums exported', $done, 'wp-photo-album-plus' ), $done ) . '</p>' );
|
|
|
395 |
|
396 |
}
|
397 |
|
@@ -603,7 +725,7 @@ global $wppa_temp;
|
|
603 |
unlink( $file );
|
604 |
unset( $wppa_temp[$key] );
|
605 |
}
|
606 |
-
if ( wppa_is_time_up( '',
|
607 |
wppa_echo( '<br>' . __( 'Could not remove all temporary files', 'wp-photo-album-plus' ) );
|
608 |
return false;
|
609 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the export functions
|
6 |
+
* Version 8.2.07.003
|
7 |
*
|
8 |
*/
|
9 |
|
10 |
function _wppa_page_export() {
|
11 |
global $wpdb;
|
12 |
+
global $wppa_try_continue;
|
13 |
|
14 |
// Export Photos admin page
|
15 |
$can_zip = PHP_VERSION_ID >= 50207 && class_exists( 'ZipArchive' );
|
16 |
|
17 |
+
// See if our depot dir can be or has been created
|
18 |
if ( ! wppa_is_dir( WPPA_DEPOT_PATH ) ) {
|
19 |
wppa_mktree( WPPA_DEPOT_PATH );
|
20 |
if ( ! wppa_is_dir( WPPA_DEPOT_PATH ) ) {
|
26 |
}
|
27 |
}
|
28 |
|
29 |
+
|
30 |
+
// This is to force the browser to directly display what is sent and not to wait for the entire page
|
31 |
+
wppa_echo( '<span style="display:none">' );
|
32 |
+
for ( $i=0;$i<21;$i++ ) wppa_echo('....................................................................................................');
|
33 |
+
wppa_echo( '</span>' );
|
34 |
+
|
35 |
+
// Open the page
|
36 |
+
wppa_echo( '
|
37 |
+
<div class="wrap">
|
38 |
+
<h2>' .
|
39 |
+
__( 'Export Photos', 'wp-photo-album-plus' ) . '
|
40 |
+
</h2>' );
|
41 |
+
|
42 |
// Do the export if requested
|
43 |
if ( wppa_get( 'export-submit' ) ) {
|
44 |
check_admin_referer( '$wppa_nonce', WPPA_NONCE );
|
45 |
wppa_export_photos();
|
46 |
}
|
47 |
+
|
48 |
+
// Construct inline js
|
49 |
$the_js = '
|
50 |
function wppaToggleExportBoxes(elm) {
|
51 |
if (jQuery(elm).prop("checked")) {
|
65 |
|
66 |
$albums = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_albums ORDER BY name", ARRAY_A );
|
67 |
foreach( array_keys( $albums ) as $key ) {
|
|
|
68 |
if ( ! wppa_is_album_visible( $albums[$key]['id'] ) ) {
|
|
|
69 |
unset( $albums[$key] );
|
70 |
}
|
71 |
}
|
99 |
}
|
100 |
|
101 |
wppa_echo( '
|
102 |
+
<div style="border:1px solid gray;padding:4px;margin: 3px 0 3px 0;position:relative;">' );
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
wppa_echo(
|
105 |
sprintf( __( 'Photos will be exported to: <b>%s</b>.', 'wp-photo-album-plus' ), WPPA_DEPOT ) . '
|
153 |
"SELECT COUNT(*)
|
154 |
FROM $wpdb->wppa_photos
|
155 |
WHERE album = %d
|
156 |
+
AND ext <> 'xxx'
|
157 |
+
AND filename NOT LIKE %s", $id, '%.pdf' ) );
|
158 |
}
|
159 |
else {
|
160 |
$numphotos = $wpdb->get_var( $wpdb->prepare(
|
161 |
"SELECT COUNT(*)
|
162 |
FROM $wpdb->wppa_photos
|
163 |
WHERE album = %d
|
164 |
+
AND ext <> 'xxx'
|
165 |
+
AND filename NOT LIKE %s
|
166 |
+
AND ( status NOT IN ('pending', 'scheduled') OR owner = %s )", $id, '%.pdf', wppa_get_user() ) );
|
167 |
}
|
168 |
|
169 |
|
220 |
</tbody>
|
221 |
</table>
|
222 |
<p>
|
223 |
+
<input type="submit" id="exp-submit" class="button-primary" name="wppa-export-submit" value="' . esc_attr( __( 'Export', 'wp-photo-album-plus' ) ) . '">' );
|
224 |
+
if ( $wppa_try_continue ) {
|
225 |
+
$url = wppa_get_imgdir( 'spinner.gif' );
|
226 |
+
$js1 = '
|
227 |
+
wppaExpTmr=setInterval(function(){
|
228 |
+
var tim=parseInt(jQuery("#extimer").html())-1;
|
229 |
+
jQuery(jQuery("#extimer").html(tim));
|
230 |
+
if (tim<1) {
|
231 |
+
clearInterval(wppaExpTmr);
|
232 |
+
jQuery("#exp-submit").trigger("click");
|
233 |
+
jQuery(".wppaexpdelta").trigger("click");
|
234 |
+
jQuery("#exp-submit").prop("disabled",true);
|
235 |
+
}
|
236 |
+
}, 1000)';
|
237 |
+
$js2 = '
|
238 |
+
clearInterval(wppaExpTmr);
|
239 |
+
jQuery(".wppaexpdelta").css("display","none")';
|
240 |
+
wppa_echo( '
|
241 |
+
<img
|
242 |
+
class="wppaexpdelta"
|
243 |
+
src="'.esc_attr($url).'"
|
244 |
+
onload="'.esc_attr($js1).'"
|
245 |
+
>
|
246 |
+
<span class="wppaexpdelta">' .
|
247 |
+
sprintf( __( 'Trying to continue in %s seconds', 'wp-photo-album-plus' ), '<span id="extimer">10</span>' ) . '
|
248 |
+
</span>
|
249 |
+
<input
|
250 |
+
type="button"
|
251 |
+
class="wppaexpdelta"
|
252 |
+
onclick="'.esc_attr($js2).'"
|
253 |
+
value="'.esc_attr(__('Stop', 'wp-photo-album-plus')).'"
|
254 |
+
>'
|
255 |
+
);
|
256 |
+
}
|
257 |
+
wppa_echo( '
|
258 |
</p>
|
259 |
</form>
|
260 |
</div>
|
267 |
global $wppa_zip;
|
268 |
global $wppa_temp;
|
269 |
global $wppa_temp_idx;
|
270 |
+
global $wppa_try_continue;
|
271 |
+
|
272 |
+
$wppa_temp_idx = 0;
|
273 |
+
$wppa_try_continue = false;
|
274 |
+
$expected_endtime = wppa_local_date( 'h:i:s', time() + wppa_time_left( 10 ) );
|
275 |
+
|
276 |
+
$url = esc_attr( wppa_get_imgdir( 'spinner.gif' ) );
|
277 |
+
$js = 'wppaTm=setInterval( function() {
|
278 |
+
var t=parseInt(jQuery(".exptmlft").last().html());
|
279 |
+
if (t>0) {
|
280 |
+
t--;
|
281 |
+
jQuery(".exptmlft").last().html(t);
|
282 |
+
}
|
283 |
+
t=parseInt(jQuery("#tmlft").html());
|
284 |
+
if (t>0) {
|
285 |
+
t--;
|
286 |
+
jQuery("#tmlft").html(t);
|
287 |
+
}
|
288 |
+
var el = document.getElementById("wppaaction");
|
289 |
+
el.scrollTop = el.scrollHeight;
|
290 |
+
}, 1000 );
|
291 |
+
jQuery(document).ready( function() {
|
292 |
+
jQuery(".expspin").css("display","none");
|
293 |
+
clearInterval(wppaTm);
|
294 |
+
});';
|
295 |
+
|
296 |
+
$tmlft = '<span id="tmlft" style="font-size:1.25em;font-weight:bold;">' . wppa_time_left( 10 ) . '</span>';
|
297 |
+
wppa_echo( '
|
298 |
+
<h2>' .
|
299 |
+
__( 'Exporting', 'wp-photo-album-plus' ) . '...<img class="expspin" src="' . $url . '" onload="' . esc_attr( $js ) . '">
|
300 |
+
</h2>' .
|
301 |
+
sprintf( __( 'If you do not get a redisplay of the album table within %s seconds, your browser may be timed out.', 'wp-photo-album-plus' ), $tmlft ) . ' ' .
|
302 |
+
__( 'In that case, just reopen the export page and try again.', 'wp-photo-album-plus' ) .
|
303 |
+
'<br>' );
|
304 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
if ( PHP_VERSION_ID >= 50207 && class_exists('ZipArchive') ) {
|
306 |
$can_zip = true;
|
307 |
}
|
311 |
if ( ! class_exists('ZipArchive') ) wppa_warning_message(__('Can export albums and photos, but cannot make a zipfile. Your php version does not support ZipArchive.', 'wp-photo-album-plus' ));
|
312 |
}
|
313 |
|
314 |
+
wppa_echo( '
|
315 |
+
<br>
|
316 |
+
<div
|
317 |
+
id="wppaaction"
|
318 |
+
style="
|
319 |
+
padding:4px;
|
320 |
+
border:1px solid gray;
|
321 |
+
margin: 3px 0 3px 0;
|
322 |
+
position:relative;
|
323 |
+
background-color:lightyellow;
|
324 |
+
max-height:250px;overflow:auto;
|
325 |
+
">' );
|
326 |
+
|
327 |
+
// The actual export procedure. find the albums
|
328 |
$albums = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums ORDER BY id" );
|
329 |
|
330 |
$done = 0;
|
335 |
if ( wppa_get( 'album-' . $id, '0', 'text' ) ) {
|
336 |
|
337 |
if ( $can_zip ) {
|
338 |
+
echo( '<p>' . __( 'Opening zip output file...', 'wp-photo-album-plus' ) );
|
339 |
$wppa_zip = new ZipArchive;
|
340 |
|
341 |
$zipfile = WPPA_DEPOT_PATH . '/album-' . $id . '.zip';
|
342 |
if ( $wppa_zip->open( $zipfile, 1 ) === TRUE ) {
|
343 |
+
$a1 = '<span style="font-weight:bold;font-size:1.25em;">' . basename( $zipfile ) . '</span>';
|
344 |
+
$a2 = '<span style="font-weight:bold;font-size:1.25em;">' . wppa_get_album_name( $id ) . '</span>';
|
345 |
+
wppa_echo( sprintf( __( 'ok, <br>Filling %1s with data from album %2s', 'wp-photo-album-plus' ), $a1, $a2 ) );
|
346 |
wppa_write_album_file_by_id( $id );
|
347 |
$wppa_zip->close();
|
348 |
} else {
|
351 |
}
|
352 |
}
|
353 |
else {
|
|
|
354 |
$wppa_zip = false;
|
355 |
+
wppa_write_album_file_by_id( $id );
|
356 |
}
|
357 |
|
358 |
+
wppa_echo( '<br>' . sprintf( __( 'Processing album %d. Time left: %s seconds', 'wp-photo-album-plus' ), $id, '<span class="exptmlft" style="font-weight:bold;font-size:1.25em;">' . ( wppa_time_left( 10 ) ). '</span>' ) );
|
359 |
|
360 |
$usr = wppa_get_user();
|
361 |
$from = get_transient( "wppa-album-$id-last-export-$usr" );
|
362 |
if ( ! $from ) $from = '0';
|
363 |
|
364 |
if ( wppa_user_is_admin() ) {
|
365 |
+
$total = $wpdb->get_var( $wpdb->prepare(
|
366 |
+
"SELECT COUNT(*) FROM $wpdb->wppa_photos
|
367 |
+
WHERE album = %d
|
368 |
+
AND ext <> 'xxx'
|
369 |
+
AND filename NOT LIKE %s", $id, '%.pdf' ) );
|
370 |
+
|
371 |
$photos = $wpdb->get_results( $wpdb->prepare(
|
372 |
"SELECT * FROM $wpdb->wppa_photos
|
373 |
WHERE album = %d
|
374 |
AND id > %d
|
375 |
+
AND ext <> 'xxx'
|
376 |
+
AND filename NOT LIKE %s
|
377 |
+
ORDER BY id", $id, $from, '%.pdf' ), ARRAY_A );
|
378 |
}
|
379 |
else {
|
380 |
+
$total = $wpdb->get_var( $wpdb->prepare(
|
381 |
+
"SELECT COUNT(*) FROM $wpdb->wppa_photos
|
382 |
+
WHERE album = %d
|
383 |
+
AND ext <> 'xxx'
|
384 |
+
AND filename NOT LIKE %s
|
385 |
+
AND ( status NOT IN ('pending', 'scheduled') OR owner = %s )", $id, '%.pdf' ) );
|
386 |
+
|
387 |
$photos = $wpdb->get_results( $wpdb->prepare(
|
388 |
"SELECT * FROM $wpdb->wppa_photos
|
389 |
WHERE album = %d
|
390 |
AND id > %d
|
391 |
+
AND ext <> 'xxx'
|
392 |
+
AND filename NOT LIKE %s
|
393 |
+
AND ( status NOT IN ('pending', 'scheduled') OR owner = %s )
|
394 |
+
ORDER BY id", $id, $from, '%.pdf', wppa_get_user() ), ARRAY_A );
|
395 |
+
}
|
396 |
+
|
397 |
+
if ( $total > count( $photos ) ) {
|
398 |
+
wppa_echo( '<br>' . sprintf( __( 'Continuing after %d items already processed out of a total of %d', 'wp-photo-album-plus' ), $total - count( $photos ), $total ) );
|
399 |
}
|
400 |
|
401 |
$cnt = 0;
|
432 |
}
|
433 |
else {
|
434 |
$wppa_zip->addFile( $from, basename( $to ) );
|
|
|
|
|
|
|
435 |
}
|
436 |
|
437 |
// Close zip
|
442 |
// No zipfile, just copy to depot
|
443 |
else {
|
444 |
wppa_copy( $from, $to );
|
|
|
|
|
445 |
}
|
446 |
|
447 |
+
// Create the metadata
|
448 |
if ( ! $alreadyin ) {
|
449 |
|
450 |
+
// Open zip
|
451 |
+
$wppa_zip->open( $zipfile, 1 );
|
452 |
+
|
453 |
+
// Write the file and optionally add to zip
|
454 |
+
$bret = wppa_write_photo_file( $photo );
|
455 |
+
|
456 |
+
// Close zip
|
457 |
+
$wppa_zip->close();
|
458 |
+
|
459 |
+
// If meta file failed, quit
|
460 |
+
if ( ! $bret ) {
|
461 |
return false;
|
462 |
}
|
463 |
+
|
464 |
+
// Increment counter
|
465 |
+
else {
|
466 |
+
$cnt++;
|
467 |
+
}
|
468 |
}
|
469 |
|
470 |
+
// Write a dot to indicate progression
|
471 |
wppa_echo( '.' );
|
472 |
|
473 |
+
if ( wppa_is_time_up( '', 10 ) ) {
|
474 |
$abort = true;
|
475 |
}
|
476 |
|
477 |
+
set_transient( "wppa-album-$id-last-export-$usr", $photo_id, HOUR_IN_SECONDS );
|
478 |
|
479 |
+
if ( $abort ) break;
|
480 |
}
|
481 |
|
482 |
+
if ( $abort && $cnt < $total ) {
|
483 |
+
wppa_echo( ' ' . sprintf( __( 'failed. Only %d out of %d photos processed', 'wp-photo-album-plus' ), $cnt, $total ) );
|
484 |
+
$wppa_try_continue = true;
|
485 |
}
|
486 |
else {
|
487 |
wppa_echo( ' '. sprintf( __( 'done. %d photos processed', 'wp-photo-album-plus' ), $cnt ) );
|
497 |
|
498 |
if ( ! $abort ) {
|
499 |
wppa_echo( '
|
500 |
+
</p>' );
|
501 |
+
/*
|
502 |
<a
|
503 |
href="' . esc_attr( WPPA_DEPOT_URL . '/album-' . $id . '.zip' ) . '"
|
504 |
download="' . esc_attr( wppa_get_album_name( $id ) ) . '">
|
505 |
<input type="button" class="button-primary" value="' . esc_attr( sprintf( __( 'Download album %s', 'wp-photo-album-plus' ), wppa_get_album_name( $id ) ) ) . '">
|
506 |
</a>' );
|
507 |
+
*/
|
508 |
$done++;
|
509 |
}
|
510 |
|
511 |
+
if ( wppa_is_time_up( '', 10 ) ) break;
|
512 |
}
|
513 |
}
|
514 |
|
515 |
wppa_echo( '<p>' . sprintf( _n( '%d Album exported', '%d Albums exported', $done, 'wp-photo-album-plus' ), $done ) . '</p>' );
|
516 |
+
wppa_echo( '</div>' ); // </ wppaaction
|
517 |
|
518 |
}
|
519 |
|
725 |
unlink( $file );
|
726 |
unset( $wppa_temp[$key] );
|
727 |
}
|
728 |
+
if ( wppa_is_time_up( '', 10 ) ) {
|
729 |
wppa_echo( '<br>' . __( 'Could not remove all temporary files', 'wp-photo-album-plus' ) );
|
730 |
return false;
|
731 |
}
|
wppa-filter.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
-
* Version: 8.2.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -335,10 +335,23 @@ global $other_deps;
|
|
335 |
$atts['album'] = implode( '.', $albs );
|
336 |
}
|
337 |
else {
|
338 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
$alb = wppa_create_album_entry( ['name' => $the_name,
|
340 |
'description' => __( 'Automatically created for post', 'wp-photo-album-plus' ) . ' ' . $the_name,
|
341 |
-
'owner' => $owner
|
342 |
] );
|
343 |
if ( $alb ) {
|
344 |
$atts['album'] = $alb;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
+
* Version: 8.2.07.003
|
7 |
*
|
8 |
*/
|
9 |
|
335 |
$atts['album'] = implode( '.', $albs );
|
336 |
}
|
337 |
else {
|
338 |
+
switch( wppa_opt( 'wppa_posttitle_owner' ) ) {
|
339 |
+
case '--- postauthor ---':
|
340 |
+
$usr = get_user_by( 'ID', $owner_id );
|
341 |
+
$owner = $usr->user_login;
|
342 |
+
break;
|
343 |
+
case '--- public ---':
|
344 |
+
$owner = '--- public ---';
|
345 |
+
break;
|
346 |
+
default:
|
347 |
+
// Should never get here
|
348 |
+
wppa_log( 'err', 'Unimplemented #posttitle album owner: '.wppa_opt( 'wppa_posttitle_owner' ));
|
349 |
+
return "Error. Unimplemented album owner indicator: ".wppa_opt( 'wppa_posttitle_owner' );
|
350 |
+
}
|
351 |
+
|
352 |
$alb = wppa_create_album_entry( ['name' => $the_name,
|
353 |
'description' => __( 'Automatically created for post', 'wp-photo-album-plus' ) . ' ' . $the_name,
|
354 |
+
'owner' => $owner,
|
355 |
] );
|
356 |
if ( $alb ) {
|
357 |
$atts['album'] = $alb;
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 8.2.07.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -354,7 +354,8 @@ global $wppa_subtab_names;
|
|
354 |
// Graylist
|
355 |
$graylist_plugins = array(
|
356 |
'shortcodes-ultimate/shortcodes-ultimate.php',
|
357 |
-
'tablepress/tablepress.php'
|
|
|
358 |
);
|
359 |
$matches = array_intersect($graylist_plugins, $plugins);
|
360 |
foreach ( $matches as $bad ) {
|
@@ -7216,6 +7217,19 @@ global $wppa_subtab_names;
|
|
7216 |
$html = wppa_select( $slug, $opts, $vals);
|
7217 |
wppa_setting_new($slug, '38', $name, $desc, $html, $help);
|
7218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7219 |
wppa_setting_box_footer_new();
|
7220 |
}
|
7221 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 8.2.07.003
|
7 |
*
|
8 |
*/
|
9 |
|
354 |
// Graylist
|
355 |
$graylist_plugins = array(
|
356 |
'shortcodes-ultimate/shortcodes-ultimate.php',
|
357 |
+
'tablepress/tablepress.php',
|
358 |
+
'responsive-lightbox/responsive-lightbox.php',
|
359 |
);
|
360 |
$matches = array_intersect($graylist_plugins, $plugins);
|
361 |
foreach ( $matches as $bad ) {
|
7217 |
$html = wppa_select( $slug, $opts, $vals);
|
7218 |
wppa_setting_new($slug, '38', $name, $desc, $html, $help);
|
7219 |
|
7220 |
+
$name = __('Owner of #posttitle album', 'wp-photo-album-plus' );
|
7221 |
+
$desc = __('The owner of a new album created by shortcode attribute album="#posttitle"', 'wp-photo-album-plus');
|
7222 |
+
$help = '';
|
7223 |
+
$slug = 'wppa_posttitle_owner';
|
7224 |
+
$opts = array( __('The owner of the post', 'wp-photo-album-plus'),
|
7225 |
+
__('Public', 'wp-photo-album-plus'),
|
7226 |
+
);
|
7227 |
+
$vals = array( '--- postauthor ---',
|
7228 |
+
'--- public ---',
|
7229 |
+
);
|
7230 |
+
$html = wppa_select( $slug, $opts, $vals);
|
7231 |
+
wppa_setting_new($slug, '39', $name, $desc, $html, $help);
|
7232 |
+
|
7233 |
wppa_setting_box_footer_new();
|
7234 |
}
|
7235 |
}
|
wppa-statistics.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Functions for counts etc
|
6 |
* Common use front and admin
|
7 |
-
* Version 8.2.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -647,6 +647,11 @@ static $login;
|
|
647 |
break;
|
648 |
}
|
649 |
|
|
|
|
|
|
|
|
|
|
|
650 |
// The user is logged in or the status is publish
|
651 |
// Dispatch on whether we skip empty albums
|
652 |
if ( wppa_switch( 'skip_empty_albums' ) ) {
|
4 |
*
|
5 |
* Functions for counts etc
|
6 |
* Common use front and admin
|
7 |
+
* Version 8.2.07.003
|
8 |
*
|
9 |
*/
|
10 |
|
647 |
break;
|
648 |
}
|
649 |
|
650 |
+
// If the user can upload to it, it is visible
|
651 |
+
if ( wppa_switch( 'user_upload_on' ) && $owner == '--- public ---' ) {
|
652 |
+
return true;
|
653 |
+
}
|
654 |
+
|
655 |
// The user is logged in or the status is publish
|
656 |
// Dispatch on whether we skip empty albums
|
657 |
if ( wppa_switch( 'skip_empty_albums' ) ) {
|
wppa-utils.php
CHANGED
@@ -1018,7 +1018,7 @@ function wppa_is_time_up( $count = '', $margin = 5 ) {
|
|
1018 |
global $wppa_endtime;
|
1019 |
|
1020 |
if ( ! $wppa_endtime ) {
|
1021 |
-
wppa_log( 'err', 'Zero endtime, set to
|
1022 |
$wppa_endtime = time() + 60;
|
1023 |
}
|
1024 |
|
1018 |
global $wppa_endtime;
|
1019 |
|
1020 |
if ( ! $wppa_endtime ) {
|
1021 |
+
wppa_log( 'err', 'Zero endtime, set to 55 secs after now' );
|
1022 |
$wppa_endtime = time() + 60;
|
1023 |
}
|
1024 |
|
wppa-widget-functions.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-widget-functions.php
|
3 |
/* Package: wp-photo-album-plus
|
4 |
/*
|
5 |
-
/* Version 8.2.
|
6 |
/*
|
7 |
*/
|
8 |
|
@@ -428,7 +428,7 @@ function wppa_widget_textarea( $class, $item, $value, $label ) {
|
|
428 |
'</textarea>' .
|
429 |
'</p>';
|
430 |
|
431 |
-
|
432 |
}
|
433 |
|
434 |
// Widget input number_format
|
2 |
/* wppa-widget-functions.php
|
3 |
/* Package: wp-photo-album-plus
|
4 |
/*
|
5 |
+
/* Version 8.2.07.003
|
6 |
/*
|
7 |
*/
|
8 |
|
428 |
'</textarea>' .
|
429 |
'</p>';
|
430 |
|
431 |
+
wppa_echo( $result );
|
432 |
}
|
433 |
|
434 |
// Widget input number_format
|
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.2.07.
|
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,7 +23,7 @@ global $wpdb;
|
|
23 |
global $wp_version;
|
24 |
|
25 |
/* WPPA Version */
|
26 |
-
global $wppa_version; $wppa_version = '8.2.07.
|
27 |
global $wppa_revno; $wppa_revno = str_replace( '.', '', $wppa_version ); // WPPA db version
|
28 |
|
29 |
/* Init page js data */
|
@@ -40,7 +40,7 @@ global $wppa_endtime;
|
|
40 |
$the_met = max ( min( $met, 120 ), 30 );
|
41 |
}
|
42 |
else {
|
43 |
-
$the_met = max ( min( $met,
|
44 |
}
|
45 |
|
46 |
$wppa_endtime = time() + $the_met;
|
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.2.07.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/
|
23 |
global $wp_version;
|
24 |
|
25 |
/* WPPA Version */
|
26 |
+
global $wppa_version; $wppa_version = '8.2.07.003'; // WPPA software version
|
27 |
global $wppa_revno; $wppa_revno = str_replace( '.', '', $wppa_version ); // WPPA db version
|
28 |
|
29 |
/* Init page js data */
|
40 |
$the_met = max ( min( $met, 120 ), 30 );
|
41 |
}
|
42 |
else {
|
43 |
+
$the_met = max ( min( $met, 90 ), 30 );
|
44 |
}
|
45 |
|
46 |
$wppa_endtime = time() + $the_met;
|