aggregator_page_category

Versions
4.6 – 5
aggregator_page_category()
6 – 7
aggregator_page_category($arg1, $arg2 = NULL)

Menu callback; displays all the items aggregated in a particular category.

If there are two arguments then this function is called as a form.

Parameters

$arg1 If there are two arguments then $arg1 is $form_state. Otherwise, $arg1 is $category.

$arg2 If there are two arguments then $arg2 is $category.

Return value

The items HTML.

Code

modules/aggregator/aggregator.pages.inc, line 61

<?php
function aggregator_page_category($arg1, $arg2 = NULL) {
  // If there are two arguments then we are called as a form, $arg1 is
  // $form_state and $arg2 is $category. Otherwise, $arg1 is $category.
  $category = is_array($arg2) ? $arg2 : $arg1;

  drupal_add_feed(url('aggregator/rss/'. $category['cid']), variable_get('site_name', 'Drupal') .' '. t('aggregator - @title', array('@title' => $category['title'])));

  // It is safe to include the cid in the query because it's loaded from the
  // database by aggregator_category_load.
  $items = aggregator_feed_items_load('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, i.iid DESC');

  return _aggregator_page_list($items, arg(3));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.