Hi!
I am trying to pull the user avatar to display it on a plugin.
This code used to work on elgg 1.8.1 and 1.8.2 but no longer in elgg 1.8.3
$_SESSION['user']->getIcon('large');
What's the correct way to pull it in elgg 1.8.x?
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.
- Weise@dwb1988

Weise - 0 likes
- ihayredinov@ihayredinov

ihayredinov - 0 likes
- Weise@dwb1988

Weise - 0 likes
You must log in to post replies.Hello... you have to use: img src="<?php echo $_SESSION['user']->getIconURL('large'); ?>
Cheers,
DW
WRONG! Do not use $_SESSION!
Use Elgg API:
To get a view:
elgg_view_entity_icon($user, 'large', array('class' => $class)) // you can add other $vars to the array
To get a URL:
$user->getIconURL('large');
Thats more acurated Ismayil Khayredinov
Thanks!