bookmark.php Favorites Bookmark this page to Reddit Share this page on Twitter Bookmark this page to Delicious Bookmark this page to Facebook Bookmark this page to StumbleUpon More bookmarks

Shopping


Community




Discuss about website design tools and programs.
 April 18 2010

How to set up one user database for multiple phpBB forums?


kwok

Exclusive member

User Avatar


Reputation:
Medals: 1 
March 2010 (1)

 Joined: January 2010
 Country: United States (us)
 Location: WWW
 Posts: 144
Member Blog: View Blog (0)
Invitations sent: 0
Successful invitations: 0

F$: 2,465,871.00
Bank: 1,000.00
Instant Play Lottery Ticket Username - Black Post Count +100 Beer Gold Medal Silver Medal Gold Star Silver Star




Using this tip, you will be able to share a user database for multiple phpBB forums with common banlist, disallow, groups, private messages, ranks, sessions, smilies, themes and users.

Step 1 Install a new phpBB forum with any prefix (i.e. using the default phpbb_).

Step 2 Remove the prefixes from the following tables:

banlist
disallow
groups
privmsgs
ranks
sessions
sessions_keys
smilies
styles_theme
user_group
users
words

You can do this easily with phpMyAdmin:
Code: Select all
ALTER TABLE phpbb_banlist RENAME banlist;
ALTER TABLE phpbb_disallow RENAME disallow;
ALTER TABLE phpbb_groups RENAME groups;
ALTER TABLE phpbb_privmsgs RENAME privmsgs;
ALTER TABLE phpbb_ranks RENAME ranks;
ALTER TABLE phpbb_sessions RENAME sessions;
ALTER TABLE phpbb_sessions_keys RENAME sessions_keys;
ALTER TABLE phpbb_smilies RENAME smilies;
ALTER TABLE phpbb_styles_theme RENAME styles_theme;
ALTER TABLE phpbb_user_group RENAME user_group;
ALTER TABLE phpbb_users RENAME users;
ALTER TABLE phpbb_words RENAME words;


Step 3 Install a second copy of phpBB in the same database, but this time, you should use a new prefix (i.e. sitename_).

Step 4 Open the file includes/constants.php for both installed phpBB forums. Remove every $table_prefix in the following lines:
Code: Select all
    // Table names
    define('BANLIST_TABLE', $table_prefix.'banlist');
    define('DISALLOW_TABLE', $table_prefix.'disallow');
    define('GROUPS_TABLE', $table_prefix.'groups');
    define('PRIVMSGS_TABLE', $table_prefix.'privmsgs');
    define('RANKS_TABLE', $table_prefix.'ranks');
    define('SESSIONS_TABLE', $table_prefix.'sessions');
    define('SESSIONS_KEYS_TABLE', $table_prefix.'sessions_keys');
    define('SMILIES_TABLE', $table_prefix.'smilies');
    define('STYLES_THEME_TABLE', $table_prefix.'styles_theme');
    define('USER_GROUP_TABLE', $table_prefix.'user_group');
    define('USERS_TABLE', $table_prefix.'users');
    define('WORDS_TABLE', $table_prefix.'words');

to become something like this:
Code: Select all
    // Table names
    define('BANLIST_TABLE', 'banlist');
    define('DISALLOW_TABLE', 'disallow');
    define('GROUPS_TABLE', 'groups');
    define('PRIVMSGS_TABLE', 'privmsgs');
    define('RANKS_TABLE', 'ranks');
    define('SESSIONS_TABLE', 'sessions');
    define('SESSIONS_KEYS_TABLE', 'sessions_keys');
    define('SMILIES_TABLE', 'smilies');
    define('STYLES_THEME_TABLE', 'styles_theme');
    define('USER_GROUP_TABLE', 'user_group');
    define('USERS_TABLE', 'users');
    define('WORDS_TABLE', 'words');


Step5 Login to the Administrator Control Panel (ACP) for both phpBB forums. Set up the cookie settings (General tab -> server configuration -> Cookie settings) and make sure that the cookie settings are the same for both forums.

Step6 Test it out. Register a new user account on the first phpBB forum and then go to the second forum to see if the account exist there. If it does, all should be working.

Step7 (optional) Delete the unused tables of the second installs (for each additional site, repeat this step): 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 do not remove any tables without a prefix because they are the common tables for all forums.
To do this easily, open phpMyAdmin and execute this code:
Code: Select all
DROP TABLE sitename_banlist;
DROP TABLE sitename_disallow;
DROP TABLE sitename_groups;
DROP TABLE sitename_privmsgs;
DROP TABLE sitename_ranks;
DROP TABLE sitename_sessions;
DROP TABLE sitename_sessions_keys;
DROP TABLE sitename_smilies;
DROP TABLE sitename_styles_theme;
DROP TABLE sitename_user_group;
DROP TABLE sitename_users;
DROP TABLE sitename_words;


Note: Since the forums are not sharing 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 shared the templates should be as well). 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.
Last edited by eurlsadmin on April 18 2010, edited 3 times in total.
 

Related Threads

Last Post By


How to change the rank of a user in phpBB?


  Started by kwok on March 25 2010
kwok
on March 25 2010 Go to last post
   Replies: 0    Views: 77

Best phpBB Mods


  Started by kwok on March 18 2010
kwok
on March 18 2010 Go to last post
   Replies: 0    Views: 97

How to disable phpBB users from "hidden" online status?


  Started by kwok on March 26 2010
kwok
on March 26 2010 Go to last post
   Replies: 0    Views: 140
Display Options (This thread contains 1 post) Currently Active Users Viewing This Thread
Posted Time Order By Sort By

No registered users and 1 guest

 
 Posting Rules

You cannot post new threads in this forum
You cannot reply to threads in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum





cron