From af7d8ebeed4e2847cae49d1e31cf7af45c1c5eae Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 15 Jul 2001 16:56:44 +0000 Subject: - Various updates, mostly related to our RDF/RSS backend. --- modules/node/node.module | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'modules/node') diff --git a/modules/node/node.module b/modules/node/node.module index cde5f9d83..9575e9ede 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -274,7 +274,6 @@ function node_module_find() { return $output; } - function node_edit($node) { $output .= form_item("Title", $node->title); $output .= form_item("Operations", implode("
", node_links($node->nid, $node->type))); @@ -362,4 +361,44 @@ function node_admin() { } } +function node_block() { + global $theme; + + $block[0][subject] = t("Syndicate"); + $block[0][content] = "
image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" />
\n"; + $block[0][info] = "Syndicate"; + + return $block; +} + +function node_feed() { + $result = db_query("SELECT nid, type FROM node WHERE promote = '1' AND status = '". node_status("posted") ."' ORDER BY timestamp DESC LIMIT 15"); + + while ($node = db_fetch_object($result)) { + $item = node_get_object(array("nid" => $node->nid, "type" => $node->type)); + + $title = $item->title; + $link = path_uri() ."node.php?id=$item->nid"; + $description = module_invoke($item->type, "summary", $item); + + $items .= format_rss_item($title, $link, $description); + } + + $output .= "\n"; + $output .= "\n"; + $output .= format_rss_channel(variable_get("site_name", "drupal"), path_uri() ."module.php?mod=node&op=feed", variable_get("site_slogan", ""), $items); + $output .= "\n"; + + print $output; + +} + +function node_page() { + global $op; + + if ($op == "feed") { + node_feed(); + } +} + ?> -- cgit v1.2.3