jamesplato
01-21-2007, 12:38 AM
I need some help. I am at a total loss. Within my wepage, I am using a call function for a random poll as below (from Advanced poll). It works fine and the script is great. the problem is just one thing. getting customization
<?php
require_once "/home/content/n/o/t/xxxx/html/xxxx/booth.php";
echo $php_poll->poll_process("random");
?>
In Advanced Poll you also get a cookie
<?php
/**
* ----------------------------------------------
* this code is optional
* Important! You have to include it
* before your html code
* ----------------------------------------------
*/
if (!headers_sent()) {
$cookie_expire = 96; // hours
$action = (isset($_GET['action'])) ? $_GET['action'] : '';
$action = (isset($_POST['action'])) ? $_POST['action'] : $action;
$poll_ident = (isset($_GET['poll_ident'])) ? $_GET['poll_ident'] : '';
$poll_ident = (isset($_POST['poll_ident'])) ? $_POST['poll_ident'] : $poll_ident;
if ($action=="vote" && (isset($_POST['option_id']) || isset($_GET['option_id']))) {
$cookie_index = intval($poll_ident);
if (!isset($_COOKIE['AdvancedPoll'][$cookie_index])) {
$endtime = time()+3600*$cookie_expire;
setcookie("AdvancedPoll[$cookie_index]", "1", $endtime);
}
}
}
?>
Is there a way to ensure the called "random" poll is not one that has already been voted on. I am sure the answer is easy, but I cannot figure it out. Please PM if you need the website to see what I mean :)
<?php
require_once "/home/content/n/o/t/xxxx/html/xxxx/booth.php";
echo $php_poll->poll_process("random");
?>
In Advanced Poll you also get a cookie
<?php
/**
* ----------------------------------------------
* this code is optional
* Important! You have to include it
* before your html code
* ----------------------------------------------
*/
if (!headers_sent()) {
$cookie_expire = 96; // hours
$action = (isset($_GET['action'])) ? $_GET['action'] : '';
$action = (isset($_POST['action'])) ? $_POST['action'] : $action;
$poll_ident = (isset($_GET['poll_ident'])) ? $_GET['poll_ident'] : '';
$poll_ident = (isset($_POST['poll_ident'])) ? $_POST['poll_ident'] : $poll_ident;
if ($action=="vote" && (isset($_POST['option_id']) || isset($_GET['option_id']))) {
$cookie_index = intval($poll_ident);
if (!isset($_COOKIE['AdvancedPoll'][$cookie_index])) {
$endtime = time()+3600*$cookie_expire;
setcookie("AdvancedPoll[$cookie_index]", "1", $endtime);
}
}
}
?>
Is there a way to ensure the called "random" poll is not one that has already been voted on. I am sure the answer is easy, but I cannot figure it out. Please PM if you need the website to see what I mean :)