From 4653945226999003876d8334b9933bf5c6fd07fd Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 13 Dec 2015 21:10:05 +0100 Subject: Hide names of deleted accounts in comment headings When the account of a user who edited/deleted a comment is removed, drop occurrences of his user name in comment headings instead of replacing the user name with "None". Signed-off-by: Lukas Fleischer --- web/template/pkg_comments.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php index 5a15fab..d05c512 100644 --- a/web/template/pkg_comments.php +++ b/web/template/pkg_comments.php @@ -31,20 +31,25 @@ if (!isset($count)) { if ($uid && $is_deleted) { $date_fmtd = gmdate('Y-m-d H:i', $row['DelTS']); - $user_fmtd = html_format_username($row['DelUserName']); $heading .= ' ('; - $heading .= __('deleted on %s by %s', $date_fmtd, $user_fmtd); + if ($row['DelUserName']) { + $user_fmtd = html_format_username($row['DelUserName']); + $heading .= __('deleted on %s by %s', $date_fmtd, $user_fmtd); + } else { + $heading .= __('deleted on %s', $date_fmtd); + } $heading .= ')'; } elseif ($uid && $is_edited) { $date_fmtd = gmdate('Y-m-d H:i', $row['EditedTS']); - $user_fmtd = html_format_username($row['EditUserName']); $heading .= ' ('; - $heading .= __('edited on %s by %s', $date_fmtd, $user_fmtd); + if ($row['EditUserName']) { + $user_fmtd = html_format_username($row['EditUserName']); + $heading .= __('edited on %s by %s', $date_fmtd, $user_fmtd); + } else { + $heading .= __('edited on %s', $date_fmtd); + } $heading .= ')'; } - - $row['DelUserName'] = html_format_username($row['DelUserName']); - $row['EditUserName'] = html_format_username($row['EditUserName']); ?>

class="comment-deleted"> -- cgit v1.2.3-70-g09d2