bbPress: Forum Integration with WordPress

WordPress and bbPress

If you want a forum in a self-hosted WordPress blog, bbPress is the right choice. This is because bbPress and WordPress can be integrated in the important areas: user and login cookie. This means users who are listed in the WordPress blog are also bbPress users. And if you login to WordPress you will also be automatically logged in to bbPress, and vice versa. So, we don’t have to duplicate user data, we don’t have to synchronize users, and users should feel that WordPress and bbPress as a single integrated software because of the single sign-on feature between the two.

Beside bbPress, there quite a lot of forum software available in the market. We can choose an open source, GPL, and freely available phpBB forum software. Or if you want the commercial one, you can try vBulletin. Currently, the features of bbPress are not as complete as those two, but it is sufficient as a standard forum software.

bbPress is also made by the team under supervision of automattic, a company founded by WordPress creators. So, it’s not strange when we look into the source code of bbPress, its structure, and the way it is programmed, are just like WordPress. Even the administration screen is a duplicate of WordPress admin screen. This should be beneficial to us, since it lower the curve to learn bbPress, especially for us who has been accustomed to WordPress’ technical stuffs.

The following image shows the appearance of bbPress using standard theme. I captured the image from http://opencart.web.id/support/, which has integrated WordPress and bbPress installation:

Appearance of standard theme in bbPress

And the following image is a sample of bbPress administration screen. As you can see from the following image, the bbPress administration screen is very similar with WordPress administration screen:

bbPress administration screen

Integration with WordPress

As I stated above, bbPress can be integrated with WordPress, especially in the two following areas:

  • User. bbPress and WordPress can use the same users table. So, WordPress users are also bbPress users. However, roles in bbPress are different than the roles in WordPress. But there’s an administration screen that we can use to map roles between bbPress and WordPress.

  • Login / auth cookie. With this feature, login to WordPress is also automatically login to the bbPress and vice versa. This feature is often called as single-sign-on.

How to Integrate bbPress with WordPress

Integration between bbPress and WordPress can be configured when we install bbPress. WordPress should be installed before bbPress, because we need some information from WordPress to put into integration settings in the bbPress installation screen. However, we can omit the integration settings when installing, and do it later.

Important:In order for cookie integration to work properly, bbPress and WordPress should be in the same domain, or at least bbPress is a sub domain of WordPress. However, the easiest and most trouble free setting is to put bbPress as subdirectory of WordPress. For example, my WordPress installation is in domain http://opencart.web.id, then I put my bbPress installation in http://opencart.web.id/support/.

In order to make it simpler, I’ll skip some trivial installation steps like configuring database. But it is important to note that bbPress must use the same database with WordPress in order to share users data. I’ll go straight to step 2 of the installation process. In this step, we deal with the screen to integrate bbPress with WordPress. The following image shows screen capture of this step:

Step 2 - bbPress integration with WordPress

The most important thing is to check the following checkboxes:

  • Add integration settings
  • Add cookie integration settings
  • Add user database integration settings

In the cookie integration settings, there are some values we have to fill, mainly cookie keys and salts. The values for these fields should match with the same values from wp-config.php file inside WordPress directory. The following source code shows a sample of those values taken from my wp-config.php in my local WordPress installation. (Notes: Each WordPress installation should generate those values differently, not using the standard one from the installation package):

define('AUTH_KEY',         'nHa]jR<NEZ/K!+I.(7<a`w)^0A#87=p3I7c|oB<QxIB}3$y&.gt]ix/S`3? 4kO2');
define('SECURE_AUTH_KEY',  'Z|A9x3b4U*f%t<AprPU#gzI&mn_&5;:{kh_K@Ta[xzNIhxe3Bfh*bttJH.6(SAmg');
define('LOGGED_IN_KEY',    'goqoh!o6bm:#VGog?gkMK5X8Dp:og`yqZ3o<v4,J>&,!-6^0xJ5HvwCTw9iAiH2}');
define('NONCE_KEY',        'tbTKKwKE?lH^c]!L=xI%}LE?pQqqyl!FOmtD47us*InrI/;e/5MGi[=^l!1R?ZRy');
define('AUTH_SALT',        'zCblK2dqf{*+ hp~/P^Un( k^+Lq{Lprrrp~B+Vwp@RC(~AJ @_^5?Wtm^ce7<KX');
define('SECURE_AUTH_SALT', 'Daq,go.C@h$1B-V~nm0tYUtQ2{z;8 nl}<,ILJS&/@^6CngV2Cf;z0KE%e$@koO=');
define('LOGGED_IN_SALT',   'lm7o!pbwHv~lc, S3!Qz(6pkr1wK^CW)])Su6h&Q5VZ`:0^@kU.4=CkPMd)emy2=');
define('NONCE_SALT',       '*M5xwQa)mS3rn/%@kz<%`ZQ_lnemLUasub%v^K]o0y(WFX6<[oaJ`.C}zt@g]3V(');

Step 3 of the installation settings is the trivial Site settings that should be easy to configure. You only have to fill the values for Site name, “Key master” Username, and First forum name. Please note that if the integration setting in step 2 succeeds, then the value for “Key master” Username should be selectable from available dropdownlist.

Then after installation process finished, there is one manual step you have to perform: add the following setting value to bb-config.php, if it is not yet there:

$bb_table_prefix = 'bb_';

Next step is mapping role between bbPress and WordPress. To do this, open the following admin screen /bb-admin/options-wordpress.php, then map all available bbPress roles to WordPress roles. The following image shows an example of such mapping:

bbPress and WordPress role mapping

Then, we enter WordPress administration screen. We have to install bbPress and WordPress integration plugin that we can download from the following URL: http://wordpress.org/extend/plugins/bbpress-integration/. Fill some settings for this plugin in its admin screen. The result of this step is some line of code (available on the bottom of the screen) that we have to add to wp-config.php inside WordPress directory.

That’s all steps required to integrate bbPress and WordPress. Now you can use bbPress and WordPress in the same domain, using the same users, using the same login cookie, and using single-sign-on.

This entry was posted in WordPress and tagged , .

2 Responses to bbPress: Forum Integration with WordPress

  1. I tried SMF and it is really awesome forum. This one is also Looking useful one. Will give a try.
    Thanks for sharing.

  2. Pingback: WordPress Hey

Leave a Reply

Your email address will not be published.

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

About Me

I am a professional developer and designer for the following systems: WordPress, Magento, and OpenCart. You can hire me to do overseas works related to those systems.
Hire me | Donate / Payment | Testimonials

Recent Comments