Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 07-10-2008, 07:27 PM
sturdevk sturdevk is offline
 
Join Date: Jan 2008
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default custom forums on vB3

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~
Reply With Quote
  #2  
Old 07-10-2008, 08:36 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use the 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
Reply With Quote
  #3  
Old 07-10-2008, 09:26 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$forumdata =& datamanager_init('Forum'$vbulletinERRTYPE_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.
Reply With Quote
  #4  
Old 07-10-2008, 09:42 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its always best to work out things for yourself then to copy and paste.

You can learn things which you will remember then.
Reply With Quote
  #5  
Old 07-11-2008, 12:28 AM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 07-11-2008, 12:37 PM
sturdevk sturdevk is offline
 
Join Date: Jan 2008
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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~
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:30 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03855 seconds
  • Memory Usage 2,227KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete