• Welcome to Simple Machines Community Forum. Please login or sign up.
December 02, 2021, 07:03:48 AM

News:

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


Share user database for 2 (or more) different forums.

Started by Spaceman-Spiff, September 03, 2004, 09:14:44 PM

Previous topic - Next topic

jan0s1k

Hey, anyone tried to get to work "Latest member" in 2.0.x? Seems, that none of these methods doesn't work (I tried to make it for my own as well.. but I keep failing :P).

Robert lee

First of all, thanks SO much for this publish - it was exactly what I required.  I now have two boards for two sub-domains on the same website using one participant desk, which is just what I desired.  however, I did observe one factor.If someone signs up on one message board, the participant depend instantly contributes another one on,but on the other message board it doesn't and I have to tell it to recall the some.

airtetdotin

Hi Anguz

I need your help for Shae db files between two forums
I had installed two forums in separate server and i pointed  two database paths to single one  but only one working
second one gets Connection error.
I have used same table prefix in database
Help Me Please.......!

TomW

I used the SQL method and it is working well, but have a question about the cookies.  Should I use the same cookie for all of my 3 forums (I am using SMF ver 2.0.2) ?

Herman's Mixen

Quote from: TomW on November 07, 2012, 04:51:33 PM
Should I use the same cookie for all of my 3 forums (I am using SMF ver 2.0.2) ?

Yes. You do use the same cookies




@airtetdotin

Anguz is not much around here anymore

forum1 use database prefix smf1_
forum2 use database prefix smf2_
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

TomW


airtetdotin

Shared two forums exactly

But the problems is settings and themes

when i change the description of forum1 forum2 changed
theme would be same


RandomUser123

Thanks for the tutorial!

It's only a bit outdated {$db_prefix} is now {db_prefix} and im_recipients is now pm_recipients and instant_messages is personal_messages.

And I can't get the cookie to work.

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Hj Ahmad Rasyid Hj Ismail

Yes. And no.

Some method in this topic discussion are still related and useful. For example this method:
Quote from: Quinn on September 05, 2011, 12:02:42 PM
I have a theme set for each forum (3) and don't allow users to select their own. No problems. The main forum has 2 separate forums in sub directories.  To simplify use and allow for a single log in on these I have shared these database tables :

ALTER TABLE smf2_members RENAME TO smf2_members_old;
ALTER TABLE smf2_personal_messages RENAME TO smf2_personal_messages_old;
ALTER TABLE smf2_pm_recipients RENAME TO smf2_pm_recipients_old;

ALTER TABLE smf3_members RENAME TO smf3_members_old;
ALTER TABLE smf3_personal_messages RENAME TO smf3_personal_messages_old;
ALTER TABLE smf3_pm_recipients RENAME TO smf3_pm_recipients_old;

ALTER TABLE smf_members RENAME TO shared_members;
ALTER TABLE smf_personal_messages RENAME TO shared_personal_messages;
ALTER TABLE smf_pm_recipients RENAME TO shared_pm_recipients;

CREATE VIEW smf_members AS SELECT * FROM shared_members;
CREATE VIEW smf_personal_messages AS SELECT * FROM shared_personal_messages;
CREATE VIEW smf_pm_recipients AS SELECT * FROM shared_pm_recipients;

CREATE VIEW smf2_members AS SELECT * FROM shared_members;
CREATE VIEW smf2_personal_messages AS SELECT * FROM shared_personal_messages;
CREATE VIEW smf2_pm_recipients AS SELECT * FROM shared_pm_recipients;

CREATE VIEW smf3_members AS SELECT * FROM shared_members;
CREATE VIEW smf3_personal_messages AS SELECT * FROM shared_personal_messages;
CREATE VIEW smf3_pm_recipients AS SELECT * FROM shared_pm_recipients;

ALTER TABLE smf_log_online RENAME TO shared_log_online;
ALTER TABLE smf2_log_online RENAME TO smf2_log_online_old;
ALTER TABLE smf3_log_online RENAME TO smf3_log_online_old;

CREATE VIEW smf_log_online AS SELECT * FROM shared_log_online;
CREATE VIEW smf2_log_online AS SELECT * FROM shared_log_online;
CREATE VIEW smf3_log_online AS SELECT * FROM shared_log_online;

ALTER TABLE smf_attachments RENAME TO shared_attachments;
ALTER TABLE smf2_attachments RENAME TO smf2_attachments_old;
ALTER TABLE smf3_attachments RENAME TO smf3_attachments_old;

CREATE VIEW smf_attachments AS SELECT * FROM shared_attachments;
CREATE VIEW smf2_attachments AS SELECT * FROM shared_attachments;
CREATE VIEW smf3_attachments AS SELECT * FROM shared_attachments;

ALTER TABLE smf_sessions RENAME TO shared_sessions;
ALTER TABLE smf2_sessions RENAME TO smf2_sessions_old;
ALTER TABLE smf3_sessions RENAME TO smf3_sessions_old;

CREATE VIEW smf_sessions AS SELECT * FROM shared_sessions;
CREATE VIEW smf2_sessions AS SELECT * FROM shared_sessions;
CREATE VIEW smf3_sessions AS SELECT * FROM shared_sessions;

Before doing this I also pointed the settings for attachments & avatars to the main forums directories. I use sub domain independent cookies (PROBABLY NOT NECESSARY IN MY SITUATION) with the same cookie name, database sessions & for all forums. Disabled registration on all but the main forum and can log in/out to all at the same time. I did not share the permissions or member groups so I can control user permissions on the other boards separately.

To keep the script kiddie's reg bots out, I  use the MOD's httpBL with Honey Pot with a few simple questions for registration on the main forum. 6719 Spammers blocked up until today

Everything is working very well.

With this example, database can be shared without modifying SMF files.

Arantor

Except, as repeated numerous times throughout this topic, there are unpleasant side effects to doing this.
No good deed goes unpunished
All helpful urges should be circumvented

Hj Ahmad Rasyid Hj Ismail

Indeed. All modifications have their own effects. Pleasant or unpleasant will depends on each mods.

But for learning and gaining knowledge, it is still useful, undoubtedly.

Arantor

Except it gives users bad impressions.

Sharing post counts between forums is bad enough, but sharing avatars (brokenly) between them is even less clever, as is the absolute requirement to share all user groups between forums. Paid subscriptions also shouldn't be used on any of the forums.
No good deed goes unpunished
All helpful urges should be circumvented

Hj Ahmad Rasyid Hj Ismail

Not really. I have taken liberty to list all of these caveats so that people will know them if they are trying to apply this mod. If they read thoroughly, they should know them.

Quote from: ahrasis on September 10, 2011, 05:49:23 AM
Quote from: ahrasis on June 15, 2010, 09:23:04 AM
I listed the note on the Caveat & Gotchas of this database mod:
Quote from: Arantor on March 23, 2010, 06:09:41 PM
This thread does discuss multiple ways of doing it, but all require significant change or come with significant caveats and gotchas. There's no simple way that actually works cleanly without any side effects :(
Avatar Caveat:
Quote from: Arantor on March 05, 2010, 07:15:54 AM
Note that member avatars are shared if they use an external URL or pick from the gallery (since that's stored in the members table, along with their post count) but not if they upload their own (since that's stored in the attachments table)
Membergroup Caveat:
Quote from: Arantor on March 09, 2010, 10:12:29 AM
Yup, that's the idea but do see the caveats from me above, like about membergroups and so on.
Attachment Caveat:
Quote from: Arantor on March 27, 2010, 05:47:31 PM
Assuming you have two topic and two message tables, you'll be duplicating attachments unless you modify all the attachment handling code too (have fun with that)

Basically, an attachment is attached to a post by id. If you attach a file to message id 1000, the same attachment is visible in BOTH sides' message 1000.
Cookie Caveat:
Quote from: Mr. Doug on March 28, 2010, 08:26:56 AM
I've had no issues with cookies. Just make sure your cookies aren't named the same way. (keep them all different.)
Theme & Board Caveat:
Quote from: Mr. Doug on March 29, 2010, 08:38:17 AM
I found a caveat to a shared member DB. Make sure all the Themes on your boards are numbered the same way. If I make a change the default to one (and reset the members options), all 3 get the change pushed.
Custom Profile Caveat:
Quote from: Arantor on March 29, 2010, 08:41:20 AM
Note also that custom profile fields are also in that table...
Statistic Caveat:
Quote from: Mr. Doug on March 31, 2010, 08:36:06 AM
I ran into the same thing. If you run the "update statistics" maintenance, it fixes it. So now I just run that every few days until I can get around to writing a cron script that does it for me. Everything functions correctly, it just doesn't update the number of users in the bottom of the page..
Hope this will help. Happy testing! ;)

Arantor

I'm sure there's more than that, actually, and also quoting me saying "but see the above note" doesn't really help in this case.

But your own post indicates how many issues there are with this approach and why it's not a good idea...
No good deed goes unpunished
All helpful urges should be circumvented

Hj Ahmad Rasyid Hj Ismail

Quote from: ahrasis on July 15, 2014, 10:11:57 PM
Indeed. All modifications have their own effects. Pleasant or unpleasant will depends on each mods.

But for learning and gaining knowledge, it is still useful, undoubtedly.

Arantor

I disagree. Bad knowledge is worse than no knowledge.
No good deed goes unpunished
All helpful urges should be circumvented

Hj Ahmad Rasyid Hj Ismail

It is not bad knowledge to learn. And IMO you know it. People do learn a long way, a short way, an easy way and a hard way. People also learn from errors and mistakes.

The mod gives ideas and ways to resolve or achieve something that someone need to accomplish. Whether it is important or not, it is another issue.

The idea itself has been developed into various another mods. This one is database with various forum installations sharing needed data. The other with single installation with same data but various forums.

It is undoubtedly useful to me and many others who discussed in this tips and tricks topic. It is even expandable and not only limited to SMF.

I can see your side of argument but it is not sound to me. Besides, we can always agree to disagree Captain Arantor. ;)

Arantor

Oh, same as always, you see my point but declare it as not sound because you disagree with it.
No good deed goes unpunished
All helpful urges should be circumvented

Advertisement: