MyBB Community Forums

Full Version: User Groups Colors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello mybb community. Currently on my forum every one on the forum sees the online list like this:

[Image: 61f27b93699b9db1eb6e74aa00126536.png]^^^

^^^ Doesn't matter what user group you are everyone see these colors ^ I want to change that. I want all of the users in red user group,yellow user group, and the admins user group to see the grey user group (1-12) in a different color. for example look image below.  But if you are from the grey user group you see all others as in the picture above.

[Image: 8c475b22917a0c318271b79ee626c3de.png]

Please let me know what you think.
If it's only the Who's Online bit on the index you want to change, and you only care about primary groups, you can achieve that with some template+style edits.

Firstly, you'll need to get the group ID of the groups you want to affect (in your case, the red, yellow and admin) - you can obtain these from the Groups section of the ACP, clicking on a group, and looking at the "gid=" section of the URL.
Then:
  • Edit the index_whosonline template (Templates section of ACP -> your theme -> Index Page Templates -> index_whosonline), replacing {$onlinemembers} with <span class="wol_group_{$mybb->user['usergroup']}">{$onlinemembers}</span>
  • Edit the user group style of the grey group (Groups section of ACP -> select group -> Username Style) and set it to something like <span class="username_registered">{username}</span>
  • Edit the CSS of your theme (Themes section of ACP -> your theme -> global.css -> Advanced Mode) and add the following to the end:
    .wol_group_3 .username_registered, .wol_group_4 .username_registered, .wol_group_6 .username_registered {
    	color: blue;
    }
    In the above example, I'm assuming the group IDs are 3, 4 and 6 (change these if necessary). Also change the color above to what you want exactly.