Documentation

GetUserFriendsList

CDBResult
CBlogUser::GetUserFriendsList(
 int  ID,
 int  userID = false,
 bool bAuth = false,
 int  limit = 20
);

Returns list of messages sent by friends of the user with ID. Static method.

Method parameters

ParameterDescriptionAvailable from version
ID User ID, which friends' messages needed to be selected.
userID SIte user ID for which the access permissions will be checked. Optional parameter. Value by default - "False".
bAuth Specifies whether the current user is authorized. Access permissions for this user will be checked. Optional parameter. Value by default - "False".
limit Number of displayed messages. Optional parameter. Value by default - 20.
arGroup Optional parameter.

Returned value

The method returns the following type of array:
Array( 
    [ID] => 20, //message ID
    [DATE_PUBLISH] => 2007-08-08 18:41:24, // date when the message is published
    [BLOG_ID] => 1, // blog ID
    [URL] => 'admin-blog' // blog address
)

Examples of use

<?
// select 20 messages sent by friends of the user with ID=2
$ID = 2;
$dbList = CBlogUser::GetUserFriendsList($ID, $USER->GetID(), $USER->IsAuthorized(), 20);
while($arList = $dbLis->Fetch())
{
    $arPost = CBlogPost::GetByID($arList["ID"]);
    print_r($arPost);
}
?>


© «Bitrix24», 2001-2024
Up