Integrating WPMU, BuddyPress and bbPress

BuddyPress Tutorials, Wordpress MU Tutorials, bbPress Tutorials April 25th, 2009

Update: Please note that this tutorial is for BuddyPress 1.0 RC-2. A new and official release of BuddyPress is now available.

Though the directions within this tutorial will work for the new release, I’ve written a 2nd tutorial that cuts out a few unnecessary steps. The new tutorial can be found here.

. . . . . . . .

This tutorial assumes that you are able to create your own database and install Wordpress MU on your own. You must also be able to navigate through Admin dashboards and modify php files.

Also assumed is that you’re starting a new install. Don’t hold me responsible if an update or other parts of your site go kablooey. Remember to save your work frequently, especially when dealing with modifying the files.

It’s been explained to me that if you’re on a dedicated server, the directions may be different when we come to the security keys. If that’s the case, then directions for retreiving the keys will be within the install pages.

Not sure if you’re on a dedicated server? Normally, the difference will be the price you pay. Do you pay $10 a month or $200? If it’s $10, then you should be alright.

Don’t let the length of the tutorial scare you. I’ve simply made it very detailed because, you ARE here for help. You’ve probably got a huge dent in your forehead and a bruise to hide it. There’s no point in writing a tutorial if half of the steps are skipped. Also, all of the links will open into new windows.

The detailed instructions are also numbered. This will allow you to specifically pinpoint where you are if you get stuck and need to ask for help.

GOOD LUCK!! HERE WE GO!!

1. Download WordPress MU 2.7.1 from http://mu.wordpress.org/download. Install it and make sure you’re not erroring out anywhere. Make sure you can log in. Also a good idea to change admin password at this point.

2. Download my zip from http://theeasybutton.com/downloads/buddypress_wpcontent.zip. It includes BuddyPress 1.0 RC-2 and bbPress 1.0-alpha-6.

During a normal install of BuddyPress and bbPress, you’re asked to move some files and folders around within your directories. Downloading my zip file will take the guess work out of this by removing those steps.

If you would prefer to download these files from their original locations and move the files & folders yourself, please read the following tutorials and skip to step 4.
Moving The Themes
Moving The Plugin

3. Unzip and upload the 2 folders. They are wp-content and forums. They should be placed in the root folder. If you’re using an FTP client, the screen should look like this:

upload21

4. Enable BuddyPress
a. In WPMU’s dashboard click on plugins & then ‘Activate’ BuddyPress

5. (Optional) Enable the BuddyPress Home Theme
a. Click on Themes under the Site Admin header
b. Click Yes by BuddyPress Default Home Theme
c. Save it
d. Click Appearance in the left menu
e. Click the home theme and you’ll get a popup screen. Activate it with the link in the top right corner

6. Forums Install — Go to yoursite.com/forums You will be greeted by a green screen that says “There doesn’t seem to be a bb-config.php file. This usually means that you want to install bbPress.” Click “let’s get started.”

7. Enter the same database information that you used when installing WPMU.

8. Tick the box by “Show advanced settings” and more options will pop up. Enter the server information (same as wpmu install) into the Database host section. Ignore all of the other boxes. Scroll to the bottom and make sure that the last option (Table name prefix) says bb_

9. Save

10. Click Go to step 2

11. On the next screen, tick the box beside “Add integration settings”

12. Tick the box beside “Add cookie integration settings”

13. Enter the URL info into the first 2 boxes. (http://www.yoursite.com) I’ve done this with AND without the trailing slash and it worked for me either way.

14. Click on the following link. http://api.wordpress.org/secret-key/1.1. Copy ALL of the codes you’re given.

15. Open wp-config.php This will be in your root folder.

16. Scroll down and find the lines that look like the ones you just copied (AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY)

17. Highlight those FIRST FOUR lines. Not 7 lines. FOUR LINES. Then right click and paste. This will replace your old security codes with the ones you copied in step 14. Save the wp-config file.

18. Next, use those codes on the forum install. One by one, copy the keys into the appropriate spaces.

The keys are the long strings of letters, number and characters. Only use the string. Don’t paste the quotes at beginning and end.

You should have 7 different keys to paste. If you don’t have 7, follow the instructions under the “salt” key boxes to get those codes.

19. After copying each of the keys into the install form, tick the box that says “Add user database integration settings” Make sure the box there matches the prefix you used during WPMU install.

If you made no changes while installing WPMU, this should say wp_

20. Click “Go to step 3″

21. Enter your Site name - This is what you want to call your forums. i.e. My Site Forums

22. Enter the forum url. i.e. http://mysite.com/forums/

23. Click the drop down menu for Username. You should see the name admin. Choose that.

24. Name your first forum. i.e. My First Forum or Test Forum or Please Please Work

25. Click “Save site settings”

26. Click “Complete the installation”

27. At this point you should see “Your installation completed successfully.” If you get any red errors, try a new install. Do this by first deleting the forums >> bb-config.php file. Only that one file, not the entire directory. Then, open your database and drop all tables that start with bb_

My suggestion to you would be to check the trailing slash from step 13. If you used it before, don’t use it this time. And vice versa.

28. If all has gone well, go to your forums. i.e. http://mysite.com/forums/

29. Log in

30. Click Admin

31. Click Settings

32. Scroll down and tick the boxes that say Enable XML-RPC and Enable Pingbacks — Save changes

33. Click Wordpress Integration

34. Give your users roles. The WPMU admin needs to be a keymaster. You can set all other roles to member. Click “Save user role map”

35. After saving, scroll down to the first grey box. You will see 2 define codes. Paste these codes into wp-config.php You should put them on the 2nd line of your file (immediately following the open php code)
They will resemble these codes
define(’COOKIE_DOMAIN’, ”);
define(’COOKIEPATH’, ‘/’);

36. Back on the WP integration page, scroll down to the bottom. Look for your longest line of code in the big grey box. It will resemble the following code:
$bb->logged_in_cookie = ‘wordpress_logged_in_5e3c6)4&lssfj39(a94715$6a33bd9aae’;

37. Copy the following code onto the 4th line of your wp-config.php
define('COOKIEHASH', 'PUT_YOUR_CODE_HERE');
It will immediately follow the other 2 define codes you just put in there.

38. Replace “PUT_YOUR_CODE_HERE” with the string you found in step 36.
i.e. define(’COOKIEHASH’, ‘5e3c6)4&lssfj39(a94715$6a33bd9aae’);

Save your wp-config.php

39. In your wp-config.php, copy your seven security key codes (full code, not just keys. Copy the full paragraph starting with the first ‘define’) These are the same keys you used when installing the forums. Copy all seven!!

40. Open your forums >> bb-config.php Scroll down through the file and find the list of security keys. Take note of how these differ from the ones you just copied. You should see BB_ at the beginning of each of them. There will only be 3 or 4, not the full 7.

41. Highlight ALL of the security codes in bb-config.php, right click, paste. This will replace the codes with the ones you just copied in step 39.

42. Fix each of the seven codes by putting BB_ at the beginning of each one.
i.e. BB_AUTH_KEY, BB_SECURE_AUTH_KEY, BB_LOGGED_IN_SALT

43. Scroll to the bottom and paste the following code on the line before the closing php code. The closing code looks like ?>. The code to paste is:
$bb->bb_xmlrpc_allow_user_switching = true;

Save the bb-config.php

44. Back in the Forum Admin, click Plugins

45. Activate BuddyPress Support Plugin

46. Go back to your WPMU/Buddypress Admin dashboard (yoursite.com/wp-admin)

47. Click BuddyPress at the bottom of the left menu

48. Click Forums setup

49. Enter your forums’ URL (i.e. http://yoursite.com/forums/)

50. Enter the name & password of the person you set as Key Master. (Mine is admin)

51. Log out of WPMU/Buddypress

52. Go to your forums and log out if you aren’t already. (http://yoursite.com/forums/)

53. Go back to your main site (http://yoursite.com) and log in

54. Back over to the forums — You should be logged in automatically.

If you’re not logged in, scream and yell and jump up and down!!! I totally give you permission!!

After you’re done throwing a fit and commenting on how badly my tutorial sucks, try a new install.

If that didn’t work, post a comment here. Let us know if there are any errors kicking out. Are you getting stuck or confused on one of the instructions? Details are important in solving problems. So please give details!!

If all went well and you’re so happy right now that you could go outside and dance naked in the streets.. please leave a comment and let me know. Also, tell your friends. =D Dancing naked ALONE is no fun. Let them join in on the fun.


29 Responses to “Integrating WPMU, BuddyPress and bbPress”

  1. Adam Lunn Says:

    You sir, are a legend

  2. Adam Lunn Says:

    You madam, are a legend

  3. Chris Says:

    Thank you Adam. Both for the compliment and the gender correction. =D

  4. Aaron Says:

    You are a friggin’ genius! Single sign-on has been giving me trouble for a while now, but 5 min with your directions and we’re golden.

    There were steps in here I’ve never heard of (probably why it didn’t work before [cough]) thanks for making it so clear!

    You should get a Nobel prize for this!

    (In related news, why the hell is it this complex?! You should think that the guys at WP or BBP would have figured something out by now…)

  5. donnacha | WordSkill Says:

    Excellent walkthrough.

    I agree with Aaron, it’s astonishing that Automattic haven’t sat down and implemented a better installation process. bbPress could really use some of the tricks that both WordPress and MU have implemented to make life easier, such as MU telling you the exact command line you need to chmod files.

    Thanks to Chris’ instructions, I managed to install bbPress but there appear to be two problems:

    1. Posts in BP group forums render with the letter p before and after each paragraph, obviously a rendering failure to properly remove the

    tag.

    2. Unable to log out once logged in to either either BP or bbPress - I log out but the cookies keep logging me back in! Mind you, at least the single login between both is working :)

  6. Chris Says:

    Sorry it took me so long to reply to this. I changed my email addy and completely forgot I had this set to send notification to the old addy. Duh Me!!

    Anyways, Aaron, thank you so very much. =D That’s an awesome comment.

    Donnacha - The P thing sounds like something within your template needs removed.

    2. Did you clear your cookies and try to log in & out again? I had that same problem with it wanting to keep me in, until I cleared cookies and made them start working as 1.

  7. Robert Says:

    I recently integrated bbPress with a WPMu + BP site and had the single sign on working fine. However, if I logged in to the main site as a user who also had a blog on the site, I noticed that I had to log in again when the domain changed from domain.com to user.domain.com. I did some trouble shooting and when I removed these lines from wp-config.php:
    define(’COOKIE_DOMAIN’, ”);
    define(’COOKIEPATH’, ‘/’);
    It worked again. Funnily enough, the forum single sign on still worked so… is anyone else experiencing similar issues or do I have gremlins in my install?

  8. Chris Says:

    I haven’t noticed this but, my opinion is, if everything works without the 2 define codes, leave them out. Especially if having them in there breaks it.

    I will most definitely check it out later though and see if I can recreate the issue.

  9. Robert Says:

    Doing some testing on this right now… When you leave those lines out, then, if you log in with the forum login, and try to log out, you stay logged in. In other words, you can’t log out any more (unless you manually clear the domain cookies). Putting the lines back in enables you to og out. It’s annoying :).

  10. Robert Says:

    I’ve fiddled around some more with this forum integration on a new WPMu + BP + bbPress install and can definitely reproduce the problem when you have:
    define(’COOKIE_DOMAIN,”);
    in your wp-config.php

    So to produce this issue, you have to create another site blog as either admin or a normal site user. Then log in as the user and try to access your blog dashboard via the Buddypress admin bar. You should get a standard WP log in dialog (which really shouldn’t happen).
    When you remove the COOKIE_DOMAIN define, being automatically logged into your blog works again however, it disturbs the log out function. It turns out you can’t log out on the forum log out any more…

    After a bit more digging, I added a line of code into bb-settings.php at line 620:

    if ( bb_match_domains($bb->uri, $bb->wp_home) ) {
    if (!$bb->cookiedomain) {$bb->cookiedomain = '.' . $cookiedomain;} // cookiepath = bb_get_common_paths($bb->uri, $bb->wp_home);
    $bb->wp_cookies_integrated = true;
    } elseif ($cookiedomain && strpos($cookiedomain, '.') !== false) {
    $bb->cookiedomain = '.' . $cookiedomain;
    $bb->cookiepath = bb_get_common_paths($bb->uri, $bb->wp_home);
    $bb->wp_cookies_integrated = true;
    }

    And things seemed much better now… Still, using the bbPress forum login, logs you into the site but again, not into your blog dashboard… for that, you still need to be logging in with the WPMu site log in…

    That’s what I’ve discovered…

  11. Robert Says:

    Ooops that code snipped got mangled a bit. Here we go again:


    if ( bb_match_domains($bb->uri, $bb->wp_home) ) {
    if (!$bb->cookiedomain) {$bb->cookiedomain = '.' . $cookiedomain;} // ADDED THIS LINE
    $bb->cookiepath = bb_get_common_paths($bb->uri, $bb->wp_home);
    $bb->wp_cookies_integrated = true;
    } elseif ($cookiedomain && strpos($cookiedomain, '.') !== false) {
    $bb->cookiedomain = '.' . $cookiedomain;
    $bb->cookiepath = bb_get_common_paths($bb->uri, $bb->wp_home);
    $bb->wp_cookies_integrated = true;
    }

  12. Chris Says:

    Hmmm…. I’ll go now and log in and see what happens when I go through those steps.

  13. Chris Says:

    Well, I’m having an awesome time tonight. I can’t get my ftp client to work. I’ll be calling my ISP tomorrow and giving them an earfull.

    So basically, I’m stuck and can do absolutely zero investigating.

    Your best bet at this point is to bring up the subject at the buddypress forums. I’ll be sure to check it out as soon as I have access to FTP again, but for now, I’m stuck. If you get this figured out, please let us know. =D

  14. Robert Says:

    No problem. It would be good if you can confirm this before I take this further… drop me a tweet when you have news, cheers :)

  15. Jonathan Says:

    Great tutorial! Thank you so much for taking the time to give such detail.

    After following the instructions almost exactly, I still find that I cannot log in to WPMU and automatically be logged into bbPress. The only inconsistency I found between the steps you outline and my own actions were at step 18, "You should have 7 different keys to paste. If you don’t have 7, follow the instructions under the 'salt' key boxes to get those codes." My installation of bbPress only had 6 boxes in which to insert keys: the "NONCE_KEY" was left out.

    Is it at all possible this could be part of the problem? For example, step 41 tells us to replace the 4 keys in bb-config.php with all 7 keys from wp-config.php, which I did as instructed, but if I could not include the "NONCE_KEY" during the initial install, how might this step be affected?

    If this is not the problem, do you have any idea what else it might be? Thank you for your time.

  16. Jonathan Says:

    Problem solved! Although I had saved my wp-config.php after completing steps 36-38, I did not re-upload the file to replace the unmodified version! Your write-up worked great. Thank you very much for your time and effort. :)

    For the record, I used Wordpress-MU-2.7.1, BuddyPress.1.0, and bbPress-1.0-alpha-6 and following this tutorial worked perfectly. (Barring user error, of course.)

  17. TheEasyButton Says:

    Thank you very much for leaving a comment Jonathan. I think maybe in the future I'll be more specific about save & upload. I do that all of the time!!!

    The 6 vs 7 thing is something I really should've changed also. In the new tutorial that I wrote specifically for the new release, I actually totally skip this step of entering info into those spaces. Well, not skip. But we skip pasting the codes and just stick some non-sense in there. It's much faster that way.

    When we do the paste into the bb-config, we're actually overwriting everything we spent that time pasting so it seems like a total waste of time.

    But again, thank you for checking out the tutorial. I'm so happy to hear it worked for you. =D

  18. symm2112 Says:

    I'm having a problem I can't get around. The integration seemed to go just fine but here is my process.

    1. Create a group, including discussions.
    2. Forum is created just fine. I can go INTO bbpress and create a topic and see it listed on the group "active forum topics"
    3. HOWEVER, if I try to click on the link on the group page to either go to the "see all" link for forums or click on the topic itself, it doesn't find it. It seems to be a permalink issue. I'm using name based permalinks for bbpress but I've tried all of the settings with no luck. It knows that SOMETHING is there, it's just not creating the right links and I don't know where it's going wrong. Has anyone seen this?

  19. admin Says:

    Sorry but no. This isn’t something I’ve seen.

  20. mark Says:

    What about missing cookie salt keys?

    Is there a tutorial on getting these as Im really confused and cant find any documenation on them.

    I’ll bookmark this page and return 2moro hopefully you can help me.

  21. ehegwer Says:

    I’m getting a redirect loop - after logging in, and then out, and trying again, it gives a redirect error

  22. Chris Says:

    @Mark - Are you using the new release of BP? These should automatically be placed in your wp-config. If not, let me know. And I’ll see if I can remember where to get them from. My own install doesn’t have the option of “getting them”. One thing you can do is just create keys on your own. Just put a big string of letters and numbers between the single quotes.

    @ehegwer - Sometimes, if you get the trailing slash wrong, you’ll loop. You could possibly try doing another install and watch step 13. Also, if you’re using the official release of buddypress, please use the other tutorial.

  23. Andy Says:

    Magnificent - worked first time. Thanks, I rarely get that first time satisfaction.

    Top Work
    ;)

  24. Chris Says:

    Cool beans Andy!! And thanks for letting us know it worked for you. =D

  25. ghettoblast Says:

    bbPress rules, I’ve just set up my first bbPress forums about games ^^ I recommend http://www.bbpressthemes.net for cool bbPress templates.

  26. Christopher Says:

    Thanks for these instructions. This is my first integration between BuddyPress and BBPress. I installed the bbpress plugin for BuddyPress as well.

    Everything seems ok re: my login information is shared between BuddyPress and BBPress. And, I can see the user data is shared.

    However, I still have to login when I go from BuddyPress to BBPress. Shouldn’t this be automatic now?

    Thanks again.

  27. Chris Says:

    First, I would recommend that you use the more updated tutorial & a different version of bbPress.

    http://theeasybutton.com/blog/2009/04/30/integrating-buddypress-10-wpmu-and-bbpress is where you can find both.

    If you’re using a different version of bbPress, this tutorial won’t work. Right now, my most updated tutorial uses bbPress alpha 6. I’m still working on integration for the newest release (bbPress 1.0.1) but hope to have that out soon.

    But, yes. You should be logged in & out on both sides no matter where you input your name/pw. Sometimes clearing cookies & cache helps.

  28. Christopher Says:

    I appreciate the reply back. Yes, I’m runing the latest bbpress, wpmu and buddypress.

    I went back and triple-checked that I followed the instructions, that the 7 lines from my wp-config replaced the 4 lines in bb-config (and added the bb_ prefix). Cleared my cache, rebooted my test machines and confirmed the settings and plugins.

    Unfortunately, while I can log into both systems with the same username/profile, it’s not automatic. And, there’s no option within my groups to create a forum either.

    If anyone else is running the latest I’d appreciate any guidance on things to look for. I suspect that had this been an upgrade it may have been a non-issue, but perhaps brand new installs of all 3 result in something being missed.

  29. Debty Says:

    Ahaan… I will follow.

About The Author

As a long time blogger & user of WordPress, my goal is to keep you from banging your head on your desk as much as I've banged my own. More...

Close
Powered by ShareThis