--- taxonomy.module.original	Thu Jan 25 18:51:36 2007
+++ taxonomy.module	Wed Jul 18 21:50:53 2007
@@ -271,7 +271,14 @@ function taxonomy_form_vocabulary($edit 
     '#default_value' => $edit['weight'],
     '#description' => t('In listings, the heavier vocabularies will sink and the lighter vocabularies will be positioned nearer the top.'),
   );
-
+  $form['showchildren'] = array('#type' => 'checkbox',
+    '#title' => t('Show children'),
+    '#default_value' => $edit['showchildren'],
+    '#description' => t('Show children terms when showing a term.'),
+  );
+  
+  
+  
   $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
   if ($edit['vid']) {
     $form['delete'] = array('#type' => 'submit', '#value' => t('Delete'));
@@ -302,7 +309,7 @@ function taxonomy_save_vocabulary(&$edit
   $edit['nodes'] = empty($edit['nodes']) ? array() : $edit['nodes'];
 
   if ($edit['vid'] && $edit['name']) {
-    db_query("UPDATE {vocabulary} SET name = '%s', description = '%s', help = '%s', multiple = %d, required = %d, hierarchy = %d, relations = %d, tags = %d, weight = %d, module = '%s' WHERE vid = %d", $edit['name'], $edit['description'], $edit['help'], $edit['multiple'], $edit['required'], $edit['hierarchy'], $edit['relations'], $edit['tags'], $edit['weight'], isset($edit['module']) ? $edit['module'] : 'taxonomy', $edit['vid']);
+    db_query("UPDATE {vocabulary} SET name = '%s', description = '%s', help = '%s', multiple = %d, required = %d, showchildren = %d, hierarchy = %d, relations = %d, tags = %d, weight = %d, module = '%s' WHERE vid = %d", $edit['name'], $edit['description'], $edit['help'], $edit['multiple'], $edit['required'], $edit['showchildren'], $edit['hierarchy'], $edit['relations'], $edit['tags'], $edit['weight'], isset($edit['module']) ? $edit['module'] : 'taxonomy', $edit['vid']);
     db_query("DELETE FROM {vocabulary_node_types} WHERE vid = %d", $edit['vid']);
     foreach ($edit['nodes'] as $type => $selected) {
       db_query("INSERT INTO {vocabulary_node_types} (vid, type) VALUES (%d, '%s')", $edit['vid'], $type);
@@ -315,7 +322,7 @@ function taxonomy_save_vocabulary(&$edit
   }
   else {
     $edit['vid'] = db_next_id('{vocabulary}_vid');
-    db_query("INSERT INTO {vocabulary} (vid, name, description, help, multiple, required, hierarchy, relations, tags, weight, module) VALUES (%d, '%s', '%s', '%s', %d, %d, %d, %d, %d, %d, '%s')", $edit['vid'], $edit['name'], $edit['description'], $edit['help'], $edit['multiple'], $edit['required'], $edit['hierarchy'], $edit['relations'], $edit['tags'], $edit['weight'], isset($edit['module']) ? $edit['module'] : 'taxonomy');
+    db_query("INSERT INTO {vocabulary} (vid, name, description, help, multiple, required, showchildren, hierarchy, relations, tags, weight, module) VALUES (%d, '%s', '%s', '%s', %d, %d, %d, %d, %d, %d, %d, '%s')", $edit['vid'], $edit['name'], $edit['description'], $edit['help'], $edit['multiple'], $edit['required'], $edit['hierarchy'], $edit['relations'], $edit['tags'], $edit['weight'], isset($edit['module']) ? $edit['module'] : 'taxonomy', $edit['showchildren']);
     foreach ($edit['nodes'] as $type => $selected) {
       db_query("INSERT INTO {vocabulary_node_types} (vid, type) VALUES (%d, '%s')", $edit['vid'], $type);
     }
@@ -1339,19 +1346,20 @@ function taxonomy_terms_parse_string($st
 /**
  * Menu callback; displays all nodes associated with a term.
  */
-function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') {
+function taxonomy_term_page($str_tids = '', $depth = 'all', $op = 'page') {
   $terms = taxonomy_terms_parse_string($str_tids);
   if ($terms['operator'] != 'and' && $terms['operator'] != 'or') {
     drupal_not_found();
   }
 
   if ($terms['tids']) {
-    $result = db_query(db_rewrite_sql('SELECT t.tid, t.name FROM {term_data} t WHERE t.tid IN (%s)', 't', 'tid'), implode(',', $terms['tids']));
+    $result = db_query(db_rewrite_sql('SELECT t.tid, t.name, t.vid FROM {term_data} t WHERE t.tid IN (%s)', 't', 'tid'), implode(',', $terms['tids']));
     $tids = array(); // we rebuild the $tids-array so it only contains terms the user has access to.
     $names = array();
     while ($term = db_fetch_object($result)) {
       $tids[] = $term->tid;
       $names[] = $term->name;
+      $vids[] = $term->vid;
     }
 
     if ($names) {
@@ -1364,12 +1372,25 @@ function taxonomy_term_page($str_tids = 
           $current->tid = $tids[0];
           $breadcrumbs = array(array('path' => $_GET['q'], 'title' => $names[0]));
           while ($parents = taxonomy_get_parents($current->tid)) {
+          	
             $current = array_shift($parents);
             $breadcrumbs[] = array('path' => 'taxonomy/term/'. $current->tid, 'title' => $current->name);
           }
+
           $breadcrumbs = array_reverse($breadcrumbs);
           menu_set_location($breadcrumbs);
+          
+          print ($term->vid);
 
+          $vocabulary=taxonomy_get_vocabulary($vids[0]);
+          if ($vocabulary->showchildren)
+          {
+          	$depth = 'all';
+          }
+          else 
+          {
+          	$depth = 0;
+          }
           $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $terms['operator'], $depth, TRUE));
           drupal_add_feed(url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed'), 'RSS - '. $title);
           return $output;
