Warning: The author of this contribution does not provide support for it anymore.

Count Down

Timer base on Forum Time possible? - Count Down

Timer base on Forum Time possible?

by SoMeOnEnUlL » Sun Sep 19, 2010 12:14 pm

This is a great mod. Thanks a lot. It would be really nice if the timer can be based on the forum time, too. So that we can set the count down for forum's event,too. Is it possible? This is great already, though. Thanks again for the mod. :)
SoMeOnEnUlL
Registered User
Posts: 5
Joined: Mon Sep 01, 2008 4:09 pm
Contact:

Re: Timer base on Forum Time possible?

by wang5555 » Mon Sep 20, 2010 9:37 am

SoMeOnEnUlL wrote:This is a great mod. Thanks a lot. It would be really nice if the timer can be based on the forum time, too. So that we can set the count down for forum's event,too. Is it possible? This is great already, though. Thanks again for the mod. :)

Default, timer base on your WWW SERVER that created your Forum.
It is more blessed to give than to reveive, welcome to letter, thanks & good-bye!
Good luck ^_^
Welcome to my forum!!
http://wang5555.hopto.org/phpBB3/
p.s. Shut down computer before 11 clock night!!!
User avatar
wang5555
Translator
Posts: 602
Joined: Wed Oct 27, 2004 2:57 pm
Location: Taiwan
Contact:

Re: Timer base on Forum Time possible?

by SoMeOnEnUlL » Mon Sep 20, 2010 4:45 pm

Is it? I mean the javascript that you used get the date/time from the user computer, right?

Anyways, the Mod is great. I am using it now. Thanks. :)
SoMeOnEnUlL
Registered User
Posts: 5
Joined: Mon Sep 01, 2008 4:09 pm
Contact:

Re: Timer base on Forum Time possible?

by wang5555 » Mon Sep 20, 2010 8:59 pm

SoMeOnEnUlL wrote:Is it? I mean the javascript that you used get the date/time from the user computer, right?

No, the javascript that get the date/time is from the SERVER computer. ;)
It is more blessed to give than to reveive, welcome to letter, thanks & good-bye!
Good luck ^_^
Welcome to my forum!!
http://wang5555.hopto.org/phpBB3/
p.s. Shut down computer before 11 clock night!!!
User avatar
wang5555
Translator
Posts: 602
Joined: Wed Oct 27, 2004 2:57 pm
Location: Taiwan
Contact:

Re: Timer base on Forum Time possible?

by Groundy » Tue Nov 02, 2010 6:29 pm

This MOD is next to useless, and only works for users in the SAME time zone, as it is set from server time, If your server is in the UK, users in Asia will have the wrog amount of time as a countdown.

I am putting this one down to experience.

This MOD needs putting back into Area 51 or at least Beta until this bug can be sorted.
Man Utd Forum

The one stop site for United fans
Groundy
Registered User
Posts: 307
Joined: Tue Dec 08, 2009 5:05 pm
Contact:

Re: Timer base on Forum Time possible?

by Groundy » Tue Nov 02, 2010 7:29 pm

In the countdown_html file find :

var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr+" "+h+":"+i+":"+s


replace with :

var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()+(today.getTimezoneOffset()/60)
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr+" "+h+":"+i+":"+s


That should set the timer for all time zones
Man Utd Forum

The one stop site for United fans
Groundy
Registered User
Posts: 307
Joined: Tue Dec 08, 2009 5:05 pm
Contact:

Re: Timer base on Forum Time possible?

by wang5555 » Wed Nov 03, 2010 12:11 pm

Groundy wrote:In the countdown_html file find :

var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr+" "+h+":"+i+":"+s


replace with :

var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()+(today.getTimezoneOffset()/60)
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr+" "+h+":"+i+":"+s


That should set the timer for all time zones

Thanks for your fix.

But it is useless.
The forum users must know the time zone of the forum server.
It is more blessed to give than to reveive, welcome to letter, thanks & good-bye!
Good luck ^_^
Welcome to my forum!!
http://wang5555.hopto.org/phpBB3/
p.s. Shut down computer before 11 clock night!!!
User avatar
wang5555
Translator
Posts: 602
Joined: Wed Oct 27, 2004 2:57 pm
Location: Taiwan
Contact:

Re: Timer base on Forum Time possible?

by Groundy » Thu Nov 04, 2010 12:43 pm

wang5555 wrote:
Groundy wrote:In the countdown_html file find :

var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr+" "+h+":"+i+":"+s


replace with :

var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()+(today.getTimezoneOffset()/60)
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr+" "+h+":"+i+":"+s


That should set the timer for all time zones

Thanks for your fix.

But it is useless.
The forum users must know the time zone of the forum server.


Wrong !!!!
The get timezone script sets the time according to the server, I have this running on my board with members from the UK to Australia, Canada and USA, they are all telling me it''s working fine and is correct to the odd second.

You should try it before you berate it.
Man Utd Forum

The one stop site for United fans
Groundy
Registered User
Posts: 307
Joined: Tue Dec 08, 2009 5:05 pm
Contact:

Re: Timer base on Forum Time possible?

by wang5555 » Thu Nov 04, 2010 9:34 pm

Groundy wrote:Wrong !!!!
The get timezone script sets the time according to the server, I have this running on my board with members from the UK to Australia, Canada and USA, they are all telling me it''s working fine and is correct to the odd second.

You should try it before you berate it.

Sorry! I already test it and get wrong timer.
It is more blessed to give than to reveive, welcome to letter, thanks & good-bye!
Good luck ^_^
Welcome to my forum!!
http://wang5555.hopto.org/phpBB3/
p.s. Shut down computer before 11 clock night!!!
User avatar
wang5555
Translator
Posts: 602
Joined: Wed Oct 27, 2004 2:57 pm
Location: Taiwan
Contact:

Re: Timer base on Forum Time possible?

by Groundy » Mon Nov 15, 2010 7:16 pm

This is how the count_down.html file should look

<!-- IF S_ENABLE_COUNT_DOWN -->
<hr />
<div class="navbar">
<div class="inner"><span class="corners-top"><span></span></span>

<div style="text-align:center; font-size: 1.3em;">
<form name="count">
<input type="text" size="80" name="count2" style="color: #ff0000; font-weight: bold; text-align: center;">
</form>


<script>

/*
Count down until any date script-
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/


//change the text below to reflect your own,
var before="United v Wigan"
var current=""
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

function countdown(yr,m,d,h,i,s){
theyear=yr;themonth=m;theday=d;thehour=h;themin=i;thesec=s
var todayDate = new Date()
var diff = todayDate .getTimezoneOffset()*60000
var today = new Date(Date.parse(todayDate) + diff)
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr+" "+h+":"+i+":"+s
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=0){
document.forms.count.count2.value=current
return
}
else
document.forms.count.count2.value="Countdown: Until "+before+", has "+dday+" day "+dhour+" hour "+dmin+" min "+dsec+" sec."
setTimeout("countdown(theyear,themonth,theday,thehour,themin,thesec)",1000)
}
//enter the count down date using the format year/month/day
countdown({DATE_COUNT_DOWN})
</script>
</div>

<span class="corners-bottom"><span></span></span></div>
</div>
<hr />
<!-- ENDIF -->


This should now work for all world time zones and is edited for the Indian and Asian GMT hr +30min time zones.
Thanks to Matt for this fix
Man Utd Forum

The one stop site for United fans
Groundy
Registered User
Posts: 307
Joined: Tue Dec 08, 2009 5:05 pm
Contact: