diff --git a/plugins/unl_avatars/start.php b/plugins/unl_avatars/start.php index 5e4b90129b70a876860b46150568c3076e961d4d..d12654eff675a25cacc908da3081e198970379a3 100644 --- a/plugins/unl_avatars/start.php +++ b/plugins/unl_avatars/start.php @@ -2,6 +2,7 @@ function unl_avatars_init() { elgg_register_page_handler('pg', 'unl_avatars_pg_handler'); + elgg_register_plugin_hook_handler('entity:icon:url', 'user', 'unl_avatars_alter_default_user_icons', 999); } // Fire up the plugin initialization using the elgg handler @@ -47,3 +48,9 @@ function unl_avatars_pg_profile($segments) { forward('profile/'.$segments[1]); } + +function unl_avatars_alter_default_user_icons($hook, $type, $returnValue, $params) { + //Always point to the icondirect.php file + $value = 'mod/profile/icondirect.php?guid='.$params['entity']->guid.'&size='.$params['size']; + return $value; +}