summary refs log tree commit diff stats
path: root/pages/vote.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/vote.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/vote.php')
-rwxr-xr-xpages/vote.php42
1 files changed, 15 insertions, 27 deletions
diff --git a/pages/vote.php b/pages/vote.php index 667b5c9..339bbf9 100755 --- a/pages/vote.php +++ b/pages/vote.php
@@ -22,46 +22,34 @@ if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22 22
23require('headerproc.php'); 23require('headerproc.php');
24 24
25$pageCategory = 'home';
26$pageAID = 'archive';
27
28$getpost = "SELECT * FROM updates WHERE id = " . $_GET['id']; 25$getpost = "SELECT * FROM updates WHERE id = " . $_GET['id'];
29$getpost2 = mysql_query($getpost); 26$getpost2 = mysql_query($getpost);
30$getpost3 = mysql_fetch_array($getpost2); 27$getpost3 = mysql_fetch_array($getpost2);
31 28
32if ($getpost3['id'] == $_GET['id']) 29if ($getpost3['id'] == $_GET['id'])
33{ 30{
34 $template = new FITemplate('msg2');
35 $template->add('BACK','Back to ' . stripslashes($getpost3['title']));
36 $template->add('LINK','/blog/' . $getpost3['slug'] . '/');
37
38 if ($_GET['dir'] == 'plus') 31 if ($_GET['dir'] == 'plus')
39 { 32 {
40 if (updatePop($_GET['id'],'rating')) 33 $add = 1;
41 {
42 $template->add('MSG','Thank you for voting!');
43 } else {
44 $template->add('MSG','I\'m sorry, but you\'ve already voted on this post.');
45 }
46 } else if ($_GET['dir'] == 'minus') 34 } else if ($_GET['dir'] == 'minus')
47 { 35 {
48 if (updatePop($_GET['id'],'rating',-1)) 36 $add = -1;
49 { 37 } else {
50 $template->add('MSG','Thank you for voting!'); 38 die;
51 } else { 39 }
52 $template->add('MSG','I\'m sorry, but you\'ve already voted on this post.'); 40
53 } 41 if (updatePop($_GET['id'],'rating',$add))
42 {
43 $getpost = "SELECT * FROM updates WHERE id = " . $_GET['id'];
44 $getpost2 = mysql_query($getpost);
45 $getpost3 = mysql_fetch_array($getpost2);
46
47 die($getpost3['rating']);
54 } else { 48 } else {
55 $template = new FITemplate('msg'); 49 die;
56 $template->add('BACK','the previous page');
57 $template->add('MSG','Um, what on earth are you doing?');
58 } 50 }
59} else { 51} else {
60 $template = new FITemplate('msg'); 52 generateError('404');
61 $template->add('BACK','the previous page');
62 $template->add('MSG','Um, what on earth are you doing?');
63} 53}
64 54
65$template->display();
66
67?> 55?>