PHP Code:
$tdm =& datamanager_init('Post', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$tdm->set('threadid', $_POST['threadid']);
$tdm->set('pagetext', $_POST['message']);
$tdm->set('allowsmilie', 1);
if ($vbulletin->userinfo['userid'] <1) {
if(($_POST['check']) == $_SESSION['check']) {
$tdm->set('username', $_POST['name']);
}else{
echo 'Input Wrong';
return;
}
}
else{
$tdm->set('userid', '1');
}
$tdm->set('visible', 1);
$tdm->set('dateline', time());
$tdm->save();
build_thread_counters($_POST['threadid']);
The if-statement is for unregistered users. They have to enter a captcha code.