Slightly more robust in case it can't find users. See bug 562.

This commit is contained in:
moodler 2003-07-22 01:58:44 +00:00
parent 3960a44b62
commit c05f2f763b
2 changed files with 9 additions and 7 deletions

View file

@ -12,6 +12,7 @@ $string['chatreport'] = "Chat sessions";
$string['currentchats'] = "Active chat sessions";
$string['currentusers'] = "Current users";
$string['enterchat'] = "Click here to enter the chat";
$string['errornousers'] = "Could not find any users!";
$string['idle'] = "Idle";
$string['messagebeepseveryone'] = "\$a beeps everyone!";
$string['messagebeepsyou'] = "\$a has just beeped you!";

View file

@ -54,13 +54,6 @@ if (isset($_GET['beep'])) {
chat_delete_old_users();
/// Get list of users
if (!$chatusers = chat_get_users($chatuser->chatid)) {
error("Could not find any users!");
}
/// Print headers
header("Expires: Wed, 4 Oct 1978 09:32:45 GMT");
@ -85,6 +78,14 @@ $str->mins = get_string("mins");
$str->sec = get_string("sec");
$str->secs = get_string("secs");
/// Get list of users
if (!$chatusers = chat_get_users($chatuser->chatid)) {
print_string("errornousers");
exit;
}
echo "<table width=\"100%\">";
foreach ($chatusers as $chatuser) {
$lastping = $timenow - $chatuser->lastmessageping;