add('QUESTION', $getpoll3['question']); $template->add('OPTION1', $getpoll3['option1']); $template->add('OPTION2', $getpoll3['option2']); $template->add('OPTION3', $getpoll3['option3']); $template->add('OPTION4', $getpoll3['option4']); $getip = "SELECT * FROM didpollalready WHERE ip = \"" . $_SERVER['REMOTE_ADDR'] . "\""; $getip2 = mysql_query($getip); $getip3 = mysql_fetch_array($getip2); if (($getip3['ip'] != $_SERVER['REMOTE_ADDR']) && (!isset($forceDisplay))) { $template->adds_block('FORM',array('exi'=>1)); } else { $template->adds_block('DISPLAY',array('exi'=>1)); $template->add('PERCENT1', getpercent($getpoll3,'1')); $template->add('PERCENT2', getpercent($getpoll3,'2')); $template->add('PERCENT3', getpercent($getpoll3,'3')); $template->add('PERCENT4', getpercent($getpoll3,'4')); } } else { $setip = "INSERT INTO didpollalready SET ip = \"" . $_SERVER['REMOTE_ADDR'] . "\""; $setip2 = mysql_query($setip); $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1"; $getpoll2 = mysql_query($getpoll); $getpoll3 = mysql_fetch_array($getpoll2); $setpoll = "UPDATE polloftheweek SET clicks" . $_POST['options'] . " = " . ($getpoll3['clicks' . $_POST['options']]+1) . " WHERE id = " . $getpoll3['id']; $setpoll2 = mysql_query($setpoll); $template = new FITemplate('msg'); $template->add('MSG','
Thank you for voting on the Poll of the Week!
Click here to visit the page for this poll.');
$template->display();
}
?>