diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-02 18:54:37 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-02 18:54:37 +0000 |
commit | 9644dcc48021b4ad9546debd399460eddd2f0612 (patch) | |
tree | 40e9a399c03ded76c2f9a9c107fc82dd1b7a2705 /modules/comment/controllers/comments.php | |
parent | 277e7f8db290d33bfe241641c0fa4de588e38d35 (diff) |
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
Diffstat (limited to 'modules/comment/controllers/comments.php')
-rw-r--r-- | modules/comment/controllers/comments.php | 5 |
1 files changed, 3 insertions, 2 deletions
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( |