MyBB Community Forums

Full Version: get username with their usergroup color
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
HEY PEOPLE,

so guys i used 

{$mybb->user['username']}

but its returning with the username only have have made many usergroup with their own respective colors like

admin = red
staff = orange
user = white
forum poster = green

can anyone help me how to get their username with their usergroup colors

ty
you want to change the user group member id colour right?

go to
Admin Panel=>User & Groups=>Groups=>Edit Groups=>Username Style

and like this

<span style="color: green;"><strong>{username}</strong></span>
Go to ACP "User & Groups" > Groups and select your usergroup.
Edit the "Username Style" to
either (CSS class for styling)
<span class="user_admin"><strong>{username}</strong></span>
or (inline style)
<span style="color: #C00><strong>{username}</strong></span>

For example:
Admin: <span class="user_admin">{username}</span>
Staff: <span class="user_staff">{username}</span>
User: <span class="user_general">{username}</span>
Poster: <span class="user_poster"><strong>{username}</strong></span>
CSS:
.user_admin { color: #C00; font-weight: bold; }
.user_staff { color: #F70; font-weight: bold; }
.user_admin { color: #FFF; }
.user_poster { color: #00C; }

[ExiTuS]
hello @[ExiTuS] thank you for the reply i currently using in line style
but i want to use the css form

but i have a doubt as you mentioned above code

.user_admin { color: #C00; font-weight: bold; }
.user_staff { color: #F70; font-weight: bold; }
.user_admin { color: #FFF; }
.user_poster { color: #00C; }

where i should put this .css and how to make it work i am new to this pls make me ty
Got your global.css and put those css codes in bottom.

And in ACP you can see there is option in header named "User&Groups" click it and then go to Groups.

there you will see the lists of usergroups.
wheather you want to edit the usergroup.
if Admin then click "Adminstrator" .
in username style
replace with this :- <span class="user_admin">{username}</span>
for respective group you can do it as i say.
(2021-08-23, 04:16 PM)PARADOXP Wrote: [ -> ]Got your global.css and put those css codes in bottom.

And in ACP you can user there is option in header named "User&Groups" click it and the go to Groups.

there you will see the lists of usergroups.
wheather you want to edit the usergroup.
if Admin then click "Adminstrator" .
in username style
replace with this :-  <span class="user_admin">{username}</span>
for respective group you can do it as i say.

thanks paradox !  Shy