From 9ad57b3d8d1000f17962bb0ba00a8958b2f141db Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Wed, 1 Jun 2011 12:15:26 -0700 Subject: Added scripts, email addresses, other minor modifications --- scripts/cleanup_old_posts.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 scripts/cleanup_old_posts.php (limited to 'scripts/cleanup_old_posts.php') diff --git a/scripts/cleanup_old_posts.php b/scripts/cleanup_old_posts.php new file mode 100755 index 0000000..6a3986a --- /dev/null +++ b/scripts/cleanup_old_posts.php @@ -0,0 +1,30 @@ +#!/usr/bin/php + + * + */ + +require_once "../htdocs/src/base.inc.php"; + +$pi = new PostIterator(); + +$diff = $CONFIG['expiretime'] * 86400; + +$pi->filterCreated(0, time() - $diff); +$pi->query(); + +$count = 0; +foreach ($pi as $post) { + $post->delete(); + $count++; + +} + +// TODO: Add Logging? + +?> -- cgit v1.2.3