Index: site_map.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/site_map/site_map.admin.inc,v retrieving revision 1.1 diff -u -p -r1.1 site_map.admin.inc --- site_map.admin.inc 8 Jan 2008 11:21:48 -0000 1.1 +++ site_map.admin.inc 20 Feb 2008 19:41:28 -0000 @@ -32,12 +32,25 @@ function site_map_admin_settings() { '#default_value' => variable_get('site_map_show_front', 1), '#description' => t('When enabled, this option will include the front page in the site map.'), ); - $form['site_map_content']['site_map_show_blogs'] = array( + $form['site_map_content']['site_map_blogsettings'] = array( + '#type' => 'fieldset', + '#title' => t('Blog settings'), + ); + $form['site_map_content']['site_map_blogsettings']['site_map_show_blogs'] = array( '#type' => 'checkbox', - '#title' => t('Show active blog authors'), + '#title' => t('Show blogs'), '#return_value' => 1, '#default_value' => variable_get('site_map_show_blogs', 1), - '#description' => t('When enabled, this option will show the 10 most active blog authors.'), + '#description' => t('This option controls whether blogs are displayed.'), + ); + $blog_options = array('1' => t('All Authors'), '0' => t('Recent Authors')); + $form['site_map_content']['site_map_blogsettings']['site_map_show_blog_authors'] = array( + '#type' => 'radios', + '#title' => t('Show blog authors'), + '#return_value' => 1, + '#default_value' => variable_get('site_map_show_blogs_authors', 1), + '#options' => $blog_options, + '#description' => t('This option controls how blog authors are displayed.'), ); $book_options = array(); if (module_exists('book')) { Index: site_map.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/site_map/site_map.module,v retrieving revision 1.38 diff -u -p -r1.38 site_map.module --- site_map.module 8 Jan 2008 11:21:48 -0000 1.38 +++ site_map.module 20 Feb 2008 19:41:29 -0000 @@ -49,7 +49,7 @@ function site_map_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('site_map_admin_settings'), 'access arguments' => array('administer site configuration'), - 'file' => 'site_map.admin.inc', + 'file' => 'site_map.admin.inc', 'type' => MENU_NORMAL_ITEM, ); $items['sitemap'] = array( @@ -177,22 +177,33 @@ function _site_map_front_page() { } /** - * Render the latest blog authors + * Render the latest blog authors, or ALL blog authors (sorted by most prolific) */ function _site_map_blogs() { $output = ''; if (module_exists('blog')) { + $show_all_authors = variable_get('site_map_show_blogs_authors', 1); $title = t('Blogs'); - $output = '
'. t("Community blog and recent blog authors at %sn.", array("%sn" => variable_get('site_name', 'Drupal'))) .'
'; + $output = '
'. t("Community blog and blog authors at %sn.", array("%sn" => variable_get('site_name', 'Drupal'))) .'
'; $blogs = array(); $blogs[] .= l(t('All blogs'), 'blog') . (variable_get('site_map_show_rss_links', 1) ? ' '. theme('site_map_feed_icon', url('blog/feed')) : ''); - $result = db_query_range("SELECT DISTINCT u.uid, u.name - FROM {users} u - INNER JOIN {node} n ON u.uid = n.uid - WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", 0, 10); - while ($account = db_fetch_object($result)) { - $blogs[] = l(t("!s's blog", array("!s" => $account->name)), "blog/$account->uid") . (variable_get('site_map_show_rss_links', 1) ? ' '. theme('site_map_feed_icon', url("blog/$account->uid/feed")) : ''); + if ($show_all_authors == 0) { + $result = db_query_range("SELECT DISTINCT u.uid, u.name + FROM {users} u + INNER JOIN {node} n ON u.uid = n.uid + WHERE u.uid > 0 AND n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", 0, 10); + while ($account = db_fetch_object($result)) { + $blogs[] = l(t("!s's blog", array("!s" => $account->name)), "blog/$account->uid") . (variable_get('site_map_show_rss_links', 1) ? ' '. theme('site_map_feed_icon', url("blog/$account->uid/feed")) : ''); + } + } elseif ($show_all_authors == 1) { + $result = db_query("SELECT count(*) as posts, u.uid, u.name + FROM {users} u + INNER JOIN {node} n ON u.uid = n.uid + WHERE u.uid > 0 AND n.type = 'blog' AND n.status = 1 GROUP BY n.uid ORDER BY posts DESC"); + while ($account = db_fetch_object($result)) { + $blogs[] = l(t("!s's blog", array("!s" => $account->name)), "blog/$account->uid") . ' ' . t("($account->posts posts)") . (variable_get('site_map_show_rss_links', 1) ? ' '. theme('site_map_feed_icon', url("blog/$account->uid/feed")) : ''); + } } $output .= theme('item_list', $blogs); $output = theme('box', $title, $output);