Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.560 diff -u -F^f -r1.560 common.inc --- includes/common.inc 22 Aug 2006 11:13:03 -0000 1.560 +++ includes/common.inc 22 Aug 2006 18:18:21 -0000 @@ -148,6 +148,34 @@ function drupal_get_headers() { return drupal_set_header(); } +/* + * Add a feed URL for the current page. + * + * @param $url + * The url for the feed + * @param $theme_function + * The name of the theming function to use to style the feed icon, defaults to theme_feed_icon() + */ +function drupal_add_feed($url = NULL, $theme_function = 'feed_icon') { + static $stored_feed_links = array(); + + if (!is_null($url)) { + $stored_feed_links[$url] = theme($theme_function, $url); + } + return $stored_feed_links; +} + +/** + * Get the feed URLs for the current page. + * + * @param $delimiter + * The delimiter to split feeds by + */ +function drupal_get_feeds($delimiter = "\n") { + $feeds = drupal_add_feed(); + return implode($feeds, $delimiter); +} + /** * @name HTTP handling * @{ Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.310 diff -u -F^f -r1.310 theme.inc --- includes/theme.inc 22 Aug 2006 09:00:30 -0000 1.310 +++ includes/theme.inc 22 Aug 2006 18:18:22 -0000 @@ -387,6 +387,7 @@ function theme_page($content) { $output .= "\n\n"; $output .= $content; + $output .= drupal_get_feeds(); $output .= "\n\n"; $output .= ''; Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.300 diff -u -F^f -r1.300 aggregator.module --- modules/aggregator/aggregator.module 20 Aug 2006 05:57:40 -0000 1.300 +++ modules/aggregator/aggregator.module 22 Aug 2006 18:18:23 -0000 @@ -1085,11 +1085,12 @@ function aggregator_page_list($sql, $hea // arg(1) is undefined if we are at the top aggregator URL // is there a better way to do this? if (!arg(1)) { - $form['feed_icon'] = array('#value' => theme('feed_icon', url('aggregator/rss'))); + drupal_add_feed(url('aggregator/rss')); } elseif (arg(1) == 'categories' && arg(2) && !arg(3)) { - $form['feed_icon'] = array('#value' => theme('feed_icon', url('aggregator/rss/' . arg(2)))); + drupal_add_feed(url('aggregator/rss/' . arg(2))); } + return $form; } Index: modules/blog/blog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v retrieving revision 1.259 diff -u -F^f -r1.259 blog.module --- modules/blog/blog.module 20 Aug 2006 07:07:17 -0000 1.259 +++ modules/blog/blog.module 22 Aug 2006 18:18:24 -0000 @@ -163,7 +163,7 @@ function blog_page_user($uid) { $output .= node_view(node_load($node->nid), 1); } $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); - $output .= theme('feed_icon', url("blog/$account->uid/feed")); + drupal_add_feed(url("blog/$account->uid/feed")); drupal_add_link(array('rel' => 'alternate', 'type' => 'application/rss+xml', @@ -190,7 +190,7 @@ function blog_page_last() { $output .= node_view(node_load($node->nid), 1); } $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); - $output .= theme('feed_icon', url('blog/feed')); + drupal_add_feed(url('blog/feed')); drupal_add_link(array('rel' => 'alternate', 'type' => 'application/rss+xml', Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.350 diff -u -F^f -r1.350 forum.module --- modules/forum/forum.module 20 Aug 2006 05:57:40 -0000 1.350 +++ modules/forum/forum.module 22 Aug 2006 18:18:25 -0000 @@ -936,7 +936,7 @@ function theme_forum_display($forums, $t 'href' => url('taxonomy/term/'. $tid .'/0/feed'))); $output .= theme('forum_topic_list', $tid, $topics, $sortby, $forum_per_page); - $output .= theme('feed_icon', url("taxonomy/term/$tid/0/feed")); + drupal_add_feed(url("taxonomy/term/$tid/0/feed")); } $output .= ''; } Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.682 diff -u -F^f -r1.682 node.module --- modules/node/node.module 22 Aug 2006 11:13:04 -0000 1.682 +++ modules/node/node.module 22 Aug 2006 18:18:27 -0000 @@ -2256,10 +2256,12 @@ function node_page_default() { $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10)); if (db_num_rows($result)) { + $feed_url = url('rss.xml', NULL, NULL, TRUE); + drupal_add_feed($feed_url); drupal_add_link(array('rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => t('RSS'), - 'href' => url('rss.xml', NULL, NULL, TRUE))); + 'href' => $feed_url)); $output = ''; while ($node = db_fetch_object($result)) { Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.304 diff -u -F^f -r1.304 taxonomy.module --- modules/taxonomy/taxonomy.module 20 Aug 2006 05:57:40 -0000 1.304 +++ modules/taxonomy/taxonomy.module 22 Aug 2006 18:18:28 -0000 @@ -1257,7 +1257,7 @@ function taxonomy_term_page($str_tids = 'href' => url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed'))); $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $terms['operator'], $depth, TRUE)); - $output .= theme('feed_icon', url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed')); + drupal_add_feed(url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed')); return $output; break; Index: themes/bluemarine/page.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/themes/bluemarine/page.tpl.php,v retrieving revision 1.18 diff -u -F^f -r1.18 page.tpl.php --- themes/bluemarine/page.tpl.php 22 Aug 2006 09:00:31 -0000 1.18 +++ themes/bluemarine/page.tpl.php 22 Aug 2006 18:18:28 -0000 @@ -43,6 +43,7 @@ +