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

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+----- Forum: Rejected (https://community.mybb.com/forum-184.html)
+----- 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

https://github.com/mybb/mybb/blob/feature/inc/functions.php#L2710
$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