summaryrefslogtreecommitdiff
path: root/modules/comment/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment/controllers')
-rw-r--r--modules/comment/controllers/admin_comments.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php
index 271c7d51..c67fc4a4 100644
--- a/modules/comment/controllers/admin_comments.php
+++ b/modules/comment/controllers/admin_comments.php
@@ -22,10 +22,11 @@ class Admin_Comments_Controller extends Admin_Controller {
public function index() {
// Get rid of old deleted/spam comments once in a while
- Database::instance()->query(
- "DELETE FROM {comments} " .
- "WHERE state IN ('deleted', 'spam') " .
- "AND unix_timestamp(now()) - updated > 86400 * 7");
+ db::build()
+ ->delete("comments")
+ ->where("state", "IN", array("deleted", "spam"))
+ ->where("updated", "<", "UNIX_TIMESTAMP() - 86400 * 7")
+ ->execute();
// Redirect to the appropriate queue
url::redirect("admin/comments/queue/unpublished");