News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Shared Forum Mod

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

Previous topic - Next topic

perplexed

I would like to try this mod but first I would have to merge a couple of separate forums together, as this sounds like a much easier option than maintaining three separate ones.  Can anyone direct me on how to achieve that?

thanks

Sarge

Quote from: perplexed on August 03, 2007, 12:08:39 PM
I would like to try this mod but first I would have to merge a couple of separate forums together, as this sounds like a much easier option than maintaining three separate ones.  Can anyone direct me on how to achieve that?

I think a few members are working on a merge script. I will let you know if I see any stable results.

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

ormuz

Is this hack working with mambo and the last versions of smf, mambo and the bridge?

ormuz

#243
Bump, is this working with joomla 1.012 bridge 1.1.7 and smf 1.1.3 ?

EDIT: yes!

Mr. Jinx

#244
Shared forum mod without the joomla bridge (tested with smf 1.1.4)

Some people in this topic asked how to use this great mod on SMF forums without the joomla bridge. I have written a small howto for those without the bridge.
This mod is completely based on Goosemoose's mod and the idea from smoothify, with some small enhancements.
You will have to use subdomains, this might be a problem for some people, but it works very nice.

HOWTO

1. Install your forum on a subdomain, for example forum.yoursite.com
This will be you *main* forum with all categories visible.

2. Create a subdomain for every forum you want, this subdomain should point to forum.yousite.com (no redirects)

3. Run this in phpMyAdmin

CREATE TABLE IF NOT EXISTS `smf_forums` (
  `forumName` text NOT NULL,
  `catList` varchar(128) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

warning: if you forum prefix is not "smf_" change it in the above code!

4. Manually add the following fields to the table you just created:
Example:
forumNamecatList
x.yoursite.com1,2,3,10
y.yoursite.com4,5,6,10
z.yoursite.com7,8,9,10
.. so for every domain you can specify the categories.
In this example, domain x.yoursite.com shows category 1,2,3 and 10.
domain y.yoursite.com shows category 4,5,6,10.
As you can see, category 10 is visible for both domains.

5. Edit Load.php

Find:

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

Add After:

// Added for the multiple forum mod
  if(!isset($_REQUEST['action']) && !isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])){
$domain = $_SERVER['SERVER_NAME'];
        $forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$domain'", __FILE__, __LINE__);
    $row_forumList = mysql_fetch_assoc($forumList);
        $user_info['query_see_board'] .= ' AND FIND_IN_SET(b.ID_CAT, "' . $row_forumList['catList'] . '")';
  }


6. In BoardIndex.php (in Sources dir)
find:

AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

replace with:

AND b.childLevel <= 1" : '') . " ORDER BY c.catOrder, b.boardOrder ASC" , __FILE__, __LINE__);


find:

$result_boards = db_query (around line 71)"

Add above that the following 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(b.ID_CAT, "' . $row_forumList['catList'] . '")';
   }


7. Edit Settings.php
find:

$boardurl = '

replace the complete line with

$boardurl = 'http://' . $_SERVER['SERVER_NAME'];


warning: Everytime you modify your settings in the admin web interface (Admin > Server Settings > Core Configuration) the $boardurl variable will be overwritten by SMF. So don't forget to change this everytime you update de core configuration.

8. Modify feauture configuration
This step is optional. If you want your users to stay online on all forums, you'll have to change the following settings:

Admin > Server Settings > Feature Configuration >  Enable local storage of cookies = DISABLED
Admin > Server Settings > Feature Configuration >  Use subdomain independent cookies = ENABLED

That should be it!

Simbyte

Wow, that's exactly what I looked for.

I'll try out soon:)

Iomega0318

Awesome! I have been wanting to do this for a long time..
I will try it out later tonight and see how it all works out..
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

Jacque

I've been searching for something like this too.   I gave it a try, and ended up with this error message on loading the main or any subdomain forums:

Unknown table 'c' in where clause
File: /home/jacquedu/public_html/forums/Sources/Recent.php
Line: 102

I did make a new database to test this by importing a backup of my existing one, I have no clue if it makes a difference or not, but I would hope one could do it that way.

Thanks for everyones contributions on this mod!!

Jacque

Sarge

Quote from: Jacque on November 03, 2007, 12:37:22 PM
I've been searching for something like this too.   I gave it a try, and ended up with this error message on loading the main or any subdomain forums:

Unknown table 'c' in where clause
File: /home/jacquedu/public_html/forums/Sources/Recent.php
Line: 102

Try this (reply #111 on page 6):
http://www.simplemachines.org/community/index.php?topic=64492.msg694947#msg694947

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

Jacque

Quote from: Sarge on November 03, 2007, 12:46:52 PM
Quote from: Jacque on November 03, 2007, 12:37:22 PM
I've been searching for something like this too.   I gave it a try, and ended up with this error message on loading the main or any subdomain forums:

Unknown table 'c' in where clause
File: /home/jacquedu/public_html/forums/Sources/Recent.php
Line: 102

Try this (reply #111 on page 6):
http://www.simplemachines.org/community/index.php?topic=64492.msg694947#msg694947

Sarge! That worked perfectly, thank you! 

And thanks again to every contributer for this mod.  I'm sure i'll have more questions, but for right now.. wow.  Just what I've been looking for.

Jacque

chippa

#250
i'm stuck on point 4

Quote4. Manually add the following fields to the table you just created:
Example:
forumName   catList
x.yoursite.com   1,2,3,10
y.yoursite.com   4,5,6,10
z.yoursite.com   7,8,9,10
.. so for every domain you can specify the categories.
In this example, domain x.yoursite.com [nofollow] shows category 1,2,3 and 10.
domain y.yoursite.com [nofollow] shows category 4,5,6,10.
As you can see, category 10 is visible for both domains.

have created the table, _forums

and it has the fields forumname and catlist in it. but i am unsure  as to how i add the extra information into it regarding the subdomains and which categories they point to.

any help?

Mr. Jinx

In step 1 you've setup your basic forum right?
You will have to make the different categories in that forum.
In each category you can make different boards. This is just some standard SMF stuff.

If you look at the link to a category, you will see it has a unique number.
This is the number you have to specify in 'catlist'. You simply insert this in you mysql table along with the desired subdomain.


chippa

#252
yeah, i have created the categories. i can see their numbers, have also created the subdomains. what im unsure about is how to actually add that data into the mysql table.

also
Quotethis subdomain should point to forum.yousite.com [nofollow] (no redirects)

does this mean that when creating the subdomains that the document root should be the folder that the forum is installed in?


Mr. Jinx

Quote from: chippa on November 08, 2007, 06:26:14 PM
does this mean that when creating the subdomains that the document root should be the folder that the forum is installed in?

It depends on what control panel you use how they call it.
I've used direct admin, and there you can make "domain pointers". So when you installed your forum on the domain forum.domain.com you would make a domain pointer xyz.domain.com pointing to forum.domain.com. You could also make a CNAME.

chippa

ok, ill play with that one and see what i come up with...

still unsure about how to add the correct data to the mysql database though.

sorry about the ignorance, i know bits and pieces, but some stuff i need my hand held for a bit.

Fatherguido

Is it possible to have each instance with a different theme? As an example if I were to divide by different types of pets -

when someone went to

dog.allaboutpets.com   could they see a dog related theme
cat.allaboutpets.com    a cat related, etc?

capnken

Nice work by everybody who has been poking at this. Following the non-Joomla install explained by Mr. Jinx in reply 244 works great, but can someone confirm whether the tweak in reply 111 to restrict posts in Recent Posts to the boards defined by subdomains works with 1.1.4? I've made those modifications, but obviously it's not working for me or I wouldn't be posting this.

In plain English, I have boards restricted by subdomain, and I need to have ?action=recent and ?action=unread only show posts from boards visible in the subdomain restriction. Disabling those actions isn't a viable option for me.

I'd also like to implement a similar restriction for Search, Latest Posts by Member, etc., but those are issues to tackle after I've resolved the bigger Recent and Unread issues.

Simbyte

Hello,

I've got a question:

The domain isn't at the same space as the forum files.

So the subdomain forum.domain.com leads to filespace.com/SMF

Now you say "this subdomain should point to forum.yousite.com (no redirects)"


Do I have to point it to filespace.com/SMF or to  forum.domain.com?


Yours Simbyte

Simbyte

No one's got an idea? Or haven't I described the problem properly?

Sarge


    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

Advertisement: