Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is it possible to alter the poll module to allow an authenticated user to vote an unlimited amount of times on a poll??? I know this is a rare request, but in my situation multiple students share one account and would like to each get a chance to vote.
I tried altering this section, but I guess it's more complicated than that because I got an error
// Determine whether or not this user is allowed to vote.
$poll->allowvotes = FALSE;
if (user_access('vote on polls') && $poll->active) {
if ($user->uid) {
$result = db_fetch_object(db_query('SELECT chorder FROM {poll_votes} WHERE nid = %d AND uid = %d', $node->nid, $user->uid));
}
else {
$result = db_fetch_object(db_query("SELECT chorder FROM {poll_votes} WHERE nid = %d AND hostname = '%s'", $node->nid, ip_address()));
}
if (isset($result->chorder)) {
$poll->vote = $result->chorder;
}
else {
$poll->vote = -1;
$poll->allowvotes = TRUE;
}
}
return $poll;
}
any help is appreciated!
Comments
Comment #1
jebernier CreditAttribution: jebernier commentedHey,
Interesting question...did you resolve this issue...I think IP address is logged so users at the same computer cannot take the poll twice.
John