Hi everyone,
When a user add a comment, we have the following entry on the activity stream "**** commented on ****** ",.
How can I remove such entry from activity stream ?
Regards,
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- Hermand Pessek@rheman
Hermand Pessek - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 1 like
- Hermand Pessek@rheman
Hermand Pessek - 0 likes
- iionly@iionly
iionly - 1 like
- Hermand Pessek@rheman
Hermand Pessek - 0 likes
- iionly@iionly
iionly - 1 like
- Hermand Pessek@rheman
Hermand Pessek - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- iionly@iionly
iionly - 0 likes
You must log in to post replies.Override this file.
You should change $keys - look at this string.
If you need to edit this string only not a view then use Translation editor plugin.
Thanks,
May be I do not well explain my issue.
Every time a user add a comment on and object , a new river is created on the activity stream. I do not what to display such river on the activity stream.
How can I implement such behavior ?
Regards,
Use 'creating', 'river' hook in this case.
Example.
Hi @RvR ,
I still don't know how to do with my issue.
Every time a user add post comment, a river is created on the activity stream. I do not want to display such river on the activity stream.
I don't know how to do.
Need Help.
Regards,
Untested code:
It might work with this code. I've not tested it but only taken some code from Tidypics I knew I used the 'creating', 'river' plugin hook and modified it a tiny bit to work on Elgg 3 (not sure if you use Elgg 2 or 3). On the latest Elgg 3 versions you probably can change it even further by not registering the plugin hook in start.php but in elgg-plugin.php. But I have to admit I haven't looked into Elgg 3.3 at all so I'm definitely not up to date with Elgg 3.3 (not much tried any Elgg 3 stuff in general yet...).
The code above checks the value of action_type provided when using the elgg_create_river_item function. In case it's a comment it should prevent the creation of this river item by returning false. If the code does not work this way I hope I've given you at least a starting point to get it working on your own.
Thanks a lot. I am using elgg 3.3.1
I did it that way. But $returnvalue['action_type'] always contains "create" so I cannot know if the action is a comment or not .
Regards,
Ah, I'm definitely not yet into Elgg 3...
Try
Thanks,
But for almost all "rivers" tested, the variable $action_type always contains "create" not "comment".
Regards,
I've tested out the code myself now. And the first code I had posted works (actually the second of my suggestions is wrong). In most cases action_type is "create" of course (but these other types of river entries were not the ones you asked about...). But for the river entries added for comments it's "comment".
I'm not sure what else to suggest. The idea of RvR in his last posting is actually quite interesting. Instead of preventing the creation it would just stop the entries from getting displayed, i.e. the change would be revertible.
I've tested the follow code and it works for me. The code provides 3 modifications (1. not create the entries, 2. only hide the entries, 3. also hide the comment entries shown as "responses" below the entries the comments were added to). You would either use modification 1 OR 2 (I would recommend 2). Modifications 3 is independently usable with 1 and 2 or you could use only 3.
The code (start.php):