MyBB Community Forums

Full Version: Adding user avatar to header template?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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']}"/>
(2012-09-08, 06:25 PM)Frank.Barry Wrote: [ -> ]Use this:

<img src="{$mybb->user['avatar']}"/>

Thanks it works, solved.
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>

$(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");
gracias me sirvio para el tema vBulletin