Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Share users database among many forums Details »»
Share users database among many forums
Version: 0.10, by mangel.ajo mangel.ajo is offline
Developer Last Online: May 2012 Show Printable Version Email this Page

Category: Major Additions - Version: 3.7.2 Rating:
Released: 07-10-2008 Last Update: 07-12-2008 Installs: 61
Re-useable Code Code Changes Translations Is in Beta Stage  
No support by the author.

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))
                {
You can add "session" to $shared_tables if you want to share your sessions among forums under the same domain (Thanks Lionel)

This is only useful for new forums joining anothers one user database.

Requirements:
  • An old forum where all users are.
  • Sharing the same database, using diferent prefixes for tables (TABLE_PREFIX)
For example: Imagine we have FORUM_A , FORUM_B, and FORUM_C each one with their respective licenses.

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:
  • memcached issues?, not sure
  • avatar/signature pics/etc issues when storage is set to disk.
  • more to come...


Author: Optimizacion Web

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #132  
Old 05-18-2010, 04:01 PM
DragonMasterNYC's Avatar
DragonMasterNYC DragonMasterNYC is offline
 
Join Date: Jul 2007
Location: Bronx NY
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #133  
Old 06-04-2010, 09:02 PM
Wilfred1 Wilfred1 is offline
 
Join Date: Jul 2009
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #134  
Old 06-05-2010, 11:18 PM
Wilfred1 Wilfred1 is offline
 
Join Date: Jul 2009
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In 4.0.3 I noticed that the code:
Code:
$this->querycount++;
is in 2 places in the class_core.php file so do you add this mod after both instances?
Reply With Quote
  #135  
Old 06-08-2010, 07:05 PM
vitoreis vitoreis is offline
 
Join Date: Nov 2005
Location: Portugal
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DragonMasterNYC View Post
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.
Thank you for your work! Continue to share all whis us, please.
Reply With Quote
  #136  
Old 06-14-2010, 03:07 PM
DragonMasterNYC's Avatar
DragonMasterNYC DragonMasterNYC is offline
 
Join Date: Jul 2007
Location: Bronx NY
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #137  
Old 07-03-2010, 12:11 AM
kawe kawe is offline
 
Join Date: Aug 2008
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fixed :d
Reply With Quote
  #138  
Old 05-19-2011, 08:16 PM
DeardsGlobal DeardsGlobal is offline
 
Join Date: Aug 2010
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04442 seconds
  • Memory Usage 2,284KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete