profile date error

jhoancito

Well-known member
Registered
Joined
Mar 23, 2021
Messages
64
Points
18

Reputation:

I have got this code month of services I added it appeared above avatar I wanted to put it at the bottom last and next I also wanted support code and top member I lost it post where I got it only date code services months or year

this code I added :
<xf:macro name="user_info"
arg-user="!"
arg-fallbackName=""
arg-includeMicrodata="{{ true }}"
arg-itemProp="">
<xf:set var="$monthsOld">{{ number(($xf.time - $user.register_date) / (60 * 60 * 24 * 30)) }}</xf:set>
<xf:set var="$yearsOld">{{ number(($xf.time - $user.register_date) / (60 * 60 * 24 * 30 * 12)) }}</xf:set>
<xf:if is="$monthsOld < '12'">
<div style="margin-top:5px;margin-bottom:5px;">
<div class="service-tag user-service--postbit ">
<div class="type-month-{$monthsOld}">{$monthsOld} Mes De Servicio</div>
</div>
</div>
<xf:else />
<div style="margin-top:5px;margin-bottom:5px;">
<div class="service-tag user-service--postbit">
<div class="type-year-{$yearsOld}">{$yearsOld} Años De Servicio</div>
</div>
</div>
</xf:if>


Captura.jpg
 

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
609
Points
103

Reputation:

Put the code on the bottom of your messsage_macro template, further way down.
 

jhoancito

Well-known member
Registered
Joined
Mar 23, 2021
Messages
64
Points
18

Reputation:

Put the code on the bottom of your messsage_macro template, further way down.
SplichoMore or less what part is my messsage_macro


<xf:macro name="user_info"
arg-user="!"
arg-fallbackName=""
arg-includeMicrodata="{{ true }}"
arg-itemProp="">

<section class="message-user"
{{ $includeMicrodata ? 'itemprop="' . $itemProp . '" itemscope itemtype="https://schema.org/Person" itemid="' . ($user ? link('canonical:members', $user) : '') . '"' : '' }}>

<xf:if is="$includeMicrodata && $user">
<meta itemprop="url" content="{{ link('canonical:members', $user) }}" />
</xf:if>

<div class="message-avatar {{ ($xf.options.showMessageOnlineStatus && $user && $user.isOnline()) ? 'message-avatar--online' : '' }}">
<div class="message-avatar-wrapper">
<xf:avatar user="$user" size="m" defaultname="{$fallbackName}" itemprop="{{ $includeMicrodata ? '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>
</div>
<div class="message-userDetails">
<h4 class="message-name"><xf:username user="$user" rich="true" defaultname="{$fallbackName}" itemprop="{{ $includeMicrodata ? 'name' : '' }}" /></h4>
<xf:usertitle user="$user" tag="h5" class="message-userTitle" banner="true" itemprop="{{ $includeMicrodata ? 'jobTitle' : '' }}" />
<xf:userbanners user="$user" tag="div" class="message-userBanner" itemprop="{{ $includeMicrodata ? 'jobTitle' : '' }}" />
</div>
<xf:if is="$user.user_id">
<xf:set var="$extras" value="{{ property('messageUserElements') }}" />
<xf:if contentcheck="true">
<div class="message-userExtras">
<xf:contentcheck>
<xf:if is="$extras.register_date">
<dl class="pairs pairs--justified">
<dt>{{ phrase('joined') }}</dt>
<dd>{{ date($user.register_date) }}</dd>
</dl>
</xf:if>
<xf:if is="$extras.message_count">
<dl class="pairs pairs--justified">
<dt>{{ phrase('messages') }}</dt>
<dd>{$user.message_count|number}</dd>
</dl>
</xf:if>
<xf:if is="$extras.solutions AND $user.question_solution_count">
<dl class="pairs pairs--justified">
<dt>{{ phrase('solutions') }}</dt>
<dd>{$user.question_solution_count|number}</dd>
</dl>
</xf:if>
<xf:if is="$extras.reaction_score">
<dl class="pairs pairs--justified">
<dt>{{ phrase('reaction_score') }}</dt>
<dd>{$user.reaction_score|number}</dd>
</dl>
</xf:if>
<xf:if is="$extras.trophy_points && $xf.options.enableTrophies">
<dl class="pairs pairs--justified">
<dt>{{ phrase('points') }}</dt>
<dd>{$user.trophy_points|number}</dd>
</dl>
</xf:if>
<xf:if is="$extras.age && $user.Profile.age">
<dl class="pairs pairs--justified">
<dt>{{ phrase('age') }}</dt>
<dd>{$user.Profile.age}</dd>
</dl>
</xf:if>
<xf:if is="$extras.location && $user.Profile.location">
<dl class="pairs pairs--justified">
<dt>{{ phrase('location') }}</dt>
<dd>
<xf:if is="$xf.options.geoLocationUrl">
<a href="{{ link('misc/location-info', '', {'location': $user.Profile.location}) }}" rel="nofollow noreferrer" target="_blank" class="u-concealed">{$user.Profile.location}</a>
<xf:else />
{$user.Profile.location}
</xf:if>
</dd>
</dl>
</xf:if>
<xf:if is="$extras.website && $user.Profile.website">
<dl class="pairs pairs--justified">
<dt>{{ phrase('website') }}</dt>
<dd><a href="{$user.Profile.website}" rel="nofollow" target="_blank">{$user.Profile.website|url_display('host', phrase('visit_site'))}</a></dd>
</dl>
</xf:if>
<xf:if is="$extras.custom_fields">
<xf:macro template="custom_fields_macros" name="custom_fields_values"
arg-type="users"
arg-group="personal"
arg-set="{$user.Profile.custom_fields}"
arg-additionalFilters="{{ ['message'] }}"
arg-valueClass="pairs pairs--justified" />
<xf:if is="$user.canViewIdentities()">
<xf:macro template="custom_fields_macros" name="custom_fields_view"
arg-type="users"
arg-group="contact"
arg-set="{$user.Profile.custom_fields}"
arg-additionalFilters="{{ ['message'] }}"
arg-valueClass="pairs pairs--justified" />
</xf:if>
</xf:if>
</xf:contentcheck>
</div>
</xf:if>
</xf:if>
<span class="message-userArrow"></span>
</section>
</xf:macro>

<xf:macro name="user_info_simple" arg-user="!" arg-fallbackName="" arg-includeMicrodata="{{ true }}" arg-itemProp="">
<header class="message-user"
{{ $includeMicrodata ? 'itemprop="' . $itemProp . '" itemscope itemtype="https://schema.org/Person" itemid="' . ($user ? link('canonical:members', $user) : '') . '"' : '' }}>

<xf:if is="$includeMicrodata">
<meta itemprop="name" content="{{ $user.username ?: $fallbackName }}" />
<xf:if is="$user">
<meta itemprop="url" content="{{ link('canonical:members', $user) }}" />
</xf:if>
</xf:if>

<div class="message-avatar">
<div class="message-avatar-wrapper">
<xf:avatar user="$user" size="s" defaultname="{$fallbackName}" itemprop="{{ $includeMicrodata ? 'image' : '' }}" />
</div>
</div>
<span class="message-userArrow"></span>
</header>
</xf:macro>

<xf:macro name="attachments" arg-attachments="!" arg-message="!" arg-canView="!">
<xf:if contentcheck="true">
<xf:css src="attachments.less" />
<section class="message-attachments">
<h4 class="block-textHeader">{{ phrase('attachments') }}</h4>
<ul class="attachmentList">
<xf:contentcheck>
<xf:foreach loop="$attachments" value="$attachment" if="!$message.isAttachmentEmbedded($attachment)">
<xf:macro template="attachment_macros" name="attachment_list_item"
arg-attachment="{$attachment}"
arg-canView="{$canView}" />
</xf:foreach>
</xf:contentcheck>
</ul>
</section>
</xf:if>
</xf:macro>

<xf:macro name="signature" arg-user="!">
<xf:if is="$xf.visitor.Option.content_show_signature AND $user.Profile.signature">
<xf:if contentcheck="true">
<aside class="message-signature">
<xf:contentcheck>
{{ bb_code($user.Profile.signature, 'user:signature', $user) }}
</xf:contentcheck>
</aside>
</xf:if>
</xf:if>
</xf:macro>
 
View previous replies…

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
609
Points
103

Reputation:

More or less what part is my messsage_macro
jhoancitoPut it after </xf:if>

<dd><a href="{$user.Profile.website}" rel="nofollow" target="_blank">{$user.Profile.website|url_display('host', phrase('visit_site'))}</a></dd>
</dl>
</xf:if>
 

jhoancito

Well-known member
Registered
Joined
Mar 23, 2021
Messages
64
Points
18

Reputation:

Put it after </xf:if>

<dd><a href="{$user.Profile.website}" rel="nofollow" target="_blank">{$user.Profile.website|url_display('host', phrase('visit_site'))}</a></dd>
</dl>
</xf:if>
Splichook thanks you published this code you have to pass me the easy support and top member friend with your css you can pass I just ask you and thanks for answering me
 

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
609
Points
103

Reputation:

ok thanks you published this code you have to pass me the easy support and top member friend with your css you can pass I just ask you and thanks for answering me
jhoancitoYou can do it with usergroups. Make two usergroups, for supporter and top member.

Then you can do something like this

Code:
<xf:if is="$user.isMemberOf(GroupID)">
Show Supporter Banner/Badge
<xf:elseif is="$user.isMemberOf(GroupID)" />
Show Top Member Banner/Badge
<xf:else />
</xf:if>

GroupID = Id of the usergroup

Everyone who is in these usergroups will have the banner.
 

jhoancito

Well-known member
Registered
Joined
Mar 23, 2021
Messages
64
Points
18

Reputation:

You can do it with usergroups. Make two usergroups, for supporter and top member.

Then you can do something like this

Code:
<xf:if is="$user.isMemberOf(GroupID)">
Show Supporter Banner/Badge
<xf:elseif is="$user.isMemberOf(GroupID)" />
Show Top Member Banner/Badge
<xf:else />
</xf:if>

GroupID = Id of the usergroup

Everyone who is in these usergroups will have the banner.
Splicho
<xf:macro name="user_info"
arg-user="!"
arg-fallbackName=""
arg-includeMicrodata="{{ true }}"
arg-itemProp="">
<xf:set var="$monthsOld">{{ number(($xf.time - $user.register_date) / (60 * 60 * 24 * 30)) }}</xf:set>
<xf:set var="$yearsOld">{{ number(($xf.time - $user.register_date) / (60 * 60 * 24 * 30 * 12)) }}</xf:set>
<xf:if is="$monthsOld < '12'">
<div style="margin-top:5px;margin-bottom:5px;">
<div class="service-tag user-service--postbit ">
<div class="type-month-{$monthsOld}">{$monthsOld} Mes De Servicio</div>
</div>
</div>
<xf:else />
<div style="margin-top:5px;margin-bottom:5px;">
<div class="service-tag user-service--postbit">
<div class="type-year-{$yearsOld}">{$yearsOld} Años De Servicio</div>
</div>
</div>
</xf:if>


here below I added it there is an error

<xf:if is="$user.isMemberOf(GroupID)">
Show Supporter Banner/Badge
<xf:elseif is="$user.isMemberOf(GroupID)" />
Show Top Member Banner/Badge
<xf:else />
</xf:if>
 

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
609
Points
103

Reputation:

jhoancitoSorry, I had a typo in my code.

Try this

Code:
<xf:if is="$user.isMemberOf(GroupID)">
    Show Supporter Banner/Badge
<xf:elseif is="$user.isMemberOf(AnotherGroupID)" />
    Show Top Member Banner/Badge
<xf:else />
    <!-- If user is not a member of any specified group -->
</xf:if>
 

jhoancito

Well-known member
Registered
Joined
Mar 23, 2021
Messages
64
Points
18

Reputation:

Sorry, I had a typo in my code.

Try this

Code:
<xf:if is="$user.isMemberOf(GroupID)">
    Show Supporter Banner/Badge
<xf:elseif is="$user.isMemberOf(AnotherGroupID)" />
    Show Top Member Banner/Badge
<xf:else />
    <!-- If user is not a member of any specified group -->
</xf:if>
Splichofollow the same


Captura.PNG
 
Top