I am currently attempting to add the users avatar to my header template (below nav bar) with the code {$avatar} but nothing shows up. Anyone can help me make it show up?
Use this:
<img src="{$mybb->user['avatar']}"/>
Does this work with 1.8? Can anyone confirm this for me?
Add both of these to your members template, it will use a default avatar for people who haven't uploaded one.
<a class="header_avatar" href="{$mybb->settings['bburl']}/usercp.php?action=avatar"><img src="{$mybb->user['avatar']}" height="35px" width="35px" /></a>
<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.png");
}
});
</script>