MyBB Community Forums
[Rejected] avatar isnt shown - Printable Version

+- MyBB Community Forums (
+-- Forum: Development (
+--- Forum: MyBB 1.8 Development (
+---- Forum: 1.8 Bugs and Issues (
+----- Forum: Rejected (
+----- Thread: [Rejected] avatar isnt shown (/thread-159826.html)

avatar isnt shown - jvdabz - 2014-09-20

Hi, When I use {$mybb->user['avatar']} variable in welcome block, users default avatar isn't shown until he updates his avatar.

RE: avatar isnt shown - Destroy666 - 2014-09-20

This is not a bug. format_avatar() function is responsible for showing the default avatar, that variable never was intended to do so.

RE: avatar isnt shown - jvdabz - 2014-09-20

So what variable or code should I use to show the default avatar?

RE: avatar isnt shown - Destroy666 - 2014-09-20
$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.

RE: avatar isnt shown - darkhorus - 2014-09-23

This is another great example of why MyBB would benefit from having this functionality in the core Wink