I wanted to set up arrowchat on our community so that only certain usergroups have access to it rather than all logged in users.
This was actually a lot easier to accomplish than I at first imagined, it took a bit of google-ing and sideways thinking but I got it working, so I thought I'd share in case anyone else wants to do something similar.
Requirements:
IPBoard v3.2.x +
Step 1:
Install arrow chat as per installation instructions
Step 2:
When you are asked to add code to your IPBoard templates add it wrapped in the following IPB if statements where the array values are the id's of the groups that you want to grant access to arrowchat:
Header Code:
- Code: Select all
<if test="IPSMember::isInGroup($this->memberData, array('3', '12'))">
<!-- ARROWCHAT -->
<link type="text/css" rel="stylesheet" id="arrowchat_css" media="all" href="/arrowchat/external.php?type=css" charset="utf-8" />
<script type="text/javascript" src="/arrowchat/includes/js/jquery.js"></script>
<script type="text/javascript" src="/arrowchat/includes/js/jquery-ui.js"></script>
</if>
Footer Code:
- Code: Select all
<if test="IPSMember::isInGroup($this->memberData, array('3', '12'))">
<!--ARROWCHAT-->
<script type="text/javascript" src="/arrowchat/external.php?type=djs" charset="utf-8"></script>
<script type="text/javascript" src="/arrowchat/external.php?type=js" charset="utf-8"></script>
</if>
Please note that you must change the paths to ArrowChat if it is not correct.
You may also leave out the jquery.js and jquery-ui.js calls if you already have them on your site.
It really is THAT easy :)