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 |
#132
|
||||
|
||||
I haven't tried yet with the cookies, considering what my aim is for this mod.
"cron" can be shared is you want the same scheduled tasks to run on all sites when active. Also "phrase","language","templateedit","templateeditlo cation" can be added if you want to share template modifications between sites with the Template Modification System. I would advise people to not share "styles" between sites since you would need to reorder each commercial style to use on each slave site. Also don't share any product info ("product","productcode","productdependency") since some forums might have cms/blog which are vB Suite only with vB Forums since vBulletin will most likely ask you to buy or upgrade to suite for the slave sites. Ony way to really share products in my mind is to make sure all slave sites pay for the exact same type of vB license and also pay for any paid modifications the master site has. I'm trying my best to stick to the terms in the licensing for vBulletin and other products associated with it so people don't get shutdown notices from anyone. Right now I'm only testing 2 sites locally and 1 at a remote location to make sure all the connections are working properly. I'm having users randomly generated to simulate users registering on the different sites and also simulate activity on the sites to make sure the scheduled tasks run normally so that when a new user registers all sites update their new user info and user count. I will be making a newuser.php cron job just to update the user counts now I have it set to 10 min intervals right now, but I'm sure it would be better to use more like 20, 30 or 60 min intervals on live forums. |
#133
|
|||
|
|||
I have a few urgent questions that I hope someone can answer for me.
If I have one domain site setup with: root (home page) root/forum1 root/forum2 root/forum3 root/custom_avatars root/profile_pics etc All the above use the same db with the different prefixes used as per this mod. Will this mod work ok? What would be the limitations? Could users login on one forum or home page and be logged in on all forums? Would this setup require extra vb licenses? Thanks for you help |
#134
|
|||
|
|||
In 4.0.3 I noticed that the code:
Code:
$this->querycount++; |
#135
|
|||
|
|||
Quote:
|
#136
|
||||
|
||||
No problem, I've been trying to do this for a years. I started a site just for this and then took it down since no one wanted to help. Right now my partner is the only one willing to help on this project since he can see the potential of it.
As of now I'm still working on a better solution for this project since in some cases like the usergroups table we just want to share rows of info instead of the whole table. |
#137
|
|||
|
|||
Fixed :d
|
#138
|
|||
|
|||
I'm working on building a network of gaming forums and I think this would work perfect. I'm just making sure though.
I have two game forums. With this I could pretty much bridge them together so that a user registers on either forum and post on both? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|