I use the “since last visit” plugin and was wondering if there was a way to show a member’s avatar, next to their name, when logged in? I have the name part working just fine, but the avatar only seems to work inside a comments tag.
TIA.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
June 22, 2007 4:57pm
Subscribe [2]#1 / Jun 22, 2007 4:57pm
I use the “since last visit” plugin and was wondering if there was a way to show a member’s avatar, next to their name, when logged in? I have the name part working just fine, but the avatar only seems to work inside a comments tag.
TIA.
#2 / Jun 23, 2007 5:24am
#3 / Jun 23, 2007 2:14pm
That’s not quite what I want to do, but thank you for the suggestion.
#4 / Jun 24, 2007 11:34am
Well, if you have the member name, what’s keeping from getting the avatar from the db directly?
#5 / Jun 24, 2007 7:45pm
What I’m trying to accomplish (and I saw this on another EE blog, but the site owner won’t tell me how he did it) is:
1. Use the “since last visit” code to show the posts and comments since the member last logged in..with “Hi { screen_name } manually added to make it more personal.
2. Have the member’s avatar appear in this code block. So far, nothing I’ve tried has worked. It simply doesn’t show up. The { avatar _url } doesn’t work outside of the comments tag, apparently.
I want it to look like this..
{ avatar }
Hi { screen_name }
Posts since..
Comments since..
Last visit at..
I’m sure there’s a simple solution to this, but I’m not seeing it.
So..that’s what I’m trying to do.
Help.
#6 / Jun 24, 2007 9:50pm
Check out wiki:// Avatar of Current User.
#7 / Jun 24, 2007 10:37pm
Followed all of the directions, ended up with a broken image, even after trying different paths.
Think I’m going to give up on it, as it has me so frustrated. Thank you for trying to help.
#8 / Jun 24, 2007 10:43pm
Well I just got it to work on my site:
<?php
global $SESS;
$member_id = $SESS->userdata['member_id'];
?>
{exp:query sql="SELECT avatar_filename, avatar_width, avatar_height FROM exp_members WHERE member_id = <?php echo $member_id; ?>"}
{if avatar_filename !=""}
<a href="http://{path=forums/member/profile}">http://www.lisajill.net/images/avatars/{avatar_filename}</a>
{/if}
{if avatar_filename ==""}
<a href="http://{path=forums/member/profile}">http://www.lisajill.net/images/avatars/forum_themes/default/images/icon_profile.gif</a>
<span>No Avatar Selected</span>
{/if}
{/exp:query}Exact cut and paste from the working setup -all is default except my domain. If you don’t run the forums you will want to point to something like member/profile rather than forums/member/profile, etc.
#9 / Jun 25, 2007 2:17am
I still think the additional plugin (Who’s Online) along with Since last visit would work… maybe something like this?
The code would need to be tidied up, but I believe it would get the data you want…
#10 / Jun 25, 2007 3:49am
Actually, I got it working…I had messed up the image path, before.
Thanks so much for your help, Daniel. Much appreciated. 😊