aggregator_page_rss
modules/aggregator/aggregator.pages.inc, строка 321
- Версии
- 5 – 6
aggregator_page_rss()
Коллбэк меню. Генерирует фид из материалов аггергатора или категорий в формате RSS 0.92.
Код
<?php
function aggregator_page_rss() {
$result = NULL;
// arg(2) is the passed cid, only select for that category
if (arg(2)) {
$category = db_fetch_object(db_query('SELECT cid, title FROM {aggregator_category} WHERE cid = %d', arg(2)));
$sql = '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 = %d ORDER BY timestamp DESC, i.iid DESC';
$result = db_query_range($sql, $category->cid, 0, variable_get('feed_default_items', 10));
}
// or, get the default aggregator items
else {
$category = NULL;
$sql = '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';
$result = db_query_range($sql, 0, variable_get('feed_default_items', 10));
}
$feeds = array();
while ($item = db_fetch_object($result)) {
$feeds[] = $item;
}
return theme('aggregator_page_rss', $feeds, $category);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии