From f16a624b55a7b1b82e12caf3b93c576dd6a9814a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 28 Jul 2024 00:02:49 -0700 Subject: [PATCH] forums: when quote a message, identify its sender and date e.g. In reply to Joe Smith's message of 28 Jul 2024: --- html/user/forum_reply.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/html/user/forum_reply.php b/html/user/forum_reply.php index 38ea75db54..b8243bc76d 100644 --- a/html/user/forum_reply.php +++ b/html/user/forum_reply.php @@ -161,7 +161,7 @@ function show_message_row($thread, $parent_post) { $x2 .= htmlspecialchars($content); } else if (!$no_quote) { if ($parent_post) { - $x2 .= quote_text(htmlspecialchars($parent_post->content))."\n"; + $x2 .= quote_text($parent_post)."\n"; } } if (!$logged_in_user->prefs->no_signature_by_default) { @@ -186,9 +186,15 @@ function show_message_row($thread, $parent_post) { row2($x1, $x2, false, "20%"); } -function quote_text($text) { - $text = "[quote]" . $text . "[/quote]"; - return $text; +function quote_text($post) { + $user = BoincUser::lookup_id($post->user); + return sprintf( + 'In reply to %s\'s message of %s: + [quote]%s[/quote]', + $user?$user->name:'unknown user', + date_str($post->timestamp), + htmlspecialchars($post->content) + ); } $cvs_version_tracker[]="\$Id$";