You are here

function blog_feed_user in Drupal 6

Same name and namespace in other branches
  1. 4 modules/blog.module \blog_feed_user()
  2. 5 modules/blog/blog.module \blog_feed_user()
  3. 7 modules/blog/blog.pages.inc \blog_feed_user()

Menu callback; displays an RSS feed containing recent blog entries of a given user.

1 string reference to 'blog_feed_user'
blog_menu in modules/blog/blog.module
Implementation of hook_menu().

File

modules/blog/blog.pages.inc, line 88
Page callback file for the blog module.

Code

function blog_feed_user($account) {
  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n  WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $account->uid, 0, variable_get('feed_default_items', 10));
  $channel['title'] = t("!name's blog", array(
    '!name' => $account->name,
  ));
  $channel['link'] = url('blog/' . $account->uid, array(
    'absolute' => TRUE,
  ));
  $items = array();
  while ($row = db_fetch_object($result)) {
    $items[] = $row->nid;
  }
  node_feed($items, $channel);
}