characters / word-wraps limitation in comments

It would be very nice, if there were a limitation of characters and word-wraps for writing a comment. I have some "jokers" in my gallery which copy and paste huge texts in the comments, or which make 100 word-wraps and then write something and do anthoer 100 word-wraps and write something, ... and the comment-section for each picture is growing bigger and bigger... I would be very glad for a solution... ( Thx!

Post edited by Chris, at 2005/12/25 1327

Re:characters / word-wraps limitation in comments

Thaks! )


Re:characters / word-wraps limitation in comments

Yes this is a problem but we can tackle these 'hooligans' the following way, replace the original code for the visitor comment section with // Visitor comments
if ($visitor_comments && isset($_REQUEST['showimage'])) {
echo "$language_username_comment \n";
echo "\n";
echo "\n";
echo "function expandCollapse(divsection) {\n";
echo " var element = document.getElementById(divsection);\n";
echo " = ( == \"none\"«») ? \"block\" \"none\";\n";
echo "}\n";
echo "function savecomments() {\n";
echo "if (document.browser.newcomment.value!='') {\n";
echo " if (document.browser.newcomment.value.length>250) {\n";
echo " alert('Max. 250 characters');\n";
echo " } else {\n";
echo " if (confirm('$language_save_comment ?')) {\n";
echo " document.browser.comment_screenwidth.value=screen.width;\n";
echo " if (document.browser.comment_username.value=='')\n";
echo " document.browser.comment_username.value='?';\n";
echo " document.browser.submit();}\n";
echo " }\n";
echo "} else {\n";
echo "expandCollapse('comments');\n";
echo "}\n";
echo "}\n";
echo "\n";
This will limit the input on the client size at 250 characters. You could further modify the code to only save a maximum of 250 characters (see section save visitor comments and replace the two lines with the fwrite statement with the following new fwrite statementfwrite($fp,substr(trim(stripslashes($_REQUEST['newcomment'])),0,250) . "\n". "\n"«»); I will implement this in the next version, version 1.3.1