auto archiving news items

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

By paulmac - October 8, 2010

Hi

I have a latest news section that allows the user to specify a date that the news item should come off the system, I use removeDate to achieve this. Is there any way of displaying these records in an archive?

Thanks

Re: [Jason] auto archiving news items

By paulmac - October 8, 2010

Hi Jason

To display only archived records (removedate is earlier than todays date) what should I specify in the where clause?

Thanks for your help.

Re: [paulmac] auto archiving news items

By Jason - October 8, 2010 - edited: October 8, 2010

Hi,

If you want to get records that were created before today, you could try this:

<?php

list($newsRecords,$newsMetaData)=getRecords(array(
'tableName' => 'news',
'where' => "createdDate < '".date("Y-m-d")."'",
'ignoreRemoveDate' => true,
));

?>


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/