function _linkchecker_node_links_missing in Link checker 7
Same name and namespace in other branches
- 5.2 linkchecker.module \_linkchecker_node_links_missing()
- 6.2 linkchecker.module \_linkchecker_node_links_missing()
Returns an array of node references missing in the linkchecker_node table.
Parameters
int $nid: The node ID.
array $links: An array of links.
Return value
array An array of node references missing in the linkchecker_node table.
1 call to _linkchecker_node_links_missing()
- _linkchecker_add_node_links in ./
linkchecker.module - Add node links to database.
File
- ./
linkchecker.module, line 1650 - This module periodically check links in given node types, blocks etc.
Code
function _linkchecker_node_links_missing($nid, $links) {
$result = db_query('SELECT ll.url FROM {linkchecker_link} ll INNER JOIN {linkchecker_node} ln ON ln.lid = ll.lid WHERE ln.nid = :nid AND ll.urlhash IN (:urlhashes)', array(
':nid' => $nid,
':urlhashes' => array_map('drupal_hash_base64', $links),
));
$links_in_database = array();
foreach ($result as $row) {
$links_in_database[] = $row->url;
}
return array_diff($links, $links_in_database);
}