posted Tuesday, July 29th, 2008
When I first started installing bbPress for a client, here are some issues that I faced. I’m giving you the solutions so you don’t have to go thru the entire process of searching for an answer.
For the moment there is no such option in bbPress. The basic documentation does not provide this very essential piece of information. After much research this is what I found:
<?php bb_option('uri'); ?>my-templates/your-template-directory-name
<?php if ( is_bb_profile() ) profile_menu(); ?></p>
If you try placing profile_menu(); outside of this page, it gives an error.
I assumed there had to be direct links that can be placed anywhere for Profile, Edit Profile and Favorites. I was right. Here is the code you can add to your logged-in.php file so these links appear only when a user is logged in:
For Profile Link:
<?php printf(bb_get_profile_link(Profile, bb_get_current_user_info( 'name' )));?>
For Edit Profile
<?php echo '<a href="'.get_profile_tab_link( bb_get_current_user_info( 'id' ), "edit" ).'">Edit Profile</a>' ?>
For Favorites
<?php echo '<a href="'.get_profile_tab_link(bb_get_current_user_info( 'id' ), "favorites" ).'">Favorites</a>' ?>
This function can then be called using:
<?php login_form(); ?>
This displays the file login-form.php if your user is not logged in. And logged-in.php with the links you just added if they are.
One is a secret key found in your wp-config.php file. This is defined as:
define('SECRET_KEY', 'YOUR-KEY-HERE'); // Change this to a unique phrase.
YOUR-KEY-HERE needs to added as is.
The second part is a Secret field which can be found in your WordPress admin. You will get the direct link on the instalation page.
Now guess what I did? I mixed up the two.
It was easy to change the first one via bb-config.php as it was defined the same way it was in wp-config.
Now how to change the Secret field to the correct one? There is a section under Settings in the bbPress admin called WordPress Integration. You can make changes here. However, lady luck was not favoring me. It just wouldn’t update the field and kept logging me out. And the integration could not work until I updated the field. I was caught in a vicious cycle.
Anyway turns out you can also update your Secret field by adding a line to bb-config.php. The value is then picked up from here. Of course you need to remove it once the value has updated as it is not very secure having both parts of the key in your config file.
So just in case you have a problem updating your Secret field, here is the code to add to bb-config.php
$bb->secret="VALUE-HERE";
The script itself is pretty good! It is the lack of documentation which can be problematic. I hope they come up with something as good as the WordPress codex pretty soon.