Not Solved Adding user avatar to header template?
#5
Not Solved
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>
[Image: sig2.jpg]
Reply


Messages In This Thread
Adding user avatar to header template? - by MRKH - 2012-09-08, 06:12 PM
RE: Adding user avatar to header template? - by iAndrew - 2016-08-09, 04:46 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)