You are here

function _xmlsitemap_node_insert_query in XML sitemap 5

Build SQL query for populating the xmlsitemap_node table.

Return value

Query string

3 calls to _xmlsitemap_node_insert_query()
xmlsitemap_node_enable in xmlsitemap_node/xmlsitemap_node.install
Implementation of hook_enable().
xmlsitemap_node_update_1 in xmlsitemap_node/xmlsitemap_node.install
Implementation of hook_update_N(). Fix scrambled values.
xmlsitemap_node_update_2 in xmlsitemap_node/xmlsitemap_node.install
Implementation of hook_update_N(). Add missing nodes.

File

xmlsitemap_node/xmlsitemap_node.install, line 133

Code

function _xmlsitemap_node_insert_query() {
  return "\n    INSERT INTO {xmlsitemap_node} (nid, last_changed, last_comment, previous_comment)\n    SELECT n.nid, n.changed, s.last_comment_timestamp, MAX(c.timestamp) FROM {node} n\n    LEFT JOIN {node_comment_statistics} s ON s.nid = n.nid\n    LEFT OUTER JOIN {comments} c ON c.nid = n.nid AND c.timestamp < s.last_comment_timestamp\n    LEFT JOIN {xmlsitemap_node} xn ON xn.nid = n.nid\n    WHERE xn.nid IS NULL\n    GROUP BY n.nid, n.changed, s.last_comment_timestamp\n  ";
}