session_register("in_category"); include_once "likelikeconstants.php"; if (substr($REQUEST_URI,0,6) == "/poll/") { $poll_id = urldecode(substr($REQUEST_URI,6)); $poll_id = preg_replace("/\?PHPSESSID.*/","",$poll_id); } $resultsurl = $altresultsurl = "/results/"; $pollcommentaryurl = $altpollcommentaryurl = "/pollcommentary/"; if (! $category) {$category = $in_category;} $errors = array(); if ($poll_id == "") { $errors[sizeof ($errors)] = "No poll specified."; } else { # load up the poll unset($poll_details); $choice_nums = array(); $choices = array(); mysql_connect("db1.xanthas.net","admin","329N02#z!~3nZ!"); $query = "select *,UNIX_TIMESTAMP(created_time) unix_time from poll_details where poll_id=$poll_id"; $results = mysql_db_query ("likelike",$query); if ( $row = mysql_fetch_array($results) ) { $poll_details = $row; } mysql_free_result($results); $poll_table = "poll_$poll_id"; if (isset($poll_details)) { # if it is a writein poll, order alphabetically $orderBy = 'choice_number'; if ($poll_details['poll_type' == 2]) { $orderBy = 'choice_text';} $query = "select * from $poll_table order by $orderBy"; $results = mysql_db_query ("likelike",$query); while ( $row = mysql_fetch_array($results) ) { # i'm using sizeof($choice_nums) for both to make sure they're the same # in case there's a blank choice or something $choices[sizeof($choice_nums)] = $row['choice_text']; $choice_nums[sizeof($choice_nums)] = $row['choice_number']; } mysql_free_result($results); } else { $errors[sizeof ($errors)] = "There was an error. Sorry."; } if (sizeof($choice_nums) <= 0) { $errors[sizeof ($errors)] = "There was an error. Sorry."; } } if (sizeof ($errors) >0) { echo "
";
for ( $counter = 0; $counter < sizeof ($errors); $counter++) {
echo $errors[ $counter ];
echo '
';
}
echo "
Try something else, please. "; exit(); } ?>
require ('sideindex.animals'); ?> |
Results |
Read/Post
Comments if ($poll_details['num_comments'] > 0) {echo ' ('.$poll_details['num_comments'].') ';}?> |
Home |