Great module. I’ve just installed it and it works great.
I did change 1 query in the _getNEvents function because on my server the original query didn’t work. When showing the calendar as a list and filtering on a catergory ID, it wouldn’t filter. The query almost remained the same except for the
startdate >= \''.$date.'\' or enddate >= \''.$date.'\' or `lastrepeat` >= \''.$date.'\'
part in the WHERE part. I had to put this in between brackets (dunno if that’s the correct name), making it:
(startdate >= \''.$date.'\' or enddate >= \''.$date.'\' or `lastrepeat` >= \''.$date.'\')
Complete query now looks like:
$eventsSQL = 'SELECT *, E.id as eid, E.category as catID, E.repeat, C.name as category, (SELECT DATEDIFF(E.enddate, E.startdate)) as DurationDays, (SELECT TIMEDIFF(E.endtime, E.starttime)) as DurationTime
FROM '.$modx->getFullTableName($this->tables['events']).' as E
LEFT JOIN '.$modx->getFullTableName($this->tables['categories']).' as C ON E.category = C.id
WHERE (startdate >= \''.$date.'\' or enddate >= \''.$date.'\' or `lastrepeat` >= \''.$date.'\') and E.active=1
and C.active=1 '.($CatId ? ' and C.id IN ('.$CatId.') ' : '').'
ORDER BY startdate LIMIT '.$n;