Oxygen Kiosk

Blog

Ads For Your Blog: Simple Code for Calling OpenX’s Single Page Call Within Wordpress Using current_post

Advertising is one of those “necessary evils” of the web, and of non-ecommerce blogs in particular. For blogs which aren’t associated with a particular product or revenue-generating business, advertising is the main way to pay the bills. It’s not something which generally enhances a site, but we try our hardest to ensure that it’s not actively detracting from the important bits of a site.

openx-adblocks.jpg

One thing which can seriously detract is the increased load time when a site is filled with ads. This not only comes from the actual images and other assets which are loaded for each ad block, but often those blocks are generated by chunks of javascript, which can add rather a large amount of code to the HTML page, even before any imagery is loaded.

Most blogs start out with Google’s Adsense, and then eventually graduate to Ad Manager if there’s enough advertiser interest that they can start selling their inventory directly. However, Google does have some vast shortcomings, so when your sites get big enough, you start looking around for ad-serving alternatives, and inevitably come upon OpenX.

The Standard Way of Calling Ads

We’re about to launch a redesign for a fantastic australian blog (more on that soon), who have a sizable roster of advertisers. They can have over 20 ad blocks of various sizes on some of their pages, so using “traditional” OpenX ad calls was not only time-consuming to add to the site, but it was adding a huge amount of HTML weight. Here’s what the “standard” OpenX ad block code looks like:

<!--/* OpenX Javascript Tag v2.8.1 */-->
<script type='text/javascript'><!--//<![CDATA[
   var m3_u = (location.protocol=='https:'?'https://example.com/www/delivery/ajs.php':'http://example.com/www/delivery/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
   document.write ("?zoneid=11");
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
   document.write ("&amp;loc=" + escape(window.location));
   if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
   if (document.context) document.write ("&context=" + escape(document.context));
   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
   document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://example.com/www/delivery/ck.php?n=a86ff4c4&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://example.com/www/delivery/avw.php?zoneid=11&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a86ff4c4' border='0' alt='' /></a></noscript>

It’s a bit messy, but not so bad by itself. However, when you’ve got 8 of these blocks all together, and another dozen spread across the rest of the page, it gets rather hefty. The front page of the site in question, without ads, weighs in at a bit over 600 lines of HTML. Dropping in 20 ad blocks brings it up to just under 1000 lines.

As I said. Hefty.
Read more

Spammers, Evildoers, and Opportunists, or: Why Oxygen Kiosk doesn’t offer SEO Services

I had a chat with a new client the other day about why we don’t consider “Search Engine Optimization” an optional extra, or even a service that we offer.

This morning there was a great string of posts on Merlin Mann’s twitter:

If you’re “insulted” by criticism of SEO, go write a novel or work at a food bank. With all respect, find a job worth fake-defending. [link]

Shorter: “SEO” is either 1. Common Sense (clean code, good urls & titles); or 2. Cheating (most everything else). Learn “1″; Exorcise “2″. [link]

Once worked at an SEO-optimized bar. Sign said we were an emergency room but our house special was 1 oz. of urine and 9 ads for other bars. [link]

These led me back to this post by Derek Powazek (@fraying on Twitter), which sums up the issues we have with the SEO industry, (and then continues to deride SEO people generally, which is fine too, they don’t do much which makes me feel like defending them from derision.)
Read more

Open Migration: Rescuing Content and Images from Squarespace

We’re currently helping our clients at Dubspot migrate their blog from Squarespace to a new system which will be built around a multi-user setup of Wordpress.

Squarespace’s propaganda goes on about “Total Data Portability”, and how “your data is yours to keep”. However, when it comes to moving to another system, there’s no automated method to get your images and other files out. You can use a “data export” to create a Movable Type formatted export of your posts (which will import fine to most blogging engines), leaving your images in their proprietary file system, to which you only have web access, and no functionality to create an archive for downloading.

I asked Squarespace support if there was any other way to get our images out, and their response was “Currently there is no feature for this — each file will need to be downloaded individually from File Storage, sorry about this.”

I asked if we could get a Squarespace dev to compress the directory so we could download it, and got various permutations of “that feature doesn’t exist, but I can suggest it as a future feature” from 3 different Squarespace support people:

squarespace-support-1.jpg

Fortunately, while all this frustration was going on, I figured out a sneaky little system to allow me to download all of the images directly from their web interface. It uses Firefox and the DownThemAll extension.
Read more

Handy CSS Test Cases

Over at oksushi.com I’ve linked to a number of handy little CSS test cases that I’ve been creating in my IRC time on #css.

I hope they help someone, somewhere, with a CSS problem.

Wordpress Post Image Resources

We’re doing some advanced Wordpress templating and hacking for the new version of the awesome The Motor Report blog, and trying to do some cool things with images from posts. Rather than requiring authors to manually define “feature” images, we’d like wordpress to automatically generate various thumbnails for search results, feature post scrollers etc.

So hence, some interesting/useful resources on the subject:

Get Images Attached to a Post: Requires functions.php hacking, gets attachments from the database, rather than through brute force search of the post content.

Get the first image from the wordpress post and display it: Requires some functions.php hacking, searches the actual post text, and has the advantage of getting the first actual image in the post, rather than the first image uploaded and associated with the post.

Simple Image Grabber Wordpress Plugin:

Also interesting: Related Posts with Thumbs plugin.

Magento Ecommerce

Hi everyone – I have written a post outlining the various costs we were faced with developing a large site with Magento Ecommerce over at my site.

Hopefully, some of you will learn from my mistakes!

Wordpress Developer-Friendly Plugins List

We spend quite a bit of time with the awesome open source Content Management System Wordpress. A huge amount of Wordpress’ power comes from the vast range of plugins available. On the flip side: As a developer trying to create a website with fast, clean, valid code, plugins can cause problems by injecting styles into their HTML output or into the head of the template. We’ve also had issues with plugins loading their own versions of common JavaScript libraries, ending up with redundant and possibly conflicting JS loads.

It’s understandable that this can happen. Plugins are generally designed to allow functionality without any template editing, and automatically including CSS and JS means that your plugin can look “right” to most users. However, we believe that plugins which include this kind of code should have “Developer Friendly” options, which allow you to turn off these includes and keep full control over how your site is styled.

A specific example: The PXS Mail Form plugin is a simple, light WP plugin which looks for code and replaces it with, yes, an email form. It’s getting rather old (last update was 2005), and there are mail form plugins with greater functionality, but PXS wins over the newer, flashier ones because of this simple feature:

PXS Mail Options

It allows you to turn this extra CSS off.

Of course, a developer who’s smart enough to know they don’t want multiple lightbox.js versions embedded in their template or style declarations in their content is probably smart enough to also know how to hack it out of the plugin responsible, and we’ve done so on many occasions. This causes problems for upgrading though, we have to document these changes and remember to re-apply them whenever the plugin is upgraded, which makes more work for us, and more expense for our clients.

So, whenever we can, we try to use plugins which either don’t do these “unfriendly” things, or give us the option to disable them. So this is a list of plugins we’ve discovered which are Developer Friendly:

PXS Mail

Cal’s Queensland Government design launches

Last year I worked full time for the Queensland Government, as part of the Smart Service Queensland team, where I was contracted to redevelop the main Queensland Government website qld.gov.au. Initially contracted for a short three month stint, this quickly blew out to a six month, then a nine month contract, as the site was a mess.

Read more

New Oxygen Kiosk layout

This year is a year of big changes for me. At the end of 2007, many different threads of my life seemed to come to an end, leaving me at the beginning of this year with a lot less baggage. Because of this, I have relocated to Sydney to open another branch of the Oxygen Kiosk.

This means that from my sunny desk in the eastern suburbs I will be working hard to expand the business down here. It also means that I will have a lot more time to spend with our existing clients, developing new solutions for them.

And, to celebrate the new year, we have a brand new website design for you. Same colours, different ideas. Please, send the link to your friends!

So, an exciting year for everyone. Bring on 2008!

O2KPTYLTDFTW

We’ve registered as a company today. Along with my aquisition (finally) of oxygenkiosk.com, we are now officially Oxygen Kiosk PTY LTD. Yes, we’ve dropped the the. We hope that that won’t confuse you.

Unhappily, after the painless process of registering the company, we’ve been let down by the ATO’s ABN application process:

The service standard as outlined in the Taxpayer Charter for the issue of an ABN is 28 days.

10 minutes to get the ACN and business registration, then a month to get an ABN? A month in which we can’t get a bank account?

Good work ATO, loving your service standard and Taxpayer Charter.

So happy to have my fixed–up amp back from the shop — I could be imagining, but it sounds better than before… 3 days ago

  • Cal Wilson

We spend a lot of our free time on the internet. Here are some of the more interesting things we have come across of late.

Cal's del.icio.us links


Fatal error: Call to undefined function delicious_bookmarks() in /home/o2knew/public_html/wp-content/themes/o2k5/index.php on line 97