bbPress

Simple, fast, elegant

« 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 Comments

  1. [...] Simpler integration with WordPress and bbPress, this is getting really cool. « Lloydomattic [...]

    Pingback by Photo Matt » bbPress Integration — September 19, 2006 @ 11:39 pm

  2. This makes what was easy even easier.
    Many thanks

    Comment by Aaron — September 19, 2006 @ 11:46 pm

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

    Comment by Jonathan Dingman — September 20, 2006 @ 12:30 am

  4. [...] 自 Mike Adams (mdawaffe) 加入 Automattic 後,bbPress 的開發?度展開,最新是進展是簡化 WordPress 和 bbPress 的整?。 [...]

    Pingback by bbPress 開發?度展開 @ 天佑的自由天地 — September 20, 2006 @ 3:58 am

  5. [...] Simpler integration with WordPress Someday this’ll be usable enough for anybody who wants an all-in-one solution for their blog and forum. (tags: wordpress development) [...]

    Pingback by links for 2006-09-20 at [MacStansbury] — September 20, 2006 @ 4:56 am

  6. 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!

    Comment by TDH — September 20, 2006 @ 8:40 am

  7. [...] Blog Software Sep 20 at 4:01 am by Thord Hedengren -The good folks over at bbPress (you know, the forum software made by the people that brought you Wordpress) just posted about easier integration with Wordpress. It looks easy enough, but I’m still waiting for the software to leave alpha. [...]

    Pingback by Wordpress/bbPress integration just got easier (is it coming soon?) at The Blog Herald — September 20, 2006 @ 8:57 am

  8. 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.

    Comment by Chris — September 20, 2006 @ 10:09 am

  9. 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.

    Comment by ink — September 20, 2006 @ 10:43 am

  10. 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?

    Comment by Null — September 20, 2006 @ 1:07 pm

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

    Comment by Sarit — September 20, 2006 @ 1:22 pm

  12. :D

    Comment by marcoss — September 20, 2006 @ 7:00 pm

  13. [...] bbPress » Blog bbPress和WP的整? (tags: bbPress) [...]

    Pingback by ourr » links for 2006-09-20 — September 20, 2006 @ 10:25 pm

  14. [...] bbPress » Blog Integrating Wordpress and bbPress has gotten easier. (tags: wordpress bbpress integration database community todo) [...]

    Pingback by Akkam’s Razor — September 21, 2006 @ 1:09 am

  15. [...] – wie man das bbPress-Forum mit Wordpress integriert – AuthOnly erlaubt ausschließlich registrierten Usern den Zugriff aufs Blog, zusätzlich benötigt man dazu den RoleManager (vom gleichen Autor) – KillPreview ist mehr für die Blogschreiberlinge selbst, es schaltet die olle Vorschau im Write-Modus aus. Spart halt Zeit beim Aufruf des Fensters – Whisper werde ich wohl bei mir einbauen. Es erlaubt registrierten Usern via Kommentar anderen registrierten Nutzern eine Nachricht zu hinterlassen. Nicht registrierte User können diesen Kommentar nicht sehen – Wordpress SMTP ist für all diejenigen interesssant, deren eigener Server aus welchen Gründen auch immer Mailversand-Probleme bereitet [...]

    Pingback by Basic Thinking Blog » Wordpress-Plugins — September 21, 2006 @ 10:19 am

  16. [...] bbPress Integration with WordPress Easier Looks like there has been some movement in the bbPress world which I am happy to report: WordPress integration! If you’re looking to integrate bbPress and WordPress, life just got a little easier. [...]

    Pingback by   bbPress Integration with WordPress Easier by Blogging Pro — September 21, 2006 @ 5:45 pm

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

    Comment by mdawaffe — September 21, 2006 @ 9:13 pm

  18. [...] Finalmente qualcosa di nuovo in casa bbPress, il forum preferito da chi usa WP: la tanto sospirata integrazione con WordPress soprattutto per quanto riguarda la gestione degli utenti e le funzioni disponibili a livello di codice. Per i più curiosi, in attesa di una traduzione nella nostra pagina wiki, ecco un esempio del nuovo file di configurazione di bbPress. [...]

    Pingback by WordPress Italy » Blog Archive » bbPress, finalmente integrato in WordPress — September 22, 2006 @ 12:25 am

  19. [...] bbPress » Blog (tags: wordpress) [...]

    Pingback by Skylog » Blog Archive » links for 2006-09-22 — September 22, 2006 @ 6:22 am

  20. [...] Most olvastam feedolvasómban a hírt, hogy lehet egyszerűen integrálni a bbpress forumainkat wordpress blogunkba. [...]

    Pingback by bbpress wordpress házasítás egyszerűbben :: kobak pont org — September 22, 2006 @ 10:48 am

  21. [...] BBpress integrato in Wordpress per chi non lo sapesse, BBpress un motore per forum, gratuito, scritto dall’autore di Wordpress usando praticamente lo stesso codice. diciamo che una derivazione forummistica. Sebbene gi in passato fosse possibile condividere gli utenti, tramite qualche ritocchino al codice e/o al database, ora i due prodotti sono integrabili nativamente http://bbpress.org/blog/2006/09/simp…ith-wordpress/ Via Tambu __________________ Sono un e Non perderti il Convegno GT sul SEO & SEM Ci saranno i migliori professionisti, con argomenti davvero innovativi [...]

    Pingback by |► BBpress integrato in Wordpress — September 22, 2006 @ 4:51 pm

  22. 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.

    Comment by Harshad Joshi — September 23, 2006 @ 7:55 pm

  23. [...] bbPress integration with WordPress [...]

    Pingback by alexking.org: Blog > Around the web — September 24, 2006 @ 7:41 pm

  24. I love you guys

    Comment by mozey — October 5, 2006 @ 2:40 pm

  25. [...] bbPress is from the same folks that make WordPress. So integration with WordPress should be easy. They just (Oct. 2006) released the first version of bbPress and my testings so far have been bug-ridden. I’m sure the problems will be worked out. Integration Instructions and the bbPress support forum. [...]

    Pingback by Forums that Integrate with WordPress | Misguided Thoughts — October 16, 2006 @ 10:56 pm

  26. [...] “Simpler integration with wordpress” [...]

    Pingback by Docunext » Blog Archive » bbpress themes — December 23, 2006 @ 7:36 pm

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

    Comment by nolawi — December 23, 2006 @ 11:06 pm

  28. [...] that looks sweat, im checking out bbpress now, its from the developers of wordpress. bbPress Simpler integration with WordPress __________________ MediaSwim.com [...]

    Pingback by integrating PHPbb into Wordpress - WickedFire - Internet Marketing Affiliate Webmaster Forum — December 27, 2006 @ 5:55 am

  29. [...] 这篇文章最早发布在bbPress博客上,题目是Simpler integration with WordPress。 [...]

    Pingback by Life Style » bbPress与WordPress整合 — February 11, 2007 @ 10:02 am

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

    Comment by Aaron — February 27, 2007 @ 6:54 pm

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

    Comment by rudy — March 29, 2007 @ 1:53 pm

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

    Comment by joyci — March 29, 2007 @ 1:55 pm

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

    Please, the link is missing a slash.

    Comment by Werbeagentur — June 7, 2007 @ 12:57 am

  34. 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.

    Comment by Raymond — June 20, 2007 @ 8:21 am

  35. [...] Simpler integration of bbPress with WordPress [...]

    Pingback by WordPress Wednesday News: WordPress 2.2.1 Mandatory Upgrade, WordCamp Awesome Weekend Conference, WordPress in Japan, and Lots of WordPress Plugins : The Blog Herald — June 29, 2007 @ 4:32 am

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

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

    Comment by Nick Prignano — November 4, 2007 @ 4:25 am

  37. [...] community site, Wordpress and bbPress, all holding hands and skipping through a field of daisies. here are instructions on how to achieve such a [...]

    Pingback by jaymis.com » Blog Archive » Integrating WordpressMU with bbPress — February 13, 2008 @ 5:07 am

  38. 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

    Comment by helpy — February 18, 2008 @ 3:26 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Code is Poetry.