Closed (outdated)
Project:
Rate
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Jan 2011 at 22:33 UTC
Updated:
3 Jul 2019 at 07:53 UTC
Jump to comment: Most recent
Hey all,
I am trying to make user on my site only vote 1 times a day period for a certain tag. The modules im using are Voting api and Rate. I have 2 Rate Widgets but only need this configuration for one which has a tag of vote. Can anyone help me with this? I tried to use the Voting api settings didnt work because it allows users to vote on many nodes once. I need it to be once a day period. I also tried the vote rules module and got confused.
Comments
Comment #1
decibel.places commentedSince you are using the Rate module custom voting widget modify the rate-widget.tpl.php file to set the class on all widget buttons to 'voted' for a 24 hour period after one vote is cast:
you could also query for the uid, to allow authenticated users from the same IP to vote once, and uid0 is anonymous
Comment #2
decibel.places commentedmoving this issue to Rate module issue queue
Comment #3
JoshW commentedim still having issues with this. it doesnt seem to be resetting at midnight and when you vote it says you have voted but the image is still a link and you can still vote. I think its changing the class for the vote button but still actually works.
Comment #4
JoshW commentedalso how would you make it work for authenticated users as well?
Comment #5
JoshW commentedreopening because its not fixed.
Comment #6
vm commentedthis is a feature request which goes against -dev and shouldn't be marked critical. If it was an existing feature that didn't work as described different story.
Comment #7
JoshW commentedfull code is
Comment #8
scott815 commentedI am trying to do the same and tried the code you gave and wanted to know if you it works in current or only works in Dev. If I can help in getting this work please let me know.
Scott
Comment #9
neoliminal commentedIf you want to restrict individual logged in users, do so here.
Comment #10
emergencyofstate commented-edit-
Found my solution here: http://drupal.org/node/1224150
----
Hi guys. Are there any modifications I can make to the above code to make it work with D7?
I believe db_fetch_object is depreciated but I'm not skilled enough to re-code for 7. Help is appreciated.
Comment #11
tinny commentedThis may help: http://drupal.org/update/modules/6/7#dbtng
In d7, you use
db_query()and then use aforeachloopIm not sure you need the foreach loop though if you only have 1 record...
Comment #12
lamp5