View Full Version : API Question: Inserting a new thread from outside Vbulletin
MattFord
01-20-2008, 07:48 PM
I seem to recall that there is a way to insert a new thread and get the ID back. I've been googling the docs to no avail. Can anybody recall such a tutorial?
Marco van Herwaarden
01-21-2008, 06:36 AM
I am pretty sure there is a thread in the articles forum about this.
Dismounted
01-21-2008, 10:12 AM
There was also a thread posted on this topic a few days ago.
djdevin
08-07-2008, 05:08 AM
Great, link us.
RLShare
08-07-2008, 05:34 AM
$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$foruminfo = fetch_foruminfo(forumid);
$threaddm->set_info('forum', foruminfo);
$threaddm->set('forumid', $foruminfo['forumid']);
$threaddm->set('userid', userid);
$threaddm->set('title', title);
$threaddm->set('pagetext', message);
$threaddm->set('allowsmilie', 0);
$threaddm->set('visible', 1);
$threaddm->set('dateline', TIMENOW);
if($threaddm->errors){
Do something about the error
}
}
else{
$threadid=$threaddm->save();
}
djdevin
08-08-2008, 07:58 PM
Worked - awesome. Thank you.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.