I've fixed it using your suggestion and it works great. However, I think what I'm trying to do doesn't require searching for the times? I want to locate all the files in the notcies directory and import them into a calendar and link to them. So since the files are already named with the date. What would be the easiest way to incorporate it into my calendar. This is how I have my calendar setup: right now it pulls the dates from the database so I want it to now pull them from all the file names and link them:
<?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);
?>