Need -1

Real Digger - July 30, 2008 - 19:58
Project:Plus 1
Version:6.x-1.0
Component:User interface
Category:feature request
Priority:normal
Assigned:Chill35
Status:postponed
Description

What abount "plus/minus 1" ?

#1

Chill35 - July 31, 2008 - 03:01

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

Thanks!

#2

Chill35 - August 6, 2008 - 20:38
Assigned to:Anonymous» Chill35

#3

adresaklumea - September 20, 2008 - 08:33

Yes is needed, but optionally from config interface.

#4

tuti - September 26, 2008 - 08:31

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!

#5

Babalu - September 26, 2008 - 08:48

subscribing

#6

freshaspect - October 20, 2008 - 14:48

This would definitely be a very useful addition. Subscribing.

#7

Chill35 - October 20, 2008 - 17:48

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.

#8

freshaspect - October 21, 2008 - 08:28

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

#9

Chill35 - October 22, 2008 - 01:30

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

#10

Chill35 - October 25, 2008 - 21:14
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.

#11

ingacosta - October 30, 2008 - 11:21

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

#12

ingacosta - October 30, 2008 - 11:45

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

Regards
Hernán

#13

freshaspect - November 4, 2008 - 11:21

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

#14

pfahlr - November 20, 2008 - 21:47

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

AttachmentSize
patch_2.4.zip 3.07 KB

#15

pfahlr - November 20, 2008 - 22:47

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.

#16

pfahlr - November 21, 2008 - 03:32

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.

AttachmentSize
plus1_vote_11-20-08.module.patch 983 bytes

#17

pfahlr - November 21, 2008 - 04:18

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.

AttachmentSize
plus1_2.4_minus1.patch.zip 3.66 KB

#18

tobiassjosten - December 15, 2008 - 09:17

This patch works well for me.

#19

dixon_ - December 19, 2008 - 00:14

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

#20

emattias - March 8, 2009 - 01:44

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..

#21

philbar - April 20, 2009 - 17:41

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.

 
 

Drupal is a registered trademark of Dries Buytaert.