Views support
bobdalob - May 4, 2008 - 14:20
| Project: | User Karma |
| Version: | 5.x-1.8 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
Description
I'm looking at this module for some general moderation use and maybe also user's benefit ("best" users etc.)
Continuing on from here I see Merc does not use Views so this is really for anyone else who is familiar with creating views, and who uses this module. Please post some help here, in particular what parameters to use to create a list of users with karma less than, say, -50 whilst showing the username & karma, and sorted by least karma. From there it should be possible to understand & adapt accordingly. Much appreciated, and hopefully of general use.

#1
Hi,
Is we all know, I can't answer this question. And... I am not entirely sure this question should be here -- I think you have more of a chance to get an answer either in Drigg's forums (http://www.drigg-code.org) or Drupal's!
I will leave this up for a week, you never know...
Merc.
#2
Hi,
I'm facing the same issue here. From the votingapi_view.inc (under VotingAPI directory), seems like it only processes correctly for its own value_type (eg. points, percent) and tag (eg. vote). Any third party field added to the table won't get processed correctly (I guess...) without additional Views integration coding.
Instead of using Views, would it be possible to do some simple db query to list down usernames and its karma where the karma is less/more than a certain threshold? Or may be just list down top 20 users with highest karma points. Then, we can include those little codes inside a page/block wherever we want.
I'm relatively new to website building (Drupal, PHP, mysql...all are new to me). I hope my idea would work and appreciate if somebody could post some codes here.
Points for node that accumulated through user_karma & extra_voting_form seems integrated correctly in Views by VotingAPI. However, I can't get points given to comment shown up in Views :( I want to create a page/block that shows a list of good comments. Any idea or module available to do so?
#3
Hi,
Hang on... this is potentially really bad and would need to be reported as a VotingAPI bug:
"I'm facing the same issue here. From the votingapi_view.inc (under VotingAPI directory), seems like it only processes correctly for its own value_type (eg. points, percent) and tag (eg. vote). Any third party field added to the table won't get processed correctly (I guess...) without additional Views integration coding."
Are you _absolutely_ sure? Can you please give us a set of _precise_ steps to show the problem? This would include 1) Creating a view with "points", step by step, and show that it works 2) Creating a view with karma, and show what the problem is.
This is important... please let me know!
Merc.
#4
I'm a newbie so I'm not absolutely sure. But I'm happy to show the steps:
1) Creating a view with "points"
- go to admin/build/views/add
- Under "Basic Information": fill in the "Name", any name will do, let's say "karma"
- Under "Block":
- check "Provide Block"
- "View Type": choose "Table View"
- "Nodes per block": put 20
- Under "Field":
- Add "Node: Type" and leave the default options
- Add "Node: Title" and leave the default options
- Add "VotingAPI: points vote result (sum)" and choose "Cleaned version" as its "Handler" -> this is the key
- Save the View
- go to admin/build/block
- Enable the block called "karma" (this is the name given to the View just now)
- You will see a block with tables that show the type of node, node title and its points given to the node through user_karma & extra_voting_forms
- to show that it works:
-> go to any node that listed in the table
-> vote the node up/down, for instance, Node A is given +1 point (note that it must be a node, voting comment won't work)
-> refresh your page where the "karma" View is showing and you will see the points for Node A reflects correctly, in this case, increased by 1 point
-> repeat above 2 steps for other nodes to double check
2) Creating a view with karma
Sorry, I'm not able to show this as there is totally no relevant field found under "Add Field" drop down menu. We need a field that looks similar like this: "VotingAPI: points vote result (sum)" to include karma_points in a View.
The options available under "Add Field" drop down menu are:
VotingAPI: points vote result (average)
VotingAPI: percent vote result (average)
VotingAPI: points vote user
VotingAPI: points vote value
VotingAPI: percent vote timestamp
...
...
...etc
I would expect something like "VotingAPI: karma_points karma result (sum)" but it's not there as a Field.
#5
Hi merc,
Any comment? Do you need more info? kindly inform me if you need more...
Anyway, would the simple mysql db query work like what I mentioned earlier? (To list down good users and good comments)
#6
Hi,
OK, I was wondering if you could help me with this. I am a little swamped right now.
Can you please submit a big in the views module, writing pretty much exactly what you wrote here, and possibly putting a reference to this very node?
This is either a problem with the views module, or a missing feature from the user_karma module. Either case, they will have the answer...
Thanks!
Merc.
#7
sure, it's my pleasure to help. However, I'm wondering if it's suppose to submit to Views as a bug. Anyway, I have submitted a report to VotingAPI (http://drupal.org/node/256638) as I think it's more possibly caused by VotingAPI if it's not user_karma. if we cannot get any answer, then I would submit a report to Views.
#8
Hi,
I wish I knew "views"...
From what I can tell, this is _very_ likely to be a VotingAPI issue. I don't think Views has anything to do with it.
Bye!
Merc.
#9
Subscribing...
#10
This link pretty much discusses why Views will not support User Karma. In essence, for those like me who know little about Views, the module only works with nodes and so because users are not nodes the two will not work together. It also touches on a couple of ideas about using the Usernode module and another about adapting Views itself, neither of which I have tried but may provide round about solutions for the adventurous.
I think this can be closed unless the title is changed to consider a new direction of thought on how to expand the functionality/report-ability of User Karma. I personally just wanted to add some ability for admin/moderators to oversee users, pick out the good guys or the bad guys if you see what I mean. I realise there are options to automatically assign roles however I'd prefer to keep manual control on that, in large part because of the uncertain 'frontier' - that's to say the ease with which one can shift and hover either side of a role assignment threshold, based on a few welcome then unwelcome comments/nodes - there's not always a direct correlation for me besides I do not wish to deter free speech for fear of saying the 'wrong' thing.
#11
Hi,
** UGH **
This is the most painful "won't fix" I've ever issued...
Sorry everybody!
Merc.
#12