Author Topic: Trying to modify a complex filter  (Read 2564 times)

arfirebird

  • Newbie
  • *
  • Posts: 9
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Trying to modify a complex filter
« on: May 17, 2002, 02:45:44 AM »
I downloaded the 3 filters for the Diamond Links (the
Superopener by BigPurpleMoon that is available over
under the "cosmetic" catagory on this board.
I like the filter a lot but wanted to change a couple
of minor things (not easy with a filter this complex
and my limited knowledge of html)...
The filter as it comes adds a diamond after some links
which when clicked opens up that link in a new window.
The other links that don't have a diamond can be opened
in a new window by clicking either of the last 2 letters
in the link.  
OK... the change I wanted to make is I wanted
to make it so that instead of clicking on the last 2 letters
in those links, that I could turn those links back to a standard link,
but add a diamond at the end of the link and make it like the
others, so that all links had diamonds
which would enable you to view the link in a new webpage.

Here's the 3 filters the way they were written by BigPurpleMoon:
==============================
Name = "Head >^ Style - Pre-Super-Opener - Option #2 (B)"
Active = TRUE
Multi = TRUE
Limit = 16
Match = "</head>|(<body)1$SET(2=<head>)"
Replace = "2"
          "<style type="text/css">"
          "#BPM-supero:hover { border: thin dotted #dd0000 }"
          "A.BPM-supero-d { font: 9pt verdana;"
          " color: #b22222; text-decoration: none;"
          " position: relative; top: -6px; left: -11px; }"
          "</style>"
          "</head>"
          "1"
          "$STOP()"

Name = "Links >^ SUPER-OPENER BETA 37 (aB) (bC)"
Active = TRUE
Multi = TRUE
Bounds = "<as*(<(\|)/a>|(<as))(^<!-- BPM_(W|A) -->)"
Limit = 450
Match = "<a"
        "("
        "([^>]++(shref=$AV(*))1[^>]+>)"
        "&&"
        "((shref=$AV(*)|starget=$AV(_blank|_new)"
        "|(sclass=$AV(*))2|(sstyle=$AV(*))3|((s[^ ]+)|>)#))+"
        ")"
        ""
        "( $NEST(<,(^(\|)/a(^?))*,> )+)4"
        ""
        "("
        "<(/a>|as)"
        "$SET(6= class="BPM-supero-d")"
        "$SET(7=◊)"
        "|"
        "(&[^; ]++; |[^<] )5"
        "($NEST(<,(^(\|)/a(^?))*,> )+ )8"
        "<((\|)/a>|as)$SET(7=<font size=-2>◊</font>)"
        "|"
        "(( (&[^; ]++;|[^<])"
        "$NEST( <,(^(\|)/a(^?))*,>)+)++{1,2})5"
        "( (&[^; ]++;|[^<])"
        " $NEST(<,(^(\|)/a(^?))*,> )+ )8"
        "<((\|)/a>|as)"
        "|"
        "( (&[^; ]++;|[^<])"
        " $NEST(<,(^(\|)/a(^?))*,> )+"
        "(&[^; ]++;|[^<])"
        " (&[^; ]++;|[^<]|$NEST(<,(^(\|)/a(^?))*,> )+)++ )5"
        "( (&[^; ]++;|[^<])"
        " $NEST(<,(^(\|)/a(^?))*,> )+"
        "(&[^; ]++;|[^<])"
        " $NEST(<,(^(\|)/a(^?))*,> )+ )8"
        "<((\|)/a>|as)"
        ")"
Replace = "<a123@45</a>"
          "<a id=BPM-supero6"
          " title=Open in new window"
          " target=_blank123>"
          "78</a>"
          "<!-- BPM_W -->"

Name = "Comments >^ Remove temporary proxomitron comment tags (C)"
Active = TRUE
Limit = 32
Match = "<!-- BPM_? -->"

===============================
Its the second filter -
Name = "Links >^ SUPER-OPENER BETA 37 (aB) (bC)"
that does most of the work.  
Here is my modification to this filter's replacement code:

======================
<a123@4578 </a>
<a id=BPM-supero 6
title=Open in new window
 target=_blank123>
<a id=BPM-supero 6
title=Open in new window
 target=_blank123<>
</a>
<!-- BPM_W -->
========================
which has the result of laying the page out the way I wanted
with diamonds after all the links, but there are 2 problems.
Problem 1 is the links that already had diamonds in the original
filter lost the hover title which said
"open in new window" after I modified it.  Problem 2
is more serious... None of the diamonds actually open a new
webbrowser, they just open the link in the same browser.
Any ideas on how to accomplish what I'm after?

I know this is a long winded question and I apologize for
asking so many questions lately, but I'm trying to figure this
stuff out.

Thanks



 
 

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Trying to modify a complex filter
« Reply #1 on: May 17, 2002, 11:05:07 AM »

hi arfirebird,
the diamond (its exact name is lozenge) was thinked only for images links. when the lozenge is added to a text link is due to a superopener fault, so if you want to add the lozenge to every text link, you need to "rewrote" superopener.

it can be done, but you must re-think the way superopener works. probably what you want can be easily done on the jd5000 version of superopener that you can find in the jd5000 filter set. search this forum and you'll find the link to download it. he realized a text link only version of superopener that you can more easily modify.

regards,
and welcome on this forum,
altosax.

 
 

arfirebird

  • Newbie
  • *
  • Posts: 9
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Trying to modify a complex filter
« Reply #2 on: May 17, 2002, 06:31:56 PM »
Thanks Altosax,
Coincidentally last night I downloaded JD5000's
filter set and merged it with mine - it has a lot
of cool stuff in it.
I ended up going back to the original Superopener
filter though, and finally came up with a modification
that gets it to work the way I was after (at least 99.9%
of the time - occasionally an odd link might come up
that it won't put a "lozenge" next to, but its rare.
(& BTW thanks for telling me the name for that -
JD5000's filter set had a comment under his modified
Superopener that pointed to a website that gave codes
for special characters and knowing the name for the
diamond shape helped me find it easier).
OK, if anyone else is interested in using my modified
version of the SuperOpener, here is the whole filter
(I'm including the matching expression because I had
to make one mod to it).
===================================
Name = "Links >^ SUPER-OPENER BETA 37 (aB) (bC)"
Active = TRUE
Multi = TRUE
Bounds = "<as*(<(\|)/a>|(<as))(^<!-- BPM_(W|A) -->)"
Limit = 450
Match = "<a"
        "("
        "([^>]++(shref=$AV(*))1[^>]+>)"
        "&&"
        "((shref=$AV(*)|starget=$AV(_blank|_new)"
        "|(sclass=$AV(*))2|(sstyle=$AV(*))3|((s[^ ]+)|>)#))+"
        ")"
        ""
        "( $NEST(<,(^(\|)/a(^?))*,> )+)4"
        ""
        "("
        "<(/a>|as)"
        "$SET(6= class="BPM-supero-d")"
        "|"
        "(&[^; ]++; |[^<] )5"
        "($NEST(<,(^(\|)/a(^?))*,> )+ )8"
        "<((\|)/a>|as)"
        "|"
        "(( (&[^; ]++;|[^<])"
        "$NEST( <,(^(\|)/a(^?))*,>)+)++{1,2})5"
        "( (&[^; ]++;|[^<])"
        " $NEST(<,(^(\|)/a(^?))*,> )+ )8"
        "<((\|)/a>|as)"
        "|"
        "( (&[^; ]++;|[^<])"
        " $NEST(<,(^(\|)/a(^?))*,> )+"
        "(&[^; ]++;|[^<])"
        " (&[^; ]++;|[^<]|$NEST(<,(^(\|)/a(^?))*,> )+)++ )5"
        "( (&[^; ]++;|[^<])"
        " $NEST(<,(^(\|)/a(^?))*,> )+"
        "(&[^; ]++;|[^<])"
        " $NEST(<,(^(\|)/a(^?))*,> )+ )8"
        "<((\|)/a>|as)"
        ")"
Replace = "<a123@4578 </a>"
        "<a id=BPM-supero"
        " title=Open in new window"
        " target=_blank123>◊"
        "</a>"
        "<!-- BPM_W -->"

====================================

Tweaked the filter a bit since original post so updated
this post - only changed the matching expression.


Edited by - arfirebird on 18 May 2002  06:41:16
 

arfirebird

  • Newbie
  • *
  • Posts: 9
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Trying to modify a complex filter
« Reply #3 on: May 17, 2002, 06:43:06 PM »
One thing I just noticed after I posted that mod:
in the Replace code, on the line that starts with
" target=_blank123> the lozenge symbol
that follows it displays as the symbol on the screen
instead of the code you use to get the symobol to
appear, so following the " target=_blank123>
use this code to get it to display the lozenge "& loz"
(without the quotes and without the space between the
"&" and the "loz") then follow it with a ";"
so that it looks like:
" target=_blank123>& loz;"
again, removing the space between the & and the loz.






 
 

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Trying to modify a complex filter
« Reply #4 on: May 20, 2002, 02:33:12 PM »

what arfirebird is trying to say is:

&loz;

regards,
altosax.

 
 

arfirebird

  • Newbie
  • *
  • Posts: 9
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Trying to modify a complex filter
« Reply #5 on: May 20, 2002, 04:47:16 PM »
Thanks  I wasn't sure how to type that without having
it show as the symbol

 
 

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Trying to modify a complex filter
« Reply #6 on: May 20, 2002, 06:57:09 PM »
Use &amp;loz; :)