PDA

View Full Version : custom forums on vB3


sturdevk
07-10-2008, 07:27 PM
Hi,

We are creating forums from our application(by directly inserting records into forum, thread and post). With vB 1.1, for creating a forum we are inserting a record into forum, thread and post. We also update forumpermission and allwed_in.

Now we are migrating to vB 3.6, what I need to do to create a forum from our application?, because I could see lot of changes on db with vB3.

Thanks,
S~

Opserty
07-10-2008, 08:36 PM
Use the Data Managers (http://www.vbulletin.com/docs/html/data_managers) to save anything to the database.

Direct database edits are not really advised.

Check the Articles section for more information on coding in vBulletin. Also see: vBulletin Code Standards (http://www.vbulletin.com/docs/html/codestandards)

RLShare
07-10-2008, 09:26 PM
$forumdata =& datamanager_init('Forum', $vbulletin, ERRTYPE_ARRAY);
$forumdata->set('title', 'NAME OF NEW FORUM');
$forumdata->set('description', 'FORUM DESCRIPTION');
$forumdata->set('link', '');
$forumdata->set('displayorder', 1);
$forumdata->set('parentid', 12);
$forumdata->set('daysprune', -1);
$forumdata->set('defaultsortfield', 'lastpost');
$forumdata->set('defaultsortorder', 'desc');
$forumdata->set('showprivate', 0);
$forumdata->set('newpostemail', '');
$forumdata->set('newthreademail', '');
$forumdata->set_bitfield('options','moderatenewpost', 0);
$forumdata->set_bitfield('options','moderatenewthread', 0);
$forumdata->set_bitfield('options','moderateattach', 0);
$forumdata->set_bitfield('options','styleoverride', 0);
$forumdata->set_bitfield('options','canhavepassword', 0);
$forumdata->set_bitfield('options','cancontainthreads', 1);
$forumdata->set_bitfield('options','active', 1);
$forumdata->set_bitfield('options','allowposting', 1);
$forumdata->set_bitfield('options','indexposts', 1);
$forumdata->set_bitfield('options','allowhtml', 0);
$forumdata->set_bitfield('options','allowbbcode', 1);
$forumdata->set_bitfield('options','allowimages', 1);
$forumdata->set_bitfield('options','allowsmilies', 0);
$forumdata->set_bitfield('options','allowicons', 0);
$forumdata->set_bitfield('options','allowratings', 0);
$forumdata->set_bitfield('options','countposts', 1);
$forumdata->set_bitfield('options','showonforumjump', 1);
$forumdata->set_bitfield('options','prefixrequired', 1);
$forumdata->set('styleid', -1);
$forumdata->set('imageprefix', '');
$forumdata->set('password', '');

$forumdata->save();
unset($forumdata);


^^Thats how you create a new forum in code, if you are unsure of what an option is, look at the forum manager for creating new forums and see the descriptions next to those options.

Opserty
07-10-2008, 09:42 PM
Its always best to work out things for yourself then to copy and paste. ;)

You can learn things which you will remember then. :)

RLShare
07-11-2008, 12:28 AM
lol..yeah I guess so. It took me forever to figure out, so I figured I'd help. I guess it might have taken me forever because I was not looking through the vbulletin manual, I was looking through the files themselves.

sturdevk
07-11-2008, 12:37 PM
Thank you for the responses. I have gone through DBManager and Code standards part, helped me to understand how to update data through PHP. But, we are using a Java application to update DB, Does any body has the data model(relationships) of vB3.6?

Thanks in advance,
S~