1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

$user contains Custom Fields?

Discussion in 'XenForo Development Discussions' started by Marcus, Nov 15, 2011.

  1. Marcus

    Marcus Well-Known Member

    I want to rewrite stock avatars depending on custom user fields. I located protected static function _getDefaultAvatarUrl(array $user, $size) in Template/Helper/core.php and want to use the $user variable to check against checkbox custom user field "favoritemeal" which can be "potato", "pizza", "pasta" ... Do you know how to fetch the custom user field "favoritemeal" from $user?

    Many thanks!
     
  2. dmnkhhn

    dmnkhhn Active Member

    In that very file there is this:
    PHP:
    public static function helperUserFieldValue($field, array $user = array(), $fieldValue null)
    It's normally used as a viewHelper in the template but I suppose you can use it for your own purpose. :)
     

Share This Page