ierse010
01-08-2007, 04:14 PM
I'm building a system in which another tool on the server should create a new forum on my vBulletin board.
Is there any vBulletin documentation available for adding a new Forum in a certain parent_id with given properties? Can I use vBulletin php functions to do this?
Is it posible to include functions for adding the new forum in my own script?
kg4mxz
01-14-2007, 07:37 PM
This function would be very useful, as I am looking to do the same thing :)
I know it is possible with a MySQL query, but I would really like to use the datamanager.
simsimt
01-14-2007, 07:52 PM
<a href="http://members.vbulletin.com/api" target="_blank">http://members.vbulletin.com/api</a>
WhaLberg
01-14-2007, 07:55 PM
I know it is possible with a MySQL query, but I would really like to use the datamanager.
Data Managers help so much. ;)
kg4mxz
01-14-2007, 09:05 PM
Have looked at the API, but I would really appreciate an example, as the API is way over my head
AN-net
01-15-2007, 02:42 AM
take a look at the admincp folder in manage forum files. the code for how vbulletin creates new forums is in them.
ierse010
01-15-2007, 07:26 AM
thanks a lot!
Which class / method should i use from this api?
I figured it out!
Here's how to create a forum using the datamanager API:
$forum = array(
'title' => 'Forum name',
'description' => '',
'link' => '',
'displayorder' => 1,
'daysprune' => -1,
'parentid' => 1,
'newthreademail' => '',
'newpostemail' => '',
'options' => array(
'moderatenewpost' => 0,
'moderatenewthread' => 0,
'moderateattach' => 0,
'warnall' => 0,
'styleoverride' => 0,
'canhavepassword' => 1,
'cancontainthreads' => 0,
'active' => 1,
'allowposting' => 0,
'indexposts' => 0,
'allowhtml' => 0,
'allowbbcode' => 1,
'allowimages' => 1,
'allowsmilies' => 1,
'allowicons' => 1,
'allowratings' => 0,
'countposts' => 0,
'showonforumjump' => 1),
'styleid' => -1,
'password' => '',
);
$forumdata =& datamanager_init('Forum', $vbulletin, ERRTYPE_CP);
foreach ($forum AS $varname => $value)
{
if ($varname == 'options')
{
foreach ($value AS $key => $val)
{
$forumdata->set_bitfield('options', $key, $val);
}
}
else
{
$forumdata->set($varname, $value);
}
}
$forumid = $forumdata->save();
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.