Auto unpublish/remove on a list submission After Set Duration

polarweb

Jeremiah
I want to allow folks to add an entry to a list and have it published for 30 days. When it hits the 31 day mark, ideally the record would be removed automatically.

Suggestions?
 
I manage something like that with a MySql view, where I show a status change for a certain period. In combination with a pre-filter.
Code:
select `ha_mf_monitor_status`.`updatedate` AS `updatedate`,`ha_mf_monitor_status`.`id` AS `id`,`ha_mf_monitor_status`.`deviceID` AS `deviceID`,`ha_mf_devices`.`typeID` AS `typeID`,`ha_mf_devices`.`locationID` AS `locationID`,`ha_mf_devices`.`devicelinkID` AS `devicelinkID`,now() AS `cnow`,`ha_mf_monitor_status`.`statusDate` AS `statusdate`,`ha_mf_monitor_status`.`toggleignore` AS `f1`,(`ha_mf_monitor_status`.`statusDate` + interval `ha_mf_monitor_status`.`toggleignore` minute_second) AS `diff1`, if(((`ha_mf_monitor_status`.`statusDate` + interval `ha_mf_monitor_status`.`toggleignore` minute_second) < now()),3,1) AS `stat`,`ha_mf_monitor_status`.`status` AS `status` from (`ha_mf_monitor_status` join `ha_mf_devices` on((`ha_mf_monitor_status`.`deviceID` = `ha_mf_devices`.`id`)))
 
Main part of concern here: if(((`ha_mf_monitor_status`.`statusDate` + interval `ha_mf_monitor_status`.`toggleignore` minute_second) < now()),3,1) AS `stat`

See MySql Date functions Link
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top