1 <?php declare(strict_types=1);
34 $conversationIds = [];
36 $res = $this->db->queryF(
37 'SELECT DISTINCT(conversation_id) FROM osc_activity WHERE user_id = %s',
39 [$this->
user->getId()]
41 while ($row = $this->db->fetchAssoc(
$res)) {
42 $conversationIds[$row[
'conversation_id']] = $row[
'conversation_id'];
45 $res = $this->db->queryF(
46 'SELECT DISTINCT(conversation_id) FROM osc_messages WHERE user_id = %s',
48 [$this->
user->getId()]
50 while ($row = $this->db->fetchAssoc(
$res)) {
51 $conversationIds[$row[
'conversation_id']] = $row[
'conversation_id'];
54 if (0 === count($conversationIds)) {
60 $in = $this->db->in(
'id', $conversationIds,
false,
'text');
61 $res = $this->db->query(
'SELECT DISTINCT(participants) FROM osc_conversation WHERE ' .
$in);
62 while ($row = $this->db->fetchAssoc(
$res)) {
63 $participants = json_decode($row[
'participants'],
true);
65 if (is_array($participants)) {
66 $usrIds = array_unique(array_merge($usrIds, array_map(
function (
$user) {
82 $usrIds = array_filter(array_map(
'intval', array_map(
'trim', $usrIds)));
91 foreach ($usrIds as $usr_id) {
92 $publicImage = isset($publicData[$usr_id]) && isset($publicData[$usr_id][
'img']) ? $publicData[$usr_id][
'img'] :
'';
95 if (isset($publicData[$usr_id])) {
97 if (isset($publicData[$usr_id][
'login'])) {
98 $publicName =
$login = (string) $publicData[$usr_id][
'login'];
101 if (isset($publicData[$usr_id][
'public_profile']) && $publicData[$usr_id][
'public_profile']) {
102 $publicName = implode(
' ', array_filter(array_map(
'trim', [
103 (
string) $publicData[$usr_id][
'firstname'],
104 (
string) $publicData[$usr_id][
'lastname'],
107 if ($publicName ===
'') {
113 $data[$usr_id] = array(
114 'public_name' => $publicName,
115 'profile_image' => $publicImage
__construct(\ilDBInterface $db, \ilObjUser $user)
Subscriber constructor.
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:
if(php_sapi_name() !='cli') $in
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
getDataByUserIds(array $usrIds)
static getTokenMaxLifetimeInSeconds()
getInitialUserProfileData()