[MODDB] Advanced time management 2.0.1

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
User avatar
-=ET=-
Registered User
Posts: 745
Joined: Sun May 25, 2003 5:32 pm

[MODDB] Advanced time management 2.0.1

Post by -=ET=- » Wed Jul 02, 2003 5:35 pm

Here is the last version of my MOD (2.0.6/EasyMOD compliant) :)

:arrow: Download : click here
:arrow: Language provided : English/French/German/Spanish/Italian
:arrow: Upgrades provided : From the 1.0.x/1.1.0/1.1.1/2.0.0 RC1/2.0.0 releases

Code: Select all

############################################################## 
## MOD Title:          Advanced time management
## MOD Author:         -=ET=- < space_et AT tiscali DOT fr > (n/a) http://www.golfexpert.net/phpbb
## MOD Description:    This MOD allow the board administrator(s)
##                     and each user to manage the time displayed
##                     on the board.
##                     They can...
##                     - set the DST time lag of their state/country
##                     - enable/disable manually the DST
##                     - just synchronize DST switches with the server ones
##                     - fully use the server local time
##                     - fully use the server UTC time & the user's computer settings
##                     - fully use the user's computer local time
## MOD Version:        2.0.1
## Compatibility:      2.0.5->2.0.6 (prior release not tested)
##
## Installation Level: Intermediate
## Installation Time:  15 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit:      15
##      admin/admin_board.php
##      admin/admin_users.php
##      includes/functions.php
##      includes/functions_selects.php
##      includes/page_header.php
##      includes/usercp_avatar.php 
##      includes/usercp_register.php
##      templates/subSilver/formIE.css
##      templates/subSilver/overall_header.tpl
##      templates/subSilver/profile_add_body.tpl
##      templates/subSilver/simple_header.tpl
##      templates/subSilver/subSilver.css
##      templates/subSilver/admin/board_config_body.tpl
##      templates/subSilver/admin/page_header.tpl
##      templates/subSilver/admin/user_edit_body.tpl
##
## Included Files:     7
##      adv_time_db_update.php
##      root/includes/pc_time_data.php
##      root/language/lang_english/lang_adv_time.php 
##      root/language/lang_french/lang_adv_time.php
##      root/language/lang_german/lang_adv_time.php 
##      root/language/lang_italian/lang_adv_time.php
##      root/language/lang_spanish/lang_adv_time.php
##
############################################################## 
## MOD History: 
## 
##   2003-12-06 - Version 2.0.1
##      - $lang['server_pc_mode'] language entry modified
##      - Add a language_change_log.txt file in the archive
##      - Italian translation improved
##      - For the language file include(), the code now test if the
##        translation file exist and otherwise use the English file.
##      - Comments has been add in every FIND instruction on part of code
##        line(s) to help identifying those lines in manual installations
##
##   2003-11-07 - Version 2.0.0
##      - Fix: modes choices alignment in ACP with IE
##      - Fix: little height space inserted on the index page when 1st seen
##      - Fix: error message on 5th & 6th mode with GZip compression enabled
##      - Instructions rewrite for adv_time_db_update.php use
##      - MOD now provide with German, Italian and Spanish translations
##
##   2003-09-30 - Version 2.0.0 Release Candidate 1
##      - MOD rename from DST time management to Advanced time management
##      - A new user's computer time mode has been add
##      - The 2 old modes using the server UTC time & the user's
##        computer settings have been merge in a new one which
##        does not need a cookie or a page reload anymore
##      - In user's profile, the default board mode is now bring to the fore by an "*"
##      - Replace "GMT" by "UTC" in timezone drop down lists
##      - Fix: modes choices alignment with Mozilla
##
##   2003-08-21 - Version 1.1.1
##      - Fix reload not executed for the 5th mode with Mozilla
##      - Minor improvements to be fully W3C compliant
##        (in session management & form attributes)
##      - Change the 5th mode information message on the index page
##      - dst_db_update.php updated to ask to delete it after use
##
##   2003-08-17 - Version 1.1.0
##      - Add the ability to set a default dst mode and a default
##        dst time lag for anonymous users and new accounts
##      - Replace "GMT" by "UTC" in the time status line as the "GMT"
##        time is not the official universal time anymore since 1985
##      - Several improvements in page_header.php & overall_header.tpl
##        for the 5th mode
##
##   2003-08-05 - Version 1.0.1
##      - Fix a minor issue in an input attribute of overall_header.tpl
##      - Update "Author notes" for EasyMOD 0.0.10a
##      - Release confirmed as phpBB 2.0.6 compliant (no change needed)
##
##   2003-07-12 - Version 1.0.0
##      - Initial final release
##      - Beta & RC releases are not supported anymore
##        (no update available - reinstall the MOD)
##
##   2003-07-12 - Version 0.4.2 - Release candidate 4c
##      - The MOD can now be installed by EasyMOD 0.0.9c
##        of Nutzzy (but is not yet an officially EasyMOD
##        Compliant MOD)!
##
##   2003-07-09 - Version 0.4.1 - Release candidate 4b
##      - Fix: correct the DST modes choice alignment
##      - Reduce DST time lag field width
##      - Minor messages update
##
##   2003-07-09 - Version 0.4.0 - Release candidate 4
##      - Minor messages update
##      - Add 2 news modes and rename all 5 modes
##
##   2003-07-08 - Version 0.3.0 - Release candidate 3
##      - Add specific time information messages on index page
##      - PC synchro mode does not use cookies anymore
##
##   2003-07-04 - Version 0.2.1 - Release candidate 2
##      - Modify Server synchro mode to be fully synchronized
##      - Minor messages update
##      - Fix: messages not displayed
##
##   2003-07-02 - Version 0.2.0 - Release candidate 1
##      - Add DST time lag validity control
##      - Add PC synchro mode
##
##   2003-06-26 - Version 0.1.0 - Initial beta release
##      - No DST time lag validity control
##      - No PC synchro mode
##
##############################################################

Just some little explanation for every one about how this MOD works.

First, it will add 2 new fields in each user's profile and in the ACP: "Time management mode" and "DST time lag"
Image
Note : the DST time lag is often 1h but sometimes it can be 1/2h or other values. That's why this field exists.

And next, forums admins and users will have the choice between 5 modes:

o Manual settings - DST Enabled/Disabled

Code: Select all

                      -----------------------
                     | phpBB |Server |  P C  |
---------------------|-----------------------|
|UTC time            |       |   x   |       |
|Timezone            |   x   |       |       |
|DST switches        |   x   |       |       |
|DST time lag value  |   x   |       |       |
---------------------------------------------
This choices allows users to enable/disable manually Daylight Saving Time.
This mode is the basic one, but it will ALWAYS work; in any circumstances.

FYI, these 2 choices will be merge in an unique "Manual settings" for phpBB 2.2 as this release will manage DST manually in user's profiles.

o DST switches synchronized with the server

Code: Select all

                      -----------------------
                     | phpBB |Server |  P C  |
---------------------|-----------------------|
|UTC time            |       |   x   |       |
|Timezone            |   x   |       |       |
|DST switches        |       |   x   |       |
|DST time lag value  |   x   |       |       |
---------------------------------------------
This option will use the DST host server flag to switch between normal time and summer time, but time zone and DST time lag used are the user's profile ones.
But be careful, to make this mode work correctly the host server must switch at the same date as you in your state.

o Times synchronized with the server local time

Code: Select all

                      -----------------------
                     | phpBB |Server |  P C  |
---------------------|-----------------------|
|UTC time            |       |   x   |       |
|Timezone            |       |   x   |       |
|DST switches        |       |   x   |       |
|DST time lag value  |       |   x   |       |
---------------------------------------------
This option will use the host server local time (and them it's UTC time, time zone, DST time lag setting and DST on/off setting). Time zone and DST time lag in user's profile are not used anymore with this mode.
But be careful, to make this mode work correctly your host server must be in the same state/country (same DST switch dates and same time zone).

o Times synchronized with the server universal time, timezone and DST with your computer settings

Code: Select all

                      -----------------------
                     | phpBB |Server |  P C  |
---------------------|-----------------------|
|UTC time            |       |   x   |       |
|Timezone            |       |       |   x   |
|DST switches        |       |       |   x   |
|DST time lag value  |       |       |   x   |
---------------------------------------------
This mode is the one I recommend :-)
The whole time lag is automatically managed by the code (time zone & DST time lag set in the phpBB profile are not used).
This mode use the UTC server time and add the PC time lag (DST+time zone). This is because the server time is often most precise than PC one, but the time lag set on the PC is always the good one.
With this mode, you can be on holydays or on business travel in a foreign country and consult your favorite phpBB forum without any time problem; it will be correctly adapt the time with the time lag of the PC you will use in the foreign country :)
For this mode, the JavaScript date/time functions must be enable on the navigator used.

o Times synchronized with your computer time

Code: Select all

                      -----------------------
                     | phpBB |Server |  P C  |
---------------------|-----------------------|
|UTC time            |       |       |   x   |
|Timezone            |       |       |   x   |
|DST switches        |       |       |   x   |
|DST time lag value  |       |       |   x   |
---------------------------------------------
This mode is the same as the previous one but the computer UTC time is used instead of the server one.
It has all the advantages of the previous one except that the time of a personal computer is often less accurate than a server one.


I don't know if all my explanation were clear (I try to do my best in English), but if you have any question, feel free to ask me.
Any comments will be appreciate too :wink:


------------------
Other MODs/topics on the subject :

[FIX] Daylight Saving Time
Which is similar to my 3rd mode without the user DST time lag setting and the choice users individually have to apply this time correction or not.
But, it's much more easy to install :wink:

[dev] DST/Summer Time V1.0 BETA
Which has 2 modes :
- one similar to my first one (manual mode),
- and a second one which needs for each users to know and set the DST dates/times switches for their state/country. Not easy and it will not work to set a correct time if you are travelling in a foreign country :roll:
This MOD allow to set default settings.

Daylight Savings Time (DST) V1.1.0
Which has only 1 mode, the manual one (the same as my 1st one and the one which will be on phpBB 2.2).

Daytime changer summertime / wintertime V1.0.0 BETA
Which has a really strange approach, because it can only switch from DST to normal time (and vice versa) for the whole board (regardless each user's real need), use a fixed DST time lag of 1h (can not be modify), and apply this offset at fixed date each year :(
But that's NOT the correct dates for 99,99% of the countries in the world :(
http://www.timeanddate.com/time/dst2003a.html
http://www.timeanddate.com/worldclock/full.html
Last edited by -=ET=- on Tue Jan 13, 2004 1:32 am, edited 61 times in total.
Eternal newbie

sangoku_51
Registered User
Posts: 105
Joined: Mon Aug 26, 2002 9:36 am
Contact:

Post by sangoku_51 » Wed Jul 02, 2003 7:57 pm

Hi good Job ;)
(vdemeester on dvp.com ;))
FwImpact.net : Web Design Project !!
Avatars, ranks, etc....
ProgOtoP.com

User avatar
-=ET=-
Registered User
Posts: 745
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- » Wed Jul 02, 2003 8:39 pm

Edited - information moved in the first post :wink:
Last edited by -=ET=- on Wed Jul 09, 2003 8:41 am, edited 5 times in total.
Eternal newbie

FX
Registered User
Posts: 254
Joined: Thu Aug 01, 2002 9:29 pm
Location: France
Contact:

Post by FX » Wed Jul 02, 2003 9:27 pm

good job (malgré les remarques de loufoque sur 2037) 8)

User avatar
-=ET=-
Registered User
Posts: 745
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- » Wed Jul 02, 2003 10:16 pm

I've just find a limitation :roll:

The third mode use a session cookie to pass the JavaScript result to the create_date function in includes/functions.php, but phpBB users may not authorized all cookies (including session cookies - not stored on the harddisk) :(
This is very rare to disable session cookies but in this case there is a problem.

Then I must try to adapt this part to use a form instead of the cookie.
The curent code is...

Code: Select all

<script>
pc_date = new Date(); 
document.cookie = "pc_time_offset=" + pc_date.getTimezoneOffset();
</script>
...just before </head> in templates/subSilver/overall_header.php

So, if anyone know how to send the JavaScript getTimezoneOffset() result to a php variable (not using urls or cookies), I'm interrested :roll:

Thanks :)
Last edited by -=ET=- on Fri Jul 04, 2003 9:37 am, edited 3 times in total.
Eternal newbie

inque187
Registered User
Posts: 94
Joined: Sat Jun 29, 2002 9:17 am
Contact:

Post by inque187 » Thu Jul 03, 2003 11:29 pm

Check the www.php.net website for the functions list. I'm sure it's there.

Also PHP 5.0.0 Beta is out! W00T!

dx infernal
Registered User
Posts: 11
Joined: Fri Jul 04, 2003 1:51 am

Post by dx infernal » Fri Jul 04, 2003 2:14 am

um... i installed your mod, and it didnt work too well... o well. *phew* good thing i back up all my files before every mod!

User avatar
-=ET=-
Registered User
Posts: 745
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- » Fri Jul 04, 2003 7:37 am

dx infernal wrote: um... i installed your mod, and it didnt work too well... o well. *phew* good thing i back up all my files before every mod!

Tel me why it didn't work? I have already some users who have install it without any problem :roll:

It didn't work because...
- You had a pb with the db update file (have you done the update, it was OK?)?
- You have a pb to set your choice in your profile (choice not stored?)?
- You have an error message (which one)?
- It didn't correct your time (with which mode)?
- Etc.

I didn't say it's a final release, so please tell me more if you want me to correct what you think it can be an issue... :roll:

Anyone else have install it here?
Eternal newbie

User avatar
-=ET=-
Registered User
Posts: 745
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- » Fri Jul 04, 2003 8:59 am

Oops, I have just re-install my MOD and find a little mistake : previously my languages entries was called 'DST_xxxxxxxxx' but in the 0.2.x release I update them in 'dst_xxxxxxxxx' (lower case) in the language files but not in the install instructions.

In admin/admin_users.php & includes/usercp_register.php, it was not...

Code: Select all

# 
#-----[ AFTER, ADD ]---------------------------------------------- 
# 
// Start add - DST management MOD
'L_DST_MODE' => $lang['DST_mode'],
'L_DST_MODE_TEXT' => $lang['DST_mode_text'],
'L_DST_MODE_NO' => $lang['DST_mode_no'],
'L_DST_MODE_YES' => $lang['DST_mode_yes'],
'L_DST_MODE_SERVER' => $lang['DST_mode_server'],
'L_DST_MODE_PC' => $lang['DST_mode_pc'],
'L_DST_TIME_LAG' => $lang['DST_time_lag'],
'L_DST_TIME_LAG_TEXT' => $lang['DST_time_lag_text'],
// End add - DST management MOD
But...

Code: Select all

# 
#-----[ AFTER, ADD ]---------------------------------------------- 
# 
// Start add - DST management MOD
'L_DST_MODE' => $lang['dst_mode'],
'L_DST_MODE_TEXT' => $lang['dst_mode_text'],
'L_DST_MODE_NO' => $lang['dst_mode_no'],
'L_DST_MODE_YES' => $lang['dst_mode_yes'],
'L_DST_MODE_SERVER' => $lang['dst_mode_server'],
'L_DST_MODE_PC' => $lang['dst_mode_pc'],
'L_DST_TIME_LAG' => $lang['dst_time_lag'],
'L_DST_TIME_LAG_TEXT' => $lang['dst_time_lag_text'],
// End add - DST management MOD
I think this is the error you find : the messages wasn't displayed :roll:

Sorry about that :(

I have already update the install instruction for download in an RC2 release with other minor messages modifications, and change the "server synchro" mode to be fully automatic (don't use anymore the phpBB time zone & the new DST time lag value) :)

P.S.: for the rest of the MOD I have find no error and it works well (even with no messages displayed lol :wink: ).
Eternal newbie

User avatar
-=ET=-
Registered User
Posts: 745
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- » Tue Jul 08, 2003 8:28 am

Up :D

Nobody else have install it ?
Eternal newbie

Godlike242
Registered User
Posts: 279
Joined: Mon Dec 16, 2002 9:29 pm
Contact:

Post by Godlike242 » Tue Jul 08, 2003 11:42 am

[edited- wrong thread]

User avatar
-=ET=-
Registered User
Posts: 745
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- » Tue Jul 08, 2003 8:49 pm

-=ET=- wrote: I've just find a limitation :roll:

Fixed!
With the new RC4 release, the MOD don't use cookies anymore if you don't want :wink:

Moreover, I add specific messages on the index page:
" - DST enabled" for the modes 1 & 2.
"All times are synchronized with the forum server" for the 3rd mode.
"All times are synchronized with your computer" for the modes 4 & 5.

Then... no one have already install it? :roll:
I need your feed back before submit it to the MODs database.
Eternal newbie

User avatar
-=ET=-
Registered User
Posts: 745
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- » Sat Jul 12, 2003 10:08 am

Here is the 0.4.2 release! :D

The MOD can now be installed by EasyMOD 0.0.9c of Nutzzy (but is not yet an officially EasyMOD Compliant MOD)!
http://phpbb.com/phpBB/viewtopic.php?t=116125

I hope this will facilitate feedbacks... :roll:
Last edited by -=ET=- on Sun Aug 17, 2003 4:15 pm, edited 3 times in total.
Eternal newbie

User avatar
-=ET=-
Registered User
Posts: 745
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- » Sat Aug 02, 2003 8:57 pm

Well...

As no one seems to have found issue nor here, nor in France (on phpBB-fr.com), I get this MOD into final release 1.0.0 :D

On this occasion, a part of the instructions have been rewrite to become more compliant with futur EMC rules (EasyMOD Compliant).

P.S. 1 : the MOD is of course EasyMOD 0.0.10a compatible (not yet EMC)
P.S. 2 : I think that this topic must now move to the "MOD Support" forum. If a moderator wants to move it...
Last edited by -=ET=- on Wed Aug 06, 2003 8:23 am, edited 1 time in total.
Eternal newbie

User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley » Sat Aug 02, 2003 9:19 pm

-=ET=- wrote: P.S. 2 : I think that this topic must now move to the "MOD Support" forum. If a moderator wants to move it...

Actually, you should submit it to the MOD Database and then it would be in the MOD Release Announcements & Support forum upon release.

Locked

Return to “[2.0.x] MODs in Development”