Browsing posts in: Web Programming

WordPress + TwinHelix ‘IEPNGFIX’

If you are having trouble getting the IE PNG FIX from TwinHelix to work in your WordPress theme, make sure that you set the correct path to the .htc file in your themes stylesheet.

/* To fix IE 6 or less PNG issues */
img, div, span { behavior: url(wp-content/themes/your_theme_name/ }

If the relative path doesn’t work for you, try an absolute path instead.

/* To fix IE 6 or less PNG issues */
img, div, span { behavior: url( }

You also need to set the correct path to the image file in the .htc file.

if (typeof blankImg == 'undefined') var blankImg = 'wp-content/themes/your_theme_name/images/blank.gif';

Again, if the relative path doesn’t work, try the absolute path.

Once you have both paths set correctly everything should work fine. If you’re still having problems, chances are that the paths are still incorrect. Double check them and try again.

It took me a while to figure this out, so I hope this post saves you the bother.

CodeIgniter Profiler: Globally Enable/Disable

Here is a quick tip for users of the CodeIgniter PHP Framework (and a reminder to myself). If you wish to enable or disable the profiler globally while developing your application (as opposed to changing the value in each seperate controller), you can do the following.

1. Open the config.php file in the application/config/ folder.
2. Add a new config setting using the following code:

| Globally Enable/Disable Profiler
| TRUE  = On
| FALSE = Off
$config['profiler_status'] = TRUE;

3. Then in each of the controllers that you want to the profiler to be displayed on, add the following code to the constructor.


Note: If you prefer to only have the profiler be displayed on some methods, then place the code from step 3 above into each of the methods.

Hope  this helps :)

PHP Frameworks

Recently I’ve been toying with the idea of using a PHP framework to help with the development of my web sites. The problem is, I don’t know which one to choose :(

Some of the frameworks I’ve been looking at include:

Each has there own unique advantages, but what is the best way to decide which one suits my needs the best?

Object Oriented Programming in PHP

Object Oriented Programming is the one area of PHP programming that I’m having difficulty grasping :(

I’ve managed to come to terms with functions, regular expressions and the likes, but I just can’t seem to grasp the concept of methods, and especially stuff like passing by reference! Are there any tricks other programmers out there use?
If you know of any good books, articles or tutorials that might help me in my quest to overcome this affliction, please, please, let me know!

Google Code: Web Authoring Statistics

In December 2005 we did an analysis of a sample of slightly over a billion documents, extracting information about popular class names, elements, attributes, and related metadata.

Some interesting things I picked up from the study are:

  • A whole slew of people are specifying the xml:lang attribute, which will have absolutely no effect (no HTML processor will look at that attribute; it’s an XML attribute).
  • Of the top twenty most-used attributes on body, fourteen are purely presentational.
  • The br element is a simple one, yet used on so many pages that it is the 8th most-used element. It is used more than the p element. There are very few legitimate semantic places to use this element (addresses and poems are the canonical examples), which means that most uses are probably presentational.
  • In our data sample there were twice as many pages that used the table element but didn’t use the td element
  • The script element was used on roughly half the pages we checked.

Google Code: Web Authoring Statistics