Post Reply 
[Req] Remove user posted comments
Aug. 11, 2008, 03:06 AM
Post: #4
RE: [Req] Remove user posted comments
Code:
[Patterns]
Name = "Remove Comments"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 40
Match = "(<((d|u|o)l)\0([^>]++)\2>)\3$SET(flags=f$GET(flags))"
        "($TST(\2=*(id|class)=$AV(([a-z_-]++|)comment(s|list))*)"
        "$SET(1=<br />\r\nComments: <a href="javascript:;" onclick="document.getElementById('prx_hide_comments').style.display='block';">Show</a> | "
        "<a href="javascript:;" onclick="document.getElementById('prx_hide_comments').style.display='none';">Hide</a><br /><br />\r\n"
        "<div id="prx_hide_comments" style="display: none;">\r\n\3)$SET(match=\0)"
        "|$SET(1=\3))"
        "|</($TST(match))\9 >"
        "($TST(flags=ff(?*)\0&$SET(flags=\0))$SET(1=</\9>)"
        "|$TST(flags=f&$SET(flags=))$SET(1=</\9>\r\n</div>)$SET(match=))"
Replace = "\1"

Here you go!

In this filter I use Mizz Mona's technique on flagging tags, and how it matches comment containers is by comparing the ID or CLASS attribute value to a list of specific "comment" names. It allows you to toggle comments (Show/Hide).

If you find that it doesn't work on a specific site, view the source code, identify the name for the comments container, change the following expression in the filter:

Quote:$AV(([a-z_-]++|)comments)

To:

Quote:$AV(([a-z_-]++|)comments|containername)
Visit this user's website
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
[Req] Remove user posted comments - Guest - Aug. 07, 2008, 10:52 PM
RE: [Req] Remove user posted comments - Kye-U - Aug. 07, 2008, 10:55 PM
RE: [Req] Remove user posted comments - Guest - Aug. 11, 2008, 12:13 AM
RE: [Req] Remove user posted comments - Kye-U - Aug. 11, 2008 03:06 AM
RE: [Req] Remove user posted comments - Guest - Aug. 12, 2008, 10:15 AM
RE: [Req] Remove user posted comments - Kye-U - Aug. 13, 2008, 03:19 AM
RE: [Req] Remove user posted comments - Guest - Aug. 15, 2008, 12:52 AM

Forum Jump: