blog_page_last

Versions
4.6 – 7
blog_page_last()

Displays a Drupal page containing recent blog entries of all users.

▾ 1 function calls blog_page_last()

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

Code

modules/blog.module, line 164

<?php
function blog_page_last() {
  global $user;

  $output = '';

  $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), variable_get('default_nodes_main', 10));

  while ($node = db_fetch_object($result)) {
    $output .= node_view(node_load(array('nid' => $node->nid)), 1);
  }
  $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
  $output .= theme('xml_icon', url('blog/feed'));

  drupal_add_link(array('rel' => 'alternate',
                        'type' => 'application/rss+xml',
                        'title' => t('RSS - blogs'),
                        'href' => url("blog/feed")));
  print theme('page', $output);
}
?>
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.