MyBB Community Forums

Full Version: Multiple Forums.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok. To best explain this here is what I sent to Tomm M.
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.
OK, so this is what we plan to do: create a method where users can have one login to access several MyBB forums in one database. We'll do this by creating a "shared users table" so to speak. This table will contain the basic uid, username, password and emails of users.

I'm making a quick plugin that will make this a hell of a lot easier for the end users - I'm hoping Joshua we can use as a little guinea pig, but of course, anyone who is interested can test this out.

Remember - this is for testing purposes only. Do not use this in a live environment just yet.

So, is this the easiest way? Having multiple installations of MyBB - if you want them connected via a shared users table, then you must install the plugin on each installation?
I'm happy to do whatever is possible to get this to work. Just to make sure you know this, when the users login I want them to be redirected to the forum that they have an account on if that makes sense. I don't want them going to a another forum that they are not a member of.
(2009-04-20, 10:38 AM)Tomm M Wrote: [ -> ]So, is this the easiest way? Having multiple installations of MyBB - if you want them connected via a shared users table, then you must install the plugin on each installation?
Yep. I'm happy to do that.

Is it possible to make an installer type thing were I just enter the admin details, forum details and directory to copy the files to and it automatically copies the files and sets up MyBB with that plugin automatically activated?