From 32540b01cc4b2a1c90f11b8430b61a8b2e001c7b Mon Sep 17 00:00:00 2001 From: Yorhel Date: Mon, 15 Jun 2009 20:37:00 +0200 Subject: 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! :-( --- lib/VNDB/Handler/Misc.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') 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; -- cgit v1.2.3