News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Shared Forum Mod

Started by Goosemoose, January 06, 2006, 03:04:39 AM

Previous topic - Next topic

SilentShade

Fixed! Thanks everybody helping. The problem was in my hands :P This shared forum mode code, was put in between of two functions, while $user_info array is built in first function loadUserSettings(). After moving this code inside the function, everything is working like a charm. :) sorry for disturbance.

Goosemoose

Hi SilentShade,
Thanks for clarifying that! Did you put it there because my directions weren't clear enough, or was it just a mistake? I'd like to explain the instructions better if I need to.

perplexed

Quote from: Goosemoose on January 06, 2006, 03:04:39 AM
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,rat
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,cat
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,dog
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,hedgehog
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rabbit
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,ferret
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,bird

Ok, 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
[snipped]

I was wondering if anyone can explain how to do this without using joomla or other cms bridge. I just want to have 3 separate forums linked together and one user database.  I have one forum now with lots of members, so I would like them to be able to go directly to the two new ones without having to register or login again.  Also what the implications or problems with doing this might be.  (I don't know anything about sql dbs so please go slowly, I dont really understand the above post as it is :( )  If this is in the wrong section, please move or redirect me.
~thanks :)

Goosemoose

Hi Perplexed, please go back a few pages, how to do this was already explained.

Neol

#184
Quote from: Goosemoose on December 13, 2006, 07:04:37 PM
Not yet. I'm finishing up my Integrated Chat mod for 1.1 Final, then I'll look at this mod.

I read that you have finished it, right? Well, not exactly finished (software almost never are), but it seems the new version works on 1.1 Final. So...

Quote from: olti on December 14, 2006, 05:35:25 AM
Goosemoose, please see if you can make an installable mod (through Package Manager). I guess smf.php has to be modified separately, since it's part of the bridge, not the forum.

An optional visual interface for setting up subforums would also be very welcome...

I know, I know... I'm trying to rush you. :P

SilentShade

#185
Quote from: Goosemoose on January 24, 2007, 10:48:30 PM
Hi SilentShade,
Thanks for clarifying that! Did you put it there because my directions weren't clear enough, or was it just a mistake? I'd like to explain the instructions better if I need to.
First of all i really appreciate your work to make such a nice mod. Thank you! :)
In your first post you have instruction:
Quote from: Goosemoose
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'] . '")';     
   }
Well everything is right, but the function ends after this string $user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';    thats why i messed up this a little.. Maybe just add a reminder that you have to add "shared forum mod" code INSIDE the function to make it work :)

Goosemoose

Hi SilentShade,
Thanks for the tip, but I'm a bit confused. The code says to find the first line, then add the 2nd bit after it. If you do that then you'd be fine.

perplexed

Quote from: Goosemoose on January 27, 2007, 02:53:28 AM
Hi Perplexed, please go back a few pages, how to do this was already explained.
lol thanks I read that but I am still a little unsure.  thanks anyway

ShopHRM

I am having trouble with this

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;



i have a dreamhost account and there is a spot where i can enter phpmyadmin but i dont see a place to add that code anywhere


ShopHRM

#190
thanks, got that figured, i seem to have everything setup but i have an issue

this is my homepage

http://www.mytestsite.hfxgaming.com/

if you click on the forum button it brings you to the forum i made when creating the bridge

http://www.mytestsite.hfxgaming.com/index.php?option=com_smf&Itemid=26

and here are the 2 links i made through this tutorial

http://www.mytestsite.hfxgaming.com/index.php?option=com_smf&Itemid=118&forum=dale
http://www.mytestsite.hfxgaming.com/index.php?option=com_smf&Itemid=118&forum=chip

as you can see there are no catagories or forums, what did i do wrong?


also just so i am clear what are the catlist numbers for



Goosemoose

The catlist numbers are the numbers of the categories you want to show up for each forum. You will need to add your category numbers into the database for it to work. If you look at the link to each category on your forum you can figure out what each number is. That will fix your empty forum problem.

ShopHRM

#192
got it all figured out, now i just need to figure out how to have different themes for each page :)

ShopHRM

Quote from: kingconnor on March 22, 2006, 06:01:37 PM
Just letting people know this is how to associate a theme with each separate forum. Please bear with me I'm a newbie to php

Step1: Create a new field in the smf_forums table called forumTheme and set to int.

Step 2: in the new field you have created (forumTheme) put the ID_THEME number you wish to associate with the forum (found in smf_themes table)

Step 3: Open up index.php under the root of your forum. Find line number 148 should be loadTheme(); replace with:

$database->setQuery( "SELECT DISTINCT forumTheme
                    FROM #__smf_forums
                    WHERE forumName='".$_REQUEST['forum']."'");
                   
$forumTheme = $database->loadResult();
   
loadTheme($forumTheme);

Quote from: Goosemoose on March 22, 2006, 01:05:21 PM
Yeah I did notice that too. I haven't had a chance to look at the code that creates the collapsable boards. Basically you would just need to make sure the code there matches the code changed in Load.php. If you find it let me know, I'm really strapped for time right now.

Yep I will check it out at some point and let you all know.

Regards

da king  ;D


I saw someone else get an error for this but i couldnt find the fix so I will ask again, I tried this and I got this error

Fatal error: Call to a member function setQuery() on a non-object in /home/.maren/mytestsite/mytestsite.hfxgaming.com/forum/index.php on line 150


I tried to change "FROM #__smf_forums" to "FROM smf_forums" but i get the same error.

I am using smf 1.1.2 with smf_1-1_joomla_1-0-x_bridge_1-1-7 and Joomla_1.0.12-Stable-Full_Package

arez

#194
i have tried to get this to work without the bridge (following instructions on the forst post and the first post on page #10 ) but i just dont get it . maybe iam missing something ..... could someone help me out with this?

/edit

its also not the best thing to store the info about the borads in the domain/subdomain. maybe this could work together with the "costom actions" mod so we can have ...index.php?action=dogforum  to redirect to the categories releated to dogs

Neol

I want to know how to use the mod without Joomla. I'm thinking of using SMF with TinyPortal.

Anyone got the mod working with TP?

arez

i got tp, too and i think the main problem is that the mod on the first page uses the system of the bridge to write the url and carry the variables for the forum

Goosemoose

There was a post on how to carry the variables without joomla in this thread. You will have to look around for it. A few people have modified this and gotten it to work well for them. You might want to pm them if you have any problems and ask them to answer your question here so that other may benefit. All my experiences were in using this with Joomla sites as that's all I run now!

Neol

Quote from: Goosemoose on February 23, 2007, 02:46:31 AM
There was a post on how to carry the variables without joomla in this thread.

You mean the first post of page 10?
http://www.simplemachines.org/community/index.php?topic=64492.msg780659#msg780659

Well, the poster used subdomains for that. Although subdomains are useful, not everyone can/may/will use them.

I'm trying to make the mod work with TP using actions. If I find a solution (even a partial one), I'll post it.

arez

there is a solution on tp forums but i didnt get it to work....

Quote from: latinlives on February 22, 2007, 12:44:36 PM
List of changes.

index.php one for each forum name.
line 334 'forumname' => array('BoardIndex.php', 'BoardIndex'),


Load.php, you have to add &&($_GET['action'] == 'forumname') for each forum that you put up
line 527
//SHARED FORUM MOD
if(!isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])  &&isset($_REQUEST['action']) &&($_GET['action'] == 'forumname')){
$sharedforummod = $_GET['action'];
        $forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$sharedforummod'", __FILE__, __LINE__);
    $row_forumList = mysql_fetch_assoc($forumList);
        $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
  }


Changing the linktree to the right forum doesnt work, and I have not had a chance to try and get it to work yet....
line 547
        // Start the linktree off empty..not quite, have to insert forum
if ($_GET['action'] == 'forumname') {$context['linktree'] = array(array('url' => $scripturl . '?action=forumname', 'name' => 'ForumName'));}

else
     $context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => 'Forum'));



The database side is set up the same as it is in the shared forum mod for Joomla/SMF

Advertisement: