Forums

Join
bbPress Support ForumsTroubleshootingtrick for profile page -> add user post and topic count

Info

trick for profile page -> add user post and topic count

  1. Since bbpress.org doesn't have a "tips and tricks" I'll post this here.

    If you'd like to tweak your profile.php template to show the total posts and topics started by a user, add this code under "bb_profile_data()"

    <?
    echo "forum posts: <b>".$bbdb->get_var("SELECT COUNT(*) FROM bb_posts WHERE poster_id = $user_id AND post_status = 0")."</b> &nbsp; "
     ." topics started: <b>".$bbdb->get_var("SELECT COUNT(*) FROM bb_posts WHERE poster_id = $user_id AND post_status = 0 AND post_position = 1")."</b>";
    ?>

    I'd make this into a plugin but I don't know how to append information within the profile (ie. attach to bb_profile_data)

  2. awesome, just what i was looking for! thanks :)

  3. Great, tnx! ;)

  4. Its been 20 months since #784
    Here are the queries I wrote which will take care of different bbPress table prefixes too :
    http://blog.ashfame.com/2009/09/show-post-count-topics-started-bbpress/

  5. You must log in to post.