+if (defined param('cmd') && param('cmd') eq 'submit'){
+ $DBH->begin_work;
+ if ($board && $board->{post}){
+ my $insert = $DBH->prepare(q{INSERT INTO forum_threads (fbid,subject) VALUES($1,$2)});
+ if ($insert->execute($board->{id},param('subject'))){
+ $thread = $DBH->selectrow_hashref($findThread,undef,
+ $DBH->last_insert_id(undef,undef,undef,undef,"forum_threads_ftid_seq"),$ND::UID)
+ or $ERROR .= p($DBH->errstr);
+ }else{
+ $ERROR .= p($DBH->errstr);
+ }
+ }
+ if ($thread && $thread->{post}){
+ my $insert = $DBH->prepare(q{INSERT INTO forum_posts (ftid,message,uid) VALUES($1,$2,$3)});
+ $insert->execute($thread->{id},escapeHTML(param('message')),$ND::UID) or $ERROR .= p($DBH->errstr);
+ }
+ $DBH->commit or $ERROR .= p($DBH->errstr);
+}
+
+