You are here

function xmlsitemap_node_comment in XML sitemap 5

Same name and namespace in other branches
  1. 5.2 xmlsitemap_node/xmlsitemap_node.module \xmlsitemap_node_comment()
  2. 6.2 xmlsitemap_node/xmlsitemap_node.module \xmlsitemap_node_comment()
  3. 6 xmlsitemap_node/xmlsitemap_node.module \xmlsitemap_node_comment()

Implementation of hook_comment().

Related topics

File

xmlsitemap_node/xmlsitemap_node.module, line 323
Adds nodes to the site map.

Code

function xmlsitemap_node_comment($comment, $op) {
  $comment = (object) $comment;
  switch ($op) {
    case 'insert':
    case 'update':
    case 'moderate':
    case 'delete':
      db_query("UPDATE {xmlsitemap_node} SET previous_comment = last_comment, last_comment = %d WHERE nid = %d", $comment->timestamp, $comment->nid);
      if (variable_get('xmlsitemap_node_count_comments', TRUE)) {
        xmlsitemap_update_sitemap();
      }
      break;
  }
}