function aggregator_remove
7.x aggregator.module | aggregator_remove($feed) |
6.x aggregator.module | aggregator_remove($feed) |
Removes all items from a feed.
Parameters
$feed: An associative array describing the feed to be cleared.
1 call to aggregator_remove()
- aggregator_admin_remove_feed_submit in drupal-6.x/
modules/ aggregator/ aggregator.admin.inc - Remove all items from a feed and redirect to the overview page.
File
- drupal-6.x/
modules/ aggregator/ aggregator.module, line 451 - 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 (!empty($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' => $feed['title'])));
}