You are here

function linkchecker_comment in Link checker 6.2

Same name and namespace in other branches
  1. 5.2 linkchecker.module \linkchecker_comment()

File

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

Code

function linkchecker_comment($comment, $op) {

  // Convert $comment object (admin/content/comment) to array (comment/edit/[cid]).
  $comment = (array) $comment;
  switch ($op) {
    case 'publish':
      $node_type = db_result(db_query("SELECT type FROM {node} WHERE nid = %d", $comment['nid']));
      if (_linkchecker_scan_nodetype($node_type) && variable_get('linkchecker_scan_comments', 0)) {
        _linkchecker_add_comment_links($comment);
      }
      break;
    case 'unpublish':
    case 'delete':
      _linkchecker_delete_comment_links($comment['cid']);
      break;
  }
}