Hi Loc Pham, welcome back.
No they are not broken, otherwise over 200.000 others would have complained already.
Are you giving the user_id as an integer as parameter ?
Are you always getting 0 or you are not getting the correct result ?
Pascal.
Hi Pascal,
Yes, I passed in the user id for admin and I’ve always got “0” back and admin had created many topics already.
bbp_get_user_post_count(1, false);
Thanks.
It works for me if I passed the reply/topic post author’s ID, it doesn’t update immediately though. Running the repair tools for calculating each users counts one by one in Tools > Forums fixed that.
I think auto-updating the count is part of the latest dev version though.
Here is the code I used to test it very quick. I just placed this in loop-single-reply.php.
<?php print bbp_get_user_reply_count( bbp_get_reply_author_id() ) ?>
Repairing the counter via Tools menu did the trick. Thank you for your help.
I encountered the same Problem as Loc: The count returned by bbp_get_user_reply_count
does not update with the user’s activities in the forums. The bbp_get_user_reply_count_raw
computes the count directly from the database, which is computationally more expensive, but delivers a correct count.
Furthermore Robkk is right: I just had a look at the source code of bbPress 2.6-alpha, and has added and hooked some functions to correctly increase and decrease the post count on user’s actions such as creating and deleting posts.