NextGEN Gallery – WordPress Gallery Plugin - Version 1.7.2

Version Description

  • 13.12.2010 =
  • Bugfix : Adding images to database require slug
Download this release

Release Info

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

Code changes from version 1.7.1 to 1.7.2

Files changed (5) hide show
  1. admin/functions.php +4 -6
  2. changelog.txt +3 -0
  3. lib/ngg-db.php +3 -3
  4. nggallery.php +2 -2
  5. readme.txt +3 -0
admin/functions.php CHANGED
@@ -587,12 +587,10 @@ class nggAdmin{
587
  // strip off the extension of the filename
588
  $path_parts = pathinfo( $picture );
589
  $alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
590
- // save it to the database
591
- $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->nggpictures (galleryid, filename, alttext, exclude) VALUES (%s, %s, %s, 0)", $galleryID, $picture, $alttext) );
592
- // and give me the new id
593
- $pic_id = (int) $wpdb->insert_id;
594
-
595
- if ($result)
596
  $image_ids[] = $pic_id;
597
 
598
  // add the metadata
587
  // strip off the extension of the filename
588
  $path_parts = pathinfo( $picture );
589
  $alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
590
+ // save it to the database
591
+ $pic_id = nggdb::add_image( $galleryID, $picture, '', $alttext );
592
+
593
+ if ( !empty($pic_id) )
 
 
594
  $image_ids[] = $pic_id;
595
 
596
  // add the metadata
changelog.txt CHANGED
@@ -6,6 +6,9 @@ by Alex Rabe & NextGEN DEV Team
6
  * TODO : Facebook connector
7
  * TODO : Switch to Plupload (http://www.plupload.com/)
8
 
 
 
 
9
  = V1.7.1 - 13.12.2010 =
10
  * Changed : Disable upgrade for PHP4 user
11
  * Changed : Disable colorpicker for option page
6
  * TODO : Facebook connector
7
  * TODO : Switch to Plupload (http://www.plupload.com/)
8
 
9
+ = V1.7.2 - 13.12.2010 =
10
+ * Bugfix : Adding images to database require slug
11
+
12
  = V1.7.1 - 13.12.2010 =
13
  * Changed : Disable upgrade for PHP4 user
14
  * Changed : Disable colorpicker for option page
lib/ngg-db.php CHANGED
@@ -603,10 +603,10 @@ class nggdb {
603
 
604
  // slug must be unique, we use the alttext for that
605
  $slug = nggdb::get_unique_slug( sanitize_title( $alttext ), 'image' );
606
-
607
  // Add the image
608
- if ( false === $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->nggpictures (slug, galleryid, filename, description, alttext, meta_data, post_id, imagedate, exclude, sortorder)
609
- VALUES (%d, %d, %s, %s, %s, %s, %d, %s, %d, %d)", $slug, $id, $filename, $description, $alttext, $meta_data, $post_id, $imagedate, $exclude, $sortorder ) ) ) {
610
  return false;
611
  }
612
 
603
 
604
  // slug must be unique, we use the alttext for that
605
  $slug = nggdb::get_unique_slug( sanitize_title( $alttext ), 'image' );
606
+
607
  // Add the image
608
+ if ( false === $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->nggpictures (image_slug, galleryid, filename, description, alttext, meta_data, post_id, imagedate, exclude, sortorder)
609
+ VALUES (%s, %d, %s, %s, %s, %s, %d, %s, %d, %d)", $slug, $id, $filename, $description, $alttext, $meta_data, $post_id, $imagedate, $exclude, $sortorder ) ) ) {
610
  return false;
611
  }
612
 
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 the Web 2.0.
6
  Author: Alex Rabe
7
- Version: 1.7.1
8
 
9
  Author URI: http://alexrabe.de/
10
 
@@ -34,7 +34,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
34
  if (!class_exists('nggLoader')) {
35
  class nggLoader {
36
 
37
- var $version = '1.7.1';
38
  var $dbversion = '1.7.0';
39
  var $minium_WP = '3.0';
40
  var $donators = 'http://nextgen.boelinger.com/donators.php';
4
  Plugin URI: http://alexrabe.de/?page_id=80
5
  Description: A NextGENeration Photo gallery for the Web 2.0.
6
  Author: Alex Rabe
7
+ Version: 1.7.2
8
 
9
  Author URI: http://alexrabe.de/
10
 
34
  if (!class_exists('nggLoader')) {
35
  class nggLoader {
36
 
37
+ var $version = '1.7.2';
38
  var $dbversion = '1.7.0';
39
  var $minium_WP = '3.0';
40
  var $donators = 'http://nextgen.boelinger.com/donators.php';
readme.txt CHANGED
@@ -134,6 +134,9 @@ To show the most recent added mages : **[recent max=x ]**
134
 
135
  == Changelog ==
136
 
 
 
 
137
  = V1.7.1 - 13.12.2010 =
138
  * Changed : Disable upgrade for PHP4 user
139
  * Changed : Disable colorpicker for option page
134
 
135
  == Changelog ==
136
 
137
+ = V1.7.2 - 13.12.2010 =
138
+ * Bugfix : Adding images to database require slug
139
+
140
  = V1.7.1 - 13.12.2010 =
141
  * Changed : Disable upgrade for PHP4 user
142
  * Changed : Disable colorpicker for option page