? comment.php
? entities.php
? temp
? test.php
? misc/autofocus.js
? misc/dependencies.js
? modules/tree2
? modules/user/access_control.js
? sites/all/modules
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.522
diff -u -d -F^\s*function -r1.522 comment.module
--- modules/comment/comment.module	24 Jan 2007 14:48:36 -0000	1.522
+++ modules/comment/comment.module	29 Jan 2007 19:03:56 -0000
@@ -469,7 +469,7 @@ function comment_user($type, $edit, &$us
       '#type' => 'textarea',
       '#title' => t('Signature'),
       '#default_value' => $edit['signature'],
-      '#description' => t('Your signature will be publicly displayed at the end of your comments.'));
+      '#description' => t('Your signature will be publicly displayed with your comments. If you modify your signature, the change will be reflected in all your comments. Leave the field empty to not show a signature.'));
 
     return $form;
   }
@@ -711,7 +711,7 @@ function comment_save($edit) {
     if (!form_get_errors()) {
       if ($edit['cid']) {
         // Update the comment in the database.
-        db_query("UPDATE {comments} SET status = %d, timestamp = %d, subject = '%s', comment = '%s', format = %d, uid = %d, name = '%s', mail = '%s', homepage = '%s' WHERE cid = %d", $edit['status'], $edit['timestamp'], $edit['subject'], $edit['comment'], $edit['format'], $edit['uid'], $edit['name'], $edit['mail'], $edit['homepage'], $edit['cid']);
+        db_query("UPDATE {comments} SET status = %d, timestamp = %d, subject = '%s', comment = '%s', format = %d, uid = %d, name = '%s', mail = '%s', homepage = '%s', signature = %d WHERE cid = %d", $edit['status'], $edit['timestamp'], $edit['subject'], $edit['comment'], $edit['format'], $edit['uid'], $edit['name'], $edit['mail'], $edit['homepage'], $edit['signature'], $edit['cid']);
 
         _comment_update_node_statistics($edit['nid']);
 
@@ -791,7 +791,7 @@ function comment_save($edit) {
           $edit['name'] = $user->name;
         }
 
-        db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, format, hostname, timestamp, status, score, users, thread, name, mail, homepage) VALUES (%d, %d, %d, %d, '%s', '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s')", $edit['cid'], $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], $_SERVER['REMOTE_ADDR'], $edit['timestamp'], $status, $score, $users, $thread, $edit['name'], $edit['mail'], $edit['homepage']);
+        db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, format, hostname, timestamp, status, score, users, thread, name, mail, homepage, signature) VALUES (%d, %d, %d, %d, '%s', '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', %d)", $edit['cid'], $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], $_SERVER['REMOTE_ADDR'], $edit['timestamp'], $status, $score, $users, $thread, $edit['name'], $edit['mail'], $edit['homepage'], $edit['signature']);
 
         _comment_update_node_statistics($edit['nid']);
 
@@ -953,7 +953,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.picture, u.data, u.signature, c.score, c.users, c.status, c.signature AS has_signature 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';
@@ -977,7 +977,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.picture, u.data, u.signature, c.score, c.users, c.thread, c.status, c.signature AS has_signature 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')) {
@@ -1475,6 +1475,13 @@ function comment_form($edit, $title = NU
           '#default_value' => $author,
           '#weight' => -1,
         );
+
+        $form['admin']['signature'] = array(
+          '#type' => 'checkbox',
+          '#title' => t('Signature'),
+          '#description' => t('Show the user\'s signature with this comment.'),
+          '#default_value' => isset($edit['signature']) ? $edit['signature'] : TRUE,
+        );
       }
       else {
         // The comment is by an anonymous user
@@ -1514,9 +1521,18 @@ function comment_form($edit, $title = NU
 
     }
     else {
-      $form['_author'] = array('#type' => 'item', '#title' => t('Your name'), '#value' => theme('username', $user)
-      );
+      $form['_author'] = array('#type' => 'item', '#title' => t('Your name'), '#value' => theme('username', $user));
       $form['author'] = array('#type' => 'value', '#value' => $user->name);
+
+      if (!empty($user->signature)) {
+        $form['signature'] = array(
+          '#type' => 'checkbox',
+          '#title' => t('Add my signature'),
+          '#description' => t('Your signature will be shown with this comment. The signature can be changed in your <a href="@account">account settings</a>.', array('@account' => url('user/'. $user->uid .'/edit'))),
+          '#weight' => 17,
+          '#default_value' => isset($edit['signature']) ? $edit['signature'] : TRUE,
+        );
+      }
     }
   }
   else if (variable_get('comment_anonymous', COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MAY_CONTACT) {
@@ -1540,7 +1556,13 @@ function comment_form($edit, $title = NU
     $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => $edit['subject']);
   }
 
-  $form['comment_filter']['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE);
+  $form['comment_filter']['comment'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Comment'),
+    '#rows' => 15,
+    '#default_value' => $edit['comment'] ? $edit['comment'] : '',
+    '#required' => TRUE,
+  );
   if (!isset($edit['format'])) {
     $edit['format'] = FILTER_FORMAT_DEFAULT;
   }
@@ -1602,6 +1624,8 @@ function comment_form_add_preview($form,
   if ($account) {
     $comment->uid = $account->uid;
     $comment->name = check_plain($account->name);
+    $comment->has_signature = $comment->signature && $user->signature;
+    $comment->signature = $comment->has_signature ? $user->signature : '';
   }
   $comment->timestamp = $edit['timestamp'] ? $edit['timestamp'] : time();
 
@@ -1664,6 +1688,11 @@ function _comment_form_submit($form_valu
     }
   }
 
+  // Default to not show the signature.
+  if (!isset($form_values['signature'])) {
+    $form_values['signature'] = 0;
+  }
+
   return $form_values;
 }
 
@@ -1775,6 +1804,9 @@ function theme_comment($comment, $links 
   $output .= '<div class="subject">'. l($comment->subject, $_GET['q'], NULL, NULL, "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>';
+  if ($comment->has_signature && !empty($comment->signature)) {
+    $output .= '<div class="signature">'. $comment->signature  .'</div>';
+  }
   $output .= '<div class="links">'. theme('links', $links) .'</div>';
   $output .= '</div>';
   return $output;
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.74
diff -u -d -F^\s*function -r1.74 system.install
--- modules/system/system.install	29 Jan 2007 12:30:11 -0000	1.74
+++ modules/system/system.install	29 Jan 2007 19:04:04 -0000
@@ -3518,6 +3518,25 @@ function system_update_1021() {
  * @todo Start this series of updates at 2000.
  */
 
+
+/**
+ * Add a signature field to the comments table
+ */
+function system_update_2000() {
+  $ret = array();
+  switch ($GLOBALS['db_type']) {
+    case 'pgsql':
+      db_add_column($ret, 'comments', 'signature', 'smallint_unsigned', array('not null' => TRUE, 'default' => '0'));
+      break;
+    case 'mysql':
+    case 'mysqli':
+      $ret[] = update_sql("ALTER TABLE {comments} ADD signature tinyint unsigned NOT NULL default '0'");
+      break;
+  }
+
+  return $ret;
+}
+
 /**
  * Remove auto_increment from {boxes} to allow adding custom blocks with
  * visibility settings.
Index: themes/bluemarine/comment.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/bluemarine/comment.tpl.php,v
retrieving revision 1.2
diff -u -d -F^\s*function -r1.2 comment.tpl.php
--- themes/bluemarine/comment.tpl.php	15 Apr 2006 04:07:17 -0000	1.2
+++ themes/bluemarine/comment.tpl.php	29 Jan 2007 19:04:04 -0000
@@ -5,5 +5,6 @@
 <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>
+    <?php if ($signature) { ?><div class="signature"><?php print $signature; ?></div><?php } ?>
     <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 -d -F^\s*function -r1.56 chameleon.theme
--- themes/chameleon/chameleon.theme	29 Nov 2006 06:36:12 -0000	1.56
+++ themes/chameleon/chameleon.theme	29 Jan 2007 19:04:05 -0000
@@ -164,6 +164,9 @@ 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";
+  if ($comment->has_signature && !empty($comment->signature)) {
+    $output .= " <div class=\"signature\">". $comment->signature  ."</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 -d -F^\s*function -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 Jan 2007 19:04:05 -0000
@@ -16,5 +16,11 @@
     <?php print $content ?>
   </div>
 
+  <?php if ($signature): ?>
+    <div class="signature">
+      <?php print $signature; ?>
+    </div>
+  <?php endif; ?>
+
   <?php print $links ?>
 </div>
Index: themes/engines/phptemplate/phptemplate.engine
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v
retrieving revision 1.56
diff -u -d -F^\s*function -r1.56 phptemplate.engine
--- themes/engines/phptemplate/phptemplate.engine	25 Jan 2007 22:14:06 -0000	1.56
+++ themes/engines/phptemplate/phptemplate.engine	29 Jan 2007 19:04:05 -0000
@@ -305,6 +305,7 @@ function phptemplate_comment($comment, $
     'author'    => theme('username', $comment),
     'comment'   => $comment,
     'content'   => $comment->comment,
+    'signature' => ($comment->has_signature && !empty($comment->signature)) ? $comment->signature : FALSE,
     'date'      => format_date($comment->timestamp),
     'links'     => isset($links) ? theme('links', $links) : '',
     'new'       => $comment->new ? t('new') : '',
Index: themes/garland/comment.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/comment.tpl.php,v
retrieving revision 1.3
diff -u -d -F^\s*function -r1.3 comment.tpl.php
--- themes/garland/comment.tpl.php	14 Dec 2006 14:21:36 -0000	1.3
+++ themes/garland/comment.tpl.php	29 Jan 2007 19:04:05 -0000
@@ -18,6 +18,12 @@
       <?php print $content ?>
     </div>
 
+    <?php if ($signature): ?>
+      <div class="signature">
+        <?php print $signature; ?>
+      </div>
+    <?php endif; ?>
+
   </div>
 
   <?php if ($links): ?>
Index: themes/garland/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/style.css,v
retrieving revision 1.14
diff -u -d -F^\s*function -r1.14 style.css
--- themes/garland/style.css	10 Jan 2007 08:24:02 -0000	1.14
+++ themes/garland/style.css	29 Jan 2007 19:04:06 -0000
@@ -690,6 +690,13 @@
   border-top: 1px solid #e9eff3;
 }
 
+.comment .signature {
+  font-size: 11px;
+  border-top: 1px solid #e0e5fb;
+  padding: 0 8px;
+  margin: .5em 0;
+}
+
 .indented {
   margin-left: 25px;
 }
Index: themes/pushbutton/comment.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/pushbutton/comment.tpl.php,v
retrieving revision 1.2
diff -u -d -F^\s*function -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 Jan 2007 19:04:07 -0000
@@ -5,6 +5,7 @@
   <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>
+  <?php if ($signature) { ?><div class="signature"><?php print $signature; ?></div><?php } ?>
   <!-- BEGIN: links -->
   <div class="links">&raquo; <?php print $links ?></div>
   <!-- END: links -->
