PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 Multiple forums sharing a user database 
Description: Use multiple forums sharing a user database. Also will share avatars, private messages, groups and themes.
Author: smigit
Date: Sat Feb 01, 2003 3:13 am
Type: HowTo
Keywords: multiple, users, database, install, sharring, sharing, share
Category: MODifications
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

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.