I wrote this code into start.php of one of my main plugin (inside the init function):
elgg_register_plugin_hook_handler('entity:icon:url', 'user', 'user_icon_url_override');
and the i copy/pasted the original function and modied into:
function user_icon_url_override($hook, $type, $returnvalue, $params) {
$user = $params['entity'];
$size = $params['size'];
if (isset($user->externalPhoto)) {
// return thumbnail
return $user->externalPhoto;
} else {
if (isset($user->icontime)) {
return "avatar/view/$user->username/$size/$user->icontime.jpg";
} else {
return "_graphics/icons/user/default{$size}.gif";
}
}
}
awesome thanks. i just activated this on my site too. thanks for sharing. :)
Does this neat trick work also on 1.9?
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.