Skip to content

Commit

Permalink
Included chat_get_participants() function.
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Sep 4, 2003
1 parent a4634d8 commit c8c9cb7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mod/chat/lib.php
Expand Up @@ -545,4 +545,21 @@ function chat_format_message($message, $courseid=0) {


} }


function chat_get_participants($chatid) {
//Returns the users with data in one chat
//(users with records in chat_messages, students)

global $CFG;

//Get students
$students = get_records_sql("SELECT DISTINCT u.*
FROM {$CFG->prefix}user u,
{$CFG->prefix}chat_messages c
WHERE c.chatid = '$chatid' and
u.id = c.userid");

//Return students array (it contains an array of unique users)
return ($students);
}

?> ?>

0 comments on commit c8c9cb7

Please sign in to comment.