Topic: php code to create new forum?
I need to create a few hundred forums. The forum admin page seems to get a bit cumbersome after about 50.... so, I'd like to do it with php.
I've found this chunk of code in admin_forums.php (around line 37) that I believe will do the trick:
if (isset($_POST['add_forum']))
{
confirm_referrer('admin_forums.php');
$add_to_cat = intval($_POST['add_to_cat']);
if ($add_to_cat < 1)
message($lang_common['Bad request']);
$db->query('INSERT INTO '.$db->prefix.'forums (cat_id) VALUES('.$add_to_cat.')') or error('Unable to create forum', __FILE__, __LINE__, $db->error());
How can I modify this code to simply insert a forum named $forum_name into a categorie named $categorie_name?
Thanks for any help!