Les Stroud Official Website

As the resident “web guy” for Les Stroud Productions, I was tasked with maintaining and improving upon the flagship website for Les Stroud.

Built on WordPress this site has seen many changes since I started working on it and is a great example of a “working” site. Many website are built and then left alone but this site is constantly evolving.

Whether it be the addition of jquery scrollbars and lightboxes, HTML 5 video fallback for iOS or Flash video on the homepage (with graceful fallback of course) this site is always looking to provide it’s visitors with a great user experience.

The original artwork was done by Luke Despatie & The Design Firm.

Easy Analytics

** EDIT – 02/08/13 **
I just committed a complete overhaul of my Easy Analytics plugin. It was in dire need of it and I am far happier with it. It is class based now with proper localization techniques, and a much better looking (albeit simple) interface. If you have it installed already, thanks and you should get the notification soon. If not, download it here.

 

** EDIT – 12/12/11**

I have just committed a slightly updated version of the plugin to the repository to allow for localization.

This is a very simple plug-in that allows any WordPress user to add the Google Analytics tracking code snippet to their site.

All you have to do is install the plugin, activate it and enter your UA-XXXXX number. It will output the snippet just before the </body> tag of your site.

For custom themes, be sure you call the wp_footer() function in your footer file as this plugin utilizes it to insert the code.

Download it here

WordPress and Flash

Typically we have always created Flash sites from scratch and used XML or, in the case of Rush.com, a custom-made CMS as the content source

For the bulk of our clients having a custom-made CMS doesn’t work with their budget so we are left with XML. This is a great option for simple updates or if the user has some modicum of web savvy but for the average person it can be daunting to update.

I have dabbled in using Drupal and creating a DruFlash type of site but found that Drupal’s interface was not as user friendly as I would like for clients.

Personally I really like how WordPress is put together – it makes sense, is easy to use and the advanced features are there but not in the way. It also seems that people in the realm of marketing and PR have at least a little experience with it so in my opinion it was the obvious choice to tie into a Flash based site.

The Issues

The first issue I ran into was the most obvious – How do I get the content out of WordPress? The answer was much simpler than I was expecting. I found a pre-existing plug-in for WordPress called Flash API. It is not for the average user as it utilizes some custom PHP and a custom class in AS3 to pull the content out of WordPress.

This is a complete tangent but I learned a while ago that there are no gold stars for re-inventing the wheel when it comes to code. If someone else has taken the time to solve your problem for you – thank them (by giving credit where you can), expand on it if you can and move on.

The second issue I ran into was – getting around limited HTML tag support in Flash HTML textfields. This took a little bit of thinking. The first thing I did was figure out what WordPress used when making something bold, italics or a different colour and balance that with what options the client wanted.

Once I knew the code that WP created, I just used some basic regular expressions and string manipulations in Flash to change the tags to ones that Flash supported.

At that point I thought I was out of the woods as far as getting the content out of WP but after uploading to the testing server I found that there were times that the content didn’t load but it was very random.

I figured out that the issue lay in how often I was querying WP. The original plan was to pull the content for a given section only when I needed it and sometimes the Flash portion of the site was loading before the content was ready and due to the way the artwork and transitions worked I couldn’t drop an event listener in to wait for it. Long story short, the section would load without content. Which is not really good web design.

So after some thinking, I decided to revamp my AS3 class to pull all of the content at once in the root swf before the site loaded where I could control the load with event listeners and incorporate some error handling and fallback options.

The upside of doing this was that once the site pulled the content we were free of WP and any potential connection issues. The downside was that the whole site needed to be reloaded to see new content but that’s a small price to pay for the increased stability.

Overall I found the process to be great. There were times when I wanted to lose my sh*t over it but I can see the benefits of building a reusable code base for this use.