array
CForumUser::GetUserRank(
int USER_ID,
string strLang = false);
The method GetUserRank returns parameters of the specified rank.
Parameters
Parameter
Description
USER_ID
The user ID.
strLang
The language ID. If specified, the method also returns the
language-dependent parameters of the rank in the language strLang.
If false, only the language-independent parameters are returned.
Return Values
Returns an associated array with the following keys:
Key
Value
ID
The rank ID.
MIN_POINTS
Number of points required to obtain this rank.
CODE
Mnemonic code.
VOTES
Number of votes that a user with this rating can give.
LID
The language ID (if strLang is specified).
NAME
Name of the rating in LID (if strLang is specified).
Example
<?
// if the forum settings allows displaying ranks
if (COption::GetOptionString("forum", "SHOW_VOTES", "Y")=="Y")
{
// display the current user rank in the current language
$arUserRank = CForumUser::GetUserRank($USER->GetID(),
LANGUAGE_ID);
echo $arUserRank["NAME"];
}
?>