36 $conversationIds = [];
38 $res = $this->db->queryF(
39 'SELECT DISTINCT(conversation_id) FROM osc_activity WHERE user_id = %s',
41 [$this->
user->getId()]
43 while (
$row = $this->db->fetchAssoc(
$res)) {
44 $conversationIds[
$row[
'conversation_id']] = $row[
'conversation_id'];
47 $res = $this->db->queryF(
48 'SELECT DISTINCT(conversation_id) FROM osc_messages WHERE user_id = %s',
50 [$this->
user->getId()]
52 while (
$row = $this->db->fetchAssoc(
$res)) {
53 $conversationIds[
$row[
'conversation_id']] = $row[
'conversation_id'];
56 if (0 === count($conversationIds)) {
62 $in = $this->db->in(
'id', $conversationIds,
false,
'text');
63 $res = $this->db->query(
'SELECT DISTINCT(participants) FROM osc_conversation WHERE ' .
$in);
64 while (
$row = $this->db->fetchAssoc(
$res)) {
65 $participants = json_decode(
$row[
'participants'],
true);
67 if (is_array($participants)) {
68 $usrIds = array_unique(array_merge($usrIds, array_map(
function (
$user) {
84 $usrIds = array_filter(array_map(
'intval', array_map(
'trim', $usrIds)));
93 foreach ($usrIds as $usr_id) {
94 $publicImage = isset($publicData[$usr_id]) && isset($publicData[$usr_id][
'img']) ? $publicData[$usr_id][
'img'] :
'';
97 if (isset($publicData[$usr_id])) {
99 if (isset($publicData[$usr_id][
'login'])) {
100 $publicName = $login = $publicData[$usr_id][
'login'];
103 if (isset($publicData[$usr_id][
'public_profile']) && $publicData[$usr_id][
'public_profile']) {
104 $publicName = implode(
', ', [
105 $publicData[$usr_id][
'lastname'],
106 $publicData[$usr_id][
'firstname'],
109 if ($publicName !==
'') {
110 $publicName .=
' [' . $login .
']';
112 $publicName = $login;
118 'public_name' => $publicName,
119 'profile_image' => $publicImage
getInitialUserProfileData()
foreach($_POST as $key=> $value) $res
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
getDataByUserIds(array $usrIds)
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
__construct(\ilDBInterface $db, \ilObjUser $user)
ilOnScreenChatUserDataProvider constructor.
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
static getTokenMaxLifetimeInSeconds()
Class ilOnScreenChatUserDataProvider.