A basic date_diff for PHP 5.2

I came across a problem having developed a site with a PHP 5.3 environment, when moving the site to the live environment the server was running PHP 5.2. Whilst the server gets upgraded I looked into getting the code to work in some form in the meantime. The main issues are the functions lcfirst() and date_diff(). The former is a simple fix, a function which lower-cases the first letter of a string — I was surprised this was only introduced in 5.3!

Filed under Development, Snippets

Quantity vs Quality

As my reader may have noticed, I took a hiatus from posting on here until recently. I came back a couple of weeks ago to try and get back into the habit of writing posts, and I set myself the target of publishing a post every Wednesday. I spend around about 12 hours a day on the web, or coding for it. Being able to share some of the fruits of that time ought to come naturally.

Filed under News

Understanding SEF routing for Joomla Components

Developing bespoke components for Joomla can be quite daunting. There are a lot of resources, books, dev articles and the API documentation; these try to give you a basic understanding of how things should be laid out. A lot of these work on the premise of learning by doing. Many of the documented examples from the API point developers to look at the core components to see how it works.

Configuring an effective component router can be quite tricky, as it depends on how complex your component is. This article serves as a reference for how routing works in Joomla, why it’s important, and how you could make better use of component routing in your projects.

Filed under Articles, Development, Web

File validation with jQuery and HTML5

I have been dealing with file uploads a lot recently, and I stumbled upon a few different methods for validating files which provide both basic file-type checking and file size checking before uploading.

The web app was already making use of jQuery with the excellent jQuery validation plugin; so I wrote a couple of extended validators.

Filed under Development, Snippets, Web

Playing with Incarna in EVE Online

Although my online gaming time has been sparse recently, I thought it would be good to take some time out and look at the new features coming to EVE Online this year. After reading the devlog post that Incarna functionality was being tested on Duality, I decided to take a peek. After spending quite a lot of time crafting my character, I was quite happy to wait an hour to grab the Duality client (4GB+) and take my avatar for a spin.

Filed under Articles, News

Filter a category from your WordPress Blog

I’m pretty new to working with the internals of WordPress. It seems very easy to settle for installing hundreds of plug-ins to achieve the simplest of tasks. Plug-ins are awkward for me, as they have the tendancy to not quite do what I want them to. I end up messing with them in some way which breaks updates.

Filed under Development, Snippets

Brief History of Fonts on the Web

For years, web designers have been yearning for custom fonts in web design. It’s a real shame that web fonts didn’t really take off with IE4 in 1997! The web was a different place back then, web design was a pretty new thing. Bandwidth was highly constrained at the time, so one could not imagine waiting for web fonts to load. Microsoft’s container format of choice is also EOT, which is a Microsoft proprietary technology. Although everybody slates it’s proprietary and closed nature, it was sort of a good idea. EOT provides domain locking, encryption, sub-setting and compression – all good things for convincing those behemoth font foundries to allow web embedding licenses.

Now is a better time than ever to move away from the standard web-safe fonts. Mainstream browsers have caught up with IE, over a decade later. Here is a short history lesson on the many techniques that Web Designers have been using to get beautiful type into their pages.

Filed under Articles, CSS, Web

Friday Update #1

My ten visitors may have noticed it was quiet over here for the last week and a half. For the last fortnight, I have been moving home. We began sorting and packing our belongings 3 weeks prior to that, yet we were still moving things out at 10:30 the night before the deadline. Probably because there was so much to clean and fix at the old place. It’s quite amazing how much shit you can stuff into one house. In total it’s taken a full week just to move our stuff and fix the place up. This includes 3 1/2 hours to get a sofa through a door, which was ridiculous. I did feel guilty that Bob – our sole surviving goldfish – was one of the last to move.

Filed under News

Speeding up your page load times

Just by configuring your site and server in the right way, you can get much faster and responsive load times out of your CMS. With mainstream open source CMS software, you are given the ability to add bolt-on functionality. It’s common for each of these add-ons to provide their own set of CSS definitions, images and JavaScript. This makes these add-ons easy to implement for non-technical users. If you aren’t careful though, you will end up with tens or even hundreds of CSS and JavaScript files. This has a performance penalty, which can affect your rankings in the SERPs.

Filed under Articles, Servers, Web

Override core widget output in WordPress

Another snippet for the WordPress theme developers out there. I decided that the category widget didn’t display the post count in a very nice-looking way. So I found a nice support post that demonstrates the user of add_filter() to alter output of the category widget. Not the most ideal way to do things in my opinion, but it does the job.

add_filter('wp_list_categories', 'cat_count_span_inline');
function cat_count_span_inline($output) {
	$output = str_replace(' (','',$output);
	$output = str_replace(')','',$output);
	return $output;

Via wordpress.org

Filed under Snippets