aggregator_page_rss

  1. drupal
    1. 4.7 aggregator.module
    2. 5 aggregator.module
    3. 6
    4. 7
Versions
4.7 – 7 aggregator_page_rss()

Menu callback; generate an RSS 0.92 feed of aggregator items or categories.

Code

drupal/modules/aggregator/aggregator.pages.inc, line 322

<?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);
}
?>