From 9644dcc48021b4ad9546debd399460eddd2f0612 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 2 Jan 2009 18:54:37 +0000 Subject: 1) Removed the published boolean database field 2) Replaced it with a string field (state) which contains the state of the comment. i.e. published, unpublished, spam. Unsure if we want to create constants in comments.php to standardize the valid values... thoughts? 3) synchronized the spamfilter and comment unit tests with the current functionality --- modules/comment/controllers/comments.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/comment/controllers') diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index fcef1832..e19a2ec1 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -30,7 +30,7 @@ class Comments_Controller extends REST_Controller { $comments = ORM::factory("comment") ->where("item_id", $item->id) - ->where("published", 1) + ->where("state", "published") ->orderby("created", "desc") ->find_all(); @@ -68,7 +68,8 @@ class Comments_Controller extends REST_Controller { print json_encode( array("result" => "success", - "resource" => $comment->published ? url::site("comments/{$comment->id}") : NULL, + "resource" => $comment->state == "published" ? url::site("comments/{$comment->id}") : + NULL, "form" => comment::get_add_form($item)->__toString())); } else { print json_encode( -- cgit v1.2.3