• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 how to get resource author avatar in my template

#3
i want to show each resource author avatar and his profile link with resource title
in my add on template i am fetching resources from this code:

<xen:foreach loop="$resources3" value="$resource">
<li class="{$resource.resource_state}">
<a style="" href="{xen:link resources, $resource}" class="resourceTitle">{$resource.title}</a>
<xen:if is="{$pos} == 0">
(<a data-avatarhtml="true" class="avatar Av203s" href="index.php?members/{$resource.user_id}/"><img width="20" height="20" align="absmiddle" alt="Oracle" src="data/avatars/s/0/203.jpg?1376110240"></a><xen:username user="$resource" rich="true" class="username" />)
<xen:else />
(<xen:username user="$resource" rich="true" class="username" />)

</xen:if>
<dt>{$resource.tag_line}</dt>
</li>
</xen:foreach>


i want to show link and image related to author ...and want to redirect to his profile .....is there any function through which i can redirect to author profile by using his id for any forum
and what are s/0 and s/1 in image path
src="ata/avatars/s/0/203.jpg?1376110240"
 
#7
i have put this code but all avatar are the default avatar ....not there uploaded avatar s
<xen:foreach loop="$resources1" value="$resource">
<li class="{$resource.resource_state}" style="vertical-align:top;">
<div style="width:auto">


<xen:avatar user="$resource" img="true" />

<a href="{xen:link resources, $resource}" class="resourceTitle">{$resource.title}</a>
(<xen:username user="$resource" rich="true" class="username" />)
<dt>{$resource.tag_line}</dt>
</div>
<div style="clear:both;"></div>
</li>
</xen:foreach>
 
Last edited:
#10
i am fetching through query and passing as an array with parent...
$resources1 = $db->fetchAll("SELECT * FROM `xf_resource` where `resource_state`='visible' order by rating_weighted DESC limit 0,$latestResourcePerPage");