--- sites/all/modules/site_map/site_map.module.orig 2008-01-24 11:36:13.000000000 -0700 +++ sites/all/modules/site_map/site_map.module 2008-01-24 11:34:43.000000000 -0700 @@ -150,6 +150,13 @@ function site_map_admin_settings() { '#maxlength' => 10, '#description' => t('Specify how many subcategories should be included on the categorie page. Enter "all" to include all subcategories,"0" to include no subcategories, or "-1" not to append the depth at all.'), ); + $form['site_map_content_options']['site_map_count_threshold'] = array( + '#type' => 'textfield', + '#title' => t('Tag node count threshold'), + '#default_value' => variable_get('site_map_count_threshold', -1), + '#size' => 3, + '#description' => t('Only show tags whose node counts are greater than this threshold. Set to -1 to disable') + ); $form['site_map_rss_options'] = array( '#type' => 'fieldset', @@ -435,10 +442,10 @@ function _site_map_menu_tree($pid = 1, $ */ function _site_map_taxonomys() { if (module_exists('taxonomy') && $vids = variable_get('site_map_show_vocabularies', array())) { - $result = db_query('SELECT vid, name, description + $result = db_query('SELECT vid, name, description, tags FROM {vocabulary} WHERE vid IN (%s) ORDER BY weight ASC, name', implode(',', $vids)); while ($t = db_fetch_object($result)) { - $output .= _site_map_taxonomy_tree($t->vid, $t->name, $t->description); + $output .= _site_map_taxonomy_tree($t->vid, $t->name, $t->description, $t->tags); } } @@ -453,7 +460,7 @@ function _site_map_taxonomys() { * @param $description An optional description of the tree. (Default: NULL) * @return A string representing a rendered tree. */ -function _site_map_taxonomy_tree($vid, $name = NULL, $description = NULL) { +function _site_map_taxonomy_tree($vid, $name = NULL, $description = NULL, $tags = 0) { if ($vid == variable_get('forum_nav_vocabulary', '')) { $title = l($name, 'forum'); } @@ -477,46 +484,56 @@ function _site_map_taxonomy_tree($vid, $ $output .= '
'; // taxonomy_get_tree() honors access controls $tree = taxonomy_get_tree($vid); + + if ($tags) { + $threshold_count = variable_get('site_map_count_threshold', -1); + } + else { + $threshold_count = -1; + } foreach ($tree as $term) { // Adjust the depth of the