nieuws: prefer full names of comment authors
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 1 Nov 2018 16:37:20 +0000 (17:37 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 28 Jun 2019 01:20:30 +0000 (03:20 +0200)
auth.inc.php
nieuws/replies.php

index ca34e4f9de909316bcb904955341913f64e6dee0..52cd4c1e29ababbce4ae3729f652617a247935d0 100644 (file)
@@ -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");
index f762c23ccf8da577faab77c06e7eb90165890f44..0847c7ef0d9aa0dde103257861863b1f847ed810 100644 (file)
@@ -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 '<li>';
        printf('<strong>%s</strong> <small class=date>%s</small>',
-               $replymeta[2], showdate($replydate)
+               $replyuser->html, showdate($replydate)
        );
        printf("<blockquote>%s</blockquote>\n", file_get_contents($reply));
        print "</li>\n";