PDA

View Full Version : Why won't this work?


Matt*is*thick
08-25-2001, 01:48 AM
This is my forumhome template! Why are my boards all mucked up??

If I remove the "onload" bit then the boards work fine so it must be connected to that. What am I doing wrong?




{htmldoctype}
<html>
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<!-- end no cache headers -->
<meta name="keywords" content="vbulletin,forum,bbs,discussion,jelsoft">
<meta name="description" content="$bbtitle is a discussion forum powered by vBulletin. To visit the forum, go to $bburl/ . To find out about vBulletin, go to http://www.vbulletin.com/ .">
<title>$bbtitle - powered by vBulletin</title>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getTime() {
now = new Date();
y2k = new Date("Sep 27 2001 20:00:00");
days = (y2k - now) / 1000 / 60 / 60 / 24;
daysRound = Math.floor(days);
hours = (y2k - now) / 1000 / 60 / 60 - (24 * daysRound);
hoursRound = Math.floor(hours);
minutes = (y2k - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
minutesRound = Math.floor(minutes);
seconds = (y2k - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
secondsRound = Math.round(seconds);
sec = (secondsRound == 1) ? " second." : " seconds.";
min = (minutesRound == 1) ? " minute" : " minutes, ";
hr = (hoursRound == 1) ? " hour" : " hours, ";
dy = (daysRound == 1) ? " day" : " days, "
document.timeForm.input1.value = "Season 4 premiere countdown : " + daysRound + dy + hoursRound + hr + minutesRound + min + secondsRound + sec;
newtime = window.setTimeout("getTime();", 1000);
}
// End -->
</script>
$headinclude
</head>

<bodyonload="getTime()">
$header

<!-- text -->
<center><form name=timeForm><input type=text name=input1 size=70 border-style="none" style="border-bottom: 0px solid; border-left: 0px solid;border-right: 0px solid;border-top: 0px solid;font:12px arial, helvetica,sans-serif"></form></center>

<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr valign="bottom">
<td><img src="charmed_logo.gif" border="0"></td>
<td align="right"><smallfont>$welcometext<br><b>$newposts</b></smallfont></td>
</tr>
<tr> </tr>
</table>

<br>

<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
$unregwelcomemessage
<tr valign="bottom">
<td><smallfont>
Charmed Fans Registered: <b>$numbermembers</b><br>
Number of insane Charmed related posts : <b>$totalposts</b><br>
Welcome to our newest Charmed Fanatic : <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid"><b>$newusername</b></a>
</smallfont></td>
<td align="right"><smallfont>
The time now is $timenow.<br>
You last visited: $bbuserinfo[lastvisitdate].
</smallfont></td>
</tr>
</table>
<!-- /text -->

<br>

<!-- main -->
<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr align="center">
<td bgcolor="{tableheadbgcolor}"><smallfont>&nbsp;</smallfont></td>
<td bgcolor="{tableheadbgcolor}" width="80%" align="left"><smallfont color="{tableheadtextcolor}"><b>Forum</b></smallfont></td>
<td bgcolor="{tableheadbgcolor}"><smallfont color="{tableheadtextcolor}"><b>Posts</b></smallfont></td>
<td bgcolor="{tableheadbgcolor}"><smallfont color="{tableheadtextcolor}"><b>Threads</b></smallfont></td>
<td bgcolor="{tableheadbgcolor}" nowrap><smallfont color="{tableheadtextcolor}"><b>Last Post</b></smallfont></td>
<td bgcolor="{tableheadbgcolor}" width="20%"><smallfont color="{tableheadtextcolor}"><b>Whitelighter(s)</b></smallfont></td>
</tr>
$forumbits
$loggedinusers
$pminfo
</table>
</td></tr></table>
<!-- /main -->

<br>

<!-- timezone/login-->
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr valign="top">
<td><smallfont>$timezone</smallfont></td>
<td align="right">$logincode</td>
</tr>
</table>
<!-- /timezone/login -->

<br>

<!-- icons -->
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<td align="center">
<img src="{imagesfolder}/on.gif" border="0" alt="On" align="absmiddle">
<b><smallfont>New posts</smallfont></b>
&nbsp;&nbsp;
<img src="{imagesfolder}/off.gif" border="0" alt="Off" align="absmiddle">
<b><smallfont>No new posts</smallfont></b>
&nbsp;&nbsp;
<img src="{imagesfolder}/lock.gif" border="0" alt="Closed Forum" align="absmiddle">
<b><smallfont>A closed forum</smallfont></b>
</td>
</tr>
</table>
<!-- /icons -->

$footer
</body>
</html>

Admin
08-25-2001, 06:31 AM
Replace
<bodyonload="getTime()">
with
<body>
and add
onload="getTime()"
to the body field. You can find it where you edit the style's colors.

Matt*is*thick
08-25-2001, 07:39 PM
Sorry I made a mistake. It doesn't work when its <body onload="getTime()"> either!

Steve Machol
08-25-2001, 07:50 PM
In my experience, some outside javascripts interfere with the javascripts in vB. I don't really think there's much you can do if they are incompatible.

Matt*is*thick
08-25-2001, 08:32 PM
Can you recommend any other way of integrating a countdown script for a given date?

Steve Machol
08-25-2001, 08:36 PM
The only suggestion I can make is to try different scripts until you find one that doesn't interfere with vB.

Admin
08-26-2001, 05:58 AM
[QUOTE]Originally posted by Matt*is*thick
Sorry I made a mistake. It doesn't work when its <body onload="getTime()"> either!

Matt*is*thick
08-26-2001, 01:12 PM
OMG!! It worked :)

Thankyou SO SO much!

I really live up to my username a LOT!

Matt*is*thick
08-26-2001, 01:30 PM
One problem though. Because its put in that body tag its calling for getTime() on every page now so I am getting a javascript error. How do I stop this?

Admin
08-26-2001, 01:55 PM
I think this would work:
1) Remove the onload from your body tag.
2) Add
onload=getTime();
right before
// End -->
</script>