summary refs log tree commit diff stats
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rwxr-xr-xpages/vote.php88
1 files changed, 20 insertions, 68 deletions
diff --git a/pages/vote.php b/pages/vote.php index 890b379..667b5c9 100755 --- a/pages/vote.php +++ b/pages/vote.php
@@ -25,89 +25,41 @@ require('headerproc.php');
25$pageCategory = 'home'; 25$pageCategory = 'home';
26$pageAID = 'archive'; 26$pageAID = 'archive';
27 27
28if (!isset($_GET['mode'])) 28$getpost = "SELECT * FROM updates WHERE id = " . $_GET['id'];
29$getpost2 = mysql_query($getpost);
30$getpost3 = mysql_fetch_array($getpost2);
31
32if ($getpost3['id'] == $_GET['id'])
29{ 33{
30 $getpost = "SELECT * FROM updates WHERE id = " . $_GET['id']; 34 $template = new FITemplate('msg2');
31 $getpost2 = mysql_query($getpost); 35 $template->add('BACK','Back to ' . stripslashes($getpost3['title']));
32 $getpost3 = mysql_fetch_array($getpost2); 36 $template->add('LINK','/blog/' . $getpost3['slug'] . '/');
33 37
34 if ($getpost3['id'] == $_GET['id']) 38 if ($_GET['dir'] == 'plus')
35 { 39 {
36 $template = new FITemplate('msg2'); 40 if (updatePop($_GET['id'],'rating'))
37 $template->add('BACK','Back to ' . stripslashes($getpost3['title']));
38 $template->add('LINK','/blog/' . $getpost3['slug'] . '/');
39
40 if ($_GET['dir'] == 'plus')
41 { 41 {
42 if (updatePop($_GET['id'],'rating')) 42 $template->add('MSG','Thank you for voting!');
43 {
44 $template->add('MSG','Thank you for voting!');
45 } else {
46 $template->add('MSG','I\'m sorry, but you\'ve already voted on this post.');
47 }
48 } else if ($_GET['dir'] == 'minus')
49 {
50 if (updatePop($_GET['id'],'rating',-1))
51 {
52 $template->add('MSG','Thank you for voting!');
53 } else {
54 $template->add('MSG','I\'m sorry, but you\'ve already voted on this post.');
55 }
56 } else { 43 } else {
57 $template = new FITemplate('msg'); 44 $template->add('MSG','I\'m sorry, but you\'ve already voted on this post.');
58 $template->add('BACK','the previous page');
59 $template->add('MSG','Um, what on earth are you doing?');
60 } 45 }
61 } else { 46 } else if ($_GET['dir'] == 'minus')
62 $template = new FITemplate('msg');
63 $template->add('BACK','the previous page');
64 $template->add('MSG','Um, what on earth are you doing?');
65 }
66} else if ($_GET['mode'] == 'comment')
67{
68 $getcomment = "SELECT * FROM comments WHERE id = " . $_GET['id'];
69 $getcomment2 = mysql_query($getcomment);
70 $getcomment3 = mysql_fetch_array($getcomment2);
71
72 if ($getcomment3['id'] == $_GET['id'])
73 { 47 {
74 $page_id = $getcomment3['page_id']; 48 if (updatePop($_GET['id'],'rating',-1))
75 $comID = substr($page_id,strpos($page_id,'-')+1);
76
77 $getpost = "SELECT * FROM updates WHERE id = " . $comID;
78 $getpost2 = mysql_query($getpost);
79 $getpost3 = mysql_fetch_array($getpost2);
80
81 $template = new FITemplate('msg2');
82 $template->add('BACK','Back to ' . stripslashes($getpost3['title']));
83 $template->add('LINK','/blog/' . $getpost3['slug'] . '/');
84
85 if ($_GET['dir'] == 'plus')
86 {
87 if (updateCommentPop($_GET['id']))
88 {
89 $template->add('MSG','Thank you for voting!');
90 } else {
91 $template->add('MSG','I\'m sorry, but you\'ve already voted on this comment.');
92 }
93 } else if ($_GET['dir'] == 'minus')
94 { 49 {
95 if (updateCommentPop($_GET['id'],-1)) 50 $template->add('MSG','Thank you for voting!');
96 {
97 $template->add('MSG','Thank you for voting!');
98 } else {
99 $template->add('MSG','I\'m sorry, but you\'ve already voted on this comment.');
100 }
101 } else { 51 } else {
102 $template = new FITemplate('msg'); 52 $template->add('MSG','I\'m sorry, but you\'ve already voted on this post.');
103 $template->add('BACK','the previous page');
104 $template->add('MSG','Um, what on earth are you doing?');
105 } 53 }
106 } else { 54 } else {
107 $template = new FITemplate('msg'); 55 $template = new FITemplate('msg');
108 $template->add('BACK','the previous page'); 56 $template->add('BACK','the previous page');
109 $template->add('MSG','Um, what on earth are you doing?'); 57 $template->add('MSG','Um, what on earth are you doing?');
110 } 58 }
59} else {
60 $template = new FITemplate('msg');
61 $template->add('BACK','the previous page');
62 $template->add('MSG','Um, what on earth are you doing?');
111} 63}
112 64
113$template->display(); 65$template->display();