by
atisz » Mon Oct 19, 2015 5:32 pm
KK wrote: @atisz, this has been discussed in the following thread -
viewtopic.php?f=4&t=8582Following the mentioned discussion, this code should do what you are looking for -
- Code: Select all
<cms:show_securefile 'avatar' >
<cms:if file_is_image >
<a href="<cms:cloak_url link=file_id />"><img src="<cms:cloak_url link=file_id thumbnail='1' />" /></a><br />
</cms:if>
<cms:set has_avatar='1' 'global' />
</cms:show_securefile>
<cms:if "<cms:not has_avatar />" >
<img src=".." />
</cms:if>
Hope it helps.
Thanks, KK! It helps, but.... There is a problem because, for example, in index.php I have to display in the main div the member details: avatar, name, address,.... but member avatar and name are displayed in the sidebar, also. And using the code above will display in sidebar both the default avatar and user chosen avatars only if I'm visiting a page (eg members/index.php?p=79) where user has no own avatar and default avatar is displayed. Otherwise, because of
- Code: Select all
<cms:set has_avatar='1' 'global' />
the sidebar doesn't display the default avatar. Is there a workaround to display the correct avatar type in the sidebar?
Thanks.