summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-26 12:54:07 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-26 12:54:07 -0800
commitdd2bca022479f5971ca3afd3d8284474c6c5e87a (patch)
tree5c66a7f971dc7832f45db8f2fad4f67749e9a9e5 /modules
parent1fd0e14359a7c7164573e4aa897c07680339e713 (diff)
Modify the expiration code to work with db::build()
Diffstat (limited to 'modules')
-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");