You are here

function _quotes_feed_last in Quotes 6

Same name and namespace in other branches
  1. 5 quotes.module \_quotes_feed_last()
  2. 7 quotes.module \_quotes_feed_last()

Displays an RSS feed containing recent quotes of all users.

1 string reference to '_quotes_feed_last'
quotes_menu in ./quotes.module
Implementation of hook_menu().

File

./quotes.module, line 1579
The quotes module allows users to maintain a list of quotes that can be displayed in any number of administrator-defined quote blocks.

Code

function _quotes_feed_last() {
  $result = db_query_range(db_rewrite_sql("SELECT n.nid, nr.title, nr.teaser, n.created, u.name, u.uid FROM {node} n INNER JOIN {node_revisions} nr ON nr.vid = n.vid INNER JOIN {users} u ON u.uid = n.uid WHERE n.status = 1 AND n.type = 'quotes' ORDER BY n.created DESC"), 0, 15);
  $nids = array();
  while ($row = db_fetch_object($result)) {
    $nids[] = $row->nid;
  }
  node_feed($nids, array(
    'title' => variable_get('site_name', 'drupal') . ' ' . t('quotes'),
    'link' => url("quotes", array(
      'absolute' => TRUE,
    )),
  ));
}