auto archiving news items

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

Re: [paulmac] auto archiving news items

By Jason - October 8, 2010

Hi,

Yes, you can still get these results by using the ignoreRemoveDate option in your getRecords function:

list($newsRecords,$newsMetaData)=getRecords(array(
'tableName' => 'news',
'ignoreRemoveDate' => true,
));


This code will return ALL news records regardless of removeDate. If you want records created after a certain date, you'll have to add a "where" clause.

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/

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/