Okay help please... I've changed the three template names. The form works wonderfully.. but there's a query for an uncashed template.
PHP Code:
if ($action=="submit") {
if ($answerall == "1") {
if ($answer1 == '' OR $answer2 == '' OR $longanswer1 == '')
{
$errormessage = "You need to answer every question, $bbuserinfo[username]!";
eval('print_output("' . fetch_template('flag_error') . '");');
exit();
}
}
eval('$formsend = "' . fetch_template('flag_answers') . '";');
if ($formforum == "1") {
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES
('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle', " . TIMENOW . ", $formforumid,
1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
0)
");
$thread['threadid'] = $DB_site->insert_id();
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, iconid, visible)
VALUES
($thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
'" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($formsend) . "', 1, 1,
0, 1)
");
$post['postid'] = $DB_site->insert_id();
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET firstpostid = $post[postid]
WHERE threadid = $thread[threadid]
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
" . iif($type == 'thread', 'threadcount = threadcount + 1,') . "
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
lastthreadid = $thread[threadid]
WHERE forumid = $formforumid
");
}
if ($formemail == "1") {
vbmail($formemailaddress, $formtitle, $formsend);
}
$errormessage = "The image has been flagged.";
eval('print_output("' . fetch_template('flag_error') . '");');
exit();
}
eval('print_output("' . fetch_template('flag') . '");');
?>