Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.534
diff -u -p -r1.534 comment.module
--- modules/comment/comment.module 1 Apr 2007 05:04:19 -0000 1.534
+++ modules/comment/comment.module 2 Apr 2007 15:13:14 -0000
@@ -641,7 +641,6 @@ function comment_reply($node, $pid = NUL
// Display the parent comment
$comment = drupal_unpack($comment);
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
- $comment->signature = check_markup($comment->signature, $comment->format);
$output .= theme('comment_view', $comment);
}
else {
@@ -946,7 +945,6 @@ function comment_render($node, $cid = 0)
if ($comment = db_fetch_object($result)) {
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
- $comment->signature = check_markup($comment->signature, $comment->format);
$links = module_invoke_all('link', 'comment', $comment, 1);
drupal_alter('link', $links, $node);
@@ -1001,7 +999,6 @@ function comment_render($node, $cid = 0)
while ($comment = db_fetch_object($result)) {
$comment = drupal_unpack($comment);
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
- $comment->signature = check_markup($comment->signature, $comment->format);
$comment->depth = count(explode('.', $comment->thread)) - 1;
if ($mode == COMMENT_MODE_THREADED_COLLAPSED || $mode == COMMENT_MODE_THREADED_EXPANDED) {
@@ -1600,11 +1597,9 @@ function comment_form_add_preview($form,
if ($account) {
$comment->uid = $account->uid;
$comment->name = check_plain($account->name);
- $comment->signature = check_markup($account->signature, $comment->format);
}
else {
$comment->name = variable_get('anonymous', t('Anonymous'));
- $comment->signature = '';
}
$comment->timestamp = !empty($edit['timestamp']) ? $edit['timestamp'] : time();
$output .= theme('comment_view', $comment);
@@ -1622,7 +1617,6 @@ 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;
- $comment->signature = check_markup($comment->signature, $comment->format);
$output .= theme('comment_view', $comment);
}
else {
@@ -1776,7 +1770,7 @@ function theme_comment($comment, $links
$output .= '
'. l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid")) . ' ' . theme('mark', $comment->new) ."
\n";
$output .= ''. t('by %a on %b', array('%a' => theme('username', $comment), '%b' => format_date($comment->timestamp))) ."
\n";
$output .= ''. $comment->comment .'
';
- $output .= '—
'. $comment->signature .'
';
+ $output .= theme('user_signature', $comment->signature);
$output .= ''. theme('links', $links) .'
';
$output .= '';
return $output;
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.390
diff -u -p -r1.390 forum.module
--- modules/forum/forum.module 28 Mar 2007 14:08:22 -0000 1.390
+++ modules/forum/forum.module 2 Apr 2007 15:13:15 -0000
@@ -311,6 +311,8 @@ function forum_view(&$node, $teaser = FA
$node = node_prepare($node, $teaser);
if (!$teaser) {
+ // Append signature to initial post.
+ $node->content['body']['#value'] .= theme('user_signature', check_markup($node->signature, $node->format));
$node->content['forum_navigation'] = array(
'#value' => theme('forum_topic_navigation', $node),
'#weight' => 100,
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.794
diff -u -p -r1.794 node.module
--- modules/node/node.module 27 Mar 2007 05:13:54 -0000 1.794
+++ modules/node/node.module 2 Apr 2007 15:13:16 -0000
@@ -521,10 +521,10 @@ function node_load($param = array(), $re
// No db_rewrite_sql is applied so as to get complete indexing for search.
if ($revision) {
array_unshift($arguments, $revision);
- $node = db_fetch_object(db_query('SELECT n.nid, r.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.nid = n.nid AND r.vid = %d WHERE '. $cond, $arguments));
+ $node = db_fetch_object(db_query('SELECT n.nid, r.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.signature, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.nid = n.nid AND r.vid = %d WHERE '. $cond, $arguments));
}
else {
- $node = db_fetch_object(db_query('SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.vid = n.vid WHERE '. $cond, $arguments));
+ $node = db_fetch_object(db_query('SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.signature, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.vid = n.vid WHERE '. $cond, $arguments));
}
if ($node->nid) {
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.763
diff -u -p -r1.763 user.module
--- modules/user/user.module 30 Mar 2007 07:45:19 -0000 1.763
+++ modules/user/user.module 2 Apr 2007 15:13:18 -0000
@@ -2773,3 +2773,35 @@ function user_forms() {
return $forms;
}
+/**
+ * Implementation of hook_comment().
+ *
+ * Adds signatures to comments.
+ */
+function user_comment($comment, $op) {
+ if ($op == 'view') {
+ if (isset($comment->signature)) {
+ $comment->signature = check_markup($comment->signature, $comment->format);
+ }
+ else {
+ $comment->signature = '';
+ }
+ }
+}
+
+/**
+ * Theme output of signature.
+ *
+ * @ingroup themeable
+ */
+function theme_user_signature($signature) {
+ $output = '';
+ if ($signature) {
+ $output .= '';
+ $output .= '
'. '—' .'
';
+ $output .= $signature;
+ $output .= '
';
+ }
+
+ return $output;
+}