Support » Fixing WordPress » WordPress and bbPress Integration

  • Hi, I have just installed both WP and bb at http://www.paperviewzine.com/ and http://forums.paperviewzine.com/ and I have integrated the two. I have installed the bbPress integration plugin for WP and done all the salts and auth keys in the config files as well as adding the cookie info created by the plugin mentioned.

    However it does not seem to be working. When I login into one, I am automatically logged out of the other, and when logged into bb i am unable to login back into WP as it just refreshes the login page and does show any messages or anything, I am then forced to reset the browser cookies/cache to get back in. Edit, seems i dont have to reset the browser at all, i logged out of bb and when i came back to WP i was logged in, so it would seem i was in fact logged in, but the cookies are not working correctly so WP and bb are not understanding that i am logged in when im logged into the other.

    Any ideas how I can fix this? The user system is working as I have created accounts in WP and they appear in bb so that part works correctly. It is just the cookies that refuse to work as intended. And I have double check the salts via phpMyAdmin and they are the same in both wp_options and bb_metas.

    Any help at all would be appreciated. Thanks

Viewing 15 replies - 1 through 15 (of 46 total)
  • Do you have something like this in your wp-config.php file?

    define( 'COOKIEHASH', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' );
    $wp->cookiedomain = '.example.com';
    define('COOKIE_DOMAIN', '.example.com');
    $wp->cookiepath = '/';
    $wp->sitecookiepath = '/';
    define('COOKIEPATH', '/' );
    define('SITECOOKIEPATH', '/');

    And this in your bb-config.php file?

    $bb->wp_siteurl = 'http://example.com';
    $bb->wp_home = 'http://example.com';
    $bb->wp_table_prefix = 'wp_';
    $bb->user_bbdb_name = 'word_database';
    $bb->user_bbdb_user = 'word_user';
    $bb->user_bbdb_password = 'xxxxxxxx';
    $bb->user_bbdb_host = 'localhost';
    $bb->custom_user_table = 'wp_users';
    $bb->custom_user_meta_table = 'wp_usermeta';
    $bb->authcookie = 'wordpress_XXXXXXXXXXXXXXXXXXXXXXXX';
    $bb->cookiedomain = '.example.com';
    $bb->cookiepath = '/';
    $bb->sitecookiepath = '/';

    As well as this at the end of your bb-config.php file?
    $bb->bb_xmlrpc_allow_user_switching = true;

    Whoah where did all that code come from? I haven’t got any of that code apart from
    define(‘COOKIE_DOMAIN’, ‘.paperviewzine.com’);
    define(‘COOKIEPATH’, ‘/’ );
    inside my wp-config.php file.

    Where did you get all that from? I haven’t seen any of that code mentioned in the bbPress documentation or the bbPress admin screen for integration. What is the XXXXXXXXXXXXXXXXX what goes in the those? It seems to me like you have done the integration totally different to what is explained in the Documentation, are you using the integration plugin, from what I can tell from that code, your ignoring the inbuilt system and linking direct to WordPress using the config file.

    I’m using the latest versions of both WordPress and bbPress, so I’m not sure if that code is the old way of doing the integration or if your just doing things differently. Can you please explain thanks.

    What is the difference between the code in the config file and the code in the database, I just realized that that the code above is the advanced settings in bbPress right? BUT it saves it in the DB not in the config file!

    Someone at the BBpress forums wrote a tutorial about this a while ago. Not sure who and not sure if it can still be found. I have been using it for all my installations, and have had perfect integration as well as having the admin user from WordPress be the Keymaster upon install and deep integration. Actually, I found that post that used to be a stickie. This code might not be needed with the stable release of 1.0, but I still use it just in case.

    Documentations are not usually concise and some of the code I use is for backwards compatibility.

    I have everything the exact same as each other in both the wp-config and bb-config:
    BUT it still does not work, any ideas why?

    <?php
    /**
     * The base configurations of the WordPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys, WordPress Language, and ABSPATH. You can find more information by
     * visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
     * wp-config.php} Codex page. You can get the MySQL settings from your web host.
     *
     * This file is used by the wp-config.php creation script during the
     * installation. You don't have to use the web site, you can just copy this file
     * to "wp-config.php" and fill in the values.
     *
     * @package WordPress
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'db52704_database1');
    
    /** MySQL database username */
    define('DB_USER', 'db52704');
    
    /** MySQL database password */
    define('DB_PASSWORD', '##########');
    
    /** MySQL hostname */
    define('DB_HOST', 'internal-db.s52704.gridserver.com');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /**#@+
     * Authentication Unique Keys.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
     * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
     *
     * @since 2.6.0
     */
    define('AUTH_KEY', 'cloud');
    define('SECURE_AUTH_KEY', 'strife');
    define('LOGGED_IN_KEY', 'rufus');
    define('NONCE_KEY', 'shinra');
    /**#@-*/
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'wppaperview_';
    
    /**
     * WordPress Localized Language, defaults to English.
     *
     * Change this to localize WordPress.  A corresponding MO file for the chosen
     * language must be installed to wp-content/languages. For example, install
     * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
     * language support.
     */
    define ('WPLANG', '');
    
    /* That's all, stop editing! Happy blogging. */
    
    /** WordPress absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
    
    //define( 'COOKIE_DOMAIN', '.paperviewzine.com' );
    //define( 'COOKIEPATH', '/' );
    
    define( 'COOKIEHASH', 'wordpress_8e72683dbbeebc073cf684080993eebc' );
    $wp->cookiedomain = '.paperviewzine.com';
    define('COOKIE_DOMAIN', '.paperviewzine.com');
    $wp->cookiepath = '/';
    $wp->sitecookiepath = '/';
    define('COOKIEPATH', '/' );
    define('SITECOOKIEPATH', '/');

    and then my bbpress config:

    <?php
    /**
     * The base configurations of bbPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys and bbPress Language. You can get the MySQL settings from your
     * web host.
     *
     * This file is used by the installer during installation.
     *
     * @package bbPress
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for bbPress */
    define( 'BBDB_NAME', 'db52704_database1' );
    
    /** MySQL database username */
    define( 'BBDB_USER', 'db52704' );
    
    /** MySQL database password */
    define( 'BBDB_PASSWORD', '##########' );
    
    /** MySQL hostname */
    define( 'BBDB_HOST', 'internal-db.s52704.gridserver.com' );
    
    /** Database Charset to use in creating database tables. */
    define( 'BBDB_CHARSET', 'utf8' );
    
    /** The Database Collate type. Don't change this if in doubt. */
    define( 'BBDB_COLLATE', '' );
    
    /**#@+
     * Authentication Unique Keys.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/bbpress/ WordPress.org secret-key service}
     *
     * @since 1.0
     */
    define( 'BB_AUTH_KEY', 'cloud' );
    define( 'BB_SECURE_AUTH_KEY', 'strife' );
    define( 'BB_LOGGED_IN_KEY', 'rufus' );
    define( 'BB_NONCE_KEY', 'shinra' );
    /**#@-*/
    
    /**
     * bbPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $bb_table_prefix = 'bb_';
    
    /**
     * bbPress Localized Language, defaults to English.
     *
     * Change this to localize bbPress. A corresponding MO file for the chosen
     * language must be installed to a directory called "my-languages" in the root
     * directory of bbPress. For example, install de.mo to "my-languages" and set
     * BB_LANG to 'de' to enable German language support.
     */
    define( 'BB_LANG', '' );
    require_once('/home/52704/domains/paperviewzine.com/html/wp-blog-header.php');
    
    $bb->wp_siteurl = 'http://www.paperviewzine.com';
    $bb->wp_home = 'http://www.paperviewzine.com';
    $bb->wp_table_prefix = 'wppaperview_';
    $bb->user_bbdb_name = 'db52704_database1';
    $bb->user_bbdb_user = 'db52704';
    $bb->user_bbdb_password = '##########';
    $bb->user_bbdb_host = 'internal-db.s52704.gridserver.com';
    $bb->cookiedomain = '.paperviewzine.com';
    $bb->cookiepath = '/';
    $bb->sitecookiepath = '/';
    $bb->authcookie = 'wordpress_8e72683dbbeebc073cf684080993eebc';
    
    ?>

    I decided to delete my bbPress installation and reinstall it using the BUILT-IN settings for integration. It works perfect apart from one part, when I’m logged in one app I’m not logged into the other and it won’t let me login to the other UNTIL I have logged out of the other. Any ideas?

    Did you add this at the end of your bbpress config file?
    $bb->bb_xmlrpc_allow_user_switching = true;

    Also, at the top of that same file it is better to put this

    if ( !defined( 'ABSPATH' ) & !defined( 'XMLRPC_REQUEST' )) {
        define( 'WP_USE_THEMES', false );
        //
        //  You will need to get the ABSOLUTE path to this file |
        //                                                     \|/
        require_once( '/home/52704/domains/paperviewzine.com/html/wp-load.php' );
        header( "HTTP/1.1 200 OK" );
        header( "Status: 200 All rosy" );
    }

    Instead of this

    require_once('/home/52704/domains/paperviewzine.com/html/wp-blog-header.php');

    I have issues logging into bbpress and then having it carry over to wordpress. But as long as a user can log into wordpress and then carry over to bbpress, then that is ok for me. With deep integration, one can use replace bbpress login form with wordpress login form.

    Lastly, you need to place your bbpress keys from your bb-config.php file into your wp-config.php file.

    Done all that but still not working :/

    I took a look at the cookies in my browser and noticed that some start with .paperviewzine.com and some just paperviewzine.com is this whats causing the problem? I noticed on WordPress.org they are just .wordpress.org and .bbpress.org so it seems like the likely culprit, how can i fix this?

    IMAGE HERE: http://paperviewzine.com/cookies.png

    And you have your WordPress keys in your bb-config.php file as well? The other thing to do is clear your cookies, restart your browser, and try again. BTW…never post your wordpress or bbpress keys; that is a security risk to you.

    Once your restart, then check your Safari cookies again and see if your domain is coming up with the “.” or not. If it is not, then change your cookiedomain to “example.com” or try “www.example.com”.

    Yes I have the keys in both wp-config and bb-config! And I have restarted the browser several times. But for some reason it creates cookies for .paperviewzine.com and paperviewzine.com :/ I’m guessing that is the problem?

    I meant to say clear you cache, but I think you knew what I meant. Hmmm, that is just strange, I need to check on something.

    Yeah the reset clears everything cache, cookies, etc. But still its not working properly :/

    Look forward to your ideas. Thanks

    The dot or missing dot is not the issue. It will usually show up both ways, but your backend cookies for both wordpress and bbpress will be with the dot. Ok, just want to go over some other things that wasn’t mentioned. You enabled XML-RPC in WordPress and BBpress; you set up your roles in bbpress; and you’ve setup the keymaster; and the wordpress integration settings in bbpress?

    Yes to all of the above! The user tables are linked, in fact their is only the WP user tables and that part works fine. The only thing that isn’t working is the cookies.

Viewing 15 replies - 1 through 15 (of 46 total)
  • The topic ‘WordPress and bbPress Integration’ is closed to new replies.