From: moodler Date: Mon, 21 Jul 2003 05:03:15 +0000 (+0000) Subject: Add a display of current users on the view page X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c3ba081792ca103c594f5d22cecd21b89c699b20;p=moodle.git Add a display of current users on the view page --- diff --git a/lang/en/chat.php b/lang/en/chat.php index 35b1e8db8e..8b364b5f37 100644 --- a/lang/en/chat.php +++ b/lang/en/chat.php @@ -10,6 +10,7 @@ $string['chatintro'] = "Introduction text"; $string['chatname'] = "Name of this chat room"; $string['chatreport'] = "Chat sessions"; $string['currentchats'] = "Active chat sessions"; +$string['currentusers'] = "Current users"; $string['enterchat'] = "Click here to enter the chat"; $string['idle'] = "Idle"; $string['messagebeepseveryone'] = "\$a beeps everyone!"; diff --git a/mod/chat/view.php b/mod/chat/view.php index b826f2de80..c3d3b1f3d2 100644 --- a/mod/chat/view.php +++ b/mod/chat/view.php @@ -46,6 +46,8 @@ $strchats = get_string("modulenameplural", "chat"); $strchat = get_string("modulename", "chat"); $strenterchat = get_string("enterchat", "chat"); + $stridle = get_string("idle", "chat"); + $strcurrentusers = get_string("currentusers", "chat"); print_header("$course->shortname: $chat->name", "$course->fullname", "$navigation id>$strchats -> $chat->name", @@ -87,6 +89,27 @@ "chat$course->id$chat->id", "$strenterchat", 500, 700, $strchat); print_simple_box_end(); + if ($chatusers = chat_get_users($chat->id)) { + $timenow = time(); + print_spacer(20,20); + print_simple_box_start("center"); + print_heading($strcurrentusers); + echo ""; + foreach ($chatusers as $chatuser) { + $lastping = $timenow - $chatuser->lastmessageping; + echo ""; + } + echo "
"; + print_user_picture($chatuser->id, 0, $chatuser->picture, false, false, false); + echo ""; + echo "

"; + echo "$chatuser->firstname $chatuser->lastname
"; + echo "$stridle: ".format_time($lastping, $str).""; + echo "

"; + echo "
"; + print_simple_box_end(); + } + print_spacer(50,50);