summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/Discussions.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-02-18 21:23:20 +0100
committerYorhel <git@yorhel.nl>2009-02-18 21:23:20 +0100
commit0e8435b202264134c964c6f66884a094366b1334 (patch)
tree86158fb6ea7d03806a61ff9acb530f11b3dbbbee /lib/VNDB/DB/Discussions.pm
parent8e9e28370280618ffa11732f1e2f8e64ea379c97 (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.pm6
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};
}