/[drupal]/contributions/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module
ViewVC logotype

Diff of /contributions/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.19.2.8, Sat Nov 29 12:45:16 2008 UTC revision 1.19.2.9, Mon Dec 1 00:10:00 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: xmlsitemap_node.module,v 1.19.2.7 2008/11/28 20:37:04 kiam Exp $  // $Id: xmlsitemap_node.module,v 1.19.2.8 2008/11/29 12:45:16 kiam Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 331  function _xmlsitemap_node_links($exclude Line 331  function _xmlsitemap_node_links($exclude
331    }    }
332    if (module_exists('comment')) {    if (module_exists('comment')) {
333      $columns = 'n.nid, n.type, n.promote, s.comment_count, n.changed, xn.previously_changed, s.last_comment_timestamp, xn.previous_comment, xn.priority_override';      $columns = 'n.nid, n.type, n.promote, s.comment_count, n.changed, xn.previously_changed, s.last_comment_timestamp, xn.previous_comment, xn.priority_override';
334      $query = "      $query = "SELECT $columns, $coalesce(ua.dst) AS alias FROM {node} n LEFT JOIN {node_comment_statistics} s ON n.nid = s.nid";
       SELECT $columns, $coalesce(ua.dst) AS alias  
       FROM {node} n  
       LEFT JOIN {node_comment_statistics} s ON n.nid = s.nid";  
335    }    }
336    else {    else {
337      $columns = 'n.nid, n.type, n.promote, n.changed, xn.previously_changed, xn.priority_override';      $columns = 'n.nid, n.type, n.promote, n.changed, xn.previously_changed, xn.priority_override';
338      $query = "      $query = "SELECT $columns, $coalesce(ua.dst) AS alias FROM {node} n";
339        SELECT $columns, $coalesce(ua.dst) AS alias    }
340        FROM {node} n";    $query .= "LEFT JOIN {url_alias} ua ON ua.src = CONCAT('node/', CAST(n.nid AS $cast)) LEFT JOIN {xmlsitemap_node} xn ON n.nid = xn.nid WHERE n.status > 0 AND (n.type NOT IN ('". implode("', '", $excludes) ."') AND xn.priority_override IS NULL OR xn.priority_override >= 0) AND n.nid <> %d GROUP BY $columns";
   }  
   $query .= "  
     LEFT JOIN {url_alias} ua ON ua.src = CONCAT('node/', CAST(n.nid AS $cast))  
     LEFT JOIN {xmlsitemap_node} xn ON n.nid = xn.nid  
     WHERE n.status > 0  
     AND (n.type NOT IN ('". implode("', '", $excludes) ."') AND xn.priority_override IS NULL OR xn.priority_override >= 0)  
     AND n.nid <> %d  
     GROUP BY $columns";  
341    $result = db_query(db_rewrite_sql($query), _xmlsitemap_node_frontpage());    $result = db_query(db_rewrite_sql($query), _xmlsitemap_node_frontpage());
342    while ($node = db_fetch_object($result)) {    while ($node = db_fetch_object($result)) {
343      db_query("INSERT INTO {xmlsitemap} (loc, lastmod, changefreq, priority) VALUES ('%s', %d, %d, %f)", xmlsitemap_url('node/'. $node->nid, $node->alias, NULL, NULL, TRUE), variable_get('xmlsitemap_node_count_comments', TRUE) ? max($node->changed, $node->last_comment_timestamp) : $node->changed, xmlsitemap_node_frequency($node), xmlsitemap_node_priority($node));      db_query("INSERT INTO {xmlsitemap} (loc, lastmod, changefreq, priority) VALUES ('%s', %d, %d, %f)", xmlsitemap_url('node/'. $node->nid, $node->alias, NULL, NULL, TRUE), variable_get('xmlsitemap_node_count_comments', TRUE) ? max($node->changed, $node->last_comment_timestamp) : $node->changed, xmlsitemap_node_frequency($node), xmlsitemap_node_priority($node));

Legend:
Removed from v.1.19.2.8  
changed lines
  Added in v.1.19.2.9

  ViewVC Help
Powered by ViewVC 1.1.2