? copyright ? dba ? directory ? primary_links ? sections Index: blog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blog.module,v retrieving revision 1.213 diff -U3 -r1.213 blog.module --- blog.module 12 Feb 2005 09:23:06 -0000 1.213 +++ blog.module 17 Mar 2005 22:18:30 -0000 @@ -157,6 +157,28 @@ } /** + * Display a list with all users that have posted blog entries + */ +function blog_users_page() { + + $result = pager_query("SELECT DISTINCT u.uid, u.name FROM {users} u LEFT JOIN {node} n ON n.uid = u.uid WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", variable_get('default_nodes_main', 10), 0, "SELECT COUNT(DISTINCT u.uid, u.name) FROM users u LEFT JOIN node n ON n.uid = u.uid WHERE n.type = 'blog' AND n.status =1 ORDER BY n.created DESC "); + + while ($row = db_fetch_object($result)) { + + $items[] = l($row->name, 'blog/'.$row->uid)." ".theme('xml_icon', url('blog/'.$row->uid.'/feed'), TRUE); + } + if ($items) { + $output = theme('item_list', $items, NULL); + $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); + } + else { + $output = t('No user has written any weblog yet.'); + } + + print theme('page', $output); +} + +/** * Displays a Drupal page containing recent blog entries of all users. */ function blog_page_last() { @@ -252,6 +274,10 @@ 'callback' => 'blog_page', 'access' => user_access('access content'), 'type' => MENU_SUGGESTED_ITEM); + $items[] = array('path' => 'blog/list', 'title' => t('bloggers'), + 'callback' => 'blog_users_page', + 'access' => user_access('access content'), + 'type' => MENU_SUGGESTED_ITEM); } return $items;