Plugin Author
myCred
(@designbymerovingi)
Not sure I understand where exactly you want to include these details. You have to forgive me but I am not that well versed with bbPress. Is it in the admin area or alongside topics and replies? A screenshot always helps! 🙂
Thread Starter
Nykess
(@nykess)
Hi Gabriel,
I have included a screenshot of where I would like for this information to appear:
http://img546.imageshack.us/img546/8953/wep6.jpg
Thanks!
Plugin Author
myCred
(@designbymerovingi)
Have you selected “Show users points balance in replies” on the myCRED > Hooks page for bbPress?
Thread Starter
Nykess
(@nykess)
Didn’t even see that option; it was really hidden. Thank you!
How can I put the “Ranks” just under that?
Plugin Author
myCred
(@designbymerovingi)
You need to use the ‘bbp_theme_after_reply_author_details’ action hook.
add_action( 'bbp_theme_after_reply_author_details', 'add_rank_in_author_details' );
function add_rank_in_author_details()
{
$reply_id = bbp_get_reply_id();
if ( bbp_is_reply_anonymous( $reply_id ) ) return;
$user_id = bbp_get_reply_author_id( $reply_id );
if ( mycred_exclude_user( $user_id ) ) return;
echo 'Rank: ' . mycred_get_users_rank( $user_id );
}
Thread Starter
Nykess
(@nykess)
Can you please specify where this should be added? I don’t know much about adding hooks.
Thank you.
Plugin Author
myCred
(@designbymerovingi)
All code goes in your themes functions.php file.
The last part of this doesn’t work. When I add:
add_action( 'bbp_theme_after_reply_author_details', 'add_rank_in_author_details' );
function add_rank_in_author_details()
{
$reply_id = bbp_get_reply_id();
if ( bbp_is_reply_anonymous( $reply_id ) ) return;
$user_id = bbp_get_reply_author_id( $reply_id );
if ( mycred_exclude_user( $user_id ) ) return;
echo 'Rank: ' . mycred_get_users_rank( $user_id );
}
All that happens is that the reply topic is echo’ed .. not the user’s rank.
Plugin Author
myCred
(@designbymerovingi)
@george How many ranks do you have setup? Try this: Go to myCRED > Settings > Management and click “Assign Ranks to Users” to see if that resolves the issue.
On my bbpress forum posts, the rank displays as: Member
On my buddypress, the user’s username is displayed as the rank.
See example here: http://oi39.tinypic.com/aytwma.jpg
We have 5 ranks.
I assigned ranks to users, no luck.
THANKS Gabriel for the awesome code, it worked like a charm !
@gabriel I wonder how I can put the rank of my forum below of the use nickname – http://puu.sh/8h8Dv.jpg
Plugin Author
myCred
(@designbymerovingi)
@vinaunder – The above code will insert the rank after the users avatar and username.
You might want to use some CSS styling to move the rank in the desired position. Otherwise check your bbPress template files to see what other positions you could use to insert the rank. bbPress comes with tons of useful action hooks for these type of scenarios.