Documentation

GetUserFriends

CDBResult
CBlogUser::GetUserFriends(
 int  ID,
 bool bFlag = true
);

Depending on the specified bFlag, returns either list of friends for the blog user with ID or a list of blog users that рфму user with ID included as a friend. Static method.

.

Method parameters

ParameterDescription
ID Site user ID.
bFlag Flag. If specified as true, the blog list is returned with the user as a friend, otherwise list of user friend blogs is returned. Optional. By default, true - list of blogs is returned, with the user as a friend.

Returned value

CDBResult object is returned.

Examples of use

<?
// elect all blogs of user friends
$dbFriends = CBlogUser::GetUserFriends($USER->GetID(), True);
while ($arFriends = $dbFriends->Fetch())
{
	?><a href="<?= CBlog::PreparePath($arFriends["URL"], false, $is404) ?>"><?= htmlspecialchars($arFriends["NAME"]) ?></a><?
}

?>


© «Bitrix24», 2001-2024