Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-08-2007, 04:14 PM
ierse010 ierse010 is offline
 
Join Date: Nov 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 01-14-2007, 07:37 PM
kg4mxz kg4mxz is offline
 
Join Date: Aug 2006
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 01-14-2007, 07:52 PM
simsimt simsimt is offline
 
Join Date: Nov 2005
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://members.vbulletin.com/api" target="_blank">http://members.vbulletin.com/api</a>
Reply With Quote
  #4  
Old 01-14-2007, 07:55 PM
WhaLberg's Avatar
WhaLberg WhaLberg is offline
 
Join Date: Nov 2006
Location: Dersaadet
Posts: 569
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
I know it is possible with a MySQL query, but I would really like to use the datamanager.
Data Managers help so much.
Reply With Quote
  #5  
Old 01-14-2007, 09:05 PM
kg4mxz kg4mxz is offline
 
Join Date: Aug 2006
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have looked at the API, but I would really appreciate an example, as the API is way over my head
Reply With Quote
  #6  
Old 01-15-2007, 02:42 AM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

take a look at the admincp folder in manage forum files. the code for how vbulletin creates new forums is in them.
Reply With Quote
  #7  
Old 01-15-2007, 07:26 AM
ierse010 ierse010 is offline
 
Join Date: Nov 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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();
Reply With Quote
Reply


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 10:19 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03816 seconds
  • Memory Usage 2,215KB
  • Queries Executed 11 (?)
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_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_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