By Carly on Thursday, 17 September 2015
Posted in General Issues
Replies 9
Likes 0
Views 521
Votes 0
Hi,

We are writing a report and need to be able to display the users avatar as part of it.

Can you tell me in which table in the database the links to the users avatars are saved and also where the default avatars are held so we can access them.

Thanks
Carly
Hi Carly,

I am really sorry for the delay of this reply as it weekends for all of us here.

I've checked the file and it seems like the following joomla API is returning the following url on your site :
JURI::root()
// result = http://demonew.online-communities.org/reports/


You can refer my screenshot here for a better view, http://screencast.com/t/sSxiwuij . To fix this I've change JURI::root() inside /administrator/components/com_easysocial/includes/user/user.php at method @getDefaultAvatar and @getAvatar to JURI::root(false, '') and the path is showing correctly now on your site. Can you verify it for me?
·
Monday, 21 September 2015 11:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Carly,

The avatar is located inside #__social_avatars. However you can use the following API in order to retrieve user's avatar based on user id provided,
$id = 46 // example user id
$my = Foundry::user($id);
?>
<img src="/$my->getAvatar();" />


You can refer to our documentation here for more info about user API, http://stackideas.com/docs/easysocial/developers/users/users .

where the default avatars are held

The avatar is located inside your /media/com_easysocial/defaults/avatars/user/ folder.
·
Thursday, 17 September 2015 19:03
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Ezrul,

Thanks for the reply.
When we use the code above it returns the path to the avatar as

Our code:
$avatar = Foundry::user($a_row->user_id);
$useravatar = $avatar->getAvatar();

$useravatar returns
http://demonew.online-communities.org/reports/media/com_easysocial/avatars/users/146/48046910f9fc8e7d69a5b4062f072e5a_medium.jpg

Which has "/reports" as part of the path so the avatar isn't found - if we remove it, it works fine
Our program is a report under the reports menu - is that the problem.

Cheers
Carly
·
Thursday, 17 September 2015 21:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Carly,

I am really sorry for the delay of this reply. Can you provide us with login credentials of http://demonew.online-communities.org and FTP access as well so we can test it out directly on your site?
·
Friday, 18 September 2015 11:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Ezrul

We have attached our credentials as requested.

Thanks
Carly
·
Friday, 18 September 2015 18:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Carly,

May I know which file in your site that you are trying to modify under "Report" menu item? I just tried to dump the avatar path on your easysocial dashboard using the same API and it seems like it working correctly as you can see from my screenshot here, http://screencast.com/t/0C4G80la8sk .
·
Friday, 18 September 2015 19:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Ezrul,

To run the report you can login the front end, select reports > research tools > forum discussions then select Our Discussions and This is a test discussion.
You will see that the avatars are not displaying but if you inspect the element and remove /reports from the path it works.

The file that produces the report is getforum.php around line 65 in the reports folder.

Thanks for your help with this.

Carly
·
Friday, 18 September 2015 21:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Ezrul,

That works fine now.
Thanks for all your help - great support

Cheers
Carly
·
Monday, 21 September 2015 20:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Carly,

You are most welcome. Glad to hear that your issue has been resolved now. I advise you to backup the file that I've modified in your site to avoid any lost during the newer update on your site.
·
Tuesday, 22 September 2015 13:08
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post