WordPress.org

Ready to get started?Download WordPress

Forums

Author Avatars List
[resolved] Sorting Authors by cubepoints rating (7 posts)

  1. Sergeev
    Member
    Posted 3 years ago #

    Hi! Thanks for gteat plugin! It's a most customizeble plugin! =)
    But i need function to sort list authors by cubepoints (http://wordpress.org/extend/plugins/cubepoints/) rating.

    It's possible? And What i need to change in code?

  2. Ben
    Member
    Plugin Author

    Posted 3 years ago #

    Sure it's possible; you "just" need to add a new sorting option... have a look at changeset [120577], which shows what I've done to introduce a new option for sorting by "recent activity". Instead of get_user_last_activity() you need to use a function from the cubepoints plugin which retrieves the points for a user, and instead of checking for buddypress you should check for the cubepoints plugin.

    If you could supply a respective patch (howto 1, 2) at the end that would be great! Any questions, feel free to ask!

  3. Sergeev
    Member
    Posted 3 years ago #

    Thanks, Ben! I resolved it in enother way.

    I opened folder "Lib" in plugin folder and changed code in "UserList.class.php".
    in line 667 I replaced $total += get_usernumposts($user_id); on $total += get_usermeta( $user_id, 'cpoints', true );

    in line 672 $total += get_usernumposts($user_id); changed on $total += get_usermeta( $user_id, 'cpoints', true );

    AND in line 248 changed post, and posts on simbol of points. For example

    Thats all. Go to widget area of author-avatars and choose order by: Number of Posts and Sorting direction: descending.
    and if need display options: show nomber of posts and bio. (Bio i changed too. Like here: http://wordpress.org/support/topic/plugin-author-avatars-list-show-aim-web-or-similars-instead-of-bio-in-widget?replies=4 and it display number of points.)

  4. Ben
    Member
    Plugin Author

    Posted 3 years ago #

    Fair enough. Good if that works for you :-) Just be careful when you update the plugin because you will obviously have to re-apply your changes...

  5. kateM82
    Member
    Posted 3 years ago #

    Hi Ben,
    Thanks so much for the great plugin, and the instructions above.
    Anyway to take it one step further and show it with a time perameter (ie Users with highest cubepoints earned this week??)

    I still want to keep the over all points/posts tally. But want people to see who is most active this week if that makes sense.

    I think they are doing something similar with tags in this post but my php isn't good enough to figure out how to do apply it.

    http://wordpress.org/support/topic/limit-tags-by-date?replies=1

    thanks in advance!

  6. Ben
    Member
    Plugin Author

    Posted 3 years ago #

    Sorry, but the post above doesn't really apply here; you'd need a way to calculate cubepoints just for the past week; I don't know the plugin very well but from what I've seen that's not possible with cubepoints.

    It can probably be implemented by adding a new value for "the past week cubepoints" and recalculating that value at least once a day; either way, that's in the area of the cubepoints plugin... maybe you can ask the author for help on that front.

  7. kateM82
    Member
    Posted 3 years ago #

    Hi Ben,

    Thanks for responding. The cubepoints people seem to have been MIA since end of last year... hopefully they will come back online soon.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic