summaryrefslogtreecommitdiff
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
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! :-(
-rw-r--r--ChangeLog1
-rw-r--r--lib/VNDB/Handler/Misc.pm5
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a444720d..302b2bd3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
2.5 - ?
- Hide NSFW images in diff viewer (unless NSFW warnings are disabled)
+ - Display related boards in recent posts tooltip op homepage
2.4 - 2009-06-07
- Release search + browser + filters
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;