MyBB Support

[HELP] Member Header Avatar problem

Submitted by cyberproxy, , Thread ID: 21263

Thread Closed

RE: [HELP] Member Header Avatar problem

This post was last modified: 20-05-2016, 08:39 PM by linkzy
#6
You can actually do this with javascript . Give your avatar a class of header_avatar img and add js code at the bottom of footer.

Example code
Code:
<li class="header_avatar"><img src="{$mybb->user['avatar']}" height="30px" width="30px" align="top" class="miniav"/></li>
Code:
<script>
$(document).ready(function() {
//create a default avatar for those without one.
if($('.header_avatar img', this).attr('src') == ''){
$('.header_avatar img').attr('src', '/images/default_avatar.gif');
}
});
</script>

Credits to Leefish, I was having this code in ma USB...

or follow one of the tutorials by effone

http://community.mybb.com/thread-149518.html
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |



Users browsing this thread: 1 Guest(s)