atom_user_blog_feed

Versions
6
atom_user_blog_feed($uid)

Code

contributions/atom/atom.module, line 155

<?php
function atom_user_blog_feed($uid) {
  if (strpos(arg(4), 'atom') === 0 || strpos(arg(4), 'feed') === 0) {
    die(drupal_not_found());
  }
  $user_result = db_query_range("SELECT u.name FROM {users} u WHERE u.uid = %d", $uid, 0, 1);
  if (!$user = db_result($user_result)) {
    return t('User does not exist.');
  }

  $nodes = db_query_range("SELECT n.nid FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = '1' ORDER BY n.created DESC", $uid, 0, variable_get('atom_feed_entries', 15));

  $feed_info = array();
  $feed_info['title']    = sprintf(t("%s's blog"), $user);
  $feed_info['subtitle'] = '';
  $feed_info['html_url'] = url("blog/$uid", array('absolute' => TRUE));
  $feed_info['atom_url'] = url("blog/$uid/atom/feed", array('absolute' => TRUE));
  _atom_print_feed($nodes, $feed_info);
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.