I’m sure there is something obvious that I’m missing here. I want to display my logged_in_members avatar (and a default image if they don’t have one).
I’ve been attempting to use the {exp:user:stats} tag to pull in the image but I’m not having any success.
<div class="avatar_wrapper">
{exp:user:stats username="{username}"}{if avatar_url != ""}<img src="{avatar_url}{avatar_filename}" width="{avatar_width}" height="{avatar_height}" alt="{username}'s avatar" />{if:else}<img src="default_avatar.gif" width="105" height="75" alt="{username} has not uploaded an avatar" />{/if}{/exp:user:stats}
</div>
I’ve tried both the {username} and {member_id} - both values are present and available. However, when I feed the {username} varialbe the {exp:user:stats} tag doesn’t spit out any data what so ever. If I hard-code the username parameter within the tag I get:
<div class="avatar_wrapper">
<img src="http://www.shirtfight.com/images/avatars/" width="0" height="0" alt="admin's avatar" />
</div>
Now this is even more odd because this user has no avatar so the second half of the condition should be what displays.
I’m clearly going down the wrong path here. Anyone have a tip or two to bet me back on the right track?
Thanks in advance!
