Closed (fixed)
Project:
User Points
Version:
5.x-2.15
Component:
Code: userpoints_views
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2007 at 17:00 UTC
Updated:
6 Aug 2008 at 11:56 UTC
Jump to comment: Most recent file
Comments
Comment #1
d0t101101 commentedI would also like to request this feature, as it would help to control how the points are displayed.
Comment #2
kbahey commentedUserpoints cannot do views at the moment.
However, if someone writes a userpoints.inc that does that integration, I will be happy to include it.
Comment #3
BarisW commentedAny updates yet? I'd like to have this too..
Comment #4
d0t101101 commentedbump
Comment #5
funana commented+1 :)
Comment #6
jredding commentedPlease comment with a description of what you would like to see in views from the userpoints module. How would you use userpoints with views?
Comment #7
funana commentede.g. I would create views for categories, sorted items by userpoints, add RSS to this views.
Comment #8
jredding commentedI'm not sure I understand this. What do you mean by categories, points don't have categories. Would you be trying to link points earned by node categories? or just display a listing of points per user?
Comment #9
ShutterFreak commentedSubscribing to this interesting feature request.
I would love to be able to display the number of points for a given user in a View, and to make that column sortable.
In addition, a Views filter could be implemented with a configurable minimum/maximum/exact number of user points.
Comment #10
funana commented- Create a view for category pages
- Display the article teasers in this view sorted by the number of User Points the articles have
Views is so powerful. I was really suprised that user points didnt show up in views ;-)
There are thousands of options that could be realized via User Points / Views...
Comment #11
funana commentedForget my posts here, sorry for confusion, but I simply mixed up userpoint with an other module. But anyway *g views support is a nice thing!
Sorry once again.
Comment #12
ebeyrent commentedI've started work on exposing Userpoints to Views, and can create a view listing users and their points. My next step is to add some filters so that I can list users and the points they accumulated per month.
I'm having some difficulty pulling in the data from the userpoints_txn table, so anyone with suggestions are welcome to assist...
Comment #13
jredding commentedIf you're working on integrating views into userpoints please post your patch here and ask any questions you have. I'm currently working on a version 3 of userpoints and if you're code is pretty solid maybe we can integrate it in? or at least make it a contrib module.
Ask your questions here or contact me via the contact page. I'll help point you in the right direction the best I can.
Comment #14
kbahey commentedFor those wanting to write patches for views integration ...
The issue is that views is node centric, whereas userpoints is user centric. Hence, we need a glue module to represent users as nodes, then build upon this module and extract data from userpoints and display it.
I did a similar thing for the fee module, using the bio module (the simplest of the users as nodes set of modules, the others being nodeprofile and usernode). Once each user is represented by a node, views have no problem displaying lists of users, and you can then write code to extract the current number of points, and have them sorted, ...etc.
See the fee module source for more details. The views functions are all at the end of the file.
Comment #15
ebeyrent commentedI used the Usernode and Nodeprofile modules and other related modules (http://shellmultimedia.com/node/274) to create user profiles as nodes. This method gave me more flexibility than the Bio module.
Comment #16
hedac commentedit should have to be a sort criteria entry like Node: Author Name
but Node: Author points
I think it is possible.. but still don't know how to program in drupal... or how API works...
Comment #17
thatashok commented+1 for userpoints in views (fields, filters, and/or arguments)
Comment #18
webchickThis has been made into a GHOP task: http://code.google.com/p/google-highly-open-participation-drupal/issues/...
Comment #19
thatashok commentedThat's exciting! I'll be sure to check in the 3 - 5 days estimated time.
Comment #20
webchickWell, no one has claimed it yet, but keep your eyes peeled. :)
Comment #21
MikeMoirano commentedExcellent! I would love to see this as well. Keep up the good work
Comment #22
mpaler commentedsubscribing
Comment #23
atta_svg commentedI've been doing this with usernodes for a while now. Works great. Should be fairly simple to do with users as well, but I was already using usernodes.
Limitations: Filter will only work on users that has received points, as the rest will (in the DB) have NULL and not 0 points. If you just want to filter on >0, or >= 100, etc, then it will work fine.
Atle
ps! Remember to clear the views-cache if patching an existing module.
---
Comment #24
ebeyrent commentedI wrote a module to help with this - it may be a little rough, but might help some people out. Perhaps there can be some integration with atta_svg's work.
Comment #25
corsix commentedAdded views fields for node/comment author's points, and transactions. This allows you to do things like:
And if a module which links nodes to users is installed (I'm using usernode), then more things are possible:
The .inc file, as that is what the GHOP task wants as a deliverable:
http://www.corsix.org/drupal53/modules/views/modules/views_userpoints.in...
(this isn't a patch, but that status seems most appropriate)
Comment #26
mpaler commentedwhere to put this include file?
Comment #27
corsix commenteddrupal/modules/views/modules/, as in the URL.
Comment #28
mpaler commentedworks like a charm. Thanks!
Comment #29
kbahey commentedcorsix,
I think this is a great addition to userpoints. I did not test it yet, but have a few questions.
- Why should this be under the views module? It should be under the userpoints module directory, so those who have userpoints commit access can maintain it. This is not the case if it is under the views module.
- I see that this is for the 2.14 version. Did you test it with the new and improved 3.x API? There are lots of changes and enhancements in that version.
- Can you compare what you did with what ebeyrent and atta_svg comments above, and see if they have anything that you missed, and merge them in?
Once the above is done, we can commit the combined work to the repository, and release a new version that has views integration in the official tar ball.
Comment #30
corsix commentedI can address the first point now, while I look into the other two.
The GHOP task asks for a .inc, and the conclusion from IRC (#drupal-ghop, December 20th 5:45 GMT) was a .inc for views:
I can change it to be something for userpoints\contrib, as everyone seems to agree on that being the best place, provided that doing so still completes the task.
Comment #31
kbahey commentedIt is definitely much better as something under contributions/modules/userpoints. Preferrably as an .inc file that we change userpoints to include_once if we detect views module as enabled.
Go ahead and merge any other worthy changes you see fit from the other two comments pointed to in my previous comments.
Once you are done with the 2.14 integartion, we can close the task with GHOP, then you can start working on the 3.x part.
Comment #32
jredding commentedI'll just chime in here just to verify that the above conversation was actually me ;) . A .inc file is easier to create as documentation already exists. Because this was a GHOP task and it was already challenging to begin with (Corsix is the 3rd person to claim it but around the 5th person to ask about the difficultly of it) I decided that a .inc file was simply easier to do.
The differences are subtle but I didn't want to cloud the GHOP task any further.
hopefully that clears up #1
as for #2
Corsix, I apologize. I didn't state this in the GHOP task and you did what you should have done; which is to use the stable version of the module. I submitted a few other userpoints tasks and on those I stated version 3 vs. version 2.14.
Without testing the code it should however work just fine against version 3 as those fields haven't changed. The .inc file could, however, be extended such as instead of joining on the uid you instead join on the node id and or comment id field as those are now available in version 3 via entity_id and entity_type. This, however, could be a bit confusing as entity_id and entity_type are not allows a node or a comment it is dependent on what is in entity_type.
Corsix I thought you tested against 3?
as for #3
"comparing with previous work". This is a excellent suggestion especially from a programming standpoint.
Going back to the .inc vs. contrib. The task didn't state it thus I see the task as complete as is.
It would be nice to roll it into a contrib module but as I told Corsix before we (which meant I ;) ) would be willing to take that on after the task was completed.
Corsix I'll let you make the final call as to if you would like to roll this into a contrib and/or do the suggestions above. You've done an excellent job on this task. In fact I would say you outdid yourself on this task. Not only did you take on one of the hardest tasks but you completed the task very quickly, with little help AND participated in the project's issue queue. You get a big applause from me.
Good job!
Comment #33
corsix commentedThe top of this issue has:
Hence I developed and tested against version 2.14. I'll setup a fresh Drupal install and put v3 on there and see if anything breaks.
Comment #34
jredding commentedyes.. this is our fault. You did everything correctly Corsix. The task is complete as stated and you did a kick-booty job on it.
Thanks again for all your hardwork. I appreciate you taking the time to get the work done for version 3 though, it is much appreciated.
I'll update the task on google.
Comment #35
corsix commentedChanged it be a contrib module for userpoints 3.x, and added some additional fields/filters so that it could mimic the pages that v3 provides (description, operation, status fields for transactions, category field and filter, link to user details pseudo-field). Also updated the two default views to be views equivalents of the userpoints and myuserpoints pages.
Includes all the functionality from post #23.
#24 listed some interesting options for transactions in a specific month, but seemed to be incomplete, with function userpoints_views_views_points_query_handler being totally empty apart from comments, and function userpoints_views_views_points_query_handler_thismonth simply indexing a member function. As such, didn't integrate anything from post #24.
Comment #36
jredding commentedwow.. you're awesome.. Let me jump over to google right now and close that task!
Comment #37
jredding commentedGHOP task closed! again awesome job Corsix!!
This particular task, on d.o, will be closed when the code is submitted into the repository for inclusion in the download.
Comment #38
kbahey commentedI committed the module to HEAD, and branched it to 5.x-2.x and 5.x-3.x.
Corsix, can you check with 3.x and see if it needs work there? File a new issue.
Comment #39
kbahey commentedCorsix
I committed the attachment in #35 to both 3.x and 2.x. Is that the way it should be, or is that for 3.x only? If so, where is the code specific to 2.x?
Comment #40
kbahey commentedI took the version in #25 (last link) and modularized it, and released a new version.
To all, please test if 5.x-2.15 does views integration correctly ...
Comment #41
MikeMoirano commentedThanks for this new feature. When you say "integrates with views", does that mean that there is a way to theme the view for the page that all of the users userpoints are displayed, the main, default page that lists every user and their userpoints? I am looking for a way to add a header to the page and to reduce the number of users on the page so as to provide a buried page, instead of having all 400 users listed in the same list.
Thanks
Comment #42
kbahey commentedPlease do not ask support question in threads that are marked fixed.
The easiest way to answer your question is to download the module and check the views feature in it.
Comment #43
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #44
radyaweb commentedTo using full function of user points in views module, you have to install usernode module too.
http://drupal.org/project/usernode
With usernode module, there will be an additional userpoint views field to be used. It should making usernode as required module for userpoints views integration. Because user will confused when looking for userpoint fields in views form.