X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;ds=sidebyside;f=ND%2FWeb%2FForum.pm;h=76adfb2915560654bf96268d48d6d32751204605;hb=a0338ef8c49837940c009341b135fd038d8acf7a;hp=1c1ecedc9b15ec1a10b131e20c07762e07d6d0a4;hpb=b8985d0163efd6e9af29dcca7a7689183286c7e7;p=ndwebbie.git diff --git a/ND/Web/Forum.pm b/ND/Web/Forum.pm index 1c1eced..76adfb2 100644 --- a/ND/Web/Forum.pm +++ b/ND/Web/Forum.pm @@ -37,7 +37,7 @@ sub viewForumThread { $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 @@ -55,10 +55,12 @@ 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(Message => param('message')); } $template->param(Posts => \@posts); - $template->param(Message => param('message')); markThreadAsRead($thread->{id});