PDA

View Full Version : Prevent users posting loads of line breaks


Meirion
05-21-2002, 08:05 PM
I've got an annoying problem with some users entering massive amounts of line breaks in the posts in order to hide something a lot further down the page. This makes the pages hard to read and is frustrating to scroll through.

Can someone tell me how to hack VB so that after say 5 or 10 consecutive line breaks it won't allow anymore?

Also is there a hack that will chop the lines at xx chars in a post? Another thing is when someone ends a line with loads and loads of !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!! and it breaks the width of the forum. I think that VB already does this feature on the post titles doesn't it? But not in the posts themselves.

Not very exciting I know, but would be very useful to me, and I'm sure some others.

Thanks
Meirion

Logician
05-22-2002, 03:39 PM
In newreply.php and newthread.php, find

$message=trim($message);

after that add:

$message=ereg_replace('[\n]+',"\n",$message);

This will convert all consecutive new lines to a single new line.

However I dont think this will stop your users as easily as you thought. They can just use:

.
.
.
.
.
.
.
.

Or if you stop this, there can be always imaginative members using this method which is impossible to be stopped by a hack:
s
c
r
o
l
l

m
e

n
o
w

See? Maybe you should regard warning the users instead of trying to stop them via a hack. My 2 cents..

Regards,
Logician