Sergio,
You can use this code I just wrote as a starting point:
http://www.strangerstudios.com/blog/2010/10/duplicate-comment-detected-it-looks-as-though-you%e2%80%99ve-already-said-that/
My code at that link works by adding some random text to the end of a new comment so it doesn’t look like a dupe. Then that text gets removed from the comment after posting.
You can add a conditional to the first function to only add the random code when the comment body is “no comment”.
e.g.
if($comment_data['comment_content'] == "no comment")
{
//add some random content to comment to keep dupe checker from finding it
$random = md5(time());
$comment_data['comment_content'] .= "disabledupes{" . $random . "}disabledupes";
return $comment_data;
}
You need to use all the code from the link above, but add a conditional like this here. I hope this helps.
(@sergiozambrano)
13 years, 11 months ago
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)