/    Sign up×
Community /Pin to ProfileBookmark

Forum help!

I currently have a forum online at:

[URL=http://s7.invisionfree.com/thenewrpg]http://s7.invisionfree.com/thenewrpg[/URL]

when you load it up, i want to display the timezones at the top (You’ll notice it) but it dosn’t seem to load. Here’s my code:

[COLOR=darkblue]

<form name=”boxes”><table>
<tr><th colspan=”4″ bgcolor=”blue”><font color=”white”>TIMEZONES</font></th><td bgcolor=”lime”></td></tr>
<tr>
<td bgcolor=”orange”><input type=”text” readonly name=”englandtime” size=”5″ style=”background-color:transparent;color:purple;border-style:none;text-align:right”> – London </td>
<td bgcolor=”aqua”><input type=”text” readonly name=”usatime” size=”5″ style=”background-color:transparent;color:purple;border-style:none;text-align:right””> – New York </td>
<td bgcolor=”red”><input type=”text” readonly name=”francetime” size=”5″ style=”background-color:transparent;color:purple;border-style:none;text-align:right””> – Paris</td>
<td bgcolor=”yellow”><input type=”text” readonly name=”floridatime” size=”5″ style=”background-color:transparent;color:purple;border-style:none;text-align:right””> – Florida</td>
<td bgcolor=”lime”>Current Actions : <input type=”text” readonly name=”actions”></td>
</tr>
</form></table>

<script language=”javascript”>
window.onLoad = “strt()”;
window.onLoad = “chckact()”;

function strt(){
now = new Date;
document.boxes.englandtime.value = now.getHours() + “:” + now.getMinutes() + “:”+ now.getSeconds();
usa = now.getHours() – 5;
document.boxes.usatime.value = usa + “:” + now.getMinutes() + “:” + now.getSeconds();
frn = now.getHours() + 1;
document.boxes.francetime.value = frn + “:” + now.getMinutes() + “:” + now.getSeconds();
flo = now.getHours() – 8;
document.boxes.floridatime.value = flo + “:” + now.getMinutes() + “:” + now.getSeconds();
setTimeout(“chckact()”,1000);

setTimeout(“strt()”,1000);
}

function chckact(){

document.boxes.actions.value = “None”;
if(now == 12){document.boxes.actions.value = “Lunch in England”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(now == 24){document.boxes.actions.value = “Mignight in England”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(usa == 12){document.boxes.actions.value = “Lunch in New York”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(usa == 24){document.boxes.actions.value = “Mignight in New York”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(frn == 12){document.boxes.actions.value = “Lunch in France”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(frn == 24){document.boxes.actions.value = “Mignight in France”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(flo == 12){document.boxes.actions.value = “Lunch in Florida”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(flo == 24){document.boxes.actions.value = “Mignight in Florida”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(flo == 9){document.boxes.actions.value = “Breakfast in Florida”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(now == 9){document.boxes.actions.value = “Breakfast in England”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(frn == 9){document.boxes.actions.value = “Breakfast in France”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
if(usa == 9){document.boxes.actions.value = “Breakfast in New York”;setTimeout(“red()”,0500);setTimeout(“blue()”,1000);setTimeout(“normal()”,1500)}else{
}
}
}
}
}
}
}
}
}
}
}
}

setTimeout(“chckact()”,4000);
}
function red(){document.boxes.actions.style.bgColor = “red”}
function blue(){document.boxes.actions.style.bgColor = “blue”}
function normal(){document.boxes.actions.style.bgColor = “white”}
</script>
[/COLOR]

thanks a lot for any help!

to post a comment
JavaScript

9 Comments(s)

Copy linkTweet thisAlerts:
@chrizauthorJan 10.2005 — It's OK now, i've changed it
Copy linkTweet thisAlerts:
@pj59Jan 10.2005 — I just "repaired" it. Still interested?

Regards PJ
Copy linkTweet thisAlerts:
@chrizauthorJan 10.2005 — yes please
Copy linkTweet thisAlerts:
@pj59Jan 10.2005 — [code=php]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="JavaScript" type="text/javascript">
<!--
var now,usa,frn,flo,timer;
function strt(){
now = new Date();
hrs=now.getUTCHours();
mns=now.getUTCMinutes();
sec=now.getUTCSeconds();
hrs=(hrs<10)?'0'+hrs:hrs;
mns=(mns<10)?'0'+mns:mns;
sec=(sec<10)?'0'+sec:sec;
document.boxes.englandtime.value = hrs + ":" + mns + ":"+ sec;
usa = hrs - 5;
usa=(usa<10)?'0'+usa:usa;
document.boxes.usatime.value = usa + ":" + mns + ":" + sec;
frn = hrs + 1;
frn=(frn<10)?'0'+frn:frn;
document.boxes.francetime.value = frn + ":" + mns + ":" + sec;
cal = hrs - 8;
cal=(cal<10)?'0'+cal:cal;
document.boxes.californiatime.value = cal + ":" + mns + ":" + sec;
setTimeout("chckact()",1000);
setTimeout("strt()",1000);
}
function chckact(){
document.boxes.actions.value = "None";
if(hrs == 12){document.boxes.actions.value = "Lunch in England";
}
else if(hrs == 24){document.boxes.actions.value = "Mignight in England";
}
else if(usa == 12){document.boxes.actions.value = "Lunch in New York";
}
else if(usa == 24){document.boxes.actions.value = "Mignight in New York";
}
else if(frn == 12){document.boxes.actions.value = "Lunch in France";
}
else if(frn == 24){document.boxes.actions.value = "Mignight in France";
}
else if(cal == 12){document.boxes.actions.value = "Lunch in California";
}
else if(cal == 24){document.boxes.actions.value = "Mignight in California";
}
else if(cal == 9){document.boxes.actions.value = "Breakfast in California"
}
else if(now == 9){document.boxes.actions.value = "Breakfast in England";
}
else if(frn == 9){document.boxes.actions.value = "Breakfast in France";
}
else if(usa == 9){document.boxes.actions.value = "Breakfast in New York";
}
if(document.boxes.actions.value != "None")timer=setTimeout("red()",500);
}
function red(){
document.boxes.actions.style.backgroundColor = "red"
clearTimeout(timer);
timer=setTimeout("blue();",500)
}
function blue(){
document.boxes.actions.style.backgroundColor = "blue"
clearTimeout(timer);
timer=setTimeout("normal();",500)
}
function normal(){
document.boxes.actions.style.backgroundColor = "white"
clearTimeout(timer);
if(document.boxes.actions.value != "None")timer=setTimeout("red();",500)
}
window.onload = strt;
//-->
</script>
</head>
<body>
<form name="boxes"><table>
<tr><th colspan="4" bgcolor="blue"><font color="white">TIMEZONES</font></th><td bgcolor="lime"></td></tr>
<tr>
<td bgcolor="orange"><input type="text" readonly name="englandtime" size="7" style="background-color:transparent;color:purple;border-style:none;text-align:right" value="xx"> - London </td>
<td bgcolor="aqua"><input type="text" readonly name="usatime" size="7" style="background-color:transparent;color:purple;border-style:none;text-align:right"> - New York </td>
<td bgcolor="red"><input type="text" readonly name="francetime" size="7" style="background-color:transparent;color:purple;border-style:none;text-align:right"> - Paris</td>
<td bgcolor="yellow"><input type="text" readonly name="californiatime" size="7" style="background-color:transparent;color:purple;border-style:none;text-align:right"> - California</td>
<td bgcolor="lime">Current Actions : <input type="text" readonly name="actions"></td>
</tr>
</form>
</table>
</body>
</html>[/code]
Hope you don't mind that I replaced Florida with a state which is in the timezone you specified.

Regards PJ
Copy linkTweet thisAlerts:
@chrizauthorJan 10.2005 — ah! thanks a lot!
Copy linkTweet thisAlerts:
@pj59Jan 10.2005 — You're welcome.

PJ
Copy linkTweet thisAlerts:
@chrizauthorJan 11.2005 — ? - do you like the forum design?
Copy linkTweet thisAlerts:
@pj59Jan 11.2005 — [i]Originally posted by chriz [/i]

[B]:D - do you like the forum design? [/B][/QUOTE]I have to admit that I "ran away" immediately after having clicked the link. I hate background music! :D

Anyway - good, I went there again after having read your latest post. The code I posted is completely messing up the hours in the clocks. Please replace the entire function 'strt()' with this code:[code=php]function strt(){
now= new Date();
us= new Date();
fr= new Date();
ca= new Date();
hrs=now.getUTCHours();
mns=now.getUTCMinutes();
sec=now.getUTCSeconds();
us.setHours(us.getHours()-5);
usa=us.getUTCHours();
usa=(usa<10)?'0'+usa:usa;
fr.setHours(fr.getHours()+1);
frn=fr.getUTCHours();
frn=(frn<10)?'0'+frn:frn;
ca.setHours(ca.getHours()-8);
cal=ca.getUTCHours();
cal=(cal<10)?'0'+cal:cal;
hrs=(hrs<10)?'0'+hrs:hrs;
mns=(mns<10)?'0'+mns:mns;
sec=(sec<10)?'0'+sec:sec;
document.boxes.englandtime.value = hrs + ":" + mns + ":"+ sec;
document.boxes.usatime.value = usa + ":" + mns + ":" + sec;
document.boxes.francetime.value = frn + ":" + mns + ":" + sec;
document.boxes.californiatime.value = cal + ":" + mns + ":" + sec;
setTimeout("chckact()",1000);
setTimeout("strt()",1000);
}[/code]
I must have been somewhere else when I posted the other stuff. :rolleyes:

Sorry for that! Regards PJ
Copy linkTweet thisAlerts:
@chrizauthorJan 11.2005 — OK, i'll do that later (cos im on a college computer and it blocks my forum home/admin page) so i'll do it when i get in the library or something. I was going to add like a jukebox kinda thing where when it loads up a pop-up windwo appears and you select what music you want to play, but in the admin CP you put the scripts in a header/footer etc. so it loads up the script on every page (you lost yet?!..) So what would happen with this is a new window (jukebox) would appear every time you clicked on a link so i would have to come up with a script where it checks the windows name or something. You couldn't help with that too could you?
×

Success!

Help @chriz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...