[QUOTE=sv1cec]The only way to have a correct user list, is if you force your users to log out, from the chat session. If they do not, they session stays in the list (I think there is a time limit, after that the session is erased). Until it gets erased, you see them in the list.
I added a log out button in my forms, so that the users can log out. In the vBChat.php file, you need to add something like this:
Find:
PHP Code:
// ---------------------------------------------------
// Start Page Output
// ---------------------------------------------------
Above that, add:
PHP Code:
// ---------------------------------------------------
// Start Logout
// ---------------------------------------------------
if($_GET['do']=="logout")
{
$DB->query("delete from ".TABLE_PREFIX."session WHERE userid=$bbuserinfo[userid] AND location like '%vBChat.php%'");
eval('print_output("' . fetch_template('chat_close') . '");');
exit;
}
The template chat_close can be something like:
HTML Code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
function winClose() {
setTimeout('self.close()',8000);
}
//--></SCRIPT>
<title>$vboptions[bbtitle] - $pagetitle</title>
$headinclude
</HEAD>
<BODY>
$header
<br><br><br><br>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat" colspan="3"><center>Thank you for using our Chat</center></td>
</tr>
<tr>
<td class="alt1"><CENTER>This window will now close.<br>Please come back at your convenience.</center></td>
</tr>
</table>
<SCRIPT LANGUAGE="JavaScript"><!--
//and at the end of the page place this call
winClose()
//--></SCRIPT>
</BODY>
</HTML>
Im sorry if i sound like a total n00b.
How would i make it so the chat opens in a new window like you state yours does, so that the user can still view the board, and also chat at the same time?
Also, if the user hits the log out button, how would i add a redirect into that template to send the user back to the forum_home, opposed to the window closing and the user having to open a browser window and go back manually?
Thanks again