Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 28 Feb 2002, 07:05
Palmer ofShinra's Avatar
Palmer ofShinra Palmer ofShinra is offline
 
Join Date: Oct 2001
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?
Reply With Quote
  #2  
Old 28 Feb 2002, 10:55
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
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
Reply With Quote
  #3  
Old 28 Feb 2002, 13:32
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
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!
Reply With Quote
  #4  
Old 28 Feb 2002, 13:35
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
actually here's the link, its the first post.

http://www.vbulletin.com/forum/showt...threadid=24595

Thanks!
__________________
Make someone smile today!
Reply With Quote
  #5  
Old 03 Mar 2002, 07:24
Palmer ofShinra's Avatar
Palmer ofShinra Palmer ofShinra is offline
 
Join Date: Oct 2001
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.
Reply With Quote
  #6  
Old 03 Mar 2002, 09:49
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
This should work:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Yup:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com

Last edited by Chen : 03 Mar 2002 at 10:06.
Reply With Quote
  #7  
Old 04 Mar 2002, 11:31
Palmer ofShinra's Avatar
Palmer ofShinra Palmer ofShinra is offline
 
Join Date: Oct 2001
Thanks... except it doesn't seem to be working.

I put this line into the bbcodeparse2 function in functions.php

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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
Reply With Quote
  #8  
Old 04 Mar 2002, 12:23
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
Did you globalize $bbuserinfo in bbcodeparse2()?
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #9  
Old 05 Mar 2002, 05:29
Palmer ofShinra's Avatar
Palmer ofShinra Palmer ofShinra is offline
 
Join Date: Oct 2001
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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(the 2 comment lines are other regexes that didn't work as well)

The line is inserted into the function just before this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Attached Images
File Type: jpg pic1.jpg (3.2 KB, 11 views)
Reply With Quote
  #10  
Old 05 Mar 2002, 15:07
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

vBulletin removes some \ so \] became ] which ruined the regex.
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #11  
Old 06 Mar 2002, 08:41
Palmer ofShinra's Avatar
Palmer ofShinra Palmer ofShinra is offline
 
Join Date: Oct 2001
*nods knowingly and wonders what he's supposed to do with this information now*
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 06:06.

Layout Options | Width: Wide Color: