Version Description
= 7.0.01 =
- This version addresses various minor bug fixes and feature requests.
= 7.0.00 =
- Shortcode generators for Gutenberg added.
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
- To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised. Configure Table IX-M to enable various mailing lists, and use the WPPA+ Notify widget for full user flexibility.
= 6.9.21 =
- This version addresses various bug fixes
- This version addresses various security issues.
= 6.9.20 =
- This version addresses various bug fixes
= 6.9.19 =
- This version addresses various minor bug fixes
= 6.9.18 =
- This version addresses various minor bug fixes
= 6.9.17 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.16 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.15 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.14 =
- This version addresses various minor bug fixes and feature requests.
- This version addresses various security issues.
= 6.9.13 =
- Security release.
= 6.9.12 =
- This version addresses various minor bug fixes and performance improvements.
= 6.9.11 =
- This version addresses various minor bug fixes and performance improvements.
= 6.9.10 =
- This version addresses various minor bug fixes and performance improvements.
= 6.9.09 =
- Panorama support phase III.
= 6.9.08 =
- This version addresses various minor bug fixes and feature requests.
- Panorama support phase II.
= 6.9.07 =
- This version addresses various minor bug fixes and feature requests.
- Panorama support phase I.
= 6.9.06 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.05 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.04 =
- This version addresses various minor bug fixes and feature requests.
- Local CDN functionality has been added.
= 6.9.03 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.02 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.01 =
- This version addresses various minor bug fixes and feature requests.
= 6.9.00 =
- This version includes the code for the privacy policy requirements.
= 6.8.09
- This version addresses various bug fixes and code edits.
= 6.8.08 =
- This version addresses various minor bug fixes and feature requests.
- This version offers substantial performance improvements when the box in Table IV-A13: Defer Javascript is ticked. This setting is now recommended and set ticked as the default.
- For more info on performance improvements and compatibility with optimizers: see the changelog.txt
= 6.8.07 =
- This version addresses various minor bug fixes and enhancements, and a new widget: Statistics.
= 6.8.06 =
- This version addresses various minor bug fixes and improved cache handling.
= 6.8.05 =
- This version addresses various minor bug fixes and feture requests.
= 6.8.04 =
- This version addresses various display issues and a few fixes of bugs that seldom affected the plugins behaviour.
Download this release
Release Info
Developer | opajaap |
Plugin | ![]() |
Version | 7.0.01.006 |
Comparing to | |
See all releases |
Code changes from version 7.0.00.016 to 7.0.01.006
- changelog.txt +15 -0
- js/wppa-utils.js +7 -1
- js/wppa-utils.min.js +1 -1
- readme.txt +6 -2
- wppa-ajax.php +8 -6
- wppa-boxes-html.php +5 -4
- wppa-cron.php +39 -9
- wppa-functions.php +10 -4
- wppa-init.php +20 -2
- wppa-items.php +2 -2
- wppa-links.php +242 -100
- wppa-non-admin.php +2 -2
- wppa-session.php +2 -2
- wppa-settings-autosave.php +27 -28
- wppa-setup.php +17 -16
- wppa-utils.php +40 -10
- wppa-wpdb-insert.php +13 -7
- wppa-wpdb-update.php +17 -1
- wppa-wrappers.php +4 -3
- wppa.php +3 -3
changelog.txt
CHANGED
@@ -1,5 +1,20 @@
|
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 7.0.00 =
|
4 |
|
5 |
= Bug Fixes =
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
3 |
+
= 7.0.01 =
|
4 |
+
|
5 |
+
= Bug Fixes =
|
6 |
+
|
7 |
+
* Front-end uploaddialog: when admin, multiple uploads should be possible even when one only was activated. Fixed. ($one_only = wppa_switch( 'upload_one_only' ) && ! wppa_user_is( 'administrator' );)
|
8 |
+
* Front-end uploaddialog: very long filenames distorted layout. Fixed. (onclick="wppaSetMaxWidthToParentWidth(this);" on the visual button)
|
9 |
+
* Link on thumbnail to lightbox did not work when the photo has audio. Fixed. (wppa_fix_poster_ext() now also works on versioned urls)
|
10 |
+
* Automatic cache clearing stopped working, fixed. (WPPA_UPLOAD_PATH . '/cache' is now a safe root)
|
11 |
+
|
12 |
+
= Other Changes =
|
13 |
+
|
14 |
+
* Table IV-A6: Enable pretty links - is now a selectionbox with three options: none, classic, and compressed.
|
15 |
+
Compressed makes a bit better human readable urls when using album and photonames in urls is activated.
|
16 |
+
* Compatibility with WPGlobus as alternative to qTranslate.
|
17 |
+
|
18 |
= 7.0.00 =
|
19 |
|
20 |
= Bug Fixes =
|
js/wppa-utils.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
//
|
3 |
// conatins common vars and functions
|
4 |
//
|
5 |
-
var wppaJsUtilsVersion = '7.0.
|
6 |
var wppaDebug;
|
7 |
|
8 |
// Trim
|
@@ -409,5 +409,11 @@ function wppaEntityDecode( txt ) {
|
|
409 |
return result;
|
410 |
}
|
411 |
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
// Say we're in
|
413 |
wppaConsoleLog( 'wppa-utils.js version '+wppaJsUtilsVersion+' loaded.', 'force' );
|
2 |
//
|
3 |
// conatins common vars and functions
|
4 |
//
|
5 |
+
var wppaJsUtilsVersion = '7.0.01';
|
6 |
var wppaDebug;
|
7 |
|
8 |
// Trim
|
409 |
return result;
|
410 |
}
|
411 |
|
412 |
+
// For tye fe upload select button
|
413 |
+
function wppaSetMaxWidthToParentWidth(elm) {
|
414 |
+
var w = elm.parentNode.clientWidth;
|
415 |
+
jQuery(elm).css({maxWidth:w});
|
416 |
+
}
|
417 |
+
|
418 |
// Say we're in
|
419 |
wppaConsoleLog( 'wppa-utils.js version '+wppaJsUtilsVersion+' loaded.', 'force' );
|
js/wppa-utils.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wppaDebug,wppaJsUtilsVersion="7.0.
|
1 |
+
var wppaDebug,wppaJsUtilsVersion="7.0.01";function wppaTrim(e,t){return wppaTrimRight(wppaTrimLeft(e,t),t)}function wppaTrimLeft(e,t){var a,r,p,n,o,i,s;switch(typeof t){case"string":for(r=(a=e).length,p=t.length;p<=r&&a.substr(0,p)==t;)r=(a=a.substr(p)).length;break;case"object":for(o=!1,s=e;!o;){for(n=0,i=s;n<t.length;)s=wppaTrimLeft(s,t[n]),n++;o=i==s}a=s;break;default:return e.replace(/^\s\s*/,"")}return a}function wppaTrimRight(e,t){var a,r,p,n,o,i,s;switch(typeof t){case"string":for(r=(a=e).length,p=t.length;p<=r&&a.substr(r-p)==t;)r=(a=a.substr(0,r-p)).length;break;case"object":for(o=!1,s=e;!o;){for(n=0,i=s;n<t.length;)s=wppaTrimRight(s,t[n]),n++;o=i==s}a=s;break;default:return e.replace(/\s\s*$/,"")}return a}function wppa_setCookie(e,t,a){var r=new Date;r.setDate(r.getDate()+a);var p=escape(t)+(null==a?"":"; expires="+r.toUTCString());document.cookie=e+"="+p}function wppa_getCookie(e){var t,a,r,p=document.cookie.split(";");for(t=0;t<p.length;t++)if(a=p[t].substr(0,p[t].indexOf("=")),r=p[t].substr(p[t].indexOf("=")+1),(a=a.replace(/^\s+|\s+$/g,""))==e)return unescape(r);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,t){if("undefined"!=typeof console&&(wppaDebug||"force"==t)){var a=(new Date).getTime()%864e5,r=Math.floor(a/36e5);a-=60*r*60*1e3;var p=Math.floor(a/6e4);a-=60*p*1e3;var n=Math.floor(a/1e3);a-=1e3*n,console.log("At: "+r+":"+p+":"+n+"."+a+" message: "+e)}}function wppaSvgHtml(e,t,a,r,p,n,o,i){var s,l,c;switch(p||(p="0"),n||(n="10"),o||(o="20"),i||(i="50"),!1,wppaSvgCornerStyle){case"gif":case"none":radius=p;break;case"light":radius=n;break;case"medium":radius=o;break;case"heavy":radius=i}t||(t="32px"),a?(s=wppaOvlSvgFillcolor,l=wppaOvlSvgBgcolor):(s=wppaSvgFillcolor,l=wppaSvgBgcolor),c=wppaUseSvg?wppaImageDirectory+e+".svg":wppaImageDirectory+e+".png";if(wppaUseSvg&&"-1"!=jQuery.inArray(e,["Next-Button","Prev-Button","Backward-Button","Forward-Button","Pause-Button","Play-Button","Stop-Button","Eagle-1","Snail","Exit","Full-Screen","Exit-Full-Screen","Content-View"])){var u='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;'+(t?"height:"+t+";":"")+"fill:"+s+";background-color:"+l+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":u+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":u+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":u+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":u+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":u+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":u+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Full-Screen":u+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Exit-Full-Screen":u+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;default:alert("Native svg "+e+" not implemented")}u+="</g></svg>"}else u='<img src="'+c+'"'+(wppaUseSvg?' class="wppa-svg"':"")+' style="height:'+t+";fill:"+s+";background-color:"+l+";"+(radius?"border-radius:"+radius+"%;":"")+(wppaUseSvg?"display:none;":"")+'text-decoration:none !important;vertical-align:middle;" />';return u}var wppaLastLazy=0;function wppaMakeLazyVisible(){var e,t=(new Date).getTime();t<wppaLastLazy+200||(jQuery(".wppa-lazy").each(function(){e=jQuery(this).attr("data-src"),wppaLazyLoad&&!wppaIsElementInViewport(this)||(jQuery(this).attr("src",e),jQuery(this).removeAttr("data-src"),jQuery(this).removeClass("wppa-lazy"))}),wppaLastLazy=t)}function wppaIsElementInViewport(e){var t=e.getBoundingClientRect();return!t||0<t.bottom&&0<t.right&&t.left<jQuery(window).width()&&t.top<jQuery(window).height()}function wppaSizeThumbArea(){0<wppaThumbAreaMaxFrac&&wppaThumbAreaMaxFrac<1&&jQuery(".wppa-thumb-area").css("max-height",jQuery(window).height()*wppaThumbAreaMaxFrac)}function wppaIconSize(e,t,a){var r=a?wppaIconSizeSlide:wppaIconSizeNormal;return"default"==r?t:(wppaIsMini[e]?r/2:r)+"px;"}function wppaEntityDecode(e){return e.split("&").join("&").split(">").join(">").split("<").join("<").split(""").join('"').split("'").join("'")}function wppaSetMaxWidthToParentWidth(e){var t=e.parentNode.clientWidth;jQuery(e).css({maxWidth:t})}wppaConsoleLog("wppa-utils.js version "+wppaJsUtilsVersion+" loaded.","force");
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
-
Version: 7.0.
|
6 |
-
Stable tag:
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -137,6 +137,10 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
|
|
137 |
|
138 |
== Upgrade Notice ==
|
139 |
|
|
|
|
|
|
|
|
|
140 |
= 7.0.00 =
|
141 |
|
142 |
* Shortcode generators for Gutenberg added.
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
+
Version: 7.0.01
|
6 |
+
Stable tag: 7.0.00.016
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
137 |
|
138 |
== Upgrade Notice ==
|
139 |
|
140 |
+
= 7.0.01 =
|
141 |
+
|
142 |
+
* This version addresses various minor bug fixes and feature requests.
|
143 |
+
|
144 |
= 7.0.00 =
|
145 |
|
146 |
* Shortcode generators for Gutenberg added.
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 7.0.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -392,21 +392,21 @@ global $wppa_log_file;
|
|
392 |
|
393 |
// Name
|
394 |
if ( isset( $_POST['name'] ) ) {
|
395 |
-
$name = strip_tags( $_POST['name'] );
|
396 |
wppa_update_photo( array( 'id' => $photo, 'name' => $name ) );
|
397 |
}
|
398 |
|
399 |
// Description
|
400 |
if ( isset( $_POST['description'] ) ) {
|
401 |
$desc = str_replace( array( '<br/>','<br>' ), '<br />', $_POST['description'] );
|
402 |
-
$desc = balanceTags( $desc, true );
|
403 |
-
wppa_update_photo( array( 'id' => $photo, 'description' => $
|
404 |
}
|
405 |
|
406 |
// Tags
|
407 |
if ( isset( $_POST['tags'] ) ) {
|
408 |
$tags = wppa_sanitize_tags( $_POST['tags'] );
|
409 |
-
wppa_update_photo( array( 'id' => $photo, 'tags' => $
|
410 |
}
|
411 |
|
412 |
// Custom fields
|
@@ -3507,7 +3507,9 @@ global $wppa_log_file;
|
|
3507 |
$output = '||'.$error.'||'.esc_attr( $title ).'||'.esc_js( $alert ).'||'.$crondata;
|
3508 |
|
3509 |
echo $output;
|
3510 |
-
|
|
|
|
|
3511 |
wppa_exit();
|
3512 |
break; // End update-option
|
3513 |
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 7.0.01
|
6 |
*
|
7 |
*/
|
8 |
|
392 |
|
393 |
// Name
|
394 |
if ( isset( $_POST['name'] ) ) {
|
395 |
+
$name = stripslashes( strip_tags( $_POST['name'] ) );
|
396 |
wppa_update_photo( array( 'id' => $photo, 'name' => $name ) );
|
397 |
}
|
398 |
|
399 |
// Description
|
400 |
if ( isset( $_POST['description'] ) ) {
|
401 |
$desc = str_replace( array( '<br/>','<br>' ), '<br />', $_POST['description'] );
|
402 |
+
$desc = stripslashes( balanceTags( $desc, true ) );
|
403 |
+
wppa_update_photo( array( 'id' => $photo, 'description' => $desc ) );
|
404 |
}
|
405 |
|
406 |
// Tags
|
407 |
if ( isset( $_POST['tags'] ) ) {
|
408 |
$tags = wppa_sanitize_tags( $_POST['tags'] );
|
409 |
+
wppa_update_photo( array( 'id' => $photo, 'tags' => $tags ) );
|
410 |
}
|
411 |
|
412 |
// Custom fields
|
3507 |
$output = '||'.$error.'||'.esc_attr( $title ).'||'.esc_js( $alert ).'||'.$crondata;
|
3508 |
|
3509 |
echo $output;
|
3510 |
+
if ( $option != 'wppa_heartbeat' ) {
|
3511 |
+
wppa_clear_cache();
|
3512 |
+
}
|
3513 |
wppa_exit();
|
3514 |
break; // End update-option
|
3515 |
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -231,7 +231,7 @@ global $wppa_session;
|
|
231 |
}
|
232 |
|
233 |
$result .= '<option value="" >' . __( '--- all ---', 'wp-photo-album-plus' ) . '</option>';
|
234 |
-
foreach( array_keys( $cats ) as $cat ) {
|
235 |
$result .= '<option value="' . $cat . '" ' . ( $current == $cat ? 'selected="selected"' : '' ) . ' >' . $cat . '</option>';
|
236 |
}
|
237 |
$result .=
|
@@ -2662,7 +2662,7 @@ static $albums_granted;
|
|
2662 |
$result .= wppa_get_dlg_item( $head, $body, $big );
|
2663 |
|
2664 |
|
2665 |
-
$one_only = wppa_switch( 'upload_one_only' );
|
2666 |
$multiple = ! $one_only;
|
2667 |
$on_camera = wppa_switch( 'camera_connect' );
|
2668 |
$may_video = wppa_switch( 'user_upload_video_on' );
|
@@ -2728,6 +2728,7 @@ static $albums_granted;
|
|
2728 |
' class="wppa-upload-button"' .
|
2729 |
' value="' . $value . '"' .
|
2730 |
' onclick="' .
|
|
|
2731 |
'jQuery(\'#wppa-user-upload-' . $yalb . '-' . $mocc . '\').removeAttr(\'capture\');' .
|
2732 |
'jQuery( \'#wppa-user-upload-' . $yalb . '-' . $mocc . '\' ).click();' .
|
2733 |
'"' .
|
@@ -2759,7 +2760,7 @@ static $albums_granted;
|
|
2759 |
}
|
2760 |
|
2761 |
// Explanation
|
2762 |
-
if (
|
2763 |
$max = 1;
|
2764 |
}
|
2765 |
// if ( ! wppa_switch( 'upload_one_only' ) ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*/
|
9 |
|
231 |
}
|
232 |
|
233 |
$result .= '<option value="" >' . __( '--- all ---', 'wp-photo-album-plus' ) . '</option>';
|
234 |
+
if ( ! empty( $cats ) ) foreach( array_keys( $cats ) as $cat ) {
|
235 |
$result .= '<option value="' . $cat . '" ' . ( $current == $cat ? 'selected="selected"' : '' ) . ' >' . $cat . '</option>';
|
236 |
}
|
237 |
$result .=
|
2662 |
$result .= wppa_get_dlg_item( $head, $body, $big );
|
2663 |
|
2664 |
|
2665 |
+
$one_only = wppa_switch( 'upload_one_only' ) && ! wppa_user_is( 'administrator' );
|
2666 |
$multiple = ! $one_only;
|
2667 |
$on_camera = wppa_switch( 'camera_connect' );
|
2668 |
$may_video = wppa_switch( 'user_upload_video_on' );
|
2728 |
' class="wppa-upload-button"' .
|
2729 |
' value="' . $value . '"' .
|
2730 |
' onclick="' .
|
2731 |
+
'wppaSetMaxWidthToParentWidth(this);' .
|
2732 |
'jQuery(\'#wppa-user-upload-' . $yalb . '-' . $mocc . '\').removeAttr(\'capture\');' .
|
2733 |
'jQuery( \'#wppa-user-upload-' . $yalb . '-' . $mocc . '\' ).click();' .
|
2734 |
'"' .
|
2760 |
}
|
2761 |
|
2762 |
// Explanation
|
2763 |
+
if ( $one_only ) {
|
2764 |
$max = 1;
|
2765 |
}
|
2766 |
// if ( ! wppa_switch( 'upload_one_only' ) ) {
|
wppa-cron.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all cron functions
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*
|
9 |
*/
|
@@ -163,6 +163,13 @@ global $wpdb;
|
|
163 |
|
164 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} started.' );
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
// Start renew crypt processes if configured socket_accept
|
167 |
if ( wppa_opt( 'crypt_albums_every' ) ) {
|
168 |
$last = get_option( 'wppa_crypt_albums_lasttimestamp', '0' );
|
@@ -274,11 +281,6 @@ global $wpdb;
|
|
274 |
|
275 |
// Add new users to default mailing list subscriptions
|
276 |
if ( wppa_opt( 'mailinglist_policy' ) == 'opt-out' ) {
|
277 |
-
$ini = ini_get( 'max_execution_time' );
|
278 |
-
if ( ! $ini ) {
|
279 |
-
$ini = 30;
|
280 |
-
}
|
281 |
-
$endtime = time() + $ini - 5;
|
282 |
|
283 |
$from = get_option( 'wppa_mailinglist_highest_user_auto_subscribed', 0 );
|
284 |
$to = $wpdb->get_var( "SELECT ID from {$wpdb->users} ORDER BY ID DESC LIMIT 1" );
|
@@ -308,6 +310,32 @@ global $wpdb;
|
|
308 |
}
|
309 |
}
|
310 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} completed.' );
|
312 |
|
313 |
$outbuf = ob_get_clean();
|
@@ -321,6 +349,7 @@ global $wpdb;
|
|
321 |
add_action( 'wppa_clear_cache', 'wppa_do_clear_cache' );
|
322 |
|
323 |
function wppa_schedule_clear_cache( $time = 10 ) {
|
|
|
324 |
|
325 |
// Are we temp disbled?
|
326 |
if ( wppa_switch( 'maint_ignore_cron' ) ) {
|
@@ -329,7 +358,7 @@ function wppa_schedule_clear_cache( $time = 10 ) {
|
|
329 |
|
330 |
// If a cron job is scheduled cancel the request
|
331 |
$next_scheduled = wp_next_scheduled( 'wppa_clear_cache' );
|
332 |
-
|
333 |
if ( $next_scheduled ) {
|
334 |
return;
|
335 |
}
|
@@ -345,11 +374,12 @@ function wppa_schedule_clear_cache( $time = 10 ) {
|
|
345 |
*/
|
346 |
|
347 |
// Schedule new event
|
348 |
-
if ( ! wp_next_scheduled( 'wppa_clear_cache' ) ) {
|
349 |
|
350 |
wp_schedule_single_event( time() + $time, 'wppa_clear_cache' );
|
|
|
351 |
|
352 |
-
wppa_log( 'Cron', '{b}wppa_clear_cache{/b} scheduled for run in ' . $time . ' sec.' );
|
353 |
}
|
354 |
}
|
355 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all cron functions
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*
|
9 |
*/
|
163 |
|
164 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} started.' );
|
165 |
|
166 |
+
// Init timer
|
167 |
+
$ini = ini_get( 'max_execution_time' );
|
168 |
+
if ( ! $ini ) {
|
169 |
+
$ini = 30;
|
170 |
+
}
|
171 |
+
$endtime = time() + $ini - 5;
|
172 |
+
|
173 |
// Start renew crypt processes if configured socket_accept
|
174 |
if ( wppa_opt( 'crypt_albums_every' ) ) {
|
175 |
$last = get_option( 'wppa_crypt_albums_lasttimestamp', '0' );
|
281 |
|
282 |
// Add new users to default mailing list subscriptions
|
283 |
if ( wppa_opt( 'mailinglist_policy' ) == 'opt-out' ) {
|
|
|
|
|
|
|
|
|
|
|
284 |
|
285 |
$from = get_option( 'wppa_mailinglist_highest_user_auto_subscribed', 0 );
|
286 |
$to = $wpdb->get_var( "SELECT ID from {$wpdb->users} ORDER BY ID DESC LIMIT 1" );
|
310 |
}
|
311 |
}
|
312 |
|
313 |
+
// Add url-sanitized names to new albums
|
314 |
+
$albs = $wpdb->get_results( "SELECT id, name FROM {$wpdb->wppa_albums} WHERE sname = ''", ARRAY_A );
|
315 |
+
if ( ! empty( $albs ) ) {
|
316 |
+
foreach( $albs as $alb ) {
|
317 |
+
wppa_update_album( array( 'id' => $alb['id'], 'sname' => wppa_sanitize_album_photo_name( $alb['name'] ) ) );
|
318 |
+
wppa_log( 'dbg', 'Set sname from ' . $alb['name'] . ' to ' . wppa_sanitize_album_photo_name( $alb['name'] ) . ' for album ' . $alb['id'] );
|
319 |
+
}
|
320 |
+
}
|
321 |
+
|
322 |
+
// Add url-sanitized names to new albums
|
323 |
+
$photos = true;
|
324 |
+
while ( time() < $endtime && $photos ) {
|
325 |
+
$photos = $wpdb->get_results( "SELECT id, name FROM {$wpdb->wppa_photos} WHERE sname = '' LIMIT 100", ARRAY_A );
|
326 |
+
if ( ! empty( $photos ) ) {
|
327 |
+
foreach( $photos as $photo ) {
|
328 |
+
wppa_update_photo( array( 'id' => $photo['id'], 'sname' => wppa_sanitize_album_photo_name( $photo['name'] ) ) );
|
329 |
+
wppa_log( 'dbg', 'Set sname from ' . $photo['name'] . ' to ' . wppa_sanitize_album_photo_name( $photo['name'] ) . ' for photo ' . $photo['id'] );
|
330 |
+
}
|
331 |
+
}
|
332 |
+
}
|
333 |
+
|
334 |
+
// Done?
|
335 |
+
if ( ! empty( $photos ) ) {
|
336 |
+
wppa_schedule_cleanup( 'now' );
|
337 |
+
}
|
338 |
+
|
339 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} completed.' );
|
340 |
|
341 |
$outbuf = ob_get_clean();
|
349 |
add_action( 'wppa_clear_cache', 'wppa_do_clear_cache' );
|
350 |
|
351 |
function wppa_schedule_clear_cache( $time = 10 ) {
|
352 |
+
static $done;
|
353 |
|
354 |
// Are we temp disbled?
|
355 |
if ( wppa_switch( 'maint_ignore_cron' ) ) {
|
358 |
|
359 |
// If a cron job is scheduled cancel the request
|
360 |
$next_scheduled = wp_next_scheduled( 'wppa_clear_cache' );
|
361 |
+
|
362 |
if ( $next_scheduled ) {
|
363 |
return;
|
364 |
}
|
374 |
*/
|
375 |
|
376 |
// Schedule new event
|
377 |
+
if ( ! wp_next_scheduled( 'wppa_clear_cache' ) && ! $done ) {
|
378 |
|
379 |
wp_schedule_single_event( time() + $time, 'wppa_clear_cache' );
|
380 |
+
$done = true;
|
381 |
|
382 |
+
wppa_log( 'Cron', '{b}wppa_clear_cache{/b} scheduled for run in ' . $time . ' sec.', true );
|
383 |
}
|
384 |
}
|
385 |
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -4193,10 +4193,13 @@ global $allphotos;
|
|
4193 |
return $xname; // Already nemeric
|
4194 |
}
|
4195 |
|
|
|
|
|
4196 |
$name = wppa_decode_uri_component( $xname );
|
4197 |
$name = str_replace( '\'', '%', $name ); // A trick for single quotes
|
4198 |
$name = str_replace( '"', '%', $name ); // A trick for double quotes
|
4199 |
$name = stripslashes( $name );
|
|
|
4200 |
|
4201 |
if ( wppa_is_int( $album ) ) {
|
4202 |
$alb = $album;
|
@@ -4212,10 +4215,10 @@ global $allphotos;
|
|
4212 |
}
|
4213 |
|
4214 |
if ( $alb ) {
|
4215 |
-
$pid = $wpdb->get_var( "SELECT id FROM $wpdb->wppa_photos WHERE
|
4216 |
}
|
4217 |
else {
|
4218 |
-
$pid = $wpdb->get_var( "SELECT id FROM $wpdb->wppa_photos WHERE
|
4219 |
}
|
4220 |
|
4221 |
if ( $pid ) {
|
@@ -4238,12 +4241,15 @@ global $allalbums;
|
|
4238 |
return $xname; // Is enumeration
|
4239 |
}
|
4240 |
|
|
|
|
|
4241 |
$name = wppa_decode_uri_component( $xname );
|
4242 |
$name = str_replace( '\'', '%', $name ); // A trick for single quotes
|
4243 |
$name = str_replace( '"', '%', $name ); // A trick for double quotes
|
4244 |
$name = stripslashes( $name );
|
|
|
4245 |
|
4246 |
-
$query = "SELECT * FROM $wpdb->wppa_albums WHERE
|
4247 |
$albs = $wpdb->get_results( $query, ARRAY_A );
|
4248 |
|
4249 |
if ( $albs ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*/
|
9 |
|
4193 |
return $xname; // Already nemeric
|
4194 |
}
|
4195 |
|
4196 |
+
$name = wppa_sanitize_album_photo_name( $xname );
|
4197 |
+
/*
|
4198 |
$name = wppa_decode_uri_component( $xname );
|
4199 |
$name = str_replace( '\'', '%', $name ); // A trick for single quotes
|
4200 |
$name = str_replace( '"', '%', $name ); // A trick for double quotes
|
4201 |
$name = stripslashes( $name );
|
4202 |
+
*/
|
4203 |
|
4204 |
if ( wppa_is_int( $album ) ) {
|
4205 |
$alb = $album;
|
4215 |
}
|
4216 |
|
4217 |
if ( $alb ) {
|
4218 |
+
$pid = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE sname = %s AND ( album = $alb ) LIMIT 1", $name ) );
|
4219 |
}
|
4220 |
else {
|
4221 |
+
$pid = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE sname = %s LIMIT 1", $name ) );
|
4222 |
}
|
4223 |
|
4224 |
if ( $pid ) {
|
4241 |
return $xname; // Is enumeration
|
4242 |
}
|
4243 |
|
4244 |
+
$name = wppa_sanitize_album_photo_name( $xname );
|
4245 |
+
/*
|
4246 |
$name = wppa_decode_uri_component( $xname );
|
4247 |
$name = str_replace( '\'', '%', $name ); // A trick for single quotes
|
4248 |
$name = str_replace( '"', '%', $name ); // A trick for double quotes
|
4249 |
$name = stripslashes( $name );
|
4250 |
+
*/
|
4251 |
|
4252 |
+
$query = $wpdb->prepare( "SELECT * FROM $wpdb->wppa_albums WHERE sname = %s", $name );
|
4253 |
$albs = $wpdb->get_results( $query, ARRAY_A );
|
4254 |
|
4255 |
if ( $albs ) {
|
wppa-init.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* This file loads required php files and contains all functions used in init actions.
|
6 |
*
|
7 |
-
* Version 7.0.
|
8 |
*/
|
9 |
|
10 |
/* LOAD SIDEBAR WIDGETS */
|
@@ -345,4 +345,22 @@ function wppa_check_scabn_compatibility() {
|
|
345 |
}
|
346 |
}
|
347 |
}
|
348 |
-
add_action( 'admin_notices', 'wppa_check_scabn_compatibility' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
*
|
5 |
* This file loads required php files and contains all functions used in init actions.
|
6 |
*
|
7 |
+
* Version 7.0.01
|
8 |
*/
|
9 |
|
10 |
/* LOAD SIDEBAR WIDGETS */
|
345 |
}
|
346 |
}
|
347 |
}
|
348 |
+
add_action( 'admin_notices', 'wppa_check_scabn_compatibility' );
|
349 |
+
|
350 |
+
// Do translation for wpGlobus
|
351 |
+
function wppa_translate( $text = '' ) {
|
352 |
+
global $wppa_lang;
|
353 |
+
|
354 |
+
if ( strpos( $text, '{:' ) !== false ) {
|
355 |
+
$text = WPGlobus_Core::extract_text( $text, $wppa_lang );
|
356 |
+
}
|
357 |
+
return $text;
|
358 |
+
}
|
359 |
+
|
360 |
+
function wppa_filter_wpglobus() {
|
361 |
+
|
362 |
+
if ( class_exists( 'WPGlobus_Core' ) ) {
|
363 |
+
add_filter( 'gettext', 'wppa_translate' );
|
364 |
+
}
|
365 |
+
}
|
366 |
+
add_action( 'plugins_loaded', 'wppa_filter_wpglobus' );
|
wppa-items.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions to retrieve album and photo items
|
6 |
-
* Version
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -616,7 +616,7 @@ function wppa_get_album_desc( $id, $xargs = array() ) {
|
|
616 |
// Optionally translate
|
617 |
if ( $args['translate'] ) {
|
618 |
|
619 |
-
// qTranslate
|
620 |
$desc = __( $desc );
|
621 |
}
|
622 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions to retrieve album and photo items
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*/
|
9 |
|
616 |
// Optionally translate
|
617 |
if ( $args['translate'] ) {
|
618 |
|
619 |
+
// qTranslate, wpGlobus
|
620 |
$desc = __( $desc );
|
621 |
}
|
622 |
|
wppa-links.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Frontend links
|
6 |
-
* Version
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -298,6 +298,11 @@ function wppa_get_slideshow_url_ajax($id, $page = '') {
|
|
298 |
// Pretty links decode
|
299 |
function wppa_convert_from_pretty( $uri ) {
|
300 |
|
|
|
|
|
|
|
|
|
|
|
301 |
// Is a pretty link given?
|
302 |
$wppapos = stripos( $uri, '/wppaspec/' );
|
303 |
if ( ! $wppapos ) return $uri;
|
@@ -442,7 +447,7 @@ function wppa_convert_from_pretty( $uri ) {
|
|
442 |
// Pretty links Encode
|
443 |
function wppa_convert_to_pretty( $xuri, $no_names = false, $overrule = false ) {
|
444 |
|
445 |
-
// Make local copy
|
446 |
$uri = $xuri;
|
447 |
|
448 |
// Only when permalink structure is not default
|
@@ -564,7 +569,11 @@ function wppa_convert_to_pretty( $xuri, $no_names = false, $overrule = false ) {
|
|
564 |
$id = substr( $uri, $start, $end - $start );
|
565 |
if ( wppa_is_int( $id ) ) { // Can convert single integer photo ids only
|
566 |
$after = substr( $uri, $end );
|
567 |
-
$pname = stripslashes( wppa_get_photo_item( $id, '
|
|
|
|
|
|
|
|
|
568 |
$pname = wppa_encode_uri_component( $pname );
|
569 |
$uri = $before . $pname . $after;
|
570 |
}
|
@@ -572,7 +581,11 @@ function wppa_convert_to_pretty( $xuri, $no_names = false, $overrule = false ) {
|
|
572 |
else {
|
573 |
$id = substr( $uri, $start );
|
574 |
if ( wppa_is_int( $id ) ) { // Can convert single integer photo ids only
|
575 |
-
$pname = stripslashes( wppa_get_photo_item( $id, '
|
|
|
|
|
|
|
|
|
576 |
$pname = wppa_encode_uri_component( $pname );
|
577 |
$uri = $before . $pname;
|
578 |
}
|
@@ -583,7 +596,7 @@ function wppa_convert_to_pretty( $xuri, $no_names = false, $overrule = false ) {
|
|
583 |
$uri = str_replace( array( ' ', '[', ']' ), array( '%20', '%5B', '%5D' ), $uri );
|
584 |
|
585 |
// Now the actual conversion to pretty links
|
586 |
-
if (
|
587 |
if ( ! get_option( 'permalink_structure' ) ) return $uri;
|
588 |
|
589 |
// Leaving the next line out gives 404 on pretty links under certain circumstances.
|
@@ -648,99 +661,37 @@ function wppa_convert_to_pretty( $xuri, $no_names = false, $overrule = false ) {
|
|
648 |
if ( in_array( $code, $support ) ) {
|
649 |
$newuri .= '/';
|
650 |
switch ( $code ) {
|
651 |
-
case 'album':
|
652 |
-
|
653 |
-
|
654 |
-
case '
|
655 |
-
|
656 |
-
|
657 |
-
case '
|
658 |
-
|
659 |
-
|
660 |
-
case '
|
661 |
-
|
662 |
-
|
663 |
-
case '
|
664 |
-
|
665 |
-
|
666 |
-
case '
|
667 |
-
|
668 |
-
|
669 |
-
case '
|
670 |
-
|
671 |
-
|
672 |
-
case '
|
673 |
-
|
674 |
-
|
675 |
-
case '
|
676 |
-
|
677 |
-
|
678 |
-
case '
|
679 |
-
|
680 |
-
|
681 |
-
case '
|
682 |
-
$newuri .= 'lt';
|
683 |
-
break;
|
684 |
-
case 'comten':
|
685 |
-
$newuri .= 'ct';
|
686 |
-
break;
|
687 |
-
case 'featen':
|
688 |
-
$newuri .= 'ft';
|
689 |
-
break;
|
690 |
-
case 'lang':
|
691 |
-
$newuri .= 'ln';
|
692 |
-
break;
|
693 |
-
case 'single':
|
694 |
-
$newuri .= 'si';
|
695 |
-
break;
|
696 |
-
case 'tag':
|
697 |
-
$newuri .= 'tg';
|
698 |
-
break;
|
699 |
-
case 'photos-only':
|
700 |
-
$newuri .= 'po';
|
701 |
-
break;
|
702 |
-
case 'albums-only':
|
703 |
-
$newuri .= 'ao';
|
704 |
-
break;
|
705 |
-
case 'medals-only':
|
706 |
-
$newuri .= 'mo';
|
707 |
-
break;
|
708 |
-
case 'debug':
|
709 |
-
$newuri .= 'db';
|
710 |
-
break;
|
711 |
-
case 'rel':
|
712 |
-
$newuri .= 'rl';
|
713 |
-
break;
|
714 |
-
case 'relcount':
|
715 |
-
$newuri .= 'rc';
|
716 |
-
break;
|
717 |
-
case 'upldr':
|
718 |
-
$newuri .= 'ul';
|
719 |
-
break;
|
720 |
-
case 'owner':
|
721 |
-
$newuri .= 'ow';
|
722 |
-
break;
|
723 |
-
case 'rootsearch':
|
724 |
-
$newuri .= 'rt';
|
725 |
-
break;
|
726 |
-
case 'hilite':
|
727 |
-
$newuri .= 'hl';
|
728 |
-
break;
|
729 |
-
case 'calendar':
|
730 |
-
$newuri .= 'ca';
|
731 |
-
break;
|
732 |
-
case 'caldate':
|
733 |
-
$newuri .= 'cd';
|
734 |
-
break;
|
735 |
-
case 'inv':
|
736 |
-
$newuri .= 'in';
|
737 |
-
break;
|
738 |
-
case 'vt':
|
739 |
-
$newuri .= 'vt';
|
740 |
-
break;
|
741 |
-
case 'catbox':
|
742 |
-
$newuri .= 'cb';
|
743 |
-
break;
|
744 |
}
|
745 |
if ( $val !== false ) {
|
746 |
if ( $code == 'searchstring' ) $newuri .= str_replace(' ', '_', $val);
|
@@ -750,9 +701,192 @@ function wppa_convert_to_pretty( $xuri, $no_names = false, $overrule = false ) {
|
|
750 |
}
|
751 |
}
|
752 |
|
|
|
|
|
|
|
753 |
return $newuri;
|
754 |
}
|
755 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
756 |
// Replace album number by name in url
|
757 |
function wppa_album_number_to_name_in_uri( $uri ) {
|
758 |
|
@@ -773,7 +907,11 @@ function wppa_album_number_to_name_in_uri( $uri ) {
|
|
773 |
$albnum = substr( $uri, $start, $end - $start );
|
774 |
if ( wppa_is_int( $albnum ) && $albnum > '0' ) { // Can convert single positive integer album ids only
|
775 |
$after = substr( $uri, $end );
|
776 |
-
$albnam = stripslashes( wppa_get_album_item( $albnum, '
|
|
|
|
|
|
|
|
|
777 |
$albnam = wppa_encode_uri_component( $albnam );
|
778 |
$uri = $before . $albnam . $after;
|
779 |
}
|
@@ -781,7 +919,11 @@ function wppa_album_number_to_name_in_uri( $uri ) {
|
|
781 |
else {
|
782 |
$albnum = substr( $uri, $start );
|
783 |
if ( wppa_is_int( $albnum ) && $albnum > '0' ) { // Can convert single positive integer album ids only
|
784 |
-
$albnam = stripslashes( wppa_get_album_item( $albnum, '
|
|
|
|
|
|
|
|
|
785 |
$albnam = wppa_encode_uri_component( $albnam );
|
786 |
$uri = $before . $albnam;
|
787 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Frontend links
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*/
|
9 |
|
298 |
// Pretty links decode
|
299 |
function wppa_convert_from_pretty( $uri ) {
|
300 |
|
301 |
+
// Is it a compressed pretty link?
|
302 |
+
if ( strpos( $uri, '-' ) ) {
|
303 |
+
$uri = wppa_decompress_pretty( $uri );
|
304 |
+
}
|
305 |
+
|
306 |
// Is a pretty link given?
|
307 |
$wppapos = stripos( $uri, '/wppaspec/' );
|
308 |
if ( ! $wppapos ) return $uri;
|
447 |
// Pretty links Encode
|
448 |
function wppa_convert_to_pretty( $xuri, $no_names = false, $overrule = false ) {
|
449 |
|
450 |
+
// Make local copy, decompresse
|
451 |
$uri = $xuri;
|
452 |
|
453 |
// Only when permalink structure is not default
|
569 |
$id = substr( $uri, $start, $end - $start );
|
570 |
if ( wppa_is_int( $id ) ) { // Can convert single integer photo ids only
|
571 |
$after = substr( $uri, $end );
|
572 |
+
$pname = stripslashes( wppa_get_photo_item( $id, 'sname' ) );
|
573 |
+
if ( ! $pname ) { // Back compat: fix missing pname
|
574 |
+
$pname = wppa_sanitize_album_photo_name( wppa_get_photo_item( $id, 'name' ) );
|
575 |
+
wppa_update_photo( array( 'id' => $id, 'sname' => $pname ) );
|
576 |
+
}
|
577 |
$pname = wppa_encode_uri_component( $pname );
|
578 |
$uri = $before . $pname . $after;
|
579 |
}
|
581 |
else {
|
582 |
$id = substr( $uri, $start );
|
583 |
if ( wppa_is_int( $id ) ) { // Can convert single integer photo ids only
|
584 |
+
$pname = stripslashes( wppa_get_photo_item( $id, 'sname' ) );
|
585 |
+
if ( ! $pname ) { // Back compat: fix missing pname
|
586 |
+
$pname = wppa_sanitize_album_photo_name( wppa_get_photo_item( $id, 'name' ) );
|
587 |
+
wppa_update_photo( array( 'id' => $id, 'sname' => $pname ) );
|
588 |
+
}
|
589 |
$pname = wppa_encode_uri_component( $pname );
|
590 |
$uri = $before . $pname;
|
591 |
}
|
596 |
$uri = str_replace( array( ' ', '[', ']' ), array( '%20', '%5B', '%5D' ), $uri );
|
597 |
|
598 |
// Now the actual conversion to pretty links
|
599 |
+
if ( wppa_opt( 'use_pretty_links' ) == '-none-' && ! $overrule ) return $uri;
|
600 |
if ( ! get_option( 'permalink_structure' ) ) return $uri;
|
601 |
|
602 |
// Leaving the next line out gives 404 on pretty links under certain circumstances.
|
661 |
if ( in_array( $code, $support ) ) {
|
662 |
$newuri .= '/';
|
663 |
switch ( $code ) {
|
664 |
+
case 'album': $newuri .= 'ab'; break;
|
665 |
+
case 'photo': $newuri .= 'pt'; break;
|
666 |
+
case 'slide': $newuri .= 'sd'; break;
|
667 |
+
case 'cover': $newuri .= 'cv'; break;
|
668 |
+
case 'occur': $newuri .= 'oc'; break;
|
669 |
+
case 'woccur': $newuri .= 'wo'; break;
|
670 |
+
case 'page': $newuri .= 'pg'; break;
|
671 |
+
case 'searchstring': $newuri .= 'ss'; break;
|
672 |
+
case 'supersearch': $newuri .= 'su'; break;
|
673 |
+
case 'topten': $newuri .= 'tt'; break;
|
674 |
+
case 'lasten': $newuri .= 'lt'; break;
|
675 |
+
case 'comten': $newuri .= 'ct'; break;
|
676 |
+
case 'featen': $newuri .= 'ft'; break;
|
677 |
+
case 'lang': $newuri .= 'ln'; break;
|
678 |
+
case 'single': $newuri .= 'si'; break;
|
679 |
+
case 'tag': $newuri .= 'tg'; break;
|
680 |
+
case 'photos-only': $newuri .= 'po'; break;
|
681 |
+
case 'albums-only': $newuri .= 'ao'; break;
|
682 |
+
case 'medals-only': $newuri .= 'mo'; break;
|
683 |
+
case 'debug': $newuri .= 'db'; break;
|
684 |
+
case 'rel': $newuri .= 'rl'; break;
|
685 |
+
case 'relcount': $newuri .= 'rc'; break;
|
686 |
+
case 'upldr': $newuri .= 'ul'; break;
|
687 |
+
case 'owner': $newuri .= 'ow'; break;
|
688 |
+
case 'rootsearch': $newuri .= 'rt'; break;
|
689 |
+
case 'hilite': $newuri .= 'hl'; break;
|
690 |
+
case 'calendar': $newuri .= 'ca'; break;
|
691 |
+
case 'caldate': $newuri .= 'cd'; break;
|
692 |
+
case 'inv': $newuri .= 'in'; break;
|
693 |
+
case 'vt': $newuri .= 'vt'; break;
|
694 |
+
case 'catbox': $newuri .= 'cb'; break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
695 |
}
|
696 |
if ( $val !== false ) {
|
697 |
if ( $code == 'searchstring' ) $newuri .= str_replace(' ', '_', $val);
|
701 |
}
|
702 |
}
|
703 |
|
704 |
+
if ( wppa_opt( 'use_pretty_links' ) == 'compressed' ) {
|
705 |
+
$newuri = wppa_compress_pretty( $newuri );
|
706 |
+
}
|
707 |
return $newuri;
|
708 |
}
|
709 |
|
710 |
+
// Decompress a compressed pretty url
|
711 |
+
function wppa_decompress_pretty( $uri ) {
|
712 |
+
|
713 |
+
// Is it a compressed pretty url?
|
714 |
+
if ( ! strpos( $uri, '/-/' ) ) {
|
715 |
+
return $uri;
|
716 |
+
}
|
717 |
+
|
718 |
+
// Split uri in: before - body - after
|
719 |
+
$temp = explode( '/-/', $uri );
|
720 |
+
$before = $temp[0];
|
721 |
+
if ( strpos( $temp[1], '?' ) ) {
|
722 |
+
$parts = explode( '?', $temp[1] );
|
723 |
+
$body = $parts[0];
|
724 |
+
$after = $parts[1];
|
725 |
+
}
|
726 |
+
else {
|
727 |
+
$body = $temp[1];
|
728 |
+
$after = '';
|
729 |
+
}
|
730 |
+
|
731 |
+
// DO NOT CHANGE THE SEQUENCE OF THIS ARRAY !!!!!
|
732 |
+
$support = array( 'ln',
|
733 |
+
'oc',
|
734 |
+
'ab',
|
735 |
+
'pt',
|
736 |
+
'sd',
|
737 |
+
'cv',
|
738 |
+
'wo',
|
739 |
+
'pg',
|
740 |
+
'ss',
|
741 |
+
'su',
|
742 |
+
'tt',
|
743 |
+
'lt',
|
744 |
+
'ct',
|
745 |
+
'ft',
|
746 |
+
'si',
|
747 |
+
'tg',
|
748 |
+
'po',
|
749 |
+
'ao',
|
750 |
+
'mo',
|
751 |
+
'db',
|
752 |
+
'rl',
|
753 |
+
'rc',
|
754 |
+
'ul',
|
755 |
+
'ow',
|
756 |
+
'rt',
|
757 |
+
'hl',
|
758 |
+
'ca',
|
759 |
+
'cd',
|
760 |
+
'in',
|
761 |
+
'vt',
|
762 |
+
'cb',
|
763 |
+
);
|
764 |
+
|
765 |
+
$splitbody = explode( '/', $body );
|
766 |
+
|
767 |
+
$body = '';
|
768 |
+
$i = 0;
|
769 |
+
$c = count( $support );
|
770 |
+
while ( $i < $c ) {
|
771 |
+
|
772 |
+
if ( isset( $splitbody[$i] ) && $splitbody[$i] != '' ) {
|
773 |
+
$body .= $support[$i] . $splitbody[$i] . '/';
|
774 |
+
}
|
775 |
+
$i++;
|
776 |
+
}
|
777 |
+
|
778 |
+
$result = rtrim( $before . '/wppaspec/' . $body . $after, '/' );
|
779 |
+
//wppa_log( 'dbg', $result );
|
780 |
+
return $result;
|
781 |
+
}
|
782 |
+
|
783 |
+
// Post process pretty url to compressed pretty uri
|
784 |
+
function wppa_compress_pretty( $uri ) {
|
785 |
+
|
786 |
+
// Split uri in: before - body - after
|
787 |
+
$temp = explode( '/wppaspec/', $uri );
|
788 |
+
$before = $temp[0];
|
789 |
+
if ( strpos( $temp[1], '?' ) ) {
|
790 |
+
$parts = explode( '?', $temp[1] );
|
791 |
+
$body = $parts[0];
|
792 |
+
$after = $parts[1];
|
793 |
+
}
|
794 |
+
else {
|
795 |
+
$body = $temp[1];
|
796 |
+
$after = '';
|
797 |
+
}
|
798 |
+
|
799 |
+
// DO NOT CHANGE THE SEQUENCE OF THIS ARRAY !!!!!
|
800 |
+
$support = array( 'lang' => '',
|
801 |
+
'occur' => '',
|
802 |
+
'album' => '',
|
803 |
+
'photo' => '',
|
804 |
+
'slide' => '',
|
805 |
+
'cover' => '',
|
806 |
+
'woccur' => '',
|
807 |
+
'page' => '',
|
808 |
+
'searchstring' => '',
|
809 |
+
'supersearch' => '',
|
810 |
+
'topten' => '',
|
811 |
+
'lasten' => '',
|
812 |
+
'comten' => '',
|
813 |
+
'featen' => '',
|
814 |
+
'single' => '',
|
815 |
+
'tag' => '',
|
816 |
+
'photos-only' => '',
|
817 |
+
'albums-only' => '',
|
818 |
+
'medals-only' => '',
|
819 |
+
'debug' => '',
|
820 |
+
'rel' => '',
|
821 |
+
'relcount' => '',
|
822 |
+
'upldr' => '',
|
823 |
+
'owner' => '',
|
824 |
+
'rootsearch' => '',
|
825 |
+
'hilite' => '',
|
826 |
+
'calendar' => '',
|
827 |
+
'caldate' => '',
|
828 |
+
'inv' => '',
|
829 |
+
'vt' => '',
|
830 |
+
'catbox' => '',
|
831 |
+
);
|
832 |
+
|
833 |
+
$splitbody = explode( '/', $body );
|
834 |
+
|
835 |
+
foreach ( $splitbody as $item ) {
|
836 |
+
$prefix = substr( $item, 0, 2 );
|
837 |
+
$data = substr( $item, 2 );
|
838 |
+
switch( $prefix ) {
|
839 |
+
case 'ln': $support['lang'] = $data; break;
|
840 |
+
case 'oc': $support['occur'] = $data; break;
|
841 |
+
case 'ab': $support['album'] = $data; break;
|
842 |
+
case 'pt': $support['photo'] = $data; break;
|
843 |
+
case 'sd': $support['slide'] = $data; break;
|
844 |
+
case 'cv': $support['cover'] = $data; break;
|
845 |
+
case 'wo': $support['woccur'] = $data; break;
|
846 |
+
case 'pg': $support['page'] = $data; break;
|
847 |
+
case 'ss': $support['searchstring'] = $data; break;
|
848 |
+
case 'su': $support['supersearch'] = $data; break;
|
849 |
+
case 'tt': $support['topten'] = $data; break;
|
850 |
+
case 'lt': $support['lasten'] = $data; break;
|
851 |
+
case 'ct': $support['comten'] = $data; break;
|
852 |
+
case 'ft': $support['featen'] = $data; break;
|
853 |
+
case 'si': $support['single'] = $data; break;
|
854 |
+
case 'tg': $support['tag'] = $data; break;
|
855 |
+
case 'po': $support['photos-only'] = $data; break;
|
856 |
+
case 'ao': $support['albums-only'] = $data; break;
|
857 |
+
case 'mo': $support['medals-only'] = $data; break;
|
858 |
+
case 'db': $support['debug'] = $data; break;
|
859 |
+
case 'rl': $support['rel'] = $data; break;
|
860 |
+
case 'rc': $support['relcount'] = $data; break;
|
861 |
+
case 'ul': $support['upldr'] = $data; break;
|
862 |
+
case 'ow': $support['owner'] = $data; break;
|
863 |
+
case 'rt': $support['rootsearch'] = $data; break;
|
864 |
+
case 'hl': $support['hilite'] = $data; break;
|
865 |
+
case 'ca': $support['calendar'] = $data; break;
|
866 |
+
case 'cd': $support['caldate'] = $data; break;
|
867 |
+
case 'in': $support['inv'] = $data; break;
|
868 |
+
case 'vt': $support['vt'] = $data; break;
|
869 |
+
case 'cb': $support['catbox'] = $data; break;
|
870 |
+
}
|
871 |
+
}
|
872 |
+
|
873 |
+
// Remake body
|
874 |
+
$body = implode( '/', $support );
|
875 |
+
$body = rtrim( $body, '/' );
|
876 |
+
|
877 |
+
// Re-combine
|
878 |
+
$result = $before . '/-/' . $body;
|
879 |
+
if ( $after ) {
|
880 |
+
$result .= '?' . $after;
|
881 |
+
}
|
882 |
+
|
883 |
+
// Done
|
884 |
+
// wppa_log( 'dbg', $result );
|
885 |
+
|
886 |
+
// return $uri; // debug
|
887 |
+
return $result;
|
888 |
+
}
|
889 |
+
|
890 |
// Replace album number by name in url
|
891 |
function wppa_album_number_to_name_in_uri( $uri ) {
|
892 |
|
907 |
$albnum = substr( $uri, $start, $end - $start );
|
908 |
if ( wppa_is_int( $albnum ) && $albnum > '0' ) { // Can convert single positive integer album ids only
|
909 |
$after = substr( $uri, $end );
|
910 |
+
$albnam = stripslashes( wppa_get_album_item( $albnum, 'sname' ) );
|
911 |
+
if ( ! $albnam ) { // bw compat: fix missing sname
|
912 |
+
$albnam = wppa_sanitize_album_photo_name( wppa_get_album_item( $albnum, 'name' ) );
|
913 |
+
wppa_update_album( array( 'id' => $albnum, 'sname' => $albnam ) );
|
914 |
+
}
|
915 |
$albnam = wppa_encode_uri_component( $albnam );
|
916 |
$uri = $before . $albnam . $after;
|
917 |
}
|
919 |
else {
|
920 |
$albnum = substr( $uri, $start );
|
921 |
if ( wppa_is_int( $albnum ) && $albnum > '0' ) { // Can convert single positive integer album ids only
|
922 |
+
$albnam = stripslashes( wppa_get_album_item( $albnum, 'sname' ) );
|
923 |
+
if ( ! $albnam ) { // bw compat: fix missing sname
|
924 |
+
$albnam = wppa_sanitize_album_photo_name( wppa_get_album_item( $albnum, 'name' ) );
|
925 |
+
wppa_update_album( array( 'id' => $albnum, 'sname' => $albnam ) );
|
926 |
+
}
|
927 |
$albnam = wppa_encode_uri_component( $albnam );
|
928 |
$uri = $before . $albnam;
|
929 |
}
|
wppa-non-admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -743,7 +743,7 @@ function wppa_redirect() {
|
|
743 |
if ( ! isset( $_SERVER["REQUEST_URI"] ) ) return;
|
744 |
|
745 |
$uri = $_SERVER["REQUEST_URI"];
|
746 |
-
$wppapos = stripos( $uri, '/wppaspec/' );
|
747 |
|
748 |
if ( $wppapos && get_option('permalink_structure') ) {
|
749 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*/
|
9 |
|
743 |
if ( ! isset( $_SERVER["REQUEST_URI"] ) ) return;
|
744 |
|
745 |
$uri = $_SERVER["REQUEST_URI"];
|
746 |
+
$wppapos = stripos( $uri, '/wppaspec/' ) || ( strpos( $uri, '/-/' ) && get_option( 'wppa_use_pretty_links' ) == 'compressed' );
|
747 |
|
748 |
if ( $wppapos && get_option('permalink_structure') ) {
|
749 |
|
wppa-session.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
-
* Version
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
@@ -190,7 +190,7 @@ static $last_query;
|
|
190 |
if ( ! isset( $wppa_session['id'] ) ) return false;
|
191 |
|
192 |
// To prevent data overflow, only save the most recent 100 urls
|
193 |
-
$c = count( $wppa_session['uris'] );
|
194 |
if ( $c > 100 ) {
|
195 |
array_shift( $wppa_session['uris'] );
|
196 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
190 |
if ( ! isset( $wppa_session['id'] ) ) return false;
|
191 |
|
192 |
// To prevent data overflow, only save the most recent 100 urls
|
193 |
+
$c = is_array( $wppa_session['uris'] ) ? count( $wppa_session['uris'] ) : 0;
|
194 |
if ( $c > 100 ) {
|
195 |
array_shift( $wppa_session['uris'] );
|
196 |
}
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -27,22 +27,7 @@ global $wp_version;
|
|
27 |
global $wppa_supported_camara_brands;
|
28 |
|
29 |
// Start test area
|
30 |
-
|
31 |
-
echo '<input type="button" vaue="Click me" onclick="wppaTimedConfirm( \'My Text\' )" />';
|
32 |
-
*//*
|
33 |
-
$session = $wpdb->get_row("SELECT * FROM $wpdb->wppa_session ORDER BY id DESC LIMIT 1", ARRAY_A );
|
34 |
-
echo $session['data'].'<br /><br />';
|
35 |
-
var_dump ( unserialize($session['data']));
|
36 |
-
echo '<br /><br />';
|
37 |
-
var_dump ( wppa_unserialize($session['data']));
|
38 |
-
echo '<br /><br />';
|
39 |
-
var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
40 |
-
*/
|
41 |
-
//global $wppa_session;
|
42 |
-
//var_dump($wppa_session['wfcart']);
|
43 |
-
//for ( $i = 0; $i < 10; $i++ ) {
|
44 |
-
// echo crypt( microtime(), rand( 1000, 4711 ) ) . '<br />';
|
45 |
-
//}
|
46 |
// End test area
|
47 |
|
48 |
// Initialize
|
@@ -3842,7 +3827,12 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
3842 |
$help .= '\n'.esc_js(__('However, you may encounter conflicts with themes and/or other plugins, so test it throughly!', 'wp-photo-album-plus'));
|
3843 |
$help .= '\n\n'.esc_js(__('Table IV-A2 (Photo names in urls) must be UNchecked for this setting to work!', 'wp-photo-album-plus'));
|
3844 |
$slug = 'wppa_use_pretty_links';
|
3845 |
-
$
|
|
|
|
|
|
|
|
|
|
|
3846 |
$clas = '';
|
3847 |
$tags = 'link,system';
|
3848 |
wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags);
|
@@ -10470,7 +10460,8 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
10470 |
$desc = __('Enable mailing users when a new album is created', 'wp-photo-album-plus');
|
10471 |
$help = '';
|
10472 |
$slug = 'wppa_newalbumnotify';
|
10473 |
-
$
|
|
|
10474 |
$clas = '';
|
10475 |
$tags = 'mail,album';
|
10476 |
wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
|
@@ -10479,7 +10470,8 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
10479 |
$desc = __('Enable mailing users when a frontend upload has been done', 'wp-photo-album-plus');
|
10480 |
$help = esc_js(__('When moderation is required, the mails will be sent after approval', 'wp-photo-album-plus'));
|
10481 |
$slug = 'wppa_feuploadnotify';
|
10482 |
-
$
|
|
|
10483 |
$clas = '';
|
10484 |
$tags = 'upload,mail';
|
10485 |
wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
|
@@ -10499,7 +10491,8 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
10499 |
$desc = __('Enable mailing users when a new comment has been added', 'wp-photo-album-plus');
|
10500 |
$help = esc_js(__('When moderation is required, the mails will be sent after approval', 'wp-photo-album-plus'));
|
10501 |
$slug = 'wppa_commentnotify';
|
10502 |
-
$
|
|
|
10503 |
$clas = '';
|
10504 |
$tags = 'comment,mail';
|
10505 |
wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags);
|
@@ -10539,7 +10532,9 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
10539 |
$desc = __('Notify users who has commented this photo earlier', 'wp-photo-album-plus');
|
10540 |
$help = '';
|
10541 |
$slug = 'wppa_commentprevious';
|
10542 |
-
$
|
|
|
|
|
10543 |
$tags = 'comment,mail';
|
10544 |
wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
|
10545 |
|
@@ -10547,7 +10542,9 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
10547 |
$desc = __('Notify moderators when a photo needs moderation', 'wp-photo-album-plus');
|
10548 |
$help = '';
|
10549 |
$slug = 'wppa_moderatephoto';
|
10550 |
-
$
|
|
|
|
|
10551 |
$tags = 'upload,mail';
|
10552 |
wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
|
10553 |
|
@@ -10555,7 +10552,9 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
10555 |
$desc = __('Notify moderators when a comment needs moderation', 'wp-photo-album-plus');
|
10556 |
$help = '';
|
10557 |
$slug = 'wppa_moderatecomment';
|
10558 |
-
$
|
|
|
|
|
10559 |
$tags = 'upload,mail';
|
10560 |
wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags);
|
10561 |
|
@@ -10563,9 +10562,8 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
10563 |
$desc = __('Send an email to the owner when a photo is approved', 'wp-photo-album-plus');
|
10564 |
$help = '';
|
10565 |
$slug = 'wppa_photoapproved';
|
10566 |
-
$
|
10567 |
-
$
|
10568 |
-
$html = array( $html1, $html2 );
|
10569 |
$clas = '';
|
10570 |
$tags = 'upload,mail';
|
10571 |
wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
|
@@ -10574,7 +10572,8 @@ var_dump ( json_decode( json_encode( unserialize( $session['data'] ) )));
|
|
10574 |
$desc = __('Notify photo owner and commenter of approved comment', 'wp-photo-album-plus');
|
10575 |
$help = '';
|
10576 |
$slug = 'wppa_commentapproved';
|
10577 |
-
$
|
|
|
10578 |
$clas = 'wppa_comment_';
|
10579 |
$tags = 'comment,mail';
|
10580 |
wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags);
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*/
|
9 |
|
27 |
global $wppa_supported_camara_brands;
|
28 |
|
29 |
// Start test area
|
30 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
// End test area
|
32 |
|
33 |
// Initialize
|
3827 |
$help .= '\n'.esc_js(__('However, you may encounter conflicts with themes and/or other plugins, so test it throughly!', 'wp-photo-album-plus'));
|
3828 |
$help .= '\n\n'.esc_js(__('Table IV-A2 (Photo names in urls) must be UNchecked for this setting to work!', 'wp-photo-album-plus'));
|
3829 |
$slug = 'wppa_use_pretty_links';
|
3830 |
+
$opts = array( __( 'None', 'wp-photo-album-plus' ),
|
3831 |
+
__( 'Classic', 'wp-photo-album-plus' ),
|
3832 |
+
__( 'Compressed', 'wp-photo-album-plus' ),
|
3833 |
+
);
|
3834 |
+
$vals = array( '-none-', 'classic', 'compressed' );
|
3835 |
+
$html = wppa_select($slug, $opts, $vals );
|
3836 |
$clas = '';
|
3837 |
$tags = 'link,system';
|
3838 |
wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags);
|
10460 |
$desc = __('Enable mailing users when a new album is created', 'wp-photo-album-plus');
|
10461 |
$help = '';
|
10462 |
$slug = 'wppa_newalbumnotify';
|
10463 |
+
$subs = count( wppa_index_string_to_array( get_option( 'wppa_mailinglist_newalbumnotify', '' ) ) );
|
10464 |
+
$html = wppa_checkbox($slug) . ' ' . sprintf( __( '%d subscribers', 'wp-photo-album-plus' ), $subs );
|
10465 |
$clas = '';
|
10466 |
$tags = 'mail,album';
|
10467 |
wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
|
10470 |
$desc = __('Enable mailing users when a frontend upload has been done', 'wp-photo-album-plus');
|
10471 |
$help = esc_js(__('When moderation is required, the mails will be sent after approval', 'wp-photo-album-plus'));
|
10472 |
$slug = 'wppa_feuploadnotify';
|
10473 |
+
$subs = count( wppa_index_string_to_array( get_option( 'wppa_mailinglist_feuploadnotify', '' ) ) );
|
10474 |
+
$html = wppa_checkbox($slug) . ' ' . sprintf( __( '%d subscribers', 'wp-photo-album-plus' ), $subs );
|
10475 |
$clas = '';
|
10476 |
$tags = 'upload,mail';
|
10477 |
wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags);
|
10491 |
$desc = __('Enable mailing users when a new comment has been added', 'wp-photo-album-plus');
|
10492 |
$help = esc_js(__('When moderation is required, the mails will be sent after approval', 'wp-photo-album-plus'));
|
10493 |
$slug = 'wppa_commentnotify';
|
10494 |
+
$subs = count( wppa_index_string_to_array( get_option( 'wppa_mailinglist_commentnotify', '' ) ) );
|
10495 |
+
$html = wppa_checkbox($slug) . ' ' . sprintf( __( '%d subscribers', 'wp-photo-album-plus' ), $subs );
|
10496 |
$clas = '';
|
10497 |
$tags = 'comment,mail';
|
10498 |
wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags);
|
10532 |
$desc = __('Notify users who has commented this photo earlier', 'wp-photo-album-plus');
|
10533 |
$help = '';
|
10534 |
$slug = 'wppa_commentprevious';
|
10535 |
+
$subs = count( wppa_index_string_to_array( get_option( 'wppa_mailinglist_commentprevious', '' ) ) );
|
10536 |
+
$html = wppa_checkbox($slug) . ' ' . sprintf( __( '%d subscribers', 'wp-photo-album-plus' ), $subs );
|
10537 |
+
$clas = '';
|
10538 |
$tags = 'comment,mail';
|
10539 |
wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
|
10540 |
|
10542 |
$desc = __('Notify moderators when a photo needs moderation', 'wp-photo-album-plus');
|
10543 |
$help = '';
|
10544 |
$slug = 'wppa_moderatephoto';
|
10545 |
+
$subs = count( wppa_index_string_to_array( get_option( 'wppa_mailinglist_moderatephoto', '' ) ) );
|
10546 |
+
$html = wppa_checkbox($slug) . ' ' . sprintf( __( '%d subscribers', 'wp-photo-album-plus' ), $subs );
|
10547 |
+
$clas = '';
|
10548 |
$tags = 'upload,mail';
|
10549 |
wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
|
10550 |
|
10552 |
$desc = __('Notify moderators when a comment needs moderation', 'wp-photo-album-plus');
|
10553 |
$help = '';
|
10554 |
$slug = 'wppa_moderatecomment';
|
10555 |
+
$subs = count( wppa_index_string_to_array( get_option( 'wppa_mailinglist_moderatecomment', '' ) ) );
|
10556 |
+
$html = wppa_checkbox($slug) . ' ' . sprintf( __( '%d subscribers', 'wp-photo-album-plus' ), $subs );
|
10557 |
+
$clas = '';
|
10558 |
$tags = 'upload,mail';
|
10559 |
wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags);
|
10560 |
|
10562 |
$desc = __('Send an email to the owner when a photo is approved', 'wp-photo-album-plus');
|
10563 |
$help = '';
|
10564 |
$slug = 'wppa_photoapproved';
|
10565 |
+
$subs = count( wppa_index_string_to_array( get_option( 'wppa_mailinglist_photoapproved', '' ) ) );
|
10566 |
+
$html = wppa_checkbox($slug) . ' ' . sprintf( __( '%d subscribers', 'wp-photo-album-plus' ), $subs );
|
|
|
10567 |
$clas = '';
|
10568 |
$tags = 'upload,mail';
|
10569 |
wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
|
10572 |
$desc = __('Notify photo owner and commenter of approved comment', 'wp-photo-album-plus');
|
10573 |
$help = '';
|
10574 |
$slug = 'wppa_commentapproved';
|
10575 |
+
$subs = count( wppa_index_string_to_array( get_option( 'wppa_mailinglist_commentapproved', '' ) ) );
|
10576 |
+
$html = wppa_checkbox($slug) . ' ' . sprintf( __( '%d subscribers', 'wp-photo-album-plus' ), $subs );
|
10577 |
$clas = 'wppa_comment_';
|
10578 |
$tags = 'comment,mail';
|
10579 |
wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags);
|
wppa-setup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -29,26 +29,20 @@ function wppa_activate_plugin() {
|
|
29 |
// Force will NOT redefine constants
|
30 |
function wppa_setup($force = false) {
|
31 |
global $silent;
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
$old_rev = get_option('wppa_revision', '100');
|
38 |
|
39 |
-
// If not a new install, remove obsolete tempfiles
|
40 |
-
if ( $old_rev > '100' ) {
|
41 |
-
wppa_clear_cache($force); // Clear cache
|
42 |
-
}
|
43 |
-
|
44 |
if ( $old_rev == $wppa_revno && ! $force ) return; // Nothing to do here
|
45 |
|
46 |
-
|
47 |
-
delete_option( 'wppa_dismiss_admin_notice_scripts_are_obsolete' );
|
48 |
|
49 |
$wppa_error = false; // Init no error
|
50 |
|
51 |
-
$create_albums = "CREATE TABLE
|
52 |
id bigint(20) NOT NULL,
|
53 |
name text NOT NULL,
|
54 |
description text NOT NULL,
|
@@ -75,6 +69,7 @@ global $silent;
|
|
75 |
wmfile tinytext NOT NULL,
|
76 |
wmpos tinytext NOT NULL,
|
77 |
indexdtm tinytext NOT NULL,
|
|
|
78 |
PRIMARY KEY (id)
|
79 |
) DEFAULT CHARACTER SET utf8;";
|
80 |
|
@@ -116,6 +111,7 @@ global $silent;
|
|
116 |
magickstack text NOT NULL,
|
117 |
indexdtm tinytext NOT NULL,
|
118 |
panorama smallint(5) NOT NULL default '0',
|
|
|
119 |
PRIMARY KEY (id),
|
120 |
KEY albumkey (album),
|
121 |
KEY statuskey (status(6))
|
@@ -589,8 +585,13 @@ global $silent;
|
|
589 |
}
|
590 |
}
|
591 |
|
592 |
-
if ( $old_rev <= '
|
593 |
-
|
|
|
|
|
|
|
|
|
|
|
594 |
|
595 |
}
|
596 |
|
@@ -1197,7 +1198,7 @@ cursorborder:'2px solid transparent',";
|
|
1197 |
'wppa_use_photo_names_in_urls' => 'no',
|
1198 |
'wppa_use_album_names_in_urls' => 'no',
|
1199 |
'wppa_use_short_qargs' => 'yes',
|
1200 |
-
'wppa_use_pretty_links' => '
|
1201 |
'wppa_use_encrypted_links' => 'no',
|
1202 |
'wppa_refuse_unencrypted' => 'no',
|
1203 |
'wppa_update_addressline' => 'yes',
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*/
|
9 |
|
29 |
// Force will NOT redefine constants
|
30 |
function wppa_setup($force = false) {
|
31 |
global $silent;
|
32 |
+
global $wpdb;
|
33 |
+
global $wppa_revno;
|
34 |
+
global $current_user;
|
35 |
+
global $wppa_error;
|
36 |
|
37 |
$old_rev = get_option('wppa_revision', '100');
|
38 |
|
|
|
|
|
|
|
|
|
|
|
39 |
if ( $old_rev == $wppa_revno && ! $force ) return; // Nothing to do here
|
40 |
|
41 |
+
wppa_clear_cache($force);
|
|
|
42 |
|
43 |
$wppa_error = false; // Init no error
|
44 |
|
45 |
+
$create_albums = "CREATE TABLE $wpdb->wppa_albums (
|
46 |
id bigint(20) NOT NULL,
|
47 |
name text NOT NULL,
|
48 |
description text NOT NULL,
|
69 |
wmfile tinytext NOT NULL,
|
70 |
wmpos tinytext NOT NULL,
|
71 |
indexdtm tinytext NOT NULL,
|
72 |
+
sname text NOT NULL,
|
73 |
PRIMARY KEY (id)
|
74 |
) DEFAULT CHARACTER SET utf8;";
|
75 |
|
111 |
magickstack text NOT NULL,
|
112 |
indexdtm tinytext NOT NULL,
|
113 |
panorama smallint(5) NOT NULL default '0',
|
114 |
+
sname text NOT NULL,
|
115 |
PRIMARY KEY (id),
|
116 |
KEY albumkey (album),
|
117 |
KEY statuskey (status(6))
|
585 |
}
|
586 |
}
|
587 |
|
588 |
+
if ( $old_rev <= '7001' ) {
|
589 |
+
if ( get_option( 'wppa_use_pretty_links', 'nil' ) == 'no' ) {
|
590 |
+
update_option( 'wppa_use_pretty_links', '-none-' );
|
591 |
+
}
|
592 |
+
if ( get_option( 'wppa_use_pretty_links', 'nil' ) == 'yes' ) {
|
593 |
+
update_option( 'wppa_use_pretty_links', 'classic' );
|
594 |
+
}
|
595 |
|
596 |
}
|
597 |
|
1198 |
'wppa_use_photo_names_in_urls' => 'no',
|
1199 |
'wppa_use_album_names_in_urls' => 'no',
|
1200 |
'wppa_use_short_qargs' => 'yes',
|
1201 |
+
'wppa_use_pretty_links' => 'classic',
|
1202 |
'wppa_use_encrypted_links' => 'no',
|
1203 |
'wppa_refuse_unencrypted' => 'no',
|
1204 |
'wppa_update_addressline' => 'yes',
|
wppa-utils.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1598,18 +1598,33 @@ global $wppa_log_file;
|
|
1598 |
// Write log message
|
1599 |
$msg = strip_tags( $msg );
|
1600 |
|
1601 |
-
@ fwrite( $file, '{b}'.$type.'{/b}: on:'.wppa_local_date( 'd.m.Y H:i:s', time()).': '.wppa_get_user().': '.$msg.
|
1602 |
|
1603 |
-
// Log
|
1604 |
-
if ( $trace || $type == 'Dbg' ) {
|
1605 |
-
@ fwrite( $file, '{b}url{/b}: '.$_SERVER['REQUEST_URI']."\n" );
|
1606 |
-
}
|
1607 |
if ( $trace ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1608 |
ob_start();
|
1609 |
debug_print_backtrace( 0, 5 );//DEBUG_BACKTRACE_IGNORE_ARGS, 12 );
|
1610 |
$trace = ob_get_contents();
|
1611 |
ob_end_clean();
|
1612 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1613 |
}
|
1614 |
|
1615 |
// Add uri history
|
@@ -2701,10 +2716,15 @@ static $wppa_get_get_cache;
|
|
2701 |
if ( $index == 'photo' && ( ! wppa_is_int( $result ) ) ) {
|
2702 |
|
2703 |
// Encrypted?
|
2704 |
-
$
|
|
|
|
|
|
|
2705 |
|
2706 |
// By name?
|
2707 |
-
|
|
|
|
|
2708 |
|
2709 |
if ( ! $result ) return false; // Non existing photo, treat as not set
|
2710 |
}
|
@@ -2818,7 +2838,7 @@ function wppa_is_multi( $id ) {
|
|
2818 |
function wppa_fix_poster_ext( $fileorurl, $id ) {
|
2819 |
|
2820 |
// Has it extension .xxx ?
|
2821 |
-
if ( substr( $fileorurl, -4 ) != '.xxx' ) {
|
2822 |
return $fileorurl;
|
2823 |
}
|
2824 |
|
@@ -4813,3 +4833,13 @@ function wppa_rename_files_sanitized( $root ) {
|
|
4813 |
}
|
4814 |
}
|
4815 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*/
|
9 |
|
1598 |
// Write log message
|
1599 |
$msg = strip_tags( $msg );
|
1600 |
|
1601 |
+
@ fwrite( $file, '{b}'.$type.'{/b}: on:'.wppa_local_date( 'd.m.Y H:i:s', time()).': '.wppa_get_user().': '.$msg. ' ' );
|
1602 |
|
1603 |
+
// Log stacktrace 3 levels
|
|
|
|
|
|
|
1604 |
if ( $trace ) {
|
1605 |
+
|
1606 |
+
$data = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 4 );
|
1607 |
+
$traceline = '';
|
1608 |
+
if ( is_array( $data ) ) {
|
1609 |
+
$i = 1;
|
1610 |
+
while ( $i < count( $data ) ) {
|
1611 |
+
$traceline .= ( $i > 1 ? '<- ' : '' ) . basename( $data[$i]['file'] ) . ':' . $data[$i]['line'] . ' ' . $data[$i]['function'] . '() ';
|
1612 |
+
$i++;
|
1613 |
+
}
|
1614 |
+
}
|
1615 |
+
/*
|
1616 |
ob_start();
|
1617 |
debug_print_backtrace( 0, 5 );//DEBUG_BACKTRACE_IGNORE_ARGS, 12 );
|
1618 |
$trace = ob_get_contents();
|
1619 |
ob_end_clean();
|
1620 |
+
*/
|
1621 |
+
@ fwrite( $file, $traceline . "\n" );
|
1622 |
+
}
|
1623 |
+
else {
|
1624 |
+
@ fwrite( $file, "\n" );
|
1625 |
+
}
|
1626 |
+
if ( $trace || strtolower( substr( $xtype, 0, 2 ) ) == 'er' ) {
|
1627 |
+
@ fwrite( $file, '{b}url{/b}: '.$_SERVER['REQUEST_URI']."\n" );
|
1628 |
}
|
1629 |
|
1630 |
// Add uri history
|
2716 |
if ( $index == 'photo' && ( ! wppa_is_int( $result ) ) ) {
|
2717 |
|
2718 |
// Encrypted?
|
2719 |
+
$temp = wppa_decrypt_photo( $result );
|
2720 |
+
if ( $temp ) {
|
2721 |
+
$result = $temp;
|
2722 |
+
}
|
2723 |
|
2724 |
// By name?
|
2725 |
+
else {
|
2726 |
+
$result = wppa_get_photo_id_by_name( $result, wppa_get_album_id_by_name( wppa_get_get( 'album' ) ) );
|
2727 |
+
}
|
2728 |
|
2729 |
if ( ! $result ) return false; // Non existing photo, treat as not set
|
2730 |
}
|
2838 |
function wppa_fix_poster_ext( $fileorurl, $id ) {
|
2839 |
|
2840 |
// Has it extension .xxx ?
|
2841 |
+
if ( substr( $fileorurl, -4 ) != '.xxx' && strpos( $fileorurl, '.xxx?ver' ) === false ) {
|
2842 |
return $fileorurl;
|
2843 |
}
|
2844 |
|
4833 |
}
|
4834 |
}
|
4835 |
}
|
4836 |
+
|
4837 |
+
function wppa_sanitize_album_photo_name( $xname ) {
|
4838 |
+
|
4839 |
+
$special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", "%", "+", chr(0));
|
4840 |
+
|
4841 |
+
$name = str_replace( $special_chars, '', $xname );
|
4842 |
+
$name = sanitize_file_name( $name );
|
4843 |
+
|
4844 |
+
return $name;
|
4845 |
+
}
|
wppa-wpdb-insert.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that add new records
|
6 |
-
* Version 7.0.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -280,6 +280,7 @@ global $wpdb;
|
|
280 |
'magickstack' => '',
|
281 |
'indexdtm' => '',
|
282 |
'panorama' => '0',
|
|
|
283 |
) );
|
284 |
|
285 |
if ( $args['scheduledtm'] ) $args['status'] = 'scheduled';
|
@@ -316,9 +317,10 @@ global $wpdb;
|
|
316 |
crypt,
|
317 |
magickstack,
|
318 |
indexdtm,
|
319 |
-
panorama
|
|
|
320 |
)
|
321 |
-
VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )",
|
322 |
$args['id'],
|
323 |
$args['album'],
|
324 |
$args['ext'],
|
@@ -349,7 +351,8 @@ global $wpdb;
|
|
349 |
$args['crypt'],
|
350 |
$args['magickstack'],
|
351 |
$args['indexdtm'],
|
352 |
-
$args['panorama']
|
|
|
353 |
);
|
354 |
$iret = $wpdb->query( $query );
|
355 |
|
@@ -393,6 +396,7 @@ global $wpdb;
|
|
393 |
'crypt' => wppa_get_unique_album_crypt(),
|
394 |
'treecounts' => serialize( array( 1,0,0,0,0,0,0,0,0,0,0 ) ),
|
395 |
'indexdtm' => '',
|
|
|
396 |
) );
|
397 |
|
398 |
if ( ! wppa_is_id_free( WPPA_ALBUMS, $args['id'] ) ) $args['id'] = wppa_nextkey( WPPA_ALBUMS );
|
@@ -419,9 +423,10 @@ global $wpdb;
|
|
419 |
scheduledtm,
|
420 |
crypt,
|
421 |
treecounts,
|
422 |
-
indexdtm
|
|
|
423 |
)
|
424 |
-
VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s ,%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )",
|
425 |
$args['id'],
|
426 |
trim( $args['name'] ),
|
427 |
trim( $args['description'] ),
|
@@ -444,7 +449,8 @@ global $wpdb;
|
|
444 |
$args['scheduledtm'],
|
445 |
$args['crypt'],
|
446 |
$args['treecounts'],
|
447 |
-
$args['indexdtm']
|
|
|
448 |
);
|
449 |
$iret = $wpdb->query( $query );
|
450 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that add new records
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*/
|
9 |
|
280 |
'magickstack' => '',
|
281 |
'indexdtm' => '',
|
282 |
'panorama' => '0',
|
283 |
+
'sname' => '',
|
284 |
) );
|
285 |
|
286 |
if ( $args['scheduledtm'] ) $args['status'] = 'scheduled';
|
317 |
crypt,
|
318 |
magickstack,
|
319 |
indexdtm,
|
320 |
+
panorama,
|
321 |
+
sname
|
322 |
)
|
323 |
+
VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )",
|
324 |
$args['id'],
|
325 |
$args['album'],
|
326 |
$args['ext'],
|
351 |
$args['crypt'],
|
352 |
$args['magickstack'],
|
353 |
$args['indexdtm'],
|
354 |
+
$args['panorama'],
|
355 |
+
$args['sname']
|
356 |
);
|
357 |
$iret = $wpdb->query( $query );
|
358 |
|
396 |
'crypt' => wppa_get_unique_album_crypt(),
|
397 |
'treecounts' => serialize( array( 1,0,0,0,0,0,0,0,0,0,0 ) ),
|
398 |
'indexdtm' => '',
|
399 |
+
'sname' => wppa_sanitize_album_photo_name( __( 'New Album', 'wp-photo-album-plus' ) ),
|
400 |
) );
|
401 |
|
402 |
if ( ! wppa_is_id_free( WPPA_ALBUMS, $args['id'] ) ) $args['id'] = wppa_nextkey( WPPA_ALBUMS );
|
423 |
scheduledtm,
|
424 |
crypt,
|
425 |
treecounts,
|
426 |
+
indexdtm,
|
427 |
+
sname
|
428 |
)
|
429 |
+
VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s ,%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )",
|
430 |
$args['id'],
|
431 |
trim( $args['name'] ),
|
432 |
trim( $args['description'] ),
|
449 |
$args['scheduledtm'],
|
450 |
$args['crypt'],
|
451 |
$args['treecounts'],
|
452 |
+
$args['indexdtm'],
|
453 |
+
$args['sname']
|
454 |
);
|
455 |
$iret = $wpdb->query( $query );
|
456 |
|
wppa-wpdb-update.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that update records
|
6 |
-
* Version
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -25,6 +25,11 @@ global $wpdb;
|
|
25 |
if ( ! wppa_cache_album( $args['id'] ) ) return false;
|
26 |
$id = $args['id'];
|
27 |
|
|
|
|
|
|
|
|
|
|
|
28 |
$need_re_index = false;
|
29 |
foreach ( array_keys( $args ) as $itemname ) {
|
30 |
$itemvalue = $args[$itemname];
|
@@ -71,6 +76,9 @@ global $wpdb;
|
|
71 |
$doit = true;
|
72 |
$need_re_index = true;
|
73 |
break;
|
|
|
|
|
|
|
74 |
|
75 |
default:
|
76 |
wppa_log( 'Error', 'Not implemented in wppa_update_album(): '.$itemname );
|
@@ -132,6 +140,11 @@ global $wpdb;
|
|
132 |
$args['modified'] = time();
|
133 |
}
|
134 |
|
|
|
|
|
|
|
|
|
|
|
135 |
$need_re_index = false;
|
136 |
foreach ( array_keys( $args ) as $itemname ) {
|
137 |
$itemvalue = $args[$itemname];
|
@@ -212,6 +225,9 @@ global $wpdb;
|
|
212 |
case 'magickstack':
|
213 |
$doit = true;
|
214 |
break;
|
|
|
|
|
|
|
215 |
|
216 |
default:
|
217 |
wppa_log( 'Error', 'Not implemented in wppa_update_photo(): '.$itemname );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that update records
|
6 |
+
* Version 7.0.01
|
7 |
*
|
8 |
*/
|
9 |
|
25 |
if ( ! wppa_cache_album( $args['id'] ) ) return false;
|
26 |
$id = $args['id'];
|
27 |
|
28 |
+
// If name update, also update sname
|
29 |
+
if ( isset( $args['name'] ) ) {
|
30 |
+
$args['sname'] = wppa_sanitize_album_photo_name( $args['name'] );
|
31 |
+
}
|
32 |
+
|
33 |
$need_re_index = false;
|
34 |
foreach ( array_keys( $args ) as $itemname ) {
|
35 |
$itemvalue = $args[$itemname];
|
76 |
$doit = true;
|
77 |
$need_re_index = true;
|
78 |
break;
|
79 |
+
case 'sname':
|
80 |
+
$doit = true;
|
81 |
+
break;
|
82 |
|
83 |
default:
|
84 |
wppa_log( 'Error', 'Not implemented in wppa_update_album(): '.$itemname );
|
140 |
$args['modified'] = time();
|
141 |
}
|
142 |
|
143 |
+
// If name update, also update sname
|
144 |
+
if ( isset( $args['name'] ) ) {
|
145 |
+
$args['sname'] = wppa_sanitize_album_photo_name( $args['name'] );
|
146 |
+
}
|
147 |
+
|
148 |
$need_re_index = false;
|
149 |
foreach ( array_keys( $args ) as $itemname ) {
|
150 |
$itemvalue = $args[$itemname];
|
225 |
case 'magickstack':
|
226 |
$doit = true;
|
227 |
break;
|
228 |
+
case 'sname':
|
229 |
+
$doit = true;
|
230 |
+
break;
|
231 |
|
232 |
default:
|
233 |
wppa_log( 'Error', 'Not implemented in wppa_update_photo(): '.$itemname );
|
wppa-wrappers.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Contains wrappers for standard php functions
|
6 |
* For security and bug reasons
|
7 |
*
|
8 |
-
* Version 7.0.
|
9 |
*
|
10 |
*/
|
11 |
|
@@ -196,7 +196,7 @@ function wppa_is_dir( $dir ) {
|
|
196 |
|
197 |
// Wrapper for is_file
|
198 |
function wppa_is_file( $path ) {
|
199 |
-
|
200 |
if ( ! wppa_is_path_safe( $path ) ) {
|
201 |
wppa_log( 'War', 'Unsafe path detected in wppa_is_path(): ' . sanitize_text_field( $path ), true );
|
202 |
return false;
|
@@ -213,7 +213,7 @@ global $wppa_lang;
|
|
213 |
global $wppa_log_file;
|
214 |
|
215 |
if ( substr( strtolower( $path ), 0, 7 ) == 'phar://' ) return false;
|
216 |
-
|
217 |
if ( ! defined( 'WPPA_UPLOAD_PATH' ) ) return true; // During activation/setup
|
218 |
|
219 |
if ( empty( $safe_files ) ) {
|
@@ -241,6 +241,7 @@ global $wppa_log_file;
|
|
241 |
WPPA_UPLOAD_PATH . '/temp',
|
242 |
WPPA_UPLOAD_PATH . '/zips',
|
243 |
WPPA_UPLOAD_PATH . '/qr',
|
|
|
244 |
);
|
245 |
|
246 |
}
|
5 |
* Contains wrappers for standard php functions
|
6 |
* For security and bug reasons
|
7 |
*
|
8 |
+
* Version 7.0.01
|
9 |
*
|
10 |
*/
|
11 |
|
196 |
|
197 |
// Wrapper for is_file
|
198 |
function wppa_is_file( $path ) {
|
199 |
+
|
200 |
if ( ! wppa_is_path_safe( $path ) ) {
|
201 |
wppa_log( 'War', 'Unsafe path detected in wppa_is_path(): ' . sanitize_text_field( $path ), true );
|
202 |
return false;
|
213 |
global $wppa_log_file;
|
214 |
|
215 |
if ( substr( strtolower( $path ), 0, 7 ) == 'phar://' ) return false;
|
216 |
+
|
217 |
if ( ! defined( 'WPPA_UPLOAD_PATH' ) ) return true; // During activation/setup
|
218 |
|
219 |
if ( empty( $safe_files ) ) {
|
241 |
WPPA_UPLOAD_PATH . '/temp',
|
242 |
WPPA_UPLOAD_PATH . '/zips',
|
243 |
WPPA_UPLOAD_PATH . '/qr',
|
244 |
+
WPPA_UPLOAD_PATH . '/cache',
|
245 |
);
|
246 |
|
247 |
}
|
wppa.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
-
* Version: 7.0.
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
@@ -22,8 +22,8 @@ global $wpdb;
|
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
-
global $wppa_revno; $wppa_revno = '
|
26 |
-
global $wppa_api_version; $wppa_api_version = '7-0-
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
+
* Version: 7.0.01.006
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
+
global $wppa_revno; $wppa_revno = '7001'; // WPPA db version
|
26 |
+
global $wppa_api_version; $wppa_api_version = '7-0-01-006'; // WPPA software version
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|