From 9ba37f4643f825052c002bda16884ccc73f57ebc Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Mon, 5 Jan 2009 18:33:23 -0500 Subject: Improved anonymous commenting There was a bug where, if an anonymous commenter used a username that was being used by an actual member, Four Island would think the anonymous commentor was actually the member. --- includes/comments.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'includes/comments.php') diff --git a/includes/comments.php b/includes/comments.php index d405279..f1b8228 100755 --- a/includes/comments.php +++ b/includes/comments.php @@ -43,16 +43,17 @@ $getcomments2 = mysql_query($getcomments) or die($getcomments); $i=0; while ($getcomments3[$i] = mysql_fetch_array($getcomments2)) { - $getuser = "SELECT * FROM phpbb_users WHERE username = \"" . $getcomments3[$i]['username'] . "\""; - $getuser2 = mysql_query($getuser); - $getuser3 = mysql_fetch_array($getuser2); - - if ($getuser3['username'] == $getcomments3[$i]['username']) + if ($getcomments3[$i]['is_anon'] == 0) { + $getuser = "SELECT * FROM phpbb_users WHERE username = \"" . $getcomments3[$i]['username'] . "\""; + $getuser2 = mysql_query($getuser); + $getuser3 = mysql_fetch_array($getuser2); + $username = $getuser3['username']; $email = $getuser3['user_email']; $website = $getuser3['user_website']; - } else { + } else if ($getcomments3[$i]['is_anon'] == 1) + { $getanon = "SELECT * FROM anon_commenters WHERE username = \"" . $getcomments3[$i]['username'] . "\""; $getanon2 = mysql_query($getanon); $getanon3 = mysql_fetch_array($getanon2); -- cgit 1.4.1