NextGEN Gallery – WordPress Gallery Plugin - Version 2.0.58

Version Description

  • 03.06.2014 =
  • Fixed: Reset jQuery to WP defaults when modified by a third-party
  • Fixed: Compatibility with WP jQuery Lightbox plugin
  • Fixed: Compatibility with Peekaboo theme
Download this release

Release Info

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

Code changes from version 2.0.57 to 2.0.58

changelog.txt CHANGED
@@ -1,7 +1,12 @@
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
4
- = V2.0.57 - 03.05.2013 =
 
 
 
 
 
5
  * NEW: Re-introduced the Reset button
6
  * NEW: Tooltip added for Page Link to functionality
7
  * NEW: Displayed Gallery Triggers moved from NextGEN Pro to NextGEN Gallery (not in use)
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
4
+ = V2.0.58 - 03.10.2014 =
5
+ * Fixed: Reset jQuery to WP defaults when modified by a third-party
6
+ * Fixed: Compatibility with WP jQuery Lightbox plugin
7
+ * Fixed: Compatibility with Peekaboo theme
8
+
9
+ = V2.0.57 - 03.05.2014 =
10
  * NEW: Re-introduced the Reset button
11
  * NEW: Tooltip added for Page Link to functionality
12
  * NEW: Displayed Gallery Triggers moved from NextGEN Pro to NextGEN Gallery (not in use)
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.57
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
@@ -256,8 +256,10 @@ class C_NextGEN_Bootstrap
256
  add_filter('pre_update_site_option_'.$this->_settings_option_name, array(&$this, 'persist_settings'));
257
 
258
  // This plugin uses jQuery extensively
259
- add_action('wp_enqueue_scripts', array(&$this, 'fix_jquery'));
260
- add_action('wp_print_scripts', array(&$this, 'fix_jquery'));
 
 
261
 
262
  // We require a minimum of jQuery 1.11.0 for IE11, due to a problem with interframe communication
263
  $version = get_bloginfo('version');
@@ -274,9 +276,7 @@ class C_NextGEN_Bootstrap
274
  // Delete displayed gallery transients periodically
275
  add_filter('cron_schedules', array(&$this, 'add_ngg_schedule'));
276
  add_action('ngg_delete_expired_transients', array(&$this, 'delete_expired_transients'));
277
- if (!wp_next_scheduled('ngg_delete_expired_transients')) {
278
- wp_schedule_event(time(), 'ngg_custom', 'ngg_delete_expired_transients');
279
- }
280
 
281
  // Update modules
282
  add_action('init', array(&$this, 'update'), PHP_INT_MAX-1);
@@ -285,6 +285,13 @@ class C_NextGEN_Bootstrap
285
  add_action('init', array(&$this, 'route'), 11);
286
  }
287
 
 
 
 
 
 
 
 
288
  /**
289
  * Defines a new cron schedule
290
  * @param $schedules
@@ -334,7 +341,11 @@ class C_NextGEN_Bootstrap
334
 
335
  // Ensure that jQuery is always set to the default
336
  if (isset($wp_scripts->registered['jquery'])) {
337
- $wp_scripts->registered['jquery']->src = FALSE;
 
 
 
 
338
  }
339
 
340
  if (isset($wp_scripts->registered['jquery-core'])) {
@@ -443,7 +454,7 @@ class C_NextGEN_Bootstrap
443
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
444
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
445
  define('NGG_PLUGIN_STARTED_AT', microtime());
446
- define('NGG_PLUGIN_VERSION', '2.0.57');
447
  define('NGG_JQUERY_VERSION', '1.11.0');
448
 
449
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
@@ -489,6 +500,11 @@ class C_NextGEN_Bootstrap
489
  if (!defined('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES')) {
490
  define('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES', FALSE);
491
  }
 
 
 
 
 
492
  }
493
 
494
  /**
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.58
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
256
  add_filter('pre_update_site_option_'.$this->_settings_option_name, array(&$this, 'persist_settings'));
257
 
258
  // This plugin uses jQuery extensively
259
+ if (NGG_FIX_JQUERY) {
260
+ add_action('wp_enqueue_scripts', array(&$this, 'fix_jquery'));
261
+ add_action('wp_print_scripts', array(&$this, 'fix_jquery'));
262
+ }
263
 
264
  // We require a minimum of jQuery 1.11.0 for IE11, due to a problem with interframe communication
265
  $version = get_bloginfo('version');
276
  // Delete displayed gallery transients periodically
277
  add_filter('cron_schedules', array(&$this, 'add_ngg_schedule'));
278
  add_action('ngg_delete_expired_transients', array(&$this, 'delete_expired_transients'));
279
+ add_action('wp', array(&$this, 'schedule_cron_jobs'));
 
 
280
 
281
  // Update modules
282
  add_action('init', array(&$this, 'update'), PHP_INT_MAX-1);
285
  add_action('init', array(&$this, 'route'), 11);
286
  }
287
 
288
+ function schedule_cron_jobs()
289
+ {
290
+ if (!wp_next_scheduled('ngg_delete_expired_transients')) {
291
+ wp_schedule_event(time(), 'ngg_custom', 'ngg_delete_expired_transients');
292
+ }
293
+ }
294
+
295
  /**
296
  * Defines a new cron schedule
297
  * @param $schedules
341
 
342
  // Ensure that jQuery is always set to the default
343
  if (isset($wp_scripts->registered['jquery'])) {
344
+ $jquery = $wp_scripts->registered['jquery'];
345
+ $jquery->src = FALSE;
346
+ if (array_search('jquery-core', $jquery->deps) === FALSE) {
347
+ $jquery->deps[] = 'jquery-core';
348
+ }
349
  }
350
 
351
  if (isset($wp_scripts->registered['jquery-core'])) {
454
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
455
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
456
  define('NGG_PLUGIN_STARTED_AT', microtime());
457
+ define('NGG_PLUGIN_VERSION', '2.0.58');
458
  define('NGG_JQUERY_VERSION', '1.11.0');
459
 
460
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
500
  if (!defined('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES')) {
501
  define('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES', FALSE);
502
  }
503
+
504
+ // Fix jquery
505
+ if (!defined('NGG_FIX_JQUERY')) {
506
+ define('NGG_FIX_JQUERY', TRUE);
507
+ }
508
  }
509
 
510
  /**
non_pope/class.nextgen_shortcode_manager.php CHANGED
@@ -101,7 +101,10 @@ class C_NextGen_Shortcode_Manager
101
  {
102
  $this->_runlevel--;
103
  $this->activate_all();
104
- return do_shortcode($content);
 
 
 
105
  }
106
 
107
  /**
101
  {
102
  $this->_runlevel--;
103
  $this->activate_all();
104
+ $content = do_shortcode($content);
105
+ $content = apply_filters('ngg_content', $content);
106
+
107
+ return $content;
108
  }
109
 
110
  /**
products/photocrati_nextgen/modules/nextgen_gallery_display/class.display_type_controller.php CHANGED
@@ -188,6 +188,11 @@ class Mixin_Display_Type_Controller extends Mixin
188
  $effect_code = $settings->thumbCode;
189
  $effect_code = str_replace('%GALLERY_ID%', $displayed_gallery->id(), $effect_code);
190
  $effect_code = str_replace('%GALLERY_NAME%', $displayed_gallery->id(), $effect_code);
 
 
 
 
 
191
  return $effect_code;
192
  }
193
 
188
  $effect_code = $settings->thumbCode;
189
  $effect_code = str_replace('%GALLERY_ID%', $displayed_gallery->id(), $effect_code);
190
  $effect_code = str_replace('%GALLERY_NAME%', $displayed_gallery->id(), $effect_code);
191
+
192
+ global $post;
193
+ if ($post && isset($post->ID) && $post->ID)
194
+ $effect_code = str_replace('%PAGE_ID%', $post->ID, $effect_code);
195
+
196
  return $effect_code;
197
  }
198
 
products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php CHANGED
@@ -80,11 +80,31 @@ class M_Third_Party_Compat extends C_Base_Module
80
  add_filter('headway_gzip', array(&$this, 'headway_gzip'), (PHP_INT_MAX - 1));
81
  add_filter('get_translatable_documents', array(&$this, 'wpml_translatable_documents'));
82
  add_filter('the_content', array(&$this, 'check_weaverii'), -(PHP_INT_MAX-2));
 
83
 
84
  // TODO: Only needed for NGG Pro 1.0.10 and lower
85
  add_action('the_post', array(&$this, 'add_ngg_pro_page_parameter'));
86
  }
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  /**
89
  * Weaver II's 'weaver_show_posts' shortcode creates a new wp-query, causing a second round of 'the_content'
90
  * filters to apply. This checks for WeaverII and enables all NextGEN shortcodes that would otherwise be left
80
  add_filter('headway_gzip', array(&$this, 'headway_gzip'), (PHP_INT_MAX - 1));
81
  add_filter('get_translatable_documents', array(&$this, 'wpml_translatable_documents'));
82
  add_filter('the_content', array(&$this, 'check_weaverii'), -(PHP_INT_MAX-2));
83
+ add_action('wp', array(&$this, 'check_for_jquery_lightbox'));
84
 
85
  // TODO: Only needed for NGG Pro 1.0.10 and lower
86
  add_action('the_post', array(&$this, 'add_ngg_pro_page_parameter'));
87
  }
88
 
89
+ function check_for_jquery_lightbox()
90
+ {
91
+ // Fix for jQuery Lightbox: http://wordpress.org/plugins/wp-jquery-lightbox/
92
+ // jQuery Lightbox tries to modify the content of a post, but it does so before we modify
93
+ // the content, and therefore it's modifications have no effect on our galleries
94
+ if (function_exists('jqlb_autoexpand_rel_wlightbox')) {
95
+ $settings = C_NextGen_Settings::get_instance();
96
+
97
+ // First, we make it appear that NGG has no lightbox effect enabled. That way
98
+ // we don't any lightbox resources
99
+ unset($settings->thumbEffect);
100
+
101
+ // We would normally just let the third-party plugin do it's thing, but it's regex doesn't
102
+ // seem to work on our <a> tags (perhaps because they span multiple of lines or have data attributes)
103
+ // So instead, we just do what the third-party plugin wants - add the rel attribute
104
+ $settings->thumbCode="rel='lightbox[%POST_ID%]'";
105
+ }
106
+ }
107
+
108
  /**
109
  * Weaver II's 'weaver_show_posts' shortcode creates a new wp-query, causing a second round of 'the_content'
110
  * filters to apply. This checks for WeaverII and enables all NextGEN shortcodes that would otherwise be left
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: photocrati
3
  Tags:gallery,image,images,photo,photos,picture,pictures,slideshow,flash,media,thumbnails,photo-albums,nextgen-gallery,nextgen
4
  Requires at least: 3.6.1
5
  Tested up to: 3.8.1
6
- Stable tag: 2.0.57
7
  License: GPLv2
8
 
9
  The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 9 million downloads.
@@ -199,7 +199,12 @@ For more information, feel free to visit the official website for the NextGEN Ga
199
 
200
  == Changelog ==
201
 
202
- = V2.0.57 - 03.05.2013 =
 
 
 
 
 
203
  * NEW: Re-introduced the Reset button
204
  * NEW: Tooltip added for Page Link to functionality
205
  * NEW: Displayed Gallery Triggers moved from NextGEN Pro to NextGEN Gallery (not in use)
3
  Tags:gallery,image,images,photo,photos,picture,pictures,slideshow,flash,media,thumbnails,photo-albums,nextgen-gallery,nextgen
4
  Requires at least: 3.6.1
5
  Tested up to: 3.8.1
6
+ Stable tag: 2.0.58
7
  License: GPLv2
8
 
9
  The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 9 million downloads.
199
 
200
  == Changelog ==
201
 
202
+ = V2.0.58 - 03.06.2014 =
203
+ * Fixed: Reset jQuery to WP defaults when modified by a third-party
204
+ * Fixed: Compatibility with WP jQuery Lightbox plugin
205
+ * Fixed: Compatibility with Peekaboo theme
206
+
207
+ = V2.0.57 - 03.05.2014 =
208
  * NEW: Re-introduced the Reset button
209
  * NEW: Tooltip added for Page Link to functionality
210
  * NEW: Displayed Gallery Triggers moved from NextGEN Pro to NextGEN Gallery (not in use)