Hello,
I run a Minecraft Server forum and I wanted to let people enter their Minecraft username in their account details and automatically change their avatar to their Minecraft skin.
I added the custom field and everything works fine. I made an edit to library/Xenforo/Template/Helper/Core.php
Basically, if a user enters their username, it will use their skin. However if the field is blank it will default to the "steve" skin. All of this works fine except that the steve skin is used when there are smaller versions of the Avatar.
Users with Custom Avatars display fine (Darth Vader for example)
Users that haven't entered their username display fine
Users that HAVE entered their username still shows the steve skin (The user to the right of Vader)
HOWEVER, On that specific user next to Vader, their Avatar works as it should.
(The user being shown is the same user that is to the right of Vader)
This occurs everywhere a "small" avatar icon is present.
I have already rebuilt the caches and I watched a friend of mine create an account. The issue is still present on his account as well.
Any ideas?
I run a Minecraft Server forum and I wanted to let people enter their Minecraft username in their account details and automatically change their avatar to their Minecraft skin.
I added the custom field and everything works fine. I made an edit to library/Xenforo/Template/Helper/Core.php
Code:
protected static function _getDefaultAvatarUrl(array $user, $size)
{
$customFields = unserialize($user['custom_fields']);
if(!empty($customFields['_minecraft_username']))
{
return "http://cravatar.eu/helmavatar/{$customFields['_minecraft_username']}/".XenForo_Model_Avatar::getSizeFromCode($size).".png";
}
else
{
return "http://cravatar.eu/helmavatar/steve/".XenForo_Model_Avatar::getSizeFromCode($size).".png";
}
}
Basically, if a user enters their username, it will use their skin. However if the field is blank it will default to the "steve" skin. All of this works fine except that the steve skin is used when there are smaller versions of the Avatar.
Users with Custom Avatars display fine (Darth Vader for example)
Users that haven't entered their username display fine
Users that HAVE entered their username still shows the steve skin (The user to the right of Vader)
HOWEVER, On that specific user next to Vader, their Avatar works as it should.
(The user being shown is the same user that is to the right of Vader)
This occurs everywhere a "small" avatar icon is present.
I have already rebuilt the caches and I watched a friend of mine create an account. The issue is still present on his account as well.
Any ideas?