Log in Register FAQ Memberlist Search Welcome to RCF - WHF Forum Index
alt : test.swf
Welcome to RCF - WHF
4fx3.gif 
Contact the Webmasters of RCFContact   Invite a friend to Join usRecommend   Chat in IRCChat   EZ Template Change OptionEZStyle   Listen to Internet Radio while you browse...iRadio   See your private message.Login for PMs   Important LinksLinks
Member Website LinksWeb Links   Play/View our GamesGames   Register.Register
calendar_open_closeCalendar 
Multiple forums sharing a user database
Post new topic   Reply to topic View previous topic :: View next topic
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support Add To Bookmarks
Multiple forums sharing a user database
PostPosted: 08/17/2006 11:00 PM Reply with quote
Citation
KeeKee
Citation
Posts 940
Word Cnt. 48,215
BDay Mar 4
Sign Pisces
Sex Sex:Female
Joined: Mar 20, 2006
Local time: 6:22 AM
usaCa.gif
Well I've decided exactly which route I'm taking with my boards so I'm diving in to start adding mods I've found I want to use. (Security first) then some nice things sans styles I'll just stick with subsilver.  Have everything laid out in a flow chart.  But before I do all that.....

I'm going to share the database among all boards, Home-n-family will be the board all points to.

I figure the easiest way for me is to use the find and replace used here
http://www.phpbb.com/kb/article.php?article_id=55

One minor thing I will change back to the original line is the banlist.
I don't want to share the ban feature would rather be able to ban someone from one board but still let them on others.

My question is the banlist the line that needs to be kept original? or is there more than one line that needs to be kept original?

The tricky part for me will be removing the unused tables afterwards esp with the slight changes but I know me,   I can't stand things taking up space that are not being used.

Is there any other feature there that it is best to Not Share?
Back to Top
View user's profile Find all posts by KeeKee Send private message   Visit poster's website Yahoo Messenger Phoogle Map ICQ Number
Re: Multiple forums sharing a user database
PostPosted: 08/17/2006 11:28 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30756
Word Cnt. 2,628,678
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 7:22 AM
Location: St Pete, FL
peace.gif
I have thought about bridging more than one database together because of the 100 MB size limit for databases.  But I really don't know anything about sharing tables between phpBB boards.  I was hoping that your link would explain it a bit, but the link isn't working for me.  Could you check it to see if you provided the correct link???

dontknow
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: Multiple forums sharing a user database
PostPosted: 08/18/2006 8:32 AM Reply with quote
Citation
KeeKee
Citation
Posts 940
Word Cnt. 48,215
BDay Mar 4
Sign Pisces
Sex Sex:Female
Joined: Mar 20, 2006
Local time: 6:22 AM
usaCa.gif
Hummm went stratight to it for me.  I don't know what the disallow is maybe a part of the ban thing.
dontknow
C&P's from that link.  There is another pl;ace that tells you how to change just the ones you want but cannot find it. I want most changed just a couple not.

There is various means to share a user database over multiple boards. Please note this is only one method and can be altered easily depending on what you want sharred. This method will result in the banlist, disallow, groups, private messages, ranks, sessions, smilies, themes and users all being sharred. We will assume you are doing a fresh install, but if this isnt the case just make the forum you currently have the one that you use to base all future tables on. Make sure you also have a copy of phpMyAdmin installed.

Step 1) Install a fresh copy of phpbb as usuall with any prefix.

Step 2) Open phpMyAdmin and remove the prefix from the following tables:
banlist
disallow
groups
privmsgs
privmsgs_text
ranks
sessions
sessions_keys
smilies
themes
themes_name
user_group
users
words

Step 3) Install a fresh copy of phpBB in the same database using a new prefix.

Step 4) Open the includes/constants.php file for the first installed board and replace

original code
Code:

// Table names
define('AUTH_ACCESS_TABLE', $table_prefix.'auth_access');
define('BANLIST_TABLE', $table_prefix.'banlist');
define('CATEGORIES_TABLE', $table_prefix.'categories');
define('CONFIG_TABLE', $table_prefix.'config');
define('DISALLOW_TABLE', $table_prefix.'disallow');
define('FORUMS_TABLE', $table_prefix.'forums');
define('GROUPS_TABLE', $table_prefix.'groups');
define('POSTS_TABLE', $table_prefix.'posts');
define('POSTS_TEXT_TABLE', $table_prefix.'posts_text');
define('PRIVMSGS_TABLE', $table_prefix.'privmsgs');
define('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text');
define('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore');
define('PRUNE_TABLE', $table_prefix.'forum_prune');
define('RANKS_TABLE', $table_prefix.'ranks');
define('SEARCH_TABLE', $table_prefix.'search_results');
define('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist');
define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch');
define('SESSIONS_TABLE', $table_prefix.'sessions');
define('SESSIONS_KEYS_TABLE', $table_prefix.'sessions_keys');
define('SMILIES_TABLE', $table_prefix.'smilies');
define('THEMES_TABLE', $table_prefix.'themes');
define('THEMES_NAME_TABLE', $table_prefix.'themes_name');
define('TOPICS_TABLE', $table_prefix.'topics');
define('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch');
define('USER_GROUP_TABLE', $table_prefix.'user_group');
define('USERS_TABLE', $table_prefix.'users');
define('WORDS_TABLE', $table_prefix.'words');
define('VOTE_DESC_TABLE', $table_prefix.'vote_desc');
define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results');
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');


with

replacement code
Code:

// Table names
define('AUTH_ACCESS_TABLE', $table_prefix.'auth_access');
define('BANLIST_TABLE', 'banlist');
define('CATEGORIES_TABLE', $table_prefix.'categories');
define('CONFIG_TABLE', $table_prefix.'config');
define('DISALLOW_TABLE', 'disallow');
define('FORUMS_TABLE', $table_prefix.'forums');
define('GROUPS_TABLE', 'groups');
define('POSTS_TABLE', $table_prefix.'posts');
define('POSTS_TEXT_TABLE', $table_prefix.'posts_text');
define('PRIVMSGS_TABLE', 'privmsgs');
define('PRIVMSGS_TEXT_TABLE', 'privmsgs_text');
define('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore');
define('PRUNE_TABLE', $table_prefix.'forum_prune');
define('RANKS_TABLE', 'ranks');
define('SEARCH_TABLE', $table_prefix.'search_results');
define('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist');
define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch');
define('SESSIONS_TABLE', 'sessions');
define('SESSIONS_KEYS_TABLE', 'sessions_keys');
define('SMILIES_TABLE', 'smilies');
define('THEMES_TABLE', 'themes');
define('THEMES_NAME_TABLE', 'themes_name');
define('TOPICS_TABLE', $table_prefix.'topics');
define('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch');
define('USER_GROUP_TABLE', 'user_group');
define('USERS_TABLE', 'users');
define('WORDS_TABLE', 'words');
define('VOTE_DESC_TABLE', $table_prefix.'vote_desc');
define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results');
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');


Step5) Repeat this last step for the second board

Step6) Go to the install location of the board and configure it through the admin panel, also do this for the second board, making sure both boards have the same cookie settings. Since the boards aren't sharring the same configuration you can give each different settings and can set the default theme for each board to a unique one and override the users preference (since users info is sharred the templates should be aswell). Also you will only have to upload one avatar directory and not two if you set the links to the avatar directory correctly, saving some valuable space.

Step7) It should be working now. Register a new account on one board and then go to the other to see if the account exist there. If it does all should be working.

Post Setup Step (optional): If you want to you can now go back and remove any redundant tables. These will be the ones listed in step two that were made from the second install. however it is probably easier to simply leave them there. make sure you dont remove the tables without a prefix though as they are needed.

Updates: 12/12/2005 - Anon - 2.0.18
Back to Top
View user's profile Find all posts by KeeKee Send private message   Visit poster's website Yahoo Messenger Phoogle Map ICQ Number
Re: Multiple forums sharing a user database
PostPosted: 08/18/2006 5:20 PM Reply with quote
Citation
KeeKee
Citation
Posts 940
Word Cnt. 48,215
BDay Mar 4
Sign Pisces
Sex Sex:Female
Joined: Mar 20, 2006
Local time: 6:22 AM
usaCa.gif
Here is the other one I was looking for.  there is one line in step 6 that may be the answer to my banning question.

(  Banning and configuration options can be set for each forum seperately. )  I'm still not sure that means I can ban someone off of one forum/board  while they can still log onto others.

So, you'd like your forums to share the user database.
There have been a lot of posts about this topic before, but I think (judging from the amount of questions we still get) a tutorial is a good idea.

Here it goes. The process is pretty easy.

1) You'll have to install all boards into seperate directories and preferrably in the same database, using different table prefixes (I will use master, slave1, slave2, ..., slaveN).

2) Designate one board as the MASTER install, this one will act as the user-database for all other forums. The rest will be called SLAVES from now.

3) For consistency, rename the MASTERS shared tables to not use the prefix (using a tool like phpMyAdmin f.i.):
Code:
ALTER TABLE master_users RENAME users;
ALTER TABLE master_user_group RENAME user_group;
ALTER TABLE master_groups RENAME groups;


4) Delete the unused tables of the SLAVE installs (for each slave repeat this step):
Code:
DROP TABLE slave1_users;
DROP TABLE slave1_user_group;
DROP TABLE slave1_groups;


5) Change for all installs (MASTER and SLAVES) the entries in includes/constants.php to (remove the $table_prefix):
Code:
define('GROUPS_TABLE', 'groups');
define('USER_GROUP_TABLE', 'user_group');
define('USERS_TABLE', 'users');


6) You're done. All your forums are now using the same user database. Banning and configuration options can be set for each forum seperately. If you want people logged in on one forum be logged in in another forum, all you need to do is make sure the cookie settings in the admin panel are the same. All forums have to use the same domain, but they can differ in subdomains (f.i. forum1.mydomain.com will have mydomain.com as the domain for cookies).
Back to Top
View user's profile Find all posts by KeeKee Send private message   Visit poster's website Yahoo Messenger Phoogle Map ICQ Number
Re: Multiple forums sharing a user database
PostPosted: 08/19/2006 1:45 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30756
Word Cnt. 2,628,678
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 7:22 AM
Location: St Pete, FL
peace.gif
Just remember that if you tie several boards together, that if you plan to install any new MODs that alter your database, you will need to remove the table prefix from the tables taht are shared.  Otherwise you could end up with a mess...

Shocked
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: Multiple forums sharing a user database
PostPosted: 08/19/2006 6:33 AM Reply with quote
Citation
KeeKee
Citation
Posts 940
Word Cnt. 48,215
BDay Mar 4
Sign Pisces
Sex Sex:Female
Joined: Mar 20, 2006
Local time: 6:22 AM
usaCa.gif
Ur saying that if the mod adds something to a table that is shared it will put the prefix back in?

Maybe I have the cart before the horse,  maybe all mods should be in first then do the sharing?
Back to Top
View user's profile Find all posts by KeeKee Send private message   Visit poster's website Yahoo Messenger Phoogle Map ICQ Number
Re: Multiple forums sharing a user database
PostPosted: 08/19/2006 1:10 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30756
Word Cnt. 2,628,678
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 7:22 AM
Location: St Pete, FL
peace.gif
Many MOD scripts include a SQL section that would update your database.  The phpbb_ part is almost always hardcoded.  So you will have to edit the MOD script and remove the phpbb_ prefix from any tables that don't have it.  I doubt that the DB Update files will be able to figure it out either.  They assume that all the tables use the table prefix listed in your config.php file.  So they will probably fail when they try to update a table that doesn't have a phpBB prefix on it, or if you leave the unused tables in your database, they will make the changes to the wrong tables.  That could be an annoying and recurring problem that you will have to address on every MOD you plan to install...

munky2
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: Multiple forums sharing a user database
PostPosted: 08/19/2006 6:24 PM Reply with quote
Citation
KeeKee
Citation
Posts 940
Word Cnt. 48,215
BDay Mar 4
Sign Pisces
Sex Sex:Female
Joined: Mar 20, 2006
Local time: 6:22 AM
usaCa.gif
O.K.  I get it.   I'm not a coder so that could create a real problem for me.

But I am going to go put that question up on phpbb and see what comes back.  It did look too easy.

Well darn....Guess I'll go ahead and start on the mods I want to put in for the security.
Back to Top
View user's profile Find all posts by KeeKee Send private message   Visit poster's website Yahoo Messenger Phoogle Map ICQ Number
 Post new topic  Reply to topic
Information
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
All times are GMT - 5 Hours

Page 1 of 1


Add To Bookmarks

 
  
  


  Google

Powered by phpBB © 2001, 2005 phpBB Group
  ImageShack  
  Putfile  
  TinyURL  
  CommonDreams  
  Log in  

Page generation time: 0.1582s (PHP: 84% - SQL: 16%) - SQL queries: 55 - GZIP enabled - Debug on