Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
southern
Client


Joined: Jan 29, 2004
Posts: 591
Location: Texas

PostPosted: Tue Apr 27, 2004 10:49 am Reply with quote

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?
 
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number
Nukeum66
Life Cycles Becoming CPU Cycles


Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA

PostPosted: Tue Apr 27, 2004 2:29 pm Reply with quote

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 Laughing

_________________
Scott Johnson MIS Ubuntu/Linux 11.10 
View user's profile Send private message Visit poster's website
southern
PostPosted: Tue Apr 27, 2004 2:54 pm Reply with quote

It's coming! 3 cases, and until I get that to you I'm not running up my tab any more!
 
Nukeum66
PostPosted: Tue Apr 27, 2004 2:59 pm Reply with quote

Run That Baby UP! ............. Wink
 
southern
PostPosted: Tue Apr 27, 2004 3:10 pm Reply with quote

I dasn't, I'd need a trailer truck to get it to you!
The code works great. Thanks, Nukeum. Smile
 
Deseroka
Client


Joined: Apr 15, 2003
Posts: 466
Location: FL

PostPosted: Tue Apr 27, 2004 3:41 pm Reply with quote

I'm glad I just have to kiss rings....
Laughing
 
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Tue Apr 27, 2004 3:53 pm Reply with quote

Pucker up baby because we be there 5/7-5/14
 
View user's profile Send private message
Nukeum66
PostPosted: Tue Apr 27, 2004 4:41 pm Reply with quote

Laughing I'll never pay for Pepsi again at this rate!

southern I do accept $donations Laughing
 
southern
PostPosted: Tue Apr 27, 2004 6:40 pm Reply with quote

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. Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©