Based on this forum :http://www.simplemachines.org/community/index.php?topic=64492.0
Run multiple forums from :
1 database, 1 directory, 1 installation.
At first, I thought that the tricks will only work with Orstio's SMF component. However, I have been falling in love with Wolverine's SMF component and tried the tricks to his SMF component. The result is SUCCESS !!!
I can run Multiple forums only with 1 installation of SMF in 1 directory and only need 1 database.
For Information, I use :
* Joomla 1.0.10
* SMF 1.1 RC2
* Wolverine's JSMF Component v. 1.1.4.2 (The latest)
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. Browse the tables you create and add your fields like the example below. forumName is the name you'll be passing in, catList are the category id's you want to display for that forum.
forumName catList
computer 1,2,3,4,5
electronics 1,2,6,7,8
entertainment 1,2,9,10,11
and so on... (unlimited forum)
3. Go to your smf forum directory and search in Sources directory
In
Load.phpFind:
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. The following fix thanks to Kingconnor
Open "your_smf_forum_dir/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'] . '")';
}
6. Create a link to your new forums!
* If you use SEF, your forum link will like this :
http://your_domain_name/component/option,com_smf/Itemid,26/forum,computer/http://your_domain_name/component/option,com_smf/Itemid,26/forum,electronics/http://your_domain_name/component/option,com_smf/Itemid,26/forum,entertainment/* If you dont use SEF, your forum link will like this :
http://your_domain_name/index.php?option=com_smf&Itemid=26&forum=computerhttp://your_domain_name/index.php?option=com_smf&Itemid=26&forum=electronicshttp://your_domain_name/index.php?option=com_smf&Itemid=26&forum=entertainment!! If your leave the forum part off like
http://your_domain_name/component/option,com_smf/Itemid,26/or
http://your_domain_name/index.php?option=com_smf&Itemid=26you will see all the boards of all your forums.
!! Works in unwrapped and also wrapped mode.
If you want to see the sample, just go to above links (The original creator of this tricks)
Best Regards,
FinLy