Online ∆ Cred

Shortcodes for Drupal

Word­Press’ Short­code API is a really cool thing, and since I’m work­ing on a Dru­pal site these days I’ve been look­ing for some­thing sim­i­lar. Unfor­tu­nately I couldn’t find any­thing… There are some imple­men­ta­tions out there but the ones I found and tested always come pre-bundled with spe­cific tags and don’t always pro­vide an exten­si­ble and sta­ble logic.

So I made mine!

Most of my work sim­ply con­sisted in copying/pasting the code in Word­Press’ shortcodes.php and bind­ing it into a Dru­pal fil­ter. Easy enough.

Now if you want to use it, you have to:

  1. Get the module
  2. Add it to your “mod­ules” directory
  3. Enable it
  4. Add it to one of your setup’s fil­ter bundle
  5. Write your own mod­ule where you’d imple­ment one or more Short­codes (via add_shortcode) and make sure you add “depen­den­cies[] = short­codes” in your .info file

You might expe­ri­ence a nasty “Call to unde­fined func­tion add_shortcode”. If so, you have to change you mod­ule implementation’s weight, either directly in your data­base, or thanks to the cool Util­ity mod­ule. Set it to 10 and you’re set!

Elsewhere II

2010.

Happy new year, folks!

In Stores Soon

I’ve been look­ing for ideas for my 2010 greet­ing card and finally found what I was look­ing for. Dur­ing the process I devel­oped sev­eral iter­a­tions that didn’t made the final cut, I selected two of them that are not that bad but not good enough for prime time!

The “ad” version

ad

The “flash­back trip­tych” version

Since it’s a trip­tych it needs more space, so I set up a ded­i­cated page… Go see it!

What now?

The actual greet­ing card will be posted in January!

Cercle et suite d’éclats

font-size:huge;

FileWatch

I wanted to try Flex 4 with a “real life” project so I wrote this lit­tle thing. Rough draft.

FileWatch

The app will allow you to mon­i­tor files changes: select a text file and you’ll be prompted when it’s updated. Basic. By the way, did I say “rough draft” before?

Every­thing in it is Open­Source, from the Illus­tra­tor files to the MXML and CSS stuff, so play with it! For those who only want the .air, here it is.

Now, why is it cool?

  • Build with the brand new Flex 4 (Gumbo) framework
  • Uses a home-brewed Icon­But­ton class, because Gumbo doesn’t pro­vide any
  • Uses the new Spark cus­tom skins logic (on But­ton, Scroll­Bar and more…)
  • Uses the new states’ logic and transitions
  • Based on as3corelib’s File­Mon­i­tor class
  • Shows you how to build a multi-instance AIR app
  • Con­tains Illustrator/Photoshop UI files

And why is it not that cool?

  • Prob­a­bly still buggy, wait for updates!
  • Flex 4 is not done yet, so the code might break at any time
  • No icons yet
  • No or very few comments
  • Pretty use­less app!

If you’re try­ing to learn Flex/Flex 4 or won­der­ing what’s new in it and how to use it you should defin­i­tively give it a go…

Have ques­tions? Drop’em!

DeltaInc

TWPlaylist

I wanted to do this for quite some time: a place that logs tracks I lis­ten to.

TWPlaylist

Intro­duc­ing TWPlaylist! Thanks to Twit­ter and a Winamp Plu­gin, all tracks that I lis­ten to (at work) are stored on a dummy account (if you know a plu­gin that does the same for iTunes, please let me know). And to keep things nice and smooth, I set up a quick page that pulls this data and dis­plays it thanks to some AJAX magic… Tracks link to a Discogs search page to find more about them.

As you can read the project page’s bot­tom, every­thing I wrote is open­source. HTML, CSS and JS ; help your­self. Noth­ing too fancy, but it could pre­vent you from wast­ing time… By the way, the code should be self-explanatory, but if it’s not I can help.

You will prob­a­bly notice the some tracks’ data look weird, in fact the Winamp plu­gin chokes on spe­cial char­ac­ters such as “&” and accented let­ters… I hope this gets fixed one day.

I’ve never been a big fan of Twit­ter as I think most user don’t use it the way it should be used, for exam­ple by hav­ing pri­vate dis­cus­sions or retweet­ing too much. How­ever it’s a pretty inter­est­ing plat­form for exper­i­men­ta­tion and art projects. What do you think?

[Sept. 2011 Update] I “donated” the twplaylist Twit­ter account to a char­ity cam­paign, so I moved the account archives to twplaylist_bckp.