You are here

function xmlsitemap_node_comment in XML sitemap 5.2

Same name and namespace in other branches
  1. 5 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().

File

xmlsitemap_node/xmlsitemap_node.module, line 20
Adds nodes to the sitemap.

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_flag_sitemap();
      }
      break;
  }
}