0 ) return 0; if ( !(int)$_POST['vote'] ) return 0; $res = db_res("UPDATE `polls_a` SET `Votes` = `Votes` + 1 WHERE `IDanswer` = ". (int)$_POST['vote']); if ( $res ) setcookie("polls_question_{$ID}", 1 , time() + ( 10000 * 3600 ), '/' ); return $res; } /** * Print a poll */ function MemberPrintPoll( $ID ) { $queryQuestion = "SELECT `Question` FROM `polls_q` WHERE `Active` = 'on' AND `ID` = $ID"; $queryAnswers = "SELECT `IDanswer`, `Answer`, `Votes` FROM `polls_a` WHERE `ID` = $ID"; $aQuestion = db_arr( $queryQuestion ); $rAnswers = db_res( $queryAnswers ); if ( !$aQuestion or !mysql_num_rows($rAnswers) ) return _t_err("_Poll not available"); $aVotes = db_arr( "SELECT SUM(`Votes`) FROM `polls_a` WHERE `ID` = $ID" ); $iTotalVotes = (int)$aVotes[0]; ob_start(); ?>