WordPress.org

Ready to get started?Download WordPress

Forums

CubePoints
Displaying points in comments (9 posts)

  1. EMF_saurus
    Member
    Posted 3 years 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/

  2. Peter Zhang
    Member
    Posted 3 years 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);

  3. EMF_saurus
    Member
    Posted 3 years 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.

  4. Tosh
    Member
    Posted 3 years ago #

    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 ' ] ';
     } ?>
  5. EMF_saurus
    Member
    Posted 3 years 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?

  6. Tosh
    Member
    Posted 3 years ago #

    Depends on your theme really. What's a link to your site and theme your using?

  7. sheryll
    Member
    Posted 3 years ago #

    thanks xberserker! The code works perfectly.

  8. kateM82
    Member
    Posted 3 years ago #

    It doesn't work for me... I am not using buddy press though, just wpmu?

  9. kateM82
    Member
    Posted 3 years ago #

    bump!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags