From b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Thu, 13 Aug 2009 17:46:09 -0400 Subject: Rewrote Admin panel The following database changes must be made: * A TEXT column called "text" must be added to the end of "polloftheweek" * The transferPollRss.php script must be run * The "pollrss" table must be dropped Closes #113 --- pages/poll.php | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'pages/poll.php') diff --git a/pages/poll.php b/pages/poll.php index 6582d90..6a87207 100755 --- a/pages/poll.php +++ b/pages/poll.php @@ -88,36 +88,37 @@ if (!isset($_GET['id'])) $getpoll2 = mysql_query($getpoll); $getpoll3 = mysql_fetch_array($getpoll2); - $template->add('QUESTION', $getpoll3['question']); - - $getrss = "SELECT * FROM pollrss WHERE id = " . $_GET['id']; - $getrss2 = mysql_query($getrss); - $getrss3 = mysql_fetch_array($getrss2); - - if ($getrss3['id'] == $_GET['id']) + if ($getpoll3['id'] == $_GET['id']) { - $template->adds_block('COMPLETE', array( 'RSS' => parseText($getrss3['rss']), - 'AUTHOR' => $getrss3['author'], - 'DATE' => date("F jS Y \a\\t g:i:s a",strtotime($getrss3['date'])), - 'OPTION1' => $getpoll3['option1'], - 'OPTION2' => $getpoll3['option2'], - 'OPTION3' => $getpoll3['option3'], - 'OPTION4' => $getpoll3['option4'], - 'CLICKS1' => $getpoll3['clicks1'], - 'CLICKS2' => $getpoll3['clicks2'], - 'CLICKS3' => $getpoll3['clicks3'], - 'CLICKS4' => $getpoll3['clicks4'])); - } else { - $template->adds_block('INCOMPLETE', array('exi'=>1)); - } + $template->add('QUESTION', $getpoll3['question']); - $template->add('POTW', getPollOfTheWeek($_GET['id'])); - $template->display(); + if ($getpoll3['text'] != '') + { + $template->adds_block('COMPLETE', array( 'RSS' => parseText($getpoll3['text']), + 'AUTHOR' => $getrss3['author'], + 'DATE' => date("F jS Y \a\\t g:i:s a",strtotime($getpoll3['week'])), + 'OPTION1' => $getpoll3['option1'], + 'OPTION2' => $getpoll3['option2'], + 'OPTION3' => $getpoll3['option3'], + 'OPTION4' => $getpoll3['option4'], + 'CLICKS1' => $getpoll3['clicks1'], + 'CLICKS2' => $getpoll3['clicks2'], + 'CLICKS3' => $getpoll3['clicks3'], + 'CLICKS4' => $getpoll3['clicks4'])); + } else { + $template->adds_block('INCOMPLETE', array('exi'=>1)); + } + + $template->add('POTW', getPollOfTheWeek($_GET['id'])); + $template->display(); - $page_id = 'polloftheweek-' . $getpoll3['id']; - include('includes/comments.php'); + $page_id = 'polloftheweek-' . $getpoll3['id']; + include('includes/comments.php'); - displayRelated($getpoll3['question']); + displayRelated($getpoll3['question']); + } else { + generateError('404'); + } } ?> -- cgit 1.4.1