Codex

Ergate/wpmu bbPress integration

Current Integration Instructions

For the most current and up to date instruction on how to integrate BBPress and WP/WPMU go to bbPress.org Blog

http://bbpress.org/blog/2006/09/simpler-integration-with-wordpress

OLD INSTRUCTIONS

Here is some info on getting started with integrating WPMU / WP with bbPress. These instructions are not specific to WP or WPMU since integration is the same. On the BBPress mailing list and scattered throughout the WPMU and WP forums are multiple directions, and varying levels of integration (just user tables to themes). As time permits I will go through and write/link up to the most common and successful processes.

The following was retrieved from directly from this link on the BBPress mailing list.

In your bb-config.php file, you can add the following (just after the bit that says "/* stop editing */" and before the bit that says "define('BBPATH', dirname(__FILE__) . '/' );" - it needs to go here so the WP functions get loaded first as they do not have if(function_exists()) round their functions - BBPress does ;)

/* 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__) . '/' )

You still need to build a my-templates, but you can now use all wp commands for example bloginfo() - very useful :). And you can use your current WP theme style by using the following in your header <head></head>...

   <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen, projection" />



   <style type="text/css">
           @import url("./my-templates/style.css");
   </style>