Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Shared user database for multiple forums, same server Details »
Shared user database for multiple forums, same server
Mod Version: 1.00, by CyberRanger (Member) CyberRanger is offline
Developer Last Online: Dec 2014 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.0.9 Rating: (0 vote - 0 average) Installs: 15
Released: 12 Oct 2005 Last Update: Never Downloads: 1
Not Supported Code Changes  

For version 3.5x+, please see http://www.vbulletin.org/forum/showthread.php?t=118473

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:
  1. Copy your forum directories to a parallel directory (for example copy /www/forums to /www/new_forums)
  2. In /includes/config.php, change $tableprefix (line 91) to a new prefix [for example $tableprefix = 'new_';]
  3. Run the vb install from the new directory (/www/new_forums/install/install.php)
  4. 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!
  5. 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
  6. 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.)
  7. 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.
  8. 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


      Block Disabled:      (Update License Status)  
      Suspended or Unlicensed Members Cannot View Code.

    • In /includes/adminfunctions_user.php around line 116 (construct_style_chooser)


      Block Disabled:      (Update License Status)  
      Suspended or Unlicensed Members Cannot View Code.


Done! Both forums are now accessed by the same user table! PM's are unified across forums as is the user count.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 12 Oct 2005, 19:06
FleaBag's Avatar
FleaBag FleaBag is offline
 
Join Date: Dec 2001
Although I personally have no use for this I just wanted to say good work! I know a lot of people will be greatful.
__________________
AndroidETC.com :: Android, and other stuff.
Reply With Quote
  #3  
Old 12 Oct 2005, 21:08
Corriewf's Avatar
Corriewf Corriewf is offline
 
Join Date: Dec 2004
Awww man you stole my idea!!!!! Its ok though cause I am just happy to see it!
Reply With Quote
  #4  
Old 12 Oct 2005, 23:12
LICryptkeeper LICryptkeeper is offline
 
Join Date: Jun 2003
oh dear god I have waited for this for so long :S now port it to 3.5! I command you! ( kidding, nice job)

I would love to get this working with the drupal CMS (I'm having a cookie issue at the moment)
Reply With Quote
  #5  
Old 13 Oct 2005, 00:15
Nutz's Avatar
Nutz Nutz is offline
 
Join Date: Aug 2004
Real name: Mathew Summerfield
Very nice hack.
Very nice forums.

Thanks,
Mat
Reply With Quote
  #6  
Old 13 Oct 2005, 02:01
GoTTi GoTTi is offline
 
Join Date: Jun 2002
can u clear up number 8 for me. i dont understand what u mean...

before i start on a hack or modification i like to know exactly whats goin on...

this has nothing to do with posts right? just user login?
Reply With Quote
  #7  
Old 13 Oct 2005, 03:24
Bad Bunny's Avatar
Bad Bunny Bad Bunny is offline
 
Join Date: Apr 2002
What transfers with the character to both forums? All of their setting and profile (including profile pic and avatar)? Some of it? None of it?

Ideally it would seem to me you would have password and email the same while everything was per site.
Reply With Quote
  #8  
Old 13 Oct 2005, 05:14
boostedsti boostedsti is offline
 
Join Date: Nov 2003
What about Subscriptions are those per user or per board?

Also is that a backup copy you are using or is it really live?
Reason I ask is

Stats: Armchairgeneral
Threads: 1, Posts: 1, Members: 7,631
Welcome to our newest member, vernon.miles

Stats:strategyzoneonline
Threads: 32,469, Posts: 421,417, Members: 7,637
Welcome to our newest member, josephhnewkirk

Either way I'm digging script.
Your sites are pretty sweet too.

Last edited by boostedsti; 13 Oct 2005 at 06:06.
Reply With Quote
  #9  
Old 13 Oct 2005, 11:17
goyo goyo is offline
 
Join Date: Mar 2002
Great hack...

Now only if we could use separate servers for this... :nervous:
Reply With Quote
  #10  
Old 13 Oct 2005, 12:33
boostedsti boostedsti is offline
 
Join Date: Nov 2003
Originally Posted by goyo
Great hack...

Now only if we could use separate servers for this... :nervous:
By looking at the code it looks like you can as long as the database in shared between the boards..

The only thing bad I see is if you decide to expand and add another forum IE 3, 4, 5, 6 etc just imagine how many tables would be in that DB..
Reply With Quote
  #11  
Old 13 Oct 2005, 15:36
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Originally Posted by boostedsti
What about Subscriptions are those per user or per board?
Subscriptions to forums and threads would be by board. However, settings like always getting an email to a thread you start would be by user. The trick is looking at what is in the user table. That determines if the setting is by board or by user. For example, since the custom title is in the user table, it will be the same on both forums. (It cannot be different). Same for the user's signature. Since signature is in the usertextfield table (a shared table) it will be the same for both forums.
Originally Posted by boostedsti
Also is that a backup copy you are using or is it really live?
Reason I ask is

Stats: Armchairgeneral
Threads: 1, Posts: 1, Members: 7,631
Welcome to our newest member, vernon.miles

Stats:strategyzoneonline
Threads: 32,469, Posts: 421,417, Members: 7,637
Welcome to our newest member, josephhnewkirk
Great question! It's live! Each forum has it's own stats table so one can see the threads and posts separately for each table. The user number will be off until the nightly cron runs that updates the user count. Some weird effects here but if you dig through the tables and the code it makes sense.
Originally Posted by boostedsti
Either way I'm digging script.
Your sites are pretty sweet too.
Thanks!

Last edited by CyberRanger; 13 Oct 2005 at 15:44.
Reply With Quote
  #12  
Old 13 Oct 2005, 15:37
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Originally Posted by goyo
Great hack...

Now only if we could use separate servers for this... :nervous:
Yes, that would be great but ... that's an entirely different beast! :nervous:
Reply With Quote
  #13  
Old 13 Oct 2005, 15:41
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Originally Posted by Bad Bunny
What transfers with the character to both forums? All of their setting and profile (including profile pic and avatar)? Some of it? None of it?

Ideally it would seem to me you would have password and email the same while everything was per site.
Anything that is in the user* tables is shared between the sites. So, email, sig, custom title, etc. Avatars are trickier. Since the avatar field is in user, the user will have the same avatar number for each site. However, the avatar table is not shared so ... he could have a different avatar on each site. However, he could really only control what one of them looks like! If the user has a custom avatar, he could actually control what is displayed on each site. I guess ideally the avatar table should also be shared.
Reply With Quote
  #14  
Old 13 Oct 2005, 15:43
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Originally Posted by GoTTi
can u clear up number 8 for me. i dont understand what u mean...

before i start on a hack or modification i like to know exactly whats goin on...

this has nothing to do with posts right? just user login?
The posts and threads are not impacted at all. Only the user* tables, strike, and pm* tables are shared. (I'll clear up #8 in a bit!)
Reply With Quote
  #15  
Old 13 Oct 2005, 17:37
Bad Bunny's Avatar
Bad Bunny Bad Bunny is offline
 
Join Date: Apr 2002
The only real use I would have for this is if it totally ran like 2 distinct forums that only shared the core user information (username, password, & email).
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 16:18.

Layout Options | Width: Wide Color: