bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

Integrate wp and bbpress registration

(4 posts)
  • Started 1 year ago by Sonika
  • Latest reply from Trent
  • This topic is not a support question
  1. Registration in WP should be registration on bbpress, so bbpress will use wp_users in wordpress database.
    When login through wp-login.php, automatically login at bbpress

    So I made some changes in my config.php (bbpress file) and in wp-config.php (wp file)

    They are:

    config.php
    -----------------------------------

    <?php
    require_once('/home/........................./public_html/wp-blog-header.php');
    // ** MySQL settings ** //
    define('BBDB_NAME', 'xxx'); // The name of the database
    define('BBDB_USER', 'xxx'); // Your MySQL username
    define('BBDB_PASSWORD', 'xxx'); // ...and password
    define('BBDB_HOST', 'localhost'); // 99% chance you won't need to change this value
    define('CUSTOM_USER_TABLE', 'wp_users');
    define('CUSTOM_USER_META_TABLE', 'wp_usermeta');
    // Change the prefix if you want to have multiple forums in a single database.
    $bb_table_prefix = 'bb_'; // Only letters, numbers and underscores please!

    // If your bbPress URL is http://bbpress.example.com/forums/ , the examples would be correct.
    // Adjust the domain and path to suit your actual URL.
    // Just the domain name; no directories or path. There should be no trailing slash here.
    $bb->domain = 'http://site.ru'; // Example: 'http://bbpress.example.com'
    // There should be both a leading and trailing slash here. '/' is fine if the site is in root.
    $bb->path = '/forum/'; // Example: '/forums/'

    // What are you going to call me?
    $bb->name = 'Форум';

    // This must be set before running the install script.
    $bb->admin_email = 'admin@site.ru';

    // Set to true if you want pretty permalinks.
    $bb->mod_rewrite = true;

    // The number of topics that show on each page.
    $bb->page_topics = 30;

    // A user can edit a post for this many minutes after submitting.
    $bb->edit_lock = 60;

    // Your timezone offset. Example: -7 for Pacific Daylight Time.
    $bb->gmt_offset = 0;

    // Change this to localize bbPress. A corresponding MO file for the
    // chosen language must be installed to bb-includes/languages.
    // For example, install de.mo to bb-includes/languages and set BBLANG to 'de'
    // to enable German language support.
    define('BBLANG', '');

    // Your Akismet Key. You do not need a key to run bbPress, but if you want to take advantage
    // of Akismet's powerful spam blocking, you'll need one. You can get an Akismet key at
    // http://wordpress.com/api-keys/
    $bb->akismet_key = false;

    // The rest is only useful if you are integrating bbPress with WordPress.
    // If you're not, just leave the rest as it is.

    $bb->wp_table_prefix = 'wp_'; // WordPress table prefix. Example: 'wp_';
    $bb->wp_home = 'http://site.ru'; // WordPress - Options->General: Blog address (URL) // No trailing slash
    $bb->wp_siteurl = 'http://site.ru'; // WordPress - Options->General: WordPress address (URL) // No trailing slash

    /* Stop editing */

    /**************************
    * Start WP integration
    **************************/
    // My bbpress is in a subdirectory of my WP install... must bew a nicer way of doing this??
    if(file_exists("../wp-settings.php"))
    {
    // loads the functions and wp config
    require_once "../wp-config.php";
    require_once "../wp-settings.php";

    // use the WP user table for your bbpress user list
    define('CUSTOM_USER_TABLE', 'wp_users');

    // your $bb->domain must match your wp domain exactly or the hash won't work and users will not authenticate.
    $myhash = md5($bb->domain);
    $bb->usercookie = 'wordpressuser_' . $myhash;
    $bb->passcookie = 'wordpresspass_' . $myhash;

    // Use the same cookie as WP
    $bb->cookiepath = '/';
    }
    /**************************
    * End WP integration
    **************************/

    define('BBPATH', dirname(__FILE__) . '/' );
    require_once( BBPATH . 'bb-settings.php' );
    ?>

    -----------------------------------

    And I add in wp-config.php:
    -----------------------------------

    // Cookies, bbPress fix
    $bb->cookiedomain = 'localhost';
    $bb->cookiepath = '/';

    -----------------------------------

    I register new user in worpdress and then go to my bbpress.
    Bbpress says my "user not found"

    What is my mistake?

    Posted 1 year ago #
  2. If you haven't figured this out already, but there is a plugin for doing this at http://bbpress.org/plugins/topic/4?replies=1 and it does the following:

    Share user accounts between your WordPress blog and your bbPress forums.

    This plugin ensures current Wordpress users can use the forum. As for registrations in bbPress and adding them to Wordpress Users, check out:

    http://trac.bbpress.org/ticket/438

    It is a Wordpress plugin to bring across the information for bbPress registrations.

    My blog is setup so users can register in WP or bbPress because with these 2 plugins, it doesn't matter where they register.

    Thanks,

    Trent

    Posted 1 year ago #
  3. That is freaking awesome!! I had already done that ticket 438 lastnight.. but, now grabbed the other one and installed it.. Works like a charm!! Thanks Trent for pointing us in the right direction.. ;) =)

    spencerp

    Posted 1 year ago #
  4. No problem! Happy to point out what took me several searches to piece together!

    Trent

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.