summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VNDB/DB/Discussions.pm4
-rw-r--r--lib/VNDB/Handler/Misc.pm2
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/VNDB/DB/Discussions.pm b/lib/VNDB/DB/Discussions.pm
index b28bfeab..78a462df 100644
--- a/lib/VNDB/DB/Discussions.pm
+++ b/lib/VNDB/DB/Discussions.pm
@@ -8,7 +8,7 @@ use Exporter 'import';
our @EXPORT = qw|dbThreadGet dbThreadEdit dbThreadAdd dbPostGet dbPostEdit dbPostAdd dbThreadCount|;
-# Options: id, type, iid, results, page, what
+# Options: id, type, iid, results, page, what, notusers
# What: boards, boardtitles, firstpost, lastpost
sub dbThreadGet {
my($self, %o) = @_;
@@ -26,6 +26,8 @@ sub dbThreadGet {
't.id IN(SELECT tid FROM threads_boards WHERE type = ?)' => $o{type} ) : (),
$o{type} && $o{iid} ? (
'tb.type = ?' => $o{type}, 'tb.iid = ?' => $o{iid} ) : (),
+ $o{notusers} ? (
+ 't.id NOT IN(SELECT tid FROM threads_boards WHERE type = \'u\')' => 1) : (),
);
my @select = (
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm
index dd9c8307..9ff2d315 100644
--- a/lib/VNDB/Handler/Misc.pm
+++ b/lib/VNDB/Handler/Misc.pm
@@ -100,7 +100,7 @@ sub homepage {
# Recent posts
div class => 'mainbox threelayout last';
h1 'Recent posts';
- my $posts = $self->dbThreadGet(what => 'lastpost boardtitles', results => 10, order => 'tpl.date DESC');
+ my $posts = $self->dbThreadGet(what => 'lastpost boardtitles', results => 10, order => 'tpl.date DESC', notusers => 1);
ul;
for (@$posts) {
my $boards = join ', ', map $self->{discussion_boards}{$_->{type}}.($_->{iid}?' > '.$_->{title}:''), @{$_->{boards}};