From: Michael Andreen Date: Wed, 28 Mar 2007 11:05:27 +0000 (+0000) Subject: need to specify which uid, since it's now added to forum_threads too X-Git-Url: https://ruin.nu/git/?a=commitdiff_plain;ds=sidebyside;h=031327dbddb9665e0d5003dbc65d6956da9ea8b1;hp=d6febe3aa8ee44a6cbc4ff336e9cd60c7a3477ca;p=ndwebbie.git need to specify which uid, since it's now added to forum_threads too --- diff --git a/ND/Web/Forum.pm b/ND/Web/Forum.pm index 6b122c6..cbeb747 100644 --- a/ND/Web/Forum.pm +++ b/ND/Web/Forum.pm @@ -25,8 +25,7 @@ use HTML::Template; use ND::Web::Include; require Exporter; -our @ISA = qw/Exporter/; - +our @ISA = qw/Exporter/; our @EXPORT = qw/viewForumThread addForumPost addForumThread markThreadAsRead/; sub viewForumThread { @@ -38,7 +37,7 @@ sub viewForumThread { $template->param(Post => $thread->{post}); my $posts = $ND::DBH->prepare(q{SELECT u.username,date_trunc('seconds',fp.time::timestamp) AS time,fp.message,COALESCE(fp.time > ftv.time,TRUE) AS unread -FROM forum_threads ft JOIN forum_posts fp USING (ftid) JOIN users u USING (uid) LEFT OUTER JOIN (SELECT * FROM forum_thread_visits WHERE uid = $2) ftv ON ftv.ftid = ft.ftid +FROM forum_threads ft JOIN forum_posts fp USING (ftid) JOIN users u ON u.uid = fp.uid LEFT OUTER JOIN (SELECT * FROM forum_thread_visits WHERE uid = $2) ftv ON ftv.ftid = ft.ftid WHERE ft.ftid = $1 ORDER BY fp.time ASC });