diff options
author | Yorhel <git@yorhel.nl> | 2009-02-18 21:23:20 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-02-18 21:23:20 +0100 |
commit | 0e8435b202264134c964c6f66884a094366b1334 (patch) | |
tree | 86158fb6ea7d03806a61ff9acb530f11b3dbbbee /lib/VNDB/DB/Discussions.pm | |
parent | 8e9e28370280618ffa11732f1e2f8e64ea379c97 (diff) |
Don't count deleted threads on number of threads on item pages
Diffstat (limited to 'lib/VNDB/DB/Discussions.pm')
-rw-r--r-- | lib/VNDB/DB/Discussions.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/VNDB/DB/Discussions.pm b/lib/VNDB/DB/Discussions.pm index 1e626c57..8e476f55 100644 --- a/lib/VNDB/DB/Discussions.pm +++ b/lib/VNDB/DB/Discussions.pm @@ -143,8 +143,10 @@ sub dbThreadCount { my($self, $type, $iid) = @_; return $self->dbRow(q| SELECT COUNT(*) AS cnt - FROM threads_tags - WHERE type = ? AND iid = ?|, + FROM threads_tags tt + JOIN threads t ON t.id = tt.tid + WHERE tt.type = ? AND tt.iid = ? + AND t.hidden = FALSE|, $type, $iid)->{cnt}; } |