What's new

XenForo PHP Help.

  • Thread starter RobotJuice
  • Start date
  • Views 10,989
Status
Not open for further replies.
RobotJuice

RobotJuice

Undercover Ad​min
Programmer EotM Grammar Nazi
Messages
4,174
Reaction score
1,507
Points
710
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
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
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
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.

Similar threads

D
Replies
0
Views
333
DaaanDee
D
7s ragdoll
Replies
3
Views
390
7s ragdoll
7s ragdoll
XxSOMEJ3WxX
Replies
0
Views
348
XxSOMEJ3WxX
XxSOMEJ3WxX
A
Replies
9
Views
587
Clepto
Clepto
Top Bottom
Login
Register