From 44bfc1c6a42838732669e59f686069491b583fe2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 10 Jan 2009 11:25:33 +0000 Subject: Auto-delete 7-day old spam/deleted comments. --- modules/comment/models/comment.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'modules/comment/models') diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php index c83b2721..989597a8 100644 --- a/modules/comment/models/comment.php +++ b/modules/comment/models/comment.php @@ -52,4 +52,17 @@ class Comment_Model extends ORM { return $author->url; } } + + /** + * @see ORM::save() + */ + public function save() { + if (!empty($this->changed)) { + $this->updated = time(); + if (!$this->loaded) { + $this->created = $this->updated; + } + } + return parent::save(); + } } -- cgit v1.2.3