Automatically move events to Past Events

4 posts by 2 authors in: Forums > CMS Builder
Last Post: May 19, 2010   (RSS)

By zip222 - May 19, 2010

I have an events section that has a list of Upcoming Events and a list of Past Events. I was wondering if there is a way to automatically move events to Past Events once the event date has passed.

Could the "removeDate" field work for this?

Re: [Jason] Automatically move events to Past Events

By zip222 - May 19, 2010

what would I need to include in the list viewer code for the past event page?

Re: [zip222] Automatically move events to Past Events

By Jason - May 19, 2010

Hi,

In your list viewer, you would need to use this to get your records:

list($pastRecords,$pastMetaData)=getRecords(array(
'tableName' => 'events',
'where' => 'removeDate < NOW()',
'ignoreRemoveDate'=>true,
));


You'll need to change names to match what you have in your database.

The 'where' field will return all records that have a removeDate that was before the current day.
It is very important to also have the line:
'ignoreRemoveDate'=>true,
otherwise it will return no records.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/