function ip_backlog_comments in IP address manager 6
Same name and namespace in other branches
- 8.2 ip.module \ip_backlog_comments()
- 7.2 ip.module \ip_backlog_comments()
- 7 ip.module \ip_backlog_comments()
Handle backlog of comments.
File
- ./
ip.module, line 344 - IP address manager module.
Code
function ip_backlog_comments() {
$result = db_query_range("SELECT c.cid AS cid, c.hostname AS hostname" . " FROM {comments} c" . " LEFT JOIN {ip_posts} i" . " ON i.type = 'comment'" . " AND (c.cid = i.id OR i.id IS NULL)" . " WHERE i.id IS NULL" . " ORDER BY c.cid DESC", 0, 50);
while ($row = db_fetch_object($result)) {
ip_posts_insert('comment', $row->cid, $row->hostname);
}
}