Re: How do you show a member's total post count?
@3sixty’s solution is a good one.
As for the question of how to get the user id, it really depends on exactly where you’re trying to pull it up. It sounds like in this case you want the user id for the last poster in a topic, so you should go to the template that controls the forum loop (bp-themes/bp-default/forums/forums-loop.php and see what’s being used to pull up the last poster’s name. In this case it’s bp_the_topic_last_poster_name. So go looking for that function. Usually if a function is referenced in a template file, it’s in the corresponding component -templatetags.php file; in this case, it’s buddypress/bp-forums/bp-forums-templatetags.php. If you look at the definition for bp_the_topic_last_poster_name, you can see that it’s getting its information from the global $forum_template that happens in the forum loop. Use print_r to print that global to your screen, and look for the ID that you’ll need.