MyBB Community Forums

Full Version: avatar isnt shown
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, When I use {$mybb->user['avatar']} variable in welcome block, users default avatar isn't shown until he updates his avatar.
This is not a bug. format_avatar() function is responsible for showing the default avatar, that variable never was intended to do so.
So what variable or code should I use to show the default avatar?
$formatted_avatar = format_avatar($mybb->user['avatar']);
Then you can use the result to output the default/custom image with correct dimensions.

Of course you can't do that in templates (unless you're using Template Conditionals or PHP in Templates), you need to create a simple plugin or edit the core files.