From 8d103a08984ac2de72d756eb5c5c8d23061ab028 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 26 Oct 2002 15:17:26 +0000 Subject: - 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 } } --- modules/archive.module | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'modules/archive.module') diff --git a/modules/archive.module b/modules/archive.module index 15d61e5b6..d2f33c0ab 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -102,14 +102,20 @@ function archive_display($original = 0) { return $output; } -function archive_block() { +function archive_block($op = "list", $delta = 0) { global $date; - - $block[0]["subject"] = "Browse archives"; - $block[0]["content"] = archive_display($date); - $block[0]["info"] = "Calendar to browse archives"; - - return $block; + if ($op == "list") { + $blocks[0]["info"] = t("Calendar to browse archives"); + return $blocks; + } + else { + switch ($delta) { + case 0: + $block["subject"] = t("Browse archives"); + $block["content"] = archive_display($date); + return $block; + } + } } function archive_link($type) { @@ -169,10 +175,11 @@ function archive_page() { } } else { - $theme->box(t("Access denied"), message_access()); + #$theme->box(t("Access denied"), message_access()); + message_access(); } $theme->footer(); } -?> +?> \ No newline at end of file -- cgit v1.2.3