Local Time on "Information Tab"

I would like an addon which displays their local time on the profile tab like this:

22d54356194f4404804783e89cbd949c.png


Thanks.
 
Here is the information you need to achieve what you want. Should be easy enough to convert it into an add-on if you so desire.

Open file library/XenForo/ControllerPublic/Member.php
Find the function actionMember()
At the bottom of that function locate the line:
PHP:
return $this->responseView('XenForo_ViewPublic_Member_View', 'member_view', $viewParams);

Right above that insert:
PHP:
if (isset($user['timezone']))
{
    $viewParams['userTimeZone'] = XenForo_Helper_TimeZone::getTimeZones()[$user['timezone']] . ' | ' . XenForo_Locale::time(
                    XenForo_Application::$time, 'absolute', (isset($visitor['language']) ? $visitor['language'] : null),
                    $user['timezone']);
}

In the Admin Control Panel open the template member_view
Locate the line:
HTML:
<xen:if is="{$user.occupation}">
    <dl><dt>{xen:phrase occupation}:</dt> <dd>{xen:string censor, $user.occupation}</dd></dl>
</xen:if>

Right underneath that insert:
HTML:
<xen:if is="{$userTimeZone}">
    <dl><dt>{xen:phrase time_zone}:</dt> <dd>{$userTimeZone}</dd></dl>
</xen:if>

Now go to a user's profile page and under the Information tab you should see their time zone and current local time.
 
Here is the information you need to achieve what you want. Should be easy enough to convert it into an add-on if you so desire.

Open file library/XenForo/ControllerPublic/Member.php
Find the function actionMember()
At the bottom of that function locate the line:
PHP:
return $this->responseView('XenForo_ViewPublic_Member_View', 'member_view', $viewParams);

Right above that insert:
PHP:
if (isset($user['timezone']))
{
    $viewParams['userTimeZone'] = XenForo_Helper_TimeZone::getTimeZones()[$user['timezone']] . ' | ' . XenForo_Locale::time(
                    XenForo_Application::$time, 'absolute', (isset($visitor['language']) ? $visitor['language'] : null),
                    $user['timezone']);
}

In the Admin Control Panel open the template member_view
Locate the line:
HTML:
<xen:if is="{$user.occupation}">
    <dl><dt>{xen:phrase occupation}:</dt> <dd>{xen:string censor, $user.occupation}</dd></dl>
</xen:if>

Right underneath that insert:
HTML:
<xen:if is="{$userTimeZone}">
    <dl><dt>{xen:phrase time_zone}:</dt> <dd>{$userTimeZone}</dd></dl>
</xen:if>

Now go to a user's profile page and under the Information tab you should see their time zone and current local time.
Thanks!
 
Top Bottom