A-  A  A+ RSS Feed

Deep Thoughts by Robert Felty

thoughts on wordpress, latex, cooking et alia

Archive for April, 2010

Friday, April 9th, 2010

Showing total number of replies in bbpress

showing total number of replies on a bbpress profile page

showing total number of replies on a bbpress profile page

For awhile now I have been wanting to show the total number of topics started and replies in a bbpress forum on the profile page. Today I finally figured out how. I like bbpress quite a bit, as it integrates very nicely into wordpress. The main downside of bbpress right now is that the documentation is still basically nonexistent. Maybe someday I will help out with it.

Anyways, to get the total number of replies, simply use the following little mysql query:

<?php
global $bbdb;
$totalReplies = $bbdb->get_var("SELECT COUNT(post_id) FROM " .
$bbdb->prefix . "posts WHERE poster_id=$user->ID");
?>

To get the total number of topics started, use:

<?php
global $bbdb;
$totalTopics = $bbdb->get_var("SELECT COUNT(topic_id) FROM " .
$bbdb->prefix . "topics WHERE topic_poster=$user->ID");
?>
Thursday, April 1st, 2010

New wordpress plugin – category reminder

Category reminder screenshot

Category reminder screenshot

I recently released my sixth wordpress plugin – category reminder. I have seen several requests around for a plugin which forces users to select a category for each post they publish, so that the posts don’t just end up as uncategorized. Bloggers with multiple authors seem especially interested in this. I have wanted this requirement for myself as well, since I sometimes forget to categorize a post before publishing it. Now users can easily add this functionality via this plugin.