Home arrow Forum [Info] SMF Component & Multiple Forum
  Welcome, Guest. Please login or register.
Did you miss your activation email?
January 08, 2009, 02:50:47 AM
Home New Posts Search Calendar


Login with username, password and session length
+  Joomla Forum
|-+  Joomla Hacks
| |-+  Joomla-SMF Forum Support
| | |-+  Joomla-SMF 1.1.x (Moderators: -Wolverine, kai920)
| | | |-+  [Info] SMF Component & Multiple Forum
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: [Info] SMF Component & Multiple Forum  (Read 1446 times)
FinLy - Arifin
QA / Testers
Joomla Newbie
*****

Karma: +3/-0
Offline Offline

Posts: 29


FinLy


View Profile WWW
[Info] SMF Component & Multiple Forum
« on: July 20, 2006, 10:02:51 AM »

Based on this forum :
Code:
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:

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.php

Find:
Code:

Code:
$user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';
   


Add After:
Code:

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:
         
Code:
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

Replace with:
         
Code:
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

Code:
$result_boards = db_query (around line 71)

Add above that the following code (might look familiar)

Code:
   // 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=computer
http://your_domain_name/index.php?option=com_smf&Itemid=26&forum=electronics
http://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=26
you 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

Logged

-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: [Info] SMF Component & Multiple Forum
« Reply #1 on: July 20, 2006, 10:09:19 PM »

great info, thanks finly!
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
manuelap
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 3


View Profile
Re: [Info] SMF Component & Multiple Forum
« Reply #2 on: August 24, 2006, 07:49:46 AM »

Just curious, but how does this work with the "recent topics module"?

And can you please publish a working version of this hack, I can not open the links you mention. I'd like to have a close look at it before I start altering my code.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
i-Vibe.com
Search Contact About Advertise Blogs Topsites Submit News Register Login