Upcoming Events Module
I don't know how to submit this properly... hopefully someone can point me n the right direction. I noticed the upcoming events module showed all events, and sorted them from the latest event down to the current day... When I changed the sort it showed even events that had already passed.
I modified the calendarlib.php file funtion upcoming_events to adjust this so that it only shows UPCOMING events that havent' passed yet, with the nearest event listed first. I don't know how to put this into CVS and I hope this change doesn't affect other calendar type items.
function upcoming_events($maxrows = -1, $calendarId = 0, $maxDays = -1) {
$cond = '';
$bindvars = array();
if($calendarId > 0){
$cond = $cond." and `calendarId` = ? ";
$bindvars = $bindvars + array($calendarId);
}
if($maxDays > 0)
{
$maxSeconds = ($maxDays * 24 * 60 * 60);
$cond = $cond." and `start` > (unix_timestamp(now()) )";
$bindvars = $bindvars + array($maxSeconds);
}
$query = "select `start`, `name`, `calitemId`, `calendarId`, `user`, `lastModif` from `tiki_calendar_items` where 1=1 ".$cond." order by ".$this->convert_sortmode('start_asc');
$result = $this->query($query,$bindvars,$maxrows,0);
$ret = array();
while ($res = $result->fetchRow()) {
$ret[] = $res;
}
return $ret;
}