Purge Old Notes

Dazed
Dazed
@dazed
9 years ago
1,022 posts
I can't recall if this is already in JR but is there an option that I can say delete old messages that are greater than "x" days? I used to kill these from the database before but was curious if there was an easier way.
updated by @dazed: 01/07/17 08:04:55AM
michael
@michael
9 years ago
7,768 posts
Pretty certain you're talking about the "Private Notes" (jrPrivateNote) module. For that module there is no prune function.

It would be easy enough to automate it though with Events and Listeners firing off of the 'daily_maintenance' function.

Docs: "Daily Maintenance"
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-developers-guide/2979/daily-maintenance

Docs: "Events and Listeners"
https://www.jamroom.net/the-jamroom-network/documentation/development/1011/events-and-listeners

Just get the timestamp for today, search for private notes that are older than that X days, then send $_POST their ids to the view_jrPrivateNote_delete() function in the jrPrivateNote module.