By L'Eclaireur SARL on Saturday, 06 May 2017
Posted in Groups
Replies 5
Likes 0
Views 608
Votes 0
Hi,

I try to notify members groups when a file is upload on group.

I do that but I don't unserstand one point -> How I can send list of members groups ? I use

$model = ES::model('Groups');
$targets = $model->getMembers($group->id, array('state' => SOCIAL_STATE_PUBLISHED));

but It seems don't working.
If $targets = ['421, '326'], I have notification.

Can you help me, I haven't find documentation about that.

I join my code. You can find it in row 454

Thank you
You should take a look at the method notifyMembers under /administrator/components/com_easysocial/includes/group/group.php . It will give you a better idea on how to notify group members.

Alternatively, you could just add your own checks in this method
·
Saturday, 06 May 2017 18:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

Ok, I found my error. I used : $group = FD::group($stream->cluster_id); instead of $group = ES::group($template->cluster_id);

A last question: I would like send the file name, but I haven't find the method to do that. I have the id file. And I would like the folder name too.

Thank you
·
Monday, 08 May 2017 22:10
·
0 Likes
·
0 Votes
·
0 Comments
·
You should look into the $files object and see what you could extract from that.
·
Monday, 08 May 2017 22:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

I have the id file only.
How can I have the name file ?

Thank you
·
Tuesday, 09 May 2017 15:40
·
0 Likes
·
0 Votes
·
0 Comments
·
You can look for this method prepareUploadedStream at the same file -> JoomlaFolder/media/com_easysocial/apps/group/files/files.php

You actually need to pass in the file id then load back the file name data from the database.

Hope this will help.
·
Tuesday, 09 May 2017 21:38
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post