diff options
Diffstat (limited to 'pages')
-rwxr-xr-x | pages/poll.php | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/pages/poll.php b/pages/poll.php index e228712..c7cc909 100755 --- a/pages/poll.php +++ b/pages/poll.php | |||
@@ -28,14 +28,7 @@ if (!isset($_GET['id'])) | |||
28 | { | 28 | { |
29 | $template = new FITemplate('pollIndex'); | 29 | $template = new FITemplate('pollIndex'); |
30 | 30 | ||
31 | if (isset($_GET['start'])) | 31 | $getpolls = "SELECT * FROM polloftheweek ORDER BY id DESC"; |
32 | { | ||
33 | $start = $_GET['start'] * 10; | ||
34 | } else { | ||
35 | $start = 0; | ||
36 | } | ||
37 | |||
38 | $getpolls = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT " . $start . ",10"; | ||
39 | $getpolls2 = mysql_query($getpolls); | 32 | $getpolls2 = mysql_query($getpolls); |
40 | $i=0; | 33 | $i=0; |
41 | while ($getpolls3[$i] = mysql_fetch_array($getpolls2)) | 34 | while ($getpolls3[$i] = mysql_fetch_array($getpolls2)) |
@@ -59,18 +52,6 @@ if (!isset($_GET['id'])) | |||
59 | $i++; | 52 | $i++; |
60 | } | 53 | } |
61 | 54 | ||
62 | if ($i==0) | ||
63 | { | ||
64 | generateError('404'); | ||
65 | exit; | ||
66 | } | ||
67 | |||
68 | $start /= 10; | ||
69 | if ($start > 0) | ||
70 | { | ||
71 | $template->adds_block('PREVIOUS', array('ID' => ($start-1))); | ||
72 | } | ||
73 | |||
74 | $cntpolls = "SELECT COUNT(*) FROM polloftheweek"; | 55 | $cntpolls = "SELECT COUNT(*) FROM polloftheweek"; |
75 | $cntpolls2 = mysql_query($cntpolls); | 56 | $cntpolls2 = mysql_query($cntpolls); |
76 | $cntpolls3 = mysql_fetch_array($cntpolls2); | 57 | $cntpolls3 = mysql_fetch_array($cntpolls2); |
@@ -79,7 +60,6 @@ if (!isset($_GET['id'])) | |||
79 | $template->adds_block('NEXT', array('ID' => ($start+1))); | 60 | $template->adds_block('NEXT', array('ID' => ($start+1))); |
80 | } | 61 | } |
81 | 62 | ||
82 | $template->add('POTW', getPollOfTheWeek()); | ||
83 | $template->display(); | 63 | $template->display(); |
84 | } else { | 64 | } else { |
85 | $template = new FITemplate('poll'); | 65 | $template = new FITemplate('poll'); |