Every time I come up against something which I once would have resorted to PHP to solve, I end up writing a little plug-in these days instead. It just feels less dirty that way…
Anyhow, this one was developed to help me out when I needed to pass a string of data from one page to another in the URL. The string in question would occasionally include a forward slash and as such the string would become split as Expression Engine interpreted it as two separate URL segments.
The ‘Encode/Decode’ plug-in takes any string of text and encodes or decodes it. Typical usage of the plug-in is as follows:
{exp:np_encodedecode style="base64" direction="encode"}{title}{/exp:np_encodedecode}
The plug-in offers ‘base64’ and ‘url’ encoding and decoding but it would be easy to add more options. For me base64 seems to work best.
Download: pi.np_encodedecode.php.zip
Obviously let me know in the comments if you have any thoughts on how this can be improved. Enjoy!
A white box arrived today containing an ‘ExpressionEngine Mug’ from the good folks at EllisLab as a thanks for my video short on ‘Why I Choose ExpressionEngine’.

It’s most awesome, primarily for its capacious capacity and then also for the ‘cut in’ ExpressionEngine ident. Now all I need is a matching T-Shirt and my life will be complete.
Thanks to all at EllisLab! :)
We have a small statement on the Nine Four website which advises new clients as to our current availability.
In general we need between 3 and 4 weeks notice to fit any significant new work in, so rather than continually update the availability statement or explain that we need 3 or 4 weeks lead time, I just used the PHP date function.
<p class="availability">We're available to work on new projects from the <?php echo date('jS of F Y', strtotime(date("d-m-Y").'+21 days' ) ); ?>.</p>
Simple really but I just thought I’d share.
For designers and developers.
Want to advertise a vacancy, email hello@nathanpitman.com.
A selection of noteworthy sites, articles or neat 'stuff'.
People keep asking, where did all your Fireworks Extensions go? They've been on holiday for quite some time, but with renewed enthusiasm for Fireworks mounting, they're back.
Involved in interactive design and development since 1995. Nathan now runs his own digital media agency called ‘Nine Four’. This is Nathan’s personal creative journal. More…
Subscribe to:
Comment