Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter-Forum.com > Announcements
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Notices

Announcements Orbiter-Forum Staff Members will post announcements about the website here.

Reply
 
Thread Tools
  #1  
Old
tblaxland's Avatar
tblaxland tblaxland is offline
Webmaster


Default Event Timers/Countdown Timers
by tblaxland 11-08-2009, 11:51 PM

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 Code:
[eventTimer]2009-12-25 06:00[/eventTimer]
...which looks like: *Click here to restart the timer*

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 Code:
[eventTimer]2009-12-31 23:59;%dd% Days %hh% Hours %mm% Minutes %ss% Seconds[/eventTimer]
...which looks like: *Click here to restart the timer*

Standard bb formatting (size, bold, italic, etc) maybe applied to get something like:
*Click here to restart the timer*

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
Reply With Quote
Views 20149 Comments 26
Total Comments 26

Comments

Old 11-09-2009, 12:15 AM   #2
astrosammy
Dash!
 
astrosammy's Avatar

Default

Wow, really a nice addition. Great work!
astrosammy is offline   Reply With Quote
Old 11-09-2009, 12:24 AM   #3
Nemoricus
Addon Developer
Default

Cool! This is a very neat feature.
Nemoricus is offline   Reply With Quote
Old 11-09-2009, 06:53 AM   #4
Tex
Webmaster
 
Tex's Avatar

Default

Great work mate! Thanks for taking on this project.
Tex is offline   Reply With Quote
Old 11-09-2009, 10:29 AM   #5
agentgonzo
Grounded since '09
 
agentgonzo's Avatar
Default

Does it work for thread titles? If so, that would be very handy for threads about shuttle launches etc.
agentgonzo is offline   Reply With Quote
Old 11-09-2009, 11:45 AM   #6
SiberianTiger
News Sifter
 
SiberianTiger's Avatar

Default

Amazing! Thank you!

Have already put them to work at http://orbiter-forum.com/showthread.php?p=131226
SiberianTiger is offline   Reply With Quote
Old 11-09-2009, 09:02 PM   #7
Tex
Webmaster
 
Tex's Avatar

Default

Quote:
Originally Posted by agentgonzo View Post
 Does it work for thread titles? If so, that would be very handy for threads about shuttle launches etc.
No it only works in the post since thread titles don't parse bb code.


Quote:
Originally Posted by SiberianTiger View Post
 Amazing! Thank you!

Have already put them to work at http://orbiter-forum.com/showthread.php?p=131226
Lookin good!
Tex is offline   Reply With Quote
Old 11-09-2009, 11:13 PM   #8
Krys
Resident Female
 
Krys's Avatar
Default

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
Krys is offline   Reply With Quote
Old 11-09-2009, 11:24 PM   #9
n72.75
Donator
 
n72.75's Avatar


Default

This is cool, I gotta try it.

*Click here to restart the timer*

Until my 19th birthday.
n72.75 is offline   Reply With Quote
Old 11-10-2009, 01:30 PM   #10
SiberianTiger
News Sifter
 
SiberianTiger's Avatar

Question

tblaxland,
It looks like the counters have wandered off, somehow. Took this screenshot at 1 : 25 p.m. Nov, 10:

The counters' code was:
HTML Code:
[eventTimer]2009-11-10 14:22:05;%dd% Days %hh% Hours %mm% Minutes %ss% Seconds[/eventTimer]
and
HTML Code:
[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?
SiberianTiger is offline   Reply With Quote
Old 11-10-2009, 01:48 PM   #11
n122vu
Addon Developer
 
n122vu's Avatar

Default

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
n122vu is offline   Reply With Quote
Old 11-10-2009, 11:20 PM   #12
tblaxland
Webmaster
 
tblaxland's Avatar


Default

Quote:
Originally Posted by SiberianTiger View Post
 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.
tblaxland is offline   Reply With Quote
Old 11-18-2009, 12:40 PM   #13
agentgonzo
Grounded since '09
 
agentgonzo's Avatar
Default

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.
agentgonzo is offline   Reply With Quote
Old 11-18-2009, 10:06 PM   #14
tblaxland
Webmaster
 
tblaxland's Avatar


Default

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
tblaxland is offline   Reply With Quote
Old 11-18-2009, 11:16 PM   #15
orb
O-F Administrator
Ninja
 
orb's Avatar

Default

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.
orb is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter-Forum.com > Announcements


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 01:11 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2007 - 2012, Orbiter-Forum.com. All rights reserved.