![]() |
Preventing !!!!!!! ???????
Is there any way to knock out multiple punctuation like this??????????????
Damn, I hate posts like this!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Or sentences ~~~~~~~~~~~~~~ full of this. |
Of course. Use:
$searcharray = array("/([!]*)/si", "/([?]*)/si", "/([~]*)/si"); $replacearray = array("!", "?", "~"); $txt = preg_replace($searcharray, $replacearray, $txt); |
Thank you for the tools! I'll see if I can apply them properly. :)
I would presume that functions_newpost.php would be a likely place to insert this. Picking the right spot might be tricky. |
In functions_bbcodeparse, find:
PHP Code:
PHP Code:
|
Text entered:
Title: This is a test!!! Results: ~?~!~?~T~?~!~?~h~?~!~?~i~?~!~?~s~?~!~?~ ~?~!~?~i~?~!~?~s~?~!~?~ ~?~!~?~a~?~!~?~ ~?~!~?~t~?~!~?~e~?~!~?~s~?~!~?~t~?~!~?~.~?~!~?~ ~?~!~?~ ~?~!~?~!~?~ ~?~!~?~?~!~?~?~!~?~?~!~?~?~!~?~?~!~?~?~!~?~ ~?~!~?~~?~!~?~~?~!~?~~?~!~?~~?~!~?~~?~!~?~~?~!~?~ If you really look inside the above string, you'll see: This is a test!!! For some reason, it comes back with a string like the above. |
My code is not supposed to parse those complicated strings of yours.
It is supposed to eliminate "!!!!!!!!!", "??????????" and "~~~~~~~~"... |
Moved to vB3
|
This should fix the problem, find inside functions_bbcodeparse.php:
PHP Code:
PHP Code:
After testing the string: Quote:
Quote:
- Zero Tolerance |
Excellent! Thank you Dark Visor and Zero Tolerance!
|
What file(s) should I modify in 3.6.5 to have this work?
|
Great help on that request. You guys should add that to the Mod Database!
|
Quote:
Anyway.. my question. Is there any way to limit it so that it only starts limiting after so many characters? I think turning ?? into ? is a little too strict. Perhaps something that turns ?????? into ??? I just realized this thread was started 2 years ago.. but someone bumped it so I might as well ask. :) |
Sorry, that was me that bumped :) I'm not sure if I'm blind, but I'm not seeing the functions_bbcodeparse file. Has it been renamed or encorporated elsewhere?
I, too, would like for it to limit only after a certain amount, like MilkCarton suggested. Could this work with periods too? I know that ... and .... are gramatically appropriate, but I'd like to shorted ................. to ... . |
Off the top of my head, create a new plugin at 'parse_bbcode' or 'bbcode_parse' (forgot which one it is :p) and insert;
PHP Code:
|
Thanks Dismounted.. but what about changing '????????' to '???' Is this something that would be too difficult to code? :)
Edit: I couldn't get what you said to work. Although, there were only "bbcode_parse_start" and "bbcode_parse_complete" Unless I didn't see just plain old bbcode_parse |
Thanks very much! I'd like to give this a try - but I admit I'm pretty dumb and new with vB. Which file should I edit to add in the code above?
|
Quote:
PHP Code:
PHP Code:
Quote:
|
Well, I would figure that much, but the code you told me to put into the plugin doesn't work.. at all. :)
I've tried every combo of !!! and ??? and nothing ever changes. |
The variables have probably changed. I'll have a look.
|
Also, with
Code:
$replacearray = array("!!!", "???", "~~~"); Maybe I'm just misunderstanding the PHP involved.. :) I'm not much of a coder just yet. haha |
Changing the regex would fix that, but I'm too tired atm :p.
|
Any luck finding the correct variables?
|
Bumping this for more info now that I'm into 3.8.6.
My users still present the issue. functions_bbcodeparse.php is no longer part of the system. |
All times are GMT. The time now is 08:35 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|