summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-12-19 09:00:40 -0500
committerStarla Insigna <hatkirby@fourisland.com>2009-12-19 09:00:40 -0500
commit69cf94fa48917f4bc1272ed85a34dd80558340e2 (patch)
tree6d87a90d25d910fb190874a32ee3f1db9d5300ea
parentb678ebeed7c82dc436e90e0b52bf61c71c10f30e (diff)
downloadfourisland-69cf94fa48917f4bc1272ed85a34dd80558340e2.tar.gz
fourisland-69cf94fa48917f4bc1272ed85a34dd80558340e2.tar.bz2
fourisland-69cf94fa48917f4bc1272ed85a34dd80558340e2.zip
Fixed POTW bug
There was previously a very annoying bug with the POTW that would randomly (but consistantly) deny people access to the POTW. It finally turned out that poll-results.php required you to be logged in to vote, which isn't what is wanted.
-rw-r--r--pages/poll-results.php103
1 files changed, 49 insertions, 54 deletions
diff --git a/pages/poll-results.php b/pages/poll-results.php index e829e53..e2fe154 100644 --- a/pages/poll-results.php +++ b/pages/poll-results.php
@@ -1,54 +1,49 @@
1<?php 1<?php
2/* 2/*
3 444444444 3 444444444
4 4::::::::4 4 4::::::::4
5 4:::::::::4 5 4:::::::::4
6 4::::44::::4 6 4::::44::::4
7 4::::4 4::::4 Four Island 7 4::::4 4::::4 Four Island
8 4::::4 4::::4 8 4::::4 4::::4
9 4::::4 4::::4 Written and maintained by Starla Insigna 9 4::::4 4::::4 Written and maintained by Starla Insigna
104::::444444::::444 104::::444444::::444
114::::::::::::::::4 pages/poll-results.php 114::::::::::::::::4 pages/poll-results.php
124444444444:::::444 124444444444:::::444
13 4::::4 Please do not use, reproduce or steal the 13 4::::4 Please do not use, reproduce or steal the
14 4::::4 contents of this file without explicit 14 4::::4 contents of this file without explicit
15 4::::4 permission from Hatkirby. 15 4::::4 permission from Hatkirby.
16 44::::::44 16 44::::::44
17 4::::::::4 17 4::::::::4
18 4444444444 18 4444444444
19*/ 19*/
20 20
21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);} 21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22 22
23require('headerproc.php'); 23require('headerproc.php');
24 24
25if ((isset($_GET['id'])) && (is_numeric($_GET['id'])) && ($_GET['id'] >= 1) && ($_GET['id'] <= 4)) 25if ((isset($_GET['id'])) && (is_numeric($_GET['id'])) && ($_GET['id'] >= 1) && ($_GET['id'] <= 4))
26{ 26{
27 if (isLoggedIn()) 27 $getip = "SELECT * FROM didpollalready WHERE ip = \"" . $_SERVER['REMOTE_ADDR'] . "\"";
28 { 28 $getip2 = mysql_query($getip);
29 $getip = "SELECT * FROM didpollalready WHERE ip = \"" . $_SERVER['REMOTE_ADDR'] . "\""; 29 $getip3 = mysql_fetch_array($getip2);
30 $getip2 = mysql_query($getip); 30
31 $getip3 = mysql_fetch_array($getip2); 31 if ($getip3['ip'] != $_SERVER['REMOTE_ADDR'])
32 32 {
33 if ($getip3['ip'] != $_SERVER['REMOTE_ADDR']) 33 $setip = "INSERT INTO didpollalready SET ip = \"" . $_SERVER['REMOTE_ADDR'] . "\"";
34 { 34 $setip2 = mysql_query($setip);
35 $setip = "INSERT INTO didpollalready SET ip = \"" . $_SERVER['REMOTE_ADDR'] . "\""; 35 $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1";
36 $setip2 = mysql_query($setip); 36 $getpoll2 = mysql_query($getpoll);
37 $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1"; 37 $getpoll3 = mysql_fetch_array($getpoll2);
38 $getpoll2 = mysql_query($getpoll); 38 $setpoll = "UPDATE polloftheweek SET clicks" . $_GET['id'] . " = " . ($getpoll3['clicks' . $_GET['id']]+1) . " WHERE id = " . $getpoll3['id'];
39 $getpoll3 = mysql_fetch_array($getpoll2); 39 $setpoll2 = mysql_query($setpoll);
40 $setpoll = "UPDATE polloftheweek SET clicks" . $_GET['id'] . " = " . ($getpoll3['clicks' . $_GET['id']]+1) . " WHERE id = " . $getpoll3['id']; 40
41 $setpoll2 = mysql_query($setpoll); 41 die(getPollOfTheWeek());
42 42 } else {
43 die(getPollOfTheWeek()); 43 generateError('404');
44 } else { 44 }
45 generateError('404'); 45} else {
46 } 46 generateError('404');
47 } else { 47}
48 generateError('404'); 48
49 } 49?>
50} else {
51 generateError('404');
52}
53
54?>