limit votes to certain number of nodes, and time
madapple - October 7, 2008 - 21:40
| Project: | DrupalIt |
| Version: | 5.x-1.3-a |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I would like to find a way to limit how many total nodes can be voted on during a given time period by one user/IP address.
working on a t-shirt voting system, and drupalit fit perfectly with the system. Now the bosses want to have users select their 3 favorite shirts, and only be able to vote for those shirts once a day.
ideas?

#1
You want the counter to start after the first vote?
#2
yes
#3
So i am thinking sth like this:
//on function drupalit_count_vote
$time_to_vote = x;
$number_of_votes = y;
$selected_time = select the time of the first node, that the user voted where the uid = get the user_id;
$users_today_votes = select count(votes) where the uid = 1 and voted_time > 00:00
if selected_time > $selected_time + $time_to_vote && $users_today_votes >= y
exit;
else
vote;
#4
#5
how can i use that? i would like a user to vote for only one node or item? We are using a "worker of the month" feature in intranet..
any help?