max length of a forum post?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

max length of a forum post?

Post 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?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
ryos
Forum Newbie
Posts: 16
Joined: Tue Feb 14, 2006 4:55 pm

A javascript gate?

Post 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. :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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).
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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
Post Reply