Gordonmac Dot Com

Mostly a web development blog

Category: Tutorials

Little nuggets of information about Wordpress, CSS, SASS, PHP, SEO and Adobe products.

Prettier PHP meter to feet/inches conversions

Posted: February 15th, 2011 | Tags: | Posted in: PHP, Tutorials

Whilst it’s fairly simple to convert meters to feet and inches using PHP the resulting conversion often looks rather complex and untidy. For example, most conversions will end up looking something like this: 12 meters = 39.3700 feet. This is not very pretty and looks overly complicated when …
Read more…

Recursive file deletion with PHP

Posted: February 18th, 2008 | Tags: | Posted in: PHP, Tutorials

This is a handy PHP function (I can’t remember where I found it) which performs a recursive deletion of every file in a given directory. I’ve been using it to periodically flush cache files created by my CMS on this site. function destroy($dir) { $mydir = opendir($dir); while(false …
Read more…

Styling previous and next links

Posted: January 26th, 2008 | Tags: | Posted in: CSS, Tutorials

Previous and next “pagination” is a fairly common design element found on sites. As the name suggests, it’s a simple navigation structure designed to allow users to move forward to the next, or return to the previous page in a sequence of documents. The purpose of this type …
Read more…

Styling search forms

Posted: December 16th, 2007 | Tags: | Posted in: CSS, Tutorials

Many people argue against removing browser default styles for form elements, especial replacing the default submit input with an image. This for the simple fact that text in an image cannot be resized by the user. However, forms are a continual interest for me, and where possible I …
Read more…

Styling dates with CSS

Posted: November 29th, 2007 | Tags: | Posted in: CSS, Tutorials

I have seen similar styling of blog post dates on many blogs, and always thought it was a rather neat way of doing it. Tonight I decided to have a go for myself and discovered that it’s pretty darn simple really. All it takes is an image, a …
Read more…