summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-06-15 20:37:00 +0200
committerYorhel <git@yorhel.nl>2009-06-15 20:37:00 +0200
commit32540b01cc4b2a1c90f11b8430b61a8b2e001c7b (patch)
treebbb5c58a86cf025bcfc9607a5728dec48e7abd1a /lib
parent9c917a5d7c1f55b44d6feba50e41639e798f7011 (diff)
Display related boards in tooltip on recent posts on homepage
And another 5ms to the page loading time of the homepage. Byebye, server resources, byebye! :-(
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/Misc.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm
index f2f66f0b..414139a5 100644
--- a/lib/VNDB/Handler/Misc.pm
+++ b/lib/VNDB/Handler/Misc.pm
@@ -115,12 +115,13 @@ sub homepage {
# Recent posts
div class => 'mainbox threelayout last';
h1 'Recent posts';
- my $posts = $self->dbThreadGet(what => 'lastpost', results => 10, order => 'tpl.date DESC');
+ my $posts = $self->dbThreadGet(what => 'lastpost boardtitles', results => 10, order => 'tpl.date DESC');
ul;
for (@$posts) {
+ my $boards = join ', ', map $self->{discussion_boards}{$_->{type}}.($_->{iid}?' > '.$_->{title}:''), @{$_->{boards}};
li;
txt age($_->{ldate}).' ';
- a href => "/t$_->{id}.$_->{count}", title => $_->{title}, shorten $_->{title}, 20;
+ a href => "/t$_->{id}.$_->{count}", title => "Posted in $boards", shorten $_->{title}, 20;
txt ' by ';
a href => "/u$_->{luid}", $_->{lusername};
end;