diff --git a/www/reviews.php b/www/reviews.php index 8e668445..cb925481 100644 --- a/www/reviews.php +++ b/www/reviews.php @@ -436,7 +436,7 @@ function showReview($db, $gameid, $rec, $specialNames, $optionFlags = 0) } // set up the comment controls, if applicable - $commentCtls = $barCommentCtl = ""; + $commentCtls = $barCommentCtls = ""; if ($showCommentCtls && ($curuser == $userid || ($dfltComments && $showVoteCtls))) { @@ -450,19 +450,30 @@ function showReview($db, $gameid, $rec, $specialNames, $optionFlags = 0) } // set up the for adding a comment - $addCommentLink = ""; + $addCommentLink = ""; // generate the controls, depending on the existing comment count - if ($commentCount == 0) { - $commentCtls = "{$addCommentLink}Add a comment"; - } else { - $commentCtls = - "" - . "View comments ($commentCount) - " - . "{$addCommentLink}Add comment"; + if ($curuser) { + if ($commentCount == 0) { + $commentCtls = "{$addCommentLink}Add a comment"; + } else { + $commentCtls = " + View comments ($commentCount)"; + } + } + else { + if ($commentCount > 0) { + $commentCtls = " + View comments ($commentCount)"; + } } - $barCommentCtls = "| $commentCtls"; + if ($commentCtls) { + $barCommentCtls = "| $commentCtls"; + } } // add any special notes @@ -483,15 +494,18 @@ function showReview($db, $gameid, $rec, $specialNames, $optionFlags = 0) if ($curuser == $userid) { echo "