From 24503e3abe705acde2df159aeae61be0d009f92e Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Wed, 19 Nov 2008 17:27:03 -0500 Subject: Imported sources --- pages/vote.php | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 pages/vote.php (limited to 'pages/vote.php') diff --git a/pages/vote.php b/pages/vote.php new file mode 100644 index 0000000..890b379 --- /dev/null +++ b/pages/vote.php @@ -0,0 +1,115 @@ +add('BACK','Back to ' . stripslashes($getpost3['title'])); + $template->add('LINK','/blog/' . $getpost3['slug'] . '/'); + + if ($_GET['dir'] == 'plus') + { + if (updatePop($_GET['id'],'rating')) + { + $template->add('MSG','Thank you for voting!'); + } else { + $template->add('MSG','I\'m sorry, but you\'ve already voted on this post.'); + } + } else if ($_GET['dir'] == 'minus') + { + if (updatePop($_GET['id'],'rating',-1)) + { + $template->add('MSG','Thank you for voting!'); + } else { + $template->add('MSG','I\'m sorry, but you\'ve already voted on this post.'); + } + } else { + $template = new FITemplate('msg'); + $template->add('BACK','the previous page'); + $template->add('MSG','Um, what on earth are you doing?'); + } + } else { + $template = new FITemplate('msg'); + $template->add('BACK','the previous page'); + $template->add('MSG','Um, what on earth are you doing?'); + } +} else if ($_GET['mode'] == 'comment') +{ + $getcomment = "SELECT * FROM comments WHERE id = " . $_GET['id']; + $getcomment2 = mysql_query($getcomment); + $getcomment3 = mysql_fetch_array($getcomment2); + + if ($getcomment3['id'] == $_GET['id']) + { + $page_id = $getcomment3['page_id']; + $comID = substr($page_id,strpos($page_id,'-')+1); + + $getpost = "SELECT * FROM updates WHERE id = " . $comID; + $getpost2 = mysql_query($getpost); + $getpost3 = mysql_fetch_array($getpost2); + + $template = new FITemplate('msg2'); + $template->add('BACK','Back to ' . stripslashes($getpost3['title'])); + $template->add('LINK','/blog/' . $getpost3['slug'] . '/'); + + if ($_GET['dir'] == 'plus') + { + if (updateCommentPop($_GET['id'])) + { + $template->add('MSG','Thank you for voting!'); + } else { + $template->add('MSG','I\'m sorry, but you\'ve already voted on this comment.'); + } + } else if ($_GET['dir'] == 'minus') + { + if (updateCommentPop($_GET['id'],-1)) + { + $template->add('MSG','Thank you for voting!'); + } else { + $template->add('MSG','I\'m sorry, but you\'ve already voted on this comment.'); + } + } else { + $template = new FITemplate('msg'); + $template->add('BACK','the previous page'); + $template->add('MSG','Um, what on earth are you doing?'); + } + } else { + $template = new FITemplate('msg'); + $template->add('BACK','the previous page'); + $template->add('MSG','Um, what on earth are you doing?'); + } +} + +$template->display(); + +?> -- cgit 1.4.1