How to show CometChat to certain usergroups only?

Please add the following CometChat footer code in your Vbulletin admincp -> styles -> templates -> search styles ->search for ‘head’ -> default theme(your site’s theme) -> header

Now find the CometChat HTML code and replace it with the following:

<vb:if condition="is_member_of($bbuserinfo, 6,7,9,10,16)">
<link type="text/css" href="/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">
<script type="text/javascript" src="/cometchat/cometchatjs.php" charset="utf-8"></script>
</vb:if>

In the above code, you will have to replace 6,7,9,10,16 as per your requirements.

For example, if you want to allow only usergroups 1 and 2 with access, then your code will be:

<vb:if condition="is_member_of($bbuserinfo, 1,2)">
<link type="text/css" href="/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">
<script type="text/javascript" src="/cometchat/cometchatjs.php" charset="utf-8"></script>
</vb:if>

Also, make sure your path to CometChat JS/CSS files is correct in the above code.

Not finding what you need?

The CometChat team is here to help!