From fb2049da3dfd9814498bb2ab0cb673b6260f4bc5 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 1 Nov 2018 17:37:20 +0100 Subject: [PATCH] nieuws: prefer full names of comment authors --- auth.inc.php | 5 +++++ nieuws/replies.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/auth.inc.php b/auth.inc.php index ca34e4f..52cd4c1 100644 --- a/auth.inc.php +++ b/auth.inc.php @@ -27,6 +27,11 @@ class User return htmlspecialchars(implode(' & ', explode("\n", $this->rawname))); } + function html() + { + return $this->name ?: $this->login; + } + function admin() { return @file_exists("{$this->dir}/.admin"); diff --git a/nieuws/replies.php b/nieuws/replies.php index f762c23..0847c7e 100644 --- a/nieuws/replies.php +++ b/nieuws/replies.php @@ -28,9 +28,10 @@ foreach (glob("$pagelink/*.html") as $reply) { if (!$replymeta) continue; $replydate = str_split($replymeta[1], 2); $replydate[1] = $replydate[0] . $replydate[1]; + $replyuser = new User("profile/{$replymeta[2]}"); print '
  • '; printf('%s %s', - $replymeta[2], showdate($replydate) + $replyuser->html, showdate($replydate) ); printf("
    %s
    \n", file_get_contents($reply)); print "
  • \n"; -- 2.30.0