Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

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
  #52  
Old 11-27-2005, 01:03 PM
FamilyCorner FamilyCorner is offline
 
Join Date: Jun 2005
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by westpointer
A number of folks have ask me to do this. I'll tried to do a 3.5.1 example this week. :up:
Thank you so much!!
Reply With Quote
  #53  
Old 11-28-2005, 02:32 PM
lazyseller lazyseller is offline
 
Join Date: Oct 2003
Posts: 178
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looking forward for this......
Reply With Quote
  #54  
Old 12-08-2005, 04:03 AM
Revpolar Revpolar is offline
 
Join Date: Feb 2004
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found a nice utility to do the string replacements with. Its called FSRU
Code:
http://www.gammadyne.com/freplace.htm#download
Example of how well it worked for me.
Code:
OPERATION COMPLETE

Search string summary:
  ". TABLE_PREFIX . "user": 562

Number of files processed: 169
Number of lines processed: 94,729
Total number of occurrences: 562
Files with occurrences: 92
Lines with occurrences: 558

Elapsed time: 954 milliseconds
Processing speed: 99,296 lines per second.
Reply With Quote
  #55  
Old 12-08-2005, 04:13 AM
minzhong minzhong is offline
 
Join Date: Jul 2005
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do i need an individual license for each 'board' ?
Reply With Quote
  #56  
Old 12-08-2005, 07:40 AM
Fenriz Fenriz is offline
 
Join Date: Aug 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by westpointer
A number of folks have ask me to do this. I'll tried to do a 3.5.1 example this week. :up:
I have 2 forums (3.5.2) on the same server and want to share user database from one forum to another. Is it the right hack for that? Could you make it for vbulletin 3.5.2?

Thank you!
Reply With Quote
  #57  
Old 12-08-2005, 11:27 AM
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Posts: 1,319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by minzhong
Do i need an individual license for each 'board' ?
Yes. Each install requires a separate license if you use this method.
Reply With Quote
  #58  
Old 12-08-2005, 11:28 AM
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Posts: 1,319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fenriz
I have 2 forums (3.5.2) on the same server and want to share user database from one forum to another. Is it the right hack for that? Could you make it for vbulletin 3.5.2?

Thank you!
I keep meaning to to that. Time is the enemy. (Yes, this is the right hack.)
Reply With Quote
  #59  
Old 12-13-2005, 07:54 AM
b65ran b65ran is offline
 
Join Date: Apr 2005
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

waiting for 3.5.2 release!
Reply With Quote
  #60  
Old 12-22-2005, 07:21 PM
boostedsti boostedsti is offline
 
Join Date: Nov 2003
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Westpointer any update on VB3.5.2?
Reply With Quote
  #61  
Old 12-23-2005, 12:28 AM
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Posts: 1,319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by boostedsti
Westpointer any update on VB3.5.2?
Sorry, I just haven't had the time to do this. Not forgotten. Maybe next week. :nervous:
Reply With Quote
Reply


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 09:12 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.04476 seconds
  • Memory Usage 2,325KB
  • 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_code
  • (2)bbcode_php
  • (5)bbcode_quote
  • (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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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