mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Can get the number of friends of a user
This commit is contained in:
		@@ -322,6 +322,23 @@ class friends {
 | 
			
		||||
		//Perform the request
 | 
			
		||||
		return CS::get()->db->updateDB($tableName, $conditions, $newValues, $conditionsValues);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Count the number of friends of a user
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param int $userID The target user ID
 | 
			
		||||
	 * @return int The number of friends of the user
 | 
			
		||||
	 */
 | 
			
		||||
	public function count_all(int $userID) : int {
 | 
			
		||||
 | 
			
		||||
		//Perform a request on the datbase
 | 
			
		||||
		$tableName = $this->friendsTable;
 | 
			
		||||
		$conditions = "WHERE ID_amis = ? AND actif = 1";
 | 
			
		||||
		$condValues = array($userID);
 | 
			
		||||
 | 
			
		||||
		return CS::get()->db->count($tableName, $conditions, $condValues);
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//Register component
 | 
			
		||||
 
 | 
			
		||||
@@ -236,9 +236,6 @@ class User{
 | 
			
		||||
		$return['openPage'] = $userInfos['pageouverte'] == 1;
 | 
			
		||||
		$return['virtualDirectory'] = $userInfos['sous_repertoire'];
 | 
			
		||||
 | 
			
		||||
		//Add account image url
 | 
			
		||||
		$return['accountImage'] = CS::get()->components->accountImage->getPath($return['userID']);
 | 
			
		||||
 | 
			
		||||
		//Check if we have to fetch advanced informations
 | 
			
		||||
		if($advanced){
 | 
			
		||||
			
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user