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});
$post->{message} = parseMarkup($post->{message});
push @posts,$post;
}
+
+ 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};
+ }
$template->param(Posts => \@posts);
+ $template->param(Message => param('message'));
markThreadAsRead($thread->{id});