Author |
Message |
southern
Client

Joined: Jan 29, 2004
Posts: 624
|
Posted:
Tue Apr 27, 2004 10:49 am |
|
Now, Nukeum, time for you to earn another case of Pepsi... how do I set up a countdown block using javascript without the error "There isn't content right now for this block. "?
I saved this javascript as block-Brady.php:
Code:
<p align="center">
<script language=JavaScript>
<!-- //
today = new Date();
BigDay = new Date("November 30, 2004")
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
e_minLeft = (e_hrsLeft - hrsLeft)*60;
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
secLeft = Math.floor((e_minLeft - minsLeft)*60);
document.write (" <b> "+daysLeft+" Days, "+hrsLeft+" Hours,<br> "+minsLeft+" Minutes and "+secLeft+" Seconds</b>" );
// -- -->
</script><br>Til Sergeant John Brady of California<br>1/23 Infantry<br>Stryker Brigade Combat Team<br>U.S. Army<br>returns from Iraq</p>
<br>
|
and it works fine except for that pesky error 'There isn't content...' That IS the content! What to do? |
|
|
|
 |
Nukeum66
Life Cycles Becoming CPU Cycles

Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA
|
Posted:
Tue Apr 27, 2004 2:29 pm |
|
Save this as block-Brady.php Place in blocks directory
Code:<?php
if (eregi("block-Brady.php",$_SERVER[PHP_SELF])) {
Header("Location: index.php");
die();
}
$content.="<center><script language=\"JavaScript\"src=\"includes/brady.php\"></script></center></b>";
$content.="<center><br>Til Sergeant John Brady of California<br>1/23 Infantry<br>";
$content.="Stryker Brigade Combat Team<br>U.S. Army<br>returns from Iraq</center>";
?>
|
Save this as brady.php place it in your includes directory Just as it is
Code:<!-- //
today = new Date();
BigDay = new Date("November 30, 2004")
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
e_minLeft = (e_hrsLeft - hrsLeft)*60;
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
secLeft = Math.floor((e_minLeft - minsLeft)*60);
document.write (" <b> "+daysLeft+" Days, "+hrsLeft+" Hours,<br> "+minsLeft+" Minutes and "+secLeft+" Seconds</b>" );
// -- -->
|
Then now this is important SEND ME MY PEPSI  |
_________________ Scott Johnson MIS Ubuntu/Linux 11.10 |
|
|
 |
southern

|
Posted:
Tue Apr 27, 2004 2:54 pm |
|
It's coming! 3 cases, and until I get that to you I'm not running up my tab any more! |
|
|
|
 |
Nukeum66

|
Posted:
Tue Apr 27, 2004 2:59 pm |
|
Run That Baby UP! .............  |
|
|
|
 |
southern

|
Posted:
Tue Apr 27, 2004 3:10 pm |
|
I dasn't, I'd need a trailer truck to get it to you!
The code works great. Thanks, Nukeum.  |
|
|
|
 |
Deseroka
Client

Joined: Apr 15, 2003
Posts: 466
Location: FL
|
Posted:
Tue Apr 27, 2004 3:41 pm |
|
I'm glad I just have to kiss rings....
 |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Tue Apr 27, 2004 3:53 pm |
|
Pucker up baby because we be there 5/7-5/14 |
|
|
|
 |
Nukeum66

|
Posted:
Tue Apr 27, 2004 4:41 pm |
|
I'll never pay for Pepsi again at this rate!
southern I do accept $donations  |
|
|
|
 |
southern

|
Posted:
Tue Apr 27, 2004 6:40 pm |
|
That's a thought, I dunno if I can walk into FedEx with three cases of Pepsi to ship.
There doesn't seem to be any teleportation facilities yet...but I said three cases and I'm a wolf of my word so let me think on the problem. Anyway this is better than kissing a ring and getting tarnish on my teeth.  |
|
|
|
 |
|