Version Description
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 6.4.02 |
Comparing to | |
See all releases |
Code changes from version 6.4.01 to 6.4.02
- readme.txt +14 -6
- theme/wppa-style.css +9 -2
- wppa-admin.php +2 -2
- wppa-ajax.php +30 -1
- wppa-album-admin-autosave.php +2 -2
- wppa-album-covers.php +31 -34
- wppa-boxes-html.php +9 -16
- wppa-common-functions.php +133 -13
- wppa-functions.php +20 -11
- wppa-maintenance.php +14 -2
- wppa-photo-admin-autosave.php +4 -4
- wppa-settings-autosave.php +79 -1
- wppa-setup.php +5 -1
- wppa-slideshow.php +4 -28
- wppa-thumbnails.php +2 -2
- wppa-upload.php +7 -7
- wppa-users.php +17 -1
- wppa.php +2 -2
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
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, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
|
5 |
-
Version: 6.4.
|
6 |
Stable tag: 6.4.01
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
@@ -176,15 +176,23 @@ but, as explained earlier, this does not help when your hosting provider does no
|
|
176 |
If you have control over the server yourself: configure it to allow the use of enough memory.
|
177 |
Oh, just Google on 'picture resizer' and you will find a bunch of free programs that will easily perform the resizing task for you.
|
178 |
|
179 |
-
==
|
180 |
|
181 |
-
|
182 |
|
183 |
-
|
184 |
|
185 |
-
|
186 |
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
|
189 |
= 6.4.01 =
|
190 |
|
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, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
|
5 |
+
Version: 6.4.02
|
6 |
Stable tag: 6.4.01
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
176 |
If you have control over the server yourself: configure it to allow the use of enough memory.
|
177 |
Oh, just Google on 'picture resizer' and you will find a bunch of free programs that will easily perform the resizing task for you.
|
178 |
|
179 |
+
== Changelog ==
|
180 |
|
181 |
+
See for additional information: http://wppa.opajaap.nl/changelog/
|
182 |
|
183 |
+
= 6.4.02 =
|
184 |
|
185 |
+
= Bug Fixes =
|
186 |
|
187 |
+
* Removed scoped styles. They only work in Firefox.
|
188 |
+
* Fixed incorrect initialisation in Import, resulting in failing to import .csv file if no photo import had been done before.
|
189 |
+
* All photos from mobile devices should be oriented correctly now. If you want to fix the orientation of existing photos: Tick Table VIII-A11a and run VIII-A11.
|
190 |
+
* Fixed a php warning if smilies are disabled in wp but not in wppa.
|
191 |
+
* Comment notifications were not always sent when multiple users should receive them. Fixed.
|
192 |
+
|
193 |
+
= Other Changes =
|
194 |
+
|
195 |
+
* Table VII-B12: Fe alert. Shows alertbox on successful front-end upload/create. Can now be switched off.
|
196 |
|
197 |
= 6.4.01 =
|
198 |
|
theme/wppa-style.css
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
/*
|
9 |
/* You may always look into a newer version of this file to see what new classes and id's come with an upgrade
|
10 |
/*
|
11 |
-
/* This is version 6.
|
12 |
*/
|
13 |
|
14 |
.wppa-container, .wppa-cover-box, .wppa-thumb-area {
|
@@ -455,4 +455,11 @@ display:none;
|
|
455 |
}
|
456 |
.wppa-message {
|
457 |
clear: both;
|
458 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
/*
|
9 |
/* You may always look into a newer version of this file to see what new classes and id's come with an upgrade
|
10 |
/*
|
11 |
+
/* This is version 6.4.02
|
12 |
*/
|
13 |
|
14 |
.wppa-container, .wppa-cover-box, .wppa-thumb-area {
|
455 |
}
|
456 |
.wppa-message {
|
457 |
clear: both;
|
458 |
+
}
|
459 |
+
|
460 |
+
.wppa-minicover-current div {
|
461 |
+
color:blue;
|
462 |
+
}
|
463 |
+
.wppa-minicover {
|
464 |
+
box-sizing:content-box !important;
|
465 |
+
}
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -21,7 +21,7 @@ function wppa_add_admin() {
|
|
21 |
global $wpdb;
|
22 |
|
23 |
// Make sure admin has access rights
|
24 |
-
if (
|
25 |
$wp_roles->add_cap( 'administrator', 'wppa_admin' );
|
26 |
$wp_roles->add_cap( 'administrator', 'wppa_upload' );
|
27 |
$wp_roles->add_cap( 'administrator', 'wppa_import' );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
21 |
global $wpdb;
|
22 |
|
23 |
// Make sure admin has access rights
|
24 |
+
if ( wppa_user_is( 'administrator' ) ) {
|
25 |
$wp_roles->add_cap( 'administrator', 'wppa_admin' );
|
26 |
$wp_roles->add_cap( 'administrator', 'wppa_upload' );
|
27 |
$wp_roles->add_cap( 'administrator', 'wppa_import' );
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 6.4.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -2072,6 +2072,35 @@ global $wppa_session;
|
|
2072 |
$value = '0';
|
2073 |
break;
|
2074 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2075 |
case 'wppa_fotomoto_on':
|
2076 |
if ( $value == 'yes' ) {
|
2077 |
$custom_content = wppa_opt( 'custom_content' );
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 6.4.02
|
6 |
*
|
7 |
*/
|
8 |
|
2072 |
$value = '0';
|
2073 |
break;
|
2074 |
|
2075 |
+
case 'wppa_superuser_user':
|
2076 |
+
// Does user exist?
|
2077 |
+
$value = trim ( $value );
|
2078 |
+
$user = get_user_by ( 'login', $value ); // seems to be case insensitive
|
2079 |
+
if ( $user && $user->user_login === $value ) {
|
2080 |
+
$super_users = get_option( 'wppa_super_users', array() );
|
2081 |
+
if ( ! in_array( $value, $super_users ) ) {
|
2082 |
+
$super_users[] = $value;
|
2083 |
+
update_option( 'wppa_super_users', $super_users );
|
2084 |
+
}
|
2085 |
+
$alert = esc_js( sprintf( __( 'User %s is now superuser.' , 'wp-photo-album-plus'), $value ) );
|
2086 |
+
}
|
2087 |
+
else {
|
2088 |
+
$alert = esc_js( sprintf( __( 'User %s does not exist.' , 'wp-photo-album-plus'), $value ) );
|
2089 |
+
}
|
2090 |
+
$value = '';
|
2091 |
+
break;
|
2092 |
+
|
2093 |
+
case 'wppa_un_superuser_user':
|
2094 |
+
$super_users = get_option( 'wppa_super_users', array() );
|
2095 |
+
if ( in_array( $value, $super_users ) ) {
|
2096 |
+
foreach ( array_keys( $super_users ) as $usr ) {
|
2097 |
+
if ( $super_users[$usr] == $value ) unset ( $super_users[$usr] );
|
2098 |
+
}
|
2099 |
+
update_option( 'wppa_super_users', $super_users );
|
2100 |
+
}
|
2101 |
+
$value = '0';
|
2102 |
+
break;
|
2103 |
+
|
2104 |
case 'wppa_fotomoto_on':
|
2105 |
if ( $value == 'yes' ) {
|
2106 |
$custom_content = wppa_opt( 'custom_content' );
|
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.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -293,7 +293,7 @@ function _wppa_admin() {
|
|
293 |
<?php } ?>
|
294 |
</td>
|
295 |
<td>
|
296 |
-
<?php if ( !
|
297 |
<span class="description" style="color:orange;" ><?php _e('WARNING If you change the owner, you will no longer be able to modify this album and upload or import photos to it!', 'wp-photo-album-plus'); ?></span>
|
298 |
<?php } ?>
|
299 |
<?php if ( $usercount > '1000' ) echo '<span class="description" >'.__('Enter user login name or <b>--- public ---</b>', 'wp-photo-album-plus'),'</span>' ?>
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* create, edit and delete albums
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
293 |
<?php } ?>
|
294 |
</td>
|
295 |
<td>
|
296 |
+
<?php if ( ! wppa_user_is( 'administrator' ) ) { ?>
|
297 |
<span class="description" style="color:orange;" ><?php _e('WARNING If you change the owner, you will no longer be able to modify this album and upload or import photos to it!', 'wp-photo-album-plus'); ?></span>
|
298 |
<?php } ?>
|
299 |
<?php if ( $usercount > '1000' ) echo '<span class="description" >'.__('Enter user login name or <b>--- public ---</b>', 'wp-photo-album-plus'),'</span>' ?>
|
wppa-album-covers.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for album covers
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1501,40 +1501,21 @@ global $wpdb;
|
|
1501 |
// Only if there are sub-albums
|
1502 |
if ( ! empty( $subs ) ) {
|
1503 |
|
1504 |
-
wppa_out( '<div>' );
|
1505 |
-
|
1506 |
-
// Local css
|
1507 |
-
if ( $top ) {
|
1508 |
-
if ( $is_list ) {
|
1509 |
-
wppa_out( '<style scoped="scoped" >' .
|
1510 |
-
'ul, li { margin:0; }' .
|
1511 |
-
'ul {' .
|
1512 |
-
'list-style-type:disc;' .
|
1513 |
-
'list-style-position:inside;' .
|
1514 |
-
'padding:0 0 0 24px;' .
|
1515 |
-
'}' .
|
1516 |
-
'li { cursor:pointer; }' .
|
1517 |
-
'</style>'
|
1518 |
-
);
|
1519 |
-
}
|
1520 |
-
if ( $display_type == 'microthumbs' ) {
|
1521 |
-
wppa_out( '<style scoped="scoped" >' .
|
1522 |
-
'img {' .
|
1523 |
-
'max-width:100px;' .
|
1524 |
-
'max-height:50px;' .
|
1525 |
-
'padding:1px;' .
|
1526 |
-
'margin:1px;' .
|
1527 |
-
'background-color:' . wppa_opt( 'bgcolor_img' ) . ';' .
|
1528 |
-
'float:left;' .
|
1529 |
-
'}' .
|
1530 |
-
'</style>'
|
1531 |
-
);
|
1532 |
-
}
|
1533 |
-
}
|
1534 |
|
1535 |
// Start list if required
|
1536 |
if ( $is_list ) {
|
1537 |
-
wppa_out(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1538 |
}
|
1539 |
else {
|
1540 |
wppa_out( '<div style="clear:both;" ></div>' );
|
@@ -1590,13 +1571,13 @@ global $wpdb;
|
|
1590 |
case 'list':
|
1591 |
case 'recursivelist':
|
1592 |
if ( $link_type == 'none' ) {
|
1593 |
-
wppa_out( '<li>' .
|
1594 |
wppa_get_album_name( $album['id'] ) .
|
1595 |
'</li>'
|
1596 |
);
|
1597 |
}
|
1598 |
else {
|
1599 |
-
wppa_out( '<li>' .
|
1600 |
'<a' .
|
1601 |
( $href_content ? ' href="' . $href_content . '"' : '' ) .
|
1602 |
( $onclick_content ? ' onclick="' . $onclick_content . '"' : '' ) .
|
@@ -1635,6 +1616,14 @@ global $wpdb;
|
|
1635 |
' class="wppa-cover-sublink-img"' .
|
1636 |
' src="' . $src . '"' .
|
1637 |
' alt="' . wppa_get_album_name( $album['id'] ) . '"' .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1638 |
' />'
|
1639 |
);
|
1640 |
}
|
@@ -1648,6 +1637,14 @@ global $wpdb;
|
|
1648 |
' class="wppa-cover-sublink-img"' .
|
1649 |
' src="' . $src . '"' .
|
1650 |
' alt="' . wppa_get_album_name( $album['id'] ) . '"' .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1651 |
' />' .
|
1652 |
'</a>'
|
1653 |
);
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for album covers
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
1501 |
// Only if there are sub-albums
|
1502 |
if ( ! empty( $subs ) ) {
|
1503 |
|
1504 |
+
wppa_out( '<div class="wppa-cover-sublist-container" >' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1505 |
|
1506 |
// Start list if required
|
1507 |
if ( $is_list ) {
|
1508 |
+
wppa_out( '<ul' .
|
1509 |
+
' class="wppa-cover-sublink-list"' .
|
1510 |
+
' style="' .
|
1511 |
+
'clear:both;' .
|
1512 |
+
'margin:0;' .
|
1513 |
+
'list-style-type:disc;' .
|
1514 |
+
'list-style-position:inside;' .
|
1515 |
+
'padding:0 0 0 24px;' .
|
1516 |
+
'"' .
|
1517 |
+
' >'
|
1518 |
+
);
|
1519 |
}
|
1520 |
else {
|
1521 |
wppa_out( '<div style="clear:both;" ></div>' );
|
1571 |
case 'list':
|
1572 |
case 'recursivelist':
|
1573 |
if ( $link_type == 'none' ) {
|
1574 |
+
wppa_out( '<li style="margin:0;cursor:pointer;" >' .
|
1575 |
wppa_get_album_name( $album['id'] ) .
|
1576 |
'</li>'
|
1577 |
);
|
1578 |
}
|
1579 |
else {
|
1580 |
+
wppa_out( '<li style="margin:0;cursor:pointer;" >' .
|
1581 |
'<a' .
|
1582 |
( $href_content ? ' href="' . $href_content . '"' : '' ) .
|
1583 |
( $onclick_content ? ' onclick="' . $onclick_content . '"' : '' ) .
|
1616 |
' class="wppa-cover-sublink-img"' .
|
1617 |
' src="' . $src . '"' .
|
1618 |
' alt="' . wppa_get_album_name( $album['id'] ) . '"' .
|
1619 |
+
' style="' .
|
1620 |
+
'max-width:100px;' .
|
1621 |
+
'max-height:50px;' .
|
1622 |
+
'padding:1px;' .
|
1623 |
+
'margin:1px;' .
|
1624 |
+
'background-color:' . wppa_opt( 'bgcolor_img' ) . ';' .
|
1625 |
+
'float:left;' .
|
1626 |
+
'"' .
|
1627 |
' />'
|
1628 |
);
|
1629 |
}
|
1637 |
' class="wppa-cover-sublink-img"' .
|
1638 |
' src="' . $src . '"' .
|
1639 |
' alt="' . wppa_get_album_name( $album['id'] ) . '"' .
|
1640 |
+
' style="' .
|
1641 |
+
'max-width:100px;' .
|
1642 |
+
'max-height:50px;' .
|
1643 |
+
'padding:1px;' .
|
1644 |
+
'margin:1px;' .
|
1645 |
+
'background-color:' . wppa_opt( 'bgcolor_img' ) . ';' .
|
1646 |
+
'float:left;' .
|
1647 |
+
'"' .
|
1648 |
' />' .
|
1649 |
'</a>'
|
1650 |
);
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*
|
9 |
*/
|
@@ -1895,7 +1895,7 @@ static $seqno;
|
|
1895 |
}
|
1896 |
|
1897 |
// One only ?
|
1898 |
-
if ( wppa_switch( 'upload_one_only' ) && !
|
1899 |
$result .=
|
1900 |
'<input' .
|
1901 |
' type="file"' .
|
@@ -1938,7 +1938,7 @@ static $seqno;
|
|
1938 |
}
|
1939 |
|
1940 |
// Explanation
|
1941 |
-
if ( ! wppa_switch( 'upload_one_only' ) && !
|
1942 |
if ( $max ) {
|
1943 |
$result .=
|
1944 |
'<span style="font-size:10px;" >' .
|
@@ -2790,9 +2790,11 @@ global $wpsmiliestrans;
|
|
2790 |
|
2791 |
// Fill inverted smilies array if needed
|
2792 |
if ( ! is_array( $wppa_smilies ) ) {
|
2793 |
-
|
2794 |
-
|
2795 |
-
$wppa_smilies[$wpsmiliestrans[$idx]]
|
|
|
|
|
2796 |
}
|
2797 |
}
|
2798 |
}
|
@@ -2809,7 +2811,7 @@ global $wpsmiliestrans;
|
|
2809 |
}
|
2810 |
}
|
2811 |
else {
|
2812 |
-
$result .= __( 'Smilies are not available', 'wp-photo-album-plus' );
|
2813 |
}
|
2814 |
|
2815 |
return $result;
|
@@ -3471,15 +3473,6 @@ global $wpdb;
|
|
3471 |
'"' .
|
3472 |
' >';
|
3473 |
|
3474 |
-
$result .= '<style type="text/css" scoped >' .
|
3475 |
-
'.wppa-minicover-current div {' .
|
3476 |
-
'color:blue;' .
|
3477 |
-
'}' .
|
3478 |
-
'.wppa-minicover {' .
|
3479 |
-
'box-sizing:content-box;' .
|
3480 |
-
'}' .
|
3481 |
-
'</style>';
|
3482 |
-
|
3483 |
$result .= '<script type="text/javascript" >' .
|
3484 |
'wppaWaitForCounter = 0;' .
|
3485 |
'</script>';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*
|
9 |
*/
|
1895 |
}
|
1896 |
|
1897 |
// One only ?
|
1898 |
+
if ( wppa_switch( 'upload_one_only' ) && ! wppa_user_is( 'administrator' ) ) {
|
1899 |
$result .=
|
1900 |
'<input' .
|
1901 |
' type="file"' .
|
1938 |
}
|
1939 |
|
1940 |
// Explanation
|
1941 |
+
if ( ! wppa_switch( 'upload_one_only' ) && ! wppa_user_is( 'administrator' ) ) {
|
1942 |
if ( $max ) {
|
1943 |
$result .=
|
1944 |
'<span style="font-size:10px;" >' .
|
2790 |
|
2791 |
// Fill inverted smilies array if needed
|
2792 |
if ( ! is_array( $wppa_smilies ) ) {
|
2793 |
+
if ( is_array( $wpsmiliestrans ) ) {
|
2794 |
+
foreach( array_keys( $wpsmiliestrans ) as $idx ) {
|
2795 |
+
if ( ! isset ( $wppa_smilies[$wpsmiliestrans[$idx]] ) ) {
|
2796 |
+
$wppa_smilies[$wpsmiliestrans[$idx]] = $idx;
|
2797 |
+
}
|
2798 |
}
|
2799 |
}
|
2800 |
}
|
2811 |
}
|
2812 |
}
|
2813 |
else {
|
2814 |
+
// $result .= __( 'Smilies are not available', 'wp-photo-album-plus' );
|
2815 |
}
|
2816 |
|
2817 |
return $result;
|
3473 |
'"' .
|
3474 |
' >';
|
3475 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3476 |
$result .= '<script type="text/javascript" >' .
|
3477 |
'wppaWaitForCounter = 0;' .
|
3478 |
'</script>';
|
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.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -638,7 +638,7 @@ global $current_user;
|
|
638 |
if ( ! $alb ) { // == 'any' ) {
|
639 |
|
640 |
// Administrator has always access OR If all albums are public
|
641 |
-
if (
|
642 |
$albs = $wpdb->get_results( "SELECT `id` FROM `".WPPA_ALBUMS."`" );
|
643 |
wppa_dbg_q( 'Q209' );
|
644 |
if ( $albs ) return true;
|
@@ -671,7 +671,7 @@ global $current_user;
|
|
671 |
else {
|
672 |
|
673 |
// Administrator has always access
|
674 |
-
if (
|
675 |
|
676 |
// If all albums are public
|
677 |
if ( ! wppa_switch( 'owner_only' ) ) return true;
|
@@ -740,6 +740,14 @@ global $wpdb;
|
|
740 |
$max_height = $screen[1];
|
741 |
}
|
742 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
743 |
// Is source more landscape or more portrait than max window
|
744 |
if ( $src_width/$src_height > $max_width/$max_height ) { // focus on width
|
745 |
$focus = 'W';
|
@@ -842,8 +850,8 @@ global $wpdb;
|
|
842 |
// Optimize file
|
843 |
wppa_optimize_image_file( $newimage );
|
844 |
|
845 |
-
// Create thumbnail...
|
846 |
-
wppa_create_thumbnail( $id );
|
847 |
}
|
848 |
else {
|
849 |
if ( is_admin() ) wppa_error_message( __( 'ERROR: Resized or copied image could not be created.' , 'wp-photo-album-plus') );
|
@@ -866,6 +874,12 @@ global $wpdb;
|
|
866 |
wppa_update_photo( array( 'id' => $id, 'exifdtm' => $exdt ) );
|
867 |
}
|
868 |
|
|
|
|
|
|
|
|
|
|
|
|
|
869 |
// Compute and save sizes
|
870 |
wppa_get_photox( $id, 'force' );
|
871 |
|
@@ -950,12 +964,19 @@ function wppa_create_thumbnail( $id, $use_source = true ) {
|
|
950 |
|
951 |
// Use source if requested and available
|
952 |
if ( $use_source ) {
|
|
|
953 |
if ( ! wppa_switch( 'watermark_thumbs' ) && is_file( $source_path ) ) {
|
954 |
$file = $source_path; // Use sourcefile
|
955 |
}
|
956 |
else {
|
957 |
$file = wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id ); // Use photofile
|
958 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
959 |
}
|
960 |
else {
|
961 |
$file = wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id ); // Use photofile
|
@@ -1059,7 +1080,6 @@ function wppa_create_thumbnail( $id, $use_source = true ) {
|
|
1059 |
wppa_log( 'Err', 'Unable to set background color to: '.$r.', '.$g.', '.$b.' in wppa_create_thumbnail' );
|
1060 |
}
|
1061 |
else {
|
1062 |
-
// wppa_log( 'dbg', 'Able to set background color to: '.$r.', '.$g.', '.$b.' in wppa_create_thumbnail' );
|
1063 |
imagefilledrectangle( $dst, 0, 0, $dst_size_w, $dst_size_h, $color );
|
1064 |
}
|
1065 |
}
|
@@ -1342,19 +1362,119 @@ static $labels;
|
|
1342 |
}
|
1343 |
|
1344 |
function wppa_get_exif_datetime( $file ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1345 |
// Check filetype
|
1346 |
-
if ( ! function_exists( 'exif_imagetype' ) ) return false; // Exif functions absent
|
1347 |
$image_type = @ exif_imagetype( $file );
|
1348 |
-
if ( $image_type != IMAGETYPE_JPEG )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1349 |
// Get exif data
|
1350 |
-
if ( ! function_exists( 'exif_read_data' ) ) return false; // Not supported by the server
|
1351 |
$exif = @ exif_read_data( $file, 'EXIF' );
|
1352 |
-
if ( ! is_array( $exif ) )
|
|
|
|
|
|
|
1353 |
// Data present
|
1354 |
-
if ( isset( $exif[
|
|
|
|
|
|
|
|
|
1355 |
return false;
|
1356 |
}
|
1357 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1358 |
function wppa_import_exif( $id, $file, $nodelete = false ) {
|
1359 |
global $wpdb;
|
1360 |
static $labels;
|
@@ -1540,14 +1660,14 @@ global $wppa;
|
|
1540 |
}
|
1541 |
elseif ( $reload == 'home' ) {
|
1542 |
echo '<script id="wppaer" type="text/javascript" >' .
|
1543 |
-
'alert( \''.esc_js( $msg ).'\' );' .
|
1544 |
'jQuery( "#wppaer" ).html( "" );' .
|
1545 |
'document.location.href="'.home_url().'";' .
|
1546 |
'</script>';
|
1547 |
}
|
1548 |
else {
|
1549 |
echo '<script id="wppaer" type="text/javascript" >' .
|
1550 |
-
'alert( \''.esc_js( $msg ).'\' );' .
|
1551 |
'jQuery( "#wppaer" ).html( "" );' .
|
1552 |
'document.location.reload( true );' .
|
1553 |
'</script>';
|
2 |
/* wppa-common-functions.php
|
3 |
*
|
4 |
* Functions used in admin and in themes
|
5 |
+
* Version 6.4.02
|
6 |
*
|
7 |
*/
|
8 |
|
638 |
if ( ! $alb ) { // == 'any' ) {
|
639 |
|
640 |
// Administrator has always access OR If all albums are public
|
641 |
+
if ( wppa_user_is( 'administrator' ) || ! wppa_switch( 'owner_only' ) ) {
|
642 |
$albs = $wpdb->get_results( "SELECT `id` FROM `".WPPA_ALBUMS."`" );
|
643 |
wppa_dbg_q( 'Q209' );
|
644 |
if ( $albs ) return true;
|
671 |
else {
|
672 |
|
673 |
// Administrator has always access
|
674 |
+
if ( wppa_user_is( 'administrator' ) ) return true; // Do NOT change this into 'wppa_admin', it will enable access to all albums at backend while owners only
|
675 |
|
676 |
// If all albums are public
|
677 |
if ( ! wppa_switch( 'owner_only' ) ) return true;
|
740 |
$max_height = $screen[1];
|
741 |
}
|
742 |
|
743 |
+
// If orientation needs +/- 90 deg rotation, swap max x and max y
|
744 |
+
$ori = wppa_get_exif_orientation( $file );
|
745 |
+
if ( $ori >= 5 && $ori <= 8 ) {
|
746 |
+
$t = $max_width;
|
747 |
+
$max_width = $max_height;
|
748 |
+
$max_height = $t;
|
749 |
+
}
|
750 |
+
|
751 |
// Is source more landscape or more portrait than max window
|
752 |
if ( $src_width/$src_height > $max_width/$max_height ) { // focus on width
|
753 |
$focus = 'W';
|
850 |
// Optimize file
|
851 |
wppa_optimize_image_file( $newimage );
|
852 |
|
853 |
+
// // Create thumbnail...
|
854 |
+
// wppa_create_thumbnail( $id );
|
855 |
}
|
856 |
else {
|
857 |
if ( is_admin() ) wppa_error_message( __( 'ERROR: Resized or copied image could not be created.' , 'wp-photo-album-plus') );
|
874 |
wppa_update_photo( array( 'id' => $id, 'exifdtm' => $exdt ) );
|
875 |
}
|
876 |
|
877 |
+
// Create thumbnail...
|
878 |
+
wppa_create_thumbnail( $id );
|
879 |
+
|
880 |
+
// Check orientation
|
881 |
+
wppa_orientate_image( $id, wppa_get_exif_orientation( $file ) );
|
882 |
+
|
883 |
// Compute and save sizes
|
884 |
wppa_get_photox( $id, 'force' );
|
885 |
|
964 |
|
965 |
// Use source if requested and available
|
966 |
if ( $use_source ) {
|
967 |
+
|
968 |
if ( ! wppa_switch( 'watermark_thumbs' ) && is_file( $source_path ) ) {
|
969 |
$file = $source_path; // Use sourcefile
|
970 |
}
|
971 |
else {
|
972 |
$file = wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id ); // Use photofile
|
973 |
}
|
974 |
+
|
975 |
+
// Non standard orientation files: never use source
|
976 |
+
$orient = wppa_get_exif_orientation( $file );
|
977 |
+
if ( $orient > '1' ) {
|
978 |
+
$file = wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id ); // Use photofile
|
979 |
+
}
|
980 |
}
|
981 |
else {
|
982 |
$file = wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id ); // Use photofile
|
1080 |
wppa_log( 'Err', 'Unable to set background color to: '.$r.', '.$g.', '.$b.' in wppa_create_thumbnail' );
|
1081 |
}
|
1082 |
else {
|
|
|
1083 |
imagefilledrectangle( $dst, 0, 0, $dst_size_w, $dst_size_h, $color );
|
1084 |
}
|
1085 |
}
|
1362 |
}
|
1363 |
|
1364 |
function wppa_get_exif_datetime( $file ) {
|
1365 |
+
|
1366 |
+
return wppa_get_exif_item( $file, 'DateTimeOriginal' );
|
1367 |
+
}
|
1368 |
+
|
1369 |
+
function wppa_get_exif_orientation( $file ) {
|
1370 |
+
|
1371 |
+
return wppa_get_exif_item( $file, 'Orientation' );
|
1372 |
+
}
|
1373 |
+
|
1374 |
+
function wppa_get_exif_item( $file, $item ) {
|
1375 |
+
|
1376 |
+
// File exists?
|
1377 |
+
if ( ! is_file( $file ) ) {
|
1378 |
+
return false;
|
1379 |
+
}
|
1380 |
+
|
1381 |
+
// Exif functions present?
|
1382 |
+
if ( ! function_exists( 'exif_imagetype' ) ) {
|
1383 |
+
return false;
|
1384 |
+
}
|
1385 |
+
|
1386 |
// Check filetype
|
|
|
1387 |
$image_type = @ exif_imagetype( $file );
|
1388 |
+
if ( $image_type != IMAGETYPE_JPEG ) {
|
1389 |
+
return false;
|
1390 |
+
}
|
1391 |
+
|
1392 |
+
// Can get exif data?
|
1393 |
+
if ( ! function_exists( 'exif_read_data' ) ) {
|
1394 |
+
return false;
|
1395 |
+
}
|
1396 |
+
|
1397 |
// Get exif data
|
|
|
1398 |
$exif = @ exif_read_data( $file, 'EXIF' );
|
1399 |
+
if ( ! is_array( $exif ) ) {
|
1400 |
+
return false;
|
1401 |
+
}
|
1402 |
+
|
1403 |
// Data present
|
1404 |
+
if ( isset( $exif[$item] ) ) {
|
1405 |
+
return $exif[$item];
|
1406 |
+
}
|
1407 |
+
|
1408 |
+
// Nothing found
|
1409 |
return false;
|
1410 |
}
|
1411 |
|
1412 |
+
function wppa_orientate_image( $id, $ori ) {
|
1413 |
+
|
1414 |
+
// If orientation right, do nothing
|
1415 |
+
if ( ! $ori || $ori == '1' ) {
|
1416 |
+
return;
|
1417 |
+
}
|
1418 |
+
|
1419 |
+
wppa_orientate_image_file( wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id ), $ori );
|
1420 |
+
wppa_bump_photo_rev();
|
1421 |
+
}
|
1422 |
+
|
1423 |
+
function wppa_orientate_image_file( $file, $ori ) {
|
1424 |
+
|
1425 |
+
// Validate args
|
1426 |
+
if ( ! is_file( $file ) ) {
|
1427 |
+
wppa_log( 'Err', 'File not found (wppa_orientate_image_file())' );
|
1428 |
+
return false;
|
1429 |
+
}
|
1430 |
+
if ( ! wppa_is_int( $ori ) || $ori < '2' || $ori > '8' ) {
|
1431 |
+
wppa_log( 'Err', 'Bad arg $ori:'.$ori.' (wppa_orientate_image_file())' );
|
1432 |
+
return false;
|
1433 |
+
}
|
1434 |
+
|
1435 |
+
// Load image
|
1436 |
+
$source = imagecreatefromjpeg( $file );
|
1437 |
+
|
1438 |
+
// Perform operation
|
1439 |
+
switch ( $ori ) {
|
1440 |
+
case '2':
|
1441 |
+
$orientate = $source;
|
1442 |
+
imageflip( $orientate, IMG_FLIP_HORIZONTAL );
|
1443 |
+
break;
|
1444 |
+
case '3':
|
1445 |
+
$orientate = imagerotate( $source, 180, 0 );
|
1446 |
+
break;
|
1447 |
+
case '4':
|
1448 |
+
$orientate = $source;
|
1449 |
+
imageflip( $orientate, IMG_FLIP_VERTICAL );
|
1450 |
+
break;
|
1451 |
+
case '5':
|
1452 |
+
$orientate = imagerotate( $source, 270, 0 );
|
1453 |
+
imageflip( $orientate, IMG_FLIP_HORIZONTAL );
|
1454 |
+
break;
|
1455 |
+
case '6':
|
1456 |
+
$orientate = imagerotate( $source, 270, 0 );
|
1457 |
+
break;
|
1458 |
+
case '7':
|
1459 |
+
$orientate = imagerotate( $source, 90, 0 );
|
1460 |
+
imageflip( $orientate, IMG_FLIP_HORIZONTAL );
|
1461 |
+
break;
|
1462 |
+
case '8':
|
1463 |
+
$orientate = imagerotate( $source, 90, 0 );
|
1464 |
+
break;
|
1465 |
+
}
|
1466 |
+
|
1467 |
+
// Output
|
1468 |
+
imagejpeg( $orientate, $file, wppa_opt( 'jpeg_quality' ) );
|
1469 |
+
|
1470 |
+
// Free the memory
|
1471 |
+
imagedestroy( $source );
|
1472 |
+
@ imagedestroy( $orientate );
|
1473 |
+
|
1474 |
+
// Done
|
1475 |
+
return true;
|
1476 |
+
}
|
1477 |
+
|
1478 |
function wppa_import_exif( $id, $file, $nodelete = false ) {
|
1479 |
global $wpdb;
|
1480 |
static $labels;
|
1660 |
}
|
1661 |
elseif ( $reload == 'home' ) {
|
1662 |
echo '<script id="wppaer" type="text/javascript" >' .
|
1663 |
+
( $msg ? 'alert( \''.esc_js( $msg ).'\' );' : '' ) .
|
1664 |
'jQuery( "#wppaer" ).html( "" );' .
|
1665 |
'document.location.href="'.home_url().'";' .
|
1666 |
'</script>';
|
1667 |
}
|
1668 |
else {
|
1669 |
echo '<script id="wppaer" type="text/javascript" >' .
|
1670 |
+
( $msg ? 'alert( \''.esc_js( $msg ).'\' );' : '' ) .
|
1671 |
'jQuery( "#wppaer" ).html( "" );' .
|
1672 |
'document.location.reload( true );' .
|
1673 |
'</script>';
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various funcions
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -2151,19 +2151,19 @@ global $wppa_done;
|
|
2151 |
$cont['5'] = __( 'You receive this email as you are assigned to moderate' , 'wp-photo-album-plus');
|
2152 |
// Send!
|
2153 |
wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
|
2154 |
-
$sentto[] = $moduser->
|
2155 |
}
|
2156 |
if ( wppa_opt( 'comment_notify' ) == 'admin' || wppa_opt( 'comment_notify' ) == 'both' || wppa_opt( 'comment_notify' ) == 'upadmin' ) {
|
2157 |
// Mail admin
|
2158 |
$moduser = get_user_by( 'id', '1' );
|
2159 |
-
if ( ! in_array( $moduser->
|
2160 |
$to = get_bloginfo( 'admin_email' );
|
2161 |
$cont['3'] = $cont2;
|
2162 |
$cont['4'] = $cont3;
|
2163 |
$cont['5'] = __( 'You receive this email as administrator of the site' , 'wp-photo-album-plus');
|
2164 |
// Send!
|
2165 |
wppa_send_mail( $to, $subj, $cont, $photo, $email, $returnurl );
|
2166 |
-
$sentto[] = $moduser->
|
2167 |
}
|
2168 |
}
|
2169 |
if ( wppa_opt( 'comment_notify' ) == 'upload' || wppa_opt( 'comment_notify' ) == 'upadmin' || wppa_opt( 'comment_notify' ) == 'upowner' ) {
|
@@ -2171,7 +2171,7 @@ global $wppa_done;
|
|
2171 |
$uploader = $wpdb->get_var( $wpdb->prepare( "SELECT `owner` FROM `".WPPA_PHOTOS."` WHERE `id` = %d", $id ) );
|
2172 |
$moduser = get_user_by( 'login', $uploader );
|
2173 |
if ( $moduser ) { // else it's an ip address ( anonymus uploader )
|
2174 |
-
if ( ! in_array( $moduser->
|
2175 |
$to = $moduser->user_email;
|
2176 |
$cont['3'] = user_can( $moduser, 'wppa_comments' ) ? $cont2 : '';
|
2177 |
if ( user_can( $moduser, 'wppa_admin' ) ) $cont['4'] = $cont3;
|
@@ -2180,7 +2180,7 @@ global $wppa_done;
|
|
2180 |
$cont['5'] = __( 'You receive this email as uploader of the photo' , 'wp-photo-album-plus');
|
2181 |
// Send!
|
2182 |
wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
|
2183 |
-
$sentto[] = $moduser->
|
2184 |
}
|
2185 |
}
|
2186 |
}
|
@@ -2190,14 +2190,14 @@ global $wppa_done;
|
|
2190 |
$owner = $wpdb->get_var( $wpdb->prepare( "SELECT `owner` FROM `".WPPA_ALBUMS."` WHERE `id` = %d", $alb ) );
|
2191 |
if ( $owner == '--- public ---' ) $owner = 'admin';
|
2192 |
$moduser = get_user_by( 'login', $owner );
|
2193 |
-
if ( ! in_array( $moduser->
|
2194 |
$to = $moduser->user_email;
|
2195 |
if ( user_can( $moduser, 'wppa_comments' ) ) $cont['3'] = $cont2; else $cont['3'] = '';
|
2196 |
if ( user_can( $moduser, 'wppa_admin' ) ) $cont['4'] = $cont3; else $cont['4'] = '';
|
2197 |
$cont['5'] = __( 'You receive this email as owner of the album' , 'wp-photo-album-plus');
|
2198 |
// Send!
|
2199 |
wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
|
2200 |
-
$sentto[] = $moduser->
|
2201 |
}
|
2202 |
}
|
2203 |
if ( wppa_switch( 'com_notify_previous' ) ) {
|
@@ -3920,7 +3920,9 @@ static $done;
|
|
3920 |
'owner' => wppa_switch( 'frontend_album_public' ) ? '--- public ---' : wppa_get_user()
|
3921 |
) );
|
3922 |
if ( $album ) {
|
3923 |
-
|
|
|
|
|
3924 |
wppa_flush_treecounts( $parent );
|
3925 |
wppa_create_pl_htaccess();
|
3926 |
}
|
@@ -3972,6 +3974,8 @@ static $done;
|
|
3972 |
}
|
3973 |
$points = '0';
|
3974 |
$alert = '';
|
|
|
|
|
3975 |
if ( $done ) {
|
3976 |
|
3977 |
//SUCCESSFUL UPLOAD, ADD POINTS
|
@@ -3979,6 +3983,12 @@ static $done;
|
|
3979 |
$bret = wppa_add_credit_points( $points, __( 'Photo upload' ,'wp-photo-album-plus' ) );
|
3980 |
$alert .= sprintf( _n( '%d photo successfully uploaded', '%d photos successfully uploaded', $done, 'wp-photo-album-plus' ), $done );
|
3981 |
if ( $bret ) $alert .= ' ' . sprintf( __( '%s points added' ,'wp-photo-album-plus'), $points );
|
|
|
|
|
|
|
|
|
|
|
|
|
3982 |
}
|
3983 |
if ( $fail ) {
|
3984 |
if ( ! $done ) {
|
@@ -3987,9 +3997,8 @@ static $done;
|
|
3987 |
else {
|
3988 |
$alert .= sprintf( _n( '%d upload failed', '%d uploads failed', $fail, 'wp-photo-album-plus' ), $fail );
|
3989 |
}
|
|
|
3990 |
}
|
3991 |
-
$reload = wppa_switch( 'home_after_upload' ) && $done ? 'home' : false;
|
3992 |
-
wppa_alert( $alert, $reload );
|
3993 |
}
|
3994 |
}
|
3995 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various funcions
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
2151 |
$cont['5'] = __( 'You receive this email as you are assigned to moderate' , 'wp-photo-album-plus');
|
2152 |
// Send!
|
2153 |
wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
|
2154 |
+
$sentto[] = $moduser->user_login;
|
2155 |
}
|
2156 |
if ( wppa_opt( 'comment_notify' ) == 'admin' || wppa_opt( 'comment_notify' ) == 'both' || wppa_opt( 'comment_notify' ) == 'upadmin' ) {
|
2157 |
// Mail admin
|
2158 |
$moduser = get_user_by( 'id', '1' );
|
2159 |
+
if ( ! in_array( $moduser->user_login, $sentto ) ) { // Already sent him?
|
2160 |
$to = get_bloginfo( 'admin_email' );
|
2161 |
$cont['3'] = $cont2;
|
2162 |
$cont['4'] = $cont3;
|
2163 |
$cont['5'] = __( 'You receive this email as administrator of the site' , 'wp-photo-album-plus');
|
2164 |
// Send!
|
2165 |
wppa_send_mail( $to, $subj, $cont, $photo, $email, $returnurl );
|
2166 |
+
$sentto[] = $moduser->user_login;
|
2167 |
}
|
2168 |
}
|
2169 |
if ( wppa_opt( 'comment_notify' ) == 'upload' || wppa_opt( 'comment_notify' ) == 'upadmin' || wppa_opt( 'comment_notify' ) == 'upowner' ) {
|
2171 |
$uploader = $wpdb->get_var( $wpdb->prepare( "SELECT `owner` FROM `".WPPA_PHOTOS."` WHERE `id` = %d", $id ) );
|
2172 |
$moduser = get_user_by( 'login', $uploader );
|
2173 |
if ( $moduser ) { // else it's an ip address ( anonymus uploader )
|
2174 |
+
if ( ! in_array( $moduser->user_login, $sentto ) ) { // Already sent him?
|
2175 |
$to = $moduser->user_email;
|
2176 |
$cont['3'] = user_can( $moduser, 'wppa_comments' ) ? $cont2 : '';
|
2177 |
if ( user_can( $moduser, 'wppa_admin' ) ) $cont['4'] = $cont3;
|
2180 |
$cont['5'] = __( 'You receive this email as uploader of the photo' , 'wp-photo-album-plus');
|
2181 |
// Send!
|
2182 |
wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
|
2183 |
+
$sentto[] = $moduser->user_login;
|
2184 |
}
|
2185 |
}
|
2186 |
}
|
2190 |
$owner = $wpdb->get_var( $wpdb->prepare( "SELECT `owner` FROM `".WPPA_ALBUMS."` WHERE `id` = %d", $alb ) );
|
2191 |
if ( $owner == '--- public ---' ) $owner = 'admin';
|
2192 |
$moduser = get_user_by( 'login', $owner );
|
2193 |
+
if ( ! in_array( $moduser->user_login, $sentto ) ) { // Already sent him?
|
2194 |
$to = $moduser->user_email;
|
2195 |
if ( user_can( $moduser, 'wppa_comments' ) ) $cont['3'] = $cont2; else $cont['3'] = '';
|
2196 |
if ( user_can( $moduser, 'wppa_admin' ) ) $cont['4'] = $cont3; else $cont['4'] = '';
|
2197 |
$cont['5'] = __( 'You receive this email as owner of the album' , 'wp-photo-album-plus');
|
2198 |
// Send!
|
2199 |
wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
|
2200 |
+
$sentto[] = $moduser->user_login;
|
2201 |
}
|
2202 |
}
|
2203 |
if ( wppa_switch( 'com_notify_previous' ) ) {
|
3920 |
'owner' => wppa_switch( 'frontend_album_public' ) ? '--- public ---' : wppa_get_user()
|
3921 |
) );
|
3922 |
if ( $album ) {
|
3923 |
+
if ( wppa_switch( 'fe_alert' ) ) {
|
3924 |
+
wppa_alert( sprintf( __( 'Album #%s created' , 'wp-photo-album-plus'), $album ) );
|
3925 |
+
}
|
3926 |
wppa_flush_treecounts( $parent );
|
3927 |
wppa_create_pl_htaccess();
|
3928 |
}
|
3974 |
}
|
3975 |
$points = '0';
|
3976 |
$alert = '';
|
3977 |
+
$reload = wppa_switch( 'home_after_upload' ) && $done ? 'home' : false;
|
3978 |
+
|
3979 |
if ( $done ) {
|
3980 |
|
3981 |
//SUCCESSFUL UPLOAD, ADD POINTS
|
3983 |
$bret = wppa_add_credit_points( $points, __( 'Photo upload' ,'wp-photo-album-plus' ) );
|
3984 |
$alert .= sprintf( _n( '%d photo successfully uploaded', '%d photos successfully uploaded', $done, 'wp-photo-album-plus' ), $done );
|
3985 |
if ( $bret ) $alert .= ' ' . sprintf( __( '%s points added' ,'wp-photo-album-plus'), $points );
|
3986 |
+
if ( wppa_switch( 'fe_alert' ) ) {
|
3987 |
+
wppa_alert( $alert, $reload );
|
3988 |
+
}
|
3989 |
+
else {
|
3990 |
+
wppa_alert( '', $reload );
|
3991 |
+
}
|
3992 |
}
|
3993 |
if ( $fail ) {
|
3994 |
if ( ! $done ) {
|
3997 |
else {
|
3998 |
$alert .= sprintf( _n( '%d upload failed', '%d uploads failed', $fail, 'wp-photo-album-plus' ), $fail );
|
3999 |
}
|
4000 |
+
wppa_alert( $alert, $reload );
|
4001 |
}
|
|
|
|
|
4002 |
}
|
4003 |
}
|
4004 |
}
|
wppa-maintenance.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains (not yet, but in the future maybe) all the maintenance routines
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -411,7 +411,19 @@ global $wppa_supported_audio_extensions;
|
|
411 |
break;
|
412 |
|
413 |
case 'wppa_remake':
|
414 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
$wppa_session[$slug.'_fixed']++;
|
416 |
}
|
417 |
else {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains (not yet, but in the future maybe) all the maintenance routines
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
411 |
break;
|
412 |
|
413 |
case 'wppa_remake':
|
414 |
+
if ( wppa_switch( 'wppa_remake_orientation_only' ) ) {
|
415 |
+
$ori = wppa_get_exif_orientation( wppa_get_source_path( $id ) );
|
416 |
+
if ( $ori > '1'&& $ori < '9' ) {
|
417 |
+
$doit = true;
|
418 |
+
}
|
419 |
+
else {
|
420 |
+
$doit = false;
|
421 |
+
}
|
422 |
+
}
|
423 |
+
else {
|
424 |
+
$doit = true;
|
425 |
+
}
|
426 |
+
if ( $doit && wppa_remake_files( '', $id ) ) {
|
427 |
$wppa_session[$slug.'_fixed']++;
|
428 |
}
|
429 |
else {
|
wppa-photo-admin-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -117,7 +117,7 @@ global $wpdb;
|
|
117 |
if ( empty( $photos ) ) {
|
118 |
if ( $photo ) echo '<p>'.__( 'This photo is no longer awaiting moderation.' , 'wp-photo-album-plus').'</p>';
|
119 |
else echo '<p>'.__( 'There are no photos awaiting moderation at this time.' , 'wp-photo-album-plus').'</p>';
|
120 |
-
if (
|
121 |
echo '<h3>'.__( 'Manage all photos by timestamp' , 'wp-photo-album-plus').'</h3>';
|
122 |
$count = $wpdb->get_var( "SELECT COUNT(*) FROM `".WPPA_PHOTOS."`" );
|
123 |
$photos = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` ORDER BY `timestamp` DESC".$limit, ARRAY_A );
|
@@ -341,7 +341,7 @@ global $wpdb;
|
|
341 |
</tr>
|
342 |
|
343 |
<!-- P_order -->
|
344 |
-
<?php if ( ! wppa_switch( 'porder_restricted' ) ||
|
345 |
<tr >
|
346 |
<th >
|
347 |
<label><?php _e( 'Photo sort order #:' , 'wp-photo-album-plus'); ?></label>
|
@@ -398,7 +398,7 @@ global $wpdb;
|
|
398 |
<?php } ?>
|
399 |
|
400 |
<!-- Link url -->
|
401 |
-
<?php if ( ! wppa_switch( 'link_is_restricted' ) ||
|
402 |
<tr >
|
403 |
<th >
|
404 |
<label><?php _e( 'Link url:' , 'wp-photo-album-plus') ?></label>
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
117 |
if ( empty( $photos ) ) {
|
118 |
if ( $photo ) echo '<p>'.__( 'This photo is no longer awaiting moderation.' , 'wp-photo-album-plus').'</p>';
|
119 |
else echo '<p>'.__( 'There are no photos awaiting moderation at this time.' , 'wp-photo-album-plus').'</p>';
|
120 |
+
if ( wppa_user_is( 'administrator' ) ) {
|
121 |
echo '<h3>'.__( 'Manage all photos by timestamp' , 'wp-photo-album-plus').'</h3>';
|
122 |
$count = $wpdb->get_var( "SELECT COUNT(*) FROM `".WPPA_PHOTOS."`" );
|
123 |
$photos = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` ORDER BY `timestamp` DESC".$limit, ARRAY_A );
|
341 |
</tr>
|
342 |
|
343 |
<!-- P_order -->
|
344 |
+
<?php if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) { ?>
|
345 |
<tr >
|
346 |
<th >
|
347 |
<label><?php _e( 'Photo sort order #:' , 'wp-photo-album-plus'); ?></label>
|
398 |
<?php } ?>
|
399 |
|
400 |
<!-- Link url -->
|
401 |
+
<?php if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) { ?>
|
402 |
<tr >
|
403 |
<th >
|
404 |
<label><?php _e( 'Link url:' , 'wp-photo-album-plus') ?></label>
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -5907,6 +5907,17 @@ global $wppa_tags;
|
|
5907 |
$tags = 'upload';
|
5908 |
wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
|
5909 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5910 |
wppa_setting_subheader( 'C', '2', __('Admin Functionality restrictions for non administrators' , 'wp-photo-album-plus') );
|
5911 |
|
5912 |
$name = __('Alt thumb is restricted', 'wp-photo-album-plus');
|
@@ -6183,7 +6194,60 @@ global $wppa_tags;
|
|
6183 |
$tags = 'access,system';
|
6184 |
wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
|
6185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6186 |
?>
|
|
|
6187 |
</tbody>
|
6188 |
<tfoot style="font-weight: bold;" class="wppa_table_7">
|
6189 |
<tr>
|
@@ -6416,6 +6480,20 @@ global $wppa_tags;
|
|
6416 |
$tags = 'system';
|
6417 |
wppa_setting(false, '11', $name, $desc, $html, $help, $clas, $tags);
|
6418 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6419 |
$name = __('Recalc sizes', 'wp-photo-album-plus');
|
6420 |
$desc = __('Recalculate photosizes and save to db.', 'wp-photo-album-plus');
|
6421 |
$help = '';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
5907 |
$tags = 'upload';
|
5908 |
wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
|
5909 |
|
5910 |
+
$name = __('Fe alert', 'wp-photo-album-plus');
|
5911 |
+
$desc = __('Show alertbox on successful front-end upload/create.', 'wp-photo-album-plus');
|
5912 |
+
$help = '';
|
5913 |
+
$slug = 'wppa_fe_alert';
|
5914 |
+
$html1 = wppa_checkbox($slug);
|
5915 |
+
$html2 = '';
|
5916 |
+
$html = array( $html1, $html2 );
|
5917 |
+
$clas = '';
|
5918 |
+
$tags = 'upload';
|
5919 |
+
wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags);
|
5920 |
+
|
5921 |
wppa_setting_subheader( 'C', '2', __('Admin Functionality restrictions for non administrators' , 'wp-photo-album-plus') );
|
5922 |
|
5923 |
$name = __('Alt thumb is restricted', 'wp-photo-album-plus');
|
6194 |
$tags = 'access,system';
|
6195 |
wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
|
6196 |
|
6197 |
+
$name = __('Super user', 'wp-photo-album-plus');
|
6198 |
+
$desc = __('Give these users all rights in wppa.', 'wp-photo-album-plus');
|
6199 |
+
$help = esc_js(__('This gives the user all the administrator privileges within wppa.', 'wp-photo-album-plus'));
|
6200 |
+
$help .= '\n\n'.esc_js(__('Make sure the user also has a role that has all the boxes ticked in Table VII-A', 'wp-photo-album-plus'));
|
6201 |
+
$slug = 'wppa_superuser_user';
|
6202 |
+
// $users = wppa_get_users(); // Already known
|
6203 |
+
$superlist = get_option( 'wppa_super_users', array() );
|
6204 |
+
|
6205 |
+
if ( wppa_get_user_count() <= wppa_opt( 'max_users' ) ) {
|
6206 |
+
$options = array( __('--- select a user to make superuser ---', 'wp-photo-album-plus') );
|
6207 |
+
$values = array( '0' );
|
6208 |
+
foreach ( $users as $usr ) {
|
6209 |
+
if ( ! wppa_user_is( 'administrator', $usr['ID'] ) ) { // an administrator can not be made superuser
|
6210 |
+
if ( ! in_array( $usr['user_login'], $superlist ) ) { // skip already on superlist
|
6211 |
+
$options[] = $usr['display_name'].' ('.$usr['user_login'].')';
|
6212 |
+
$values[] = $usr['user_login'];
|
6213 |
+
}
|
6214 |
+
}
|
6215 |
+
}
|
6216 |
+
$onchange = 'alert(\''.__('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus').'\');wppaRefreshAfter();';
|
6217 |
+
$html1 = wppa_select($slug, $options, $values, $onchange);
|
6218 |
+
$html2 = '';
|
6219 |
+
}
|
6220 |
+
else { // over 1000 users
|
6221 |
+
$onchange = 'alert(\''.__('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus').'\');wppaRefreshAfter();';
|
6222 |
+
$html1 = __( 'User login name <b>( case sensitive! )</b>:' , 'wp-photo-album-plus');
|
6223 |
+
$html2 = wppa_input ( $slug, '150px', '', '', $onchange );
|
6224 |
+
}
|
6225 |
+
$html = array( $html1, $html2 );
|
6226 |
+
$clas = '';
|
6227 |
+
$tags = 'access,system';
|
6228 |
+
wppa_setting(false, '11', $name, $desc, $html, $help, $clas, $tags);
|
6229 |
+
|
6230 |
+
$name = __('Unsuper user', 'wp-photo-album-plus');
|
6231 |
+
$desc = __('Remove user from super user list.', 'wp-photo-album-plus');
|
6232 |
+
$help = '';
|
6233 |
+
$slug = 'wppa_un_superuser_user';
|
6234 |
+
$superlist = get_option( 'wppa_super_users', array() );
|
6235 |
+
$options = array( __('--- select a user to unmake superuser ---', 'wp-photo-album-plus') );
|
6236 |
+
$values = array( '0' );
|
6237 |
+
foreach ( $superlist as $usr ) {
|
6238 |
+
$u = get_user_by( 'login', $usr );
|
6239 |
+
$options[] = $u->display_name.' ('.$u->user_login.')';
|
6240 |
+
$values[] = $u->user_login;
|
6241 |
+
}
|
6242 |
+
$onchange = 'alert(\''.__('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus').'\');wppaRefreshAfter();';
|
6243 |
+
$html1 = wppa_select($slug, $options, $values, $onchange);
|
6244 |
+
$html2 = '';
|
6245 |
+
$html = array( $html1, $html2 );
|
6246 |
+
$clas = '';
|
6247 |
+
$tags = 'access,system';
|
6248 |
+
wppa_setting(false, '12', $name, $desc, $html, $help, $clas, $tags);
|
6249 |
?>
|
6250 |
+
|
6251 |
</tbody>
|
6252 |
<tfoot style="font-weight: bold;" class="wppa_table_7">
|
6253 |
<tr>
|
6480 |
$tags = 'system';
|
6481 |
wppa_setting(false, '11', $name, $desc, $html, $help, $clas, $tags);
|
6482 |
|
6483 |
+
$name = __('Orientation only', 'wp-photo-album-plus');
|
6484 |
+
$desc = __('Remake non standard orientated photos only.', 'wp-photo-album-plus');
|
6485 |
+
$help = '';
|
6486 |
+
$slug1 = '';
|
6487 |
+
$slug2 = 'wppa_remake_orientation_only';
|
6488 |
+
$html1 = '';
|
6489 |
+
$html2 = wppa_checkbox( $slug2 );
|
6490 |
+
$html3 = wppa_status_field( $slug2 );
|
6491 |
+
$html4 = wppa_togo_field( $slug2 );
|
6492 |
+
$html = array($html1, $html2, $html3, $html4);
|
6493 |
+
$clas = '';
|
6494 |
+
$tags = 'system';
|
6495 |
+
wppa_setting(false, '11a', $name, $desc, $html, $help, $clas, $tags);
|
6496 |
+
|
6497 |
$name = __('Recalc sizes', 'wp-photo-album-plus');
|
6498 |
$desc = __('Recalculate photosizes and save to db.', 'wp-photo-album-plus');
|
6499 |
$help = '';
|
wppa-setup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1183,6 +1183,7 @@ Hide Camera info
|
|
1183 |
'wppa_upload_fronend_maxsize' => '0',
|
1184 |
'wppa_void_dups' => 'no',
|
1185 |
'wppa_home_after_upload' => 'no',
|
|
|
1186 |
|
1187 |
'wppa_editor_upload_limit_count' => '0',
|
1188 |
'wppa_editor_upload_limit_time' => '0',
|
@@ -1198,6 +1199,8 @@ Hide Camera info
|
|
1198 |
'wppa_blacklist_user' => '',
|
1199 |
'wppa_un_blacklist_user' => '',
|
1200 |
'wppa_photo_owner_change' => 'no',
|
|
|
|
|
1201 |
|
1202 |
// Table VIII: Actions
|
1203 |
// A Harmless
|
@@ -1212,6 +1215,7 @@ Hide Camera info
|
|
1212 |
'wppa_recup' => '',
|
1213 |
'wppa_file_system' => 'flat',
|
1214 |
'wppa_remake' => '',
|
|
|
1215 |
'wppa_remake_skip_one' => '',
|
1216 |
'wppa_errorlog_purge' => '',
|
1217 |
'wppa_comp_sizes' => '',
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
1183 |
'wppa_upload_fronend_maxsize' => '0',
|
1184 |
'wppa_void_dups' => 'no',
|
1185 |
'wppa_home_after_upload' => 'no',
|
1186 |
+
'wppa_fe_alert' => 'yes',
|
1187 |
|
1188 |
'wppa_editor_upload_limit_count' => '0',
|
1189 |
'wppa_editor_upload_limit_time' => '0',
|
1199 |
'wppa_blacklist_user' => '',
|
1200 |
'wppa_un_blacklist_user' => '',
|
1201 |
'wppa_photo_owner_change' => 'no',
|
1202 |
+
'wppa_superuser_user' => '',
|
1203 |
+
'wppa_un_superuser_user' => '',
|
1204 |
|
1205 |
// Table VIII: Actions
|
1206 |
// A Harmless
|
1215 |
'wppa_recup' => '',
|
1216 |
'wppa_file_system' => 'flat',
|
1217 |
'wppa_remake' => '',
|
1218 |
+
'wppa_remake_orientation_only' => 'no',
|
1219 |
'wppa_remake_skip_one' => '',
|
1220 |
'wppa_errorlog_purge' => '',
|
1221 |
'wppa_comp_sizes' => '',
|
wppa-slideshow.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the slideshow high level functions
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1015,12 +1015,6 @@ function wppa_slide_filmstrip( $opt = '' ) {
|
|
1015 |
);
|
1016 |
}
|
1017 |
|
1018 |
-
wppa_out( '<style type="text/css" scoped >' .
|
1019 |
-
'.thumbnail-frame { ' . wppa_get_thumb_frame_style( false, 'film' ) . ' }' .
|
1020 |
-
'.wppa-filmthumb-active { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }' .
|
1021 |
-
'</style>'
|
1022 |
-
);
|
1023 |
-
|
1024 |
$cnt = count( $thumbs );
|
1025 |
$start = $cnt - $preambule;
|
1026 |
$end = $cnt;
|
@@ -1077,28 +1071,10 @@ function wppa_startstop_icons() {
|
|
1077 |
if ( ! wppa_switch( 'show_start_stop_icons' ) ) {
|
1078 |
return;
|
1079 |
}
|
1080 |
-
/*
|
1081 |
-
$type = wppa_opt( 'start_stop_icons_type' );
|
1082 |
-
|
1083 |
-
// Set type dependant dimensions
|
1084 |
-
switch ( $type ) {
|
1085 |
-
case 'r.png':
|
1086 |
-
$size = '72';
|
1087 |
-
$curv = '36';
|
1088 |
-
break;
|
1089 |
-
default:
|
1090 |
-
*/
|
1091 |
-
$size = wppa_opt( 'start_pause_symbol_size' );
|
1092 |
-
$curv = wppa_opt( 'start_pause_symbol_bradius' );
|
1093 |
-
/*
|
1094 |
-
}
|
1095 |
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
$curv /= '2';
|
1100 |
-
}
|
1101 |
-
*/
|
1102 |
// Create and output the html
|
1103 |
wppa_out( '<img' .
|
1104 |
' id="wppa-startstop-icon-' . wppa( 'mocc' ) . '"' .
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the slideshow high level functions
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
1015 |
);
|
1016 |
}
|
1017 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1018 |
$cnt = count( $thumbs );
|
1019 |
$start = $cnt - $preambule;
|
1020 |
$end = $cnt;
|
1071 |
if ( ! wppa_switch( 'show_start_stop_icons' ) ) {
|
1072 |
return;
|
1073 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1074 |
|
1075 |
+
$size = wppa_opt( 'start_pause_symbol_size' );
|
1076 |
+
$curv = wppa_opt( 'start_pause_symbol_bradius' );
|
1077 |
+
|
|
|
|
|
|
|
1078 |
// Create and output the html
|
1079 |
wppa_out( '<img' .
|
1080 |
' id="wppa-startstop-icon-' . wppa( 'mocc' ) . '"' .
|
wppa-thumbnails.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Various funcions to display a thumbnail image
|
6 |
* Contains all possible frontend thumbnail types
|
7 |
*
|
8 |
-
* Version 6.4.
|
9 |
*
|
10 |
*/
|
11 |
|
@@ -1711,7 +1711,7 @@ function wppa_do_filmthumb( $id, $idx, $do_for_feed = false, $glue = false ) {
|
|
1711 |
|
1712 |
// If ! $do_for_feed: pre-or post-ambule. To avoid dup id change it in that case
|
1713 |
$tmp = $do_for_feed ? 'film' : 'pre';
|
1714 |
-
$style = $glue ? 'style="'.wppa_get_thumb_frame_style( $glue, 'film' ).'"' : '';
|
1715 |
$result .= '<div' .
|
1716 |
' id="'.$tmp.'_wppatnf_'.wppa_encrypt_photo($thumb['id']).'_'.wppa( 'mocc' ).'"' .
|
1717 |
' class="thumbnail-frame"' .
|
5 |
* Various funcions to display a thumbnail image
|
6 |
* Contains all possible frontend thumbnail types
|
7 |
*
|
8 |
+
* Version 6.4.02
|
9 |
*
|
10 |
*/
|
11 |
|
1711 |
|
1712 |
// If ! $do_for_feed: pre-or post-ambule. To avoid dup id change it in that case
|
1713 |
$tmp = $do_for_feed ? 'film' : 'pre';
|
1714 |
+
$style = $glue ? 'style="'.wppa_get_thumb_frame_style( $glue, 'film' ).'"' : 'style="'.wppa_get_thumb_frame_style( false, 'film' ).'"';
|
1715 |
$result .= '<div' .
|
1716 |
' id="'.$tmp.'_wppatnf_'.wppa_encrypt_photo($thumb['id']).'_'.wppa( 'mocc' ).'"' .
|
1717 |
' class="thumbnail-frame"' .
|
wppa-upload.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the upload/import pages and functions
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -64,7 +64,7 @@ global $wppa_revno;
|
|
64 |
$err = wppa_upload_zip();
|
65 |
if ( isset( $_POST['wppa-go-import'] ) && $err == '0' ) {
|
66 |
wppa_ok_message( __( 'Connecting to your depot...' , 'wp-photo-album-plus' ) );
|
67 |
-
update_option( 'wppa_import_source_'.$user,
|
68 |
<script type="text/javascript">document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_import_photos&zip='.$target, 'js' ) ) ?>';</script>
|
69 |
<?php }
|
70 |
}
|
@@ -105,7 +105,7 @@ global $wppa_revno;
|
|
105 |
|
106 |
// chek if albums exist before allowing upload
|
107 |
if ( wppa_has_albums() ) {
|
108 |
-
if ( wppa_switch( 'upload_one_only' ) && !
|
109 |
/* One only */ ?>
|
110 |
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px; width: 600px;">
|
111 |
<h3 style="margin-top:0px;"><?php _e( 'Upload a single photo' , 'wp-photo-album-plus'); ?></h3>
|
@@ -520,7 +520,7 @@ global $wppa_session;
|
|
520 |
|
521 |
?>
|
522 |
<form action="<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_import_photos' ) ) ?>" method="post">
|
523 |
-
<?php if (
|
524 |
|
525 |
<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >
|
526 |
<?php
|
@@ -1219,7 +1219,7 @@ function wppa_get_import_files() {
|
|
1219 |
|
1220 |
// Dispatch on source type local/remote
|
1221 |
elseif ( $source_type == 'local' ) {
|
1222 |
-
$source = get_option( 'wppa_import_source_'.$user,
|
1223 |
$source_path = $source; // Filesystem
|
1224 |
$files = glob( $source_path . '/*' );
|
1225 |
}
|
@@ -1462,7 +1462,7 @@ global $wppa_supported_audio_extensions;
|
|
1462 |
$user = wppa_get_user();
|
1463 |
$source_type = get_option( 'wppa_import_source_type_'.$user, 'local' );
|
1464 |
if ( $source_type == 'remote' ) wppa( 'is_remote', true );
|
1465 |
-
$source = get_option( 'wppa_import_source_'.$user,
|
1466 |
|
1467 |
$depot = WPPA_ABSPATH . $source; // Filesystem
|
1468 |
$depoturl = get_bloginfo( 'wpurl' ).'/'.$source; // url
|
@@ -1974,7 +1974,7 @@ global $wppa_supported_audio_extensions;
|
|
1974 |
return;
|
1975 |
}
|
1976 |
$write_handle = fopen( $file, "wt" );
|
1977 |
-
if ( ! $
|
1978 |
wppa_error_message( __( 'Can not open file. Can not continue. (2)' , 'wp-photo-album-plus') );
|
1979 |
return;
|
1980 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the upload/import pages and functions
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
64 |
$err = wppa_upload_zip();
|
65 |
if ( isset( $_POST['wppa-go-import'] ) && $err == '0' ) {
|
66 |
wppa_ok_message( __( 'Connecting to your depot...' , 'wp-photo-album-plus' ) );
|
67 |
+
update_option( 'wppa_import_source_'.$user, WPPA_DEPOT_PATH ); ?>
|
68 |
<script type="text/javascript">document.location = '<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_import_photos&zip='.$target, 'js' ) ) ?>';</script>
|
69 |
<?php }
|
70 |
}
|
105 |
|
106 |
// chek if albums exist before allowing upload
|
107 |
if ( wppa_has_albums() ) {
|
108 |
+
if ( wppa_switch( 'upload_one_only' ) && ! wppa_user_is( 'administrator' ) ) {
|
109 |
/* One only */ ?>
|
110 |
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px; width: 600px;">
|
111 |
<h3 style="margin-top:0px;"><?php _e( 'Upload a single photo' , 'wp-photo-album-plus'); ?></h3>
|
520 |
|
521 |
?>
|
522 |
<form action="<?php echo( wppa_dbg_url( get_admin_url().'admin.php?page=wppa_import_photos' ) ) ?>" method="post">
|
523 |
+
<?php if ( wppa_user_is( 'administrator' ) || ! wppa_switch( 'chgsrc_is_restricted' ) ) { ?>
|
524 |
|
525 |
<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >
|
526 |
<?php
|
1219 |
|
1220 |
// Dispatch on source type local/remote
|
1221 |
elseif ( $source_type == 'local' ) {
|
1222 |
+
$source = get_option( 'wppa_import_source_'.$user, WPPA_DEPOT_PATH );
|
1223 |
$source_path = $source; // Filesystem
|
1224 |
$files = glob( $source_path . '/*' );
|
1225 |
}
|
1462 |
$user = wppa_get_user();
|
1463 |
$source_type = get_option( 'wppa_import_source_type_'.$user, 'local' );
|
1464 |
if ( $source_type == 'remote' ) wppa( 'is_remote', true );
|
1465 |
+
$source = get_option( 'wppa_import_source_'.$user, WPPA_DEPOT_PATH );
|
1466 |
|
1467 |
$depot = WPPA_ABSPATH . $source; // Filesystem
|
1468 |
$depoturl = get_bloginfo( 'wpurl' ).'/'.$source; // url
|
1974 |
return;
|
1975 |
}
|
1976 |
$write_handle = fopen( $file, "wt" );
|
1977 |
+
if ( ! $write_handle ) {
|
1978 |
wppa_error_message( __( 'Can not open file. Can not continue. (2)' , 'wp-photo-album-plus') );
|
1979 |
return;
|
1980 |
}
|
wppa-users.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains user and capabilities related routines
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -72,6 +72,10 @@ function wppa_user_is( $role, $user_id = null ) {
|
|
72 |
|
73 |
if ( ! is_user_logged_in() ) return false;
|
74 |
|
|
|
|
|
|
|
|
|
75 |
if ( is_numeric( $user_id ) ) {
|
76 |
$user = get_userdata( $user_id );
|
77 |
}
|
@@ -235,3 +239,15 @@ static $result = -1;
|
|
235 |
|
236 |
return in_array( $user, $blacklist );
|
237 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains user and capabilities related routines
|
6 |
+
* Version 6.4.02
|
7 |
*
|
8 |
*/
|
9 |
|
72 |
|
73 |
if ( ! is_user_logged_in() ) return false;
|
74 |
|
75 |
+
if ( $role == 'administrator' && wppa_is_user_superuser() ) {
|
76 |
+
return true;
|
77 |
+
}
|
78 |
+
|
79 |
if ( is_numeric( $user_id ) ) {
|
80 |
$user = get_userdata( $user_id );
|
81 |
}
|
239 |
|
240 |
return in_array( $user, $blacklist );
|
241 |
}
|
242 |
+
|
243 |
+
function wppa_is_user_superuser() {
|
244 |
+
|
245 |
+
$login = wppa_get_user();
|
246 |
+
|
247 |
+
$superlist = get_option( 'wppa_super_users', array() );
|
248 |
+
|
249 |
+
if ( in_array( $login, $superlist ) ) {
|
250 |
+
return true;
|
251 |
+
}
|
252 |
+
return false;
|
253 |
+
}
|
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.4.
|
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/
|
@@ -34,7 +34,7 @@ global $wppa_revno; $wppa_revno = '6401';
|
|
34 |
/* This is the api interface version number
|
35 |
/* It is incremented at any code change.
|
36 |
*/
|
37 |
-
global $wppa_api_version; $wppa_api_version = '6-4-
|
38 |
|
39 |
/* start timers */
|
40 |
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.4.02
|
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/
|
34 |
/* This is the api interface version number
|
35 |
/* It is incremented at any code change.
|
36 |
*/
|
37 |
+
global $wppa_api_version; $wppa_api_version = '6-4-02-005';
|
38 |
|
39 |
/* start timers */
|
40 |
global $wppa_starttime; $wppa_starttime = microtime(true);
|