diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-01-10 11:25:33 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-10 11:25:33 +0000 |
commit | 44bfc1c6a42838732669e59f686069491b583fe2 (patch) | |
tree | 65316f9b2cea5e060f2ade3f655a421eb1885d4b /modules/comment/controllers | |
parent | 74766e5b823faca35fa57467bd8e19d048c1a8fb (diff) |
Auto-delete 7-day old spam/deleted comments.
Diffstat (limited to 'modules/comment/controllers')
-rw-r--r-- | modules/comment/controllers/admin_comments.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php index c5fab259..5460d651 100644 --- a/modules/comment/controllers/admin_comments.php +++ b/modules/comment/controllers/admin_comments.php @@ -55,7 +55,13 @@ class Admin_Comments_Controller extends Admin_Controller { } public function index() { - $this->queue("unpublished"); + // Get rid of old deleted/spam comments + Database::instance()->query( + "DELETE FROM `comments` " . + "WHERE state IN ('deleted', 'spam') " . + "AND unix_timestamp(now()) - updated > 86400 * 7"); + + $this->queue("unpublished"); } public function menu_labels($state) { |