Fixes when displaying lists of users in group mode

This commit is contained in:
moodler
2004-04-08 15:12:35 +00:00
parent 1b1c19fff7
commit fdff1f63a3
4 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
require_once('../lib.php');
require_variable($id);
optional_variable($groupid);
optional_variable($groupid, -1);
if (!$chat = get_record("chat", "id", $id)) {
error("Could not find that chat room!");
@@ -39,7 +39,7 @@
$groupname = '';
}
if (!$chat_sid = chat_login_user($chat->id, "header_js")) {
if (!$chat_sid = chat_login_user($chat->id, "header_js", $currentgroup)) {
error("Could not log in to chat room!!");
}
+2 -1
View File
@@ -239,11 +239,12 @@ function chat_get_latest_message($chatid, $groupid=0) {
//////////////////////////////////////////////////////////////////////
function chat_login_user($chatid, $version="header_js") {
function chat_login_user($chatid, $version="header_js", $groupid=0) {
global $USER;
$chatuser->chatid = $chatid;
$chatuser->userid = $USER->id;
$chatuser->groupid = $groupid;
$chatuser->version = $version;
$chatuser->ip = $USER->lastIP;
$chatuser->lastping = $chatuser->firstping = $chatuser->lastmessageping = time();
+1 -1
View File
@@ -64,7 +64,7 @@ header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: text/html");
header("Refresh: $CFG->chat_refresh_userlist; URL=users.php?chat_sid=$chat_sid");
header("Refresh: $CFG->chat_refresh_userlist; URL=users.php?chat_sid=$chat_sid&groupid=$groupid");
print_header();
+1 -1
View File
@@ -75,7 +75,7 @@
if ($currentgroup) {
$groupselect = " AND groupid = '$currentgroup'";
$groupparam = "&group=$currentgroup";
$groupparam = "&groupid=$currentgroup";
} else {
$groupselect = "";
$groupparam = "";