function blog_feed_last

7.x blog.pages.inc blog_feed_last()
6.x blog.pages.inc blog_feed_last()

Menu callback; displays an RSS feed containing recent blog entries of all users.

1 string reference to 'blog_feed_last'
blog_menu in drupal-6.x/modules/blog/blog.module
Implementation of hook_menu().

File

drupal-6.x/modules/blog/blog.pages.inc, line 103
Page callback file for the blog module.

Code

function blog_feed_last() {
  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10));
  $channel['title'] = t('!site_name blogs', array('!site_name' => variable_get('site_name', 'Drupal')));
  $channel['link'] = url('blog', array('absolute' => TRUE));

  $items = array();
  while ($row = db_fetch_object($result)) {
    $items[] = $row->nid;
  }

  node_feed($items, $channel);
}