diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-10-16 20:13:22 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-10-16 20:13:22 +0000 |
commit | 33a3502dfee073325f5046baee655e6a2bdb29ec (patch) | |
tree | 7632ce5324998a3dac61b975cc2b3e24e1080063 /includes/module.inc | |
parent | 2ec1512419549fa48fb9925b8cd31e239864769d (diff) | |
download | brdo-33a3502dfee073325f5046baee655e6a2bdb29ec.tar.gz brdo-33a3502dfee073325f5046baee655e6a2bdb29ec.tar.bz2 |
- Removed a node's link ID (lid) as discussed on the mailing list. See
'updates/3.00-to.x.xx.mysql' for the required MySQL updates.
- Renamed some "author" fields to "uid" fields for sake of consistency.
- Fixed the coding style of some PHP files.
- Fixed the moderation queue (fairly untested though).
- Re-introduced the temporary SQL table in _node_get().
- Added a missing 'auto_increment' to 'updates/3.00-to-x.xx.mysql'.
Diffstat (limited to 'includes/module.inc')
-rw-r--r-- | includes/module.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/module.inc b/includes/module.inc index 4b6959c34..479dcde3f 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -53,19 +53,21 @@ function module_hook($name, $hook) { // rehash module-exported blocks: function module_rehash_blocks($name) { db_query("UPDATE blocks SET remove = '1' WHERE module = '$name'"); + if ($blocks = module_invoke($name, "block")) { - foreach ($blocks as $offset=>$block) { - foreach ($block as $item=>$data) { + foreach ($blocks as $delta => $block) { + foreach ($block as $item => $data) { $block[$item] = addslashes($data); } if (!db_fetch_object(db_query("SELECT * FROM blocks WHERE module = '$name' AND name = '$block[info]'"))) { - db_query("INSERT INTO blocks (name, module, delta) VALUES ('$block[info]', '$name', '$offset')"); + db_query("INSERT INTO blocks (name, module, delta) VALUES ('$block[info]', '$name', '$delta')"); } else { - db_query("UPDATE blocks SET delta = '$offset', remove = '0' WHERE module = '$name' AND name = '$block[info]'"); + db_query("UPDATE blocks SET delta = '$delta', remove = '0' WHERE module = '$name' AND name = '$block[info]'"); } } } + db_query("DELETE FROM blocks WHERE module = '$name' AND remove = '1'"); } |