summary refs log tree commit diff stats
path: root/pages/polloftheweek.php
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-11-19 17:27:03 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-11-19 17:27:03 -0500
commit24503e3abe705acde2df159aeae61be0d009f92e (patch)
tree8debbd53dcd0db2f5934c5e2af4e697e3787781d /pages/polloftheweek.php
downloadfourisland-24503e3abe705acde2df159aeae61be0d009f92e.tar.gz
fourisland-24503e3abe705acde2df159aeae61be0d009f92e.tar.bz2
fourisland-24503e3abe705acde2df159aeae61be0d009f92e.zip
Imported sources
Diffstat (limited to 'pages/polloftheweek.php')
-rw-r--r--pages/polloftheweek.php73
1 files changed, 73 insertions, 0 deletions
diff --git a/pages/polloftheweek.php b/pages/polloftheweek.php new file mode 100644 index 0000000..930f346 --- /dev/null +++ b/pages/polloftheweek.php
@@ -0,0 +1,73 @@
1<?php
2/*
3 444444444
4 4::::::::4
5 4:::::::::4
6 4::::44::::4
7 4::::4 4::::4 Four Island
8 4::::4 4::::4
9 4::::4 4::::4 Written and maintained by Starla Insigna
104::::444444::::444
114::::::::::::::::4 pages/polloftheweek.php
124444444444:::::444
13 4::::4 Please do not use, reproduce or steal the
14 4::::4 contents of this file without explicit
15 4::::4 permission from Hatkirby.
16 44::::::44
17 4::::::::4
18 4444444444
19*/
20
21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22
23require('headerproc.php');
24
25if (!isset($_GET['potw']))
26{
27 if (!isset($forceDisplay))
28 {
29 $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1";
30 } else {
31 $getpoll = "SELECT * FROM polloftheweek WHERE id = " . $forceDisplay;
32 }
33 $getpoll2 = mysql_query($getpoll);
34 $getpoll3 = mysql_fetch_array($getpoll2);
35
36 $template->add('QUESTION', $getpoll3['question']);
37 $template->add('OPTION1', $getpoll3['option1']);
38 $template->add('OPTION2', $getpoll3['option2']);
39 $template->add('OPTION3', $getpoll3['option3']);
40 $template->add('OPTION4', $getpoll3['option4']);
41
42 $getip = "SELECT * FROM didpollalready WHERE ip = \"" . $_SERVER['REMOTE_ADDR'] . "\"";
43 $getip2 = mysql_query($getip);
44 $getip3 = mysql_fetch_array($getip2);
45
46 if (($getip3['ip'] != $_SERVER['REMOTE_ADDR']) && (!isset($forceDisplay)))
47 {
48 $template->adds_block('FORM',array('exi'=>1));
49 } else {
50 $template->adds_block('DISPLAY',array('exi'=>1));
51
52 $template->add('PERCENT1', getpercent($getpoll3,'1'));
53 $template->add('PERCENT2', getpercent($getpoll3,'2'));
54 $template->add('PERCENT3', getpercent($getpoll3,'3'));
55 $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}
72
73?>