diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-06-05 12:13:23 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-06-05 12:13:23 +0000 |
commit | 27388f66557cddce6aff1cc945601c5f843304cd (patch) | |
tree | 3a12f2afdc14b5af5be1b03d9c1fde6ac3d77928 /modules/aggregator | |
parent | 745222200e0670f55c6d695e467558171b7bb5d8 (diff) | |
download | brdo-27388f66557cddce6aff1cc945601c5f843304cd.tar.gz brdo-27388f66557cddce6aff1cc945601c5f843304cd.tar.bz2 |
- Patch #149176 by chx, David et al: getting rid of the sequences table, using db_last_insert_id() instead of db_next_id().
Diffstat (limited to 'modules/aggregator')
-rw-r--r-- | modules/aggregator/aggregator.module | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 9e11a668d..e27c847c2 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -427,8 +427,7 @@ function aggregator_save_category($edit) { } else if (!empty($edit['title'])) { // A single unique id for bundles and feeds, to use in blocks - $next_id = db_next_id('{aggregator_category}_cid'); - db_query("INSERT INTO {aggregator_category} (cid, title, description, block) VALUES (%d, '%s', '%s', 5)", $next_id, $edit['title'], $edit['description']); + db_query("INSERT INTO {aggregator_category} (title, description, block) VALUES ('%s', '%s', 5)", $edit['title'], $edit['description']); } } @@ -578,9 +577,9 @@ function aggregator_save_feed($edit) { db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $edit['fid']); } else if ($edit['title']) { + db_query("INSERT INTO {aggregator_feed} (title, url, refresh, block) VALUES ('%s', '%s', %d, 5)", $edit['title'], $edit['url'], $edit['refresh']); // A single unique id for bundles and feeds, to use in blocks. - $edit['fid'] = db_next_id('{aggregator_feed}_fid'); - db_query("INSERT INTO {aggregator_feed} (fid, title, url, refresh, block) VALUES (%d, '%s', '%s', %d, 5)", $edit['fid'], $edit['title'], $edit['url'], $edit['refresh']); + $edit['fid'] = db_last_insert_id('aggregator_feed', 'fid'); } if ($edit['title']) { // The feed is being saved, save the categories as well. @@ -985,8 +984,8 @@ function aggregator_save_item($edit) { db_query('DELETE FROM {aggregator_category_item} WHERE iid = %d', $edit['iid']); } else if ($edit['title'] && $edit['link']) { - $edit['iid'] = db_next_id('{aggregator_item}_iid'); - db_query("INSERT INTO {aggregator_item} (iid, fid, title, link, author, description, timestamp, guid) VALUES (%d, %d, '%s', '%s', '%s', '%s', %d, '%s')", $edit['iid'], $edit['fid'], $edit['title'], $edit['link'], $edit['author'], $edit['description'], $edit['timestamp'], $edit['guid']); + db_query("INSERT INTO {aggregator_item} (fid, title, link, author, description, timestamp, guid) VALUES (%d, '%s', '%s', '%s', '%s', %d, '%s')", $edit['fid'], $edit['title'], $edit['link'], $edit['author'], $edit['description'], $edit['timestamp'], $edit['guid']); + $edit['iid'] = db_last_insert_id('aggregator_item', 'iid'); // file the items in the categories indicated by the feed $categories = db_query('SELECT cid FROM {aggregator_category_feed} WHERE fid = %d', $edit['fid']); while ($category = db_fetch_object($categories)) { |