summaryrefslogtreecommitdiff
path: root/modules/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-10-26 15:17:26 +0000
committerDries Buytaert <dries@buytaert.net>2002-10-26 15:17:26 +0000
commit8d103a08984ac2de72d756eb5c5c8d23061ab028 (patch)
treee8cb8b9b2f071a9b7bd2e222d8183e5c27ad6683 /modules/node.module
parent2ec14f35ac7d5600e6d03b5cf79f717f43d1cfab (diff)
downloadbrdo-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 'modules/node.module')
-rw-r--r--modules/node.module16
1 files changed, 10 insertions, 6 deletions
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"] = "<div align=\"center\">". lm("<img src=\"". $theme->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."))) ."</div>\n";
- $block[0][subject] = t("Syndicate");
- $block[0][content] = "<div align=\"center\">". lm("<img src=\"". $theme->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."))) ."</div>\n";
- $block[0][info] = "Syndicate";
-
- return $block;
+ return $block;
+ }
}
function node_feed($nodes = 0, $channel = array()) {