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:
Code:
$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();