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 |
#102
|
|||
|
|||
none whatsoever. I only added sessions since the 2 forums are on same site so there was no need to re-login
|
#103
|
|||
|
|||
Im using 3.8.2, installed and worked like a charm the first time!
Thanks!! |
#104
|
|||
|
|||
Quote:
MIne show registered users fine! What I dont see is the current only users, I would like to be able to show it. |
#105
|
|||
|
|||
I would love to use this but I would have to be very caution when upgrading. Once I go down this road I would build the functioanlity of the site around the idea of a single login ability ... sign-up for one site and you're a member to all sites. Not sure what to think about that actually.
|
#106
|
|||
|
|||
Quote:
Quote:
|
#107
|
|||
|
|||
Quote:
Just add the "session" table to the list of shared tables. |
#108
|
|||
|
|||
Quote:
Quote:
ALSO, I do not want to share the avatars or profile pictures. I removed both the "avatar","profilefield" from the list of shared tables, still avatars and profile pictures are getting affected. Both websites have custom avatars set to use DISK, not DB, but when you change the avatr in one website, it affects the avatar in the other website. Can somebody explain me how to fix this? AND the users signatures too, I dont want to share the signatures, is there any way to avoid it? Thanks! UPDATE: A "fix" for the avatar/picture profile issue, is to have the avatars in the "forumB" set to use DB storage. Even when it do not makes sense to me why the problem was happening if I removed the "avatars" table from the shared table list. |
#109
|
|||
|
|||
Quote:
This is because that info is coming from the datastore which is not shared by the 2 installs, and is not recommended to share. When you update the counter, you just rebuild the datastore for the appropriate forum. But that could be a pain to do once in a while .... |
#110
|
|||
|
|||
you could also try to create a plugin at forumhome_start and put this in it (will add a query)
PHP Code:
|
#111
|
|||
|
|||
Could anybody help with my questions?
Thanks |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|