Exemple #1
0
 static function set_spam_state($comment_ids, $new_state)
 {
     $is_active = $new_state ? 0 : 1;
     // setting spam_state=0 will undelete a comment
     $new_state = (int) $new_state;
     // just in case
     Dal::execute_multiple("UPDATE {comments} SET is_active={$is_active}, spam_state={$new_state} WHERE comment_id=?", array_map(create_function('$id', 'return array($id);'), $comment_ids));
 }