? admin.module Index: blog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blog.module,v retrieving revision 1.212 diff -U3 -r1.212 blog.module --- blog.module 29 Jan 2005 22:02:36 -0000 1.212 +++ blog.module 8 Feb 2005 23:25:51 -0000 @@ -160,6 +160,26 @@ } /** + * Display a list with all users that have posted blog entries + */ +function blog_users_page() { + $result = pager_query(db_rewrite_sql("SELECT DISTINCT u.name, u.uid FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), variable_get('default_nodes_main', 10)); + + 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() { @@ -255,6 +275,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); $items[] = array('path' => 'blog/feed', 'title' => t('RSS feed'), 'callback' => 'blog_feed', 'access' => user_access('access content'),