summaryrefslogtreecommitdiff
path: root/web/template
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-02-04 18:39:49 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2014-02-04 18:48:23 +0100
commitfb7bde3a6ca049700a691324c21005ae26782584 (patch)
tree2844c5ea2d7c7364349938ba6e42059fd92f6b48 /web/template
parent6ee13212111ab67f920ff7778e39acd69a9878df (diff)
Add support for anonymous comments
This allows for removing users without also removing the corresponding comments. Instead, all comments from deleted users will be displayed as "Anonymous comment". Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/template')
-rw-r--r--web/template/pkg_comments.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php
index 2ed6420..88e739e 100644
--- a/web/template/pkg_comments.php
+++ b/web/template/pkg_comments.php
@@ -10,7 +10,7 @@ $pkgname = $row['Name'];
</h3>
<?php while (list($indx, $row) = each($comments)): ?>
- <?php if ($SID):
+ <?php if ($row['UserName'] && $SID):
$row['UserName'] = "<a href=\"" . get_user_uri($row['UserName']) . "\">{$row['UserName']}</a>";
endif; ?>
<h4>
@@ -22,10 +22,18 @@ $pkgname = $row['Name'];
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
<input type="image" src="/images/x.png" alt="<?= __('Delete comment') ?>" name="submit" value="1" />
</fieldset>
+ <?php if ($row['UserName']): ?>
<?= __('Comment by %s', $row['UserName']) ?>
+ <?php else: ?>
+ <?= __('Anonymous comment') ?>
+ <?php endif; ?>
</form>
<?php else: ?>
+ <?php if ($row['UserName']): ?>
<?= __('Comment by %s', $row['UserName']) ?>
+ <?php else: ?>
+ <?= __('Anonymous comment') ?>
+ <?php endif; ?>
<?php endif; ?>
</h4>
<p class="timestamp"><?= gmdate('Y-m-d H:i', $row['CommentTS']) ?></p>