You are here

function linkchecker_comment_update in Link checker 7

Implements hook_comment_update().

File

./linkchecker.module, line 979
This module periodically check links in given node types, blocks etc.

Code

function linkchecker_comment_update($comment) {

  // The node is going to be published.
  $node_type = db_query('SELECT type FROM {node} WHERE nid = :nid', array(
    ':nid' => $comment->nid,
  ))
    ->fetchField();
  if (variable_get('linkchecker_scan_comment_' . $node_type, FALSE) && $comment->status == COMMENT_PUBLISHED) {
    _linkchecker_add_comment_links($comment);
  }
  else {

    // The node is going to be unpublished.
    linkchecker_comment_delete($comment);
  }
}