Orstio and I came up with a way to run multiple forums from 1 database, 1 directory, 1 installation. I'm running 7 forums and I only need to upgrade once, install mods once, and my users are shared
First the examples. Note the number of Categories that show in each, and that some are shared. some aren't.
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rathttp://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,cathttp://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,doghttp://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,hedgehoghttp://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rabbithttp://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,ferrethttp://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,birdOk, you can do it without the Mambo/Joomla bridge but it's no where near as good. We used the power of the bridge to rewrite all the links. Basically what you do is create a new table smf_forums that houses two fields, forumName and catList. Here is an example of what it could look like with 3 forums that share some categories, and have some unique. This all works off of ONE smf directory!
forumName catList
Rat 1,2,3,4
Cat 1,5,6,7
Dog 1,4,8,9
Ok so here are the steps.
1. Run this in phpMyAdmin
Code:
CREATE TABLE IF NOT EXISTS `smf_forums` (
`forumName` text NOT NULL,
`catList` varchar(128) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
2. Go in and add your fields like the example above forumName is the name you'll be passing in, catList are the category id's you want to display for that forum. If your prefix isn't smf_ , make sure to change it.
3. Edit Load.php
In Load.php
Find:
Code:
$user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';
Add After:
Code:
// Added for the multiple forum mod
if(!empty($_REQUEST['forum']) && !isset($_REQUEST['action']) && !isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])){
$forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$_REQUEST[forum]'", __FILE__, __LINE__);
$row_forumList = mysql_fetch_assoc($forumList);
$user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
}
4. In BoardIndex.php (in Sources dir)
find:
Code:
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);
replace with:
AND b.childLevel <= 1" : '') . " ORDER BY c.catOrder, b.boardOrder ASC" , __FILE__, __LINE__);
5. In smf.php in the component directory for the bridge, this $myurl= line is in 4 places but slightly different each time. You can copy the same line to all 3 places without a problem.
For version 1.1x of the bridge do the following:
From
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&Itemid=' . $Itemid . '&';To
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&Itemid=' . $Itemid . '&'
. (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&' : '');
From
$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&Itemid=' . $_REQUEST['Itemid'] . '&' ;To
$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&Itemid=' . $_REQUEST['Itemid'] . '&'
. (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&' : '');
-------------
In older versions of the bridge do the following to smf.php
Find:
Code:
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&Itemid=' . $Itemid. '&';
and find:
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&Itemid=' . $Itemid . '&';
Replace both with:
Code:
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&Itemid=' . $Itemid. '&'. (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&' : '');
Find:
$myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&Itemid=' . $_REQUEST['Itemid'] . '&' );
Replace with:
$myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&Itemid=' . $_REQUEST['Itemid'] . '&' . (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&' : ''));
----------------------------------------------
6. The following fix thanks to Kingconnor
Open "yourforumdir/Sources/BoardIndex.php" and find the following code
$result_boards = db_query (around line 71)
Add above that the following code (might look familiar)
// Added for the multiple forum mod
if(!empty($_REQUEST['forum']) && !isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])){
$forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$_REQUEST[forum]'", __FILE__, __LINE__);
$row_forumList = mysql_fetch_assoc($forumList);
$user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
}
7. Create a link to your new forums! Here is an example using SEF:
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rathttp://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,cathttp://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,dogWithout SEF would be like this (note I use SEF so it will switch after the first page)
http://www.goosemoose.com/index.php?option=com_smf&Itemid=118&forum=ratNote that if you leave the forum part off you see all the boards.