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

Create Avatar link

Discussion in 'XenForo Development Discussions' started by DregondRahl, May 17, 2011.

  1. DregondRahl

    DregondRahl Member


    I can get the database values for the avatar [gravatar] but I don't know whats the function to convert it into a avatar links o i can use it in my code without the template system. I seem to be stuck with it only. I need to pass the avatar as a JSON string.
  2. Robbo

    Robbo Well-Known Member

    Just had a quick look. Looks like you want XenForo_Template_Helper_Core::getAvatarUrls($user)?

        * Returns an array containing the URLs for each avatar size available for the given user
        * @param array $user
        * @return array [$sizeCode => $url, $sizeCode => $url...]
    public static function getAvatarUrls(array $user)
    $urls = array();

            foreach (
    XenForo_Model_Avatar::getSizes() AS $sizeCode => $maxDimensions)
    $urls[$sizeCode] = self::getAvatarUrl($user$sizeCode);


Share This Page