mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Add a notification when people have left
This commit is contained in:
parent
9f85bed4c3
commit
a2e9f1c579
@ -10,6 +10,7 @@ $string['chatname'] = "Name of this chat room";
|
||||
$string['enterchat'] = "Click here to enter the chat";
|
||||
$string['idle'] = "Idle";
|
||||
$string['messageenter'] = "\$a has just entered this chat";
|
||||
$string['messageexit'] = "\$a has left this chat";
|
||||
$string['savemessages'] = "Number of messages to save";
|
||||
$string['strftimemessage'] = "%%H:%%M";
|
||||
|
||||
|
@ -37,7 +37,23 @@ if (isset($chat_enter)) {
|
||||
|
||||
$timeold = time() - CHAT_OLD_PING;
|
||||
|
||||
delete_records_select("chat_users", "lastping < '$timeold'");
|
||||
if ($oldusers = get_records_select("chat_users", "lastping < '$timeold'") ) {
|
||||
delete_records_select("chat_users", "lastping < '$timeold'");
|
||||
foreach ($oldusers as $olduser) {
|
||||
$message->chatid = $olduser->chatid;
|
||||
$message->userid = $olduser->userid;
|
||||
$message->message = "exit";
|
||||
$message->system = 1;
|
||||
$message->timestamp = time();
|
||||
|
||||
if (!insert_record("chat_messages", $message)) {
|
||||
error("Could not insert a chat message!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Get list of users
|
||||
|
@ -71,7 +71,7 @@
|
||||
// chat_display_version("box", $browser);
|
||||
// chat_display_version("text", $browser);
|
||||
|
||||
print_heading("");
|
||||
print_heading($chat->name);
|
||||
|
||||
print_simple_box( text_to_html($chat->intro) , "center");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user