Skip to:
Content
Pages
Categories
Search
Top
Bottom

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


  • _ck_
    Participant

    @_ck_

    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)

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.