state = "spam"; module::incr_var("comment", "spam_caught"); break; case "ham": $comment->state = "published"; break; case "unknown": $comment->state = "unpublished"; break; } $comment->save(); } static function comment_updated($old, $new) { if (!module::get_var("akismet", "api_key")) { return; } if ($old->state != "spam" && $new->state == "spam") { akismet::submit_spam($new); } else if ($old->state == "spam" && $new->state != "spam") { akismet::submit_ham($new); } } }