MyBB Community Forums

Full Version: User Titles Custom Style
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, is there any ways to add custom style to user titles, like there are title called "Newbie", you get it by its default with 0 invites, and i want to change the "Newbie" title to like black color.

I would be very thankfull if someone teach me how to do it  Shy (If possible)
You can edit/change the user titles in ACP >> Users & Groups >> User Titles

[attachment=42314]
(2019-11-12, 05:08 PM)SvePu Wrote: [ -> ]You can edit/change the user titles in ACP >> Users & Groups >> User Titles
I know that, but i need to change the style, like when i post something, it will show title color as white, i want to change it like to black or any  Shy
Do you want to change it for everyone or on a group by group basis? The user titles weren't designed to accept HTML as they should be plain text.
(2019-11-12, 06:14 PM)Ben Wrote: [ -> ]Do you want to change it for everyone or on a group by group basis? The user titles weren't designed to accept HTML as they should be plain text.
On a group, like there's group called Newbie and i want to change the style.
For this you'll need a few template changes and new CSS rules

postbit & postbit_classic:
Search:
{$post['usertitle']}<br />
Replace with:
<span class="userstatus_{$post['stars']}">{$post['usertitle']}</span><br />


member_profile:
Search:
({$usertitle})<br />
Replace with:
<span class="userstatus_{$stars}">({$usertitle})</span><br />


memberlist_user:
Search:
{$user['usertitle']}<br />
Replace with:
<span class="userstatus_{$user['stars']}">{$user['usertitle']}</span><br />


Then add to global.css like:
/* Newbie*/
.userstatus_1 {
    color: white;
}
/*Junior Member*/
.userstatus_2 {
    color: red;
}
/*Member*/
.userstatus_3 {
    color: green;
}

/* etc *****/
The number after "userstatus_" is defined by usergroup or rank stars

Maybe there are some more templates to change...you'll see Wink
(2019-11-12, 06:34 PM)SvePu Wrote: [ -> ]For this you'll need a few template changes and new CSS rules

postbit & postbit_classic:
Search:
{$post['usertitle']}<br />
Replace with:
<span class="userstatus_{$post['stars']}">{$post['usertitle']}</span><br />


member_profile:
Search:
({$usertitle})<br />
Replace with:
<span class="userstatus_{$stars}">({$usertitle})</span><br />


memberlist_user:
Search:
{$user['usertitle']}<br />
Replace with:
<span class="userstatus_{$user['stars']}">{$user['usertitle']}</span><br />


Then add to global.css like:
/* Newbie*/
.userstatus_1 {
    color: white;
}
/*Junior Member*/
.userstatus_2 {
    color: red;
}
/*Member*/
.userstatus_3 {
    color: green;
}

/* etc *****/
The number after "userstatus_" is defined by usergroup or rank stars

Maybe there are some more templates to change...you'll see Wink
-------------------------------------------------------------------------------
There are

<div class="post-usertitle"><span class="title_gid_{$usergroup['gid']}">{$post['usertitle']}</span></div>

full line of this in postbit, i'm new in MyBB, can you explain me with this?
Replace the line in postbit with:
<div class="post-usertitle"><span class="title_gid_{$usergroup['gid']} userstatus_{$stars}">{$post['usertitle']}</span></div>

and add into global.css
/* Newbie*/
.userstatus_1 {
    color: white !important;
}
/*Junior Member*/
.userstatus_2 {
    color: red !important;
}
/*Member*/
.userstatus_3 {
    color: green !important;
}

/* etc *****/
Only in postbit or in all of these u listed?
The CSS part you have to include only once .

Template changes you have to make in all ones where the user titles are included.
The needed code is different from template to template. Look at my post above.