function _linkchecker_comment_links_missing in Link checker 7
Same name and namespace in other branches
- 5.2 linkchecker.module \_linkchecker_comment_links_missing()
- 6.2 linkchecker.module \_linkchecker_comment_links_missing()
Returns an array of comment references missing in the linkchecker_comment table.
Parameters
int $cid: The comment ID.
array $links: An array of links.
Return value
array An array of comment references missing in the linkchecker_comment table.
1 call to _linkchecker_comment_links_missing()
- _linkchecker_add_comment_links in ./
linkchecker.module - Add comment links to database.
File
- ./
linkchecker.module, line 1670 - This module periodically check links in given node types, blocks etc.
Code
function _linkchecker_comment_links_missing($cid, $links) {
$result = db_query('SELECT ll.url FROM {linkchecker_link} ll INNER JOIN {linkchecker_comment} lc ON lc.lid = ll.lid WHERE lc.cid = :cid AND ll.urlhash IN (:urlhashes)', array(
':cid' => $cid,
':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);
}