Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
433 views
in Q2A Core by

I using q2a for my b2c site, but there was lot of spam messages.

My site is only for Chinese user only, and i do not want use the reCAPTCHA.

i edit some code in file qa-page-ask.php after line 108 like this:

 

//Some Chinese plz
$message = '<strong>NOTICE:</strong> You should type some Chinese word (like “你好”) in your comment to pass the spam-check, thanks for your patience!';
$pattern = '/[一-龥]/u';
   
if(!preg_match_all($pattern, $intitle, $match)) {
    exit($message);    
}
 
it works good, but when i upgrade q2a, i will be work it again.
 
any idea to post this code to a plugins? or give me some tips to do it. thanks.

Please log in or register to answer this question.

...