diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-12-16 23:57:33 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-12-16 23:57:33 +0000 |
commit | 574a2e47eea1bc8e2ea13240e407a32e4b728560 (patch) | |
tree | 7c124110e7e71df958fff50b2fb8e0832dd18204 /modules/blog | |
parent | 18d22419f3da39ca4bf92f46d605a25957f311be (diff) | |
download | brdo-574a2e47eea1bc8e2ea13240e407a32e4b728560.tar.gz brdo-574a2e47eea1bc8e2ea13240e407a32e4b728560.tar.bz2 |
- Patch #345866 by alexanderpas, justinrandell, Dave Reid: remove from hook_block().
Diffstat (limited to 'modules/blog')
-rw-r--r-- | modules/blog/blog.module | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/modules/blog/blog.module b/modules/blog/blog.module index e9b036c13..0fe3c3190 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -165,25 +165,28 @@ function _blog_post_exists($account) { } /** - * Implementation of hook_block(). + * Implementation of hook_block_list(). + */ +function blog_block_list() { + $block['recent']['info'] = t('Recent blog posts'); + return $block; +} + +/** + * Implementation of hook_block_view(). * * Displays the most recent 10 blog titles. */ -function blog_block($op = 'list', $delta = '') { +function blog_block_view($delta = '') { global $user; - if ($op == 'list') { - $block['recent']['info'] = t('Recent blog posts'); - return $block; - } - elseif ($op == 'view') { - if (user_access('access content')) { - $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, 10); - if ($node_title_list = node_title_list($result)) { - $block['content'] = $node_title_list; - $block['content'] .= theme('more_link', url('blog'), t('Read the latest blog entries.')); - $block['subject'] = t('Recent blog posts'); - return $block; - } + + if (user_access('access content')) { + $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, 10); + if ($node_title_list = node_title_list($result)) { + $block['content'] = $node_title_list; + $block['content'] .= theme('more_link', url('blog'), t('Read the latest blog entries.')); + $block['subject'] = t('Recent blog posts'); + return $block; } } } |