Exemplo n.º 1
0
 static function comment_created($comment)
 {
     if (!module::get_var("akismet", "api_key")) {
         return;
     }
     switch (akismet::check_comment($comment)) {
         case "spam":
             $comment->state = "spam";
             module::incr_var("comment", "spam_caught");
             break;
         case "ham":
             $comment->state = "published";
             break;
         case "unknown":
             $comment->state = "unpublished";
             break;
     }
     $comment->save();
 }