![]() |
|
|
Thread Tools |
|
#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? No members have liked this post.
|
|
#2
|
||||
|
||||
|
Where is the glow code defined? From the CP or directly in the code?
__________________
Chen Avinadav Formerly vBulletin.org Owner and Founder chen@avinadav.com No members have liked this post.
|
|
#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.
__________________
Make someone smile today!
No members have liked this post.
|
|
#4
|
||||
|
||||
|
actually here's the link, its the first post.
http://www.vbulletin.com/forum/showt...threadid=24595 Thanks!
__________________
Make someone smile today!
No members have liked this post.
|
|
#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. No members have liked this post.
|
|
#6
|
||||||||
|
||||||||
|
This should work:
Yup:
__________________
Chen Avinadav Formerly vBulletin.org Owner and Founder chen@avinadav.com No members have liked this post.
Last edited by Chen : 03 Mar 2002 at 10:06. |
||||||||
|
#7
|
||||
|
||||
|
Thanks... except it doesn't seem to be working.
I put this line into the bbcodeparse2 function in functions.php
DIsablecodes is a new user option field I added and I know it works because my previous kludge works (just badly) 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 No members have liked this post.
|
||||
|
#8
|
||||
|
||||
|
Did you globalize $bbuserinfo in bbcodeparse2()?
__________________
Chen Avinadav Formerly vBulletin.org Owner and Founder chen@avinadav.com No members have liked this post.
|
|
#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.
THAT code works, and in the end produces the effect shown in the attachment... namely that certain codes aren't pulled from the DB and thus not parsed. However, this code does nothing
(the 2 comment lines are other regexes that didn't work as well) The line is inserted into the function just before this:
No members have liked this post.
|
||||||||||||
|
#10
|
||||
|
||||
vBulletin removes some \ so \] became ] which ruined the regex.
__________________
Chen Avinadav Formerly vBulletin.org Owner and Founder chen@avinadav.com No members have liked this post.
|
||||
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
| Thread Tools | |
|
|
| New To Site? | Need Help? |
All times are GMT. The time now is 06:06.


