Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 4 Years, 3 Months, 1 Week ago Border color for a user avatar based on its gender
#1
Solved: 4 Years, 3 Months, 1 Week ago Question 
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


Attached Files Thumbnail(s)
   
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#2
Solved: 4 Years, 3 Months, 1 Week ago
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;
}
Reply
#3
Solved: 4 Years, 3 Months, 1 Week ago
@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!
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)