1. 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 ?

Discussion in 'Troubleshooting and Problems' started by erich37, Dec 9, 2010.

  1. erich37

    erich37 Well-Known Member

    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,
     
  2. Lawrence

    Lawrence Well-Known Member

    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>
     
    Lnqtm likes this.
  3. Kier

    Kier XenForo Developer Staff Member

    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" />
     
    Lnqtm, krstep and Lawrence like this.
  4. ragtek

    ragtek Guest

    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 ^^
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
     
  6. ragtek

    ragtek Guest

    thx
     
  7. erich37

    erich37 Well-Known Member

    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,
     
  8. Kier

    Kier XenForo Developer Staff Member

    Doesn't the template edit achieve that?
     
  9. erich37

    erich37 Well-Known Member

    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....
     
  10. markku

    markku Well-Known Member

    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>
    
     
  11. James

    James Well-Known Member

    You could apply the template edit and then create an option for it in the ACP...
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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" />
    
     
    nttruong, Lnqtm and markku like this.

Share This Page