This kind of stuff is better done with the datamanager.
PHP Code:
function mk_thread($title, $pagetext) {
require_once('includes/class_dm_threadpost');
require_once('includes/functions_databuild.php');
$threaddm = new vB_DataManager_Thread_FirstPost($this->registry, ERRTYPE_STANDARD);
$forumid = 000; //hardwire the forum, or pass it in
$postuserid = $this->registry->userinfo['userid'];
$userid = $this->registry->userinfo['userid'];
$username = $this->registry->userinfo['username'];
$allowsmilie = '1';
$visible = '1';
$threaddm->do_set('forumid', intval($forumid));
$threaddm->do_set('postuserid', $postuserid);
$threaddm->do_set('userid', $userid);
$threaddm->do_set('username', $username);
$threaddm->do_set('pagetext', $pagetext);
$threaddm->do_set('title', $title);
$threaddm->do_set('allowsmilie', $allowsmilie);
$threaddm->do_set('visible', $visible);
$threaddm->save();
build_forum_counters($forumid);
}
Alternatively, simply remove the post from postparsed
[sql]
delete from postparsed where postid=$postid
[/sql]
This will force a refresh when the post is viewed.