This topic is locked

Time expired data

5/26/2017 3:28:59 PM
PHPRunner General questions
E
EazyLInes author

Hi - I'm quite new to this but getting to grips quite quickly now. I'm using PHPrunner 9.6
I have used the "Classified Adds" template and would like to restrict the amount of time an advert can remain live.

For instance: If I submit an advert today I want it to remain live and viewed by my visitors for a period of 30days, Once this 30 days has expired the advert is no longer viewable.
I have a field called date_acquired and another called date_expires (just to keep it simple). I assume we do something like: date_acquired + 30day = ? then tell it to filter out all those dates that don't fall into the specific date category. But how we do that seems to be a little beyond me at the moment.
I don't want to have to delete these ads one by one manually.
I would grateful for any assist on this one.
Regards

Ken

A
Athlon 5/30/2017

Ken, I think the best way to do this is by running a cron job on your server, not within the application. If it is to run within the application it would have to be logged in and running to do the housekeeping.
set a simple cron - write it in php if you are more familiar with it and call the file. It should look at all the records past a given date <30days from now and delete them. it can be set for example to run every 24hrs. You never have to deal with it once it is setup.
Hope that helps.
Mike.