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

apanag - October 13, 2008 - 22:56

You want the counter to start after the first vote?

#2

madapple - October 14, 2008 - 04:28

yes

#3

apanag - October 15, 2008 - 09:55

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

apanag - December 3, 2008 - 23:18
Status:active» closed

#5

serkan_isin - February 9, 2009 - 12:06

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?

 
 

Drupal is a registered trademark of Dries Buytaert.