« Template Changes bbPress Trac: now with 99% less spam! »

Simpler integration with WordPress

September 19, 2006 10:50 pm — Development — mdawaffe

If you’re looking to integrate bbPress and WordPress, life just got a little easier.

Database Integration

Setting $bb->wp_table_prefix in bbPress’s config.php will tell bbPress to grab users and user meta data from those WordPress tables.

The CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE constants are still around and will override other settings if you need more fine grained control.

UPDATE: I should have mentioned Matt’s external user database update from a few months ago. It allows you to pull user and user meta information from a separate database. All you have to do is define USER_BBDB_NAME, USER_BBDB_USER, USER_BBDB_PASSWORD, and USER_BBDB_HOST.

If you’ve installed bbPress into a subdirectory of your WordPress installation, define $bb->wp_home and $bb->wp_siteurl as your WordPress blog address and WordPress address, respectively. Both sites will now share the same cookies so that when you’re logged into one, you’re logged into the other. (The addresses referenced above can be found in WordPress’ Options -> General admin tab.)

If bbPress is not installed in a subdirectory of your WordPress install, you’ll probably need to adjust both bbPress’ and WordPress’ cookies to meet your specific requirements. Below is a brief outline of the variables and constants that control the cookie behavior in the two programs.

PHP bbPress WordPress
name $bb->usercookie USER_COOKIE
name $bb->passcookie PASS_COOKIE
path $bb->cookiepath COOKIEPATH
path $bb->sitecookiepath SITECOOKIEPATH
domain $bb->cookiedomain COOKIE_DOMAIN

Registration Integration

Currently, when a user registers on your bbPress forum, your WordPress blog doesn’t know about it (and vice versa). The user will be created, but WordPress won’t know what user role to apply.

At the moment, integrating user registration more tightly will require a plugin both for bbPress and for WordPress. Hooks to look at include bbPress’ bb_new_user and bb_user_has_no_caps along with WordPress’ user_register.

Function Integration

bbPress keeps all of the code it has in common with WordPress in a couple of discrete files. If you’d like to load both bbPress and WordPress at the same time (so that you have access to both sets of functions and APIs), you’ll need to tell bbPress not to try and load functions and classes that WordPress has already defined.

Do so by defining WP_BB as true in either config.php or wp-config.php. Also, WordPress will have to be loaded first.

The short of it

We’re always trying to make things simpler around here. Integration with WordPress is easier now than it used to be but will hopefully continue to become more and more painless as we keep working.

As always, config-sample.php has a couple hints.

38 Responses to Simpler integration with WordPress

  1. Pingback: Photo Matt » bbPress Integration

  2. Aaron says:

    This makes what was easy even easier.
    Many thanks

  3. It’s about time! I’ve been waiting for this for a while, this will make life better. Thanks!

  4. Pingback: bbPress 開發?度展開 @ 天佑的自由天地

  5. Pingback: links for 2006-09-20 at [MacStansbury]

  6. TDH says:

    Ow man, bbPress just keeps getting niftier and niftier. I hope you guys can get a solid release out there soon because I’m dying to use this on a public site.

    Cheers!

  7. Pingback: WordPress/bbPress integration just got easier (is it coming soon?) at The Blog Herald

  8. Chris says:

    Are there actually user creation plugins available to WP and BBpress? Or is this just a heads-up that these will need to come along at a future point?

    Thanks for all the hard work, by the way.

  9. ink says:

    Wow! It’s Great! Wery helpfull for me.

    1. Would you integrate some Gallery software into this pretty good integration bundle?
    2. Would it work in bundle where WordPressMU + bbPress inegrated?

    It’s important for me, because i’m interested in creation of community, where users can have their own blogs, communicate in forum, and share their pictures from one user account.

  10. Null says:

    When will rhe forum be up here so we can ask questions like:
    - When will bb-press support img tags so we can add images into our forum
    - When will the plugins (page) be ready?
    - When will bbpress use Vet like this way?

  11. Sarit says:

    What, no language files for bbPress?
    I’m a Hebrew blogger and I would love to offer it translated.

  12. Pingback: ourr » links for 2006-09-20

  13. Pingback: Akkam’s Razor

  14. Pingback: Basic Thinking Blog » WordPress-Plugins

  15. Pingback:   bbPress Integration with WordPress Easier by Blogging Pro

  16. mdawaffe says:

    I’ve updated this post’s Database Integration section to include the news about Matt’s work allowing for an external user database.

  17. Pingback: WordPress Italy » Blog Archive » bbPress, finalmente integrato in WordPress

  18. Pingback: Skylog » Blog Archive » links for 2006-09-22

  19. Pingback: bbpress wordpress házasítás egyszerűbben :: kobak pont org

  20. Pingback: |► BBpress integrato in WordPress

  21. Is it always necessary to have a SQL backend for this wonderful blogs software?

    I would suggest text files as a backend. Please can you write this kind of software?

    Regards.

  22. Pingback: alexking.org: Blog > Around the web

  23. mozey says:

    I love you guys

  24. Pingback: Forums that Integrate with WordPress | Misguided Thoughts

  25. Pingback: Docunext » Blog Archive » bbpress themes

  26. nolawi says:

    the problem with this is that the instructions are so bad really horrible… anyways i will try it

  27. Pingback: integrating PHPbb into WordPress - WickedFire - Internet Marketing Affiliate Webmaster Forum

  28. Pingback: Life Style » bbPress与WordPress整合

  29. Aaron says:

    Yeah, really geeky directions here that only another geek could follow.

  30. rudy says:

    i’ve already used bbpress here…. http://www.speedytown.com/forum/garamdunia/ and it’s easy to manage … many thanks to you..

  31. joyci says:

    it’s seem to be next big thing, for all forumer … switch your forum to bbpress !!!!

  32. Werbeagentur says:

    “As always, config-sample.php has a couple hints.”

    Please, the link is missing a slash.

  33. Raymond says:

    To get it working with WPMU i had to add the following lines to config.php, after $bb->wp_xxx settings:

    if ( isset( $bb->wp_table_prefix ) ){
    $bb->usercookie = ‘wordpressuser’;
    $bb->passcookie = ‘wordpresspass’;
    }

    Because WPMU does not use HASH in its COOKIES.

  34. Pingback: WordPress Wednesday News: WordPress 2.2.1 Mandatory Upgrade, WordCamp Awesome Weekend Conference, WordPress in Japan, and Lots of WordPress Plugins : The Blog Herald

  35. Anybody who is looking for “more” integration of wp with bb, check out this article:

    http://www.adityanaik.com/integratepress-part-i/

  36. Pingback: jaymis.com » Blog Archive » Integrating WordPressMU with bbPress

  37. helpy says:

    Do so by defining WP_BB as true in either config.php or wp-config.php. Also, WordPress will have to be loaded first.

    I use WP and BB with german language! If I include wp-blog-header.php in the configuration file (config.php) of bbpress, the following error occurs:

    Fatal error: Cannot redeclare class streamreader in /homepages/.../www/forum/bb-includes/streams.php on line 26

    If I uncomment the lines 122 + 123 in bb-settings.php:

    // include_once(BBPATH . BBINC . ‘streams.php’);
    // include_once(BBPATH . BBINC . ‘gettext.php’);

    No error occurs … but the forum is in english!

    I use WP 2.3.3 and bbpress 0.8.3.1

    Is there a documented way to fix this?

    cu, helpy