summaryrefslogtreecommitdiff
path: root/modules/aggregator
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-08-23 18:38:41 +0000
committerDries Buytaert <dries@buytaert.net>2006-08-23 18:38:41 +0000
commit158a8814ebe80fcd138c83225742d7255f74c0a9 (patch)
tree00bf942852efca7ed4bb962d8160829166fd30a1 /modules/aggregator
parentd53aec15103df92cf5fa512c1a7d1724236920c3 (diff)
downloadbrdo-158a8814ebe80fcd138c83225742d7255f74c0a9.tar.gz
brdo-158a8814ebe80fcd138c83225742d7255f74c0a9.tar.bz2
- Patch #66569 by m3avrck: add RSS autodiscovery automatically.
Diffstat (limited to 'modules/aggregator')
-rw-r--r--modules/aggregator/aggregator.module12
1 files changed, 4 insertions, 8 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index e32f95c99..49edc354c 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -1030,6 +1030,8 @@ function aggregator_admin_overview() {
* Menu callback; displays the most recent items gathered from any feed.
*/
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));
}
@@ -1049,6 +1051,8 @@ function aggregator_page_source() {
function aggregator_page_category() {
$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));
}
@@ -1082,14 +1086,6 @@ function aggregator_page_list($sql, $header, $categorize) {
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Save categories'));
$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;
}