XenForo Tutorials

Animated Avatars in threads

Submitted by security, , Thread ID: 8237

Thread Closed
security
Closed Account
Level:
0
Reputation:
0
Posts:
13
Likes:
1
Credits:
21
28-07-2015, 08:43 AM
This post was last modified: 28-07-2015, 08:44 AM by security
#1
This is a simple template edit that allows animated avatars to show in posts. You have two options here:

1. Forces the size of all avatars to be 96x96
2. Allow avatars to use their aspect ration.

Also there is 2 versions, one that displays the animation to everyone and the other codes won't show animation to guests for faster browsing. [Image: clear.png]

Guest will see animation


Forced 96x96 edit: Open template message_user_info

Find
Code:
<xen:avatar user="$user" size="m" />
Replace with
Code:
<a class="username avatar Av{$user.user_id}l" href="{xen:link members, $user}">
<img src="{xen:helper avatar, $user, l, 'true'}" alt="{$user.username}" height="96px" width="96px" itemprop="photo" />
</a>
Aspect ration edit: Open template message_user_info

Find
Code:
<xen:avatar user="$user" size="m" />
Replace with
Code:
<a class="username avatar Av{$user.user_id}l" href="{xen:link members, $user}">
<img src="{xen:helper avatar, $user, l, 'true'}" alt="{$user.username}" style="max-height:96px;max-width:96px;" itemprop="photo" />
</a>
If guest; do not display animation

Forced 96x96 edit: Open template message_user_info

Find
Code:
<xen:avatar user="$user" size="m" />
Replace with
Code:
<xen:if is="!{$visitor.user_id}">
<xen:avatar user="$user" size="m" />
<xen:else />
<a class="username avatar Av{$user.user_id}l" href="{xen:link members, $user}">
<img src="{xen:helper avatar, $user, l, 'true'}" alt="{$user.username}" height="96px" width="96px" itemprop="photo" />
</a></xen:if>
Aspect ration edit: Open template message_user_info

Find
Code:
<xen:avatar user="$user" size="m" />
Replace with
Code:
<xen:if is="!{$visitor.user_id}">
<xen:avatar user="$user" size="m" />
<xen:else />
<a class="username avatar Av{$user.user_id}l" href="{xen:link members, $user}">
<img src="{xen:helper avatar, $user, l, 'true'}" alt="{$user.username}" style="max-height:96px;max-width:96px;" itemprop="photo" />
</a></xen:if>

RE: Animated Avatars in threads

rUx
Junior Member
Level:
0
Reputation:
0
Posts:
60
Likes:
4
Credits:
0
24-12-2017, 02:16 PM
#2
Did this on my site but I'm not sure what got changed, does this require some addons to work?

Users browsing this thread: 1 Guest(s)