Meeting Mod and Timezone

Allgemeiner Support zum phpBB 2 Board und phpBB 2 Modifikationen
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Antworten
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Meeting Mod and Timezone

Beitrag von Earthkeeper »

The meeting hack is working very good, except the time is messed up. It seems that
the mod does not include the timezone in its calculation. That's why I'm seeing the server
time instead of my time.

Is there a fix for this?
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

On entering the time, the board-timezone will be used because on displaying a meeting the user timezone will be coded.
There must one base for the time and the board timezone is the best base for it...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

hmm... Since my timezone is 15 hours faster than the server time, it is really
confusing to use the mod. If I set the meeting time at 12:00PM, when I look
at the list, it shows the next day at 3AM.

I don't have this problem with the delayed topic mod and also the calendar
mod. I'm sure this is a usability issue.

I think you can add the user's timezone variable to the time input. Sorry I'm
not proficient with codes but it makes sense that way, isn't it?
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

The timezone is used to create the right timestamp, so please check your board- and user-settings.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

oxpus hat geschrieben:The timezone is used to create the right timestamp, so please check your board- and user-settings.
Thank you for your reply. You mean the error lies in my timezone settings -
either the board system time setting or the user time setting.

I've checked and both of the board time and user time is set to the correct
timezone. Now my time is 13:00 but when I go to add a meeting, it initially
displays it as "yesterday at 22:00". It seems to me that it is displaying the
time of the web server instead of using the board or user timezone setting.

Try setting your system board to GMT+7 and see what I mean. Sorry for
being persistent, but it really bugs me. ;)
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Okay, try this:

Code: Alles auswählen

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_meeting.php

#
#-----[ FIND ]------------------------------------------
#
	$meeting_time = strtotime($m_year.'-'.$m_month.'-'.$m_day.' '.$m_hour.':'.$m_minute.':00');
	$meeting_until = strtotime($u_year.'-'.$u_month.'-'.$u_day.' '.$u_hour.':'.$u_minute.':00');

#
#-----[ REPLACE WITH ]------------------------------------------
#
	$meeting_time = strtotime($m_year.'-'.$m_month.'-'.$m_day.' '.$m_hour.':'.$m_minute.':00') + ($board_config['board_timezone'] * 3600);
	$meeting_until = strtotime($u_year.'-'.$u_month.'-'.$u_day.' '.$u_hour.':'.$u_minute.':00') + ($board_config['board_timezone'] * 3600);

#
#-----[ FIND ]------------------------------------------
#
	$mday = date('d', $meeting_time);
	$mmonth = date('m', $meeting_time);
	$mhour = date('H', $meeting_time);
	$mminute = date('i', $meeting_time);

	$uday = date('d', $meeting_until);
	$umonth = date('m', $meeting_until);
	$uhour = date('H', $meeting_until);
	$uminute = date('i', $meeting_until);

	$m_year = date('Y', $meeting_time);
	$u_year = date('Y', $meeting_until);

#
#-----[ REPLACE WITH ]------------------------------------------
#
	$mday = create_date('d', $meeting_time, $board_config['board_timezone']);
	$mmonth = create_date('m', $meeting_time, $board_config['board_timezone']);
	$mhour = create_date('H', $meeting_time, $board_config['board_timezone']);
	$mminute = create_date('i', $meeting_time, $board_config['board_timezone']);

	$uday = create_date('d', $meeting_until, $board_config['board_timezone']);
	$umonth = create_date('m', $meeting_until, $board_config['board_timezone']);
	$uhour = create_date('H', $meeting_until, $board_config['board_timezone']);
	$uminute = create_date('i', $meeting_until, $board_config['board_timezone']);

	$m_year = create_date('Y', $meeting_time, $board_config['board_timezone']);
	$u_year = create_date('Y', $meeting_until, $board_config['board_timezone']);


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
I also fix the mod...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

Hmm... It is not working yet.

When adding, the date and time displayed correctly but once submited it is
still not showing the correct time.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

And if you change in admin_MEeting.php

Code: Alles auswählen

#    $meeting_time = strtotime($m_year.'-'.$m_month.'-'.$m_day.' '.$m_hour.':'.$m_minute.':00') + ($board_config['board_timezone'] * 3600);
#    $meeting_until = strtotime($u_year.'-'.$u_month.'-'.$u_day.' '.$u_hour.':'.$u_minute.':00') + ($board_config['board_timezone'] * 3600); 
into this?

Code: Alles auswählen

#    $meeting_time = strtotime($m_year.'-'.$m_month.'-'.$m_day.' '.$m_hour.':'.$m_minute.':00') + ($userdata['user_timezone'] * 3600);
#    $meeting_until = strtotime($u_year.'-'.$u_month.'-'.$u_day.' '.$u_hour.':'.$u_minute.':00') + ($userdata['user_timezone'] * 3600); 
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

Still not working. Since my board timezone and user timezone is the same,
it gives the same time. There must be somewhere else that needs to be changed...

Before using the above, I got 15hours faster time. Now I get 22 hours faster.
meeting_until = strtotime($u_year.'-'.$u_month.'-'.$u_day.' '.$u_hour.':'.$u_minute.':00') + ($userdata['user_timezone'] * 3600);
From this, you're only using the server time + user timezone (which in my case is GMT+7).
I think you need to know what timezone the server time is, then calculate from there.
Zuletzt geändert von Earthkeeper am Fr 21.Jan, 2005 18:47, insgesamt 1-mal geändert.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

I guess it's because
it adds the GMT+7 into the time as well.
Where?
The only time the mod will add are the seconds * 3600 for each timezone-hour setting on the user profiles. On saving and on displaying...

Wait, I'll testing it again with GMT + 7 and different timezones for board and user.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

From this, you're only using the Server time + user timezone (which in my case is GMT+7).
I think you need to know what timezone the Server time is, then calculate from there.
Wrong. The time at this point will be created from the entered values on the ACP form and the timezone of the user will be added.
Try this lines (the original ones):

Code: Alles auswählen

$meeting_time = strtotime($m_year.'-'.$m_month.'-'.$m_day.' '.$m_hour.':'.$m_minute.':00');
$meeting_until = strtotime($u_year.'-'.$u_month.'-'.$u_day.' '.$u_hour.':'.$u_minute.':00');
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

Before changing back to the original one above, I tried clicking edit, do not change anything, and then click submit.

Since I did not change anything, the time ahown on the meeting list should stays the same. But this is not so. The time shown got added into it again. And now it is even more into the future.
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

Okay, I've changed it back. Now it is back to 15 hours ahead of time.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Now I tried it out with different timezones and delete each formatting based on them.
The times on ACP will be saved as they are entered and also displayed at the same timezone.
No user or board timezone will change the times now.

The mod itself will be updated in less minutes.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

The time on the meeting list is now correct for both admin and user.

But in admin, when adding a new meeting, the initial time is not correct.
Please add this to your changes:

Code: Alles auswählen

# 
#-----[ FIND ]------------------------------------------ 
# 
	$mday = create_date('d', $meeting_time, 0);
	$mmonth = create_date('m', $meeting_time, 0);
	$mhour = create_date('H', $meeting_time, 0);
	$mminute = create_date('i', $meeting_time, 0);

	$uday = create_date('d', $meeting_until, 0);
	$umonth = create_date('m', $meeting_until, 0);
	$uhour = create_date('H', $meeting_until, 0);
	$uminute = create_date('i', $meeting_until, 0);

	$m_year = create_date('Y', $meeting_time, 0);
	$u_year = create_date('Y', $meeting_until, 0);

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
	$mday = create_date('d', $meeting_time, $board_config['board_timezone']); 
	$mmonth = create_date('m', $meeting_time, $board_config['board_timezone']); 
	$mhour = create_date('H', $meeting_time, $board_config['board_timezone']); 
	$mminute = create_date('i', $meeting_time, $board_config['board_timezone']); 

	$uday = create_date('d', $meeting_until, $board_config['board_timezone']); 
	$umonth = create_date('m', $meeting_until, $board_config['board_timezone']); 
	$uhour = create_date('H', $meeting_until, $board_config['board_timezone']); 
	$uminute = create_date('i', $meeting_until, $board_config['board_timezone']); 

	$m_year = create_date('Y', $meeting_time, $board_config['board_timezone']); 
	$u_year = create_date('Y', $meeting_until, $board_config['board_timezone']); 
It works now, thanks :)
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

Just for testing, I logged in as a user and change my user timezone to
GMT+8. I'm expecting the time of the meeting list to change to GMT+8 as
well. But it seems that it stays the same. Is this supposed to happen?
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Do not change anything on the files!
I already have tested the new files with several timezone settings (board and/or user).

The current mod release will now work with the timezone from the "meeting point", so no timezone, board neither user, will play a role for it.
This is the only real way (I now knew) to handle times without timezones.

Adding the board timezone die editing the timezone will destroy this workflow.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

Okay thanks. I've reverted back to your files.

This isn't too bad actually, I'll just re-adjust the time shown when adding new
meeting. It's just a few clicks more.

But the problem with this in still there. Any idea?
Just for testing, I logged in as a user and change my user timezone to
GMT+8. I'm expecting the time of the meeting list to change to GMT+8 as
well. But it seems that it stays the same. Is this supposed to happen?
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

That's what I said:
The time will alltimes be the same, because it's the time which exists at the meeting point.

For example:
You will meet an user in New York on 10am and your timezone is GMT+8.
When will this meeting be? At 10am or 6pm? ;)
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

oxpus hat geschrieben:That's what I said:
The time will alltimes be the same, because it's the time which exists at the meeting point.

For example:
You will meet an user in New York on 10am and your timezone is GMT+8.
When will this meeting be? At 10am or 6pm? ;)
Hmm... that makes sense.
But I'm thinking something else :P

I frequently appoint a chat meeting with the board staff at the chat room.
So the time this time is the time of the web site, which will be different
for each user based on their timezone setting.

That's why I'm asking. :)
Maybe you should add an "Online" or "offline" meeting option to solve this.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

:eek:
The meeting mod was not create to combine different timezones :(
There should only be exist a tool to bring user together in the real world...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
Earthkeeper
Beiträge: 12
Registriert: Mi 19.Jan, 2005 08:40

Beitrag von Earthkeeper »

No Problem. It is working pretty good now. I can always specify the location
as "Chat room 4 (GMT+7 Time)". ;)

Thank you again.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Yes, the best way to avoid missunderstandings.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Antworten