MyBB Codes

Full Version: Color for male and female
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Ah, glad to see you can solved that Wink
Ok i haven't played around in awhile on a mybb board so i have got back into it and redone everything mentioned in this thread but now im stuck on the color change for username on gender ?

Example: So username would be blue for men and pink for female username?

I just don't want to have create another user group hopefully the Username color is possible for these 2 genders.
Have you done what was mentioned in this message :

http://www.mybbcodes.com/showthread.php?...2#pid12902
(11-09-2014 07:57 AM)exdiogene Wrote: [ -> ]Have you done what was mentioned in this message :

http://www.mybbcodes.com/showthread.php?...2#pid12902

Yes 1 profile field is already there by default in ACP and I enabled so its required upon registration to choose man or women ONLY and code placed so fid3 replaced the text in postbit to the left from (Gender: male) to (Gender: icon.gif) ONLY in postbit, im just stuck at where i would need to edit so that the 2 colors would be displayed for man blue and women pink USERNAME automatically.

Thanks.
(07-21-2010 08:54 PM)exdiogene Wrote: [ -> ]For the background you would simply put the username section inside a span tag with a male or female class.

Something like : < span class="{$post['fid3']}" >< strong >< span class="largetext">{$post['profilelink']}< /span >< /strong >< /span >

You now have to create the classes in the CSS file by adding this in AdminCP -> Templates & Style -> Themes -> YourTheme -> global.css

.male {
background: #e0e0ff;
padding: 2px;
}
.female{
background: #ffe0e0;
padding: 2px;
}

I have temporarely installed these changes to MyBBCodes.com, have a look at a few members posts...

This is where it goes over my head sorry, the global css i understand but the part im stuck

< span class="{$post['fid3']}" >[/b]< strong >< span class="largetext">{$post['profilelink']}< /span >< /strong >[b]< /span >

a. where does this code go above
b. will the code automatically change the color of USERNAME according to gender?
It goes inside the template where you want the username background colour to change. Mainly in the postbit template where you will find :
<span class="largetext">{$post['profilelink']}</span>

You just need to surround it with the gender colouring span section :
<span class="{$post['fid3']}"> ... </span>

Wink
(11-09-2014 09:56 AM)exdiogene Wrote: [ -> ]It goes inside the template where you want the username background colour to change. Mainly in the postbit template where you will find :
<span class="largetext">{$post['profilelink']}</span>

You just need to surround it with the gender colouring span section :
<span class="{$post['fid3']}"> ... </span>

Wink

<span class="{$post['fid3']}"> ... </span>

So if i want Usernames for men gender and username for women gender to be their own color how to go about this?
Here is what I am talking about

[attachment=826]
Simply replace this :
<span class="largetext">{$post['profilelink']}</span>
With this :
<span class="{$post['fid3']}"><span class="largetext">{$post['profilelink']}</span></span>

Inside your "postbit" template.

If you made the proper insertion in the style sheet, the background behind the username will be pink for "female" and blue for "male". But be sure that your profile field for the gender is really fid3! Wink
(11-10-2014 09:45 AM)exdiogene Wrote: [ -> ]
<span class="largetext">{$post['profilelink']}</span>

<span class="{$post['fid3']}"><span class="largetext">{$post['profilelink']}</span></span>

@exdiogene thanks for help up to now, almost

    <div class="author_information">
            <strong><span class="{$post['fid3']}"><span class="largetext">{$post['profilelink']}</span></span></strong> {$post['onlinestatus']}<br />
            <span class="smalltext">
                {$post['usertitle']}<br />
                {$post['userstars']}
                {$post['groupimage']}


I copied this exact code above and replaced it with the original (default theme postbit) but still no color change ? Angel
Pages: 1 2 3
Reference URL's