Since I don’t actively develop for bbPress 1.x at this time, you’re on your own with these ones.
bbPress is a forum platform by the same people who do WordPress. It’s very much a barebones bulletin board system (which makes layers on layers of bb jokes). bbPress is not for the non-techy at this point. It’s still in alpha mode, with a lot of rough edges, and is comparable to WordPress 1. Maybe. Most of the features are done as plugins, rather than defaults, so you don’t get things like PMing and Quick Tags and inline images. You have to add in plugins for that. While I was using it, I wrote a few of my own plugins and hacks to make things work like I wanted.
All of these hacks can be directly applied to the functions.php file of your theme.
Change ‘Sticky’ to an image
If you make a topic sticky it gets ‘pinned’ to the top of the forum. This great for things like announcements etc. It’s really annoying that it’s hard to change. I wanted a post-it image to show that it was pinned, so I made a function to delete the default function and replace it with my own.
This goes in your functions.php for your theme, just like it would for WordPress
<?php // This sets sticky label as an image remove_filter('bb_topic_labels', 'bb_sticky_label', 20); function my_sticky_label( $label ) { global $topic; if (is_front()) { if ( '2' === $topic->topic_sticky ) { return sprintf(__('<img src="/images/sticky.png" alt="[sticky]" /> %s'), $label); } } else { if ( '1' === $topic->topic_sticky || '2' === $topic->topic_sticky ) { return sprintf(__('<img src="/images/sticky.png" alt="[sticky]" /> %s'), $label); } } return $label; } add_filter('bb_topic_labels', 'my_sticky_label', 20); ?>
Change the text of a ‘Closed’ topic
By default when you close a topic it renames the topic to Closed: Topic Name. I wanted to change that to Read Only: Topic Name, so what I did was delete the old closed filter and replaced it with my own.
<?php // This sets closed lable to read as 'read only' remove_filter('bb_topic_labels', 'bb_closed_label'); function my_closed_label( $label ) { global $topic; if ( '0' === $topic->topic_open ) return sprintf(__('[Read Only] %s'), $label); return $label; } add_filter('bb_topic_labels', 'my_closed_label'); ?>
Woopra
If you use Woopra to monitor traffic and Gravatar for icons, you may notice that just slapping Woopra’s tracker in the bottom of your site doesn’t show the Gravars. Since bbPress themeing is what it is, I put this in my theme’s footer.php file to make gravatars show up in my Woopra console. The trick was getting it to extract the logged in user’s email. So here it is. Put this in your footer file and Woopra will show gravatars.
<!-- Woopra Code Start --> <?php global $user_id, $user_email, $user_identity; $woopra_name = bb_get_current_user_info( 'login' ); $woopra_email = bb_get_current_user_info( 'email' ); if ( $woopra_name == '') { echo "<script type=\"text/javascript\">"; echo "\n"; } else { echo '<script type="text/javascript">'; echo "\nvar woopra_visitor = new Array();"; echo "\nwoopra_visitor['name'] = '$woopra_name';"; echo "\nwoopra_visitor['email'] = '$woopra_email';"; echo "\nwoopra_visitor['avatar'] = 'http://www.gravatar.com/avatar/" . md5(strtolower($woopra_email)) . "&size=60&default=http%3A%2F%2Fstatic.woopra.com%2Fimages%2Favatar.png';"; echo "\n"; } ?> var _wh = ((document.location.protocol=='https:') ? "https://sec1.woopra.com" : "http://static.woopra.com"); document.write(unescape("%3Cscript src='" + _wh + "/js/woopra.js' type='text/javascript'%3E%3C/script%3E")); </script> <!-- Woopra Code End -->