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/node.module | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'modules/node.module') diff --git a/modules/node.module b/modules/node.module index d337687ad..8140914b1 100644 --- a/modules/node.module +++ b/modules/node.module @@ -670,14 +670,18 @@ function node_admin() { } } -function node_block() { +function node_block($op = "list", $delta = 0) { global $theme; + if ($op == "list") { + $blocks[0]["info"] = t("Syndicate"); + return $blocks; + } + else { + $block["subject"] = t("Syndicate"); + $block["content"] = "
". lm("image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"XML\" />", array("mod" => "node", "op" => "feed"), "", array("title" => t("Read the XML version of this page."))) ."
\n"; - $block[0][subject] = t("Syndicate"); - $block[0][content] = "
". lm("image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"XML\" />", array("mod" => "node", "op" => "feed"), "", array("title" => t("Read the XML version of this page."))) ."
\n"; - $block[0][info] = "Syndicate"; - - return $block; + return $block; + } } function node_feed($nodes = 0, $channel = array()) { -- cgit v1.2.3