Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthordwclifton
    • CommentTimeAug 2nd 2005 edited
     # 1
    There seems to be a lot of clammor for this, how did that one guy put it? Chew off his arm or something...anyway, if you look under the Smilies discussion, the SmartyPants thread, and so on, a lot of people are interested in writing extensions that filter comments after a formatter has done its thing.

    I can think of several good reasons to want to do this:

    * Comment spam -- filter URLs in links to viagra/gambling/porn sites.
    * Filter language -- what if my site is rated G?

    Smilies and Smartypants are two more good examples.

    Help Mr. Vanilla Guru, help!
    •  
      CommentAuthorMark
    • CommentTimeAug 2nd 2005 edited
     # 2
    Right now you'd have to write your own extended formatters to accomplish this.

    for example:
    1. Write a smiley formatter.
    2. Write a markdown formatter.
    3. Include those two formatters in a new file - a la include_once("path/to/your/formatters/smileys.php");
    4. Write a new "base" formatter like a text or html formatter.
    5. Instantiate your other two formatters (smiley and markdown) and add them to your base formatter's formatters collection.
    6. Make sure that your base formatter's parse method loops through those extra formatters when it's finished it's own parsing methods.
  1.  # 3
    i think it'd be much better in general if all formatters were called when parsing comments unless they were told not to. that way you could mix and match. assuming this would work.
    •  
      CommentAuthordwclifton
    • CommentTimeAug 2nd 2005
     # 4
    Whoa! I guess then I was correct after studying your code Mark, I really thought I was missing some simple way of doing this.

    Oh well, too much work for a universal comment filter. Perhaps as you develop the system some more you'll come up with an easier way to do this sort of thing.

    Thanks.
    •  
      CommentAuthordwclifton
    • CommentTimeAug 2nd 2005
     # 5
    BTW, my favorite feature so far is the external style URL. I can come here and it's formatted exactly the same way as it is on my own site. That rocks.
    •  
      CommentAuthorichigo
    • CommentTimeAug 3rd 2005
     # 6
    i would say it would be really great if you could extend the core so that it would be easier to do such an extention...

    i think there may be many fancy extentions coming..

    for example editing usual amazon links to amazon links with your amazon partner id and similar stuff...and yeah of course smilies and spam protection and smpartypants and such stuff..
    •  
      CommentAuthorMark
    • CommentTimeAug 3rd 2005 edited
     # 7
    It doesn't get much easier than it already is.
    If you want to chain together text, html, and markdown formatting, take the code that is already written and include them all into one formatter. It's EASY.
    •  
      CommentAuthordwclifton
    • CommentTimeAug 7th 2005
     # 8
    A comment filter should be independant of whatever formatter the user chooses to use.
Add your comments
    Username Password
  • Format comments as