--- taxonomy_block.module.orig  2010-05-29 13:21:17.000000000 -0500
+++ taxonomy_block.module       2010-05-29 13:23:01.000000000 -0500
@@ -102,7 +102,7 @@ function taxonomy_block_block($op = 'lis
           $output .= l(t($name_parent), taxonomy_term_path($term_parent));  
         }
         if ($node_count) {
-          $total_parent = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $tid_parent));
+          $total_parent = db_result(db_query("select count(distinct(n.tnid)) from {term_node} tn inner join {node} n on tn.nid = n.nid where tid=%d and n.status=1", $tid_parent));
           $output .= " ($total_parent)"; 
         }
         $output .= "</li>";
@@ -138,7 +138,7 @@ function taxonomy_block_block($op = 'lis
               $output .= l(t($name_child), taxonomy_term_path($term_child));  
             }
             if ($node_count) {
-              $total_child = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $tid_child));
+              $total_child = db_result(db_query("select count(distinct(n.tnid)) from {term_node} tn inner join {node} n on tn.nid = n.nid where tid=%d and n.status=1", $tid_child)); 
               $output .= " ($total_child)"; 
             }
             $output .= "</li>";
