How do I change the default avatars?

Akrion

Well-known member
Hi guys,

I am building a custom style and I am @ the point where I would like to modify the default avatars (Male, Female and the ? one) ... so my question is - is that doable through debug mode menus or I have to replace the default style avatar images in the "avatars" folder?

Thanks in advance!
Akrion
 
I would just replace the existing images:

styles/default/xenforo/avatars

Or create a new style if you want to use a different image path.

_____

There is no specific setting that you can edit for the location of the default avatars. There is only the root path for all images in a style:

Admin CP -> Appearance -> Style Properties -> General -> Path to images

Screen shot 2011-01-31 at 8.54.46 PM.webp

See this file if you are curious about the code:

library/XenForo/Template/Helper/Core.php

Code:
	/**
	 * Returns the default gender-specific avatar URL
	 *
	 * @param string $gender - male / female / other
	 * @param string $size (s,m,l)
	 *
	 * @return string
	 */
	protected static function _getDefaultAvatarUrl(array $user, $size)
	{
		switch ($user['gender'])
		{
			case 'male':
			case 'female':
				$gender = $user['gender'] . '_';
				break;

			default:
				$gender = '';
				break;
		}

		return self::styleProperty('imagePath') . "/xenforo/avatars/avatar_$gender$size.png";
	}
 
Top Bottom