You are here

function _quotes_feed_user in Quotes 5

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

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

Parameters

$uid: The user ID of the user's quotes to be fed.

1 call to _quotes_feed_user()
_quotes_page in ./quotes.module
Menu callback that calls theme_quotes_page().

File

./quotes.module, line 1500

Code

function _quotes_feed_user($uid) {
  global $user;
  $luser = $uid ? user_load(array(
    'uid' => $uid,
    'status' => 1,
  )) : $user;
  $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' AND u.uid = %d ORDER BY n.created DESC"), $luser->uid, 0, 15);
  node_feed($result, array(
    'title' => t("!name's quotes", array(
      '!name' => $luser->uid ? $luser->name : variable_get('anonymous', t('Anonymous')),
    )),
    'link' => url("quotes/{$luser->uid}", NULL, NULL, TRUE),
  ));
}