Index: sites/all/modules/site_map/site_map.module =================================================================== --- sites/all/modules/site_map/site_map.module (revision 4101) +++ sites/all/modules/site_map/site_map.module (working copy) @@ -123,7 +123,14 @@ '#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', '#title' => t('RSS settings'), @@ -379,10 +386,10 @@ */ 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); } } @@ -397,7 +404,7 @@ * @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'); } @@ -421,46 +428,55 @@ $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