X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FWeb%2FForum.pm;h=1b06b8a6cbfff3b9aadfce60e79263d67ad054de;hb=a5ecd18d276ae1a43b92d96e2347a077a1a52427;hp=be9a10f7c5fddf550fd22cd1ae316074633e26b6;hpb=e1e188775dd3c5e1e9472661dc2006c3cca29e1c;p=ndwebbie.git diff --git a/ND/Web/Forum.pm b/ND/Web/Forum.pm index be9a10f..1b06b8a 100644 --- a/ND/Web/Forum.pm +++ b/ND/Web/Forum.pm @@ -34,11 +34,10 @@ sub viewForumThread { my $template = HTML::Template->new(filename => "templates/viewthread.tmpl", global_vars => 1, cache => 1); - $template->param(Subject => $thread->{subject}); $template->param(Id => $thread->{id}); $template->param(Post => $thread->{post}); - my $posts = $ND::DBH->prepare(q{SELECT u.username,date_trunc('minute',fp.time::timestamp) AS time,fp.message,COALESCE(fp.time > ftv.time,TRUE) AS unread + 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 WHERE ft.ftid = $1 ORDER BY fp.time ASC @@ -56,7 +55,9 @@ ORDER BY fp.time ASC } if (defined param('cmd') && param('cmd') eq 'Preview'){ - push @posts,{message => parseMarkup(escapeHTML(param('message'))), unread => 1, username => 'PREVIEW', Time => 'Not submitted yet', NewPosts => $old ? 1 : 0}; + my $text = parseMarkup(escapeHTML(param('message'))); + $text .= p b $@ if $@; + push @posts,{message => $text, unread => 1, username => 'PREVIEW', Time => 'Not submitted yet', NewPosts => $old ? 1 : 0}; } $template->param(Posts => \@posts); $template->param(Message => param('message'));