xmlsitemap_node_comment

Definition

xmlsitemap_node_comment($comment, $op)
contributions/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module, line 293

Description

Implementation of hook_comment().

Related topics

Namesort iconDescription
XML SitemapNotify search engines of site updates.

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;
  }
}