Index: taxonomy_dhtml.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_dhtml/taxonomy_dhtml.module,v
retrieving revision 1.66.4.6
diff -u -F^f -r1.66.4.6 taxonomy_dhtml.module
--- taxonomy_dhtml.module	3 Mar 2007 14:54:00 -0000	1.66.4.6
+++ taxonomy_dhtml.module	9 Sep 2007 19:23:37 -0000
@@ -41,7 +41,7 @@ function taxonomy_dhtml_vocab_vert($voca
     }
     $out .= "<li>$link</li>\n";
     $old_depth = $term->depth;
-    $count = taxonomy_term_count_nodes($term->tid);
+    $count = taxonomy_dhtml_term_count_nodes($term->tid);
   }
   return $out;
 }
@@ -62,7 +62,7 @@ function taxonomy_dhtml_overview($type =
       // localize and append the node count to each term name
       for ($m=0; $m<count($tree); $m++) {
         $tree[$m]->name = $tree[$m]->name;
-        if ($count = taxonomy_term_count_nodes($tree[$m]->tid, $type)) {
+        if ($count = taxonomy_dhtml_term_count_nodes($tree[$m]->tid, $type)) {
           $tree[$m]->name .= " ($count)";
         }
       }
@@ -271,4 +271,14 @@ function taxonomy_dhtml_help($section) {
   return $output;
 }
 
-?>
+function taxonomy_dhtml_term_count_nodes($tid = 0, $type = NULL) {
+  if ($type) {
+    $count = db_result(db_query(db_rewrite_sql("SELECT COUNT(n.nid) AS c FROM {term_node} t INNER JOIN {node} n ON t.nid = n.nid WHERE t.
+tid = %d n.status = 1 AND n.type = '%s'"), $tid, $type));
+  }
+  else {
+    $count = db_result(db_query(db_rewrite_sql('SELECT COUNT(n.nid) AS c FROM {term_node} t INNER JOIN {node} n ON t.nid = n.nid WHERE t.
+tid = %d AND n.status = 1'), $tid));
+  }
+  return $count;
+}

