Hi,
I have some trouble with code posted without using backticks (i’m using a Geshi syntax plugin)
I noticed that the function “bb_autop” inside the file “functions.bb-formatting.php” adds new line characters before and after each html open/close tag (ul, li…). Responsible for this modification are these two rows:
$pee = preg_replace('!(<(?:ul|ol|li|blockquote|pre|p)[^>]*>)!', "n$1", $pee);
$pee = preg_replace('!(</(?:ul|ol|li|blockquote|pre|p)>)!', "$1n", $pee);
why is this replacement done?
The purpose of a plugin is to allow non expert people like myself to use all of their intelligence to figure out how to download such plugin and so they can make use of it and improve their user experience. It is not to pretend that there is a plugin by inserting code (which they wouldn’t have a clue how to do) in an already non compliant plugin and then search the internet and insert another item into the code of the non compliant plugin (with current version of the software) and hope it works.
I really do appreciate your help and guidance and suggestions, but I am a layman when it comes to computers and when I am looking for a plugin, I am really looking for a plugin and something that I can just download and have work.
Wow, it worked.
This is the code I used:
<?php if (get_forum_id() == 29): ?>
<?php bb_load_template('filename.php');?>
<?php endif; ?>
https://codex.wordpress.org/I18n_for_WordPress_Developers
Same concept for bbPress. You could make all those plain text if you like, they’re built that way by default for people who need to translate their sites.
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