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 |
#32
|
|||
|
|||
I've used the the view method suggested in the past by Sir Adrian.
The only issue I had was with PM's since we wanted to keep them separate between the forums, and the user table stored the stats for that. So now I'm working on that issue. |
#33
|
|||
|
|||
if you had the sites on the same hosting. couldn't you make cookies sub-domain based? and treat the other site as the same session? also, i notice you can't pm members or the avatars aren't carrying over. and its db based file storage
|
#34
|
|||
|
|||
Thanks for this hack.
Ok, I guess this should work if avatars are stored in the database instead of files, but for some reason, in User CP, 'Do not use an avatar' is checked instead of 'Use Custom Avatar.' Which table holds that setting? ETA: Ok, found it -- just add the 'customavatar' table to the list. |
#35
|
|||
|
|||
Ok, I have a quick question, I have a old user back up from a forum I had a year ago, can I use this to revert data bases in a way I can use the old emails to the new forum?
Can I do this? |
#36
|
|||
|
|||
Hmm, for some reason, I can't perform searches... It always returns 'no matches'...
|
#37
|
|||
|
|||
Anyone make this work when your board does not use a pfefix for you database?
|
#38
|
|||
|
|||
Quote:
but the new forums that you add, which will use the main user database should have prefixes, and should be new forums, you cannot join old forums with their own user databases. |
#39
|
|||
|
|||
Quote:
For me it's working: If I search here for "pruebecita" it works http://www.economiahoy.es/foro/search.php this forum is using the user database from: http://www.foropymes.es/foro/ Could you give some details of your problem? |
#40
|
|||
|
|||
I got it up and running and every thing seems to function perfect besides one thing.
I store my avatars on disk (file system) instead of the database storage. Anyone know how to properly link this? I am scratching my head on this, as avatars do not show up. |
#41
|
|||
|
|||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|