PDA

View Full Version : Minimum words/chars to post?


SteelFrog
06-18-2002, 10:38 AM
Is there anyone who has a hack that sets the minimum number of chars/words needed to post?
I just hate people upping their post counts by posting only "Yes" or "Sure" or something similarly short.

Is there any way I can stop this?

Thanks in advance.

Logician
06-18-2002, 11:55 AM
yep possible..

Edit newreply.php find:


// check for subject and message
$message=trim($message);
if ($message=="") {
eval("standarderror(\"".gettemplate("error_nosubject")."\");");
exit;
}


After that add:



if (strlen(trim($message))<X) {
eval("standarderror(\"".gettemplate("too_short")."\");");
exit;
}


Replace X with the min. char number you want and create a new template named "too_short" via Admin CP. This hack applies only to new replies. Not likely but if you have a problem with newthreads too, apply the same code to new.thread.php

A few points:
* Remember: smiley text or bbcode count as chars too.
* This wont stop your users to pass it with a text like:
"yes............................................... ...................."

Another hack I use in my board is to check vowel count. If the message does not have a vowel or enough vovel I dont let it pass, since it's either a meaningless text like "ghgjhgkjg" or a very short answer like "no" or ": )"

Enjoy..
Logician