Well whaddya know, I got it working!
Forgetting about displaychatusers.php I decided to go straight for index.php, into which I added this code...
PHP Code:
// get chatters
$datecut=time()-$cookietimeout;
$chatters = '';
$comma = '';
$forumusers = $DB_site->query("SELECT username,invisible,userid,usergroupid FROM user WHERE inchat=1 AND lastchatactivity>$datecut ORDER BY invisible ASC, username ASC");
while ($forumuser = $DB_site->fetch_array($forumusers)) {
if ($forumuser['invisible']==0 or $bbuserinfo['usergroupid']==6 or $bbuserinfo['usergroupid']==5 or $bbuserinfo['usergroupid']==7) {
$userid = $forumuser['userid'];
if ($forumuser['invisible'] == 1) { // Invisible User but show to Admin
$invisibleuser = '*';
} else {
$invisibleuser = '';
}
if ($forumuser['usergroupid'] == 6 and $highlightadmin) {
$username = "<b><i>$forumuser[username]</i></b>";
} else if (($mod["$userid"] or $forumuser['usergroupid'] == 5) and $highlightadmin) {
$username = "<b>$forumuser[username]</b>";
} else {
$username = $forumuser['username'];
}
eval("\$chatters .= \"".$comma.gettemplate('forumhome_loggedinuser')."\";");
$comma = ', ';
}
}
after this code...
PHP Code:
} else {
$pminfo='';
}
and it works great! (FYI, my usergroupid of 6 is my administrators group. You'll need to change it to whatever yours is if you want to use this code.)
I managed to get the number of users currently in chat displayed as well. I just added this code to index.php:
PHP Code:
// get total chatters
$datecut=time()-$cookietimeout;
$chatnum = mysql_num_rows(mysql_query("select * from user WHERE inchat=1 AND lastchatactivity>$datecut"));
after the above code and it works fine.
Then added this to the bottom of the forumhome_loggedinusers template:
Code:
<tr id="cat">
<td bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" colspan="6"><a href="chat/"><normalfont color="#000000"><b>Users Chatting</b></normalfont></a><normalfont color="#000000"><b>: $chatnum</b></normalfont></td>
</tr>
<tr>
<td bgcolor="#1C5780" align="center" valign="top">
<a href="chat/"><img src="https://vborg.vbsupport.ru/images/activechatters.gif" alt="Users Chatting" align=middle border=0></a>
</td>
<td bgcolor="#13486D" colspan="5"><smallfont>
$chatters</smallfont></td>
</tr>
to show it all on the front page after the logged in users section.