From 07aae7e8f8b752e6b37b338783a6d6fef290ee10 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sun, 7 Dec 2008 17:27:58 -0500 Subject: Removed comment rating system --- includes/comments.php | 10 +----- includes/functions.php | 26 --------------- pages/vote.php | 88 ++++++++++++-------------------------------------- theme/comments.tpl | 6 ---- 4 files changed, 21 insertions(+), 109 deletions(-) diff --git a/includes/comments.php b/includes/comments.php index 682aa0e..ca5528e 100755 --- a/includes/comments.php +++ b/includes/comments.php @@ -68,19 +68,11 @@ while ($getcomments3[$i] = mysql_fetch_array($getcomments2)) if (isset($username)) { - if ($getcomments3[$i]['rating'] > -2) - { - $text = parseBBCode($getcomments3[$i]['comment']); - } else { - $text = 'This comment has been rated down below the threshold for public viewing (-1), suggesting that it may contain inappropriate or off topic content. (Or it may have been flame bait, or simply bad!)'; - } - $template->add_ref($curID, 'COMMENTS', array( 'CODEDEMAIL' => md5(strtolower($email)), 'USERNAME' => (($website != '') ? '' . $username . '' : $username), 'DATE' => date("F dS Y \a\\t g:i:s a",strtotime($getcomments3[$i]['posttime'])), - 'RATING' => $getcomments3[$i]['rating'], 'ID' => $getcomments3[$i]['id'], - 'TEXT' => $text)); + 'TEXT' => parseBBCode($getcomments3[$i]['comment']))); } $i++; } diff --git a/includes/functions.php b/includes/functions.php index ee19391..c71e69f 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -215,30 +215,4 @@ function verifyUser($username, $password) return (($_POST['username'] != '') && ($getuser3['username'] == $_POST['username'])); } -function updateCommentPop($id, $plus=1) -{ - $gettrack = "SELECT * FROM tracking_comments WHERE ip = \"" . $_SERVER['REMOTE_ADDR'] . "\""; - $gettrack2 = mysql_query($gettrack); - $gettrack3 = mysql_fetch_array($gettrack2); - - $trackArr = explode(',',$gettrack3['comment_id']); - - if (($gettrack3['ip'] != $_SERVER['REMOTE_ADDR']) || (array_search($id,$trackArr) === FALSE)) - { - $setcomment = "UPDATE comments SET rating = rating+" . $plus . " WHERE id = " . $id; - $setcomment2 = mysql_query($setcomment); - - if ($gettrack3['ip'] == $_SERVER['REMOTE_ADDR']) - { - $settrack = "UPDATE tracking SET rating = \"" . $gettrack3['comment_id'] . "," . $id . "\" WHERE id = " . $gettrack3['id']; - } else { - $settrack = "INSERT INTO tracking (ip,rating) VALUES (\"" . $_SERVER['REMOTE_ADDR'] . "\",\"" . $id . "\")"; - } - $settrack2 = mysql_query($settrack) or die($settrack); - return 1; - } else { - return 0; - } -} - ?> 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'); $pageCategory = 'home'; $pageAID = 'archive'; -if (!isset($_GET['mode'])) +$getpost = "SELECT * FROM updates WHERE id = " . $_GET['id']; +$getpost2 = mysql_query($getpost); +$getpost3 = mysql_fetch_array($getpost2); + +if ($getpost3['id'] == $_GET['id']) { - $getpost = "SELECT * FROM updates WHERE id = " . $_GET['id']; - $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 ($getpost3['id'] == $_GET['id']) + if ($_GET['dir'] == 'plus') { - $template = new FITemplate('msg2'); - $template->add('BACK','Back to ' . stripslashes($getpost3['title'])); - $template->add('LINK','/blog/' . $getpost3['slug'] . '/'); - - if ($_GET['dir'] == 'plus') + if (updatePop($_GET['id'],'rating')) { - 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.'); - } + $template->add('MSG','Thank you for voting!'); } else { - $template = new FITemplate('msg'); - $template->add('BACK','the previous page'); - $template->add('MSG','Um, what on earth are you doing?'); + $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 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']) + } else if ($_GET['dir'] == 'minus') { - $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 (updatePop($_GET['id'],'rating',-1)) { - 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.'); - } + $template->add('MSG','Thank you for voting!'); } else { - $template = new FITemplate('msg'); - $template->add('BACK','the previous page'); - $template->add('MSG','Um, what on earth are you doing?'); + $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?'); } $template->display(); diff --git a/theme/comments.tpl b/theme/comments.tpl index d814292..c029ffb 100755 --- a/theme/comments.tpl +++ b/theme/comments.tpl @@ -11,12 +11,6 @@ on - - - - - - -- cgit 1.4.1