diff options
Diffstat (limited to 'modules/comment/controllers/admin_comments.php')
-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) { |