• is it possible to make different blogs access a single user table? if so, anyone wanna share?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Install WordPress into as many folders as you want blogs. Then, when creating the wp-config.php file, you would use all of the same database name, user name, and password for all. To make each blog unique in the database, you would change, in the wp-config.php file, the table prefix for each blog.
    By default, the table prefix is wp_, so you could have blog1_, blog2_, blog_3, etc.
    So, three blogs=three installs=three wp-config.php that have the same login and database, but each has its own unique prefix.
    HTH.

    hmm. the replies to this were lost.
    allusion, can you explain how you did this?
    i’m assuming you changed the line
    $tableusers = $table_prefix . ‘users’;
    to
    $tableusers = ‘wp_users’
    or something like that?

    ryoken, I just manually modified the $tablesettings in different installations.

    what files do i have to change?
    <– newb

    bump?

    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).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘multiple blogs, single user table’ is closed to new replies.