The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Finding and chopping out multiple \n
OK I'll come clean at the start. I'm running vBulletin Version 1.1.5
on a "charity" site and the traffic doesn't warrant purchasing an upgrade. What I want to do is to add a small patch function that can be called at the same time as the existing function dowordwrap(). Some users of my BBS have discovered how much "fun" it can be to hold down the enter key when writing a message. It doesn't burden the board's bandwidth much but I want to stop it, anyway. The trouble is that I am not really sure how to begin writing an eregi_replace() expression that will do the job of finding sequences of >2 \n and replacing those instances with \n\n. Does anyone care to give me a line or so code that could enable me to take the existing function in global.php: function dowordwrap($wordwraptext) { global $wordwrap; if ($text!="") { $text=eregi_replace("([^\n\r \./<>\"\\-]{".$wordwrap."})"," \\1 ",$wordwraptext); } else { $text=$wordwraptext; } return $text; } so that I can modify it as a new function: (function dostriplinestext($text)) I can then ADD the new function to global.php . . . then I guess, all I need to do is find all the files that call that function and add in the lines necessary. Better still: could the dowordwrap() function be modded to do both jobs - or (I have searched) has the mod already been written? :ermm: I do realise that this patch wouldn't stop idiots hitting a-z followed by enter . . . but at least they would be taking some exercise . . .. Regards, Abby ( webmaster@iancollins.net ) ________________ version 2.2.6 rocks! I am jealous! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|