--- org/template.php	2006-12-12 15:31:55.000000000 -0600
+++ template.php	2007-02-26 13:17:05.000000000 -0600
@@ -41,21 +41,25 @@
 function phptemplate_comment_wrapper($content, $type = null) {
   static $node_type;
   if (isset($type)) $node_type = $type;
-
+/*
   if (!$content || $node_type == 'forum') {
     return '<div id="comments">'. $content . '</div>';
   }
   else {
     return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
   }
+*/
+return $content;
 }
-
 /**
  * Override or insert PHPTemplate variables into the templates.
  */
-function _phptemplate_variables($hook, $vars) {
-  if ($hook == 'page') {
-
+function _phptemplate_variables($hook, $vars = array()) {
+switch ($hook) {
+    case 'page':
+      if((arg(0) == 'forum' || $vars['type'] == 'forum' || $vars['node']->type == 'forum')&& !drupal_is_front_page()) {
+	        $vars['template_file'] = 'page-forum';
+      }
     if ($secondary = menu_secondary_local_tasks()) {
       $output = '<span class="clear"></span>';
       $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
@@ -66,10 +70,45 @@
     if (module_exists('color')) {
       _color_page_alter($vars);
     }
+ 
+    case 'node':
+      if($vars['type'] == 'forum'&&  !drupal_is_front_page()) {
+        $vars['row_class'] = _row_class();
+        $vars['userid']=$vars['node']->uid;
+        $joined = module_invoke('flatforum', 'get_created', $vars['node']->uid);
+        $vars['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
+        $posts = module_invoke('flatforum', 'get', $vars['node']->uid);
+        $vars['posts'] = $posts ? $posts : 0;
+        $vars['title'] = empty($vars['title']) ? '&nbsp' : $vars['title'];
+        $vars['content'] = $vars['node']->body;
+        $vars['links'] = empty($vars['links']) ? '&nbsp' : $vars['links'];
+      }
+      break;
+
+    case 'comment' :
+      $cnode = node_load($vars['comment']->nid);
+
+      if($cnode->type == 'forum'&&  !drupal_is_front_page()) {
+        $vars['template_file'] = 'node-forum';
+        $vars['row_class'] = _row_class();
+        $vars['name'] = $vars['author'];
+        $vars['userid'] = $vars['comment']->uid;
+        $joined = module_invoke('flatforum', 'get_created', $vars['comment']->uid);
+        $vars['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
+        $posts = module_invoke('flatforum', 'get', $vars['comment']->uid);
+        $vars['posts'] = $posts ? $posts : 0;
+        $vars['submitted'] = format_date($vars['comment']->timestamp);
+        $subject = $vars['comment']->subject;
+        $vars['title'] = empty($subject) ? '&nbsp' : $subject;
+        $vars['content'] = $vars['comment']->comment;
+        $vars['links'] = empty($vars['links']) ? '&nbsp' : $vars['links'];
+      }
+     
+      break;
+  }
+
     return $vars;
   }
-  return array();
-}
 
 /**
  * Returns the rendered local tasks. The default implementation renders
@@ -86,3 +125,16 @@
 
   return $output;
 }
+/* removes the next and previous links */ 
+function phptemplate_forum_topic_navigation($node){
+	if($node->type == 'forum'){
+        return _phptemplate_callback('forum_topic_navigation', array('node' => $node));
+}else{
+	return theme_forum_topic_navigation($node);
+} }
+  
+function _row_class() {
+  static $forum_row = TRUE;
+  $forum_row = !$forum_row;
+  return $forum_row ? 'odd' : 'even';
+}
