This seems to work for me
PHP Code:
chdir('/var/www/vhosts/example.net.au/subdomains/abc/httpdocs/forum');
require_once('./global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_threadpost.php');
require_once('./includes/functions_databuild.php');
$forumid = '3';
$userid = '1';
$title = 'My New Thread Title';
$pagetext = 'Thread posted from external php script';
$open = '1';
$allow_smilie = '1';
$visible = '1';
// fetch userinfo
if (!$userinfo = fetch_userinfo($userid))
{
die("Invalid User!");
}
// initialize datamanager
$threaddm = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);
// set data
$foruminfo = fetch_foruminfo($forumid);
$threaddm->set_info('forum',$foruminfo);
$threaddm->set_info('user',$userinfo);
$threaddm->set('forumid', $forumid);
$threaddm->set('userid',$userinfo['userid']);
$threaddm->set('title', $title);
$threaddm->set('pagetext', $pagetext);
$threaddm->set('open', $open);
$threaddm->set('allowsmilie', $allow_smilie);
$threaddm->set('visible', $visible);
// error checks
$threaddm->pre_save();
if (!empty($threaddm->errors))
{
echo ($threaddm->errors);
}
// save
$threadid = $threaddm->save();
unset($threaddm);
// rebuild caches
build_thread_counters($threadid);
build_forum_counters($forumid);
referenced:
https://vborg.vbsupport.ru/showpost....3&postcount=23