MyBB Community Forums

Full Version: Border color for a user avatar based on its gender
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, is there any way how to change color of the border around the profile avatar of user according to its gender? 

I use conditional plugin, and it works for me with images shown in postbit... but I wanna replace this image with border color of its avatar.

Thank you very much!

What about to use overlay? one image as a background and on this image put <div> element. Is there anyone who can help me with this css solution? I tried it according to http://stackoverflow.com/questions/18339...r-an-image but without success Sad
Hey...please try this:

Open theme template "postbit_avatar" and replace:
<div class="author_avatar"><a href="{$post['profilelink_plain']}"><img src="{$useravatar['image']}" alt="" {$useravatar['width_height']} /></a></div>

with:
<div class="author_avatar"><a href="{$post['profilelink_plain']}"><img <if $post['fidX'] then>class="{$post['fidX']}_border"</if> src="{$useravatar['image']}" alt="" {$useravatar['width_height']} /></a></div>
Replace X in $post['fidX'] with the number of gender profile field. (default: 3)

Also add to theme global.css something like this:
.post .post_author div.author_avatar img.Male_border{
 border-color: blue;
}
.post .post_author div.author_avatar img.Female_border{
 border-color: pink;
}
.post .post_author div.author_avatar img.Undisclosed_border{
 border-color: gray;
}
.post .post_author div.author_avatar img.Other_border{
 border-color: green;
}
@SvePu - thank you very much for your reply and help. Unfortunately my webhost forced update to php7 so Template conditionals plugin is not working anymore Sad I am really disappointed and I am looking for a new version. I hope it will be out soon.

@SvePu - I tried it in my local host - works great, I just need to changed CSS to something like this:

.post .post_author div.author_avatar img.Male_border{
border: 2px solid #ccc;
}

Thank you very much!