67c67,71
< $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(
69c73
< '#title' => t('Show recent blog authors'),
---
> '#title' => t('Show blogs'),
72c76,92
< '#description' => t('When enabled, this option will show the recent 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.'),
> );
> $form['site_map_content']['site_map_blogsettings']['site_map_show_anonymous_blogs'] = array(
> '#type' => 'checkbox',
> '#title' => t('Show anonymous blogs'),
> '#return_value' => 1,
> '#default_value' => variable_get('site_map_show_anonymous_blogs', 1),
> '#description' => t('This option controls whether anonymous content is displayed.'),
307c327
< * Render the latest blog authors
---
> * Render the latest blog authors, or ALL blog authors (sorted by most prolific)
310a331,335
> $option_state = variable_get('site_map_show_blogs_authors', 1);
> $anonymous_filter = '';
> if (variable_get('site_map_show_anonymous_blogs', 1) == 0) {
> $anonymous_filter = 'u.uid > 0 AND';
> }
312c337
< $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'))) .'
';
316,321c341,356
< $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 ($option_state == 0) {
> $result = db_query_range("SELECT DISTINCT u.uid, u.name
> FROM {users} u
> INNER JOIN {node} n ON u.uid = n.uid
> WHERE $anonymous_filter 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 ? $account->name : variable_get("anonymous", t("Anonymous")))), "blog/$account->uid") . (variable_get('site_map_show_rss_links', 1) ? ' '. theme('site_map_feed_icon', url("blog/$account->uid/feed")) : '');
> }
> } elseif ($option_state == 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 $anonymous_filter 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 ? $account->name : variable_get("anonymous", t("Anonymous")))), "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")) : '');
> }