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
  #82  
Old 02-28-2006, 03:14 AM
justindwhite justindwhite is offline
 
Join Date: Apr 2005
Location: Spartanburg, SC
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by psalzmann
I don't think you guys realize... that this is a general hack that is not just for vb 3.. it can be used in ANY vb version, it's the "guts" behind the hack/info that defines how or what should be done.

Keep in mind, even with the proper info above for the "set" version he is writing this hack for, still does not work out of the box. Well, it does kinda, if you use the exact version the author is using. However, even the instructions I had to work with, I was missing some strikes table and a few others.. I just skipped them. No harm done.

The only problem I've had with this hack is very minor --

When you have a Running board, with say 1000 members or posts and then begin this hack to a fresh board, the new board statistics do not reflect the old board.

ie: 1 Thread, 1 Post, 1 Members

Then I made a tweak to at least show who's online (I made old board and the new board look at the same `sessions` table, so now if there are 5 users on the old board, there is 5 users + how many users are on the new board. That works.

The problem we have is the "new fresh board" member count. It's only showing 1 member - Admin. However, now I've got to find a way to refresh this stats.. if possible.. to reflect what both boards show. I think it's some serilized data somewhere in the db. I'll figure it out soon enough.
well do you mind sharing how you got yours to work? I have tried many times and failed.
Reply With Quote
  #83  
Old 02-28-2006, 08:08 PM
Rahjeir Rahjeir is offline
 
Join Date: Feb 2005
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I went another route. I replaced TABLE_PREFIX with MERGE_PREFIX and defined it. Though I merged alot more tables then the ones defined here.

For 3.5.X I had to edit the class_dm.php. These are the two stock lines I needed to edit for a 3.5.X. My forums have been running merged for 1 1/2 years now. Only minor issues come up.

class_dm.php(rewrite with your merged value.)
Search for
$return = $this->db_insert(TABLE_PREFIX, $this->table, $doquery);

Search for
$return = $this->db_update(TABLE_PREFIX, $this->table, $this->condition, $doquery, $delayed);

Other then that, the above hack should work.
Reply With Quote
  #84  
Old 03-08-2006, 02:28 AM
lovevn lovevn is offline
 
Join Date: May 2004
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I could pay if anyone can do this for me. I am using 3.5.x

Thanks
Reply With Quote
  #85  
Old 03-21-2006, 06:55 PM
john_robot john_robot is offline
 
Join Date: Jun 2005
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, This is really good info , I want to do something different , I want to to get all the forum posts categories and what ever it has except the skin template , can you please guide me on this. the idea is I want to have a different skin on one of my forum.
Reply With Quote
  #86  
Old 03-22-2006, 04:21 PM
Fenriz Fenriz is offline
 
Join Date: Aug 2002
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

westpointer is dead
Reply With Quote
  #87  
Old 03-22-2006, 04:37 PM
CyberRanger's Avatar
CyberRanger CyberRanger is offline
 
Join Date: Mar 2004
Posts: 1,319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hehe ... no, not dead. I think the one poster summed it up well. This is more a concept than an easy to install mod. If you aren't versed in php, I really don't recommend trying this.

:banana: :banana:
Reply With Quote
  #88  
Old 03-22-2006, 08:22 PM
dicb dicb is offline
 
Join Date: Mar 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm about to try this for 3.5.4 right now. I have a site ready to launch, and I'm this is all I need for it. Just to let you know, I assumed I would have to figure this out myself untill I googled "vbulletin same login on multiple forums".

Whether this works or not, I want to thank Westpointer for this BEFORE I start cursing and screaming.

Here goes. I'm not optomistic. If you don't hear back from me shortly assume the worst and don't try it on 3.5.4.
Reply With Quote
  #89  
Old 03-22-2006, 09:20 PM
dicb dicb is offline
 
Join Date: Mar 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I should note, I backedup the entire new forum directory, so my numbers may be off here, especially since I see them replacing things in the install dir. I just thought better safe than sorry since their may be more things that needed changes made in them than 3.0.8 did.

First replace... 597 replaced in 315 documents.

Second replace... 8 replaced in 315.

Third replace... 77 replaced in 315.

#8 - changed [ . TABLE_PREFIX . $idname] to [. "$idname] on line 1242 of /includes/functions.php

print_chooser_row (with two o's) starts on line 1497 of /includes/adminfunctions.php. started replacement at 1506, but I'm not sure I did it right. I replaced
Code:
if (!is_array($GLOBALS["$cachename"]))
	{
		$GLOBALS["$cachename"] = array();
		$result = $vbulletin->db->query_read("SELECT title, $tableid FROM " . TABLE_PREFIX . "$tablename $wherecondition ORDER BY title");
		while ($currow = $vbulletin->db->fetch_array($result))
		{
			$GLOBALS["$cachename"]["$currow[$tableid]"] = $currow['title'];
		}
		unset($currow);
		$vbulletin->db->free_result($result);
	}
with
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 
        }
Once again, I have no idea if that's right.

construct_style_choose starts on line 166. Replaced on line 175,
Code:
	$tableid = $tablename . "id";
with...
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 
        "); 
    }
I'm not sure I did everything right, or if there is more that needs to be done, however that is what I did. I am uploading them now, but don't have time to test it. Timestamp should give an idea of how long it took, but subtract one cig break for sanity.
Reply With Quote
  #90  
Old 03-22-2006, 10:27 PM
dicb dicb is offline
 
Join Date: Mar 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

whhew, I'm glad I documented that... cause it worked.... er, almost.
The PM's are screwed up. I can compose and send them... but I can't read them. Even if I send one, I can't view it in my sent items folder. When I switch between the forums they both show the same thing (2 messages in inbox) and when I go to my PM folder the space where the PM title should be is blank. There are still two rows in the table (one for each message) and there is even that little check box on the right to mark them for deletion. Only problem is with no title to the message, I can't view the message.

Bottom line, everyone has been bugging to get this ported to 3.5.x, but nobody just went through it to see if it would work. It almost did. All you have to do is follow the directions carefully. Westpoint - excellent job here on this hack. Your time and efforts are greatly appreciated by everyone here, regardless of how they express it. Hopefully you or someone here will be able to get the PM issue fixed. It looks like something small, cause I'm not getting any error messages. Unfortunatly I don't know how vb works well enough to figure it out myself.
Reply With Quote
  #91  
Old 03-23-2006, 05:58 PM
dicb dicb is offline
 
Join Date: Mar 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I spoke too soon. Registration is completely jacked up. Depending on which forum you register in, you'll have different problems. Undoing all the work.

Cheers, and hopefully someone will have more sucess than I, and maybe my experiment will help a little.
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 06:57 AM.


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.04941 seconds
  • Memory Usage 2,335KB
  • 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
  • (4)bbcode_code
  • (2)bbcode_php
  • (1)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