0

I posted this same question on WP Forum, but it's completely dead.

So, there is a great tutorial in this blog about showing post count in bbPress at this link.

According to that article, to show post count in bbPress, I should replace

<?php bb_profile_data(); ?>

with the following code

<?php bb_profile_data(); ?>
<div id="user-stats">
 <?php
 global $bb_table_prefix;
 $query1 = "SELECT COUNT(*) FROM ".$bb_table_prefix."posts WHERE poster_id = $user_id AND post_status = 0";
 $query2 = "SELECT COUNT(*) FROM ".$bb_table_prefix."posts WHERE poster_id = $user_id AND post_status = 0 AND post_position = 1";
 echo "Forum Posts: <b>".$bbdb->get_var($query1)."</b> &nbsp; ";
 echo " Topics Started: <b>".$bbdb->get_var($query2)."</b>"; ?>
</div>

But I've only one question. Where in the world is that bb_profile_data(); tag. Please help me, it's very important for me...Thanks you guys!!

  • Your links are missing. – birgire May 24 '13 at 15:38
  • If you're on a UNIX-like OS, and have shell access, try this from the bbPress root directory: find . -exec grep -iHn bb_profile_data {} \; – Pat J May 24 '13 at 16:21
0

From this reference you get the following info:

Function and Method Cross Reference

bb_profile_data()

Defined at:
/bb-includes/functions.bb-template.php -> line 2405
Referenced 1 times:
/bb-templates/kakumei/profile.php -> line 30

so you should check your profile template.

If you have ssh access to your site, try

# grep "bb_profile_data" -R /the/path/to/your/site/

in the shell command line, to search for the bb_profile_data string in all the files within the /the/path/to/your/site/ directory.

Update:

In bbPress 2.3.2 you seems to have instead:

 <p class="bbp-user-forum-role"><?php  printf( __( 'Forum Role: %s',      'bbpress' ), bbp_get_user_display_role()    ); ?></p>
 <p class="bbp-user-topic-count"><?php printf( __( 'Topics Started: %s',  'bbpress' ), bbp_get_user_topic_count_raw() ); ?></p>
 <p class="bbp-user-reply-count"><?php printf( __( 'Replies Created: %s', 'bbpress' ), bbp_get_user_reply_count_raw() ); ?></p>

in the file /plugins/bbpress/templates/default/bbpress/user-profile.php to display the topics and replies count. You can view the source here.

| improve this answer | |
  • Thanks for replying. I'm using bbPress 3.2 and there is no /bb-includes/functions.bb-template.php path in my bbPress. – Hardeep Asrani May 24 '13 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.