Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: darknovember - tammikuu 25, 2014, 12:52:41 AP

Otsikko: can two forums use the same user login data
Kirjoitti: darknovember - tammikuu 25, 2014, 12:52:41 AP
just another crazy question im tossing out there
but if you have two forums, can you use the user information from forum #1 on forum #2
reason for this question is because I would like to use some mods on part of my forum but not on other parts
So the easiest way i can figure to do this is simply to make more forums, but i would really like to have everyone use the same login information on both forums without having to re register, haha no idea if this can be done or not just wondering.
Otsikko: Re: can two forums use the same user login data
Kirjoitti: Arantor - tammikuu 25, 2014, 01:28:05 AP
Not without a massive amount of work and all kinds of things that are a bit flaky.
Otsikko: Re: can two forums use the same user login data
Kirjoitti: darknovember - tammikuu 25, 2014, 01:57:04 AP
ahh, haha thats probably something i should stay away from then haha
Otsikko: Re: can two forums use the same user login data
Kirjoitti: moparisthebest - tammikuu 27, 2014, 09:09:51 AP
Couldn't you have 2 forums in the same database with different prefixes, then make prefix2_members a view of prefix1_members ?
Otsikko: Re: can two forums use the same user login data
Kirjoitti: Arantor - tammikuu 27, 2014, 09:52:27 AP
No. There are some very nasty issues like for example avatars won't work properly even if you fix all the places where the DB prefix would have to be changed.
Otsikko: Re: can two forums use the same user login data
Kirjoitti: moparisthebest - tammikuu 27, 2014, 10:19:28 AP
Quickly looking through the database structure I don't see any problems that would cause, the avatar issue would be due to the avatar directory not being in sync across both forums, but that would be remedied with a symbolic link:

ln -s /path/to/forum1/avatars /path/to/forum2/avatars

Any other reason it wouldn't work?
Otsikko: Re: can two forums use the same user login data
Kirjoitti: Arantor - tammikuu 27, 2014, 10:34:31 AP
Except that uploaded avatars are not in that folder but stored in the attachments table as well as the master attachments folder(s), user preferences in the themes table (as the only storage of arbitrary rows per user), custom field values also there in the themes table... Need I go on?
Otsikko: Re: can two forums use the same user login data
Kirjoitti: moparisthebest - tammikuu 27, 2014, 10:38:26 AP
So attachments table and folder would have to be shared too, the other tables could be different to allow different user preferences/themes for different forums.  It might work if it's that big of a deal for you. :)
Otsikko: Re: can two forums use the same user login data
Kirjoitti: Arantor - tammikuu 27, 2014, 10:41:30 AP
And sharing the attachments table will cause all kinds of things to go haywire, because it works by attaching to message ids so now you share attachments between forums and each attachment shows up in two different places.
Otsikko: Re: can two forums use the same user login data
Kirjoitti: darknovember - tammikuu 27, 2014, 01:37:08 IP
only idea i could think of is if the profile folders was synced with the other, I havent really poked around in the file structure of smf so im unsure how doable it is really.
but if its just a file by file copy im sure that i could make a script to automatically copy all of the files from one area to the other.
only issue with all of that i could see is file naming, and if a user changed there profile in forum #2 then when it did come time for the profiles to sync the changes that they did make in forum number 2 would be reverted back to the way they was before...


another thought on getting this done is I wonder how hard it would be to implement mods in one part of the forum but not others.... thats probably another crazy hard thing to do but its just a thought none the less...
Otsikko: Re: can two forums use the same user login data
Kirjoitti: Arantor - tammikuu 27, 2014, 01:49:07 IP
There's no 'folders' for the profile. None of that stuff is in files anywhere, it's all in the database. And trying to sync that is also a pain in the posterior.

There is really no good way in SMF to do what you're trying to do :(
Otsikko: Re: can two forums use the same user login data
Kirjoitti: darknovember - tammikuu 27, 2014, 02:13:58 IP
yeah haha, thats kinda why once you told me that at the start that it was very hard to do i figured ide forget about that idea haha :P, just was browsing and seen all the replies here on it , already created the two forums and had everyone at least the active members create new profiles on the other forums and were using them both now haha just thought there was a easier way of doing it all.
Otsikko: Re: can two forums use the same user login data
Kirjoitti: TomW - tammikuu 28, 2014, 10:17:33 AP
I had 3 forums share member data by creating views of the members tables.   It worked but had some serious quirks, one of which was the need to upload an avatar for each forum.  Also the user statistics get borked.  And you cannot successfully use any mods for PMs.  Plus, any mods which require changes to the member tables required extra attention.  And, for some users, even though they had a username/password, they had to register again - I never figured that one out as it was not a consistent problem.  None of these are major issues, but were a pita at times.

Those are the issues that I faced.  I eventually removed the views, created the member tables from scratch, and repopulated them with a backup from the 'main' forum.    It is now much easier for me to install mods, and best of all, none of the forum members complained.