modUser.getPhoto
Last updated not available | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moremodUser::getPhoto¶
Resolves the avatar URL in a fixed order:
- the profile photo, through
getProfilePhoto()with the requested dimensions; - Gravatar, when the
enable_gravatarsetting is on;getGravatar()receives only the width; - otherwise the
$defaultstring, returned untouched.
Syntax¶
string getPhoto ([integer $width = 128 [, integer $height = 128 [, string $default = '']]])
-
$width(integer) Photo width, by default128. -
$height(integer) Photo height, by default128. -
$default(string) Fallback URL, by default''.
Example¶
echo $user->getPhoto(64, 64, '/assets/images/nophoto.png');
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










