}
if (defined param('cmd')){
- if(param('cmd') eq 'Submit'){
+ if(param('cmd') eq 'Submit' or param('cmd') eq 'Preview'){
$DBH->begin_work;
if ($board && $board->{post}){
$thread = addForumThread $DBH,$board,$ND::UID,param('subject');
}
- if ($thread && $thread->{post}){
+ if (param('cmd') eq 'Submit' and $thread && $thread->{post}){
addForumPost($DBH,$thread,$ND::UID,param('message'));
}
$DBH->commit or $ND::ERROR .= p($DBH->errstr);
my @categories;
while (my $category = $categories->fetchrow_hashref){
$boards->execute($category->{id},$ND::UID) or $ND::ERROR .= p($DBH->errstr);
- #TODO: really need to do this outside, so you don't need moderate access
my @boards;
while (my $b = $boards->fetchrow_hashref){
}
$BODY->param(Categories => \@categories);
}
- my ($category) = $DBH->selectrow_array(q{SELECT category FROM forum_categories WHERE fcid = $1}
- ,undef,$board->{fcid}) or $ND::ERROR .= p($DBH->errstr);
+ my ($category) = $DBH->selectrow_array(q{SELECT category FROM forum_categories WHERE fcid = $1}
+ ,undef,$board->{fcid}) or $ND::ERROR .= p($DBH->errstr);
+ $BODY->param(Category => $category);
}else{ #List boards
$BODY->param(Overview => 1);