1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-08 09:24:25 +03:00
ifhub.club/application/frontend/components/user/blocks/block.user-photo.tpl

37 lines
1.4 KiB
Smarty
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{**
* Блок с фотографией пользователя в профиле
*}
{capture 'block_content'}
{$session = $oUserProfile->getSession()}
{* Статус онлайн\оффлайн *}
{if $session}
{if $oUserProfile->isOnline() && $smarty.now - strtotime($session->getDateLast()) < 60*5}
<div class="user-status user-status--online">{$aLang.user.status.online}</div>
{else}
<div class="user-status user-status--offline">
{$date = {date_format date=$session->getDateLast() hours_back="12" minutes_back="60" day_back="8" now="60*5" day="day H:i" format="j F в G:i"}|lower}
{if $oUserProfile->getProfileSex() != 'woman'}
{lang 'user.status.was_online_male' date=$date}
{else}
{lang 'user.status.was_online_female' date=$date}
{/if}
</div>
{/if}
{/if}
{component 'photo'
classes = 'js-user-photo'
hasPhoto = $oUserProfile->getProfileFoto()
editable = $oUserProfile->isAllowEdit()
targetId = $oUserProfile->getId()
url = $oUserProfile->getUserWebPath()
photoPath = $oUserProfile->getProfileFotoPath()
photoAltText = $oUserProfile->getDisplayName()}
{/capture}
{component 'block'
mods = 'user-photo'
content = $smarty.capture.block_content}