- Posts: 214
COMMUNITY FORUM
How to display user`s avatar
- George Nasis
- Topic Author
- Offline
- Elite Member
Less
More
11 years 5 days ago #118831
by George Nasis
How to display user`s avatar was created by George Nasis
Hallo there!
This is the code to ger username
$user = JFactory::getUser();
echo $user->get('username');
How can we retrieve the image?
i try echo $user->get('image); but it doesn`t work
I try to display it with a custom html module
Thanx
This is the code to ger username
$user = JFactory::getUser();
echo $user->get('username');
How can we retrieve the image?
i try echo $user->get('image); but it doesn`t work
I try to display it with a custom html module
Thanx
Please Log in or Create an account to join the conversation.
- Stefanos Mountrakis
- Offline
- New Member
Less
More
- Posts: 8
11 years 5 days ago #118832
by Stefanos Mountrakis
Replied by Stefanos Mountrakis on topic Re: How to display user`s avatar
try $user->profile->image; or $user->avatar; , using var_dump($user) or print_r($user) really helps :)
Please Log in or Create an account to join the conversation.
- George Nasis
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 214
11 years 4 days ago #118833
by George Nasis
Replied by George Nasis on topic Re: How to display user`s avatar
Hallo there!
The first two don`t work neither.. :/ what do you mean to use var_dump($user) or print_r($user) ??
Can you please write the code??
Thanx a lot!
The first two don`t work neither.. :/ what do you mean to use var_dump($user) or print_r($user) ??
Can you please write the code??
Thanx a lot!
Please Log in or Create an account to join the conversation.
- George Nasis
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 214
11 years 4 days ago #118834
by George Nasis
Replied by George Nasis on topic Re: How to display user`s avatar
Finally this works!!!
<?php $user = JFactory::getUser(); ?>
<img src="<?php echo $user->avatar; ?>" style="width:50px; height:auto;" />
<?php $user = JFactory::getUser(); ?>
<img src="<?php echo $user->avatar; ?>" style="width:50px; height:auto;" />
Please Log in or Create an account to join the conversation.
- Stefanos Mountrakis
- Offline
- New Member
Less
More
- Posts: 8
11 years 4 days ago #118835
by Stefanos Mountrakis
Replied by Stefanos Mountrakis on topic Re: How to display user`s avatar
nice to hear that :)
Please Log in or Create an account to join the conversation.