[Rejected] avatar isnt shown
#1
Hi, When I use {$mybb->user['avatar']} variable in welcome block, users default avatar isn't shown until he updates his avatar.
Reply
#2
This is not a bug. format_avatar() function is responsible for showing the default avatar, that variable never was intended to do so.
Reply
#3
So what variable or code should I use to show the default avatar?
Reply
#4
https://github.com/mybb/mybb/blob/featur....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.
Reply
#5
This is another great example of why MyBB would benefit from having this functionality in the core Wink
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)