NextGEN Gallery – WordPress Gallery Plugin - Version 2.0.66.26

Version Description

  • 08.18.2014 =
  • NEW: Added fault tolerance to bulk action AJAX requests
  • Changed: Moved some settings from DB to in-memory
  • Fixed: Compatibility with BuddyPress plugin in multisite environments
  • Fixed: Ability to find static resources outside of WP_PLUGIN_DIR
  • Fixed: Autoupdate conflict with Photocrati Theme
  • Fixed: Workaround GoDaddy's throttling of consecutive AJAX requests
  • Fixed: Issue with settings manager in multisite enviroments
Download this release

Release Info

Developer photocrati
Plugin Icon 128x128 NextGEN Gallery – WordPress Gallery Plugin
Version 2.0.66.26
Comparing to
See all releases

Code changes from version 2.0.66.17 to 2.0.66.26

Files changed (30) hide show
  1. changelog.txt +9 -0
  2. nggallery.php +16 -16
  3. non_pope/class.nextgen_settings.php +12 -17
  4. non_pope/class.photocrati_settings_manager.php +21 -20
  5. products/photocrati_nextgen/modules/ajax/module.ajax.php +6 -1
  6. products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php +6 -1
  7. products/photocrati_nextgen/modules/frame_communication/class.frame_communication_installer.php +0 -14
  8. products/photocrati_nextgen/modules/frame_communication/class.frame_event_publisher.php +1 -1
  9. products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php +11 -6
  10. products/photocrati_nextgen/modules/fs/class.fs.php +37 -19
  11. products/photocrati_nextgen/modules/mvc/adapter.mvc_fs.php +12 -1
  12. products/photocrati_nextgen/modules/mvc/adapter.mvc_router.php +28 -4
  13. products/photocrati_nextgen/modules/mvc/class.mvc_installer.php +0 -16
  14. products/photocrati_nextgen/modules/mvc/class.mvc_option_handler.php +15 -2
  15. products/photocrati_nextgen/modules/mvc/class.mvc_view.php +1 -2
  16. products/photocrati_nextgen/modules/mvc/module.mvc.php +13 -5
  17. products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php +6 -1
  18. products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php +1 -1
  19. products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php +1 -1
  20. products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php +1 -1
  21. products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php +1 -1
  22. products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php +1 -1
  23. products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php +1 -1
  24. products/photocrati_nextgen/modules/ngglegacy/admin/css/nggadmin.css +3 -3
  25. products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.ajax.js +47 -18
  26. products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.progressbar.js +1 -0
  27. products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php +21 -1
  28. products/photocrati_nextgen/modules/wordpress_routing/adapter.wordpress_router.php +59 -38
  29. products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php +24 -10
  30. readme.txt +9 -0
changelog.txt CHANGED
@@ -1,6 +1,15 @@
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
 
 
 
 
 
 
 
 
 
4
  = V2.0.66.17 - 08.08.2014 =
5
  * NEW: Added french translations
6
  * Secured: XSS vulnerability in jQuery Plupload Queue (thanks Codevigilant Team)
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
4
+ = V2.0.66.26 - 08.18.2014 =
5
+ * NEW: Added fault tolerance to bulk action AJAX requests
6
+ * Changed: Moved some settings from DB to in-memory
7
+ * Fixed: Compatibility with BuddyPress plugin in multisite environments
8
+ * Fixed: Ability to find static resources outside of WP_PLUGIN_DIR
9
+ * Fixed: Autoupdate conflict with Photocrati Theme
10
+ * Fixed: Workaround GoDaddy's throttling of consecutive AJAX requests
11
+ * Fixed: Issue with settings manager in multisite enviroments
12
+
13
  = V2.0.66.17 - 08.08.2014 =
14
  * NEW: Added french translations
15
  * Secured: XSS vulnerability in jQuery Plupload Queue (thanks Codevigilant Team)
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 9 million downloads.
7
- * Version: 2.0.66.17
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
@@ -255,9 +255,7 @@ class C_NextGEN_Bootstrap
255
  }
256
 
257
  // If the selected stylesheet is using an unsafe path, then notify the user
258
- if (C_NextGen_Style_Manager::get_instance()->is_directory_unsafe()) {
259
- add_action('all_admin_notices', array(&$this, 'display_stylesheet_notice'));
260
- }
261
 
262
  // Delete displayed gallery transients periodically
263
  add_filter('cron_schedules', array(&$this, 'add_ngg_schedule'));
@@ -358,17 +356,19 @@ class C_NextGEN_Bootstrap
358
  */
359
  function display_stylesheet_notice()
360
  {
361
- $styles = C_NextGen_Style_Manager::get_instance();
362
- $filename = $styles->get_selected_stylesheet();
363
- $abspath = $styles->find_selected_stylesheet_abspath();
364
- $newpath = $styles->new_dir;
365
-
366
- echo "<div class='updated error'>
367
- <h3>WARNING: NextGEN Gallery Stylesheet NOT Upgrade-safe</h3>
368
- <p>
369
- <strong>{$filename}</strong> is currently stored in <strong>{$abspath}</strong>, which isn't upgrade-safe. Please move the stylesheet to
370
- <strong>{$newpath}</strong> to ensure that your customizations persist after updates.
371
- </p></div>";
 
 
372
  }
373
 
374
  /**
@@ -431,7 +431,7 @@ class C_NextGEN_Bootstrap
431
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
432
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
433
  define('NGG_PLUGIN_STARTED_AT', microtime());
434
- define('NGG_PLUGIN_VERSION', '2.0.66.17');
435
 
436
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
437
  define('NGG_HIDE_STRICT_ERRORS', TRUE);
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 9 million downloads.
7
+ * Version: 2.0.66.26
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
255
  }
256
 
257
  // If the selected stylesheet is using an unsafe path, then notify the user
258
+ add_action('all_admin_notices', array(&$this, 'display_stylesheet_notice'));
 
 
259
 
260
  // Delete displayed gallery transients periodically
261
  add_filter('cron_schedules', array(&$this, 'add_ngg_schedule'));
356
  */
357
  function display_stylesheet_notice()
358
  {
359
+ if (C_NextGen_Style_Manager::get_instance()->is_directory_unsafe()) {
360
+ $styles = C_NextGen_Style_Manager::get_instance();
361
+ $filename = $styles->get_selected_stylesheet();
362
+ $abspath = $styles->find_selected_stylesheet_abspath();
363
+ $newpath = $styles->new_dir;
364
+
365
+ echo "<div class='updated error'>
366
+ <h3>WARNING: NextGEN Gallery Stylesheet NOT Upgrade-safe</h3>
367
+ <p>
368
+ <strong>{$filename}</strong> is currently stored in <strong>{$abspath}</strong>, which isn't upgrade-safe. Please move the stylesheet to
369
+ <strong>{$newpath}</strong> to ensure that your customizations persist after updates.
370
+ </p></div>";
371
+ }
372
  }
373
 
374
  /**
431
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
432
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
433
  define('NGG_PLUGIN_STARTED_AT', microtime());
434
+ define('NGG_PLUGIN_VERSION', '2.0.66.26');
435
 
436
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
437
  define('NGG_HIDE_STRICT_ERRORS', TRUE);
non_pope/class.nextgen_settings.php CHANGED
@@ -2,28 +2,23 @@
2
 
3
 
4
  if (!class_exists('C_NextGen_Settings')) {
5
- class C_NextGen_Settings {
6
- static function get_instance()
7
- {
8
  return C_Photocrati_Settings_Manager::get_instance();
9
- }
10
-
11
- static function add_option_handler($klass, $options=array())
12
- {
13
- $instance = self::get_instance();
14
- return $instance->add_option_handler($klass, $options);
15
- }
16
- }
17
  }
18
 
19
  if (!class_exists('C_NextGen_Global_Settings')) {
20
- class C_NextGen_Global_Settings extends C_NextGen_Settings {
21
- static function get_instance()
22
- {
23
  if (is_multisite())
24
  return C_Photocrati_Global_Settings_Manager::get_instance();
25
- else
26
  return C_Photocrati_Settings_Manager::get_instance();
27
- }
28
- }
 
29
  }
2
 
3
 
4
  if (!class_exists('C_NextGen_Settings')) {
5
+ class C_NextGen_Settings {
6
+ static function get_instance()
7
+ {
8
  return C_Photocrati_Settings_Manager::get_instance();
9
+ }
10
+ }
 
 
 
 
 
 
11
  }
12
 
13
  if (!class_exists('C_NextGen_Global_Settings')) {
14
+ class C_NextGen_Global_Settings extends C_NextGen_Settings {
15
+ static function get_instance()
16
+ {
17
  if (is_multisite())
18
  return C_Photocrati_Global_Settings_Manager::get_instance();
19
+ else {
20
  return C_Photocrati_Settings_Manager::get_instance();
21
+ }
22
+ }
23
+ }
24
  }
non_pope/class.photocrati_settings_manager.php CHANGED
@@ -64,11 +64,12 @@ if (!class_exists('C_Photocrati_Settings_Manager_Base')) {
64
  {
65
  $retval = $default;
66
 
67
- if (isset($this->_options[$key]))
68
- $retval = $this->_options[$key];
69
- elseif (($handler = $this->_get_option_handler($key, 'get'))) {
70
- $retval = $handler->get($key, $default);
71
- }
 
72
 
73
  // In case a stdObject has been passed in as a value, we
74
  // want to only return scalar values or arrays
@@ -224,14 +225,14 @@ if (!class_exists('C_Photocrati_Settings_Manager_Base')) {
224
  if (!class_exists('C_Photocrati_Global_Settings_Manager')) {
225
  class C_Photocrati_Global_Settings_Manager extends C_Photocrati_Settings_Manager_Base
226
  {
 
227
  public static function get_instance()
228
  {
229
- static $_instance = NULL;
230
- if (is_null($_instance)) {
231
- $klass = get_class();
232
- $_instance = new $klass();
233
- }
234
- return $_instance;
235
  }
236
 
237
  function save()
@@ -257,15 +258,15 @@ if (!class_exists('C_Photocrati_Global_Settings_Manager')) {
257
  if (!class_exists('C_Photocrati_Settings_Manager')) {
258
  class C_Photocrati_Settings_Manager extends C_Photocrati_Settings_Manager_Base
259
  {
260
- public static function get_instance()
261
- {
262
- static $_instance = NULL;
263
- if (is_null($_instance)) {
264
- $klass = get_class();
265
- $_instance = new $klass();
266
- }
267
- return $_instance;
268
- }
269
 
270
  function get($key, $default=NULL)
271
  {
64
  {
65
  $retval = $default;
66
 
67
+ if (($handler = $this->_get_option_handler($key, 'get'))) {
68
+ $retval = $handler->get($key, $default);
69
+ }
70
+ else if (isset($this->_options[$key])) {
71
+ $retval = $this->_options[$key];
72
+ }
73
 
74
  // In case a stdObject has been passed in as a value, we
75
  // want to only return scalar values or arrays
225
  if (!class_exists('C_Photocrati_Global_Settings_Manager')) {
226
  class C_Photocrati_Global_Settings_Manager extends C_Photocrati_Settings_Manager_Base
227
  {
228
+ static $_instance = NULL;
229
  public static function get_instance()
230
  {
231
+ if (is_null(self::$_instance)) {
232
+ $klass = get_class();
233
+ self::$_instance = new $klass();
234
+ }
235
+ return self::$_instance;
 
236
  }
237
 
238
  function save()
258
  if (!class_exists('C_Photocrati_Settings_Manager')) {
259
  class C_Photocrati_Settings_Manager extends C_Photocrati_Settings_Manager_Base
260
  {
261
+ static $_instance = NULL;
262
+ public static function get_instance()
263
+ {
264
+ if (is_null(self::$_instance)) {
265
+ $klass = get_class();
266
+ self::$_instance = new $klass();
267
+ }
268
+ return self::$_instance;
269
+ }
270
 
271
  function get($key, $default=NULL)
272
  {
products/photocrati_nextgen/modules/ajax/module.ajax.php CHANGED
@@ -21,11 +21,16 @@ class M_Ajax extends C_Base_Module
21
  );
22
 
23
  include_once('class.ajax_option_handler.php');
24
- C_NextGen_Settings::add_option_handler('C_Ajax_Option_Handler', array(
25
  'ajax_slug',
26
  'ajax_url',
27
  'ajax_js_url'
28
  ));
 
 
 
 
 
29
 
30
  include_once('class.ajax_installer.php');
31
  C_Photocrati_Installer::add_handler($this->module_id, 'C_Ajax_Installer');
21
  );
22
 
23
  include_once('class.ajax_option_handler.php');
24
+ C_NextGen_Settings::get_instance()->add_option_handler('C_Ajax_Option_Handler', array(
25
  'ajax_slug',
26
  'ajax_url',
27
  'ajax_js_url'
28
  ));
29
+ if (is_multisite()) C_NextGen_Global_Settings::get_instance()->add_option_handler('C_Ajax_Option_Handler', array(
30
+ 'ajax_slug',
31
+ 'ajax_url',
32
+ 'ajax_js_url'
33
+ ));
34
 
35
  include_once('class.ajax_installer.php');
36
  C_Photocrati_Installer::add_handler($this->module_id, 'C_Ajax_Installer');
products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php CHANGED
@@ -31,11 +31,16 @@ class M_Attach_To_Post extends C_Base_Module
31
  );
32
 
33
  include_once('class.attach_to_post_option_handler.php');
34
- C_NextGen_Settings::add_option_handler('C_Attach_To_Post_Option_Handler', array(
35
  'attach_to_post_url',
36
  'gallery_preview_url',
37
  'attach_to_post_display_tab_js_url'
38
  ));
 
 
 
 
 
39
 
40
  include_once('class.attach_to_post_installer.php');
41
  C_Photocrati_Installer::add_handler($this->module_id, 'C_Attach_To_Post_Installer');
31
  );
32
 
33
  include_once('class.attach_to_post_option_handler.php');
34
+ C_NextGen_Settings::get_instance()->add_option_handler('C_Attach_To_Post_Option_Handler', array(
35
  'attach_to_post_url',
36
  'gallery_preview_url',
37
  'attach_to_post_display_tab_js_url'
38
  ));
39
+ if (is_multisite()) C_NextGen_Global_Settings::get_instance()->add_option_handler('C_Attach_To_Post_Option_Handler', array(
40
+ 'attach_to_post_url',
41
+ 'gallery_preview_url',
42
+ 'attach_to_post_display_tab_js_url'
43
+ ));
44
 
45
  include_once('class.attach_to_post_installer.php');
46
  C_Photocrati_Installer::add_handler($this->module_id, 'C_Attach_To_Post_Installer');
products/photocrati_nextgen/modules/frame_communication/class.frame_communication_installer.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
-
3
- class C_Frame_Communication_Installer
4
- {
5
- function __construct()
6
- {
7
- $this->settings = C_NextGen_Settings::get_instance();
8
- }
9
-
10
- function install()
11
- {
12
- $this->settings->set_default_value('frame_communication_option_name', 'X-Frame-Events');
13
- }
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
products/photocrati_nextgen/modules/frame_communication/class.frame_event_publisher.php CHANGED
@@ -15,7 +15,7 @@ class C_Frame_Event_Publisher extends C_Component
15
  function initialize()
16
  {
17
  parent::initialize();
18
- $this->setting_name = C_NextGen_Settings::get_instance()->frame_communication_option_name;
19
  }
20
 
21
  /**
15
  function initialize()
16
  {
17
  parent::initialize();
18
+ $this->setting_name = C_NextGen_Settings::get_instance()->frame_event_cookie_name;
19
  }
20
 
21
  /**
products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php CHANGED
@@ -15,15 +15,20 @@ class M_Frame_Communication extends C_Base_Module
15
  'photocrati-frame_communication',
16
  'Frame/iFrame Inter-Communication',
17
  'Provides a means for HTML frames to share server-side events with each other',
18
- '0.3',
19
  'http://www.nextgen-gallery.com',
20
  'Photocrati Media',
21
  'http://www.photocrati.com',
22
  $context
23
  );
24
 
25
- include_once('class.frame_communication_installer.php');
26
- C_Photocrati_Installer::add_handler($this->module_id, 'C_Frame_Communication_Installer');
 
 
 
 
 
27
  }
28
 
29
  function _register_utilities()
@@ -56,9 +61,9 @@ class M_Frame_Communication extends C_Base_Module
56
  function get_type_list()
57
  {
58
  return array(
59
- 'C_Frame_Communication_Installer' => 'class.frame_communication_installer.php',
60
- 'C_Frame_Event_Publisher' => 'class.frame_event_publisher.php',
61
- 'I_Frame_Event_Publisher' => 'interface.frame_event_publisher.php'
62
  );
63
  }
64
  }
15
  'photocrati-frame_communication',
16
  'Frame/iFrame Inter-Communication',
17
  'Provides a means for HTML frames to share server-side events with each other',
18
+ '0.4',
19
  'http://www.nextgen-gallery.com',
20
  'Photocrati Media',
21
  'http://www.photocrati.com',
22
  $context
23
  );
24
 
25
+ include_once('class.frame_communication_option_handler.php');
26
+ C_NextGen_Settings::get_instance()->add_option_handler('C_Frame_Communication_Option_Handler', array(
27
+ 'frame_event_cookie_name',
28
+ ));
29
+ C_NextGen_Global_Settings::get_instance()->add_option_handler('C_Frame_Communication_Option_Handler', array(
30
+ 'frame_event_cookie_name',
31
+ ));
32
  }
33
 
34
  function _register_utilities()
61
  function get_type_list()
62
  {
63
  return array(
64
+ 'C_Frame_Communication_Option_Handler' => 'class.frame_communication_option_handler.php',
65
+ 'C_Frame_Event_Publisher' => 'class.frame_event_publisher.php',
66
+ 'I_Frame_Event_Publisher' => 'interface.frame_event_publisher.php'
67
  );
68
  }
69
  }
products/photocrati_nextgen/modules/fs/class.fs.php CHANGED
@@ -336,33 +336,51 @@ class Mixin_Fs_Instance_Methods extends Mixin
336
  * Gets the document root for this application
337
  * @return string
338
  */
339
- function get_document_root($type = 'root')
340
- {
341
- if ($type == 'plugins') {
342
- $retval = WP_PLUGIN_DIR;
343
- }
344
- else if ($type == 'content') {
345
- $retval = WP_CONTENT_DIR;
346
- }
347
- else if ($type == 'gallery') {
348
- $root_type = defined('NGG_GALLERY_ROOT_TYPE') ? NGG_GALLERY_ROOT_TYPE : 'site';
349
- if ($root_type == 'content')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
  $retval = WP_CONTENT_DIR;
351
- else
 
 
 
 
 
 
 
 
 
352
  $retval = $this->_document_root;
353
  }
354
- else if (empty($type) || $type == 'root') {
355
- $retval = $this->_document_root;
356
- }
357
- else {
358
- $retval = $this->_document_root;
359
- }
360
 
361
  if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
362
  $retval = str_replace('/', DIRECTORY_SEPARATOR, $retval);
363
 
364
  return $retval;
365
- }
366
 
367
  /**
368
  * Sets the document root for this application
336
  * Gets the document root for this application
337
  * @return string
338
  */
339
+ function get_document_root($type = 'root')
340
+ {
341
+ $retval = NULL;
342
+
343
+ switch ($type) {
344
+ case 'plugins':
345
+ case 'plugin':
346
+ $retval = WP_PLUGIN_DIR;
347
+ break;
348
+ case 'plugins_mu':
349
+ case 'plugin_mu':
350
+ $retval = WPMU_PLUGIN_DIR;
351
+ break;
352
+ case 'templates':
353
+ case 'template':
354
+ case 'themes':
355
+ case 'theme':
356
+ $retval = get_template_directory();
357
+ break;
358
+ case 'styles':
359
+ case 'style':
360
+ case 'stylesheets':
361
+ case 'stylesheet':
362
+ $retval = get_stylesheet_directory();
363
+ break;
364
+ case 'content':
365
  $retval = WP_CONTENT_DIR;
366
+ break;
367
+ case 'gallery':
368
+ case 'galleries':
369
+ $root_type = defined('NGG_GALLERY_ROOT_TYPE') ? NGG_GALLERY_ROOT_TYPE : 'site';
370
+ if ($root_type == 'content')
371
+ $retval = WP_CONTENT_DIR;
372
+ else
373
+ $retval = $this->_document_root;
374
+ break;
375
+ default:
376
  $retval = $this->_document_root;
377
  }
 
 
 
 
 
 
378
 
379
  if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
380
  $retval = str_replace('/', DIRECTORY_SEPARATOR, $retval);
381
 
382
  return $retval;
383
+ }
384
 
385
  /**
386
  * Sets the document root for this application
products/photocrati_nextgen/modules/mvc/adapter.mvc_fs.php CHANGED
@@ -26,7 +26,18 @@ class A_MVC_Fs extends Mixin
26
 
27
  // Get the relative path, if asked. Skip when docroot=/ lest we generate url like
28
  // wp-contentpluginsnextgen-galleryproducts..
29
- if ($relative) $path = str_replace($fs->get_document_root('plugins'), '', $path);
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  return $path;
32
  }
26
 
27
  // Get the relative path, if asked. Skip when docroot=/ lest we generate url like
28
  // wp-contentpluginsnextgen-galleryproducts..
29
+ if ($relative) {
30
+ $original_length = strlen($path);
31
+ $roots = array('plugins', 'plugins_mu', 'templates', 'stylesheets');
32
+ $found_root = FALSE;
33
+ foreach ($roots as $root) {
34
+ $path = str_replace($this->object->get_document_root($root), '', $path);
35
+ if (strlen($path) != $original_length) {
36
+ $found_root = $root;
37
+ break;
38
+ }
39
+ }
40
+ }
41
 
42
  return $path;
43
  }
products/photocrati_nextgen/modules/mvc/adapter.mvc_router.php CHANGED
@@ -10,16 +10,40 @@ class A_MVC_Router extends Mixin
10
  */
11
  function get_static_url($path, $module=FALSE)
12
  {
 
 
13
  // Determine the base url
14
  $base_url = $this->object->get_base_url('plugins');
15
  $base_url = $this->object->remove_url_segment('/index.php', $base_url);
16
 
17
  // Find the module directory
18
  $fs = $this->object->get_registry()->get_utility('I_Fs');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
- return $this->join_paths(
21
- $base_url,
22
- str_replace("\\", '/', $fs->find_static_abspath($path, $module, TRUE))
23
- );
24
  }
25
  }
10
  */
11
  function get_static_url($path, $module=FALSE)
12
  {
13
+ $retval = '';
14
+
15
  // Determine the base url
16
  $base_url = $this->object->get_base_url('plugins');
17
  $base_url = $this->object->remove_url_segment('/index.php', $base_url);
18
 
19
  // Find the module directory
20
  $fs = $this->object->get_registry()->get_utility('I_Fs');
21
+ $path = $fs->find_static_abspath($path, $module);
22
+
23
+
24
+ // Convert the path to a relative path
25
+ $original_length = strlen($path);
26
+ $roots = array('plugins', 'plugins_mu', 'templates', 'stylesheets');
27
+ $found_root = FALSE;
28
+ foreach ($roots as $root) {
29
+ $path = str_replace($fs->get_document_root($root), '', $path);
30
+ if (strlen($path) != $original_length) {
31
+ $found_root = $root;
32
+ break;
33
+ }
34
+ }
35
+
36
+ if ($found_root) {
37
+ $retval = $this->object->join_paths(
38
+ $this->object->get_base_url($found_root),
39
+ str_replace("\\", '/', $path)
40
+ );
41
+ }
42
+
43
+ else {
44
+ //TODO: What do we do here?
45
+ }
46
 
47
+ return $retval;
 
 
 
48
  }
49
  }
products/photocrati_nextgen/modules/mvc/class.mvc_installer.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
-
3
- class C_MVC_Installer
4
- {
5
- function __construct()
6
- {
7
- $this->settings = C_NextGen_Settings::get_instance();
8
- }
9
-
10
- function install()
11
- {
12
- $this->settings->delete('mvc_template_dir');
13
- $this->settings->set_default_value('mvc_template_dirname', '/templates');
14
- $this->settings->set_default_value('mvc_static_dirname', '/static');
15
- }
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
products/photocrati_nextgen/modules/mvc/class.mvc_option_handler.php CHANGED
@@ -3,7 +3,20 @@
3
  class C_Mvc_Option_Handler
4
  {
5
  function get($option, $default=NULL)
6
- {
7
- return implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'templates'));
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  }
9
  }
3
  class C_Mvc_Option_Handler
4
  {
5
  function get($option, $default=NULL)
6
+ {
7
+ $retval = $default;
8
+
9
+ switch ($option) {
10
+ case 'mvc_template_dir':
11
+ case 'mvc_template_dirname':
12
+ $retval = '/templates';
13
+ break;
14
+ case 'mvc_static_dirname':
15
+ case 'mvc_static_dir':
16
+ $retval = '/static';
17
+ break;
18
+ }
19
+
20
+ return $retval;
21
  }
22
  }
products/photocrati_nextgen/modules/mvc/class.mvc_view.php CHANGED
@@ -240,8 +240,7 @@ class Mixin_Mvc_View_Instance_Methods extends Mixin
240
  $path = $path . '.php';
241
 
242
  $retval = $fs->join_paths(
243
- $fs->get_document_root('plugins'),
244
- $this->object->get_registry()->get_module_dir($module),
245
  $settings->mvc_template_dirname,
246
  $path
247
  );
240
  $path = $path . '.php';
241
 
242
  $retval = $fs->join_paths(
243
+ $this->object->get_registry()->get_module_dir($module),
 
244
  $settings->mvc_template_dirname,
245
  $path
246
  );
products/photocrati_nextgen/modules/mvc/module.mvc.php CHANGED
@@ -27,13 +27,21 @@ class M_MVC extends C_Base_Module
27
  "http://www.photocrati.com"
28
  );
29
 
30
- include_once('class.mvc_installer.php');
31
- C_Photocrati_Installer::add_handler($this->module_id, 'C_Mvc_Installer');
32
-
33
  include_once('class.mvc_option_handler.php');
34
- C_NextGen_Settings::add_option_handler('C_Mvc_Option_Handler', array(
35
- 'mvc_template_dir'
 
 
 
36
  ));
 
 
 
 
 
 
 
 
37
  }
38
 
39
  function _register_utilities()
27
  "http://www.photocrati.com"
28
  );
29
 
 
 
 
30
  include_once('class.mvc_option_handler.php');
31
+ C_NextGen_Settings::get_instance()->add_option_handler('C_Mvc_Option_Handler', array(
32
+ 'mvc_template_dir',
33
+ 'mvc_template_dirname',
34
+ 'mvc_static_dir',
35
+ 'mvc_static_dirname'
36
  ));
37
+
38
+ if (is_multisite()) C_NextGen_Global_Settings::get_instance()->add_option_handler('C_Mvc_Option_Handler', array(
39
+ 'mvc_template_dir',
40
+ 'mvc_template_dirname',
41
+ 'mvc_static_dir',
42
+ 'mvc_static_dirname'
43
+ ));
44
+
45
  }
46
 
47
  function _register_utilities()
products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php CHANGED
@@ -29,11 +29,16 @@ class M_NextGen_Admin extends C_Base_Module
29
  C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer');
30
 
31
  include_once('class.nextgen_admin_option_handler.php');
32
- C_NextGen_Settings::add_option_handler('C_NextGen_Admin_Option_Handler', array(
33
  'jquery_ui_theme',
34
  'jquery_ui_theme_version',
35
  'jquery_ui_theme_url'
36
  ));
 
 
 
 
 
37
  }
38
 
39
  /**
29
  C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer');
30
 
31
  include_once('class.nextgen_admin_option_handler.php');
32
+ C_NextGen_Settings::get_instance()->add_option_handler('C_NextGen_Admin_Option_Handler', array(
33
  'jquery_ui_theme',
34
  'jquery_ui_theme_version',
35
  'jquery_ui_theme_url'
36
  ));
37
+ if (is_multisite()) C_NextGen_Global_Settings::get_instance()->add_option_handler('C_NextGen_Admin_Option_Handler', array(
38
+ 'jquery_ui_theme',
39
+ 'jquery_ui_theme_version',
40
+ 'jquery_ui_theme_url'
41
+ ));
42
  }
43
 
44
  /**
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.7',
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.9',
22
  'http://nextgen-gallery.com',
23
  'Photocrati Media',
24
  'http://www.photocrati.com'
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.9',
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.11',
29
  'http://www.nextgen-gallery.com',
30
  'Photocrati Media',
31
  'http://www.photocrati.com'
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.7',
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.9',
23
  'http://www.nextgen-gallery.com',
24
  'Photocrati Media',
25
  'http://www.photocrati.com'
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
  NGG_BASIC_SINGLEPIC,
18
  'NextGen Basic Singlepic',
19
  'Provides a singlepic gallery for NextGEN Gallery',
20
- '0.7',
21
  'http://www.photocrati.com',
22
  'Photocrati Media',
23
  'http://www.photocrati.com'
17
  NGG_BASIC_SINGLEPIC,
18
  'NextGen Basic Singlepic',
19
  'Provides a singlepic gallery for NextGEN Gallery',
20
+ '0.9',
21
  'http://www.photocrati.com',
22
  'Photocrati Media',
23
  'http://www.photocrati.com'
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
  NGG_BASIC_TAGCLOUD,
18
  'NextGen Basic Tagcloud',
19
  'Provides a tagcloud for NextGEN Gallery',
20
- '0.7',
21
  'http://www.photocrati.com',
22
  'Photocrati Media',
23
  'http://www.photocrati.com'
17
  NGG_BASIC_TAGCLOUD,
18
  'NextGen Basic Tagcloud',
19
  'Provides a tagcloud for NextGEN Gallery',
20
+ '0.9',
21
  'http://www.photocrati.com',
22
  'Photocrati Media',
23
  'http://www.photocrati.com'
products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php CHANGED
@@ -17,7 +17,7 @@ class M_NextGen_Settings extends C_Base_Module
17
  'photocrati-nextgen_settings',
18
  'NextGEN Gallery Settings',
19
  'Provides central management for NextGEN Gallery settings',
20
- '0.5',
21
  'http://www.nextgen-gallery.com',
22
  'Photocrati Media',
23
  'http://www.photocrati.com'
17
  'photocrati-nextgen_settings',
18
  'NextGEN Gallery Settings',
19
  'Provides central management for NextGEN Gallery settings',
20
+ '0.8',
21
  'http://www.nextgen-gallery.com',
22
  'Photocrati Media',
23
  'http://www.photocrati.com'
products/photocrati_nextgen/modules/ngglegacy/admin/css/nggadmin.css CHANGED
@@ -203,13 +203,13 @@ p#ngg-inlinebutton {
203
 
204
  #ngg-listimages .column-1,
205
  #ngg-listimages .column-2 {
206
- width: 3%;
207
- min-width: 33px;
208
  }
209
 
210
  #ngg-listimages .column-3 {
211
  min-width: 80px;
212
- width: 8%;
213
  }
214
 
215
  #ngg-listimages .column-3 .thumb {
203
 
204
  #ngg-listimages .column-1,
205
  #ngg-listimages .column-2 {
206
+ width: 4%;
207
+ min-width: 33px;
208
  }
209
 
210
  #ngg-listimages .column-3 {
211
  min-width: 80px;
212
+ width: 10%;
213
  }
214
 
215
  #ngg-listimages .column-3 .thumb {
products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.ajax.js CHANGED
@@ -16,7 +16,10 @@ nggAjax = {
16
  permission: nggAjaxSetup.permission,
17
  error: nggAjaxSetup.error,
18
  failure: nggAjaxSetup.failure,
19
- timeout: 10000
 
 
 
20
  },
21
 
22
  run: function( index ) {
@@ -24,7 +27,7 @@ nggAjax = {
24
  var req = $.ajax({
25
  type: "POST",
26
  url: s.url,
27
- data:"action=" + s.action + "&operation=" + s.operation + "&_wpnonce=" + s.nonce + "&image=" + s.ids[index],
28
  cache: false,
29
  timeout: 30000,
30
  success: function(msg){
@@ -45,22 +48,48 @@ nggAjax = {
45
  }
46
 
47
  },
48
- error: function (jqXHR, textStatus, errorThrown) {
49
- var msg = jqXHR.responseText;
50
-
51
- if (msg == '') {
52
- msg = '( ' + errorThrown + ' )';
53
- }
54
- nggProgressBar.addNote( "<strong>ID " + nggAjax.settings.ids[index] + ":</strong> " + nggAjax.settings.failure, msg);
55
- },
56
- complete: function () {
57
- index++;
58
- nggProgressBar.increase( index );
59
- // parse the whole array
60
- if (index < nggAjax.settings.ids.length)
61
- nggAjax.run( index );
62
- else
63
- nggProgressBar.finished();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
  });
66
  },
16
  permission: nggAjaxSetup.permission,
17
  error: nggAjaxSetup.error,
18
  failure: nggAjaxSetup.failure,
19
+ timeout: 20000,
20
+ retries: 0,
21
+ max_retries: 5,
22
+ retry_delay: 30000
23
  },
24
 
25
  run: function( index ) {
27
  var req = $.ajax({
28
  type: "POST",
29
  url: s.url,
30
+ data:"action=" + s.action + "&operation=" + s.operation + "&_wpnonce=" + s.nonce + "&image=" + s.ids[index] + "&retries="+nggAjax.settings.retries,
31
  cache: false,
32
  timeout: 30000,
33
  success: function(msg){
48
  }
49
 
50
  },
51
+ error: function(jqXHR, textStatus, errorThrown) {
52
+ nggAjax.settings.errorThrown = errorThrown;
53
+ },
54
+ complete: function (jqXHR, textStatus) {
55
+ index++;
56
+
57
+ if (index < nggAjax.settings.ids.length) {
58
+ var run = true;
59
+
60
+ if (textStatus == 'error' || textStatus == 'abort') {
61
+ nggAjax.settings.retries += 1;
62
+ if (nggAjax.settings.retries <= nggAjax.settings.max_retries) {
63
+ var seconds = nggAjax.settings.retry_delay / 1000;
64
+ index--;
65
+ run = false;
66
+ nggProgressBar.addNote("<strong>ID " + nggAjax.settings.ids[length] + ":</strong> " + "Retrying in " + seconds + " seconds; host might be throttling.");
67
+ setTimeout(function(){
68
+ nggAjax.run( index );
69
+ }, nggAjax.settings.retry_delay);
70
+ }
71
+ else {
72
+ var msg = jqXHR.responseText;
73
+ if (msg == '') {
74
+ msg = '( ' + nggAjax.settings.errorThrown + ' )';
75
+ }
76
+ nggProgressBar.addNote( "<strong>ID " + nggAjax.settings.ids[index] + ":</strong> " + nggAjax.settings.failure, msg);
77
+ nggProgressBar.increase(index);
78
+ }
79
+
80
+ }
81
+ else {
82
+ nggAjax.settings.retries = 0;
83
+ nggProgressBar.increase(index);
84
+ }
85
+
86
+ if (run) nggAjax.run( index );
87
+ }
88
+
89
+ // Done processing
90
+ else {
91
+ nggProgressBar.finished();
92
+ }
93
  }
94
  });
95
  },
products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.progressbar.js CHANGED
@@ -108,6 +108,7 @@
108
  var progressBar = this;
109
  if (s.wait) {
110
  $("#" + s.id).delay(1000).hide("slow");
 
111
  div.click(function () {
112
  progressBar.remove_dialog(false, 0);
113
  });
108
  var progressBar = this;
109
  if (s.wait) {
110
  $("#" + s.id).delay(1000).hide("slow");
111
+ progressBar.addNote("Done!");
112
  div.click(function () {
113
  progressBar.remove_dialog(false, 0);
114
  });
products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php CHANGED
@@ -86,14 +86,34 @@ class M_Third_Party_Compat extends C_Base_Module
86
  add_filter('home_url', array(&$this, 'wpml_home_url'), -1, 4);
87
  add_filter('headway_gzip', array(&$this, 'headway_gzip'), (PHP_INT_MAX - 1));
88
  add_filter('ckeditor_external_plugins', array(&$this, 'ckeditor_plugins'), 11);
89
- add_filter('bp_do_redirect_canonical', '__return_false');
90
  add_filter('the_content', array(&$this, 'check_weaverii'), -(PHP_INT_MAX-2));
91
  add_action('wp', array(&$this, 'check_for_jquery_lightbox'));
92
 
 
 
 
 
 
 
 
93
  // TODO: Only needed for NGG Pro 1.0.10 and lower
94
  add_action('the_post', array(&$this, 'add_ngg_pro_page_parameter'));
95
  }
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  /**
98
  * WPML's home_url filter causes a conflict with NextGEN's url generation, but doesn't appear to be necessary for
99
  * WPML to function. This is necessary until we properly support WP_CONTENT_URL & WP_PLUGINS_URL.
86
  add_filter('home_url', array(&$this, 'wpml_home_url'), -1, 4);
87
  add_filter('headway_gzip', array(&$this, 'headway_gzip'), (PHP_INT_MAX - 1));
88
  add_filter('ckeditor_external_plugins', array(&$this, 'ckeditor_plugins'), 11);
89
+ add_filter('bp_do_redirect_canonical', array(&$this, 'fix_buddypress_routing'));
90
  add_filter('the_content', array(&$this, 'check_weaverii'), -(PHP_INT_MAX-2));
91
  add_action('wp', array(&$this, 'check_for_jquery_lightbox'));
92
 
93
+ // WPML fix
94
+ if (class_exists('SitePress')) {
95
+ M_WordPress_Routing::$_use_canonical_redirect = FALSE;
96
+ M_WordPress_Routing::$_use_old_slugs = FALSE;
97
+ add_action('template_redirect', array(&$this, 'fix_wpml_canonical_redirect'), 1);
98
+ }
99
+
100
  // TODO: Only needed for NGG Pro 1.0.10 and lower
101
  add_action('the_post', array(&$this, 'add_ngg_pro_page_parameter'));
102
  }
103
 
104
+ function fix_buddypress_routing()
105
+ {
106
+ M_WordPress_Routing::$_use_canonical_redirect = FALSE;
107
+
108
+ return FALSE;
109
+ }
110
+
111
+ function fix_wpml_canonical_redirect()
112
+ {
113
+ M_WordPress_Routing::$_use_canonical_redirect = FALSE;
114
+ M_WordPress_Routing::$_use_old_slugs = FALSE;
115
+ }
116
+
117
  /**
118
  * WPML's home_url filter causes a conflict with NextGEN's url generation, but doesn't appear to be necessary for
119
  * WPML to function. This is necessary until we properly support WP_CONTENT_URL & WP_PLUGINS_URL.
products/photocrati_nextgen/modules/wordpress_routing/adapter.wordpress_router.php CHANGED
@@ -71,51 +71,72 @@ class A_WordPress_Router extends Mixin
71
 
72
  function get_base_url($site_url = FALSE)
73
  {
74
- $retval = NULL;
75
- $add_index = TRUE;
76
 
77
- if ($site_url === TRUE || $site_url === 'site')
78
- {
79
- $retval = site_url();
80
- }
81
- else if ($site_url === FALSE || $site_url === 'home') {
82
- $retval = home_url();
83
- }
84
- else if ($site_url === 'plugins') {
85
- $retval = plugins_url();
86
- $add_index = FALSE;
87
- }
88
- else if ($site_url === 'content') {
89
- $retval = content_url();
90
- $add_index = FALSE;
91
- }
92
- else if ($site_url === 'root') {
93
- $retval = get_option('home');
94
- if (is_ssl())
95
- $scheme = 'https';
96
- else
97
- $scheme = parse_url($retval, PHP_URL_SCHEME);
98
- $retval = set_url_scheme($retval, $scheme);
99
- }
100
- else if ($site_url === 'gallery') {
101
- $add_index = FALSE;
102
- $root_type = defined('NGG_GALLERY_ROOT_TYPE') ? NGG_GALLERY_ROOT_TYPE : 'site';
103
- if ($root_type === 'content')
 
 
 
 
 
 
 
 
 
104
  $retval = content_url();
105
- else
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  $retval = site_url();
107
  }
108
- else {
109
- $retval = home_url();
110
- }
111
 
112
- if ($add_index)
113
  $retval = $this->_add_index_dot_php_to_url($retval);
114
 
115
- // in case the user's home/site/content/plugins_url constant does not contain their domain
116
- if (!parse_url($retval, PHP_URL_HOST))
117
- $retval = 'http://' . $_SERVER['SERVER_NAME'] . $retval;
118
-
119
  if ($this->object->is_https())
120
  $retval = preg_replace('/^http:\\/\\//i', 'https://', $retval, 1);
121
 
71
 
72
  function get_base_url($site_url = FALSE)
73
  {
74
+ $retval = NULL;
75
+ $add_index_dot_php = TRUE;
76
 
77
+ switch ($site_url) {
78
+ case $site_url === TRUE:
79
+ case 'site':
80
+ $retval = site_url();
81
+ break;
82
+ case $site_url === FALSE:
83
+ case 'home':
84
+ $retval = home_url();
85
+ break;
86
+ case 'plugins':
87
+ case 'plugin':
88
+ $retval = plugins_url();
89
+ $add_index_dot_php = FALSE;
90
+ break;
91
+ case 'plugins_mu':
92
+ case 'plugin_mu':
93
+ $retval = WPMU_PLUGIN_URL;
94
+ $retval = set_url_scheme($retval);
95
+ $retval = apply_filters( 'plugins_url', $retval, '', '');
96
+ $add_index_dot_php = FALSE;
97
+ break;
98
+ case 'templates':
99
+ case 'template':
100
+ case 'themes':
101
+ case 'theme':
102
+ $retval = get_template_directory_uri();
103
+ $add_index_dot_php = FALSE;
104
+ break;
105
+ case 'styles':
106
+ case 'style':
107
+ case 'stylesheets':
108
+ case 'stylesheet':
109
+ $retval = get_stylesheet_directory_uri();
110
+ $add_index_dot_php = FALSE;
111
+ break;
112
+ case 'content':
113
  $retval = content_url();
114
+ $add_index_dot_php = FALSE;
115
+ break;
116
+ case 'root':
117
+ $retval = get_option('home');
118
+ if (is_ssl())
119
+ $scheme = 'https';
120
+ else
121
+ $scheme = parse_url($retval, PHP_URL_SCHEME);
122
+ $retval = set_url_scheme($retval, $scheme);
123
+ break;
124
+ case 'gallery':
125
+ case 'galleries':
126
+ $root_type = defined('NGG_GALLERY_ROOT_TYPE') ? NGG_GALLERY_ROOT_TYPE : 'site';
127
+ $add_index_dot_php = FALSE;
128
+ if ($root_type === 'content')
129
+ $retval = content_url();
130
+ else
131
+ $retval = site_url();
132
+ break;
133
+ default:
134
  $retval = site_url();
135
  }
 
 
 
136
 
137
+ if ($add_index_dot_php)
138
  $retval = $this->_add_index_dot_php_to_url($retval);
139
 
 
 
 
 
140
  if ($this->object->is_https())
141
  $retval = preg_replace('/^http:\\/\\//i', 'https://', $retval, 1);
142
 
products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php CHANGED
@@ -8,7 +8,10 @@
8
  ***/
9
  class M_WordPress_Routing extends C_Base_Module
10
  {
11
- function define()
 
 
 
12
  {
13
  parent::define(
14
  'photocrati-wordpress_routing',
@@ -27,12 +30,23 @@ class M_WordPress_Routing extends C_Base_Module
27
  $this->get_registry()->add_adapter('I_Routing_App', 'A_WordPress_Routing_App');
28
  }
29
 
30
- function _register_hooks()
31
- {
32
- remove_action( 'template_redirect', 'wp_old_slug_redirect');
33
- remove_action( 'template_redirect', 'redirect_canonical');
34
- add_action('template_redirect', array(&$this, 'restore_request_uri'), 1);
35
- }
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  /**
38
  * When WordPress sees a url like http://foobar.com/nggallery/page/2/, it thinks that it is an
@@ -46,9 +60,9 @@ class M_WordPress_Routing extends C_Base_Module
46
  $_SERVER['UNENCODED_URL'] = $_SERVER['HTTP_X_ORIGINAL_URL'] = $_SERVER['REQUEST_URI'] = $request_uri;
47
  }
48
  // this is the proper behavior but it causes problems with WPML
49
- else if (!class_exists('SitePress')) {
50
- wp_old_slug_redirect();
51
- redirect_canonical();
52
  }
53
  }
54
 
8
  ***/
9
  class M_WordPress_Routing extends C_Base_Module
10
  {
11
+ static $_use_canonical_redirect = NULL;
12
+ static $_use_old_slugs = NULL;
13
+
14
+ function define()
15
  {
16
  parent::define(
17
  'photocrati-wordpress_routing',
30
  $this->get_registry()->add_adapter('I_Routing_App', 'A_WordPress_Routing_App');
31
  }
32
 
33
+ function _register_hooks()
34
+ {
35
+ add_action('template_redirect', array(&$this, 'restore_request_uri'), 1);
36
+
37
+ // These two things cause conflicts in NGG. So we temporarily
38
+ // disable them and then reactivate them, if they were used,
39
+ // in the restore_request_uri() method
40
+ if (has_action('template_redirect', 'wp_old_slug_redirect')) {
41
+ remove_action( 'template_redirect', 'wp_old_slug_redirect');
42
+ if (!is_null(self::$_use_canonical_redirect)) self::$_use_old_slugs = TRUE;
43
+ }
44
+ if (has_action('template_redirect', 'redirect_canonical')) {
45
+ remove_action( 'template_redirect', 'redirect_canonical');
46
+ if (!is_null(self::$_use_canonical_redirect)) self::$_use_canonical_redirect = TRUE;
47
+ }
48
+ }
49
+
50
 
51
  /**
52
  * When WordPress sees a url like http://foobar.com/nggallery/page/2/, it thinks that it is an
60
  $_SERVER['UNENCODED_URL'] = $_SERVER['HTTP_X_ORIGINAL_URL'] = $_SERVER['REQUEST_URI'] = $request_uri;
61
  }
62
  // this is the proper behavior but it causes problems with WPML
63
+ else {
64
+ if (self::$_use_old_slugs) wp_old_slug_redirect();
65
+ if (self::$_use_canonical_redirect) redirect_canonical();
66
  }
67
  }
68
 
readme.txt CHANGED
@@ -199,6 +199,15 @@ For more information, feel free to visit the official website for the NextGEN Ga
199
 
200
  == Changelog ==
201
 
 
 
 
 
 
 
 
 
 
202
  = V2.0.66.17 - 08.08.2014 =
203
  * NEW: Added french translations
204
  * Secured: XSS vulnerability in jQuery Plupload Queue (thanks Codevigilant Team)
199
 
200
  == Changelog ==
201
 
202
+ = V2.0.66.26 - 08.18.2014 =
203
+ * NEW: Added fault tolerance to bulk action AJAX requests
204
+ * Changed: Moved some settings from DB to in-memory
205
+ * Fixed: Compatibility with BuddyPress plugin in multisite environments
206
+ * Fixed: Ability to find static resources outside of WP_PLUGIN_DIR
207
+ * Fixed: Autoupdate conflict with Photocrati Theme
208
+ * Fixed: Workaround GoDaddy's throttling of consecutive AJAX requests
209
+ * Fixed: Issue with settings manager in multisite enviroments
210
+
211
  = V2.0.66.17 - 08.08.2014 =
212
  * NEW: Added french translations
213
  * Secured: XSS vulnerability in jQuery Plupload Queue (thanks Codevigilant Team)