Jump to content

How To Set CometChat For Certain Usergroups


sweethoney

Recommended Posts

Posted

Restrict What Member Groups Can Use CometChat?

Go Into Your Admin Panel And Themes --> Edit HTML/CSS --> globalTemplate

 

Replace Your CometChat Script With

{{if \IPS\Member::loggedIn()->inGroup (array(4,7,13))}}
        <link type="text/css" href="/forum/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">
        <script type="text/javascript" src="/forum/cometchat/cometchatjs.php" charset="utf-8"></script>
        {{endif}}

Change The Numbers In The

{{if \IPS\Member::loggedIn()->inGroup (array(4,7,13))}}

With The Numbers Of The Usergroups You Want To Let Use Cometchat, You Will Find The Number In The URL When You Go To Admin --> Members --> Groups --> Edit Then The URL Will Look Like

http://yoursite.com/admin/?adsess=LOADS_OF_RANDOM_CRAP&app=core&module=members&control

he Number Of The Group Is 4 As You Can See At The End Of It

groups&do=form&id=4

To Add More Groups Just Add Another , With The Number Of The Group

Posted

You can also limit it to members only with this:

{{if \IPS\Member::loggedIn()->real_name != "")}}
        <link type="text/css" href="/forum/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">
        <script type="text/javascript" src="/forum/cometchat/cometchatjs.php" charset="utf-8"></script>
{{endif}}

Guests will not have access to CometChat with this code. :)

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...