I have found plugins to run cron jobs and I can create a cron job. But I need help with this. I want to run a cronjob to delete blod entrys over 60 days old. I can create the cron job . But I have no ide how to write the sql query. Can any one help with this please. PS I can write the php to run the query as well . I just need help with the query string. I dont understand the elgg database well enough to know wher the data is stored.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Team Webgalli@webgalli

Team Webgalli - 0 likes
- Brian Collins@bmcoll3278

Brian Collins - 0 likes
- Evan Winslow@ewinslow

Evan Winslow - 0 likes
- Brian Collins@bmcoll3278

Brian Collins - 0 likes
- iionly@iionly

iionly - 0 likes
You must log in to post replies.use elgg_get_entities() and pass a where[] for time_created > strtotime('60 Days')
zoom. That is right over my head.
Brian, follow the link to learn about elgg_get_entities. That is how you are going to query the database to find blogs. It supports all kinds of parameters for which entities you want.
ok ill try thanks
A possible way to implement this would be to use the Expirationdate plugin as a basis. This plugin already implements a cronjob that expires / deletes entitities after their valid time has expired. There are functions included (to be useable by other plugins) to set/unset the valid time.
What you would need to do is to define the valid time (for example 60 days) of a blog entry when it is created. This should be possible by using an Elgg event handler.