XenForo Tutorials

Frames for avatars

Submitted by Yondu, , Thread ID: 252123

Yondu
Marry Poppins Y'all
Administrators
Level:
36
Reputation:
190
Posts:
1.53K
Likes:
333
Credits:
3.52K
26-09-2022, 11:30 PM
#1
This tutorial is for frames for avatars. Let's begin.

Updated for 2.1

New conditional in 2.1
Code:
<xf:if is="{{$user && $user.isMemberOf('3,4,6')}}">

The CSS might be outdated

Extra.less
Code:
.avatar-frame-container {

  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
background-repeat: no-repeat;
margin-top: -115px;
}

.avatar-frame {
  background-repeat: no-repeat;
  position: absolute;
  display: block;
  width: 135px;
  height: 135px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -1px;
  margin-top: -3px;
}

.owner { background-image: url("images/avatar-frame-owner.png"); }
.admin { background-image: url("images/avatar-frame-admin.png"); }


.message-avatar-frame {
  z-index: 1;
  width: 135px;
  height: 135px;
}

message_macro
Code:
<div class="message-avatar-wrapper">
<xf:avatar user="$user" size="m" defaultname="{$fallbackName}" itemprop="image" />
<xf:if is="$xf.options.showMessageOnlineStatus && $user && $user.isOnline()">
<span class="message-avatar-online" tabindex="0" data-xf-init="tooltip" data-trigger="auto" title="{{ phrase('online_now')|for_attr }}"></span>
</xf:if>

<div class="avatar-frame-container">



<xf:if is="{{$user && $user.isMemberOf('3')}}">
            <div class="avatar-frame admin">

<xf:elseif is="{{$user && $user.isMemberOf('4')}}"/>
          
            <div class="avatar-frame mod">

          <xf:elseif is="{{$user && $user.isMemberOf('10')}}"/>
            <div class="avatar-frame admin">


          </xf:if>


<xf:if is="{{$user && $user.isMemberOf('3')}} || {{$user && $user.isMemberOf('4')}} || {{$user && $user.isMemberOf('10')}}">




</div>
  </xf:if>

</div>
</div>

Click save and you're done.

Enjoy
[Image: wsUuw16j6oyxLLRnnK.gif]

RE: Frames for avatars

jhoancito123
Newbie
Level:
1
Reputation:
0
Posts:
18
Likes:
0
Credits:
2
11-12-2022, 07:51 PM
#2
and this where it is edited has a photo how does that frame look

<xf:if is="{{$user && $user.isMemberOf('3,4,6')}}">

RE: Frames for avatars

adashzon
Lurker
Level:
0
Reputation:
0
Posts:
7
Likes:
1
Credits:
2
27-06-2023, 04:20 AM
#3
thanks for the tut, keep up the quality

RE: Frames for avatars

metaphor1642
Lurker
Level:
0
Reputation:
0
Posts:
4
Likes:
0
Credits:
0
04-08-2023, 11:55 PM
#4
Nice thanks for the tutorial. Quick questio can i change the colors?

Users browsing this thread: 1 Guest(s)