? files
? modules/forum/forum (copy).install
? modules/forum/forum (copy).module
? sites/default/settings.php
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.357
diff -u -p -r1.357 theme.inc
--- includes/theme.inc	31 May 2007 12:14:04 -0000	1.357
+++ includes/theme.inc	7 Jun 2007 16:40:31 -0000
@@ -1579,6 +1579,9 @@ function template_preprocess_node(&$vari
     $variables['content'] = '';
   }
 
+  $joined                 = _user_get_created($node->uid);
+  $variables['joined']    = !empty($joined) ? format_date($joined, 'custom', 'd M Y') : '';
+  $variables['posts']     = _user_get_posts($node->uid);
   $variables['date']      = format_date($node->created);
   $variables['links']     = !empty($node->links) ? theme('links', $node->links, array('class' => 'links inline')) : '';
   $variables['name']      = theme('username', $node);
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.551
diff -u -p -r1.551 comment.module
--- modules/comment/comment.module	5 Jun 2007 12:13:21 -0000	1.551
+++ modules/comment/comment.module	7 Jun 2007 16:40:40 -0000
@@ -152,32 +152,32 @@ function comment_theme() {
       'arguments' => array('form' => NULL),
     ),
     'comment_preview' => array(
-      'arguments' => array('comment' => NULL, 'links' => array(), 'visible' => 1),
+      'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array(), 'visible' => 1),
     ),
     'comment_view' => array(
-      'arguments' => array('comment' => NULL, 'links' => array(), 'visible' => 1),
+      'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array(), 'visible' => 1),
     ),
     'comment_controls' => array(
       'arguments' => array('form' => NULL),
     ),
     'comment' => array(
-      'arguments' => array('comment' => NULL, 'links' => array()),
+      'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array()),
       'file' => 'comment.tpl.php',
     ),
     'comment_folded' => array(
       'arguments' => array('comment' => NULL),
     ),
     'comment_flat_collapsed' => array(
-      'arguments' => array('comment' => NULL),
+      'arguments' => array('comment' => NULL, 'node' => NULL),
     ),
     'comment_flat_expanded' => array(
-      'arguments' => array('comment' => NULL),
+      'arguments' => array('comment' => NULL, 'node' => NULL),
     ),
     'comment_thread_collapsed' => array(
-      'arguments' => array('comment' => NULL),
+      'arguments' => array('comment' => NULL, 'node' => NULL),
     ),
     'comment_thread_expanded' => array(
-      'arguments' => array('comment' => NULL),
+      'arguments' => array('comment' => NULL, 'node' => NULL),
     ),
     'comment_post_forbidden' => array(
       'arguments' => array('nid' => NULL),
@@ -689,7 +689,7 @@ function comment_reply($node, $pid = NUL
           // Display the parent comment
           $comment = drupal_unpack($comment);
           $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
-          $output .= theme('comment_view', $comment);
+          $output .= theme('comment_view', $comment, $node);
         }
         else {
           drupal_set_message(t('The comment you are replying to does not exist.'), 'error');
@@ -988,7 +988,7 @@ function comment_render($node, $cid = 0)
         $links = module_invoke_all('link', 'comment', $comment, 1);
         drupal_alter('link', $links, $node);
 
-        $output .= theme('comment_view', $comment, $links);
+        $output .= theme('comment_view', $comment, $node, $links);
       }
     }
     else {
@@ -1057,16 +1057,16 @@ function comment_render($node, $cid = 0)
         }
 
         if ($mode == COMMENT_MODE_FLAT_COLLAPSED) {
-          $output .= theme('comment_flat_collapsed', $comment);
+          $output .= theme('comment_flat_collapsed', $comment, $node);
         }
         else if ($mode == COMMENT_MODE_FLAT_EXPANDED) {
-          $output .= theme('comment_flat_expanded', $comment);
+          $output .= theme('comment_flat_expanded', $comment, $node);
         }
         else if ($mode == COMMENT_MODE_THREADED_COLLAPSED) {
-          $output .= theme('comment_thread_collapsed', $comment);
+          $output .= theme('comment_thread_collapsed', $comment, $node);
         }
         else if ($mode == COMMENT_MODE_THREADED_EXPANDED) {
-          $output .= theme('comment_thread_expanded', $comment);
+          $output .= theme('comment_thread_expanded', $comment, $node);
         }
       }
       for ($i = 0; $i < $divs; $i++) {
@@ -1626,6 +1626,7 @@ function comment_form_add_preview($form,
   drupal_set_title(t('Preview comment'));
 
   $output = '';
+  $node = node_load($edit['nid']);
 
   // Invoke full validation for the form, to protect against cross site
   // request forgeries (CSRF) and setting arbitrary values for fields such as
@@ -1651,7 +1652,7 @@ function comment_form_add_preview($form,
       $comment->name = variable_get('anonymous', t('Anonymous'));
     }
     $comment->timestamp = !empty($edit['timestamp']) ? $edit['timestamp'] : time();
-    $output .= theme('comment_view', $comment);
+    $output .= theme('comment_view', $comment, $node);
   }
   $form['comment_preview'] = array(
     '#value' => $output,
@@ -1666,10 +1667,10 @@ function comment_form_add_preview($form,
     $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.signature, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d', $edit['pid'], COMMENT_PUBLISHED));
     $comment = drupal_unpack($comment);
     $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
-    $output .= theme('comment_view', $comment);
+    $output .= theme('comment_view', $comment, $node);
   }
   else {
-    $form['#suffix'] = node_view(node_load($edit['nid']));
+    $form['#suffix'] = node_view($node);
     $edit['pid'] = 0;
   }
 
@@ -1724,19 +1725,7 @@ function comment_form_submit($form, &$fo
   }
 }
 
-/*
-** Renderer or visualization functions this can be optionally
-** overridden by themes.
-*/
-
-function theme_comment_preview($comment, $links = array(), $visible = 1) {
-  $output = '<div class="preview">';
-  $output .= theme('comment_view', $comment, $links, $visible);
-  $output .= '</div>';
-  return $output;
-};
-
-function theme_comment_view($comment, $links = array(), $visible = 1) {
+function theme_comment_view($comment, $node, $links = array(), $visible = 1) {
   static $first_new = TRUE;
 
   $output = '';
@@ -1757,7 +1746,7 @@ function theme_comment_view($comment, $l
     // Comment API hook
     comment_invoke_comment($comment, 'view');
 
-    $output .= theme('comment', $comment, $links);
+    $output .= theme('comment', $comment, $node, $links);
   }
   else {
     $output .= theme('comment_folded', $comment);
@@ -1825,6 +1814,11 @@ function comment_controls_submit($form, 
  */
 function template_preprocess_comment(&$variables) {
   $comment = $variables['comment'];
+  $node = $variables['node'];
+
+  $joined                 = _user_get_created($comment->uid);
+  $variables['joined']    = !empty($joined) ? format_date($joined, 'custom', 'd M Y') : '';
+  $variables['posts']     = _user_get_posts($comment->uid);
   $variables['author']    = theme('username', $comment);
   $variables['comment']   = $comment;
   $variables['content']   = $comment->comment;
@@ -1837,6 +1831,7 @@ function template_preprocess_comment(&$v
                       array('!a' => theme('username', $comment),
                             '@b' => format_date($comment->timestamp)));
   $variables['title']     = l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid"));
+  $variables['template_files'][] = 'comment-'. $node->type;
 }
 
 function theme_comment_folded($comment) {
@@ -1847,22 +1842,22 @@ function theme_comment_folded($comment) 
   return $output;
 }
 
-function theme_comment_flat_collapsed($comment) {
-  return theme('comment_view', $comment, '', 0);
+function theme_comment_flat_collapsed($comment, $node) {
+  return theme('comment_view', $comment, $node, '', 0);
 }
 
-function theme_comment_flat_expanded($comment) {
-  return theme('comment_view', $comment, module_invoke_all('link', 'comment', $comment, 0));
+function theme_comment_flat_expanded($comment, $node) {
+  return theme('comment_view', $comment, $node, module_invoke_all('link', 'comment', $comment, 0));
 }
 
-function theme_comment_thread_collapsed($comment) {
-  $output .= theme('comment_view', $comment, '', 0);
+function theme_comment_thread_collapsed($comment, $node) {
+  $output .= theme('comment_view', $comment, $node, '', 0);
   return $output;
 }
 
-function theme_comment_thread_expanded($comment) {
+function theme_comment_thread_expanded($comment, $node) {
   $output = '';
-  $output .= theme('comment_view', $comment, module_invoke_all('link', 'comment', $comment, 0));
+  $output .= theme('comment_view', $comment, $node, module_invoke_all('link', 'comment', $comment, 0));
   return $output;
 }
 
Index: modules/forum/forum.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.css,v
retrieving revision 1.4
diff -u -p -r1.4 forum.css
--- modules/forum/forum.css	27 May 2007 17:57:48 -0000	1.4
+++ modules/forum/forum.css	7 Jun 2007 16:40:41 -0000
@@ -36,3 +36,66 @@
   float: right; /* LTR */
   width: 46%;
 }
+
+/* Flatforum Structure */
+.forum-body {
+  float: left;
+  margin-bottom: 6px;
+  padding: 0.5em;
+  border: 1px solid #abc;
+}
+
+.forum-header {
+  border-bottom: 1px solid #ccc;
+  margin-left: 2px;
+}
+
+.forum-body h3.forum-title {
+  font-size: 1.2em;
+  margin-left: 5px;
+  float: right;
+}
+
+.forum-body-left {
+  width: 18%;
+  height: 100%;
+  float: left;
+  font-size: 0.8em; 
+  padding: 5px;
+  margin: 0;
+  border-right: 1px solid #AABBCC;
+}
+
+.forum-body-left .forum-author {
+  font-size: 1.8em;
+  margin-bottom: 5px;
+}
+
+.forum-body-left .forum-posts, .forum-body-left .forum-joined {
+  font-size: 12px;
+}
+
+.forum-body-left {
+}
+
+.forum-body-right {
+}
+
+.forum-body .forum-body-left .picture {
+  float: none;
+  border: none;
+  padding: 0;
+}
+
+.forum-body-right {
+  float: right;
+  width: 78%;
+}
+
+.forum-body-right .content {
+  padding: 5px;
+}
+
+.forum-body-right .content .links {
+}
+
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.402
diff -u -p -r1.402 forum.module
--- modules/forum/forum.module	4 Jun 2007 15:56:32 -0000	1.402
+++ modules/forum/forum.module	7 Jun 2007 16:40:46 -0000
@@ -360,9 +360,9 @@ function forum_submit(&$form_values) {
         $forum_terms[] = $term->tid;
       }
     }
-    foreach ($form_values['taxonomy'] as $term) {
-      if (in_array($term, $forum_terms)) {
-        $form_values['tid'] = $term;
+    foreach ($form_values['taxonomy'] as $term_id => $term) {// NOTE: This($temp_array) is a workaround to get taxonomy module to work for forums.
+      if (in_array($term_id, $forum_terms)) {
+        $form_values['tid'] = $term_id;
       }
     }
     $old_tid = db_result(db_query_range("SELECT tid FROM {forum} WHERE nid = %d ORDER BY vid DESC", $form_values['nid'], 0, 1));
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.359
diff -u -p -r1.359 taxonomy.module
--- modules/taxonomy/taxonomy.module	5 Jun 2007 12:13:22 -0000	1.359
+++ modules/taxonomy/taxonomy.module	7 Jun 2007 16:40:54 -0000
@@ -743,7 +743,9 @@ function taxonomy_form_alter(&$form, $fo
             $default_terms[$term->tid] = $term;
           }
         }
-        $form['taxonomy'][$vocabulary->vid] = taxonomy_form($vocabulary->vid, array_keys($default_terms), $vocabulary->help);
+        // NOTE: This($temp_array) is a workaround to get taxonomy module to work for forums.
+        $temp_array = array();
+        $form['taxonomy'][$vocabulary->vid] = taxonomy_form($temp_array, $vocabulary->vid, array_keys($default_terms), $vocabulary->help);
         $form['taxonomy'][$vocabulary->vid]['#weight'] = $vocabulary->weight;
         $form['taxonomy'][$vocabulary->vid]['#required'] = $vocabulary->required;
       }
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.793
diff -u -p -r1.793 user.module
--- modules/user/user.module	5 Jun 2007 12:13:23 -0000	1.793
+++ modules/user/user.module	7 Jun 2007 16:41:11 -0000
@@ -2782,6 +2782,54 @@ function user_help_page() {
 }
 
 /**
+ * Return timestamp when a specified or current user registered.
+ */
+function _user_get_created($uid = '') {
+  $output = '';
+  if (empty($uid)) {
+    global $user;
+    $uid = $user->uid;
+  }
+
+  $output = db_result(db_query('SELECT created FROM {users} WHERE uid = %d', $uid));
+
+  return $output;
+}
+
+/**
+ * Get the number of nodes and comments for the specified or the current user.
+ *
+ * @param $uid User ID count comments for.
+ * @param $option Return the count for comment or node. Defaults to the sum of both.
+ */
+function _user_get_posts($uid = '', $option = NULL) {
+  $output = 0;
+
+  if (empty($uid)) {
+    global $user;
+    $uid = $user->uid;
+  }
+
+  if (!module_exists('comment') && $option != 'nodes') {
+    return $output;
+  }
+
+  switch ($option) {
+    case 'nodes':
+      $output = db_result(db_query('SELECT COUNT(*) FROM {node} WHERE uid = %d AND status = 1', $uid));
+      break;
+    case 'comments':
+      $output = db_result(db_query('SELECT COUNT(*) FROM {comments} WHERE uid = %d AND status = %d', $uid, COMMENT_PUBLISHED));
+      break;
+    default:
+      $output = db_result(db_query('SELECT COUNT(*) FROM {node} WHERE uid = %d AND status = 1', $uid));
+      $output += db_result(db_query('SELECT COUNT(*) FROM {comments} WHERE uid = %d AND status = %d', $uid, COMMENT_PUBLISHED));
+  }
+
+  return $output;
+}
+
+/**
  * Retrieve a list of all user setting/information categories and sort them by weight.
  */
 function _user_categories($account) {
Index: themes/garland/comment-forum.tpl.php
===================================================================
RCS file: themes/garland/comment-forum.tpl.php
diff -N themes/garland/comment-forum.tpl.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ themes/garland/comment-forum.tpl.php	7 Jun 2007 16:41:12 -0000
@@ -0,0 +1,38 @@
+<div class="forum-body<?php print ($comment->new) ? ' comment-new' : ''; print ($comment->status == COMMENT_NOT_PUBLISHED) ? ' comment-unpublished' : ''; ?> clear-block">
+<?php //print 'waheguru';?>
+  <div class="forum-header">
+    <h3 class="forum-title"><?php print $title ?></h3>
+    <?php print $date ?>
+  </div>
+
+  <div class="forum-body-left">
+    <div class="forum-author"><?php print $author ?></div>
+    <?php print $picture ?>
+
+    <span class="forum-posts">
+      <?php print t('Posts:') . ' ' . $posts ?><br />
+    </span>
+    <span class="forum-joined">
+      <?php print t('Joined:') . ' ' . $joined ?><br />
+    </span>
+  </div>
+
+  <div class="forum-body-right">
+
+    <?php if ($comment->new) : ?>
+      <a id="new"></a>
+      <span class="new"><?php print $new ?></span>
+    <?php endif; ?>
+
+    <div class="content">
+      <?php print $content ?>
+      <?php if ($signature): ?>
+      <div class="user-signature clear-block">
+        <?php print $signature ?>
+      </div>
+      <?php endif; ?>
+      <?php print $links ?>
+    </div>
+  </div>
+
+</div>
Index: themes/garland/node-forum.tpl.php
===================================================================
RCS file: themes/garland/node-forum.tpl.php
diff -N themes/garland/node-forum.tpl.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ themes/garland/node-forum.tpl.php	7 Jun 2007 16:41:12 -0000
@@ -0,0 +1,37 @@
+<?php phptemplate_comment_wrapper(NULL, $node->type); ?>
+
+<div id="node-<?php print $node->nid; ?>" class="forum-body<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">
+
+  <div class="forum-header">
+    <h3 class="forum-title"><?php print $title ?></h3><?php print $date ?>
+  </div>
+
+  <div class="forum-body-left">
+    <div class="forum-author"><?php print $name ?></div>
+    <?php print $picture ?>
+
+    <span class="forum-posts">
+      <?php print t('Posts:') . ' ' . $posts ?><br />
+    </span>
+    <span class="forum-joined">
+      <?php print t('Joined:') . ' ' . $joined ?><br />
+    </span>
+  </div>
+
+  <div class="forum-body-right">
+
+    <div class="content">
+      <?php print $content ?>
+    <div class="meta">
+    <?php if ($taxonomy): ?>
+      <div class="terms"><?php print $terms ?></div>
+    <?php endif;?>
+    </div>
+
+    <?php if ($links): ?>
+      <div class="links"><?php print $links; ?></div>
+    <?php endif; ?>
+    </div>
+  </div>
+
+</div>
Index: themes/garland/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/style.css,v
retrieving revision 1.19
diff -u -p -r1.19 style.css
--- themes/garland/style.css	13 Apr 2007 07:33:24 -0000	1.19
+++ themes/garland/style.css	7 Jun 2007 16:41:14 -0000
@@ -1023,3 +1023,11 @@ table.system-status-report tr.ok, table.
   background-color: #dfd;
   border-color: #beb;
 }
+
+/**
+ * Forum styling.
+ */
+
+.forum-body {
+  background: #fff url(images/gradient-inner.png) repeat-x 0 0;
+} 
