The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
![]() |
|||||||||||||||||||||||||
This is a feature requested many times, and we are still waiting, so I released a patch to be able to run many forums with the same user database.
This is an EXPERIMENTAL PATCH I'm running on my forums. Code:
--- ../../../private/upload/includes/class_core.php 2008-07-10 11:17:32.000000000 +0200 +++ class_core.php 2008-07-11 17:44:20.000000000 +0200 @@ -405,6 +405,33 @@ $this->connection_recent =& $link; $this->querycount++; + $shared_tables = Array("user","useractivation","userban","usertitle","userchangelog","usertextfield","userfield","usergroup","userlist","usernote","profilevisitor","reputation","reputationlevel","spamlog","strikes","pm","pmreceipt","pmtext","avatar","profilefield"); + + $main_prefix = "FP_"; + foreach ($shared_tables as $shared_table) + { + $orig = TABLE_PREFIX.$shared_table; + $dst = $main_prefix.$shared_table; + + $this->sql = str_replace($orig." ",$dst." " ,$this->sql); + $this->sql = str_replace($orig.".",$dst."." ,$this->sql); + $this->sql = str_replace($orig."\r",$dst."\r",$this->sql); + $this->sql = str_replace($orig."\n",$dst."\n",$this->sql); + $this->sql = str_replace($orig."\t",$dst."\t",$this->sql); + + } + if ($queryresult = $this->functions[$buffered ? 'query' : 'query_unbuffered']($this->sql, $link)) { This is only useful for new forums joining anothers one user database. Requirements:
FORUM A has table prefix FA_ in database, FORUM_B has FB_ and FORUM_C has FC_ FORUM A is the main, and older forum, where we have all our users. then we would install FORUM_B and FORUM_C normally, using the same database that FORUM_A uses, but setting up their own table prefixes. once FB_ and FC_ are installed then we go patching class_core.php from FORUM_B and FORUM_C setting up $main_prefix = "FA_"; so they use FORUM_A for shared tables. Possible problems:
Author: Optimizacion Web Show Your Support
|
Comments |
#62
|
|||
|
|||
![]()
Still not resolved.
Is there an easy & non destructive way to add prefixes to the start of all unprefixed tables? Some of the tables on the main forum are prefixed but like mw_ for media wiki, so a script needs to be variable. |
#63
|
|||
|
|||
![]()
Is this the only Mod to do this? Anyone offer a commercial one with full support similar to how VBSEO does for search opt?
|
#64
|
|||
|
|||
![]()
Wow,
I got it to work within like ten minutes by reading all five pages and getting everyones input. Thanks for a great hack this is what I have been looking for and it works perfectly. |
#65
|
|||
|
|||
![]()
Do you have prefixes on the main db?
|
#66
|
|||
|
|||
![]() Quote:
![]() |
#67
|
|||
|
|||
![]()
when you share the usertable, will the vb featurees like avatars stop working on all forum or just the forum B that is sharing the usertable with from the forum A
|
#68
|
|||
|
|||
![]()
also if i share the usertable will the usergroup be the same as forum A ?
and where do i paste that patch, on forum A or forum B? |
#69
|
|||
|
|||
![]() Quote:
Also guys my main DB does NOT have prefixes .... I just used this: Code:
$shared_tables = Array("user","useractivation","userban","usertitle","userchangelog","usertextfield","userfield","usergroup","userlist","usernote","profilevisitor","reputation","reputationlevel","spamlog","strikes","pm","pmreceipt","pmtext","avatar","profilefield"); $main_prefix = ""; foreach ($shared_tables as $shared_table) { $orig = TABLE_PREFIX.$shared_table; $dst = $main_prefix.$shared_table; $this->sql = str_replace($orig." ",$dst." " ,$this->sql); $this->sql = str_replace($orig.".",$dst."." ,$this->sql); $this->sql = str_replace($orig."\r",$dst."\r",$this->sql); $this->sql = str_replace($orig."\n",$dst."\n",$this->sql); $this->sql = str_replace($orig."\t",$dst."\t",$this->sql); } ![]() |
#70
|
|||
|
|||
![]()
Check this out for the How To:
https://vborg.vbsupport.ru/showpost....1&postcount=53 put it in the class_core.php on the 2nd, 3rd, 4th, ect forums. Leave the class core on the main forum whos user database your using alone. |
#71
|
|||
|
|||
![]()
thanks for the reply =)
now im wondering if this support mysql 5.1.30 |
![]() |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|