Are there adjustments you can make to the code to show the total user points written beside each user name each time it appears? For example, when I post an article and the link to my user name appears, it would read "posted by Seanjuan (12)". It would be nice to let the admin determine the style in which the number appears, like parenthetical or hyphenated or whatever they like.
It would also be really cool to sort the entire list of users by the total user points, ascending or decending, etc.
Just a suggestion, thanks!
Sean
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | userpoints.txt | 6.16 KB | kbahey |
| #4 | userpoints.module | 5.95 KB | kbahey |
Comments
Comment #1
kbahey commentedThe first one may be difficult to implement, since it requires changes everywhere the user is displayed, so it involves changes to other modules.
What can be done is to provide a link to the points in the user's profile. This can be done in the userpoints_user() function.
Try this, and if it works, I can can commit to the repository.
Add the following 4 lines after the "break;" line in that function.
See if it works.
A user list is possible. The "Highest Users" block already does half of that.
Comment #2
sciman commentedNot sure I'm understanding what this would do, or how to execute changes to the script, but I'd sure like to have a way, as administrator of identifying user points of all members of a community. I use drupal in teaching, and metrics of involvement in the site can be part of a grading scheme. If there were a table of some sort for administrators to display at least summry point results across authenticated users or users of various roles by participant, that would be cool. If each user had a running point total on their user page, that would be an improvement;-)
Comment #3
seaneffel commentedThanks for the updates, but I need a little more information so I can try your extra code. I'm pretty darned good at the cut-n-paste but I need to know exactly where that new code belongs, if not line numbers then tell me the string I should search for. And I assume I should add this to my .module file, right? Thanks for the clarification!
Comment #4
kbahey commentedHere is a version with the above modification. It returns a new item called "points" to the user object when it is viewed.
Copy the module to the modules directory, then go to a user and view him (e.g. example.com/user/23), and see if anything is displayed.
sciman, for displaying all users with points, a page need to be added to the module to do this. It is not difficult, but I will get to it when time permits.
Comment #5
seaneffel commentedThat file doesn't do much for me, I don't see any display of points or numbers aside from the block that appeared there from your orginal code.
http://www.cctvcambridge.org/user/17
Comment #6
kbahey commentedTry replacing the function userpoints_user() as follows:
Comment #7
seaneffel commentedThat change, as long as I did it right, caused my site to fail when loading. I got a blank white page on all load attempts. I put the file back the way I found it and the site is back up.
Comment #8
kbahey commentedTry this version. I tested it and it works (shows the points of the users in the profile).
Save it as userpoints.module.
Comment #9
kbahey commentedComment #10
kbahey commentedSciman,
I went ahead and added the feature you want. It would be useful for others too.
If a user has the permission "view userpoints", they will have a menu item called "User Points", which is a page that lists all the users that have points in descending order.
Wait till tomorrow and download the 4.6 version, and it should contian that feature.
Comment #11
sciman commentedAbsolutely terrific.. this is an extremely useful feature for those of us interested in educational uses of Drupal.. much appreciated.
Comment #12
(not verified) commentedComment #13
(not verified) commented