2009-04-20, 09:13 AM
Ok. To best explain this here is what I sent to Tomm M.
Here is what Tomm M replied with.
As he suggested I am making a thread on this so I can get guided on what I should do.
Ok, I have setup the main page with the login fields on it. Tomm M said:
Ok, What should I add to the DB user table and what should I add to the login page? Oh, and all the forums are going to be on one DB with different prefixes.
Quote:I am wanting to set up a private forum hosting website for mothers groups. I need to be able to have multiple forums running (same DB or different DB), one for each mothers group. I will make an account for all members of the mothers group on each forum. Here is the hard part, I want to make all members from all forums have to login through a main page, kinda like a portal. I want them to fill in their username and password then click a button to login, then I want the member to be redirected to thier forum. Is it possible to somehow search the DB/S to find that user and log them in to the forum they are a member of and then redirect them?
If it makes any difference the forums will be running under subdomains.
Here is what Tomm M replied with.
Quote:It's not easy to run multiple forums off one user table, and I wouldn't recommend it, but if you need to to do it then I'll run through a few things to get you started.
First, if you see this thread: http://community.mybboard.net/thread-6190.html
Use this to create a custom portal with a login box for your users to login with. Second, you'll need to create a new field in the users table to be able to tell the script where to send the user after they've logged in.
Third, you need to modify each installation's ./inc/datahandlers/user.php - everytime the user is updated or created, you need to mirror the information into the one user table. For example, if you take a look in the file, and around line 977, you'll see this:
PHP Code:
$this->uid = $db->insert_query("users", $this->user_insert_data);
I'm sorry if it's wrong - I only have 1.6 on this PC, but it should be pretty similar! All you have to do is add the same thing after, but something like this:
PHP Code:
$db->query("INSERT INTO shared_users ('username', 'uid', 'email', 'password') VALUES (array_of_values)");
You'll need to alter the login part of MyBB to check this shared user table instead of it's own user table too. One of the things I'm hoping to work on in the coming months is a sort of one-source login plugin so this can be done easily. It won't be for some time though.
There's a hell of a lot of custom edits to make, and no doubt they'll be plenty of errors and performance problems along the way. I've only done it once, and not even in a public environment, so I can't say for sure it can even be done properly. I certainly haven't seen a popular website do it before, but you could always prove me wrong Smile
If you need any help, then feel free to start a thread and we'll go through it bit by bit first, before trying to apply it to a live system. A sort of testing tutorial, if you get what I mean... that way, others who want to do this can follow too...
As he suggested I am making a thread on this so I can get guided on what I should do.
Ok, I have setup the main page with the login fields on it. Tomm M said:
Quote:Second, you'll need to create a new field in the users table to be able to tell the script where to send the user after they've logged in.
Ok, What should I add to the DB user table and what should I add to the login page? Oh, and all the forums are going to be on one DB with different prefixes.