Sharing A Members Database

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Scam Warning
User avatar
cyberken
Registered User
Posts: 185
Joined: Wed Jul 27, 2005 11:51 am
Location: Edinburgh

Sharing A Members Database

Post by cyberken »

When the RC1 is released im planning on opening my full, new site at around the same time and I'm wondering how to share the members database over multiple installations.

The layout of my site will be something like this:

Main site (with main forums)
site 1 (on subdomain with own forums)
site 2 (on subdomain with own forums)
site 3 (on subdomain with own forums)
ect ect.

Im currently installing B5 on the subdomains in order to test it out but what I need is when a member signs up to one forum they automatically become members on them all.
Im not looking for the permissions to be copied as a moderator on one wont be on another.

I did find an old one I used for 2.0.x but some of the lines of code are different on phpBB3 and im useless with most lines of code.

Is this something that anyone is working on or can help me with :)
Zero Override
Registered User
Posts: 25
Joined: Mon Mar 19, 2007 10:33 am
Location: Netherlands

Re: Sharing A Members Database

Post by Zero Override »

The fastest way, not sure about the quality of it, is to change the name of the table names in includes/constants.php. Install the three forums in one database with three different prefixes. Then choose one prefix you like best! ;)

Share the users table and you're done. Not sure if you need to share the user_groups table too, perhaps you should try that on your test boards! :)
User avatar
cyberken
Registered User
Posts: 185
Joined: Wed Jul 27, 2005 11:51 am
Location: Edinburgh

Re: Sharing A Members Database

Post by cyberken »

Zero Override wrote: The fastest way, not sure about the quality of it, is to change the name of the table names in includes/constants.php. Install the three forums in one database with three different prefixes. Then choose one prefix you like best! ;)

Share the users table and you're done. Not sure if you need to share the user_groups table too, perhaps you should try that on your test boards! :)

Thanx :) there is also a part that I have to delete the prexix of some tables in phpMyAdmin - at the mo I cant make the 3 of them come together :(
Zero Override
Registered User
Posts: 25
Joined: Mon Mar 19, 2007 10:33 am
Location: Netherlands

Re: Sharing A Members Database

Post by Zero Override »

You don't have to delete the prefix. Let me explain;
  1. Install the three boards
  2. Change the includes/constants.php for two of the boards, so they use the prefix of the third board, for the users table
  3. Delete the two tables that are not being used after this modification, so you can test if it is working or not ;)
That should work, I think! :)

REMARK: "Our newest member" is stored in the config table (the user_id). That will not be shared, so it will display the newest member for each board! :)
User avatar
Raimon
Former Team Member
Posts: 12088
Joined: Tue May 30, 2006 5:31 pm
Location: Netherlands
Name: Raimon Meuldijk

Re: Sharing A Members Database

Post by Raimon »

Zero Override wrote: You don't have to delete the prefix. Let me explain;
  1. Install the three boards
  2. Change the includes/constants.php for two of the boards, so they use the prefix of the third board, for the users table
  3. Delete the two tables that are not being used after this modification, so you can test if it is working or not ;)
That should work, I think! :)

REMARK: "Our newest member" is stored in the config table (the user_id). That will not be shared, so it will display the newest member for each board! :)


When you only change your user tabel it never gone work.
You need for the correct working also the USER_GROUP table and the groups_table when you have only the user tabel its not working correctly, and you gone get some enoying errors.
But try this first out on a test environment.
Need phpBB installation, extenstions, Styles or integrate phpBB with you website?
Contact me @ www.raimon.nl for fair prices and good service!
Zero Override
Registered User
Posts: 25
Joined: Mon Mar 19, 2007 10:33 am
Location: Netherlands

Re: Sharing A Members Database

Post by Zero Override »

In my first post I wasn't sure about it...
Zero Override wrote: Share the users table and you're done. Not sure if you need to share the user_groups table too, perhaps you should try that on your test boards! :)

Now, I tested it and it doesn't work without the GROUPS-table, so you need to to share all three the tables! :)
User avatar
Raimon
Former Team Member
Posts: 12088
Joined: Tue May 30, 2006 5:31 pm
Location: Netherlands
Name: Raimon Meuldijk

Re: Sharing A Members Database

Post by Raimon »

You need also the user_group table what i have writting. on my previous message.
and acl_groups , acl_users for the users and groups (like registerd and guest etc) permissions
Need phpBB installation, extenstions, Styles or integrate phpBB with you website?
Contact me @ www.raimon.nl for fair prices and good service!
Zero Override
Registered User
Posts: 25
Joined: Mon Mar 19, 2007 10:33 am
Location: Netherlands

Re: Sharing A Members Database

Post by Zero Override »

Raimon wrote: You need also the user_group table what i have writting. on my previous message.
and acl_groups , acl_users for the users and groups (like registerd and guest etc) permissions
Since the permissions don't have to be the same for all boards, I doubt that those tables need to be shared... :roll:
User avatar
cyberken
Registered User
Posts: 185
Joined: Wed Jul 27, 2005 11:51 am
Location: Edinburgh

Re: Sharing A Members Database

Post by cyberken »

Thanks for all your help :)
Although not fully tested yet to see if everything is working right, I now have the same members (well me and test 1 and test2) registered on 2 forums - now to work on the next 6 :(

All your help is very appreciated - anything I can do for you please let me know :)
Zero Override
Registered User
Posts: 25
Joined: Mon Mar 19, 2007 10:33 am
Location: Netherlands

Re: Sharing A Members Database

Post by Zero Override »

Well, it's enough cheering for me to see that it works. You help me already, in getting to know every inch of phpBB3! ;)
User avatar
cyberken
Registered User
Posts: 185
Joined: Wed Jul 27, 2005 11:51 am
Location: Edinburgh

Re: Sharing A Members Database

Post by cyberken »

Ok sorry to be a pain again but I now have another problem :(

Due to an error I made I have uploaded the forums and installed again
I have the main site and several subdomains

I have copied:
'USER_GROUP_TABLE'
'USERS_TABLE'
'GROUPS_TABLE'
'ACL_GROUPS_TABLE'
'ACL_USERS_TABLE'
from the main forum to the others in the subdomains but they look the same and it isnt showing any test members in the memberlist on the other forums :(

what am i doing wrong?
Zero Override
Registered User
Posts: 25
Joined: Mon Mar 19, 2007 10:33 am
Location: Netherlands

Re: Sharing A Members Database

Post by Zero Override »

Did you change the names of the tables in includes/constants.php? I don't understand what you just did, to try and make it work... :?
User avatar
cyberken
Registered User
Posts: 185
Joined: Wed Jul 27, 2005 11:51 am
Location: Edinburgh

Re: Sharing A Members Database

Post by cyberken »

Zero Override wrote: Did you change the names of the tables in includes/constants.php? I don't understand what you just did, to try and make it work... :?

Hi Zero - sorry :(

I copied the info above from the main forums to the ones on the subdomains and nothing happened.
I then tried to change the table prefix to the one that is being used on the main forum and threw up error messages saing the table does not exist

I cant remember what i done to make it work at first - its giving me a headache :(
zula
Registered User
Posts: 138
Joined: Wed Mar 22, 2006 9:56 pm

Re: Sharing A Members Database

Post by zula »

i think the idea is if you add new forum to the pack, you always have to go to includes and update to new forum extension, i think thats what happened.
User avatar
Handyman`
Former Team Member
Posts: 1751
Joined: Thu Feb 03, 2005 8:44 pm

Re: Sharing A Members Database

Post by Handyman` »

I figured since I replied to this on area51, I'll just post my message here as well :)

Only for more boards, duplicate board 2 instructions but make sure each one has their own prefix.
Handyman wrote: try installing to forums into the same database with different prefixes… then on one of the forums, open the includes/constants.php and change the $table_prefix for the users, user_group and groups table to the actual table name of the users table you have in the database.

example:

board 1
  • Table Prefix phpbb_
Board 2
  • Table Prefix phpbb3_
  • Change includes/constants.php $table_prefix . 'users' to 'phpbb_users'
  • Change $table_prefix . 'user_group' to phpbb_user_group
  • Change $table_prefix . 'groups' to phpbb_groups
that should get you going in the right direction… I would be interested to hear how it works.
http://startrekguide.com My Mod Queue || 1/16/10 Display Posts Anywhere 1.2.0 RC5, Cash MOD 1.0.0 b1, MOD Version Check, AJAX Chat, SEO MOD, AJAX QR, Photo Gallery
MOD Development Manager (version 0.2.0-dev with MODX Generator)

Return to “phpBB Discussion”