What abount "plus/minus 1" ?

Comments

Chill35’s picture

Oh yeah. Much needed. I will put that in, and also make the widget more sexy out of the box.

Thanks!

Chill35’s picture

Assigned: Unassigned » Chill35
idflorin’s picture

Yes is needed, but optionally from config interface.

tuti’s picture

Any idea of when -1 will be added?

Also, I'd like to request that you could show how many plus and minus votes have been voted not just the result of plus votes - minus votes.

This function would make this module have a unique feature that (to my knowledge) no other voting module has.

Should I make a seperate feature request for this or will this do?

Cheers!

Babalu’s picture

subscribing

freshaspect’s picture

This would definitely be a very useful addition. Subscribing.

Chill35’s picture

I have been told that a -1 that actually substracts an entire vote is a bad idea because that's not how Digg does it.

Someone told me:

This one might be tricky. You don't want -1 to substract a full vote (Digg doesn't) so perhaps that is option, set the -1/bury vote subtraction (0.1, 0.25, etc.. votes) and then do a ceil() on the sum (so that 2.1 still get ups to 3, unless one more person clicks bury)

That's something I could do. And have the actual subtraction percentage configurable on the module page.

I wonder if you guys are ok with a plain Minus 1 functionality for now, the functionality would be optional of course.

freshaspect’s picture

I think plain minus 1 functionality would work fine for now. Making the downgrade weighting configurable will make a nice addition but I would argue is a less critical use case.

Paul

Chill35’s picture

Thanks Freshaspect, I will start with that. I am gonna have some free time Sunday to get crankin' on that.

Chill35’s picture

Status: Active » Postponed

I have worked a few hours on this and have been unable to figure it out.

I am able to record "-1" votes in the Voting API table without problems, however when votes are calculated by the Voting API, the -1 is treated like +1.

There seems to be a problem with the Voting API.

If one of you is able to figure it out and submit a patch, you are welcome.

ingacosta’s picture

I think we should take these features separately. That is, on one hand add all the negative votes, and secondly, all the positive votes.

ingacosta’s picture

Or maybe adding a second box for negative votes. It would be very useful for my site. Great module!

Regards
Hernán

freshaspect’s picture

Really want to get minus 1 up and running...

Is there any chance of making a dev version available that has the minus one stuff in it - even if the votingapi is recording down votes as up votes? We can then work out the best way of fixing this up...

Thanks,
Paul

pfahlr’s picture

StatusFileSize
new3.07 KB

I made a patch against 2.4 that allows for minus 1. I needed this for a site where users can vote against or for an article.

Modified
plus1.module
- added a new setting field to enable voting against a node
- added additional input variable ($amount) to plus1_vote page callback
- modified theme_plus1_widget() to display vote against box if user has not voted and voting against is enabled

jquery.plus1.js
- now removes second widget when a vote occurs

plus1.css
- floated the widgets so they appear side by side

down.png
-new file - flipped up.png for vote against widget

pfahlr’s picture

I just now read post 10 after the fact. The value field in the votingapi_vote table is type float and not unsigned. When I look at the votingapi_cache table, it appears to be storing the values correctly. I haven't really worked with voting API much as of now. As I mentioned in my last post, I'm currently building a site that requires this functionality, so I'll keep everyone posted on what I find.

pfahlr’s picture

StatusFileSize
new983 bytes

RE:#10

I think I figured this out, or at least I found another problem. When I truncate votingapi_cache, and run votingapi_select_results(), the results come through in a different order with the result for count instead of average first. In plus1_vote, you're calling votingapi_select_results() and setting only the content_id criteria, so the array you get back has all three count, average, and sum. Then drupal_json() is called passing score as $results[0]['value'] which is unreliable.

On further inspection I found plus1_get_score() which encapsulates this whole process returning just the score. This patch replaces the direct call to votingapi_select_results() with plus1_get_score() and adjusts the following call to drupal_json() accordingly.

I'm going to post another patch for minus 1 functionality shortly that fixes this problem and some javascript/css issues that arose when I added a second button.

pfahlr’s picture

StatusFileSize
new3.66 KB

This patch adds minus 1 functionality and fixes the issue mentioned in post #10. The widget is displayed as a single box with up and down arrows when minus 1 is enabled. The html/css/javascript setup is better than the earlier version as I noticed some issues when I went to theme it.

tobiassjosten’s picture

This patch works well for me.

dixon_’s picture

Any updates on this issue? Does it need a reroll (havent tested the patch my self yet). Any plans to commit this?

emattias’s picture

Will the new -1 functionality be able to tally both the number of +1 votes and -1 votes seperately and not just keep a positive - negative votecount?

I'd like to be able to display the number of positive and negative votes for a node or even a percentage of the total number of votes have been positive and negative, but that can easily be accomplished if you get both positive and negative votes..

philbar’s picture

This feature is already integrated with the similar module Vote Up/Down.

No point in duplicating functionality of an existing module when it is not necessary.

nancydru’s picture

@philbar: I totally agree. There is also an issue to merge the modules. This work is just not needed here.

nancydru’s picture

Status: Postponed » Closed (works as designed)

If you need this, file an issue to convert to Vote Up/Down module.

See #445274: Need 0 for a "0" request.