Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 02-05-2006, 02:57 PM
DB03 DB03 is offline
 
Join Date: Feb 2006
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Automatically creating forums

Is there anyway I can run a script to automatically create a forum (instead of doing it through the admin cp)? I tried adding an entry to the forum database but it seems like I might have to add another entry somewhere as it does not show up in the admin cp. Thanks.
Reply With Quote
  #2  
Old 02-05-2006, 08:04 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is it you are trying to achieve?
Reply With Quote
  #3  
Old 03-07-2006, 11:35 PM
DeMiNe0 DeMiNe0 is offline
 
Join Date: Jun 2004
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have the same question. I have a set of about 10 forums that takes me an extra half hour to create every time i need to add new ones. If i can just run a query or script to make them all in one shot, it would speed things up alot.
Reply With Quote
  #4  
Old 03-08-2006, 02:55 PM
zell_11 zell_11 is offline
 
Join Date: Dec 2004
Location: Edinburgh- Scotland
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What like having carbon copy forums that runs x amount of time. So the forums would have same premissions, same moderator, same parent catagory but diffrent name?

Tell me if this is what you are looking for
Reply With Quote
  #5  
Old 03-10-2006, 01:06 AM
DeMiNe0 DeMiNe0 is offline
 
Join Date: Jun 2004
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes. exactly. All i would need to do is run a script and imput the names i want the forums to have,
Reply With Quote
  #6  
Old 03-11-2006, 09:00 PM
DeMiNe0 DeMiNe0 is offline
 
Join Date: Jun 2004
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is becoming harder then i thought to do lol.
Reply With Quote
  #7  
Old 03-11-2006, 09:13 PM
Borgs8472 Borgs8472 is offline
 
Join Date: Apr 2004
Posts: 924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On topic, some command line type functions might be helpful as an alternative to the admincp at times.
Reply With Quote
  #8  
Old 03-11-2006, 10:29 PM
nitro nitro is offline
 
Join Date: Nov 2001
Posts: 302
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

why dont you just drop your query into the query box in cp or phpmyadmin ?

You could probably run a php script at command line with args as well so you would just do something like this in ssh #php newforum.php blabla and the php script as long as it had the right query would just do what you wanted.
Reply With Quote
  #9  
Old 03-12-2006, 07:42 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can just add the entries via SQL, but you will have to rebuild the forum information, easiest way is to edit a forum then save it.

Harder way would be to look for the correct datastore function to rebuild forum information.

OR - use the forum datamanager.
Reply With Quote
  #10  
Old 05-12-2006, 11:12 AM
thomberg thomberg is offline
 
Join Date: Feb 2006
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Datamanager i wrote to create a forum:

PHP Code:
<?php
define
('THIS_SCRIPT','datamanager');
define('SKIP_SESSIONCREATE',true);
chdir('..'); // change directory to your forum home with global.php in it
require_once('./global.php');

if (
count($_SERVER['argv']) < 3) die ("Usage: ".__FILE__." <forumname> <parentid>  [<description>]\n");

$forumdata =& datamanager_init('Forum'$vbulletinERRTYPE_ARRAY); 

// arguments
$forumdata->set('title'$_SERVER['argv'][1]); 
$forumdata->set('parentid'$_SERVER['argv'][2]); 
if (
$_SERVER['argv'][3]) $forumdata->set('description'$_SERVER['argv'][3]); 

// your default settings
$forumdata->set('displayorder'1); 
$forumdata->set_bitfield('options''active'1);  
$forumdata->set_bitfield('options''allowposting'1);  
$forumdata->set_bitfield('options''cancontainthreads'1);  
$forumdata->set_bitfield('options''moderatenewpost'0);  
$forumdata->set_bitfield('options''moderatenewthread'0);  
$forumdata->set_bitfield('options''moderateattach'0);  
$forumdata->set_bitfield('options''allowbbcode'1);  
$forumdata->set_bitfield('options''allowimages'1);  
$forumdata->set_bitfield('options''allowhtml'0);  
$forumdata->set_bitfield('options''allowsmilies'1);  
$forumdata->set_bitfield('options''allowicons'1);  
$forumdata->set_bitfield('options''allowratings'0);  
$forumdata->set_bitfield('options''countposts'1);  
$forumdata->set_bitfield('options''canhavepassword'0);  
$forumdata->set_bitfield('options''indexposts'1);  
$forumdata->set_bitfield('options''styleoverride'0);  
$forumdata->set_bitfield('options''showonforumjump'1);  
$forumdata->set_bitfield('options''warnall'0);  


// check for errors 
if (!empty($forumdata->errors)) 

    
$errorlist ''
    foreach (
$forumdata->errors AS $index => $error
    { 
        
$errorlist .= $error."\n"
    } 
         echo 
$errorlist;
     
    
// ... additional code; $errorlist is outputted to the user 

else 

    
// save the data 
    
    
$vbulletin->userinfo['forumid'] = $forumid $forumdata->save(); 
echo 
$forumid;
}  

?>
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 05:57 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.03977 seconds
  • Memory Usage 2,264KB
  • 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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete