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 found more details, but it doesnt' seem like anyone cares... Anyway, if you register in the forum that doesn't use the prefix, everything is find. If you register in any of the other forums, things get very squirrly.
I have everything working as well except when registering a new user from the new forums. It is still adding it to the new database user table instead of the old existing. Does anyone have any helpfull tips on where to find the insert statement that adds in a new user.
Ok got past the previous post problem. The current issue is in the Private Messaging. Whe I send a PM from the new site I get no error message and the message shows in my sent items however does not show in my inbox. I looked in the database and in table pmtext I can see the PM inside of table PM I see one entry which would be what shows in my PM box. What I don't see is the second entry that would allow it to show in my inbox.
I have been over the code way to many times and I think I am just missing it somewhere any help would be appreciated. It is really hard to find problems when there is no errors.
Ok not sure if anyone is interested or how I could distribute this but I have the entire program working just I didn't keep track of the changes needed to make it work. Can I just remove my license key from all files and zip all the files together? I don't know what the rules are and how to go about this. I have it working on V3.5.
Ok not sure if anyone is interested or how I could distribute this but I have the entire program working just I didn't keep track of the changes needed to make it work. Can I just remove my license key from all files and zip all the files together? I don't know what the rules are and how to go about this. I have it working on V3.5.
Any help would be great, Thanks
First, great work! Thanks for keeping this concept alive. I've simply not had the appropriate amount of time to devote to it. How to package it is the tough thing. I'm fairly certain that you are NOT allowed to distribute entire vb replacement files here. You have to just show the hacks. I'm not positive about that but I think that's true.