Closed (fixed)
Project:
Vote Up/Down
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
9 Aug 2006 at 20:47 UTC
Updated:
19 Apr 2007 at 20:45 UTC
vote_up_down module anonymous user
use up-down vote X
Comments
Comment #1
frjo commentedAnonymous voting is not yet supported, I need to add that to the README.
Comment #2
frjo commentedComment #3
lennart commentedanonymous user still cannot vote even when granted access under access control. There is no mention of this in the readme file.
Comment #4
jackdaw commentedyes, I have this problem too
Comment #5
frjo commentedLine 23 in the README.txt in cvs "Anonymous voting is not supported, not yet at least."
Comment #6
rousehouse commentedLooking forward to this feature (when it's ready). ;-)
Comment #7
xamox commentedLooking forwards to it as well.
Comment #8
marcoBauli commented+1 to the coire for this feat
Comment #9
shadyman@erroraccessdenied.com commented+1 looking forward
Comment #10
shadyman@erroraccessdenied.com commentedComment #11
summit commentedDoes this feature of anonymous voting get enabled please?
I really would like it!
Thanks for your response in advance!
greetings,
Martijn
www.ontwikkelingswerk.net
Comment #12
shadyman@erroraccessdenied.com commentedMartijn:
No, the feature is postponed until it can be implemented.
Comment #13
aw05 commentedI am working on this right now because our site needs anonymous voting asap. Hopefully, we'll have a patch available in the next few days, but no promises.
Comment #14
Blackwolf commentedaw05: you'd be my hero if you could pull this off :)
Comment #15
summit commentedMy hero also.
thanks in advance!
greetings,
Martijn
Comment #16
frjo commentedThe Fivestar module supports anonymous voters and many other nice things. It is developed by Eaton as a showcase what you can do with Voting API. I intend to implement many things from Fivestar in to the next version of Vote up/down.
If possibel I might even simply build on top of Fivestar, just as I already build on top of Links, Voting API etc. I would also like to make more use of CCK and Views.
I will start with this when I retun from my travels in a couple of weeks.
Comment #17
Lityi commented"couple of weeks"!? :)
Come back and do this NOW! No fun until you statisfy our request! :)
(I'd sponsor it a little bit if it speeds up the developing process...)
Then you can have your travel around the world, hehehe.
Comment #18
j0rd commentedi'm going to attempt to get this going tonight. We'll see how far i get. If i can't figure it out easy, i'll probably just switch to 5 star.
Comment #19
j0rd commentedQuick and dirty anonymous voting. 1 per IP.
Download here: http://mholman.com/vote_up_down.module.diff
Please rank some of the portfolio work as well.
Is this a permanent fix? No.
Does it work? Yes.
What does it do? Enabled the voting system for anonymous users. Stores the votes under the uid ip2long(sprintf("%u",$_SERVER['REMOTE_ADDR']));
Is this a good idea? Not really, but it works for me for now.
Comment #20
guschnit commentedhi
I'm not an expert
Where do we have to insert that code?
is it for version 5?
regards
Comment #21
frjo commentedThe HEAD version, http://drupal.org/node/96075, now has support for anonymous voting. OBS! HEAD only supports Drupal 5. Thanks for the comments and code on this issue.
I'm very interested in comments on the implementation, and bug reports of course.
By using the ip address plus the day of the year as "uid" I'm allowing one vote per IP and day. Does that sounds reasonable? I took that from the fivestar module.
Here is how I generate a "uid" for anonymous voters, does it look OK?
Comment #22
j0rd commentedthat's exactly how i did the UID in my code diff posted above. My code is for 5.1, but i'm sure it can be applied to other versions of drupal.
You'll also need to remove the tests for && $user->uid in the theme functions for vote_up_down to allow them to vote.
My diff above has all the code changes needed. If you don't know how to read a diff....i'll explain it below.
find this line in vote_up_down.module
and replace it with
This allows users who are logged in to get tracked under their UID and users who are not logged in to get tracked under a fake UID which is their IP. This will cause conflicts in the ip2long conversion is the same as a UID, but i believe you'll need a server with a load of members to have these two start conflicting.
Then find the two instances of this code
and replace it with the following
This allows users who are not logged in to vote. Remember, there are two instances of this.
Thanks for committing the code to HEAD, although i believe you should create a more permanent solution.
Comment #23
j0rd commentedi just took a look at the nightly snap shot and i would recommend using that. It's more robust that my hack as it includes administrative features as well.
Comment #24
j0rd commentedThere's a bug in the HEADs implementation.
I noticed that when i'm anonymous and vote, then refresh the page, usually it would show the Up arrow highlighted, but it's not anymore.
Could we please get this fixed. It did not happen in my implementation.
Comment #25
frjo commentedWhen I vote as a anonymous user on my test site and then refresh the page the vote arrow is active, just like when I vote as a logged in user. I guess something is different in our setups. Have you tried it on a fresh install of Drupal 5.1?
If you as a anonymous user come back the next day, or rather after midnight, the system will treat you as a new anonymous user and you can make a new vote.
Comment #26
Blackwolf commentedThanks frjo for your update. But I think there is a problem somewhere.
Because when I vote anonymously from machine/IP-address "A", machine/IP-address "B" wil no longer be able to vote, and the "has voted"-icon will appear, even though no vote has been casted from "B". Also the vote won't get resetted after 24 hours+.
Do I have something seriously wrong in my setup or can this be reproduced elsewere?
Comment #27
frjo commentedI can reproduce this. The uid field in the tabell votingapi_vote is int(10). The uid I generated for anonymous users was not a integer value and to long.
I have just committed a new attempt to HEAD that seems to fix this on my test site. Please try it out and report any problems with this approche here.
Comment #28
frjo commentedComment #29
shadyman@erroraccessdenied.com commentedI'm still getting "You must login to vote" when hovering over the + as an anonymous user with the Alternative +1 vote style.
Everyone has permission to use/view/access up-down vote.
Comment #30
shadyman@erroraccessdenied.com commentedI should add that I installed the HEAD, and cleared my cache.
Comment #31
shadyman@erroraccessdenied.com commentedIgnore that, Turns out I had "Allow anonymous users to vote" set to Off in the voteupdown 'advanced' settings. My bad :)
Comment #32
(not verified) commented