Post Reply 
[Req] Would like to filter [Color] code with Proxomitron
Jan. 27, 2009, 11:16 PM (This post was last modified: Jan. 27, 2009 11:29 PM by WWWJunkie.)
Post: #1
[Req] Would like to filter [Color] code with Proxomitron
I'd like to filter a statement like this. This was cut and paste from the source of the webpage.

Code:
<textarea name="message" id="vB_Editor_001_textarea" rows="10" cols="60" style="display:block; width:500px; height:250px" tabindex="1" dir="ltr">[QUOTE=justme;24585376][COLOR=&quot;Teal&quot;]One thing really bothers me is these annoying colors[/COLOR][/QUOTE]

</textarea>

How do I match and replace the [COLOR=&quot;Teal&quot;] and [/COLOR], since it is blocked [] I'm having difficulties. I've created other filters, but they were very simple, and straight-forward, so I still consider myself a newbie at best.

Actually I don't need to replace it with anything, I want to remove it with the filter.

.txt  quote2.txt (Size: 275 bytes / Downloads: 693) Sorry when I cut and pasted the page read it as bbcode I would assume.

So I added an attachment to this page in txt format so that one can see the source that I was referring to.
Add Thank You Quote this message in a reply
Jan. 27, 2009, 11:36 PM
Post: #2
RE: [Req] Would like to filter [Color] code with Proxomitron
You can match "[", "]" by escaping them: "\[", "\]".
However, i wonder if you really want to match forum color tags, that is, filtering your own posts while submitting.

The actual text coloring page code most likely looks like:
Code:
<span style="color: teal;">One thing really bothers me is these annoying colors</span>
Add Thank You Quote this message in a reply
Jan. 27, 2009, 11:40 PM
Post: #3
RE: [Req] Would like to filter [Color] code with Proxomitron
(Jan. 27, 2009 11:36 PM)sidki3003 Wrote:  You can match "[", "]" by escaping them: "\[", "\]".
However, i wonder if you really want to match forum color tags, that is, filtering your own posts while submitting.

The actual text coloring page code most likely looks like:
Code:
<span style="color: teal;">One thing really bothers me is these annoying colors</span>

Well basically I have changed the webpage to all black with <font color=*> and replaced it with <font color=black>.....but when I quote someone I want it to the be black as well. So by removing the color code it will go to the default black post. I know it sounds weird. Smile!

BTW Thank you for the reply.
Add Thank You Quote this message in a reply
Jan. 27, 2009, 11:41 PM
Post: #4
RE: [Req] Would like to filter [Color] code with Proxomitron
Welcome!

Here's a quick filter:

Code:
[Patterns]
Name = "Remove [COLOR]"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 512
Match = "\[COLOR=\w\]"
        "$INEST(\[COLOR=\w\],\[/COLOR\])"
        "\[/COLOR\]"

Note that I had to escape [ and ] with a backslash as they are special characters in Proxomitron Smile!

If you find that it's not removing an instance, try increasing the byte limit.

EDIT: Whoops!

Try this:

Code:
[Patterns]
Name = "Remove [COLOR]"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 50
Match = "(\[COLOR=\w\]|\[/COLOR\])"
Visit this user's website
Add Thank You Quote this message in a reply
Jan. 27, 2009, 11:44 PM
Post: #5
RE: [Req] Would like to filter [Color] code with Proxomitron
(Jan. 27, 2009 11:41 PM)Kye-U Wrote:  Welcome!

Here's a quick filter:

Code:
[Patterns]
Name = "Remove [COLOR]"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 512
Match = "\[COLOR=\w\]"
        "$INEST(\[COLOR=\w\],\[/COLOR\])"
        "\[/COLOR\]"

Note that I had to escape [ and ] with a backslash as they are special characters in Proxomitron Smile!

If you find that it's not removing an instance, try increasing the byte limit.

Thank you I do see that, that definitely looks like that will be a valuable technique that you both have shown me for future filter.
Add Thank You Quote this message in a reply
Jan. 27, 2009, 11:48 PM
Post: #6
RE: [Req] Would like to filter [Color] code with Proxomitron
I added another filter in my post; the first filter removed the entire COLOR tag, along with its contents. The second one removes just the COLOR tags Wink
Visit this user's website
Add Thank You Quote this message in a reply
Jan. 31, 2009, 08:45 PM (This post was last modified: Jan. 31, 2009 09:02 PM by WWWJunkie.)
Post: #7
RE: [Req] Would like to filter [Color] code with Proxomitron
Just doing a test
<textProxA>Sorry to bother you guys again. I really do appreciate your help thus far, but I can't get the filter to work on the webpage, though it works in the test area of proxomitron.

So if anyone can help, basically if you quote my post, I would like proxomitron to filter out the color code. As in the test above if I view the source of the newreply I see this code.

Code:
<textarea id="message" name="message" rows="20" cols="70" tabindex="2" ><textProxA>[quote='WWWJunkie' pid='11012' dateline='1233434733']
[color=#C71585]Just doing a test[/color]
[/quote]

<textProxE></textarea>

So when I click on the quote button, proxomitron already filters out the
Code:
[color=#C71585]
and the
Code:
[/color]

Is it something to do with CSS or javascript that I am missing and proxomitron isn't filtering it out by default? Sorry to be such a newbie.

<textProxE>
Add Thank You Quote this message in a reply
Jan. 31, 2009, 09:37 PM
Post: #8
RE: [Req] Would like to filter [Color] code with Proxomitron
(Jan. 31, 2009 08:45 PM)WWWJunkie Wrote:  Just doing a test
<textProxA> <snip> <textProxE>

<textProxA> and <textProxE> are temporary tags i'm generating to protect textareas.

So if you happen to use a sidki/JD/Grypen config, you need to untick _both_ textarea protectors (thus risking to break things considerably).

Or write a textarea filter that matches the entire tag block (bounds match), which is preferable for a variety of reasons anyway, and place it somewhere at the top in the "Web Page Filters" window.
Add Thank You Quote this message in a reply
Jan. 31, 2009, 09:52 PM
Post: #9
RE: [Req] Would like to filter [Color] code with Proxomitron
Something like:
Code:
[Patterns]
Name = "Remove BB "color" Tags"
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "<textarea*</textarea >"
Limit = 16384
Match = "(\#\[/+color*\])+\#"
Replace = "\@"
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: