summary refs log tree commit diff stats
path: root/pages/poll.php
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-08-09 09:14:58 -0400
committerStarla Insigna <hatkirby@fourisland.com>2009-08-09 09:14:58 -0400
commit893957c41481a0cd5eb624096337762ffa54ff28 (patch)
tree09d2487f8add5a6281e3482a471abf21faa4f819 /pages/poll.php
parentd27a3784c81f0c582e43655509e806978b7e65e4 (diff)
downloadfourisland-893957c41481a0cd5eb624096337762ffa54ff28.tar.gz
fourisland-893957c41481a0cd5eb624096337762ffa54ff28.tar.bz2
fourisland-893957c41481a0cd5eb624096337762ffa54ff28.zip
Created layout 7
The following changes were also made in this revision:

* All HTML was changed to XHTML and a !DOCTYPE was included to reflect this
* Rewrote quotes tracking system to be much less complicated and actually working
* Changed quotes rendering to look more like Chirpy than Rash
* Fixed comment textarea bug
* Rewrote a ton of CSS so it's not as bloated
* Added a JavaScript confirmation when deleting a comment
* AJAXified voting on the POTW
* AJAXified voting and flagging quotes
* AJAXified commenting
* AJAXified voting on posts
* Added DateFinder back after it was accidentally deleted in Layout 4.5

The following database changes must be performed as soon as possible:

* Fix title of NO <!DOCTYPE> post (the &lt; is missing the semicolon)
* Restore post Frasty Tha Snaman from a backup
* Reset "flag" field of all rows in "rash_quotes" to 0
* Remove the "vote" and "flag" columns of "rash_tracking"
* Rename the "quote_id" column of "rash_tracking" to "vote"

The following external code changes must also be performed as soon as possible:

* Add the following line to the end of the // Four Island block in The Fourm's functions.php:
  require('/svr/www/hatkirby/fourisland/main/includes/specialdates.php');
Diffstat (limited to 'pages/poll.php')
-rwxr-xr-xpages/poll.php29
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
27if (isset($_GET['submit'])) 27if (!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'];