From 19fd4a5af02598996dd548b3b2307a2b1ea527e3 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Wed, 19 Nov 2008 18:02:14 +0100 Subject: [PATCH] Show proper titles in forum --- lib/NDWeb/Controller/Forum.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/NDWeb/Controller/Forum.pm b/lib/NDWeb/Controller/Forum.pm index 2de3ea8..a9b1cb5 100644 --- a/lib/NDWeb/Controller/Forum.pm +++ b/lib/NDWeb/Controller/Forum.pm @@ -189,6 +189,8 @@ sub board : Local { } $c->stash(threads => \@threads); + $c->stash(title => "$board->{board} ($board->{category})"); + $c->forward('listModeratorBoards', [$board->{fbid}]) if $board->{moderate}; } @@ -198,15 +200,18 @@ sub thread : Local { my $dbh = $c->model; $c->forward('findThread'); - unless ($c->stash->{thread}){ + $thread = $c->stash->{thread}; + unless ($thread){ $c->stash(template => 'default.tt2'); $c->res->status(404); return; } my $query = $dbh->prepare(q{SELECT uid,username FROM users u JOIN forum_priv_access fta USING (uid) WHERE fta.ftid = $1}); - $query->execute($thread); + $query->execute($thread->{ftid}); $c->stash(access => $query->fetchall_arrayref({}) ); + $c->stash(title => $thread->{subject} + . " ($thread->{category} - $thread->{board})"); $c->forward('findPosts'); $c->forward('markThreadAsRead') if $c->user_exists; if ($c->stash->{thread}->{moderate}) { -- 2.39.2