$path = __FILE__;
$path = preg_replace( "'\\\archive\.php'", "", $path);
$path = preg_replace( "'/archive\.php'", "", $path);
include($path."/poll_config.php");
if($stylesheet_url == "")
$stylesheet_url = $path."/default_stylesheet.css";
?>
Poll Archive
$dir = dir($path."/archivedata"); //Create a directory object to the current directory
$polls = array();
$i = 0;
while($dir_entry = $dir->read()){
if(strstr($dir_entry,"archived")){
$polls[$i] = $dir_entry;
$i++;
}
}
if($i == 0){
echo "No Archived Polls";
}
else{
if(isset($_GET['showpoll'])){
$pollid = $_GET['showpoll'];
if(empty($polls[$pollid])) $pollid = 0;
}
else{
if(!isset($_POST['pollid'])) $pollid = 0;
else $pollid = intval($_POST['pollid']);
}
$pollfile = $path."/archivedata/".$polls[$pollid];
$delete = array("archived_",".txt");
$pollid_date = str_replace($delete, "", $polls[$pollid]);
$data = explode("_", $pollid_date);
$date = date("D j\<\s\u\p\>S\<\/\s\u\p\> F", $data[1]);
include($pollfile);
?>
Archived On |
echo $date; ?> |
Poll Question: |
echo stripslashes($ask); ?> |
Total Votes: |
echo $total; ?> |
|
echo $a[$i]; ?> |
echo $v[$i]; ?> vote if($v[$i] != 1) echo "s"; ?> ( echo $percentage; ?>%) |
|
}
}
?>
|
printNextPrev($pollid);
}
function printNextPrev($pollid){
global $path;
$nextpoll = $pollid + 1;
$prevpoll = $pollid - 1;
$dir = dir($path."/archivedata"); //Create a directory object to the current directory
$polls = array();
$i = 0;
while($dir_entry = $dir->read()){
if(strstr($dir_entry,"archived")){
$polls[$i] = $dir_entry;
$i++;
}
}
if(!empty($polls[$prevpoll])) echo "<< Prev ";
if(!empty($polls[$nextpoll])) echo "Next >>";
}
?>