| version 1.9, 2005/11/28 11:53:49 |
version 1.10, 2005/11/28 15:14:10 |
| Line 1195 function ezin_get_poll_answer_list_count |
|
| Line 1195 function ezin_get_poll_answer_list_count |
|
| return array(); |
return array(); |
| } /* }}} */ |
} /* }}} */ |
| |
|
| |
function ezin_is_valid_poll($poll_answer_id) /* {{{ */ |
| |
{ |
| |
global $ezin_sys; |
| |
global $ezin_db_handle; |
| |
$poll_answer_id = intval($poll_answer_id); |
| |
$query = 'SELECT answers.poll_id' |
| |
.' FROM '.$ezin_sys['db']['tables']['polls'].' AS polls,' |
| |
.$ezin_sys['db']['tables']['poll_answers'].' AS answers' |
| |
.' WHERE polls.id = answers.poll_id' |
| |
.' AND polls.dt_valid_from <= SYSDATE()' |
| |
.' AND polls.dt_valid_to >= SYSDATE()' |
| |
.' AND answers.id = '.$poll_answer_id; |
| |
$result = @mysql_query($query, $ezin_db_handle) |
| |
or ezin_db_error('ezin_is_valid_poll()'); |
| |
$row = mysql_fetch_array($result, MYSQL_NUM); |
| |
@mysql_free_result($result); |
| |
return is_array($row) ? $row[0] : 0; |
| |
} /* }}} */ |
| |
|
| |
function ezin_poll_answer_vote($poll_answer_id) /* {{{ */ |
| |
{ |
| |
global $ezin_sys; |
| |
global $ezin_db_handle; |
| |
$poll_answer_id = intval($poll_answer_id); |
| |
$query = sprintf('UPDATE %s SET votes = votes + 1 WHERE id = %d', |
| |
$ezin_sys['db']['tables']['poll_answers'], $poll_answer_id); |
| |
$result = @mysql_query($query, $ezin_db_handle) |
| |
or ezin_db_error('ezin_poll_answer_vote()'); |
| |
return true; |
| |
} /* }}} */ |
| |
|
| /* |
/* |
| * FEEDBACK/NEWSLETTER RELATED FUNCTIONS |
* FEEDBACK/NEWSLETTER RELATED FUNCTIONS |
| */ |
*/ |