]> git.mjollnir.org Git - moodle.git/commitdiff
Add a display of current users on the view page
authormoodler <moodler>
Mon, 21 Jul 2003 05:03:15 +0000 (05:03 +0000)
committermoodler <moodler>
Mon, 21 Jul 2003 05:03:15 +0000 (05:03 +0000)
lang/en/chat.php
mod/chat/view.php

index 35b1e8db8ef9d7ee5ba4ca2b98270e21ae32153c..8b364b5f3768c1799f3b55277f462ae7c894b9e9 100644 (file)
@@ -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!";
index b826f2de806c7f8bbb8fd9c08d0aed3410128eac..c3d3b1f3d25274a95a5d38c1957278b0d69a2168 100644 (file)
@@ -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 <A HREF=index.php?id=$course->id>$strchats</A> -> $chat->name", 
                           "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 "<table width=\"100%\">";
+        foreach ($chatusers as $chatuser) {
+            $lastping = $timenow - $chatuser->lastmessageping;
+            echo "<tr><td width=35>";
+            print_user_picture($chatuser->id, 0, $chatuser->picture, false, false, false);
+            echo "</td><td valign=center>";
+            echo "<p><font size=1>";
+            echo "$chatuser->firstname $chatuser->lastname<br />";
+            echo "<font color=\"#888888\">$stridle: ".format_time($lastping, $str)."</font>";
+            echo "</font></p>";
+            echo "<td></tr>";
+        }
+        echo "</table>";
+        print_simple_box_end();
+    }
+
     print_spacer(50,50);