Version Description
- 10.21.2013 =
- NEW: Requests /ngg_tag/[tagname] will create a displayed gallery
- NEW: Option added to "Import Gallery" tab to use original images
- Fixed: Links are broken on the ngg_tags-sitemap.xml file by WordPress SEO
- Fixed: PHP notice: Attempt to assign property of non-object
- Fixed: Undefined property warnings when using NextGEN Basic Thumbnails
- Fixed: Detect if an applying a transient to a displayed gallery was successful
- Fixed: Compatibility issues with BJ-Lazy-Load and Colorbox
- Fixed: Pagination conflicts for multiple Imagebrowsers on the same page
- Fixed: Ability to display previous exception with debug mode
- Fixed: Tagclouds not working in multisite instances
- Fixed: Load widgets.css when a widget is being used
- Fixed: Installer should remove all instances of the component factory
- Fixed: Widget settings interface not intuitive
- Fixed: Inability to upload images in some Windows host environments
- Fixed: Sorting images/galleries using the Attach To Post interface
- Fixed: Fix detection of HTTPS (pull request by Leonhardt Wille)
- Fixed: Compilation errors of regular expressions
- Fixed: Pro galleries wouldn't display in environments using PHP 5.3.3 or less
- Fixed: Scanning of router slug is now limited to the uri, not the url
- Fixed: Show slideshow link isn't required for thumbnail/imagebrowser integration
- Fixed: WordPress media-upload with 'singlepic' image size
- Fixed: Use target=_blank when the link setting is provided for NextGEN Basic Singlepic
- Fixed: Only display rendering errors if WP_DEBUG is enabled
Download this release
Release Info
Developer | photocrati |
Plugin | NextGEN Gallery – WordPress Gallery Plugin |
Version | 2.0.33 |
Comparing to | |
See all releases |
Code changes from version 2.0.31 to 2.0.33
- changelog.txt +26 -0
- nggallery.php +8 -4
- non_pope/class.photocrati_installer.php +6 -0
- products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php +1 -1
- products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php +16 -1
- products/photocrati_nextgen/modules/datamapper/module.datamapper.php +2 -2
- products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php +1 -1
- products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php +4 -2
- products/photocrati_nextgen/modules/fs/class.fs.php +1 -0
- products/photocrati_nextgen/modules/fs/module.fs.php +1 -1
- products/photocrati_nextgen/modules/lightbox/module.lightbox.php +1 -1
- products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php +2 -1
- products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php +4 -2
- products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_compact_album_form.php +23 -1
- products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_settings.js +7 -0
- products/photocrati_nextgen/modules/nextgen_basic_gallery/hook.nextgen_basic_gallery_integration.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_controller.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_controller.php +34 -4
- products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic.php +1 -0
- products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.taxonomy_controller.php +117 -0
- products/photocrati_nextgen/modules/nextgen_basic_tagcloud/interface.taxonomy_controller.php +8 -0
- products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php +16 -2
- products/photocrati_nextgen/modules/nextgen_basic_templates/adapter.nextgen_basic_template_form.php +2 -0
- products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php +1 -1
- products/photocrati_nextgen/modules/nextgen_data/class.album_mapper.php +4 -1
- products/photocrati_nextgen/modules/nextgen_data/class.gallery.php +8 -1
- products/photocrati_nextgen/modules/nextgen_data/class.gallery_mapper.php +18 -0
- products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php +103 -16
- products/photocrati_nextgen/modules/nextgen_data/class.image_mapper.php +18 -0
- products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php +4 -3
- products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php +1 -1
- products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php +12 -4
- products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_renderer.php +6 -1
- products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php +1 -1
- products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js +24 -27
- products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php +1 -1
- products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php +602 -0
- products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php +20 -6
- products/photocrati_nextgen/modules/ngglegacy/changelog.txt +0 -718
- products/photocrati_nextgen/modules/ngglegacy/lib/xmlrpc.php +0 -886
- products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php +1 -1
- products/photocrati_nextgen/modules/ngglegacy/nggallery.php +0 -4
- products/photocrati_nextgen/modules/ngglegacy/view/singlepic.php +8 -3
- products/photocrati_nextgen/modules/router/class.router.php +3 -3
- products/photocrati_nextgen/modules/router/class.routing_app.php +3 -4
- products/photocrati_nextgen/modules/router/module.router.php +1 -1
- products/photocrati_nextgen/modules/security/class.wordpress_security_actor.php +13 -0
- products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php +117 -0
- products/photocrati_nextgen/modules/widget/class.widget.php +1 -1
- products/photocrati_nextgen/modules/widget/class.widget_gallery.php +26 -0
- products/photocrati_nextgen/modules/widget/module.widget.php +1 -1
- products/photocrati_nextgen/product.photocrati_nextgen.php +4 -2
- readme.txt +25 -0
changelog.txt
CHANGED
@@ -1,6 +1,32 @@
|
|
1 |
NextGEN Gallery
|
2 |
by Photocrati Media
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
= V2.0.31 - 10.03.2013 =
|
5 |
* NEW: Restored AJAX pagination for NextGEN Basic ImageBrowser display type
|
6 |
* Fixed: Compatibility with WordPress Local SEO by Yoast
|
1 |
NextGEN Gallery
|
2 |
by Photocrati Media
|
3 |
|
4 |
+
= V2.0.33 - 10.21.2013 =
|
5 |
+
* NEW: Requests /ngg_tag/[tagname] will create a displayed gallery
|
6 |
+
* NEW: Option added to "Import Gallery" tab to use original images
|
7 |
+
* Fixed: Links are broken on the ngg_tags-sitemap.xml file by WordPress SEO
|
8 |
+
* Fixed: PHP notice: Attempt to assign property of non-object
|
9 |
+
* Fixed: Undefined property warnings when using NextGEN Basic Thumbnails
|
10 |
+
* Fixed: Detect if an applying a transient to a displayed gallery was successful
|
11 |
+
* Fixed: Compatibility issues with BJ-Lazy-Load and Colorbox
|
12 |
+
* Fixed: Pagination conflicts for multiple Imagebrowsers on the same page
|
13 |
+
* Fixed: Ability to display previous exception with debug mode
|
14 |
+
* Fixed: Tagclouds not working in multisite instances
|
15 |
+
* Fixed: Load widgets.css when a widget is being used
|
16 |
+
* Fixed: Installer should remove all instances of the component factory
|
17 |
+
* Fixed: Widget settings interface not intuitive
|
18 |
+
* Fixed: Inability to upload images in some Windows host environments
|
19 |
+
* Fixed: Sorting images/galleries using the Attach To Post interface
|
20 |
+
* Fixed: Fix detection of HTTPS (pull request by Leonhardt Wille)
|
21 |
+
* Fixed: Compilation errors of regular expressions
|
22 |
+
* Fixed: Pro galleries wouldn't display in environments using PHP 5.3.3 or less
|
23 |
+
* Fixed: Scanning of router slug is now limited to the uri, not the url
|
24 |
+
* Fixed: Show slideshow link isn't required for thumbnail/imagebrowser integration
|
25 |
+
* Fixed: WordPress media-upload with 'singlepic' image size
|
26 |
+
* Fixed: Use target=_blank when the link setting is provided for NextGEN Basic Singlepic
|
27 |
+
* Fixed: Only display rendering errors if WP_DEBUG is enabled
|
28 |
+
|
29 |
+
|
30 |
= V2.0.31 - 10.03.2013 =
|
31 |
* NEW: Restored AJAX pagination for NextGEN Basic ImageBrowser display type
|
32 |
* Fixed: Compatibility with WordPress Local SEO by Yoast
|
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
|
@@ -57,8 +57,10 @@ class C_NextGEN_Bootstrap
|
|
57 |
echo "<p>On line <strong>{$exception->getLine()}</strong> of <strong>{$exception->getFile()}</strong></p>";
|
58 |
echo "<h3>Trace:</h3>";
|
59 |
echo "<pre>{$exception->getTraceAsString()}</pre>";
|
60 |
-
|
61 |
-
|
|
|
|
|
62 |
}
|
63 |
}
|
64 |
}
|
@@ -279,6 +281,8 @@ class C_NextGEN_Bootstrap
|
|
279 |
function update()
|
280 |
{
|
281 |
$this->_load_pope();
|
|
|
|
|
282 |
C_Photocrati_Installer::update();
|
283 |
}
|
284 |
|
@@ -329,7 +333,7 @@ class C_NextGEN_Bootstrap
|
|
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.
|
333 |
}
|
334 |
|
335 |
|
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.33
|
8 |
* Author: Photocrati Media
|
9 |
* Plugin URI: http://www.nextgen-gallery.com
|
10 |
* Author URI: http://www.photocrati.com
|
57 |
echo "<p>On line <strong>{$exception->getLine()}</strong> of <strong>{$exception->getFile()}</strong></p>";
|
58 |
echo "<h3>Trace:</h3>";
|
59 |
echo "<pre>{$exception->getTraceAsString()}</pre>";
|
60 |
+
if (method_exists($exception, 'getPrevious')) {
|
61 |
+
if (($previous = $exception->getPrevious())) {
|
62 |
+
self::print_exception($previous);
|
63 |
+
}
|
64 |
}
|
65 |
}
|
66 |
}
|
281 |
function update()
|
282 |
{
|
283 |
$this->_load_pope();
|
284 |
+
|
285 |
+
// Try updating all modules
|
286 |
C_Photocrati_Installer::update();
|
287 |
}
|
288 |
|
333 |
define('NEXTGEN_GALLERY_MODULE_URL', path_join(NEXTGEN_GALLERY_PRODUCT_URL, 'photocrati_nextgen/modules'));
|
334 |
define('NEXTGEN_GALLERY_PLUGIN_CLASS', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'module.NEXTGEN_GALLERY_PLUGIN.php'));
|
335 |
define('NEXTGEN_GALLERY_PLUGIN_STARTED_AT', microtime());
|
336 |
+
define('NEXTGEN_GALLERY_PLUGIN_VERSION', '2.0.33');
|
337 |
}
|
338 |
|
339 |
|
non_pope/class.photocrati_installer.php
CHANGED
@@ -111,6 +111,12 @@ if (!class_exists('C_Photocrati_Installer'))
|
|
111 |
update_option('photocrati_auto_update_admin_update_list', null);
|
112 |
update_option('photocrati_auto_update_admin_check_date', '');
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
foreach ($modules as $module_name) {
|
115 |
if (($handler = self::get_handler_instance(array_shift(explode('|', $module_name))))) {
|
116 |
if (method_exists($handler, 'install'))
|
111 |
update_option('photocrati_auto_update_admin_update_list', null);
|
112 |
update_option('photocrati_auto_update_admin_check_date', '');
|
113 |
|
114 |
+
// Other Pope applications might be loaded, and therefore
|
115 |
+
// all singletons should be destroyed, so that they can be
|
116 |
+
// adapted as necessary. For now, we'll just assume that the factory
|
117 |
+
// is the only singleton that will be used by other Pope applications
|
118 |
+
C_Component_Factory::$_instances = array();
|
119 |
+
|
120 |
foreach ($modules as $module_name) {
|
121 |
if (($handler = self::get_handler_instance(array_shift(explode('|', $module_name))))) {
|
122 |
if (method_exists($handler, 'install'))
|
products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php
CHANGED
@@ -23,7 +23,7 @@ class M_Attach_To_Post extends C_Base_Module
|
|
23 |
'photocrati-attach_to_post',
|
24 |
'Attach To Post',
|
25 |
'Provides the "Attach to Post" interface for displaying galleries and albums',
|
26 |
-
'0.
|
27 |
'http://www.nextgen-gallery.com',
|
28 |
'Photocrati Media',
|
29 |
'http://www.photocrati.com',
|
23 |
'photocrati-attach_to_post',
|
24 |
'Attach To Post',
|
25 |
'Provides the "Attach to Post" interface for displaying galleries and albums',
|
26 |
+
'0.7',
|
27 |
'http://www.nextgen-gallery.com',
|
28 |
'Photocrati Media',
|
29 |
'http://www.photocrati.com',
|
products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php
CHANGED
@@ -1038,6 +1038,7 @@ jQuery(function($){
|
|
1038 |
|
1039 |
fill_image_sortorder_options: function(){
|
1040 |
this.sortorder_options.reset();
|
|
|
1041 |
this.sortorder_options.push(this.create_sortorder_option('sortorder', 'Custom'));
|
1042 |
this.sortorder_options.push(this.create_sortorder_option(Ngg.DisplayTab.instance.image_key, 'Image ID'));
|
1043 |
this.sortorder_options.push(this.create_sortorder_option('filename', 'Filename'));
|
@@ -1047,6 +1048,7 @@ jQuery(function($){
|
|
1047 |
|
1048 |
fill_gallery_sortorder_options: function(){
|
1049 |
this.sortorder_options.reset();
|
|
|
1050 |
this.sortorder_options.push(this.create_sortorder_option('sortorder' ,'Custom'));
|
1051 |
this.sortorder_options.push(this.create_sortorder_option('name', 'Name'));
|
1052 |
this.sortorder_options.push(this.create_sortorder_option('galdesc', 'Description'));
|
@@ -1056,7 +1058,19 @@ jQuery(function($){
|
|
1056 |
this.sortorder_options.each(function(item){
|
1057 |
item.set('selected', model.get('value') == item.get('value') ? true : false, {silent: true});
|
1058 |
});
|
1059 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1060 |
this.entities.reset();
|
1061 |
this.$el.find('a.sortorder').each(function(){
|
1062 |
var $item = $(this);
|
@@ -1068,6 +1082,7 @@ jQuery(function($){
|
|
1068 |
},
|
1069 |
|
1070 |
sortdirection_changed: function(model){
|
|
|
1071 |
this.sortdirection_options.each(function(item){
|
1072 |
item.set('selected', model.get('value') == item.get('value') ? true : false, {silent: true});
|
1073 |
});
|
1038 |
|
1039 |
fill_image_sortorder_options: function(){
|
1040 |
this.sortorder_options.reset();
|
1041 |
+
this.sortorder_options.push(this.create_sortorder_option('', 'None'));
|
1042 |
this.sortorder_options.push(this.create_sortorder_option('sortorder', 'Custom'));
|
1043 |
this.sortorder_options.push(this.create_sortorder_option(Ngg.DisplayTab.instance.image_key, 'Image ID'));
|
1044 |
this.sortorder_options.push(this.create_sortorder_option('filename', 'Filename'));
|
1048 |
|
1049 |
fill_gallery_sortorder_options: function(){
|
1050 |
this.sortorder_options.reset();
|
1051 |
+
this.sortorder_options.push(this.create_sortorder_option('', 'None'));
|
1052 |
this.sortorder_options.push(this.create_sortorder_option('sortorder' ,'Custom'));
|
1053 |
this.sortorder_options.push(this.create_sortorder_option('name', 'Name'));
|
1054 |
this.sortorder_options.push(this.create_sortorder_option('galdesc', 'Description'));
|
1058 |
this.sortorder_options.each(function(item){
|
1059 |
item.set('selected', model.get('value') == item.get('value') ? true : false, {silent: true});
|
1060 |
});
|
1061 |
+
|
1062 |
+
this.displayed_gallery.set('sortorder', []);
|
1063 |
+
|
1064 |
+
var sort_by = model.get('value');
|
1065 |
+
|
1066 |
+
// If "None" was selected, then clear the "sortorder" property
|
1067 |
+
if (model.get('value').length == 0) {
|
1068 |
+
sort_by = 'sortorder';
|
1069 |
+
}
|
1070 |
+
|
1071 |
+
// Change the "sort by" parameter
|
1072 |
+
this.displayed_gallery.set('order_by', sort_by);
|
1073 |
+
|
1074 |
this.entities.reset();
|
1075 |
this.$el.find('a.sortorder').each(function(){
|
1076 |
var $item = $(this);
|
1082 |
},
|
1083 |
|
1084 |
sortdirection_changed: function(model){
|
1085 |
+
|
1086 |
this.sortdirection_options.each(function(item){
|
1087 |
item.set('selected', model.get('value') == item.get('value') ? true : false, {silent: true});
|
1088 |
});
|
products/photocrati_nextgen/modules/datamapper/module.datamapper.php
CHANGED
@@ -14,7 +14,7 @@ class M_DataMapper extends C_Base_Module
|
|
14 |
'photocrati-datamapper',
|
15 |
'DataMapper',
|
16 |
'Provides a database abstraction layer following the DataMapper pattern',
|
17 |
-
'0.
|
18 |
'http://www.photocrati.com',
|
19 |
'Photocrati Media',
|
20 |
'http://www.photocrati.com'
|
@@ -194,7 +194,7 @@ class M_DataMapper extends C_Base_Module
|
|
194 |
return array(
|
195 |
'A_Datamapper_Factory' => 'adapter.datamapper_factory.php',
|
196 |
'C_Datamapper_Installer' => 'class.datamapper_installer.php',
|
197 |
-
'C_Datamapper'
|
198 |
'C_Custompost_Datamapper_Driver' => 'class.custompost_datamapper_driver.php',
|
199 |
'C_Customtable_Datamapper_Driver' => 'class.customtable_datamapper_driver.php',
|
200 |
'C_Datamapper_Driver_Base' => 'class.datamapper_driver_base.php',
|
14 |
'photocrati-datamapper',
|
15 |
'DataMapper',
|
16 |
'Provides a database abstraction layer following the DataMapper pattern',
|
17 |
+
'0.3',
|
18 |
'http://www.photocrati.com',
|
19 |
'Photocrati Media',
|
20 |
'http://www.photocrati.com'
|
194 |
return array(
|
195 |
'A_Datamapper_Factory' => 'adapter.datamapper_factory.php',
|
196 |
'C_Datamapper_Installer' => 'class.datamapper_installer.php',
|
197 |
+
'C_Datamapper' => 'class.datamapper.php',
|
198 |
'C_Custompost_Datamapper_Driver' => 'class.custompost_datamapper_driver.php',
|
199 |
'C_Customtable_Datamapper_Driver' => 'class.customtable_datamapper_driver.php',
|
200 |
'C_Datamapper_Driver_Base' => 'class.datamapper_driver_base.php',
|
products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php
CHANGED
@@ -13,7 +13,7 @@ class M_Dynamic_Thumbnails extends C_Base_Module
|
|
13 |
'photocrati-dynamic_thumbnails',
|
14 |
'Dynamic Thumbnails',
|
15 |
'Adds support for dynamic thumbnails',
|
16 |
-
'0.
|
17 |
'http://www.nextgen-gallery.com',
|
18 |
'Photocrati Media',
|
19 |
'http://www.photocrati.com'
|
13 |
'photocrati-dynamic_thumbnails',
|
14 |
'Dynamic Thumbnails',
|
15 |
'Adds support for dynamic thumbnails',
|
16 |
+
'0.3',
|
17 |
'http://www.nextgen-gallery.com',
|
18 |
'Photocrati Media',
|
19 |
'http://www.photocrati.com'
|
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('init', array(
|
39 |
|
40 |
}
|
41 |
|
@@ -48,7 +48,9 @@ class M_Frame_Communication extends C_Base_Module
|
|
48 |
$router->get_static_url('photocrati-frame_communication#frame_event_publisher.js'),
|
49 |
array('jquery')
|
50 |
);
|
51 |
-
|
|
|
|
|
52 |
}
|
53 |
|
54 |
function get_type_list()
|
35 |
|
36 |
function _register_hooks()
|
37 |
{
|
38 |
+
add_action('init', array($this, 'enqueue_admin_scripts'));
|
39 |
|
40 |
}
|
41 |
|
48 |
$router->get_static_url('photocrati-frame_communication#frame_event_publisher.js'),
|
49 |
array('jquery')
|
50 |
);
|
51 |
+
|
52 |
+
if (is_admin())
|
53 |
+
wp_enqueue_script('frame_event_publisher');
|
54 |
}
|
55 |
|
56 |
function get_type_list()
|
products/photocrati_nextgen/modules/fs/class.fs.php
CHANGED
@@ -290,6 +290,7 @@ class Mixin_Fs_Instance_Methods extends Mixin
|
|
290 |
|
291 |
// determine if each piece should be appended to $retval
|
292 |
foreach ($pieces as $ndx => $val) {
|
|
|
293 |
$one = array_search($val, $retval);
|
294 |
$two = array_search($val, $pieces);
|
295 |
$one = (FALSE === $one ? 0 : count($one) + 1);
|
290 |
|
291 |
// determine if each piece should be appended to $retval
|
292 |
foreach ($pieces as $ndx => $val) {
|
293 |
+
if ($val === '') continue;
|
294 |
$one = array_search($val, $retval);
|
295 |
$two = array_search($val, $pieces);
|
296 |
$one = (FALSE === $one ? 0 : count($one) + 1);
|
products/photocrati_nextgen/modules/fs/module.fs.php
CHANGED
@@ -12,7 +12,7 @@ class M_Fs extends C_Base_Module
|
|
12 |
'photocrati-fs',
|
13 |
'Filesystem',
|
14 |
'Provides a filesystem abstraction layer for Pope modules',
|
15 |
-
'0.
|
16 |
'http://www.photocrati.com',
|
17 |
'Photocrati Media',
|
18 |
'http://www.photocrati.com'
|
12 |
'photocrati-fs',
|
13 |
'Filesystem',
|
14 |
'Provides a filesystem abstraction layer for Pope modules',
|
15 |
+
'0.2',
|
16 |
'http://www.photocrati.com',
|
17 |
'Photocrati Media',
|
18 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/lightbox/module.lightbox.php
CHANGED
@@ -18,7 +18,7 @@ class M_Lightbox extends C_Base_Module
|
|
18 |
'photocrati-lightbox',
|
19 |
'Lightbox',
|
20 |
_("Provides integration with JQuery's lightbox plugin"),
|
21 |
-
'0.
|
22 |
'http://leandrovieira.com/projects/jquery/lightbox/',
|
23 |
'Photocrati Media',
|
24 |
'http://www.photocrati.com'
|
18 |
'photocrati-lightbox',
|
19 |
'Lightbox',
|
20 |
_("Provides integration with JQuery's lightbox plugin"),
|
21 |
+
'0.4',
|
22 |
'http://leandrovieira.com/projects/jquery/lightbox/',
|
23 |
'Photocrati Media',
|
24 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php
CHANGED
@@ -135,7 +135,8 @@ class A_NextGen_AddGallery_Ajax extends Mixin
|
|
135 |
$storage = $this->get_registry()->get_utility('I_Gallery_Storage');
|
136 |
$fs = $this->get_registry()->get_utility('I_Fs');
|
137 |
try {
|
138 |
-
|
|
|
139 |
if (!$retval) $retval = array('error' => "Could not import folder. No images found.");
|
140 |
}
|
141 |
catch (Exception $ex) {
|
135 |
$storage = $this->get_registry()->get_utility('I_Gallery_Storage');
|
136 |
$fs = $this->get_registry()->get_utility('I_Fs');
|
137 |
try {
|
138 |
+
$keep_files = $this->param('keep_location') == 'on';
|
139 |
+
$retval = $storage->import_gallery_from_fs($fs->join_paths($fs->get_document_root(), 'wp-content', $folder), false, !$keep_files);
|
140 |
if (!$retval) $retval = array('error' => "Could not import folder. No images found.");
|
141 |
}
|
142 |
catch (Exception $ex) {
|
products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
<div id="file_browser">
|
3 |
</div>
|
4 |
<p>
|
|
|
5 |
<input type="button" id="import_button" name="import_folder" value="Import Folder" class="button-primary"/>
|
6 |
</p>
|
7 |
<script type="text/javascript">
|
@@ -43,7 +44,8 @@
|
|
43 |
// Start importing process
|
44 |
var post_params = {
|
45 |
action: 'import_folder',
|
46 |
-
folder: selected_folder
|
|
|
47 |
};
|
48 |
$.post(photocrati_ajax.url, post_params, function(response){
|
49 |
if (typeof(response) != 'object') response = JSON.parse(response);
|
@@ -58,4 +60,4 @@
|
|
58 |
});
|
59 |
})
|
60 |
});
|
61 |
-
</script>
|
2 |
<div id="file_browser">
|
3 |
</div>
|
4 |
<p>
|
5 |
+
<input type="checkbox" id="import_keep_location" name="keep_location" value="on" /> <label for="import_keep_location"> <?php esc_html_e('Keep images in original location.', 'nggallery'); ?> <span style="font-size: 85%"><?php esc_html_e('Caution: If you keep images in the original folder and later delete the gallery, the images in that folder might be deleted depending on your settings.', 'nggallery'); ?></span></label><br/><br/>
|
6 |
<input type="button" id="import_button" name="import_folder" value="Import Folder" class="button-primary"/>
|
7 |
</p>
|
8 |
<script type="text/javascript">
|
44 |
// Start importing process
|
45 |
var post_params = {
|
46 |
action: 'import_folder',
|
47 |
+
folder: selected_folder,
|
48 |
+
keep_location: $('#import_keep_location').is(":checked") ? 'on' : 'off'
|
49 |
};
|
50 |
$.post(photocrati_ajax.url, post_params, function(response){
|
51 |
if (typeof(response) != 'object') response = JSON.parse(response);
|
60 |
});
|
61 |
})
|
62 |
});
|
63 |
+
</script>
|
products/photocrati_nextgen/modules/nextgen_basic_album/adapter.nextgen_basic_compact_album_form.php
CHANGED
@@ -6,4 +6,26 @@ class A_NextGen_Basic_Compact_Album_Form extends Mixin_NextGen_Basic_Album_Form
|
|
6 |
{
|
7 |
return NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM;
|
8 |
}
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
{
|
7 |
return NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM;
|
8 |
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Returns a list of fields to render on the settings page
|
12 |
+
*/
|
13 |
+
function _get_field_names()
|
14 |
+
{
|
15 |
+
$fields = parent::_get_field_names();
|
16 |
+
$fields[] = 'thumbnail_override_settings';
|
17 |
+
return $fields;
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Enqueues static resources required by this form
|
22 |
+
*/
|
23 |
+
function enqueue_static_resources()
|
24 |
+
{
|
25 |
+
wp_enqueue_script(
|
26 |
+
'nextgen_basic_compact_albums_settings_script',
|
27 |
+
$this->object->get_static_url('photocrati-nextgen_basic_album#compact_settings.js'),
|
28 |
+
array('jquery.nextgen_radio_toggle')
|
29 |
+
);
|
30 |
+
}
|
31 |
+
}
|
products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php
CHANGED
@@ -18,7 +18,7 @@ class M_NextGen_Basic_Album extends C_Base_Module
|
|
18 |
'photocrati-nextgen_basic_album',
|
19 |
'NextGEN Basic Album',
|
20 |
"Provides support for NextGEN's Basic Album",
|
21 |
-
'0.
|
22 |
'http://nextgen-gallery.com',
|
23 |
'Photocrati Media',
|
24 |
'http://www.photocrati.com'
|
18 |
'photocrati-nextgen_basic_album',
|
19 |
'NextGEN Basic Album',
|
20 |
"Provides support for NextGEN's Basic Album",
|
21 |
+
'0.4',
|
22 |
'http://nextgen-gallery.com',
|
23 |
'Photocrati Media',
|
24 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_settings.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(function($){
|
2 |
+
$('input[name="photocrati-nextgen_basic_compact_album[override_thumbnail_settings]"]')
|
3 |
+
.nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_compact_album_thumbnail_dimensions'))
|
4 |
+
.nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_compact_album_thumbnail_quality'))
|
5 |
+
.nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_compact_album_thumbnail_crop'))
|
6 |
+
.nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_compact_album_thumbnail_watermark'));
|
7 |
+
});
|
products/photocrati_nextgen/modules/nextgen_basic_gallery/hook.nextgen_basic_gallery_integration.php
CHANGED
@@ -16,7 +16,7 @@ class Hook_NextGen_Basic_Gallery_Integration extends Hook
|
|
16 |
$params = (array)$displayed_gallery->get_entity();
|
17 |
$ds = $params['display_settings'];
|
18 |
|
19 |
-
if ((!empty($ds['show_slideshow_link']) || !empty($ds['show_thumbnail_link']))
|
20 |
&& $show != $this->object->context)
|
21 |
{
|
22 |
// We've got an alternate request. We'll use a different display
|
16 |
$params = (array)$displayed_gallery->get_entity();
|
17 |
$ds = $params['display_settings'];
|
18 |
|
19 |
+
if ((!empty($ds['show_slideshow_link']) || !empty($ds['show_thumbnail_link']) || !empty($ds['use_imagebrowser_effect']))
|
20 |
&& $show != $this->object->context)
|
21 |
{
|
22 |
// We've got an alternate request. We'll use a different display
|
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.6',
|
29 |
'http://www.nextgen-gallery.com',
|
30 |
'Photocrati Media',
|
31 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_controller.php
CHANGED
@@ -123,7 +123,7 @@ class A_NextGen_Basic_ImageBrowser_Controller extends Mixin_NextGen_Basic_Galler
|
|
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-' . $
|
127 |
|
128 |
// try to read EXIF data, but fallback to the db presets
|
129 |
$meta = new C_NextGen_Metadata($picture);
|
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-' . $displayed_gallery->id() . '-' . (get_the_ID() == false ? 0 : get_the_ID());
|
127 |
|
128 |
// try to read EXIF data, but fallback to the db presets
|
129 |
$meta = new C_NextGen_Metadata($picture);
|
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php
CHANGED
@@ -19,7 +19,7 @@ class M_NextGen_Basic_ImageBrowser extends C_Base_Module
|
|
19 |
'photocrati-nextgen_basic_imagebrowser',
|
20 |
'NextGEN Basic ImageBrowser',
|
21 |
'Provides the NextGEN Basic ImageBrowser Display Type',
|
22 |
-
'0.
|
23 |
'http://www.nextgen-gallery.com',
|
24 |
'Photocrati Media',
|
25 |
'http://www.photocrati.com'
|
19 |
'photocrati-nextgen_basic_imagebrowser',
|
20 |
'NextGEN Basic ImageBrowser',
|
21 |
'Provides the NextGEN Basic ImageBrowser Display Type',
|
22 |
+
'0.4',
|
23 |
'http://www.nextgen-gallery.com',
|
24 |
'Photocrati Media',
|
25 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php
CHANGED
@@ -63,7 +63,7 @@
|
|
63 |
<?php $this->end_element(); ?>
|
64 |
<script type='text/javascript'>
|
65 |
jQuery(function($){
|
66 |
-
NggPaginatedGallery
|
67 |
'<?php echo $displayed_gallery->id() ?>',
|
68 |
$('#<?php echo $anchor ?>'),
|
69 |
$('#<?php echo $anchor ?> .ngg-browser-prev, #<?php echo $anchor ?> .ngg-browser-next')
|
63 |
<?php $this->end_element(); ?>
|
64 |
<script type='text/javascript'>
|
65 |
jQuery(function($){
|
66 |
+
new NggPaginatedGallery(
|
67 |
'<?php echo $displayed_gallery->id() ?>',
|
68 |
$('#<?php echo $anchor ?>'),
|
69 |
$('#<?php echo $anchor ?> .ngg-browser-prev, #<?php echo $anchor ?> .ngg-browser-next')
|
products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_controller.php
CHANGED
@@ -32,8 +32,19 @@ class A_NextGen_Basic_Singlepic_Controller extends Mixin
|
|
32 |
break;
|
33 |
}
|
34 |
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
// mode is a legacy parameter
|
39 |
if (!is_array($display_settings['mode']))
|
@@ -88,17 +99,28 @@ class A_NextGen_Basic_Singlepic_Controller extends Mixin
|
|
88 |
$params['image']->container[0]->_cache_overrides['classname'] = 'ngg-singlepic ' . $display_settings['float'];
|
89 |
$params['image']->container[0]->_cache_overrides['imageURL'] = $display_settings['link'];
|
90 |
$params['image']->container[0]->_cache_overrides['thumbnailURL'] = $thumbnail_url;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
-
|
|
|
|
|
|
|
93 |
}
|
94 |
else {
|
95 |
$params = $display_settings;
|
96 |
$params['storage'] = &$storage;
|
97 |
$params['image'] = &$image;
|
98 |
-
$params['effect_code'] = $
|
99 |
$params['inner_content'] = $displayed_gallery->inner_content;
|
100 |
$params['settings'] = $display_settings;
|
101 |
$params['thumbnail_url'] = $thumbnail_url;
|
|
|
102 |
|
103 |
$params = $this->object->prepare_display_parameters($displayed_gallery, $params);
|
104 |
|
@@ -106,6 +128,14 @@ class A_NextGen_Basic_Singlepic_Controller extends Mixin
|
|
106 |
}
|
107 |
}
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
/**
|
110 |
* Enqueues all static resources required by this display type
|
111 |
*
|
32 |
break;
|
33 |
}
|
34 |
|
35 |
+
$params = array();
|
36 |
+
|
37 |
+
if (!empty($display_settings['link']))
|
38 |
+
{
|
39 |
+
$target = '_blank';
|
40 |
+
$effect_code = '';
|
41 |
+
}
|
42 |
+
else {
|
43 |
+
$display_settings['link'] = $storage->get_image_url($image);
|
44 |
+
$target = '_self';
|
45 |
+
$effect_code = $this->object->get_effect_code($displayed_gallery);
|
46 |
+
}
|
47 |
+
$params['target'] = $target;
|
48 |
|
49 |
// mode is a legacy parameter
|
50 |
if (!is_array($display_settings['mode']))
|
99 |
$params['image']->container[0]->_cache_overrides['classname'] = 'ngg-singlepic ' . $display_settings['float'];
|
100 |
$params['image']->container[0]->_cache_overrides['imageURL'] = $display_settings['link'];
|
101 |
$params['image']->container[0]->_cache_overrides['thumbnailURL'] = $thumbnail_url;
|
102 |
+
$params['target'] = $target;
|
103 |
+
|
104 |
+
// if a link is present we temporarily must filter out the effect code
|
105 |
+
if (empty($effect_code))
|
106 |
+
add_filter('ngg_get_thumbcode', array(&$this, 'strip_thumbcode'), 10);
|
107 |
+
|
108 |
+
$retval = $this->object->legacy_render($display_settings['template'], $params, $return, 'singlepic');
|
109 |
|
110 |
+
if (empty($effect_code))
|
111 |
+
remove_filter('ngg_get_thumbcode', array(&$this, 'strip_thumbcode'), 10);
|
112 |
+
|
113 |
+
return $retval;
|
114 |
}
|
115 |
else {
|
116 |
$params = $display_settings;
|
117 |
$params['storage'] = &$storage;
|
118 |
$params['image'] = &$image;
|
119 |
+
$params['effect_code'] = $effect_code;
|
120 |
$params['inner_content'] = $displayed_gallery->inner_content;
|
121 |
$params['settings'] = $display_settings;
|
122 |
$params['thumbnail_url'] = $thumbnail_url;
|
123 |
+
$params['target'] = $target;
|
124 |
|
125 |
$params = $this->object->prepare_display_parameters($displayed_gallery, $params);
|
126 |
|
128 |
}
|
129 |
}
|
130 |
|
131 |
+
/**
|
132 |
+
* Intentionally disable the application of the effect code
|
133 |
+
*/
|
134 |
+
function strip_thumbcode($thumbcode)
|
135 |
+
{
|
136 |
+
return '';
|
137 |
+
}
|
138 |
+
|
139 |
/**
|
140 |
* Enqueues all static resources required by this display type
|
141 |
*
|
products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php
CHANGED
@@ -17,7 +17,7 @@ class M_NextGen_Basic_Singlepic extends C_Base_Module
|
|
17 |
NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME,
|
18 |
'NextGen Basic Singlepic',
|
19 |
'Provides a singlepic gallery for NextGEN Gallery',
|
20 |
-
'0.
|
21 |
'http://www.photocrati.com',
|
22 |
'Photocrati Media',
|
23 |
'http://www.photocrati.com'
|
17 |
NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME,
|
18 |
'NextGen Basic Singlepic',
|
19 |
'Provides a singlepic gallery for NextGEN Gallery',
|
20 |
+
'0.4',
|
21 |
'http://www.photocrati.com',
|
22 |
'Photocrati Media',
|
23 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic.php
CHANGED
@@ -65,6 +65,7 @@
|
|
65 |
<a href="<?php echo esc_attr($settings['link']); ?>"
|
66 |
title="<?php echo esc_attr($image->description)?>"
|
67 |
data-image-id='<?php echo esc_attr($image->pid); ?>'
|
|
|
68 |
<?php echo $effect_code ?>>
|
69 |
<img class="ngg-singlepic"
|
70 |
src="<?php echo $thumbnail_url; ?>"
|
65 |
<a href="<?php echo esc_attr($settings['link']); ?>"
|
66 |
title="<?php echo esc_attr($image->description)?>"
|
67 |
data-image-id='<?php echo esc_attr($image->pid); ?>'
|
68 |
+
target='<?php echo esc_attr($target); ?>'
|
69 |
<?php echo $effect_code ?>>
|
70 |
<img class="ngg-singlepic"
|
71 |
src="<?php echo $thumbnail_url; ?>"
|
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.taxonomy_controller.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class C_Taxonomy_Controller extends C_MVC_Controller
|
4 |
+
{
|
5 |
+
static $_instances = array();
|
6 |
+
protected $ngg_tag_detection_has_run = FALSE;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Returns an instance of this class
|
10 |
+
*
|
11 |
+
* @param string $context
|
12 |
+
* @return C_Taxonomy_Controller
|
13 |
+
*/
|
14 |
+
static function get_instance($context = FALSE)
|
15 |
+
{
|
16 |
+
if (!isset(self::$_instances[$context]))
|
17 |
+
{
|
18 |
+
$klass = get_class();
|
19 |
+
self::$_instances[$context] = new $klass($context);
|
20 |
+
}
|
21 |
+
return self::$_instances[$context];
|
22 |
+
}
|
23 |
+
|
24 |
+
function define($context = FALSE)
|
25 |
+
{
|
26 |
+
parent::define($context);
|
27 |
+
$this->implement('I_Taxonomy_Controller');
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Returns the rendered HTML of a gallery based on the provided tag
|
32 |
+
*
|
33 |
+
* @param string $tag
|
34 |
+
* @return string
|
35 |
+
*/
|
36 |
+
function index_action($tag)
|
37 |
+
{
|
38 |
+
$renderer = $this->object->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
|
39 |
+
$output = $renderer->display_images(array(
|
40 |
+
'source' => 'tags',
|
41 |
+
'container_ids' => $tag,
|
42 |
+
'slug' => $tag,
|
43 |
+
'display_type' => NEXTGEN_GALLERY_BASIC_THUMBNAILS
|
44 |
+
));
|
45 |
+
|
46 |
+
// This strips extra whitespace and strips newlines. For some reason this is especially
|
47 |
+
// necessary on Wordpress taxonomy pages.
|
48 |
+
return trim(preg_replace("/\s\s+/", " ", $output));
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Determines if the current page is /ngg_tag/{*}
|
53 |
+
*
|
54 |
+
* @param $posts Wordpress post objects
|
55 |
+
* @return array Wordpress post objects
|
56 |
+
*/
|
57 |
+
function detect_ngg_tag($posts)
|
58 |
+
{
|
59 |
+
global $wp;
|
60 |
+
global $wp_query;
|
61 |
+
|
62 |
+
// This appears to be necessary for multisite installations, but I can't imagine why. More hackery..
|
63 |
+
$tag = (get_query_var('ngg_tag') ? get_query_var('ngg_tag') : get_query_var('name'));
|
64 |
+
|
65 |
+
if (!$this->ngg_tag_detection_has_run // don't run more than once; necessary for certain themes
|
66 |
+
&& !is_admin() // will destroy 'view all posts' page without this
|
67 |
+
&& !empty($tag) // only run when a tag has been given to wordpress
|
68 |
+
&& (stripos($wp->request, 'ngg_tag') === 0 // make sure the query begins with /ngg_tag
|
69 |
+
|| (isset($wp_query->query_vars['page_id'])
|
70 |
+
&& $wp_query->query_vars['page_id'] === 'ngg_tag')
|
71 |
+
)
|
72 |
+
)
|
73 |
+
{
|
74 |
+
$this->ngg_tag_detection_has_run = TRUE;
|
75 |
+
|
76 |
+
// Wordpress somewhat-correctly generates several notices, so silence them as they're really unnecessary
|
77 |
+
if (!defined('WP_DEBUG') || !WP_DEBUG)
|
78 |
+
error_reporting(0);
|
79 |
+
|
80 |
+
// create in-code a fake post; we feed it back to Wordpress as the sole result of the "the_posts" filter
|
81 |
+
$posts = NULL;
|
82 |
+
$posts[] = $this->create_ngg_tag_post($tag);
|
83 |
+
|
84 |
+
$wp_query->is_404 = FALSE;
|
85 |
+
$wp_query->is_page = TRUE;
|
86 |
+
$wp_query->is_singular = TRUE;
|
87 |
+
$wp_query->is_home = FALSE;
|
88 |
+
$wp_query->is_archive = FALSE;
|
89 |
+
$wp_query->is_category = FALSE;
|
90 |
+
|
91 |
+
unset($wp_query->query['error']);
|
92 |
+
$wp_query->query_vars['error'] = '';
|
93 |
+
}
|
94 |
+
|
95 |
+
return $posts;
|
96 |
+
}
|
97 |
+
|
98 |
+
function create_ngg_tag_post($tag)
|
99 |
+
{
|
100 |
+
$post = new stdClass;
|
101 |
+
$post->post_author = FALSE;
|
102 |
+
$post->post_name = 'ngg_tag';
|
103 |
+
$post->guid = get_bloginfo('wpurl') . '/' . 'ngg_tag';
|
104 |
+
$post->post_title = "Images tagged "{$tag}"";
|
105 |
+
$post->post_content = $this->index_action($tag);
|
106 |
+
$post->ID = FALSE;
|
107 |
+
$post->post_type = 'page';
|
108 |
+
$post->post_status = 'static';
|
109 |
+
$post->comment_status = 'closed';
|
110 |
+
$post->ping_status = 'closed';
|
111 |
+
$post->comment_count = 0;
|
112 |
+
$post->post_date = current_time('mysql');
|
113 |
+
$post->post_date_gmt = current_time('mysql', 1);
|
114 |
+
|
115 |
+
return($post);
|
116 |
+
}
|
117 |
+
}
|
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/interface.taxonomy_controller.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
interface I_Taxonomy_Controller extends I_MVC_Controller
|
4 |
+
{
|
5 |
+
function index_action($tag);
|
6 |
+
function detect_ngg_tag($posts);
|
7 |
+
function create_ngg_tag_post($tag);
|
8 |
+
}
|
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php
CHANGED
@@ -17,7 +17,7 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module
|
|
17 |
NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME,
|
18 |
'NextGen Basic Tagcloud',
|
19 |
'Provides a tagcloud for NextGEN Gallery',
|
20 |
-
'0.
|
21 |
'http://www.photocrati.com',
|
22 |
'Photocrati Media',
|
23 |
'http://www.photocrati.com'
|
@@ -27,6 +27,10 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module
|
|
27 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_Tagcloud_Installer');
|
28 |
}
|
29 |
|
|
|
|
|
|
|
|
|
30 |
|
31 |
function _register_adapters()
|
32 |
{
|
@@ -78,6 +82,14 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module
|
|
78 |
function _register_hooks()
|
79 |
{
|
80 |
C_NextGen_Shortcode_Manager::add('tagcloud', array(&$this, 'render_shortcode'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
/**
|
@@ -119,7 +131,9 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module
|
|
119 |
'C_NextGen_Basic_Tagcloud_Installer' => 'class.nextgen_basic_tagcloud_installer.php',
|
120 |
'A_Nextgen_Basic_Tagcloud_Mapper' => 'adapter.nextgen_basic_tagcloud_mapper.php',
|
121 |
'A_Nextgen_Basic_Tagcloud_Routes' => 'adapter.nextgen_basic_tagcloud_routes.php',
|
122 |
-
'A_Nextgen_Basic_Tagcloud_Urls' => 'adapter.nextgen_basic_tagcloud_urls.php'
|
|
|
|
|
123 |
);
|
124 |
}
|
125 |
}
|
17 |
NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME,
|
18 |
'NextGen Basic Tagcloud',
|
19 |
'Provides a tagcloud for NextGEN Gallery',
|
20 |
+
'0.4',
|
21 |
'http://www.photocrati.com',
|
22 |
'Photocrati Media',
|
23 |
'http://www.photocrati.com'
|
27 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_Tagcloud_Installer');
|
28 |
}
|
29 |
|
30 |
+
function _register_utilities()
|
31 |
+
{
|
32 |
+
$this->get_registry()->add_utility('I_Taxonomy_Controller', 'C_Taxonomy_Controller');
|
33 |
+
}
|
34 |
|
35 |
function _register_adapters()
|
36 |
{
|
82 |
function _register_hooks()
|
83 |
{
|
84 |
C_NextGen_Shortcode_Manager::add('tagcloud', array(&$this, 'render_shortcode'));
|
85 |
+
|
86 |
+
add_filter(
|
87 |
+
'the_posts',
|
88 |
+
array(
|
89 |
+
$this->get_registry()->get_utility('I_Taxonomy_Controller'),
|
90 |
+
'detect_ngg_tag'),
|
91 |
+
-10
|
92 |
+
);
|
93 |
}
|
94 |
|
95 |
/**
|
131 |
'C_NextGen_Basic_Tagcloud_Installer' => 'class.nextgen_basic_tagcloud_installer.php',
|
132 |
'A_Nextgen_Basic_Tagcloud_Mapper' => 'adapter.nextgen_basic_tagcloud_mapper.php',
|
133 |
'A_Nextgen_Basic_Tagcloud_Routes' => 'adapter.nextgen_basic_tagcloud_routes.php',
|
134 |
+
'A_Nextgen_Basic_Tagcloud_Urls' => 'adapter.nextgen_basic_tagcloud_urls.php',
|
135 |
+
'I_Taxonomy_Controller' => 'interface.taxonomy_controller.php',
|
136 |
+
'C_Taxonomy_Controller' => 'class.taxonomy_controller.php'
|
137 |
);
|
138 |
}
|
139 |
}
|
products/photocrati_nextgen/modules/nextgen_basic_templates/adapter.nextgen_basic_template_form.php
CHANGED
@@ -154,12 +154,14 @@ class A_NextGen_Basic_Template_Form extends Mixin
|
|
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);
|
165 |
|
154 |
$gallery->slideshow_link = $params['slideshow_link'];
|
155 |
$gallery->slideshow_link_text = $displayed_gallery->display_settings['slideshow_link_text'];
|
156 |
}
|
157 |
+
else $gallery->show_slideshow = FALSE;
|
158 |
|
159 |
if (!empty($displayed_gallery->display_settings['show_piclens_link'])) {
|
160 |
$gallery->show_piclens = true;
|
161 |
$gallery->piclens_link = $params['piclens_link'];
|
162 |
$gallery->piclens_link_text = $displayed_gallery->display_settings['piclens_link_text'];
|
163 |
}
|
164 |
+
else $gallery->show_piclens = FALSE;
|
165 |
|
166 |
$gallery = apply_filters('ngg_gallery_object', $gallery, 4);
|
167 |
|
products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php
CHANGED
@@ -15,7 +15,7 @@ class M_NextGen_Basic_Templates extends C_Base_Module
|
|
15 |
'photocrati-nextgen_basic_templates',
|
16 |
'NextGen Basic Templates',
|
17 |
'Provides a NextGen-Legacy compatible thumbnail gallery for NextGEN Gallery',
|
18 |
-
'0.
|
19 |
'http://www.photocrati.com',
|
20 |
'Photocrati Media',
|
21 |
'http://www.photocrati.com'
|
15 |
'photocrati-nextgen_basic_templates',
|
16 |
'NextGen Basic Templates',
|
17 |
'Provides a NextGen-Legacy compatible thumbnail gallery for NextGEN Gallery',
|
18 |
+
'0.2',
|
19 |
'http://www.photocrati.com',
|
20 |
'Photocrati Media',
|
21 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/nextgen_data/class.album_mapper.php
CHANGED
@@ -84,10 +84,13 @@ class Mixin_Album_Mapper extends Mixin
|
|
84 |
*/
|
85 |
function _convert_to_table_data($entity)
|
86 |
{
|
87 |
-
$exclude
|
|
|
88 |
unset($entity->exclude);
|
|
|
89 |
$retval = $this->call_parent('_convert_to_table_data', $entity);
|
90 |
$entity->exclude = $exclude;
|
|
|
91 |
return $retval;
|
92 |
}
|
93 |
|
84 |
*/
|
85 |
function _convert_to_table_data($entity)
|
86 |
{
|
87 |
+
$exclude = $entity->exclude;
|
88 |
+
$new_sortorder = property_exists($entity, 'new_sortorder') ? $entity->new_sortorder : NULL;
|
89 |
unset($entity->exclude);
|
90 |
+
unset($entity->new_sortorder);
|
91 |
$retval = $this->call_parent('_convert_to_table_data', $entity);
|
92 |
$entity->exclude = $exclude;
|
93 |
+
if ($new_sortorder) $entity->new_sortorder = $new_sortorder;
|
94 |
return $retval;
|
95 |
}
|
96 |
|
products/photocrati_nextgen/modules/nextgen_data/class.gallery.php
CHANGED
@@ -63,7 +63,8 @@ class C_Gallery extends C_DataMapper_Model
|
|
63 |
* @param C_DataMapper $mapper
|
64 |
* @param string $context
|
65 |
*/
|
66 |
-
function initialize($properties = FALSE, $mapper=FALSE)
|
|
|
67 |
|
68 |
// Get the mapper is not specified
|
69 |
if (!$mapper) {
|
@@ -71,4 +72,10 @@ class C_Gallery extends C_DataMapper_Model
|
|
71 |
}
|
72 |
parent::initialize($mapper, $properties);
|
73 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
}
|
63 |
* @param C_DataMapper $mapper
|
64 |
* @param string $context
|
65 |
*/
|
66 |
+
function initialize($properties = FALSE, $mapper=FALSE)
|
67 |
+
{
|
68 |
|
69 |
// Get the mapper is not specified
|
70 |
if (!$mapper) {
|
72 |
}
|
73 |
parent::initialize($mapper, $properties);
|
74 |
}
|
75 |
+
|
76 |
+
function get_images()
|
77 |
+
{
|
78 |
+
$mapper = C_Image_Mapper::get_instance();
|
79 |
+
return $mapper->find_all(array('galleryid = %d', $this->gid));
|
80 |
+
}
|
81 |
}
|
products/photocrati_nextgen/modules/nextgen_data/class.gallery_mapper.php
CHANGED
@@ -57,6 +57,24 @@ class Mixin_Gallery_Mapper extends Mixin
|
|
57 |
return $entity->title;
|
58 |
}
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
function _save_entity($entity)
|
62 |
{
|
57 |
return $entity->title;
|
58 |
}
|
59 |
|
60 |
+
/**
|
61 |
+
* Override the save method to avoid trying to save the 'new_sortorder' property
|
62 |
+
* to the database, which will fail since the column doesn't exist in the
|
63 |
+
* database.
|
64 |
+
* TODO: This is just a workaround and should be removed when we implement
|
65 |
+
* https://www.wrike.com/open.htm?id=8250095
|
66 |
+
* @param stdClass|C_DataMapper_Model $entity
|
67 |
+
* @return boolean
|
68 |
+
*/
|
69 |
+
function _convert_to_table_data($entity)
|
70 |
+
{
|
71 |
+
$new_sortorder = property_exists($entity, 'new_sortorder') ? $entity->new_sortorder : NULL;
|
72 |
+
unset($entity->new_sortorder);
|
73 |
+
$retval = $this->call_parent('_convert_to_table_data', $entity);
|
74 |
+
if ($new_sortorder) $entity->new_sortorder = $new_sortorder;
|
75 |
+
return $retval;
|
76 |
+
}
|
77 |
+
|
78 |
|
79 |
function _save_entity($entity)
|
80 |
{
|
products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php
CHANGED
@@ -495,7 +495,7 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
|
|
495 |
* @param type $filename specifies the name of the file
|
496 |
* @return C_Image
|
497 |
*/
|
498 |
-
function upload_base64_image($gallery, $data, $filename=FALSE)
|
499 |
{
|
500 |
$settings = C_NextGen_Settings::get_instance();
|
501 |
$memory_limit = intval(ini_get('memory_limit'));
|
@@ -530,10 +530,17 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
|
|
530 |
$filename = str_replace($match[0], '.'.$match[1], $filename);
|
531 |
}
|
532 |
$abs_filename = path_join($upload_dir, $filename);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
533 |
|
534 |
-
// Create the database record
|
535 |
-
$factory = $this->object->get_registry()->get_utility('I_Component_Factory');
|
536 |
-
$retval = $image = $factory->create('image');
|
537 |
$image->alttext = sanitize_title_with_dashes(basename($filename, '.' . pathinfo($filename, PATHINFO_EXTENSION)));
|
538 |
$image->galleryid = $this->object->_get_gallery_id($gallery);
|
539 |
$image->filename = $filename;
|
@@ -613,15 +620,24 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
|
|
613 |
return $retval;
|
614 |
}
|
615 |
|
616 |
-
function import_gallery_from_fs($abspath, $gallery_id=FALSE)
|
617 |
{
|
618 |
$retval = FALSE;
|
619 |
if (@file_exists($abspath)) {
|
620 |
|
621 |
// Ensure that this folder has images
|
622 |
-
$
|
623 |
-
|
624 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
if (!empty($files)) {
|
626 |
|
627 |
// Get needed utilities
|
@@ -630,7 +646,7 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
|
|
630 |
|
631 |
// Sometimes users try importing a directory, which actually has all images under another directory
|
632 |
$first_file_abspath = $fs->join_paths($abspath, $files[0]);
|
633 |
-
if (is_dir($first_file_abspath)) return $this->import_gallery_from_fs($first_file_abspath, $gallery_id);
|
634 |
|
635 |
// If no gallery has been specified, then use the directory name as the gallery name
|
636 |
if (!$gallery_id) {
|
@@ -638,6 +654,10 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
|
|
638 |
$gallery = $gallery_mapper->create(array(
|
639 |
'title' => basename($abspath),
|
640 |
));
|
|
|
|
|
|
|
|
|
641 |
|
642 |
// Save the gallery
|
643 |
if ($gallery->save()) $gallery_id = $gallery->id();
|
@@ -649,15 +669,82 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
|
|
649 |
foreach ($files as $file) {
|
650 |
if (!preg_match("/\.(jpg|jpeg|gif|png)/i", $file)) continue;
|
651 |
$file_abspath = $fs->join_paths($abspath, $file);
|
652 |
-
$image =
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
658 |
}
|
659 |
|
660 |
-
|
661 |
// Add the gallery name to the result
|
662 |
$gallery = $gallery_mapper->find($gallery_id);
|
663 |
$retval['gallery_name'] = $gallery->title;
|
495 |
* @param type $filename specifies the name of the file
|
496 |
* @return C_Image
|
497 |
*/
|
498 |
+
function upload_base64_image($gallery, $data, $filename=FALSE, $image_id=FALSE)
|
499 |
{
|
500 |
$settings = C_NextGen_Settings::get_instance();
|
501 |
$memory_limit = intval(ini_get('memory_limit'));
|
530 |
$filename = str_replace($match[0], '.'.$match[1], $filename);
|
531 |
}
|
532 |
$abs_filename = path_join($upload_dir, $filename);
|
533 |
+
|
534 |
+
// Create or retrieve the image object
|
535 |
+
$image = NULL;
|
536 |
+
if ($image_id) {
|
537 |
+
$image = $this->object->_image_mapper->find($image_id, TRUE);
|
538 |
+
unset($image->meta_data['saved']);
|
539 |
+
}
|
540 |
+
if (!$image) $image = $this->object->_image_mapper->create();
|
541 |
+
$retval = $image;
|
542 |
|
543 |
+
// Create or update the database record
|
|
|
|
|
544 |
$image->alttext = sanitize_title_with_dashes(basename($filename, '.' . pathinfo($filename, PATHINFO_EXTENSION)));
|
545 |
$image->galleryid = $this->object->_get_gallery_id($gallery);
|
546 |
$image->filename = $filename;
|
620 |
return $retval;
|
621 |
}
|
622 |
|
623 |
+
function import_gallery_from_fs($abspath, $gallery_id=FALSE, $move_files=TRUE)
|
624 |
{
|
625 |
$retval = FALSE;
|
626 |
if (@file_exists($abspath)) {
|
627 |
|
628 |
// Ensure that this folder has images
|
629 |
+
$files_all = scandir($abspath);
|
630 |
+
$files = array();
|
631 |
+
|
632 |
+
// first perform some filtering on file list
|
633 |
+
foreach ($files_all as $file)
|
634 |
+
{
|
635 |
+
if ($file == '.' || $file == '..')
|
636 |
+
continue;
|
637 |
+
|
638 |
+
$files[] = $file;
|
639 |
+
}
|
640 |
+
|
641 |
if (!empty($files)) {
|
642 |
|
643 |
// Get needed utilities
|
646 |
|
647 |
// Sometimes users try importing a directory, which actually has all images under another directory
|
648 |
$first_file_abspath = $fs->join_paths($abspath, $files[0]);
|
649 |
+
if (is_dir($first_file_abspath) && count($files) == 1) return $this->import_gallery_from_fs($first_file_abspath, $gallery_id, $move_files);
|
650 |
|
651 |
// If no gallery has been specified, then use the directory name as the gallery name
|
652 |
if (!$gallery_id) {
|
654 |
$gallery = $gallery_mapper->create(array(
|
655 |
'title' => basename($abspath),
|
656 |
));
|
657 |
+
|
658 |
+
if (!$move_files) {
|
659 |
+
$gallery->path = str_ireplace(ABSPATH, '', $abspath);
|
660 |
+
}
|
661 |
|
662 |
// Save the gallery
|
663 |
if ($gallery->save()) $gallery_id = $gallery->id();
|
669 |
foreach ($files as $file) {
|
670 |
if (!preg_match("/\.(jpg|jpeg|gif|png)/i", $file)) continue;
|
671 |
$file_abspath = $fs->join_paths($abspath, $file);
|
672 |
+
$image = null;
|
673 |
+
|
674 |
+
if ($move_files) {
|
675 |
+
$image = $this->object->upload_base64_image(
|
676 |
+
$gallery_id,
|
677 |
+
file_get_contents($file_abspath),
|
678 |
+
str_replace(' ', '_', $file)
|
679 |
+
);
|
680 |
+
}
|
681 |
+
else {
|
682 |
+
// Create the database record ... TODO cleanup, some duplication here from upload_base64_image
|
683 |
+
$factory = $this->object->get_registry()->get_utility('I_Component_Factory');
|
684 |
+
$image = $factory->create('image');
|
685 |
+
$image->alttext = sanitize_title_with_dashes(basename($file_abspath, '.' . pathinfo($file_abspath, PATHINFO_EXTENSION)));
|
686 |
+
$image->galleryid = $this->object->_get_gallery_id($gallery_id);
|
687 |
+
$image->filename = basename($file_abspath);
|
688 |
+
$image->image_slug = nggdb::get_unique_slug( sanitize_title_with_dashes( $image->alttext ), 'image' );
|
689 |
+
$image_key = $this->object->_image_mapper->get_primary_key_column();
|
690 |
+
$abs_filename = $file_abspath;
|
691 |
+
|
692 |
+
if (($image_id = $this->object->_image_mapper->save($image))) {
|
693 |
+
try {
|
694 |
+
// backup and image resizing should have already been performed, better to avoid
|
695 |
+
# if ($settings->imgBackup)
|
696 |
+
# $this->object->backup_image($image);
|
697 |
+
|
698 |
+
# if ($settings->imgAutoResize)
|
699 |
+
# $this->object->generate_image_clone(
|
700 |
+
# $abs_filename,
|
701 |
+
# $abs_filename,
|
702 |
+
# $this->object->get_image_size_params($image_id, 'full')
|
703 |
+
# );
|
704 |
+
|
705 |
+
// Ensure that fullsize dimensions are added to metadata array
|
706 |
+
$dimensions = getimagesize($abs_filename);
|
707 |
+
$full_meta = array(
|
708 |
+
'width' => $dimensions[0],
|
709 |
+
'height' => $dimensions[1]
|
710 |
+
);
|
711 |
+
if (!isset($image->meta_data) OR (is_string($image->meta_data) && strlen($image->meta_data) == 0)) {
|
712 |
+
$image->meta_data = array();
|
713 |
+
}
|
714 |
+
$image->meta_data = array_merge($image->meta_data, $full_meta);
|
715 |
+
$image->meta_data['full'] = $full_meta;
|
716 |
+
|
717 |
+
// Generate a thumbnail for the image
|
718 |
+
$this->object->generate_thumbnail($image);
|
719 |
+
|
720 |
+
// Set gallery preview image if missing
|
721 |
+
$this->object->get_registry()->get_utility('I_Gallery_Mapper')->set_preview_image($gallery, $image_id, TRUE);
|
722 |
+
|
723 |
+
// Notify other plugins that an image has been added
|
724 |
+
do_action('ngg_added_new_image', $image);
|
725 |
+
|
726 |
+
// delete dirsize after adding new images
|
727 |
+
delete_transient( 'dirsize_cache' );
|
728 |
+
|
729 |
+
// Seems redundant to above hook. Maintaining for legacy purposes
|
730 |
+
do_action(
|
731 |
+
'ngg_after_new_images_added',
|
732 |
+
$gallery_id,
|
733 |
+
array($image->$image_key)
|
734 |
+
);
|
735 |
+
}
|
736 |
+
catch(Exception $ex) {
|
737 |
+
throw new E_InsufficientWriteAccessException(
|
738 |
+
FALSE, $abs_filename, FALSE, $ex
|
739 |
+
);
|
740 |
+
}
|
741 |
+
}
|
742 |
+
else throw new E_InvalidEntityException();
|
743 |
+
}
|
744 |
+
|
745 |
+
$retval['image_ids'][] = $image->{$image->id_field};
|
746 |
}
|
747 |
|
|
|
748 |
// Add the gallery name to the result
|
749 |
$gallery = $gallery_mapper->find($gallery_id);
|
750 |
$retval['gallery_name'] = $gallery->title;
|
products/photocrati_nextgen/modules/nextgen_data/class.image_mapper.php
CHANGED
@@ -55,6 +55,24 @@ class Mixin_Gallery_Image_Mapper extends Mixin
|
|
55 |
return $retval;
|
56 |
}
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
function _save_entity($entity)
|
60 |
{
|
55 |
return $retval;
|
56 |
}
|
57 |
|
58 |
+
/**
|
59 |
+
* Override the save method to avoid trying to save the 'new_sortorder' property
|
60 |
+
* to the database, which will fail since the column doesn't exist in the
|
61 |
+
* database.
|
62 |
+
* TODO: This is just a workaround and should be removed when we implement
|
63 |
+
* https://www.wrike.com/open.htm?id=8250095
|
64 |
+
* @param stdClass|C_DataMapper_Model $entity
|
65 |
+
* @return boolean
|
66 |
+
*/
|
67 |
+
function _convert_to_table_data($entity)
|
68 |
+
{
|
69 |
+
$new_sortorder = property_exists($entity, 'new_sortorder') ? $entity->new_sortorder : NULL;
|
70 |
+
unset($entity->new_sortorder);
|
71 |
+
$retval = $this->call_parent('_convert_to_table_data', $entity);
|
72 |
+
if ($new_sortorder) $entity->new_sortorder = $new_sortorder;
|
73 |
+
return $retval;
|
74 |
+
}
|
75 |
+
|
76 |
|
77 |
function _save_entity($entity)
|
78 |
{
|
products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php
CHANGED
@@ -23,10 +23,10 @@ class C_Image_Wrapper
|
|
23 |
* @param bool $legacy Whether the image source is from NextGen Legacy or NextGen
|
24 |
* @return void
|
25 |
*/
|
26 |
-
public function __construct($image, $displayed_gallery, $legacy = FALSE)
|
27 |
{
|
28 |
// for clarity
|
29 |
-
if (isset($displayed_gallery->display_settings['number_of_columns']))
|
30 |
{
|
31 |
$columns = $displayed_gallery->display_settings['number_of_columns'];
|
32 |
}
|
@@ -408,7 +408,6 @@ class C_Image_Wrapper
|
|
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 {
|
@@ -421,6 +420,8 @@ class C_Image_Wrapper
|
|
421 |
$retval = '';
|
422 |
}
|
423 |
|
|
|
|
|
424 |
$retval .= ' data-image-id="' . $this->__get('id') . '"';
|
425 |
|
426 |
$this->_cache['thumbcode'] = $retval;
|
23 |
* @param bool $legacy Whether the image source is from NextGen Legacy or NextGen
|
24 |
* @return void
|
25 |
*/
|
26 |
+
public function __construct($image, $displayed_gallery=NULL, $legacy = FALSE)
|
27 |
{
|
28 |
// for clarity
|
29 |
+
if ($displayed_gallery && isset($displayed_gallery->display_settings['number_of_columns']))
|
30 |
{
|
31 |
$columns = $displayed_gallery->display_settings['number_of_columns'];
|
32 |
}
|
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 |
$retval = $effect_code;
|
412 |
}
|
413 |
else {
|
420 |
$retval = '';
|
421 |
}
|
422 |
|
423 |
+
$retval = apply_filters('ngg_get_thumbcode', $retval, $this);
|
424 |
+
|
425 |
$retval .= ' data-image-id="' . $this->__get('id') . '"';
|
426 |
|
427 |
$this->_cache['thumbcode'] = $retval;
|
products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php
CHANGED
@@ -15,7 +15,7 @@ class M_NextGen_Data extends C_Base_Module
|
|
15 |
'photocrati-nextgen-data',
|
16 |
'NextGEN Data Tier',
|
17 |
"Provides a data tier for NextGEN gallery based on the DataMapper module",
|
18 |
-
'0.
|
19 |
'http://www.photocrati.com',
|
20 |
'Photocrati Media',
|
21 |
'http://www.photocrati.com'
|
15 |
'photocrati-nextgen-data',
|
16 |
'NextGEN Data Tier',
|
17 |
"Provides a data tier for NextGEN gallery based on the DataMapper module",
|
18 |
+
'0.3',
|
19 |
'http://www.photocrati.com',
|
20 |
'Photocrati Media',
|
21 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php
CHANGED
@@ -168,13 +168,14 @@ class Mixin_Displayed_Gallery_Queries extends Mixin
|
|
168 |
$select,
|
169 |
$image_key,
|
170 |
$sortorder_set,
|
171 |
-
'
|
172 |
TRUE
|
173 |
);
|
174 |
// A user might want to sort the results by the order of
|
175 |
// images that they specified to be included. For that,
|
176 |
// we need some trickery by reversing the order direction
|
177 |
$sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC';
|
|
|
178 |
}
|
179 |
|
180 |
// Add exclude column
|
@@ -204,10 +205,11 @@ class Mixin_Displayed_Gallery_Queries extends Mixin
|
|
204 |
$select,
|
205 |
$image_key,
|
206 |
$this->object->sortorder,
|
207 |
-
'
|
208 |
TRUE
|
209 |
);
|
210 |
$sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC';
|
|
|
211 |
}
|
212 |
$mapper->select($select);
|
213 |
|
@@ -239,10 +241,11 @@ class Mixin_Displayed_Gallery_Queries extends Mixin
|
|
239 |
$select,
|
240 |
$image_key,
|
241 |
$this->object->sortorder,
|
242 |
-
'
|
243 |
TRUE
|
244 |
);
|
245 |
$sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC';
|
|
|
246 |
}
|
247 |
|
248 |
// Mark each result as excluded
|
@@ -909,7 +912,12 @@ class Mixin_Displayed_Gallery_Instance_Methods extends Mixin
|
|
909 |
*/
|
910 |
function apply_transient($transient_id)
|
911 |
{
|
912 |
-
|
|
|
913 |
$this->object->_stdObject = $transient;
|
|
|
|
|
|
|
|
|
914 |
}
|
915 |
}
|
168 |
$select,
|
169 |
$image_key,
|
170 |
$sortorder_set,
|
171 |
+
'new_sortorder',
|
172 |
TRUE
|
173 |
);
|
174 |
// A user might want to sort the results by the order of
|
175 |
// images that they specified to be included. For that,
|
176 |
// we need some trickery by reversing the order direction
|
177 |
$sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC';
|
178 |
+
$sort_by = 'new_sortorder';
|
179 |
}
|
180 |
|
181 |
// Add exclude column
|
205 |
$select,
|
206 |
$image_key,
|
207 |
$this->object->sortorder,
|
208 |
+
'new_sortorder',
|
209 |
TRUE
|
210 |
);
|
211 |
$sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC';
|
212 |
+
$sort_by = 'new_sortorder';
|
213 |
}
|
214 |
$mapper->select($select);
|
215 |
|
241 |
$select,
|
242 |
$image_key,
|
243 |
$this->object->sortorder,
|
244 |
+
'new_sortorder',
|
245 |
TRUE
|
246 |
);
|
247 |
$sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC';
|
248 |
+
$sort_by = 'new_sortorder';
|
249 |
}
|
250 |
|
251 |
// Mark each result as excluded
|
912 |
*/
|
913 |
function apply_transient($transient_id)
|
914 |
{
|
915 |
+
$retval = FALSE;
|
916 |
+
if (($transient = C_Photocrati_Cache::get($transient_id, FALSE, 'displayed_galleries'))) {
|
917 |
$this->object->_stdObject = $transient;
|
918 |
+
$retval = TRUE;
|
919 |
+
}
|
920 |
+
|
921 |
+
return $retval;
|
922 |
}
|
923 |
}
|
products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_renderer.php
CHANGED
@@ -202,7 +202,12 @@ class Mixin_Displayed_Gallery_Renderer extends Mixin
|
|
202 |
// Display!
|
203 |
return $this->object->render($displayed_gallery, TRUE, $mode);
|
204 |
}
|
205 |
-
else
|
|
|
|
|
|
|
|
|
|
|
206 |
}
|
207 |
else {
|
208 |
$retval = "Invalid Displayed Gallery";
|
202 |
// Display!
|
203 |
return $this->object->render($displayed_gallery, TRUE, $mode);
|
204 |
}
|
205 |
+
else {
|
206 |
+
if (C_NextGEN_Bootstrap::$debug)
|
207 |
+
$retval = "Invalid Displayed Gallery" . var_dump($displayed_gallery->get_errors());
|
208 |
+
else
|
209 |
+
$retval = "Gallery not found. Please <strong>check your settings</strong>.";
|
210 |
+
}
|
211 |
}
|
212 |
else {
|
213 |
$retval = "Invalid Displayed Gallery";
|
products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php
CHANGED
@@ -19,7 +19,7 @@ class M_Gallery_Display extends C_Base_Module
|
|
19 |
'photocrati-nextgen_gallery_display',
|
20 |
'Gallery Display',
|
21 |
'Provides the ability to display gallery of images',
|
22 |
-
'0.
|
23 |
'http://www.photocrati.com',
|
24 |
'Photocrati Media',
|
25 |
'http://www.photocrati.com'
|
19 |
'photocrati-nextgen_gallery_display',
|
20 |
'Gallery Display',
|
21 |
'Provides the ability to display gallery of images',
|
22 |
+
'0.3',
|
23 |
'http://www.photocrati.com',
|
24 |
'Photocrati Media',
|
25 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js
CHANGED
@@ -1,37 +1,19 @@
|
|
1 |
(function($){
|
2 |
-
window.NggPaginatedGallery = {
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
this.links = links;
|
7 |
-
this.container = container;
|
8 |
-
|
9 |
-
var displayed_gallery = this.get_displayed_gallery_obj();
|
10 |
-
if (displayed_gallery) {
|
11 |
-
if (typeof(displayed_gallery.display_settings['ajax_pagination']) != 'undefined') {
|
12 |
-
if (parseInt(displayed_gallery.display_settings['ajax_pagination'])) {
|
13 |
-
this.enable_ajax_pagination();
|
14 |
-
}
|
15 |
-
}
|
16 |
-
}
|
17 |
-
|
18 |
-
// We maintain a count of all the current AJAX actions initiated
|
19 |
-
if (typeof(window['ngg_ajax_operation_count']) == 'undefined') {
|
20 |
-
window['ngg_ajax_operaton_count'] = 0;
|
21 |
-
}
|
22 |
-
},
|
23 |
|
24 |
-
|
25 |
-
get_displayed_gallery_obj: function(){
|
26 |
var index = 'gallery_'+this.displayed_gallery_id;
|
27 |
if (typeof(window.galleries[index]) == 'undefined')
|
28 |
return false;
|
29 |
else
|
30 |
return window.galleries[index];
|
31 |
-
}
|
32 |
|
33 |
|
34 |
-
enable_ajax_pagination
|
35 |
var transient_id = this.get_displayed_gallery_obj().transient_id;
|
36 |
var obj = this;
|
37 |
|
@@ -53,9 +35,9 @@
|
|
53 |
obj.do_ajax(request);
|
54 |
});
|
55 |
});
|
56 |
-
}
|
57 |
|
58 |
-
do_ajax
|
59 |
|
60 |
var container = this.container;
|
61 |
|
@@ -82,6 +64,21 @@
|
|
82 |
$(document).trigger('refreshed');
|
83 |
}
|
84 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
};
|
87 |
|
1 |
(function($){
|
2 |
+
window.NggPaginatedGallery = function(displayed_gallery_id, container, links) {
|
3 |
+
this.displayed_gallery_id = displayed_gallery_id;
|
4 |
+
this.links = links;
|
5 |
+
this.container = container;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
this.get_displayed_gallery_obj = function(){
|
|
|
8 |
var index = 'gallery_'+this.displayed_gallery_id;
|
9 |
if (typeof(window.galleries[index]) == 'undefined')
|
10 |
return false;
|
11 |
else
|
12 |
return window.galleries[index];
|
13 |
+
};
|
14 |
|
15 |
|
16 |
+
this.enable_ajax_pagination = function(){
|
17 |
var transient_id = this.get_displayed_gallery_obj().transient_id;
|
18 |
var obj = this;
|
19 |
|
35 |
obj.do_ajax(request);
|
36 |
});
|
37 |
});
|
38 |
+
};
|
39 |
|
40 |
+
this.do_ajax = function(request){
|
41 |
|
42 |
var container = this.container;
|
43 |
|
64 |
$(document).trigger('refreshed');
|
65 |
}
|
66 |
});
|
67 |
+
};
|
68 |
+
|
69 |
+
// Initialize
|
70 |
+
var displayed_gallery = this.get_displayed_gallery_obj();
|
71 |
+
if (displayed_gallery) {
|
72 |
+
if (typeof(displayed_gallery.display_settings['ajax_pagination']) != 'undefined') {
|
73 |
+
if (parseInt(displayed_gallery.display_settings['ajax_pagination'])) {
|
74 |
+
this.enable_ajax_pagination();
|
75 |
+
}
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
// We maintain a count of all the current AJAX actions initiated
|
80 |
+
if (typeof(window['ngg_ajax_operation_count']) == 'undefined') {
|
81 |
+
window['ngg_ajax_operaton_count'] = 0;
|
82 |
}
|
83 |
};
|
84 |
|
products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php
CHANGED
@@ -16,7 +16,7 @@ class M_NextGen_Other_Options extends C_Base_Module
|
|
16 |
'photocrati-nextgen_other_options',
|
17 |
'Other Options',
|
18 |
'NextGEN Gallery Others Options Page',
|
19 |
-
'0.
|
20 |
'http://www.nextgen-gallery.com',
|
21 |
'Photocrati Media',
|
22 |
'http://www.photocrati.com'
|
16 |
'photocrati-nextgen_other_options',
|
17 |
'Other Options',
|
18 |
'NextGEN Gallery Others Options Page',
|
19 |
+
'0.4',
|
20 |
'http://www.nextgen-gallery.com',
|
21 |
'Photocrati Media',
|
22 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php
ADDED
@@ -0,0 +1,602 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/***
|
4 |
+
{
|
5 |
+
Module: photocrati-nextgen_xmlrpc
|
6 |
+
}
|
7 |
+
***/
|
8 |
+
class M_NextGen_XmlRpc extends C_Base_Module
|
9 |
+
{
|
10 |
+
function define()
|
11 |
+
{
|
12 |
+
parent::define(
|
13 |
+
'photocrati-nextgen_xmlrpc',
|
14 |
+
'NextGEN Gallery XML-RPC',
|
15 |
+
'Provides an XML-RPC API for NextGEN Gallery',
|
16 |
+
'0.1',
|
17 |
+
'http://www.nextgen-gallery.com',
|
18 |
+
'Photocrati Media',
|
19 |
+
'http://www.photocrati.com'
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
+
function _register_hooks()
|
24 |
+
{
|
25 |
+
add_filter('xmlrpc_methods', array(&$this, 'add_methods') );
|
26 |
+
}
|
27 |
+
|
28 |
+
function add_methods($methods)
|
29 |
+
{
|
30 |
+
$methods['ngg.installed'] = array(&$this, 'get_version');
|
31 |
+
// Image methods
|
32 |
+
$methods['ngg.getImage'] = array(&$this, 'get_image');
|
33 |
+
$methods['ngg.getImages'] = array(&$this, 'get_images');
|
34 |
+
$methods['ngg.uploadImage'] = array(&$this, 'upload_image');
|
35 |
+
$methods['ngg.editImage'] = array(&$this, 'edit_image');
|
36 |
+
$methods['ngg.deleteImage'] = array(&$this, 'delete_image');
|
37 |
+
// Gallery methods
|
38 |
+
$methods['ngg.getGallery'] = array(&$this, 'get_gallery');
|
39 |
+
$methods['ngg.getGalleries'] = array(&$this, 'get_galleries');
|
40 |
+
$methods['ngg.newGallery'] = array(&$this, 'create_gallery');
|
41 |
+
$methods['ngg.editGallery'] = array(&$this, 'edit_gallery');
|
42 |
+
$methods['ngg.deleteGallery'] = array(&$this, 'delete_gallery');
|
43 |
+
|
44 |
+
// Album methods
|
45 |
+
$methods['ngg.getAlbum'] = array(&$this, 'get_album');
|
46 |
+
$methods['ngg.getAlbums'] = array(&$this, 'get_albums');
|
47 |
+
$methods['ngg.newAlbum'] = array(&$this, 'create_album');
|
48 |
+
$methods['ngg.editAlbum'] = array(&$this, 'edit_album');
|
49 |
+
$methods['ngg.deleteAlbum'] = array(&$this, 'delete_album');
|
50 |
+
|
51 |
+
return $methods;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Gets the version of NextGEN Gallery installed
|
56 |
+
* @return string
|
57 |
+
*/
|
58 |
+
function get_version()
|
59 |
+
{
|
60 |
+
return array('version' => NEXTGEN_GALLERY_PLUGIN_VERSION);
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Login a user
|
65 |
+
* @param $username
|
66 |
+
* @param $password
|
67 |
+
* @return bool|WP_Error|WP_User
|
68 |
+
*/
|
69 |
+
function login($username, $password, $blog_id=1)
|
70 |
+
{
|
71 |
+
$retval = FALSE;
|
72 |
+
|
73 |
+
if (!is_a(($user_obj = wp_authenticate($username, $password)), 'WP_Error')) {
|
74 |
+
wp_set_current_user($user_obj->ID);
|
75 |
+
$retval = $user_obj;
|
76 |
+
|
77 |
+
if (is_multisite()) switch_to_blog($blog_id);
|
78 |
+
}
|
79 |
+
|
80 |
+
return $retval;
|
81 |
+
}
|
82 |
+
|
83 |
+
function can_manage_gallery($gallery_id_or_obj, $check_upload_capability=FALSE)
|
84 |
+
{
|
85 |
+
$retval = FALSE;
|
86 |
+
|
87 |
+
// Get the gallery object, if we don't have it already
|
88 |
+
$gallery = NULL;
|
89 |
+
if (is_int($gallery_id_or_obj)) {
|
90 |
+
$gallery_mapper = C_Gallery_Mapper::get_instance();
|
91 |
+
$gallery = $gallery_mapper->find($gallery_id_or_obj);
|
92 |
+
}
|
93 |
+
|
94 |
+
$security = $this->get_registry()->get_utility('I_Security_Manager');
|
95 |
+
$actor = $security->get_current_actor();
|
96 |
+
if ($actor->get_entity_id() == $gallery->author) $retval = TRUE;
|
97 |
+
elseif ($actor->is_allowed('nextgen_edit_gallery_unowned')) $retval = TRUE;
|
98 |
+
|
99 |
+
// Optionally, check if the user can upload to this gallery
|
100 |
+
if ($retval && $check_upload_capability) {
|
101 |
+
$retval = $actor->is_allowed('nextgen_upload_image');
|
102 |
+
}
|
103 |
+
|
104 |
+
return $retval;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Returns a single image object
|
109 |
+
* @param $args (blog_id, username, password, pid)
|
110 |
+
*/
|
111 |
+
function get_image($args, $return_model=FALSE)
|
112 |
+
{
|
113 |
+
$retval = new IXR_Error(403, 'Invalid username or password');
|
114 |
+
$blog_id = intval($args[0]);
|
115 |
+
$username = strval($args[1]);
|
116 |
+
$password = strval($args[2]);
|
117 |
+
$image_id = intval($args[3]);
|
118 |
+
|
119 |
+
// Authenticate the user
|
120 |
+
if ($this->login($username, $password, $blog_id)) {
|
121 |
+
|
122 |
+
// Try to find the image
|
123 |
+
$image_mapper = C_Image_Mapper::get_instance();
|
124 |
+
if (($image = $image_mapper->find($image_id, TRUE))) {
|
125 |
+
|
126 |
+
// Try to find the gallery that the image belongs to
|
127 |
+
$gallery_mapper = C_Gallery_Mapper::get_instance();
|
128 |
+
if (($gallery = $gallery_mapper->find($image->galleryid))) {
|
129 |
+
|
130 |
+
// Does the user have sufficient capabilities?
|
131 |
+
if ($this->can_manage_gallery($gallery)) {
|
132 |
+
$storage = C_Gallery_Storage::get_instance();
|
133 |
+
$image->imageURL = $storage->get_image_url($image);
|
134 |
+
$image->thumbURL = $storage->get_thumb_url($image);
|
135 |
+
$image->imagePath = $storage->get_image_abspath($image);
|
136 |
+
$image->thumbPath = $storage->get_thumb_abspath($image);
|
137 |
+
$retval = $return_model ? $image : $image->get_entity();
|
138 |
+
}
|
139 |
+
|
140 |
+
else {
|
141 |
+
$retval = new IXR_Error(403, "You don't have permission to manage gallery #{$image->galleryid}");
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
// No gallery found
|
146 |
+
else {
|
147 |
+
$retval = new IXR_Error(404, "Gallery not found (with id #{$image->gallerid}");
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
// No image found
|
152 |
+
else $retval = FALSE;
|
153 |
+
}
|
154 |
+
|
155 |
+
return $retval;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Returns a collection of images
|
160 |
+
* @param $args (blog_id, username, password, gallery_id
|
161 |
+
*/
|
162 |
+
function get_images($args)
|
163 |
+
{
|
164 |
+
$retval = new IXR_Error(403, 'Invalid username or password');
|
165 |
+
$blog_id = intval($args[0]);
|
166 |
+
$username = strval($args[1]);
|
167 |
+
$password = strval($args[2]);
|
168 |
+
$gallery_id = intval($args[3]);
|
169 |
+
|
170 |
+
// Authenticate the user
|
171 |
+
if ($this->login($username, $password, $blog_id)) {
|
172 |
+
|
173 |
+
// Try to find the gallery
|
174 |
+
$mapper = C_Gallery_Mapper::get_instance();
|
175 |
+
if (($gallery = $mapper->find($gallery_id, TRUE))) {
|
176 |
+
|
177 |
+
// Does the user have sufficient capabilities?
|
178 |
+
if ($this->can_manage_gallery($gallery)) {
|
179 |
+
$retval = $gallery->get_images();
|
180 |
+
}
|
181 |
+
else {
|
182 |
+
$retval = new IXR_Error(403, "You don't have permission to manage gallery #{$image->galleryid}");
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
// No gallery found
|
187 |
+
else {
|
188 |
+
$retval = new IXR_Error(404, "Gallery not found (with id #{$image->gallerid}");
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
return $retval;
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Uploads an image to a particular gallery
|
197 |
+
* @param $args (blog_id, username, password, data)
|
198 |
+
*
|
199 |
+
* Data is an assoc array:
|
200 |
+
* o string name
|
201 |
+
* o string type (optional)
|
202 |
+
* o base64 bits
|
203 |
+
* o bool overwrite (optional)
|
204 |
+
* o int gallery
|
205 |
+
* o int image_id (optional)
|
206 |
+
* @return image
|
207 |
+
*/
|
208 |
+
function upload_image($args)
|
209 |
+
{
|
210 |
+
$retval = new IXR_Error(403, 'Invalid username or password');
|
211 |
+
$blog_id = intval($args[0]);
|
212 |
+
$username = strval($args[1]);
|
213 |
+
$password = strval($args[2]);
|
214 |
+
$data = $args[3];
|
215 |
+
$gallery_id = isset($data['gallery_id']) ? $data['gallery_id'] : $data['gallery'];
|
216 |
+
|
217 |
+
// Authenticate the user
|
218 |
+
if ($this->login($username, $password, $blog_id)) {
|
219 |
+
|
220 |
+
// Try to find the gallery
|
221 |
+
$mapper = C_Gallery_Mapper::get_instance();
|
222 |
+
if (($gallery = $mapper->find($gallery_id, TRUE))) {
|
223 |
+
|
224 |
+
// Does the user have sufficient capabilities?
|
225 |
+
if ($this->can_manage_gallery($gallery, TRUE)) {
|
226 |
+
|
227 |
+
// Upload the image
|
228 |
+
$storage = C_Gallery_Storage::get_instance();
|
229 |
+
$image = $storage->upload_base64_image($gallery, $data['bits'], $data['name'], $data['image_id']);
|
230 |
+
if ($image) {
|
231 |
+
$storage = C_Gallery_Storage::get_instance();
|
232 |
+
$image->imageURL = $storage->get_image_url($image);
|
233 |
+
$image->thumbURL = $storage->get_thumb_url($image);
|
234 |
+
$image->imagePath = $storage->get_image_abspath($image);
|
235 |
+
$image->thumbPath = $storage->get_thumb_abspath($image);
|
236 |
+
$retval = $image->get_entity();
|
237 |
+
}
|
238 |
+
else
|
239 |
+
$retval = new IXR_Error(500, "Could not upload image");
|
240 |
+
}
|
241 |
+
else {
|
242 |
+
$retval = new IXR_Error(403, "You don't have permission to upload to gallery #{$image->galleryid}");
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
// No gallery found
|
247 |
+
else {
|
248 |
+
$retval = new IXR_Error(404, "Gallery not found (with id #{$image->gallerid}");
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
+
return $retval;
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Edits an image object
|
257 |
+
* @param $args (blog_id, username, password, image_id, alttext, description, exclude, other_properties
|
258 |
+
*/
|
259 |
+
function edit_image($args)
|
260 |
+
{
|
261 |
+
$alttext = strval($args[4]);
|
262 |
+
$description = strval($args[5]);
|
263 |
+
$exclude = intval($args[6]);
|
264 |
+
$properties = isset($args[7]) ? (array)$args[7] : array();
|
265 |
+
|
266 |
+
$retval = $this->get_image($args, TRUE);
|
267 |
+
if (!($retval instanceof IXR_Error)) {
|
268 |
+
$retval->alttext = $alttext;
|
269 |
+
$retval->description = $description;
|
270 |
+
$retval->exclude = $exclude;
|
271 |
+
|
272 |
+
// Other properties can be specified using an associative array
|
273 |
+
foreach ($properties as $key => $value) {
|
274 |
+
$retval->$key = $value;
|
275 |
+
}
|
276 |
+
|
277 |
+
$retval = $retval->save();
|
278 |
+
}
|
279 |
+
|
280 |
+
return $retval;
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* Deletes an existing image from a gallery
|
285 |
+
* @param $args (blog_id, username, password, image_id)
|
286 |
+
*/
|
287 |
+
function delete_image($args)
|
288 |
+
{
|
289 |
+
$retval = $this->get_image($args, TRUE);
|
290 |
+
if (!($retval instanceof IXR_Error)) {
|
291 |
+
$retval = $retval->destroy();
|
292 |
+
}
|
293 |
+
return $retval;
|
294 |
+
}
|
295 |
+
|
296 |
+
/**
|
297 |
+
* Creates a new gallery
|
298 |
+
* @param $args (blog_id, username, password, title)
|
299 |
+
*/
|
300 |
+
function create_gallery($args)
|
301 |
+
{
|
302 |
+
$retval = new IXR_Error(403, 'Invalid username or password');
|
303 |
+
$blog_id = intval($args[0]);
|
304 |
+
$username = strval($args[1]);
|
305 |
+
$password = strval($args[2]);
|
306 |
+
$title = strval($args[3]);
|
307 |
+
|
308 |
+
// Authenticate the user
|
309 |
+
if ($this->login($username, $password, $blog_id)) {
|
310 |
+
|
311 |
+
$security = $this->get_registry()->get_utility('I_Security_Manager');
|
312 |
+
if ($security->is_allowed('nextgen_edit_gallery')) {
|
313 |
+
$mapper = C_Gallery_Mapper::get_instance();
|
314 |
+
if (($gallery = $mapper->create(array('title' => $title))) && $gallery->save()) {
|
315 |
+
$retval = $gallery->id();
|
316 |
+
}
|
317 |
+
else $retval = new IXR_Error(500, "Unable to create gallery");
|
318 |
+
|
319 |
+
}
|
320 |
+
else $retval = new IXR_Error(403, "Sorry, but you must be able to manage galleries. Check your roles/capabilities.");
|
321 |
+
}
|
322 |
+
|
323 |
+
return $retval;
|
324 |
+
}
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Edits an existing gallery
|
328 |
+
* @param $args (blog_id, username, password, gallery_id, name, title, description, preview_pic_id)
|
329 |
+
*/
|
330 |
+
function edit_gallery($args)
|
331 |
+
{
|
332 |
+
$retval = new IXR_Error(403, 'Invalid username or password');
|
333 |
+
$blog_id = intval($args[0]);
|
334 |
+
$username = strval($args[1]);
|
335 |
+
$password = strval($args[2]);
|
336 |
+
$gallery_id = intval($args[3]);
|
337 |
+
$name = strval($args[4]);
|
338 |
+
$title = strval($args[5]);
|
339 |
+
$image_id = intval($args[6]);
|
340 |
+
$properties = isset($args[7]) ? (array) $args[7] : array();
|
341 |
+
|
342 |
+
// Authenticate the user
|
343 |
+
if ($this->login($username, $password, $blog_id)) {
|
344 |
+
|
345 |
+
$mapper = C_Gallery_Mapper::get_instance();
|
346 |
+
if (($gallery = $mapper->find($gallery_id, TRUE))) {
|
347 |
+
if ($this->can_manage_gallery($gallery)) {
|
348 |
+
$gallery->name = $name;
|
349 |
+
$gallery->title = $title;
|
350 |
+
$gallery->previewpic = $image_id;
|
351 |
+
foreach ($properties as $key => $value) {
|
352 |
+
$gallery->$key = $value;
|
353 |
+
}
|
354 |
+
$retval = $gallery->save();
|
355 |
+
}
|
356 |
+
else $retval = new IXR_Error(403, "You don't have permission to modify this gallery");
|
357 |
+
}
|
358 |
+
else $retval = new IXR_Error(404, "Gallery #{$gallery_id} doesn't exist");
|
359 |
+
}
|
360 |
+
|
361 |
+
return $retval;
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Gets a single gallery instance
|
366 |
+
* @param $args (blog_id, username, password, gallery_id)
|
367 |
+
*/
|
368 |
+
function get_gallery($args, $return_model=FALSE)
|
369 |
+
{
|
370 |
+
$retval = new IXR_Error(403, 'Invalid username or password');
|
371 |
+
$blog_id = intval($args[0]);
|
372 |
+
$username = strval($args[1]);
|
373 |
+
$password = strval($args[2]);
|
374 |
+
$gallery_id = intval($args[3]);
|
375 |
+
|
376 |
+
// Authenticate the user
|
377 |
+
if ($this->login($username, $password, $blog_id)) {
|
378 |
+
$mapper = C_Gallery_Mapper::get_instance();
|
379 |
+
if (($gallery = $mapper->find($gallery_id, TRUE))) {
|
380 |
+
if ($this->can_manage_gallery($gallery)) {
|
381 |
+
$retval = $return_model ? $gallery : $gallery->get_entity();
|
382 |
+
}
|
383 |
+
}
|
384 |
+
else $retval = FALSE;
|
385 |
+
}
|
386 |
+
|
387 |
+
return $retval;
|
388 |
+
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Deletes a gallery
|
392 |
+
* @param $args (blog_id, username, password, gallery_id)
|
393 |
+
*/
|
394 |
+
function delete_gallery($args)
|
395 |
+
{
|
396 |
+
$retval = $this->get_gallery($args, TRUE);
|
397 |
+
|
398 |
+
if (!($retval instanceof IXR_Error)) {
|
399 |
+
$retval = $retval->destroy();
|
400 |
+
}
|
401 |
+
|
402 |
+
return $retval;
|
403 |
+
}
|
404 |
+
|
405 |
+
/**
|
406 |
+
* Creates a new album
|
407 |
+
* @param $args (blog_id, username, password, title, previewpic, description, galleries
|
408 |
+
*/
|
409 |
+
function create_album($args)
|
410 |
+
{
|
411 |
+
$retval = new IXR_Error(403, 'Invalid username or password');
|
412 |
+
$blog_id = intval($args[0]);
|
413 |
+
$username = strval($args[1]);
|
414 |
+
$password = strval($args[2]);
|
415 |
+
$title = intval($args[3]);
|
416 |
+
$previewpic = isset($args[4]) ? intval($args[4]): 0;
|
417 |
+
$desc = isset($args[5]) ? strval($args[5]) : '';
|
418 |
+
$sortorder = isset($args[6]) ? $args[6] : '';
|
419 |
+
$page_id = isset($args[7]) ? intval($args[7]) : 0;
|
420 |
+
|
421 |
+
// Authenticate the user
|
422 |
+
if ($this->login($username, $password, $blog_id)) {
|
423 |
+
|
424 |
+
// Is request allowed?
|
425 |
+
$security = $this->get_registry()->get_utility('I_Security_Manager');
|
426 |
+
if ($security->is_allowed('nextgen_edit_album')) {
|
427 |
+
|
428 |
+
$mapper = C_Album_Mapper::get_instance();
|
429 |
+
$album = $mapper->create(array(
|
430 |
+
'name' => $title,
|
431 |
+
'previewpic' => $previewpic,
|
432 |
+
'albumdesc' => $desc,
|
433 |
+
'sortorder' => $sortorder,
|
434 |
+
'page_id' => $page_id
|
435 |
+
));
|
436 |
+
|
437 |
+
if ($album->save()) $retval = $album->id();
|
438 |
+
else $retval = new IXR_Error(500, "Unable to create album");
|
439 |
+
}
|
440 |
+
}
|
441 |
+
|
442 |
+
return $retval;
|
443 |
+
}
|
444 |
+
|
445 |
+
|
446 |
+
/**
|
447 |
+
* Returns all albums
|
448 |
+
* @param $args (blog_id, username, password)
|
449 |
+
* @return IXR_Error
|
450 |
+
*/
|
451 |
+
function get_albums($args)
|
452 |
+
{
|
453 |
+
$retval = new IXR_Error(403, 'Invalid username or password');
|
454 |
+
$blog_id = intval($args[0]);
|
455 |
+
$username = strval($args[1]);
|
456 |
+
$password = strval($args[2]);
|
457 |
+
|
458 |
+
// Authenticate the user
|
459 |
+
if ($this->login($username, $password, $blog_id)) {
|
460 |
+
|
461 |
+
// Are we allowed?
|
462 |
+
$security = $this->get_registry()->get_utility('I_Security_Manager');
|
463 |
+
if ($security->is_allowed('nextgen_edit_album')) {
|
464 |
+
|
465 |
+
// Fetch all albums
|
466 |
+
$mapper = C_Album_Mapper::get_instance();
|
467 |
+
$retval = array();
|
468 |
+
foreach ($mapper->find_all() as $album) {
|
469 |
+
// Vladimir's Lightroom plugins requires the 'id' to be a string
|
470 |
+
// Ask if he can accept integers as well. Currently, integers break
|
471 |
+
// his plugin
|
472 |
+
$album->id = (string) $album->id;
|
473 |
+
$album->galleries = $album->sortorder;
|
474 |
+
|
475 |
+
$retval[$album->{$album->id_field}] = (array) $album;
|
476 |
+
}
|
477 |
+
}
|
478 |
+
else $retval = new IXR_Error(403, "Sorry, you must be able to manage albums");
|
479 |
+
|
480 |
+
|
481 |
+
}
|
482 |
+
|
483 |
+
return $retval;
|
484 |
+
}
|
485 |
+
|
486 |
+
/**
|
487 |
+
* Gets a single album
|
488 |
+
* @param $args (blog_id, username, password, album_id)
|
489 |
+
*/
|
490 |
+
function get_album($args, $return_model=FALSE)
|
491 |
+
{
|
492 |
+
$retval = new IXR_Error(403, 'Invalid username or password');
|
493 |
+
$blog_id = intval($args[0]);
|
494 |
+
$username = strval($args[1]);
|
495 |
+
$password = strval($args[2]);
|
496 |
+
$album_id = intval($args[3]);
|
497 |
+
|
498 |
+
// Authenticate the user
|
499 |
+
if ($this->login($username, $password, $blog_id)) {
|
500 |
+
|
501 |
+
// Are we allowed?
|
502 |
+
$security = $this->get_registry()->get_utility('I_Security_Manager');
|
503 |
+
if ($security->is_allowed('nextgen_edit_album')) {
|
504 |
+
$mapper = C_Album_Mapper::get_instance();
|
505 |
+
$album = $mapper->find($album_id, TRUE);
|
506 |
+
|
507 |
+
// Vladimir's Lightroom plugins requires the 'id' to be a string
|
508 |
+
// Ask if he can accept integers as well. Currently, integers break
|
509 |
+
// his plugin
|
510 |
+
$album->id = (string) $album->id;
|
511 |
+
$album->galleries = $album->sortorder;
|
512 |
+
|
513 |
+
$retval = $return_model ? $album : $album->get_entity();
|
514 |
+
}
|
515 |
+
else $retval = new IXR_Error(403, "Sorry, you must be able to manage albums");
|
516 |
+
}
|
517 |
+
|
518 |
+
return $retval;
|
519 |
+
}
|
520 |
+
|
521 |
+
/**
|
522 |
+
* Deletes an existing album
|
523 |
+
* @param $args (blog_id, username, password, album_id)
|
524 |
+
*/
|
525 |
+
function delete_album($args)
|
526 |
+
{
|
527 |
+
$retval = $this->get_album($args, TRUE);
|
528 |
+
|
529 |
+
if (!($retval instanceof IXR_Error)) {
|
530 |
+
$retval = $retval->destroy();
|
531 |
+
}
|
532 |
+
|
533 |
+
return $retval;
|
534 |
+
}
|
535 |
+
|
536 |
+
/**
|
537 |
+
* Edit an existing album
|
538 |
+
* @param $args (blog_id, username, password, album_id, name, preview pic id, description, galleries)
|
539 |
+
*/
|
540 |
+
function edit_album($args)
|
541 |
+
{
|
542 |
+
$retval = $this->get_album($args, TRUE);
|
543 |
+
|
544 |
+
if (!($retval instanceof IXR_Error)) {
|
545 |
+
$retval->name = strval($args[4]);
|
546 |
+
$retval->previewpic = intval($args[5]);
|
547 |
+
$retval->albumdesc = strval($args[6]);
|
548 |
+
$retval->sortorder = $args[7];
|
549 |
+
|
550 |
+
$properties = isset($args[8]) ? $args[8] : array();
|
551 |
+
foreach ($properties as $key => $value) $retval->$key = $value;
|
552 |
+
unset($retval->galleries);
|
553 |
+
|
554 |
+
$retval = $retval->save();
|
555 |
+
}
|
556 |
+
|
557 |
+
return $retval;
|
558 |
+
}
|
559 |
+
|
560 |
+
|
561 |
+
/**
|
562 |
+
* Returns all galleries
|
563 |
+
* @param $args (blog_id, username, password)
|
564 |
+
*/
|
565 |
+
function get_galleries($args)
|
566 |
+
{
|
567 |
+
$retval = new IXR_Error(403, 'Invalid username or password');
|
568 |
+
$blog_id = intval($args[0]);
|
569 |
+
$username = strval($args[1]);
|
570 |
+
$password = strval($args[2]);
|
571 |
+
|
572 |
+
// Authenticate the user
|
573 |
+
if ($this->login($username, $password, $blog_id)) {
|
574 |
+
|
575 |
+
// Do we have permission?
|
576 |
+
$security = $this->get_registry()->get_utility('I_Security_Manager');
|
577 |
+
if ($security->is_allowed('nextgen_edit_gallery')) {
|
578 |
+
$mapper = C_Gallery_Mapper::get_instance();
|
579 |
+
$image_mapper = C_Image_Mapper::get_instance();
|
580 |
+
$storage = C_Gallery_Storage::get_instance();
|
581 |
+
$retval = array();
|
582 |
+
foreach ($mapper->find_all() as $gallery) {
|
583 |
+
// Vladimir's Lightroom plugins requires the 'id' to be a string
|
584 |
+
// Ask if he can accept integers as well. Currently, integers break
|
585 |
+
// his plugin
|
586 |
+
$gallery->gid = (string) $gallery->gid;
|
587 |
+
|
588 |
+
// Set other gallery properties
|
589 |
+
$image_counter = array_pop($image_mapper->select('COUNT(*) as counter')->where(array("galleryid = %d", $gallery->gid))->run_query());
|
590 |
+
$gallery->counter = $image_counter->counter;
|
591 |
+
$gallery->abspath = $storage->get_gallery_abspath($gallery);
|
592 |
+
$retval[$gallery->{$gallery->id_field}] = (array)$gallery;
|
593 |
+
}
|
594 |
+
}
|
595 |
+
else $retval = new IXR_Error( 401, __( 'Sorry, you must be able to manage galleries' ) );
|
596 |
+
}
|
597 |
+
|
598 |
+
return $retval;
|
599 |
+
}
|
600 |
+
}
|
601 |
+
|
602 |
+
new M_NextGen_XmlRpc;
|
products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php
CHANGED
@@ -33,18 +33,32 @@ function media_upload_nextgen() {
|
|
33 |
$img = nggdb::find_image($send_id);
|
34 |
$thumbcode = $img->get_thumbcode();
|
35 |
$class="ngg-singlepic ngg-{$image['align']}";
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
// Build output
|
38 |
if ($image['size'] == "thumbnail")
|
39 |
-
$html = "<img src='{$image['thumb']}' alt='$alttext' class='$class' />";
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
42 |
|
43 |
if ($image['size'] == "full")
|
44 |
-
$html = "<img src='{$image['url']}' alt='$alttext' class='$class' />";
|
45 |
|
46 |
if ($image['size'] == "singlepic")
|
47 |
-
$html = "[singlepic id
|
48 |
|
49 |
media_upload_nextgen_save_image();
|
50 |
|
33 |
$img = nggdb::find_image($send_id);
|
34 |
$thumbcode = $img->get_thumbcode();
|
35 |
$class="ngg-singlepic ngg-{$image['align']}";
|
36 |
+
|
37 |
+
// Create a shell displayed-gallery so we can inspect its settings
|
38 |
+
$registry = C_Component_Registry::get_instance();
|
39 |
+
$mapper = $registry->get_utility('I_Displayed_Gallery_Mapper');
|
40 |
+
$factory = $registry->get_utility('I_Component_Factory');
|
41 |
+
$args = array(
|
42 |
+
'display_type' => NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME
|
43 |
+
);
|
44 |
+
$displayed_gallery = $factory->create('displayed_gallery', $mapper, $args);
|
45 |
+
$width = $displayed_gallery->display_settings['width'];
|
46 |
+
$height = $displayed_gallery->display_settings['height'];
|
47 |
+
|
48 |
// Build output
|
49 |
if ($image['size'] == "thumbnail")
|
50 |
+
$html = "<img src='{$image['thumb']}' alt='{$alttext}' class='{$class}' />";
|
51 |
+
else
|
52 |
+
$html = '';
|
53 |
+
|
54 |
+
// Wrap the link to the fullsize image around
|
55 |
+
$html = "<a {$thumbcode} href='{$image['url']}' title='{$clean_description}'>{$html}</a>";
|
56 |
|
57 |
if ($image['size'] == "full")
|
58 |
+
$html = "<img src='{$image['url']}' alt='{$alttext}' class='{$class}' />";
|
59 |
|
60 |
if ($image['size'] == "singlepic")
|
61 |
+
$html = "[singlepic id={$send_id} w={$width} h={$height} float={$image['align']}]";
|
62 |
|
63 |
media_upload_nextgen_save_image();
|
64 |
|
products/photocrati_nextgen/modules/ngglegacy/changelog.txt
DELETED
@@ -1,718 +0,0 @@
|
|
1 |
-
NextGEN Gallery
|
2 |
-
by Photocrati Media
|
3 |
-
|
4 |
-
= V1.9.5 - 05.07.2012 =
|
5 |
-
* Changed: Branding changes following Photocrati acquisition (removed donation messages and updated links)
|
6 |
-
* Secured: Use WordPress-bundled JavaScript libraries for swfobject and swfupload instead of bundling our own
|
7 |
-
* Bugfix: Adjusted thickbox effect styling to ensure that the lightbox is always displayed in the foreground
|
8 |
-
* Bugfix: Fixed compatibility issues with Contact Form 7 and other plugins by following WordPress Plugin conventions
|
9 |
-
* Bugfix: Fixed network-wide activation in WordPress 3.4
|
10 |
-
* Bugfix: Plugin is no longer dependent on it's folder name
|
11 |
-
|
12 |
-
= V1.9.3 - 26.02.2012 =
|
13 |
-
* Bugfix : Ensure to set the slug for "all" albums
|
14 |
-
* Bugfix : Updated german translation ( THX to Roger Hunziker )
|
15 |
-
* Bugfix : Ensure error checking on IPTC array (THX to Kristian Edlund)
|
16 |
-
* Bugfix : Handle IE8 cached images better in slideshow
|
17 |
-
* Bugfix : Show album preview image if selected (THX to Kristian Edlund)
|
18 |
-
|
19 |
-
= V1.9.2 - 17.01.2012 =
|
20 |
-
* NEW : Added more XMLRPC commands (THX to Vladimir Vinogradsky)
|
21 |
-
* Changed : Rework Post-thumbnail function (THX to Kristian Edlund)
|
22 |
-
* Bugfix : Check first for valid images on unzip (only Mac OS zip-files)
|
23 |
-
* Bugfix : Increase z-index for twenty eleven theme
|
24 |
-
* Bugfix : Support non latin chars in tagcloud
|
25 |
-
* Bugfix : Allow other tinymce intance
|
26 |
-
* Bugfix : Better support for WPML translation
|
27 |
-
|
28 |
-
= V1.9.1 - 10.12.2011 =
|
29 |
-
* Bugfix : Security hardness for untrusted filenames/meta data (THX to Brian St. Pierre)
|
30 |
-
* Bugfix : Fixed security vulnerability (TXH to Jon Cave)
|
31 |
-
* Bugfix : Load piclens script via other function
|
32 |
-
* Bugfix : IE7 script fix for add gallery
|
33 |
-
* Bugfix : IE7/IE8 width set correctly for edit album autocomplete field
|
34 |
-
|
35 |
-
= V1.9.0 - 27.11.2011 =
|
36 |
-
* NEW : Keep images transparency for PNG and GIF format
|
37 |
-
* NEW : Switch to Plupload, support now HTML5 Upload (only with WordPress 3.3)
|
38 |
-
* NEW : Added client side resize feature (only with WordPress 3.3)
|
39 |
-
* NEW : Support for gallery templates in album shortcodes [ album id=x template="name" gallery="templatename" ]
|
40 |
-
* NEW : Added new hook ngg_delete_picture
|
41 |
-
* Changed : Updated to jQuery Cycle Version 2.9995
|
42 |
-
* Changed : Always cache the single pictures, remove option
|
43 |
-
* Bugfix : Couldn't use bulk operation for search results
|
44 |
-
* Bugfix : Bugfix for Edit thumbnails under IE 8 + 9
|
45 |
-
* Bugfix : Allow empty altext in ngg.editImage
|
46 |
-
* Bugfix : Various PHP notice fixes
|
47 |
-
* Bugfix : Resize fix for Shutter effect and mobile Browser
|
48 |
-
* Bugfix : FTP Import missing slug field into database
|
49 |
-
* Bugfix : Check also EXIF field "DateTimeOriginal" for timestamp
|
50 |
-
|
51 |
-
= V1.8.4 - 26.10.2011 =
|
52 |
-
* Bugfix : Fixed security vulnerability (TXH to Alain Schneider)
|
53 |
-
|
54 |
-
= V1.8.3 - 07.08.2011 =
|
55 |
-
* Changed : Support for simple custom permalink structures (i.e. /%category%/%postname%/)
|
56 |
-
* Bugfix : Sub-Albums in Albums didn't create the correct link
|
57 |
-
* Bugfix : AJAX Pagination didn't work anymore
|
58 |
-
* Bugfix : Adding index.php to home_url()
|
59 |
-
* Bugfix : Preview picture lost on backend gallery page 2 or higher
|
60 |
-
|
61 |
-
= V1.8.2 - 12.07.2011 =
|
62 |
-
* Bugfix : Set pagination variables for search result, otherwise update failed
|
63 |
-
* Bugfix : Update failed for paged galleries since WordPress 3.2
|
64 |
-
|
65 |
-
= V1.8.1 - 18.06.2011 =
|
66 |
-
* Bugfix : Special case for pagination, instead of showing page-1, we show the clean url
|
67 |
-
* Bugfix : Various PHP notice fixes
|
68 |
-
* Bugfix : Typo in rewrite rules
|
69 |
-
* Bugfix : Flush rewrite rules during upgrade later
|
70 |
-
|
71 |
-
= V1.8.0 - 12.06.2011 =
|
72 |
-
* NEW : Full rework of permalink url structure
|
73 |
-
* NEW : Adding Google Sitemaps for Images (require WordPress SEO plugin by YOAST )
|
74 |
-
* NEW : Support for WPML ( WordPress Multilingual Plugin )
|
75 |
-
* NEW : Adding support for arrow key in shutter effect (THX to Flyvans)
|
76 |
-
* NEW : Adding sort operation for galleries overview page
|
77 |
-
* Changed : Updated pagination to new WP3.1 style
|
78 |
-
* Bugfix : Create unique slug in a better way
|
79 |
-
* Bugfix : Rework screen options filter for gallery and image table
|
80 |
-
* Bugfix : Empty values in XMLRPC update calls are ignored
|
81 |
-
* Bugfix : Create gallery failed when safe-mode on
|
82 |
-
* Bugfix : Permalink didn't work in combination with album & imagebrowser
|
83 |
-
|
84 |
-
= V1.7.4 - 15.02.2011 =
|
85 |
-
* Bugfix : Disallow direct call of ajax file to avoid path disclosure (THX to High-Tech Bridge SA)
|
86 |
-
* Bugfix : Rework jQuery Cycle slideshow for IE compat reason (THX to Justin Dickenson)
|
87 |
-
* Bugfix : Resize only larger images in slideshow
|
88 |
-
* Bugfix : Improved image format detection in gd.thumbnail class (THX to Kupar.b)
|
89 |
-
|
90 |
-
= V1.7.3 - 20.01.2011 =
|
91 |
-
* NEW : Introduce plugin health check for conflicts with other plugins/themes
|
92 |
-
* NEW : Adding new XMLRPC method ngg.deleteImage
|
93 |
-
* NEW : Adding new XMLRPC method ngg.editImage
|
94 |
-
* Changed : Rework register script for autocomplete feature
|
95 |
-
* Bugfix : Bugfix for Multisite setup and flash upload
|
96 |
-
* Bugfix : WP3.1 compat issue, show site admin page only on Multisite installation
|
97 |
-
|
98 |
-
= V1.7.2 - 13.12.2010 =
|
99 |
-
* Bugfix : Adding images to database require slug
|
100 |
-
|
101 |
-
= V1.7.1 - 13.12.2010 =
|
102 |
-
* Changed : Disable upgrade for PHP4 user
|
103 |
-
* Changed : Disable colorpicker for option page
|
104 |
-
* Bugfix : Compat fix for upgrade
|
105 |
-
|
106 |
-
= V1.7.0 - 11.12.2010 =
|
107 |
-
* NEW : Publish a new post direct from the gallery admin page
|
108 |
-
* NEW : Added filter hook 'ngg_get_image_metadata' to add more exif/iptc information
|
109 |
-
* NEW : Adding Autocomplete field to TinyMCE Popup and Album page
|
110 |
-
* NEW : More methods for XMLRPC interface
|
111 |
-
* Changed : New hooks for gallery table (THX to Alexander Schneider)
|
112 |
-
* Changed : Introduce jQuery dialog as new UI element
|
113 |
-
* Changed : Call TinyMCE window via admin-ajax
|
114 |
-
* Bugfix : Better support for SSL blogs
|
115 |
-
* Bugfix : Install/Upgrade failed when table prefix contain captial letters
|
116 |
-
* Bugfix : Fix validation issues in Media-RSS
|
117 |
-
* Bugfix : Empty tags in XMP Meta causes PHP error
|
118 |
-
* Bugfix : Rework load mechanism for slideshow
|
119 |
-
* Bugfix : Copy meta data when image is copied
|
120 |
-
* Bugfix : Icon Support for Ozh' Admin Drop Down Menu
|
121 |
-
* Bugfix : Use correct sort order in slideshow
|
122 |
-
|
123 |
-
= V1.6.2 - 19.09.2010 =
|
124 |
-
* NEW : Added constant NGG_SKIP_LOAD_SCRIPTS to avoid script load
|
125 |
-
* Bugfix : Load Tags library with core files
|
126 |
-
* Bugfix : Slideshow script failed in IE7, load script now in header
|
127 |
-
* Bugfix : Load slideshow widget always
|
128 |
-
* Changed : New admin notice for database upgrade
|
129 |
-
* Changed : Rework crop feature for featured images
|
130 |
-
* Changed : Use site_url() instead get_option ('siteurl'), required for SSL support
|
131 |
-
|
132 |
-
= V1.6.1 - 08.09.2010 =
|
133 |
-
* Bugfix : Script load of swfobject.js failed
|
134 |
-
* Bugfix : Show sideshow also with 1 or 2 images
|
135 |
-
* Bugfix : Rework null byte check in zip upload
|
136 |
-
|
137 |
-
= V1.6.0 - 07.09.2010 =
|
138 |
-
* NEW : Wordpress 3.0 Network (Multi-Site) support
|
139 |
-
* NEW : Integrate jQuery Cycle as NON-Flash slideshow
|
140 |
-
* NEW : Adding jQuery File Tree for import folder (THX to Sergey Pasyuk )
|
141 |
-
* NEW : Added action hook 'ngg_show_imagebrowser_first' on custom request
|
142 |
-
* NEW : Added filter hook 'ngg_slideshow_size' to resize sildeshow for mobile browser plugins
|
143 |
-
* Changed : Reorder tabs for upload
|
144 |
-
* Changed : New menu icon and screen icon (THX to Ben Dunkle)
|
145 |
-
* Changed : Load frontend libs always
|
146 |
-
* Changed : Rework of overview page
|
147 |
-
* Bugfix : Security bugfix for Zip-Upload (THX to Dominic Szablewski)
|
148 |
-
* Bugfix : Allow JPG, PNG, GIF extension
|
149 |
-
* Bugfix : New German translation (THX to Martin Kramarz)
|
150 |
-
* Bugfix : Copy/Move also backup file
|
151 |
-
* Bugfix : Calculate correct ratio for fix thumbnail size (THX to Alekz Keck)
|
152 |
-
|
153 |
-
= V1.5.5 - 14.06.2010 =
|
154 |
-
* Bugfix : Compat issue for post thumbnails with WP2.9
|
155 |
-
* NEW : Adding more hooks for custom fields plugin
|
156 |
-
|
157 |
-
= V1.5.4 - 14.06.2010 =
|
158 |
-
* Bugfix : No resize of smaller images
|
159 |
-
* Bugfix : Compat issues for Post Thumbnails under WP3.0
|
160 |
-
* Bugfix : Esc_URL in Media RSS
|
161 |
-
|
162 |
-
= V1.5.3 - 11.04.2010 =
|
163 |
-
* New : Adding pagination to footer
|
164 |
-
* Changed : Prepare new filter to replace slideshow
|
165 |
-
* Bugfix : Remove non-breaking space from navigation
|
166 |
-
* Bugfix : Pagination of galleries
|
167 |
-
* Bugfix : Fixed brackets position for old shortcode query
|
168 |
-
* Bugfix : Slideshow option 'Show next image on click" has wrong default value
|
169 |
-
|
170 |
-
= V1.5.2 - 25.03.2010 =
|
171 |
-
* Bugfix : XSS security vulnerability (THX to Core Security Advisories Team , Pedro Varangot)
|
172 |
-
* Bugfix : Missing $wpdb in shortcodes.php
|
173 |
-
|
174 |
-
= V1.5.1 - 23.03.2010 =
|
175 |
-
* Bugfix : PHP4 compat issue for Add gallery & options page
|
176 |
-
* Bugfix : Gallery widget can now have a empty title
|
177 |
-
* Bugfix : Adding correct stripslash for gallery title
|
178 |
-
|
179 |
-
= V1.5.0 - 18.03.2010 =
|
180 |
-
* NEW : Support for Post thumbnail feature
|
181 |
-
* NEW : Backup and Recover function for images (THX to Simone Fumagalli)
|
182 |
-
* NEW : Resize images after upload (THX to Simone Fumagalli)
|
183 |
-
* NEW : Added a JSON class for fetching galleries in a RESTful way (see xml/json.php)
|
184 |
-
* NEW : Adding various new capabilities for user roles
|
185 |
-
* NEW : Auto downloader for translation file
|
186 |
-
* Changed : Rename query var from slideshow to callback for compat reason with other plugin
|
187 |
-
* Changed : Convert widget function to new WP structure
|
188 |
-
* Changed : Include lookup for tags into the backend search
|
189 |
-
* Changed : Restructure addgallery and settings page to enable custom tabs
|
190 |
-
* Bugfix : Select album preview from gallery preview pics instead random list
|
191 |
-
* Bugfix : Keep fix dimension in edit thumbnail operation
|
192 |
-
* Bugfix : Import meta data didn't work correct for existing images
|
193 |
-
* Bugfix : Fix onload bug for Chrome 4 in Shutter script
|
194 |
-
* Bugfix : Remove various PHP notices for a better world
|
195 |
-
* Removed : Canonical link is now part of Wordpress 2.9
|
196 |
-
|
197 |
-
= V1.4.3 - 16.11.2009 =
|
198 |
-
* Bugfix : Urlencode XML file path for sildeshow
|
199 |
-
|
200 |
-
= V1.4.2 - 16.11.2009 =
|
201 |
-
* Changed : Load sildeshow XML not longer via relative path
|
202 |
-
* Bugfix : No imagebrowser in carousel mode
|
203 |
-
* Bugfix : JS Effect navigation based on wrong array structure
|
204 |
-
* Bugfix : Remove whitespaces from meta import
|
205 |
-
* Bugfix : Capability check for upgrade notice
|
206 |
-
* Removed : Hide "more settings" for now, causes problems with IE and jQuery UI tabs
|
207 |
-
|
208 |
-
= V1.4.1 - 10.11.2009 =
|
209 |
-
* Bugfix : Capabilites could not be saved
|
210 |
-
* Bugfix : Ajax pagination option not saved
|
211 |
-
* Bugfix : echo nggSlideshowWidget() for compat reason
|
212 |
-
|
213 |
-
= V1.4.0 - 08.11.2009 =
|
214 |
-
* NEW : Automatic rotate images during upload or via manage gallery page (THX to Simone Fumagalli)
|
215 |
-
* NEW : Include Bulkupdate for gallery overview, require PHP 5.2
|
216 |
-
* NEW : XMLRPC support with 4 new methods : see xmlrpc.php for more information
|
217 |
-
* NEW : Recent and random images can be taken from a specific gallery using the id=x parameter in the shortcode (THX to Prollius)
|
218 |
-
* NEW : Recent images can be recent by exif date (instead of database id) by using the mode=recentdate parameter in the shortcode (THX to Prollius)
|
219 |
-
* NEW : Introduce the WP_Object_cache and meta_data
|
220 |
-
* NEW : Various new hooks and filters
|
221 |
-
* Added : Better support for role manager plugin (THX to Mattias Buelens)
|
222 |
-
* Added : New option to add hidden images. Needed to show all images in a modal window (Thickbox, Lightbox et.)
|
223 |
-
* Added : New link parameter for the singlepic shortcode : [singlepic id=x w=x h=x link="http://google.com"]
|
224 |
-
* Added : New template gallery-carousel
|
225 |
-
* Added : New id parameter for recent and random shortcodes : [random max="7" template="filename" id="2"] takes only pictures from the gallery with id=2
|
226 |
-
* Added : New mode parameter for recent shortcode : [recent max="7" template="filename" id="3" mode="date" /] where mode can be one of (id, date, sort). Recent pictures are delivered by addition to database (id), exif date (date) or user sort order (sort).
|
227 |
-
* Added : Enable/Disable Ajax navigation via settings
|
228 |
-
* Added : New filter hook 'ngg_render_template' to render templates with a other plugin
|
229 |
-
* Changed : Added option to link an album with a page id
|
230 |
-
* Changed : Support templates for child themes, use STYLESHEETPATH instead TEMPLATEPATH (THX to Prollius)
|
231 |
-
* Changed : Rework of Media RSS Widget
|
232 |
-
* Bugfix : Check capability to create a new page
|
233 |
-
* Bugfix : Fix double call of filter name , changed to ngg_picturelist_object (THX to Prollius)
|
234 |
-
* Bugfix : Check for a deleted gallery in a album
|
235 |
-
|
236 |
-
= V1.3.6 - 20.09.2009 =
|
237 |
-
* Changed : Just change the feed link
|
238 |
-
|
239 |
-
= V1.3.5 - 17.07.2009 =
|
240 |
-
* Bugfix : Fixed XSS issue for Page title
|
241 |
-
|
242 |
-
= V1.3.4 - 07.07.2009 =
|
243 |
-
* Added : New filter ngg_gallery_object and ngg_image_object
|
244 |
-
* Bugfix : Fix double rendering of a gallery if two album shortcodes are used
|
245 |
-
* Bugfix : Fix for custom field ngg_gal_sort
|
246 |
-
* Bugfix : Changed capability check for upload
|
247 |
-
* Bugfix : Check for correct version OR memory limit
|
248 |
-
|
249 |
-
= V1.3.3 - 11.06.2009 =
|
250 |
-
* Changed : Load Thickbox images via wp_footer()
|
251 |
-
* Bugfix : Widget setting couldnot be saved
|
252 |
-
|
253 |
-
= V1.3.2 - 10.06.2009 =
|
254 |
-
* Changed : Resize maximum to 1280 x 1280 with nggshow (THX to onezero)
|
255 |
-
* Bugfix : Bugfix for Multifile upload
|
256 |
-
* Bugfix : Bugfix for sortorder under jQuery 1.3
|
257 |
-
* Bugfix : Workaround for more albums per page, need more rework
|
258 |
-
* Bugfix : AJAX reload didn't work if slideshow is shown by default
|
259 |
-
* Bugfix : Redirect links didn't work if permalinks are deactivates
|
260 |
-
* Bugfix : Add new gallery in manage-overview didn't use defaultpath
|
261 |
-
|
262 |
-
= V1.3.1 - 07.06.2009 =
|
263 |
-
* Bugfix : Fixed ZIP upload, wrong variable used
|
264 |
-
* Bugfix : Check for array before foreach in album missing
|
265 |
-
|
266 |
-
= V1.3.0 - 07.06.2009 =
|
267 |
-
* NEW : Subalbum support
|
268 |
-
* NEW : Search for images in the admin tab
|
269 |
-
* NEW : Add new gallery also in manage tab
|
270 |
-
* NEW : AJAX support for Imagebrowser and gallery navigation (THX to Anty)
|
271 |
-
* NEW : Added zip upload via URL (THX to Juan Jose Galvez)
|
272 |
-
* Added : jQuery Multiple File Upload Plugin v1.44
|
273 |
-
* Added : SWFUpload V2.2.0
|
274 |
-
* Changed : Remove extension for Alttext during first import
|
275 |
-
* Changed : Meta tag added via wp_head hook (THX to Viper)
|
276 |
-
* Bugfix : Correct various PHP notice messages
|
277 |
-
* Bugfix : Typo fix in custom fields for ngg_gal_ImageBrowser
|
278 |
-
* Bugfix : Avoid upload of images in gallery without correct capability
|
279 |
-
|
280 |
-
= V1.2.1 - 22.03.2009 =
|
281 |
-
* NEW : Support for IE8 Web Slices in widgets
|
282 |
-
* NEW : Add filter ngg_image_object
|
283 |
-
* Changed : Descending order in add gallery menu
|
284 |
-
* Bugfix : Exclude option didnT work for multi pages
|
285 |
-
* Bugfix : Check for correct capability in manage gallery
|
286 |
-
|
287 |
-
= V1.2.0 - 09.03.2009 =
|
288 |
-
* NEW : Support for image tag cloud with shortcode [tagcloud]
|
289 |
-
* NEW : Adding shortcode [recent max="7" template="filename" /] & [random max="7" template="filename" /] to show the most recent/random pictures (THX to Bernhard)
|
290 |
-
* NEW : Crop thumbnails manually (THX to Simone Fumagalli)
|
291 |
-
* NEW : Support for i18n with polyglot or qtrans plugin (THX to Boris Glumpler)
|
292 |
-
* NEW : Canonical meta link support
|
293 |
-
* Added : SWFUpload V2.2.0 B5
|
294 |
-
* Added : New memory limit check in upload screen
|
295 |
-
* Bugfix : Language typo fixes
|
296 |
-
* Bugfix : Admin Pagination fix
|
297 |
-
* Bugfix : Typo fix in widgets
|
298 |
-
* Bugfix : Init column script after document is ready
|
299 |
-
* Bugfix : htmlspecialchars() instead htmlentities() for links in the a href title description
|
300 |
-
* Bugfix : Upgrade routine didn't add sortorder to correct table (THX to Uwe)
|
301 |
-
* Bugfix : Correct shotcode in media upload tab
|
302 |
-
|
303 |
-
= V1.1.0 - 26.01.2009 =
|
304 |
-
* NEW : Pagination for album page via custom fields ('ngg_paged_Galleries')
|
305 |
-
* NEW : Support for fixed number of columns inside the gallery
|
306 |
-
* NEW : Added pagination for galleries and images in admin section
|
307 |
-
* NEW : New action hook after image is added to database, called 'ngg_added_new_image'
|
308 |
-
* NEW : New template for caption below images, called via [nggallery id=x template=caption]
|
309 |
-
* Added : SWFUpload V2.2.0 B4
|
310 |
-
* Changed : Rework of Manage image tables
|
311 |
-
* Changed : Move imagerotator.swf to wp-content/uploads
|
312 |
-
* Changed : Added a URL field to setup the path to the Imagerotator
|
313 |
-
* Changed : Add additional parameter to gallery object
|
314 |
-
* Changed : Load donators list external
|
315 |
-
* Bugfix : Style fixes for tables in IE7
|
316 |
-
* Bugfix : All albums code couldn't use the slideshow, query is empty for 0
|
317 |
-
* Bugfix : Htmlentities() for links in the a href title description
|
318 |
-
* Bugfix : Clean up mode for singlepic
|
319 |
-
* Bugfix : Typo in widget settings
|
320 |
-
|
321 |
-
= V1.0.2 - 19.12.2008 =
|
322 |
-
* Added : Option to enable/disable the MediaRSS Feed
|
323 |
-
* Added : For flash under FF3/WIN we should use outline: none;
|
324 |
-
* Added : Use sort order also for Media RSS
|
325 |
-
* Changed : Descending order for TinyMCE Editor
|
326 |
-
* Changed : Added screencolor flashvar as bgcolor for the flash slideshow
|
327 |
-
* Changed : Remove link to gallery in sidebar widget
|
328 |
-
* Bugfix : Check for empty gallery title and show name instead
|
329 |
-
* Bugfix : Album id=all / Album id=0 didn't show content
|
330 |
-
* Bugfix : Check for a empty description and alttext
|
331 |
-
* Bugfix : Remove HTML tags from slideshow
|
332 |
-
* Bugfix : Load SWFobject always when the imagerotator exist
|
333 |
-
* Bugfix : Zip-Upload in existing gallery failed
|
334 |
-
* Bugifx : Typo in functions.php (THX to David Horat)
|
335 |
-
|
336 |
-
= V1.0.1 - 11.12.2008 =
|
337 |
-
* Bugfix : Change upgrade routine, import_date_time could cause a memory problem
|
338 |
-
* Bugfix : Help pages will not show up in non-english enviroment
|
339 |
-
* Bugfix : Show gallery name if title is empty
|
340 |
-
|
341 |
-
= V1.0.0 - 11.12.2008 =
|
342 |
-
* NEW : Adding some rewrite rules for the Blog title for a better SEO (Will be continued...)
|
343 |
-
* NEW : Added ImageMagick support (currently a bit experimental) (THX to Frederic de Ranter)
|
344 |
-
* NEW : Automatic unistall via register_uninstall_hook()
|
345 |
-
* NEW : Added a presort option to sort easier the images
|
346 |
-
* NEW : Lookup for a nggallery.css in the theme folder
|
347 |
-
* NEW : Added Date/Time field to database and import it from EXIF, new sort option
|
348 |
-
* NEW : Multi Widgets to show links to Media RSS feeds (THX to Vincent Prat)
|
349 |
-
* NEW : PicLens support for galleries (THX to Vincent Prat)
|
350 |
-
* NEW : Copy/Move images between galleries (THX to Vincent Prat)
|
351 |
-
* NEW : Media RSS feeds (either for galleries, albums or global) (THX to Vincent Prat)
|
352 |
-
* NEW : Image tag management (THX to Vincent Prat)
|
353 |
-
* NEW : Convert all shortcodes to WP shortcodes API
|
354 |
-
* NEW : AJAX based thumbnail generator
|
355 |
-
* NEW : Create output via template files, more flexible and support for multiple templates
|
356 |
-
* NEW : Extended role system. Each gallery has now a author
|
357 |
-
* NEW : [thumb id="4,5,12,..."] shortcode. You can now insert thumbnails for one or more images (that are not necessarly inside the same gallery).
|
358 |
-
* Changed : Add swfupload 2.2.0. Support for Adobe Flash 10 upload
|
359 |
-
* Changed : Update all Admin pages for Wordpress 2.7 Admin UI
|
360 |
-
* Changed : New icon for TinyMCE and WP2.7 Menue from http://www.pinvoke.com/
|
361 |
-
* Changed : Move update message to admin.php
|
362 |
-
* Changed : Widgets are now core and doesn't need to be activate, rework as Multi Widgets
|
363 |
-
* Changed : Improved the gallery management page.
|
364 |
-
* Changed : Rename the filter 'ngg_create_gallery_thumbcode' to 'ngg_get_thumbcode'.
|
365 |
-
* Changed : Convert tags to WP-Taxonomy tables, no more need for ngg_tags, ngg_pic2tags
|
366 |
-
* Changed : Arrange manage fields in a new way
|
367 |
-
* Changed : Support now SSL
|
368 |
-
* Changed : Use JQuery UI instead of interface lib
|
369 |
-
* Changed : Updated to swfobject 2.1
|
370 |
-
* Changed : Rework of database queries and new central nggdb class
|
371 |
-
* Bugfix : Changed CSS for singlepic padding to margin
|
372 |
-
* Bugfix : Check for zero in Exif Focal Length
|
373 |
-
* Bugfix : Round instead inval for square thumbnails
|
374 |
-
* Removed : Do not longer check for myGallery folders
|
375 |
-
* Removed : Use now PclZip from WP Core
|
376 |
-
* Removed : Wordpress 2.1 - 2.3 files deleted
|
377 |
-
|
378 |
-
= V0.99 - 27.09.2008 =
|
379 |
-
* Changed : Included swfobject version 2.1
|
380 |
-
* Bugfix : Recognize the zip better
|
381 |
-
* Bugfix : Limit the length of the title in the media-upload
|
382 |
-
* Bugfix : Round instead inval for square thumbnails
|
383 |
-
|
384 |
-
= V0.98 - 15.07.2008 =
|
385 |
-
* Bugfix : Removed all whitespaces at EOF
|
386 |
-
|
387 |
-
= V0.97 - 10.07.2008 =
|
388 |
-
* Changed : Get new path contstant from WP2.6
|
389 |
-
* Changed : Minor updates for WP2.6
|
390 |
-
* Changed : Added new filters (THX to Vincent Prat)
|
391 |
-
* Removed : Revert singlepic wrapper, breaks validation
|
392 |
-
|
393 |
-
= V0.96 - 18.05.2008 =
|
394 |
-
* Changed : Use postbox for gallery settings
|
395 |
-
* Added : New filter function to add custom columns
|
396 |
-
* Bugfix : Fixed width for Thickbox in Manage gallery
|
397 |
-
* Bugfix : fixed width for media upload select box
|
398 |
-
* Bugfix : Remove <p> tag in singlepic regex
|
399 |
-
* Bugfix : Correct format of shutter speed
|
400 |
-
* Bugfix : Album name in Short code not useable
|
401 |
-
|
402 |
-
= V0.95 - 25.04.2008 =
|
403 |
-
* Bugfix : Correction in media-upload to fit with Wordpress 2.5.1
|
404 |
-
* Bugfix : Attribute_escape all objects in media-upload
|
405 |
-
* Bugfix : Correct sortorder for albums
|
406 |
-
* Bugfix : Typo correction (THX to Momo-I)
|
407 |
-
|
408 |
-
= V0.94 - 20.04.2008 =
|
409 |
-
* Added : New filter option ngg_create_gallery_link
|
410 |
-
* Changed : Reduce amount of DB queries in albums (Big THX to Alexandr Kindras)
|
411 |
-
* Changed : Revert wpautop priority change. Doesn't good for other plugins
|
412 |
-
|
413 |
-
= V0.93 - 12.04.2008 =
|
414 |
-
* Added : Select Full-Size or Singlepic in Media Upload
|
415 |
-
* Added : Check for minimum 8 MB Memory
|
416 |
-
* Changed : Priority from wpautop must be before gallery
|
417 |
-
* Bugfix : Added Screencolor to Widgets
|
418 |
-
* Bugfix : Clean CSS class in setup.php
|
419 |
-
* Bugfix : Change PHP short tag (Thx to Archedition)
|
420 |
-
* Bugfix : Remove tab.png from CSS (Thx to Frisco)
|
421 |
-
* Bugfix : Remove newline and encode quotes in Media-Upload (THX to Trip Mellinger)
|
422 |
-
|
423 |
-
= V0.92 - 30.03.2008 =
|
424 |
-
* Changed : Higher priority for filter in WP2.5 final
|
425 |
-
* Changed : Do not increase memory_limit with ini_set
|
426 |
-
* Added : Read EXIF field ImageDescription
|
427 |
-
|
428 |
-
= V0.91 - 24.03.2008 =
|
429 |
-
* Changed : Resample mode back to 3
|
430 |
-
* Changed : Add DIV "ngg-singlepic-wrapper" for SingelPic (THX to Travel-Junkie)
|
431 |
-
* Changed : Increase Tweakfactor for Memory Check
|
432 |
-
* Bugfix : Use admin.css only on NextGEN pages (THX tp Oliver)
|
433 |
-
* Bugfix : Updates widgets (V1.21) for ImageRotator 3.15
|
434 |
-
* Bugfix : Change order of rewrite rules for WP 2.5
|
435 |
-
* Bugfix : Include Dashboard CSS also for page "nextgen-gallery"
|
436 |
-
|
437 |
-
= V0.90 - 18.03.2008 =
|
438 |
-
* NEW : Sort order for images
|
439 |
-
* NEW : Updated style for Wp 2.5
|
440 |
-
* NEW : Media upload tab integration for WP 2.5
|
441 |
-
* Added : Change wp shortcode filter
|
442 |
-
* Added : TinyMCE V3 Button for WordPress 2.5
|
443 |
-
* Added : Singlepic center class
|
444 |
-
* Changed : New default parameter for ImageRotator 3.15
|
445 |
-
* Changed : By default enable metadata import
|
446 |
-
* Changed : Moved disable/enable flash setting to add gallery
|
447 |
-
* Changed : wpdb->escape gallerytag in nggfunctions
|
448 |
-
* Changed : Sort files after scan folder
|
449 |
-
* Changed : Check for filename during upload
|
450 |
-
* Changed : Remove jQuery plugin for navigation
|
451 |
-
* Changed : Remove myGallery import
|
452 |
-
* Changed : Resample mode default set to 5, causes problems at PHP 4.4.8 /PHP 5.2.4
|
453 |
-
* Bugfix : nggextractXML missing stripslashes
|
454 |
-
* Bugfix : P tags not closed in manage.php
|
455 |
-
* Bugfix : Remove " from singlepic class
|
456 |
-
* Bugfix : Rewrite rule for ImageBrowser added
|
457 |
-
|
458 |
-
= V0.83 - 14.02.2008 =
|
459 |
-
* Changed : New Interfaces.js from WP Core 2.5, for sortable bug under IE7
|
460 |
-
* Changed : Update to jQuery V1.2.2, deregister older version from WP
|
461 |
-
* Changed : Add ini_set 128MB for memory-limit
|
462 |
-
* Bugfix : SWFUpload Cookie Post_Params are overwritten , no upload possible
|
463 |
-
* Bugfix : WPMU options are not saved after installation
|
464 |
-
* Bugfix : Remove Flush rewrite rules during install
|
465 |
-
|
466 |
-
= V0.82 - 09.02.2008 =
|
467 |
-
* Bugfix : add_filter (searchnggallerytags) not proper included for some other plugins
|
468 |
-
|
469 |
-
= V0.81 - 04.02.2008 =
|
470 |
-
* Changed : Use stristr first to reduce CPU cycles (THX to Alakhnor)
|
471 |
-
* Changed : Flush Rewrites rules after option update
|
472 |
-
* Changed : Rework for folder check under Safe-Mode
|
473 |
-
* Bugfix : Check for array in get_option() (THX to Alessandro)
|
474 |
-
* Bugfix : Add Cookie to SWFUpload, show Error code included
|
475 |
-
* Bugfix : galShowOrder = Sildeshow at first didn't work
|
476 |
-
* Bugfix : Remove reference from ngg_getOnlyImages
|
477 |
-
|
478 |
-
= V0.80 - 02.02.2008 =
|
479 |
-
* NEW : SWFUpload integrated : Show upload progress and select multiple files in the file browser dialog.
|
480 |
-
* NEW : Progress bar for resize, watermark and thumbnail operation
|
481 |
-
* NEW : Import Meta data from images
|
482 |
-
* NEW : Show Meta data information
|
483 |
-
* NEW : Cache option for SinglePic
|
484 |
-
* NEW : Permalink support
|
485 |
-
* NEW : Custom fields support - Change the settings for each post/page
|
486 |
-
* Changed : Up to 10 Widgets, exclude galleries from random/recent images.
|
487 |
-
* Changed : Refactor permission check for Safe-Mode Check and mkdir/chmod
|
488 |
-
* Changed : Admin CSS in new folder/file for better structure
|
489 |
-
* Changed : Clean up folder structure
|
490 |
-
* Changed : Clean up code in manage.php, functions.php
|
491 |
-
* Changed : Moved several functions into nggAdmin Class (functions.php)
|
492 |
-
* Changed : Update to jQuery V1.1.4 (v1.2.1 causes problems with interface.js)
|
493 |
-
* Changed : Hide used galleries in album admin page
|
494 |
-
* Changed : Remove float in singlepic code and added class ngg-left , ngg-right (THX to Nathan Sylvain)
|
495 |
-
* Changed : Edit style setting (added new class .desc , THX to Sebastian)
|
496 |
-
* Changed : Check for galleryfolder instead name (THX to Luke Poland)
|
497 |
-
* Changed : Delete images per default
|
498 |
-
* Changed : Change CSS (ngg-album-compact) , remove width & height setting from code
|
499 |
-
* Bugfix : Fixed static front page problem
|
500 |
-
* Bugfix : Missing stripslashes & html_entity_decode
|
501 |
-
* Bugfix : Change Album CSS (THX to Thomas-DK)
|
502 |
-
* Bugfix : Watermark for GIF not correct supported
|
503 |
-
* Bugfix : Missing wp_nonce at setup page
|
504 |
-
* Bugfix : Add DIV in Slideshow link (for Safari & Opera)
|
505 |
-
* Added : Screencolor flashvar for JW Image Rotator 3.13 or higher
|
506 |
-
* Added : Set WP-CHARSET / COLLATE during installation
|
507 |
-
* Added : Updated to Pclzip.lib.php v2.6
|
508 |
-
* Added : CSS ID field for gallery & images
|
509 |
-
* WPMU : New site admin page (wpmu.php)
|
510 |
-
* WPMU : Integrated quota check
|
511 |
-
* WPMU : No update check
|
512 |
-
* WPMU : Remove edit style (THX to Kristin)
|
513 |
-
* WPMU : Remove uninstall button
|
514 |
-
* WPMU : Remove server settings
|
515 |
-
* WPMU : Gallery path set to blog.dir
|
516 |
-
* Added : Support for WPMU
|
517 |
-
|
518 |
-
= V0.74 - 01.12.2007 =
|
519 |
-
* NEW : Added meta reader class, first step to integrated meta data import
|
520 |
-
|
521 |
-
= V0.73 - 20.10.2007 =
|
522 |
-
* Added : Support for Shutter Reloaded
|
523 |
-
* Update to jQuery Tabs 2.7.4
|
524 |
-
* Changed : Remove $_SERVER['REQUEST_URI'] for IIS compatibility
|
525 |
-
* Bugfix : Option Sildeshow didn't jump to overview
|
526 |
-
|
527 |
-
= V0.72 - 13.09.2007 =
|
528 |
-
* Added : Missing overflow:hidden in ngg-album.css
|
529 |
-
* Added : New experimental stylesheet hovereffect.css
|
530 |
-
* Changed : Better check for memory limit in zip-files
|
531 |
-
* Bugfix : Missing stripslashes for alttext (THX to Lawrence)
|
532 |
-
* Bugfix : Navigation didn't highlight page 1 (THX to Brot)
|
533 |
-
* Bugfix : Albums automatic minimize if more than 4 galleries
|
534 |
-
* Bugfix : Missing check_admin_referer in style (THX again to Christopher)
|
535 |
-
|
536 |
-
= V0.71 - 07.09.2007 =
|
537 |
-
* Added : Add defer="defer" to Slideshow to avoid IE crash (THX to Simbo)
|
538 |
-
* Bugfix : Bugfix for slideshow to show all pictures
|
539 |
-
* Bugfix : Wrong check_admin_referer in albums (THX to Christopher)
|
540 |
-
* Bugfix : No exclude check in counter and widgets (THX to Christopher)
|
541 |
-
* Bugfix : Check for existing role (THX to Lost in Network)
|
542 |
-
* Bugfix : Label in roles are wrong (THX to Joern)
|
543 |
-
|
544 |
-
= V0.70 - 06.09.2007 =
|
545 |
-
* NEW : Add role manager page and capabilities
|
546 |
-
* NEW : Show gallery with [tags=list of tags]
|
547 |
-
* NEW : Show album with [albumtags=list of tags]
|
548 |
-
* NEW : Tag system for all images
|
549 |
-
* NEW : Option for append related images
|
550 |
-
* NEW : Option to show description below thumbnail
|
551 |
-
* NEW : Option to show ImageBrowser instead JS effect
|
552 |
-
* Added : Add Full size link to thickbox
|
553 |
-
* Added : Check for page/postid in tag processing
|
554 |
-
* Added : Sildeshow widget can now contain all images
|
555 |
-
* Added : Minimize/Maximize option for albums
|
556 |
-
* Added : Deregister jQuery V1.1.2 for WP2.2 (to use V1.1.3.1)
|
557 |
-
* Added : Integrate wp_nonce_field at all admin pages
|
558 |
-
* Changed : Update to Thickbox 3.1 + mods for NextGEN gallery
|
559 |
-
* Changed : Moved "clear:both" into class "ngg-clear" (THX to Gero)
|
560 |
-
* Changed : Switched from jQuery Interface to jQuery Tabs from Klaus Hartl
|
561 |
-
* Remove : Remove option for singlepic link
|
562 |
-
* Remove : Remove options for imagebrowser
|
563 |
-
* Bugfix : Most Recent image in Widget are wrong
|
564 |
-
* Bugfix : More XHTML valid , htmlspecialchars() after add_query_arg()
|
565 |
-
* Bugfix : Sanitize file name before upload
|
566 |
-
* Bugfix : Sanitize folder name (THX to Tom Fowler)
|
567 |
-
* Bugfix : Show title/alt in jQuery plugin (THX to Gregory Green)
|
568 |
-
* Bugfix : i18n support for Gallery tab
|
569 |
-
* Bugfix : Reduce memory-needs for plugin
|
570 |
-
* Bugfix : Typo/spelling correction
|
571 |
-
* Bugfix : Removed myGallery author from contribute list
|
572 |
-
|
573 |
-
= V0.64 - 31.07.2007 =
|
574 |
-
* Bugfix : Remove arrows in image browser text
|
575 |
-
* Bugfix : Include nggadmintab.php with dirname
|
576 |
-
* Bugfix : Zip-Upload under Mac > look for basename
|
577 |
-
|
578 |
-
= V0.63 - 10.07.2007 =
|
579 |
-
* NEW : You can now upload a zip file into a existing gallery
|
580 |
-
* Added : Remove subfolder in Zip-files
|
581 |
-
* Added : Show required memory for thumbnail creation
|
582 |
-
* Added : Updated to jQuery.multifile 1.22
|
583 |
-
* Added : Install-Upgrade for WordPress 2.3
|
584 |
-
* Bugfix : Supress unlink error message for thumbs
|
585 |
-
* Bugfix : Support upload of zip files from MAC
|
586 |
-
* Bugfix : Add Stripslash for image description
|
587 |
-
* Bugfix : Use for Singlepic not rel="Gallery name"
|
588 |
-
* Bugfix : Moved RSS/Snoopy includes into function
|
589 |
-
|
590 |
-
= V0.62 - 06.07.2007 =
|
591 |
-
* NEW : Import for myGallery
|
592 |
-
* Added : Updated to jQuery 1.1.3.1
|
593 |
-
* Bugfix : Check for memory_limit setting, otherwise pass the test
|
594 |
-
* Bugfix : Thumbcode not insert for nggDisplayRandomImages and nggDisplayRecentImages
|
595 |
-
|
596 |
-
= V0.61 - 29.06.2007 =
|
597 |
-
* Added : Forgot the file jquery.nextgen.pack.js and jquery.nextgen.js
|
598 |
-
|
599 |
-
= V0.60 - 27.06.2007 =
|
600 |
-
* NEW : Select a image from the Upload Tab
|
601 |
-
* NEW : Tag [imagebrowser=id] for a Inline Gallery Browser
|
602 |
-
* NEW : Show gallery without Subpages
|
603 |
-
* NEW : Manage gallery : Function "Add a new page"
|
604 |
-
* NEW : Manage gallery : Show/Hide thumbnails
|
605 |
-
* Added : Slideshow option : Watermark / Background music
|
606 |
-
* Added : Check for memory limit
|
607 |
-
* Added : Show actual memory usage in overview
|
608 |
-
* Added : Include function check in widget
|
609 |
-
* Added : Latest Sidebar widget from KeViN
|
610 |
-
* Added : Check for capability during installation
|
611 |
-
* Changed : Remove P Tag around gallery tags ( THX to the work from John Godley )
|
612 |
-
* Bugfix : Delete picture, check for pid
|
613 |
-
* Bugfix : admin/settings.php line #172: typos corrected (this=these,maxium=maximum). (THX to Helene D.)
|
614 |
-
* Bugfix : admin/settings.php line #311: missing </td> added. (THX to Helene D.)
|
615 |
-
|
616 |
-
= V0.52 - 31.05.2007 =
|
617 |
-
* Changed : Create better thubmnails in square mode (THX to Kees de Bruin)
|
618 |
-
* Changed : Again , fixed ratio create better thumbnails (Also for widescreen photos)
|
619 |
-
* Removed : Option "Resize image before cropping" removed and included in Create square thumbnail
|
620 |
-
* Bugfix : Scan folder for new picture didn't set exclude = 0
|
621 |
-
* Bugfix : If no option is checked in thumbnails, resize failed (THK to Joern Kretzschmar)
|
622 |
-
|
623 |
-
= V0.51 - 28.05.2007 =
|
624 |
-
* Bugfix : Thumbnail permission not set correct
|
625 |
-
* Bugfix : Folder permission check wrong
|
626 |
-
* Bugfix : Remove echo in album (THX to Lazy)
|
627 |
-
|
628 |
-
= V0.50 - 28.05.2007 =
|
629 |
-
* NEW : Select multiple files for upload (THX to Diego A., http://www.fyneworks.com)
|
630 |
-
* NEW : Sidebar widget contain now Slideshow, recent images and random images
|
631 |
-
* Added : New Option for Imagerotator 3.8 (Slow zoom effect)
|
632 |
-
* Added : Option for CDATA wrapper (not working proper)
|
633 |
-
* Added : Option for Thickbox Loading Image
|
634 |
-
* Added : CSS file for dKret2 (THK to Joern)
|
635 |
-
* Added : Better file permission check
|
636 |
-
* Changed : Fixed ratio create better thumbnails in portrait mode
|
637 |
-
* Changed : All jQuery scripts are now in "No Conflict" mode
|
638 |
-
* Changed : Script loading now via wp_enqueue_script
|
639 |
-
* Changed : Add constant values for folder/file permission
|
640 |
-
* Changed : Use description in <A href title>
|
641 |
-
* Bugfix : Remove wrong DIV tag in slideshow
|
642 |
-
* Bugfix : Tag [Slideshow=id,width,height] didn't work proper
|
643 |
-
* Bugfix : Name conflict in Album script (serialize) (THX to Die-Andis)
|
644 |
-
* Bugfix : Changed check for CSS activation
|
645 |
-
* Bugfix : Changed check for safe-mode (Don't ask)
|
646 |
-
|
647 |
-
= V0.43 - 20.05.2007 =
|
648 |
-
* Changed : Rename Thumbnail class to avoid php name collision
|
649 |
-
* Bugfix : Missing translation flag in setup
|
650 |
-
* Bugfix : Changed check for safe-mode
|
651 |
-
* Bugfix : Changed check for Zip-File
|
652 |
-
|
653 |
-
= V0.42 - 17.05.2007 =
|
654 |
-
* Bugfix : Float function for singlepic not integrated, sorry !
|
655 |
-
* Bugfix : Remove clear:both in widget
|
656 |
-
|
657 |
-
= V0.41 - 17.05.2007 =
|
658 |
-
* NEW : Sidebar widget from KeViN
|
659 |
-
* Update : Better album management for more galleries
|
660 |
-
* Update : Thickbox v3 integrated
|
661 |
-
* Added : Float selection for singlepic
|
662 |
-
* Added : CSS class for widget
|
663 |
-
* Added : CSS file for K2 theme
|
664 |
-
* Added : German translation (THX to Lazy)
|
665 |
-
* Added : Better check for safe-mode
|
666 |
-
* Added : CSS Class for single-pic : class="ngg-singlepic"
|
667 |
-
* Added : Option to resize image before cropping it (Setting reset of prior versions needed! Setup -> Reset Settings)
|
668 |
-
* Changed : Image quality by default 85% (THX to ArizonaGroovejet)
|
669 |
-
* Bugfix : Update wrong file when select other style
|
670 |
-
* Bugfix : Fixed Permalink in album (THX to Helene D.)
|
671 |
-
* Bugfix : Scan folder in empty gallery
|
672 |
-
* Bugfix : Swfobjects only added with Thickbox effect
|
673 |
-
* Bugfix : Umlauts are now handled correctly
|
674 |
-
|
675 |
-
= V0.40 - 29.04.2007 =
|
676 |
-
* NEW : TinyMCE Button integration
|
677 |
-
* Removed : CSS Style : remove width/height in album
|
678 |
-
|
679 |
-
= V0.39 - 28.04.2007 =
|
680 |
-
* Added : Set ORDER BY for gallery
|
681 |
-
* Bugfix : check now for Exclude != 1
|
682 |
-
* Bugfix : DB Query in function wrong
|
683 |
-
* Bugfix : DB exlude = DEFAULT '0'
|
684 |
-
* Bugfix : Scan folder in empty gallery
|
685 |
-
|
686 |
-
= V0.38 - 28.04.2007 =
|
687 |
-
* Bugfix : One time more remove get_settings :-)
|
688 |
-
* Bugfix : $_GET in Manage gallery
|
689 |
-
* Bugfix : exclude option
|
690 |
-
|
691 |
-
= V0.37 - 28.04.2007 =
|
692 |
-
* Bugfix : $_GET in Manage gallery
|
693 |
-
* Bugfix : update DB installation routine
|
694 |
-
|
695 |
-
= V0.36 - 26.04.2007 =
|
696 |
-
* Bugfix : Stupid PHP beginner failure in album management
|
697 |
-
|
698 |
-
= V0.35 - 26.04.2007 =
|
699 |
-
* Rework : Folder name can be flexible
|
700 |
-
* New option : Fullsize pic for Singlepic mode
|
701 |
-
* New option : Select show order
|
702 |
-
* Added : Check for WP2.1
|
703 |
-
* Added : Check for permission for default folder
|
704 |
-
* Bugfix : Remove get_settings
|
705 |
-
* Bugfix : Correction for Safe-Mode ON
|
706 |
-
* Bugfix : Set Default '0' for table album.sortorder
|
707 |
-
* Bugfix : Update sort order
|
708 |
-
|
709 |
-
= V0.34 - 24.04.2007 =
|
710 |
-
* Added : Add fix ration setting
|
711 |
-
* Added : Add language file file
|
712 |
-
* Bugfix : Change link in Album to get_bloginfo('wpurl')
|
713 |
-
* Bugfix : Album CSS file not loaded
|
714 |
-
|
715 |
-
= V0.33 - 23.04.2007 =
|
716 |
-
* NEW : Overview Page
|
717 |
-
* NEW : Core function
|
718 |
-
* NEW : Slideshow
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
products/photocrati_nextgen/modules/ngglegacy/lib/xmlrpc.php
DELETED
@@ -1,886 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* XML-RPC protocol support for NextGEN Gallery
|
4 |
-
*
|
5 |
-
* @package NextGEN Gallery
|
6 |
-
* @author Alex Rabe
|
7 |
-
*
|
8 |
-
*/
|
9 |
-
class nggXMLRPC{
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Init the methods for the XMLRPC hook
|
13 |
-
*
|
14 |
-
*/
|
15 |
-
function __construct() {
|
16 |
-
|
17 |
-
add_filter('xmlrpc_methods', array(&$this, 'add_methods') );
|
18 |
-
}
|
19 |
-
|
20 |
-
function add_methods($methods) {
|
21 |
-
|
22 |
-
$methods['ngg.installed'] = array(&$this, 'nggInstalled');
|
23 |
-
// Image methods
|
24 |
-
$methods['ngg.getImage'] = array(&$this, 'getImage');
|
25 |
-
$methods['ngg.getImages'] = array(&$this, 'getImages');
|
26 |
-
$methods['ngg.uploadImage'] = array(&$this, 'uploadImage');
|
27 |
-
$methods['ngg.editImage'] = array(&$this, 'editImage');
|
28 |
-
$methods['ngg.deleteImage'] = array(&$this, 'deleteImage');
|
29 |
-
// Gallery methods
|
30 |
-
$methods['ngg.getGallery'] = array(&$this, 'getGallery');
|
31 |
-
$methods['ngg.getGalleries'] = array(&$this, 'getGalleries');
|
32 |
-
$methods['ngg.newGallery'] = array(&$this, 'newGallery');
|
33 |
-
$methods['ngg.editGallery'] = array(&$this, 'editGallery');
|
34 |
-
$methods['ngg.deleteGallery'] = array(&$this, 'deleteGallery');
|
35 |
-
// Album methods
|
36 |
-
$methods['ngg.getAlbum'] = array(&$this, 'getAlbum');
|
37 |
-
$methods['ngg.getAlbums'] = array(&$this, 'getAlbums');
|
38 |
-
$methods['ngg.newAlbum'] = array(&$this, 'newAlbum');
|
39 |
-
$methods['ngg.editAlbum'] = array(&$this, 'editAlbum');
|
40 |
-
$methods['ngg.deleteAlbum'] = array(&$this, 'deleteAlbum');
|
41 |
-
|
42 |
-
return $methods;
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Check if it's an csv string, then serialize it.
|
47 |
-
*
|
48 |
-
* @since 1.9.2
|
49 |
-
* @param string $data
|
50 |
-
* @return serialized string
|
51 |
-
*/
|
52 |
-
function is_serialized( $data ) {
|
53 |
-
|
54 |
-
// if it isn't a string, we don't serialize it.
|
55 |
-
if ( ! is_string( $data ) )
|
56 |
-
return false;
|
57 |
-
|
58 |
-
if ($data && !strpos( $data , '{')) {
|
59 |
-
$items = explode(',', $data);
|
60 |
-
return serialize($items);
|
61 |
-
}
|
62 |
-
|
63 |
-
return $data;
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Check if NextGEN Gallery is installed
|
68 |
-
*
|
69 |
-
* @since 1.4
|
70 |
-
*
|
71 |
-
* @param none
|
72 |
-
* @return string version number
|
73 |
-
*/
|
74 |
-
function nggInstalled($args) {
|
75 |
-
global $ngg;
|
76 |
-
return array( 'version' => $ngg->version );
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Log user in.
|
81 |
-
*
|
82 |
-
* @since 2.8
|
83 |
-
*
|
84 |
-
* @param string $username User's username.
|
85 |
-
* @param string $password User's password.
|
86 |
-
* @return mixed WP_User object if authentication passed, false otherwise
|
87 |
-
*/
|
88 |
-
function login($username, $password) {
|
89 |
-
global $wp_version;
|
90 |
-
|
91 |
-
if (version_compare($wp_version,"3.5","<")) {
|
92 |
-
if ( !get_option( 'enable_xmlrpc' ) ) {
|
93 |
-
$this->error = new IXR_Error( 405, sprintf( __('XML-RPC services are disabled on this blog. An admin user can enable them at %s'), admin_url('options-writing.php') ) );
|
94 |
-
return false;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
$user = wp_authenticate($username, $password);
|
99 |
-
|
100 |
-
if (is_wp_error($user)) {
|
101 |
-
$this->error = new IXR_Error(403, __('Bad login/pass combination.'));
|
102 |
-
return false;
|
103 |
-
}
|
104 |
-
|
105 |
-
set_current_user( $user->ID );
|
106 |
-
return $user;
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Method "ngg.uploadImage"
|
111 |
-
* Uploads a image to a gallery
|
112 |
-
*
|
113 |
-
* @since 1.4
|
114 |
-
*
|
115 |
-
* @copyright addapted from WP Core
|
116 |
-
* @param array $args Method parameters.
|
117 |
-
* - int blog_id
|
118 |
-
* - string username
|
119 |
-
* - string password
|
120 |
-
* - struct data
|
121 |
-
* o string name
|
122 |
-
* o string type (optional)
|
123 |
-
* o base64 bits
|
124 |
-
* o bool overwrite (optional)
|
125 |
-
* o int gallery
|
126 |
-
* o int image_id (optional)
|
127 |
-
* @return array with image meta data
|
128 |
-
*/
|
129 |
-
function uploadImage($args) {
|
130 |
-
global $wpdb;
|
131 |
-
|
132 |
-
require_once ( dirname ( dirname( __FILE__ ) ). '/admin/functions.php' ); // admin functions
|
133 |
-
require_once ( 'meta.php' ); // meta data import
|
134 |
-
|
135 |
-
$blog_ID = (int) $args[0];
|
136 |
-
$username = $wpdb->escape($args[1]);
|
137 |
-
$password = $wpdb->escape($args[2]);
|
138 |
-
$data = $args[3];
|
139 |
-
|
140 |
-
$name = $data['name'];
|
141 |
-
$type = $data['type'];
|
142 |
-
$bits = $data['bits'];
|
143 |
-
|
144 |
-
// gallery & image id
|
145 |
-
$gid = (int) $data['gallery']; // required field
|
146 |
-
$pid = (int) $data['image_id']; // optional but more foolproof of overwrite
|
147 |
-
$image = false; // container for the image object
|
148 |
-
|
149 |
-
logIO('O', '(NGG) Received '.strlen($bits).' bytes');
|
150 |
-
|
151 |
-
if ( !$user = $this->login($username, $password) )
|
152 |
-
return $this->error;
|
153 |
-
|
154 |
-
// Check if you have the correct capability for upload
|
155 |
-
if ( !current_user_can('NextGEN Upload images') ) {
|
156 |
-
logIO('O', '(NGG) User does not have upload_files capability');
|
157 |
-
$this->error = new IXR_Error(401, __('You are not allowed to upload files to this site.'));
|
158 |
-
return $this->error;
|
159 |
-
}
|
160 |
-
|
161 |
-
// Look for the gallery , could we find it ?
|
162 |
-
if ( !$gallery = nggdb::find_gallery($gid) )
|
163 |
-
return new IXR_Error(404, __('Could not find gallery ' . $gid ));
|
164 |
-
|
165 |
-
// Now check if you have the correct capability for this gallery
|
166 |
-
if ( !nggAdmin::can_manage_this_gallery($gallery->author) ) {
|
167 |
-
logIO('O', '(NGG) User does not have upload_files capability');
|
168 |
-
$this->error = new IXR_Error(401, __('You are not allowed to upload files to this gallery.'));
|
169 |
-
return $this->error;
|
170 |
-
}
|
171 |
-
|
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');
|
179 |
-
if ( !in_array($filepart['extension'], $ext) ){
|
180 |
-
logIO('O', '(NGG) Not allowed file type');
|
181 |
-
$this->error = new IXR_Error(401, __('This is no valid image file.','nggallery'));
|
182 |
-
return $this->error;
|
183 |
-
}
|
184 |
-
|
185 |
-
// in the case you would overwrite the image, let's delete the old one first
|
186 |
-
if(!empty($data["overwrite"]) && ($data["overwrite"] == true)) {
|
187 |
-
|
188 |
-
// search for the image based on the filename, if it's not already provided
|
189 |
-
if ($pid == 0)
|
190 |
-
$pid = $wpdb->get_col(" SELECT pid FROM {$wpdb->nggpictures} WHERE filename = '{$name}' AND galleryid = '{$gid}' ");
|
191 |
-
|
192 |
-
if ( !$image = nggdb::find_image( $pid ) )
|
193 |
-
return new IXR_Error(404, __('Could not find image id ' . $pid ));
|
194 |
-
|
195 |
-
// sync the gallery<->image parameter, otherwise we may copy it to the wrong gallery
|
196 |
-
$gallery = $image;
|
197 |
-
|
198 |
-
// delete now the image
|
199 |
-
if ( !@unlink( $image->imagePath ) ) {
|
200 |
-
$errorString = sprintf(__('Failed to delete image %1$s ','nggallery'), $image->imagePath);
|
201 |
-
logIO('O', '(NGG) ' . $errorString);
|
202 |
-
return new IXR_Error(500, $errorString);
|
203 |
-
}
|
204 |
-
}
|
205 |
-
|
206 |
-
// upload routine from wp core, load first the image to the upload folder, $upload['file'] contain the path
|
207 |
-
$upload = wp_upload_bits($name, $type, $bits);
|
208 |
-
if ( ! empty($upload['error']) ) {
|
209 |
-
$errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']);
|
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 );
|
222 |
-
$destination = $path . '/'. $filename;
|
223 |
-
|
224 |
-
// Move files to gallery folder
|
225 |
-
if ( !@rename($upload['file'], $destination ) ) {
|
226 |
-
$errorString = sprintf(__('Failed to move image %1$s to %2$s','nggallery'), '<strong>' . $upload['file'] . '</strong>', $destination);
|
227 |
-
logIO('O', '(NGG) ' . $errorString);
|
228 |
-
return new IXR_Error(500, $errorString);
|
229 |
-
}
|
230 |
-
|
231 |
-
//add to database if it's a new image
|
232 |
-
if(empty($data["overwrite"]) || ($data["overwrite"] == false)) {
|
233 |
-
$pid_array = nggAdmin::add_Images( $gallery->gid, array( $filename ) );
|
234 |
-
// the first element is our new image id
|
235 |
-
if (count($pid_array) == 1)
|
236 |
-
$pid = $pid_array[0];
|
237 |
-
}
|
238 |
-
|
239 |
-
//get all information about the image, in the case it's a new one
|
240 |
-
if (!$image)
|
241 |
-
$image = nggdb::find_image( $pid );
|
242 |
-
|
243 |
-
// create again the thumbnail, should return a '1'
|
244 |
-
nggAdmin::create_thumbnail( $image );
|
245 |
-
|
246 |
-
return apply_filters( 'ngg_upload_image', $image );
|
247 |
-
|
248 |
-
}
|
249 |
-
|
250 |
-
/**
|
251 |
-
* Method "ngg.deleteImage"
|
252 |
-
* Delete a Image from the database and gallery
|
253 |
-
*
|
254 |
-
* @since 1.7.3
|
255 |
-
*
|
256 |
-
* @param array $args Method parameters.
|
257 |
-
* - int blog_id
|
258 |
-
* - string username
|
259 |
-
* - string password
|
260 |
-
* - int image_id
|
261 |
-
* @return true
|
262 |
-
*/
|
263 |
-
function deleteImage($args) {
|
264 |
-
|
265 |
-
global $nggdb, $ngg;
|
266 |
-
|
267 |
-
require_once ( dirname ( dirname( __FILE__ ) ). '/admin/functions.php' ); // admin functions
|
268 |
-
|
269 |
-
$this->escape($args);
|
270 |
-
$blog_ID = (int) $args[0];
|
271 |
-
$username = $args[1];
|
272 |
-
$password = $args[2];
|
273 |
-
$id = (int) $args[3];
|
274 |
-
|
275 |
-
if ( !$user = $this->login($username, $password) )
|
276 |
-
return $this->error;
|
277 |
-
|
278 |
-
if ( !$image = nggdb::find_image($id) )
|
279 |
-
return(new IXR_Error(404, __("Invalid image ID")));
|
280 |
-
|
281 |
-
if ( !current_user_can( 'NextGEN Manage gallery' ) && !nggAdmin::can_manage_this_gallery($image->author) )
|
282 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to edit this image' ) );
|
283 |
-
|
284 |
-
if ($ngg->options['deleteImg']) {
|
285 |
-
@unlink($image->imagePath);
|
286 |
-
@unlink($image->thumbPath);
|
287 |
-
@unlink($image->imagePath . "_backup" );
|
288 |
-
}
|
289 |
-
|
290 |
-
nggdb::delete_image ( $id );
|
291 |
-
|
292 |
-
return true;
|
293 |
-
|
294 |
-
}
|
295 |
-
|
296 |
-
/**
|
297 |
-
* Method "ngg.editImage"
|
298 |
-
* Edit a existing Image
|
299 |
-
*
|
300 |
-
* @since 1.7.3
|
301 |
-
*
|
302 |
-
* @param array $args Method parameters.
|
303 |
-
* - int blog_id
|
304 |
-
* - string username
|
305 |
-
* - string password
|
306 |
-
* - int Image ID
|
307 |
-
* - string alt/title text
|
308 |
-
* - string description
|
309 |
-
* - int exclude from gallery (0 or 1)
|
310 |
-
* @return true if success
|
311 |
-
*/
|
312 |
-
function editImage($args) {
|
313 |
-
|
314 |
-
global $ngg;
|
315 |
-
|
316 |
-
require_once ( dirname ( dirname( __FILE__ ) ). '/admin/functions.php' ); // admin functions
|
317 |
-
|
318 |
-
$this->escape($args);
|
319 |
-
$blog_ID = (int) $args[0];
|
320 |
-
$username = $args[1];
|
321 |
-
$password = $args[2];
|
322 |
-
$id = (int) $args[3];
|
323 |
-
$alttext = $args[4];
|
324 |
-
$description= $args[5];
|
325 |
-
$exclude = (int) $args[6];
|
326 |
-
|
327 |
-
if ( !$user = $this->login($username, $password) )
|
328 |
-
return $this->error;
|
329 |
-
|
330 |
-
if ( !$image = nggdb::find_image($id) )
|
331 |
-
return(new IXR_Error(404, __( 'Invalid image ID' )));
|
332 |
-
|
333 |
-
if ( !current_user_can( 'NextGEN Manage gallery' ) && !nggAdmin::can_manage_this_gallery($image->author) )
|
334 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to edit this image' ) );
|
335 |
-
|
336 |
-
if ( !empty( $id ) )
|
337 |
-
$result = nggdb::update_image($id, false, false, $description, $alttext, $exclude);
|
338 |
-
|
339 |
-
if ( !$result )
|
340 |
-
return new IXR_Error(500, __('Sorry, could not update the image'));
|
341 |
-
|
342 |
-
return true;
|
343 |
-
|
344 |
-
}
|
345 |
-
|
346 |
-
/**
|
347 |
-
* Method "ngg.newGallery"
|
348 |
-
* Create a new gallery
|
349 |
-
*
|
350 |
-
* @since 1.4
|
351 |
-
*
|
352 |
-
* @param array $args Method parameters.
|
353 |
-
* - int blog_id
|
354 |
-
* - string username
|
355 |
-
* - string password
|
356 |
-
* - string new gallery name
|
357 |
-
* @return int with new gallery ID
|
358 |
-
*/
|
359 |
-
function newGallery($args) {
|
360 |
-
|
361 |
-
global $ngg;
|
362 |
-
|
363 |
-
require_once ( dirname ( dirname( __FILE__ ) ). '/admin/functions.php' ); // admin functions
|
364 |
-
|
365 |
-
$this->escape($args);
|
366 |
-
$blog_ID = (int) $args[0];
|
367 |
-
$username = $args[1];
|
368 |
-
$password = $args[2];
|
369 |
-
$name = $args[3];
|
370 |
-
$id = false;
|
371 |
-
|
372 |
-
if ( !$user = $this->login($username, $password) )
|
373 |
-
return $this->error;
|
374 |
-
|
375 |
-
if( !current_user_can( 'NextGEN Manage gallery' ) )
|
376 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to manage galleries' ) );
|
377 |
-
|
378 |
-
if ( !empty( $name ) )
|
379 |
-
$id = nggAdmin::create_gallery($name, $ngg->options['gallerypath'], false);
|
380 |
-
|
381 |
-
if ( !$id )
|
382 |
-
return new IXR_Error(500, __('Sorry, could not create the gallery'));
|
383 |
-
|
384 |
-
return($id);
|
385 |
-
|
386 |
-
}
|
387 |
-
|
388 |
-
/**
|
389 |
-
* Method "ngg.editGallery"
|
390 |
-
* Edit a existing gallery
|
391 |
-
*
|
392 |
-
* @since 1.7.0
|
393 |
-
*
|
394 |
-
* @param array $args Method parameters.
|
395 |
-
* - int blog_id
|
396 |
-
* - string username
|
397 |
-
* - string password
|
398 |
-
* - int gallery ID
|
399 |
-
* - string gallery name
|
400 |
-
* - string title
|
401 |
-
* - string description
|
402 |
-
* - int ID of the preview picture
|
403 |
-
* @return true if success
|
404 |
-
*/
|
405 |
-
function editGallery($args) {
|
406 |
-
|
407 |
-
global $ngg;
|
408 |
-
|
409 |
-
require_once ( dirname ( dirname( __FILE__ ) ). '/admin/functions.php' ); // admin functions
|
410 |
-
|
411 |
-
$this->escape($args);
|
412 |
-
$blog_ID = (int) $args[0];
|
413 |
-
$username = $args[1];
|
414 |
-
$password = $args[2];
|
415 |
-
$id = (int) $args[3];
|
416 |
-
$name = $args[4];
|
417 |
-
$title = $args[5];
|
418 |
-
$description= $args[6];
|
419 |
-
$previewpic = (int) $args[7];
|
420 |
-
|
421 |
-
if ( !$user = $this->login($username, $password) )
|
422 |
-
return $this->error;
|
423 |
-
|
424 |
-
if ( !$gallery = nggdb::find_gallery($id) )
|
425 |
-
return(new IXR_Error(404, __("Invalid gallery ID")));
|
426 |
-
|
427 |
-
if ( !current_user_can( 'NextGEN Manage gallery' ) && !nggAdmin::can_manage_this_gallery($gallery->author) )
|
428 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to manage this gallery' ) );
|
429 |
-
|
430 |
-
if ( !empty( $name ) )
|
431 |
-
$result = nggdb::update_gallery($id, $name, false, $title, $description, false, $previewpic);
|
432 |
-
|
433 |
-
if ( !$result )
|
434 |
-
return new IXR_Error(500, __('Sorry, could not update the gallery'));
|
435 |
-
|
436 |
-
return true;
|
437 |
-
|
438 |
-
}
|
439 |
-
|
440 |
-
/**
|
441 |
-
* Method "ngg.newAlbum"
|
442 |
-
* Create a new album
|
443 |
-
*
|
444 |
-
* @since 1.7.0
|
445 |
-
*
|
446 |
-
* @param array $args Method parameters.
|
447 |
-
* - int blog_id
|
448 |
-
* - string username
|
449 |
-
* - string password
|
450 |
-
* - string new album name
|
451 |
-
* - int id of preview image
|
452 |
-
* - string description
|
453 |
-
* - string serialized array of galleries or a comma-separated string of gallery IDs
|
454 |
-
* @return int with new album ID
|
455 |
-
*/
|
456 |
-
function newAlbum($args) {
|
457 |
-
|
458 |
-
global $ngg;
|
459 |
-
|
460 |
-
$this->escape($args);
|
461 |
-
$blog_ID = (int) $args[0];
|
462 |
-
$username = $args[1];
|
463 |
-
$password = $args[2];
|
464 |
-
$name = $args[3];
|
465 |
-
$preview = (int) $args[4];
|
466 |
-
$description= $args[5];
|
467 |
-
$galleries = $this->is_serialized($args[6]);
|
468 |
-
$id = false;
|
469 |
-
|
470 |
-
if ( !$user = $this->login($username, $password) )
|
471 |
-
return $this->error;
|
472 |
-
|
473 |
-
if( !current_user_can( 'NextGEN Edit album' ) || !nggGallery::current_user_can( 'NextGEN Add/Delete album' ) )
|
474 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to manage albums' ) );
|
475 |
-
|
476 |
-
if ( !empty( $name ) )
|
477 |
-
$id = $result = nggdb::add_album( $name, $preview, $description, $galleries );
|
478 |
-
|
479 |
-
if ( !$id )
|
480 |
-
return new IXR_Error(500, __('Sorry, could not create the album'));
|
481 |
-
|
482 |
-
return($id);
|
483 |
-
|
484 |
-
}
|
485 |
-
|
486 |
-
/**
|
487 |
-
* Method "ngg.editAlbum"
|
488 |
-
* Edit a existing Album
|
489 |
-
*
|
490 |
-
* @since 1.7.0
|
491 |
-
*
|
492 |
-
* @param array $args Method parameters.
|
493 |
-
* - int blog_id
|
494 |
-
* - string username
|
495 |
-
* - string password
|
496 |
-
* - int album ID
|
497 |
-
* - string album name
|
498 |
-
* - int id of preview image
|
499 |
-
* - string description
|
500 |
-
* - string serialized array of galleries or a comma-separated string of gallery IDs
|
501 |
-
* @return true if success
|
502 |
-
*/
|
503 |
-
function editAlbum($args) {
|
504 |
-
|
505 |
-
global $ngg;
|
506 |
-
|
507 |
-
require_once ( dirname ( dirname( __FILE__ ) ). '/admin/functions.php' ); // admin functions
|
508 |
-
|
509 |
-
$this->escape($args);
|
510 |
-
$blog_ID = (int) $args[0];
|
511 |
-
$username = $args[1];
|
512 |
-
$password = $args[2];
|
513 |
-
$id = (int) $args[3];
|
514 |
-
$name = $args[4];
|
515 |
-
$preview = (int) $args[5];
|
516 |
-
$description= $args[6];
|
517 |
-
$galleries = $this->is_serialized($args[7]);
|
518 |
-
|
519 |
-
if ( !$user = $this->login($username, $password) )
|
520 |
-
return $this->error;
|
521 |
-
|
522 |
-
if ( !$album = nggdb::find_album($id) )
|
523 |
-
return(new IXR_Error(404, __("Invalid album ID")));
|
524 |
-
|
525 |
-
if( !current_user_can( 'NextGEN Edit album' ) )
|
526 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to manage albums' ) );
|
527 |
-
|
528 |
-
if ( !empty( $name ) )
|
529 |
-
$result = nggdb::update_album($id, $name, $preview, $description, $galleries);
|
530 |
-
|
531 |
-
if ( !$result )
|
532 |
-
return new IXR_Error(500, __('Sorry, could not update the album'));
|
533 |
-
|
534 |
-
return true;
|
535 |
-
|
536 |
-
}
|
537 |
-
|
538 |
-
/**
|
539 |
-
* Method "ngg.deleteAlbum"
|
540 |
-
* Delete a album from the database
|
541 |
-
*
|
542 |
-
* @since 1.7.0
|
543 |
-
*
|
544 |
-
* @param array $args Method parameters.
|
545 |
-
* - int blog_id
|
546 |
-
* - string username
|
547 |
-
* - string password
|
548 |
-
* - int album id
|
549 |
-
* @return true
|
550 |
-
*/
|
551 |
-
function deleteAlbum($args) {
|
552 |
-
|
553 |
-
global $nggdb;
|
554 |
-
|
555 |
-
$this->escape($args);
|
556 |
-
$blog_ID = (int) $args[0];
|
557 |
-
$username = $args[1];
|
558 |
-
$password = $args[2];
|
559 |
-
$id = (int) $args[3];
|
560 |
-
|
561 |
-
if ( !$user = $this->login($username, $password) )
|
562 |
-
return $this->error;
|
563 |
-
|
564 |
-
if ( !$album = nggdb::find_album($id) )
|
565 |
-
return(new IXR_Error(404, __("Invalid album ID")));
|
566 |
-
|
567 |
-
if( !current_user_can( 'NextGEN Edit album' ) && !nggGallery::current_user_can( 'NextGEN Add/Delete album' ) )
|
568 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to manage albums' ) );
|
569 |
-
|
570 |
-
$nggdb->delete_album($id);
|
571 |
-
|
572 |
-
return true;
|
573 |
-
|
574 |
-
}
|
575 |
-
|
576 |
-
/**
|
577 |
-
* Method "ngg.deleteGallery"
|
578 |
-
* Delete a gallery from the database, including all images
|
579 |
-
*
|
580 |
-
* @since 1.7.0
|
581 |
-
*
|
582 |
-
* @param array $args Method parameters.
|
583 |
-
* - int blog_id
|
584 |
-
* - string username
|
585 |
-
* - string password
|
586 |
-
* - int gallery_id
|
587 |
-
* @return true
|
588 |
-
*/
|
589 |
-
function deleteGallery($args) {
|
590 |
-
|
591 |
-
global $nggdb;
|
592 |
-
|
593 |
-
require_once ( dirname ( dirname( __FILE__ ) ). '/admin/functions.php' ); // admin functions
|
594 |
-
|
595 |
-
$this->escape($args);
|
596 |
-
$blog_ID = (int) $args[0];
|
597 |
-
$username = $args[1];
|
598 |
-
$password = $args[2];
|
599 |
-
$id = (int) $args[3];
|
600 |
-
|
601 |
-
if ( !$user = $this->login($username, $password) )
|
602 |
-
return $this->error;
|
603 |
-
|
604 |
-
if ( !$gallery = nggdb::find_gallery($id) )
|
605 |
-
return(new IXR_Error(404, __("Invalid gallery ID")));
|
606 |
-
|
607 |
-
if ( !current_user_can( 'NextGEN Manage gallery' ) && !nggAdmin::can_manage_this_gallery($gallery->author) )
|
608 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to manage galleries' ) );
|
609 |
-
|
610 |
-
$nggdb->delete_gallery($id);
|
611 |
-
|
612 |
-
return true;
|
613 |
-
|
614 |
-
}
|
615 |
-
|
616 |
-
/**
|
617 |
-
* Method "ngg.getAlbums"
|
618 |
-
* Return the list of all albums
|
619 |
-
*
|
620 |
-
* @since 1.7.0
|
621 |
-
*
|
622 |
-
* @param array $args Method parameters.
|
623 |
-
* - int blog_id
|
624 |
-
* - string username
|
625 |
-
* - string password
|
626 |
-
* @return array with all galleries
|
627 |
-
*/
|
628 |
-
function getAlbums($args) {
|
629 |
-
|
630 |
-
global $nggdb;
|
631 |
-
|
632 |
-
$this->escape($args);
|
633 |
-
$blog_ID = (int) $args[0];
|
634 |
-
$username = $args[1];
|
635 |
-
$password = $args[2];
|
636 |
-
|
637 |
-
if ( !$user = $this->login($username, $password) )
|
638 |
-
return $this->error;
|
639 |
-
|
640 |
-
if( !current_user_can( 'NextGEN Edit album' ) )
|
641 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to manage albums' ) );
|
642 |
-
|
643 |
-
$album_list = $nggdb->find_all_album('id', 'ASC', 0, 0 );
|
644 |
-
|
645 |
-
return($album_list);
|
646 |
-
|
647 |
-
}
|
648 |
-
|
649 |
-
/**
|
650 |
-
* Method "ngg.getAlbum"
|
651 |
-
* Return the specified album
|
652 |
-
*
|
653 |
-
* @since 1.9.2
|
654 |
-
*
|
655 |
-
* @param array $args Method parameters.
|
656 |
-
* - int blog_id
|
657 |
-
* - string username
|
658 |
-
* - string password
|
659 |
-
* - int album_id
|
660 |
-
* @return array with the album object
|
661 |
-
*/
|
662 |
-
function getAlbum($args) {
|
663 |
-
|
664 |
-
global $nggdb;
|
665 |
-
|
666 |
-
$this->escape($args);
|
667 |
-
$blog_ID = (int) $args[0];
|
668 |
-
$username = $args[1];
|
669 |
-
$password = $args[2];
|
670 |
-
$id = (int) $args[3];
|
671 |
-
|
672 |
-
if ( !$user = $this->login($username, $password) )
|
673 |
-
return $this->error;
|
674 |
-
|
675 |
-
if( !current_user_can( 'NextGEN Edit album' ) )
|
676 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to manage albums' ) );
|
677 |
-
|
678 |
-
$album = $nggdb->find_album( $id );
|
679 |
-
|
680 |
-
return($album);
|
681 |
-
|
682 |
-
}
|
683 |
-
|
684 |
-
/**
|
685 |
-
* Method "ngg.getGalleries"
|
686 |
-
* Return the list of all galleries
|
687 |
-
*
|
688 |
-
* @since 1.4
|
689 |
-
*
|
690 |
-
* @param array $args Method parameters.
|
691 |
-
* - int blog_id
|
692 |
-
* - string username
|
693 |
-
* - string password
|
694 |
-
* @return array with all galleries
|
695 |
-
*/
|
696 |
-
function getGalleries($args) {
|
697 |
-
|
698 |
-
global $nggdb;
|
699 |
-
|
700 |
-
$this->escape($args);
|
701 |
-
$blog_ID = (int) $args[0];
|
702 |
-
$username = $args[1];
|
703 |
-
$password = $args[2];
|
704 |
-
|
705 |
-
if ( !$user = $this->login($username, $password) )
|
706 |
-
return $this->error;
|
707 |
-
|
708 |
-
if( !current_user_can( 'NextGEN Manage gallery' ) )
|
709 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to manage galleries' ) );
|
710 |
-
|
711 |
-
$gallery_list = $nggdb->find_all_galleries('gid', 'asc', true, 0, 0, false);
|
712 |
-
|
713 |
-
return($gallery_list);
|
714 |
-
|
715 |
-
}
|
716 |
-
|
717 |
-
/**
|
718 |
-
* Method "ngg.getGallery"
|
719 |
-
* Return the specified gallery
|
720 |
-
*
|
721 |
-
* @since 1.9.2
|
722 |
-
*
|
723 |
-
* @param array $args Method parameters.
|
724 |
-
* - int blog_id
|
725 |
-
* - string username
|
726 |
-
* - string password
|
727 |
-
* - int gallery_id
|
728 |
-
* @return array with the gallery object
|
729 |
-
*/
|
730 |
-
function getGallery($args) {
|
731 |
-
|
732 |
-
global $nggdb;
|
733 |
-
|
734 |
-
$this->escape($args);
|
735 |
-
$blog_ID = (int) $args[0];
|
736 |
-
$username = $args[1];
|
737 |
-
$password = $args[2];
|
738 |
-
$gid = (int) $args[3];
|
739 |
-
|
740 |
-
if ( !$user = $this->login($username, $password) )
|
741 |
-
return $this->error;
|
742 |
-
|
743 |
-
if( !current_user_can( 'NextGEN Manage gallery' ) )
|
744 |
-
return new IXR_Error( 401, __( 'Sorry, you must be able to manage galleries' ) );
|
745 |
-
|
746 |
-
$gallery = $nggdb->find_gallery($gid);
|
747 |
-
|
748 |
-
return($gallery);
|
749 |
-
|
750 |
-
}
|
751 |
-
|
752 |
-
/**
|
753 |
-
* Method "ngg.getImages"
|
754 |
-
* Return the list of all images inside a gallery
|
755 |
-
*
|
756 |
-
* @since 1.4
|
757 |
-
*
|
758 |
-
* @param array $args Method parameters.
|
759 |
-
* - int blog_id
|
760 |
-
* - string username
|
761 |
-
* - string password
|
762 |
-
* - int gallery_id
|
763 |
-
* @return array with all images
|
764 |
-
*/
|
765 |
-
function getImages($args) {
|
766 |
-
|
767 |
-
global $nggdb;
|
768 |
-
|
769 |
-
require_once ( dirname ( dirname( __FILE__ ) ). '/admin/functions.php' ); // admin functions
|
770 |
-
|
771 |
-
$this->escape($args);
|
772 |
-
$blog_ID = (int) $args[0];
|
773 |
-
$username = $args[1];
|
774 |
-
$password = $args[2];
|
775 |
-
$gid = (int) $args[3];
|
776 |
-
|
777 |
-
if ( !$user = $this->login($username, $password) )
|
778 |
-
return $this->error;
|
779 |
-
|
780 |
-
// Look for the gallery , could we find it ?
|
781 |
-
if ( !$gallery = nggdb::find_gallery( $gid ) )
|
782 |
-
return new IXR_Error(404, __('Could not find gallery ' . $gid ));
|
783 |
-
|
784 |
-
// Now check if you have the correct capability for this gallery
|
785 |
-
if ( !nggAdmin::can_manage_this_gallery($gallery->author) ) {
|
786 |
-
logIO('O', '(NGG) User does not have upload_files capability');
|
787 |
-
$this->error = new IXR_Error(401, __('You are not allowed to upload files to this gallery.'));
|
788 |
-
return $this->error;
|
789 |
-
}
|
790 |
-
|
791 |
-
// get picture values
|
792 |
-
$picture_list = $nggdb->get_gallery( $gid, 'pid', 'ASC', false );
|
793 |
-
|
794 |
-
return($picture_list);
|
795 |
-
|
796 |
-
}
|
797 |
-
|
798 |
-
/**
|
799 |
-
* Method "ngg.getImage"
|
800 |
-
* Return a single image inside a gallery
|
801 |
-
*
|
802 |
-
* @since 1.9.2
|
803 |
-
*
|
804 |
-
* @param array $args Method parameters.
|
805 |
-
* - int blog_id
|
806 |
-
* - string username
|
807 |
-
* - string password
|
808 |
-
* - int picture_id
|
809 |
-
* @return array with image properties
|
810 |
-
*/
|
811 |
-
function getImage($args) {
|
812 |
-
|
813 |
-
global $nggdb;
|
814 |
-
|
815 |
-
require_once ( dirname ( dirname( __FILE__ ) ). '/admin/functions.php' ); // admin functions
|
816 |
-
|
817 |
-
$this->escape($args);
|
818 |
-
$blog_ID = (int) $args[0];
|
819 |
-
$username = $args[1];
|
820 |
-
$password = $args[2];
|
821 |
-
$pid = (int) $args[3];
|
822 |
-
|
823 |
-
if ( !$user = $this->login($username, $password) )
|
824 |
-
return $this->error;
|
825 |
-
|
826 |
-
// get picture
|
827 |
-
$image = $nggdb->find_image( $pid );
|
828 |
-
|
829 |
-
if ($image) {
|
830 |
-
$gid = $image->galleryid;
|
831 |
-
|
832 |
-
// Look for the gallery , could we find it ?
|
833 |
-
if ( !$gallery = nggdb::find_gallery( $gid ) )
|
834 |
-
return new IXR_Error(404, __('Could not find gallery ' . $gid ));
|
835 |
-
|
836 |
-
// Now check if you have the correct capability for this gallery
|
837 |
-
if ( !nggAdmin::can_manage_this_gallery($gallery->author) ) {
|
838 |
-
logIO('O', '(NGG) User does not have upload_files capability');
|
839 |
-
$this->error = new IXR_Error(401, __('You are not allowed to upload files to this gallery.'));
|
840 |
-
return $this->error;
|
841 |
-
}
|
842 |
-
}
|
843 |
-
|
844 |
-
return($image);
|
845 |
-
|
846 |
-
}
|
847 |
-
|
848 |
-
/**
|
849 |
-
* Sanitize string or array of strings for database.
|
850 |
-
*
|
851 |
-
* @since 1.7.0
|
852 |
-
* @author WordPress Core
|
853 |
-
* @filesource inludes/class-wp-xmlrpc-server.php
|
854 |
-
*
|
855 |
-
* @param string|array $array Sanitize single string or array of strings.
|
856 |
-
* @return string|array Type matches $array and sanitized for the database.
|
857 |
-
*/
|
858 |
-
function escape(&$array) {
|
859 |
-
global $wpdb;
|
860 |
-
|
861 |
-
if (!is_array($array)) {
|
862 |
-
return($wpdb->escape($array));
|
863 |
-
} else {
|
864 |
-
foreach ( (array) $array as $k => $v ) {
|
865 |
-
if ( is_array($v) ) {
|
866 |
-
$this->escape($array[$k]);
|
867 |
-
} else if ( is_object($v) ) {
|
868 |
-
//skip
|
869 |
-
} else {
|
870 |
-
$array[$k] = $wpdb->escape($v);
|
871 |
-
}
|
872 |
-
}
|
873 |
-
}
|
874 |
-
}
|
875 |
-
|
876 |
-
/**
|
877 |
-
* PHP5 style destructor and will run when database object is destroyed.
|
878 |
-
*
|
879 |
-
* @return bool Always true
|
880 |
-
*/
|
881 |
-
function __destruct() {
|
882 |
-
|
883 |
-
}
|
884 |
-
}
|
885 |
-
|
886 |
-
$nggxmlrpc = new nggXMLRPC();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php
CHANGED
@@ -24,7 +24,7 @@ class M_NggLegacy extends C_Base_Module
|
|
24 |
'photocrati-nextgen-legacy',
|
25 |
'NextGEN Legacy',
|
26 |
'Embeds the original version of NextGEN 1.9.3 by Alex Rabe',
|
27 |
-
'0.
|
28 |
'http://www.nextgen-gallery.com',
|
29 |
'Photocrati Media',
|
30 |
'http://www.photocrati.com'
|
24 |
'photocrati-nextgen-legacy',
|
25 |
'NextGEN Legacy',
|
26 |
'Embeds the original version of NextGEN 1.9.3 by Alex Rabe',
|
27 |
+
'0.2',
|
28 |
'http://www.nextgen-gallery.com',
|
29 |
'Photocrati Media',
|
30 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/ngglegacy/nggallery.php
CHANGED
@@ -264,10 +264,6 @@ if (!class_exists('nggLoader')) {
|
|
264 |
require_once (dirname (__FILE__) . '/nggfunctions.php'); // n.a.
|
265 |
require_once (dirname (__FILE__) . '/lib/shortcodes.php'); // 92.664
|
266 |
|
267 |
-
//Just needed if you access remote to WordPress
|
268 |
-
if ( defined('XMLRPC_REQUEST') )
|
269 |
-
require_once (dirname (__FILE__) . '/lib/xmlrpc.php');
|
270 |
-
|
271 |
// We didn't need all stuff during a AJAX operation
|
272 |
if ( defined('DOING_AJAX') )
|
273 |
require_once (dirname (__FILE__) . '/admin/ajax.php');
|
264 |
require_once (dirname (__FILE__) . '/nggfunctions.php'); // n.a.
|
265 |
require_once (dirname (__FILE__) . '/lib/shortcodes.php'); // 92.664
|
266 |
|
|
|
|
|
|
|
|
|
267 |
// We didn't need all stuff during a AJAX operation
|
268 |
if ( defined('DOING_AJAX') )
|
269 |
require_once (dirname (__FILE__) . '/admin/ajax.php');
|
products/photocrati_nextgen/modules/ngglegacy/view/singlepic.php
CHANGED
@@ -18,9 +18,14 @@ Please note : A Image resize or watermarking operation will remove all meta info
|
|
18 |
**/
|
19 |
?>
|
20 |
<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($image)) : ?>
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
24 |
</a>
|
25 |
<?php if (!empty ($image->caption)) : ?><span><?php echo $image->caption ?></span><?php endif; ?>
|
26 |
<?php endif; ?>
|
18 |
**/
|
19 |
?>
|
20 |
<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($image)) : ?>
|
21 |
+
<a href="<?php echo $image->imageURL; ?>"
|
22 |
+
title="<?php echo $image->linktitle; ?>"
|
23 |
+
<?php if(!empty($target)) { ?>target="<?php echo esc_attr($target); ?>"<?php } ?>
|
24 |
+
<?php echo $image->thumbcode; ?>>
|
25 |
+
<img class="<?php echo $image->classname; ?>"
|
26 |
+
src="<?php echo $image->thumbnailURL; ?>"
|
27 |
+
alt="<?php echo $image->alttext; ?>"
|
28 |
+
title="<?php echo $image->alttext; ?>"/>
|
29 |
</a>
|
30 |
<?php if (!empty ($image->caption)) : ?><span><?php echo $image->caption ?></span><?php endif; ?>
|
31 |
<?php endif; ?>
|
products/photocrati_nextgen/modules/router/class.router.php
CHANGED
@@ -151,9 +151,9 @@ class Mixin_Router extends Mixin
|
|
151 |
function is_https()
|
152 |
{
|
153 |
return (
|
154 |
-
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ||
|
155 |
-
(!empty($_SERVER['HTTP_USESSL']) && $_SERVER['HTTP_USESSL'] !== 'off') ||
|
156 |
-
(!empty($_SERVER['REDIRECT_HTTPS']) && $_SERVER['REDIRECT_HTTPS'] !== 'off') ||
|
157 |
$_SERVER['SERVER_PORT'] == 443);
|
158 |
}
|
159 |
|
151 |
function is_https()
|
152 |
{
|
153 |
return (
|
154 |
+
(!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') ||
|
155 |
+
(!empty($_SERVER['HTTP_USESSL']) && strtolower($_SERVER['HTTP_USESSL']) !== 'off') ||
|
156 |
+
(!empty($_SERVER['REDIRECT_HTTPS']) && strtolower($_SERVER['REDIRECT_HTTPS']) !== 'off') ||
|
157 |
$_SERVER['SERVER_PORT'] == 443);
|
158 |
}
|
159 |
|
products/photocrati_nextgen/modules/router/class.routing_app.php
CHANGED
@@ -50,7 +50,7 @@ class Mixin_Routing_App extends Mixin
|
|
50 |
);
|
51 |
|
52 |
// We treat wildcards much differently then normal rewrites
|
53 |
-
if (preg_match("/\\{[
|
54 |
$pattern = str_replace('{*}', '(.*?)', $src);
|
55 |
$pattern = str_replace('{.*}', '(.*?)', $pattern);
|
56 |
$pattern = str_replace('{\\w}', '([\\w-_]*)', $pattern);
|
@@ -445,7 +445,7 @@ class Mixin_Routing_App extends Mixin
|
|
445 |
$route_regex = '#' . $route_regex . '/?$#i';
|
446 |
|
447 |
// convert placeholders to regex as well
|
448 |
-
return preg_replace('/~([^~]+)~/i', ($param_slug ? '('.preg_quote($param_slug,'#').'\K)?' : '').'(
|
449 |
}
|
450 |
|
451 |
/**
|
@@ -519,8 +519,7 @@ class Mixin_Routing_App extends Mixin
|
|
519 |
if (!isset($parts['path'])) $parts['path'] = '';
|
520 |
$parts['path'] = $this->object->join_paths(
|
521 |
$parts['path'],
|
522 |
-
|
523 |
-
$param_slug : '',
|
524 |
$this->object->create_parameter_segment($key, $value, $id, $use_prefix)
|
525 |
);
|
526 |
$retval = $this->object->construct_url_from_parts($parts);
|
50 |
);
|
51 |
|
52 |
// We treat wildcards much differently then normal rewrites
|
53 |
+
if (preg_match("/\\{[\\.\\\\*]/", $src)) {
|
54 |
$pattern = str_replace('{*}', '(.*?)', $src);
|
55 |
$pattern = str_replace('{.*}', '(.*?)', $pattern);
|
56 |
$pattern = str_replace('{\\w}', '([\\w-_]*)', $pattern);
|
445 |
$route_regex = '#' . $route_regex . '/?$#i';
|
446 |
|
447 |
// convert placeholders to regex as well
|
448 |
+
return preg_replace('/~([^~]+)~/i', ($param_slug ? '('.preg_quote($param_slug,'#').'\K)?' : '').'(?P<\1>[^/]+)/?', $route_regex);
|
449 |
}
|
450 |
|
451 |
/**
|
519 |
if (!isset($parts['path'])) $parts['path'] = '';
|
520 |
$parts['path'] = $this->object->join_paths(
|
521 |
$parts['path'],
|
522 |
+
$param_slug && strpos($parts['path'], $param_slug) === FALSE ? $param_slug : '',
|
|
|
523 |
$this->object->create_parameter_segment($key, $value, $id, $use_prefix)
|
524 |
);
|
525 |
$retval = $this->object->construct_url_from_parts($parts);
|
products/photocrati_nextgen/modules/router/module.router.php
CHANGED
@@ -13,7 +13,7 @@ class M_Router extends C_Base_Module
|
|
13 |
'photocrati-router',
|
14 |
'Router for Pope',
|
15 |
'Provides routing capabilities for Pope modules',
|
16 |
-
'0.
|
17 |
'http://www.photocrati.com',
|
18 |
'Photocrati Media',
|
19 |
'http://www.photocrati.com'
|
13 |
'photocrati-router',
|
14 |
'Router for Pope',
|
15 |
'Provides routing capabilities for Pope modules',
|
16 |
+
'0.4',
|
17 |
'http://www.photocrati.com',
|
18 |
'Photocrati Media',
|
19 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/modules/security/class.wordpress_security_actor.php
CHANGED
@@ -105,6 +105,19 @@ class Mixin_WordPress_Security_Action_Converter extends Mixin
|
|
105 |
{
|
106 |
$capability_name = 'NextGEN Upload images';
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
break;
|
109 |
}
|
110 |
}
|
105 |
{
|
106 |
$capability_name = 'NextGEN Upload images';
|
107 |
|
108 |
+
break;
|
109 |
+
}
|
110 |
+
case 'nextgen_edit_album_settings':
|
111 |
+
{
|
112 |
+
$capability_name = 'NextGEN Edit album settings';
|
113 |
+
|
114 |
+
break;
|
115 |
+
}
|
116 |
+
|
117 |
+
case 'nextgen_edit_album':
|
118 |
+
{
|
119 |
+
$capability_name = 'NextGEN Edit album';
|
120 |
+
|
121 |
break;
|
122 |
}
|
123 |
}
|
products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/***
|
4 |
+
{
|
5 |
+
Module: photocrati-third_party_compat,
|
6 |
+
Depends: {}
|
7 |
+
}
|
8 |
+
***/
|
9 |
+
class M_Third_Party_Compat extends C_Base_Module
|
10 |
+
{
|
11 |
+
function define()
|
12 |
+
{
|
13 |
+
parent::define(
|
14 |
+
'photocrati-third_party_compat',
|
15 |
+
'Third Party Compatibility',
|
16 |
+
"Adds Third party compatibility hacks, adjustments, and modifications",
|
17 |
+
'0.1',
|
18 |
+
'http://www.nextgen-gallery.com',
|
19 |
+
'Photocrati Media',
|
20 |
+
'http://www.photocrati.com'
|
21 |
+
);
|
22 |
+
}
|
23 |
+
|
24 |
+
function _register_adapters()
|
25 |
+
{
|
26 |
+
}
|
27 |
+
|
28 |
+
function _register_hooks()
|
29 |
+
{
|
30 |
+
add_action('init', array(&$this, 'colorbox'), PHP_INT_MAX);
|
31 |
+
add_action('wp', array(&$this, 'bjlazyload'), PHP_INT_MAX);
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Colorbox fires a filter (pri=100) to add class attributes to images via a the_content filter. We fire our
|
36 |
+
* shortcodes at PHP_INT_MAX-1 to avoid encoding issues with some themes. Here we move the Colorbox filters
|
37 |
+
* priority to PHP_INT_MAX so that they run after our shortcode text has been replaced with rendered galleries.
|
38 |
+
*/
|
39 |
+
function colorbox()
|
40 |
+
{
|
41 |
+
if (!class_exists('JQueryColorboxFrontend'))
|
42 |
+
return;
|
43 |
+
|
44 |
+
global $wp_filter;
|
45 |
+
|
46 |
+
if (empty($wp_filter['the_content'][100]))
|
47 |
+
return;
|
48 |
+
|
49 |
+
foreach ($wp_filter['the_content'][100] as $id => $filter) {
|
50 |
+
if (!strpos($id, 'addColorboxGroupIdToImages'))
|
51 |
+
continue;
|
52 |
+
|
53 |
+
$object = $filter['function'][0];
|
54 |
+
|
55 |
+
if (get_class($object) != 'JQueryColorboxFrontend')
|
56 |
+
continue;
|
57 |
+
|
58 |
+
remove_filter('the_content', array($object, 'addColorboxGroupIdToImages'), 100);
|
59 |
+
remove_filter('the_excerpt', array($object, 'addColorboxGroupIdToImages'), 100);
|
60 |
+
add_filter('the_content', array($object, 'addColorboxGroupIdToImages'), PHP_INT_MAX);
|
61 |
+
add_filter('the_excerpt', array($object, 'addColorboxGroupIdToImages'), PHP_INT_MAX);
|
62 |
+
break;
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* For the same reasons as Colorbox we move BJ-Lazy-load's filter() method to a later priority so it can access
|
68 |
+
* our rendered galleries.
|
69 |
+
*/
|
70 |
+
function bjlazyload()
|
71 |
+
{
|
72 |
+
if (!class_exists('BJLL'))
|
73 |
+
return;
|
74 |
+
|
75 |
+
global $wp_filter;
|
76 |
+
|
77 |
+
if (empty($wp_filter['the_content'][200]))
|
78 |
+
return;
|
79 |
+
|
80 |
+
foreach ($wp_filter['the_content'][200] as $id => $filter) {
|
81 |
+
if (!strpos($id, 'filter'))
|
82 |
+
continue;
|
83 |
+
|
84 |
+
$object = $filter['function'][0];
|
85 |
+
|
86 |
+
if (get_class($object) != 'BJLL')
|
87 |
+
continue;
|
88 |
+
|
89 |
+
remove_filter('the_content', array($object, 'filter'), 200);
|
90 |
+
add_filter('the_content', array($object, 'filter'), PHP_INT_MAX);
|
91 |
+
break;
|
92 |
+
}
|
93 |
+
|
94 |
+
add_filter('the_content', array($this, 'bjlazyload_filter'), PHP_INT_MAX-1);
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* BJ-Lazy-load's regex is lazy and doesn't handle multiline search or instances where <img is immediately followed
|
99 |
+
* by a newline. The following regex replaces newlines and strips unnecessary space. We fire this filter
|
100 |
+
* before BJ-Lazy-Load's to make our galleries compatible with its expectations.
|
101 |
+
*
|
102 |
+
* @param string $content
|
103 |
+
* @return string
|
104 |
+
*/
|
105 |
+
function bjlazyload_filter($content)
|
106 |
+
{
|
107 |
+
return trim(preg_replace("/\s\s+/", " ", $content));
|
108 |
+
}
|
109 |
+
|
110 |
+
function get_type_list()
|
111 |
+
{
|
112 |
+
return array(
|
113 |
+
);
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
new M_Third_Party_Compat();
|
products/photocrati_nextgen/modules/widget/class.widget.php
CHANGED
@@ -81,7 +81,7 @@ class Mixin_Widget extends Mixin
|
|
81 |
*/
|
82 |
function echo_widget_slideshow($galleryID, $width = '', $height = '')
|
83 |
{
|
84 |
-
wp_enqueue_style('nextgen_widgets_style', $this->get_static_url('widgets.css'));
|
85 |
wp_enqueue_style('nextgen_basic_slideshow_style', $this->get_static_url('nextgen_basic_slideshow#nextgen_basic_slideshow.css'));
|
86 |
$widget = new C_Widget_Slideshow();
|
87 |
$widget->render_slideshow($galleryID, $width, $height);
|
81 |
*/
|
82 |
function echo_widget_slideshow($galleryID, $width = '', $height = '')
|
83 |
{
|
84 |
+
wp_enqueue_style('nextgen_widgets_style', $this->get_static_url('widget#widgets.css'));
|
85 |
wp_enqueue_style('nextgen_basic_slideshow_style', $this->get_static_url('nextgen_basic_slideshow#nextgen_basic_slideshow.css'));
|
86 |
$widget = new C_Widget_Slideshow();
|
87 |
$widget->render_slideshow($galleryID, $width, $height);
|
products/photocrati_nextgen/modules/widget/class.widget_gallery.php
CHANGED
@@ -45,6 +45,32 @@ class C_Widget_Gallery extends WP_Widget
|
|
45 |
function update($new_instance, $old_instance)
|
46 |
{
|
47 |
$instance = $old_instance;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
$instance['title'] = strip_tags($new_instance['title']);
|
49 |
$instance['items'] = (int)$new_instance['items'];
|
50 |
$instance['type'] = $new_instance['type'];
|
45 |
function update($new_instance, $old_instance)
|
46 |
{
|
47 |
$instance = $old_instance;
|
48 |
+
|
49 |
+
// do not allow 0 or less
|
50 |
+
if ((int)$new_instance['items'] <= 0)
|
51 |
+
$new_instance['items'] = 4;
|
52 |
+
|
53 |
+
// for clarity: empty the list if we're showing every gallery anyway
|
54 |
+
if ($new_instance['exclude'] == 'all')
|
55 |
+
$new_instance['list'] = '';
|
56 |
+
|
57 |
+
// remove gallery ids that do not exist
|
58 |
+
if (in_array($new_instance['exclude'], array('denied', 'allow')))
|
59 |
+
{
|
60 |
+
// do search
|
61 |
+
$mapper = C_Component_Registry::get_instance()->get_utility('I_Gallery_Mapper');
|
62 |
+
$ids = explode(',', $new_instance['list']);
|
63 |
+
foreach ($ids as $ndx => $id) {
|
64 |
+
if (!$mapper->find($id))
|
65 |
+
unset($ids[$ndx]);
|
66 |
+
}
|
67 |
+
$new_instance['list'] = implode(',', $ids);
|
68 |
+
}
|
69 |
+
|
70 |
+
// reset to show all galleries IF there are no valid galleries in the list
|
71 |
+
if ($new_instance['exclude'] !== 'all' && empty($new_instance['list']))
|
72 |
+
$new_instance['exclude'] = 'all';
|
73 |
+
|
74 |
$instance['title'] = strip_tags($new_instance['title']);
|
75 |
$instance['items'] = (int)$new_instance['items'];
|
76 |
$instance['type'] = $new_instance['type'];
|
products/photocrati_nextgen/modules/widget/module.widget.php
CHANGED
@@ -15,7 +15,7 @@ class M_Widget extends C_Base_Module
|
|
15 |
'photocrati-widget',
|
16 |
'Widget',
|
17 |
'Handles clearing of NextGen Widgets',
|
18 |
-
'0.
|
19 |
'http://www.nextgen-gallery.com',
|
20 |
'Photocrati Media',
|
21 |
'http://www.photocrati.com'
|
15 |
'photocrati-widget',
|
16 |
'Widget',
|
17 |
'Handles clearing of NextGen Widgets',
|
18 |
+
'0.2',
|
19 |
'http://www.nextgen-gallery.com',
|
20 |
'Photocrati Media',
|
21 |
'http://www.photocrati.com'
|
products/photocrati_nextgen/product.photocrati_nextgen.php
CHANGED
@@ -43,7 +43,9 @@ class P_Photocrati_NextGen extends C_Base_Product
|
|
43 |
'photocrati-nextgen_basic_singlepic',
|
44 |
'photocrati-nextgen_basic_tagcloud',
|
45 |
'photocrati-nextgen_basic_album',
|
46 |
-
'photocrati-widget'
|
|
|
|
|
47 |
);
|
48 |
|
49 |
function define()
|
@@ -52,7 +54,7 @@ class P_Photocrati_NextGen extends C_Base_Product
|
|
52 |
'photocrati-nextgen',
|
53 |
'Photocrati NextGEN',
|
54 |
'Photocrati NextGEN',
|
55 |
-
'2.0.
|
56 |
'http://www.nextgen-gallery.com',
|
57 |
'Photocrati Media',
|
58 |
'http://www.photocrati.com'
|
43 |
'photocrati-nextgen_basic_singlepic',
|
44 |
'photocrati-nextgen_basic_tagcloud',
|
45 |
'photocrati-nextgen_basic_album',
|
46 |
+
'photocrati-widget',
|
47 |
+
'photocrati-third_party_compat',
|
48 |
+
'photocrati-nextgen_xmlrpc'
|
49 |
);
|
50 |
|
51 |
function define()
|
54 |
'photocrati-nextgen',
|
55 |
'Photocrati NextGEN',
|
56 |
'Photocrati NextGEN',
|
57 |
+
'2.0.33',
|
58 |
'http://www.nextgen-gallery.com',
|
59 |
'Photocrati Media',
|
60 |
'http://www.photocrati.com'
|
readme.txt
CHANGED
@@ -199,6 +199,31 @@ For more information, feel free to visit the official website for the NextGEN Ga
|
|
199 |
|
200 |
== Changelog ==
|
201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
= V2.0.31 - 10.03.2013 =
|
203 |
* NEW: Restored AJAX pagination for NextGEN Basic ImageBrowser display type
|
204 |
* Fixed: Compatibility with WordPress Local SEO by Yoast
|
199 |
|
200 |
== Changelog ==
|
201 |
|
202 |
+
= V2.0.33 - 10.21.2013 =
|
203 |
+
* NEW: Requests /ngg_tag/[tagname] will create a displayed gallery
|
204 |
+
* NEW: Option added to "Import Gallery" tab to use original images
|
205 |
+
* Fixed: Links are broken on the ngg_tags-sitemap.xml file by WordPress SEO
|
206 |
+
* Fixed: PHP notice: Attempt to assign property of non-object
|
207 |
+
* Fixed: Undefined property warnings when using NextGEN Basic Thumbnails
|
208 |
+
* Fixed: Detect if an applying a transient to a displayed gallery was successful
|
209 |
+
* Fixed: Compatibility issues with BJ-Lazy-Load and Colorbox
|
210 |
+
* Fixed: Pagination conflicts for multiple Imagebrowsers on the same page
|
211 |
+
* Fixed: Ability to display previous exception with debug mode
|
212 |
+
* Fixed: Tagclouds not working in multisite instances
|
213 |
+
* Fixed: Load widgets.css when a widget is being used
|
214 |
+
* Fixed: Installer should remove all instances of the component factory
|
215 |
+
* Fixed: Widget settings interface not intuitive
|
216 |
+
* Fixed: Inability to upload images in some Windows host environments
|
217 |
+
* Fixed: Sorting images/galleries using the Attach To Post interface
|
218 |
+
* Fixed: Fix detection of HTTPS (pull request by Leonhardt Wille)
|
219 |
+
* Fixed: Compilation errors of regular expressions
|
220 |
+
* Fixed: Pro galleries wouldn't display in environments using PHP 5.3.3 or less
|
221 |
+
* Fixed: Scanning of router slug is now limited to the uri, not the url
|
222 |
+
* Fixed: Show slideshow link isn't required for thumbnail/imagebrowser integration
|
223 |
+
* Fixed: WordPress media-upload with 'singlepic' image size
|
224 |
+
* Fixed: Use target=_blank when the link setting is provided for NextGEN Basic Singlepic
|
225 |
+
* Fixed: Only display rendering errors if WP_DEBUG is enabled
|
226 |
+
|
227 |
= V2.0.31 - 10.03.2013 =
|
228 |
* NEW: Restored AJAX pagination for NextGEN Basic ImageBrowser display type
|
229 |
* Fixed: Compatibility with WordPress Local SEO by Yoast
|