This thread will detail how to have a single login for multiple forums. It makes the following assumptions:
A valid vbulletin license exists for each install
All forums will be on the same server
You already have one forum operational AND that forum uses a BLANK $tableprefix!
One database will contain all the tables
This thread is a follow-up from this discussion over at vbulletin.com. Thanks to Brains for some pointers!
Here are the steps:
Copy your forum directories to a parallel directory (for example copy /www/forums to /www/new_forums)
In /includes/config.php, change $tableprefix (line 91) to a new prefix [for example $tableprefix = 'new_';]
Run the vb install from the new directory (/www/new_forums/install/install.php)
During the install, be sure NOT to empty the tables. If you have any doubt about what this means, stop NOW! If you empty the tables, you will lose all of your existing data from a prior install!
Download the files from these directories to your PC: /new_forums, /new_forums/admincp, /new_forums/archive, /new_forums/includes, /new_forums/modcp, /new_forums/subscriptions
We are now going to make global changes to the files in the folders (and subfolders) above. I used Dreamweaver's "edit-find and replace" function with "find in" set to "Entire Current Local Site". We are basically going to remove the "TABLE_PREFIX" from any code dealing with the user. (Note - if you are comfortable with unix command, you could do these changes from the command line on the server.)
Run the following find and replace operations:
Find [" . TABLE_PREFIX . "user] (find what's inside the brackets). Replace with [?.?user] This should find 562 instances of user, usergroup, userfield, and usertextfield
Find [" . TABLE_PREFIX . "strikes] (find what's inside the brackets). Replace with [?.?strikes] This should find 5 instances of strikes
Find [" . TABLE_PREFIX . "pm] (find what's inside the brackets). Replace with [?.?pm] This should find 61 instances of pm, pmtext, pmtextid, and pmreceipt.
Upload these directories back to the server.
We now need to do a little fine tuning
In /includes/functions.php: on line 1171 remove the table_prefix before $idname.
In /includes/adminfunctions: modify print_choser_row (line 1161)to check for $tableid of user, usergroups
PHP Code:
if ($tableid == "user" OR $tableid == "usergroup") {
$result = $DB_site->query("SELECT title, $tableid FROM "."$tablename$wherecondition ORDER BY title");
} else {
$result = $DB_site->query("SELECT title, $tableid FROM " . TABLE_PREFIX . "$tablename$wherecondition ORDER BY title"); // existing code
}
In /includes/adminfunctions_user.php around line 116 (construct_style_chooser)
PHP Code:
$tableid = $tablename . "id";
if ($tablename == "user" OR $tablename == "usergroupid") {
$result = $DB_site->query("
SELECT title, $tableid FROM "."$tablename WHERE userselect = 1
ORDER BY title
");
} else {
// existing code
$result = $DB_site->query("
SELECT title, $tableid FROM " . TABLE_PREFIX . "$tablename WHERE userselect = 1
ORDER BY title
");
}
Done! Both forums are now accessed by the same user table! PM's are unified across forums as is the user count.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I am very new to vbulleting and i don't know anything about php. but i would like to setup a 2 message boards and give same users access. can anyone help me?
Can anyone please help out a newbie please come on what does it take some money that is ok by me. As you can tell I do not know nothing about php nor vbulletin so please help me.
Can anyone please help out a newbie please come on what does it take some money that is ok by me. As you can tell I do not know nothing about php nor vbulletin so please help me.
OK I have done everthing but I am getting an error in the admincp now everytime I go to search for users I get this error
PHP Code:
Fatal error: Call to a member function on a non-object in /home/hugojr/public_html/florida2/includes/adminfunctions.php on line 1156
what does this mean? here is what line 1156 looks like
PHP Code:
$result = $DB_site->query("SELECT title, $tableid FROM " . TABLE_PREFIX . "$tablename$wherecondition ORDER BY title");
I just posted this in a different forum before finding this thread. PLEASE first of all, reading my post below, am I understanding it correctly, that this hack will do what I am requesting below?
AND ALSO
will this work with 3.5.1?
Quote:
I own a website that is "sister sites" with another. We intertwine quite a bit of content and our design is the same, other than the logos and colors. Before I ask this question it is important to note that I have NO PROBLEM and already PLAN to purchase a completely separate license for the second website.
What I would like to do is twofold:
1) I'd like to import my users into the forums that I install on the second site
2) I'd like to be able to have one sign in for both sites.
Does that make sense? So if MemberJoe signs in to "Site A" and browses around, posts a few times, then visits "Site B" he would automatically be signed in and wouldn't have to do it again.
Is there a way to do this??
Again, I'm going to purchase the second license, that is definitely not a problem
I should probably make sure that I point this out, the two different sites are on the same server but are completely different domains.
I haven't tried this with ver 3.5.1 but the concept would be the same. It would take some slight tweaking (ie DB_site) is no longer the correct syntax, but you could probably figure it out.
This does look like what you'd want. You don't "import" the users into the second db, it simply reads the users from the same db.
OK I have done everthing but I am getting an error in the admincp now everytime I go to search for users I get this error
PHP Code:
Fatal error: Call to a member function on a non-object in /home/hugojr/public_html/florida2/includes/adminfunctions.php on line 1156
what does this mean? here is what line 1156 looks like
PHP Code:
$result = $DB_site->query("SELECT title, $tableid FROM " . TABLE_PREFIX . "$tablename$wherecondition ORDER BY title");
please someone please help me..
Hmm, that looks fine to me. The only function you are callind is $DB_site so I'm not sure why line 1156 would not work while 1154 does. What happens if you make the two the same? Does the query run then? (Obviously, don't leave it that way! Just for testing the code.)