Version Description
- 09.25.2013 =
- NEW: Restored the ability to use imagebrowser display type instead of a lightbox effect
- Changed: Displayed galleries are no longer rendered in RSS feeds
- Changed: Removed "Plugin Check" widget from overview page
- Fixed: Silence PHP warnings/errors in an output buffer for AJAX actions
- Fixed: Compatibility issue with WordPress SEO and broken site maps (and large error_logs)
- Fixed: Compatibility issue with AJAX Event Calendar (and possibly others)
- Fixed: Adjusted Photocrati Resource Manager to be third-party friendly
- Fixed: Fixed empty result set for displayed galleries selecting 'All' tags
- Fixed: URL generation for imagebrowser pagination links
- Fixed: Ensure that image meta is imported on creation
- Fixed: Ensure that transients are removed when an external object cache is used
- Fixed: Don't load pluggable.php. This will fix plugin conflicts
- Fixed: In Attach to Post interface, galleries created in one tab weren't showing in another
- Fixed: Don't output frame events cookie for XML-RPC requests
Download this release
Release Info
Developer | photocrati |
Plugin | NextGEN Gallery – WordPress Gallery Plugin |
Version | 2.0.30 |
Comparing to | |
See all releases |
Code changes from version 2.0.27 to 2.0.30
- changelog.txt +16 -0
- nggallery.php +3 -6
- non_pope/class.photocrati_cache.php +1 -1
- non_pope/class.photocrati_resource_manager.php +38 -27
- pope/lib/autoload.php +1 -1
- products/photocrati_nextgen/modules/ajax/class.ajax_controller.php +5 -7
- products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php +1 -1
- products/photocrati_nextgen/modules/frame_communication/class.frame_event_publisher.php +9 -1
- products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_mapper.php +1 -0
- products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_routes.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_urls.php +1 -0
- products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php +12 -0
- products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnails_controller.php +27 -7
- products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.css +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_controller.php +6 -1
- products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/hook.nextgen_basic_imagebrowser_alt_urls.php +42 -0
- products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php +2 -1
- products/photocrati_nextgen/modules/nextgen_basic_templates/adapter.nextgen_basic_template_form.php +9 -14
- products/photocrati_nextgen/modules/nextgen_data/class.image_mapper.php +3 -12
- products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php +21 -3
- products/photocrati_nextgen/modules/nextgen_data/class.nextgen_metadata.php +1 -1
- products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php +21 -12
- products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_renderer.php +5 -0
- products/photocrati_nextgen/modules/ngglegacy/admin/overview.php +6 -283
- products/photocrati_nextgen/modules/ngglegacy/lib/meta.php +29 -15
- products/photocrati_nextgen/modules/ngglegacy/lib/xmlrpc.php +5 -1
- products/photocrati_nextgen/product.photocrati_nextgen.php +3 -3
- readme.txt +20 -0
changelog.txt
CHANGED
@@ -1,6 +1,22 @@
|
|
1 |
NextGEN Gallery
|
2 |
by Photocrati Media
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
= V2.0.27 - 09.18.2013 =
|
5 |
* Fixed: Reduce performance impact of purging displayed gallery transients
|
6 |
|
1 |
NextGEN Gallery
|
2 |
by Photocrati Media
|
3 |
|
4 |
+
= V2.0.30 - 09.25.2013 =
|
5 |
+
* NEW: Restored the ability to use imagebrowser display type instead of a lightbox effect
|
6 |
+
* Changed: Displayed galleries are no longer rendered in RSS feeds
|
7 |
+
* Changed: Removed "Plugin Check" widget from overview page
|
8 |
+
* Fixed: Silence PHP warnings/errors in an output buffer for AJAX actions
|
9 |
+
* Fixed: Compatibility issue with WordPress SEO and broken site maps (and large error_logs)
|
10 |
+
* Fixed: Compatibility issue with AJAX Event Calendar (and possibly others)
|
11 |
+
* Fixed: Adjusted Photocrati Resource Manager to be third-party friendly
|
12 |
+
* Fixed: Fixed empty result set for displayed galleries selecting 'All' tags
|
13 |
+
* Fixed: URL generation for imagebrowser pagination links
|
14 |
+
* Fixed: Ensure that image meta is imported on creation
|
15 |
+
* Fixed: Ensure that transients are removed when an external object cache is used
|
16 |
+
* Fixed: Don't load pluggable.php. This will fix plugin conflicts
|
17 |
+
* Fixed: In Attach to Post interface, galleries created in one tab weren't showing in another
|
18 |
+
* Fixed: Don't output frame events cookie for XML-RPC requests
|
19 |
+
|
20 |
= V2.0.27 - 09.18.2013 =
|
21 |
* Fixed: Reduce performance impact of purging displayed gallery transients
|
22 |
|
nggallery.php
CHANGED
@@ -4,7 +4,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
|
|
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 million downloads.
|
7 |
-
* Version: 2.0.
|
8 |
* Author: Photocrati Media
|
9 |
* Plugin URI: http://www.nextgen-gallery.com
|
10 |
* Author URI: http://www.photocrati.com
|
@@ -33,7 +33,7 @@ class C_NextGEN_Bootstrap
|
|
33 |
var $_registry = NULL;
|
34 |
var $_settings_option_name = 'ngg_options';
|
35 |
var $_pope_loaded = FALSE;
|
36 |
-
static $debug =
|
37 |
|
38 |
static function shutdown($exception=NULL)
|
39 |
{
|
@@ -77,9 +77,6 @@ class C_NextGEN_Bootstrap
|
|
77 |
|
78 |
function _load_non_pope()
|
79 |
{
|
80 |
-
// Load WordPress pluggables for plugin compatibility
|
81 |
-
include_once(path_join(ABSPATH, 'wp-includes/pluggable.php'));
|
82 |
-
|
83 |
// Load caching component
|
84 |
include_once('non_pope/class.photocrati_cache.php');
|
85 |
C_Photocrati_Cache::get_instance();
|
@@ -332,7 +329,7 @@ class C_NextGEN_Bootstrap
|
|
332 |
define('NEXTGEN_GALLERY_MODULE_URL', path_join(NEXTGEN_GALLERY_PRODUCT_URL, 'photocrati_nextgen/modules'));
|
333 |
define('NEXTGEN_GALLERY_PLUGIN_CLASS', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'module.NEXTGEN_GALLERY_PLUGIN.php'));
|
334 |
define('NEXTGEN_GALLERY_PLUGIN_STARTED_AT', microtime());
|
335 |
-
define('NEXTGEN_GALLERY_PLUGIN_VERSION', '2.0.
|
336 |
}
|
337 |
|
338 |
|
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 million downloads.
|
7 |
+
* Version: 2.0.30
|
8 |
* Author: Photocrati Media
|
9 |
* Plugin URI: http://www.nextgen-gallery.com
|
10 |
* Author URI: http://www.photocrati.com
|
33 |
var $_registry = NULL;
|
34 |
var $_settings_option_name = 'ngg_options';
|
35 |
var $_pope_loaded = FALSE;
|
36 |
+
static $debug = WP_DEBUG;
|
37 |
|
38 |
static function shutdown($exception=NULL)
|
39 |
{
|
77 |
|
78 |
function _load_non_pope()
|
79 |
{
|
|
|
|
|
|
|
80 |
// Load caching component
|
81 |
include_once('non_pope/class.photocrati_cache.php');
|
82 |
C_Photocrati_Cache::get_instance();
|
329 |
define('NEXTGEN_GALLERY_MODULE_URL', path_join(NEXTGEN_GALLERY_PRODUCT_URL, 'photocrati_nextgen/modules'));
|
330 |
define('NEXTGEN_GALLERY_PLUGIN_CLASS', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'module.NEXTGEN_GALLERY_PLUGIN.php'));
|
331 |
define('NEXTGEN_GALLERY_PLUGIN_STARTED_AT', microtime());
|
332 |
+
define('NEXTGEN_GALLERY_PLUGIN_VERSION', '2.0.30');
|
333 |
}
|
334 |
|
335 |
|
non_pope/class.photocrati_cache.php
CHANGED
@@ -108,7 +108,7 @@ class C_Photocrati_Cache
|
|
108 |
if ($_wp_using_ext_object_cache) {
|
109 |
$keys = ($expired_only ? self::get_expired_key_list($group) : self::get_key_list($group));
|
110 |
foreach ($keys as $key) $cache->delete($key, FALSE);
|
111 |
-
$sql = $wpdb->prepare("DELETE FROM {$wpdb->
|
112 |
if ($expired_only) $sql .= " AND option_value < ".time();
|
113 |
$retval = $wpdb->query($sql);
|
114 |
}
|
108 |
if ($_wp_using_ext_object_cache) {
|
109 |
$keys = ($expired_only ? self::get_expired_key_list($group) : self::get_key_list($group));
|
110 |
foreach ($keys as $key) $cache->delete($key, FALSE);
|
111 |
+
$sql = $wpdb->prepare("DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", "%%{$cache->group}%%");
|
112 |
if ($expired_only) $sql .= " AND option_value < ".time();
|
113 |
$retval = $wpdb->query($sql);
|
114 |
}
|
non_pope/class.photocrati_resource_manager.php
CHANGED
@@ -8,8 +8,9 @@ class C_Photocrati_Resource_Manager
|
|
8 |
var $styles = '';
|
9 |
var $scripts = '';
|
10 |
var $other_output = '';
|
11 |
-
var $wrote_footer =
|
12 |
-
var $run_shutdown =
|
|
|
13 |
|
14 |
/**
|
15 |
* Start buffering all generated output. We'll then do two things with the buffer
|
@@ -18,33 +19,30 @@ class C_Photocrati_Resource_Manager
|
|
18 |
*/
|
19 |
function __construct()
|
20 |
{
|
21 |
-
//
|
22 |
-
|
23 |
|
24 |
-
|
25 |
-
if (apply_filters('run_ngg_resource_manager', TRUE)) {
|
26 |
-
add_action('init',array(&$this, 'start_buffer'), 1);
|
27 |
-
add_action('wp_print_footer_scripts', array(&$this, 'get_resources'), 1);
|
28 |
-
add_action('admin_print_footer_scripts', array(&$this, 'get_resources'), 1);
|
29 |
-
add_action('shutdown', array(&$this, 'shutdown'));
|
30 |
-
}
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
* Determines if the resource manager should perform it's routines for this request
|
35 |
-
* @param $retval
|
36 |
* @return bool
|
37 |
*/
|
38 |
-
function
|
39 |
{
|
|
|
|
|
40 |
if (is_admin()) {
|
41 |
if (isset($_REQUEST['page']) && !preg_match("#^(ngg|nextgen)#", $_REQUEST['page'])) $retval = FALSE;
|
42 |
}
|
43 |
|
44 |
if (strpos($_SERVER['REQUEST_URI'], 'wp-admin/update') !== FALSE) $retval = FALSE;
|
45 |
-
else if (isset($_GET['display_gallery_iframe']))
|
|
|
|
|
46 |
|
47 |
-
|
48 |
}
|
49 |
|
50 |
/**
|
@@ -52,8 +50,14 @@ class C_Photocrati_Resource_Manager
|
|
52 |
*/
|
53 |
function start_buffer()
|
54 |
{
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
/**
|
@@ -102,18 +106,20 @@ class C_Photocrati_Resource_Manager
|
|
102 |
*/
|
103 |
function move_resources()
|
104 |
{
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
|
115 |
-
|
116 |
-
|
|
|
117 |
}
|
118 |
}
|
119 |
|
@@ -138,6 +144,11 @@ class C_Photocrati_Resource_Manager
|
|
138 |
}
|
139 |
}
|
140 |
|
|
|
|
|
|
|
|
|
|
|
141 |
// The output_buffer() function has been called in the PHP shutdown callback
|
142 |
// This will allow us to print the scripts ourselves and manipulate the buffer
|
143 |
if ($in_shutdown === TRUE) {
|
8 |
var $styles = '';
|
9 |
var $scripts = '';
|
10 |
var $other_output = '';
|
11 |
+
var $wrote_footer = FALSE;
|
12 |
+
var $run_shutdown = FALSE;
|
13 |
+
var $valid_request = TRUE;
|
14 |
|
15 |
/**
|
16 |
* Start buffering all generated output. We'll then do two things with the buffer
|
19 |
*/
|
20 |
function __construct()
|
21 |
{
|
22 |
+
// Validate the request
|
23 |
+
$this->validate_request();
|
24 |
|
25 |
+
add_action('init',array(&$this, 'start_buffer'), 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
}
|
27 |
|
28 |
/**
|
29 |
* Determines if the resource manager should perform it's routines for this request
|
|
|
30 |
* @return bool
|
31 |
*/
|
32 |
+
function validate_request()
|
33 |
{
|
34 |
+
$retval = TRUE;
|
35 |
+
|
36 |
if (is_admin()) {
|
37 |
if (isset($_REQUEST['page']) && !preg_match("#^(ngg|nextgen)#", $_REQUEST['page'])) $retval = FALSE;
|
38 |
}
|
39 |
|
40 |
if (strpos($_SERVER['REQUEST_URI'], 'wp-admin/update') !== FALSE) $retval = FALSE;
|
41 |
+
else if (isset($_GET['display_gallery_iframe'])) $retval = FALSE;
|
42 |
+
else if (preg_match("/(js|css|xsl|xml)$/", $_SERVER['REQUEST_URI'])) $retval = FALSE;
|
43 |
+
else if (defined('WP_ADMIN') && WP_ADMIN && defined('DOING_AJAX') && DOING_AJAX) $retval = FALSE;
|
44 |
|
45 |
+
$this->valid_request = $retval;
|
46 |
}
|
47 |
|
48 |
/**
|
50 |
*/
|
51 |
function start_buffer()
|
52 |
{
|
53 |
+
if (apply_filters('run_ngg_resource_manager', $this->valid_request)) {
|
54 |
+
ob_start(array(&$this, 'output_buffer_handler'));
|
55 |
+
ob_start(array(&$this, 'get_buffer'));
|
56 |
+
|
57 |
+
add_action('wp_print_footer_scripts', array(&$this, 'get_resources'), 1);
|
58 |
+
add_action('admin_print_footer_scripts', array(&$this, 'get_resources'), 1);
|
59 |
+
add_action('shutdown', array(&$this, 'shutdown'));
|
60 |
+
}
|
61 |
}
|
62 |
|
63 |
/**
|
106 |
*/
|
107 |
function move_resources()
|
108 |
{
|
109 |
+
if ($this->valid_request) {
|
110 |
+
// Move stylesheets to head
|
111 |
+
if ($this->styles) {
|
112 |
+
$this->buffer = str_ireplace('</head>', $this->styles.'</head>', $this->buffer);
|
113 |
+
}
|
114 |
|
115 |
+
// Move the scripts to the bottom of the page
|
116 |
+
if ($this->scripts) {
|
117 |
+
$this->buffer = str_ireplace('</body>', $this->scripts.'</body>', $this->buffer);
|
118 |
+
}
|
119 |
|
120 |
+
if ($this->other_output) {
|
121 |
+
$this->buffer = str_replace('</body>', $this->other_output.'</body>', $this->buffer);
|
122 |
+
}
|
123 |
}
|
124 |
}
|
125 |
|
144 |
}
|
145 |
}
|
146 |
|
147 |
+
// We don't want to manipulate the buffer if it doesn't contain HTML
|
148 |
+
elseif (strpos($this->buffer, '</body>') === FALSE) {
|
149 |
+
$this->valid_request = FALSE;
|
150 |
+
}
|
151 |
+
|
152 |
// The output_buffer() function has been called in the PHP shutdown callback
|
153 |
// This will allow us to print the scripts ourselves and manipulate the buffer
|
154 |
if ($in_shutdown === TRUE) {
|
pope/lib/autoload.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
if (!defined('POPE_VERSION')) {
|
4 |
-
define('POPE_VERSION', '0.
|
5 |
require_once('class.extensibleobject.php');
|
6 |
require_once('interface.component.php');
|
7 |
require_once('class.component.php');
|
1 |
<?php
|
2 |
|
3 |
if (!defined('POPE_VERSION')) {
|
4 |
+
define('POPE_VERSION', '0.4');
|
5 |
require_once('class.extensibleobject.php');
|
6 |
require_once('interface.component.php');
|
7 |
require_once('class.component.php');
|
products/photocrati_nextgen/modules/ajax/class.ajax_controller.php
CHANGED
@@ -12,10 +12,8 @@ class C_Ajax_Controller extends C_MVC_Controller
|
|
12 |
|
13 |
function index_action()
|
14 |
{
|
15 |
-
|
16 |
-
|
17 |
-
E_CORE_ERROR|E_CORE_WARNING|E_COMPILE_ERROR|E_ERROR|E_PARSE|E_USER_ERROR|E_USER_WARNING|E_RECOVERABLE_ERROR
|
18 |
-
);
|
19 |
|
20 |
// Inform the MVC framework what type of content we're returning
|
21 |
$this->set_content_type('json');
|
@@ -32,11 +30,11 @@ class C_Ajax_Controller extends C_MVC_Controller
|
|
32 |
if (!$retval)
|
33 |
$retval = array('error' => 'Not a valid AJAX action');
|
34 |
|
|
|
|
|
|
|
35 |
// Return the JSON to the browser
|
36 |
echo json_encode($retval);
|
37 |
-
|
38 |
-
// reset the reporting level
|
39 |
-
error_reporting($error_reporting);
|
40 |
}
|
41 |
|
42 |
/**
|
12 |
|
13 |
function index_action()
|
14 |
{
|
15 |
+
// Start an output buffer to avoid displaying any PHP warnings/errors
|
16 |
+
ob_start();
|
|
|
|
|
17 |
|
18 |
// Inform the MVC framework what type of content we're returning
|
19 |
$this->set_content_type('json');
|
30 |
if (!$retval)
|
31 |
$retval = array('error' => 'Not a valid AJAX action');
|
32 |
|
33 |
+
// Flush the buffer
|
34 |
+
ob_end_clean();
|
35 |
+
|
36 |
// Return the JSON to the browser
|
37 |
echo json_encode($retval);
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
/**
|
products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php
CHANGED
@@ -260,7 +260,7 @@ jQuery(function($){
|
|
260 |
* A collection that can fetch it's entities from the server
|
261 |
**/
|
262 |
Ngg.Models.Remote_Collection = Ngg.Models.SelectableItems.extend({
|
263 |
-
fetch_limit:
|
264 |
in_progress: false,
|
265 |
fetch_url: photocrati_ajax.url,
|
266 |
action: '',
|
260 |
* A collection that can fetch it's entities from the server
|
261 |
**/
|
262 |
Ngg.Models.Remote_Collection = Ngg.Models.SelectableItems.extend({
|
263 |
+
fetch_limit: 5000,
|
264 |
in_progress: false,
|
265 |
fetch_url: photocrati_ajax.url,
|
266 |
action: '',
|
products/photocrati_nextgen/modules/frame_communication/class.frame_event_publisher.php
CHANGED
@@ -64,7 +64,15 @@ class Mixin_Frame_Event_Publisher extends Mixin
|
|
64 |
{
|
65 |
$id = md5(serialize($data));
|
66 |
$data['context'] = $this->object->context;
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
return $data;
|
70 |
}
|
64 |
{
|
65 |
$id = md5(serialize($data));
|
66 |
$data['context'] = $this->object->context;
|
67 |
+
|
68 |
+
$write_cookie = TRUE;
|
69 |
+
if (defined('XMLRPC_REQUEST')) {
|
70 |
+
$write_cookie = XMLRPC_REQUEST == FALSE;
|
71 |
+
}
|
72 |
+
|
73 |
+
if ($write_cookie) {
|
74 |
+
setrawcookie($this->object->setting_name.'_'.$id,$this->object->_encode($data));
|
75 |
+
}
|
76 |
|
77 |
return $data;
|
78 |
}
|
products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php
CHANGED
@@ -35,7 +35,7 @@ class M_Frame_Communication extends C_Base_Module
|
|
35 |
|
36 |
function _register_hooks()
|
37 |
{
|
38 |
-
add_action('
|
39 |
|
40 |
}
|
41 |
|
35 |
|
36 |
function _register_hooks()
|
37 |
{
|
38 |
+
add_action('init', array(&$this, 'enqueue_admin_scripts'));
|
39 |
|
40 |
}
|
41 |
|
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_mapper.php
CHANGED
@@ -71,6 +71,7 @@ class Hook_NextGen_Basic_Gallery_Defaults extends Hook
|
|
71 |
$this->object->_set_default_value($entity, 'settings', 'thumbnail_height', $settings->thumbheight);
|
72 |
$this->object->_set_default_value($entity, 'settings', 'show_all_in_lightbox', $settings->galHiddenImg);
|
73 |
$this->object->_set_default_value($entity, 'settings', 'ajax_pagination', $settings->galAjaxNav);
|
|
|
74 |
$this->object->_set_default_value($entity, 'settings', 'template', '');
|
75 |
$this->object->_set_default_value($entity, 'settings', 'display_no_images_error', 1);
|
76 |
|
71 |
$this->object->_set_default_value($entity, 'settings', 'thumbnail_height', $settings->thumbheight);
|
72 |
$this->object->_set_default_value($entity, 'settings', 'show_all_in_lightbox', $settings->galHiddenImg);
|
73 |
$this->object->_set_default_value($entity, 'settings', 'ajax_pagination', $settings->galAjaxNav);
|
74 |
+
$this->object->_set_default_value($entity, 'settings', 'use_imagebrowser_effect', $settings->galImgBrowser);
|
75 |
$this->object->_set_default_value($entity, 'settings', 'template', '');
|
76 |
$this->object->_set_default_value($entity, 'settings', 'display_no_images_error', 1);
|
77 |
|
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_routes.php
CHANGED
@@ -15,7 +15,7 @@ class A_NextGen_Basic_Gallery_Routes extends Mixin
|
|
15 |
function add_nextgen_basic_gallery_routes()
|
16 |
{
|
17 |
$slug = C_NextGen_Settings::get_instance()->router_param_slug;
|
18 |
-
$this->object->rewrite("{$slug}{*}/image/{*}", "{$slug}{1}/pid--{2}");
|
19 |
$this->object->rewrite("{$slug}{*}/slideshow/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW . "{2}");
|
20 |
$this->object->rewrite("{$slug}{*}/thumbnails/{*}", "{$slug}{1}/show--". NEXTGEN_GALLERY_BASIC_THUMBNAILS . "{2}");
|
21 |
$this->object->rewrite("{$slug}{*}/show--slide/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW . "/{2}");
|
15 |
function add_nextgen_basic_gallery_routes()
|
16 |
{
|
17 |
$slug = C_NextGen_Settings::get_instance()->router_param_slug;
|
18 |
+
$this->object->rewrite("{$slug}{*}/image/{*}", "{$slug}{1}/pid--{2}/show--" . NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER);
|
19 |
$this->object->rewrite("{$slug}{*}/slideshow/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW . "{2}");
|
20 |
$this->object->rewrite("{$slug}{*}/thumbnails/{*}", "{$slug}{1}/show--". NEXTGEN_GALLERY_BASIC_THUMBNAILS . "{2}");
|
21 |
$this->object->rewrite("{$slug}{*}/show--slide/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW . "/{2}");
|
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_urls.php
CHANGED
@@ -25,6 +25,7 @@ class A_NextGen_Basic_Gallery_Urls extends Mixin
|
|
25 |
if ($key == 'show') {
|
26 |
if ($value == NEXTGEN_GALLERY_BASIC_SLIDESHOW) $value = 'slideshow';
|
27 |
elseif ($value == NEXTGEN_GALLERY_BASIC_THUMBNAILS) $value = 'thumbnails';
|
|
|
28 |
return '/'.$value;
|
29 |
}
|
30 |
elseif ($key == 'page') {
|
25 |
if ($key == 'show') {
|
26 |
if ($value == NEXTGEN_GALLERY_BASIC_SLIDESHOW) $value = 'slideshow';
|
27 |
elseif ($value == NEXTGEN_GALLERY_BASIC_THUMBNAILS) $value = 'thumbnails';
|
28 |
+
elseif ($value == NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER) $value = 'imagebrowser';
|
29 |
return '/'.$value;
|
30 |
}
|
31 |
elseif ($key == 'page') {
|
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php
CHANGED
@@ -36,6 +36,7 @@ class A_NextGen_Basic_Thumbnail_Form extends Mixin_Display_Type_Form
|
|
36 |
'nextgen_basic_thumbnails_number_of_columns',
|
37 |
'nextgen_basic_thumbnails_ajax_pagination',
|
38 |
'nextgen_basic_thumbnails_hidden',
|
|
|
39 |
'nextgen_basic_thumbnails_show_piclens_link',
|
40 |
'nextgen_basic_thumbnails_piclens_link_text',
|
41 |
'nextgen_basic_thumbnails_show_slideshow_link',
|
@@ -135,6 +136,17 @@ class A_NextGen_Basic_Thumbnail_Form extends Mixin_Display_Type_Form
|
|
135 |
);
|
136 |
}
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
/**
|
139 |
* Renders the show_piclens_link settings field
|
140 |
*
|
36 |
'nextgen_basic_thumbnails_number_of_columns',
|
37 |
'nextgen_basic_thumbnails_ajax_pagination',
|
38 |
'nextgen_basic_thumbnails_hidden',
|
39 |
+
'nextgen_basic_thumbnails_imagebrowser_effect',
|
40 |
'nextgen_basic_thumbnails_show_piclens_link',
|
41 |
'nextgen_basic_thumbnails_piclens_link_text',
|
42 |
'nextgen_basic_thumbnails_show_slideshow_link',
|
136 |
);
|
137 |
}
|
138 |
|
139 |
+
function _render_nextgen_basic_thumbnails_imagebrowser_effect_field($display_type)
|
140 |
+
{
|
141 |
+
return $this->_render_radio_field(
|
142 |
+
$display_type,
|
143 |
+
'use_imagebrowser_effect',
|
144 |
+
'Use imagebrowser effect',
|
145 |
+
$display_type->settings['use_imagebrowser_effect'],
|
146 |
+
'When active each image in the gallery will link to an imagebrowser display and lightbox effects will not be applied.'
|
147 |
+
);
|
148 |
+
}
|
149 |
+
|
150 |
/**
|
151 |
* Renders the show_piclens_link settings field
|
152 |
*
|
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnails_controller.php
CHANGED
@@ -125,6 +125,22 @@ class A_NextGen_Basic_Thumbnails_Controller extends Mixin_NextGen_Basic_Gallery_
|
|
125 |
);
|
126 |
}
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
// The render functions require different processing
|
129 |
if (!empty($display_settings['template']))
|
130 |
{
|
@@ -137,13 +153,11 @@ class A_NextGen_Basic_Thumbnails_Controller extends Mixin_NextGen_Basic_Gallery_
|
|
137 |
'next' => (empty($pagination_next)) ? FALSE : $pagination_next,
|
138 |
'prev' => (empty($pagination_prev)) ? FALSE : $pagination_prev,
|
139 |
'pagination' => $pagination,
|
140 |
-
'piclens_link'
|
141 |
-
'
|
142 |
-
'slideshow_link' => @$display_settings['slideshow_link'],
|
143 |
-
'slideshow_link_text' => @$display_settings['slideshow_link_text']
|
144 |
)
|
145 |
);
|
146 |
-
|
147 |
}
|
148 |
else {
|
149 |
$params = $display_settings;
|
@@ -153,15 +167,21 @@ class A_NextGen_Basic_Thumbnails_Controller extends Mixin_NextGen_Basic_Gallery_
|
|
153 |
$params['transient_id'] = $displayed_gallery->transient_id;
|
154 |
$params['current_page'] = $current_page;
|
155 |
$params['piclens_link'] = $piclens_link;
|
156 |
-
$params['effect_code'] = $
|
157 |
$params['pagination'] = $pagination;
|
158 |
$params['thumbnail_size_name'] = $thumbnail_size_name;
|
159 |
$params['slideshow_link'] = $slideshow_link;
|
160 |
|
161 |
$params = $this->object->prepare_display_parameters($displayed_gallery, $params);
|
162 |
|
163 |
-
|
164 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
}
|
166 |
else if ($display_settings['display_no_images_error']) {
|
167 |
return $this->object->render_partial("photocrati-nextgen_gallery_display#no_images_found", array(), $return);
|
125 |
);
|
126 |
}
|
127 |
|
128 |
+
// This setting 1) points all images to an imagebrowser display & 2) disables the lightbox effect
|
129 |
+
if ($display_settings['use_imagebrowser_effect'])
|
130 |
+
{
|
131 |
+
// this hook *MUST* be removed later; it should not apply to galleries that may come after this one!
|
132 |
+
$storage->add_post_hook(
|
133 |
+
'get_image_url',
|
134 |
+
'imagebrowser alternate url replacer',
|
135 |
+
'Hook_NextGen_Basic_Imagebrowser_Alt_URLs',
|
136 |
+
'get_image_url'
|
137 |
+
);
|
138 |
+
$effect_code = '';
|
139 |
+
}
|
140 |
+
else {
|
141 |
+
$effect_code = $this->object->get_effect_code($displayed_gallery);
|
142 |
+
}
|
143 |
+
|
144 |
// The render functions require different processing
|
145 |
if (!empty($display_settings['template']))
|
146 |
{
|
153 |
'next' => (empty($pagination_next)) ? FALSE : $pagination_next,
|
154 |
'prev' => (empty($pagination_prev)) ? FALSE : $pagination_prev,
|
155 |
'pagination' => $pagination,
|
156 |
+
'piclens_link' => $piclens_link,
|
157 |
+
'slideshow_link' => $slideshow_link
|
|
|
|
|
158 |
)
|
159 |
);
|
160 |
+
$output = $this->object->legacy_render($display_settings['template'], $params, $return, 'gallery');
|
161 |
}
|
162 |
else {
|
163 |
$params = $display_settings;
|
167 |
$params['transient_id'] = $displayed_gallery->transient_id;
|
168 |
$params['current_page'] = $current_page;
|
169 |
$params['piclens_link'] = $piclens_link;
|
170 |
+
$params['effect_code'] = $effect_code;
|
171 |
$params['pagination'] = $pagination;
|
172 |
$params['thumbnail_size_name'] = $thumbnail_size_name;
|
173 |
$params['slideshow_link'] = $slideshow_link;
|
174 |
|
175 |
$params = $this->object->prepare_display_parameters($displayed_gallery, $params);
|
176 |
|
177 |
+
$output = $this->object->render_view('photocrati-nextgen_basic_gallery#thumbnails/index', $params, $return);
|
178 |
}
|
179 |
+
|
180 |
+
if ($display_settings['use_imagebrowser_effect'])
|
181 |
+
$storage->del_post_hook('get_image_url', 'imagebrowser alternate url replacer');
|
182 |
+
|
183 |
+
return $output;
|
184 |
+
|
185 |
}
|
186 |
else if ($display_settings['display_no_images_error']) {
|
187 |
return $this->object->render_partial("photocrati-nextgen_gallery_display#no_images_found", array(), $return);
|
products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php
CHANGED
@@ -25,7 +25,7 @@ class M_NextGen_Basic_Gallery extends C_Base_Module
|
|
25 |
'photocrati-nextgen_basic_gallery',
|
26 |
'NextGEN Basic Gallery',
|
27 |
"Provides NextGEN Gallery's basic thumbnail/slideshow integrated gallery",
|
28 |
-
'0.
|
29 |
'http://www.nextgen-gallery.com',
|
30 |
'Photocrati Media',
|
31 |
'http://www.photocrati.com'
|
25 |
'photocrati-nextgen_basic_gallery',
|
26 |
'NextGEN Basic Gallery',
|
27 |
"Provides NextGEN Gallery's basic thumbnail/slideshow integrated gallery",
|
28 |
+
'0.5',
|
29 |
'http://www.nextgen-gallery.com',
|
30 |
'Photocrati Media',
|
31 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.css
CHANGED
@@ -35,7 +35,7 @@ body {
|
|
35 |
|
36 |
.ngg-slideshow img {
|
37 |
max-width: 100% !important;
|
38 |
-
max-height: 100%;
|
39 |
width: auto;
|
40 |
height: auto;
|
41 |
border: none;
|
35 |
|
36 |
.ngg-slideshow img {
|
37 |
max-width: 100% !important;
|
38 |
+
max-height: 100%;
|
39 |
width: auto;
|
40 |
height: auto;
|
41 |
border: none;
|
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_controller.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* Provides rendering logic for the NextGen Basic ImageBrowser
|
5 |
*/
|
6 |
-
class A_NextGen_Basic_ImageBrowser_Controller extends
|
7 |
{
|
8 |
/**
|
9 |
* Renders the front-end display for the imagebrowser display type
|
@@ -104,11 +104,15 @@ class A_NextGen_Basic_ImageBrowser_Controller extends Mixin
|
|
104 |
// determine URI to the next & previous images
|
105 |
$back_pid = ($key >= 1) ? $picture_array[$key - 1] : end($picture_array);
|
106 |
|
|
|
|
|
|
|
107 |
$prev_image_link = $this->object->set_param_for(
|
108 |
$application->get_routed_url(TRUE),
|
109 |
'pid',
|
110 |
$picture_list[$back_pid]->image_slug
|
111 |
);
|
|
|
112 |
|
113 |
$next_pid = ($key < ($total - 1)) ? $picture_array[$key + 1] : reset($picture_array);
|
114 |
$next_image_link = $this->object->set_param_for(
|
@@ -116,6 +120,7 @@ class A_NextGen_Basic_ImageBrowser_Controller extends Mixin
|
|
116 |
'pid',
|
117 |
$picture_list[$next_pid]->image_slug
|
118 |
);
|
|
|
119 |
|
120 |
// css class
|
121 |
$anchor = 'ngg-imagebrowser-' . $picture->galleryid . '-' . (get_the_ID() == false ? 0 : get_the_ID());
|
3 |
/**
|
4 |
* Provides rendering logic for the NextGen Basic ImageBrowser
|
5 |
*/
|
6 |
+
class A_NextGen_Basic_ImageBrowser_Controller extends Mixin_NextGen_Basic_Gallery_Controller
|
7 |
{
|
8 |
/**
|
9 |
* Renders the front-end display for the imagebrowser display type
|
104 |
// determine URI to the next & previous images
|
105 |
$back_pid = ($key >= 1) ? $picture_array[$key - 1] : end($picture_array);
|
106 |
|
107 |
+
// 'show' is set when using the imagebrowser as an alternate view to a thumbnail or slideshow
|
108 |
+
// for which the basic-gallery module will rewrite the show parameter into existence as long as 'image'
|
109 |
+
// is set. We remove 'show' here so navigation appears fluid.
|
110 |
$prev_image_link = $this->object->set_param_for(
|
111 |
$application->get_routed_url(TRUE),
|
112 |
'pid',
|
113 |
$picture_list[$back_pid]->image_slug
|
114 |
);
|
115 |
+
$prev_image_link = trailingslashit($this->object->remove_param_for($prev_image_link, 'show', $displayed_gallery->id()));
|
116 |
|
117 |
$next_pid = ($key < ($total - 1)) ? $picture_array[$key + 1] : reset($picture_array);
|
118 |
$next_image_link = $this->object->set_param_for(
|
120 |
'pid',
|
121 |
$picture_list[$next_pid]->image_slug
|
122 |
);
|
123 |
+
$next_image_link = trailingslashit($this->object->remove_param_for($next_image_link, 'show', $displayed_gallery->id()));
|
124 |
|
125 |
// css class
|
126 |
$anchor = 'ngg-imagebrowser-' . $picture->galleryid . '-' . (get_the_ID() == false ? 0 : get_the_ID());
|
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/hook.nextgen_basic_imagebrowser_alt_urls.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Hook_NextGen_Basic_Imagebrowser_Alt_URLs extends Hook {
|
4 |
+
/**
|
5 |
+
* Replaces the full-size image url with a path to the current url + a pid (image) parameter. This causes
|
6 |
+
* basic thumbnail displays to render a basic imagebrowser.
|
7 |
+
*
|
8 |
+
* @param $image
|
9 |
+
* @param string $size
|
10 |
+
* @return null
|
11 |
+
*/
|
12 |
+
function get_image_url($image, $size='full')
|
13 |
+
{
|
14 |
+
// Get the method to be returned
|
15 |
+
$retval = $this->object->get_method_property(
|
16 |
+
$this->method_called,
|
17 |
+
ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE
|
18 |
+
);
|
19 |
+
|
20 |
+
if ($size == 'full')
|
21 |
+
{
|
22 |
+
$router = $this->object->get_registry()->get_utility('I_Router');
|
23 |
+
$controller = $this->object->get_registry()->get_utility('I_Display_Type_Controller');
|
24 |
+
$application = $router->get_routed_app();
|
25 |
+
|
26 |
+
if ($router->param('ajax_pagination_referrer'))
|
27 |
+
$url = $router->param('ajax_pagination_referrer');
|
28 |
+
else
|
29 |
+
$url = $application->get_routed_url(TRUE);
|
30 |
+
|
31 |
+
$retval = $controller->set_param_for($url, 'pid', $image->image_slug);
|
32 |
+
|
33 |
+
$this->object->set_method_property(
|
34 |
+
$this->method_called,
|
35 |
+
ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE,
|
36 |
+
$retval
|
37 |
+
);
|
38 |
+
}
|
39 |
+
|
40 |
+
return $retval;
|
41 |
+
}
|
42 |
+
}
|
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php
CHANGED
@@ -113,7 +113,8 @@ class M_NextGen_Basic_ImageBrowser extends C_Base_Module
|
|
113 |
'C_Nextgen_Basic_Imagebrowser_Installer' => 'class.nextgen_basic_imagebrowser_installer.php',
|
114 |
'A_Nextgen_Basic_Imagebrowser_Mapper' => 'adapter.nextgen_basic_imagebrowser_mapper.php',
|
115 |
'A_Nextgen_Basic_Imagebrowser_Routes' => 'adapter.nextgen_basic_imagebrowser_routes.php',
|
116 |
-
'A_Nextgen_Basic_Imagebrowser_Urls' => 'adapter.nextgen_basic_imagebrowser_urls.php'
|
|
|
117 |
);
|
118 |
}
|
119 |
}
|
113 |
'C_Nextgen_Basic_Imagebrowser_Installer' => 'class.nextgen_basic_imagebrowser_installer.php',
|
114 |
'A_Nextgen_Basic_Imagebrowser_Mapper' => 'adapter.nextgen_basic_imagebrowser_mapper.php',
|
115 |
'A_Nextgen_Basic_Imagebrowser_Routes' => 'adapter.nextgen_basic_imagebrowser_routes.php',
|
116 |
+
'A_Nextgen_Basic_Imagebrowser_Urls' => 'adapter.nextgen_basic_imagebrowser_urls.php',
|
117 |
+
'Hook_NextGen_Basic_Imagebrowser_Alt_URLs' => 'hook.nextgen_basic_imagebrowser_alt_urls.php'
|
118 |
);
|
119 |
}
|
120 |
}
|
products/photocrati_nextgen/modules/nextgen_basic_templates/adapter.nextgen_basic_template_form.php
CHANGED
@@ -134,8 +134,6 @@ class A_NextGen_Basic_Template_Form extends Mixin
|
|
134 |
// create the 'gallery' object
|
135 |
$gallery = new stdclass;
|
136 |
$gallery->ID = $displayed_gallery->id();
|
137 |
-
$gallery->show_slideshow = FALSE;
|
138 |
-
$gallery->show_piclens = FALSE;
|
139 |
$gallery->name = stripslashes($orig_gallery->name);
|
140 |
$gallery->title = stripslashes($orig_gallery->title);
|
141 |
$gallery->description = html_entity_decode(stripslashes($orig_gallery->galdesc));
|
@@ -151,19 +149,16 @@ class A_NextGen_Basic_Template_Form extends Mixin
|
|
151 |
$gallery->columns = @intval($displayed_gallery->display_settings['number_of_columns']);
|
152 |
$gallery->imagewidth = ($gallery->columns > 0) ? 'style="width:' . floor(100 / $gallery->columns) . '%;"' : '';
|
153 |
|
154 |
-
if (
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
$gallery->slideshow_link_text = $displayed_gallery->display_settings['alternative_view_link_text'];
|
160 |
-
}
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
}
|
167 |
}
|
168 |
|
169 |
$gallery = apply_filters('ngg_gallery_object', $gallery, 4);
|
134 |
// create the 'gallery' object
|
135 |
$gallery = new stdclass;
|
136 |
$gallery->ID = $displayed_gallery->id();
|
|
|
|
|
137 |
$gallery->name = stripslashes($orig_gallery->name);
|
138 |
$gallery->title = stripslashes($orig_gallery->title);
|
139 |
$gallery->description = html_entity_decode(stripslashes($orig_gallery->galdesc));
|
149 |
$gallery->columns = @intval($displayed_gallery->display_settings['number_of_columns']);
|
150 |
$gallery->imagewidth = ($gallery->columns > 0) ? 'style="width:' . floor(100 / $gallery->columns) . '%;"' : '';
|
151 |
|
152 |
+
if (!empty($displayed_gallery->display_settings['show_slideshow_link'])) {
|
153 |
+
$gallery->show_slideshow = TRUE;
|
154 |
+
$gallery->slideshow_link = $params['slideshow_link'];
|
155 |
+
$gallery->slideshow_link_text = $displayed_gallery->display_settings['slideshow_link_text'];
|
156 |
+
}
|
|
|
|
|
157 |
|
158 |
+
if (!empty($displayed_gallery->display_settings['show_piclens_link'])) {
|
159 |
+
$gallery->show_piclens = true;
|
160 |
+
$gallery->piclens_link = $params['piclens_link'];
|
161 |
+
$gallery->piclens_link_text = $displayed_gallery->display_settings['piclens_link_text'];
|
|
|
162 |
}
|
163 |
|
164 |
$gallery = apply_filters('ngg_gallery_object', $gallery, 4);
|
products/photocrati_nextgen/modules/nextgen_data/class.image_mapper.php
CHANGED
@@ -58,23 +58,14 @@ class Mixin_Gallery_Image_Mapper extends Mixin
|
|
58 |
|
59 |
function _save_entity($entity)
|
60 |
{
|
61 |
-
$exists = false;
|
62 |
-
$primary_key = $this->object->get_primary_key_column();
|
63 |
-
if (isset($entity->$primary_key)) {
|
64 |
-
$exists = true;
|
65 |
-
}
|
66 |
// If successfully saved, then import metadata and
|
67 |
$retval = $this->call_parent('_save_entity', $entity);
|
68 |
if ($retval) {
|
69 |
include_once(NGGALLERY_ABSPATH.'/admin/functions.php');
|
70 |
$image_id = $this->get_id($entity);
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
}
|
75 |
-
else {
|
76 |
-
nggAdmin::import_MetaData($image_id);
|
77 |
-
}
|
78 |
C_Photocrati_Cache::flush();
|
79 |
}
|
80 |
return $retval;
|
58 |
|
59 |
function _save_entity($entity)
|
60 |
{
|
|
|
|
|
|
|
|
|
|
|
61 |
// If successfully saved, then import metadata and
|
62 |
$retval = $this->call_parent('_save_entity', $entity);
|
63 |
if ($retval) {
|
64 |
include_once(NGGALLERY_ABSPATH.'/admin/functions.php');
|
65 |
$image_id = $this->get_id($entity);
|
66 |
+
if (!isset($entity->meta_data['saved'])) {
|
67 |
+
nggAdmin::import_MetaData($image_id);
|
68 |
+
}
|
|
|
|
|
|
|
|
|
69 |
C_Photocrati_Cache::flush();
|
70 |
}
|
71 |
return $retval;
|
products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php
CHANGED
@@ -19,7 +19,7 @@ class C_Image_Wrapper
|
|
19 |
* Constructor. Converts the image class into an array and fills from defaults any missing values
|
20 |
*
|
21 |
* @param object $gallery Individual result from displayed_gallery->get_entities()
|
22 |
-
* @param object $displayed_gallery Displayed gallery
|
23 |
* @param bool $legacy Whether the image source is from NextGen Legacy or NextGen
|
24 |
* @return void
|
25 |
*/
|
@@ -403,8 +403,26 @@ class C_Image_Wrapper
|
|
403 |
*/
|
404 |
function get_thumbcode($gallery_name = '')
|
405 |
{
|
406 |
-
|
407 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
}
|
409 |
|
410 |
/**
|
19 |
* Constructor. Converts the image class into an array and fills from defaults any missing values
|
20 |
*
|
21 |
* @param object $gallery Individual result from displayed_gallery->get_entities()
|
22 |
+
* @param object $displayed_gallery Displayed gallery -- MAY BE NULL
|
23 |
* @param bool $legacy Whether the image source is from NextGen Legacy or NextGen
|
24 |
* @return void
|
25 |
*/
|
403 |
*/
|
404 |
function get_thumbcode($gallery_name = '')
|
405 |
{
|
406 |
+
if (empty($this->_displayed_gallery))
|
407 |
+
{
|
408 |
+
$effect_code = C_NextGen_Settings::get_instance()->thumbCode;
|
409 |
+
$effect_code = str_replace('%GALLERY_ID%', $gallery_name, $effect_code);
|
410 |
+
$effect_code = str_replace('%GALLERY_NAME%', $gallery_name, $effect_code);
|
411 |
+
$effect_code = apply_filters('ngg_get_thumbcode', $effect_code, $this);
|
412 |
+
$retval = $effect_code;
|
413 |
+
}
|
414 |
+
else {
|
415 |
+
$controller = C_Component_Registry::get_instance()->get_utility('I_Display_Type_Controller');
|
416 |
+
$retval = $controller->get_effect_code($this->_displayed_gallery);
|
417 |
+
|
418 |
+
// This setting requires that we disable the effect code
|
419 |
+
$ds = $this->_displayed_gallery->display_settings;
|
420 |
+
if (isset($ds['use_imagebrowser_effect']) && $ds['use_imagebrowser_effect'])
|
421 |
+
$retval = '';
|
422 |
+
}
|
423 |
+
|
424 |
+
$this->_cache['thumbcode'] = $retval;
|
425 |
+
return $retval;
|
426 |
}
|
427 |
|
428 |
/**
|
products/photocrati_nextgen/modules/nextgen_data/class.nextgen_metadata.php
CHANGED
@@ -85,7 +85,7 @@ class C_NextGen_Metadata extends C_Component
|
|
85 |
$meta = $this->image->meta_data;
|
86 |
|
87 |
// check if we already import the meta data to the database
|
88 |
-
if (!is_array($meta) || ($meta['saved'] != TRUE))
|
89 |
{
|
90 |
return FALSE;
|
91 |
}
|
85 |
$meta = $this->image->meta_data;
|
86 |
|
87 |
// check if we already import the meta data to the database
|
88 |
+
if (!is_array($meta) || !isset($meta['saved']) OR ($meta['saved'] != TRUE))
|
89 |
{
|
90 |
return FALSE;
|
91 |
}
|
products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php
CHANGED
@@ -281,7 +281,7 @@ class Mixin_Displayed_Gallery_Queries extends Mixin
|
|
281 |
// Container ids are tags
|
282 |
if ($source_obj->name == 'tags') {
|
283 |
$term_ids = $this->object->get_term_ids_for_tags($this->object->container_ids);
|
284 |
-
|
285 |
}
|
286 |
|
287 |
// Container ids are gallery ids
|
@@ -296,9 +296,7 @@ class Mixin_Displayed_Gallery_Queries extends Mixin
|
|
296 |
// Container ids are tags
|
297 |
if ($source_obj->name == 'tags') {
|
298 |
$term_ids = $this->object->get_term_ids_for_tags($this->object->excluded_container_ids);
|
299 |
-
|
300 |
-
$mapper->where(array("{$image_key} NOT IN %s",get_objects_in_term($term_ids, 'ngg_tag')));
|
301 |
-
}
|
302 |
}
|
303 |
|
304 |
// Container ids are gallery ids
|
@@ -725,23 +723,34 @@ class Mixin_Displayed_Gallery_Queries extends Mixin
|
|
725 |
{
|
726 |
global $wpdb;
|
727 |
|
728 |
-
// don't run for galleries without a container-id, like the tagcloud
|
729 |
-
if (!$tags && empty($this->object->container_ids))
|
730 |
-
return array();
|
731 |
-
|
732 |
// If no tags were provided, get them from the container_ids
|
733 |
if (!$tags) $tags = $this->object->container_ids;
|
734 |
|
735 |
// Convert container ids to a string suitable for WHERE IN
|
736 |
$container_ids = array();
|
737 |
-
|
738 |
-
$
|
|
|
|
|
|
|
739 |
}
|
740 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
741 |
|
742 |
// Get all term_ids for each image tag slug
|
743 |
$term_ids = array();
|
744 |
-
$query = $wpdb->prepare("SELECT term_id FROM $wpdb->terms WHERE slug IN ({$container_ids}) ORDER BY term_id ASC ", NULL);
|
745 |
foreach ($wpdb->get_results($query) as $row) {
|
746 |
$term_ids[] = $row->term_id;
|
747 |
}
|
281 |
// Container ids are tags
|
282 |
if ($source_obj->name == 'tags') {
|
283 |
$term_ids = $this->object->get_term_ids_for_tags($this->object->container_ids);
|
284 |
+
$mapper->where(array("{$image_key} IN %s",get_objects_in_term($term_ids, 'ngg_tag')));
|
285 |
}
|
286 |
|
287 |
// Container ids are gallery ids
|
296 |
// Container ids are tags
|
297 |
if ($source_obj->name == 'tags') {
|
298 |
$term_ids = $this->object->get_term_ids_for_tags($this->object->excluded_container_ids);
|
299 |
+
$mapper->where(array("{$image_key} NOT IN %s",get_objects_in_term($term_ids, 'ngg_tag')));
|
|
|
|
|
300 |
}
|
301 |
|
302 |
// Container ids are gallery ids
|
723 |
{
|
724 |
global $wpdb;
|
725 |
|
|
|
|
|
|
|
|
|
726 |
// If no tags were provided, get them from the container_ids
|
727 |
if (!$tags) $tags = $this->object->container_ids;
|
728 |
|
729 |
// Convert container ids to a string suitable for WHERE IN
|
730 |
$container_ids = array();
|
731 |
+
if (!in_array('All', $tags)) {
|
732 |
+
foreach ($tags as $container) {
|
733 |
+
$container_ids[]= "'{$container}'";
|
734 |
+
}
|
735 |
+
$container_ids = implode(',', $container_ids);
|
736 |
}
|
737 |
+
|
738 |
+
// Construct query
|
739 |
+
$query = $wpdb->prepare("
|
740 |
+
SELECT {$wpdb->term_taxonomy}.term_id FROM {$wpdb->term_taxonomy}
|
741 |
+
INNER JOIN {$wpdb->terms} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id
|
742 |
+
WHERE {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id
|
743 |
+
AND taxonomy = %s
|
744 |
+
", 'ngg_tag');
|
745 |
+
|
746 |
+
// Filter by selected tags
|
747 |
+
if ($container_ids) $query .= "AND (slug IN ({$container_ids}) OR name IN ({$container_ids}))";
|
748 |
+
|
749 |
+
// Add order by clause
|
750 |
+
$query .= "ORDER BY {$wpdb->terms}.term_id";
|
751 |
|
752 |
// Get all term_ids for each image tag slug
|
753 |
$term_ids = array();
|
|
|
754 |
foreach ($wpdb->get_results($query) as $row) {
|
755 |
$term_ids[] = $row->term_id;
|
756 |
}
|
products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_renderer.php
CHANGED
@@ -217,6 +217,11 @@ class Mixin_Displayed_Gallery_Renderer extends Mixin
|
|
217 |
*/
|
218 |
function render($displayed_gallery, $return=FALSE, $mode = null)
|
219 |
{
|
|
|
|
|
|
|
|
|
|
|
220 |
if ($mode == null)
|
221 |
{
|
222 |
$mode = 'normal';
|
217 |
*/
|
218 |
function render($displayed_gallery, $return=FALSE, $mode = null)
|
219 |
{
|
220 |
+
// Simply throwing our rendered gallery into a feed will most likely not work correctly.
|
221 |
+
// The MediaRSS option in NextGEN is available as an alternative.
|
222 |
+
if(is_feed())
|
223 |
+
return '';
|
224 |
+
|
225 |
if ($mode == null)
|
226 |
{
|
227 |
$mode = 'normal';
|
products/photocrati_nextgen/modules/ngglegacy/admin/overview.php
CHANGED
@@ -90,9 +90,7 @@ if ( !(get_locale() == 'en_US') )
|
|
90 |
add_meta_box('ngg_about_meta_box', __('About', 'nggallery'), 'ngg_AboutMetaBox', 'ngg_overview', 'left', 'core');
|
91 |
//add_meta_box('ngg_lastdonators', __('Recent donators', 'nggallery'), 'ngg_widget_overview_donators', 'ngg_overview', 'right', 'core');
|
92 |
if ( !is_multisite() || is_super_admin() ) {
|
93 |
-
add_meta_box('ngg_plugin_check', __('Plugin Check', 'nggallery'), 'ngg_plugin_check', 'ngg_overview', 'right', 'core');
|
94 |
add_meta_box('ngg_server', __('Server Settings', 'nggallery'), 'ngg_overview_server', 'ngg_overview', 'right', 'core');
|
95 |
-
add_meta_box('dashboard_plugins', __('Related plugins', 'nggallery'), 'ngg_widget_related_plugins', 'ngg_overview', 'left', 'core');
|
96 |
}
|
97 |
|
98 |
function ngg_AboutMetaBox()
|
@@ -112,7 +110,12 @@ function ngg_likeThisMetaBox() {
|
|
112 |
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/');
|
113 |
echo '</p><ul>';
|
114 |
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
116 |
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'>";
|
117 |
_e('Give it a good rating on WordPress.org', 'nggallery');
|
118 |
echo "</a></li>";
|
@@ -133,210 +136,6 @@ function ngg_likeThisMetaBox() {
|
|
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 |
-
* Ajax Check for conflict with other plugins/themes
|
138 |
-
*
|
139 |
-
* @return void
|
140 |
-
*/
|
141 |
-
function ngg_plugin_check() {
|
142 |
-
|
143 |
-
global $ngg;
|
144 |
-
?>
|
145 |
-
<script type="text/javascript">
|
146 |
-
(function($) {
|
147 |
-
nggPluginCheck = {
|
148 |
-
|
149 |
-
settings: {
|
150 |
-
img_run: '<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="icon" alt="started"/>',
|
151 |
-
img_ok: '<img src="<?php echo esc_url( admin_url( 'images/yes.png' ) ); ?>" class="icon" alt="ok"/>',
|
152 |
-
img_fail: '<img src="<?php echo esc_url( admin_url( 'images/no.png' ) ); ?>" class="icon" alt="failed" />',
|
153 |
-
domain: '<?php echo esc_url( home_url('index.php', is_ssl() ? 'https' : 'http') ); ?>'
|
154 |
-
},
|
155 |
-
|
156 |
-
run: function( index, state ) {
|
157 |
-
ul = $('#plugin_check');
|
158 |
-
s = this.settings;
|
159 |
-
var step = 1;
|
160 |
-
switch ( index ) {
|
161 |
-
case 1:
|
162 |
-
this.check1();
|
163 |
-
break;
|
164 |
-
case 2:
|
165 |
-
this.check2( step );
|
166 |
-
break;
|
167 |
-
case 3:
|
168 |
-
this.check3();
|
169 |
-
break;
|
170 |
-
}
|
171 |
-
},
|
172 |
-
|
173 |
-
// this function check if the json API will work with your theme & plugins
|
174 |
-
check1 : function() {
|
175 |
-
this.start(1);
|
176 |
-
var req = $.ajax({
|
177 |
-
dataType: 'json',
|
178 |
-
url: s.domain,
|
179 |
-
data:'callback=json&format=json&method=version',
|
180 |
-
cache: false,
|
181 |
-
timeout: 10000,
|
182 |
-
success: function(msg){
|
183 |
-
if (msg.version == '<?php echo $ngg->version; ?>')
|
184 |
-
nggPluginCheck.success(1);
|
185 |
-
else
|
186 |
-
nggPluginCheck.failed(1);
|
187 |
-
},
|
188 |
-
error: function (msg) {
|
189 |
-
nggPluginCheck.failed(1);
|
190 |
-
},
|
191 |
-
complete: function () {
|
192 |
-
nggPluginCheck.run(2);
|
193 |
-
}
|
194 |
-
});
|
195 |
-
|
196 |
-
},
|
197 |
-
|
198 |
-
// this function check if GD lib can create images & thumbnails
|
199 |
-
check2 : function( step ) {
|
200 |
-
if (step == 1) this.start(2);
|
201 |
-
var stop = false;
|
202 |
-
var req = $.ajax({
|
203 |
-
type: "POST",
|
204 |
-
url: ajaxurl,
|
205 |
-
data:"action=ngg_image_check&step=" + step,
|
206 |
-
cache: false,
|
207 |
-
timeout: 10000,
|
208 |
-
success: function(msg){
|
209 |
-
if (msg.stat == 'ok') {
|
210 |
-
nggPluginCheck.success(2, msg.message);
|
211 |
-
} else {
|
212 |
-
if (step == 1)
|
213 |
-
nggPluginCheck.failed(2);
|
214 |
-
stop = true;
|
215 |
-
}
|
216 |
-
|
217 |
-
},
|
218 |
-
error: function (msg) {
|
219 |
-
if (step == 1)
|
220 |
-
nggPluginCheck.failed(2);
|
221 |
-
stop = true;
|
222 |
-
},
|
223 |
-
complete: function () {
|
224 |
-
step++;
|
225 |
-
if (step <= 11 && stop == false)
|
226 |
-
nggPluginCheck.check2(step);
|
227 |
-
else
|
228 |
-
nggPluginCheck.run(3);
|
229 |
-
}
|
230 |
-
});
|
231 |
-
},
|
232 |
-
|
233 |
-
// this function check if wp_head / wp_footer is avaiable
|
234 |
-
check3 : function() {
|
235 |
-
this.start(3);
|
236 |
-
var req = $.ajax({
|
237 |
-
type: "POST",
|
238 |
-
url: ajaxurl,
|
239 |
-
data:"action=ngg_test_head_footer",
|
240 |
-
cache: false,
|
241 |
-
timeout: 10000,
|
242 |
-
success: function(msg){
|
243 |
-
if (msg == 'success')
|
244 |
-
nggPluginCheck.success(3);
|
245 |
-
else
|
246 |
-
nggPluginCheck.failed(3, msg);
|
247 |
-
},
|
248 |
-
error: function (msg) {
|
249 |
-
nggPluginCheck.failed(3);
|
250 |
-
}
|
251 |
-
});
|
252 |
-
},
|
253 |
-
|
254 |
-
start: function( id ) {
|
255 |
-
|
256 |
-
s = this.settings;
|
257 |
-
var field = "#check" + id;
|
258 |
-
|
259 |
-
if ( ul.find(field + " img").length == 0)
|
260 |
-
$(field).prepend( s.img_run );
|
261 |
-
else
|
262 |
-
$(field + " img").replaceWith( s.img_run );
|
263 |
-
|
264 |
-
$(field + " .success").hide();
|
265 |
-
$(field + " .failed").hide();
|
266 |
-
$(field + " .default").replaceWith('<p class="default message"><?php echo esc_js( __('Running...', 'nggallery') ); ?></p> ');
|
267 |
-
},
|
268 |
-
|
269 |
-
success: function( id, msg ) {
|
270 |
-
|
271 |
-
s = this.settings;
|
272 |
-
var field = "#check" + id;
|
273 |
-
|
274 |
-
if ( ul.find(field + " img").length == 0)
|
275 |
-
$(field).prepend( s.img_ok );
|
276 |
-
else
|
277 |
-
$(field + " img").replaceWith( s.img_ok );
|
278 |
-
|
279 |
-
$(field + " .default").hide();
|
280 |
-
if (msg)
|
281 |
-
$(field + " .success").replaceWith('<p class="success message">' + msg +' </p> ');
|
282 |
-
else
|
283 |
-
$(field + " .success").show();
|
284 |
-
|
285 |
-
},
|
286 |
-
|
287 |
-
failed: function( id, msg ) {
|
288 |
-
|
289 |
-
s = this.settings;
|
290 |
-
var field = "#check" + id;
|
291 |
-
|
292 |
-
if ( ul.find(field + " img").length == 0)
|
293 |
-
$(field).prepend( s.img_fail );
|
294 |
-
else
|
295 |
-
$(field + " img").replaceWith( s.img_fail );
|
296 |
-
|
297 |
-
$(field + " .default").hide();
|
298 |
-
if (msg)
|
299 |
-
$(field + " .failed").replaceWith('<p class="failed message">' + msg +' </p> ');
|
300 |
-
else
|
301 |
-
$(field + " .failed").show();
|
302 |
-
|
303 |
-
}
|
304 |
-
|
305 |
-
};
|
306 |
-
})(jQuery);
|
307 |
-
</script>
|
308 |
-
<div class="dashboard-widget-holder wp_dashboard_empty">
|
309 |
-
<div class="ngg-dashboard-widget">
|
310 |
-
<div class="dashboard-widget-content">
|
311 |
-
<ul id="plugin_check" class="settings">
|
312 |
-
<li id="check1">
|
313 |
-
<strong><?php _e('Check plugin/theme conflict', 'nggallery'); ?></strong>
|
314 |
-
<p class="default message"><?php _e('Not tested', 'nggallery'); ?></p>
|
315 |
-
<p class="success message" style="display: none;"><?php _e('No conflict could be detected', 'nggallery'); ?></p>
|
316 |
-
<p class="failed message" style="display: none;"><?php _e('Test failed, disable other plugins & switch to default theme', 'nggallery'); ?></p>
|
317 |
-
</li>
|
318 |
-
<li id="check2">
|
319 |
-
<strong><?php _e('Test image function', 'nggallery'); ?></strong>
|
320 |
-
<p class="default message"><?php _e('Not tested', 'nggallery'); ?></p>
|
321 |
-
<p class="success message" style="display: none;"><?php _e('The plugin could create images', 'nggallery'); ?></p>
|
322 |
-
<p class="failed message" style="display: none;"><?php _e('Couldn\'t create image, check your memory limit', 'nggallery'); ?></p>
|
323 |
-
</li>
|
324 |
-
<li id="check3">
|
325 |
-
<strong><?php _e('Check theme compatibility', 'nggallery'); ?></strong>
|
326 |
-
<p class="default message"><?php _e('Not tested', 'nggallery'); ?></p>
|
327 |
-
<p class="success message" style="display: none;"><?php _e('Your theme should work fine with NextGEN Gallery', 'nggallery'); ?></p>
|
328 |
-
<p class="failed message" style="display: none;"><?php _e('wp_head()/wp_footer() is missing, contact the theme author', 'nggallery'); ?></p>
|
329 |
-
</li>
|
330 |
-
</ul>
|
331 |
-
<p class="textright">
|
332 |
-
<input type="button" name="update" value="<?php _e('Check plugin', 'nggallery'); ?>" onclick="nggPluginCheck.run(1);" class="button-secondary" />
|
333 |
-
</p>
|
334 |
-
</div>
|
335 |
-
</div>
|
336 |
-
</div>
|
337 |
-
<?php
|
338 |
-
}
|
339 |
-
|
340 |
/**
|
341 |
* Show the server settings in a dashboard widget
|
342 |
*
|
@@ -782,82 +581,6 @@ function ngg_get_phpinfo() {
|
|
782 |
return $phpinfo;
|
783 |
}
|
784 |
|
785 |
-
/**
|
786 |
-
* Show NextGEN Gallery related plugins. Fetch plugins from wp.org which have added 'nextgen-gallery' as tag in readme.txt
|
787 |
-
*
|
788 |
-
* @return postbox output
|
789 |
-
*/
|
790 |
-
function ngg_widget_related_plugins() {
|
791 |
-
echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
|
792 |
-
}
|
793 |
-
function ngg_related_plugins() {
|
794 |
-
include(ABSPATH . 'wp-admin/includes/plugin-install.php');
|
795 |
-
|
796 |
-
if ( false === ( $api = get_transient( 'ngg_related_plugins' ) ) ) {
|
797 |
-
// this api sucks , tags will not be used in the correct way : nextgen-gallery cannot be searched
|
798 |
-
$api = plugins_api('query_plugins', array('search' => 'nextgen') );
|
799 |
-
|
800 |
-
if ( is_wp_error($api) )
|
801 |
-
return;
|
802 |
-
|
803 |
-
set_transient( 'ngg_related_plugins', $api, 60*60*24 );
|
804 |
-
}
|
805 |
-
|
806 |
-
echo '<div style="margin-bottom:10px;padding:8px;font-size:110%;background:#eebbaa;"><b>Note</b>: these plugins are provided by third parties and are <b>NOT</b> supported by Photocrati Media in any way</div>';
|
807 |
-
|
808 |
-
// don't show my own plugin :-) and some other plugins, which come up with the search result
|
809 |
-
$blacklist = array(
|
810 |
-
'nextgen-gallery',
|
811 |
-
'galleria-wp',
|
812 |
-
'photosmash-galleries',
|
813 |
-
'flash-album-gallery',
|
814 |
-
'events-calendar',
|
815 |
-
'widgets',
|
816 |
-
'side-content',
|
817 |
-
'featurific-for-wordpress',
|
818 |
-
'smooth-gallery-replacement',
|
819 |
-
'livesig',
|
820 |
-
'wordpress-gallery-slideshow',
|
821 |
-
'nkmimagefield',
|
822 |
-
'nextgen-ajax',
|
823 |
-
'projectmanager'
|
824 |
-
);
|
825 |
-
|
826 |
-
$i = 0;
|
827 |
-
while ( $i < 4 ) {
|
828 |
-
|
829 |
-
// pick them randomly
|
830 |
-
if ( 0 == count($api->plugins) )
|
831 |
-
return;
|
832 |
-
|
833 |
-
$key = array_rand($api->plugins);
|
834 |
-
$plugin = $api->plugins[$key];
|
835 |
-
|
836 |
-
// don't forget to remove them
|
837 |
-
unset($api->plugins[$key]);
|
838 |
-
|
839 |
-
if ( !isset($plugin->name) )
|
840 |
-
continue;
|
841 |
-
|
842 |
-
if ( in_array($plugin->slug , $blacklist ) )
|
843 |
-
continue;
|
844 |
-
|
845 |
-
$link = esc_url( $plugin->homepage );
|
846 |
-
$title = esc_html( $plugin->name );
|
847 |
-
|
848 |
-
$description = esc_html( strip_tags(@html_entity_decode($plugin->short_description, ENT_QUOTES, get_option('blog_charset'))) );
|
849 |
-
|
850 |
-
$ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin->slug, 'install-plugin_' . $plugin->slug) .
|
851 |
-
'&TB_iframe=true&width=600&height=800';
|
852 |
-
|
853 |
-
echo "<h5><a href='{$link}' target='_blank'>{$title}</a></h5> <span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n";
|
854 |
-
echo "<p>$description<strong> " . __( 'Author' ) . " : </strong>$plugin->author</p>\n";
|
855 |
-
|
856 |
-
$i++;
|
857 |
-
}
|
858 |
-
|
859 |
-
}
|
860 |
-
|
861 |
function ngg_list_contributors() {
|
862 |
/* The list of my contributors. Thanks to all of them !*/
|
863 |
|
90 |
add_meta_box('ngg_about_meta_box', __('About', 'nggallery'), 'ngg_AboutMetaBox', 'ngg_overview', 'left', 'core');
|
91 |
//add_meta_box('ngg_lastdonators', __('Recent donators', 'nggallery'), 'ngg_widget_overview_donators', 'ngg_overview', 'right', 'core');
|
92 |
if ( !is_multisite() || is_super_admin() ) {
|
|
|
93 |
add_meta_box('ngg_server', __('Server Settings', 'nggallery'), 'ngg_overview_server', 'ngg_overview', 'right', 'core');
|
|
|
94 |
}
|
95 |
|
96 |
function ngg_AboutMetaBox()
|
110 |
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/');
|
111 |
echo '</p><ul>';
|
112 |
|
113 |
+
$url = 'http://wordpress.org/plugins/nextgen-gallery/' ;
|
114 |
+
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'>";
|
115 |
+
_e('Please click "Works" on WordPress.org', 'nggallery');
|
116 |
+
echo "</a></li>";
|
117 |
+
|
118 |
+
$url = 'http://wordpress.org/plugins/nextgen-gallery/' ;
|
119 |
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'>";
|
120 |
_e('Give it a good rating on WordPress.org', 'nggallery');
|
121 |
echo "</a></li>";
|
136 |
<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>';
|
137 |
}
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
/**
|
140 |
* Show the server settings in a dashboard widget
|
141 |
*
|
581 |
return $phpinfo;
|
582 |
}
|
583 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
function ngg_list_contributors() {
|
585 |
/* The list of my contributors. Thanks to all of them !*/
|
586 |
|
products/photocrati_nextgen/modules/ngglegacy/lib/meta.php
CHANGED
@@ -129,6 +129,8 @@ class nggMeta{
|
|
129 |
$meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeDigitized']));
|
130 |
else if (!empty($exif['DateTimeOriginal']))
|
131 |
$meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeOriginal']));
|
|
|
|
|
132 |
if (!empty($exif['FocalLength']))
|
133 |
$meta['focal_length'] = $this->exif_frac2dec( $exif['FocalLength'] ) . __(' mm','nggallery');
|
134 |
if (!empty($exif['ISOSpeedRatings']))
|
@@ -498,25 +500,37 @@ class nggMeta{
|
|
498 |
*/
|
499 |
function get_date_time() {
|
500 |
|
501 |
-
|
502 |
|
503 |
-
|
504 |
-
|
|
|
|
|
505 |
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
517 |
|
518 |
// Return the MySQL format
|
519 |
-
$date_time = date( 'Y-m-d H:i:s', $
|
520 |
|
521 |
return $date_time;
|
522 |
}
|
129 |
$meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeDigitized']));
|
130 |
else if (!empty($exif['DateTimeOriginal']))
|
131 |
$meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeOriginal']));
|
132 |
+
else if (!empty($exif['FileDateTime']))
|
133 |
+
$meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['FileDateTime']));
|
134 |
if (!empty($exif['FocalLength']))
|
135 |
$meta['focal_length'] = $this->exif_frac2dec( $exif['FocalLength'] ) . __(' mm','nggallery');
|
136 |
if (!empty($exif['ISOSpeedRatings']))
|
500 |
*/
|
501 |
function get_date_time() {
|
502 |
|
503 |
+
$date = time();
|
504 |
|
505 |
+
// Try XMP first
|
506 |
+
if (isset($this->xmp_array['created_timestamp'])) {
|
507 |
+
$date = @strtotime($this->xmp_array['created_timestamp']);
|
508 |
+
}
|
509 |
|
510 |
+
// Then EXIF
|
511 |
+
else if (isset($this->exif_array['created_timestamp'])) {
|
512 |
+
$date = @strtotime($this->exif_array['created_timestamp']);
|
513 |
+
}
|
514 |
+
|
515 |
+
// Then IPTC
|
516 |
+
else if (isset($this->iptc_array['created_date'])) {
|
517 |
+
$date = $this->iptc_array['created_date'];
|
518 |
+
if (isset($this->iptc_array['created_time'])) {
|
519 |
+
$date .= " {$this->iptc_array['created_time']}";
|
520 |
+
}
|
521 |
+
$date = @strtotime($date);
|
522 |
+
}
|
523 |
+
|
524 |
+
// If all else fails, use the file creation time
|
525 |
+
else if ($this->image->imagePath) {
|
526 |
+
$date = @filectime($this->image->imagePath);
|
527 |
+
}
|
528 |
+
|
529 |
+
// Failback
|
530 |
+
if (!$date) $date = time();
|
531 |
|
532 |
// Return the MySQL format
|
533 |
+
$date_time = date( 'Y-m-d H:i:s', $date);
|
534 |
|
535 |
return $date_time;
|
536 |
}
|
products/photocrati_nextgen/modules/ngglegacy/lib/xmlrpc.php
CHANGED
@@ -172,6 +172,7 @@ class nggXMLRPC{
|
|
172 |
//clean filename and extract extension
|
173 |
$filepart = nggGallery::fileinfo( $name );
|
174 |
$name = $filepart['basename'];
|
|
|
175 |
|
176 |
// check for allowed extension and if it's an image file
|
177 |
$ext = array('jpg', 'png', 'gif');
|
@@ -209,9 +210,12 @@ class nggXMLRPC{
|
|
209 |
logIO('O', '(NGG) ' . $errorString);
|
210 |
return new IXR_Error(500, $errorString);
|
211 |
}
|
|
|
|
|
|
|
212 |
|
213 |
// this is the dir to the gallery
|
214 |
-
$path = WINABSPATH . $
|
215 |
|
216 |
// check if the filename already exist, if not add a counter index
|
217 |
$filename = wp_unique_filename( $path, $name );
|
172 |
//clean filename and extract extension
|
173 |
$filepart = nggGallery::fileinfo( $name );
|
174 |
$name = $filepart['basename'];
|
175 |
+
$gallery_path = $gallery->path;
|
176 |
|
177 |
// check for allowed extension and if it's an image file
|
178 |
$ext = array('jpg', 'png', 'gif');
|
210 |
logIO('O', '(NGG) ' . $errorString);
|
211 |
return new IXR_Error(500, $errorString);
|
212 |
}
|
213 |
+
|
214 |
+
if (!empty($gallery->path))
|
215 |
+
$gallery_path = $gallery->path;
|
216 |
|
217 |
// this is the dir to the gallery
|
218 |
+
$path = WINABSPATH . $gallery_path;
|
219 |
|
220 |
// check if the filename already exist, if not add a counter index
|
221 |
$filename = wp_unique_filename( $path, $name );
|
products/photocrati_nextgen/product.photocrati_nextgen.php
CHANGED
@@ -50,9 +50,9 @@ class P_Photocrati_NextGen extends C_Base_Product
|
|
50 |
{
|
51 |
parent::define(
|
52 |
'photocrati-nextgen',
|
53 |
-
'Photocrati
|
54 |
-
'Photocrati
|
55 |
-
'2.0.
|
56 |
'http://www.nextgen-gallery.com',
|
57 |
'Photocrati Media',
|
58 |
'http://www.photocrati.com'
|
50 |
{
|
51 |
parent::define(
|
52 |
'photocrati-nextgen',
|
53 |
+
'Photocrati NextGEN',
|
54 |
+
'Photocrati NextGEN',
|
55 |
+
'2.0.30',
|
56 |
'http://www.nextgen-gallery.com',
|
57 |
'Photocrati Media',
|
58 |
'http://www.photocrati.com'
|
readme.txt
CHANGED
@@ -119,6 +119,10 @@ For more information, feel free to visit the official website for the NextGEN Ga
|
|
119 |
== Frequently Asked Questions ==
|
120 |
|
121 |
|
|
|
|
|
|
|
|
|
122 |
= Do you have documentation or tutorials? =
|
123 |
|
124 |
Yes. See <a href="http://www.nextgen-gallery.com/help/" target="_blank">NextGEN Gallery Documentation</a>.
|
@@ -195,6 +199,22 @@ For more information, feel free to visit the official website for the NextGEN Ga
|
|
195 |
|
196 |
== Changelog ==
|
197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
= V2.0.27 - 09.18.2013 =
|
199 |
* Fixed: Reduce performance impact of purging displayed gallery transients
|
200 |
|
119 |
== Frequently Asked Questions ==
|
120 |
|
121 |
|
122 |
+
= Why are my galleries not opening up in a lightbox after I move my site? =
|
123 |
+
|
124 |
+
This is often due to the URL paths to the CSS and JavaScript files used by the Lightbox Effects not being changed to relevant addresses based on the new site. This article will help sort out this issue if that is the case: <a href="http://www.nextgen-gallery.com/galleries-opening-lightbox/" target="_blank">Why are my galleries not opening up in a lightbox?</a>.
|
125 |
+
|
126 |
= Do you have documentation or tutorials? =
|
127 |
|
128 |
Yes. See <a href="http://www.nextgen-gallery.com/help/" target="_blank">NextGEN Gallery Documentation</a>.
|
199 |
|
200 |
== Changelog ==
|
201 |
|
202 |
+
= V2.0.30 - 09.25.2013 =
|
203 |
+
* NEW: Restored the ability to use imagebrowser display type instead of a lightbox effect
|
204 |
+
* Changed: Displayed galleries are no longer rendered in RSS feeds
|
205 |
+
* Changed: Removed "Plugin Check" widget from overview page
|
206 |
+
* Fixed: Silence PHP warnings/errors in an output buffer for AJAX actions
|
207 |
+
* Fixed: Compatibility issue with WordPress SEO and broken site maps (and large error_logs)
|
208 |
+
* Fixed: Compatibility issue with AJAX Event Calendar (and possibly others)
|
209 |
+
* Fixed: Adjusted Photocrati Resource Manager to be third-party friendly
|
210 |
+
* Fixed: Fixed empty result set for displayed galleries selecting 'All' tags
|
211 |
+
* Fixed: URL generation for imagebrowser pagination links
|
212 |
+
* Fixed: Ensure that image meta is imported on creation
|
213 |
+
* Fixed: Ensure that transients are removed when an external object cache is used
|
214 |
+
* Fixed: Don't load pluggable.php. This will fix plugin conflicts
|
215 |
+
* Fixed: In Attach to Post interface, galleries created in one tab weren't showing in another
|
216 |
+
* Fixed: Don't output frame events cookie for XML-RPC requests
|
217 |
+
|
218 |
= V2.0.27 - 09.18.2013 =
|
219 |
* Fixed: Reduce performance impact of purging displayed gallery transients
|
220 |
|