Version Description
- 03.15.2016 = Fixed: Removed unnecessary whitespace from "Related images" template that caused issues with some themes Fixed: Detection of parents from grand-child-albums when generating breadcrumbs Fixed: C_Router->initialize() generating warnings with WP-CLI or the WP-CLI-Cron Fixed: Added Roots-theme relative-url support to C_MVC_Router->get_static_url() Fixed: nggdb::get_unique_slug() checking test-1, -2, -3,.. -9, -10, and then rolling back to -1 rather than continuing to -11, -12, etc Fixed: Album breadcrumbs CSS compatibility with certain themes Fixed: Made C_Gallery->validation() not use sanitize_title() on the image name attribute; this allows gallery names with UTF-8 to not generate 404 Fixed: NGG's cross-frame-communication cookies from building up (and not being culled) to the point HTTP requests were rejected by the server for having too large of a cookie header Fixed: Updated C_Dynamic_Thumbnails_Manager->get_uri_from_params() with a minor user-submitted patch Fixed: Updated C_CustomPost_DataMapper_Driver->_save_entity() with a minor user-submitted patch Fixed: Cleaned up overview.php's readability and removed some now-long-unused code from legacy's ajax.php
Download this release
Release Info
Developer | photocrati |
Plugin | NextGEN Gallery – WordPress Gallery Plugin |
Version | 2.1.26 |
Comparing to | |
See all releases |
Code changes from version 2.1.23 to 2.1.26
- .hg_archival.txt +2 -2
- .hgtags +1 -0
- changelog.txt +13 -0
- nggallery.php +3 -3
- products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php +1 -1
- products/photocrati_nextgen/modules/datamapper/package.module.datamapper.php +4 -2
- products/photocrati_nextgen/modules/dynamic_thumbnails/package.module.dynamic_thumbnails.php +1 -2
- products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php +8 -1
- products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.js +13 -7
- products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.min.js +1 -1
- products/photocrati_nextgen/modules/i18n/lang/nggallery.po +2 -2
- products/photocrati_nextgen/modules/mvc/package.module.mvc.php +4 -0
- products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php +1 -0
- products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.css +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.min.css +1 -1
- products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php +2 -2
- products/photocrati_nextgen/modules/nextgen_gallery_display/templates/related.php +1 -4
- products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php +2 -151
- products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php +8 -0
- products/photocrati_nextgen/modules/ngglegacy/admin/overview.php +298 -442
- products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php +1 -1
- products/photocrati_nextgen/modules/router/package.module.router.php +1 -1
- readme.txt +18 -5
.hg_archival.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
repo: 2b82bc45fbe039c6f4c9f0c667e9cd1ee4d84cbb
|
2 |
-
node:
|
3 |
branch: default
|
4 |
-
tag: 2.1.
|
1 |
repo: 2b82bc45fbe039c6f4c9f0c667e9cd1ee4d84cbb
|
2 |
+
node: 193d9b5fe3c5b949c9e2289e93011746202f9aa2
|
3 |
branch: default
|
4 |
+
tag: 2.1.26
|
.hgtags
CHANGED
@@ -337,3 +337,4 @@ adbd42e0b7450aa76fd70c4218d07bac9beb3c7b 2.1.19
|
|
337 |
22e4846d4b3b59177e20e26974edd4b84470c394 2.1.19
|
338 |
f334e538b611b3210e9187f696b5d61089d6a470 2.1.21
|
339 |
56c44c308de1f74ad1411fd5db0ea0eadbdfade9 2.1.22
|
|
337 |
22e4846d4b3b59177e20e26974edd4b84470c394 2.1.19
|
338 |
f334e538b611b3210e9187f696b5d61089d6a470 2.1.21
|
339 |
56c44c308de1f74ad1411fd5db0ea0eadbdfade9 2.1.22
|
340 |
+
a3e4a954e5b4c109fb932394d288ba47376223c2 2.1.23
|
changelog.txt
CHANGED
@@ -1,6 +1,19 @@
|
|
1 |
NextGEN Gallery
|
2 |
by Photocrati Media
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
= V2.1.23 - 01.05.2015 =
|
5 |
* Secured: XSS vulnerabilities in Manage Gallery pages
|
6 |
* Secured: Ability to browse and import gallery folders
|
1 |
NextGEN Gallery
|
2 |
by Photocrati Media
|
3 |
|
4 |
+
= V2.1.26 - 03.15.2016 =
|
5 |
+
Fixed: Removed unnecessary whitespace from "Related images" template that caused issues with some themes
|
6 |
+
Fixed: Detection of parents from grand-child-albums when generating breadcrumbs
|
7 |
+
Fixed: C_Router->initialize() generating warnings with WP-CLI or the WP-CLI-Cron
|
8 |
+
Fixed: Added Roots-theme relative-url support to C_MVC_Router->get_static_url()
|
9 |
+
Fixed: nggdb::get_unique_slug() checking test-1, -2, -3,.. -9, -10, and then rolling back to -1 rather than continuing to -11, -12, etc
|
10 |
+
Fixed: Album breadcrumbs CSS compatibility with certain themes
|
11 |
+
Fixed: Made C_Gallery->validation() not use sanitize_title() on the image name attribute; this allows gallery names with UTF-8 to not generate 404
|
12 |
+
Fixed: NGG's cross-frame-communication cookies from building up (and not being culled) to the point HTTP requests were rejected by the server for having too large of a cookie header
|
13 |
+
Fixed: Updated C_Dynamic_Thumbnails_Manager->get_uri_from_params() with a minor user-submitted patch
|
14 |
+
Fixed: Updated C_CustomPost_DataMapper_Driver->_save_entity() with a minor user-submitted patch
|
15 |
+
Fixed: Cleaned up overview.php's readability and removed some now-long-unused code from legacy's ajax.php
|
16 |
+
|
17 |
= V2.1.23 - 01.05.2015 =
|
18 |
* Secured: XSS vulnerabilities in Manage Gallery pages
|
19 |
* Secured: Ability to browse and import gallery folders
|
nggallery.php
CHANGED
@@ -3,8 +3,8 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
|
|
3 |
|
4 |
/**
|
5 |
* Plugin Name: NextGEN Gallery by Photocrati
|
6 |
-
* Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over
|
7 |
-
* Version: 2.1.
|
8 |
* Author: Photocrati Media
|
9 |
* Plugin URI: http://www.nextgen-gallery.com
|
10 |
* Author URI: http://www.photocrati.com
|
@@ -589,7 +589,7 @@ class C_NextGEN_Bootstrap
|
|
589 |
define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
|
590 |
define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
|
591 |
define('NGG_PLUGIN_STARTED_AT', microtime());
|
592 |
-
define('NGG_PLUGIN_VERSION', '2.1.
|
593 |
|
594 |
if (!defined('NGG_HIDE_STRICT_ERRORS')) {
|
595 |
define('NGG_HIDE_STRICT_ERRORS', TRUE);
|
3 |
|
4 |
/**
|
5 |
* Plugin Name: NextGEN Gallery by Photocrati
|
6 |
+
* Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 14 million downloads.
|
7 |
+
* Version: 2.1.26
|
8 |
* Author: Photocrati Media
|
9 |
* Plugin URI: http://www.nextgen-gallery.com
|
10 |
* Author URI: http://www.photocrati.com
|
589 |
define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
|
590 |
define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
|
591 |
define('NGG_PLUGIN_STARTED_AT', microtime());
|
592 |
+
define('NGG_PLUGIN_VERSION', '2.1.26');
|
593 |
|
594 |
if (!defined('NGG_HIDE_STRICT_ERRORS')) {
|
595 |
define('NGG_HIDE_STRICT_ERRORS', TRUE);
|
products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php
CHANGED
@@ -204,7 +204,7 @@ class A_Gallery_Storage_Frame_Event extends Mixin
|
|
204 |
$event->pid = $image->{$image->id_field};
|
205 |
$event->id_field = $image->id_field;
|
206 |
$event->thumb_url = $image->thumb_url;
|
207 |
-
C_Frame_Event_Publisher::get_instance()->add_event(array('event' => 'thumbnail_modified', 'image' => $event));
|
208 |
}
|
209 |
return $retval;
|
210 |
}
|
204 |
$event->pid = $image->{$image->id_field};
|
205 |
$event->id_field = $image->id_field;
|
206 |
$event->thumb_url = $image->thumb_url;
|
207 |
+
C_Frame_Event_Publisher::get_instance('attach_to_post')->add_event(array('event' => 'thumbnail_modified', 'image' => $event));
|
208 |
}
|
209 |
return $retval;
|
210 |
}
|
products/photocrati_nextgen/modules/datamapper/package.module.datamapper.php
CHANGED
@@ -360,8 +360,10 @@ class Mixin_CustomPost_DataMapper_Driver extends Mixin
|
|
360 |
// final release.
|
361 |
if ($post_id = @wp_insert_post($post)) {
|
362 |
$new_entity = $this->object->find($post_id, TRUE);
|
363 |
-
|
364 |
-
$
|
|
|
|
|
365 |
}
|
366 |
// Save properties as post meta
|
367 |
$this->object->_flush_and_update_postmeta($post_id, $entity instanceof stdClass ? $entity : $entity->get_entity());
|
360 |
// final release.
|
361 |
if ($post_id = @wp_insert_post($post)) {
|
362 |
$new_entity = $this->object->find($post_id, TRUE);
|
363 |
+
if ($new_entity) {
|
364 |
+
foreach ($new_entity->get_entity() as $key => $value) {
|
365 |
+
$entity->{$key} = $value;
|
366 |
+
}
|
367 |
}
|
368 |
// Save properties as post meta
|
369 |
$this->object->_flush_and_update_postmeta($post_id, $entity instanceof stdClass ? $entity : $entity->get_entity());
|
products/photocrati_nextgen/modules/dynamic_thumbnails/package.module.dynamic_thumbnails.php
CHANGED
@@ -173,7 +173,7 @@ class Mixin_Dynamic_Thumbnails_Manager extends Mixin
|
|
173 |
{
|
174 |
$params = $this->object->_get_params_sanitized($params);
|
175 |
$image = isset($params['image']) ? $params['image'] : null;
|
176 |
-
$image_id = is_scalar($image) ? (int) $image : $image->pid;
|
177 |
$image_width = isset($params['width']) ? $params['width'] : null;
|
178 |
$image_height = isset($params['height']) ? $params['height'] : null;
|
179 |
$image_quality = isset($params['quality']) ? $params['quality'] : null;
|
@@ -183,7 +183,6 @@ class Mixin_Dynamic_Thumbnails_Manager extends Mixin
|
|
183 |
$image_rotation = isset($params['rotation']) ? $params['rotation'] : null;
|
184 |
$image_flip = isset($params['flip']) ? $params['flip'] : null;
|
185 |
$image_reflection = isset($params['reflection']) ? $params['reflection'] : null;
|
186 |
-
$router = C_Router::get_instance();
|
187 |
$uri = null;
|
188 |
$uri .= '/';
|
189 |
$uri .= $this->object->get_route_name() . '/';
|
173 |
{
|
174 |
$params = $this->object->_get_params_sanitized($params);
|
175 |
$image = isset($params['image']) ? $params['image'] : null;
|
176 |
+
$image_id = is_scalar($image) || is_null($image) ? (int) $image : $image->pid;
|
177 |
$image_width = isset($params['width']) ? $params['width'] : null;
|
178 |
$image_height = isset($params['height']) ? $params['height'] : null;
|
179 |
$image_quality = isset($params['quality']) ? $params['quality'] : null;
|
183 |
$image_rotation = isset($params['rotation']) ? $params['rotation'] : null;
|
184 |
$image_flip = isset($params['flip']) ? $params['flip'] : null;
|
185 |
$image_reflection = isset($params['reflection']) ? $params['reflection'] : null;
|
|
|
186 |
$uri = null;
|
187 |
$uri .= '/';
|
188 |
$uri .= $this->object->get_route_name() . '/';
|
products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php
CHANGED
@@ -52,9 +52,16 @@ class M_Frame_Communication extends C_Base_Module
|
|
52 |
$router->get_static_url('photocrati-frame_communication#frame_event_publisher.js'),
|
53 |
array('jquery')
|
54 |
);
|
55 |
-
|
56 |
if (is_admin())
|
|
|
57 |
wp_enqueue_script('frame_event_publisher');
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
|
60 |
function get_type_list()
|
52 |
$router->get_static_url('photocrati-frame_communication#frame_event_publisher.js'),
|
53 |
array('jquery')
|
54 |
);
|
55 |
+
|
56 |
if (is_admin())
|
57 |
+
{
|
58 |
wp_enqueue_script('frame_event_publisher');
|
59 |
+
wp_localize_script(
|
60 |
+
'frame_event_publisher',
|
61 |
+
'frame_event_publisher_domain',
|
62 |
+
array(parse_url(site_url(), PHP_URL_HOST))
|
63 |
+
);
|
64 |
+
}
|
65 |
}
|
66 |
|
67 |
function get_type_list()
|
products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
(function(g,f){'use strict';var h=function(e){if("object"!==typeof e.document)throw Error("Cookies.js requires a `window` with a `document` object");var b=function(a,d,c){return 1===arguments.length?b.get(a):b.set(a,d,c)};b._document=e.document;b._cacheKeyPrefix="cookey.";b._maxExpireDate=new Date("Fri, 31 Dec 9999 23:59:59 UTC");b.defaults={path:"/",secure:!1};b.get=function(a){b._cachedDocumentCookie!==b._document.cookie&&b._renewCache();a=b._cache[b._cacheKeyPrefix+a];return a===f?f:decodeURIComponent(a)};
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
|
8 |
window.Frame_Event_Publisher = {
|
9 |
id: window.name,
|
@@ -39,6 +39,12 @@ window.Frame_Event_Publisher = {
|
|
39 |
|
40 |
initialize: function(){
|
41 |
this.setup_ajax_handlers();
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
this.window = window;
|
43 |
if (typeof(this.window.id) != 'undefined' && this.window.id.length != null && this.window.id.length > 0) this.id = this.window.id;
|
44 |
else this.id == 'Unknown';
|
@@ -163,8 +169,8 @@ window.Frame_Event_Publisher = {
|
|
163 |
return frame_events;
|
164 |
},
|
165 |
|
166 |
-
delete_cookie: function(cookie){
|
167 |
-
|
168 |
},
|
169 |
|
170 |
listen_for: function(signal, callback){
|
1 |
(function(g,f){'use strict';var h=function(e){if("object"!==typeof e.document)throw Error("Cookies.js requires a `window` with a `document` object");var b=function(a,d,c){return 1===arguments.length?b.get(a):b.set(a,d,c)};b._document=e.document;b._cacheKeyPrefix="cookey.";b._maxExpireDate=new Date("Fri, 31 Dec 9999 23:59:59 UTC");b.defaults={path:"/",secure:!1};b.get=function(a){b._cachedDocumentCookie!==b._document.cookie&&b._renewCache();a=b._cache[b._cacheKeyPrefix+a];return a===f?f:decodeURIComponent(a)};
|
2 |
+
b.set=function(a,d,c){c=b._getExtendedOptions(c);c.expires=b._getExpiresDate(d===f?-1:c.expires);b._document.cookie=b._generateCookieString(a,d,c);return b};b.expire=function(a,d){return b.set(a,f,d)};b._getExtendedOptions=function(a){return{path:a&&a.path||b.defaults.path,domain:a&&a.domain||b.defaults.domain,expires:a&&a.expires||b.defaults.expires,secure:a&&a.secure!==f?a.secure:b.defaults.secure}};b._isValidDate=function(a){return"[object Date]"===Object.prototype.toString.call(a)&&!isNaN(a.getTime())};
|
3 |
+
b._getExpiresDate=function(a,d){d=d||new Date;"number"===typeof a?a=Infinity===a?b._maxExpireDate:new Date(d.getTime()+1E3*a):"string"===typeof a&&(a=new Date(a));if(a&&!b._isValidDate(a))throw Error("`expires` parameter cannot be converted to a valid Date instance");return a};b._generateCookieString=function(a,b,c){a=a.replace(/[^#$&+\^`|]/g,encodeURIComponent);a=a.replace(/\(/g,"%28").replace(/\)/g,"%29");b=(b+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent);c=c||{};a=a+"="+b+(c.path?";path="+
|
4 |
+
c.path:"");a+=c.domain?";domain="+c.domain:"";a+=c.expires?";expires="+c.expires.toUTCString():"";return a+=c.secure?";secure":""};b._getCacheFromString=function(a){var d={};a=a?a.split("; "):[];for(var c=0;c<a.length;c++){var e=b._getKeyValuePairFromCookieString(a[c]);d[b._cacheKeyPrefix+e.key]===f&&(d[b._cacheKeyPrefix+e.key]=e.value)}return d};b._getKeyValuePairFromCookieString=function(a){var b=a.indexOf("="),b=0>b?a.length:b,c=a.substr(0,b),e;try{e=decodeURIComponent(c)}catch(f){console&&"function"===
|
5 |
+
typeof console.error&&console.error('Could not decode cookie with key "'+c+'"',f)}return{key:e,value:a.substr(b+1)}};b._renewCache=function(){b._cache=b._getCacheFromString(b._document.cookie);b._cachedDocumentCookie=b._document.cookie};b._areEnabled=function(){var a="1"===b.set("cookies.js",1).get("cookies.js");b.expire("cookies.js");return a};b.enabled=b._areEnabled();return b},e="object"===typeof g.document?h(g):h;"function"===typeof define&&define.amd?define(function(){return e}):"object"===typeof exports?
|
6 |
+
("object"===typeof module&&"object"===typeof module.exports&&(exports=module.exports=e),exports.Cookies=e):g.Cookies=e})("undefined"===typeof window?this:window);
|
7 |
|
8 |
window.Frame_Event_Publisher = {
|
9 |
id: window.name,
|
39 |
|
40 |
initialize: function(){
|
41 |
this.setup_ajax_handlers();
|
42 |
+
|
43 |
+
// Provided by wp_localize_script() this lets us delete cookies set by the server
|
44 |
+
if (typeof window.frame_event_publisher_domain !== 'undefined') {
|
45 |
+
Cookies.defaults.domain = window.frame_event_publisher_domain;
|
46 |
+
}
|
47 |
+
|
48 |
this.window = window;
|
49 |
if (typeof(this.window.id) != 'undefined' && this.window.id.length != null && this.window.id.length > 0) this.id = this.window.id;
|
50 |
else this.id == 'Unknown';
|
169 |
return frame_events;
|
170 |
},
|
171 |
|
172 |
+
delete_cookie: function(cookie) {
|
173 |
+
Cookies.expire(cookie);
|
174 |
},
|
175 |
|
176 |
listen_for: function(signal, callback){
|
products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(4(g,f){\'
|
1 |
+
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(4(g,f){\'2m 2n\';5 h=4(e){6("y"!==j e.p)1z 1B("I.Q 2l a `8` 1s a `p` y");5 b=4(a,d,c){7 1===16.t?b.14(a):b.R(a,d,c)};b.J=e.p;b.10="2k.";b.1r=W A("2i, 2j 2o 2p 23:1q:1q 2v");b.D={v:"/",w:!1};b.14=4(a){b.1F!==b.J.o&&b.1E();a=b.1o[b.10+a];7 a===f?f:1v(a)};b.R=4(a,d,c){c=b.1p(c);c.r=b.1l(d===f?-1:c.r);b.J.o=b.1C(a,d,c);7 b};b.1d=4(a,d){7 b.R(a,f,d)};b.1p=4(a){7{v:a&&a.v||b.D.v,x:a&&a.x||b.D.x,r:a&&a.r||b.D.r,w:a&&a.w!==f?a.w:b.D.w}};b.1m=4(a){7"[y A]"===2s.2h.2r.1Q(a)&&!2w(a.1j())};b.1l=4(a,d){d=d||W A;"2e"===j a?a=22===a?b.1r:W A(d.1j()+21*a):"26"===j a&&(a=W A(a));6(a&&!b.1m(a))1z 1B("`r` 27 2f 2d 2c 1I a 2a A 2q");7 a};b.1C=4(a,b,c){a=a.G(/[^#$&+\\^`|]/g,1D);a=a.G(/\\(/g,"%28").G(/\\)/g,"%29");b=(b+"").G(/[^!#$&-+\\--:<-\\[\\]-~]/g,1D);c=c||{};a=a+"="+b+(c.v?";v="+c.v:"");a+=c.x?";x="+c.x:"";a+=c.r?";r="+c.r.2K():"";7 a+=c.w?";w":""};b.1A=4(a){5 d={};a=a?a.1O("; "):[];M(5 c=0;c<a.t;c++){5 e=b.1u(a[c]);d[b.10+e.U]===f&&(d[b.10+e.U]=e.1w)}7 d};b.1u=4(a){5 b=a.2A("="),b=0>b?a.t:b,c=a.1x(0,b),e;Y{e=1v(c)}V(f){s&&"4"===j s.1t&&s.1t(\'2B 2C 2F o 1s U "\'+c+\'"\',f)}7{U:e,1w:a.1x(b+1)}};b.1E=4(){b.1o=b.1A(b.J.o);b.1F=b.J.o};b.1n=4(){5 a="1"===b.R("z.Q",1).14("z.Q");b.1d("z.Q");7 a};b.2J=b.1n();7 b},e="y"===j g.p?h(g):h;"4"===j 1i&&1i.2M?1i(4(){7 e}):"y"===j H?("y"===j 1g&&"y"===j 1g.H&&(H=1g.H=e),H.I=e):g.I=e})("q"===j 8?3:8);8.O={9:8.2z,1a:\'X-17-2g\',u:[],P:F,L:{},8:F,1y:F,1c:4(){7 1k.12.p===1k.p},1L:4(){7!3.1c()},1Z:4(){6(!3.1y){5 C=3;S(p).2t(4(e,2u,2O){1U(4(){C.1Y()},0)})}},1Y:4(){3.E(3.1e(p.o))},1X:4(){3.1Z();6(j 8.1G!==\'q\'){I.D.x=8.1G}3.8=8;6(j(3.8.9)!=\'q\'&&3.8.9.t!=2D&&3.8.9.t>0)3.9=3.8.9;15 3.9==\'20\';3.u=3.1e(p.o);3.P=1W;6(3.1c())3.T(3.u,1W);7 3.u},1M:4(k){3.L[k.9]=k},E:4(m,k){6(!3.P)m=3.1X();6(3.9=="20"){3.P=F;1U(4(){3.E(m,k)},2I)}15{6(3.1L()){6(16.t<=1)k=8;3.19(k).1M(k.O);3.1K(m,k)}15{6(16.t==0)m=3.u;3.1J(m)}}},1K:4(m,k){3.19(k).E(m,k)},1J:4(m){3.T(m);M(5 18 1H 3.L){5 k=3.L[18];Y{k.T(m)}V(K){6(j(s)!="q")s.1b(K);2N 3.L.18}}},19:4(k){5 B=k;Y{2H(B.p!==B.12.p)B=B.12}V(K){6(j(s)!="q")s.1b(K)}7 B.O},T:4(m,N){6(j(N)=="q")N=F;M(5 n 1H m){5 l=m[n];6(!N&&!3.1f(n)){6(j(s)!="q")s.1b("2G "+n+":"+l.l+" 1I "+3.9);3.1N(n,m[n])}}},1f:4(9){7 3.u[9]!=q},1N:4(9,l){5 Z=l.13+\':\'+l.l;l.9=9;6(j(8)!="q")S(8).2E(Z,l);3.u[9]=l},1e:4(o){5 1h={};5 z=2y(o).1O(\' \');M(5 i=0;i<z.t;i++){5 1V=z[i];5 11=1V.2L(/X-17-1S([^=]+)=(.*)/);6(11){5 n=11[1];5 1T=11[2].G(/;$/,\'\');Y{1h[n]=2x.2b(1T)}V(K){}5 1a=\'X-17-1S\'+n;3.1R(1a)}}7 1h},1R:4(o){I.1d(o)},25:4(Z,1P){5 C=3;S(8).24(Z,4(e,l){5 13=l.13;5 n=l.9;6(!C.1f(n)){1P.1Q(C,l);C.u[n]=l}})}};S(4($){O.E()});',62,175,'|||this|function|var|if|return|window|id||||||||||typeof|child|event|events|event_id|cookie|document|undefined|expires|console|length|received|path|secure|domain|object|cookies|Date|retval|publisher|defaults|broadcast|false|replace|exports|Cookies|_document|ex|children|for|forced|Frame_Event_Publisher|initialized|js|set|jQuery|emit|key|catch|new||try|signal|_cacheKeyPrefix|parts|parent|context|get|else|arguments|Frame|index|find_parent|cookie_name|log|is_parent|expire|get_events|has_received_event|module|frame_events|define|getTime|self|_getExpiresDate|_isValidDate|_areEnabled|_cache|_getExtendedOptions|59|_maxExpireDate|with|error|_getKeyValuePairFromCookieString|decodeURIComponent|value|substr|ajax_handlers_setup|throw|_getCacheFromString|Error|_generateCookieString|encodeURIComponent|_renewCache|_cachedDocumentCookie|frame_event_publisher_domain|in|to|notify_children|notify_parent|is_child|register_child|trigger_event|split|callback|call|delete_cookie|Events_|event_data|setTimeout|current_cookie|true|initialize|ajax_handler|setup_ajax_handlers|Unknown|1E3|Infinity||bind|listen_for|string|parameter|||valid|parse|converted|be|number|cannot|Events|prototype|Fri|31|cookey|requires|use|strict|Dec|9999|instance|toString|Object|ajaxComplete|xhr|UTC|isNaN|JSON|unescape|name|indexOf|Could|not|null|trigger|decode|Emitting|while|100|enabled|toUTCString|match|amd|delete|settings'.split('|'),0,{}))
|
products/photocrati_nextgen/modules/i18n/lang/nggallery.po
CHANGED
@@ -2418,7 +2418,7 @@ msgid "Server Settings"
|
|
2418 |
msgstr ""
|
2419 |
|
2420 |
#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
|
2421 |
-
msgid "NextGEN Gallery is one of the most popular WordPress plugins of all time with over
|
2422 |
msgstr ""
|
2423 |
|
2424 |
#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
|
@@ -3203,7 +3203,7 @@ msgid "http://www.nextgen-gallery.com"
|
|
3203 |
msgstr ""
|
3204 |
|
3205 |
#. Description of the plugin/theme
|
3206 |
-
msgid "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over
|
3207 |
msgstr ""
|
3208 |
|
3209 |
#. Author of the plugin/theme
|
2418 |
msgstr ""
|
2419 |
|
2420 |
#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
|
2421 |
+
msgid "NextGEN Gallery is one of the most popular WordPress plugins of all time with over 14 million downloads."
|
2422 |
msgstr ""
|
2423 |
|
2424 |
#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
|
3203 |
msgstr ""
|
3204 |
|
3205 |
#. Description of the plugin/theme
|
3206 |
+
msgid "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 14 million downloads."
|
3207 |
msgstr ""
|
3208 |
|
3209 |
#. Author of the plugin/theme
|
products/photocrati_nextgen/modules/mvc/package.module.mvc.php
CHANGED
@@ -153,6 +153,10 @@ class A_MVC_Router extends Mixin
|
|
153 |
$retval = self::$_lookups[$key] = $this->object->join_paths($this->object->get_base_url('root'), str_replace('\\', '/', $path));
|
154 |
}
|
155 |
}
|
|
|
|
|
|
|
|
|
156 |
return $retval;
|
157 |
}
|
158 |
}
|
153 |
$retval = self::$_lookups[$key] = $this->object->join_paths($this->object->get_base_url('root'), str_replace('\\', '/', $path));
|
154 |
}
|
155 |
}
|
156 |
+
// For "roots" and others that make use of relative URL
|
157 |
+
if (current_theme_supports('root-relative-urls') && strpos($retval, '/') !== 0) {
|
158 |
+
$retval = '/' . $retval;
|
159 |
+
}
|
160 |
return $retval;
|
161 |
}
|
162 |
}
|
products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php
CHANGED
@@ -80,6 +80,7 @@ class A_NextGen_Album_Breadcrumbs extends Mixin
|
|
80 |
$found = $this->find_gallery_parent($gallery_id, $album->sortorder, $found);
|
81 |
if ($found) {
|
82 |
$found[] = $album;
|
|
|
83 |
}
|
84 |
}
|
85 |
}
|
80 |
$found = $this->find_gallery_parent($gallery_id, $album->sortorder, $found);
|
81 |
if ($found) {
|
82 |
$found[] = $album;
|
83 |
+
break;
|
84 |
}
|
85 |
}
|
86 |
}
|
products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.css
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
padding: .5em 0 .5em 0;
|
6 |
}
|
7 |
|
8 |
-
.ngg-breadcrumbs li {
|
9 |
float: left;
|
10 |
padding: 0 .3em 0 .15em;
|
11 |
margin: 0;
|
5 |
padding: .5em 0 .5em 0;
|
6 |
}
|
7 |
|
8 |
+
ul.ngg-breadcrumbs > li {
|
9 |
float: left;
|
10 |
padding: 0 .3em 0 .15em;
|
11 |
margin: 0;
|
products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.ngg-breadcrumbs{list-style:none;overflow:hidden;margin:0;padding:.5em 0 .5em 0}.ngg-breadcrumbs
|
1 |
+
.ngg-breadcrumbs{list-style:none;overflow:hidden;margin:0;padding:.5em 0 .5em 0}ul.ngg-breadcrumbs>li{float:left;padding:0 .3em 0 .15em;margin:0;vertical-align:middle;border:0;list-style-type:none}.ngg-breadcrumbs .ngg-breadcrumb-divisor{margin:0;padding:0 0 0 .15em}
|
products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php
CHANGED
@@ -230,12 +230,12 @@ class Mixin_NextGen_Gallery_Validation
|
|
230 |
$this->object->title = M_NextGen_Data::strip_html($this->object->title, TRUE);
|
231 |
// If no name is present, use the title to generate one
|
232 |
if (!$this->object->name) {
|
233 |
-
$this->object->name = sanitize_file_name(
|
234 |
$this->object->name = apply_filters('ngg_gallery_name', $this->object->name);
|
235 |
}
|
236 |
// If no slug is set, use the title to generate one
|
237 |
if (!$this->object->slug) {
|
238 |
-
$this->object->slug = nggdb::get_unique_slug(
|
239 |
}
|
240 |
}
|
241 |
// Set what will be the path to the gallery
|
230 |
$this->object->title = M_NextGen_Data::strip_html($this->object->title, TRUE);
|
231 |
// If no name is present, use the title to generate one
|
232 |
if (!$this->object->name) {
|
233 |
+
$this->object->name = sanitize_file_name($this->object->title);
|
234 |
$this->object->name = apply_filters('ngg_gallery_name', $this->object->name);
|
235 |
}
|
236 |
// If no slug is set, use the title to generate one
|
237 |
if (!$this->object->slug) {
|
238 |
+
$this->object->slug = nggdb::get_unique_slug($this->object->title, 'gallery');
|
239 |
}
|
240 |
}
|
241 |
// Set what will be the path to the gallery
|
products/photocrati_nextgen/modules/nextgen_gallery_display/templates/related.php
CHANGED
@@ -1,11 +1,8 @@
|
|
1 |
<div class="ngg-related-gallery">
|
2 |
-
<?php foreach ($images as $image) {
|
3 |
-
|
4 |
-
<?php
|
5 |
$controller = C_Display_Type_Controller::get_instance();
|
6 |
$effect_code = $controller->get_effect_code($gallery->displayed_gallery);
|
7 |
?>
|
8 |
-
|
9 |
<a href="<?php echo $image->imageURL; ?>"
|
10 |
title="<?php echo stripslashes(M_I18N::translate($image->description, 'pic_' . $image->pid . '_description')); ?>"
|
11 |
<?php echo $effect_code; ?>>
|
1 |
<div class="ngg-related-gallery">
|
2 |
+
<?php foreach ($images as $image) {
|
|
|
|
|
3 |
$controller = C_Display_Type_Controller::get_instance();
|
4 |
$effect_code = $controller->get_effect_code($gallery->displayed_gallery);
|
5 |
?>
|
|
|
6 |
<a href="<?php echo $image->imageURL; ?>"
|
7 |
title="<?php echo stripslashes(M_I18N::translate($image->description, 'pic_' . $image->pid . '_description')); ?>"
|
8 |
<?php echo $effect_code; ?>>
|
products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php
CHANGED
@@ -11,8 +11,6 @@ add_action('wp_ajax_ngg_ajax_operation', 'ngg_ajax_operation' );
|
|
11 |
*/
|
12 |
function ngg_ajax_operation() {
|
13 |
|
14 |
-
global $wpdb;
|
15 |
-
|
16 |
// if nonce is not correct it returns -1
|
17 |
check_ajax_referer( "ngg-ajax" );
|
18 |
|
@@ -77,8 +75,6 @@ add_action('wp_ajax_createNewThumb', 'createNewThumb');
|
|
77 |
|
78 |
function createNewThumb() {
|
79 |
|
80 |
-
global $ngg;
|
81 |
-
|
82 |
// check for correct capability
|
83 |
if ( !is_user_logged_in() )
|
84 |
die('-1');
|
@@ -87,8 +83,7 @@ function createNewThumb() {
|
|
87 |
if ( !current_user_can('NextGEN Manage gallery') )
|
88 |
die('-1');
|
89 |
|
90 |
-
$id
|
91 |
-
$picture = nggdb::find_image( $id );
|
92 |
|
93 |
$x = round( $_POST['x'] * $_POST['rr'], 0);
|
94 |
$y = round( $_POST['y'] * $_POST['rr'], 0);
|
@@ -96,8 +91,7 @@ function createNewThumb() {
|
|
96 |
$h = round( $_POST['h'] * $_POST['rr'], 0);
|
97 |
$crop_frame = array('x' => $x, 'y' => $y, 'width' => $w, 'height' => $h);
|
98 |
|
99 |
-
$
|
100 |
-
$storage = C_Gallery_Storage::get_instance();
|
101 |
|
102 |
// XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility
|
103 |
$params = array('watermark' => false, 'reflection' => false, 'crop' => true, 'crop_frame' => $crop_frame);
|
@@ -130,8 +124,6 @@ function ngg_rotateImage() {
|
|
130 |
// include the ngg function
|
131 |
include_once (dirname (__FILE__). '/functions.php');
|
132 |
|
133 |
-
$ngg_options = get_option('ngg_options');
|
134 |
-
|
135 |
$id = (int) $_POST['id'];
|
136 |
$result = '-1';
|
137 |
|
@@ -160,7 +152,6 @@ function ngg_rotateImage() {
|
|
160 |
|
161 |
header('HTTP/1.1 500 Internal Server Error');
|
162 |
die( $result );
|
163 |
-
|
164 |
}
|
165 |
|
166 |
add_action('wp_ajax_ngg_dashboard', 'ngg_ajax_dashboard');
|
@@ -178,150 +169,10 @@ function ngg_ajax_dashboard() {
|
|
178 |
|
179 |
switch ( $_GET['jax'] ) {
|
180 |
|
181 |
-
case 'ngg_lastdonators' :
|
182 |
-
ngg_overview_donators();
|
183 |
-
break;
|
184 |
-
|
185 |
case 'dashboard_primary' :
|
186 |
ngg_overview_news();
|
187 |
break;
|
188 |
-
|
189 |
-
case 'dashboard_plugins' :
|
190 |
-
ngg_related_plugins();
|
191 |
-
break;
|
192 |
-
|
193 |
}
|
194 |
-
die();
|
195 |
-
}
|
196 |
-
|
197 |
-
add_action( 'wp_ajax_ngg_rebuild_unique_slugs', 'ngg_ajax_rebuild_unique_slugs' );
|
198 |
-
/**
|
199 |
-
* This rebuild the slugs for albums, galleries and images as ajax routine, max 50 elements per request
|
200 |
-
*
|
201 |
-
* @since 1.7.0
|
202 |
-
* @return string '1'
|
203 |
-
*/
|
204 |
-
function ngg_ajax_rebuild_unique_slugs() {
|
205 |
-
global $wpdb;
|
206 |
-
|
207 |
-
// check for correct NextGEN capability
|
208 |
-
if ( !current_user_can('NextGEN Change options') )
|
209 |
-
die('No access');
|
210 |
-
|
211 |
-
$action = $_POST['_action'];
|
212 |
-
$offset = (int) $_POST['offset'];
|
213 |
-
|
214 |
-
switch ($action) {
|
215 |
-
case 'images':
|
216 |
-
$images = $wpdb->get_results("SELECT * FROM $wpdb->nggpictures ORDER BY pid ASC LIMIT $offset, 50", OBJECT_K);
|
217 |
-
if ( is_array($images) ) {
|
218 |
-
foreach ($images as $image) {
|
219 |
-
//slug must be unique, we use the alttext for that
|
220 |
-
$image->slug = nggdb::get_unique_slug( sanitize_title( $image->alttext ), 'image', $image->pid );
|
221 |
-
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->nggpictures SET image_slug= '%s' WHERE pid = '%d'" , $image->slug, $image->pid ) );
|
222 |
-
}
|
223 |
-
}
|
224 |
-
break;
|
225 |
-
case 'gallery':
|
226 |
-
$galleries = $wpdb->get_results("SELECT * FROM $wpdb->nggallery ORDER BY gid ASC LIMIT $offset, 50", OBJECT_K);
|
227 |
-
if ( is_array($galleries) ) {
|
228 |
-
foreach ($galleries as $gallery) {
|
229 |
-
//slug must be unique, we use the title for that
|
230 |
-
$gallery->slug = nggdb::get_unique_slug( sanitize_title( $gallery->title ), 'gallery', $gallery->gid );
|
231 |
-
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->nggallery SET slug= '%s' WHERE gid = '%d'" , $gallery->slug, $gallery->gid ) );
|
232 |
-
}
|
233 |
-
}
|
234 |
-
break;
|
235 |
-
case 'album':
|
236 |
-
$albumlist = $wpdb->get_results("SELECT * FROM $wpdb->nggalbum ORDER BY id ASC LIMIT $offset, 50", OBJECT_K);
|
237 |
-
if ( is_array($albumlist) ) {
|
238 |
-
foreach ($albumlist as $album) {
|
239 |
-
//slug must be unique, we use the name for that
|
240 |
-
$album->slug = nggdb::get_unique_slug( sanitize_title( $album->name ), 'album', $album->id );
|
241 |
-
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->nggalbum SET slug= '%s' WHERE id = '%d'" , $album->slug, $album->id ) );
|
242 |
-
}
|
243 |
-
}
|
244 |
-
break;
|
245 |
-
}
|
246 |
-
|
247 |
-
die(1);
|
248 |
-
}
|
249 |
-
add_action('wp_ajax_ngg_image_check', 'ngg_ajax_image_check');
|
250 |
-
/**
|
251 |
-
* Test for various image resolution
|
252 |
-
*
|
253 |
-
* @since 1.7.3
|
254 |
-
* @return result
|
255 |
-
*/
|
256 |
-
function ngg_ajax_image_check() {
|
257 |
-
|
258 |
-
// check for correct NextGEN capability
|
259 |
-
if ( !current_user_can('NextGEN Upload images') )
|
260 |
-
die('No access');
|
261 |
-
|
262 |
-
if ( !defined('ABSPATH') )
|
263 |
-
die('No access');
|
264 |
-
|
265 |
-
$step = (int) $_POST['step'];
|
266 |
-
|
267 |
-
// build the test sizes
|
268 |
-
$sizes = array();
|
269 |
-
$sizes[1] = array ( 'width' => 800, 'height' => 600);
|
270 |
-
$sizes[2] = array ( 'width' => 1024, 'height' => 768);
|
271 |
-
$sizes[3] = array ( 'width' => 1280, 'height' => 960); // 1MP
|
272 |
-
$sizes[4] = array ( 'width' => 1600, 'height' => 1200); // 2MP
|
273 |
-
$sizes[5] = array ( 'width' => 2016, 'height' => 1512); // 3MP
|
274 |
-
$sizes[6] = array ( 'width' => 2272, 'height' => 1704); // 4MP
|
275 |
-
$sizes[7] = array ( 'width' => 2560, 'height' => 1920); // 5MP
|
276 |
-
$sizes[8] = array ( 'width' => 2848, 'height' => 2136); // 6MP
|
277 |
-
$sizes[9] = array ( 'width' => 3072, 'height' => 2304); // 7MP
|
278 |
-
$sizes[10] = array ( 'width' => 3264, 'height' => 2448); // 8MP
|
279 |
-
$sizes[11] = array ( 'width' => 4048, 'height' => 3040); // 12MP
|
280 |
-
|
281 |
-
if ( $step < 1 || $step > 11 )
|
282 |
-
die('No vaild value');
|
283 |
-
|
284 |
-
// let's test each image size
|
285 |
-
$temp = imagecreatetruecolor ($sizes[$step]['width'], $sizes[$step]['height'] );
|
286 |
-
imagedestroy ($temp);
|
287 |
-
|
288 |
-
$result = array ('stat' => 'ok', 'message' => sprintf(__('Could create image with %s x %s pixel', 'nggallery'), $sizes[$step]['width'], $sizes[$step]['height'] ) );
|
289 |
-
|
290 |
-
header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
|
291 |
-
echo json_encode($result);
|
292 |
|
293 |
die();
|
294 |
}
|
295 |
-
|
296 |
-
add_action('wp_ajax_ngg_test_head_footer', 'ngg_ajax_test_head_footer');
|
297 |
-
/**
|
298 |
-
* Check for the header / footer, parts taken from Matt Martz (http://sivel.net/)
|
299 |
-
*
|
300 |
-
* @see https://gist.github.com/378450
|
301 |
-
* @since 1.7.3
|
302 |
-
* @return result
|
303 |
-
*/
|
304 |
-
function ngg_ajax_test_head_footer() {
|
305 |
-
|
306 |
-
// Build the url to call, NOTE: uses home_url and thus requires WordPress 3.0
|
307 |
-
$url = add_query_arg( array( 'test-head' => '', 'test-footer' => '' ), home_url() );
|
308 |
-
// Perform the HTTP GET ignoring SSL errors
|
309 |
-
$response = wp_remote_get( $url, array( 'sslverify' => false ) );
|
310 |
-
// Grab the response code and make sure the request was sucessful
|
311 |
-
$code = (int) wp_remote_retrieve_response_code( $response );
|
312 |
-
if ( $code == 200 ) {
|
313 |
-
global $head_footer_errors;
|
314 |
-
$head_footer_errors = array();
|
315 |
-
|
316 |
-
// Strip all tabs, line feeds, carriage returns and spaces
|
317 |
-
$html = preg_replace( '/[\t\r\n\s]/', '', wp_remote_retrieve_body( $response ) );
|
318 |
-
|
319 |
-
// Check to see if we found the existence of wp_head
|
320 |
-
if ( ! strstr( $html, '<!--wp_head-->' ) )
|
321 |
-
die('Missing the call to wp_head() in your theme, contact the theme author');
|
322 |
-
// Check to see if we found the existence of wp_footer
|
323 |
-
if ( ! strstr( $html, '<!--wp_footer-->' ) )
|
324 |
-
die('Missing the call to wp_footer() in your theme, contact the theme author');
|
325 |
-
}
|
326 |
-
die('success');
|
327 |
-
}
|
11 |
*/
|
12 |
function ngg_ajax_operation() {
|
13 |
|
|
|
|
|
14 |
// if nonce is not correct it returns -1
|
15 |
check_ajax_referer( "ngg-ajax" );
|
16 |
|
75 |
|
76 |
function createNewThumb() {
|
77 |
|
|
|
|
|
78 |
// check for correct capability
|
79 |
if ( !is_user_logged_in() )
|
80 |
die('-1');
|
83 |
if ( !current_user_can('NextGEN Manage gallery') )
|
84 |
die('-1');
|
85 |
|
86 |
+
$id = (int) $_POST['id'];
|
|
|
87 |
|
88 |
$x = round( $_POST['x'] * $_POST['rr'], 0);
|
89 |
$y = round( $_POST['y'] * $_POST['rr'], 0);
|
91 |
$h = round( $_POST['h'] * $_POST['rr'], 0);
|
92 |
$crop_frame = array('x' => $x, 'y' => $y, 'width' => $w, 'height' => $h);
|
93 |
|
94 |
+
$storage = C_Gallery_Storage::get_instance();
|
|
|
95 |
|
96 |
// XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility
|
97 |
$params = array('watermark' => false, 'reflection' => false, 'crop' => true, 'crop_frame' => $crop_frame);
|
124 |
// include the ngg function
|
125 |
include_once (dirname (__FILE__). '/functions.php');
|
126 |
|
|
|
|
|
127 |
$id = (int) $_POST['id'];
|
128 |
$result = '-1';
|
129 |
|
152 |
|
153 |
header('HTTP/1.1 500 Internal Server Error');
|
154 |
die( $result );
|
|
|
155 |
}
|
156 |
|
157 |
add_action('wp_ajax_ngg_dashboard', 'ngg_ajax_dashboard');
|
169 |
|
170 |
switch ( $_GET['jax'] ) {
|
171 |
|
|
|
|
|
|
|
|
|
172 |
case 'dashboard_primary' :
|
173 |
ngg_overview_news();
|
174 |
break;
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
|
177 |
die();
|
178 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php
CHANGED
@@ -187,6 +187,14 @@ jQuery(function (){
|
|
187 |
//prevent the browser to follow the link
|
188 |
return false;
|
189 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
});
|
191 |
|
192 |
function checkAll(form)
|
187 |
//prevent the browser to follow the link
|
188 |
return false;
|
189 |
});
|
190 |
+
|
191 |
+
// If too many of these are generated the cookie becomes so large servers will reject HTTP requests
|
192 |
+
// Wait some time for other listeners to catch this event and then purge it from the browser
|
193 |
+
Frame_Event_Publisher.listen_for('attach_to_post:thumbnail_modified', function(data) {
|
194 |
+
setTimeout(function() {
|
195 |
+
Frame_Event_Publisher.delete_cookie("X-Frame-Events_" + data.id);
|
196 |
+
}, 400);
|
197 |
+
});
|
198 |
});
|
199 |
|
200 |
function checkAll(form)
|
products/photocrati_nextgen/modules/ngglegacy/admin/overview.php
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
3 |
|
4 |
/**
|
5 |
* nggallery_admin_overview()
|
@@ -7,12 +8,12 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
|
|
7 |
* Add the admin overview the dashboard style
|
8 |
* @return mixed content
|
9 |
*/
|
10 |
-
function nggallery_admin_overview()
|
|
|
11 |
?>
|
12 |
<div class="wrap ngg-wrap">
|
13 |
-
<?php screen_icon(
|
14 |
-
<h2><?php _e('NextGEN Gallery Overview', 'nggallery') ?></h2>
|
15 |
-
<?php if (version_compare(PHP_VERSION, '5.0.0', '<')) ngg_check_for_PHP5(); ?>
|
16 |
<div id="dashboard-widgets-container" class="ngg-overview">
|
17 |
<div id="dashboard-widgets" class="metabox-holder">
|
18 |
<div id="post-body">
|
@@ -29,471 +30,326 @@ function nggallery_admin_overview() {
|
|
29 |
</div>
|
30 |
</div>
|
31 |
<script type="text/javascript">
|
32 |
-
|
33 |
-
var ajaxWidgets, ajaxPopulateWidgets;
|
34 |
-
|
35 |
-
jQuery(document).ready( function($) {
|
36 |
-
// These widgets are sometimes populated via ajax
|
37 |
-
ajaxWidgets = [
|
38 |
-
'dashboard_primary',
|
39 |
-
'dashboard_plugins'
|
40 |
-
];
|
41 |
-
|
42 |
-
ajaxPopulateWidgets = function(el) {
|
43 |
-
show = function(id, i) {
|
44 |
-
var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading');
|
45 |
-
if ( e.length ) {
|
46 |
-
p = e.parent();
|
47 |
-
setTimeout( function(){
|
48 |
-
p.load('admin-ajax.php?action=ngg_dashboard&jax=' + id, '', function() {
|
49 |
-
p.hide().slideDown('normal', function(){
|
50 |
-
$(this).css('display', '');
|
51 |
-
if ( 'dashboard_plugins' == id && $.isFunction(tb_init) )
|
52 |
-
tb_init('#dashboard_plugins a.thickbox');
|
53 |
-
});
|
54 |
-
});
|
55 |
-
}, i * 500 );
|
56 |
-
}
|
57 |
-
};
|
58 |
-
if ( el ) {
|
59 |
-
el = el.toString();
|
60 |
-
if ( $.inArray(el, ajaxWidgets) != -1 )
|
61 |
-
show(el, 0);
|
62 |
-
} else {
|
63 |
-
$.each( ajaxWidgets, function(i) {
|
64 |
-
show(this, i);
|
65 |
-
});
|
66 |
-
}
|
67 |
-
};
|
68 |
-
ajaxPopulateWidgets();
|
69 |
-
} );
|
70 |
-
|
71 |
-
jQuery(document).ready( function($) {
|
72 |
-
// postboxes setup
|
73 |
postboxes.add_postbox_toggles('ngg-overview');
|
74 |
});
|
75 |
-
//]]>
|
76 |
</script>
|
77 |
<?php
|
78 |
}
|
79 |
|
80 |
-
|
81 |
-
* Load the meta boxes
|
82 |
-
*
|
83 |
-
*/
|
84 |
-
add_meta_box('dashboard_right_now', __('Welcome to NextGEN Gallery !', 'nggallery'), 'ngg_overview_right_now', 'ngg_overview', 'left', 'core');
|
85 |
-
add_meta_box('ngg_meta_box', __('Do you like this Plugin?', 'nggallery'), 'ngg_likeThisMetaBox', 'ngg_overview', 'right', 'core');
|
86 |
-
//add_meta_box('dashboard_primary', __('Latest News', 'nggallery'), 'ngg_widget_overview_news', 'ngg_overview', 'left', 'core');
|
87 |
-
add_meta_box('ngg_about_meta_box', __('About', 'nggallery'), 'ngg_AboutMetaBox', 'ngg_overview', 'left', 'core');
|
88 |
-
//add_meta_box('ngg_lastdonators', __('Recent donators', 'nggallery'), 'ngg_widget_overview_donators', 'ngg_overview', 'right', 'core');
|
89 |
-
if ( !is_multisite() || is_super_admin() ) {
|
90 |
-
add_meta_box('ngg_server', __('Server Settings', 'nggallery'), 'ngg_overview_server', 'ngg_overview', 'right', 'core');
|
91 |
-
}
|
92 |
-
|
93 |
-
function ngg_AboutMetaBox()
|
94 |
{
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
<div class="social" style="text-align:center;margin:15px 0 10px 0;"><span class="social" style="margin-right:5px;"><a target="_blank" href="http://twitter.com/NextGENGallery"><img title="Follow NextGEN on Twitter" alt="Twitter" src="' . NGGALLERY_URLPATH . 'admin/images/twitter.png"></a></span><span class="social" style="margin-right:5px;"><a target="_blank" href="http://www.facebook.com/NextGENGallery"><img title="Like NextGEN on Facebook" alt="Facebook" src="' . NGGALLERY_URLPATH . 'admin/images/facebook.png"></a></span><span class="social"><a target="_blank" href="http://plus.google.com/101643895780935290171"><img title="Add NextGEN to your circles" alt="GooglePlus" src="' . NGGALLERY_URLPATH . 'admin/images/googleplus.png"></a></span></div>';
|
134 |
-
}
|
135 |
|
136 |
-
/**
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
function
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
</div>
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
* @return void
|
163 |
-
*/
|
164 |
-
function ngg_widget_overview_donators() {
|
165 |
-
echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
|
166 |
-
}
|
167 |
-
|
168 |
-
function ngg_overview_donators() {
|
169 |
-
global $ngg;
|
170 |
-
|
171 |
-
$i = 0;
|
172 |
-
$list = '';
|
173 |
-
|
174 |
-
$supporter = nggAdminPanel::get_remote_array($ngg->donators);
|
175 |
-
|
176 |
-
// Ensure that this is a array
|
177 |
-
if ( !is_array($supporter) )
|
178 |
-
return _e('Thanks to all donators...', 'nggallery');
|
179 |
-
|
180 |
-
$supporter = array_reverse($supporter);
|
181 |
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
190 |
}
|
191 |
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
</div>
|
203 |
</div>
|
204 |
-
</div>
|
205 |
-
<?php
|
206 |
-
}
|
207 |
-
|
208 |
-
/**
|
209 |
-
* Show the latest NextGEN Gallery news
|
210 |
-
*
|
211 |
-
* @return void
|
212 |
-
*/
|
213 |
-
function ngg_widget_overview_news() {
|
214 |
-
echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
|
215 |
-
}
|
216 |
-
function ngg_overview_news(){
|
217 |
-
|
218 |
-
?>
|
219 |
-
<div class="rss-widget">
|
220 |
<?php
|
221 |
-
|
222 |
-
|
223 |
-
if ( is_object($rss) ) {
|
224 |
-
|
225 |
-
if ( is_wp_error($rss) ) {
|
226 |
-
echo '<p>' . sprintf(__('Newsfeed could not be loaded. Check the <a href="%s">front page</a> to check for updates.', 'nggallery'), 'http://www.nextgen-gallery.com/') . '</p>';
|
227 |
-
return;
|
228 |
-
}
|
229 |
-
|
230 |
-
echo '<ul>';
|
231 |
-
foreach ( $rss->get_items(0, 3) as $item ) {
|
232 |
-
$link = $item->get_link();
|
233 |
-
while ( stristr($link, 'http') != $link )
|
234 |
-
$link = substr($link, 1);
|
235 |
-
$link = nextgen_esc_url(strip_tags($link));
|
236 |
-
$title = esc_attr(strip_tags($item->get_title()));
|
237 |
-
if ( empty($title) )
|
238 |
-
$title = __('Untitled');
|
239 |
-
|
240 |
-
$desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
|
241 |
-
$desc = wp_html_excerpt( $desc, 360 );
|
242 |
-
|
243 |
-
// Append ellipsis. Change existing [...] to […].
|
244 |
-
if ( '[...]' == substr( $desc, -5 ) )
|
245 |
-
$desc = substr( $desc, 0, -5 ) . '[…]';
|
246 |
-
elseif ( '[…]' != substr( $desc, -10 ) )
|
247 |
-
$desc .= ' […]';
|
248 |
-
|
249 |
-
$desc = esc_html( $desc );
|
250 |
-
|
251 |
-
$date = $item->get_date();
|
252 |
-
$diff = '';
|
253 |
-
|
254 |
-
if ( $date ) {
|
255 |
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
|
258 |
-
if ( $date_stamp = strtotime( $date ) )
|
259 |
-
$date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date_stamp ) . '</span>';
|
260 |
-
else
|
261 |
-
$date = '';
|
262 |
-
}
|
263 |
-
?>
|
264 |
-
<li><a class="rsswidget" title="" target="_blank" href='<?php echo $link; ?>'><?php echo $title; ?></a>
|
265 |
-
<span class="rss-date"><?php echo $date; ?></span>
|
266 |
-
<div class="rssSummary"><strong><?php echo $diff; ?></strong> - <?php echo $desc; ?></div></li>
|
267 |
-
<?php
|
268 |
-
}
|
269 |
-
echo '</ul>';
|
270 |
-
}
|
271 |
?>
|
272 |
-
|
273 |
-
|
274 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
|
276 |
-
/**
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
function
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
margin-left: 10px;
|
294 |
-
}
|
295 |
-
#ngg_overview_right_now td {
|
296 |
-
padding: 4px;
|
297 |
-
}
|
298 |
-
#ngg_overview_right_now td:first-child {
|
299 |
-
font-size: 16px;
|
300 |
}
|
301 |
-
|
302 |
-
|
303 |
-
<p><?php _e('At a Glance', 'nggallery'); ?></p>
|
304 |
-
<table>
|
305 |
-
<tbody>
|
306 |
-
<tr class="first">
|
307 |
-
<td class="first b"><a href="admin.php?page=ngg_addgallery"><?php echo $images; ?></a></td>
|
308 |
-
<td class="t"><a href="admin.php?page=ngg_addgallery"><?php echo _n( 'Image', 'Images', $images, 'nggallery' ); ?></a></td>
|
309 |
-
<td class="b"></td>
|
310 |
-
<td class="last"></td>
|
311 |
-
</tr>
|
312 |
-
<tr>
|
313 |
-
<td class="first b"><a href="admin.php?page=nggallery-manage-gallery"><?php echo $galleries; ?></a></td>
|
314 |
-
<td class="t"><a href="admin.php?page=nggallery-manage-gallery"><?php echo _n( 'Gallery', 'Galleries', $galleries, 'nggallery' ); ?></a></td>
|
315 |
-
<td class="b"></td>
|
316 |
-
<td class="last"></td>
|
317 |
-
</tr>
|
318 |
-
<tr>
|
319 |
-
<td class="first b"><a href="admin.php?page=nggallery-manage-album"><?php echo $albums; ?></a></td>
|
320 |
-
<td class="t"><a href="admin.php?page=nggallery-manage-album"><?php echo _n( 'Album', 'Albums', $albums, 'nggallery' ); ?></a></td>
|
321 |
-
<td class="b"></td>
|
322 |
-
<td class="last"></td>
|
323 |
-
</tr>
|
324 |
-
</tbody>
|
325 |
-
</table>
|
326 |
-
</div>
|
327 |
-
<div class="versions" style="padding-top:14px">
|
328 |
-
<br class="clear" />
|
329 |
-
</div>
|
330 |
-
<?php
|
331 |
-
if ( is_multisite() )
|
332 |
-
ngg_dashboard_quota();
|
333 |
-
}
|
334 |
-
|
335 |
-
// Display File upload quota on dashboard
|
336 |
-
function ngg_dashboard_quota() {
|
337 |
-
|
338 |
-
if ( get_site_option( 'upload_space_check_disabled' ) )
|
339 |
-
return;
|
340 |
-
|
341 |
-
if ( !wpmu_enable_function('wpmuQuotaCheck') )
|
342 |
-
return;
|
343 |
-
|
344 |
-
$settings = C_NextGen_Settings::get_instance();
|
345 |
-
$fs = C_Fs::get_instance();
|
346 |
-
$dir = $fs->join_paths($fs->get_document_root('content'), $settings->gallerypath);
|
347 |
-
|
348 |
-
$quota = get_space_allowed();
|
349 |
-
$used = get_dirsize( $dir ) / 1024 / 1024;
|
350 |
-
|
351 |
-
if ( $used > $quota )
|
352 |
-
$percentused = '100';
|
353 |
-
else
|
354 |
-
$percentused = ( $used / $quota ) * 100;
|
355 |
-
$used_color = ( $percentused < 70 ) ? ( ( $percentused >= 40 ) ? 'waiting' : 'approved' ) : 'spam';
|
356 |
-
$used = round( $used, 2 );
|
357 |
-
$percentused = number_format( $percentused );
|
358 |
-
|
359 |
-
?>
|
360 |
-
<p class="sub musub" style="position:static" ><?php _e( 'Storage Space' ); ?></p>
|
361 |
-
<div class="table table_content musubtable">
|
362 |
-
<table>
|
363 |
-
<tr class="first">
|
364 |
-
<td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), nextgen_esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $quota ); ?></td>
|
365 |
-
<td class="t posts"><?php _e( 'Space Allowed' ); ?></td>
|
366 |
-
</tr>
|
367 |
-
</table>
|
368 |
-
</div>
|
369 |
-
<div class="table table_discussion musubtable">
|
370 |
-
<table>
|
371 |
-
<tr class="first">
|
372 |
-
<td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), nextgen_esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $used, $percentused ); ?></td>
|
373 |
-
<td class="last t comments <?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>
|
374 |
-
</tr>
|
375 |
-
</table>
|
376 |
-
</div>
|
377 |
-
<br class="clear" />
|
378 |
-
<?php
|
379 |
-
}
|
380 |
-
|
381 |
-
/**
|
382 |
-
* Show GD Library version information
|
383 |
-
*
|
384 |
-
* @return void
|
385 |
-
*/
|
386 |
-
function ngg_gd_info() {
|
387 |
-
|
388 |
-
if(function_exists("gd_info")){
|
389 |
-
$info = gd_info();
|
390 |
-
$keys = array_keys($info);
|
391 |
-
for($i=0; $i<count($keys); $i++) {
|
392 |
-
if(is_bool($info[$keys[$i]]))
|
393 |
-
echo "<li> " . $keys[$i] ." : <span>" . ngg_gd_yesNo($info[$keys[$i]]) . "</span></li>\n";
|
394 |
-
else
|
395 |
-
echo "<li> " . $keys[$i] ." : <span>" . $info[$keys[$i]] . "</span></li>\n";
|
396 |
}
|
397 |
}
|
398 |
-
else {
|
399 |
-
echo '<h4>'.__('No GD support', 'nggallery').'!</h4>';
|
400 |
-
}
|
401 |
-
}
|
402 |
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
*/
|
409 |
-
function ngg_gd_yesNo( $bool ){
|
410 |
-
if($bool)
|
411 |
-
return __('Yes', 'nggallery');
|
412 |
-
else
|
413 |
-
return __('No', 'nggallery');
|
414 |
-
}
|
415 |
|
|
|
|
|
416 |
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
*
|
421 |
-
* @return void
|
422 |
-
*/
|
423 |
-
function ngg_get_serverinfo() {
|
424 |
|
425 |
-
|
426 |
-
|
427 |
-
$sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
|
428 |
-
// GET SQL Mode
|
429 |
-
$mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
|
430 |
-
if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
|
431 |
-
if (empty($sql_mode)) $sql_mode = __('Not set', 'nggallery');
|
432 |
-
// Get PHP Safe Mode
|
433 |
-
if(ini_get('safe_mode')) $safe_mode = __('On', 'nggallery');
|
434 |
-
else $safe_mode = __('Off', 'nggallery');
|
435 |
-
// Get PHP allow_url_fopen
|
436 |
-
if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'nggallery');
|
437 |
-
else $allow_url_fopen = __('Off', 'nggallery');
|
438 |
-
// Get PHP Max Upload Size
|
439 |
-
if (function_exists('wp_max_upload_size')) $upload_max = strval(round( (int) wp_max_upload_size() / (1024 * 1024) )) . 'M';
|
440 |
-
else if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
|
441 |
-
else $upload_max = __('N/A', 'nggallery');
|
442 |
-
// Get PHP Output buffer Size
|
443 |
-
if(ini_get('pcre.backtrack_limit')) $backtrack_limit = ini_get('pcre.backtrack_limit');
|
444 |
-
else $backtrack_limit = __('N/A', 'nggallery');
|
445 |
-
// Get PHP Max Post Size
|
446 |
-
if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
|
447 |
-
else $post_max = __('N/A', 'nggallery');
|
448 |
-
// Get PHP Max execution time
|
449 |
-
if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
|
450 |
-
else $max_execute = __('N/A', 'nggallery');
|
451 |
-
// Get PHP Memory Limit
|
452 |
-
if(ini_get('memory_limit')) $memory_limit = $ngg->memory_limit;
|
453 |
-
else $memory_limit = __('N/A', 'nggallery');
|
454 |
-
// Get actual memory_get_usage
|
455 |
-
if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'nggallery');
|
456 |
-
else $memory_usage = __('N/A', 'nggallery');
|
457 |
-
// required for EXIF read
|
458 |
-
if (is_callable('exif_read_data')) $exif = __('Yes', 'nggallery'). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
|
459 |
-
else $exif = __('No', 'nggallery');
|
460 |
-
// required for meta data
|
461 |
-
if (is_callable('iptcparse')) $iptc = __('Yes', 'nggallery');
|
462 |
-
else $iptc = __('No', 'nggallery');
|
463 |
-
// required for meta data
|
464 |
-
if (is_callable('xml_parser_create')) $xml = __('Yes', 'nggallery');
|
465 |
-
else $xml = __('No', 'nggallery');
|
466 |
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
<li><?php _e('PHP Safe Mode', 'nggallery'); ?> : <span><?php echo $safe_mode; ?></span></li>
|
475 |
-
<li><?php _e('PHP Allow URL fopen', 'nggallery'); ?> : <span><?php echo $allow_url_fopen; ?></span></li>
|
476 |
-
<li><?php _e('PHP Memory Limit', 'nggallery'); ?> : <span><?php echo $memory_limit; ?></span></li>
|
477 |
-
<li><?php _e('PHP Max Upload Size', 'nggallery'); ?> : <span><?php echo $upload_max; ?></span></li>
|
478 |
-
<li><?php _e('PHP Max Post Size', 'nggallery'); ?> : <span><?php echo $post_max; ?></span></li>
|
479 |
-
<li><?php _e('PCRE Backtracking Limit', 'nggallery'); ?> : <span><?php echo $backtrack_limit; ?></span></li>
|
480 |
-
<li><?php _e('PHP Max Script Execute Time', 'nggallery'); ?> : <span><?php echo $max_execute; ?>s</span></li>
|
481 |
-
<li><?php _e('PHP Exif support', 'nggallery'); ?> : <span><?php echo $exif; ?></span></li>
|
482 |
-
<li><?php _e('PHP IPTC support', 'nggallery'); ?> : <span><?php echo $iptc; ?></span></li>
|
483 |
-
<li><?php _e('PHP XML support', 'nggallery'); ?> : <span><?php echo $xml; ?></span></li>
|
484 |
-
<?php
|
485 |
-
}
|
486 |
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
498 |
}
|
499 |
|
|
1 |
<?php
|
2 |
+
|
3 |
+
if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
|
4 |
|
5 |
/**
|
6 |
* nggallery_admin_overview()
|
8 |
* Add the admin overview the dashboard style
|
9 |
* @return mixed content
|
10 |
*/
|
11 |
+
function nggallery_admin_overview()
|
12 |
+
{
|
13 |
?>
|
14 |
<div class="wrap ngg-wrap">
|
15 |
+
<?php screen_icon('nextgen-gallery'); ?>
|
16 |
+
<h2><?php _e('NextGEN Gallery Overview', 'nggallery'); ?></h2>
|
|
|
17 |
<div id="dashboard-widgets-container" class="ngg-overview">
|
18 |
<div id="dashboard-widgets" class="metabox-holder">
|
19 |
<div id="post-body">
|
30 |
</div>
|
31 |
</div>
|
32 |
<script type="text/javascript">
|
33 |
+
jQuery(document).ready(function($) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
postboxes.add_postbox_toggles('ngg-overview');
|
35 |
});
|
|
|
36 |
</script>
|
37 |
<?php
|
38 |
}
|
39 |
|
40 |
+
class C_NGG_Admin_Overview
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
{
|
42 |
+
public function __construct()
|
43 |
+
{
|
44 |
+
/**
|
45 |
+
* Load the meta boxes
|
46 |
+
*
|
47 |
+
*/
|
48 |
+
add_meta_box(
|
49 |
+
'dashboard_right_now',
|
50 |
+
__('Welcome to NextGEN Gallery !', 'nggallery'),
|
51 |
+
array($this, 'overview_metabox'),
|
52 |
+
'ngg_overview',
|
53 |
+
'left',
|
54 |
+
'core'
|
55 |
+
);
|
56 |
+
|
57 |
+
add_meta_box(
|
58 |
+
'ngg_meta_box',
|
59 |
+
__('Do you like this Plugin?', 'nggallery'),
|
60 |
+
array($this, 'sharing_metabox'),
|
61 |
+
'ngg_overview',
|
62 |
+
'right',
|
63 |
+
'core'
|
64 |
+
);
|
65 |
+
|
66 |
+
add_meta_box(
|
67 |
+
'ngg_about_meta_box',
|
68 |
+
__('About', 'nggallery'),
|
69 |
+
array($this, 'about_metabox'),
|
70 |
+
'ngg_overview',
|
71 |
+
'left',
|
72 |
+
'core'
|
73 |
+
);
|
74 |
+
|
75 |
+
if (!is_multisite() || is_super_admin())
|
76 |
+
{
|
77 |
+
add_meta_box(
|
78 |
+
'ngg_server',
|
79 |
+
__('Server Settings', 'nggallery'),
|
80 |
+
array($this, 'server_metabox'),
|
81 |
+
'ngg_overview',
|
82 |
+
'right',
|
83 |
+
'core'
|
84 |
+
);
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
public function sharing_metabox()
|
89 |
+
{
|
90 |
+
echo '<p>';
|
91 |
+
echo sprintf(__('This plugin is primarily developed, maintained, supported and documented by <a href="%s" target="_blank">Photocrati Media</a> with a lot of love & effort. Any kind of contribution would be highly appreciated. Thanks!', 'nggallery'), 'http://www.photocrati.com/');
|
92 |
+
echo '</p><ul>';
|
93 |
+
|
94 |
+
$url = 'http://wordpress.org/plugins/nextgen-gallery/' ;
|
95 |
+
echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-rating.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
|
96 |
+
_e('Please click "Works" on WordPress.org', 'nggallery');
|
97 |
+
echo "</a></li>";
|
98 |
+
|
99 |
+
$url = 'http://wordpress.org/plugins/nextgen-gallery/' ;
|
100 |
+
echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-rating.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
|
101 |
+
_e('Give it a good rating on WordPress.org', 'nggallery');
|
102 |
+
echo "</a></li>";
|
103 |
+
|
104 |
+
$url = 'http://www.nextgen-gallery.com';
|
105 |
+
echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/nextgen.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
|
106 |
+
_e("Visit the plugin homepage", 'nggallery');
|
107 |
+
echo "</a></li>";
|
108 |
+
|
109 |
+
$url = 'http://www.nextgen-gallery.com/languages/';
|
110 |
+
echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-translate.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>";
|
111 |
+
_e("Help translating it", 'nggallery');
|
112 |
+
echo "</a></li>";
|
113 |
+
|
114 |
+
echo '</ul>';
|
115 |
+
|
116 |
+
echo '
|
117 |
<div class="social" style="text-align:center;margin:15px 0 10px 0;"><span class="social" style="margin-right:5px;"><a target="_blank" href="http://twitter.com/NextGENGallery"><img title="Follow NextGEN on Twitter" alt="Twitter" src="' . NGGALLERY_URLPATH . 'admin/images/twitter.png"></a></span><span class="social" style="margin-right:5px;"><a target="_blank" href="http://www.facebook.com/NextGENGallery"><img title="Like NextGEN on Facebook" alt="Facebook" src="' . NGGALLERY_URLPATH . 'admin/images/facebook.png"></a></span><span class="social"><a target="_blank" href="http://plus.google.com/101643895780935290171"><img title="Add NextGEN to your circles" alt="GooglePlus" src="' . NGGALLERY_URLPATH . 'admin/images/googleplus.png"></a></span></div>';
|
118 |
+
}
|
119 |
|
120 |
+
/**
|
121 |
+
* Show a summary of the used images
|
122 |
+
*
|
123 |
+
* @return void
|
124 |
+
*/
|
125 |
+
public function overview_metabox()
|
126 |
+
{
|
127 |
+
global $wpdb;
|
128 |
+
$images = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures") );
|
129 |
+
$galleries = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggallery") );
|
130 |
+
$albums = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggalbum") );
|
131 |
+
?>
|
132 |
+
<style type='text/css'>
|
133 |
+
#ngg_overview_right_now p {
|
134 |
+
padding: 0 0 6px 10px;
|
135 |
+
margin: 0;
|
136 |
+
}
|
137 |
+
#ngg_overview_right_now table {
|
138 |
+
margin-left: 10px;
|
139 |
+
}
|
140 |
+
#ngg_overview_right_now td {
|
141 |
+
padding: 4px;
|
142 |
+
}
|
143 |
+
#ngg_overview_right_now td:first-child {
|
144 |
+
font-size: 16px;
|
145 |
+
}
|
146 |
+
</style>
|
147 |
+
<div class="table table_content" id='ngg_overview_right_now'>
|
148 |
+
<p><?php _e('At a Glance', 'nggallery'); ?></p>
|
149 |
+
<table>
|
150 |
+
<tbody>
|
151 |
+
<tr class="first">
|
152 |
+
<td class="first b"><a href="admin.php?page=ngg_addgallery"><?php echo $images; ?></a></td>
|
153 |
+
<td class="t"><a href="admin.php?page=ngg_addgallery"><?php echo _n( 'Image', 'Images', $images, 'nggallery' ); ?></a></td>
|
154 |
+
<td class="b"></td>
|
155 |
+
<td class="last"></td>
|
156 |
+
</tr>
|
157 |
+
<tr>
|
158 |
+
<td class="first b"><a href="admin.php?page=nggallery-manage-gallery"><?php echo $galleries; ?></a></td>
|
159 |
+
<td class="t"><a href="admin.php?page=nggallery-manage-gallery"><?php echo _n( 'Gallery', 'Galleries', $galleries, 'nggallery' ); ?></a></td>
|
160 |
+
<td class="b"></td>
|
161 |
+
<td class="last"></td>
|
162 |
+
</tr>
|
163 |
+
<tr>
|
164 |
+
<td class="first b"><a href="admin.php?page=nggallery-manage-album"><?php echo $albums; ?></a></td>
|
165 |
+
<td class="t"><a href="admin.php?page=nggallery-manage-album"><?php echo _n( 'Album', 'Albums', $albums, 'nggallery' ); ?></a></td>
|
166 |
+
<td class="b"></td>
|
167 |
+
<td class="last"></td>
|
168 |
+
</tr>
|
169 |
+
</tbody>
|
170 |
+
</table>
|
171 |
</div>
|
172 |
+
<div class="versions" style="padding-top:14px">
|
173 |
+
<br class="clear" />
|
174 |
+
</div>
|
175 |
+
<?php
|
176 |
+
if (is_multisite())
|
177 |
+
$this->dashboard_quota();
|
178 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
|
180 |
+
public function about_metabox()
|
181 |
+
{
|
182 |
+
?>
|
183 |
+
<div id="poststuff">
|
184 |
+
<p><?php _e("NextGEN Gallery is one of the most popular WordPress plugins of all time with over 14 million downloads.", 'nggallery'); _e("It is developed and supported by Photocrati Media. We'd like to offer a special thanks to Alex Rabe, who first developed the plugin and maintained it through 2011.", 'nggallery'); ?></p>
|
185 |
+
<p><?php _e("<strong>NEED HELP?</strong> If you need help or assistance please visit the <a href='http://wordpress.org/support/plugin/nextgen-gallery'>NextGEN Gallery forums on WordPress.org</a>. Please note that we actively monitor and participate in the forums, but given that NextGEN Gallery is a free product, we don't guarantee replies to support queries.", 'nggallery'); ?></p>
|
186 |
+
<p><?php _e("<strong>EXTENDING NEXTGEN?</strong> There are many third party plugins that add displays and functionality for NextGEN Gallery. See our <a href='http://www.nextgen-gallery.com/nextgen-gallery-extension-plugins/'>Complete List of NextGEN Extension Plugins</a>.", 'nggallery'); ?></p>
|
187 |
+
</div>
|
188 |
+
<?php
|
189 |
}
|
190 |
|
191 |
+
/**
|
192 |
+
* Show the server settings in a dashboard widget
|
193 |
+
*
|
194 |
+
* @return void
|
195 |
+
*/
|
196 |
+
public function server_metabox()
|
197 |
+
{
|
198 |
+
?>
|
199 |
+
<div id="dashboard_server_settings" class="dashboard-widget-holder wp_dashboard_empty">
|
200 |
+
<div class="ngg-dashboard-widget">
|
201 |
+
<div class="dashboard-widget-content">
|
202 |
+
<ul class="settings">
|
203 |
+
<?php $this->server_info(); ?>
|
204 |
+
</ul>
|
205 |
+
<p><strong><?php _e('Graphic Library', 'nggallery'); ?></strong></p>
|
206 |
+
<ul class="settings">
|
207 |
+
<?php $this->gd_info(); ?>
|
208 |
+
</ul>
|
209 |
+
</div>
|
210 |
</div>
|
211 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
<?php
|
213 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
|
215 |
+
/**
|
216 |
+
* Show up some server infor's
|
217 |
+
* @author GamerZ (http://www.lesterchan.net)
|
218 |
+
*
|
219 |
+
* @return void
|
220 |
+
*/
|
221 |
+
public function server_info()
|
222 |
+
{
|
223 |
+
global $wpdb, $ngg;
|
224 |
+
// Get MYSQL Version
|
225 |
+
$sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
|
226 |
+
// GET SQL Mode
|
227 |
+
$mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
|
228 |
+
if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
|
229 |
+
if (empty($sql_mode)) $sql_mode = __('Not set', 'nggallery');
|
230 |
+
// Get PHP Safe Mode
|
231 |
+
if(ini_get('safe_mode')) $safe_mode = __('On', 'nggallery');
|
232 |
+
else $safe_mode = __('Off', 'nggallery');
|
233 |
+
// Get PHP allow_url_fopen
|
234 |
+
if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'nggallery');
|
235 |
+
else $allow_url_fopen = __('Off', 'nggallery');
|
236 |
+
// Get PHP Max Upload Size
|
237 |
+
if (function_exists('wp_max_upload_size')) $upload_max = strval(round( (int) wp_max_upload_size() / (1024 * 1024) )) . 'M';
|
238 |
+
else if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
|
239 |
+
else $upload_max = __('N/A', 'nggallery');
|
240 |
+
// Get PHP Output buffer Size
|
241 |
+
if(ini_get('pcre.backtrack_limit')) $backtrack_limit = ini_get('pcre.backtrack_limit');
|
242 |
+
else $backtrack_limit = __('N/A', 'nggallery');
|
243 |
+
// Get PHP Max Post Size
|
244 |
+
if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
|
245 |
+
else $post_max = __('N/A', 'nggallery');
|
246 |
+
// Get PHP Max execution time
|
247 |
+
if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
|
248 |
+
else $max_execute = __('N/A', 'nggallery');
|
249 |
+
// Get PHP Memory Limit
|
250 |
+
if(ini_get('memory_limit')) $memory_limit = $ngg->memory_limit;
|
251 |
+
else $memory_limit = __('N/A', 'nggallery');
|
252 |
+
// Get actual memory_get_usage
|
253 |
+
if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'nggallery');
|
254 |
+
else $memory_usage = __('N/A', 'nggallery');
|
255 |
+
// required for EXIF read
|
256 |
+
if (is_callable('exif_read_data')) $exif = __('Yes', 'nggallery'). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
|
257 |
+
else $exif = __('No', 'nggallery');
|
258 |
+
// required for meta data
|
259 |
+
if (is_callable('iptcparse')) $iptc = __('Yes', 'nggallery');
|
260 |
+
else $iptc = __('No', 'nggallery');
|
261 |
+
// required for meta data
|
262 |
+
if (is_callable('xml_parser_create')) $xml = __('Yes', 'nggallery');
|
263 |
+
else $xml = __('No', 'nggallery');
|
264 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
?>
|
266 |
+
<li><?php _e('Operating System', 'nggallery'); ?> : <span><?php echo PHP_OS; ?> (<?php echo (PHP_INT_SIZE * 8) ?> Bit)</span></li>
|
267 |
+
<li><?php _e('Server', 'nggallery'); ?> : <span><?php echo $_SERVER["SERVER_SOFTWARE"]; ?></span></li>
|
268 |
+
<li><?php _e('Memory usage', 'nggallery'); ?> : <span><?php echo $memory_usage; ?></span></li>
|
269 |
+
<li><?php _e('MYSQL Version', 'nggallery'); ?> : <span><?php echo $sqlversion; ?></span></li>
|
270 |
+
<li><?php _e('SQL Mode', 'nggallery'); ?> : <span><?php echo $sql_mode; ?></span></li>
|
271 |
+
<li><?php _e('PHP Version', 'nggallery'); ?> : <span><?php echo PHP_VERSION; ?></span></li>
|
272 |
+
<li><?php _e('PHP Safe Mode', 'nggallery'); ?> : <span><?php echo $safe_mode; ?></span></li>
|
273 |
+
<li><?php _e('PHP Allow URL fopen', 'nggallery'); ?> : <span><?php echo $allow_url_fopen; ?></span></li>
|
274 |
+
<li><?php _e('PHP Memory Limit', 'nggallery'); ?> : <span><?php echo $memory_limit; ?></span></li>
|
275 |
+
<li><?php _e('PHP Max Upload Size', 'nggallery'); ?> : <span><?php echo $upload_max; ?></span></li>
|
276 |
+
<li><?php _e('PHP Max Post Size', 'nggallery'); ?> : <span><?php echo $post_max; ?></span></li>
|
277 |
+
<li><?php _e('PCRE Backtracking Limit', 'nggallery'); ?> : <span><?php echo $backtrack_limit; ?></span></li>
|
278 |
+
<li><?php _e('PHP Max Script Execute Time', 'nggallery'); ?> : <span><?php echo $max_execute; ?>s</span></li>
|
279 |
+
<li><?php _e('PHP Exif support', 'nggallery'); ?> : <span><?php echo $exif; ?></span></li>
|
280 |
+
<li><?php _e('PHP IPTC support', 'nggallery'); ?> : <span><?php echo $iptc; ?></span></li>
|
281 |
+
<li><?php _e('PHP XML support', 'nggallery'); ?> : <span><?php echo $xml; ?></span></li>
|
282 |
+
<?php
|
283 |
+
}
|
284 |
|
285 |
+
/**
|
286 |
+
* Show GD Library version information
|
287 |
+
*
|
288 |
+
* @return void
|
289 |
+
*/
|
290 |
+
function gd_info()
|
291 |
+
{
|
292 |
+
if (function_exists("gd_info"))
|
293 |
+
{
|
294 |
+
$info = gd_info();
|
295 |
+
$keys = array_keys($info);
|
296 |
+
for($i=0; $i<count($keys); $i++) {
|
297 |
+
if(is_bool($info[$keys[$i]]))
|
298 |
+
echo "<li> " . $keys[$i] ." : <span>" . ($info[$keys[$i]] ? __('Yes', 'nggallery') : __('No', 'nggallery')) . "</span></li>\n";
|
299 |
+
else
|
300 |
+
echo "<li> " . $keys[$i] ." : <span>" . $info[$keys[$i]] . "</span></li>\n";
|
301 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
}
|
303 |
+
else {
|
304 |
+
echo '<h4>'.__('No GD support', 'nggallery').'!</h4>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
}
|
306 |
}
|
|
|
|
|
|
|
|
|
307 |
|
308 |
+
// Display File upload quota on dashboard
|
309 |
+
function dashboard_quota()
|
310 |
+
{
|
311 |
+
if ( get_site_option( 'upload_space_check_disabled' ) )
|
312 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
|
314 |
+
if ( !wpmu_enable_function('wpmuQuotaCheck') )
|
315 |
+
return;
|
316 |
|
317 |
+
$settings = C_NextGen_Settings::get_instance();
|
318 |
+
$fs = C_Fs::get_instance();
|
319 |
+
$dir = $fs->join_paths($fs->get_document_root('content'), $settings->gallerypath);
|
|
|
|
|
|
|
|
|
320 |
|
321 |
+
$quota = get_space_allowed();
|
322 |
+
$used = get_dirsize( $dir ) / 1024 / 1024;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
|
324 |
+
if ( $used > $quota )
|
325 |
+
$percentused = '100';
|
326 |
+
else
|
327 |
+
$percentused = ( $used / $quota ) * 100;
|
328 |
+
$used_color = ( $percentused < 70 ) ? ( ( $percentused >= 40 ) ? 'waiting' : 'approved' ) : 'spam';
|
329 |
+
$used = round( $used, 2 );
|
330 |
+
$percentused = number_format( $percentused );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
+
?>
|
333 |
+
<p class="sub musub" style="position:static" ><?php _e( 'Storage Space' ); ?></p>
|
334 |
+
<div class="table table_content musubtable">
|
335 |
+
<table>
|
336 |
+
<tr class="first">
|
337 |
+
<td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), nextgen_esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $quota ); ?></td>
|
338 |
+
<td class="t posts"><?php _e( 'Space Allowed' ); ?></td>
|
339 |
+
</tr>
|
340 |
+
</table>
|
341 |
+
</div>
|
342 |
+
<div class="table table_discussion musubtable">
|
343 |
+
<table>
|
344 |
+
<tr class="first">
|
345 |
+
<td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), nextgen_esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $used, $percentused ); ?></td>
|
346 |
+
<td class="last t comments <?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>
|
347 |
+
</tr>
|
348 |
+
</table>
|
349 |
+
</div>
|
350 |
+
<br class="clear" />
|
351 |
+
<?php
|
352 |
+
}
|
353 |
}
|
354 |
|
355 |
+
$NGG_Admin_Overview = new C_NGG_Admin_Overview();
|
products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php
CHANGED
@@ -946,7 +946,7 @@ class nggdb
|
|
946 |
$query = array();
|
947 |
$query[] = "SELECT {$field}, SUBSTR({$field}, %d) AS 'i' FROM {$table}";
|
948 |
$query[] = "WHERE ({$field} LIKE '{$slug}-%%' AND CONVERT(SUBSTR({$field}, %d), SIGNED) BETWEEN 1 AND %d) OR {$field} = %s";
|
949 |
-
$query[] = "ORDER BY i DESC LIMIT 1";
|
950 |
$query = $wpdb->prepare(implode(" ", $query), strlen("{$slug}-")+1, strlen("{$slug}-")+1, PHP_INT_MAX, $slug);
|
951 |
|
952 |
// If the above query returns a result, it means that the slug is already taken
|
946 |
$query = array();
|
947 |
$query[] = "SELECT {$field}, SUBSTR({$field}, %d) AS 'i' FROM {$table}";
|
948 |
$query[] = "WHERE ({$field} LIKE '{$slug}-%%' AND CONVERT(SUBSTR({$field}, %d), SIGNED) BETWEEN 1 AND %d) OR {$field} = %s";
|
949 |
+
$query[] = "ORDER BY CAST(i AS SIGNED INTEGER) DESC LIMIT 1";
|
950 |
$query = $wpdb->prepare(implode(" ", $query), strlen("{$slug}-")+1, strlen("{$slug}-")+1, PHP_INT_MAX, $slug);
|
951 |
|
952 |
// If the above query returns a result, it means that the slug is already taken
|
products/photocrati_nextgen/modules/router/package.module.router.php
CHANGED
@@ -286,7 +286,7 @@ class C_Router extends C_Component
|
|
286 |
public function initialize()
|
287 |
{
|
288 |
parent::initialize();
|
289 |
-
$this->_request_method = $_SERVER['REQUEST_METHOD'];
|
290 |
}
|
291 |
static function &get_instance($context = False)
|
292 |
{
|
286 |
public function initialize()
|
287 |
{
|
288 |
parent::initialize();
|
289 |
+
$this->_request_method = !empty($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null;
|
290 |
}
|
291 |
static function &get_instance($context = False)
|
292 |
{
|
readme.txt
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
=== NextGEN Gallery ===
|
2 |
-
Contributors: photocrati
|
3 |
Tags: nextgen, nextgen gallery, gallery, galleries, image, images, image gallery, photo, photos, photo gallery, picture, pictures, picture gallery, album, albums, photo albums, image album, media, media gallery, thumbnails, thumbnail gallery, thumbnail galleries, slideshow, slideshows, slideshow gallery, slideshow galleries, fancybox, lightbox, responsive, responsive gallery, responsive galleries, wordpress responsive gallery, nextcellent, wordpress gallery plugin, wordpress photo gallery plugin, wp gallery, wp gallery plugins, best gallery plugin, free photo gallery, singlepic, image captions imagebrowser, watermarks, watermarking, photography, photographer
|
4 |
Requires at least: 4.0.0
|
5 |
-
Stable tag: 2.1.
|
6 |
-
Tested up to: 4.4
|
7 |
License: GPLv2
|
8 |
|
9 |
-
The most popular WordPress gallery plugin and one of the most popular plugins of all time with over
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
= WordPress Gallery Plugin =
|
14 |
|
15 |
-
NextGEN Gallery is the most popular **WordPress gallery plugin**, and one of the most popular WordPress plugins of all time, with over
|
16 |
|
17 |
It provides a powerful engine for uploading and managing galleries of images, with the ability to batch upload, import meta data, add/delete/rearrange/sort images, edit thumbnails, group galleries into albums, and more. It also provides two front-end display styles (slideshows and thumbnail galleries), both of which come with a wide array of options for controlling size, style, timing, transitions, controls, lightbox effects, and more.
|
18 |
|
@@ -199,6 +199,19 @@ For more information, feel free to visit the official website for the NextGEN Ga
|
|
199 |
|
200 |
== Changelog ==
|
201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
= V2.1.23 - 01.05.2015 =
|
203 |
* Secured: XSS vulnerabilities in Manage Gallery pages
|
204 |
* Secured: Ability to browse and import gallery folders
|
1 |
=== NextGEN Gallery ===
|
2 |
+
Contributors: photocrati, imagely
|
3 |
Tags: nextgen, nextgen gallery, gallery, galleries, image, images, image gallery, photo, photos, photo gallery, picture, pictures, picture gallery, album, albums, photo albums, image album, media, media gallery, thumbnails, thumbnail gallery, thumbnail galleries, slideshow, slideshows, slideshow gallery, slideshow galleries, fancybox, lightbox, responsive, responsive gallery, responsive galleries, wordpress responsive gallery, nextcellent, wordpress gallery plugin, wordpress photo gallery plugin, wp gallery, wp gallery plugins, best gallery plugin, free photo gallery, singlepic, image captions imagebrowser, watermarks, watermarking, photography, photographer
|
4 |
Requires at least: 4.0.0
|
5 |
+
Stable tag: 2.1.26
|
6 |
+
Tested up to: 4.4.2
|
7 |
License: GPLv2
|
8 |
|
9 |
+
The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 14 million downloads.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
= WordPress Gallery Plugin =
|
14 |
|
15 |
+
NextGEN Gallery is the most popular **WordPress gallery plugin**, and one of the most popular WordPress plugins of all time, with over 14 million downloads.
|
16 |
|
17 |
It provides a powerful engine for uploading and managing galleries of images, with the ability to batch upload, import meta data, add/delete/rearrange/sort images, edit thumbnails, group galleries into albums, and more. It also provides two front-end display styles (slideshows and thumbnail galleries), both of which come with a wide array of options for controlling size, style, timing, transitions, controls, lightbox effects, and more.
|
18 |
|
199 |
|
200 |
== Changelog ==
|
201 |
|
202 |
+
= V2.1.26 - 03.15.2016 =
|
203 |
+
Fixed: Removed unnecessary whitespace from "Related images" template that caused issues with some themes
|
204 |
+
Fixed: Detection of parents from grand-child-albums when generating breadcrumbs
|
205 |
+
Fixed: C_Router->initialize() generating warnings with WP-CLI or the WP-CLI-Cron
|
206 |
+
Fixed: Added Roots-theme relative-url support to C_MVC_Router->get_static_url()
|
207 |
+
Fixed: nggdb::get_unique_slug() checking test-1, -2, -3,.. -9, -10, and then rolling back to -1 rather than continuing to -11, -12, etc
|
208 |
+
Fixed: Album breadcrumbs CSS compatibility with certain themes
|
209 |
+
Fixed: Made C_Gallery->validation() not use sanitize_title() on the image name attribute; this allows gallery names with UTF-8 to not generate 404
|
210 |
+
Fixed: NGG's cross-frame-communication cookies from building up (and not being culled) to the point HTTP requests were rejected by the server for having too large of a cookie header
|
211 |
+
Fixed: Updated C_Dynamic_Thumbnails_Manager->get_uri_from_params() with a minor user-submitted patch
|
212 |
+
Fixed: Updated C_CustomPost_DataMapper_Driver->_save_entity() with a minor user-submitted patch
|
213 |
+
Fixed: Cleaned up overview.php's readability and removed some now-long-unused code from legacy's ajax.php
|
214 |
+
|
215 |
= V2.1.23 - 01.05.2015 =
|
216 |
* Secured: XSS vulnerabilities in Manage Gallery pages
|
217 |
* Secured: Ability to browse and import gallery folders
|