11
I've been trying to add a new block with the following php script. I drop this code in the content block and set the content type to php script. All I get is the block name in the preview. The block does not show on the site at all! Any ideas?
<?
//-----------------------------------------------------
//------COUNT DOWN TIMER-------------------------------
//-----------------------------------------------------
// enter start date below like this: "January 2, 2001"
$end = "May 6, 2007";
// enter string of what this start date is.
$text = "until the conference!";
$textOnTheDay = "G'07 begins today!!!";
$textAfterwards = "Check out the procedings.";
//--------------------------
$now = strtotime ("now");
$then = strtotime ("$end");
$difference = $then - $now;
$num = $difference/86400;
$days = intval($num);
$num2 = ($num - $days)*24;
$hours = intval($num2);
$num3 = ($num2 - $hours)*60;
$mins = intval($num3);
$num4 = ($num3 - $mins)*60;
$secs = intval($num4);
if ($days>0 || $hours>0 || $minutes>0 || $seconds>0) {
?>
<p>
<? echo $days ?> days,
<? echo $hours ?> hours,
<? echo $mins ?> minutes,
<? echo $secs ?> seconds
<? echo $text ?>
</p>
<? } else if (($days==0) && ($hours<=0 || $minutes<=0 || $seconds<=0)) { ?>
<p><? echo $textOnTheDay ?><p>
<? } else { ?>
<p> <? echo $textAfterwards ?></p>
<? } ?>