diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-02-11 19:21:14 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-02-11 19:21:14 +0000 |
commit | f137b26979754e3e94bec73ea947cd87d08594a2 (patch) | |
tree | 7d7f2d5eb2646d61a57e1fb04f835d92823ed0d7 /modules/node.module | |
parent | d795565c32530d6af7e895ca769423eb230b73bb (diff) | |
download | brdo-f137b26979754e3e94bec73ea947cd87d08594a2.tar.gz brdo-f137b26979754e3e94bec73ea947cd87d08594a2.tar.bz2 |
- Patch 4902 by Goba:
+ only adds an optional parameter to url() and l(), so individual links
can be set to be absolute
+ modifies drupal_goto() to accept the parameters of url() without the
$absolute parameter, so cleaner invocations can be used
+ rework of some code in node_feed, making it much better to look at
(the current code uses foreach with an immediate brake to get the first
key of the associative array, geeeeez)
+ added xml:base to the rss tag generated by node_feed()
+ set all user mail URLs to be absolute
+ fix a small fragmented URL in user.module
Diffstat (limited to 'modules/node.module')
-rw-r--r-- | modules/node.module | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/modules/node.module b/modules/node.module index 9bebdb4b0..9d513fe95 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1011,19 +1011,22 @@ function node_feed($nodes = 0, $channel = array()) { */ $item = node_load(array('nid' => $node->nid)); - $link = url("node/view/$node->nid"); + $link = url("node/view/$node->nid", NULL, NULL, 1); $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"; + $channel_defaults = array( + 'version' => '0.92', + 'title' => variable_get('site_name', 'drupal') .' - '. variable_get('site_slogan', ''), + 'link' => $base_url, + 'description' => variable_get('site_mission', ''), + 'language' => (($key = reset(array_keys($languages))) ? $key : 'en') + ); + $channel = array_merge($channel_defaults, $channel); + + $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.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 .= "<rss version=\"". $channel["version"] . "\" xml:base=\"". $channel["link"] . "\">\n"; $output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language']); $output .= "</rss>\n"; |