Answer the question
In order to leave comments, you need to log in
Voting, how can I make it possible to vote once?
Hello, I found the following line in the voting module:
if (isset($exists->id) && (time() - strtotime($exists->date)) < 60 * 60 * 24) {
Answer the question
In order to leave comments, you need to log in
in your example it is exactly 24 hours.
It depends how you want to implement it. If you look at the rough side, then just change the parameter 60 * 60 * 24 to 60 * 60 * 24 * 31, then users will not be able to vote for a month :-)
But this is bad, because the poll can change.
Use cookies as described above, but make the cookie name prefixed with the survey ID. For example vote_101, then check it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question