MyBB Community Forums

Full Version: how to show usergroup colour in any page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i made css for it and in other parts of my forum its showing but in my custom page its showing white.
i am using this
user{$mybb->user['usergroup']}

and i check that its showing there who is browsing the page that user id comes like
<a href="member.php?action=profile&amp;uid=1" class="user4">admin</a>
as i am admin thats why its showing user4
Hello.
You can try this plugin for usernames colors:
https://community.mybb.com/mods.php?action=view&pid=128

And this for usergroup legend:
https://community.mybb.com/mods.php?action=view&pid=642
as i said in all page its already showing. so i dont wanna use any plugin. i want code for it
Make sure to clear browser cache and proxy cache if using a reverse proxy such as cloudflare.
i already did it. and i did not use any cdn
but here the main question is who browse the page that user id css is using
(2020-12-08, 02:05 PM)soumik Wrote: [ -> ]i already did it. and i did not use any cdn
but here the main question is who browse the page that user id css is using

Press F12 in your browser on a page with the name and look in the Elements tab. Is the css being applied properly? Is it overtaken by another styling rule?
css working sir but the issue is the variable.
{$mybb->user['usergroup']} this show only who view the page that user group id not the original group id of the username is posted in the page.
(2020-12-08, 06:09 PM)soumik Wrote: [ -> ]css working sir but the issue is the variable.
{$mybb->user['usergroup']}  this show only who view the page that user group id not the original group id of the username is posted in the page.

Ohhh I see what you mean. Use this instead "{$usergroup['gid']}" or "{$memprofile['usergroup']}" for user profiles. When you use "user" variables it's taking information from the user who is currently logged in viewing the page.
i try both but not geeing id number