Hi Guys,
I have been a little slow in implementing this but now I notice a problem.
I used Tommynanda's script but it does not show the event nearest to todays date. It shows the date farfest away.
<?php
$date = date("Ymd", time()+3600*7);
$NumEvents = 0;
$handle = opendir('../event_dates');
$i=1;
while (($file = readdir($handle)) !== false) {
if($i==1)
{
$hfile = $file;
$i++;
}
else if ($hfile<=$file) {
$hfile = $file;
}
}
if($i!=1)
include '../event_dates/' . $hfile;
else {
echo "<strong class='red'>Sorry, no events are planned at present</strong>";
}
?>
The text files in the events_dates are named as such. For todays date it would be 20040729.
How do I show the event with the dates nearest todays date?
Thanks a bunch :)