The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Share users database among many forums Details »» | |||||||||||||||||||||||||
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 |
#52
|
|||
|
|||
thanks for it...could you please provide a small tutorial on how to do it?
|
#53
|
||||
|
||||
a little question: I believe the password's salt is based on the forum's license string. ¿Why doesn't this affect this mod?
|
#54
|
||||
|
||||
Quote:
Quote:
1.- open includes/class_core.php 2.- find Code:
$this->querycount++; 3.- after that, add 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 = "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); } |
#55
|
|||
|
|||
Now that was a nice short tutorial
Would this work with two different versions of vBulletin? Say for example a 3.6.x and a 3.7.x site? I assume that this would not cause major impacts with upgrading as long as we remember to update the core file again? I wonder what the chances are that vBulletin could do something as a standard feature in vBulletin as I always wondered what the master and slave setting were for in the config.php file but honestly I never really had the time to investigate. I will have to look at this code more and give it a try on one of my test boards and if it works I may need to buy some more vBulletin licenses! |
#56
|
|||
|
|||
Hi there.
Is this working on the latest version of vB? This will work with two different databases right, basically sharing one database's vB users? |
#57
|
||||
|
||||
If I also wanted to share my Who's Online data (so that users showing up as logged in on one forum also appear as logged in on the other), is there anything I should be concerned about before just sharing those tables?
|
#58
|
|||
|
|||
great hack will use at some point.
|
#59
|
|||
|
|||
I have been looking for such a mod to merge my two forums database, I will give a try and let everyone know the performance.
|
#60
|
|||
|
|||
I've read this thread 4 times, all 4 pages & I can't seem to get the slave board to grab anything from the main.
The main forum has no prefix in it's tables so I have used the following: 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); I also tried $main_prefix = "."; & $main_prefix = " "; The new forum has yf_ as prefix which I had entered into the config.php before install. Same database. Is there a setting within the config.php that could be affecting the class_core.php mod? I'm refreshing the member list on the new forum to check it's working. I should see it go from 1 member to 12,447 members to mirror the main forum right? |
#61
|
|||
|
|||
i have the same problem my main forum does not use table prefix what can we edit to have it so that members can log into the second board - all i would like is the users shared nothing else.
Please anyhelp would be appreciated. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|