NextGEN Gallery – WordPress Gallery Plugin - Version 2.1.0

Version Description

  • 05.18.2015 =
  • NEW: Album breadcrumbs and pagination
  • NEW: Ability to override builtin MVC templates
  • NEW: Robust transient management
  • NEW: Added the ability to set post thumbnails via XML-RPC module
  • NEW: Added 'ngg_get_image_size_params' filter to control image generation
  • NEW: Added 'ngg_basic_tagcloud_title' and 'ngg_basic_tagcloud_excluded_display_types' filters
  • NEW: Added ngg_manage_images_items_per_page filter
  • NEW: Added "ngg_get_image_url" filter
  • NEW: Including Ukranian and Polish translations
  • NEW: The ability to set template in widgets
  • Changed: Default thumbnail dimensions set to 240x160
  • Changed: Product now adheres to Pope 0.12 and provides get_modules_to_load()
  • Changed: Updated translations
  • Changed: Removed link to capsman plugin in Roles accordion
  • Changed: Taxnomies now use internationalized strings
  • Changed: Image date/time meta data fields are stored as UNIX timestamps
  • Secured: Uploading zips
  • Fixed: Various PHP warnings and notices
  • Fixed: Compatibility fixes for WPML
  • Fixed: Ensure that backup image functionality fails gracefully
  • Fixed: WP option 'ngg_do_upgrade' updated in every HTTP request
  • Fixed; Empty $_SERVER['PATHINFO'] causing multiple routing issues
  • Fixed: "Manage Galleries" display image alttext in the filename column
  • Fixed: Various issues with the tag cloud display type
  • Fixed: Integrity check when updating from 1.9.x
  • Fixed: Image filenames substituting spaces for + which is only proper in the query string
  • Fixed: Insert Gallery Window not working with nested levels of gzip compression
  • Fixed: Imagebrowser as lightbox effect not working with pagination
  • Fixed: Compatibility with MultiVerso Advanced File Sharing
  • Fixed: "Add page" button not displaying on the next immediate page load
  • Fixed: Double-escaping of non-latin characters
  • Fixed: Imagebrowser pagination with custom templates
  • Fixed: Custom CSS is enqueued late to ensure it's one of the last stylesheets loaded
  • Fixed: Fixed watermarking PNG images
  • Fixed: Using the "Import Metadata" bulk action overwrites existing data
  • Fixed: Seconds were not retained from CaptureTime EXIF field
  • Fixed: Conflicts created by our TinyMCE plugin
  • Fixed: Image mapper setting gid to gallery name, not the unique ID
  • Fixed: Restored nggdb->get_random_images(), nggdb->search_for_file, and nggdb->find_all_albums()
  • Fixed: Allow gallery slug as parameter to nggdb::get_gallery()
  • Fixed: Don't minify Plupload's i18n JavaScript
  • Fixed: Custom template images not being given their full effect code attributes
  • Fixed: When importing galleries from folders, allow symlinks
  • Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper
  • Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts()
  • Fixed: Warning about missing style.php file on Network Admin -> Gallery page
  • Fixed: Warning about getimagesize() failure when backing up an image
Download this release

Release Info

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

Code changes from version 2.0.79 to 2.1.0

Files changed (70) hide show
  1. .hg_archival.txt +3 -3
  2. .hgsubstate +1 -1
  3. .hgtags +33 -0
  4. changelog.txt +47 -5
  5. nggallery.php +21 -27
  6. non_pope/class.nextgen_style_manager.php +5 -0
  7. non_pope/class.photocrati_cache.php +0 -294
  8. non_pope/class.photocrati_installer.php +21 -6
  9. non_pope/class.photocrati_transient_manager.php +170 -0
  10. non_pope/class.pope_cache_drivers.php +0 -116
  11. pope/lib/autoload.php +1 -1
  12. pope/lib/class.component_registry.php +14 -5
  13. products/photocrati_nextgen/class.nextgen_product_installer.php +32 -3
  14. products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php +10 -1
  15. products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.css +6 -0
  16. products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.min.css +1 -1
  17. products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.css +11 -0
  18. products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.min.css +1 -1
  19. products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php +1 -0
  20. products/photocrati_nextgen/modules/dynamic_thumbnails/package.module.dynamic_thumbnails.php +1 -2
  21. products/photocrati_nextgen/modules/i18n/lang/nggallery-el.mo +0 -0
  22. products/photocrati_nextgen/modules/i18n/lang/nggallery-pl_PL.mo +0 -0
  23. products/photocrati_nextgen/modules/i18n/lang/nggallery-ru_RU.mo +0 -0
  24. products/photocrati_nextgen/modules/i18n/lang/nggallery-uk.mo +0 -0
  25. products/photocrati_nextgen/modules/i18n/lang/nggallery.po +8 -4
  26. products/photocrati_nextgen/modules/lightbox/static/lightbox_context.js +1 -1
  27. products/photocrati_nextgen/modules/lightbox/static/lightbox_context.min.js +1 -1
  28. products/photocrati_nextgen/modules/mvc/package.module.mvc.php +49 -5
  29. products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php +4 -3
  30. products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php +0 -1
  31. products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php +3 -0
  32. products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php +233 -10
  33. products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.css +23 -0
  34. products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.min.css +1 -0
  35. products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.css +1 -1
  36. products/photocrati_nextgen/modules/nextgen_basic_album/templates/breadcrumbs.php +17 -0
  37. products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php +1 -0
  38. products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php +1 -0
  39. products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_galleries_per_page.php +0 -19
  40. products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php +0 -34
  41. products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php +1 -1
  42. products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.js +45 -43
  43. products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.min.js +1 -1
  44. products/photocrati_nextgen/modules/nextgen_basic_tagcloud/package.module.nextgen_basic_tagcloud.php +25 -11
  45. products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/settings.css +3 -0
  46. products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/settings.min.css +1 -0
  47. products/photocrati_nextgen/modules/nextgen_basic_templates/package.module.nextgen_basic_templates.php +1 -1
  48. products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php +146 -61
  49. products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php +1 -4
  50. products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php +37 -12
  51. products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php +3 -6
  52. products/photocrati_nextgen/modules/nextgen_pro_upgrade/package.module.nextgen_pro_upgrade.php +3 -3
  53. products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php +2 -2
  54. products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php +29 -0
  55. products/photocrati_nextgen/modules/ngglegacy/admin/album.php +11 -1
  56. products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php +1 -1
  57. products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php +1 -2
  58. products/photocrati_nextgen/modules/ngglegacy/admin/manage.php +32 -29
  59. products/photocrati_nextgen/modules/ngglegacy/admin/roles.php +3 -2
  60. products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php +12 -0
  61. products/photocrati_nextgen/modules/ngglegacy/lib/meta.php +43 -56
  62. products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php +6 -132
  63. products/photocrati_nextgen/modules/ngglegacy/xml/media-rss.php +7 -2
  64. products/photocrati_nextgen/modules/router/package.module.router.php +2 -2
  65. products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php +32 -7
  66. products/photocrati_nextgen/modules/widget/package.module.widget.php +2 -1
  67. products/photocrati_nextgen/modules/wordpress_routing/package.module.wordpress_routing.php +8 -2
  68. products/photocrati_nextgen/modules/wpcli/module.wpcli.php +1 -10
  69. products/photocrati_nextgen/product.photocrati_nextgen.php +70 -55
  70. readme.txt +56 -6
.hg_archival.txt CHANGED
@@ -1,4 +1,4 @@
1
  repo: 2b82bc45fbe039c6f4c9f0c667e9cd1ee4d84cbb
2
- node: a1941ca75c83c8ef644221154d41c5e65adb00b8
3
- branch: 2.0.79
4
- tag: 2.0.79
1
  repo: 2b82bc45fbe039c6f4c9f0c667e9cd1ee4d84cbb
2
+ node: 75383700145e5f627c989cb1134fec0030bcf857
3
+ branch: default
4
+ tag: 2.1.0
.hgsubstate CHANGED
@@ -1 +1 @@
1
- 9e9145cf180742cafbe9731a64b499569a4d2907 pope
1
+ dfaca7487081728ffca20130ed6c379f8fda91b2 pope
.hgtags CHANGED
@@ -177,6 +177,7 @@ d3c286994e9bc95bee465ecb2c53882b527d57d7 2.0.67.13
177
  4b1fed1745ab51f7789d53685919eadd365d43f8 2.0.67.14
178
  5e9b6061c8cd27fb6eed97774416b02eb23938b0 2.0.67.16
179
  1cc0f2e25f257ea8dfecaab770eab3de6e2848e3 2.0.67.17
 
180
  45449d377063659c69aeed08193bc88f51d36f36 2.0.67.19
181
  1354e95ceec8f0ad4f28c23ab1dd84ddca620b1d 2.0.67.20
182
  dcb0b4844a9c896a2eea408db7a0a800f482fc40 2.0.67.21
@@ -264,3 +265,35 @@ fffa3417c7d12b9bd2bcbfc52802bfa165580acc 2.0.76.1
264
  33e049382f939a9f4a69563f9c19a17fcd711c05 2.0.76.3
265
  8994240050c95ef9467b0677b2a4fedd7f43ce2a 2.0.76.4
266
  9ce01a2939098a9f6fd3dc3a75b89a7b8d50ea7a 2.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  4b1fed1745ab51f7789d53685919eadd365d43f8 2.0.67.14
178
  5e9b6061c8cd27fb6eed97774416b02eb23938b0 2.0.67.16
179
  1cc0f2e25f257ea8dfecaab770eab3de6e2848e3 2.0.67.17
180
+ b43e4536b6d0c07e12d5a457fb1563ec40952be9 2.0.67.18
181
  45449d377063659c69aeed08193bc88f51d36f36 2.0.67.19
182
  1354e95ceec8f0ad4f28c23ab1dd84ddca620b1d 2.0.67.20
183
  dcb0b4844a9c896a2eea408db7a0a800f482fc40 2.0.67.21
265
  33e049382f939a9f4a69563f9c19a17fcd711c05 2.0.76.3
266
  8994240050c95ef9467b0677b2a4fedd7f43ce2a 2.0.76.4
267
  9ce01a2939098a9f6fd3dc3a75b89a7b8d50ea7a 2.1
268
+ bfedd0b35f2026e255c69d07edfa75228261aeb1 2.0.77
269
+ 05de352a0fad8913965b5434e65272d2e44febe6 2.0.77.2
270
+ a43f86ad7c62aa9eb883c1c8f2ee7156a726c7af 2.0.78
271
+ 86abe906475fb25234fab869d03082a0a0fcba5a 2.0.78.2
272
+ 24a7242440216b0e9de87a2a9cac9a9ad5679681 2.0.78.3
273
+ 4966ecb00b551d0257f794fc234556dc4e5c923c 2.0.78.4
274
+ 67a69544d2ae3025ea018743d86d6890f4cea09e 2.0.78.5
275
+ 2ed5f4d1c1b86dc355dbec73ee023858d16f5932 2.0.77.3
276
+ a1941ca75c83c8ef644221154d41c5e65adb00b8 2.0.79
277
+ db1dd16a6bc94fd7a5977ec7ab61b65f155bb33c 2.0.80
278
+ f0c7bc4fea8cb00d38e5fffdbb920f88908a80e8 2.0.81
279
+ 1a42ef072397b4bd239d88574027b2ebb404a45a 2.0.82
280
+ 03a4df18fc95feb9f44a4e68964c530c5a25d9be 2.0.83
281
+ 418fdc5a7f2c04283fb3c36e9b8b7028c6aec0b4 2.0.84
282
+ 81bac66ab1d3525ccb8fe4162719a429e1ab43d1 2.1.84
283
+ 81bac66ab1d3525ccb8fe4162719a429e1ab43d1 2.1.84
284
+ 0000000000000000000000000000000000000000 2.1.84
285
+ 7457ec34e37f2ea76e7e5ec71a9347ae3b2e3d45 2.0.85
286
+ 3c1f28c9074eb71bf7abd95f5d5c4f363cef70c9 2.0.86
287
+ 7244ee054fa09a29c9a1eef693b6c40c528a64c1 2.0.87
288
+ b85e6518695f82db0a26331e97aef3f8a4c84b6b 2.0.88
289
+ 5c529c48a6c7a3127e15a551358ded95b5f91738 2.0.89
290
+ 5a7da0ec89905f6a7c2b939c17e312974bc9c825 2.0.90
291
+ 641022ad985167e2f9789787c67e39d2c4f836bf 2.0.91
292
+ cee255e599142af94ea042d446fa7ce1ae53d20c 2.0.92
293
+ 86f5629d63b2e52b119726895ddd2f541c1888eb 2.1.0
294
+ 86f5629d63b2e52b119726895ddd2f541c1888eb 2.1.0
295
+ 0000000000000000000000000000000000000000 2.1.0
296
+ 0000000000000000000000000000000000000000 2.1.0
297
+ 37ff3526d2471627b17b51d1bd6568def35e99e0 2.1.0
298
+ 37ff3526d2471627b17b51d1bd6568def35e99e0 2.1.0
299
+ 0000000000000000000000000000000000000000 2.1.0
changelog.txt CHANGED
@@ -1,15 +1,57 @@
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
4
- = V2.0.79 - 03.20.2015 =
5
- * Secured: Usage of find_in_set() mysql function
6
-
7
- = V2.0.77.3 - 03.12.2015 =
8
- * Secured: Upload images and importing galleries from folders
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  * Fixed: When importing galleries from folders, allow symlinks
10
  * Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper
11
  * Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts()
12
  * Fixed: Warning about missing style.php file on Network Admin -> Gallery page
 
 
 
 
13
 
14
  = V2.0.77 - 03.05.2015 =
15
  * NEW: Added "ngg_get_image_url" filter
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
4
+ = V2.1.0 - 05.18.2015 =
5
+ * NEW: Album breadcrumbs and pagination
6
+ * NEW: Ability to override builtin MVC templates
7
+ * NEW: Robust transient management
8
+ * NEW: Added the ability to set post thumbnails via XML-RPC module
9
+ * NEW: Added 'ngg_get_image_size_params' filter to control image generation
10
+ * NEW: Added 'ngg_basic_tagcloud_title' and 'ngg_basic_tagcloud_excluded_display_types' filters
11
+ * NEW: Added ngg_manage_images_items_per_page filter
12
+ * NEW: Added "ngg_get_image_url" filter
13
+ * NEW: Including Ukranian and Polish translations
14
+ * NEW: The ability to set template in widgets
15
+ * Changed: Default thumbnail dimensions set to 240x160
16
+ * Changed: Product now adheres to Pope 0.12 and provides get_modules_to_load()
17
+ * Changed: Updated translations
18
+ * Changed: Removed link to capsman plugin in Roles accordion
19
+ * Changed: Taxnomies now use internationalized strings
20
+ * Changed: Image date/time meta data fields are stored as UNIX timestamps
21
+ * Secured: Uploading zips
22
+ * Fixed: Various PHP warnings and notices
23
+ * Fixed: Compatibility fixes for WPML
24
+ * Fixed: Ensure that backup image functionality fails gracefully
25
+ * Fixed: WP option 'ngg_do_upgrade' updated in every HTTP request
26
+ * Fixed; Empty $_SERVER['PATHINFO'] causing multiple routing issues
27
+ * Fixed: "Manage Galleries" display image alttext in the filename column
28
+ * Fixed: Various issues with the tag cloud display type
29
+ * Fixed: Integrity check when updating from 1.9.x
30
+ * Fixed: Image filenames substituting spaces for + which is only proper in the query string
31
+ * Fixed: Insert Gallery Window not working with nested levels of gzip compression
32
+ * Fixed: Imagebrowser as lightbox effect not working with pagination
33
+ * Fixed: Compatibility with MultiVerso Advanced File Sharing
34
+ * Fixed: "Add page" button not displaying on the next immediate page load
35
+ * Fixed: Double-escaping of non-latin characters
36
+ * Fixed: Imagebrowser pagination with custom templates
37
+ * Fixed: Custom CSS is enqueued late to ensure it's one of the last stylesheets loaded
38
+ * Fixed: Fixed watermarking PNG images
39
+ * Fixed: Using the "Import Metadata" bulk action overwrites existing data
40
+ * Fixed: Seconds were not retained from CaptureTime EXIF field
41
+ * Fixed: Conflicts created by our TinyMCE plugin
42
+ * Fixed: Image mapper setting gid to gallery name, not the unique ID
43
+ * Fixed: Restored nggdb->get_random_images(), nggdb->search_for_file, and nggdb->find_all_albums()
44
+ * Fixed: Allow gallery slug as parameter to nggdb::get_gallery()
45
+ * Fixed: Don't minify Plupload's i18n JavaScript
46
+ * Fixed: Custom template images not being given their full effect code attributes
47
  * Fixed: When importing galleries from folders, allow symlinks
48
  * Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper
49
  * Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts()
50
  * Fixed: Warning about missing style.php file on Network Admin -> Gallery page
51
+ * Fixed: Warning about getimagesize() failure when backing up an image
52
+
53
+ = V2.0.78 - 03.12.2015 =
54
+ * Secured: AJAX actions for uploading images and importing folders now uses nonce checks
55
 
56
  = V2.0.77 - 03.05.2015 =
57
  * NEW: Added "ngg_get_image_url" filter
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 12 million downloads.
7
- * Version: 2.0.79
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
@@ -40,7 +40,6 @@ if (!function_exists('nextgen_esc_url')) {
40
  $url = wp_kses_normalize_entities( $url );
41
  $url = str_replace( '&', '&', $url );
42
  $url = str_replace( "'", ''', $url );
43
- $url = str_replace( '%', '%25', $url );
44
  $url = str_replace( ' ', '%20', $url );
45
  }
46
 
@@ -80,6 +79,7 @@ class C_NextGEN_Bootstrap
80
  var $_pope_loaded = FALSE;
81
  static $debug = FALSE;
82
  var $minimum_ngg_pro_version = '2.0.5';
 
83
 
84
  static function shutdown($exception=NULL)
85
  {
@@ -172,26 +172,12 @@ class C_NextGEN_Bootstrap
172
  function _load_non_pope()
173
  {
174
  // Load caching component
175
- include_once('non_pope/class.photocrati_cache.php');
176
- C_Photocrati_Cache::get_instance();
177
- C_Photocrati_Cache::get_instance('displayed_galleries');
178
- C_Photocrati_Cache::get_instance('displayed_gallery_rendering');
179
 
180
- C_Photocrati_Cache::$enabled = PHOTOCRATI_CACHE;
181
-
182
- if (isset($_REQUEST['ngg_flush'])) {
183
- C_Photocrati_Cache::flush('all');
184
  die("Flushed all caches");
185
  }
186
- elseif (isset($_REQUEST['ngg_force_update'])) {
187
- C_Photocrati_Cache::$do_not_lookup = TRUE;
188
- C_Photocrati_Cache::$force_update = TRUE;
189
- $_SERVER['QUERY_STRING'] = str_replace('ngg_force_update=1', '', $_SERVER['QUERY_STRING']);
190
- }
191
- elseif (isset($_REQUEST['ngg_flush_expired'])) {
192
- C_Photocrati_Cache::flush('all', TRUE);
193
- die("Flushed all expired items from the cache");
194
- }
195
 
196
  // Load Settings Manager
197
  include_once('non_pope/class.photocrati_settings_manager.php');
@@ -304,7 +290,9 @@ class C_NextGEN_Bootstrap
304
  $retval = TRUE;
305
 
306
  if (defined('NEXTGEN_GALLERY_PRO_VERSION')) $retval = FALSE;
307
- if (defined('NGG_PRO_PLUGIN_VERSION') && version_compare(NGG_PRO_PLUGIN_VERSION, $this->minimum_ngg_pro_version) < 0) $retval = FALSE;
 
 
308
 
309
  return $retval;
310
  }
@@ -354,9 +342,11 @@ class C_NextGEN_Bootstrap
354
  add_action('all_admin_notices', array(&$this, 'display_stylesheet_notice'));
355
 
356
  // Delete displayed gallery transients periodically
357
- add_filter('cron_schedules', array(&$this, 'add_ngg_schedule'));
358
- add_action('ngg_delete_expired_transients', array(&$this, 'delete_expired_transients'));
359
- add_action('wp', array(&$this, 'schedule_cron_jobs'));
 
 
360
 
361
  // Update modules
362
  add_action('init', array(&$this, 'update'), PHP_INT_MAX-1);
@@ -447,7 +437,7 @@ class C_NextGEN_Bootstrap
447
  */
448
  function delete_expired_transients()
449
  {
450
- C_Photocrati_Cache::flush('all', TRUE);
451
  }
452
 
453
  /**
@@ -584,7 +574,7 @@ class C_NextGEN_Bootstrap
584
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
585
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
586
  define('NGG_PLUGIN_STARTED_AT', microtime());
587
- define('NGG_PLUGIN_VERSION', '2.0.79');
588
 
589
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
590
  define('NGG_HIDE_STRICT_ERRORS', TRUE);
@@ -616,12 +606,16 @@ class C_NextGEN_Bootstrap
616
  define('PHOTOCRATI_CACHE', TRUE);
617
  }
618
  if (!defined('PHOTOCRATI_CACHE_TTL')) {
619
- define('PHOTOCRATI_CACHE_TTL', 3600);
620
  }
621
 
622
  // Cron job
623
  if (!defined('NGG_CRON_SCHEDULE')) {
624
- define('NGG_CRON_SCHEDULE', 1800);
 
 
 
 
625
  }
626
 
627
  // Don't enforce interfaces
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 12 million downloads.
7
+ * Version: 2.1.0
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
40
  $url = wp_kses_normalize_entities( $url );
41
  $url = str_replace( '&amp;', '&#038;', $url );
42
  $url = str_replace( "'", '&#039;', $url );
 
43
  $url = str_replace( ' ', '%20', $url );
44
  }
45
 
79
  var $_pope_loaded = FALSE;
80
  static $debug = FALSE;
81
  var $minimum_ngg_pro_version = '2.0.5';
82
+ var $minimum_ngg_plus_version = '1.0.1';
83
 
84
  static function shutdown($exception=NULL)
85
  {
172
  function _load_non_pope()
173
  {
174
  // Load caching component
175
+ include_once('non_pope/class.photocrati_transient_manager.php');
 
 
 
176
 
177
+ if (isset($_REQUEST['ngg_flush']) OR isset($_REQUEST['ngg_flush_expired'])) {
178
+ C_Photocrati_Transient_Manager::flush();
 
 
179
  die("Flushed all caches");
180
  }
 
 
 
 
 
 
 
 
 
181
 
182
  // Load Settings Manager
183
  include_once('non_pope/class.photocrati_settings_manager.php');
290
  $retval = TRUE;
291
 
292
  if (defined('NEXTGEN_GALLERY_PRO_VERSION')) $retval = FALSE;
293
+ if (defined('NEXTGEN_GALLERY_PRO_PLUGIN_BASENAME') && !defined('NGG_PRO_PLUGIN_VERSION')) $retval = FALSE; // 1.0 - 1.0.6
294
+ if (defined('NGG_PRO_PLUGIN_VERSION') && version_compare(NGG_PRO_PLUGIN_VERSION, $this->minimum_ngg_pro_version) < 0) $retval = FALSE;
295
+ if (defined('NGG_PLUS_PLUGIN_VERSION') && version_compare(NGG_PLUS_PLUGIN_VERSION, $this->minimum_ngg_plus_version) < 0) $retval = FALSE;
296
 
297
  return $retval;
298
  }
342
  add_action('all_admin_notices', array(&$this, 'display_stylesheet_notice'));
343
 
344
  // Delete displayed gallery transients periodically
345
+ if (NGG_CRON_ENABLED) {
346
+ add_filter('cron_schedules', array(&$this, 'add_ngg_schedule'));
347
+ add_action('ngg_delete_expired_transients', array(&$this, 'delete_expired_transients'));
348
+ add_action('wp', array(&$this, 'schedule_cron_jobs'));
349
+ }
350
 
351
  // Update modules
352
  add_action('init', array(&$this, 'update'), PHP_INT_MAX-1);
437
  */
438
  function delete_expired_transients()
439
  {
440
+ C_Photocrati_Transient_Manager::flush();
441
  }
442
 
443
  /**
574
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
575
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
576
  define('NGG_PLUGIN_STARTED_AT', microtime());
577
+ define('NGG_PLUGIN_VERSION', '2.1.0');
578
 
579
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
580
  define('NGG_HIDE_STRICT_ERRORS', TRUE);
606
  define('PHOTOCRATI_CACHE', TRUE);
607
  }
608
  if (!defined('PHOTOCRATI_CACHE_TTL')) {
609
+ define('PHOTOCRATI_CACHE_TTL', 1800);
610
  }
611
 
612
  // Cron job
613
  if (!defined('NGG_CRON_SCHEDULE')) {
614
+ define('NGG_CRON_SCHEDULE', 900);
615
+ }
616
+
617
+ if (!defined('NGG_CRON_ENABLED')) {
618
+ define('NGG_CRON_ENABLED', TRUE);
619
  }
620
 
621
  // Don't enforce interfaces
non_pope/class.nextgen_style_manager.php CHANGED
@@ -27,6 +27,11 @@ class C_NextGen_Style_Manager
27
  // This is where all stylesheets should be stored
28
  $this->add_directory($this->new_dir);
29
 
 
 
 
 
 
30
  // We check the parent theme directory. Needed for child themes
31
  $this->add_directory(rtrim(get_template_directory(), "/\\"), TRUE);
32
 
27
  // This is where all stylesheets should be stored
28
  $this->add_directory($this->new_dir);
29
 
30
+ // We also check wp-content/ngg/styles
31
+ $this->add_directory(implode(DIRECTORY_SEPARATOR, array(
32
+ WP_CONTENT_DIR, 'ngg', 'styles'
33
+ )));
34
+
35
  // We check the parent theme directory. Needed for child themes
36
  $this->add_directory(rtrim(get_template_directory(), "/\\"), TRUE);
37
 
non_pope/class.photocrati_cache.php DELETED
@@ -1,294 +0,0 @@
1
- <?php
2
-
3
- class C_Photocrati_Cache
4
- {
5
- static $enabled = TRUE;
6
- static $do_not_lookup = FALSE;
7
- static $force_update = FALSE;
8
- static $hits = 0;
9
- static $_instances = array();
10
- public $group = NULL;
11
-
12
- /**
13
- * Gets an instance of the Cache
14
- * @return C_Photocrati_Cache
15
- */
16
- static function &get_instance($group=NULL)
17
- {
18
- if (!$group) $group = 'ngg_cache_';
19
- if (substr($group, -1) != '_') $group .= '_';
20
- if (!isset(self::$_instances[$group])) {
21
- $klass = get_class();
22
- self::$_instances[$group] = new $klass($group);
23
- }
24
-
25
- return self::$_instances[$group];
26
- }
27
-
28
- /**
29
- * Create a new cache for the specified group
30
- * @param $group
31
- */
32
- function __construct($group)
33
- {
34
- $this->group = $group;
35
- }
36
-
37
- /**
38
- * Gets an item from the cache
39
- * @param $key
40
- * @param null $default
41
- * @return mixed
42
- */
43
- static function get($key, $default=NULL, $group=NULL)
44
- {
45
- return self::get_instance($group)->lookup($key, $default);
46
- }
47
-
48
- /**
49
- * Caches an item
50
- * @param $key
51
- * @param null $value
52
- * @return bool|int
53
- */
54
- static function set($key, $value=NULL, $group=NULL, $ttl=NULL)
55
- {
56
- return self::get_instance($group)->update($key, $value, $ttl);
57
- }
58
-
59
- /**
60
- * Removes an item from the cache
61
- * @param $key
62
- */
63
- static function remove($key, $group=NULL)
64
- {
65
- return self::get_instance($group)->delete($key);
66
- }
67
-
68
- /**
69
- * Generate a unique key from params
70
- * @param $params
71
- * @return string
72
- */
73
- static function generate_key($params)
74
- {
75
- if (!self::$enabled) return NULL;
76
- if (is_object($params)) $params = (array) $params;
77
- if (is_array($params)) {
78
- foreach ($params as &$param) $param = @json_encode($param);
79
- $params = implode('', $params);
80
- }
81
-
82
- return md5($params);
83
- }
84
-
85
- /**
86
- * Flush the entire cache
87
- */
88
- static function flush($group=NULL, $expired_only=FALSE)
89
- {
90
- if (!extension_loaded('suhosin')) ini_set('memory_limit', -1);
91
- $retval = 0;
92
-
93
- if (self::$enabled) {
94
-
95
- // Delete all caches
96
- if ($group == 'all') {
97
- foreach (self::$_instances as $cache) {
98
- $retval += self::flush($cache->group, $expired_only);
99
- }
100
- }
101
-
102
- // Delete items from a single cache in particular
103
- else {
104
- $cache = self::get_instance($group);
105
-
106
- // Determine if the object cache is external, and not stored in the DB
107
- // If it's external, we have to delete each transient, one by one
108
- global $_wp_using_ext_object_cache, $wpdb;
109
- if ($_wp_using_ext_object_cache) {
110
- $keys = ($expired_only ? self::get_expired_key_list($group) : self::get_key_list($group));
111
- foreach ($keys as $key) $cache->delete($key, FALSE);
112
- }
113
-
114
- // Transients are stored in the database
115
- else {
116
- $keys = ($expired_only ? self::get_expired_key_list($group) : self::get_key_list($group));
117
- if ($keys) {
118
- $all_keys = array();
119
- foreach ($keys as $value) {
120
- $all_keys[] = "'_transient_timeout_{$value}'";
121
- $all_keys[] = "'_transient_{$value}'";
122
- }
123
-
124
- // Determine the maximum packet size for the MySQL server
125
- $max_packet_size = 1000000; // 1 MB
126
- if ($row = $wpdb->get_row("SHOW VARIABLES LIKE 'max_allowed_packet'")) {
127
- $max_packet_size = intval($row->Value);
128
- }
129
- $precision = -6;
130
- if ($max_packet_size <1000000) $precision = -5;
131
- if ($max_packet_size <100000) $precision = -4;
132
- if ($max_packet_size <10000) $precision = -3;
133
- if ($max_packet_size <1000) $precision = -2;
134
-
135
- if (version_compare(PHP_VERSION, '5.3.0') >= 0)
136
- $max_packet_size = round($max_packet_size, $precision, PHP_ROUND_HALF_DOWN);
137
- else
138
- $max_packet_size = round($max_packet_size, $precision);
139
-
140
- // Generate DELETE queries up to $max_packet_size
141
- $keys = array();
142
- $average_key_size = strlen($all_keys[0])+15;
143
- $count = 1000; // 1 KB buffer
144
- while (($key = array_pop($all_keys))) {
145
-
146
- if (($count + $average_key_size) < $max_packet_size) {
147
- $keys[] = $key;
148
- $count += $average_key_size;
149
- }
150
- else {
151
- $keys = implode(',', $keys);
152
- $sql = "DELETE FROM {$wpdb->options} WHERE option_name IN (". $keys. ')';
153
- if (strlen($sql) > $max_packet_size) error_log("Delete transient query larger than max_allowed_packet for MySQL");
154
- else $retval += $wpdb->query($sql);
155
- $count = 1000;
156
- $keys = array();
157
- }
158
- }
159
-
160
- // If the number of keys to delete is less than the max packet size, then we should still
161
- // delete the records
162
- if (!$retval && $keys) {
163
- $keys = implode(',', $keys);
164
- $sql = "DELETE FROM {$wpdb->options} WHERE option_name IN (". $keys. ')';
165
- if (strlen($sql) > $max_packet_size) error_log("Delete transient query larger than max_allowed_packet for MySQL");
166
- else $retval += $wpdb->query($sql);
167
- }
168
- }
169
- }
170
-
171
- // removes all the just removed entries from the tracker entry
172
- self::unset_tracker_expired_keys($group, $expired_only);
173
- }
174
- }
175
-
176
- return $retval;
177
- }
178
-
179
- static function get_key_list($group=NULL, $expired_only=FALSE)
180
- {
181
- $retval = array();
182
- $cache = self::get_instance($group);
183
-
184
- $current = get_option($cache->group . 'tracker');
185
- if (!is_array($current) || empty($current))
186
- return $retval;
187
-
188
- foreach ($current as $time => $keys) {
189
- foreach ($keys as $ndx => $key) {
190
- if ($expired_only && $time < time())
191
- $retval[] = $key;
192
- elseif (!$expired_only)
193
- $retval[] = $key;
194
- }
195
- }
196
-
197
- return $retval;
198
- }
199
-
200
- /**
201
- * Updates group tracker option to remove expired keys
202
- *
203
- * @param string $group
204
- * @return array Currently active time/key array
205
- */
206
- static function unset_tracker_expired_keys($group = NULL, $expired_only = FALSE)
207
- {
208
- $retval = array();
209
- $cache = self::get_instance($group);
210
-
211
- $current = get_option($cache->group . 'tracker');
212
-
213
- if (!is_array($current))
214
- return $retval;
215
-
216
- if (!$expired_only)
217
- $current = array();
218
- else {
219
- foreach ($current as $time => $keys) {
220
- if ($time < time())
221
- unset($current[$time]);
222
- }
223
- }
224
-
225
- delete_option($cache->group . 'tracker');
226
- add_option($cache->group . 'tracker', $current, NULL, 'no');
227
-
228
- return $current;
229
- }
230
-
231
- static function get_expired_key_list($group=NULL)
232
- {
233
- return self::get_key_list($group, TRUE);
234
- }
235
-
236
-
237
- /**
238
- * Gets an item using a particular key
239
- * @param $key
240
- * @param $default
241
- * @return mixed
242
- */
243
- function lookup($key, $default=NULL)
244
- {
245
- $retval = $default;
246
-
247
- if (self::$enabled && self::$do_not_lookup === FALSE) {
248
- if (is_array($key)) $key = self::generate_key($key);
249
- if (!($retval = get_transient($key))) $retval = $default;
250
- }
251
-
252
- return $retval;
253
- }
254
-
255
- /**
256
- * Set an item in the cache using a particular key
257
- *
258
- * @param $key
259
- * @param $value
260
- * @return bool|int
261
- */
262
- function update($key, $value, $ttl=NULL)
263
- {
264
- if (!$ttl) $ttl = PHOTOCRATI_CACHE_TTL;
265
-
266
- $retval = FALSE;
267
- if (self::$enabled)
268
- {
269
- if (is_array($key))
270
- $key = self::generate_key($key);
271
- if (self::$force_update OR $this->lookup($key, FALSE) === FALSE)
272
- {
273
- set_transient($key, $value, $ttl);
274
- $current = get_option($this->group . 'tracker');
275
- delete_option($this->group . 'tracker');
276
- if (!is_array($current))
277
- $current = array();
278
- $time = time();
279
- $current[$time][] = $key;
280
- add_option($this->group . 'tracker', $current, NULL, 'no');
281
- $retval = $key;
282
- }
283
- }
284
- return $retval;
285
- }
286
-
287
- function delete($key)
288
- {
289
- if (self::$enabled)
290
- return delete_transient($key);
291
- else
292
- return FALSE;
293
- }
294
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
non_pope/class.photocrati_installer.php CHANGED
@@ -114,7 +114,7 @@ if (!class_exists('C_Photocrati_Installer'))
114
 
115
  static function done_upgrade()
116
  {
117
- update_option('ngg_doing_upgrade', FALSE);
118
  }
119
 
120
  static function update($reset=FALSE)
@@ -122,6 +122,21 @@ if (!class_exists('C_Photocrati_Installer'))
122
  $local_settings = C_NextGen_Settings::get_instance();
123
  $global_settings = C_NextGen_Global_Settings::get_instance();
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  // This is a specific hack/work-around/fix and can probably be removed sometime after 2.0.20's release
126
  //
127
  // NextGen 2x was not multisite compatible until 2.0.18. Users that upgraded before this
@@ -162,7 +177,7 @@ if (!class_exists('C_Photocrati_Installer'))
162
  $can_upgrade = $do_upgrade ? self::can_do_upgrade() : FALSE;
163
  if ($can_upgrade && !$diff) $diff = $current_module_list;
164
 
165
- if ($can_upgrade) {
166
 
167
  // Clear APC cache
168
  if (function_exists('apc_clear_cache')) {
@@ -170,10 +185,10 @@ if (!class_exists('C_Photocrati_Installer'))
170
  apc_clear_cache();
171
  }
172
 
173
- // The cache should be flushed
174
- C_Photocrati_Cache::flush();
175
- C_Photocrati_Cache::flush('all');
176
- if (class_exists('C_Pope_Cache')) C_Pope_Cache::get_instance()->flush();
177
 
178
  // Remove all NGG created cron jobs
179
  self::refresh_cron();
114
 
115
  static function done_upgrade()
116
  {
117
+ delete_option('ngg_doing_upgrade');
118
  }
119
 
120
  static function update($reset=FALSE)
122
  $local_settings = C_NextGen_Settings::get_instance();
123
  $global_settings = C_NextGen_Global_Settings::get_instance();
124
 
125
+ // Somehow some installations are missing several default settings
126
+ // Because gallerystorage_driver is essential to know we do a 'soft' reset here
127
+ // by filling in any missing options from the default settings
128
+ if (is_null($local_settings->gallerystorage_driver)) {
129
+ $settings_installer = new C_NextGen_Settings_Installer();
130
+
131
+ $local_settings->reset();
132
+ $settings_installer->install_local_settings();
133
+ $local_settings->save();
134
+
135
+ $global_settings->reset();
136
+ $settings_installer->install_global_settings();
137
+ $global_settings->save();
138
+ }
139
+
140
  // This is a specific hack/work-around/fix and can probably be removed sometime after 2.0.20's release
141
  //
142
  // NextGen 2x was not multisite compatible until 2.0.18. Users that upgraded before this
177
  $can_upgrade = $do_upgrade ? self::can_do_upgrade() : FALSE;
178
  if ($can_upgrade && !$diff) $diff = $current_module_list;
179
 
180
+ if ($can_upgrade && $do_upgrade) {
181
 
182
  // Clear APC cache
183
  if (function_exists('apc_clear_cache')) {
185
  apc_clear_cache();
186
  }
187
 
188
+ // We flush ALL transients
189
+ wp_cache_flush();
190
+ global $wpdb;
191
+ $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient%'");
192
 
193
  // Remove all NGG created cron jobs
194
  self::refresh_cron();
non_pope/class.photocrati_transient_manager.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class C_Photocrati_Transient_Manager
4
+ {
5
+ private $_groups = array();
6
+ static $_instance = NULL;
7
+
8
+ /**
9
+ * @return C_Photocrati_Transient_Manager
10
+ */
11
+ static function get_instance()
12
+ {
13
+ if (!self::$_instance) {
14
+ $klass = get_class();
15
+ self::$_instance = new $klass;
16
+ }
17
+ return self::$_instance;
18
+ }
19
+
20
+ function __construct()
21
+ {
22
+ global $_wp_using_ext_object_cache;
23
+
24
+ $this->_groups = get_option('ngg_transient_groups', array('__counter' => 1));
25
+ if ($_wp_using_ext_object_cache) $this->_tracker = get_option('photocrati_cache_tracker', array());
26
+ register_shutdown_function(array(&$this, '_update_tracker'));
27
+ }
28
+
29
+ function delete_tracked($group=NULL)
30
+ {
31
+ global $_wp_using_ext_object_cache;
32
+ if ($_wp_using_ext_object_cache) {
33
+ if ($group) {
34
+ if (is_array($this->_tracker) && isset($this->_tracker[$this->get_group_id($group)])) {
35
+ foreach ($this->_tracker[$this->get_group_id($group)] as $key) {
36
+ delete_transient($this->get_group_id($group).'__'.$key);
37
+ }
38
+ unset($this->_tracker[$this->get_group_id($group)]);
39
+ }
40
+ }
41
+ else foreach($this->_groups as $group => $data) $this->delete_tracked($group);
42
+ }
43
+ }
44
+
45
+ function _update_tracker()
46
+ {
47
+ global $_wp_using_ext_object_cache;
48
+ if ($_wp_using_ext_object_cache) {
49
+ delete_option('photocrati_cache_tracker');
50
+ add_option('photocrati_cache_tracker', $this->_tracker, '', 'no');
51
+ }
52
+ }
53
+
54
+ function add_group($group_or_groups)
55
+ {
56
+ $updated = FALSE;
57
+ $groups = is_array($group_or_groups) ? $group_or_groups : array($group_or_groups);
58
+ foreach ($groups as $group) {
59
+ if (!isset($this->_groups[$group])) {
60
+ $id = $this->_groups['__counter'] += 1;
61
+ $this->_groups[$group] = array('id' => $id, 'enabled' => TRUE);
62
+ $updated = TRUE;
63
+ }
64
+ }
65
+ if ($updated) update_option('ngg_transient_groups', $this->_groups);
66
+
67
+ }
68
+
69
+ function get_group_id($group_name)
70
+ {
71
+ $this->add_group($group_name);
72
+
73
+ return $this->_groups[$group_name]['id'];
74
+ }
75
+
76
+ function generate_key($group, $params=array())
77
+ {
78
+ if (is_object($params)) $params = (array) $params;
79
+ if (is_array($params)) {
80
+ foreach ($params as &$param) $param = @json_encode($param);
81
+ $params = implode('', $params);
82
+ }
83
+
84
+ return $this->get_group_id($group).'__'.str_replace('-', '_', crc32($params));
85
+ }
86
+
87
+ function get($key, $default=NULL, $lookup=NULL)
88
+ {
89
+ $retval = $default;
90
+
91
+ if (is_null($lookup)) {
92
+ if (defined('PHOTOCRATI_CACHE')) {
93
+ $lookup = PHOTOCRATI_CACHE;
94
+ }
95
+ }
96
+
97
+ if ($lookup) {
98
+ $retval = json_decode(get_transient($key));
99
+ if (is_object($retval)) $retval = (array) $retval;
100
+ if (is_null($retval)) $retval = $default;
101
+ }
102
+
103
+ return $retval;
104
+ }
105
+
106
+ function _track_key($key)
107
+ {
108
+ global $_wp_using_ext_object_cache;
109
+ if ($_wp_using_ext_object_cache) {
110
+ $parts = explode('__', $key);
111
+ $group = $parts[0];
112
+ $id = $parts[1];
113
+ if (!isset($this->_tracker[$group])) $this->_tracker[$group] = array();
114
+ $this->_tracker[$group][] = $id;
115
+ }
116
+ }
117
+
118
+ function set($key, $value, $ttl=0)
119
+ {
120
+ $retval = FALSE;
121
+ $enabled = TRUE;
122
+ if (defined('PHOTOCRATI_CACHE')) $enabled = PHOTOCRATI_CACHE;
123
+ if (defined('PHOTOCRATI_CACHE_TTL') && !$ttl) $ttl = PHOTOCRATI_CACHE_TTL;
124
+ if ($enabled) {
125
+ $retval = set_transient($key, json_encode($value), $ttl);
126
+ if ($retval) $this->_track_key($key);
127
+ }
128
+
129
+ return $retval;
130
+ }
131
+
132
+ function delete($key)
133
+ {
134
+ return delete_transient($key);
135
+ }
136
+
137
+ function clear($group=NULL)
138
+ {
139
+ if (is_string($group) && !empty($group))
140
+ {
141
+ global $wpdb;
142
+ $query = "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient%' AND option_name LIKE '%{$this->get_group_id($group)}__%'";
143
+ $wpdb->query($query);
144
+ $this->delete_tracked($group);
145
+ }
146
+ else foreach ($this->_groups as $name => $params) {
147
+ $this->clear($name);
148
+ }
149
+ }
150
+
151
+ static function update($key, $value, $ttl=NULL)
152
+ {
153
+ return self::get_instance()->set($key, $value, $ttl);
154
+ }
155
+
156
+ static function fetch($key, $default=NULL)
157
+ {
158
+ return self::get_instance()->get($key, $default);
159
+ }
160
+
161
+ static function flush($group=NULL)
162
+ {
163
+ return self::get_instance()->clear($group);
164
+ }
165
+
166
+ static function create_key($group, $params=array())
167
+ {
168
+ return self::get_instance()->generate_key($group, $params);
169
+ }
170
+ }
non_pope/class.pope_cache_drivers.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- class C_Pope_Cache_Transients implements I_Pope_Cache_Driver
4
- {
5
- static $initialized = FALSE;
6
- static $group_name = 'pope_cache';
7
-
8
- public static function initialize()
9
- {
10
- if (self::$initialized)
11
- return;
12
-
13
- if (is_multisite())
14
- self::$group_name = self::$group_name . '_' . get_current_blog_id();
15
-
16
- self::$initialized = TRUE;
17
- }
18
-
19
- public static function add_key_prefix($prefix)
20
- {
21
- // there's a chance this will create IDs longer than be stored in wp_options.option_name
22
- // self::$group_name = self::$group_name . '_' . $prefix;
23
- }
24
-
25
- public static function lookup($key, $default = NULL)
26
- {
27
- $cache = C_Photocrati_Cache::get_instance(self::$group_name);
28
- return $cache->lookup($key, $default);
29
- }
30
-
31
- public static function update($key, $value)
32
- {
33
- $cache = C_Photocrati_Cache::get_instance(self::$group_name);
34
- $cache->update($key, $value);
35
- }
36
-
37
- public static function flush()
38
- {
39
- $cache = C_Photocrati_Cache::get_instance(self::$group_name);
40
- $cache->flush(self::$group_name);
41
- }
42
-
43
- }
44
-
45
- class C_Pope_Cache_WPOptions implements I_Pope_Cache_Driver
46
- {
47
- static $initialized = FALSE;
48
- static $_empty = TRUE;
49
- static $_name = 'pope_cache';
50
- static $_cache = array();
51
-
52
- public static function initialize()
53
- {
54
- if (self::$initialized)
55
- return;
56
-
57
- if (is_multisite())
58
- self::$_cache = get_blog_option(NULL, self::$_name, array());
59
- else
60
- self::$_cache = get_option(self::$_name, array());
61
-
62
- self::$initialized = TRUE;
63
- }
64
-
65
- public static function add_key_prefix($prefix)
66
- {
67
- }
68
-
69
- public static function lookup($key, $default = NULL)
70
- {
71
- self::initialize();
72
-
73
- if (!empty(self::$_cache[$key]))
74
- return self::$_cache[$key];
75
- else
76
- return $default;
77
- }
78
-
79
- public static function update($key, $value)
80
- {
81
- self::initialize();
82
-
83
- if (!empty(self::$_cache[$key]) && self::$_cache[$key] == $value)
84
- return;
85
-
86
- self::$_cache[$key] = $value;
87
-
88
- if (empty(self::$_cache))
89
- return;
90
-
91
- if (self::$_empty) {
92
- if (is_multisite()) {
93
- add_blog_option(NULL, self::$_name, self::$_cache);
94
- } else {
95
- add_option(self::$_name, self::$_cache);
96
- }
97
- self::$_empty = FALSE;
98
- } else {
99
- if (is_multisite()) {
100
- update_blog_option(NULL, self::$_name, self::$_cache);
101
- } else {
102
- update_option(self::$_name, self::$_cache);
103
- }
104
- }
105
- }
106
-
107
- public static function flush()
108
- {
109
- self::$_cache = array();
110
- if (is_multisite())
111
- delete_blog_option(NULL, self::$_name);
112
- else
113
- delete_option(self::$_name);
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pope/lib/autoload.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  if (!defined('POPE_VERSION')) {
4
- define('POPE_VERSION', '0.10');
5
  require_once('class.pope_cache.php');
6
  require_once('class.extensibleobject.php');
7
  require_once('interface.component.php');
1
  <?php
2
 
3
  if (!defined('POPE_VERSION')) {
4
+ define('POPE_VERSION', '0.12');
5
  require_once('class.pope_cache.php');
6
  require_once('class.extensibleobject.php');
7
  require_once('interface.component.php');
pope/lib/class.component_registry.php CHANGED
@@ -323,7 +323,7 @@ class C_Component_Registry
323
  function get_module_list($for_product_id=FALSE)
324
  {
325
  $retval = $module_list = array();
326
-
327
 
328
  // As of Feb 10, 2015, there's no standard way across Pope products to an "ordered" list of modules
329
  // that the product provides.
@@ -344,11 +344,20 @@ class C_Component_Registry
344
  $obj = $this->get_product($product_id);
345
  try{
346
  $klass = new ReflectionClass($obj);
347
- $modules = $klass->getStaticPropertyValue('modules');
348
- if (!$modules && method_exists($obj, 'define_modules')) {
349
- $obj->define_modules();
350
- $modules = $klass->getStaticPropertyValue('modules');
 
 
 
 
 
 
 
 
351
  }
 
352
  $module_list[$product_id] = $modules;
353
  }
354
 
323
  function get_module_list($for_product_id=FALSE)
324
  {
325
  $retval = $module_list = array();
326
+ // As of May 1, 2015, there's a new standard. A product will provide get_provided_modules() and get_modules_to_load().
327
 
328
  // As of Feb 10, 2015, there's no standard way across Pope products to an "ordered" list of modules
329
  // that the product provides.
344
  $obj = $this->get_product($product_id);
345
  try{
346
  $klass = new ReflectionClass($obj);
347
+ if ($klass->hasMethod('get_modules_to_load')) {
348
+ $modules = $obj->get_modules_to_load();
349
+ }
350
+ elseif ($klass->hasProperty('modules')) {
351
+ $modules = $klass->getStaticPropertyValue('modules');
352
+ }
353
+
354
+ if (!$modules && $klass->hasMethod('define_modules')) {
355
+ $modules = $obj->define_modules();
356
+ if ($klass->hasProperty('modules')) {
357
+ $modules = $klass->getStaticPropertyValue('modules');
358
+ }
359
  }
360
+
361
  $module_list[$product_id] = $modules;
362
  }
363
 
products/photocrati_nextgen/class.nextgen_product_installer.php CHANGED
@@ -14,14 +14,43 @@ class C_NextGen_Product_Installer
14
  return $pope_modules_list;
15
  }
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  function uninstall($hard)
18
  {
19
  // remove this products modules from the pope_module_list registry
 
 
20
  $pope_modules_list = get_option('pope_module_list', array());
21
- $pope_modules_list = $this->_filter_modules($pope_modules_list, P_Photocrati_NextGen::$modules);
22
 
23
  // run each modules respective uninstall routines
24
- foreach (P_Photocrati_NextGen::$modules as $module_name) {
25
  if (($handler = C_Photocrati_Installer::get_handler_instance($module_name))) {
26
  if (method_exists($handler, 'uninstall')) $handler->uninstall($hard);
27
  }
@@ -44,7 +73,7 @@ class C_NextGen_Product_Installer
44
 
45
  if (FALSE !== $pro_version)
46
  {
47
- $pope_modules_list = $this->_filter_modules($pope_modules_list, P_Photocrati_NextGen_Pro::$modules);
48
  $search = array_search('photocrati-nextgen-pro|' . $pro_version, $pope_modules_list);
49
  if (FALSE !== $search)
50
  unset($pope_modules_list[$search]);
14
  return $pope_modules_list;
15
  }
16
 
17
+ function get_modules_to_load_for($product_id)
18
+ {
19
+ $modules = array();
20
+
21
+ $obj = C_Component_Registry::get_instance()->get_product($product_id);
22
+ try {
23
+ $klass = new ReflectionClass( $obj );
24
+ if ( $klass->hasMethod( 'get_modules_to_load' ) ) {
25
+ $modules = $obj->get_modules_to_load();
26
+ } elseif ( $klass->hasProperty( 'modules' ) ) {
27
+ $modules = $klass->getStaticPropertyValue( 'modules' );
28
+ }
29
+
30
+ if ( ! $modules && $klass->hasMethod( 'define_modules' ) ) {
31
+ $modules = $obj->define_modules();
32
+ if ( $klass->hasProperty( 'modules' ) ) {
33
+ $modules = $klass->getStaticPropertyValue( 'modules' );
34
+ }
35
+ }
36
+ }
37
+ catch (ReflectionException $ex) {
38
+ // Oh oh...
39
+ }
40
+
41
+ return $modules;
42
+ }
43
+
44
  function uninstall($hard)
45
  {
46
  // remove this products modules from the pope_module_list registry
47
+ $registry = C_Component_Registry::get_instance();
48
+ $nextgen_product = $registry->get_product('photocrati-nextgen');
49
  $pope_modules_list = get_option('pope_module_list', array());
50
+ $pope_modules_list = $this->_filter_modules($pope_modules_list, $nextgen_product->get_modules_to_load());
51
 
52
  // run each modules respective uninstall routines
53
+ foreach ($nextgen_product->get_modules_to_load() as $module_name) {
54
  if (($handler = C_Photocrati_Installer::get_handler_instance($module_name))) {
55
  if (method_exists($handler, 'uninstall')) $handler->uninstall($hard);
56
  }
73
 
74
  if (FALSE !== $pro_version)
75
  {
76
+ $pope_modules_list = $this->_filter_modules($pope_modules_list, $this->get_modules_to_load_for('photocrati-nextgen-pro'));
77
  $search = array_search('photocrati-nextgen-pro|' . $pro_version, $pope_modules_list);
78
  if (FALSE !== $search)
79
  unset($pope_modules_list[$search]);
products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php CHANGED
@@ -503,7 +503,16 @@ class Mixin_Attach_To_Post_Display_Tab extends Mixin
503
  $this->object->do_not_cache();
504
  // Ensure that JS is returned
505
  $this->object->set_content_type('javascript');
506
- while (ob_get_level() > 0) {
 
 
 
 
 
 
 
 
 
507
  ob_end_clean();
508
  }
509
  // Get all entities used by the display tab
503
  $this->object->do_not_cache();
504
  // Ensure that JS is returned
505
  $this->object->set_content_type('javascript');
506
+ $buffer_limit = 0;
507
+ $zlib = ini_get('zlib.output_compression');
508
+ if (!is_numeric($zlib) && $zlib == 'On') {
509
+ $buffer_limit = 1;
510
+ } else {
511
+ if (is_numeric($zlib) && $zlib > 0) {
512
+ $buffer_limit = 1;
513
+ }
514
+ }
515
+ while (ob_get_level() != $buffer_limit) {
516
  ob_end_clean();
517
  }
518
  // Get all entities used by the display tab
products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.css CHANGED
@@ -12,6 +12,7 @@ body {
12
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
13
  filter: alpha(opacity=0);
14
  opacity: 0.0;
 
15
  }
16
 
17
  .entity_errors {
@@ -33,6 +34,11 @@ body {
33
  border: 0px;
34
  background: none;
35
  min-height: 100%;
 
 
 
 
 
36
  }
37
 
38
  .ui-tabs-panel {
12
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
13
  filter: alpha(opacity=0);
14
  opacity: 0.0;
15
+ height: 100%;
16
  }
17
 
18
  .entity_errors {
34
  border: 0px;
35
  background: none;
36
  min-height: 100%;
37
+ overflow: hidden;
38
+ }
39
+
40
+ #attach_to_post_tabs div.main_menu_tab {
41
+ overflow: hidden;
42
  }
43
 
44
  .ui-tabs-panel {
products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.min.css CHANGED
@@ -1 +1 @@
1
- html,body{width:100%;min-height:100%;padding:0;margin:0;font-size:13px}body{position:absolute;visibility:hidden;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0);opacity:0}.entity_errors{color:red}.entity_errors ul{margin-left:30px}.entity_errors ul li{list-style-type:disc}.ui-helper-reset{font-size:13px}#attach_to_post_tabs{border:0;background:none;min-height:100%}.ui-tabs-panel{min-height:100%}.ui-widget-header{border:0;border-bottom:1px solid #dfdfdf;background:none}iframe{width:100%;min-height:100%;border:0;padding:0;margin:0;background:transparent}#displayed_gallery_source{width:400px}#source_configuration td{vertical-align:top}#source_configuration .chzn-choices input[type=text]{height:auto !important}#slug_configuration #slug_label{width:52px}#slug_configuration #slug_column input[type=text]{width:498px}.display_type_preview{float:left;width:25%}.display_type_preview .image_container{width:100%;vertical-align:middle;text-align:center;font-size:12px;font-weight:600}.display_type_preview .image_container p{display:inline-block}#preview_tab_content .previewed_entity{width:100%;border-bottom:solid 1px #e0e0d6;background-color:#fafaf0}#preview_tab_content .previewed_entity .container{padding-top:15px}#preview_tab_content .previewed_entity.header{background-color:#f0f0e6;padding-bottom:5px;padding-top:5px}#preview_tab_content .header label{font-size:12px;color:#649664;font-weight:600}#preview_tab_content .ui-sortable-helper{background:none}#preview_tab_content ul{list-style-type:none;display:block;border:solid 2px #e0e0d6;padding:0;position:relative}#preview_tab_content .inclusion_checkbox{margin-right:7px;display:block;float:left}#preview_tab_content .image_container{background-color:white;background-repeat:no-repeat;background-position:center center;padding:19px;margin:7px;border:solid 1px black;display:block;vertical-align:middle;text-align:center;position:relative}#preview_tab_content .image_container img{border:0}#preview_tab_content #entity_list li{float:left}#preview_tab_content #entity_list .ui-state-default{background:none;border:0}#preview_tab_content .placeholder{background-color:#e0ddc1;position:relative}#preview_tab_content #entity_list .exclude_container{display:block;text-align:center;margin:0 auto;color:black;font-weight:normal;position:absolute;bottom:2px;left:0;width:100%}#preview_tab_content .header_row{margin-bottom:5px}#preview_tab_content .header_row strong{width:70px;display:inline-block}#preview_tab_content .header_row .separator{display:inline-block;margin:0 5px}#preview_tab_content .header_row .selected{font-weight:bold}#preview_tab_content #entity_list li.clear{float:none;clear:both}.clear{clear:both;float:none}table{font-size:13px}#display_settings_form table tr td:first-child{vertical-align:top;text-align:right;padding-right:7px;width:180px}#display_settings_form table td{text-align:left}#display_settings_form table textarea{height:60px}#display_settings_form textarea,#display_settings_form input[type=text],#display_settings_form input[type=number],#display_settings_form select{width:157px}#display_settings_form .ngg_slideshow_gallery_width,#display_settings_form .ngg_slideshow_gallery_height,#display_settings_form .ngg_thumbnail_dimension_width,#display_settings_form .ngg_thumbnail_dimension_height{width:65px !important}#display_settings_form .nextgen_settings_colorpicker{width:85px !important;text-align:center}.ui-tabs{visibility:visible;position:relative}.ui-tabs .ui-tabs-hide{display:block !important;visibility:hidden;position:absolute;top:-5000px}.ui-tabs .main_menu_tab{overflow:visible}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:pointer}.select2-result-label{white-space:nowrap}.select2-results{font-family:'segoe ui',Arial,sans-serif;font-size:13px}.refresh_button{float:right}
1
+ html,body{width:100%;min-height:100%;padding:0;margin:0;font-size:13px}body{position:absolute;visibility:hidden;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0);opacity:0;height:100%}.entity_errors{color:red}.entity_errors ul{margin-left:30px}.entity_errors ul li{list-style-type:disc}.ui-helper-reset{font-size:13px}#attach_to_post_tabs{border:0;background:none;min-height:100%;overflow:hidden}#attach_to_post_tabs div.main_menu_tab{overflow:hidden}.ui-tabs-panel{min-height:100%}.ui-widget-header{border:0;border-bottom:1px solid #dfdfdf;background:none}iframe{width:100%;min-height:100%;border:0;padding:0;margin:0;background:transparent}#displayed_gallery_source{width:400px}#source_configuration td{vertical-align:top}#source_configuration .chzn-choices input[type=text]{height:auto !important}#slug_configuration #slug_label{width:52px}#slug_configuration #slug_column input[type=text]{width:498px}.display_type_preview{float:left;width:25%}.display_type_preview .image_container{width:100%;vertical-align:middle;text-align:center;font-size:12px;font-weight:600}.display_type_preview .image_container p{display:inline-block}#preview_tab_content .previewed_entity{width:100%;border-bottom:solid 1px #e0e0d6;background-color:#fafaf0}#preview_tab_content .previewed_entity .container{padding-top:15px}#preview_tab_content .previewed_entity.header{background-color:#f0f0e6;padding-bottom:5px;padding-top:5px}#preview_tab_content .header label{font-size:12px;color:#649664;font-weight:600}#preview_tab_content .ui-sortable-helper{background:none}#preview_tab_content ul{list-style-type:none;display:block;border:solid 2px #e0e0d6;padding:0;position:relative}#preview_tab_content .inclusion_checkbox{margin-right:7px;display:block;float:left}#preview_tab_content .image_container{background-color:white;background-repeat:no-repeat;background-position:center center;padding:19px;margin:7px;border:solid 1px black;display:block;vertical-align:middle;text-align:center;position:relative}#preview_tab_content .image_container img{border:0}#preview_tab_content #entity_list li{float:left}#preview_tab_content #entity_list .ui-state-default{background:none;border:0}#preview_tab_content .placeholder{background-color:#e0ddc1;position:relative}#preview_tab_content #entity_list .exclude_container{display:block;text-align:center;margin:0 auto;color:black;font-weight:normal;position:absolute;bottom:2px;left:0;width:100%}#preview_tab_content .header_row{margin-bottom:5px}#preview_tab_content .header_row strong{width:70px;display:inline-block}#preview_tab_content .header_row .separator{display:inline-block;margin:0 5px}#preview_tab_content .header_row .selected{font-weight:bold}#preview_tab_content #entity_list li.clear{float:none;clear:both}.clear{clear:both;float:none}table{font-size:13px}#display_settings_form table tr td:first-child{vertical-align:top;text-align:right;padding-right:7px;width:180px}#display_settings_form table td{text-align:left}#display_settings_form table textarea{height:60px}#display_settings_form textarea,#display_settings_form input[type=text],#display_settings_form input[type=number],#display_settings_form select{width:157px}#display_settings_form .ngg_slideshow_gallery_width,#display_settings_form .ngg_slideshow_gallery_height,#display_settings_form .ngg_thumbnail_dimension_width,#display_settings_form .ngg_thumbnail_dimension_height{width:65px !important}#display_settings_form .nextgen_settings_colorpicker{width:85px !important;text-align:center}.ui-tabs{visibility:visible;position:relative}.ui-tabs .ui-tabs-hide{display:block !important;visibility:hidden;position:absolute;top:-5000px}.ui-tabs .main_menu_tab{overflow:visible}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:pointer}.select2-result-label{white-space:nowrap}.select2-results{font-family:'segoe ui',Arial,sans-serif;font-size:13px}.refresh_button{float:right}
products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.css CHANGED
@@ -54,3 +54,14 @@
54
  right: 30px !important;
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
 
54
  right: 30px !important;
55
  }
56
 
57
+ #ngg_attach_to_post_dialog-body {
58
+ -webkit-border-radius: 0px;
59
+ -moz-border-radius: 0px;
60
+ border-radius: 0px;
61
+ border: 1px solid #969696;
62
+ background: rgba(255, 255, 255, 0.6);
63
+ -webkit-box-shadow: #B3B3B3 5px 5px 5px;
64
+ -moz-box-shadow: #B3B3B3 5px 5px 5px;
65
+ box-shadow: #B3B3B3 2px 2px 5px;
66
+ border-top: none;
67
+ }
products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.min.css CHANGED
@@ -1 +1 @@
1
- #ngg_attach_to_post_dialog-title{display:none}#ngg_attach_to_post_dialog-head{min-height:0;height:0}#ngg_attach_to_post_dialog-head .mce-close{position:absolute;top:6px !important;right:20px !important;z-index:2}.ngg_attach_to_post_window{position:relative;border:0 !important}.ngg_attach_to_post_window .mceResize,.ngg_attach_to_post_window .mceTop,.ngg_attach_to_post_window .mceBottom,.ngg_attach_to_post_window .mceLeft,.ngg_attach_to_post_window .mceRight,.ngg_attach_to_post_window .mceCenter{background:transparent !important;border:0 !important}.ngg_attach_to_post_window .mceMiddle span{padding-top:6px !important}.ngg_attach_to_post_window .mceTop{display:block !important;height:0 !important;font-size:0 !important}.ngg_attach_to_post_window .mceClose{background:url('uploader-icons.png') !important;display:block !important;margin:0 !important;padding:0 !important;width:15px !important;height:15px !important;background-position:-100px 0 !important;position:absolute !important;top:44px !important;right:30px !important}
1
+ #ngg_attach_to_post_dialog-title{display:none}#ngg_attach_to_post_dialog-head{min-height:0;height:0}#ngg_attach_to_post_dialog-head .mce-close{position:absolute;top:6px !important;right:20px !important;z-index:2}.ngg_attach_to_post_window{position:relative;border:0 !important}.ngg_attach_to_post_window .mceResize,.ngg_attach_to_post_window .mceTop,.ngg_attach_to_post_window .mceBottom,.ngg_attach_to_post_window .mceLeft,.ngg_attach_to_post_window .mceRight,.ngg_attach_to_post_window .mceCenter{background:transparent !important;border:0 !important}.ngg_attach_to_post_window .mceMiddle span{padding-top:6px !important}.ngg_attach_to_post_window .mceTop{display:block !important;height:0 !important;font-size:0 !important}.ngg_attach_to_post_window .mceClose{background:url('uploader-icons.png') !important;display:block !important;margin:0 !important;padding:0 !important;width:15px !important;height:15px !important;background-position:-100px 0 !important;position:absolute !important;top:44px !important;right:30px !important}#ngg_attach_to_post_dialog-body{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;border:1px solid #969696;background:rgba(255,255,255,.6);-webkit-box-shadow:#b3b3b3 5px 5px 5px;-moz-box-shadow:#b3b3b3 5px 5px 5px;box-shadow:#b3b3b3 2px 2px 5px;border-top:0}
products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php CHANGED
@@ -24,6 +24,7 @@
24
  <?php endforeach ?>
25
  </div>
26
 
 
27
  <?php wp_print_footer_scripts() ?>
28
  </body>
29
  </html>
24
  <?php endforeach ?>
25
  </div>
26
 
27
+ <div id="adminmenu" style="display:none;" data-wp-responsive="true"></div>
28
  <?php wp_print_footer_scripts() ?>
29
  </body>
30
  </html>
products/photocrati_nextgen/modules/dynamic_thumbnails/package.module.dynamic_thumbnails.php CHANGED
@@ -225,8 +225,7 @@ class Mixin_Dynamic_Thumbnails_Manager extends Mixin
225
  }
226
  public function get_image_url($image, $params)
227
  {
228
- $router = C_Router::get_instance();
229
- return $router->get_url($this->object->get_image_uri($image, $params), FALSE);
230
  }
231
  public function get_params_from_uri($uri)
232
  {
225
  }
226
  public function get_image_url($image, $params)
227
  {
228
+ return C_Router::get_instance()->get_url($this->object->get_image_uri($image, $params), FALSE, 'root');
 
229
  }
230
  public function get_params_from_uri($uri)
231
  {
products/photocrati_nextgen/modules/i18n/lang/nggallery-el.mo ADDED
Binary file
products/photocrati_nextgen/modules/i18n/lang/nggallery-pl_PL.mo ADDED
Binary file
products/photocrati_nextgen/modules/i18n/lang/nggallery-ru_RU.mo CHANGED
Binary file
products/photocrati_nextgen/modules/i18n/lang/nggallery-uk.mo ADDED
Binary file
products/photocrati_nextgen/modules/i18n/lang/nggallery.po CHANGED
@@ -819,6 +819,10 @@ msgstr ""
819
  msgid "The display type that the tagcloud will point its results to"
820
  msgstr ""
821
 
 
 
 
 
822
  #: products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php:163
823
  msgid "NextGEN Basic TagCloud"
824
  msgstr ""
@@ -1720,6 +1724,10 @@ msgstr ""
1720
  msgid "Page Link to"
1721
  msgstr ""
1722
 
 
 
 
 
1723
  #: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:611
1724
  #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:336
1725
  #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:365
@@ -2629,10 +2637,6 @@ msgstr ""
2629
  msgid "Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress."
2630
  msgstr ""
2631
 
2632
- #: products/photocrati_nextgen/modules/ngglegacy/admin/roles.php:27
2633
- msgid "For a more flexible user management you can use the"
2634
- msgstr ""
2635
-
2636
  #: products/photocrati_nextgen/modules/ngglegacy/admin/roles.php:31
2637
  msgid "Main NextGEN Gallery overview"
2638
  msgstr ""
819
  msgid "The display type that the tagcloud will point its results to"
820
  msgstr ""
821
 
822
+ #: products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.taxonomy_controller.php:114
823
+ msgid "Images tagged &quot;%s&quot;"
824
+ msgstr ""
825
+
826
  #: products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php:163
827
  msgid "NextGEN Basic TagCloud"
828
  msgstr ""
1724
  msgid "Page Link to"
1725
  msgstr ""
1726
 
1727
+ #: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:616
1728
+ msgid "There are no pages to link to"
1729
+ msgstr ""
1730
+
1731
  #: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:611
1732
  #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:336
1733
  #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:365
2637
  msgid "Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress."
2638
  msgstr ""
2639
 
 
 
 
 
2640
  #: products/photocrati_nextgen/modules/ngglegacy/admin/roles.php:31
2641
  msgid "Main NextGEN Gallery overview"
2642
  msgstr ""
products/photocrati_nextgen/modules/lightbox/static/lightbox_context.js CHANGED
@@ -21,7 +21,7 @@ function nextgen_lightbox_filter_selector($, selector)
21
  }
22
 
23
  selector = selector.not('.gallery_link');
24
- selector.not('.use_imagebrowser_effect');
25
  }
26
 
27
  return selector;
21
  }
22
 
23
  selector = selector.not('.gallery_link');
24
+ selector = selector.not('.use_imagebrowser_effect');
25
  }
26
 
27
  return selector;
products/photocrati_nextgen/modules/lightbox/static/lightbox_context.min.js CHANGED
@@ -1 +1 @@
1
- eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('h l($,0){5(d&&d.2){7 2=d.2;5(2==\'p\'){0=0.b($(\'a > 8\').c())}f 5(2==\'o\'){0=0.b($(\'a[1] > 8\').c().q(h(){7 1=$(n).m(\'1\').k();7 6=1.g(1.i-3);7 9=1.g(1.i-4);j(6==\'y\'||6==\'z\'||6==\'A\'||9==\'r\'||9==\'B\')}))}f 5(2==\'x\'){0=0.b($(\'a > 8[w*="s-t-"]\').c())}0=0.e(\'.u\');0.e(\'.v\')}j 0}',38,38,'selector|href|context|||if|ext|var|img|ext2||add|parent|nextgen_lightbox_settings|not|else|substring|function|length|return|toLowerCase|nextgen_lightbox_filter_selector|attr|this|all_images_direct|all_images|filter|tiff|wp|image|gallery_link|use_imagebrowser_effect|class|nextgen_and_wp_images|jpg|gif|png|jpeg'.split('|'),0,{}))
1
+ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('h l($,0){5(d&&d.2){7 2=d.2;5(2==\'p\'){0=0.b($(\'a > 8\').c())}f 5(2==\'o\'){0=0.b($(\'a[1] > 8\').c().q(h(){7 1=$(n).m(\'1\').k();7 6=1.g(1.i-3);7 9=1.g(1.i-4);j(6==\'y\'||6==\'z\'||6==\'A\'||9==\'r\'||9==\'B\')}))}f 5(2==\'x\'){0=0.b($(\'a > 8[w*="s-t-"]\').c())}0=0.e(\'.u\');0=0.e(\'.v\')}j 0}',38,38,'selector|href|context|||if|ext|var|img|ext2||add|parent|nextgen_lightbox_settings|not|else|substring|function|length|return|toLowerCase|nextgen_lightbox_filter_selector|attr|this|all_images_direct|all_images|filter|tiff|wp|image|gallery_link|use_imagebrowser_effect|class|nextgen_and_wp_images|jpg|gif|png|jpeg'.split('|'),0,{}))
products/photocrati_nextgen/modules/mvc/package.module.mvc.php CHANGED
@@ -10,15 +10,19 @@ class A_MVC_Fs extends Mixin
10
  {
11
  static $_lookups = array();
12
  static $_non_minified_modules = array();
 
 
 
 
13
  public function initialize()
14
  {
15
  register_shutdown_function(array(&$this, 'cache_lookups'));
16
- self::$_lookups = C_Photocrati_Cache::get('find_static_abspath', array(), 'MVC');
17
  self::$_non_minified_modules = apply_filters('ngg_non_minified_modules', array());
18
  }
19
  public function cache_lookups()
20
  {
21
- C_Photocrati_Cache::set('find_static_abspath', self::$_lookups, 'MVC');
22
  }
23
  /**
24
  * Gets the absolute path to a static resource. If it doesn't exist, then NULL is returned
@@ -101,11 +105,15 @@ class A_MVC_Router extends Mixin
101
  public function initialize()
102
  {
103
  register_shutdown_function(array(&$this, 'cache_lookups'));
104
- self::$_lookups = C_Photocrati_Cache::get('get_static_url', array(), 'MVC');
 
 
 
 
105
  }
106
  public function cache_lookups()
107
  {
108
- C_Photocrati_Cache::set('get_static_url', self::$_lookups, 'MVC');
109
  }
110
  public function _get_static_url_key($path, $module = FALSE)
111
  {
@@ -553,12 +561,48 @@ class Mixin_Mvc_View_Instance_Methods extends Mixin
553
  }
554
  // Append the suffix
555
  $path = $path . '.php';
556
- $retval = $fs->join_paths($this->object->get_registry()->get_module_dir($module), $settings->mvc_template_dirname, $path);
 
 
 
557
  if (!@file_exists($retval)) {
558
  throw new RuntimeException("{$retval} is not a valid MVC template");
559
  }
560
  return $retval;
561
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  /**
563
  * Adds a template parameter
564
  * @param $key
10
  {
11
  static $_lookups = array();
12
  static $_non_minified_modules = array();
13
+ public function _get_cache_key()
14
+ {
15
+ return C_Photocrati_Transient_Manager::create_key('MVC', 'find_static_abspath');
16
+ }
17
  public function initialize()
18
  {
19
  register_shutdown_function(array(&$this, 'cache_lookups'));
20
+ self::$_lookups = C_Photocrati_Transient_Manager::fetch($this->_get_cache_key(), array());
21
  self::$_non_minified_modules = apply_filters('ngg_non_minified_modules', array());
22
  }
23
  public function cache_lookups()
24
  {
25
+ C_Photocrati_Transient_Manager::update($this->_get_cache_key(), self::$_lookups);
26
  }
27
  /**
28
  * Gets the absolute path to a static resource. If it doesn't exist, then NULL is returned
105
  public function initialize()
106
  {
107
  register_shutdown_function(array(&$this, 'cache_lookups'));
108
+ self::$_lookups = C_Photocrati_Transient_Manager::fetch($this->_get_cache_key(), array());
109
+ }
110
+ public function _get_cache_key()
111
+ {
112
+ return C_Photocrati_Transient_Manager::create_key('MVC', 'get_static_url');
113
  }
114
  public function cache_lookups()
115
  {
116
+ C_Photocrati_Transient_Manager::update($this->_get_cache_key(), self::$_lookups);
117
  }
118
  public function _get_static_url_key($path, $module = FALSE)
119
  {
561
  }
562
  // Append the suffix
563
  $path = $path . '.php';
564
+ // First check if the template is in the override dir
565
+ if (!($retval = $this->object->get_template_override_abspath($module, $path))) {
566
+ $retval = $fs->join_paths($this->object->get_registry()->get_module_dir($module), $settings->mvc_template_dirname, $path);
567
+ }
568
  if (!@file_exists($retval)) {
569
  throw new RuntimeException("{$retval} is not a valid MVC template");
570
  }
571
  return $retval;
572
  }
573
+ public function get_template_override_dir($module = NULL)
574
+ {
575
+ $fs = C_Fs::get_instance();
576
+ $dir = $fs->join_paths(WP_CONTENT_DIR, 'ngg');
577
+ if (!@file_exists($dir)) {
578
+ wp_mkdir_p($dir);
579
+ }
580
+ $dir = $fs->join_paths($dir, 'modules');
581
+ if (!@file_exists($dir)) {
582
+ wp_mkdir_p($dir);
583
+ }
584
+ if ($module) {
585
+ $dir = $fs->join_paths($dir, $module);
586
+ if (!@file_exists($dir)) {
587
+ wp_mkdir_p($dir);
588
+ }
589
+ $dir = $fs->join_paths($dir, 'templates');
590
+ if (!@file_exists($dir)) {
591
+ wp_mkdir_p($dir);
592
+ }
593
+ }
594
+ return $dir;
595
+ }
596
+ public function get_template_override_abspath($module, $filename)
597
+ {
598
+ $fs = C_Fs::get_instance();
599
+ $retval = NULL;
600
+ $abspath = $fs->join_paths($this->object->get_template_override_dir($module), $filename);
601
+ if (@file_exists($abspath)) {
602
+ $retval = $abspath;
603
+ }
604
+ return $retval;
605
+ }
606
  /**
607
  * Adds a template parameter
608
  * @param $key
products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php CHANGED
@@ -25,8 +25,10 @@ class M_NextGen_AddGallery_Page extends C_Base_Module
25
  function initialize()
26
  {
27
  $forms = C_Form_Manager::get_instance();
 
28
  $forms->add_form(NGG_ADD_GALLERY_SLUG, 'upload_images');
29
- if (!is_multisite()) $forms->add_form(NGG_ADD_GALLERY_SLUG, 'import_folder');
 
30
  }
31
 
32
  function get_type_list()
@@ -49,9 +51,8 @@ class M_NextGen_AddGallery_Page extends C_Base_Module
49
  $this->get_registry()->add_adapter('I_Page_Manager', 'A_NextGen_AddGallery_Pages');
50
  $this->get_registry()->add_adapter('I_NextGen_Admin_Page', 'A_NextGen_AddGallery_Controller', NGG_ADD_GALLERY_SLUG);
51
  $this->get_registry()->add_adapter('I_Form', 'A_Upload_Images_Form', 'upload_images');
52
- if (!is_multisite()) {
53
  $this->get_registry()->add_adapter('I_Form', 'A_Import_Folder_Form', 'import_folder');
54
- }
55
  }
56
  }
57
 
25
  function initialize()
26
  {
27
  $forms = C_Form_Manager::get_instance();
28
+ $settings = C_NextGen_Settings::get_instance();
29
  $forms->add_form(NGG_ADD_GALLERY_SLUG, 'upload_images');
30
+ if (!is_multisite() || (is_multisite() && $settings->get('wpmuImportFolder')))
31
+ $forms->add_form(NGG_ADD_GALLERY_SLUG, 'import_folder');
32
  }
33
 
34
  function get_type_list()
51
  $this->get_registry()->add_adapter('I_Page_Manager', 'A_NextGen_AddGallery_Pages');
52
  $this->get_registry()->add_adapter('I_NextGen_Admin_Page', 'A_NextGen_AddGallery_Controller', NGG_ADD_GALLERY_SLUG);
53
  $this->get_registry()->add_adapter('I_Form', 'A_Upload_Images_Form', 'upload_images');
54
+ if (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuImportFolder')))
55
  $this->get_registry()->add_adapter('I_Form', 'A_Import_Folder_Form', 'import_folder');
 
56
  }
57
  }
58
 
products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php CHANGED
@@ -736,7 +736,6 @@ class Mixin_NextGen_Admin_Page_Instance_Methods extends Mixin
736
  if ($this->object->is_post_request() && $this->has_method($action)) {
737
  $this->object->{$action}($this->object->param($this->context));
738
  }
739
- // Display and process all forms
740
  foreach ($this->object->get_forms() as $form) {
741
  $form->page = $this->object;
742
  $form->enqueue_static_resources();
736
  if ($this->object->is_post_request() && $this->has_method($action)) {
737
  $this->object->{$action}($this->object->param($this->context));
738
  }
 
739
  foreach ($this->object->get_forms() as $form) {
740
  $form->page = $this->object;
741
  $form->enqueue_static_resources();
products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php CHANGED
@@ -71,6 +71,8 @@ class M_NextGen_Basic_Album extends C_Base_Module
71
  'I_Displayed_Gallery_Renderer',
72
  'A_NextGen_Basic_Album_Routes'
73
  );
 
 
74
  }
75
 
76
 
@@ -146,6 +148,7 @@ class M_NextGen_Basic_Album extends C_Base_Module
146
  function get_type_list()
147
  {
148
  return array(
 
149
  'A_Nextgen_Basic_Album' => 'adapter.nextgen_basic_album.php',
150
  'A_Nextgen_Basic_Album_Controller' => 'adapter.nextgen_basic_album_controller.php',
151
  'A_Nextgen_Basic_Album_Mapper' => 'adapter.nextgen_basic_album_mapper.php',
71
  'I_Displayed_Gallery_Renderer',
72
  'A_NextGen_Basic_Album_Routes'
73
  );
74
+
75
+ $this->get_registry()->add_adapter('I_MVC_View', 'A_NextGen_Album_Breadcrumbs');
76
  }
77
 
78
 
148
  function get_type_list()
149
  {
150
  return array(
151
+ 'A_NextGen_Album_Breadcrumbs' => 'adapter.nextgen_album_breadcrumbs.php',
152
  'A_Nextgen_Basic_Album' => 'adapter.nextgen_basic_album.php',
153
  'A_Nextgen_Basic_Album_Controller' => 'adapter.nextgen_basic_album_controller.php',
154
  'A_Nextgen_Basic_Album_Mapper' => 'adapter.nextgen_basic_album_mapper.php',
products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php CHANGED
@@ -1,4 +1,179 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Provides validation for NextGen Basic Albums
4
  */
@@ -36,8 +211,10 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
36
  // a parent_id, which is the album that it belongs to. We need to do this
37
  // because the link to the gallery, is not /nggallery/gallery--id, but
38
  // /nggallery/album--id/gallery--id
39
- // Are we to display a gallery?
40
- if ($gallery = $gallery_slug = $this->param('gallery')) {
 
 
41
  // basic albums only support one per post
42
  if (isset($GLOBALS['nggShowGallery'])) {
43
  return;
@@ -51,11 +228,14 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
51
  $gallery = $result->{$result->id_field};
52
  }
53
  $renderer = C_Displayed_Gallery_Renderer::get_instance('inner');
54
- $gallery_params = array('source' => 'galleries', 'container_ids' => array($gallery), 'display_type' => $display_settings['gallery_display_type'], 'original_display_type' => $displayed_gallery->display_type, 'original_settings' => $display_settings);
55
  if (!empty($display_settings['gallery_display_template'])) {
56
  $gallery_params['template'] = $display_settings['gallery_display_template'];
57
  }
58
- return $renderer->display_images($gallery_params, $return);
 
 
 
59
  } else {
60
  if ($album = $this->param('album')) {
61
  $mapper = C_Album_Mapper::get_instance();
@@ -67,33 +247,42 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
67
  $displayed_gallery->entity_ids = array();
68
  $displayed_gallery->sortorder = array();
69
  $displayed_gallery->container_ids = ($album === '0' or $album === 'all') ? array() : array($album);
 
 
70
  }
71
  }
72
  // Get the albums
73
  // TODO: This should probably be moved to the elseif block above
74
  $this->albums = $displayed_gallery->get_albums();
75
  // None of the above: Display the main album. Get the settings required for display
76
- $current_page = (int) $this->param('nggpage', 1);
77
  $offset = $display_settings['galleries_per_page'] * ($current_page - 1);
78
  $entities = $displayed_gallery->get_included_entities($display_settings['galleries_per_page'], $offset);
79
  // If there are entities to be displayed
80
  if ($entities) {
 
81
  if (!empty($display_settings['template'])) {
82
  // Add additional parameters
83
- $pagination_result = $this->object->create_pagination($current_page, $displayed_gallery->get_entity_count(), $display_settings['galleries_per_page'], urldecode($this->object->param('ajax_pagination_referrer')));
84
  $this->object->remove_param('ajax_pagination_referrer');
85
  $display_settings['current_page'] = $current_page;
86
  $display_settings['entities'] =& $entities;
87
  $display_settings['pagination_prev'] = $pagination_result['prev'];
88
  $display_settings['pagination_next'] = $pagination_result['next'];
89
  $display_settings['pagination'] = $pagination_result['output'];
 
 
90
  // Render legacy template
91
  $this->object->add_mixin('Mixin_NextGen_Basic_Templates');
92
  $display_settings = $this->prepare_legacy_album_params($displayed_gallery->get_entity(), $display_settings);
93
- return $this->object->legacy_render($display_settings['template'], $display_settings, $return, 'album');
 
 
 
 
94
  } else {
95
  $params = $display_settings;
96
  $albums = $this->prepare_legacy_album_params($displayed_gallery->get_entity(), array('entities' => $entities));
 
97
  $params['image_gen_params'] = $albums['image_gen_params'];
98
  $params['galleries'] = $albums['galleries'];
99
  $params['displayed_gallery'] = $displayed_gallery;
@@ -112,6 +301,21 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
112
  return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return);
113
  }
114
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  /**
116
  * Gets the parent album for the entity being displayed
117
  * @param int $entity_id
@@ -161,7 +365,12 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
161
  if ($gallery->pageid > 0) {
162
  $gallery->pagelink = @get_page_link($gallery->pageid);
163
  } else {
164
- $gallery->pagelink = $this->object->set_param_for($this->object->get_routed_url(TRUE), 'album', $gallery->slug);
 
 
 
 
 
165
  }
166
  } else {
167
  if ($gallery->pageid > 0) {
@@ -171,11 +380,15 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
171
  $pagelink = $this->object->get_routed_url(TRUE);
172
  $parent_album = $this->object->get_parent_album_for($gallery->{$id_field});
173
  if ($parent_album) {
 
 
 
174
  $pagelink = $this->object->set_param_for($pagelink, 'album', $parent_album->slug);
175
  } else {
176
  if ($displayed_gallery->container_ids === array('0') || $displayed_gallery->container_ids === array('')) {
177
  $pagelink = $this->object->set_param_for($pagelink, 'album', 'all');
178
  } else {
 
179
  $pagelink = $this->object->set_param_for($pagelink, 'album', 'album');
180
  }
181
  }
@@ -207,7 +420,12 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
207
  {
208
  $this->call_parent('enqueue_frontend_resources', $displayed_gallery);
209
  wp_enqueue_style('nextgen_basic_album_style', $this->object->get_static_url('photocrati-nextgen_basic_album#nextgen_basic_album.css'));
 
210
  wp_enqueue_script('jquery.dotdotdot', $this->object->get_static_url('photocrati-nextgen_basic_album#jquery.dotdotdot-1.5.7-packed.js'), array('jquery'));
 
 
 
 
211
  $this->enqueue_ngg_styles();
212
  }
213
  }
@@ -220,6 +438,7 @@ class A_NextGen_Basic_Album_Mapper extends Mixin
220
  // Set defaults for both display (album) types
221
  $settings = C_NextGen_Settings::get_instance();
222
  $this->object->_set_default_value($entity, 'settings', 'galleries_per_page', $settings->galPagedGalleries);
 
223
  $this->object->_set_default_value($entity, 'settings', 'disable_pagination', 0);
224
  $this->object->_set_default_value($entity, 'settings', 'template', '');
225
  // Thumbnail dimensions -- only used by extended albums
@@ -310,7 +529,7 @@ class Mixin_NextGen_Basic_Album_Form extends Mixin_Display_Type_Form
310
  {
311
  public function _get_field_names()
312
  {
313
- return array('nextgen_basic_album_gallery_display_type', 'nextgen_basic_templates_template');
314
  }
315
  /**
316
  * Renders the Gallery Display Type field
@@ -327,7 +546,11 @@ class Mixin_NextGen_Basic_Album_Form extends Mixin_Display_Type_Form
327
  */
328
  public function _render_nextgen_basic_album_galleries_per_page_field($display_type)
329
  {
330
- return $this->render_partial('photocrati-nextgen_basic_album#nextgen_basic_album_galleries_per_page', array('display_type_name' => $display_type->name, 'galleries_per_page_label' => __('Items per page', 'nggallery'), 'galleries_per_page_help' => __('Maximum number of galleries or sub-albums to appear on a single page', 'nggallery'), 'galleries_per_page' => $display_type->settings['galleries_per_page']), TRUE);
 
 
 
 
331
  }
332
  }
333
  class A_NextGen_Basic_Extended_Album_Form extends Mixin_NextGen_Basic_Album_Form
1
  <?php
2
+ class A_NextGen_Album_Breadcrumbs extends Mixin
3
+ {
4
+ public $breadcrumb_cache = array();
5
+ public function are_breadcrumbs_enabled($display_settings)
6
+ {
7
+ $retval = FALSE;
8
+ if (isset($display_settings['enable_breadcrumbs']) && $display_settings['enable_breadcrumbs']) {
9
+ $retval = TRUE;
10
+ } elseif (isset($display_settings['original_settings']) && $this->are_breadcrumbs_enabled($display_settings['original_settings'])) {
11
+ $retval = TRUE;
12
+ }
13
+ return $retval;
14
+ }
15
+ public function get_original_album_entities($display_settings)
16
+ {
17
+ $retval = array();
18
+ if (isset($display_settings['original_album_entities'])) {
19
+ $retval = $display_settings['original_album_entities'];
20
+ } elseif (isset($display_settings['original_settings']) && $this->get_original_album_entities($display_settings['original_settings'])) {
21
+ $retval = $this->get_original_album_entities($display_settings['original_settings']);
22
+ }
23
+ return $retval;
24
+ }
25
+ public function render_object()
26
+ {
27
+ $root_element = $this->call_parent('render_object');
28
+ if ($displayed_gallery = $this->object->get_param('displayed_gallery')) {
29
+ $ds = $displayed_gallery->display_settings;
30
+ if ($this->are_breadcrumbs_enabled($ds) && ($original_entities = $this->get_original_album_entities($ds))) {
31
+ $original_entities = $this->get_original_album_entities($ds);
32
+ if (!empty($ds['original_album_id'])) {
33
+ $ids = $ds['original_album_id'];
34
+ } else {
35
+ $ids = $displayed_gallery->container_ids;
36
+ }
37
+ $breadcrumbs = $this->object->generate_breadcrumb($ids, $original_entities);
38
+ foreach ($root_element->find('nextgen_gallery.gallery_container', TRUE) as $container) {
39
+ $container->insert($breadcrumbs);
40
+ }
41
+ }
42
+ }
43
+ return $root_element;
44
+ }
45
+ public function render_legacy_template_breadcrumbs($displayed_gallery, $entities, $gallery_id = FALSE)
46
+ {
47
+ $ds = $displayed_gallery->display_settings;
48
+ if (!empty($entities) && !empty($ds['template']) && $this->are_breadcrumbs_enabled($ds)) {
49
+ if ($gallery_id) {
50
+ $ids = array($gallery_id);
51
+ } elseif (!empty($ds['original_album_id'])) {
52
+ $ids = $ds['original_album_id'];
53
+ } else {
54
+ $ids = $displayed_gallery->container_ids;
55
+ }
56
+ if (!empty($ds['original_album_entities'])) {
57
+ $breadcrumb_entities = $ds['original_album_entities'];
58
+ } else {
59
+ $breadcrumb_entities = $entities;
60
+ }
61
+ return $this->object->generate_breadcrumb($ids, $breadcrumb_entities);
62
+ } else {
63
+ return '';
64
+ }
65
+ }
66
+ public function find_gallery_parent($gallery_id, $sortorder)
67
+ {
68
+ $map = C_Album_Mapper::get_instance();
69
+ $found = array();
70
+ foreach ($sortorder as $order) {
71
+ if (strpos($order, 'a') === 0) {
72
+ $album_id = ltrim($order, 'a');
73
+ if (empty($this->breadcrumb_cache[$order])) {
74
+ $album = $map->find($album_id);
75
+ $this->breadcrumb_cache[$order] = $album;
76
+ if (in_array($gallery_id, $album->sortorder)) {
77
+ $found[] = $album;
78
+ break;
79
+ } else {
80
+ $found = $this->find_gallery_parent($gallery_id, $album->sortorder, $found);
81
+ if ($found) {
82
+ $found[] = $album;
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ return $found;
89
+ }
90
+ public function generate_breadcrumb($gallery_id = NULL, $entities)
91
+ {
92
+ $found = array();
93
+ $router = C_Router::get_instance();
94
+ $app = $router->get_routed_app();
95
+ if (is_array($gallery_id)) {
96
+ $gallery_id = array_shift($gallery_id);
97
+ }
98
+ foreach ($entities as $ndx => $entity) {
99
+ $tmpid = (isset($entity->albumdesc) ? 'a' : '') . $entity->{$entity->id_field};
100
+ $this->breadcrumb_cache[$tmpid] = $entity;
101
+ if (isset($entity->albumdesc) && in_array($gallery_id, $entity->sortorder)) {
102
+ $found[] = $entity;
103
+ break;
104
+ }
105
+ }
106
+ if (empty($found)) {
107
+ foreach ($entities as $entity) {
108
+ if (!empty($entity->sortorder)) {
109
+ $found = $this->object->find_gallery_parent($gallery_id, $entity->sortorder);
110
+ }
111
+ if (!empty($found)) {
112
+ $found[] = $entity;
113
+ break;
114
+ }
115
+ }
116
+ }
117
+ $found = array_reverse($found);
118
+ if (strpos($gallery_id, 'a') === 0) {
119
+ $album_found = FALSE;
120
+ foreach ($found as $found_item) {
121
+ if ($found_item->{$found_item->id_field} == $gallery_id) {
122
+ $album_found = TRUE;
123
+ }
124
+ }
125
+ if (!$album_found) {
126
+ $album_id = ltrim($gallery_id, 'a');
127
+ $album = C_Album_Mapper::get_instance()->find($album_id);
128
+ $found[] = $album;
129
+ $this->breadcrumb_cache[$gallery_id] = $album;
130
+ }
131
+ } else {
132
+ $gallery_found = FALSE;
133
+ foreach ($entities as $entity) {
134
+ if (isset($entity->is_gallery) && $entity->is_gallery && $gallery_id == $entity->{$entity->id_field}) {
135
+ $gallery_found = TRUE;
136
+ $found[] = $entity;
137
+ break;
138
+ }
139
+ }
140
+ if (!$gallery_found) {
141
+ $gallery = C_Gallery_Mapper::get_instance()->find($gallery_id);
142
+ $found[] = $gallery;
143
+ $this->breadcrumb_cache[$gallery->{$gallery->id_field}] = $gallery;
144
+ }
145
+ }
146
+ $crumbs = array();
147
+ if (!empty($found)) {
148
+ $end = end($found);
149
+ reset($found);
150
+ foreach ($found as $found_item) {
151
+ $type = isset($found_item->albumdesc) ? 'album' : 'gallery';
152
+ $id = ($type == 'album' ? 'a' : '') . $found_item->{$found_item->id_field};
153
+ $entity = $this->breadcrumb_cache[$id];
154
+ $link = NULL;
155
+ if ($type == 'album') {
156
+ $name = $entity->name;
157
+ if ($entity->pageid > 0) {
158
+ $link = @get_page_link($entity->pageid);
159
+ }
160
+ if (empty($link) && $found_item !== $end) {
161
+ $link = $app->get_routed_url();
162
+ $link = $app->strip_param_segments($link);
163
+ $link = $app->set_parameter_value('album', $entity->slug, NULL, FALSE, $link);
164
+ }
165
+ } else {
166
+ $name = $entity->title;
167
+ }
168
+ $crumbs[] = array('type' => $type, 'name' => $name, 'url' => $link);
169
+ }
170
+ }
171
+ // free this memory immediately
172
+ $this->breadcrumb_cache = array();
173
+ $view = new C_MVC_View('photocrati-nextgen_basic_album#breadcrumbs', array('breadcrumbs' => $crumbs, 'divisor' => apply_filters('ngg_breadcrumb_separator', ' &raquo; ')));
174
+ return $view->render(TRUE);
175
+ }
176
+ }
177
  /**
178
  * Provides validation for NextGen Basic Albums
179
  */
211
  // a parent_id, which is the album that it belongs to. We need to do this
212
  // because the link to the gallery, is not /nggallery/gallery--id, but
213
  // /nggallery/album--id/gallery--id
214
+ $parent_albums = $displayed_gallery->get_albums();
215
+ // Are we to display a gallery? Ensure our 'gallery' isn't just a paginated album view
216
+ $gallery = $gallery_slug = $this->param('gallery');
217
+ if ($gallery && strpos($gallery, 'nggpage--') !== 0) {
218
  // basic albums only support one per post
219
  if (isset($GLOBALS['nggShowGallery'])) {
220
  return;
228
  $gallery = $result->{$result->id_field};
229
  }
230
  $renderer = C_Displayed_Gallery_Renderer::get_instance('inner');
231
+ $gallery_params = array('source' => 'galleries', 'container_ids' => array($gallery), 'display_type' => $display_settings['gallery_display_type'], 'original_display_type' => $displayed_gallery->display_type, 'original_settings' => $display_settings, 'original_album_entities' => $parent_albums);
232
  if (!empty($display_settings['gallery_display_template'])) {
233
  $gallery_params['template'] = $display_settings['gallery_display_template'];
234
  }
235
+ add_filter('ngg_displayed_gallery_rendering', array($this, 'add_breadcrumbs_to_legacy_templates'), 10, 2);
236
+ $output = $renderer->display_images($gallery_params, $return);
237
+ remove_filter('ngg_displayed_gallery_rendering', array($this, 'add_breadcrumbs_to_legacy_templates'));
238
+ return $output;
239
  } else {
240
  if ($album = $this->param('album')) {
241
  $mapper = C_Album_Mapper::get_instance();
247
  $displayed_gallery->entity_ids = array();
248
  $displayed_gallery->sortorder = array();
249
  $displayed_gallery->container_ids = ($album === '0' or $album === 'all') ? array() : array($album);
250
+ $displayed_gallery->display_settings['original_album_id'] = 'a' . $album_sub;
251
+ $displayed_gallery->display_settings['original_album_entities'] = $parent_albums;
252
  }
253
  }
254
  // Get the albums
255
  // TODO: This should probably be moved to the elseif block above
256
  $this->albums = $displayed_gallery->get_albums();
257
  // None of the above: Display the main album. Get the settings required for display
258
+ $current_page = (int) $this->param('page', $displayed_gallery->id(), 1);
259
  $offset = $display_settings['galleries_per_page'] * ($current_page - 1);
260
  $entities = $displayed_gallery->get_included_entities($display_settings['galleries_per_page'], $offset);
261
  // If there are entities to be displayed
262
  if ($entities) {
263
+ $pagination_result = $this->object->create_pagination($current_page, $displayed_gallery->get_entity_count(), $display_settings['galleries_per_page'], urldecode($this->object->param('ajax_pagination_referrer')));
264
  if (!empty($display_settings['template'])) {
265
  // Add additional parameters
 
266
  $this->object->remove_param('ajax_pagination_referrer');
267
  $display_settings['current_page'] = $current_page;
268
  $display_settings['entities'] =& $entities;
269
  $display_settings['pagination_prev'] = $pagination_result['prev'];
270
  $display_settings['pagination_next'] = $pagination_result['next'];
271
  $display_settings['pagination'] = $pagination_result['output'];
272
+ $this->object->add_mixin('A_NextGen_Album_Breadcrumbs');
273
+ $breadcrumbs = $this->object->render_legacy_template_breadcrumbs($displayed_gallery, $entities);
274
  // Render legacy template
275
  $this->object->add_mixin('Mixin_NextGen_Basic_Templates');
276
  $display_settings = $this->prepare_legacy_album_params($displayed_gallery->get_entity(), $display_settings);
277
+ $retval = $this->object->legacy_render($display_settings['template'], $display_settings, $return, 'album');
278
+ if (!empty($breadcrumbs)) {
279
+ $retval = $breadcrumbs . $retval;
280
+ }
281
+ return $retval;
282
  } else {
283
  $params = $display_settings;
284
  $albums = $this->prepare_legacy_album_params($displayed_gallery->get_entity(), array('entities' => $entities));
285
+ $params['pagination'] = $pagination_result['output'];
286
  $params['image_gen_params'] = $albums['image_gen_params'];
287
  $params['galleries'] = $albums['galleries'];
288
  $params['displayed_gallery'] = $displayed_gallery;
301
  return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return);
302
  }
303
  }
304
+ public function add_breadcrumbs_to_legacy_templates($html, $displayed_gallery)
305
+ {
306
+ $this->object->add_mixin('A_NextGen_Album_Breadcrumbs');
307
+ $original_album_entities = array();
308
+ if (isset($displayed_gallery->display_settings['original_album_entities'])) {
309
+ $original_album_entities = $displayed_gallery->display_settings['original_album_entities'];
310
+ } elseif (isset($displayed_gallery->display_settings['original_settings']) && isset($displayed_gallery->display_settings['original_settings']['original_album_entities'])) {
311
+ $original_album_entities = $displayed_gallery->display_settings['original_settings']['original_album_entities'];
312
+ }
313
+ $breadcrumbs = $this->object->render_legacy_template_breadcrumbs($displayed_gallery, $original_album_entities, $displayed_gallery->conatiner_ids);
314
+ if (!empty($breadcrumbs)) {
315
+ $html = $breadcrumbs . $html;
316
+ }
317
+ return $html;
318
+ }
319
  /**
320
  * Gets the parent album for the entity being displayed
321
  * @param int $entity_id
365
  if ($gallery->pageid > 0) {
366
  $gallery->pagelink = @get_page_link($gallery->pageid);
367
  } else {
368
+ $pagelink = $this->object->get_routed_url(TRUE);
369
+ $pagelink = $this->object->remove_param_for($pagelink, 'album');
370
+ $pagelink = $this->object->remove_param_for($pagelink, 'gallery');
371
+ $pagelink = $this->object->remove_param_for($pagelink, 'nggpage');
372
+ $pagelink = $this->object->set_param_for($pagelink, 'album', $gallery->slug);
373
+ $gallery->pagelink = $pagelink;
374
  }
375
  } else {
376
  if ($gallery->pageid > 0) {
380
  $pagelink = $this->object->get_routed_url(TRUE);
381
  $parent_album = $this->object->get_parent_album_for($gallery->{$id_field});
382
  if ($parent_album) {
383
+ $pagelink = $this->object->remove_param_for($pagelink, 'album');
384
+ $pagelink = $this->object->remove_param_for($pagelink, 'gallery');
385
+ $pagelink = $this->object->remove_param_for($pagelink, 'nggpage');
386
  $pagelink = $this->object->set_param_for($pagelink, 'album', $parent_album->slug);
387
  } else {
388
  if ($displayed_gallery->container_ids === array('0') || $displayed_gallery->container_ids === array('')) {
389
  $pagelink = $this->object->set_param_for($pagelink, 'album', 'all');
390
  } else {
391
+ $pagelink = $this->object->remove_param_for($pagelink, 'nggpage');
392
  $pagelink = $this->object->set_param_for($pagelink, 'album', 'album');
393
  }
394
  }
420
  {
421
  $this->call_parent('enqueue_frontend_resources', $displayed_gallery);
422
  wp_enqueue_style('nextgen_basic_album_style', $this->object->get_static_url('photocrati-nextgen_basic_album#nextgen_basic_album.css'));
423
+ wp_enqueue_style('nextgen_pagination_style', $this->get_static_url('photocrati-nextgen_pagination#style.css'));
424
  wp_enqueue_script('jquery.dotdotdot', $this->object->get_static_url('photocrati-nextgen_basic_album#jquery.dotdotdot-1.5.7-packed.js'), array('jquery'));
425
+ $ds = $displayed_gallery->display_settings;
426
+ if (!empty($ds['enable_breadcrumbs']) && $ds['enable_breadcrumbs'] || !empty($ds['original_settings']['enable_breadcrumbs']) && $ds['original_settings']['enable_breadcrumbs']) {
427
+ wp_enqueue_style('nextgen_basic_album_breadcrumbs_style', $this->object->get_static_url('photocrati-nextgen_basic_album#breadcrumbs.css'));
428
+ }
429
  $this->enqueue_ngg_styles();
430
  }
431
  }
438
  // Set defaults for both display (album) types
439
  $settings = C_NextGen_Settings::get_instance();
440
  $this->object->_set_default_value($entity, 'settings', 'galleries_per_page', $settings->galPagedGalleries);
441
+ $this->object->_set_default_value($entity, 'settings', 'enable_breadcrumbs', 1);
442
  $this->object->_set_default_value($entity, 'settings', 'disable_pagination', 0);
443
  $this->object->_set_default_value($entity, 'settings', 'template', '');
444
  // Thumbnail dimensions -- only used by extended albums
529
  {
530
  public function _get_field_names()
531
  {
532
+ return array('nextgen_basic_album_gallery_display_type', 'nextgen_basic_album_galleries_per_page', 'nextgen_basic_album_enable_breadcrumbs', 'nextgen_basic_templates_template');
533
  }
534
  /**
535
  * Renders the Gallery Display Type field
546
  */
547
  public function _render_nextgen_basic_album_galleries_per_page_field($display_type)
548
  {
549
+ return $this->_render_number_field($display_type, 'galleries_per_page', __('Items per page', 'nggallery'), $display_type->settings['galleries_per_page'], __('Maximum number of galleries or sub-albums to appear on a single page', 'nggallery'), FALSE, '', 0);
550
+ }
551
+ public function _render_nextgen_basic_album_enable_breadcrumbs_field($display_type)
552
+ {
553
+ return $this->_render_radio_field($display_type, 'enable_breadcrumbs', __('Enable breadcrumbs', 'nggallery'), isset($display_type->settings['enable_breadcrumbs']) ? $display_type->settings['enable_breadcrumbs'] : FALSE);
554
  }
555
  }
556
  class A_NextGen_Basic_Extended_Album_Form extends Mixin_NextGen_Basic_Album_Form
products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.css ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ngg-breadcrumbs {
2
+ list-style: none;
3
+ overflow: hidden;
4
+ margin: 0;
5
+ padding: .5em 0 .5em 0;
6
+ }
7
+
8
+ .ngg-breadcrumbs li {
9
+ float: left;
10
+ padding: 0 .3em 0 .15em;
11
+ margin: 0;
12
+ vertical-align: middle;
13
+ border: none;
14
+ list-style-type: none;
15
+ }
16
+
17
+ .ngg-breadcrumbs li a {
18
+ }
19
+
20
+ .ngg-breadcrumbs .ngg-breadcrumb-divisor {
21
+ margin: 0;
22
+ padding: 0 0 0 .15em;
23
+ }
products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .ngg-breadcrumbs{list-style:none;overflow:hidden;margin:0;padding:.5em 0 .5em 0}.ngg-breadcrumbs li{float:left;padding:0 .3em 0 .15em;margin:0;vertical-align:middle;border:0;list-style-type:none}.ngg-breadcrumbs .ngg-breadcrumb-divisor{margin:0;padding:0 0 0 .15em}
products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.css CHANGED
@@ -120,4 +120,4 @@
120
  .ngg-clear {
121
  clear: both;
122
  float: none;
123
- }
120
  .ngg-clear {
121
  clear: both;
122
  float: none;
123
+ }
products/photocrati_nextgen/modules/nextgen_basic_album/templates/breadcrumbs.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul class="ngg-breadcrumbs">
2
+ <?php
3
+ $end = end($breadcrumbs);
4
+ reset($breadcrumbs);
5
+ foreach ($breadcrumbs as $crumb) { ?>
6
+ <li class="ngg-breadcrumb">
7
+ <?php if (!is_null($crumb['url'])) { ?>
8
+ <a href="<?php echo $crumb['url']; ?>"><?php esc_html_e($crumb['name']); ?></a>
9
+ <?php } else { ?>
10
+ <?php esc_html_e($crumb['name']); ?>
11
+ <?php } ?>
12
+ <?php if ($crumb !== $end) { ?>
13
+ <span class="ngg-breadcrumb-divisor"><?php echo $divisor; ?></span>
14
+ <?php } ?>
15
+ </li>
16
+ <?php } ?>
17
+ </ul>
products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php CHANGED
@@ -34,5 +34,6 @@
34
  </div>
35
  <?php } ?>
36
  <br class="ngg-clear"/>
 
37
  </div>
38
  <?php $this->end_element(); ?>
34
  </div>
35
  <?php } ?>
36
  <br class="ngg-clear"/>
37
+ <?php echo $pagination ?>
38
  </div>
39
  <?php $this->end_element(); ?>
products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php CHANGED
@@ -18,5 +18,6 @@
18
  </div>
19
  </div>
20
  <?php } ?>
 
21
  </div>
22
  <?php $this->end_element(); ?>
18
  </div>
19
  </div>
20
  <?php } ?>
21
+ <?php echo $pagination ?>
22
  </div>
23
  <?php $this->end_element(); ?>
products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_galleries_per_page.php DELETED
@@ -1,19 +0,0 @@
1
- <tr>
2
- <td>
3
- <label class="tooltip"
4
- for="<?php esc_attr_e($display_type_name)?>_galleries_per_page"
5
- title="<?php esc_attr_e($galleries_per_page_help)?>">
6
- <?php esc_html_e($galleries_per_page_label) ?>
7
- </label>
8
- </td>
9
- <td>
10
- <input
11
- id="<?php esc_attr_e($display_type_name)?>_galleries_per_page"
12
- name="<?php esc_attr_e($display_type_name) ?>[galleries_per_page]"
13
- type="number"
14
- min="0"
15
- value="<?php esc_attr_e($galleries_per_page)?>"
16
- placeholder="#"
17
- />
18
- </td>
19
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php CHANGED
@@ -43,8 +43,6 @@ class M_NextGen_Basic_Gallery extends C_Base_Module
43
  $forms->add_form(NGG_DISPLAY_SETTINGS_SLUG, NGG_BASIC_SLIDESHOW);
44
  }
45
 
46
- $notices = C_Admin_Notification_Manager::get_instance();
47
- $notices->add('image_rotator_notice', 'C_Image_Rotator_Notice');
48
  }
49
 
50
  function get_type_list()
@@ -342,36 +340,4 @@ class C_NextGen_Basic_Gallery_Installer extends C_Gallery_Display_Installer
342
  }
343
  }
344
 
345
- class C_Image_Rotator_Notice
346
- {
347
- static $_instance = NULL;
348
- static function get_instance($name)
349
- {
350
- if (!self::$_instance) {
351
- $klass = get_class();
352
- self::$_instance = new $klass($name);
353
- }
354
- return self::$_instance;
355
- }
356
-
357
- function __construct($name)
358
- {
359
- $this->name = $name;
360
- }
361
-
362
- function render()
363
- {
364
- $link = 'http://www.nextgen-gallery.com/flash-removed';
365
- return sprintf(
366
- __("Flash slideshow support has been removed from NextGEN Gallery. Please see <a href='%s'>this blog post</a> for more information.", 'nggallery'),
367
- $link
368
- );
369
- }
370
-
371
- function is_dismissable()
372
- {
373
- return TRUE;
374
- }
375
- }
376
-
377
  new M_NextGen_Basic_Gallery;
43
  $forms->add_form(NGG_DISPLAY_SETTINGS_SLUG, NGG_BASIC_SLIDESHOW);
44
  }
45
 
 
 
46
  }
47
 
48
  function get_type_list()
340
  }
341
  }
342
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  new M_NextGen_Basic_Gallery;
products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php CHANGED
@@ -21,7 +21,7 @@ class A_NextGen_Basic_Gallery_Controller extends Mixin
21
  $displayed_gallery->original_settings = $displayed_gallery->display_settings;
22
  $displayed_gallery->display_type = $show;
23
  $params = (array) $displayed_gallery->get_entity();
24
- unset($params['display_settings']);
25
  $retval = $renderer->display_images($params, $return);
26
  $call_parent = FALSE;
27
  }
21
  $displayed_gallery->original_settings = $displayed_gallery->display_settings;
22
  $displayed_gallery->display_type = $show;
23
  $params = (array) $displayed_gallery->get_entity();
24
+ $params['display_settings'] = array();
25
  $retval = $renderer->display_images($params, $return);
26
  $call_parent = FALSE;
27
  }
products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.js CHANGED
@@ -1,48 +1,50 @@
1
- jQuery(function($){
2
- var imagebrowser_links = $('a.use_imagebrowser_effect');
3
-
4
- imagebrowser_links.click(function(e){
5
- e.preventDefault();
6
-
7
- var success = true;
8
- var $this = $(this);
9
- var image_id = $this.attr('data-image-id');
10
- var image_slug = $this.attr('data-image-slug');
11
-
12
- var url = window.location.toString();
13
- url = url.split('/'+photocrati_ajax.ngg_param_slug+'/').shift();
14
- if(url.substr(-1) == '/') url = url.substr(0, url.length - 1);
15
-
16
- image_id = image_slug ? image_slug : image_id;
17
- try {
18
- if (!image_id) image_id = parseInt($this.parents('.ngg-gallery-thumbnail-box').attr('id').match(/\d+/).join(''));
19
- }
20
- catch (ex) {
21
- success = false;
22
- }
23
-
24
- if (success) {
25
- // Custom permalinks are disabled. So we have to redirect to /index.php/nggallery/image/n?qs=1
26
- if (photocrati_ajax.wp_root_url.indexOf('index.php') >= 0) {
27
- url = photocrati_ajax.wp_root_url + "/"+photocrati_ajax.ngg_param_slug+"/image/"+image_id;
28
- if(window.location.toString().indexOf('?') >= 0) url += '?'+window.location.toString().split('?').pop();
29
  }
30
 
31
- // Just append the slug
32
- else url += "/"+photocrati_ajax.ngg_param_slug+"/image/"+image_id;
33
-
34
- window.location = url;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
- });
37
-
38
- // Unregister any onclick handlers added after the above has executed to avoid conflicts
39
- if (imagebrowser_links.length > 0) {
40
- setTimeout(function(){
41
- imagebrowser_links.each(function(){
42
- this.onclick = null;
43
- });
44
- }, 200);
45
- }
46
 
 
 
47
  });
48
-
1
+ jQuery(function($) {
2
+ var ngg_imagebrowser_init = function() {
3
+ var imagebrowser_links = $('a.use_imagebrowser_effect');
4
+ imagebrowser_links.click(function(e) {
5
+ e.preventDefault();
6
+ var success = true;
7
+ var $this = $(this);
8
+ var image_id = $this.attr('data-image-id');
9
+ var image_slug = $this.attr('data-image-slug');
10
+
11
+ var url = window.location.toString();
12
+ url = url.split('/' + photocrati_ajax.ngg_param_slug + '/').shift();
13
+ if (url.substr(-1) == '/')
14
+ url = url.substr(0, url.length - 1);
15
+
16
+ image_id = image_slug ? image_slug : image_id;
17
+ try {
18
+ if (!image_id)
19
+ image_id = parseInt($this.parents('.ngg-gallery-thumbnail-box').attr('id').match(/\d+/).join(''));
20
+ } catch (ex) {
21
+ success = false;
 
 
 
 
 
 
 
22
  }
23
 
24
+ if (success) {
25
+ // Custom permalinks are disabled. So we have to redirect to /index.php/nggallery/image/n?qs=1
26
+ if (photocrati_ajax.wp_root_url.indexOf('index.php') >= 0) {
27
+ url = photocrati_ajax.wp_root_url + "/" + photocrati_ajax.ngg_param_slug + "/image/" + image_id;
28
+ if (window.location.toString().indexOf('?') >= 0)
29
+ url += '?'+window.location.toString().split('?').pop();
30
+ } else {
31
+ // Just append the slug
32
+ url += "/"+photocrati_ajax.ngg_param_slug+"/image/"+image_id;
33
+ }
34
+ window.location = url;
35
+ }
36
+ });
37
+
38
+ // Unregister any onclick handlers added after the above has executed to avoid conflicts
39
+ if (imagebrowser_links.length > 0) {
40
+ setTimeout(function() {
41
+ imagebrowser_links.each(function() {
42
+ this.onclick = null;
43
+ });
44
+ }, 200);
45
  }
46
+ };
 
 
 
 
 
 
 
 
 
47
 
48
+ $(this).bind('refreshed', ngg_imagebrowser_init);
49
+ ngg_imagebrowser_init();
50
  });
 
products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.min.js CHANGED
@@ -1 +1 @@
1
- eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('A(c($){4 8=$(\'a.B\');8.C(c(e){e.v();4 i=u;4 $5=$(5);4 3=$5.j(\'q-b-n\');4 k=$5.j(\'q-b-D\');4 2=9.f.h();2=2.p(\'/\'+7.g+\'/\').z();6(2.o(-1)==\'/\')2=2.o(0,2.r-1);3=k?k:3;y{6(!3)3=x($5.t(\'.s-w-E-I\').j(\'n\').Q(/\\d+/).P(\'\'))}S(T){i=F}6(i){6(7.m.l(\'N.O\')>=0){2=7.m+"/"+7.g+"/b/"+3;6(9.f.h().l(\'?\')>=0)2+=\'?\'+9.f.h().p(\'?\').H()}G 2+="/"+7.g+"/b/"+3;9.f=2}});6(8.r>0){J(c(){8.K(c(){5.M=L})},R)}});',56,56,'||url|image_id|var|this|if|photocrati_ajax|imagebrowser_links|window||image|function|||location|ngg_param_slug|toString|success|attr|image_slug|indexOf|wp_root_url|id|substr|split|data|length|ngg|parents|true|preventDefault|gallery|parseInt|try|shift|jQuery|use_imagebrowser_effect|click|slug|thumbnail|false|else|pop|box|setTimeout|each|null|onclick|index|php|join|match|200|catch|ex'.split('|'),0,{}))
1
+ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('C(8($){4 i=8(){4 f=$(\'a.B\');f.A(8(e){e.D();4 l=E;4 $5=$(5);4 3=$5.k(\'m-c-r\');4 h=$5.k(\'m-c-z\');4 2=b.9.g();2=2.q(\'/\'+7.j+\'/\').H();6(2.p(-1)==\'/\')2=2.p(0,2.s-1);3=h?h:3;t{6(!3)3=v($5.x(\'.y-w-G-L\').k(\'r\').T(/\\d+/).V(\'\'))}U(W){l=S}6(l){6(7.o.n(\'R.K\')>=0){2=7.o+"/"+7.j+"/c/"+3;6(b.9.g().n(\'?\')>=0)2+=\'?\'+b.9.g().q(\'?\').M()}N{2+="/"+7.j+"/c/"+3}b.9=2}});6(f.s>0){O(8(){f.P(8(){5.J=Q})},I)}};$(5).u(\'F\',i);i()});',59,59,'||url|image_id|var|this|if|photocrati_ajax|function|location||window|image|||imagebrowser_links|toString|image_slug|ngg_imagebrowser_init|ngg_param_slug|attr|success|data|indexOf|wp_root_url|substr|split|id|length|try|bind|parseInt|gallery|parents|ngg|slug|click|use_imagebrowser_effect|jQuery|preventDefault|true|refreshed|thumbnail|shift|200|onclick|php|box|pop|else|setTimeout|each|null|index|false|match|catch|join|ex'.split('|'),0,{}))
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/package.module.nextgen_basic_tagcloud.php CHANGED
@@ -20,7 +20,7 @@ class A_NextGen_Basic_Tagcloud_Controller extends Mixin
20
  {
21
  $display_settings = $displayed_gallery->display_settings;
22
  $application = C_Router::get_instance()->get_routed_app();
23
- $tag = $this->param('gallerytag');
24
  // we're looking at a tag, so show images w/that tag as a thumbnail gallery
25
  if (!is_home() && !empty($tag)) {
26
  return C_Displayed_Gallery_Renderer::get_instance()->display_images(array('source' => 'tags', 'container_ids' => array(esc_attr($tag)), 'display_type' => $display_settings['display_type'], 'original_display_type' => $displayed_gallery->display_type, 'original_settings' => $display_settings));
@@ -63,6 +63,15 @@ class A_NextGen_Basic_Tagcloud_Form extends Mixin_Display_Type_Form
63
  {
64
  return array('nextgen_basic_tagcloud_number', 'nextgen_basic_tagcloud_display_type');
65
  }
 
 
 
 
 
 
 
 
 
66
  public function _render_nextgen_basic_tagcloud_number_field($display_type)
67
  {
68
  return $this->_render_number_field($display_type, 'number', __('Maximum number of tags', 'nggallery'), $display_type->settings['number']);
@@ -70,14 +79,15 @@ class A_NextGen_Basic_Tagcloud_Form extends Mixin_Display_Type_Form
70
  public function _render_nextgen_basic_tagcloud_display_type_field($display_type)
71
  {
72
  $types = array();
73
- $skip_types = array('photocrati-nextgen_basic_tagcloud', 'photocrati-nextgen_basic_singlepic');
 
74
  $mapper = C_Display_Type_Mapper::get_instance();
75
  $display_types = $mapper->find_all();
76
  foreach ($display_types as $dt) {
77
  if (in_array($dt->name, $skip_types)) {
78
  continue;
79
  }
80
- $types[$dt->name] = str_replace('NextGEN Basic ', '', $dt->title);
81
  }
82
  return $this->_render_select_field($display_type, 'display_type', __('Display type', 'nggallery'), $types, $display_type->settings['display_type'], __('The display type that the tagcloud will point its results to', 'nggallery'));
83
  }
@@ -164,11 +174,11 @@ class C_Taxonomy_Controller extends C_MVC_Controller
164
  */
165
  public function index_action($tag)
166
  {
167
- $renderer = C_Displayed_Gallery_Renderer::get_instance();
168
- $output = $renderer->display_images(array('source' => 'tags', 'container_ids' => $tag, 'slug' => $tag, 'display_type' => NGG_BASIC_THUMBNAILS));
169
- // This strips extra whitespace and strips newlines. For some reason this is especially
170
- // necessary on Wordpress taxonomy pages.
171
- return trim(preg_replace('/\\s\\s+/', ' ', $output));
172
  }
173
  /**
174
  * Determines if the current page is /ngg_tag/{*}
@@ -186,13 +196,15 @@ class C_Taxonomy_Controller extends C_MVC_Controller
186
  $wp_query = $wp_query_local;
187
  }
188
  // This appears to be necessary for multisite installations, but I can't imagine why. More hackery..
189
- $tag = get_query_var('ngg_tag') ? get_query_var('ngg_tag') : get_query_var('name');
190
  if (!$this->ngg_tag_detection_has_run && !is_admin() && !empty($tag) && (stripos($wp->request, 'ngg_tag') === 0 || isset($wp_query->query_vars['page_id']) && $wp_query->query_vars['page_id'] === 'ngg_tag')) {
191
  $this->ngg_tag_detection_has_run = TRUE;
192
  // Wordpress somewhat-correctly generates several notices, so silence them as they're really unnecessary
193
  if (!defined('WP_DEBUG') || !WP_DEBUG) {
194
  error_reporting(0);
195
  }
 
 
196
  // create in-code a fake post; we feed it back to Wordpress as the sole result of the "the_posts" filter
197
  $posts = NULL;
198
  $posts[] = $this->create_ngg_tag_post($tag);
@@ -212,15 +224,17 @@ class C_Taxonomy_Controller extends C_MVC_Controller
212
  }
213
  public function create_ngg_tag_post($tag)
214
  {
 
 
215
  $post = new stdClass();
216
  $post->post_author = FALSE;
217
  $post->post_name = 'ngg_tag';
218
  $post->guid = get_bloginfo('wpurl') . '/' . 'ngg_tag';
219
- $post->post_title = "Images tagged &quot;{$tag}&quot;";
220
  $post->post_content = $this->index_action($tag);
221
  $post->ID = FALSE;
222
  $post->post_type = 'page';
223
- $post->post_status = 'static';
224
  $post->comment_status = 'closed';
225
  $post->ping_status = 'closed';
226
  $post->comment_count = 0;
20
  {
21
  $display_settings = $displayed_gallery->display_settings;
22
  $application = C_Router::get_instance()->get_routed_app();
23
+ $tag = urldecode($this->param('gallerytag'));
24
  // we're looking at a tag, so show images w/that tag as a thumbnail gallery
25
  if (!is_home() && !empty($tag)) {
26
  return C_Displayed_Gallery_Renderer::get_instance()->display_images(array('source' => 'tags', 'container_ids' => array(esc_attr($tag)), 'display_type' => $display_settings['display_type'], 'original_display_type' => $displayed_gallery->display_type, 'original_settings' => $display_settings));
63
  {
64
  return array('nextgen_basic_tagcloud_number', 'nextgen_basic_tagcloud_display_type');
65
  }
66
+ public function enqueue_static_resources()
67
+ {
68
+ $path = 'photocrati-nextgen_basic_tagcloud#settings.css';
69
+ wp_enqueue_style('nextgen_basic_tagcloud_settings-css', $this->get_static_url($path));
70
+ $atp = C_Attach_Controller::get_instance();
71
+ if (!is_null($atp)) {
72
+ $atp->mark_script($path);
73
+ }
74
+ }
75
  public function _render_nextgen_basic_tagcloud_number_field($display_type)
76
  {
77
  return $this->_render_number_field($display_type, 'number', __('Maximum number of tags', 'nggallery'), $display_type->settings['number']);
79
  public function _render_nextgen_basic_tagcloud_display_type_field($display_type)
80
  {
81
  $types = array();
82
+ $skip_types = array(NGG_BASIC_TAGCLOUD, NGG_BASIC_SINGLEPIC, NGG_BASIC_COMPACT_ALBUM, NGG_BASIC_EXTENDED_ALBUM);
83
+ $skip_types = apply_filters('ngg_basic_tagcloud_excluded_display_types', $skip_types);
84
  $mapper = C_Display_Type_Mapper::get_instance();
85
  $display_types = $mapper->find_all();
86
  foreach ($display_types as $dt) {
87
  if (in_array($dt->name, $skip_types)) {
88
  continue;
89
  }
90
+ $types[$dt->name] = $dt->title;
91
  }
92
  return $this->_render_select_field($display_type, 'display_type', __('Display type', 'nggallery'), $types, $display_type->settings['display_type'], __('The display type that the tagcloud will point its results to', 'nggallery'));
93
  }
174
  */
175
  public function index_action($tag)
176
  {
177
+ $mapper = C_Display_Type_Mapper::get_instance();
178
+ // Respect the global display type setting
179
+ $display_type = $mapper->find_by_name(NGG_BASIC_TAGCLOUD, TRUE);
180
+ $display_type = !empty($display_type->settings['display_type']) ? $display_type->settings['display_type'] : NGG_BASIC_THUMBNAILS;
181
+ return "[ngg_images source='tags' container_ids='{$tag}' slug='{$tag}' display_type='{$display_type}']";
182
  }
183
  /**
184
  * Determines if the current page is /ngg_tag/{*}
196
  $wp_query = $wp_query_local;
197
  }
198
  // This appears to be necessary for multisite installations, but I can't imagine why. More hackery..
199
+ $tag = urldecode(get_query_var('ngg_tag') ? get_query_var('ngg_tag') : get_query_var('name'));
200
  if (!$this->ngg_tag_detection_has_run && !is_admin() && !empty($tag) && (stripos($wp->request, 'ngg_tag') === 0 || isset($wp_query->query_vars['page_id']) && $wp_query->query_vars['page_id'] === 'ngg_tag')) {
201
  $this->ngg_tag_detection_has_run = TRUE;
202
  // Wordpress somewhat-correctly generates several notices, so silence them as they're really unnecessary
203
  if (!defined('WP_DEBUG') || !WP_DEBUG) {
204
  error_reporting(0);
205
  }
206
+ // Without this all url generated from this page lacks the /ngg_tag/(slug) section of the URL
207
+ add_filter('ngg_wprouting_add_post_permalink', '__return_false');
208
  // create in-code a fake post; we feed it back to Wordpress as the sole result of the "the_posts" filter
209
  $posts = NULL;
210
  $posts[] = $this->create_ngg_tag_post($tag);
224
  }
225
  public function create_ngg_tag_post($tag)
226
  {
227
+ $title = sprintf(__('Images tagged &quot;%s&quot;', 'nggallery'), $tag);
228
+ $title = apply_filters('ngg_basic_tagcloud_title', $title, $tag);
229
  $post = new stdClass();
230
  $post->post_author = FALSE;
231
  $post->post_name = 'ngg_tag';
232
  $post->guid = get_bloginfo('wpurl') . '/' . 'ngg_tag';
233
+ $post->post_title = $title;
234
  $post->post_content = $this->index_action($tag);
235
  $post->ID = FALSE;
236
  $post->post_type = 'page';
237
+ $post->post_status = 'publish';
238
  $post->comment_status = 'closed';
239
  $post->ping_status = 'closed';
240
  $post->comment_count = 0;
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/settings.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ select#photocrati-nextgen_basic_tagcloud_display_type {
2
+ width: 235px;
3
+ }
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/settings.min.css ADDED
@@ -0,0 +1 @@
 
1
+ select#photocrati-nextgen_basic_tagcloud_display_type{width:235px}
products/photocrati_nextgen/modules/nextgen_basic_templates/package.module.nextgen_basic_templates.php CHANGED
@@ -199,7 +199,7 @@ class Mixin_Legacy_Template_Locator extends Mixin
199
  */
200
  public function get_template_directories()
201
  {
202
- return array('Child Theme' => get_stylesheet_directory() . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR, 'Parent Theme' => get_template_directory() . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR, 'NextGEN' => NGGALLERY_ABSPATH . 'view' . DIRECTORY_SEPARATOR);
203
  }
204
  /**
205
  * Returns an array of all available template files
199
  */
200
  public function get_template_directories()
201
  {
202
+ return array('Child Theme' => get_stylesheet_directory() . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR, 'Parent Theme' => get_template_directory() . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR, 'NextGEN Legacy' => NGGALLERY_ABSPATH . 'view' . DIRECTORY_SEPARATOR, 'NextGEN Overrides' => implode(DIRECTORY_SEPARATOR, array(WP_CONTENT_DIR, 'ngg', 'legacy', 'templates')));
203
  }
204
  /**
205
  * Returns an array of all available template files
products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php CHANGED
@@ -197,7 +197,7 @@ class Mixin_Album_Mapper extends Mixin
197
  $retval = $this->call_parent('_save_entity', $entity);
198
  if ($retval) {
199
  do_action('ngg_album_updated', $entity);
200
- C_Photocrati_Cache::flush('displayed_gallery_rendering');
201
  }
202
  return $retval;
203
  }
@@ -354,7 +354,7 @@ class Mixin_Gallery_Mapper extends Mixin
354
  $retval = $this->call_parent('_save_entity', $entity);
355
  if ($retval) {
356
  do_action('ngg_created_new_gallery', $entity->{$entity->id_field});
357
- C_Photocrati_Cache::flush('displayed_gallery_rendering');
358
  }
359
  return $retval;
360
  }
@@ -384,7 +384,7 @@ class Mixin_Gallery_Mapper extends Mixin
384
  }
385
  if ($retval) {
386
  do_action('ngg_delete_gallery', $gallery);
387
- C_Photocrati_Cache::flush('displayed_gallery_rendering');
388
  }
389
  }
390
  return $retval;
@@ -515,7 +515,11 @@ class E_UploadException extends E_NggErrorException
515
  if (!$message) {
516
  $message = 'There was a problem uploading the file.';
517
  }
518
- parent::__construct($message, $code, $previous);
 
 
 
 
519
  }
520
  }
521
  class E_InsufficientWriteAccessException extends E_NggErrorException
@@ -542,7 +546,11 @@ class E_NoSpaceAvailableException extends E_NggErrorException
542
  if (!$message) {
543
  $message = 'You have exceeded your storage capacity. Please remove some files and try again.';
544
  }
545
- parent::__construct($message, $code, $previous);
 
 
 
 
546
  }
547
  }
548
  class E_No_Image_Library_Exception extends E_NggErrorException
@@ -552,7 +560,11 @@ class E_No_Image_Library_Exception extends E_NggErrorException
552
  if (!$message) {
553
  $message = 'The site does not support the GD Image library. Please ask your hosting provider to enable it.';
554
  }
555
- parent::__construct($message, $code, $previous);
 
 
 
 
556
  }
557
  }
558
  class Mixin_GalleryStorage_Driver_Base extends Mixin
@@ -639,12 +651,14 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
639
  }
640
  /**
641
  * Backs up an image file
 
642
  * @param int|object $image
643
  */
644
  public function backup_image($image)
645
  {
646
  $retval = FALSE;
647
- if ($image_path = $this->object->get_image_abspath($image)) {
 
648
  $retval = copy($image_path, $this->object->get_backup_abspath($image));
649
  // Store the dimensions of the image
650
  if (function_exists('getimagesize')) {
@@ -653,8 +667,11 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
653
  $image = $mapper->find($image);
654
  }
655
  if ($image) {
656
- $dimensions = getimagesize($retval);
657
- $image->meta_data['backup'] = array('filename' => basename($retval), 'width' => $dimensions[0], 'height' => $dimensions[1], 'generated' => microtime());
 
 
 
658
  $mapper->save($image);
659
  }
660
  }
@@ -943,7 +960,7 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
943
  if (isset($file_info['type'])) {
944
  $type = strtolower($file_info['type']);
945
  $valid_types = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png');
946
- $valid_regex = '/\\.(jpg|jpeg|gif|png)$/';
947
  // Is this a valid type?
948
  if (in_array($type, $valid_types)) {
949
  // If we can, we'll verify the mime type
@@ -1120,7 +1137,7 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
1120
  }
1121
  $retval = $image;
1122
  // Create or update the database record
1123
- $image->alttext = M_I18n::mb_basename($original_filename, '.' . M_I18n::mb_pathinfo($original_filename, PATHINFO_EXTENSION));
1124
  $image->galleryid = $this->object->_get_gallery_id($gallery);
1125
  $image->filename = $filename;
1126
  $image->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($image->alttext), 'image');
@@ -1219,7 +1236,7 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
1219
  if ($gallery_id) {
1220
  $retval = array('gallery_id' => $gallery_id, 'image_ids' => array());
1221
  foreach ($files as $file) {
1222
- if (!preg_match('/\\.(jpg|jpeg|gif|png)/i', $file)) {
1223
  continue;
1224
  }
1225
  $file_abspath = $fs->join_paths($abspath, $file);
@@ -1230,7 +1247,7 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
1230
  // Create the database record ... TODO cleanup, some duplication here from upload_base64_image
1231
  $factory = C_Component_Factory::get_instance();
1232
  $image = $factory->create('image');
1233
- $image->alttext = sanitize_title_with_dashes(M_I18n::mb_basename($file_abspath, '.' . M_I18n::mb_pathinfo($file_abspath, PATHINFO_EXTENSION)));
1234
  $image->galleryid = $this->object->_get_gallery_id($gallery_id);
1235
  $image->filename = M_I18n::mb_basename($file_abspath);
1236
  $image->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($image->alttext), 'image');
@@ -1547,22 +1564,13 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
1547
  */
1548
  public function generate_image_clone($image_path, $clone_path, $params)
1549
  {
1550
- $width = isset($params['width']) ? $params['width'] : NULL;
1551
- $height = isset($params['height']) ? $params['height'] : NULL;
1552
- $quality = isset($params['quality']) ? $params['quality'] : NULL;
1553
- $type = isset($params['type']) ? $params['type'] : NULL;
1554
  $crop = isset($params['crop']) ? $params['crop'] : NULL;
1555
  $watermark = isset($params['watermark']) ? $params['watermark'] : NULL;
1556
  $reflection = isset($params['reflection']) ? $params['reflection'] : NULL;
1557
  $rotation = isset($params['rotation']) ? $params['rotation'] : NULL;
1558
  $flip = isset($params['flip']) ? $params['flip'] : NULL;
1559
- $crop_frame = isset($params['crop_frame']) ? $params['crop_frame'] : NULL;
1560
  $destpath = NULL;
1561
  $thumbnail = NULL;
1562
- $quality = 100;
1563
- // Do this before anything else can modify the original -- $detailed_size
1564
- // may hold IPTC metadata we need to write to our clone
1565
- $size = getimagesize($image_path, $detailed_size);
1566
  $result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params);
1567
  // XXX this should maybe be removed and extra settings go into $params?
1568
  $settings = C_NextGen_Settings::get_instance();
@@ -1571,7 +1579,6 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
1571
  $image_dir = dirname($image_path);
1572
  $clone_path = $result['clone_path'];
1573
  $clone_dir = $result['clone_directory'];
1574
- $clone_suffix = $result['clone_suffix'];
1575
  $clone_format = $result['clone_format'];
1576
  $format_list = $this->object->get_image_format_list();
1577
  // Ensure target directory exists, but only create 1 subdirectory
@@ -1627,10 +1634,6 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
1627
  }
1628
  $destpath_info = M_I18n::mb_pathinfo($destpath);
1629
  $destpath_extension = $destpath_info['extension'];
1630
- $destpath_extension_str = null;
1631
- if ($destpath_extension != null) {
1632
- $destpath_extension_str = '.' . $destpath_extension;
1633
- }
1634
  if (strtolower($destpath_extension) != strtolower($clone_format_extension)) {
1635
  $destpath_dir = $destpath_info['dirname'];
1636
  $destpath_basename = $destpath_info['filename'];
@@ -1841,7 +1844,7 @@ class Mixin_Gallery_Image_Mapper extends Mixin
1841
  $image = $image->{$image->id_field};
1842
  }
1843
  wp_delete_object_term_relationships($image, 'ngg_tag');
1844
- C_Photocrati_Cache::flush();
1845
  return $retval;
1846
  }
1847
  public function _save_entity($entity)
@@ -1855,7 +1858,7 @@ class Mixin_Gallery_Image_Mapper extends Mixin
1855
  if (!isset($entity->meta_data['saved'])) {
1856
  nggAdmin::import_MetaData($image_id);
1857
  }
1858
- C_Photocrati_Cache::flush('displayed_gallery_rendering');
1859
  }
1860
  return $retval;
1861
  }
@@ -1927,7 +1930,7 @@ class Mixin_Gallery_Image_Mapper extends Mixin
1927
  $this->object->_set_default_value($entity, 'alttext', $alttext);
1928
  }
1929
  // Set unique slug
1930
- if (isset($entity->alttext) && !isset($entity->image_slug)) {
1931
  $entity->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($entity->alttext), 'image');
1932
  }
1933
  // Ensure that the exclude parameter is an integer or boolean-evaluated
@@ -2465,7 +2468,7 @@ class C_NextGen_Metadata extends C_Component
2465
  if ($this->size && is_array($metadata)) {
2466
  // get exif - data
2467
  if (is_callable('exif_read_data')) {
2468
- $this->exif_data = @exif_read_data($this->file_path, 0, TRUE);
2469
  }
2470
  // stop here if we didn't need other meta data
2471
  if ($onlyEXIF) {
@@ -2531,8 +2534,8 @@ class C_NextGen_Metadata extends C_Component
2531
  }
2532
  if (!is_array($this->exif_array)) {
2533
  $meta = array();
2534
- if (isset($this->exif_data['EXIF'])) {
2535
- $exif = $this->exif_data['EXIF'];
2536
  if (!empty($exif['FNumber'])) {
2537
  $meta['aperture'] = 'F ' . round($this->exif_frac2dec($exif['FNumber']), 2);
2538
  }
@@ -2540,13 +2543,13 @@ class C_NextGen_Metadata extends C_Component
2540
  $meta['camera'] = trim($exif['Model']);
2541
  }
2542
  if (!empty($exif['DateTimeDigitized'])) {
2543
- $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeDigitized']));
2544
  } else {
2545
  if (!empty($exif['DateTimeOriginal'])) {
2546
- $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeOriginal']));
2547
  } else {
2548
  if (!empty($exif['FileDateTime'])) {
2549
- $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['FileDateTime']));
2550
  }
2551
  }
2552
  }
@@ -2626,10 +2629,13 @@ class C_NextGen_Metadata extends C_Component
2626
  // convert the exif date format to a unix timestamp
2627
  public function exif_date2ts($str)
2628
  {
2629
- // seriously, who formats a date like 'YYYY:MM:DD hh:mm:ss'?
2630
- @(list($date, $time) = explode(' ', trim($str)));
2631
- @(list($y, $m, $d) = explode(':', $date));
2632
- return strtotime("{$y}-{$m}-{$d} {$time}");
 
 
 
2633
  }
2634
  /**
2635
  * nggMeta::readIPTC() - IPTC Data Information for EXIF Display
@@ -2772,7 +2778,7 @@ class C_NextGen_Metadata extends C_Component
2772
  switch ($key) {
2773
  case 'xap:CreateDate':
2774
  case 'xap:ModifyDate':
2775
- $this->xmp_array[$value] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($xmlarray[$key]));
2776
  break;
2777
  default:
2778
  $this->xmp_array[$value] = $xmlarray[$key];
@@ -2815,6 +2821,9 @@ class C_NextGen_Metadata extends C_Component
2815
  if ($value = $this->get_XMP($object)) {
2816
  return $value;
2817
  }
 
 
 
2818
  if ($value = $this->get_IPTC($object)) {
2819
  return $value;
2820
  }
@@ -2845,25 +2854,11 @@ class C_NextGen_Metadata extends C_Component
2845
  public function get_date_time()
2846
  {
2847
  $date = time();
2848
- // Try XMP first
2849
- if (isset($this->xmp_array['created_timestamp'])) {
2850
- $date = @strtotime($this->xmp_array['created_timestamp']);
2851
- } else {
2852
- if (isset($this->exif_array['created_timestamp'])) {
2853
- $date = @strtotime($this->exif_array['created_timestamp']);
2854
- } else {
2855
- if (isset($this->iptc_array['created_date'])) {
2856
- $date = $this->iptc_array['created_date'];
2857
- if (isset($this->iptc_array['created_time'])) {
2858
- $date .= " {$this->iptc_array['created_time']}";
2859
- }
2860
- $date = @strtotime($date);
2861
- } else {
2862
- if ($this->image->imagePath) {
2863
- $date = @filectime($this->image->imagePath);
2864
- }
2865
- }
2866
- }
2867
  }
2868
  // Failback
2869
  if (!$date) {
@@ -3066,7 +3061,7 @@ class Mixin_NggLegacy_GalleryStorage_Driver extends Mixin
3066
  if ($image_abspath) {
3067
  // encode the filename: because filesystems will let you name things like%@this.jpg
3068
  $parts = M_I18n::mb_pathinfo($image_abspath);
3069
- $parts['basename'] = urlencode($parts['basename']);
3070
  $image_abspath = $parts['dirname'] . DIRECTORY_SEPARATOR . $parts['basename'];
3071
  $doc_root = $fs->get_document_root('gallery');
3072
  if ($doc_root != null) {
@@ -3132,6 +3127,7 @@ class Mixin_NggLegacy_GalleryStorage_Driver extends Mixin
3132
  if (is_numeric($image)) {
3133
  $image = $this->object->_image_mapper->find($image);
3134
  }
 
3135
  // Ensure we have a valid image
3136
  if ($image) {
3137
  $settings = C_NextGen_Settings::get_instance();
@@ -3399,6 +3395,95 @@ class Mixin_NggLegacy_GalleryStorage_Driver extends Mixin
3399
  }
3400
  return $retval;
3401
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3402
  /**
3403
  * Copies (or moves) images into another gallery
3404
  *
197
  $retval = $this->call_parent('_save_entity', $entity);
198
  if ($retval) {
199
  do_action('ngg_album_updated', $entity);
200
+ C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
201
  }
202
  return $retval;
203
  }
354
  $retval = $this->call_parent('_save_entity', $entity);
355
  if ($retval) {
356
  do_action('ngg_created_new_gallery', $entity->{$entity->id_field});
357
+ C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
358
  }
359
  return $retval;
360
  }
384
  }
385
  if ($retval) {
386
  do_action('ngg_delete_gallery', $gallery);
387
+ C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
388
  }
389
  }
390
  return $retval;
515
  if (!$message) {
516
  $message = 'There was a problem uploading the file.';
517
  }
518
+ if (PHP_VERSION_ID >= 50300) {
519
+ parent::__construct($message, $code, $previous);
520
+ } else {
521
+ parent::__construct($message, $code);
522
+ }
523
  }
524
  }
525
  class E_InsufficientWriteAccessException extends E_NggErrorException
546
  if (!$message) {
547
  $message = 'You have exceeded your storage capacity. Please remove some files and try again.';
548
  }
549
+ if (PHP_VERSION_ID >= 50300) {
550
+ parent::__construct($message, $code, $previous);
551
+ } else {
552
+ parent::__construct($message, $code);
553
+ }
554
  }
555
  }
556
  class E_No_Image_Library_Exception extends E_NggErrorException
560
  if (!$message) {
561
  $message = 'The site does not support the GD Image library. Please ask your hosting provider to enable it.';
562
  }
563
+ if (PHP_VERSION_ID >= 50300) {
564
+ parent::__construct($message, $code, $previous);
565
+ } else {
566
+ parent::__construct($message, $code);
567
+ }
568
  }
569
  }
570
  class Mixin_GalleryStorage_Driver_Base extends Mixin
651
  }
652
  /**
653
  * Backs up an image file
654
+ *
655
  * @param int|object $image
656
  */
657
  public function backup_image($image)
658
  {
659
  $retval = FALSE;
660
+ $image_path = $this->object->get_image_abspath($image);
661
+ if ($image_path && @file_exists($image_path)) {
662
  $retval = copy($image_path, $this->object->get_backup_abspath($image));
663
  // Store the dimensions of the image
664
  if (function_exists('getimagesize')) {
667
  $image = $mapper->find($image);
668
  }
669
  if ($image) {
670
+ if (!property_exists($image, 'meta_data')) {
671
+ $image->meta_data = array();
672
+ }
673
+ $dimensions = getimagesize($image_path);
674
+ $image->meta_data['backup'] = array('filename' => basename($image_path), 'width' => $dimensions[0], 'height' => $dimensions[1], 'generated' => microtime());
675
  $mapper->save($image);
676
  }
677
  }
960
  if (isset($file_info['type'])) {
961
  $type = strtolower($file_info['type']);
962
  $valid_types = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png');
963
+ $valid_regex = '/\\.(jpg|jpeg|gif|png)$/i';
964
  // Is this a valid type?
965
  if (in_array($type, $valid_types)) {
966
  // If we can, we'll verify the mime type
1137
  }
1138
  $retval = $image;
1139
  // Create or update the database record
1140
+ $image->alttext = str_replace('.' . M_I18n::mb_pathinfo($original_filename, PATHINFO_EXTENSION), '', M_I18n::mb_basename($original_filename));
1141
  $image->galleryid = $this->object->_get_gallery_id($gallery);
1142
  $image->filename = $filename;
1143
  $image->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($image->alttext), 'image');
1236
  if ($gallery_id) {
1237
  $retval = array('gallery_id' => $gallery_id, 'image_ids' => array());
1238
  foreach ($files as $file) {
1239
+ if (!preg_match('/\\.(jpg|jpeg|gif|png)$/i', $file)) {
1240
  continue;
1241
  }
1242
  $file_abspath = $fs->join_paths($abspath, $file);
1247
  // Create the database record ... TODO cleanup, some duplication here from upload_base64_image
1248
  $factory = C_Component_Factory::get_instance();
1249
  $image = $factory->create('image');
1250
+ $image->alttext = sanitize_title_with_dashes(str_replace('.' . M_I18n::mb_pathinfo($file_abspath, PATHINFO_EXTENSION), '', M_I18n::mb_basename($file_abspath)));
1251
  $image->galleryid = $this->object->_get_gallery_id($gallery_id);
1252
  $image->filename = M_I18n::mb_basename($file_abspath);
1253
  $image->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($image->alttext), 'image');
1564
  */
1565
  public function generate_image_clone($image_path, $clone_path, $params)
1566
  {
 
 
 
 
1567
  $crop = isset($params['crop']) ? $params['crop'] : NULL;
1568
  $watermark = isset($params['watermark']) ? $params['watermark'] : NULL;
1569
  $reflection = isset($params['reflection']) ? $params['reflection'] : NULL;
1570
  $rotation = isset($params['rotation']) ? $params['rotation'] : NULL;
1571
  $flip = isset($params['flip']) ? $params['flip'] : NULL;
 
1572
  $destpath = NULL;
1573
  $thumbnail = NULL;
 
 
 
 
1574
  $result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params);
1575
  // XXX this should maybe be removed and extra settings go into $params?
1576
  $settings = C_NextGen_Settings::get_instance();
1579
  $image_dir = dirname($image_path);
1580
  $clone_path = $result['clone_path'];
1581
  $clone_dir = $result['clone_directory'];
 
1582
  $clone_format = $result['clone_format'];
1583
  $format_list = $this->object->get_image_format_list();
1584
  // Ensure target directory exists, but only create 1 subdirectory
1634
  }
1635
  $destpath_info = M_I18n::mb_pathinfo($destpath);
1636
  $destpath_extension = $destpath_info['extension'];
 
 
 
 
1637
  if (strtolower($destpath_extension) != strtolower($clone_format_extension)) {
1638
  $destpath_dir = $destpath_info['dirname'];
1639
  $destpath_basename = $destpath_info['filename'];
1844
  $image = $image->{$image->id_field};
1845
  }
1846
  wp_delete_object_term_relationships($image, 'ngg_tag');
1847
+ C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
1848
  return $retval;
1849
  }
1850
  public function _save_entity($entity)
1858
  if (!isset($entity->meta_data['saved'])) {
1859
  nggAdmin::import_MetaData($image_id);
1860
  }
1861
+ C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
1862
  }
1863
  return $retval;
1864
  }
1930
  $this->object->_set_default_value($entity, 'alttext', $alttext);
1931
  }
1932
  // Set unique slug
1933
+ if (isset($entity->alttext) && empty($entity->image_slug)) {
1934
  $entity->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($entity->alttext), 'image');
1935
  }
1936
  // Ensure that the exclude parameter is an integer or boolean-evaluated
2468
  if ($this->size && is_array($metadata)) {
2469
  // get exif - data
2470
  if (is_callable('exif_read_data')) {
2471
+ $this->exif_data = @exif_read_data($this->file_path, NULL, TRUE);
2472
  }
2473
  // stop here if we didn't need other meta data
2474
  if ($onlyEXIF) {
2534
  }
2535
  if (!is_array($this->exif_array)) {
2536
  $meta = array();
2537
+ $exif = isset($this->exif_array['EXIF']) ? $this->exif_array['EXIF'] : array();
2538
+ if (count($exif)) {
2539
  if (!empty($exif['FNumber'])) {
2540
  $meta['aperture'] = 'F ' . round($this->exif_frac2dec($exif['FNumber']), 2);
2541
  }
2543
  $meta['camera'] = trim($exif['Model']);
2544
  }
2545
  if (!empty($exif['DateTimeDigitized'])) {
2546
+ $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeDigitized']);
2547
  } else {
2548
  if (!empty($exif['DateTimeOriginal'])) {
2549
+ $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeOriginal']);
2550
  } else {
2551
  if (!empty($exif['FileDateTime'])) {
2552
+ $meta['created_timestamp'] = $this->exif_date2ts($exif['FileDateTime']);
2553
  }
2554
  }
2555
  }
2629
  // convert the exif date format to a unix timestamp
2630
  public function exif_date2ts($str)
2631
  {
2632
+ $retval = is_numeric($str) ? $str : @strtotime($str);
2633
+ if (!$retval && $str) {
2634
+ @(list($date, $time) = explode(' ', trim($str)));
2635
+ @(list($y, $m, $d) = explode(':', $date));
2636
+ $retval = strtotime("{$y}-{$m}-{$d} {$time}");
2637
+ }
2638
+ return $retval;
2639
  }
2640
  /**
2641
  * nggMeta::readIPTC() - IPTC Data Information for EXIF Display
2778
  switch ($key) {
2779
  case 'xap:CreateDate':
2780
  case 'xap:ModifyDate':
2781
+ $this->xmp_array[$value] = strtotime($xmlarray[$key]);
2782
  break;
2783
  default:
2784
  $this->xmp_array[$value] = $xmlarray[$key];
2821
  if ($value = $this->get_XMP($object)) {
2822
  return $value;
2823
  }
2824
+ if ($object == 'created_timestamp' && ($d = $this->get_IPTC('created_date')) && ($t = $this->get_IPTC('created_time'))) {
2825
+ return $this->exif_date2ts($d . ' ' . $t);
2826
+ }
2827
  if ($value = $this->get_IPTC($object)) {
2828
  return $value;
2829
  }
2854
  public function get_date_time()
2855
  {
2856
  $date = time();
2857
+ // Try getting the created_timestamp field
2858
+ $date = $this->exif_date2ts($this->get_META('created_timestamp'));
2859
+ if (!$date) {
2860
+ $image_path = C_Gallery_Storage::get_instance()->get_backup_abspath($this->image);
2861
+ $date = @filectime($image_path);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2862
  }
2863
  // Failback
2864
  if (!$date) {
3061
  if ($image_abspath) {
3062
  // encode the filename: because filesystems will let you name things like%@this.jpg
3063
  $parts = M_I18n::mb_pathinfo($image_abspath);
3064
+ $parts['basename'] = rawurlencode($parts['basename']);
3065
  $image_abspath = $parts['dirname'] . DIRECTORY_SEPARATOR . $parts['basename'];
3066
  $doc_root = $fs->get_document_root('gallery');
3067
  if ($doc_root != null) {
3127
  if (is_numeric($image)) {
3128
  $image = $this->object->_image_mapper->find($image);
3129
  }
3130
+ $params = apply_filters('ngg_get_image_size_params', $params, $size, $image);
3131
  // Ensure we have a valid image
3132
  if ($image) {
3133
  $settings = C_NextGen_Settings::get_instance();
3395
  }
3396
  return $retval;
3397
  }
3398
+ public function set_post_thumbnail($post, $image)
3399
+ {
3400
+ $attachment_id = null;
3401
+ // Get the post id
3402
+ $post_id = $post;
3403
+ if (is_object($post)) {
3404
+ if (property_exists($post, 'ID')) {
3405
+ $post_id = $post->ID;
3406
+ } elseif (property_exists($post, 'post_id')) {
3407
+ $post_id = $post->post_id;
3408
+ }
3409
+ } elseif (is_array($post)) {
3410
+ if (isset($post['ID'])) {
3411
+ $post_id = $post['ID'];
3412
+ } elseif (isset($post['post_id'])) {
3413
+ $post_id = $post['post_id'];
3414
+ }
3415
+ }
3416
+ // Get the image object
3417
+ if (is_int($image)) {
3418
+ $image = C_Image_Mapper::get_instance()->find($image);
3419
+ }
3420
+ // Do we have what we need?
3421
+ if ($image && is_int($post_id)) {
3422
+ $args = array('post_type' => 'attachment', 'meta_key' => '_ngg_image_id', 'meta_compare' => '==', 'meta_value' => $image->{$image->id_field});
3423
+ $upload_dir = wp_upload_dir();
3424
+ $basedir = $upload_dir['basedir'];
3425
+ $thumbs_dir = implode(DIRECTORY_SEPARATOR, array($basedir, 'ngg_featured'));
3426
+ $gallery_abspath = $this->object->get_gallery_abspath($image->galleryid);
3427
+ $image_abspath = $this->object->get_full_abspath($image);
3428
+ $target_path = null;
3429
+ $copy_image = TRUE;
3430
+ // Have we previously set the post thumbnail?
3431
+ if ($posts = get_posts($args)) {
3432
+ $attachment_id = $posts[0]->ID;
3433
+ $attachment_file = get_attached_file($attachment_id);
3434
+ $target_path = $attachment_file;
3435
+ if (filemtime($image_abspath) > filemtime($target_path)) {
3436
+ $copy_image = TRUE;
3437
+ }
3438
+ } else {
3439
+ $url = $this->object->get_full_url($image);
3440
+ $target_relpath = null;
3441
+ $target_basename = M_I18n::mb_basename($image_abspath);
3442
+ if (strpos($image_abspath, $gallery_abspath) === 0) {
3443
+ $target_relpath = substr($image_abspath, strlen($gallery_abspath));
3444
+ } else {
3445
+ if ($image->galleryid) {
3446
+ $target_relpath = path_join(strval($image->galleryid), $target_basename);
3447
+ } else {
3448
+ $target_relpath = $target_basename;
3449
+ }
3450
+ }
3451
+ $target_relpath = trim($target_relpath, '\\/');
3452
+ $target_path = path_join($thumbs_dir, $target_relpath);
3453
+ $max_count = 100;
3454
+ $count = 0;
3455
+ while (file_exists($target_path) && $count <= $max_count) {
3456
+ $count++;
3457
+ $pathinfo = M_I18n::mb_pathinfo($target_path);
3458
+ $dirname = $pathinfo['dirname'];
3459
+ $filename = $pathinfo['filename'];
3460
+ $extension = $pathinfo['extension'];
3461
+ $rand = mt_rand(1, 9999);
3462
+ $basename = $filename . '_' . sprintf('%04d', $rand) . '.' . $extension;
3463
+ $target_path = path_join($dirname, $basename);
3464
+ }
3465
+ if (file_exists($target_path)) {
3466
+ }
3467
+ $target_dir = dirname($target_path);
3468
+ wp_mkdir_p($target_dir);
3469
+ }
3470
+ if ($copy_image) {
3471
+ @copy($image_abspath, $target_path);
3472
+ if (!$attachment_id) {
3473
+ $size = @getimagesize($target_path);
3474
+ $image_type = $size ? $size['mime'] : 'image/jpeg';
3475
+ $title = sanitize_file_name($image->alttext);
3476
+ $caption = sanitize_file_name($image->description);
3477
+ $attachment = array('post_title' => $title, 'post_content' => $caption, 'post_status' => 'attachment', 'post_parent' => 0, 'post_mime_type' => $image_type, 'guid' => $url);
3478
+ $attachment_id = wp_insert_attachment($attachment, $target_path);
3479
+ }
3480
+ update_post_meta($attachment_id, '_ngg_image_id', $image->{$image->id_field});
3481
+ wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $target_path));
3482
+ set_post_thumbnail($post_id, $attachment_id);
3483
+ }
3484
+ }
3485
+ return $attachment_id;
3486
+ }
3487
  /**
3488
  * Copies (or moves) images into another gallery
3489
  *
products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php CHANGED
@@ -507,10 +507,7 @@ class C_Display_Type_Installer
507
  */
508
  function uninstall($hard = FALSE)
509
  {
510
- // Flush displayed gallery cache
511
- C_Photocrati_Cache::flush();
512
- C_Photocrati_Cache::flush('displayed_galleries');
513
- C_Photocrati_Cache::flush('displayed_gallery_rendering');
514
 
515
  $this->uninstall_display_types();
516
 
507
  */
508
  function uninstall($hard = FALSE)
509
  {
510
+ C_Photocrati_Transient_Manager::flush();
 
 
 
511
 
512
  $this->uninstall_display_types();
513
 
products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php CHANGED
@@ -998,7 +998,7 @@ class Mixin_Displayed_Gallery_Queries extends Mixin
998
  $retval = array_reverse($retval);
999
  }
1000
  // Limit the entities
1001
- if ($limit && $offset) {
1002
  $retval = array_slice($retval, $offset, $limit);
1003
  }
1004
  return $retval;
@@ -1245,10 +1245,11 @@ class Mixin_Displayed_Gallery_Instance_Methods extends Mixin
1245
  */
1246
  public function to_transient()
1247
  {
1248
- $group = 'displayed_galleries';
1249
- $key = C_Photocrati_Cache::generate_key($this->object->get_entity(), $group);
1250
- if (is_null(C_Photocrati_Cache::get($key, NULL, $group))) {
1251
- C_Photocrati_Cache::set($key, $this->object->get_entity(), $group, NGG_DISPLAYED_GALLERY_CACHE_TTL);
 
1252
  }
1253
  $this->object->transient_id = $key;
1254
  if (!$this->object->id()) {
@@ -1266,8 +1267,19 @@ class Mixin_Displayed_Gallery_Instance_Methods extends Mixin
1266
  if (!$transient_id && isset($this->object->transient_id)) {
1267
  $transient_id = $this->object->transient_id;
1268
  }
1269
- if ($transient_id && ($transient = C_Photocrati_Cache::get($transient_id, FALSE, 'displayed_galleries'))) {
 
 
 
 
 
 
 
 
1270
  $this->object->_stdObject = $transient;
 
 
 
1271
  $this->object->transient_id = $transient_id;
1272
  if (!$this->object->id()) {
1273
  $this->object->id($transient_id);
@@ -1280,6 +1292,21 @@ class Mixin_Displayed_Gallery_Instance_Methods extends Mixin
1280
  }
1281
  return $retval;
1282
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1283
  }
1284
  class C_Displayed_Gallery_Mapper extends C_CustomPost_DataMapper_Driver
1285
  {
@@ -1547,7 +1574,6 @@ class Mixin_Displayed_Gallery_Renderer extends Mixin
1547
  {
1548
  $retval = '';
1549
  $lookup = TRUE;
1550
- $cache = C_Photocrati_Cache::get_instance('displayed_gallery_rendering');
1551
  // Simply throwing our rendered gallery into a feed will most likely not work correctly.
1552
  // The MediaRSS option in NextGEN is available as an alternative.
1553
  if (!C_NextGen_Settings::get_instance()->galleries_in_feeds && is_feed()) {
@@ -1600,9 +1626,9 @@ class Mixin_Displayed_Gallery_Renderer extends Mixin
1600
  $key_params[] = get_option('permalink_structure');
1601
  }
1602
  // Try getting the rendered HTML from the cache
1603
- $key = $cache->generate_key($key_params);
1604
  if (NGG_RENDERING_CACHE_ENABLED) {
1605
- $html = $cache->lookup($key, FALSE);
1606
  }
1607
  // Output debug messages
1608
  if ($html) {
@@ -1626,11 +1652,10 @@ class Mixin_Displayed_Gallery_Renderer extends Mixin
1626
  $retval .= $this->debug_msg('Rendering displayed gallery');
1627
  $current_mode = $controller->get_render_mode();
1628
  $controller->set_render_mode($mode);
1629
- $html = $controller->index_action($displayed_gallery, TRUE);
1630
  if ($key != null) {
1631
- $cache->update($key, $html, NGG_RENDERING_CACHE_TTL);
1632
  }
1633
- $controller->set_render_mode($current_mode);
1634
  }
1635
  $retval .= $html;
1636
  if (!$return) {
998
  $retval = array_reverse($retval);
999
  }
1000
  // Limit the entities
1001
+ if ($limit) {
1002
  $retval = array_slice($retval, $offset, $limit);
1003
  }
1004
  return $retval;
1245
  */
1246
  public function to_transient()
1247
  {
1248
+ $params = $this->object->get_entity();
1249
+ unset($params->transient_id);
1250
+ $key = C_Photocrati_Transient_Manager::create_key('displayed_galleries', $params);
1251
+ if (is_null(C_Photocrati_Transient_Manager::fetch($key, NULL))) {
1252
+ C_Photocrati_Transient_Manager::update($key, $params, NGG_DISPLAYED_GALLERY_CACHE_TTL);
1253
  }
1254
  $this->object->transient_id = $key;
1255
  if (!$this->object->id()) {
1267
  if (!$transient_id && isset($this->object->transient_id)) {
1268
  $transient_id = $this->object->transient_id;
1269
  }
1270
+ if ($transient_id && ($transient = C_Photocrati_Transient_Manager::fetch($transient_id, FALSE))) {
1271
+ // Ensure that the transient is an object, not array
1272
+ if (is_array($transient)) {
1273
+ $obj = new stdClass();
1274
+ foreach ($transient as $key => $value) {
1275
+ $obj->{$key} = $value;
1276
+ }
1277
+ $transient = $obj;
1278
+ }
1279
  $this->object->_stdObject = $transient;
1280
+ // Ensure that the display settings are an array
1281
+ $this->object->display_settings = $this->_object_to_array($this->object->display_settings);
1282
+ // Ensure that we have the most accurate transient id
1283
  $this->object->transient_id = $transient_id;
1284
  if (!$this->object->id()) {
1285
  $this->object->id($transient_id);
1292
  }
1293
  return $retval;
1294
  }
1295
+ public function _object_to_array($object)
1296
+ {
1297
+ $retval = $object;
1298
+ if (is_object($retval)) {
1299
+ $retval = get_object_vars($object);
1300
+ }
1301
+ if (is_array($retval)) {
1302
+ foreach ($retval as $key => $val) {
1303
+ if (is_object($val)) {
1304
+ $retval[$key] = $this->_object_to_array($val);
1305
+ }
1306
+ }
1307
+ }
1308
+ return $retval;
1309
+ }
1310
  }
1311
  class C_Displayed_Gallery_Mapper extends C_CustomPost_DataMapper_Driver
1312
  {
1574
  {
1575
  $retval = '';
1576
  $lookup = TRUE;
 
1577
  // Simply throwing our rendered gallery into a feed will most likely not work correctly.
1578
  // The MediaRSS option in NextGEN is available as an alternative.
1579
  if (!C_NextGen_Settings::get_instance()->galleries_in_feeds && is_feed()) {
1626
  $key_params[] = get_option('permalink_structure');
1627
  }
1628
  // Try getting the rendered HTML from the cache
1629
+ $key = C_Photocrati_Transient_Manager::create_key('displayed_gallery_rendering', $key_params);
1630
  if (NGG_RENDERING_CACHE_ENABLED) {
1631
+ $html = C_Photocrati_Transient_Manager::fetch($key, FALSE);
1632
  }
1633
  // Output debug messages
1634
  if ($html) {
1652
  $retval .= $this->debug_msg('Rendering displayed gallery');
1653
  $current_mode = $controller->get_render_mode();
1654
  $controller->set_render_mode($mode);
1655
+ $html = apply_filters('ngg_displayed_gallery_rendering', $controller->index_action($displayed_gallery, TRUE), $displayed_gallery);
1656
  if ($key != null) {
1657
+ C_Photocrati_Transient_Manager::update($key, $html, NGG_RENDERING_CACHE_TTL);
1658
  }
 
1659
  }
1660
  $retval .= $html;
1661
  if (!$return) {
products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php CHANGED
@@ -289,10 +289,7 @@ Choose [Cancel] to Stop, [OK] to proceed.', 'nggallery'), 'slug_field' => $this-
289
  {
290
  $cache = C_Cache::get_instance();
291
  $cache->flush_galleries();
292
- C_Photocrati_Cache::flush();
293
- C_Photocrati_Cache::flush('displayed_galleries');
294
- C_Photocrati_Cache::flush('displayed_gallery_rendering');
295
- C_Photocrati_Cache::flush('mvc');
296
  }
297
  public function save_action()
298
  {
@@ -307,7 +304,7 @@ Choose [Cancel] to Stop, [OK] to proceed.', 'nggallery'), 'slug_field' => $this-
307
  }
308
  // If the router slug has changed, then flush the cache
309
  if ($settings['router_param_slug'] != $this->object->get_model()->router_param_slug) {
310
- C_Photocrati_Cache::flush();
311
  }
312
  // Save both setting groups
313
  $this->object->get_model()->set($settings)->save();
@@ -356,7 +353,7 @@ Choose [Cancel] to Stop, [OK] to proceed.', 'nggallery')), TRUE);
356
  {
357
  global $wpdb;
358
  // Flush the cache
359
- C_Photocrati_Cache::flush('all');
360
  // Uninstall the plugin
361
  $settings = C_NextGen_Settings::get_instance();
362
  if (defined('NGG_PRO_PLUGIN_VERSION') || defined('NEXTGEN_GALLERY_PRO_VERSION')) {
289
  {
290
  $cache = C_Cache::get_instance();
291
  $cache->flush_galleries();
292
+ C_Photocrati_Transient_Manager::flush();
 
 
 
293
  }
294
  public function save_action()
295
  {
304
  }
305
  // If the router slug has changed, then flush the cache
306
  if ($settings['router_param_slug'] != $this->object->get_model()->router_param_slug) {
307
+ C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
308
  }
309
  // Save both setting groups
310
  $this->object->get_model()->set($settings)->save();
353
  {
354
  global $wpdb;
355
  // Flush the cache
356
+ C_Photocrati_Transient_Manager::flush();
357
  // Uninstall the plugin
358
  $settings = C_NextGen_Settings::get_instance();
359
  if (defined('NGG_PRO_PLUGIN_VERSION') || defined('NEXTGEN_GALLERY_PRO_VERSION')) {
products/photocrati_nextgen/modules/nextgen_pro_upgrade/package.module.nextgen_pro_upgrade.php CHANGED
@@ -37,8 +37,8 @@ class A_NextGen_Pro_Upgrade_Controller extends Mixin
37
  public function index_action()
38
  {
39
  $this->object->enqueue_backend_resources();
40
- $key = C_Photocrati_Cache::generate_key('nextgen_pro_upgrade_page');
41
- if ($html = C_Photocrati_Cache::get('nextgen_pro_upgrade_page', FALSE)) {
42
  echo $html;
43
  } else {
44
  // Get page content
@@ -55,7 +55,7 @@ class A_NextGen_Pro_Upgrade_Controller extends Mixin
55
  $params = array('description' => $description, 'headline' => $headline);
56
  $html = $this->render_view($template, $params, TRUE);
57
  // Cache it
58
- C_Photocrati_Cache::set($key, $html);
59
  // Render it
60
  echo $html;
61
  }
37
  public function index_action()
38
  {
39
  $this->object->enqueue_backend_resources();
40
+ $key = C_Photocrati_Transient_Manager::create_key('nextgen_pro_upgrade_page', 'html');
41
+ if ($html = C_Photocrati_Transient_Manager::fetch($key, FALSE)) {
42
  echo $html;
43
  } else {
44
  // Get page content
55
  $params = array('description' => $description, 'headline' => $headline);
56
  $html = $this->render_view($template, $params, TRUE);
57
  // Cache it
58
+ C_Photocrati_Transient_Manager::update($key, $html);
59
  // Render it
60
  echo $html;
61
  }
products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php CHANGED
@@ -76,8 +76,8 @@ class C_NextGen_Settings_Installer
76
  'relatedHeading' => '<h3>' . __('Related Images', 'nggallery') . ':</h3>', // subheading for related images
77
 
78
  // Thumbnail Settings
79
- 'thumbwidth' => 120, // Thumb Width
80
- 'thumbheight' => 90, // Thumb height
81
  'thumbfix' => True, // Fix the dimension
82
  'thumbquality' => 100, // Thumb Quality
83
 
76
  'relatedHeading' => '<h3>' . __('Related Images', 'nggallery') . ':</h3>', // subheading for related images
77
 
78
  // Thumbnail Settings
79
+ 'thumbwidth' => 240, // Thumb Width
80
+ 'thumbheight' => 160, // Thumb height
81
  'thumbfix' => True, // Fix the dimension
82
  'thumbquality' => 100, // Thumb Quality
83
 
products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php CHANGED
@@ -28,12 +28,15 @@ class M_NextGen_XmlRpc extends C_Base_Module
28
  function add_methods($methods)
29
  {
30
  $methods['ngg.installed'] = array(&$this, 'get_version');
 
 
31
  // Image methods
32
  $methods['ngg.getImage'] = array(&$this, 'get_image');
33
  $methods['ngg.getImages'] = array(&$this, 'get_images');
34
  $methods['ngg.uploadImage'] = array(&$this, 'upload_image');
35
  $methods['ngg.editImage'] = array(&$this, 'edit_image');
36
  $methods['ngg.deleteImage'] = array(&$this, 'delete_image');
 
37
  // Gallery methods
38
  $methods['ngg.getGallery'] = array(&$this, 'get_gallery');
39
  $methods['ngg.getGalleries'] = array(&$this, 'get_galleries');
@@ -630,6 +633,32 @@ class M_NextGen_XmlRpc extends C_Base_Module
630
 
631
  return $retval;
632
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
633
  }
634
 
635
  new M_NextGen_XmlRpc;
28
  function add_methods($methods)
29
  {
30
  $methods['ngg.installed'] = array(&$this, 'get_version');
31
+ $methods['ngg.setPostThumbnail'] = array(&$this, 'set_post_thumbnail');
32
+
33
  // Image methods
34
  $methods['ngg.getImage'] = array(&$this, 'get_image');
35
  $methods['ngg.getImages'] = array(&$this, 'get_images');
36
  $methods['ngg.uploadImage'] = array(&$this, 'upload_image');
37
  $methods['ngg.editImage'] = array(&$this, 'edit_image');
38
  $methods['ngg.deleteImage'] = array(&$this, 'delete_image');
39
+
40
  // Gallery methods
41
  $methods['ngg.getGallery'] = array(&$this, 'get_gallery');
42
  $methods['ngg.getGalleries'] = array(&$this, 'get_galleries');
633
 
634
  return $retval;
635
  }
636
+
637
+ /**
638
+ * Sets the post thumbnail for a post to a NextGEN Gallery image
639
+ * @param $args (blog_id, username, password, post_id, image_id)
640
+ *
641
+ * @return IXR_Error|int attachment id
642
+ */
643
+ function set_post_thumbnail($args)
644
+ {
645
+ $retval = new IXR_Error(403, 'Invalid username or password');
646
+ $blog_id = intval($args[0]);
647
+ $username = strval($args[1]);
648
+ $password = strval($args[2]);
649
+ $post_ID = intval($args[3]);
650
+ $image_id = intval($args[4]);
651
+
652
+ // Authenticate the user
653
+ if ($this->_login($username, $password, $blog_id)) {
654
+ if ( current_user_can( 'edit_post', $post_ID )) {
655
+ $retval = C_Gallery_Storage::get_instance()->set_post_thumbnail($post_ID, $image_id);
656
+ }
657
+ else $retval = new IXR_Error(403, "Sorry but you need permission to do this");
658
+ }
659
+
660
+ return $retval;
661
+ }
662
  }
663
 
664
  new M_NextGen_XmlRpc;
products/photocrati_nextgen/modules/ngglegacy/admin/album.php CHANGED
@@ -599,13 +599,23 @@ function showDialog() {
599
  if (!isset($album->pageid))
600
  $album->pageid = 0;
601
 
 
602
  wp_dropdown_pages(array(
603
  'echo' => TRUE,
604
  'name' => 'pageid',
605
  'selected' => $album->pageid,
606
  'show_option_none' => esc_html('Not linked', 'nggallery'),
607
  'option_none_value' => 0
608
- )); ?>
 
 
 
 
 
 
 
 
 
609
  </th>
610
  </tr>
611
 
599
  if (!isset($album->pageid))
600
  $album->pageid = 0;
601
 
602
+ ob_start();
603
  wp_dropdown_pages(array(
604
  'echo' => TRUE,
605
  'name' => 'pageid',
606
  'selected' => $album->pageid,
607
  'show_option_none' => esc_html('Not linked', 'nggallery'),
608
  'option_none_value' => 0
609
+ ));
610
+ $dropdown = ob_get_contents();
611
+ ob_end_clean();
612
+ if (!empty($dropdown))
613
+ echo $dropdown;
614
+ else {
615
+ echo '<input type="hidden" id="pageid" name="pageid" value="0"/>';
616
+ esc_html_e('There are no pages to link to', 'nggallery');
617
+ }
618
+ ?>
619
  </th>
620
  </tr>
621
 
products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php CHANGED
@@ -44,7 +44,7 @@ function nggallery_picturelist($controller) {
44
 
45
  // look for pagination
46
  $_GET['paged'] = isset($_GET['paged']) && ($_GET['paged'] > 0) ? absint($_GET['paged']) : 1;
47
- $items_per_page = 50;
48
 
49
  $start = ( $_GET['paged'] - 1 ) * $items_per_page;
50
 
44
 
45
  // look for pagination
46
  $_GET['paged'] = isset($_GET['paged']) && ($_GET['paged'] > 0) ? absint($_GET['paged']) : 1;
47
+ $items_per_page = apply_filters('ngg_manage_images_items_per_page', 50);
48
 
49
  $start = ( $_GET['paged'] - 1 ) * $items_per_page;
50
 
products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php CHANGED
@@ -26,8 +26,7 @@ function nggallery_sortorder($galleryID = 0){
26
  $wpdb->query("UPDATE $wpdb->nggpictures SET sortorder = '$sortindex' WHERE pid = $pic_id");
27
  $sortindex++;
28
  }
29
-
30
- C_Photocrati_Cache::flush('displayed_gallery_rendering');
31
 
32
  do_action('ngg_gallery_sort', $galleryID);
33
 
26
  $wpdb->query("UPDATE $wpdb->nggpictures SET sortorder = '$sortindex' WHERE pid = $pic_id");
27
  $sortindex++;
28
  }
29
+ C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
 
30
 
31
  do_action('ngg_gallery_sort', $galleryID);
32
 
products/photocrati_nextgen/modules/ngglegacy/admin/manage.php CHANGED
@@ -213,7 +213,7 @@ class nggManageGallery {
213
 
214
  $output = array();
215
 
216
- $output[] = "<div><strong><a href='{$image_url}' class='thickbox' title='{$filename}'>{$caption}</a></strong></div>";
217
  $output[] = '<div class="meta">'. esc_html($date) . '</div>';
218
  $output[] = "<div class='meta'>{$pixels}</div>";
219
  $output[] = "<label for='exclude_{$picture->pid}'>";
@@ -825,36 +825,39 @@ class nggManageGallery {
825
  nggAdmin::import_gallery($gallerypath, $this->gid);
826
  }
827
 
828
- if (isset ($_POST['addnewpage'])) {
829
- // Add a new page
830
-
831
- check_admin_referer('ngg_updategallery');
832
-
833
- $parent_id = esc_attr($_POST['parent_id']);
834
- $gallery_title = esc_attr($_POST['title']);
835
- $gallery_name = $wpdb->get_var("SELECT name FROM $wpdb->nggallery WHERE gid = '$this->gid' ");
836
-
837
- // Create a WP page
838
- global $user_ID;
839
-
840
- $page['post_type'] = 'page';
841
- $page['post_content'] = '[nggallery id=' . $this->gid . ']';
842
- $page['post_parent'] = $parent_id;
843
- $page['post_author'] = $user_ID;
844
- $page['post_status'] = 'publish';
845
- $page['post_title'] = $gallery_title == '' ? $gallery_name : $gallery_title;
846
- $page = apply_filters('ngg_add_new_page', $page, $this->gid);
847
-
848
- $gallery_pageid = wp_insert_post ($page);
849
- if ($gallery_pageid != 0) {
850
- $result = $wpdb->query("UPDATE $wpdb->nggallery SET title= '$gallery_title', pageid = '$gallery_pageid' WHERE gid = '$this->gid'");
851
- wp_cache_delete($this->gid, 'ngg_gallery');
852
- nggGallery::show_message( __('New gallery page ID','nggallery'). ' ' . $gallery_pageid . ' -> <strong>' . $gallery_title . '</strong> ' .__('created','nggallery') );
853
- }
 
 
 
854
 
855
  do_action('ngg_gallery_addnewpage', $this->gid);
856
- }
857
- }
858
 
859
  /**
860
  * Publish a new post with the shortcode from the selected image
213
 
214
  $output = array();
215
 
216
+ $output[] = "<div><strong><a href='{$image_url}' class='thickbox' title='{$caption}'>{$filename}</a></strong></div>";
217
  $output[] = '<div class="meta">'. esc_html($date) . '</div>';
218
  $output[] = "<div class='meta'>{$pixels}</div>";
219
  $output[] = "<label for='exclude_{$picture->pid}'>";
825
  nggAdmin::import_gallery($gallerypath, $this->gid);
826
  }
827
 
828
+ // Add a new page
829
+ if (isset ($_POST['addnewpage']))
830
+ {
831
+ check_admin_referer('ngg_updategallery');
832
+
833
+ $parent_id = esc_attr($_POST['parent_id']);
834
+ $gallery_title = esc_attr($_POST['title']);
835
+ $mapper = C_Gallery_Mapper::get_instance();
836
+ $gallery = $mapper->find($this->gid);
837
+ $gallery_name = $gallery->name;
838
+
839
+ // Create a WP page
840
+ global $user_ID;
841
+
842
+ $page['post_type'] = 'page';
843
+ $page['post_content'] = '[nggallery id=' . $this->gid . ']';
844
+ $page['post_parent'] = $parent_id;
845
+ $page['post_author'] = $user_ID;
846
+ $page['post_status'] = 'publish';
847
+ $page['post_title'] = $gallery_title == '' ? $gallery_name : $gallery_title;
848
+ $page = apply_filters('ngg_add_new_page', $page, $this->gid);
849
+
850
+ $gallery_pageid = wp_insert_post ($page);
851
+ if ($gallery_pageid != 0)
852
+ {
853
+ $gallery->pageid = $gallery_pageid;
854
+ $mapper->save($gallery);
855
+ nggGallery::show_message(__('New gallery page ID', 'nggallery') . ' ' . $gallery_pageid . ' -> <strong>' . $gallery_title . '</strong> ' . __('created','nggallery'));
856
+ }
857
 
858
  do_action('ngg_gallery_addnewpage', $this->gid);
859
+ }
860
+ }
861
 
862
  /**
863
  * Publish a new post with the shortcode from the selected image
products/photocrati_nextgen/modules/ngglegacy/admin/roles.php CHANGED
@@ -23,8 +23,9 @@ if ( !empty($_POST) ) {
23
 
24
  ?>
25
  <div class="wrap">
26
- <p><?php _e('Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress.', 'nggallery') ?> <br />
27
- <?php _e('For a more flexible user management you can use the', 'nggallery') ?> <a href="http://wordpress.org/extend/plugins/capsman/" target="_blank">Capability Manager</a>.</p>
 
28
  <?php wp_nonce_field('ngg_addroles') ?>
29
  <table class="form-table">
30
  <tr valign="top">
23
 
24
  ?>
25
  <div class="wrap">
26
+ <p>
27
+ <?php _e('Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress.', 'nggallery') ?> <br />
28
+ </p>
29
  <?php wp_nonce_field('ngg_addroles') ?>
30
  <table class="form-table">
31
  <tr valign="top">
products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php CHANGED
@@ -37,6 +37,9 @@ $class = '';
37
  </thead>
38
  <?php
39
  foreach ($dbdata as $key => $value){
 
 
 
40
  if ( is_array($value) ) continue;
41
  $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
42
  echo '<tr '.$class.'>
@@ -63,6 +66,9 @@ $class = '';
63
  </thead>
64
  <?php
65
  foreach ($exifdata as $key => $value){
 
 
 
66
  $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
67
  echo '<tr '.$class.'>
68
  <td style="width:230px">' . esc_html ( $meta->i18n_name($key) ) . '</td>
@@ -88,6 +94,9 @@ $class = '';
88
  </thead>
89
  <?php
90
  foreach ($iptcdata as $key => $value){
 
 
 
91
  $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
92
  echo '<tr '.$class.'>
93
  <td style="width:230px">' . esc_html( $meta->i18n_name($key) ) . '</td>
@@ -112,6 +121,9 @@ $class = '';
112
  </thead>
113
  <?php
114
  foreach ($xmpdata as $key => $value){
 
 
 
115
  $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
116
  echo '<tr '.$class.'>
117
  <td style="width:230px">' . esc_html( $meta->i18n_name($key) ) . '</td>
37
  </thead>
38
  <?php
39
  foreach ($dbdata as $key => $value){
40
+ if (in_array($key, array('created_timestamp', 'timestamp')) && is_numeric($value)) {
41
+ $value = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $value);
42
+ }
43
  if ( is_array($value) ) continue;
44
  $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
45
  echo '<tr '.$class.'>
66
  </thead>
67
  <?php
68
  foreach ($exifdata as $key => $value){
69
+ if (in_array($key, array('created_timestamp', 'timestamp')) && is_numeric($value)) {
70
+ $value = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $value);
71
+ }
72
  $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
73
  echo '<tr '.$class.'>
74
  <td style="width:230px">' . esc_html ( $meta->i18n_name($key) ) . '</td>
94
  </thead>
95
  <?php
96
  foreach ($iptcdata as $key => $value){
97
+ if (in_array($key, array('created_timestamp', 'timestamp')) && is_numeric($value)) {
98
+ $value = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $value);
99
+ }
100
  $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
101
  echo '<tr '.$class.'>
102
  <td style="width:230px">' . esc_html( $meta->i18n_name($key) ) . '</td>
121
  </thead>
122
  <?php
123
  foreach ($xmpdata as $key => $value){
124
+ if (in_array($key, array('created_timestamp', 'timestamp')) && is_numeric($value)) {
125
+ $value = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $value);
126
+ }
127
  $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
128
  echo '<tr '.$class.'>
129
  <td style="width:230px">' . esc_html( $meta->i18n_name($key) ) . '</td>
products/photocrati_nextgen/modules/ngglegacy/lib/meta.php CHANGED
@@ -49,7 +49,7 @@ class nggMeta{
49
 
50
  // get exif - data
51
  if ( is_callable('exif_read_data'))
52
- $this->exif_data = @exif_read_data($imagePath , 0, true );
53
 
54
  // stop here if we didn't need other meta data
55
  if ($onlyEXIF)
@@ -121,19 +121,19 @@ class nggMeta{
121
 
122
  $meta= array();
123
 
124
- if ( isset($this->exif_data['EXIF']) ) {
125
- $exif = $this->exif_data['EXIF'];
126
 
127
  if (!empty($exif['FNumber']))
128
  $meta['aperture'] = 'F ' . round( $this->exif_frac2dec( $exif['FNumber'] ), 2 );
129
  if (!empty($exif['Model']))
130
  $meta['camera'] = trim( $exif['Model'] );
131
  if (!empty($exif['DateTimeDigitized']))
132
- $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeDigitized']));
133
  else if (!empty($exif['DateTimeOriginal']))
134
- $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeOriginal']));
135
  else if (!empty($exif['FileDateTime']))
136
- $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['FileDateTime']));
137
  if (!empty($exif['FocalLength']))
138
  $meta['focal_length'] = $this->exif_frac2dec( $exif['FocalLength'] ) . __(' mm','nggallery');
139
  if (!empty($exif['ISOSpeedRatings']))
@@ -204,13 +204,17 @@ class nggMeta{
204
  }
205
 
206
  // convert the exif date format to a unix timestamp
207
- function exif_date2ts($str) {
208
- // seriously, who formats a date like 'YYYY:MM:DD hh:mm:ss'?
209
- @list( $date, $time ) = explode( ' ', trim($str) );
210
- @list( $y, $m, $d ) = explode( ':', $date );
 
 
 
211
 
212
- return strtotime( "{$y}-{$m}-{$d} {$time}" );
213
- }
 
214
 
215
  /**
216
  * nggMeta::readIPTC() - IPTC Data Information for EXIF Display
@@ -390,7 +394,7 @@ class nggMeta{
390
  switch ($key) {
391
  case 'xap:CreateDate':
392
  case 'xap:ModifyDate':
393
- $this->xmp_array[$value] = date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($xmlarray[$key]));
394
  break;
395
  default :
396
  $this->xmp_array[$value] = $xmlarray[$key];
@@ -427,21 +431,24 @@ class nggMeta{
427
  * @param string $object
428
  * @return mixed $value
429
  */
430
- function get_META($object = false) {
431
-
432
- // defined order first look into database, then XMP, IPTC and EXIF.
433
- if ($value = $this->get_saved_meta($object))
434
- return $value;
435
- if ($value = $this->get_XMP($object))
436
- return $value;
437
- if ($value = $this->get_IPTC($object))
438
- return $value;
439
- if ($value = $this->get_EXIF($object))
440
- return $value;
 
 
 
441
 
442
- // nothing found ?
443
- return false;
444
- }
445
 
446
  /**
447
  * nggMeta::i8n_name() - localize the tag name
@@ -501,44 +508,24 @@ class nggMeta{
501
  * Return the Timestamp from the image , if possible it's read from exif data
502
  * @return int
503
  */
504
- function get_date_time() {
505
 
506
  $date = time();
507
 
508
- $imagePath = C_Gallery_Storage::get_instance()->get_image_abspath($this->image);
509
-
510
- // Try XMP first
511
- if (isset($this->xmp_array['created_timestamp'])) {
512
- $date = @strtotime($this->xmp_array['created_timestamp']);
513
- }
514
-
515
- // Then EXIF
516
- else if (isset($this->exif_array['created_timestamp'])) {
517
- $date = @strtotime($this->exif_array['created_timestamp']);
518
- }
519
-
520
- // Then IPTC
521
- else if (isset($this->iptc_array['created_date'])) {
522
- $date = $this->iptc_array['created_date'];
523
- if (isset($this->iptc_array['created_time'])) {
524
- $date .= " {$this->iptc_array['created_time']}";
525
- }
526
- $date = @strtotime($date);
527
- }
528
-
529
- // If all else fails, use the file creation time
530
- else if ($imagePath) {
531
- $date = @filectime($imagePath);
532
  }
533
 
534
  // Failback
535
  if (!$date) $date = time();
536
 
537
- // Return the MySQL format
538
- $date_time = date( 'Y-m-d H:i:s', $date);
539
 
540
- return $date_time;
541
- }
542
 
543
  /**
544
  * This function return the most common metadata, via a filter we can add more
49
 
50
  // get exif - data
51
  if ( is_callable('exif_read_data'))
52
+ $this->exif_data = @exif_read_data($imagePath , NULL, TRUE);
53
 
54
  // stop here if we didn't need other meta data
55
  if ($onlyEXIF)
121
 
122
  $meta= array();
123
 
124
+ $exif = isset($this->exif_array['EXIF']) ? $this->exif_array['EXIF'] : array();
125
+ if (count($exif)) {
126
 
127
  if (!empty($exif['FNumber']))
128
  $meta['aperture'] = 'F ' . round( $this->exif_frac2dec( $exif['FNumber'] ), 2 );
129
  if (!empty($exif['Model']))
130
  $meta['camera'] = trim( $exif['Model'] );
131
  if (!empty($exif['DateTimeDigitized']))
132
+ $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeDigitized']);
133
  else if (!empty($exif['DateTimeOriginal']))
134
+ $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeOriginal']);
135
  else if (!empty($exif['FileDateTime']))
136
+ $meta['created_timestamp'] = $this->exif_date2ts($exif['FileDateTime']);
137
  if (!empty($exif['FocalLength']))
138
  $meta['focal_length'] = $this->exif_frac2dec( $exif['FocalLength'] ) . __(' mm','nggallery');
139
  if (!empty($exif['ISOSpeedRatings']))
204
  }
205
 
206
  // convert the exif date format to a unix timestamp
207
+ function exif_date2ts($str)
208
+ {
209
+ $retval = is_numeric($str) ? $str : @strtotime($str);
210
+ if (!$retval && $str) {
211
+ @list( $date, $time ) = explode( ' ', trim($str) );
212
+ @list( $y, $m, $d ) = explode( ':', $date );
213
+ $retval = strtotime( "{$y}-{$m}-{$d} {$time}" );
214
 
215
+ }
216
+ return $retval;
217
+ }
218
 
219
  /**
220
  * nggMeta::readIPTC() - IPTC Data Information for EXIF Display
394
  switch ($key) {
395
  case 'xap:CreateDate':
396
  case 'xap:ModifyDate':
397
+ $this->xmp_array[$value] = $this->exif_date2ts($xmlarray[$key]);
398
  break;
399
  default :
400
  $this->xmp_array[$value] = $xmlarray[$key];
431
  * @param string $object
432
  * @return mixed $value
433
  */
434
+ function get_META($object = false) {
435
+
436
+ // defined order first look into database, then XMP, IPTC and EXIF.
437
+ if ($value = $this->get_saved_meta($object))
438
+ return $value;
439
+ if ($value = $this->get_XMP($object))
440
+ return $value;
441
+ if ($object == 'created_timestamp' && ($d = $this->get_IPTC('created_date')) && ($t = $this->get_IPTC('created_time'))) {
442
+ return $this->exif_date2ts($d . ' '.$t);
443
+ }
444
+ if ($value = $this->get_IPTC($object))
445
+ return $value;
446
+ if ($value = $this->get_EXIF($object))
447
+ return $value;
448
 
449
+ // nothing found ?
450
+ return false;
451
+ }
452
 
453
  /**
454
  * nggMeta::i8n_name() - localize the tag name
508
  * Return the Timestamp from the image , if possible it's read from exif data
509
  * @return int
510
  */
511
+ function get_date_time() {
512
 
513
  $date = time();
514
 
515
+ $date = $this->exif_date2ts($this->get_META('created_timestamp'));
516
+ if (!$date) {
517
+ $image_path = C_Gallery_Storage::get_instance()->get_backup_abspath($this->image);
518
+ $date = @filectime($image_path);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
  }
520
 
521
  // Failback
522
  if (!$date) $date = time();
523
 
524
+ // Return the MySQL format
525
+ $date_time = date( 'Y-m-d H:i:s', $date);
526
 
527
+ return $date_time;
528
+ }
529
 
530
  /**
531
  * This function return the most common metadata, via a filter we can add more
products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php CHANGED
@@ -158,6 +158,11 @@ class nggPostThumbnail {
158
  */
159
  function ajax_set_post_thumbnail()
160
  {
 
 
 
 
 
161
  global $post_ID;
162
 
163
  // check for correct capability
@@ -178,138 +183,7 @@ class nggPostThumbnail {
178
  die('0');
179
  }
180
 
181
- if ($thumbnail_id != null)
182
- {
183
- $imap = C_Image_Mapper::get_instance();
184
- $storage = C_Gallery_Storage::get_instance();
185
-
186
- $image = $imap->find($thumbnail_id);
187
-
188
- // for NGG we look for the image id
189
- if ($image)
190
- {
191
- $image_id = $thumbnail_id;
192
-
193
- $args = array(
194
- 'post_type' => 'attachment',
195
- 'meta_key' => '_ngg_image_id',
196
- 'meta_compare' => '==',
197
- 'meta_value' => $image_id
198
- );
199
-
200
- $upload_dir = wp_upload_dir();
201
- $basedir = $upload_dir['basedir'];
202
- $thumbs_dir = implode(DIRECTORY_SEPARATOR, array($basedir, 'ngg_featured'));
203
- $gallery_abspath = $storage->get_gallery_abspath($image->galleryid);
204
- $image_abspath = $storage->get_full_abspath($image);
205
- $target_path = null;
206
-
207
- $posts = get_posts($args);
208
- $attachment_id = null;
209
-
210
- if ($posts != null)
211
- {
212
- $attachment_id = $posts[0]->ID;
213
- }
214
- else
215
- {
216
- $url = $storage->get_full_url($image);
217
-
218
- $target_relpath = null;
219
- $target_basename = M_I18n::mb_basename($image_abspath);
220
-
221
- if (strpos($image_abspath, $gallery_abspath) === 0)
222
- {
223
- $target_relpath = substr($image_abspath, strlen($gallery_abspath));
224
- }
225
- else if ($image->galleryid)
226
- {
227
- $target_relpath = path_join(strval($image->galleryid), $target_basename);
228
- }
229
- else
230
- {
231
- $target_relpath = $target_basename;
232
- }
233
-
234
- $target_relpath = trim($target_relpath, '\\/');
235
- $target_path = path_join($thumbs_dir, $target_relpath);
236
- $max_count = 100;
237
- $count = 0;
238
-
239
- while (file_exists($target_path) && $count <= $max_count)
240
- {
241
- $count++;
242
-
243
- $pathinfo = M_I18n::mb_pathinfo($target_path);
244
- $dirname = $pathinfo['dirname'];
245
- $filename = $pathinfo['filename'];
246
- $extension = $pathinfo['extension'];
247
-
248
- $rand = mt_rand(1, 9999);
249
- $basename = $filename . '_' . sprintf('%04d', $rand) . '.' . $extension;
250
-
251
- $target_path = path_join($dirname, $basename);
252
- }
253
-
254
- if (file_exists($target_path))
255
- {
256
- // XXX handle very rare case in which $max_count wasn't enough?
257
- }
258
-
259
- $target_dir = dirname($target_path);
260
-
261
- wp_mkdir_p($target_dir);
262
-
263
- if (@copy($image_abspath, $target_path))
264
- {
265
- $size = @getimagesize($target_path);
266
- $image_type = ($size) ? $size['mime'] : 'image/jpeg';
267
-
268
- $title = sanitize_file_name($image->alttext);
269
- $caption = sanitize_file_name($image->description);
270
-
271
- $attachment = array(
272
- 'post_title' => $title,
273
- 'post_content' => $caption,
274
- 'post_status' => 'attachment',
275
- 'post_parent' => 0,
276
- 'post_mime_type' => $image_type,
277
- 'guid' => $url
278
- );
279
-
280
- // Save the data
281
- $attachment_id = wp_insert_attachment($attachment, $target_path);
282
-
283
- if ($attachment_id)
284
- {
285
- wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $target_path));
286
-
287
- update_post_meta($attachment_id, '_ngg_image_id', $image_id);
288
- }
289
- }
290
- }
291
-
292
- if ($attachment_id)
293
- {
294
- //$attachment = get_post($attachment_id);
295
- //$attachment_meta = wp_get_attachment_metadata($attachment_id);
296
- $attachment_file = get_attached_file($attachment_id);
297
- $target_path = $attachment_file;
298
-
299
- if (filemtime($image_abspath) > filemtime($target_path))
300
- {
301
- if (@copy($image_abspath, $target_path))
302
- {
303
- wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $target_path));
304
- }
305
- }
306
-
307
- die(strval($attachment_id));
308
- }
309
- }
310
- }
311
-
312
- die('0');
313
  }
314
 
315
  /**
158
  */
159
  function ajax_set_post_thumbnail()
160
  {
161
+ // This function does the following:
162
+ // 1) Check if the user is logged in and has permission to edit the post
163
+ // 2) Get the thumbnail id from the POST request. The thumbnail id is actually the NGG image id
164
+ // 3)]
165
+
166
  global $post_ID;
167
 
168
  // check for correct capability
183
  die('0');
184
  }
185
 
186
+ die(strval(C_Gallery_Storage::get_instance()->set_post_thumbnail($post_ID, $thumbnail_id)));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  }
188
 
189
  /**
products/photocrati_nextgen/modules/ngglegacy/xml/media-rss.php CHANGED
@@ -59,8 +59,13 @@ if ( $mode == 'last_pictures' ) {
59
  $first = current($galleries);
60
  $gid = $first->gid;
61
  }
62
-
63
-
 
 
 
 
 
64
  // Set the main gallery object
65
  $gallery = $galleries[$gid];
66
 
59
  $first = current($galleries);
60
  $gid = $first->gid;
61
  }
62
+
63
+ // account for the the odd logic used in selecting galleries here
64
+ if ($gid == 1)
65
+ $gid = 0;
66
+ elseif ($gid > 1)
67
+ $gid--;
68
+
69
  // Set the main gallery object
70
  $gallery = $galleries[$gid];
71
 
products/photocrati_nextgen/modules/router/package.module.router.php CHANGED
@@ -205,9 +205,9 @@ class Mixin_Router extends Mixin
205
  */
206
  public function get_request_uri($with_params = TRUE)
207
  {
208
- if (isset($_SERVER['ORIG_REQUEST_URI'])) {
209
  $retval = $_SERVER['ORIG_REQUEST_URI'];
210
- } elseif (isset($_SERVER['PATH_INFO'])) {
211
  $retval = $_SERVER['PATH_INFO'];
212
  } else {
213
  $retval = $_SERVER['REQUEST_URI'];
205
  */
206
  public function get_request_uri($with_params = TRUE)
207
  {
208
+ if (!empty($_SERVER['ORIG_REQUEST_URI'])) {
209
  $retval = $_SERVER['ORIG_REQUEST_URI'];
210
+ } elseif (!empty($_SERVER['PATH_INFO'])) {
211
  $retval = $_SERVER['PATH_INFO'];
212
  } else {
213
  $retval = $_SERVER['REQUEST_URI'];
products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php CHANGED
@@ -111,6 +111,7 @@ class M_Third_Party_Compat extends C_Base_Module
111
  add_filter('ngg_non_minified_modules', array($this, 'dont_minify_nextgen_pro_cssjs'));
112
  add_filter('run_ngg_resource_manager', array(&$this, 'check_woocommerce_download'));
113
  add_filter('run_ngg_resource_manager', array(&$this, 'check_wpecommerce_download'));
 
114
 
115
  // WPML fix
116
  if (class_exists('SitePress')) {
@@ -123,6 +124,19 @@ class M_Third_Party_Compat extends C_Base_Module
123
  add_action('the_post', array(&$this, 'add_ngg_pro_page_parameter'));
124
  }
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  /**
127
  * Determine if the requested URL is a WooCommerce download and adjust the resource manager
128
  *
@@ -259,7 +273,7 @@ class M_Third_Party_Compat extends C_Base_Module
259
 
260
  global $wp_filter;
261
 
262
- if (empty($wp_filter['init'][2]))
263
  return;
264
 
265
  foreach ($wp_filter['init'][2] as $id => $filter) {
@@ -273,6 +287,13 @@ class M_Third_Party_Compat extends C_Base_Module
273
 
274
  remove_action('init', array($object, 'js_load'), 2);
275
  }
 
 
 
 
 
 
 
276
  }
277
 
278
  /**
@@ -452,12 +473,16 @@ class M_Third_Party_Compat extends C_Base_Module
452
  */
453
  function dont_minify_nextgen_pro_cssjs($modules_to_not_minify)
454
  {
455
- if (defined('NGG_PRO_PLUGIN_VERSION')) {
456
- $modules_to_not_minify += P_Photocrati_NextGen_Pro::$modules;
457
- }
458
- else if (defined('NGG_PLUS_PLUGIN_VERSION')) {
459
- $modules_to_not_minify += P_Photocrati_NextGen_Plus::$modules;
460
- }
 
 
 
 
461
 
462
  return $modules_to_not_minify;
463
  }
111
  add_filter('ngg_non_minified_modules', array($this, 'dont_minify_nextgen_pro_cssjs'));
112
  add_filter('run_ngg_resource_manager', array(&$this, 'check_woocommerce_download'));
113
  add_filter('run_ngg_resource_manager', array(&$this, 'check_wpecommerce_download'));
114
+ add_filter('run_ngg_resource_manager', array(&$this, 'check_mafs_download'));
115
 
116
  // WPML fix
117
  if (class_exists('SitePress')) {
124
  add_action('the_post', array(&$this, 'add_ngg_pro_page_parameter'));
125
  }
126
 
127
+ /**
128
+ * Determine if the requested URL is a Multiverso Advanced File Sharing download and adjust the resource manager
129
+ *
130
+ * @param bool $valid_request
131
+ * @return bool
132
+ */
133
+ function check_mafs_download($valid_request = TRUE)
134
+ {
135
+ if (function_exists('mv_install') && isset($_GET['upf']) && isset($_GET['id']))
136
+ $valid_request = FALSE;
137
+ return $valid_request;
138
+ }
139
+
140
  /**
141
  * Determine if the requested URL is a WooCommerce download and adjust the resource manager
142
  *
273
 
274
  global $wp_filter;
275
 
276
+ if (empty($wp_filter['init'][2]) && empty($wp_filter['after_setup_theme'][1]))
277
  return;
278
 
279
  foreach ($wp_filter['init'][2] as $id => $filter) {
287
 
288
  remove_action('init', array($object, 'js_load'), 2);
289
  }
290
+
291
+ foreach ($wp_filter['after_setup_theme'][1] as $id => $filter) {
292
+ if ($id !== 'wpml_installer_instance_delegator')
293
+ continue;
294
+
295
+ remove_action('after_setup_theme', 'wpml_installer_instance_delegator', 1);
296
+ }
297
  }
298
 
299
  /**
473
  */
474
  function dont_minify_nextgen_pro_cssjs($modules_to_not_minify)
475
  {
476
+
477
+ // TODO: once Pro 2.1.30 is widely circulated, we don't need to use
478
+ // the installer. We can use the component registry to fetch the product
479
+ // and call the product's get_modules_to_load() function
480
+ $installer = new C_NextGen_Product_Installer;
481
+
482
+ if (defined('NGG_PRO_PLUGIN_VERSION') && class_exists('P_Photocrati_NextGen_Pro'))
483
+ $modules_to_not_minify += $installer->get_modules_to_load_for('photocrati-nextgen-pro');
484
+ else if (defined('NGG_PLUS_PLUGIN_VERSION') && class_exists('P_Photocrati_NextGen_Plus'))
485
+ $modules_to_not_minify += $installer->get_modules_to_load_for('photocrati-nextgen-plus');
486
 
487
  return $modules_to_not_minify;
488
  }
products/photocrati_nextgen/modules/widget/package.module.widget.php CHANGED
@@ -130,7 +130,8 @@ class C_Widget_Gallery extends WP_Widget
130
  $after_widget = '</div>' . $after_widget;
131
  }
132
  $source = $instance['type'] == 'random' ? 'random_images' : 'recent';
133
- $params = array('slug' => 'widget-' . $args['widget_id'], 'source' => $source, 'display_type' => NGG_BASIC_THUMBNAILS, 'images_per_page' => $instance['items'], 'maximum_entity_count' => $instance['items'], 'template' => $view->get_template_abspath('photocrati-widget#display_gallery'), 'image_type' => $instance['show'] == 'original' ? 'full' : 'thumb', 'show_all_in_lightbox' => FALSE, 'show_slideshow_link' => FALSE, 'show_thumbnail_link' => FALSE, 'use_imagebrowser_effect' => FALSE, 'disable_pagination' => TRUE, 'image_width' => $instance['width'], 'image_height' => $instance['height'], 'ngg_triggers_display' => 'never', 'widget_setting_title' => $title, 'widget_setting_before_widget' => $before_widget, 'widget_setting_before_title' => $before_title, 'widget_setting_after_widget' => $after_widget, 'widget_setting_after_title' => $after_title, 'widget_setting_width' => $instance['width'], 'widget_setting_height' => $instance['height'], 'widget_setting_show_setting' => $instance['show'], 'widget_setting_widget_id' => $widget_id);
 
134
  switch ($instance['exclude']) {
135
  case 'all':
136
  break;
130
  $after_widget = '</div>' . $after_widget;
131
  }
132
  $source = $instance['type'] == 'random' ? 'random_images' : 'recent';
133
+ $template = !empty($instance['template']) ? $instance['template'] : $view->get_template_abspath('photocrati-widget#display_gallery');
134
+ $params = array('slug' => 'widget-' . $args['widget_id'], 'source' => $source, 'display_type' => NGG_BASIC_THUMBNAILS, 'images_per_page' => $instance['items'], 'maximum_entity_count' => $instance['items'], 'template' => $template, 'image_type' => $instance['show'] == 'original' ? 'full' : 'thumb', 'show_all_in_lightbox' => FALSE, 'show_slideshow_link' => FALSE, 'show_thumbnail_link' => FALSE, 'use_imagebrowser_effect' => FALSE, 'disable_pagination' => TRUE, 'image_width' => $instance['width'], 'image_height' => $instance['height'], 'ngg_triggers_display' => 'never', 'widget_setting_title' => $title, 'widget_setting_before_widget' => $before_widget, 'widget_setting_before_title' => $before_title, 'widget_setting_after_widget' => $after_widget, 'widget_setting_after_title' => $after_title, 'widget_setting_width' => $instance['width'], 'widget_setting_height' => $instance['height'], 'widget_setting_show_setting' => $instance['show'], 'widget_setting_widget_id' => $widget_id);
135
  switch ($instance['exclude']) {
136
  case 'all':
137
  break;
products/photocrati_nextgen/modules/wordpress_routing/package.module.wordpress_routing.php CHANGED
@@ -118,6 +118,9 @@ class A_WordPress_Routing_App extends Mixin
118
  */
119
  public function add_post_permalink_to_url($generated_url)
120
  {
 
 
 
121
  $base_url = $this->object->get_router()->get_base_url('home');
122
  $settings = C_NextGen_Settings::get_instance();
123
  if (strlen($generated_url) < 2) {
@@ -163,6 +166,8 @@ class A_WordPress_Routing_App extends Mixin
163
  $post_permalink = str_replace(home_url(), $base_url, $post_permalink);
164
  $post_parts = $this->parse_url($post_permalink);
165
  $post_parts['path'] = $this->object->join_paths($post_parts['path'], $settings->router_param_slug, $ngg_parameters);
 
 
166
  if (!empty($generated_parts['query']) && empty($post_parts['query'])) {
167
  $post_parts['query'] = $generated_parts['query'];
168
  }
@@ -179,9 +184,10 @@ class A_WordPress_Routing_App extends Mixin
179
  {
180
  $router = C_Router::get_instance();
181
  $_SERVER['ORIG_REQUEST_URI'] = $_SERVER['REQUEST_URI'];
182
- // TODO: Verify that we only need to do this on Windows
183
  $base_parts = parse_url($router->get_base_url('root'));
184
- $_SERVER['UNENCODED_URL'] = $_SERVER['HTTP_X_ORIGINAL_URL'] = $_SERVER['REQUEST_URI'] = '/' . trailingslashit($router->join_paths(!empty($base_parts['path']) ? $base_parts['path'] : '', $this->object->strip_param_segments($router->get_request_uri())));
 
 
185
  if (isset($_SERVER['PATH_INFO'])) {
186
  $_SERVER['ORIG_PATH_INFO'] = $_SERVER['PATH_INFO'];
187
  unset($_SERVER['PATH_INFO']);
118
  */
119
  public function add_post_permalink_to_url($generated_url)
120
  {
121
+ if (!apply_filters('ngg_wprouting_add_post_permalink', TRUE)) {
122
+ return $generated_url;
123
+ }
124
  $base_url = $this->object->get_router()->get_base_url('home');
125
  $settings = C_NextGen_Settings::get_instance();
126
  if (strlen($generated_url) < 2) {
166
  $post_permalink = str_replace(home_url(), $base_url, $post_permalink);
167
  $post_parts = $this->parse_url($post_permalink);
168
  $post_parts['path'] = $this->object->join_paths($post_parts['path'], $settings->router_param_slug, $ngg_parameters);
169
+ $post_parts['path'] = str_replace('index.php/index.php', 'index.php', $post_parts['path']);
170
+ // incase permalink_structure contains index.php
171
  if (!empty($generated_parts['query']) && empty($post_parts['query'])) {
172
  $post_parts['query'] = $generated_parts['query'];
173
  }
184
  {
185
  $router = C_Router::get_instance();
186
  $_SERVER['ORIG_REQUEST_URI'] = $_SERVER['REQUEST_URI'];
 
187
  $base_parts = parse_url($router->get_base_url('root'));
188
+ $new_request_uri = $router->join_paths(!empty($base_parts['path']) ? $base_parts['path'] : '', $this->object->strip_param_segments($router->get_request_uri()));
189
+ $new_request_uri = str_replace('index.php/index.php', 'index.php', $new_request_uri);
190
+ $_SERVER['UNENCODED_URL'] = $_SERVER['HTTP_X_ORIGINAL_URL'] = $_SERVER['REQUEST_URI'] = '/' . trailingslashit($new_request_uri);
191
  if (isset($_SERVER['PATH_INFO'])) {
192
  $_SERVER['ORIG_PATH_INFO'] = $_SERVER['PATH_INFO'];
193
  unset($_SERVER['PATH_INFO']);
products/photocrati_nextgen/modules/wpcli/module.wpcli.php CHANGED
@@ -44,19 +44,10 @@ if (class_exists('WP_CLI_Command')) {
44
  */
45
  function flush_cache($args, $assoc_args)
46
  {
47
- C_Photocrati_Cache::flush('all');
48
  WP_CLI::success('Flushed all caches');
49
  }
50
 
51
- /**
52
- * Flushes POPE code cache
53
- */
54
- function flush_pope_cache($args, $assoc_args)
55
- {
56
- C_Photocrati_Cache::flush('all', TRUE);
57
- WP_CLI::success('Flushed all expired items from the cache');
58
- }
59
-
60
  /**
61
  * Create a new gallery
62
  *
44
  */
45
  function flush_cache($args, $assoc_args)
46
  {
47
+ C_Photocrati_Transient_Manager::flush();
48
  WP_CLI::success('Flushed all caches');
49
  }
50
 
 
 
 
 
 
 
 
 
 
51
  /**
52
  * Create a new gallery
53
  *
products/photocrati_nextgen/product.photocrati_nextgen.php CHANGED
@@ -10,64 +10,81 @@ define('NGG_CHANGE_OPTIONS_CAP', 'NextGEN Manage gallery');
10
 
11
  class P_Photocrati_NextGen extends C_Base_Product
12
  {
13
- static $modules;
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- function define_modules()
16
- {
17
- self::$modules = array(
18
- 'photocrati-fs',
19
- 'photocrati-i18n',
20
- 'photocrati-validation',
21
- 'photocrati-router',
22
- 'photocrati-wordpress_routing',
23
- 'photocrati-security',
24
- 'photocrati-nextgen_settings',
25
- 'photocrati-mvc',
26
- 'photocrati-ajax',
27
- 'photocrati-datamapper',
28
- 'photocrati-nextgen-legacy',
29
- 'photocrati-nextgen-data',
30
- );
31
 
32
- self::$modules = array_merge(self::$modules, array(
33
- 'photocrati-dynamic_thumbnails',
34
- 'photocrati-nextgen_admin',
35
- 'photocrati-nextgen_gallery_display',
36
- 'photocrati-frame_communication',
37
- 'photocrati-attach_to_post',
38
- 'photocrati-nextgen_addgallery_page',
39
- 'photocrati-nextgen_other_options',
40
- 'photocrati-nextgen_pagination'
41
- ));
42
 
43
- if (!is_admin()) {
44
- self::$modules[] = 'photocrati-dynamic_stylesheet';
45
- self::$modules[] = 'photocrati-mediarss';
46
- }
47
 
48
- if (is_admin()) {
49
- self::$modules = array_merge(self::$modules, array(
50
- 'photocrati-nextgen_pro_upgrade',
51
- ));
52
- }
 
 
 
 
 
 
 
 
53
 
54
- self::$modules = array_merge(self::$modules, array(
55
- 'photocrati-cache',
56
- 'photocrati-lightbox',
57
- 'photocrati-nextgen_basic_templates',
58
- 'photocrati-nextgen_basic_gallery',
59
- 'photocrati-nextgen_basic_imagebrowser',
60
- 'photocrati-nextgen_basic_singlepic',
61
- 'photocrati-nextgen_basic_tagcloud',
62
- 'photocrati-nextgen_basic_album',
63
- 'photocrati-widget',
64
- 'photocrati-third_party_compat',
65
- 'photocrati-nextgen_xmlrpc'
66
- ));
67
 
68
- if (defined('WP_CLI') && WP_CLI)
69
- self::$modules = array_merge(self::$modules, array('photocrati-wpcli'));
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  function define()
73
  {
@@ -83,9 +100,7 @@ class P_Photocrati_NextGen extends C_Base_Product
83
 
84
  $module_path = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'modules'));
85
  $this->get_registry()->set_product_module_path($this->module_id, $module_path);
86
- $this->define_modules();
87
-
88
- foreach (self::$modules as $module_name) $this->_get_registry()->load_module($module_name);
89
 
90
  include_once('class.nextgen_product_installer.php');
91
  C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Product_Installer');
10
 
11
  class P_Photocrati_NextGen extends C_Base_Product
12
  {
13
+ static $modules_provided = array(
14
+ 'photocrati-fs' => 'always',
15
+ 'photocrati-i18n' => 'always',
16
+ 'photocrati-validation' => 'always',
17
+ 'photocrati-router' => 'always',
18
+ 'photocrati-wordpress_routing' => 'always',
19
+ 'photocrati-security' => 'always',
20
+ 'photocrati-nextgen_settings' => 'always',
21
+ 'photocrati-mvc' => 'always',
22
+ 'photocrati-ajax' => 'always',
23
+ 'photocrati-datamapper' => 'always',
24
+ 'photocrati-nextgen-legacy' => 'always',
25
+ 'photocrati-nextgen-data' => 'always',
26
 
27
+ // We should look at how to make the modules below only
28
+ // require loading in wp-admin
29
+ 'photocrati-dynamic_thumbnails' => 'always',
30
+ 'photocrati-nextgen_admin' => 'always',
31
+ 'photocrati-nextgen_gallery_display' => 'always',
32
+ 'photocrati-frame_communication' => 'always',
33
+ 'photocrati-attach_to_post' => 'always',
34
+ 'photocrati-nextgen_addgallery_page' => 'always',
35
+ 'photocrati-nextgen_other_options' => 'always',
36
+ 'photocrati-nextgen_pagination' => 'always',
 
 
 
 
 
 
37
 
38
+ // Front-end only
39
+ 'photocrati-dynamic_stylesheet' => 'frontend',
40
+ 'photocrati-mediarss' => 'frontend',
 
 
 
 
 
 
 
41
 
42
+ // Backend-only
43
+ 'photocrati-nextgen_pro_upgrade' => 'backend',
 
 
44
 
45
+ 'photocrati-cache' => 'always',
46
+ 'photocrati-lightbox' => 'always',
47
+ 'photocrati-nextgen_basic_templates' => 'always',
48
+ 'photocrati-nextgen_basic_gallery' => 'always',
49
+ 'photocrati-nextgen_basic_imagebrowser' => 'always',
50
+ 'photocrati-nextgen_basic_singlepic' => 'always',
51
+ 'photocrati-nextgen_basic_tagcloud' => 'always',
52
+ 'photocrati-nextgen_basic_album' => 'always',
53
+ 'photocrati-widget' => 'always',
54
+ 'photocrati-third_party_compat' => 'always',
55
+ 'photocrati-nextgen_xmlrpc' => 'always',
56
+ 'photocrati-wpcli' => 'other',
57
+ );
58
 
59
+ function get_modules_provided()
60
+ {
61
+ return array_keys(self::$modules_provided);
62
+ }
63
+
64
+ function get_modules_to_load()
65
+ {
66
+ $retval = array();
 
 
 
 
 
67
 
68
+ foreach (self::$modules_provided as $module_name => $condition) {
69
+ switch ($condition) {
70
+ case 'always':
71
+ $retval[] = $module_name;
72
+ break;
73
+ case 'backend':
74
+ if (is_admin()) $retval[] = $module_name;
75
+ break;
76
+ case 'frontend':
77
+ if (!is_admin()) $retval[] = $module_name;
78
+ break;
79
+ case 'other':
80
+ if ($module_name == 'photocrati-wpcli' && defined('WP_CLI') && WP_CLI)
81
+ $retval[] = 'photocrati-wpcli';
82
+ break;
83
+ }
84
+ }
85
+
86
+ return $retval;
87
+ }
88
 
89
  function define()
90
  {
100
 
101
  $module_path = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'modules'));
102
  $this->get_registry()->set_product_module_path($this->module_id, $module_path);
103
+ foreach ($this->get_modules_to_load() as $module_name) $this->_get_registry()->load_module($module_name);
 
 
104
 
105
  include_once('class.nextgen_product_installer.php');
106
  C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Product_Installer');
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: photocrati
3
  Tags: nextgen, nextgen gallery, gallery, galleries, image, images, image gallery, photo, photos, photo gallery, picture, pictures, picture gallery, album, albums, photo albums, image album, media, media gallery, thumbnails, thumbnail gallery, thumbnail galleries, slideshow, slideshows, slideshow gallery, slideshow galleries, fancybox, lightbox, responsive, responsive gallery, responsive galleries, wordpress responsive gallery, nextcellent, wordpress gallery plugin, wordpress photo gallery plugin, wp gallery, wp gallery plugins, best gallery plugin, free photo gallery, singlepic, image captions imagebrowser, watermarks, watermarking, photography, photographer
4
  Requires at least: 3.6.1
5
- Tested up to: 4.1.1
6
- Stable tag: 2.0.79
7
  License: GPLv2
8
 
9
  The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 12 million downloads.
@@ -199,15 +199,65 @@ For more information, feel free to visit the official website for the NextGEN Ga
199
 
200
  == Changelog ==
201
 
202
- = V2.0.79 - 03.20.2015 =
203
- * Secured: Usage of find_in_set() mysql function
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
 
205
- = V2.0.77.3 - 03.12.2015 =
206
- * Secured: Upload images and importing galleries from folders
207
  * Fixed: When importing galleries from folders, allow symlinks
208
  * Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper
209
  * Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts()
210
  * Fixed: Warning about missing style.php file on Network Admin -> Gallery page
 
 
 
 
211
 
212
  = V2.0.77 - 03.05.2015 =
213
  * NEW: Added "ngg_get_image_url" filter
2
  Contributors: photocrati
3
  Tags: nextgen, nextgen gallery, gallery, galleries, image, images, image gallery, photo, photos, photo gallery, picture, pictures, picture gallery, album, albums, photo albums, image album, media, media gallery, thumbnails, thumbnail gallery, thumbnail galleries, slideshow, slideshows, slideshow gallery, slideshow galleries, fancybox, lightbox, responsive, responsive gallery, responsive galleries, wordpress responsive gallery, nextcellent, wordpress gallery plugin, wordpress photo gallery plugin, wp gallery, wp gallery plugins, best gallery plugin, free photo gallery, singlepic, image captions imagebrowser, watermarks, watermarking, photography, photographer
4
  Requires at least: 3.6.1
5
+ Tested up to: 4.2.2
6
+ Stable tag: 2.1.0
7
  License: GPLv2
8
 
9
  The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 12 million downloads.
199
 
200
  == Changelog ==
201
 
202
+ = V2.1.0 - 05.18.2015 =
203
+ * NEW: Album breadcrumbs and pagination
204
+ * NEW: Ability to override builtin MVC templates
205
+ * NEW: Robust transient management
206
+ * NEW: Added the ability to set post thumbnails via XML-RPC module
207
+ * NEW: Added 'ngg_get_image_size_params' filter to control image generation
208
+ * NEW: Added 'ngg_basic_tagcloud_title' and 'ngg_basic_tagcloud_excluded_display_types' filters
209
+ * NEW: Added ngg_manage_images_items_per_page filter
210
+ * NEW: Added "ngg_get_image_url" filter
211
+ * NEW: Including Ukranian and Polish translations
212
+ * NEW: The ability to set template in widgets
213
+ * Changed: Default thumbnail dimensions set to 240x160
214
+ * Changed: Product now adheres to Pope 0.12 and provides get_modules_to_load()
215
+ * Changed: Updated translations
216
+ * Changed: Removed link to capsman plugin in Roles accordion
217
+ * Changed: Taxnomies now use internationalized strings
218
+ * Changed: Image date/time meta data fields are stored as UNIX timestamps
219
+ * Secured: Uploading zips
220
+ * Fixed: Various PHP warnings and notices
221
+ * Fixed: Compatibility fixes for WPML
222
+ * Fixed: Ensure that backup image functionality fails gracefully
223
+ * Fixed: WP option 'ngg_do_upgrade' updated in every HTTP request
224
+ * Fixed; Empty $_SERVER['PATHINFO'] causing multiple routing issues
225
+ * Fixed: "Manage Galleries" display image alttext in the filename column
226
+ * Fixed: Various issues with the tag cloud display type
227
+ * Fixed: Integrity check when updating from 1.9.x
228
+ * Fixed: Image filenames substituting spaces for + which is only proper in the query string
229
+ * Fixed: Insert Gallery Window not working with nested levels of gzip compression
230
+ * Fixed: Imagebrowser as lightbox effect not working with pagination
231
+ * Fixed: Compatibility with MultiVerso Advanced File Sharing
232
+ * Fixed: "Add page" button not displaying on the next immediate page load
233
+ * Fixed: Double-escaping of non-latin characters
234
+ * Fixed: Imagebrowser pagination with custom templates
235
+ * Fixed: Custom CSS is enqueued late to ensure it's one of the last stylesheets loaded
236
+ * Fixed: Fixed watermarking PNG images
237
+ * Fixed: Using the "Import Metadata" bulk action overwrites existing data
238
+ * Fixed: Seconds were not retained from CaptureTime EXIF field
239
+ * Fixed: Conflicts created by our TinyMCE plugin
240
+ * Fixed: Image mapper setting gid to gallery name, not the unique ID
241
+ * Fixed: Restored nggdb->get_random_images(), nggdb->search_for_file, and nggdb->find_all_albums()
242
+ * Fixed: Allow gallery slug as parameter to nggdb::get_gallery()
243
+ * Fixed: Don't minify Plupload's i18n JavaScript
244
+ * Fixed: Custom template images not being given their full effect code attributes
245
+ * Fixed: When importing galleries from folders, allow symlinks
246
+ * Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper
247
+ * Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts()
248
+ * Fixed: Warning about missing style.php file on Network Admin -> Gallery page
249
+ * Fixed: Warning about getimagesize() failure when backing up an image
250
 
251
+ = V2.0.78.1 - 03.12.2015 =
252
+ * Changed: Image date/time meta data fields are stored as UNIX timestamps
253
  * Fixed: When importing galleries from folders, allow symlinks
254
  * Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper
255
  * Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts()
256
  * Fixed: Warning about missing style.php file on Network Admin -> Gallery page
257
+ * Fixed: Warning about getimagesize() failure when backing up an image
258
+
259
+ = V2.0.78 - 03.12.2015 =
260
+ * Secured: AJAX actions for uploading images and importing folders now uses nonce checks
261
 
262
  = V2.0.77 - 03.05.2015 =
263
  * NEW: Added "ngg_get_image_url" filter