You are here

function aggregator_feed_items_load in Drupal 6

Same name and namespace in other branches
  1. 7 modules/aggregator/aggregator.pages.inc \aggregator_feed_items_load()

Load feed items by passing a SQL query.

Parameters

$sql: The query to be executed.

Return value

An array of the feed items.

3 calls to aggregator_feed_items_load()
aggregator_page_category in modules/aggregator/aggregator.pages.inc
Menu callback; displays all the items aggregated in a particular category.
aggregator_page_last in modules/aggregator/aggregator.pages.inc
Menu callback; displays the most recent items gathered from any feed.
aggregator_page_source in modules/aggregator/aggregator.pages.inc
Menu callback; displays all the items captured from a particular feed.

File

modules/aggregator/aggregator.pages.inc, line 83
User page callbacks for the aggregator module.

Code

function aggregator_feed_items_load($sql) {
  $items = array();
  if (isset($sql)) {
    $result = pager_query($sql, 20);
    while ($item = db_fetch_object($result)) {
      $result_category = db_query('SELECT c.title, c.cid FROM {aggregator_category_item} ci LEFT JOIN {aggregator_category} c ON ci.cid = c.cid WHERE ci.iid = %d ORDER BY c.title', $item->iid);
      $item->categories = array();
      while ($item_categories = db_fetch_object($result_category)) {
        $item->categories[] = $item_categories;
      }
      $items[$item->iid] = $item;
    }
  }
  return $items;
}