You are here

function _quotes_feed_user in Quotes 7

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

Displays an RSS feed containing recent quotes of a given user.

Parameters

array $account: The account of the user's quotes to be fed.

1 string reference to '_quotes_feed_user'
quotes_menu in ./quotes.module
Implements hook_menu().

File

./quotes.module, line 2185
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_user($account = NULL) {
  $luser = user_load(arg(1));
  $sql = db_select('node', 'n')
    ->fields('n', array(
    'nid',
    'title',
    'created',
    'uid',
  ))
    ->condition('status', 1)
    ->condition('type', 'quotes')
    ->condition('uid', $luser->uid)
    ->orderBy('created', 'DESC')
    ->range(0, variable_get('feed_default_items', 15))
    ->addTag('node_access')
    ->execute()
    ->fetchCol();
  $channel['title'] = t("!name's quotes", array(
    '!name' => $luser->uid ? $luser->name : variable_get('anonymous', t('Anonymous')),
  ));
  $channel['link'] = url("quotes/" . $luser->uid, array(
    'absolute' => TRUE,
  ));
  node_feed($sql, $channel);
}