You are here

function _linkchecker_node_links_missing in Link checker 5.2

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

Returns an array of node references missing in the linkchecker_nodes table.

1 call to _linkchecker_node_links_missing()
_linkchecker_add_node_links in ./linkchecker.module
Add node links to database.

File

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

Code

function _linkchecker_node_links_missing($nid, $links) {
  $placeholders = implode(',', array_fill(0, count($links), "'%s'"));
  $res = db_query("SELECT url FROM {linkchecker_links} ll INNER JOIN {linkchecker_nodes} ln ON ll.lid = ln.lid WHERE ln.nid = %d AND token IN (" . $placeholders . ")", array_merge(array(
    $nid,
  ), 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);
}