Download & Extend

Vote Up Down for comments should enable display of comments by votes

Project:Vote Up/Down
Version:6.x-3.x-dev
Component:vud_comment
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

My goal was to use VUD to allow users to rate comments and then sort comments by their vote total.

I enabled voting then went about doing the sorting.

It would have been nice if the content type would, after having comments on that content type been enabled for voting, have offered an additional setting for comment display order. (see /admin/content/types//edit)

By default, one can only sort by date ascending or descending. It would be neato if VUD comments would also allow ordering by number of votes on the comment.

See also: http://drupal.org/node/628890

Comments

#1

I would be extreamely interested in something like this!

#2

Yes this would be very, very useful!

#3

I would be very, very interested as well.

And I find it very strange that no one coded this yet. This is the reason for voting, praise the best and relegate the worst.

#4

Without the ability to order comments by vote or even display the comment with the most votes (via a view) .. I'm not sure I understand the purpose of allowing votes on comments at all?

#5

In drupal 7 there still aren't any hooks for ordering comments beyond the default. See comments API (in fact there are fewer options in 7).

So Views 2 is our ONLY option for sorting comments without totally hacking core, in other words you have to render your comments with views in order to allow sorting by vote results.

Fortunately the Voting API already provides vote count integration with views.

You can do this by creating a new view, and adding a "vote results" relationship. Now you can sort by # votes.

Unfortunately the only way to allow the user to select the sort option is by using the "table" display, which is not really usable without totally overriding the theme, but at least it's possible...

AttachmentSizeStatusTest resultOperations
Picture 2.png64.29 KBIgnored: Check issue status.NoneNone

#6

subscribe

#7

I've tried #5 using a node view and a comment view, using VUD dev. I can't get the VUD widget to show in a view. I don't see sort or display options for total votes.

Here are my options for sorting: http://gyazo.com/08257c7cb74010476a0850a3032aec1b.png

Here are my options for adding fields: http://gyazo.com/7af78df66c4b8a907c79bf72eecec233.png

What am I missing?

#8

OK, I'm not so dense after all.

To get the widget to display I called the theme function from a views_customfield php field like this:

<?php
print vud_widget_proxy($data->cid, 'comment', 'vote', 'updown', $readonly=NULL);
?>

The vote total is kind of mislabeled. Currently it's "Vote Results: Value, The value of an individual cast vote." But it's not the value of an individual cast vote, it's the result of the aggregation function chosen in the relationship (Total score, number of votes, average votes) on all votes cast on a comment.

This is using a comments view.

Maybe this can help someone down the road.

#9

Status:active» fixed

Thanks awolfey,

perhaps this module is useful as well:

http://drupal.org/project/comments_in_a_view

#10

Given the comments posted in #5, this should likely be closed in favor of the other feature enhancement I opened for VUD: http://drupal.org/node/628890

(that one was marked as a dupe; but not listed what it was duplicating, so I reopened it

#11

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#12

Priority:normal» major
Status:closed (fixed)» active

Guys, this issue is not fixed and I don't understand why this is so difficult to accomplish in Drupal. If you use views to display your comments, it breaks threading completely. So If I sort by vote, it displays each comment as a separate comments, not attached. Not to mention Ajax Comments is useless when you start using views to power your comment display. thePaul at #4 had it right.

This isn't so much a problem with VUD then it is with Drupal, but I don't understand why every one of these threads always stop at the views solution. We need a real solution to integrate with the comment module itself.

Am I to understand that even if I wanted to hack core, I couldn't accomplish this task? It seems to me it is just a matter of changing the sort query, but I have had no luck doing this successfully.

This is an important feature and I would appreciate it if anyone could share a better solution.

#13

Version:6.x-2.x-dev» 6.x-3.x-dev
Component:Code» vud_comment
Priority:major» normal
Status:active» closed (won't fix)

About the original question, as mentioned by others, is something we can not do from outside AFAIK, so the proposed view solution makes sense, but there are restrictions, as was also mentioned. IIRC merlinofchaos told me once that the actual "suggested way to let users change sorting in a view" is actually make many displays as tabs :-/, so that seems to be a little tricky too.

I am really not convinced about this feature, since IMHO is out of the scope of the module for the reasons mentioned.

About the "use widgets in a comment view", add the "Vote Up/Down: Comment Widget" field to your comment view.

#14

Status:closed (won't fix)» active

Sorry to open this again after the maintainer said it's a "won't fix" but I'm willing to pay for this feature and I'd like to know the best way to implement it. Is a separate module that creates the option in the content-type/comment settings for "sort by votes, threaded" the way to go?

#15

Just curious, wouldn't something like this help with performance issues as well--as opposed to installing views just to sort votes?

#16

Subscribing...

Need this for a project.

#17

Maybe this could help:
- use nodecomments module to turn certain nodetypes' comments into nodes.
- add vote/up down to the new nodetype
- alter the included view in nodecomments to handle sorting by votes

I imagine the main problem is getting threading to work... but if, say, the view sorts items only within a thread, and child threads are each ordered by the same view, it could work.

#18

One other thing; I doubt ordering just by votes would be the way the big boys do it. They probably have some sort of algorithm taking into account things like "up" vs "down" percentage, the reputability of the commenting user, total votes, comment word length, etc.

#19

Status:active» closed (won't fix)

After two months being re-opened, I'm re-closing it as #13, IMHO the better way to deal with this is definitely views, but as mentioned, a little out of scope of the module.

If someone provide code for this, I could revisit this.

nobody click here