Auto hiding a record after a certain number of days

6 posts by 4 authors in: Forums > CMS Builder
Last Post: March 13, 2010   (RSS)

Re: [NigelGordijk] Auto hiding a record after a certain number of days

By Dave - March 12, 2010

Hi Nigel,

Try adding a special "removeDate" field. See:
http://www.interactivetools.com/docs/cmsbuilder/special_fieldnames.html

Another way (using MySQL) would be to add this to the getRecords() options:
'where' => " `eventDate` >= (NOW() - INTERVAL 7 DAY) ",

If you try that be sure to change eventDate to match your fieldname.

Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [NigelGordijk] Auto hiding a record after a certain number of days

By gkornbluth - March 12, 2010

Hi Nigel,

If the "7 days" is a constant you might have a look at this post for some ideas as well.

http://www.interactivetools.com/iforum/Products_C2/CMS_Builder_F35/displaying_tonights_performing_artist_P72298/

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [Dave] Auto hiding a record after a certain number of days

By NigelGordijk - March 12, 2010

Hi, Dave.

Will this delete the record, or merely hide it? I would prefer the latter, if possible.

Cheers,
Nigel Gordijk

Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net

Re: [NigelGordijk] Auto hiding a record after a certain number of days

By Donna - March 12, 2010

Hi Nigel,

It won't display in the front end. It will still exist in the back end, though. :)
Donna

--
support@interactivetools.com

Re: [Donna] Auto hiding a record after a certain number of days

By NigelGordijk - March 13, 2010

Thanks, Everyone!
Nigel Gordijk

Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net