Not Solved Adding user avatar to header template?
#1
Not Solved
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?
Reply
#2
Not Solved
Use this:

<img src="{$mybb->user['avatar']}"/>
Reply
#3
Not Solved
(2012-09-08, 06:25 PM)Frank.Barry Wrote: Use this:

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

Thanks it works, solved.
Reply
#4
Not Solved
Does this work with 1.8? Can anyone confirm this for me?
My Website: LSGForums
Add me via Skype! LSGForums
Reply
#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
#6
Not Solved
gracias me sirvio para el tema vBulletin
https://community.mybb.com/thread-228127.html
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)