1
I'm trying to add the following code in a custom block. I'm running XOOPS 2.3.1RC
The code works fine on an independent page.
When I add a new block with content type set to php the block doesn't even show up.
The visibility, permissions and groups are set okay. Any ideas on how to get this to work?
$day = 27; // Day of the countdown
$month = 04; // Month of the countdown
$year = 2009; // Year of the countdown
$hour = 12; // Hour of the day (east coast time)
$event = "Conference Begins"; //event
$calculation = ((mktime ($hour,0,0,$month,$day,$year) - time(void))/3600);
$hours = (int)$calculation;
$days = (int)($hours/24);
?>
It is =$days?> days until =$event?>.
You'd think I'd have remembered what I did 2 years ago. If using the PHP content type the code must be pure php without the opening/closing tags. And no html.
Working Code
$day = 27; // Day of the countdown
$month = 04; // Month of the countdown
$year = 2009; // Year of the countdown
$hour = 12; // Hour of the day (east coast time)
$event = "Conference Begins"; //event
$calculation = ((mktime ($hour,0,0,$month,$day,$year) - time(void))/3600);
$hours = (int)$calculation;
$days = (int)($hours/24);
print "It is $days days until $event.";