blog_block_view
function blog_block_view
blog_block_view($delta = '')
Implements hook_block_view().
Displays the most recent 10 blog titles.
File
- modules/blog/blog.module, line 232
- Enables multi-user blogs.
Code
function blog_block_view($delta = '') { global $user; if (user_access('access content')) { $result = db_select('node', 'n') ->fields('n', array('nid', 'title', 'created')) ->condition('type', 'blog') ->condition('status', 1) ->orderBy('created', 'DESC') ->range(0, variable_get('blog_block_count', 10)) ->addTag('node_access') ->execute(); if ($node_title_list = node_title_list($result)) { $block['subject'] = t('Recent blog posts'); $block['content']['blog_list'] = $node_title_list; $block['content']['blog_more'] = array( '#theme' => 'more_link', '#url' => 'blog', '#title' => t('Read the latest blog entries.'), ); return $block; } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!blog!blog.module/function/blog_block_view/7.x