• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/ratings.php
  • Класс: CAllRatings
  • Вызов: CAllRatings::getUserData
static function getUserData($userId = 0, $value = 0)
{
	$result = array();

	$userId = (
		!empty($userId)
			? (int)$userId
			: 0
	);

	if ($userId <= 0)
	{
		return $result;
	}

	$res = CUser::getById($userId);
	if ($userFields = $res->fetch())
	{
		$result = array(
			'NAME_FORMATTED' => CUser::formatName(
				CSite::getNameFormat(false),
				array(
					'NAME' => $userFields["NAME"],
					'LAST_NAME' => $userFields["LAST_NAME"],
					'SECOND_NAME' => $userFields["SECOND_NAME"],
					'LOGIN' => $userFields["LOGIN"],
				),
				true
			),
			'PERSONAL_PHOTO' => array(
				'ID' => $userFields["PERSONAL_PHOTO"],
				'SRC' => false
			),
			"WEIGHT" => (
				BitrixMainModuleManager::isModuleInstalled('intranet')
					? self::getUserWeight($userId)
					: $value
			)
		);

		if ((int)$userFields['PERSONAL_PHOTO'] > 0)
		{
			$imageFile = CFile::getFileArray($userFields["PERSONAL_PHOTO"]);
			if ($imageFile !== false)
			{
				$file = CFile::resizeImageGet(
					$imageFile,
					array("width" => 100, "height" => 100),
					BX_RESIZE_IMAGE_EXACT,
					false
				);
				$result['PERSONAL_PHOTO']['SRC'] = $file['src'];
			}
		}
	}

	return $result;
}