MyBB Community Forums

Full Version: Wrong time for new users on my forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Forum link: http://smolna13.pl

My forum is 100% properly set, but still, when a new user registers, his time is -2hrs to the proper one. 

I've tried setting random combinations of timezones and dst correction on/off in the acp configuration and still, no matter the setting the time for a newly registered user is 2hrs back. 
I've checked the database entry in settings and it seems just fine and changes properly when I set time through ACP.

Also I've checked the server time and it's also correct. 

Now I'm thinking of the plugins... maybe they messed it up? 

List of plugins that I use and might use date/time:
- Board Announcements Manager 
- Invitation Plugin
Mark Edited as Unread

Mod_Notify

ModNotice Plus

Move Posts 

MyAlerts 



I don't know when the problem started. I haven't noticed it since just 2 days ago. Last installed plugin is Boards Announcements Manager, but I doubt it's the source.



FYI: the time shown for new users is in UTC (0) my time is UTC +1 and DST in effect so to sum up - (+2).


Another weird thing is that I had to send a SQL query to fix timezones for all users as they were messed up too - many had weird time zones, when most had correct ones. 

Please help me out with this weird annoying issue.
Forum URL please.
Oh, right, sorry.

http://smolna13.pl
your forum's active theme does not have time zone setting & DST correction option on the registering page.
obviously all users are put on same time zone which was set through admin panel / registering form modification
I know that. I'm not that stupid - the time zone and DST settings set via ACP are useless to me - that;'s the problem because no matter what I chose, it won't matter.
I intentionally removed the time zone and dst settings on registration page because my forum is only for certain group of people living in the same city, so this options in the form are pointless.
Removing them might have caused the issue? I thought that the ACP settings are the parent here... Logically thinking, if I have the right settings there, then why would default time settings in registration form differ (no matter if they are avalible or not)?

If removing this part of registration page template causes the issue then I would say it's a bug, because it shouldn't matter.

Tell me if I'm wrong.

I will try readding the missing part later on. Thanks for the reply.
this guidance might help => set all users to same time zone
It is form related.

And the guide is wrong at least for myBB 1.6.13. Removing the form or commenting it out causes to register with time UTC 0 and no DST. That is a bug!!
It's really stupid that eventhough you set default timezone and DST for the forum (and new users), still the stupid form is above it all.



I fixed it myself - or did a bypass.

Removing the form or commenting it out, as I said, causes a bug - default settings set via ACP get overriden and new users register with UTC 0 / GMT 0 DST 0.


To fix that - in template member_register, you need to re-add the time settings, find the fieldset markup related to them, it looks like that in default theme:

<fieldset class="trow2">
<legend><strong><label for="timezone">{$lang->time_offset}</label></strong></legend>

And simply replace it with:

<fieldset class="trow2" style="visibility:hidden;">
<legend><strong><label for="timezone">{$lang->time_offset}</label></strong></legend>

If you have the form removed and don't know where to look for the whole code part then here it is with the modification added:

<fieldset class="trow2" style="visibility:hidden;">
<legend><strong><label for="timezone">{$lang->time_offset}</label></strong></legend>
<table cellspacing="0" cellpadding="{$theme['tablespace']}" width="100%">
<tr>
<td><span class="smalltext">{$lang->time_offset_desc}</span></td>
</tr>
<tr>
<td>{$tzselect}</td>
</tr>
<tr>
<td><span class="smalltext">{$lang->dst_correction}</span></td>
</tr>
<tr>
<td>
	<select name="dstcorrection">
		<option value="2" {$dst_auto_selected}>{$lang->dst_correction_auto}</option>
		<option value="1" {$dst_enabled_selected}>{$lang->dst_correction_enabled}</option>
		<option value="0" {$dst_disabled_selected}>{$lang->dst_correction_disabled}</option>
	</select>
</td>
</tr>
</table>
</fieldset>