function aggregator_remove in Drupal 4
Same name and namespace in other branches
- 5 modules/aggregator/aggregator.module \aggregator_remove()
- 6 modules/aggregator/aggregator.module \aggregator_remove()
- 7 modules/aggregator/aggregator.module \aggregator_remove()
1 call to aggregator_remove()
- aggregator_admin_remove_feed_submit in modules/
aggregator.module - Remove all items from a feed and redirect to the overview page.
File
- modules/
aggregator.module, line 570 - Used to aggregate syndicated content (RSS, RDF, and Atom).
Code
function aggregator_remove($feed) {
$result = db_query('SELECT iid FROM {aggregator_item} WHERE fid = %d', $feed['fid']);
while ($item = db_fetch_object($result)) {
$items[] = "iid = {$item->iid}";
}
if ($items) {
db_query('DELETE FROM {aggregator_category_item} WHERE ' . implode(' OR ', $items));
}
db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $feed['fid']);
db_query("UPDATE {aggregator_feed} SET checked = 0, etag = '', modified = 0 WHERE fid = %d", $feed['fid']);
drupal_set_message(t('The news items from %site have been removed.', array(
'%site' => theme('placeholder', $feed['title']),
)));
}