What's new

XenForo PHP Help.

  • Thread starter RobotJuice
  • Start date
  • Views 11,066
Status
Not open for further replies.
RobotJuice

RobotJuice

Undercover Ad​min
Programmer EotM Grammar Nazi
Messages
4,174
Reaction score
1,507
Points
710
Sin$
7
Okay so basically what i am trying to do is make it so that a users avatar is their minecraft skin.
This is what i have.
PHP:
protected static function _getDefaultAvatarUrl(array $user, $size)
    {
        return "http://minotar.net/helm/{$user['username']}/".XenForo_Model_Avatar::getSizeFromCode($size).".png";
    }

Now my problem is that i want it to not set their avatar bassed on their username but rather from a custom field that they have there ign.
So i guess my problem is that i cant figure out how to direct it to a custom field.

I want it to take their imput from the 'Minecraft IGN'
aea872f2.png
 
Sumo

Sumo

ヽ༼ຈل͜ຈ༽ノ raise your dongers ヽ༼ຈل͜ຈ༽ノ
VIP
Retired
Nevar gon' happen in your lifetime Odysseus' Summit 5th Anniversary
Messages
5,496
Reaction score
3,452
Points
1,085
Sin$
0
Custom fields are included in the user object by default (atleast for visitor I would assume the same with how ever you are doing it).

$customFields = unserialize($user['custom_fields']);

Then it would just simply be
$customFields['minecraft_ign']; or w/e your field name is.

Also, buy a license :tongue:
 
RobotJuice

RobotJuice

Undercover Ad​min
Programmer EotM Grammar Nazi
Messages
4,174
Reaction score
1,507
Points
710
Sin$
7
Custom fields are included in the user object by default (atleast for visitor I would assume the same with how ever you are doing it).

$customFields = unserialize($user['custom_fields']);

Then it would just simply be
$customFields['minecraft_ign']; or w/e your field name is.

Also, buy a license :tongue:
Thank you sir, and how you know i has no license?!?! lol i would buy one but i have no money at the moment and i just use the site to practice css and html and php :wink:
 
Sumo

Sumo

ヽ༼ຈل͜ຈ༽ノ raise your dongers ヽ༼ຈل͜ຈ༽ノ
VIP
Retired
Nevar gon' happen in your lifetime Odysseus' Summit 5th Anniversary
Messages
5,496
Reaction score
3,452
Points
1,085
Sin$
0
Thank you sir, and how you know i has no license?!?! lol i would buy one but i have no money at the moment and i just use the site to practice css and html and php :wink:

Because you posted here instead of on xf.
 
Status
Not open for further replies.
Top Bottom
Login
Register