+ +
Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.529 diff -u -p -r1.529 comment.module --- modules/comment/comment.module 12 Mar 2007 13:08:02 -0000 1.529 +++ modules/comment/comment.module 24 Mar 2007 23:57:36 -0000 @@ -454,26 +454,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); } @@ -647,7 +630,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) { @@ -975,7 +958,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,7 +1521,7 @@ function comment_form($edit, $title = NU $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => !empty($edit['subject']) ? $edit['subject'] : ''); } - $form['comment_filter']['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => !empty($edit['comment']) ? $edit['comment'] : $user->signature, '#required' => TRUE); + $form['comment_filter']['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'], '#required' => TRUE); if (!isset($edit['format'])) { $edit['format'] = FILTER_FORMAT_DEFAULT; } Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.760 diff -u -p -r1.760 user.module --- modules/user/user.module 24 Mar 2007 05:36:30 -0000 1.760 +++ modules/user/user.module 24 Mar 2007 23:57:39 -0000 @@ -1432,6 +1432,21 @@ function user_edit_form($uid, $edit, $re } } + // Signature: + if (module_exists('comment')) { + $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 24 Mar 2007 23:57:39 -0000 @@ -4,6 +4,12 @@ } ?>
- +
". l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid") ."
\n"; - $output .= "\n"; + $output .= $signature ."\n"; + $output .= "