Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.531
diff -u -p -r1.531 comment.module
--- modules/comment/comment.module	27 Mar 2007 05:13:53 -0000	1.531
+++ modules/comment/comment.module	29 Mar 2007 20:25:27 -0000
@@ -455,26 +455,9 @@ function comment_nodeapi(&$node, $op, $a
 
 /**
  * Implementation of hook_user().
- *
- * Provides signature customization for the user's comments.
  */
 function comment_user($type, $edit, &$user, $category = NULL) {
-  if ($type == 'form' && $category == 'account') {
-    // when user tries to edit his own data
-    $form['comment_settings'] = array(
-      '#type' => 'fieldset',
-      '#title' => t('Comment settings'),
-      '#collapsible' => TRUE,
-      '#weight' => 4);
-    $form['comment_settings']['signature'] = array(
-      '#type' => 'textarea',
-      '#title' => t('Signature'),
-      '#default_value' => $edit['signature'],
-      '#description' => t('Your signature will be publicly displayed at the end of your comments.'));
-
-    return $form;
-  }
-  elseif ($type == 'delete') {
+  if ($type == 'delete') {
     db_query('UPDATE {comments} SET uid = 0 WHERE uid = %d', $user->uid);
     db_query('UPDATE {node_comment_statistics} SET last_comment_uid = 0 WHERE last_comment_uid = %d', $user->uid);
   }
@@ -648,7 +631,7 @@ function comment_reply($node, $pid = NUL
       // $pid indicates that this is a reply to a comment.
       if ($pid) {
         // load the comment whose cid = $pid
-        if ($comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d', $pid, COMMENT_PUBLISHED))) {
+        if ($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', $pid, COMMENT_PUBLISHED))) {
           // If that comment exists, make sure that the current comment and the parent comment both
           // belong to the same parent node.
           if ($comment->nid != $node->nid) {
@@ -952,7 +935,7 @@ function comment_render($node, $cid = 0)
 
     if ($cid) {
       // Single comment view.
-      $query = 'SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.picture, u.data, c.score, c.users, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d';
+      $query = 'SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.score, c.users, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d';
       $query_args = array($cid);
       if (!user_access('administer comments')) {
         $query .= ' AND c.status = %d';
@@ -972,7 +955,7 @@ function comment_render($node, $cid = 0)
     else {
       // Multiple comment view
       $query_count = 'SELECT COUNT(*) FROM {comments} WHERE nid = %d';
-      $query = 'SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.picture, u.data, c.score, c.users, c.thread, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d';
+      $query = 'SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.score, c.users, c.thread, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d';
 
       $query_args = array($nid);
       if (!user_access('administer comments')) {
@@ -1538,9 +1521,6 @@ function comment_form($edit, $title = NU
   if (!empty($edit['comment'])) {
     $default = $edit['comment'];
   }
-  elseif (isset($user->signature)) {
-    $default = $user->signature;
-  }
   else {
     $default = '';
   }
@@ -1618,6 +1598,11 @@ function comment_form_add_preview($form,
     if ($account) {
       $comment->uid = $account->uid;
       $comment->name = check_plain($account->name);
+      $comment->signature = $account->signature;
+    }
+    else {
+      $comment->name = variable_get('anonymous', t('Anonymous'));
+      $comment->signature = '';
     }
     $comment->timestamp = !empty($edit['timestamp']) ? $edit['timestamp'] : time();
     $output .= theme('comment_view', $comment);
@@ -1632,7 +1617,7 @@ function comment_form_add_preview($form,
   $output = '';
 
   if ($edit['pid']) {
-    $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, 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 = 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);
@@ -1788,6 +1773,7 @@ function theme_comment($comment, $links 
   $output .= '<div class="subject">'. l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid")) . ' ' . theme('mark', $comment->new) ."</div>\n";
   $output .= '<div class="credit">'. t('by %a on %b', array('%a' => theme('username', $comment), '%b' => format_date($comment->timestamp))) ."</div>\n";
   $output .= '<div class="body">'. $comment->comment .'</div>';
+  $output .= '<div class="user-signature clear-block">'. $comment->signature .'</div>';
   $output .= '<div class="links">'. theme('links', $links) .'</div>';
   $output .= '</div>';
   return $output;
Index: modules/user/user.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.css,v
retrieving revision 1.4
diff -u -p -r1.4 user.css
--- modules/user/user.css	30 Dec 2006 07:45:31 -0000	1.4
+++ modules/user/user.css	29 Mar 2007 20:25:27 -0000
@@ -47,3 +47,7 @@
 .profile dd {
   margin:0;
 }
+
+.user-signature {
+  border-top: 1px solid #ccc;
+}
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.762
diff -u -p -r1.762 user.module
--- modules/user/user.module	27 Mar 2007 05:13:54 -0000	1.762
+++ modules/user/user.module	29 Mar 2007 20:25:28 -0000
@@ -1435,6 +1435,21 @@ function user_edit_form($uid, $edit, $re
     }
   }
 
+  // Signature:
+  if (module_exists('comment') && !$register) {
+    $form['signature_settings'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Signature settings'),
+      '#weight' => 1,
+    );
+    $form['signature_settings']['signature'] = array(
+      '#type' => 'textarea',
+      '#title' => t('Signature'),
+      '#default_value' => $edit['signature'],
+      '#description' => t('Your signature will be publicly displayed at the end of your comments.'),
+    );
+  }
+
   // Picture/avatar:
   if (variable_get('user_pictures', 0) && !$register) {
     $form['picture'] = array('#type' => 'fieldset', '#title' => t('Picture'), '#weight' => 1);
Index: themes/bluemarine/comment.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/bluemarine/comment.tpl.php,v
retrieving revision 1.3
diff -u -p -r1.3 comment.tpl.php
--- themes/bluemarine/comment.tpl.php	31 Jan 2007 15:49:26 -0000	1.3
+++ themes/bluemarine/comment.tpl.php	29 Mar 2007 20:25:28 -0000
@@ -4,6 +4,13 @@
   } ?>
 <h3 class="title"><?php print $title; ?></h3><?php if ($new != '') { ?><span class="new"><?php print $new; ?></span><?php } ?>
     <div class="submitted"><?php print $submitted; ?></div>
-    <div class="content"><?php print $content; ?></div>
+    <div class="content">
+     <?php print $content; ?>
+     <?php if ($signature): ?>
+      <div class="user-signature clear-block">
+       <?php print $signature ?>
+      </div>
+     <?php endif; ?>
+    </div>
     <div class="links">&raquo; <?php print $links; ?></div>
   </div>
Index: themes/chameleon/chameleon.theme
===================================================================
RCS file: /cvs/drupal/drupal/themes/chameleon/chameleon.theme,v
retrieving revision 1.56
diff -u -p -r1.56 chameleon.theme
--- themes/chameleon/chameleon.theme	29 Nov 2006 06:36:12 -0000	1.56
+++ themes/chameleon/chameleon.theme	29 Mar 2007 20:25:28 -0000
@@ -163,7 +163,13 @@ function chameleon_comment($comment, $li
 
   $output  = "<div class=\"comment". ($comment->status == COMMENT_NOT_PUBLISHED ? ' comment-unpublished' : '') ."\">\n";
   $output .= " <h3 class=\"title\">". l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid") ."</h3>\n";
-  $output .= " <div class=\"content\">". $comment->comment ."</div>\n";
+  $output .= " <div class=\"content\">". $comment->comment;
+  if ($signature) {
+    $output .= "  <div class=\"user-signature clear-block\">";
+    $output .= $signature ."\n";
+    $output .= "  </div>\n";
+  }
+  $output .= " </div>\n";
   $output .= " <div class=\"links\">". theme('links', array_merge($submitted, $links)) ."</div>\n";
   $output .= "</div>\n";
 
Index: themes/engines/phptemplate/comment.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/comment.tpl.php,v
retrieving revision 1.4
diff -u -p -r1.4 comment.tpl.php
--- themes/engines/phptemplate/comment.tpl.php	31 Aug 2006 07:21:43 -0000	1.4
+++ themes/engines/phptemplate/comment.tpl.php	29 Mar 2007 20:25:28 -0000
@@ -14,6 +14,11 @@
 
   <div class="content">
     <?php print $content ?>
+    <?php if ($signature): ?>
+    <div class="user-signature clear-block">
+      <?php print $signature ?>
+    </div>
+    <?php endif; ?>
   </div>
 
   <?php print $links ?>
Index: themes/engines/phptemplate/phptemplate.engine
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v
retrieving revision 1.60
diff -u -p -r1.60 phptemplate.engine
--- themes/engines/phptemplate/phptemplate.engine	27 Mar 2007 05:13:55 -0000	1.60
+++ themes/engines/phptemplate/phptemplate.engine	29 Mar 2007 20:25:29 -0000
@@ -313,6 +313,7 @@ function phptemplate_comment($comment, $
     'date'      => format_date($comment->timestamp),
     'links'     => isset($links) ? theme('links', $links) : '',
     'new'       => $comment->new ? t('new') : '',
+    'signature' => check_markup($comment->signature, $comment->format),
     'picture'   => theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', $comment) : '',
     'submitted' => t('Submitted by !a on @b.',
                       array('!a' => theme('username', $comment),
Index: themes/garland/comment.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/comment.tpl.php,v
retrieving revision 1.4
diff -u -p -r1.4 comment.tpl.php
--- themes/garland/comment.tpl.php	31 Jan 2007 15:49:26 -0000	1.4
+++ themes/garland/comment.tpl.php	29 Mar 2007 20:25:29 -0000
@@ -16,6 +16,11 @@
 
     <div class="content">
       <?php print $content ?>
+      <?php if ($signature): ?>
+      <div class="user-signature clear-block">
+        <?php print $signature ?>
+      </div>
+      <?php endif; ?>
     </div>
 
   </div>
Index: themes/pushbutton/comment.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/pushbutton/comment.tpl.php,v
retrieving revision 1.2
diff -u -p -r1.2 comment.tpl.php
--- themes/pushbutton/comment.tpl.php	15 Apr 2006 04:07:18 -0000	1.2
+++ themes/pushbutton/comment.tpl.php	29 Mar 2007 20:25:29 -0000
@@ -4,7 +4,14 @@
   <?php endif; ?>
   <h3 class="title"><?php print $title ?></h3>
   <div class="submitted"><?php print $submitted ?><?php if ($comment->new) : ?><span class="new"> *<?php print $new ?></span><?php endif; ?></div>
-  <div class="content"><?php print $content ?></div>
+  <div class="content">
+    <?php print $content ?>
+    <?php if ($signature): ?>
+      <div class="user-signature clear-block">
+        <?php print $signature ?>
+      </div>
+    <?php endif; ?>
+  </div>
   <!-- BEGIN: links -->
   <div class="links">&raquo; <?php print $links ?></div>
   <!-- END: links -->
