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: [zip222] Automatically move events to Past Events

By Jason - May 19, 2010

Hi,

Yes, this should work. After the "removeDate" has been passed, the even will no long display on upcoming events. You could have a past events page, however, that could specifically search for events past their removeDate.

Great idea!
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

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/