aggregator_page_sources
modules/aggregator/aggregator.module, строка 1174
- Версии
- 5 – 6
aggregator_page_sources()
Коллбэк меню; показывает все фиды, используемые аггрегатором.
Код
<?php
function aggregator_page_sources() {
$result = db_query('SELECT f.fid, f.title, f.description, f.image, MAX(i.timestamp) AS last FROM {aggregator_feed} f LEFT JOIN {aggregator_item} i ON f.fid = i.fid GROUP BY f.fid, f.title, f.description, f.image ORDER BY last DESC, f.title');
$output = "<div id=\"aggregator\">\n";
while ($feed = db_fetch_object($result)) {
$output .= '<h2>'. check_plain($feed->title) ."</h2>\n";
// Most recent items:
$list = array();
if (variable_get('aggregator_summary_items', 3)) {
$items = db_query_range('SELECT i.title, i.timestamp, i.link FROM {aggregator_item} i WHERE i.fid = %d ORDER BY i.timestamp DESC', $feed->fid, 0, variable_get('aggregator_summary_items', 3));
while ($item = db_fetch_object($items)) {
$list[] = theme('aggregator_summary_item', $item);
}
}
$output .= theme('item_list', $list);
$link['sources'] = array(
'title' => t('More'),
'href' => 'aggregator/sources/'. $feed->fid
);
$output .= '<div class="links">'. theme('links', $link) ."</div>\n";
}
$output .= theme('xml_icon', url('aggregator/opml'));
$output .= '</div>';
return $output;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии