Question on sharing users (7 posts)

  1. hauolinaaupono
    Posted 7 years ago #

    I have developed a site for my boss. It's located at http://www.ralphmoorehawaii.com. I've installed 3 wordpress blogs on this site. One to use as a blog, another to use to categorize articles, and another for book reviews. We want to allow people to comment on posts, but we want them to register first. Is there a way that all 3 blogs can share the same users so that one only needs to sign-up in one area to be able to post in all areas?

    Thanks for your help on this.

  2. educationthemes
    Posted 7 years ago #

    To share user data across multiple installtions of WordPress you need to use the same database as affix different table prefizes in wp-config.php for each blog or install.

    Then you need to add these lines of code to the wordpress installs that are NOT your main install (i.e. on the ones that are the addons if you like and where people WON'T register).

    define('CUSTOM_USER_TABLE', $table_prefix.'my_users');
    define('CUSTOM_USER_META_TABLE', $table_prefix.'my_usermeta');

    Change the words my_users and my_usermeta to whatever the table prefixes are in the main install (i.e. the one were everybody registers).

    If you want to make sure that users are kept logged in to all installs when they have logged into the main site then add this code underneath the above code:

    $public_cookiehash = md5('http://www.ralphmoorehawaii.com/');
    define('USER_COOKIE', 'wordpressuser_'. $public_cookiehash);
    define('PASS_COOKIE', 'wordpresspass_'. $public_cookiehash);

    Replace the URL with the url of your main install. Hope that helps.

  3. hauolinaaupono
    Posted 7 years ago #

    I'm not that brilliant when it comes to php or databases. Can you explain in a little more detail, or can I even inquire about hiring someone to do this?

  4. educationthemes
    Posted 7 years ago #

    To hire someone you need to leave contact details.

  5. hauolinaaupono
    Posted 7 years ago #

    Hawaii Time, so please check time before you call.

  6. dbUNIT16
    Posted 7 years ago #

    This was really easy! Perfect!

    Thank you eduthemes!

  7. vurea
    Posted 7 years ago #

    this doesn't seem like its working for 2.6.2 .

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.