Index: comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment.module,v retrieving revision 1.333 diff -u -r1.333 comment.module --- comment.module 1 Feb 2005 19:45:58 -0000 1.333 +++ comment.module 4 Feb 2005 05:47:32 -0000 @@ -1403,7 +1403,7 @@ } // comment field: - $form .= form_textarea(t('Comment'), 'comment', $edit['comment'] ? $edit['comment'] : $user->signature, 70, 10, '', NULL, TRUE); + $form .= form_textarea(t('Comment'), 'comment', $edit['comment'], 70, 10, '', NULL, TRUE); // format selector $form .= filter_form('format', $edit['format']); @@ -1435,6 +1435,8 @@ $output .= "cid\">\n"; + $comment->comment .= _comment_get_user_signature($comment->uid); + // Switch to folded/unfolded view of the comment if ($visible) { $comment->comment = check_output($comment->comment, $comment->format); @@ -1676,4 +1678,19 @@ db_query("UPDATE {node_comment_statistics} SET comment_count = %d, last_comment_timestamp = '%s', last_comment_name = '%s', last_comment_uid = %d WHERE nid = %d", $count, $last_reply ? $last_reply->timestamp : $node->created, $last_reply->name, $last_reply ? $last_reply->uid : $node->uid, $nid); } +/** + * Retrieves a user's signature, if it exists. + * + * @param $uid: The user ID. + */ +function _comment_get_user_signature($uid) { + $output = ""; + + $signature = db_result(db_query('SELECT signature FROM users WHERE uid = ' . $uid . ' AND signature != ""')); + if ($signature) { + $output .= '

' . $signature . '

'; + } + + return $output; +} ?>