MyBB Community Forums

Full Version: Reputation Comments
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to make "Reputation Comments" only viewable to Admins and the member who received them.

I found the code edit below for reputation.php to block users from seeing other users Reputation Comments, but it also blocks Admins. Can somebody help modify the code so that the Admin can also see Reputation Comments for all users?

Existing code which alows everyone to view Comments:
[Previous code]
$reputation_vote['comments'] = $parser->parse_message($reputation_vote['comments'], $reputation_parser);
eval("\$reputation_votes .= \"".$templates->get("reputation_vote")."\";");
[/code]

Modified code, allows users to view only their own Comments:
 if($mybb->user["username"] == $user['username']){
        $reputation_vote['comments'] = $parser->parse_message($reputation_vote['comments'], $reputation_parser);
        eval("\$reputation_votes .= \"".$templates->get("reputation_vote")."\";");
        } 

if($mybb->user["username"] == $user['username'])

to:

if($mybb->user["username"] == $user['username'] || $mybb->usergroup['cancp'] == 1)
Perfect. Thank you Matt!