I need to add the condition "except if duplicate comment_text == 'no comments' " to the duplicate comment validation.
I'm a copy-paste dev and I'm not sql-code diver yet. I can see the code below is in charge of that, but can't tell where.
Can you help me up? (translating the sql would be a plus and would make you my god, hehe)
$dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_approved != 'trash' AND ( comment_author = '$comment_author' ";
if ( $comment_author_email )
$dupe .= "OR comment_author_email = '$comment_author_email' ";
$dupe .= ") AND comment_content = '$comment_content' LIMIT 1";
if ( $wpdb->get_var($dupe) ) {
if ( defined('DOING_AJAX') )
die( __('Duplicate comment detected; it looks as though you’ve already said that!') );
/*wp_die( __('Duplicate comment detected; it looks as though you’ve already said that!') );*/
}