aggregator_page_category

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/aggregator/aggregator.pages.inc, строка 61

Версии
5
aggregator_page_category()
6
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.

Параметры

$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.

Возвращаемое значение

The items HTML.

Код

<?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));
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему