Page 1 of 1

max length of a forum post?

Posted: Tue Feb 14, 2006 7:56 pm
by s.dot
well i set my database field for forum entries to TEXT, which can hold a rather large amount of text, and recently people have been spamming my forums by copying/pasting insanely LARGE amounts of text.

So I wonder, what's a good amount to limit forum posts to? Some posts are rather large, but may not be spam. Does PHPBB limit post size?

I was thinking about limiting them by using substr($forum_entry,0,5000) or something. is there a better way to do it without the server having to deal with that much POST data?

A javascript gate?

Posted: Tue Feb 14, 2006 8:17 pm
by ryos
You could, of course, use javascript to validate on the client and ensure that the post is not too long. This is very easy to defeat, but it might keep some of the script kiddies away.

Beyond that, I can't think of another way to prevent the data from getting to your server.

BTW, 5000 characters is a bit low. I'm sure you knew that. :)

Posted: Tue Feb 14, 2006 8:43 pm
by feyd
phpbb has a limit, which technically, is the full size of TEXT (64K), however posts are stored in bbcoded form, so a good deal of space gets eaten by those translations. How much is larely dependant on the text submitted.

On the whole, there's little you can really do other than enforce a strict rule set, (temporarily) ban those that spam, and other such things. Once you get large enough, the board, overall, will take care of itself by virtue of your trusted moderators. Having anonymous posting allowed makes it a bit more difficult, however there are a few things you can do. Enacting a moderated posting system (for low level users, or anonymous users) is often best. Couple that with a time delay requirement between posts (the time limit might flucuate based on membership level).

Posted: Tue Feb 14, 2006 11:09 pm
by s.dot
so 5,000 is a bit low for the character count?
crap, I don't know what a good limit is because I never really write long posts (or count characters :P).

Plus, I don't want my members to notice it unless they are spamming the boards. I don't want to cut a long (but valid) post off in mid sentence.

And feyd, that's a grand idea about the time between posts based on membership levels.

Posted: Tue Feb 14, 2006 11:19 pm
by feyd
I'd say 10K may be okay. What I would do is if they post something that will go over the limit, force a preview mode with the truncated length to show it to them. Inform them their post is too long and needs to be edited or split into multple posts. You might want to tell them how many characters over they are.. but that may help spammers :P