Hi does anyone know how to remove the activity stream of a plugin e.g HypePortfolio from the dashboard? Reallly need help with this.
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.
What version of Elgg? 1.7 or 1.8
It's 1.8
The proper way of doing it:
1. Create a new plugin (see documentation for details)
2. Register a plugin hook
The above will register a hook for the following trigger found in engine/lib/river.php:
$params = array(
'type' => $type,
'subtype' => $subtype,
'action_type' => $action_type,
'access_id' => $access_id,
'view' => $view,
'subject_guid' => $subject_guid,
'object_guid' => $object_guid,
'annotation_id' => $annotation_id,
'posted' => $posted,
);
// return false to stop insert
$params = elgg_trigger_plugin_hook('creating', 'river', null, $params);
if ($params == false) {
// inserting did not fail - it was just prevented
return true;
}
Every time the plugin is attempting to add an item to a river with a subtype added to the array $remove_subtypes, your hook will prevent that action.
@Ismayil:
Thanks for the reminder that your posted code points me to ;-)
I was planning to pull Elgg-community_customizations
to do some simple patches to block 'junk' kind of stuff on the river - people :-
-- Making so-o-o many fiends - clogging the Comm River,
-- Updating their Profiles umpteem times in several minutes,
-- Updating their Avatars umpteem times in several minutes,
and that sort of ckunky stuff that clouds the River when we're loooking
for some juicy *technical posts `n stuff.
Funny thing is that after coding those changess --
I seem to 'lost' all my code..
Somewhere on my Desktop or Drive C: or XAMPP'shtdocs ;-P
and so I gonna have to code all that again ! ;-(
But PlZ - nobody laugh at my sloppiness !
I'm the kinda Developer that has 500+ items on my Desktop
and a few hunderd scattered on XAMPP ;-oO;X
But thanks to your reference to the
'elgg_register_plugin_hook_handler('creating', 'river', ..
I kinda remember most of that lost code ;-)
And so back working on that code..
and maybe soon gotta do my 'newbie' struggles
with GitHub Web interface + Git GUI stuffs.
:) Just realized that you might want to be a little more attentive when you do this than I am while posting my previous post. Of course, you need to return $params, not true.
Yep ;-) & ThX - I caught that ;)
Hi the code i added to my start.php file is below, however the HypePortfolio activities are still being added to the dashboard. What am i doing wrong?
function activityStreamEdit_init() {
// Load system configuration
global $CONFIG;
elgg_register_plugin_hook_handler('creating', 'river', 'my_river_hook');
}
function my_river_hook($hook, $type, $return, $params) {
$remove_subtypes = array('hjeducation', 'hjexperience', 'hjskill', 'hjlanguage', 'hjportfoliofile');
$subtype = elgg_extract('subtype', $params, false);
if ($subtype && in_array($subtype, $remove_subtypes)) {
return false;
}
return true;
}
You forgot to initialize your plugin :)
elgg_register_event_handler('init', 'system', 'activityStreamEdit_init');
function activityStreamEdit_init() {
elgg_register_plugin_hook_handler('creating', 'river', 'my_river_hook');
}
function my_river_hook($hook, $type, $return, $params) {
$remove_subtypes = array('hjeducation', 'hjexperience', 'hjskill', 'hjlanguage', 'hjportfoliofile');
$subtype = elgg_extract('subtype', $params, false);
if ($subtype && in_array($subtype, $remove_subtypes)) {
return false;
}
return $return;
}
@JF:
Now thatsh wot I likes to see ;)
Someone newbie-like looking but not
afraid to roll sleeves and just try N test out code..
In my good books..;-P
@Dhrup thanks alot :)
But unfortunately the posts are still going to the activity stream in the dashboard :(
I even deactivated anad re-activated the plugin.
- Previous
- 1
- 2
- Next
You must log in to post replies.