Code: Select all
<?php
include 'config.php';
include 'calendar.php';
$time = time();
$today = date('j',$time);
$cmonth = date('n');
$events = mysql_query("SELECT *, DATE_FORMAT(date, '%M %e, %Y %h:%m:%s') as
date, DATE_FORMAT(date, '%c') as month, DATE_FORMAT(date, '%e') as day FROM calevents order by date desc") or die(mysql_error());
if($events)
{
$days = array();
while($row = mysql_fetch_array($events))
{
if($row['month'] == $cmonth)
{
$day = $row['day'];
$days[$day] = array('events.php?action=view&id='.$row['id'], 'linked-day');
}
}
}
//$days[$today] = array(NULL,NULL,'<span style="color: red; font-weight: bold;">'.$today.'</span>');
echo generate_calendar(date('Y', $time), date('n', $time), $days, 3);
?>