Adding User Avatars to lastpost Node

J2A

Member
Just having some difficulty tweaking this template and understanding how the User avatar system works

Code:
<xen:avatar user="$forum.lastPost"  img="true" />

I've noticed the size property is used here, but all the sizes are unsuitable for what i require and also with this code it links to the correct profile but the (just shows the default avatar) actual avatar of the user does not display?

Any suggestions how to get this work correctly? Heres what i want it to look like: http://dribbble.com/shots/166859-Forum

Any help would be appreciated! (This should be in the questions section)
 
It seems to be opening up the user card info into a new page (not an overlay). Also, how can I get it to show the users name when hovering over the avatar like how it does for "following..."
View attachment 20528
<a href="{xen:link members/card, $forum.lastPost}" class="OverlayTrigger Tooltip" title="{$forum.lastPost.username}">

That might work, it might not, I've not tested.
 
Great! The pop up is working perfectly! The tool tip pops up as well but for some reason it is positioned over the thread title.

Edit: The tool tip is working properly in Chrome and Safari. All other browsers are showing it over the thread title. Maybe a CSS padding/margin issue?
 
Great! The pop up is working perfectly! The tool tip pops up as well but for some reason it is positioned over the thread title.

Edit: The tool tip is working properly in Chrome and Safari. All other browsers are showing it over the thread title. Maybe a CSS padding/margin issue?

I decided to give this try and I ran into the same problem, what you can do is wrap the avatar code with a div and than make the; div.DivName .Tooltip { float: left } and that should do the trick Luke.

I made a div with the classes of .avatar and .lastPostAvatar, so I did this to get the tooltip to be placed correctly
Code:
.avatar.lastPostAvatar .Tooltip {
float: left;
}
 
Did you guys ever figure out how to pull imgs for people that don't hold an avatar and uses gravatar? both scenarios seems pull no image since it's not stored in the data folder
 
I decided to give this try and I ran into the same problem, what you can do is wrap the avatar code with a div and than make the; div.DivName .Tooltip { float: left } and that...
Just as I suspected. Thank you!
Did you guys ever figure out how to pull imgs for people that don't hold an avatar and uses gravatar? both scenarios seems pull no image since it's not stored in the data folder
I haven't had the time to inspect this any further but would love to figure out a fix.
 
These are just template edits to hack some kind of avatar for the last poster. The ideal solution would be an add-on that adds the avatar data to the viewParams for the last poster.
 
I think you should be modifying the template thread_list_item. I'll take a look.

Okay yeah I was right. I've got the XenForo syntax sorted, all you need to do now is edit the CSS to resize the image. Steps:
Open thread_list_info
Find:
Code:
<dl class="lastPostInfo">
<dt><xen:username user="$thread.lastPostInfo" /></dt>
<dd class="muted"><a{xen:if '{$visitor.user_id}', ' href="{xen:link posts, $thread.lastPostInfo}" title="{xen:phrase go_to_last_message}"'} class="dateTime"><xen:datetime time="$thread.lastPostInfo.post_date" /></a></dd>
</dl>
Replace:
Code:
<dl class="lastPostInfo">
<xen:set var="$avatarGroup">{xen:if '{$thread.lastPostInfo.user_id} < 1000', '0', '{xen:helper snippet, $thread.lastPostInfo.user_id, 1}'}</xen:set>
<img src="data/avatars/s/{$avatarGroup}/{$thread.lastPostInfo.user_id}.jpg" alt="{$thread.lastPostInfo.username}" />
<dt><xen:username user="$thread.lastPostInfo" /></dt>
<dd class="muted"><a{xen:if '{$visitor.user_id}', ' href="{xen:link posts, $thread.lastPostInfo}" title="{xen:phrase go_to_last_message}"'} class="dateTime"><xen:datetime time="$thread.lastPostInfo.post_date" /></a></dd>
</dl>

All you need to do now is add the CSS syntax. Here is what I've got so far:
ee6a2110e37349778f5093c.png
Hi what's the css to get the avatar in the thread listing you posted, to the left of the username and date? instead of above the name. i would like to put it in the same wrapping as the lastpost info for the forum list mod
 
Back
Top Bottom