bb_new_topic_link('your text here');
okay, so I figured out that “<?php bb_new_topic_link(); ?>” creates a hyperlink that says “add new >” linking to the place to start a new topic.
How can I customize that text? ie – what’s the php for just the link, so I can say:
<a href="THE LINK">something else<?a>
So, I’m learning how to hack around these bbpress themes pretty nicely, but sometimes the php confounds me. For example, here’ some code from a basic front page:
<th><?php _e('Posts'); ?></th>
<th><?php _e('Last Poster'); ?></th>
<th><?php _e('Freshness'); ?></th>
Simple table headers, but what’s the point of the php? Why don’t I just slap the words in there exactly how I want it? Isn’t this just churning resources? Why wouldn’t I just do this:
<th>Posts</th>
<th>Last Poster</th>
<th>Freshness</th>
Thanks!
Trick is for bbPress functions, half of them are WordPress functions, just sometimes with bb_ on the front, so they behave essentially the same. A fair few others are just aliases to return data instead of outputting it (i.e. get_forum_link vs. forum_link). Beyond that though, yeah it’s all pretty undocumented, but it’s usually relatively obvious from the name and parameters it takes.
I’d love to be able to help right a bbPress Codex mind you…
I noticed this situation as well, though I haven’t had time to look fully into it – it seemed that a new user when signed up was automatically set to inactive, but upon logging in, or posting, they became active. I’ll have to check further when I get the chance to see if this is a ‘problem’ or just a ‘feature’.
get_forum_id()
ie;
<?php if (get_forum_id() == 12): ?>
text block
<?php endif; ?>
A lot of these functions aren’t nearly as well documented as WordPress’ own similar functions, but can all be found inside of bb-includes/functions.bb-template.php
@gouri, bbpress is standalone software that is meant to run by itself, or alongside practically anything you choose. In the case of deep integration, if that’s your plan, yes it will work on either WordPress.org or WordPress µ
function login_form() {
if ( bb_is_user_logged_in() )
bb_load_template( 'logged-in.php' );
else
bb_load_template( 'login-form.php', array('user_login', 'remember_checked', 'redirect_to', 're') );
}
I would really love to know the 2nd option, so i can place that code in my forum.php
it would be nice to display a block of text when users visit some sections of my forum.
but im not so good with statements, can u code an example?
Slight difference between bb_load_template() and include(), bb_load_template() can take as it’s 2nd argument an array of containing the names of variables to be used as globals within the template, whereas using include() the included file just inherits all the global variables from the parent.
delayedinsanity, you beauty. As far as I can see, this is the problem. I switched to using wp-load.php and the status in the header is 202 without my hack. What’s more, it corrects this issue:
https://bbpress.org/forums/topic/wpmu-284a-deep-integration-breaks-rss-feed
Many thanks.
So to sum it up. I was previously doing the following in bb-config.php for deep integration:
require_once('/var/www/vhosts/youlookfab.com/httpdocs/wp-blog-header.php');
But it broke RSS feeds and put 404 headers in my forum pages. The following seems to solve both issues:
require_once('/var/www/vhosts/youlookfab.com/httpdocs/wp-load.php');
I’m running a forum, which has a sidebar on the left, it was a pain to edit that sidebar, so I tried some including today.
If you want to including a file in to your forum, use this code:
<?php bb_load_template(‘sidebar.php’);?>
Add that sidebar.php or whatever you want to call it in your template folder.
It works similar like the one we are used to using for WordPress:
<?php include(TEMPLATEPATH.”/sidebar.php”);?>
Glad to see what I am saying confirmed with independent realworld proof.
Pleased to be of service. 
BTW, just how big is your site that you require multiple db servers?
I don’t know of a single WordPress+bbPress install, other than Automattic’s that are using multiple db servers.
(unless of course you are running other apps that have heavy db use or maybe for backup replication)
It’s more for redundancy than anything else, although before we got opcode caching in and had optimised some plugins involved we were catching traffic surges when our client tweeted new posts that were making us very very glad we had that much capacity.
There’s a reason for that.
Most of us still remember the days of Netscape 2.0, when everybodies website was inside of frames, they all blinked, every frame had a different background and almost every button was some kind of animation.
We’re all trying to pretend that it never happened. Animated what now?
Which pages are you getting the 404 header on? I just crawled my local copy quickly with firebug and was getting 200’s across the board. I’m probably missing a few of the pages though, I just loaded it up and started clicking away.
heyho,
so i guess this is going to be my last question and i should be done now with my bbpress template .
so i need a placeholder link for normal logged in folks like
<?php if ( is_admin() yadda yadda php xy bla bla() ) : ?>
<table>
<tr>
<td>
<li><?php bb_admin_link();?></li>
</td>
</tr>
</table>
or else
<table>
<tr>
<td>
<li><?php bb_any_link();?></li>
</td>
</tr>
</table>
what kind of bbpress/php tags do i need?
thankssssss a bunch
Guh. Last stab at it, the action only runs on a valid tag being added (rather than just an attempt being made to add one). Beyond that though, who knows, I’m running 2.8.2 SVN so it’s always hard to tell what’s just me
Looks like WordPress is setting the 404 because it doesn’t recognize the bbPress page that is loading.
When the global WP object is constructed, the function WP->handle_404 calls “status_header( 404 )”.
As a workaround, I modified “handle_404” to lay off the 404 if “BB_PATH” is defined (i.e. when a bbPress page is loading). This seems to work ok.
Here’s the new “handle_404” at around line 445 in “wp-includes/classes.php”.
function handle_404() {
global $wp_query;
if ( !defined( 'BB_PATH' ) && (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
// Don't 404 for these queries if they matched an object.
if ( ( is_tag() || is_category() || is_author() ) && $wp_query->get_queried_object() ) {
if ( !is_404() )
status_header( 200 );
return;
}
$wp_query->set_404();
status_header( 404 );
nocache_headers();
} elseif ( !is_404() ) {
status_header( 200 );
}
}
yeah that’s what i’m doing since 2 days (i allways try things first befor i ask), and this is kinda annoying if you’re in a “productive flow” with your template design.
aaaaanyway i may find this pisser … one day 
thanks kawa
just the the other way round haha , i need to hide those existing messages completely.
Not quite sure what you’re asking, but if you’re just trying to display a message to non-logged in users, use something like:
<?php if ( !bb_is_user_logged_in() ) : ?>
Welcome, please log in or register!
<?php endif; ?>
in front-page.php
My coding is pretty terrible too ;P I just learn from poking around in bbPress and WordPress and breaking things a lot, so you’re going about it the right way
well not really kawa i’ve just copy & pasted the message from this forum here (@chand it’s right on top of this forum), my forum is in german and i thought that sounds maybe chinese for a few if i post the german message so i copied the one from here. 
other than that , kawa you’re right i’m one of the most brilliant php coders you’ve ever seen, my backend know how is like …well ughhh beyond words lol
however, i use your trick with those fields, but yet an advice regarding to the “guest welcome/login message” ?
There might be a fatal database error, and database errors might hidden by default, $bbdb->suppress_errors( false ); will turn them on if they are. Obvious question is, does that work without any database interaction?
It’s not necessarily very obvious if it is run unless you get something to echo because it’s all hidden under AJAX
<?php
function status_tags_update( $a, $b, $c ) {
var_dump($a);
var_dump($b);
var_dump($c);
}
add_action('bb_tag_added', 'status_tags_update',100,3);
?>
I put that in my functions.php and it happily threw out some mangled HTML with the dumps underneath the tag list