diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-09-24 19:08:27 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-09-24 19:08:27 +0000 |
commit | 586455b56e7993159d4a90891f9d21541176ab57 (patch) | |
tree | fab7a56ec59ff0c4113041ecc10ad12199f68f35 /modules/node.module | |
parent | 718e7865f7ecb6cd1faf240299f9c4b033642f78 (diff) | |
download | brdo-586455b56e7993159d4a90891f9d21541176ab57.tar.gz brdo-586455b56e7993159d4a90891f9d21541176ab57.tar.bz2 |
- Added a pubDate for each item. Patch by Neil.
Diffstat (limited to 'modules/node.module')
-rw-r--r-- | modules/node.module | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/modules/node.module b/modules/node.module index b5facee02..f2e8ffb87 100644 --- a/modules/node.module +++ b/modules/node.module @@ -985,35 +985,20 @@ function node_feed($nodes = 0, $channel = array()) { */ $item = node_load(array("nid" => $node->nid)); - - /* - ** Transform the node information into an RSS item: - */ - - $items .= format_rss_item($item->title, url(node_url($node)), ($item->teaser ? $item->teaser : $item->body)); - - /* - ** Determine the publication date: - */ - - if ($item->updated > $pubdate) { - $pubdate = $item->updated; - } - if ($item->created > $pubdate) { - $pubdate = $item->created; - } + $link = url(node_url($node)); + $items .= format_rss_item($item->title, $link, ($item->teaser ? $item->teaser : $item->body), array("pubDate" => date("r", $item->changed))); } $output .= "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; $output .= "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">]>\n"; - if (!$channel["version"]) $channel["version"] = "0.91"; + if (!$channel["version"]) $channel["version"] = "0.92"; if (!$channel["title"]) $channel["title"] = variable_get("site_name", "drupal") ." - ". variable_get("site_slogan", ""); if (!$channel["link"]) $channel["link"] = $base_url; if (!$channel["description"]) $channel["description"] = variable_get("site_mission", ""); foreach ($languages as $key => $value) break; if (!$channel["language"]) $channel["language"] = $key ? $key : "en"; $output .= "<rss version=\"". $channel["version"] . "\">\n"; - $output .= format_rss_channel($channel["title"], $channel["link"], $channel["description"], $items, $channel["language"], array("pubDate" => date("r", $pubdate))); + $output .= format_rss_channel($channel["title"], $channel["link"], $channel["description"], $items, $channel["language"]); $output .= "</rss>\n"; header("Content-Type: text/xml"); |