--- mail_archive.module	2006-01-24 11:04:54.000000000 -0500
+++ mail_archive.module.New	2006-01-24 11:13:03.000000000 -0500
@@ -359,6 +359,7 @@
   print theme('page', $output, $title);
 }
 
+
 function theme_mail_archive_list($categories, $parents, $tid) {
   if ($categories) {
     $header = array(t('Categories'), t('Mailing lists'));
@@ -820,7 +821,7 @@
 function mail_archive_page($tid = 0, $display = 'all') {
   global $user;
 
-  if (module_exist('taxonomy')) {
+  if (module_exist('taxonomy') && $tid != 0) {
     $subscriptions_per_page = variable_get('subscriptions_per_page', 25);
 
     $categories = mail_archive_get_categories($tid);
@@ -835,6 +836,10 @@
       $output .= theme('mail_archive_subscription_overview', $subscription);
     }
     drupal_set_breadcrumb(array(l(t('Home'), NULL)));
+
+    // print theme('mail_archive_notax_display', $output); 
+    echo $output;
+
   }
 }
 
@@ -852,10 +857,10 @@
   $term = module_invoke('taxonomy', 'get_term', $tid);
   $check_tid = $tid ? "'". check_query($tid) ."'" : 'NULL';
 
-  $sql = 'SELECT s.messages, s.last, s.lid, n.title, n.nid, n.sticky FROM {mail_archive_subscriptions} s INNER JOIN {node} n ON s.nid = n.nid INNER JOIN {term_node} r ON n.nid = r.nid '. node_access_join_sql() ." WHERE r.tid = $check_tid";
+  $sql = 'SELECT s.messages, s.last, s.lid, n.title, n.nid, n.sticky FROM {mail_archive_subscriptions} s INNER JOIN {node} n ON s.nid = n.nid INNER JOIN {term_node} r ON n.nid = r.nid '. _node_access_join_sql() ." WHERE r.tid = $check_tid";
   $sql .= tablesort_sql($subscription_list_header, 'n.sticky DESC,');
 
-  $sql_count = 'SELECT COUNT(n.nid) FROM {node} n '. node_access_join_sql() ." INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = $check_tid WHERE n.status = 1 AND n.type = 'mail_archive'";
+  $sql_count = 'SELECT COUNT(n.nid) FROM {node} n '. _node_access_join_sql() ." INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = $check_tid WHERE n.status = 1 AND n.type = 'mail_archive'";
 
   $result = pager_query($sql, $subscriptions_per_page, 0, $sql_count);
 
@@ -874,7 +879,7 @@
   if (count($_categories)) {
     $counts = array();
 
-    $_counts = db_query("SELECT r.tid, COUNT(n.nid) AS subscriptions FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid " . node_access_join_sql() . " WHERE n.status = 1 AND n.type = 'mail_archive' AND " . node_access_where_sql(). " GROUP BY r.tid", $tid);
+    $_counts = db_query("SELECT r.tid, COUNT(n.nid) AS subscriptions FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid " . _node_access_join_sql() . " WHERE n.status = 1 AND n.type = 'mail_archive' AND " . node_access_where_sql(). " GROUP BY r.tid", $tid);
     while ($count = db_fetch_object($_counts)) {
       $counts[$count->tid] = $count;
     }
