Index: gsitemap.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gsitemap/Attic/gsitemap.module,v
retrieving revision 1.56.2.4
diff -u -p -r1.56.2.4 gsitemap.module
--- gsitemap.module	16 Mar 2007 14:57:48 -0000	1.56.2.4
+++ gsitemap.module	18 Mar 2007 13:13:42 -0000
@@ -362,10 +362,10 @@ function gsitemap_output_index() {
     print '<loc>'. url('gsitemap/'. $i, NULL, NULL, TRUE) .'</loc>';
 
     $range = gsitemap_get_chunk_range($i);
-    $last_changed_node = db_result(db_query(sprintf("SELECT MAX(changed) as changed from {node} WHERE nid >= %d AND nid < %d", $range->low, $range->high)));
+    $last_changed_node = db_result(db_query("SELECT MAX(changed) as changed from {node} WHERE nid >= %d AND nid < %d", $range->low, $range->high));
 
     if ($countcom) {
-      $last_changed_comment = db_result(db_query(sprintf("SELECT MAX(timestamp) as timestamp from {comments} WHERE nid >= %d AND nid < %d", $range->low, $range->high)));
+      $last_changed_comment = db_result(db_query("SELECT MAX(timestamp) as timestamp from {comments} WHERE nid >= %d AND nid < %d", $range->low, $range->high));
     }
     else {
       $last_changed_comment = 0;
@@ -397,11 +397,11 @@ function gsitemap_output_chunk($chunk) {
   print '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';
   print '<url><loc>'. $base_url .'</loc><changefreq>always</changefreq><priority>'. variable_get('gsitemap_frontpage', '1.0') .'</priority></url>';
   $count = array();
-  $count[0] = db_result(db_query(sprintf("SELECT COUNT(*) AS count FROM {node} WHERE nid >= %d AND nid < %d", $range->low, $range->high)));
-  $count[1] = db_result(db_query(sprintf("SELECT COUNT(*) AS count FROM {gsitemap} WHERE nid >= %d AND nid < %d", $range->low, $range->high)));
+  $count[0] = db_result(db_query("SELECT COUNT(*) AS count FROM {node} WHERE nid >= %d AND nid < %d", $range->low, $range->high));
+  $count[1] = db_result(db_query("SELECT COUNT(*) AS count FROM {gsitemap} WHERE nid >= %d AND nid < %d", $range->low, $range->high));
   if (module_exists('comment')) {
     if ($count[0]->count != $count[1]->count) {
-      $result = db_query(sprintf("SELECT {node}.nid, changed FROM {node} LEFT JOIN {gsitemap} USING (nid) WHERE {gsitemap}.nid IS NULL AND {node}.nid >= %d AND {node}.nid < %d", $range->low, $range->high));
+      $result = db_query("SELECT {node}.nid, changed FROM {node} LEFT JOIN {gsitemap} USING (nid) WHERE {gsitemap}.nid IS NULL AND {node}.nid >= %d AND {node}.nid < %d", $range->low, $range->high);
       while($node = db_fetch_object($result)) {
         db_query("INSERT INTO {gsitemap} (nid, last_changed) VALUES (%d, %d)", $node->nid, $node->changed);
       }
@@ -411,7 +411,7 @@ function gsitemap_output_chunk($chunk) {
       }
     }
     $maxcomments = db_result(db_query("SELECT MAX(comment_count) AS max_comments FROM {node_comment_statistics}"));
-    $result = db_query(db_rewrite_sql(sprintf("SELECT DISTINCT (n.nid), n.type, n.status, n.promote, s.comment_count, n.changed, g.previously_changed, s.last_comment_timestamp, g.previous_comment, g.priority_override FROM {node} n LEFT JOIN {node_comment_statistics} s ON n.nid = s.nid LEFT JOIN {gsitemap} g ON n.nid = g.nid LEFT JOIN {url_alias} u ON src = CONCAT('node/', n.nid) WHERE n.status > 0 AND (g.priority_override >= 0 OR g.priority_override IS NULL) AND n.type NOT IN ('%s') AND n.nid >= %d AND n.nid < %d", $excludes, $range->low, $range->high), 'n'));
+    $result = db_query(db_rewrite_sql("SELECT n.nid, n.type, n.status, n.promote, s.comment_count, n.changed, g.previously_changed, s.last_comment_timestamp, g.previous_comment, g.priority_override FROM {node} n LEFT JOIN {node_comment_statistics} s ON n.nid = s.nid LEFT JOIN {gsitemap} g ON n.nid = g.nid LEFT JOIN {url_alias} u ON src = CONCAT('node/', n.nid) WHERE n.status > 0 AND (g.priority_override >= 0 OR g.priority_override IS NULL) AND n.type NOT IN ('%s') AND n.nid >= %d AND n.nid < %d", 'n'), $excludes, $range->low, $range->high);
   }
   else {
     if ($count[0]->count != $count[1]->count) {
@@ -420,7 +420,7 @@ function gsitemap_output_chunk($chunk) {
         db_query("INSERT INTO {gsitemap} (nid, last_changed) VALUES (%d, %d)", $node->nid, $node->changed);
       }
     }
-    $result = db_query(db_rewrite_sql(sprintf("SELECT DISTINCT (n.nid), n.type, n.status, n.promote, n.changed, g.previously_changed, g.priority_override FROM {node} n LEFT JOIN {gsitemap} g ON n.nid = g.nid LEFT JOIN {url_alias} u ON src = CONCAT('node/',n.nid) WHERE n.status > 0 AND (g.priority_override >= 0 OR g.priority_override IS NULL) AND n.type NOT IN ('%s') AND n.nid >= %d AND n.nid < %d", $excludes, $range->low, $range->high), 'n'));
+    $result = db_query(db_rewrite_sql("SELECT n.nid, n.type, n.status, n.promote, n.changed, g.previously_changed, g.priority_override FROM {node} n LEFT JOIN {gsitemap} g ON n.nid = g.nid LEFT JOIN {url_alias} u ON src = CONCAT('node/',n.nid) WHERE n.status > 0 AND (g.priority_override >= 0 OR g.priority_override IS NULL) AND n.type NOT IN ('%s') AND n.nid >= %d AND n.nid < %d", 'n'), $excludes, $range->low, $range->high);
     $maxcomments = 0;
   }
   while($node = db_fetch_object($result)) {
