summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/module.inc4
-rw-r--r--modules/blog.module4
-rw-r--r--modules/blog/blog.module4
-rw-r--r--modules/export.module4
-rw-r--r--modules/node.module41
-rw-r--r--modules/node/node.module41
6 files changed, 93 insertions, 5 deletions
diff --git a/includes/module.inc b/includes/module.inc
index 475fe8370..38deae940 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -13,7 +13,9 @@ function module_iterate($function, $argument = "") {
// invoke hook $hook of module $name with optional arguments:
function module_invoke($name, $hook, $a1 = 0, $a2 = 0) {
$function = $name ."_". $hook;
- return function_exists($function) ? $function($a1, $a2) : 0;
+ if (function_exists($function)) {
+ return $function($a1, $a2);
+ }
}
// return array of module names (includes lazy module loading):
diff --git a/modules/blog.module b/modules/blog.module
index 14d8b48b7..d5517adbd 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -26,6 +26,10 @@ function blog_status() {
return array(dumped, posted);
}
+function blog_summary($node) {
+ return $node->body;
+}
+
function blog_feed_user($name = 0, $date = 0) {
global $user;
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index 14d8b48b7..d5517adbd 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -26,6 +26,10 @@ function blog_status() {
return array(dumped, posted);
}
+function blog_summary($node) {
+ return $node->body;
+}
+
function blog_feed_user($name = 0, $date = 0) {
global $user;
diff --git a/modules/export.module b/modules/export.module
index 3464d4222..c96ee2d8e 100644
--- a/modules/export.module
+++ b/modules/export.module
@@ -13,7 +13,7 @@ function export_export_rdf() {
print "<channel>\n";
print " <title>". variable_get(site_name, "drupal") ."</title>\n";
print " <link>". path_uri() ."</link>\n";
- print " <description>". variable_get(site_name, "drupal") ."</description>\n";
+ print " <description>". variable_get(site_slogan, "") ."</description>\n";
print "</channel>\n";
$result = db_query("SELECT * FROM node WHERE promote = '1' AND status = '$status[posted]' ORDER BY timestamp DESC LIMIT 10");
@@ -42,7 +42,7 @@ function export_export_rss() {
print "<channel rdf:about=\"". path_uri() ."export.php?headlines.rss\">\n";
print " <title>". variable_get(site_name, "drupal") ."</title>\n";
print " <link>". path_uri() ."</link>\n";
- print " <description>". variable_get(site_name, "drupal") ."</description>\n";
+ print " <description>". variable_get(site_slogan, "") ."</description>\n";
print " <items>\n";
print " <rdf:Seq>\n";
diff --git a/modules/node.module b/modules/node.module
index cde5f9d83..9575e9ede 100644
--- a/modules/node.module
+++ b/modules/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("<br />", 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] = "<div align=\"center\"><a href=\"module.php?mod=blog&op=feed\"><img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" /></a></div>\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 .= "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
+ $output .= "<rss version=\"0.91\">\n";
+ $output .= format_rss_channel(variable_get("site_name", "drupal"), path_uri() ."module.php?mod=node&op=feed", variable_get("site_slogan", ""), $items);
+ $output .= "</rss>\n";
+
+ print $output;
+
+}
+
+function node_page() {
+ global $op;
+
+ if ($op == "feed") {
+ node_feed();
+ }
+}
+
?>
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("<br />", 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] = "<div align=\"center\"><a href=\"module.php?mod=blog&op=feed\"><img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" /></a></div>\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 .= "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
+ $output .= "<rss version=\"0.91\">\n";
+ $output .= format_rss_channel(variable_get("site_name", "drupal"), path_uri() ."module.php?mod=node&op=feed", variable_get("site_slogan", ""), $items);
+ $output .= "</rss>\n";
+
+ print $output;
+
+}
+
+function node_page() {
+ global $op;
+
+ if ($op == "feed") {
+ node_feed();
+ }
+}
+
?>