The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Create new vBulletin forum script
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? |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
<a href="http://members.vbulletin.com/api" target="_blank">http://members.vbulletin.com/api</a>
|
#4
|
||||
|
||||
Quote:
|
#5
|
|||
|
|||
Have looked at the API, but I would really appreciate an example, as the API is way over my head
|
#6
|
||||
|
||||
take a look at the admincp folder in manage forum files. the code for how vbulletin creates new forums is in them.
|
#7
|
|||
|
|||
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(); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|