You are here

function _linkchecker_batch_comments_import_op in Link checker 5.2

Same name and namespace in other branches
  1. 6.2 includes/linkchecker.batch.inc \_linkchecker_batch_comments_import_op()
  2. 7 linkchecker.batch.inc \_linkchecker_batch_comments_import_op()

Batch operation: Load all comments, 100 by hundred.

1 string reference to '_linkchecker_batch_comments_import_op'
_linkchecker_batch_import_comments in ./linkchecker.module
Batch: Load all comments 100 by hundred.

File

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

Code

function _linkchecker_batch_comments_import_op($row, $limit, $node_types) {

  // Retrieve the next group of records.
  $placeholders = implode(',', array_fill(0, count($node_types), "'%s'"));
  $result = db_query_range('SELECT cid FROM {comments} c INNER JOIN {node} n ON c.nid = n.nid WHERE c.status <> %d AND n.status = %d AND n.type IN (' . $placeholders . ') ORDER BY cid ASC', array_merge(array(
    COMMENT_NOT_PUBLISHED,
    1,
  ), $node_types), $row, $limit);
  while ($res = db_fetch_array($result)) {

    // Load the comment and scan for links.
    $comment = _linkchecker_comment_load($res['cid']);
    _linkchecker_add_comment_links($comment);
  }
}