vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Major Additions - Share users database among many forums (https://vborg.vbsupport.ru/showthread.php?t=185021)

rsuplido 08-04-2008 12:48 AM

Quote:

Originally Posted by mangel.ajo (Post 1589085)
Uhh, I have to check that.

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?

It seems like when it is set to FULLSEARCH it doesn't work. I decided to use the key words option and it works now.

ps2wiz 08-04-2008 01:12 AM

Quote:

Originally Posted by rsuplido (Post 1590847)
Store the avatars back to the database and add 'customavatar' to the list.

Thank you very much, that did the trick. :)

lovevn 08-04-2008 01:28 AM

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)

mangel.ajo 08-04-2008 06:54 AM

Quote:

Originally Posted by ps2wiz (Post 1590838)
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.

Yes, that's one of the things that cannot be used with this patch "directly"

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)

mangel.ajo 08-04-2008 06:56 AM

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? :)


Quote:

Originally Posted by lovevn (Post 1590865)
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)


lovevn 08-04-2008 09:04 AM

Quote:

Originally Posted by mangel.ajo (Post 1590990)
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? :)

Hello
Thanks for your reply.
Both forums are running the same ecodeing. However, in my main board
I turn this off

Quote:

$config['Mysqli']['charset'] = 'utf8';
And on my slave board(which is vbulletin chinese version) it is on.

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

ps2wiz 08-04-2008 09:41 PM

Quote:

Originally Posted by mangel.ajo (Post 1590988)
Yes, that's one of the things that cannot be used with this patch "directly"

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)

Yeah, I just transferred them back into the database and added "customavatar" to the list of shared tables.

I also let people host their signature pics on my forum. So I also added "sigpic" to the list of shared tables.

ps2wiz 08-19-2008 03:02 AM

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 :)

Zate 08-26-2008 02:09 AM

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.

z4media 09-02-2008 01:54 PM

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

mayanks 09-04-2008 10:42 AM

thanks for it...could you please provide a small tutorial on how to do it?

Amenadiel 09-05-2008 02:45 AM

a little question: I believe the password's salt is based on the forum's license string. ¿Why doesn't this affect this mod?

Amenadiel 09-05-2008 02:51 AM

Quote:

Originally Posted by z4media (Post 1612798)
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

Quote:

Originally Posted by mayanks (Post 1614291)
thanks for it...could you please provide a small tutorial on how to do it?



1.- open includes/class_core.php

2.- find
Code:

$this->querycount++;
(should be line 406)

3.- after that, add
Code:

              $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);

              }

4.- save and close file, upload if you need to

Quarterbore 09-16-2008 07:12 PM

Now that was a nice short tutorial :D

Would this work with two different versions of vBulletin? Say for example a 3.6.x and a 3.7.x site?

I assume that this would not cause major impacts with upgrading as long as we remember to update the core file again?

I wonder what the chances are that vBulletin could do something as a standard feature in vBulletin as I always wondered what the master and slave setting were for in the config.php file but honestly I never really had the time to investigate.

I will have to look at this code more and give it a try on one of my test boards and if it works I may need to buy some more vBulletin licenses!

King Justice 09-26-2008 11:40 AM

Hi there. :)

Is this working on the latest version of vB? This will work with two different databases right, basically sharing one database's vB users?

Kaelon 10-02-2008 07:08 AM

If I also wanted to share my Who's Online data (so that users showing up as logged in on one forum also appear as logged in on the other), is there anything I should be concerned about before just sharing those tables?

myown 10-02-2008 08:17 AM

great hack will use at some point.

chikkoo 11-10-2008 05:45 AM

I have been looking for such a mod to merge my two forums database, I will give a try and let everyone know the performance.

gibgib 11-11-2008 08:21 AM

I've read this thread 4 times, all 4 pages & I can't seem to get the slave board to grab anything from the main.
The main forum has no prefix in it's tables so I have used the following:

Code:

$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 = "";
              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);

$main_prefix = "";
I also tried
$main_prefix = ".";
&
$main_prefix = " ";

The new forum has yf_ as prefix which I had entered into the config.php before install.
Same database.
Is there a setting within the config.php that could be affecting the class_core.php mod?
I'm refreshing the member list on the new forum to check it's working. I should see it go from 1 member to 12,447 members to mirror the main forum right?

merk_aus 11-16-2008 11:15 AM

i have the same problem my main forum does not use table prefix what can we edit to have it so that members can log into the second board - all i would like is the users shared nothing else.

Please anyhelp would be appreciated.

gibgib 11-17-2008 07:23 AM

Still not resolved.
Is there an easy & non destructive way to add prefixes to the start of all unprefixed tables?
Some of the tables on the main forum are prefixed but like mw_ for media wiki, so a script needs to be variable.

kderentz 11-20-2008 06:03 PM

Is this the only Mod to do this? Anyone offer a commercial one with full support similar to how VBSEO does for search opt?

merk_aus 11-24-2008 03:32 AM

Wow,
I got it to work within like ten minutes by reading all five pages and getting everyones input.

Thanks for a great hack this is what I have been looking for and it works perfectly.

gibgib 11-24-2008 03:42 AM

Do you have prefixes on the main db?

J105C 11-29-2008 05:46 AM

Quote:

Originally Posted by TraumTeam (Post 1583028)
Is this the project to run several different Forums (search, new Thread, Categories...) but with the same userdatabase and login?

I requestet this about 5 years ago in vbulletin support forum and i got the answer, that this wont work....

You know vbulletin will deny A LOT of features and functionality to simply keep the trend of requests down. They have denied sharing personal pictures and even the use of attachments very early in their game. Nothing is impossible ;)

maidos 11-29-2008 08:40 AM

when you share the usertable, will the vb featurees like avatars stop working on all forum or just the forum B that is sharing the usertable with from the forum A

maidos 11-29-2008 10:29 AM

also if i share the usertable will the usergroup be the same as forum A ?
and where do i paste that patch, on forum A or forum B?

kderentz 12-03-2008 12:13 AM

Quote:

Originally Posted by merk_aus (Post 1671741)
Wow,
I got it to work within like ten minutes by reading all five pages and getting everyones input.

Thanks for a great hack this is what I have been looking for and it works perfectly.

+1


Also guys my main DB does NOT have prefixes .... I just used this:

Code:

              $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 = "";
              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);

              }

and it worked fine. My avatars are not showing up but Im guessing its because they are probably set to store in files not the DB :D

kderentz 12-03-2008 12:15 AM

Quote:

Originally Posted by maidos (Post 1675087)
and where do i paste that patch, on forum A or forum B?

Check this out for the How To:

https://vborg.vbsupport.ru/showpost....1&postcount=53

put it in the class_core.php on the 2nd, 3rd, 4th, ect forums. Leave the class core on the main forum whos user database your using alone.

maidos 12-05-2008 07:00 AM

thanks for the reply =)
now im wondering if this support mysql 5.1.30

gibgib 12-05-2008 09:46 AM

Got it to work!!

This mod WILL NOT work if you have the database type on the subsequent forums set to 'mysqli' in the config.php. Change it to 'mysql'.
Hope that saves some pulling of hair out of your noggin :)

kderentz 12-05-2008 03:45 PM

Hey guys ... running into an issue now ...

On the test site I have the Avatars set to the DB, but they still are not showing up.

2nd thing is I started to build the live site and have the patch set up, however unlike the the test site the Reg. User count isnt updating when someone registers, will it only do that when some reg on site B? should I set up a cron job just to update counters once a day?

gibgib 12-06-2008 06:22 AM

Quote:

Originally Posted by kderentz (Post 1679113)
Hey guys ... running into an issue now ...

On the test site I have the Avatars set to the DB, but they still are not showing up.

2nd thing is I started to build the live site and have the patch set up, however unlike the the test site the Reg. User count isnt updating when someone registers, will it only do that when some reg on site B? should I set up a cron job just to update counters once a day?

Can help with the first Q....
You need to add "customavatar", to your array list.

maidos 12-06-2008 03:26 PM

my main forum doesnt have prefix so what should i do

kderentz 12-07-2008 01:22 AM

Quote:

Originally Posted by maidos (Post 1679652)
my main forum doesnt have prefix so what should i do

Check out my posts above

kderentz 12-07-2008 01:24 AM

Quote:

Originally Posted by gibgib (Post 1679490)
Can help with the first Q....
You need to add "customavatar", to your array list.


Thank ... ill look into that.

maidos 12-07-2008 09:27 AM

Quote:

Originally Posted by kderentz (Post 1679967)
Check out my posts above

did check but i get database error that way

my second forum got prefix fb_

kderentz 12-08-2008 06:01 PM

Quote:

Originally Posted by maidos (Post 1680128)
did check but i get database error that way

my second forum got prefix fb_

If you have no prefix in Forum A .... and Forum B has the prefix "fb_" then you simply set it to:

Code:

$main_prefix = "";
^make sure the quote marks have no spaces .. it really doesn't matter what Forum B, C, D, ect prefixes are as you only need to set the prefix for the forum whom user database your using.

kderentz 12-08-2008 06:02 PM

Quote:

Originally Posted by gibgib (Post 1679490)
Can help with the first Q....
You need to add "customavatar", to your array list.

That worked thanks!

Also it looks like the user count will update when someone posts :up:

maidos 12-08-2008 08:27 PM

Quote:

Originally Posted by kderentz (Post 1681123)
If you have no prefix in Forum A .... and Forum B has the prefix "fb_" then you simply set it to:

Code:

$main_prefix = "";
^make sure the quote marks have no spaces .. it really doesn't matter what Forum B, C, D, ect prefixes are as you only need to set the prefix for the forum whom user database your using.

thats what i did, not working :(


All times are GMT. The time now is 01:05 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03115 seconds
  • Memory Usage 1,849KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete