New Feature Event Timers/Countdown Timers

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
Orbiter-Forum is proud to introduce the addition of custom event timers (aka countdown/countup timers). This being a spaceflight forum, countdown clocks hold a special place in our hearts, so we have written a custom solution for this board (nothing else suitable was available). We hope you all find it useful. Also, feel free to tell other vBulletin users/admins etc about it. There is a download package, wiki, and source code all available on my bitbucket page.

Use and Formatting:

The event timers will show the time remaining to, or time passed since, an event. Typical usage would be...
HTML:
[eventTimer]2009-12-25 06:00[/eventTimer]
...which looks like: [eventTimer]2009-12-25 06:00[/eventTimer]

Times are in UTC and the format complies with ISO 8601 (24 hour format), ie, "yyyy-mm-dd hh:mm[:ss]" (seconds are optional, all other fields must be provided).

The time remaining will be displayed as "dd/hh:mm:ss" by default. A custom format string may be added using the following macros:
Code:
%dd% - days 
%hh% - hours
%mm% - minutes
%ss% - seconds
An example usage is (note the semi-colon separating the event date/time and the format string)...
HTML:
[eventTimer]2009-12-31 23:59;%dd% Days %hh% Hours %mm% Minutes %ss% Seconds[/eventTimer]
...which looks like: [eventTimer]2009-12-31 23:59;%dd% Days %hh% Hours %mm% Minutes %ss% Seconds[/eventTimer]

Standard bb formatting (size, bold, italic, etc) maybe applied to get something like:
[eventTimer]2010-04-01 12:00[/eventTimer]

Hovering the mouse over the timer will display the event time in a tooltip box.

Known Issues:

When using the vBulletin inline editor, the timer will not automatically start after the edit is saved (you will see a message "*Click here to restart the timer*". Refreshing the page or clicking on the timer will restart the timer.

Copyright Notice:

Copyright 2009 by tblaxland.

Event Timer is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Event Timer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with Event Timer. If not, see http://www.gnu.org/licenses/.

Credits:

Prototype.js - Sam Stephenson http://www.conio.net/
NTP for Javascript - jehiah http://jehiah.cz/archive/ntp-for-javascript
 

Nemoricus

Addon Developer
Addon Developer
Joined
Jul 7, 2009
Messages
286
Reaction score
0
Points
0
Cool! This is a very neat feature.
 

Tex

O-F Administrator
Administrator
Retired Staff
Tutorial Publisher
Joined
Oct 16, 2007
Messages
6,574
Reaction score
67
Points
123
Location
Houston
Website
youtube.com
Great work mate! Thanks for taking on this project. :cheers:
 

Tex

O-F Administrator
Administrator
Retired Staff
Tutorial Publisher
Joined
Oct 16, 2007
Messages
6,574
Reaction score
67
Points
123
Location
Houston
Website
youtube.com

Krys

Resident Female
GFX Staff
Joined
Apr 21, 2009
Messages
2,156
Reaction score
0
Points
0
Location
Kent, UK
Thank you, thank you, thank you!

Saves so much time telling people what bloody time it is in their country!

OrbiQuiz on irc just got easier to organise.....uh oh
 

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,687
Reaction score
1,337
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
This is cool, I gotta try it.

[eventTimer]2010-05-14 00:00[/eventTimer]

Until my 19th birthday.
 

SiberianTiger

News Sifter
News Reporter
Donator
Joined
Feb 13, 2008
Messages
5,398
Reaction score
8
Points
0
Location
Khimki
Website
tigerofsiberia.livejournal.com
tblaxland,
It looks like the counters have wandered off, somehow. Took this screenshot at 1 : 25 p.m. Nov, 10:
0f5b96b484a9.gif

The counters' code was:
HTML:
[eventTimer]2009-11-10 14:22:05;%dd% Days %hh% Hours %mm% Minutes %ss% Seconds[/eventTimer]
and
HTML:
[eventTimer]2009-11-12 15:43:30;%dd% Days %hh% Hours %mm% Minutes %ss% Seconds[/eventTimer]
They seemed fine at first, when I just posted them. Could it happen due to following reposting of the message?
 

n122vu

Addon Developer
Addon Developer
Donator
Joined
Nov 1, 2007
Messages
3,196
Reaction score
51
Points
73
Location
KDCY
Here's the view from where I sit:


The launch site:Baikonur

The launch time is:
19 : 22 : 05 Baikonur 10.11.2009
17 : 22 : 05 Moscow Time 10.11.2009
14 : 22 : 05 UTC November 11, 2009
9 : 22 : 05 a.m. EST November 11, 2009

Launch countdown:
00 Days 00 Hours 35 Minutes 26 Seconds


The expected docking time is:
18 : 43 : 30 ±3 min Moscow Time 12.11.2009
15 : 43 : 30 ±3 min UTC November 12, 2009
10 : 43 : 30 a.m. ±3 min EST November 12, 2009

Docking countdown:
02 Days 01 Hours 56 Minutes 51 Seconds
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
They seemed fine at first, when I just posted them. Could it happen due to following reposting of the message?
I've checked various timers, including the ones on your launch thread and they look OK. It doesn't seem to be a time zone issue since the timer was out by some odd number of minutes. Note that the timers are synched to our servers clock when the page is loaded. Maybe that clock got out of synch, it would be very strange though...

Let me know if you see them off again. :cheers:
 

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
Currently %hh% is always a 2-digit number, so if the time is one hour, it would display as "01" rather than "1". It would be nice if you could specify %h% to mean "1" in this case (removing leading zeroes) and still leave the %hh% to be always two digits. The same for the other fields too.
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
Thanks for the suggestion, I agree with you.

In a similar vein, I think if the next most significant field is not present, then the display should take account of that. Eg, currently the hours field will only display up to 23 hours, but it would be nice to display the total number of hours if the day field is missing.

Something for v0.2 ;)
 

orb

O-F Administrator,
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Currently the timer counts down before event, and up after it. So if someone writes a post before some event and uses "until", "before" or similar word, then after this event should be passed it's hard to say whether that event really passed, when that post isn't reedited by author, and especially when seconds are omitted, without hovering mouse over it.
I have a suggestion for additional field in timer formatting string. A sign of timer counting, either only simple +/- for e.g. %sign% (or other unused enclosed in %%) string, or in some extended user customizable form shown in examples below.

An example for how would I see simple version:
Code:
STS-129 launch: [event[b][/b]Timer]2009-11-16 19:28:10;L%sign%%dd%days/%hh%:%mm%:%ss%[/event[b][/b]Timer]
And how would I see customizable version of it:
Code:
[event[b][/b]Timer]2010-01-01 00:00?"till":"since";%dd% days, %hh% hours, %mm% minutes, %ss% seconds %sign%[/event[b][/b]Timer] the beginning of 2010.
 

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
Currently the timer counts down before event, and up after it. So if someone writes a post before some event and uses "until", "before" or similar word, then after this event should be passed it's hard to say whether that event really passed, when that post isn't reedited by author, and especially when seconds are omitted, without hovering mouse over it.
I have a suggestion for additional field in timer formatting string. A sign of timer counting, either only simple +/- for e.g. %sign% (or other unused enclosed in %%) string, or in some extended user customizable form shown in examples below.

An example for how would I see simple version:
Code:
STS-129 launch: [eventTimer]2009-11-16 19:28:10;L%sign%%dd%days/%hh%:%mm%:%ss%[/eventTimer]
And how would I see customizable version of it:
Code:
[eventTimer]2010-01-01 00:00?"till":"since";%dd% days, %hh% hours, %mm% minutes, %ss% seconds %sign%[/eventTimer] the beginning of 2010.
I wholeheartedly concur. I had a similar thought (though less lucid and more plagued by bikini-clad lesbians) when I was posting about STS-129 this afternoon.
 

orb

O-F Administrator,
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
... I think if the next most significant field is not present, then the display should take account of that. Eg, currently the hours field will only display up to 23 hours, but it would be nice to display the total number of hours if the day field is missing.
I wholeheartedly concur. I had a similar thought (though less lucid and more plagued by bikini-clad lesbians) when I was posting about STS-129 this afternoon.

I've made something like this. Tested on my friend's vBulletin with success. Only changed file is eventTimerClient.js, I'm attaching here in the zip file.
I already sent details about extended usage of eventTimer to tblaxland.

EDIT: Updated attachment to even more improved version.
 

Attachments

  • eventTimerClient.zip
    1 KB · Views: 11
Last edited:

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
Thanks orb. I have used your code and added the feature to have variable length fields. Taking agentgonzo's example, this would look something like:

HTML:
STS-129 launch: L[eventTimer]2009-11-16 19:28:10;%c%%dd%/%hh%:%mm%:%ss%[/eventTimer]
STS-129 launch: L[eventTimer]2009-11-16 19:28:10;%c%%dd%/%hh%:%mm%:%ss%[/eventTimer]

or Apollo style (where they did not use the "days" field and hours was three digits):
HTML:
STS-129 launch: L[eventTimer]2009-11-16 19:28:10;%c%%hhh%:%mm%:%ss%[/eventTimer]
STS-129 launch: L[eventTimer]2009-11-16 19:28:10;%c%%hhh%:%mm%:%ss%[/eventTimer]

And showing a custom sign string:
HTML:
[eventTimer]2010-01-01 00:00:00?before|after;%d%/%hh%:%mm%:%ss% %c%[/eventTimer] the beginning of New Year 2010
[eventTimer]2010-01-01 00:00:00?before|after;%d%/%hh%:%mm%:%ss% %c%[/eventTimer] the beginning of New Year 2010

EDIT: BTW, more exhaustive documentation can be found on the bitbucket page: http://bitbucket.org/tblaxland/event-timer/wiki/Home
 

orb

O-F Administrator,
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Last edited:
Top