• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Local Time on "Information Tab"

Syndol 2.0

Active member
#2
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.
 
#3
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!