where is CURRENT_TIME defined in detail?

Discussion forum for MOD Writers regarding MOD Development.
Locked
huggle
Registered User
Posts: 34
Joined: Tue Jul 28, 2009 2:30 pm

where is CURRENT_TIME defined in detail?

Post by huggle »

[note to Moderators/Admins:
this is not a MOD writer discussion. I am asking the developers where they hid a certain piece of code, hence it's - in my humble opinion - a development question]



I would like to add a second time display to the overall header, in addition to the board time as defined in the ACP.

The overall header's code refers only to a "CURRENT_TIME" and I seem to be unable to find exactly where this current time is defined in a phpBB 3.0.11's files. (I'm looking for the detailed code; the part that defines what exactly is to be considered board time.)
My idea is to add the second time by telling the board to use the current time and substract 6 hours.

(Just in case you wonder why I need a second time: I run a fan board for an actor who lives abroad and my users would like to know what time it is at his place. Atm I have an external clock displayed on the board, but I'd rather be independent of that external source and adding a second time shouldn't be that much editing. 1 line in the overall header and another wherever the board time is defined.)
And yes, I know there is a 3.0.12 but it's only 1 week old and - no offense - I'd rather wait for the first bug reports before I upgrade. You know - never change a running system and all that.
if you make it idiot-proof
someone will upgrade the idiot
User avatar
AmigoJack
Registered User
Posts: 5759
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: where is CURRENT_TIME defined in detail?

Post by AmigoJack »

huggle wrote:the board time
That doesn't exist - you refer to the server's time.
huggle wrote:defined in the ACP
By that you could only mean the format and timezone you've set for guests. All registered users can set their format and timezone independantly.
huggle wrote:CURRENT_TIME
Why not searching all files for this text? Gives me:
file \includes\functions.php:

Code: Select all

'CURRENT_TIME'                    => sprintf($user->lang['CURRENT_TIME'], $user->format_date(time(), false, true)), 
huggle wrote:an actor who lives abroad
You need to know his timezone. Or your timezone. Relative values like -6 hours are not precise enough. I.e. if the timezone of your actor is UTC -0400 then you could add this line:

Code: Select all

'CURRENT_TIME_ACTOR'=> $user-> format_date( time()- $user-> timezone- $user-> dst- 60* 60* 4, FALSE, TRUE ), 
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.
huggle
Registered User
Posts: 34
Joined: Tue Jul 28, 2009 2:30 pm

Re: where is CURRENT_TIME defined in detail?

Post by huggle »

ah, that's exactly what I meant. I had found the CURRENT_TIME line in functions.php but found no clue to the source of that time (i.e. the precise line of code where was defined exactly what current time is).
Thanks for the code - I was thinking of using something similar but didn't know what time format (absolute (time) or relative (time zone)) the software required. Hence my question. I thought if I found the original definition I could simply use a modified copy for my purposes.

A ready-to-customize code is of course much more convenient than having to write it myself! Thank you! Image
I never learned php or html but I've been working with phpBBs for the last 12 years so that gradually I've become at least a decent editor and I understand about 85% of the board's codes. I have to confess, though, that I feel much more at home with programming in BASIC, qBASIC, C+, Pascal and Milan (LOL yes, I'm a fossile but we silver surfers are a growing power in the net). :mrgreen:
if you make it idiot-proof
someone will upgrade the idiot
Locked

Return to “[3.0.x] MOD Writers Discussion”