summary refs log tree commit diff stats
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rwxr-xr-xpages/poll.php17
-rwxr-xr-xpages/polloftheweek.php71
2 files changed, 43 insertions, 45 deletions
diff --git a/pages/poll.php b/pages/poll.php index 67f51a8..d871a7d 100755 --- a/pages/poll.php +++ b/pages/poll.php
@@ -24,7 +24,22 @@ require('headerproc.php');
24 24
25$pageCategory = 'poll'; 25$pageCategory = 'poll';
26 26
27if (!isset($_GET['id'])) 27if (isset($_GET['submit']))
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']))
28{ 43{
29 $template = new FITemplate('pollIndex'); 44 $template = new FITemplate('pollIndex');
30 45
diff --git a/pages/polloftheweek.php b/pages/polloftheweek.php index 930f346..0410151 100755 --- a/pages/polloftheweek.php +++ b/pages/polloftheweek.php
@@ -22,52 +22,35 @@ if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22 22
23require('headerproc.php'); 23require('headerproc.php');
24 24
25if (!isset($_GET['potw'])) 25if (!isset($forceDisplay))
26{ 26{
27 if (!isset($forceDisplay)) 27 $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1";
28 { 28} else {
29 $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1"; 29 $getpoll = "SELECT * FROM polloftheweek WHERE id = " . $forceDisplay;
30 } else { 30}
31 $getpoll = "SELECT * FROM polloftheweek WHERE id = " . $forceDisplay; 31$getpoll2 = mysql_query($getpoll);
32 } 32$getpoll3 = mysql_fetch_array($getpoll2);
33 $getpoll2 = mysql_query($getpoll); 33
34 $getpoll3 = mysql_fetch_array($getpoll2); 34$template->add('QUESTION', $getpoll3['question']);
35 35$template->add('OPTION1', $getpoll3['option1']);
36 $template->add('QUESTION', $getpoll3['question']); 36$template->add('OPTION2', $getpoll3['option2']);
37 $template->add('OPTION1', $getpoll3['option1']); 37$template->add('OPTION3', $getpoll3['option3']);
38 $template->add('OPTION2', $getpoll3['option2']); 38$template->add('OPTION4', $getpoll3['option4']);
39 $template->add('OPTION3', $getpoll3['option3']); 39
40 $template->add('OPTION4', $getpoll3['option4']); 40$getip = "SELECT * FROM didpollalready WHERE ip = \"" . $_SERVER['REMOTE_ADDR'] . "\"";
41 41$getip2 = mysql_query($getip);
42 $getip = "SELECT * FROM didpollalready WHERE ip = \"" . $_SERVER['REMOTE_ADDR'] . "\""; 42$getip3 = mysql_fetch_array($getip2);
43 $getip2 = mysql_query($getip);
44 $getip3 = mysql_fetch_array($getip2);
45 43
46 if (($getip3['ip'] != $_SERVER['REMOTE_ADDR']) && (!isset($forceDisplay))) 44if (($getip3['ip'] != $_SERVER['REMOTE_ADDR']) && (!isset($forceDisplay)))
47 { 45{
48 $template->adds_block('FORM',array('exi'=>1)); 46 $template->adds_block('FORM',array('exi'=>1));
49 } else { 47} else {
50 $template->adds_block('DISPLAY',array('exi'=>1)); 48 $template->adds_block('DISPLAY',array('exi'=>1));
51 49
52 $template->add('PERCENT1', getpercent($getpoll3,'1')); 50 $template->add('PERCENT1', getpercent($getpoll3,'1'));
53 $template->add('PERCENT2', getpercent($getpoll3,'2')); 51 $template->add('PERCENT2', getpercent($getpoll3,'2'));
54 $template->add('PERCENT3', getpercent($getpoll3,'3')); 52 $template->add('PERCENT3', getpercent($getpoll3,'3'));
55 $template->add('PERCENT4', getpercent($getpoll3,'4')); 53 $template->add('PERCENT4', getpercent($getpoll3,'4'));
56 }
57} else {
58 $setip = "INSERT INTO didpollalready SET ip = \"" . $_SERVER['REMOTE_ADDR'] . "\"";
59 $setip2 = mysql_query($setip);
60 $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1";
61 $getpoll2 = mysql_query($getpoll);
62 $getpoll3 = mysql_fetch_array($getpoll2);
63 $setpoll = "UPDATE polloftheweek SET clicks" . $_POST['options'] . " = " . ($getpoll3['clicks' . $_POST['options']]+1) . " WHERE id = " . $getpoll3['id'];
64 $setpoll2 = mysql_query($setpoll);
65
66 $template = new FITemplate('msg');
67
68 $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.');
69
70 $template->display();
71} 54}
72 55
73?> 56?>