public function getAvatarUrl($sizeCode, $forceType = null, $canonical = false)
{
$app = $this->app();
$sizeMap = $app->container('avatarSizeMap');
if (!isset($sizeMap[$sizeCode]))
{
// Always fallback to 's' in the event of an unknown size (e.g. 'xs', 'xxs' etc.)
$sizeCode = 's';
}
if ($this->gravatar && $forceType != 'custom')
{
return $this->getGravatarUrl($sizeCode);
}
else if ($this->avatar_date)
{
$group = floor($this->user_id / 1000);
return $app->applyExternalDataUrl(
"avatars/{$sizeCode}/{$group}/{$this->user_id}.jpg?{$this->avatar_date}",
$canonical
);
}
else
{
return null;
}
}