mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 00:25:18 +00:00
Can get the number of friends of a user
This commit is contained in:
@ -138,6 +138,17 @@ class userController
|
||||
if(count($userInfos) == 0)
|
||||
Rest_fatal_error(500, "Couldn't get informations about the user !");
|
||||
|
||||
//Add account image url
|
||||
$userInfos['accountImage'] = CS::get()->components->accountImage->getPath($userID);
|
||||
|
||||
//Get the number of friends (if allowed)
|
||||
if($userInfos['friend_list_public'] === true){
|
||||
$userInfos['number_friends'] = CS::get()->components->friends->count_all($userID);
|
||||
}
|
||||
else
|
||||
//User friends won't be displayed
|
||||
$userInfos["number_friends"] = 0;
|
||||
|
||||
//Return user informations
|
||||
return $userInfos;
|
||||
|
||||
|
Reference in New Issue
Block a user