function hasVoted($poll_id, $ip, $user_id=NULL){
$db =& Database::getInstance();
$sql = "SELECT COUNT(*) FROM ".$db->prefix("xoopspoll_log")."
WHERE poll_id=".intval($poll_id)." AND";
if ( !empty($user_id) ) {
$sql .= " user_id=".intval($user_id);
} else {
$sql .= " ip='".$ip."'";
}
list($count) = $db->fetchRow($db->query($sql));
if ( $count > 0 ) {
return true;
}
return false;
}
lubdub wrote:
Missing features I'd really would appreciate (of course, I could code them myself... but... not time for now )
- choose the way to record votes (for now, I think it's based on ip, but I have several users behind the same firewall, so it should be allowed to be based on username)
- allow/prevent anonymous users to vote
- show the list of voting users with their vote (at least for admin, but some polls could be completely public)
netwize wrote:
request:
I want a idle time for user to activate or the system will auto delete their accounts ..
felix9x wrote:
What would be real cool if there was a admin setting like 1-require email activation 2-activate immediatly 3-activate manualy by admins. That requires a bit of a redesign to the system and it would be up to the developers of XOOPS to decide if they want to put effort into that. Most communities would choose you to have a valid email.