NextGEN Gallery – WordPress Gallery Plugin - Version 1.8.1

Version Description

  • 18.06.2011 =
  • Bugfix : Special case for pagination, instead of showing page-1, we show the clean url
  • Bugfix : Various PHP notice fixes
  • Bugfix : Typo in rewrite rules
  • Bugfix : Flush rewrite rules during upgrade later
Download this release

Release Info

Developer alexrabe
Plugin Icon 128x128 NextGEN Gallery – WordPress Gallery Plugin
Version 1.8.1
Comparing to
See all releases

Code changes from version 1.8.0 to 1.8.1

admin/admin.php CHANGED
@@ -377,9 +377,9 @@ class nggAdminPanel{
377
  // we would like to have screen option only at the manage images / gallery page
378
  if ( isset ($_POST['sortGallery']) )
379
  $screen = $screen;
380
- else if ( ($_GET['mode'] == 'edit') || isset ($_POST['backToGallery']) )
381
  $screen->base = $screen->id = 'nggallery-manage-images';
382
- else if ( ($_GET['mode'] == 'sort') )
383
  $screen = $screen;
384
  else
385
  $screen->base = $screen->id = 'nggallery-manage-gallery';
377
  // we would like to have screen option only at the manage images / gallery page
378
  if ( isset ($_POST['sortGallery']) )
379
  $screen = $screen;
380
+ else if ( (isset($_GET['mode']) && $_GET['mode'] == 'edit') || isset ($_POST['backToGallery']) )
381
  $screen->base = $screen->id = 'nggallery-manage-images';
382
+ else if ( (isset($_GET['mode']) && $_GET['mode'] == 'sort') )
383
  $screen = $screen;
384
  else
385
  $screen->base = $screen->id = 'nggallery-manage-gallery';
admin/manage-images.php CHANGED
@@ -661,7 +661,8 @@ class _NGG_Images_List_Table extends WP_List_Table {
661
  $columns = get_column_headers( $this->_screen );
662
  $hidden = get_hidden_columns( $this->_screen );
663
  $_sortable = $this->get_sortable_columns();
664
-
 
665
  foreach ( $_sortable as $id => $data ) {
666
  if ( empty( $data ) )
667
  continue;
661
  $columns = get_column_headers( $this->_screen );
662
  $hidden = get_hidden_columns( $this->_screen );
663
  $_sortable = $this->get_sortable_columns();
664
+ $sortable = array();
665
+
666
  foreach ( $_sortable as $id => $data ) {
667
  if ( empty( $data ) )
668
  continue;
admin/upgrade.php CHANGED
@@ -107,9 +107,6 @@ function ngg_upgrade() {
107
  update_option( "ngg_db_version", NGG_DBVERSION );
108
  echo __('finished', 'nggallery') . "<br />\n";
109
 
110
- // better to flush rewrite rules after upgrades
111
- $nggRewrite->flush();
112
-
113
  $wpdb->hide_errors();
114
 
115
  // *** From here we start file operation which could failed sometimes,
@@ -189,6 +186,9 @@ function ngg_upgrade() {
189
  update_option('ngg_options', $ngg_options);
190
  echo __('Updated options.', 'nggallery');
191
  }
 
 
 
192
  return;
193
  }
194
 
107
  update_option( "ngg_db_version", NGG_DBVERSION );
108
  echo __('finished', 'nggallery') . "<br />\n";
109
 
 
 
 
110
  $wpdb->hide_errors();
111
 
112
  // *** From here we start file operation which could failed sometimes,
186
  update_option('ngg_options', $ngg_options);
187
  echo __('Updated options.', 'nggallery');
188
  }
189
+
190
+ // better to flush rewrite rules after upgrades
191
+ $nggRewrite->flush();
192
  return;
193
  }
194
 
changelog.txt CHANGED
@@ -6,6 +6,12 @@ by Alex Rabe & NextGEN DEV Team
6
  * TODO : Switch to Plupload (http://www.plupload.com/)
7
  * TODO : Rework album page for large amount of galleries
8
 
 
 
 
 
 
 
9
  = V1.8.0 - 12.06.2011 =
10
  * NEW : Full rework of permalink url structure
11
  * NEW : Adding Google Sitemaps for Images (require WordPress SEO plugin by YOAST )
6
  * TODO : Switch to Plupload (http://www.plupload.com/)
7
  * TODO : Rework album page for large amount of galleries
8
 
9
+ = V1.8.1 - 18.06.2011 =
10
+ * Bugfix : Special case for pagination, instead of showing page-1, we show the clean url
11
+ * Bugfix : Various PHP notice fixes
12
+ * Bugfix : Typo in rewrite rules
13
+ * Bugfix : Flush rewrite rules during upgrade later
14
+
15
  = V1.8.0 - 12.06.2011 =
16
  * NEW : Full rework of permalink url structure
17
  * NEW : Adding Google Sitemaps for Images (require WordPress SEO plugin by YOAST )
lib/rewrite.php CHANGED
@@ -75,7 +75,7 @@ class nggRewrite {
75
 
76
  // 1. Post / Page url + main slug
77
  $url = trailingslashit ( get_permalink ($post->ID) ) . $this->slug;
78
-
79
  // 2. Album, pid or tags
80
  if (isset ($args['album']) && ($args['gallery'] == false) )
81
  $url .= '/' . $args['album'];
@@ -91,6 +91,8 @@ class nggRewrite {
91
  // 3. Navigation
92
  if (isset ($args['nggpage']) && ($args['nggpage']) )
93
  $url .= '/page-' . $args['nggpage'];
 
 
94
 
95
  // 4. Show images or Slideshow
96
  if (isset ($args['show']))
@@ -239,7 +241,7 @@ class nggRewrite {
239
  '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/slideshow/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&show=slide',
240
  '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/images/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&show=gallery',
241
  '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/page-([0-9]+)/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&nggpage=$matches[4]',
242
- '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/page-([0-9]+)/slideshow/?$' => 'index.php?pagename=$matches[1]&album=$matches[21]&gallery=$matches[3]&nggpage=$matches[4]&show=slide',
243
  '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/page-([0-9]+)/images/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&nggpage=$matches[4]&show=gallery',
244
  '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/image/([^/]+)/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&pid=$matches[4]',
245
 
75
 
76
  // 1. Post / Page url + main slug
77
  $url = trailingslashit ( get_permalink ($post->ID) ) . $this->slug;
78
+
79
  // 2. Album, pid or tags
80
  if (isset ($args['album']) && ($args['gallery'] == false) )
81
  $url .= '/' . $args['album'];
91
  // 3. Navigation
92
  if (isset ($args['nggpage']) && ($args['nggpage']) )
93
  $url .= '/page-' . $args['nggpage'];
94
+ elseif (isset ($args['nggpage']) && ($args['nggpage'] === false) && ( count($args) == 1 ) )
95
+ $url = trailingslashit ( get_permalink ($post->ID) ); // special case instead of showing page-1, we show the clean url
96
 
97
  // 4. Show images or Slideshow
98
  if (isset ($args['show']))
241
  '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/slideshow/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&show=slide',
242
  '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/images/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&show=gallery',
243
  '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/page-([0-9]+)/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&nggpage=$matches[4]',
244
+ '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/page-([0-9]+)/slideshow/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&nggpage=$matches[4]&show=slide',
245
  '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/page-([0-9]+)/images/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&nggpage=$matches[4]&show=gallery',
246
  '(.+?)/' . $this->slug . '/([^/]+)/([^/]+)/image/([^/]+)/?$' => 'index.php?pagename=$matches[1]&album=$matches[2]&gallery=$matches[3]&pid=$matches[4]',
247
 
nggallery.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: NextGEN Gallery
4
  Plugin URI: http://alexrabe.de/?page_id=80
5
  Description: A NextGENeration Photo Gallery for WordPress
6
  Author: Alex Rabe
7
- Version: 1.8.0
8
 
9
  Author URI: http://alexrabe.de/
10
 
@@ -34,9 +34,9 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
34
  if (!class_exists('nggLoader')) {
35
  class nggLoader {
36
 
37
- var $version = '1.8.0';
38
  var $dbversion = '1.8.0';
39
- var $minium_WP = '3.0';
40
  var $donators = 'http://nextgen.boelinger.com/donators.php';
41
  var $options = '';
42
  var $manage_page;
@@ -189,7 +189,7 @@ class nggLoader {
189
  $this->memory_limit = ini_get('memory_limit');
190
 
191
  // Yes, we reached Gigabyte limits, so check if it's a megabyte limit
192
- if (strtolower( substr($memory_limit, -1) ) == 'm') {
193
 
194
  $this->memory_limit = (int) substr( $this->memory_limit, 0, -1);
195
 
4
  Plugin URI: http://alexrabe.de/?page_id=80
5
  Description: A NextGENeration Photo Gallery for WordPress
6
  Author: Alex Rabe
7
+ Version: 1.8.1
8
 
9
  Author URI: http://alexrabe.de/
10
 
34
  if (!class_exists('nggLoader')) {
35
  class nggLoader {
36
 
37
+ var $version = '1.8.1';
38
  var $dbversion = '1.8.0';
39
+ var $minium_WP = '3.1';
40
  var $donators = 'http://nextgen.boelinger.com/donators.php';
41
  var $options = '';
42
  var $manage_page;
189
  $this->memory_limit = ini_get('memory_limit');
190
 
191
  // Yes, we reached Gigabyte limits, so check if it's a megabyte limit
192
+ if (strtolower( substr($this->memory_limit, -1) ) == 'm') {
193
 
194
  $this->memory_limit = (int) substr( $this->memory_limit, 0, -1);
195
 
nggfunctions.php CHANGED
@@ -245,7 +245,7 @@ function nggCreateGallery($picturelist, $galleryID = false, $template = '', $ima
245
  $pid = get_query_var('pid');
246
 
247
  // in case of permalinks the pid is a slug, we need the id
248
- if( !is_numeric($pid) ) {
249
  $picture = nggdb::find_image($pid);
250
  $pid = $picture->pid;
251
  }
245
  $pid = get_query_var('pid');
246
 
247
  // in case of permalinks the pid is a slug, we need the id
248
+ if( !is_numeric($pid) && !empty($pid) ) {
249
  $picture = nggdb::find_image($pid);
250
  $pid = $picture->pid;
251
  }
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: alexrabe
3
  Donate link: http://alexrabe.de/donation/
4
  Tags: photos,flash,slideshow,images,gallery,media,admin,post,photo-albums,pictures,widgets,photo,picture,image,nextgen-gallery,nextgen gallery
5
- Requires at least: 3.0
6
  Tested up to: 3.2
7
  Stable tag: trunk
8
 
@@ -13,13 +13,10 @@ NextGEN Gallery is a full integrated Image Gallery plugin for WordPress with doz
13
  NextGEN Gallery is a full integrated Image Gallery plugin for WordPress with a slideshow option. Before I started writing the plugin I studied all the existing image and gallery plugins for WordPress.
14
  Some of them are really good and well designed, but the gap I filled was a simple administration system at the back end which can also handle multiple galleries.
15
 
16
- Important Links:
17
-
18
- * <a href="http://nextgen-gallery.com/" title="Demonstration page">Demonstration</a>
19
- * <a href="http://alexrabe.de/wordpress-plugins/nextgen-gallery/languages/" title="Translation and Language files">Language files</a>
20
- * <a href="http://wordpress.org/extend/plugins/nextgen-gallery/changelog/" title="NextGEN Gallery Changelog">Changelog</a>
21
- * <a href="http://alexrabe.de/wordpress-plugins/nextgen-gallery/faq/" title="NextGEN Gallery FAQ">NextGEN Gallery FAQ</a>
22
- * <a href="http://wordpress.org/tags/nextgen-gallery?forum_id=10" title="Wordpress Support Forum">Support Forum</a>
23
 
24
  = Features =
25
 
@@ -133,6 +130,12 @@ To show the most recent added mages : **[recent max=x ]**
133
 
134
  == Changelog ==
135
 
 
 
 
 
 
 
136
  = V1.8.0 - 12.06.2011 =
137
  * NEW : Full rework of permalink url structure
138
  * NEW : Adding Google Sitemaps for Images (require WordPress SEO plugin by YOAST )
2
  Contributors: alexrabe
3
  Donate link: http://alexrabe.de/donation/
4
  Tags: photos,flash,slideshow,images,gallery,media,admin,post,photo-albums,pictures,widgets,photo,picture,image,nextgen-gallery,nextgen gallery
5
+ Requires at least: 3.1
6
  Tested up to: 3.2
7
  Stable tag: trunk
8
 
13
  NextGEN Gallery is a full integrated Image Gallery plugin for WordPress with a slideshow option. Before I started writing the plugin I studied all the existing image and gallery plugins for WordPress.
14
  Some of them are really good and well designed, but the gap I filled was a simple administration system at the back end which can also handle multiple galleries.
15
 
16
+ [Demonstration](http://nextgen-gallery.com/) |
17
+ [FAQ](http://alexrabe.de/wordpress-plugins/nextgen-gallery/faq/)|
18
+ [Support](http://wordpress.org/tags/nextgen-gallery?forum_id=10)|
19
+ [Translations](http://code.google.com/p/nextgen-gallery/downloads/list?q=label:Translation)
 
 
 
20
 
21
  = Features =
22
 
130
 
131
  == Changelog ==
132
 
133
+ = V1.8.1 - 18.06.2011 =
134
+ * Bugfix : Special case for pagination, instead of showing page-1, we show the clean url
135
+ * Bugfix : Various PHP notice fixes
136
+ * Bugfix : Typo in rewrite rules
137
+ * Bugfix : Flush rewrite rules during upgrade later
138
+
139
  = V1.8.0 - 12.06.2011 =
140
  * NEW : Full rework of permalink url structure
141
  * NEW : Adding Google Sitemaps for Images (require WordPress SEO plugin by YOAST )