diff options
Diffstat (limited to 'pages/vote.php')
-rwxr-xr-x | pages/vote.php | 42 |
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 | ||
23 | require('headerproc.php'); | 23 | require('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 | ||
32 | if ($getpost3['id'] == $_GET['id']) | 29 | if ($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 | ?> |