EMF_saurus
Member
Posted 1 year ago #
Perhaps I'm missing something in the documentations, but I would like to display the points a person has earned beneath their name when they post a comment. I see you can use the cp_displayPoints() function, but that will only show your own points upon display.
Any thoughts?
http://wordpress.org/extend/plugins/cubepoints/
Peter Zhang
Member
Posted 1 year ago #
cp_displayPoints() take in a parameter $uid, which, as its name suggests, is the id of the user that you want to display the points amount of.
So, your code should be something like cp_displayPoints($comment->author);
EMF_saurus
Member
Posted 1 year ago #
Sorry I'm not quite figuring this one out; I'm still a bit basic with PHP.
I implemented cp_displayPoints($comment->author); in the appropriate place, but now it seems to be outputting the number of points of whoever is logged in and viewing them. I'm not sure I'm necessarily using the right parameter there or if I need to do something elsewhere.
This is how I have mine and it works fine. It displays like this [ 1015 points ]
<?php $user = get_userdata($comment->user_id); if(function_exists('cp_displayPoints') && $user->ID){
echo '[ ';
cp_displayPoints($user->ID);
echo ' ] ';
} ?>
EMF_saurus
Member
Posted 1 year ago #
That works for me as well... except now I've realized I'm not putting it in the right place/file after all. Where is yours?
Depends on your theme really. What's a link to your site and theme your using?
thanks xberserker! The code works perfectly.
It doesn't work for me... I am not using buddy press though, just wpmu?