NextGEN Gallery – WordPress Gallery Plugin - Version 2.0.31

Version Description

  • 10.03.2013 =
  • NEW: Restored AJAX pagination for NextGEN Basic ImageBrowser display type
  • Fixed: Compatibility with WordPress Local SEO by Yoast
  • Fixed: Inability to upload images if image_slug field was missing in database
  • Fixed: Integration of NextGEN Basic Thumbnail and NextGEN Basic Slideshow display types
  • Fixed: Photocrati Resource Manager further adjusted to be third-party friendly
  • Fixed: Added the ability to find legacy templates in both the child/parent theme directories
  • Fixed: JavaScript errors in Attach to Post interface
  • Fixed: Router can handle port numbers in urls
  • Fixed: Carousel template was linking to NextGEN Basic ImageBrowser view
  • Fixed: SQL query generated for displayed galleries using tags as source
  • Fixed: 3rd party compat: raise & never lower pcre.backtrack_limit
Download this release

Release Info

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

Code changes from version 2.0.30 to 2.0.31

Files changed (29) hide show
  1. changelog.txt +13 -0
  2. nggallery.php +2 -2
  3. non_pope/class.photocrati_resource_manager.php +6 -1
  4. products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php +6 -0
  5. products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php +1 -1
  6. products/photocrati_nextgen/modules/nextgen_admin/class.form.php +10 -0
  7. products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_routes.php +1 -1
  8. products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php +1 -1
  9. products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php +1 -1
  10. products/photocrati_nextgen/modules/nextgen_basic_gallery/hook.nextgen_basic_gallery_integration.php +8 -2
  11. products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/ajax_pagination.js +1 -1
  12. products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.css +2 -0
  13. products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_form.php +4 -1
  14. products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/hook.nextgen_basic_imagebrowser_alt_urls.php +5 -2
  15. products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php +10 -1
  16. products/photocrati_nextgen/modules/nextgen_basic_templates/class.legacy_template_locator.php +2 -1
  17. products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php +13 -0
  18. products/photocrati_nextgen/modules/nextgen_data/class.image_mapper.php +1 -1
  19. products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php +2 -0
  20. products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_ajax.php +24 -0
  21. products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php +9 -13
  22. products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php +25 -19
  23. products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js +88 -1
  24. products/photocrati_nextgen/modules/nextgen_settings/class.nextgen_settings_installer.php +2 -2
  25. products/photocrati_nextgen/modules/ngglegacy/lang/nggallery.pot +2 -2
  26. products/photocrati_nextgen/modules/ngglegacy/lib/shortcodes.php +6 -2
  27. products/photocrati_nextgen/modules/router/mixin.url_manipulation.php +9 -2
  28. products/photocrati_nextgen/product.photocrati_nextgen.php +1 -1
  29. readme.txt +13 -0
changelog.txt CHANGED
@@ -1,6 +1,19 @@
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  = V2.0.30 - 09.25.2013 =
5
  * NEW: Restored the ability to use imagebrowser display type instead of a lightbox effect
6
  * Changed: Displayed galleries are no longer rendered in RSS feeds
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
7
+ * Fixed: Inability to upload images if image_slug field was missing in database
8
+ * Fixed: Integration of NextGEN Basic Thumbnail and NextGEN Basic Slideshow display types
9
+ * Fixed: Photocrati Resource Manager further adjusted to be third-party friendly
10
+ * Fixed: Added the ability to find legacy templates in both the child/parent theme directories
11
+ * Fixed: JavaScript errors in Attach to Post interface
12
+ * Fixed: Router can handle port numbers in urls
13
+ * Fixed: Carousel template was linking to NextGEN Basic ImageBrowser view
14
+ * Fixed: SQL query generated for displayed galleries using tags as source
15
+ * Fixed: 3rd party compat: raise & never lower pcre.backtrack_limit
16
+
17
  = V2.0.30 - 09.25.2013 =
18
  * NEW: Restored the ability to use imagebrowser display type instead of a lightbox effect
19
  * Changed: Displayed galleries are no longer rendered in RSS feeds
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.30
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
@@ -329,7 +329,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.30');
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.31
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
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.31');
333
  }
334
 
335
 
non_pope/class.photocrati_resource_manager.php CHANGED
@@ -39,8 +39,13 @@ class C_Photocrati_Resource_Manager
39
 
40
  if (strpos($_SERVER['REQUEST_URI'], 'wp-admin/update') !== FALSE) $retval = FALSE;
41
  else if (isset($_GET['display_gallery_iframe'])) $retval = FALSE;
42
- else if (preg_match("/(js|css|xsl|xml)$/", $_SERVER['REQUEST_URI'])) $retval = FALSE;
43
  else if (defined('WP_ADMIN') && WP_ADMIN && defined('DOING_AJAX') && DOING_AJAX) $retval = FALSE;
 
 
 
 
 
 
44
 
45
  $this->valid_request = $retval;
46
  }
39
 
40
  if (strpos($_SERVER['REQUEST_URI'], 'wp-admin/update') !== FALSE) $retval = FALSE;
41
  else if (isset($_GET['display_gallery_iframe'])) $retval = FALSE;
 
42
  else if (defined('WP_ADMIN') && WP_ADMIN && defined('DOING_AJAX') && DOING_AJAX) $retval = FALSE;
43
+ else if (preg_match("/(js|css|xsl|xml|kml)$/", $_SERVER['REQUEST_URI'])) $retval = FALSE;
44
+ elseif (preg_match("/\\.(\\w{3,4})$/", $_SERVER['REQUEST_URI'], $match)) {
45
+ if (!in_array($match[1], array('htm', 'html', 'php'))) {
46
+ $retval = FALSE;
47
+ }
48
+ }
49
 
50
  $this->valid_request = $retval;
51
  }
products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php CHANGED
@@ -39,6 +39,12 @@ class M_Attach_To_Post extends C_Base_Module
39
 
40
  include_once('class.attach_to_post_installer.php');
41
  C_Photocrati_Installer::add_handler($this->module_id, 'C_Attach_To_Post_Installer');
 
 
 
 
 
 
42
  }
43
 
44
  /**
39
 
40
  include_once('class.attach_to_post_installer.php');
41
  C_Photocrati_Installer::add_handler($this->module_id, 'C_Attach_To_Post_Installer');
42
+
43
+ $uri = strtolower($_SERVER['REQUEST_URI']);
44
+
45
+ if (strpos($uri, '/nextgen-attach_to_post') !== false) {
46
+ define('WP_ADMIN', true);
47
+ }
48
  }
49
 
50
  /**
products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php CHANGED
@@ -75,7 +75,7 @@ class A_NextGen_AddGallery_Ajax extends Mixin
75
  }
76
 
77
  if ($error) header('HTTP/1.1 400 Bad Request');
78
- else $retval['gallery_name'] = $gallery_name;
79
 
80
  return $retval;
81
  }
75
  }
76
 
77
  if ($error) header('HTTP/1.1 400 Bad Request');
78
+ else $retval['gallery_name'] = esc_html($gallery_name);
79
 
80
  return $retval;
81
  }
products/photocrati_nextgen/modules/nextgen_admin/class.form.php CHANGED
@@ -210,6 +210,16 @@ class Mixin_Form_Field_Generators extends Mixin
210
  True
211
  );
212
  }
 
 
 
 
 
 
 
 
 
 
213
 
214
  function _render_thumbnail_override_settings_field($display_type)
215
  {
210
  True
211
  );
212
  }
213
+
214
+ function _render_ajax_pagination_field($display_type)
215
+ {
216
+ return $this->object->_render_radio_field(
217
+ $display_type,
218
+ 'ajax_pagination',
219
+ _('Enable AJAX pagination'),
220
+ isset($display_type->settings['ajax_pagination']) ? $display_type->settings['ajax_pagination'] : FALSE
221
+ );
222
+ }
223
 
224
  function _render_thumbnail_override_settings_field($display_type)
225
  {
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_routes.php CHANGED
@@ -15,7 +15,7 @@ class A_NextGen_Basic_Gallery_Routes extends Mixin
15
  function add_nextgen_basic_gallery_routes()
16
  {
17
  $slug = C_NextGen_Settings::get_instance()->router_param_slug;
18
- $this->object->rewrite("{$slug}{*}/image/{*}", "{$slug}{1}/pid--{2}/show--" . NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER);
19
  $this->object->rewrite("{$slug}{*}/slideshow/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW . "{2}");
20
  $this->object->rewrite("{$slug}{*}/thumbnails/{*}", "{$slug}{1}/show--". NEXTGEN_GALLERY_BASIC_THUMBNAILS . "{2}");
21
  $this->object->rewrite("{$slug}{*}/show--slide/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW . "/{2}");
15
  function add_nextgen_basic_gallery_routes()
16
  {
17
  $slug = C_NextGen_Settings::get_instance()->router_param_slug;
18
+ $this->object->rewrite("{$slug}{*}/image/{*}", "{$slug}{1}/pid--{2}");
19
  $this->object->rewrite("{$slug}{*}/slideshow/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW . "{2}");
20
  $this->object->rewrite("{$slug}{*}/thumbnails/{*}", "{$slug}{1}/show--". NEXTGEN_GALLERY_BASIC_THUMBNAILS . "{2}");
21
  $this->object->rewrite("{$slug}{*}/show--slide/{*}", "{$slug}{1}/show--" . NEXTGEN_GALLERY_BASIC_SLIDESHOW . "/{2}");
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php CHANGED
@@ -103,7 +103,7 @@ class A_NextGen_Basic_Slideshow_Form extends Mixin_Display_Type_Form
103
  {
104
  return $this->render_partial('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow_settings_gallery_dimensions', array(
105
  'display_type_name' => $display_type->name,
106
- 'gallery_dimensions_label' => _('Maximum Dimensions'),
107
  'gallery_width' => $display_type->settings['gallery_width'],
108
  'gallery_height' => $display_type->settings['gallery_height'],
109
  ), True);
103
  {
104
  return $this->render_partial('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow_settings_gallery_dimensions', array(
105
  'display_type_name' => $display_type->name,
106
+ 'gallery_dimensions_label' => _('Maximum dimensions'),
107
  'gallery_width' => $display_type->settings['gallery_width'],
108
  'gallery_height' => $display_type->settings['gallery_height'],
109
  ), True);
products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php CHANGED
@@ -158,7 +158,7 @@ class A_NextGen_Basic_Thumbnail_Form extends Mixin_Display_Type_Form
158
  return $this->_render_radio_field(
159
  $display_type,
160
  'ajax_pagination',
161
- 'Enable Ajax pagination',
162
  $display_type->settings['ajax_pagination'],
163
  'Browse images without reloading the page.'
164
  );
158
  return $this->_render_radio_field(
159
  $display_type,
160
  'ajax_pagination',
161
+ 'Enable AJAX pagination',
162
  $display_type->settings['ajax_pagination'],
163
  'Browse images without reloading the page.'
164
  );
products/photocrati_nextgen/modules/nextgen_basic_gallery/hook.nextgen_basic_gallery_integration.php CHANGED
@@ -4,8 +4,14 @@ class Hook_NextGen_Basic_Gallery_Integration extends Hook
4
  {
5
  function index_action($displayed_gallery, $return=FALSE)
6
  {
 
 
 
 
 
 
7
  // Are we to display a different display type?
8
- if (($show = $this->object->param('show')))
9
  {
10
  $params = (array)$displayed_gallery->get_entity();
11
  $ds = $params['display_settings'];
@@ -41,4 +47,4 @@ class Hook_NextGen_Basic_Gallery_Integration extends Hook
41
  }
42
  }
43
  }
44
- }
4
  {
5
  function index_action($displayed_gallery, $return=FALSE)
6
  {
7
+ $show = $this->object->param('show');
8
+ $pid = $this->object->param('pid');
9
+
10
+ if (!empty($pid) && isset($displayed_gallery->display_settings['use_imagebrowser_effect']) && intval($displayed_gallery->display_settings['use_imagebrowser_effect']))
11
+ $show = NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER;
12
+
13
  // Are we to display a different display type?
14
+ if (!empty($show))
15
  {
16
  $params = (array)$displayed_gallery->get_entity();
17
  $ds = $params['display_settings'];
47
  }
48
  }
49
  }
50
+ }
products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/ajax_pagination.js CHANGED
@@ -34,7 +34,7 @@ jQuery(function($){
34
  $(document).trigger('refreshed');
35
  }).always(function() {
36
  self.toggle_busy(false);
37
- });;
38
 
39
  });
40
  },
34
  $(document).trigger('refreshed');
35
  }).always(function() {
36
  self.toggle_busy(false);
37
+ });
38
 
39
  });
40
  },
products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.css CHANGED
@@ -62,6 +62,8 @@
62
 
63
  .ngg-galleryoverview div.pic img {
64
  width: 100%;
 
 
65
  }
66
 
67
  .ngg-gallery-list li {
62
 
63
  .ngg-galleryoverview div.pic img {
64
  width: 100%;
65
+ border: 0px;
66
+ border-radius: 0px;
67
  }
68
 
69
  .ngg-gallery-list li {
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/adapter.nextgen_basic_imagebrowser_form.php CHANGED
@@ -12,6 +12,9 @@ class A_NextGen_Basic_ImageBrowser_Form extends Mixin_Display_Type_Form
12
  */
13
  function _get_field_names()
14
  {
15
- return array('nextgen_basic_templates_template');
 
 
 
16
  }
17
  }
12
  */
13
  function _get_field_names()
14
  {
15
+ return array(
16
+ 'ajax_pagination',
17
+ 'nextgen_basic_templates_template',
18
+ );
19
  }
20
  }
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/hook.nextgen_basic_imagebrowser_alt_urls.php CHANGED
@@ -28,7 +28,10 @@ class Hook_NextGen_Basic_Imagebrowser_Alt_URLs extends Hook {
28
  else
29
  $url = $application->get_routed_url(TRUE);
30
 
31
- $retval = $controller->set_param_for($url, 'pid', $image->image_slug);
 
 
 
32
 
33
  $this->object->set_method_property(
34
  $this->method_called,
@@ -39,4 +42,4 @@ class Hook_NextGen_Basic_Imagebrowser_Alt_URLs extends Hook {
39
 
40
  return $retval;
41
  }
42
- }
28
  else
29
  $url = $application->get_routed_url(TRUE);
30
 
31
+ $url = $controller->set_param_for($url, 'pid', $image->image_slug);
32
+ $url = $controller->remove_param_for($url, 'show');
33
+
34
+ $retval = $url;
35
 
36
  $this->object->set_method_property(
37
  $this->method_called,
42
 
43
  return $retval;
44
  }
45
+ }
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php CHANGED
@@ -60,4 +60,13 @@
60
  </div>
61
 
62
  </div>
63
- <?php $this->end_element(); ?>
 
 
 
 
 
 
 
 
 
60
  </div>
61
 
62
  </div>
63
+ <?php $this->end_element(); ?>
64
+ <script type='text/javascript'>
65
+ jQuery(function($){
66
+ NggPaginatedGallery.init(
67
+ '<?php echo $displayed_gallery->id() ?>',
68
+ $('#<?php echo $anchor ?>'),
69
+ $('#<?php echo $anchor ?> .ngg-browser-prev, #<?php echo $anchor ?> .ngg-browser-next')
70
+ )
71
+ });
72
+ </script>
products/photocrati_nextgen/modules/nextgen_basic_templates/class.legacy_template_locator.php CHANGED
@@ -38,7 +38,8 @@ class Mixin_Legacy_Template_Locator extends Mixin
38
  function get_template_directories()
39
  {
40
  return array(
41
- 'Overrides' => STYLESHEETPATH . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR,
 
42
  'NextGEN' => NGGALLERY_ABSPATH . 'view' . DIRECTORY_SEPARATOR
43
  );
44
  }
38
  function get_template_directories()
39
  {
40
  return array(
41
+ 'Child Theme' => get_stylesheet_directory() . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR,
42
+ 'Parent Theme' => get_template_directory() . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR,
43
  'NextGEN' => NGGALLERY_ABSPATH . 'view' . DIRECTORY_SEPARATOR
44
  );
45
  }
products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php CHANGED
@@ -537,6 +537,7 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
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;
 
540
  $image_key = $this->object->_image_mapper->get_primary_key_column();
541
 
542
  // If we can't write to the directory, then there's no point in continuing
@@ -1043,6 +1044,10 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
1043
  $destpath = NULL;
1044
  $thumbnail = NULL;
1045
 
 
 
 
 
1046
  $result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params);
1047
 
1048
  // XXX this should maybe be removed and extra settings go into $params?
@@ -1216,6 +1221,14 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
1216
  }
1217
 
1218
  $thumbnail->save($destpath, $quality);
 
 
 
 
 
 
 
 
1219
  }
1220
  }
1221
 
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;
540
+ $image->image_slug = nggdb::get_unique_slug( sanitize_title_with_dashes( $image->alttext ), 'image' );
541
  $image_key = $this->object->_image_mapper->get_primary_key_column();
542
 
543
  // If we can't write to the directory, then there's no point in continuing
1044
  $destpath = NULL;
1045
  $thumbnail = NULL;
1046
 
1047
+ // Do this before anything else can modify the original -- $detailed_size
1048
+ // may hold IPTC metadata we need to write to our clone
1049
+ $size = getimagesize($image_path, $detailed_size);
1050
+
1051
  $result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params);
1052
 
1053
  // XXX this should maybe be removed and extra settings go into $params?
1221
  }
1222
 
1223
  $thumbnail->save($destpath, $quality);
1224
+
1225
+ // IF the original contained IPTC metadata we should attempt to copy it
1226
+ if (isset($detailed_size['APP13'])) {
1227
+ $metadata = iptcembed($detailed_size['APP13'], $destpath);
1228
+ $fp = fopen($destpath, 'wb');
1229
+ fwrite($fp, $metadata);
1230
+ fclose($fp);
1231
+ }
1232
  }
1233
  }
1234
 
products/photocrati_nextgen/modules/nextgen_data/class.image_mapper.php CHANGED
@@ -111,7 +111,7 @@ class Mixin_Gallery_Image_Mapper extends Mixin
111
  {
112
  // If not set already, we'll add an exclude property. This is used
113
  // by NextGEN Gallery itself, as well as the Attach to Post module
114
- $this->object->_set_default_value($entity, 'exclude', FALSE);
115
 
116
  // Ensure that the object has a description attribute
117
  $this->object->_set_default_value($entity, 'description', '');
111
  {
112
  // If not set already, we'll add an exclude property. This is used
113
  // by NextGEN Gallery itself, as well as the Attach to Post module
114
+ $this->object->_set_default_value($entity, 'exclude', 0);
115
 
116
  // Ensure that the object has a description attribute
117
  $this->object->_set_default_value($entity, 'description', '');
products/photocrati_nextgen/modules/nextgen_data/class.image_wrapper.php CHANGED
@@ -421,6 +421,8 @@ class C_Image_Wrapper
421
  $retval = '';
422
  }
423
 
 
 
424
  $this->_cache['thumbcode'] = $retval;
425
  return $retval;
426
  }
421
  $retval = '';
422
  }
423
 
424
+ $retval .= ' data-image-id="' . $this->__get('id') . '"';
425
+
426
  $this->_cache['thumbcode'] = $retval;
427
  return $retval;
428
  }
products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.gallery_display_ajax.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class A_Gallery_Display_Ajax extends Mixin
4
+ {
5
+ function render_displayed_gallery_action()
6
+ {
7
+ $retval = array();
8
+
9
+ if (isset($_POST['ajax_referrer'])) {
10
+ $_SERVER['REQUEST_URI'] = $_POST['ajax_referrer'];
11
+ C_Router::get_instance()->serve_request();
12
+ }
13
+
14
+ if (isset($_POST['displayed_gallery_id'])) {
15
+ $displayed_gallery = new C_Displayed_Gallery();
16
+ $displayed_gallery->apply_transient($_POST['displayed_gallery_id']);
17
+ $renderer = C_Displayed_Gallery_Renderer::get_instance();
18
+ $retval['html'] = $renderer->render($displayed_gallery, TRUE);
19
+ }
20
+
21
+ return $retval;
22
+ }
23
+ }
24
+
products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php CHANGED
@@ -728,7 +728,7 @@ class Mixin_Displayed_Gallery_Queries extends Mixin
728
 
729
  // Convert container ids to a string suitable for WHERE IN
730
  $container_ids = array();
731
- if (!in_array('All', $tags)) {
732
  foreach ($tags as $container) {
733
  $container_ids[]= "'{$container}'";
734
  }
@@ -736,18 +736,14 @@ class Mixin_Displayed_Gallery_Queries extends Mixin
736
  }
737
 
738
  // Construct query
739
- $query = $wpdb->prepare("
740
- SELECT {$wpdb->term_taxonomy}.term_id FROM {$wpdb->term_taxonomy}
741
- INNER JOIN {$wpdb->terms} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id
742
- WHERE {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id
743
- AND taxonomy = %s
744
- ", 'ngg_tag');
745
-
746
- // Filter by selected tags
747
- if ($container_ids) $query .= "AND (slug IN ({$container_ids}) OR name IN ({$container_ids}))";
748
-
749
- // Add order by clause
750
- $query .= "ORDER BY {$wpdb->terms}.term_id";
751
 
752
  // Get all term_ids for each image tag slug
753
  $term_ids = array();
728
 
729
  // Convert container ids to a string suitable for WHERE IN
730
  $container_ids = array();
731
+ if (!in_array('all', array_map('strtolower', $tags))) {
732
  foreach ($tags as $container) {
733
  $container_ids[]= "'{$container}'";
734
  }
736
  }
737
 
738
  // Construct query
739
+ $query = "SELECT {$wpdb->term_taxonomy}.term_id FROM {$wpdb->term_taxonomy}
740
+ INNER JOIN {$wpdb->terms} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id
741
+ WHERE {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id
742
+ AND {$wpdb->term_taxonomy}.taxonomy = %s";
743
+ if (!empty($container_ids))
744
+ $query .= " AND ({$wpdb->terms}.slug IN ({$container_ids}) OR {$wpdb->terms}.name IN ({$container_ids}))";
745
+ $query .= " ORDER BY {$wpdb->terms}.term_id";
746
+ $query = $wpdb->prepare($query, 'ngg_tag');
 
 
 
 
747
 
748
  // Get all term_ids for each image tag slug
749
  $term_ids = array();
products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php CHANGED
@@ -87,6 +87,11 @@ class M_Gallery_Display extends C_Base_Module
87
  'A_Display_Settings_Page'
88
  );
89
 
 
 
 
 
 
90
  $this->get_registry()->add_adapter('I_MVC_View', 'A_Gallery_Display_View');
91
  }
92
 
@@ -266,30 +271,31 @@ class M_Gallery_Display extends C_Base_Module
266
  function get_type_list()
267
  {
268
  return array(
 
269
  'A_Display_Settings_Controller' => 'adapter.display_settings_controller.php',
270
- 'A_Display_Settings_Page' => 'adapter.display_settings_page.php',
271
- 'A_Gallery_Display_Factory' => 'adapter.gallery_display_factory.php',
272
- 'C_Gallery_Display_Installer' => 'class.gallery_display_installer.php',
273
- 'A_Gallery_Display_View' => 'adapter.gallery_display_view.php',
274
- 'C_Displayed_Gallery' => 'class.displayed_gallery.php',
275
- 'C_Displayed_Gallery_Mapper' => 'class.displayed_gallery_mapper.php',
276
- 'C_Displayed_Gallery_Renderer' => 'class.displayed_gallery_renderer.php',
277
- 'C_Displayed_Gallery_Source' => 'class.displayed_gallery_source.php',
278
  'C_Displayed_Gallery_Source_Mapper' => 'class.displayed_gallery_source_mapper.php',
279
- 'C_Display_Type' => 'class.display_type.php',
280
- 'C_Display_Type_Controller' => 'class.display_type_controller.php',
281
- 'C_Display_Type_Mapper' => 'class.display_type_mapper.php',
282
  'Hook_Propagate_Thumbnail_Dimensions_To_Settings' => 'hook.propagate_thumbnail_dimensions_to_settings.php',
283
- 'I_Displayed_Gallery' => 'interface.displayed_gallery.php',
284
- 'I_Displayed_Gallery_Mapper' => 'interface.displayed_gallery_mapper.php',
285
- 'I_Displayed_Gallery_Renderer' => 'interface.displayed_gallery_renderer.php',
286
- 'I_Displayed_Gallery_Source' => 'interface.displayed_gallery_source.php',
287
  'I_Displayed_Gallery_Source_Mapper' => 'interface.displayed_gallery_source_mapper.php',
288
  'I_Display_Settings_Controller' => 'interface.display_settings_controller.php',
289
- 'I_Display_Type' => 'interface.display_type.php',
290
- 'I_Display_Type_Controller' => 'interface.display_type_controller.php',
291
- 'I_Display_Type_Mapper' => 'interface.display_type_mapper.php',
292
- 'Mixin_Display_Type_Form' => 'mixin.display_type_form.php'
293
  );
294
  }
295
  }
87
  'A_Display_Settings_Page'
88
  );
89
 
90
+ $this->_get_registry()->add_adapter(
91
+ 'I_Ajax_Controller',
92
+ 'A_Gallery_Display_Ajax'
93
+ );
94
+
95
  $this->get_registry()->add_adapter('I_MVC_View', 'A_Gallery_Display_View');
96
  }
97
 
271
  function get_type_list()
272
  {
273
  return array(
274
+ 'A_Gallery_Display_Ajax' => 'adapter.gallery_display_ajax.php',
275
  'A_Display_Settings_Controller' => 'adapter.display_settings_controller.php',
276
+ 'A_Display_Settings_Page' => 'adapter.display_settings_page.php',
277
+ 'A_Gallery_Display_Factory' => 'adapter.gallery_display_factory.php',
278
+ 'C_Gallery_Display_Installer' => 'class.gallery_display_installer.php',
279
+ 'A_Gallery_Display_View' => 'adapter.gallery_display_view.php',
280
+ 'C_Displayed_Gallery' => 'class.displayed_gallery.php',
281
+ 'C_Displayed_Gallery_Mapper' => 'class.displayed_gallery_mapper.php',
282
+ 'C_Displayed_Gallery_Renderer' => 'class.displayed_gallery_renderer.php',
283
+ 'C_Displayed_Gallery_Source' => 'class.displayed_gallery_source.php',
284
  'C_Displayed_Gallery_Source_Mapper' => 'class.displayed_gallery_source_mapper.php',
285
+ 'C_Display_Type' => 'class.display_type.php',
286
+ 'C_Display_Type_Controller' => 'class.display_type_controller.php',
287
+ 'C_Display_Type_Mapper' => 'class.display_type_mapper.php',
288
  'Hook_Propagate_Thumbnail_Dimensions_To_Settings' => 'hook.propagate_thumbnail_dimensions_to_settings.php',
289
+ 'I_Displayed_Gallery' => 'interface.displayed_gallery.php',
290
+ 'I_Displayed_Gallery_Mapper' => 'interface.displayed_gallery_mapper.php',
291
+ 'I_Displayed_Gallery_Renderer' => 'interface.displayed_gallery_renderer.php',
292
+ 'I_Displayed_Gallery_Source' => 'interface.displayed_gallery_source.php',
293
  'I_Displayed_Gallery_Source_Mapper' => 'interface.displayed_gallery_source_mapper.php',
294
  'I_Display_Settings_Controller' => 'interface.display_settings_controller.php',
295
+ 'I_Display_Type' => 'interface.display_type.php',
296
+ 'I_Display_Type_Controller' => 'interface.display_type_controller.php',
297
+ 'I_Display_Type_Mapper' => 'interface.display_type_mapper.php',
298
+ 'Mixin_Display_Type_Form' => 'mixin.display_type_form.php'
299
  );
300
  }
301
  }
products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js CHANGED
@@ -1 +1,88 @@
1
- // common.js is intentionally empty
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+ window.NggPaginatedGallery = {
3
+
4
+ init: function(displayed_gallery_id, container, links){
5
+ this.displayed_gallery_id = displayed_gallery_id;
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: function(){
35
+ var transient_id = this.get_displayed_gallery_obj().transient_id;
36
+ var obj = this;
37
+
38
+ // Attach a click event handler for each pagination link to
39
+ // adjust the request to be sent via XHR
40
+ this.links.each(function(){
41
+ var $link = $(this);
42
+ $link.click(function(e){
43
+ e.preventDefault();
44
+
45
+ // Describe AJAX request
46
+ var request = {
47
+ action: 'render_displayed_gallery',
48
+ displayed_gallery_id: transient_id,
49
+ ajax_referrer: $link.attr('href')
50
+ }
51
+
52
+ // Notify the user that we're busy
53
+ obj.do_ajax(request);
54
+ });
55
+ });
56
+ },
57
+
58
+ do_ajax: function(request){
59
+
60
+ var container = this.container;
61
+
62
+ // Adjust the user notification
63
+ window['ngg_ajax_operaton_count']++;
64
+ $('body, a').css('cursor', 'wait');
65
+
66
+ // Send the AJAX request
67
+ $.post(photocrati_ajax.url, request, function(response){
68
+
69
+ // Adjust the user notification
70
+ window['ngg_ajax_operaton_count']--;
71
+ if (window['ngg_ajax_operaton_count'] <= 0) {
72
+ window['ngg_ajax_operaton_count'] = 0;
73
+ $('body, a').css('cursor', 'auto');
74
+ }
75
+
76
+ // Ensure that the server returned JSON
77
+ if (typeof(response) != 'object') response = JSON.parse(response);
78
+ if (response) {
79
+ container.replaceWith(response.html);
80
+
81
+ // Let the user know that we've refreshed the content
82
+ $(document).trigger('refreshed');
83
+ }
84
+ });
85
+ }
86
+ };
87
+
88
+ })(jQuery);
products/photocrati_nextgen/modules/nextgen_settings/class.nextgen_settings_installer.php CHANGED
@@ -58,8 +58,8 @@ class C_NextGen_Settings_Installer
58
  'galPagedGalleries' => 0, // Number of galleries per page (in a album)
59
  'galColumns' => 0, // Number of columns for the gallery
60
  'galShowSlide' => True, // Show slideshow
61
- 'galTextSlide' => __('[Show as slideshow]', 'nggallery'), // Text for slideshow
62
- 'galTextGallery' => __('[Show picture list]', 'nggallery'), // Text for gallery
63
  'galShowOrder' => 'gallery', // Show order
64
  'galSort' => 'sortorder', // Sort order
65
  'galSortDir' => 'ASC', // Sort direction
58
  'galPagedGalleries' => 0, // Number of galleries per page (in a album)
59
  'galColumns' => 0, // Number of columns for the gallery
60
  'galShowSlide' => True, // Show slideshow
61
+ 'galTextSlide' => __('[Show slideshow]', 'nggallery'), // Text for slideshow
62
+ 'galTextGallery' => __('[Show thumbnails]', 'nggallery'), // Text for gallery
63
  'galShowOrder' => 'gallery', // Show order
64
  'galSort' => 'sortorder', // Sort order
65
  'galSortDir' => 'ASC', // Sort direction
products/photocrati_nextgen/modules/ngglegacy/lang/nggallery.pot CHANGED
@@ -1128,11 +1128,11 @@ msgid "NextGEN Gallery : Tables could not created, please check your database se
1128
  msgstr ""
1129
 
1130
  #: ../admin/install.php:170
1131
- msgid "[Show as slideshow]"
1132
  msgstr ""
1133
 
1134
  #: ../admin/install.php:171
1135
- msgid "[Show picture list]"
1136
  msgstr ""
1137
 
1138
  #: ../admin/manage-galleries.php:69
1128
  msgstr ""
1129
 
1130
  #: ../admin/install.php:170
1131
+ msgid "[Show slideshow]"
1132
  msgstr ""
1133
 
1134
  #: ../admin/install.php:171
1135
+ msgid "[Show thumbnails]"
1136
  msgstr ""
1137
 
1138
  #: ../admin/manage-galleries.php:69
products/photocrati_nextgen/modules/ngglegacy/lib/shortcodes.php CHANGED
@@ -13,8 +13,12 @@ class NextGEN_shortcodes {
13
  // register the new shortcodes
14
  function NextGEN_shortcodes() {
15
 
16
- //Long posts should require a higher limit, see http://core.trac.wordpress.org/ticket/8553
17
- @ini_set('pcre.backtrack_limit', 500000);
 
 
 
 
18
 
19
  // convert the old shortcode
20
  add_filter('the_content', array(&$this, 'convert_shortcode'));
13
  // register the new shortcodes
14
  function NextGEN_shortcodes() {
15
 
16
+ // Long posts should require a higher limit, see http://core.trac.wordpress.org/ticket/8553
17
+ $pcre_limit = 500000;
18
+ if ((int)ini_get('pcre.backtrack_ limit') < $pcre_limit) {
19
+ @ini_set('pcre.backtrack_limit', $pcre_limit);
20
+ }
21
+
22
 
23
  // convert the old shortcode
24
  add_filter('the_content', array(&$this, 'convert_shortcode'));
products/photocrati_nextgen/modules/router/mixin.url_manipulation.php CHANGED
@@ -121,9 +121,16 @@ class Mixin_Url_Manipulation extends Mixin
121
  */
122
  function construct_url_from_parts($parts)
123
  {
 
 
 
 
 
 
 
 
124
  $retval = $this->object->join_paths(
125
- isset($parts['scheme']) && $parts['host'] ?
126
- "{$parts['scheme']}://{$parts['host']}" : '',
127
  isset($parts['path']) ? $parts['path'] : ''
128
  );
129
  if (isset($parts['query']) && $parts['query']) $retval .= "?{$parts['query']}";
121
  */
122
  function construct_url_from_parts($parts)
123
  {
124
+ // let relative paths be relative, and full paths full
125
+ $prefix = '';
126
+ if (!empty($parts['scheme']) && !empty($parts['host'])) {
127
+ $prefix = $parts['scheme'] . '://' . $parts['host'];
128
+ if (!empty($parts['port']))
129
+ $prefix .= ':' . $parts['port'];
130
+ }
131
+
132
  $retval = $this->object->join_paths(
133
+ $prefix,
 
134
  isset($parts['path']) ? $parts['path'] : ''
135
  );
136
  if (isset($parts['query']) && $parts['query']) $retval .= "?{$parts['query']}";
products/photocrati_nextgen/product.photocrati_nextgen.php CHANGED
@@ -52,7 +52,7 @@ class P_Photocrati_NextGen extends C_Base_Product
52
  'photocrati-nextgen',
53
  'Photocrati NextGEN',
54
  'Photocrati NextGEN',
55
- '2.0.30',
56
  'http://www.nextgen-gallery.com',
57
  'Photocrati Media',
58
  'http://www.photocrati.com'
52
  'photocrati-nextgen',
53
  'Photocrati NextGEN',
54
  'Photocrati NextGEN',
55
+ '2.0.31',
56
  'http://www.nextgen-gallery.com',
57
  'Photocrati Media',
58
  'http://www.photocrati.com'
readme.txt CHANGED
@@ -199,6 +199,19 @@ For more information, feel free to visit the official website for the NextGEN Ga
199
 
200
  == Changelog ==
201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  = V2.0.30 - 09.25.2013 =
203
  * NEW: Restored the ability to use imagebrowser display type instead of a lightbox effect
204
  * Changed: Displayed galleries are no longer rendered in RSS feeds
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
205
+ * Fixed: Inability to upload images if image_slug field was missing in database
206
+ * Fixed: Integration of NextGEN Basic Thumbnail and NextGEN Basic Slideshow display types
207
+ * Fixed: Photocrati Resource Manager further adjusted to be third-party friendly
208
+ * Fixed: Added the ability to find legacy templates in both the child/parent theme directories
209
+ * Fixed: JavaScript errors in Attach to Post interface
210
+ * Fixed: Router can handle port numbers in urls
211
+ * Fixed: Carousel template was linking to NextGEN Basic ImageBrowser view
212
+ * Fixed: SQL query generated for displayed galleries using tags as source
213
+ * Fixed: 3rd party compat: raise & never lower pcre.backtrack_limit
214
+
215
  = V2.0.30 - 09.25.2013 =
216
  * NEW: Restored the ability to use imagebrowser display type instead of a lightbox effect
217
  * Changed: Displayed galleries are no longer rendered in RSS feeds