diff -u -b blog_list-old/blog_list.module blog_list/blog_list.module --- blog_list-old/blog_list.module 2009-02-10 22:18:58.000000000 -0500 +++ blog_list/blog_list.module 2009-02-10 22:19:28.000000000 -0500 @@ -34,9 +34,8 @@ function blog_list_blog_list() { global $user; - $output = _blog_list_get_blogs(); - - $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); + $output = _blog_list_get_blogs(TRUE); + $content .= theme('pager', NULL, variable_get('default_nodes_main',10)); return $output; } @@ -55,8 +54,7 @@ } else if ($op == 'view') { if ($delta == 0) { $block['subject'] = t('Blogs'); - $block['content'] = _blog_list_get_blogs(); - $block['content'] .= theme('pager', NULL, variable_get('default_nodes_main',10)); + $block['content'] = _blog_list_get_blogs(FALSE); } } return $block; @@ -66,13 +64,18 @@ /** * Helper function to grab the 'blogs' * + * @param boolean use pager or not * @return HTML with a themed table */ -function _blog_list_get_blogs() { +function _blog_list_get_blogs($pager = FALSE) { $header = array(t('User')); $rows = array(); + if ($pager) { $result = pager_query(db_rewrite_sql("SELECT DISTINCT u.name, u.uid FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.type = 'blog' AND n.status = 1 AND u.uid <> 0 ORDER BY n.created DESC"), variable_get('default_nodes_main', 10)); + } else { + $result = db_query("SELECT DISTINCT u.name, u.uid FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.type = 'blog' AND n.status = 1 AND u.uid <> 0 ORDER BY n.created DESC"); + } while ($bu = db_fetch_array($result)) { $rows[] = array(l($bu['name'],'blog/'.$bu['uid'])); }