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

how to switch off TIMEZONE at Register-page ?

erich37

Well-known member
#1
I would like to remove the field "Timezone" from the registration-page (domain.com/register) as this is confusing my users during the registration-process.

Is there any way to remove this field from the register-page ?


Thanks,
 

Lawrence

Well-known member
#2
Appearance -> Templates -> Your Style -> register_form

Find:

Code:
    <dl class="ctrlUnit">
        <dt><label for="ctrl_timezone">{xen:phrase time_zone}:</label></dt>
        <dd>
            <select name="timezone" class="textCtrl {xenif $fields.timezoneAuto, 'AutoTimeZone'} OptOut" id="ctrl_timezone">
                <xen:foreach loop="$timeZones" key="$identifier" value="$name">
                    <option value="{$identifier}" {xen:selected "{$identifier} == {$fields.timezone}"}>{$name}</option>
                </xen:foreach>
            </select>
        </dd>
    </dl>
and replace with this:

Code:
<xen:comment>
    <dl class="ctrlUnit">
        <dt><label for="ctrl_timezone">{xen:phrase time_zone}:</label></dt>
        <dd>
            <select name="timezone" class="textCtrl {xenif $fields.timezoneAuto, 'AutoTimeZone'} OptOut" id="ctrl_timezone">
                <xen:foreach loop="$timeZones" key="$identifier" value="$name">
                    <option value="{$identifier}" {xen:selected "{$identifier} == {$fields.timezone}"}>{$name}</option>
                </xen:foreach>
            </select>
        </dd>
    </dl>
</xen:comment>
 

Kier

XenForo Developer
Staff member
#3
I'd suggest not actually removing it, but rather making it a hidden option.

After making the template edit that Lawrence posted, add the following to set Central European Time:
HTML:
<input type="hidden" name="timezone" value="Europe/Amsterdam" />
 
R

ragtek

Guest
#4
If there is no timezone set, the datamananger sets the default one, which is already europe/london
PHP:
'timezone'
					=> array('type' => self::TYPE_STRING, 'default' => 'Europe/London', 'maxLength' => 50),
Wouldn't this be the same?
Just to know for the feature ^^
 

Jake Bunce

XenForo moderator
Staff member
#5
If there is no timezone set, the datamananger sets the default one, which is already europe/london
PHP:
'timezone'
					=> array('type' => self::TYPE_STRING, 'default' => 'Europe/London', 'maxLength' => 50),
Wouldn't this be the same?
Just to know for the feature ^^
I just tested this. If the timezone field is completely removed from the registration form then the resulting registration has no timezone set at all (xf_user.timezone is empty).

I like Kier's suggestion to make it a hidden field.
 
R

ragtek

Guest
#6
I just tested this. If the timezone field is completely removed from the registration form then the resulting registration has no timezone set at all (xf_user.timezone is empty).

I like Kier's suggestion to make it a hidden field.
thx
 

erich37

Well-known member
#7
well, I do have a Forum which is targeted to people from the country of Germany only, so I would need the CET-time-zone only.
My users are people over the age of 50 and I do not want to bother them with time-zone-settings (which is more or less in english language) at the Register-page already.

Kier, is there any chance you can make an option in ACP in order to remove the TimeZone-field from the Register-page ?
I mean: like having a Checkbox in ACP which I can use to switch this field off from appearing at the Sign-up-Page ? Have it activated as per default, but having the option to switch it off ?

I do not want to remove the time-settings, just hide it from the Register-page when new members are signing-up the first time. They can adjust their time-settings at a later stage as well......

Thanks,
 

erich37

Well-known member
#9
mahhhh... I do not want to mess around in code.
I think the time-settings are a bit disturbing to have at the register-page.....for some specific niche Forums at least....
 

markku

Well-known member
#10
I'd suggest not actually removing it, but rather making it a hidden option.

After making the template edit that Lawrence posted, add the following to set Central European Time:
HTML:
<input type="hidden" name="timezone" value="Europe/Amsterdam" />
Where do I put that code?

Should I put it somewhere in the register_form template, like this:

HTML:
<xen:comment>
    <dl class="ctrlUnit">
        <dt><label for="ctrl_timezone">{xen:phrase time_zone}:</label></dt>
        <dd>
            <select name="timezone" class="textCtrl {xenif $fields.timezoneAuto, 'AutoTimeZone'} OptOut" id="ctrl_timezone">
                <xen:foreach loop="$timeZones" key="$identifier" value="$name">
                    <option value="{$identifier}" {xen:selected "{$identifier} == {$fields.timezone}"}>{$name}</option>
                </xen:foreach>
            </select>

<input type="hidden" name="timezone" value="Europe/Amsterdam" />        </dd>
    </dl>
</xen:comment>
 

Jake Bunce

XenForo moderator
Staff member
#12
Where do I put that code?

Should I put it somewhere in the register_form template, like this:

HTML:
<xen:comment>
    <dl class="ctrlUnit">
        <dt><label for="ctrl_timezone">{xen:phrase time_zone}:</label></dt>
        <dd>
            <select name="timezone" class="textCtrl {xenif $fields.timezoneAuto, 'AutoTimeZone'} OptOut" id="ctrl_timezone">
                <xen:foreach loop="$timeZones" key="$identifier" value="$name">
                    <option value="{$identifier}" {xen:selected "{$identifier} == {$fields.timezone}"}>{$name}</option>
                </xen:foreach>
            </select>

<input type="hidden" name="timezone" value="Europe/Amsterdam" />        </dd>
    </dl>
</xen:comment>
Put it after the commented code, like this:

Code:
	<xen:comment>
	<dl class="ctrlUnit">
		<dt><label for="ctrl_timezone">{xen:phrase time_zone}:</label></dt>
		<dd>
			<select name="timezone" class="textCtrl {xenif $fields.timezoneAuto, 'AutoTimeZone'} OptOut" id="ctrl_timezone">
				<xen:foreach loop="$timeZones" key="$identifier" value="$name">
					<option value="{$identifier}" {xen:selected "{$identifier} == {$fields.timezone}"}>{$name}</option>
				</xen:foreach>
			</select>
		</dd>
	</dl>
	</xen:comment>

	<input type="hidden" name="timezone" value="Europe/Amsterdam" />