diff options
Diffstat (limited to 'pages/poll.php')
-rwxr-xr-x | pages/poll.php | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/pages/poll.php b/pages/poll.php index d9cce70..6582d90 100755 --- a/pages/poll.php +++ b/pages/poll.php | |||
@@ -24,22 +24,7 @@ require('headerproc.php'); | |||
24 | 24 | ||
25 | $pageCategory = 'poll'; | 25 | $pageCategory = 'poll'; |
26 | 26 | ||
27 | if (isset($_GET['submit'])) | 27 | if (!isset($_GET['id'])) |
28 | { | ||
29 | $setip = "INSERT INTO didpollalready SET ip = \"" . $_SERVER['REMOTE_ADDR'] . "\""; | ||
30 | $setip2 = mysql_query($setip); | ||
31 | $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1"; | ||
32 | $getpoll2 = mysql_query($getpoll); | ||
33 | $getpoll3 = mysql_fetch_array($getpoll2); | ||
34 | $setpoll = "UPDATE polloftheweek SET clicks" . $_POST['options'] . " = " . ($getpoll3['clicks' . $_POST['options']]+1) . " WHERE id = " . $getpoll3['id']; | ||
35 | $setpoll2 = mysql_query($setpoll); | ||
36 | |||
37 | $template = new FITemplate('msg'); | ||
38 | |||
39 | $template->add('MSG','<H2>' . $getpoll3['question'] . '</H2><P>Thank you for voting on the Poll of the Week!<BR><A HREF="poll.php?id=' . $getpoll3['id'] . '">Click here to visit the page for this poll.'); | ||
40 | |||
41 | $template->display(); | ||
42 | } else if (!isset($_GET['id'])) | ||
43 | { | 28 | { |
44 | $template = new FITemplate('pollIndex'); | 29 | $template = new FITemplate('pollIndex'); |
45 | 30 | ||
@@ -70,7 +55,7 @@ if (isset($_GET['submit'])) | |||
70 | $template->adds_block('POLL', array( 'ID' => $getpolls3[$i]['id'], | 55 | $template->adds_block('POLL', array( 'ID' => $getpolls3[$i]['id'], |
71 | 'QUESTION' => $question, | 56 | 'QUESTION' => $question, |
72 | 'WEEK' => date('F jS Y', strtotime($getpolls3[$i]['week'])), | 57 | 'WEEK' => date('F jS Y', strtotime($getpolls3[$i]['week'])), |
73 | 'EVEN' => (($i % 2 == 1) ? ' CLASS="even"' : ''))); | 58 | 'EVEN' => (($i % 2 == 1) ? ' class="even"' : ''))); |
74 | $i++; | 59 | $i++; |
75 | } | 60 | } |
76 | 61 | ||
@@ -94,8 +79,7 @@ if (isset($_GET['submit'])) | |||
94 | $template->adds_block('NEXT', array('ID' => ($start+1))); | 79 | $template->adds_block('NEXT', array('ID' => ($start+1))); |
95 | } | 80 | } |
96 | 81 | ||
97 | include('pages/polloftheweek.php'); | 82 | $template->add('POTW', getPollOfTheWeek()); |
98 | |||
99 | $template->display(); | 83 | $template->display(); |
100 | } else { | 84 | } else { |
101 | $template = new FITemplate('poll'); | 85 | $template = new FITemplate('poll'); |
@@ -114,7 +98,7 @@ if (isset($_GET['submit'])) | |||
114 | { | 98 | { |
115 | $template->adds_block('COMPLETE', array( 'RSS' => parseText($getrss3['rss']), | 99 | $template->adds_block('COMPLETE', array( 'RSS' => parseText($getrss3['rss']), |
116 | 'AUTHOR' => $getrss3['author'], | 100 | 'AUTHOR' => $getrss3['author'], |
117 | 'DATE' => date("F dS Y \a\\t g:i:s a",strtotime($getrss3['date'])), | 101 | 'DATE' => date("F jS Y \a\\t g:i:s a",strtotime($getrss3['date'])), |
118 | 'OPTION1' => $getpoll3['option1'], | 102 | 'OPTION1' => $getpoll3['option1'], |
119 | 'OPTION2' => $getpoll3['option2'], | 103 | 'OPTION2' => $getpoll3['option2'], |
120 | 'OPTION3' => $getpoll3['option3'], | 104 | 'OPTION3' => $getpoll3['option3'], |
@@ -127,10 +111,7 @@ if (isset($_GET['submit'])) | |||
127 | $template->adds_block('INCOMPLETE', array('exi'=>1)); | 111 | $template->adds_block('INCOMPLETE', array('exi'=>1)); |
128 | } | 112 | } |
129 | 113 | ||
130 | $forceDisplay = $_GET['id']; | 114 | $template->add('POTW', getPollOfTheWeek($_GET['id'])); |
131 | include('pages/polloftheweek.php'); | ||
132 | unset($forceDisplay); | ||
133 | |||
134 | $template->display(); | 115 | $template->display(); |
135 | 116 | ||
136 | $page_id = 'polloftheweek-' . $getpoll3['id']; | 117 | $page_id = 'polloftheweek-' . $getpoll3['id']; |