MyBB Community Forums

Full Version: Need Some Help, Having Issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am just looking to do this function but doesn't display anything. I have the plugin to use php in templates.

Example Code
<?php
if($memprofile['usergroup'] == 4) {
print 'Admin';
}
?>

It does not display anything, I have tried gid as well. The goal here is when viewing someones profile it will tell you what group they are in, Example usage is above.

Can't use
<?php
if($mybb->user['usergroup'] == 4) {
print 'Admin';
}
?>


It doesn't work because at this point you are loading your stats not the remote users.

Any solutions?
the first code should work on member_profile template

however member profile page already contains the member group
^ It doesn't work though sadly, Need a solution.
Can you try this with $mybb->user['uid'] code ?
checked & working for me. please see code image & output image

@WallBB
$mybb->user['uid'] refers to visiting user.
$memprofile['uid'] gives user id of the profile
If you're using php in templates like you said you can easily do this:

<if $memprofile['usergroup'] == 4 then>Admin</if>