summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgfuncs.inc.php
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/lib/pkgfuncs.inc.php
parent6ee13212111ab67f920ff7778e39acd69a9878df (diff)
downloadaurweb-fb7bde3a6ca049700a691324c21005ae26782584.tar.xz
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/lib/pkgfuncs.inc.php')
-rw-r--r--web/lib/pkgfuncs.inc.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index c1a64f7..80165c9 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -208,11 +208,11 @@ function package_comments($pkgid) {
if ($pkgid > 0) {
$dbh = DB::connect();
$q = "SELECT PackageComments.ID, UserName, UsersID, Comments, CommentTS ";
- $q.= "FROM PackageComments, Users ";
- $q.= "WHERE PackageComments.UsersID = Users.ID";
- $q.= " AND PackageID = " . $pkgid;
- $q.= " AND DelUsersID IS NULL"; # only display non-deleted comments
- $q.= " ORDER BY CommentTS DESC";
+ $q.= "FROM PackageComments LEFT JOIN Users ";
+ $q.= "ON PackageComments.UsersID = Users.ID ";
+ $q.= "WHERE PackageID = " . $pkgid . " ";
+ $q.= "AND DelUsersID IS NULL "; # only display non-deleted comments
+ $q.= "ORDER BY CommentTS DESC";
if (!isset($_GET['comments'])) {
$q.= " LIMIT 10";