Advertisement:

Author Topic: Share user database for 2 (or more) different forums.  (Read 283752 times)

Offline Cal-Look

  • Newbie
  • *
  • Posts: 6
Re: Share user database for 2 (or more) different forums.
« Reply #40 on: December 13, 2004, 09:16:55 AM »
I'm going to go over the tables again, but for me this was a plug-and-play situation - I made all the suggested changes and set it up as per he instructions at the beginning of this Topic and it worked like a charm. I'm just not sure where to go to fix this. The tables were prefixed as suggested and beyond that, it should be fine, no? I'll poke around. Thanks!

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Share user database for 2 (or more) different forums.
« Reply #41 on: December 28, 2004, 03:46:26 AM »
Okay, first I managed to get 3 forums setup as mambo bridges and shared them. I basically installed 3 versions of the mambo bridge (edited a few files, msg me if you want them). Since several of the tables are shared once the user logs into any of the forums they log into all of them. This also avoids using wrappers.

Now for the questions. Any way to move a thread to a board on one of the other forums? This would be great as I am finding reasons to do this a lot. If not I was thinking of writting a mod to do this but how many other people would actually want it? Any idea where to start?

Second, is there a way to share one of the categories in each of the forums? For example I have a random chatter board on the Rats Rule forum that is the primary one that gets used, and everyone wants to chat on it. It would make it easier if I could just mirror that to each forum.

Thanks

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Share user database for 2 (or more) different forums.
« Reply #42 on: December 28, 2004, 04:24:17 AM »
I don't know how you'd do it with separate forums... I think [Unknown] explained in a similar topic, how to add an ID_FORUM to the boards table, which seems to be a simpler way of doing what you're asking for.
Cristián Lávaque http://cristianlavaque.com

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Cristián Lávaque http://cristianlavaque.com

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Share user database for 2 (or more) different forums.
« Reply #44 on: January 08, 2005, 08:26:28 PM »
Okay,
 I finally sat down and went through what [Unknown] had posted. This might work but only if I moved all the forums into the same table called boards. I would rather leave everything in seperate tables as they are. I took a look at movetopic.php and it looks like the answer would be to edit how it works but I wanted to know if anyone else had some ideas. It's always harder to edit someone elses code  ::)

Offline HoTmetal

  • Marketing Consultant
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,949
Re: Share user database for 2 (or more) different forums.
« Reply #45 on: January 13, 2005, 12:34:34 PM »
Quote
Firstly, thanks SO much for this post - it was exactly what I needed.
Me too. I just did a search, but didn't find this post... I just happend to walk into it..lol
Good job spacemanspiff.

This does leave me with one question. Does this mod insert new users into 1 DB, or both, or do you choose witch one you want to use?

Ps Anguz I just read your mod. post. If you still need someone to setup a test board for this IM me &  I can do it. Also, should I use this mod here, or yours? Thanks in advance [again] rickc
« Last Edit: January 13, 2005, 12:37:42 PM by rickc »

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Share user database for 2 (or more) different forums.
« Reply #46 on: January 13, 2005, 05:31:37 PM »
Hi rickc, PMing you now.
Cristián Lávaque http://cristianlavaque.com

Offline jazz

  • Jr. Member
  • **
  • Posts: 331
Re: Share user database for 2 (or more) different forums.
« Reply #47 on: January 29, 2005, 08:51:36 PM »
Hello.  Reading this section, it helped me come up with some ideas for the use of my forum.  My question is this:

Can this be set up to allow a certain member group in my existing forum to use?  Basically it would be closed to the public, and there available to one member group but not everyone.

Thanks!

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Share user database for 2 (or more) different forums.
« Reply #48 on: January 29, 2005, 08:54:21 PM »
You could, you'd have to set the whole second forum to allow only that group access.
Cristián Lávaque http://cristianlavaque.com

Offline Kazona

  • Newbie
  • *
  • Posts: 1
Re: Share user database for 2 (or more) different forums.
« Reply #49 on: February 22, 2005, 07:05:06 AM »
Could anyone tell me how I would share the global permissions for each board? As it is now, whilst membergroups are shared, the permissions for them seem to still be handled seperately. The thing is, on my boards with each membergroup a member gets more privileges. However, after setting permissions for all the membergroups in one board, I noticed that the permissions in the other board hadn't changed at all.

So, simply put, how do I make it that the global permissions for membergroups are the same on both boards (not local permissions obviously).

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Share user database for 2 (or more) different forums.
« Reply #50 on: March 06, 2005, 11:26:58 PM »
You'd share the permissions table, but this would only share board independent permissions, not global board permissions.  That's a lot more complicated.

-[Unknown]

Offline nanoarray

  • Semi-Newbie
  • *
  • Posts: 62
Re: Share user database for 2 (or more) different forums.
« Reply #51 on: March 19, 2005, 12:10:16 AM »
Someone asked me how to setup 2 different SMF forums with shared user database. So, instead of writing in private message, I decide to share it here. Besides, I have never tried this myself, so I could use the feedback in case the steps I outline below are wrong or incomplete.

In the tutorial below, the following database tables will be shared:
  • im_recipients
  • instant_messages
  • membergroups
  • members
  • [/li]
You can share more tables if you like, and if you know what you're doing.

Here it goes...

1. Installing the forums
Install two (or more) different SMF forum in the same database, but using different prefix. For this example, the first forum is using "smf1_" (without quotes) and the second is using "smf2_". Just install the two forums normally, don't start telling users to sign up yet.


2. Modifying the source code
Open each of the .php files located in the Sources directory in your hard drive using a text editor program. Find all occurances of "{$db_prefix}members" and replace with "smf1_members" (without quotes). Do this for every single .php file in the Sources directory. Also find and replace the following:
"{$db_prefix}im_recipients" => "smf1_im_recipients"
"{$db_prefix}instant_messages" => "smf1_instant_messages"
"{$db_prefix}membergroups" => "smf1_membergroups"
You can also share more tables if you want and know what you're doing.

If you have a text editor program that can do batch replace or replace in all opened documents, use that instead, it will ease the task a lot (you can open everything at do a replace for all of the opened files). One text editor program that I know can do this is JCreator.


3. Upload the modified source files
Upload the content of the Sources directory that you just modified above to the Sources directory in your forum(s), overwrite any existing files. You don't need to do this for your first forum (smf1_), but doing this won't cause any problems.

Your forums should now share the same member, membergroup and instant message database.


4. Optional settings
If both (or all) of the forums are hosted on the same site (domain), you can use the same Cookie name for SMF, so users won't need to login twice when moving from one forum to another. You can find this setting inside the Admin Center -> Edit Server Settings -> Cookie Name


Possible Issues
  • User uploaded avatar
    Temporary solution: disable this feature.
    Better solution: also share the "attachments" table and synchronize the attachment settings (Admin Center -> Edit Features and Options -> Attachments section). This probably won't work if the forums are in different domains or subdomains.
  • Forum with multiple themes (ID_THEME conflict in members table)
    Temporary solution: use the same themes, or set the default forum theme for all of the forum using the same ID, and don't let users select their own theme.
  • [/li]


Other recommended tables to share:
- log_karma
- log_online <- session might get screwed if the forums are in different domains


Any comments/suggestions/errors?
I keep on thinking I'm forgetting something here... ::)
[/quote]

I did all the above, but it only works for admin and not for new registered users.  What else do I have to do?

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Share user database for 2 (or more) different forums.
« Reply #52 on: March 19, 2005, 01:49:19 AM »
So they don't show up in the members table?  Do they show up in the old/other members table?

-[Unknown]

Offline nanoarray

  • Semi-Newbie
  • *
  • Posts: 62
Re: Share user database for 2 (or more) different forums.
« Reply #53 on: March 19, 2005, 04:19:34 AM »
So they don't show up in the members table?  Do they show up in the old/other members table?

-[Unknown]

I got it now.  I mixed up my naming system, so it didn't change.  Now it's fine.

My next problem: when I log in, it shows as guest on the 2nd forum but as user on the 1st (original) forum.   How to fix that?

Offline nanoarray

  • Semi-Newbie
  • *
  • Posts: 62
Re: Share user database for 2 (or more) different forums.
« Reply #54 on: March 19, 2005, 12:26:37 PM »
I notice two things are wrong.

Suppose forum 1 has the member list, and forum 2 shares that same list.

a) If you log in forum 1 and then go to forum 2, everything goes smoothly.  You can read postings in both forums with a "log-in" status.  This is correct.

b) If you log in forum 2 and then go to forum 1, everything goes smoothly still.  But as soon as you try to read posting in forum 1, you get log off automatically which doesn't happen in a).

c) Continue from b).  When you log off forum 2, your status shows as "log off".  But when you go to forum 1, your status shows as "log in" still, even though you already log off from forum 2.

Any suggestion as to how to rectify this?


Offline nanoarray

  • Semi-Newbie
  • *
  • Posts: 62
Re: Share user database for 2 (or more) different forums.
« Reply #55 on: March 19, 2005, 01:25:51 PM »
How do you combine the total post and total topic in both forums, so that both forums show the same numbers?

Offline raedzaro

  • Jr. Member
  • **
  • Posts: 116
    • just to tell the world that I'm Jordanian
Re: Share user database for 2 (or more) different forums.
« Reply #56 on: March 22, 2005, 05:56:29 AM »
thanks but How share two forums with two differrent languages?

Offline Jan

  • Semi-Newbie
  • *
  • Posts: 46
  • Gender: Male
Re: Share user database for 2 (or more) different forums.
« Reply #57 on: April 15, 2005, 03:16:40 AM »
I share user DB for 2 differnt forums smf1_ and smf2_ and it works fine but I wonder about "Users Online".

When I 'm watching "smf1_"  I will see myself in "Users Online" section but when I'm watching "smf2_" I havn't seen my name in "Users Online" section. Why?

Do I need to share other tables?  ::)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Share user database for 2 (or more) different forums.
« Reply #58 on: April 15, 2005, 10:42:13 AM »
That's the smf_log_online table.

-[Unknown]

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Share user database for 2 (or more) different forums.
« Reply #59 on: April 16, 2005, 06:53:27 PM »
Find, Sources/Subs.php:

Code: [Select]
updateSettings(array(
'latestMember' => $latestmember,
'latestRealName' => $latestRealName,
'memberCount' => $memberCount,
'unapprovedMembers' => $unapprovedCount
));

Replace:
Code: [Select]
db_query("
REPLACE INTO prefix1_settings
VALUES ('latestMember', '$latestmember'),
('latestRealName', '$latestRealName'),
('memberCount', '$memberCount'),
('unapprovedMembers', '$unapprovedCount')", __FILE__, __LINE__);

db_query("
REPLACE INTO prefix2_settings
VALUES ('latestMember', '$latestmember'),
('latestRealName', '$latestRealName'),
('memberCount', '$memberCount'),
('unapprovedMembers', '$unapprovedCount')", __FILE__, __LINE__);

-[Unknown]

What should this be in 1.1? The code has changed quite a bit.