/**
* @return XenForo_Model_UserGroup
*/
protected function _getUserGroupModel() {
return $this->getModelFromCache('XenForo_Model_UserGroup');
}
$myId = 10;
$userGroup = $this->_getUserGroupModel()->getUserGroupById($myId);
print_r ($userGroup);
<xen:if is="{$visitor.user_group_id} == 3">
Hi Administrator.
</xen:if>
Going to try this now. Thanks.Code:<xen:if is="{$visitor.user_group_id} == 3"> Hi Administrator. </xen:if>
Note that user_group_id only stores the primary usergroup id of a user; so you are only comparing the primary usergroup in the code above. Secondary usergroup id's are stored as a comma separated list in the secondary_group_ids field; but I haven't come across any native template helper that we can use here.
@dmnkhhn:
Interesting approach. Off to try it right now.
Yes it seems we can only use a rank image for primary groups then? I know by default the Admin account is in the Registered group, you have to change that after installation.Edit:
Wait. Just checked and found my primary usergroup is "Registered", and "Administrative" + "Moderating" are set as my secondary groups, by default. That's strange. The code given above wouldn't work.
We use essential cookies to make this site work, and optional cookies to enhance your experience.