Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Shared user database for multiple forums, same server Details »»
Shared user database for multiple forums, same server
Version: 1.00, by CyberRanger CyberRanger is offline
Developer Last Online: Jan 2015 Show Printable Version Email this Page

Version: 3.0.9 Rating:
Released: 10-11-2005 Last Update: Never Installs: 15
Code Changes  
No support by the author.

For version 3.5x+, please see https://vborg.vbsupport.ru/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

      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.

Comments
  #112  
Old 11-28-2007, 09:46 PM
TundraSoul TundraSoul is offline
 
Join Date: Mar 2002
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't mind doing the edits, I just need to know what to do. (drool)...
Reply With Quote
  #113  
Old 11-29-2007, 06:20 PM
geckofrog geckofrog is offline
 
Join Date: Aug 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

me too, I need this!
Reply With Quote
  #114  
Old 11-30-2007, 09:44 PM
massiveblack massiveblack is offline
 
Join Date: Apr 2005
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any more information on this?

Much appreciated...truly.

JM
Reply With Quote
  #115  
Old 12-27-2007, 07:39 PM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would really like this as well.
Reply With Quote
  #116  
Old 02-26-2008, 03:46 AM
glaird glaird is offline
 
Join Date: Nov 2007
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cross-server is just what I'm looking for! Have you had a chance to document it yet?

thanks!
Reply With Quote
  #117  
Old 02-27-2008, 12:59 AM
superthang superthang is offline
 
Join Date: Aug 2007
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any up for this on 3.6.8 or 3.7 ?

cyberranger your my hero! please share!
Reply With Quote
  #118  
Old 06-21-2008, 03:58 AM
Sean James's Avatar
Sean James Sean James is offline
 
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 895
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this available?
Reply With Quote
  #119  
Old 02-18-2009, 06:21 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know this is a very old thread, but I am still running 3.0.xx and I need to build a second site which will use the user tables of my first one, so here I am.

I would like to know how the "sessions" are handled. I have some questions here and I would appreciate if someone can answer them for me.

Let's assume two sites, A and B. With this hack, all user information is kept in the "user" table in database A.

A member of site A logs in Site B. Obviously, since the last login time is stored in the shared user table, the last login time entered in the table, will be common for both sites, correct? So if the member comes back after two days and logs in site A, the last login time will be the last login time from his visit in site B. That means that if the user asks to see the new posts since his last visit (for example), the posts shown to him will not be correct, he will miss the posts between the last time he visited site A and the time he visited site B. Am I correct on this? It is of course possible to alter the user table to have separate columns for these time parameters for site A and site B.

Another question: again, let's suppose that a member logs in site B, does some work there and then follows a link to site A. Will he still be logged in in site A or will he need to re-log in in the other site? In other words, how are cookies handled? And what difference will it make if someone uses the "Remember me" checkbox in one site?

Finally a code question: the author suggests that we use a new table prefix for the new database "new_". The changes suggested show an empty table prefix though, for the old database. Shall I assume that wherever it is suggested to replace " . TABLE_PREFIX . " with ".", if one uses a prefix in the old database, he should replace " . TABLE_PREFIX . " with whatever his old table prefix is? I guess one could define something like "USER_TABLE_PREFIX" with the value of the table prefix used in the first site, and do the find and replace operations you suggest?

Again, I am aware this is an old hack, which has already been ported to later vB releases, but since I do not plan to use later releases, and this thing is pressing me, I would certainly appreciate any help you can give me.
Reply With Quote
Reply

Thread Tools

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

Forum Jump


All times are GMT. The time now is 08:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04984 seconds
  • Memory Usage 2,305KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete