XF 2.2 Возраст юзера в карточке профиля

Версия XenForo
2.2.11

pumba560

Проверенные
Сообщения
416
Решения
3
Реакции
10
Баллы
50
При реге есть графа указывать свой год рождения, соответственно показывается возраст, но тупо цифра.
Можно как то добавить перед цифрой возраста надпись, типа Возраст:

Буфер обмена-1.jpg
 
Последнее редактирование:
Решение
Проверила модификации на 2.2.11, должно все примениться
Шаблон: member_tooltip
Ключ: Придумайте
Тип поиска: Простая замена
Найти:
HTML:
                    <xf:if contentcheck="true">
                        <div class="memberTooltip-blurb">
                        <xf:contentcheck>
                            <xf:userblurb user="$user" tag="div" />
                        </xf:contentcheck>
                        </div>
                    </xf:if>
Заменить:
HTML:
                    <div class="memberTooltip-blurb">
                        <xf:usertitle user="$user" />
                        <xf:if is="$user.Profile.location">
                            <span role="presentation" aria-hidden="true">&middot;</span>...
При реге есть графа указывать свой год рождения, соответственно показывается возраст, но тупо цифра.
Можно как то добавить перед цифрой возраста надпись, типа Возраст:

Посмотреть вложение 152996
Через модификатор можно добавить фразу предварительно создав ее в языках
 
Модификация шаблона member_tooltip
Ключ: придумайте
Тип поиска: Простая замена
Найти:
HTML:
<xf:if contentcheck="true">
                        <div class="memberTooltip-blurb">
                        <xf:contentcheck>
                            <xf:userblurb user="$user" tag="div" />
                        </xf:contentcheck>
                        </div>
                    </xf:if>
Заменить:
HTML:
<div class="memberTooltip-blurb">
                        <xf:usertitle user="$user" />
                        <xf:if is="$user.Profile.location">
                            <span role="presentation" aria-hidden="true">&middot;</span>
                            <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>
                        </xf:if>
                    </div>
                    
                    <xf:if is="$user.Profile.birthday.age">
                        <div class="memberTooltip-blurb">
                            <dl class="pairs pairs--inline">
                                <dt>{{ phrase('age') }}</dt>
                                <dd>{$user.Profile.birthday.age}</dd>
                            </dl>
                        </div>
                    </xf:if>
1739628426506.png
 
Может так правильней ?? А то не принимает модификацию
Найти
<div class="memberTooltip-blurbContainer">
<xf:if contentcheck="true">
<div class="memberTooltip-blurb">
<xf:contentcheck>
<xf:userblurb user="$user" tag="div" />
</xf:contentcheck>
</div>

Но лучше бы инфа бралась с графы День рождения, и была полной , типа 16 Май 1966 (Возраст: 58)
ИТ в всплывающем профиле счас цифра возраста есть, а прит просмотре полного профиля все равно одна цифра, видимо надо править еще одну модификацию
 
Последнее редактирование:
День рождения, и была полной , типа 16 Май 1966 (Возраст: 58)
В модификации шаблона member_tooltip , в поле найти, измените код возраста на этот
HTML:
<xf:if contentcheck="true">
                        <div class="memberTooltip-blurb">
                            <dl class="pairs pairs--inline">
                                <dt>{{ phrase('age') }}</dt>
                                <dd>
                                    <xf:contentcheck>
                                        <xf:if is="$user.Profile.birthday.timeStamp">
                                            {{ date($user.Profile.birthday.timeStamp, $user.Profile.birthday.format) }}
                                            <xf:if is="$user.Profile.birthday.age">
                                                {{ parens(phrase('age:') . ' ' . {$user.Profile.birthday.age}) }}
                                        </xf:if>
                                    </xf:if>
                                </xf:contentcheck>
                                </dd>
                            </dl>
                        </div>
                    </xf:if>
в всплывающем профиле счас цифра возраста есть, а прит просмотре полного профиля все равно одна цифра
Модификация шаблона member_view
Ключ: придумайте
Тип поиска: Простая замена
Найти:
HTML:
<xf:userblurb user="$user" tag="div" class="memberHeader-blurb" />
Заменить:
HTML:
<div class="memberHeader-blurb">
                                <xf:usertitle user="$user" />
                                <xf:if is="$user.Profile.location">
                                    <span role="presentation" aria-hidden="true">&middot;</span>
                                    <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>
                            </xf:if>
                        </div>
                    
                    
                            <xf:if contentcheck="true">
                                <div class="memberHeader-blurb">
                                    <dl class="pairs pairs--inline">
                                        <dt>{{ phrase('age') }}</dt>
                                        <dd>
                                            <xf:contentcheck>
                                                <xf:if is="$user.Profile.birthday.timeStamp">
                                                    {{ date($user.Profile.birthday.timeStamp, $user.Profile.birthday.format) }}
                                                    <xf:if is="$user.Profile.birthday.age">
                                                        {{ parens(phrase('age:') . ' ' . {$user.Profile.birthday.age}) }}
                                                </xf:if>
                                            </xf:if>
                                        </xf:contentcheck>
                                        </dd>
                                    </dl>
                                </div>
                            </xf:if>
1739640655211.png
 
В модификации шаблона member_tooltip, в поле найти, измените код возраста на этот
То есть я в поле Найти ввожу ваш код, а замену оставляю как в предыдущем сообщении ?
Так не принимает изменения.. че то не так.

Изменения в member_view работают нормально.


Вот содержание моего шаблона member_tooltip

<xf:css src="member_tooltip.less" />

<div class="tooltip-content-inner">
<div class="memberTooltip {{ $user.Profile.banner_date ? 'memberTooltip--withBanner' : '' }}">
<xf:profilebanner user="$user" size="m" class="memberTooltip-header" toggle="memberTooltip--withBanner">
<span class="memberTooltip-avatar">
<xf:avatar user="{$user}" size="m" notooltip="true" />
</span>
<div class="memberTooltip-headerInfo">
<xf:if contentcheck="true">
<div class="memberTooltip-headerAction">
<xf:contentcheck>
<!--[XF:header_action_start]-->
<xf:if contentcheck="true">
<xf:button class="button--link button--small menuTrigger"
data-xf-click="menu"
aria-label="{{ phrase('more_options') }}"
aria-expanded="false"
aria-haspopup="true">
<xf:fa icon="fa-cog" />
</xf:button>

<div class="menu" data-menu="menu" aria-hidden="true">
<div class="menu-content">
<h3 class="menu-header">{{ phrase('moderator_tools') }}</h3>
<xf:contentcheck>
<xf:macro template="member_macros" name="moderator_menu_actions"
arg-user="{$user}"
arg-context="tooltip" />
</xf:contentcheck>
</div>
</div>
</xf:if>
<!--[XF:header_action_end]-->
</xf:contentcheck>
</div>
</xf:if>

<h4 class="memberTooltip-name">
<span class="memberTooltip-nameWrapper">
<xf:username user="$user" rich="true" notooltip="true" />
</span>

<xf:if is="$user.hasViewableUsernameHistory()">
<a class="memberTooltip-nameChangeIndicator"
data-xf-click="menu"
data-xf-init="tooltip"
title="{{ phrase('username_changed')|for_attr }}"
role="button"
tabindex="0"
aria-expanded="false"
aria-haspopup="true"
aria-label="{{ phrase('username_changed')|for_attr }}"><xf:fa icon="fa-history" /></a>
<div class="menu" data-menu="menu" aria-hidden="true"
data-href="{{ link('members/username-history', $user, {'menu': 1}) }}"
data-load-target=".js-usernameHistoryBody">
<div class="menu-content">
<h3 class="menu-header">{{ phrase('previous_usernames') }}</h3>
<div class="js-usernameHistoryBody">
<div class="menu-row">
{{ phrase('loading...') }}
</div>
</div>
</div>
</div>
</xf:if>
</h4>

<xf:if contentcheck="true">
<div class="memberTooltip-banners">
<xf:contentcheck><xf:userbanners user="$user" /></xf:contentcheck>
</div>
</xf:if>

<div class="memberTooltip-blurbContainer">
<xf:if contentcheck="true">
<div class="memberTooltip-blurb">
<xf:contentcheck>
<xf:userblurb user="$user" tag="div" />
</xf:contentcheck>
</div>
</xf:if>

<div class="memberTooltip-blurb">
<dl class="pairs pairs--inline">
<dt>{{ phrase('joined') }}</dt>
<dd><xf:date time="$user.register_date" /></dd>
</dl>
</div>

<xf:if contentcheck="true">
<div class="memberTooltip-blurb">
<dl class="pairs pairs--inline">
<dt>{{ phrase('last_seen') }}</dt>
<dd dir="auto">
<xf:contentcheck><xf:useractivity user="$user" class="pairs--plainLabel" /></xf:contentcheck>
</dd>
</dl>
</div>
</xf:if>
</div>
</div>
</xf:profilebanner>
<div class="memberTooltip-info">
<div class="memberTooltip-stats">
<div class="pairJustifier">
<xf:macro template="member_macros" name="member_stat_pairs"
arg-user="{$user}"
arg-context="tooltip" />
</div>
</div>
</div>

<xf:if contentcheck="true">
<hr class="memberTooltip-separator" />

<div class="memberTooltip-actions">
<xf:contentcheck>
<xf:macro template="member_macros" name="member_action_buttons"
arg-user="{$user}"
arg-context="tooltip" />
</xf:contentcheck>
</div>
</xf:if>
</div>
</div>
 
Последнее редактирование:
Проверила модификации на 2.2.11, должно все примениться
Шаблон: member_tooltip
Ключ: Придумайте
Тип поиска: Простая замена
Найти:
HTML:
                    <xf:if contentcheck="true">
                        <div class="memberTooltip-blurb">
                        <xf:contentcheck>
                            <xf:userblurb user="$user" tag="div" />
                        </xf:contentcheck>
                        </div>
                    </xf:if>
Заменить:
HTML:
                    <div class="memberTooltip-blurb">
                        <xf:usertitle user="$user" />
                        <xf:if is="$user.Profile.location">
                            <span role="presentation" aria-hidden="true">&middot;</span>
                            <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>
                        </xf:if>
                    </div>
                    
                   <xf:if contentcheck="true">
                        <div class="memberTooltip-blurb">
                            <dl class="pairs pairs--inline">
                                <dt>{{ phrase('age') }}</dt>
                                <dd>
                                    <xf:contentcheck>
                                        <xf:if is="$user.Profile.birthday.timeStamp">
                                            {{ date($user.Profile.birthday.timeStamp, $user.Profile.birthday.format) }}
                                            <xf:if is="$user.Profile.birthday.age">
                                                {{ parens(phrase('age:') . ' ' . {$user.Profile.birthday.age}) }}
                                        </xf:if>
                                    </xf:if>
                                </xf:contentcheck>
                                </dd>
                            </dl>
                        </div>
                    </xf:if>
Шаблон: member_view
Ключ: Придумайте
Найти:
HTML:
<xf:userblurb user="$user" tag="div" class="memberHeader-blurb" />
Заменить:
HTML:
                        <div class="memberHeader-blurb">
                                <xf:usertitle user="$user" />
                                <xf:if is="$user.Profile.location">
                                    <span role="presentation" aria-hidden="true">&middot;</span>
                                    <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>
                            </xf:if>
                        </div>
                    
                    
                            <xf:if contentcheck="true">
                                <div class="memberHeader-blurb">
                                    <dl class="pairs pairs--inline">
                                        <dt>{{ phrase('age') }}</dt>
                                        <dd>
                                            <xf:contentcheck>
                                                <xf:if is="$user.Profile.birthday.timeStamp">
                                                    {{ date($user.Profile.birthday.timeStamp, $user.Profile.birthday.format) }}
                                                    <xf:if is="$user.Profile.birthday.age">
                                                        {{ parens(phrase('age:') . ' ' . {$user.Profile.birthday.age}) }}
                                                    </xf:if>
                                                </xf:if>
                                            </xf:contentcheck>
                                        </dd>
                                    </dl>
                                </div>
                            </xf:if>
 
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу