From 83a572a26245ad849be8983a818ae586f29a56c2 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Wed, 10 Jan 2007 16:06:37 +0000 Subject: [PATCH] trunc to seconds for thread listing --- ND/Web/Pages/Forum.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ND/Web/Pages/Forum.pm b/ND/Web/Pages/Forum.pm index 2b287a9..4aa72fe 100644 --- a/ND/Web/Pages/Forum.pm +++ b/ND/Web/Pages/Forum.pm @@ -92,7 +92,7 @@ sub render { } my $categories = $DBH->prepare(q{SELECT fcid AS id,category FROM forum_categories ORDER BY fcid}); - my $threads = $DBH->prepare(q{SELECT ft.ftid AS id,ft.subject,count(NULLIF(COALESCE(fp.time > ftv.time,TRUE),FALSE)) AS unread,count(fp.fpid) AS posts, max(fp.time)::timestamp as last_post + my $threads = $DBH->prepare(q{SELECT ft.ftid AS id,ft.subject,count(NULLIF(COALESCE(fp.time > ftv.time,TRUE),FALSE)) AS unread,count(fp.fpid) AS posts, date_trunc('seconds',max(fp.time)::timestamp) as last_post FROM forum_threads ft JOIN forum_posts fp USING (ftid) LEFT OUTER JOIN (SELECT * FROM forum_thread_visits WHERE uid = $2) ftv ON ftv.ftid = ft.ftid WHERE ft.fbid = $1 GROUP BY ft.ftid, ft.subject -- 2.39.2