array CBlogUser::GetUserGroups( int ID, int blogID, string joinStatus = "", int selectType = BLOG_BY_BLOG_USER_ID );
The method returns an array of user groups for the blog with the blogID. The user with ID is attached to these user groups. Static method.
|Parameter||Description||Available from version|
|joinStatus||Flag - specifies whether a user is attached to a user group, or this attachment is still pending. Optional. By default, this status is not relevant.|
|selectType||Specific user ID to search. Possible values:
|bUrl||Optional parameter. Value by default - "false".|
Returned valueReturns an array of blog user groups, or false otherwise.
This method uses built-in caching. As a result, when the method is used multiple times on the page, the database request will be performed only once.
Examples of use
<? // retrieve user groups for a blog with ID=1. The current user is attached to these user groups $ID = $USER->GetID(); $arUserGroups = CBlogUser::GetUserGroups($ID, 1, "", BLOG_BY_USER_ID); if(is_array($arUserGroups)) print_r($arUserGroups); ?>