ElkArte Community

Title: An avatar controller?
Post by: emanuele on August 10, 2014, 12:26:39 pm
In several situations (especially when javascript is involved) grab the correct avatar for a user is a real pain (you have always to rely on php to fetch and return the data to javascript, making it hard to really avoid php (yeah, I know what I'm going to propose may sound odd LOL), so I was thinking: in most of the cases use determineAvatar to get the proper URL and render it is fine, but what if we add a controller that returns the avatar based on the user ID?
Sort of dlattach, just specific for avatarts.
So, you want my avatar you use:
Code: [Select]
http://www.elkarte.net/community/index.php?action=avatar;u=2
and it outputs the avatar, no matter what that avatar is: it may be local or remote, it fetch_web_data or whatever and returns the image via php.
Not to be used everywhere for performances' sake, of course, though in certain situations may be very handy.
Title: Re: An avatar controller?
Post by: Joshua Dickerson on August 12, 2014, 06:20:01 pm
Makes sense. Kind of making a micro service of it.

Might make more sense to put it under the profile though as a subaction.