diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-10-26 15:17:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-10-26 15:17:26 +0000 |
commit | 8d103a08984ac2de72d756eb5c5c8d23061ab028 (patch) | |
tree | e8cb8b9b2f071a9b7bd2e222d8183e5c27ad6683 /includes/module.inc | |
parent | 2ec14f35ac7d5600e6d03b5cf79f717f43d1cfab (diff) | |
download | brdo-8d103a08984ac2de72d756eb5c5c8d23061ab028.tar.gz brdo-8d103a08984ac2de72d756eb5c5c8d23061ab028.tar.bz2 |
- Committed Marco's block rewrite:
+ Blocks are not longer called if not rendered: major performance
improvement.
+ Fixed some bugs (preview option was broken, path option was broken).
+ Removed "ascii"-type blocks.
+ Added permission to for "PHP blocks"
+ ...
NOTES:
+ You'll want to run "update.php":
ALTER TABLE blocks DROP remove;
ALTER TABLE blocks DROP name;
+ You'll want to update your custom modules as well as the modules in
the contrib repository. Block function should now read:
function *_block($op = "list", $delta = 0) {
if ($op == "list") {
return array of block infos
}
else {
return subject and content of $delta block
}
}
Diffstat (limited to 'includes/module.inc')
-rw-r--r-- | includes/module.inc | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/includes/module.inc b/includes/module.inc index d908ceb25..7a248d236 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -69,25 +69,4 @@ function module_hook($name, $hook) { return function_exists($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 $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', '$delta')"); - } - else { - 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'"); -} - ?>
\ No newline at end of file |