Same name and namespace in other branches
  1. 4.6.x modules/blog.module \blog_feed_last()
  2. 4.7.x modules/blog.module \blog_feed_last()
  3. 5.x modules/blog/blog.module \blog_feed_last()
  4. 6.x modules/blog/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 modules/blog/blog.module
Implements hook_menu().

File

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

Code

function blog_feed_last() {
  $nids = db_select('node', 'n')
    ->fields('n', array(
    'nid',
    'created',
  ))
    ->condition('type', 'blog')
    ->condition('status', 1)
    ->orderBy('created', 'DESC')
    ->range(0, variable_get('feed_default_items', 10))
    ->addTag('node_access')
    ->execute()
    ->fetchCol();
  $channel['title'] = t('!site_name blogs', array(
    '!site_name' => variable_get('site_name', 'Drupal'),
  ));
  $channel['link'] = url('blog', array(
    'absolute' => TRUE,
  ));
  node_feed($nids, $channel);
}