Commit 158a8814 authored by Dries's avatar Dries
Browse files

- Patch #66569 by m3avrck: add RSS autodiscovery automatically.

parent d53aec15
...@@ -43,8 +43,8 @@ Drupal x.x.x, xxxx-xx-xx (development version) ...@@ -43,8 +43,8 @@ Drupal x.x.x, xxxx-xx-xx (development version)
* added configurable content types. * added configurable content types.
* changed node rendering to work with structured arrays. * changed node rendering to work with structured arrays.
- performance: - performance:
* improved session handling. * improved session handling: reduces database overhead.
* omit sidebars when serving a '404 - Page not found'. * omit sidebars when serving a '404 - Page not found': saves CPU cycles and bandwidth.
- removed the archive module. - removed the archive module.
- upgrade system: - upgrade system:
* created space for update branches. * created space for update branches.
......
...@@ -1030,6 +1030,8 @@ function aggregator_admin_overview() { ...@@ -1030,6 +1030,8 @@ function aggregator_admin_overview() {
* Menu callback; displays the most recent items gathered from any feed. * Menu callback; displays the most recent items gathered from any feed.
*/ */
function aggregator_page_last() { function aggregator_page_last() {
drupal_add_feed(url('aggregator/rss'), variable_get('site_name', 'drupal') . ' ' . t('aggregator'));
return _aggregator_page_list('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC', arg(1)); return _aggregator_page_list('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC', arg(1));
} }
...@@ -1049,6 +1051,8 @@ function aggregator_page_source() { ...@@ -1049,6 +1051,8 @@ function aggregator_page_source() {
function aggregator_page_category() { function aggregator_page_category() {
$category = db_fetch_object(db_query('SELECT cid, title FROM {aggregator_category} WHERE cid = %d', arg(2))); $category = db_fetch_object(db_query('SELECT cid, title FROM {aggregator_category} WHERE cid = %d', arg(2)));
drupal_add_feed(url('aggregator/rss/'. arg(2)), variable_get('site_name', 'drupal') . ' ' . t('aggregator - @title', array('@title' => $category->title)));
return _aggregator_page_list('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = '. $category->cid .' ORDER BY timestamp DESC, iid DESC', arg(3)); return _aggregator_page_list('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = '. $category->cid .' ORDER BY timestamp DESC, iid DESC', arg(3));
} }
...@@ -1082,14 +1086,6 @@ function aggregator_page_list($sql, $header, $categorize) { ...@@ -1082,14 +1086,6 @@ function aggregator_page_list($sql, $header, $categorize) {
} }
$form['submit'] = array('#type' => 'submit', '#value' => t('Save categories')); $form['submit'] = array('#type' => 'submit', '#value' => t('Save categories'));
$form['pager'] = array('#value' => theme('pager', NULL, 20, 0)); $form['pager'] = array('#value' => theme('pager', NULL, 20, 0));
// arg(1) is undefined if we are at the top aggregator URL
// is there a better way to do this?
if (!arg(1)) {
drupal_add_feed(url('aggregator/rss'));
}
elseif (arg(1) == 'categories' && arg(2) && !arg(3)) {
drupal_add_feed(url('aggregator/rss/'. arg(2)));
}
return $form; return $form;
} }
......
...@@ -2257,7 +2257,7 @@ function node_page_default() { ...@@ -2257,7 +2257,7 @@ function node_page_default() {
if (db_num_rows($result)) { if (db_num_rows($result)) {
$feed_url = url('rss.xml', NULL, NULL, TRUE); $feed_url = url('rss.xml', NULL, NULL, TRUE);
drupal_add_feed($feed_url, t('RSS')); drupal_add_feed($feed_url, variable_get('site_name', 'drupal') .' '. t('RSS'));
$output = ''; $output = '';
while ($node = db_fetch_object($result)) { while ($node = db_fetch_object($result)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment