Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Transmogrifier Extension! (0.9.3+ only)

edited December 2006 in Vanilla 1.0 Help
I wanted to write a separate "smilies" extension for 0.9.3, but it became pretty clear that it would serve as a much more general utility to transform any string to any other string, so I renamed it "Transmogrifier" for obvious reasons.

Extension for 0.9.3 revision 196 and above

Extension for 0.9.3 revision 195 and below

It reads replacement strings from ./extensions/Transmogrifier/config.txt, and should be fairly good about ignoring empty lines and whitespace. Any line that starts with a pound sign (#) is considered a comment.

One small annoyance: The following characters ^.[$()|*+?{\ must be escaped with a backslash on the left side of the '==' only. Fixed.

Give it a try!

Does not work on 0.9.2.x!!!!

Comments

  • Nice Bergamot!
  • One thing I love about PHP is that there's a preexisting function for *everything*.
  • Probably gonna point out here, that this extension expects you to already have smilies in your /images/ directory prior to using this or you will see broken images. So to save Bergamot from answering that, you'll have to come up with or find your own smilies :)
  • edited February 2006
    Oh, I forgot to mention that!

    The config file included is mainly an example to teach people the syntax; you can give it whatever paths you want. It only links to 5 emoticons by default anyway:

    :) == <img alt=":)" src="./images/emoticons/smile.gif" /> :-) == <img alt=":-)" src="./images/emoticons/smile.gif" /> :( == <img alt=":(" src="./images/emoticons/frown.gif" /> :-( == <img alt=":-(" src="./images/emoticons/frown.gif" /> ;) == <img alt=";)" src="./images/emoticons/wink.gif" /> ;-) == <img alt=";-)" src="./images/emoticons/wink.gif" /> :P == <img alt=":P" src="./images/emoticons/tongue.gif" /> :-P == <img alt=":-P" src="./images/emoticons/tongue.gif" /> :D == <img alt=":D" src="./images/emoticons/biggrin.gif" /> :-D == <img alt=":-D" src="./images/emoticons/biggrin.gif" /> M$ == Microsoft
    As you can see, stuff on the left side of the == is transmogrified into the stuff on the right side. I chose '==' because I didn't think it would be used much in common emoticons or HTML.

    Also, it's important to note that the replacement only happens when the text is displayed, so the database copy stays clean.
  • edited February 2006
    Heh... it can be transmogrified to the curse word censor that was requested: http://lussumo.com/community/discussion/339/extension-request-curse-word-autocensor/ Now anybody want to work on that swear list? lol.
  • Actually, I built it out of parts of the SwearFilter extension that comes with vanilla. Its swear list is extremely comprehensive, and could be easily modified to work with this plugin.
  • I stand corrected. It was transmogrified FROM the swear filter. :-) Looks like I need to play with Vanilla more.
  • Is there a 0.9.3 Extensions page i can submit these to?
  • edited February 2006
    C-uniT == <img alt="Troll" src="http://www.37signals.com/svn/images/37icon-troll-big.gif" />
  • I would reocmmend dropping that troll icon onto your own server instead of bogging down 37signals :)
  • I think he was joking...
  • There is an extensions section on the wiki btw bergamot. Just make yourself an account there and set up a 0.9.3 section. I think mark is developing something to make extension grabbing much easier in v1 but i cant see him arguing in the meantime if you want to post it up somewhere.
  • Hey, I know this topic is probably dead but I was wondering if this could be extended for use outside a post, mainly to discussion topics as users can still have swear words in the title. But, my main reason is for a clean and easy way to replace [sticky] with an image.
  • It can be done via CSS (read here).
  • Since the [sticky] isn't part of the topic of the discussion, it wouldn't help much.

    As far as the rest goes, I have no idea if it's possible to add a string formatter to discussion topics. I bet it is, but I also bet I have no idea how to do it.
  • edited December 2006
    I'm not having any luck with this. I uploaded the smilies to my /images/emoticons folder (yes, that is the correct path even though it's the same as in the example) and plugged in the transmogrifier and turned it on.

    I still get the text instead of the image. This is also the case with the Vanillacons extension.
This discussion has been closed.