This topic is locked

Filter Question

1/8/2009 10:04:12 AM
Calendar Template general questions
M
mkesley author

I would like to filter the calcalendar_list.php page to only show current or future events. I tried adding EventDate >= now() to the sql filter and the result tab showed what I wanted but when the page was built it still showed all events.
I assume the before sql event for the list page is overriding the sql settings but I'm not sure where to add my custom where to achieve the desired result. Can someone point me in the right direction?
Thanks.

J
Jane 1/21/2009

Hi,
edit all SQL queries in the List page: Before SQL query event.

Here is just a sample:

"select

count()

from `calcalendar` left join `calcategory`

on (`calcalendar`.`Category`=`calcategory`.`id`)

left join `calnumbers`

on ((to_days((`calcalendar`.`DateField` + interval `calnumbers`.`n` day)) - to_days(`calcalendar`.`EndDate`)) <= 0)

where (`calcalendar`.`Recurrence` = 1) and (`calcalendar`.`Period` = 'd') and (".$strWhereClause1.")

and `calcalendar`.`DateField`>CURDATE()

union all

select

count(
)

from `calcalendar` left join `calcategory`

on (`calcalendar`.`Category`=`calcategory`.`id`)

left join `calnumbers`

on ((to_days((`calcalendar`.`DateField` + interval (`calnumbers`.`n`*7) day)) - to_days(`calcalendar`.`EndDate`)) <= 0)

where (`calcalendar`.`Recurrence` = 1) and (`calcalendar`.`Period` = 'ww') and (".$strWhereClause2.")

and `calcalendar`.`DateField`>CURDATE()

union all

select

...