From f137b26979754e3e94bec73ea947cd87d08594a2 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 11 Feb 2004 19:21:14 +0000 Subject: - 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 --- modules/node/node.module | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'modules/node') diff --git a/modules/node/node.module b/modules/node/node.module index 9bebdb4b0..9d513fe95 100644 --- a/modules/node/node.module +++ b/modules/node/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 .= "\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 = "\n"; $output .= "]>\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 .= "\n"; + $output .= "\n"; $output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language']); $output .= "\n"; -- cgit v1.2.3