WPMU 2.6.1 Integration Success with 1.0-alhpa-2
-
I have seen lots of posts with folks having trouble getting integration to work. I am on 2.6.1 and 1.0-alhpa-2 and I have everything working with no problems.
The one gotcha that I found that I have not seen mentioned: COOKIEHASH in the wp-settings.php file. It currently ships empty in WP, and probably most people left it blank like me:
define('COOKIEHASH', '' );
The hash is calculated in bb-settings.php:
define('BB_HASH', $bb->wp_cookies_integrated ? md5($bb->wp_siteurl) : md5($bb->uri));
Since bbPress is hardcoded to use an MD5 hash of the domain appended to all cookies (when you are integrating), you need to have the matching hash appended to your WP cookies.
The hash is added to the cookie to make it unique, like
wp_logged_in_user_3ffce08ac7419977b5ab9d68969a4cd0
To fix this to match bbPress, set it up like this in wp-settings.php:
define('COOKIEHASH', md5(get_option('siteurl')));
Or even better calculate it once to avoid the get_option overhead and hard code it.
define('COOKIEHASH', '3ffce08ac7419977b5ab9d68969a4cd0');
Bonus points for anyone who can guess the hash above. Yes, it’s md5 and one-way, but on this forum, the answer should be pretty obvious.
The form of the url passed to md5 should be ‘http://mysite.com’ with no trailing slash.
One more cool thing: I do not allow registration on the support forum, only through the main WP site. In order to enable posting in the forum from the moment of signup, add a plugin in you mu-plugins directory containing the following:
function enable_forum_new_user( $user_id ) {
update_usermeta($user_id, 'bb_capabilities', array('member' => true));
return;
}
add_action('wpmu_new_user', 'enable_forum_new_user');Now your users can hit the forum and post the second they click their confirmation email. Cool, huh?
- You must be logged in to reply to this topic.