Skip to:
Content
Pages
Categories
Search
Top
Bottom
Codex HomeLegacy DocsArchived Section: Getting Started → Using an existing bbPress installation for your BuddyPress Forums

Using an existing bbPress installation for your BuddyPress Forums


Archived file. Good only up to BP 1.5 version


***The following pertains to sites wanting to use an existing bbPress installation (v1.x) with BuddyPress***

*** NOTE: This is a very rare scenario!  You will not need to follow this guide unless you are running a bbPress 1.x install on your site! ***

If you choose to enable group forums on BuddyPress, you will have the option to “Set up a new bbPress Installation” or to “Use an existing bbPress installation“.

What does this mean necessarily?

If you don’t have a standalone, existing version of bbPress 1.x installed somewhere, then all you have to do is click on “Set up a new bbPress installation“. Stop reading this article! You’re done!

Now, if you have an existing bbPress 1.x install, you have a choice to make.

Set Up a New bbPress installation

Pros

Cons

Use an existing bbPress installation

Pros

Cons

***Regardless of which choice you make, by default, there will be two entry points for forums. Your existing bbPress install URL and the BuddyPress global forums URL (eg. http://testbp.org/forums).***

Still want to go ahead with using an existing installation? Go ahead and click on “Use an existing bbPress installation” and follow the steps.

Then, implement the following to ensure your BuddyPress group forums are not publicly displayed on your existing bbPress install.

1) Change the forum slug in BuddyPress (optional)

By default, BuddyPress forums can be accessed at:
hxxp://example.com/forums/

If your existing bbPress install is also installed in /forums/, you’ll want to rename BuddyPress’ forums slug to something else.

You can do this by adding the following line in your wp-config.php:

define( 'BP_FORUMS_SLUG', 'group-forums' );

In the example above, your BP forums can now be accessed at hxxp://example.com/group-forums/

2) Create a new forum category in standalone bbPress

By default, BuddyPress will create new forums in your existing bbPress install under forum id #1 . We do not want to do this. So we’re going to create a new forum category to house these new BuddyPress forums.

  1. First, login to your existing bbPress admin area and click on “Forums”.
  2. Next, scroll down and create a new forum category. You can call this forum category “Group Forums” or whatever you want! Under “Make this forum a category”, ensure that this is checked.
  3. Note down the forum ID of the forum category you just created. (You can get the forum category ID by mousing over the “Edit” link and checking the “id” parameter.)

3) Tell BuddyPress to use this new forum category

In step #2, we created a new, forum category to house our BuddyPress group forums. Now we want to tell BuddyPress to use this new forum category.

This can be done by adding the following define to wp-config.php:

define ( 'BP_FORUMS_PARENT_FORUM_ID', $forum_id );

Change $forum_id to the forum ID from step #2. Now, all new BuddyPress group forums will be created in standalone bbPress under this new forum category.

3) Hide BuddyPress group forum data in standalone bbPress

Now, the last issue we have is hiding all BuddyPress group forum related data from access and view on your existing bbPress installation.

We’re going to be using _ck_’s Hidden Groups plugin to do this. Please install and activate the plugin on your existing bbPress install.

Next:

  1. Open up the plugin (hidden-forums.php) in a text editor.
  2. Comment out this line:
    $hidden_forums['hidden_forums']=array(500,501,502); // hide these forums, list by comma seperated number
  3. Underneath that line, add the following:
    $bp_hide_group_forum_category_id = $forum_id;
    
    $hidden_forums['hidden_forums']=array();
    $hidden_forums['hidden_forums'][] = $bp_hide_group_forum_category_id;
    
    $forums = get_forums();
    foreach ($forums as $forum) {
    	if ($forum->forum_parent == $bp_hide_group_forum_category_id)
    		$hidden_forums['hidden_forums'][] = $forum->forum_id;
    }

Change the $bp_hide_group_forum_category_id variable to the forum category ID you noted down in step #2.

And that should be it! By default, the admin can view every single forum post on your bbPress install, so try viewing your bbPress install when you’re logged out!

* Posted by r-a-y, July 16, 2010. This how-to was originally based on this forum post.

Skip to toolbar