You are here

function _linkchecker_comment_links_missing in Link checker 5.2

Same name and namespace in other branches
  1. 6.2 linkchecker.module \_linkchecker_comment_links_missing()
  2. 7 linkchecker.module \_linkchecker_comment_links_missing()

Returns an array of comment references missing in the linkchecker_comments table.

1 call to _linkchecker_comment_links_missing()
_linkchecker_add_comment_links in ./linkchecker.module
Add comment links to database.

File

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

Code

function _linkchecker_comment_links_missing($cid, $links) {
  $placeholders = implode(',', array_fill(0, count($links), "'%s'"));
  $res = db_query("SELECT url FROM {linkchecker_links} ll INNER JOIN {linkchecker_comments} lc ON ll.lid = lc.lid WHERE lc.cid = %d AND token IN (" . $placeholders . ")", array_merge(array(
    $cid,
  ), array_map('md5', $links)));
  $links_in_database = array();
  while ($row = db_fetch_object($res)) {
    $links_in_database[] = $row->url;
  }
  return array_diff($links, $links_in_database);
}