The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Stripping text...
Well... we use the notorious [glow] code over on our forums.... which a sizable number of people love
And an equal number hate. So to cater to both sides... I'm making a tiny hack to let people turn it off. Basically... what I need... is whatever little snippet of code it is that will strip [glow=color] and [/glow] out of posts before parsing. Mind you, it has to compensate for 'color' being most anything. I'm sure it has something to do with regexes... and those still hurt my head. So umm... help? |
#2
|
||||
|
||||
Where is the glow code defined? From the CP or directly in the code?
|
#3
|
||||
|
||||
Glow was added as a vb tag through the the CP....
We are using the one listed in the thread by Ozone over at vb.com. |
#4
|
||||
|
||||
actually here's the link, its the first post.
http://www.vbulletin.com/forum/showt...threadid=24595 Thanks! |
#5
|
||||
|
||||
I don't see how the code is defined mattering at all...
All I need is the commands to remove [glow=color] and [/glow] from the message body... Then i'll slide it into bbcodeparse2 and have it triggered by the user option being set. I have a very clumsy kludge in place at the moment, which siomply skips parsing the glow code specifically. But then that leaves the unparsed code in the post, which looks bad. |
#6
|
||||
|
||||
This should work:
Code:
$text = preg_replace("#\[(/{0,1})glow(=[^\]]*){0,1}\]#i", "", $test); PHP Code:
|
#7
|
||||
|
||||
Thanks... except it doesn't seem to be working.
I put this line into the bbcodeparse2 function in functions.php PHP Code:
But for some reason, the above line (even using the other regex... you have 2 different regexes in your post) fails to have any effect whatsoever. I hate regexes |
#8
|
||||
|
||||
Did you globalize $bbuserinfo in bbcodeparse2()?
|
#9
|
||||
|
||||
Yeah... because a different snippet of code using that same bbuserinfo field DOES work...
However, it leaves the unparsed code visible in the post, as shown in the attachment. PHP Code:
However, this code does nothing PHP Code:
The line is inserted into the function just before this: PHP Code:
|
#10
|
||||
|
||||
PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|