single user table, multiple blogs
-
I have 6 blogs that I would like to have share a single user database that will allow them to login simultaneously and only create one user name and login password.
After looking through the forums, I tried these instructions posted a few years ago, but it was not successful in doing what I want:
I use just the same setup, since I run an English and a German blog, and didn’t want to maintain two sets of users.
The table names are set in wp-settings.php, by concatenating the table prefix from wp-config.php and the table-specific names.
In my case, I first configured my English blog, with a table prefix of “wp_wnp_en_”, and created a number of users.
Then I configured my German blog with a table prefix of wp_wnp_de, and AFTER RUNNING INSTALL, I made the following changes:
1. In the wp-config.php file for the German blog I added this line under the line setting the table prefix:$tableusers = “wp_wnp_en_users” ;
2. In the wp-settings.php file, I wrapped the line
$tableusers = $table_prefix . ‘users’;
in an if-statement which only sets it here if it hasn’t been set yet:
if ( $tableusers == “” )
{
$tableusers = $table_prefix . ‘users’;
}Two important observations:
— when setting up a new blog, DO THIS AFTER running php-admin/install.php. Otherwise install.php will bomb
on the attempt to create the already existing table.
— be aware that everyone in this usertable will have the same rights on all blogs thus modified, so this is really only good for multiple blogs run by the same person (as in my multilingual scenario).Please let me know a better way to do this.
Thank you!
~RCW
- The topic ‘single user table, multiple blogs’ is closed to new replies.