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 |
#42
|
|||
|
|||
Quote:
|
#43
|
|||
|
|||
Thank you very much, that did the trick.
|
#44
|
|||
|
|||
It works well but I have some problems:
-Private message text is broken in the slave board. -User's title is broken in the slave board. -signature is broken in the slave board My board is using utf-8 charset(vietnamese languages) |
#45
|
|||
|
|||
Quote:
If you can enter the machine as root you could make a hard-link from the secondary forum avatars directory to the main one using "ln" (I'm assuming it's a U*IX/Linux machine) |
#46
|
|||
|
|||
Hello loven!
That seems strange since str_replace shouldn't affect the strings encoding. Could you please check if both forums are running using the same encoding? The problem could be there... Could you provide the urls for us to test? |
#47
|
|||
|
|||
Quote:
Thanks for your reply. Both forums are running the same ecodeing. However, in my main board I turn this off Quote:
I try to turn this off on the slave board but I got some error. Could you tell me how to fix on this case? Thanks again |
#48
|
|||
|
|||
Quote:
I also let people host their signature pics on my forum. So I also added "sigpic" to the list of shared tables. |
#49
|
|||
|
|||
Also, I figured if both board share the same PMs, then why not visitor messages too?
Just add: "visitormessage","visitormessage_hash" And you are good to go |
#50
|
|||
|
|||
Interesting way of doing it.
we've been running shared users for about 3+ years now and it has some minor "issues".. we initially did ours with PHP edits, then eventually by static links.. works well but has some issues with groups not updating sometimes. Currently looking at what modifications I'd need to make the functions affecting registration, changing password, changing username, changing email address... ideally i'd love to just share username, password and email address, and nothing else. Much to do. |
#51
|
|||
|
|||
Hello
I´am very intersted in this modification, but there is no howto. Please explain the implementation of this mod. Where do i put the code in the class_core.php, btw. in which line ? thx Flo |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|