P
P
photosho2017-07-14 12:50:01
1C-Bitrix
photosho, 2017-07-14 12:50:01

How to get user photo?

How can I get the user's photo from the "$USER" global object?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rapidum_alder, 2020-08-05
@rapidum_alder

Global $USER;
$userID = $USER->GetID(); //Looking for the current id. user.
$photoID = CUser::GetByID($userID)->Fetch()['PERSONAL_PHOTO']; //Get the Photo ID from the user ID.
$photoPath = CFile::GetPath($photoID); //Get the path to the file.
I searched myself, I found it myself, I decided to help.

J
jonikey, 2021-12-16
@jonikey

<?echo CFile::GetPath($USER->GetParam("PERSONAL_PHOTO"));?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question