blog_feed_user

Versions
4.6 – 5
blog_feed_user($uid = 0)
6 – 7
blog_feed_user($account)

Displays an RSS feed containing recent blog entries of a given user.

▾ 1 function calls blog_feed_user()

blog_page in modules/blog.module
Menu callback; displays a Drupal page containing recent blog entries.

Code

modules/blog.module, line 82

<?php
function blog_feed_user($uid = 0) {
  global $user;

  if ($uid) {
    $account = user_load(array('uid' => $uid, 'status' => 1));
  }
  else {
    $account = $user;
  }

  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, r.teaser, n.created, u.name, u.uid FROM {node} n INNER JOIN {node_revisions} r ON n.vid = r.vid INNER JOIN {users} u ON n.uid = u.uid WHERE n.type = 'blog' AND u.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $uid, 0, variable_get('feed_default_items', 10));
  $channel['title'] = $account->name ."'s blog";
  $channel['link'] = url("blog/$uid", NULL, NULL, TRUE);
  $channel['description'] = $term->description;
  node_feed($result, $channel);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.