Jamie Holding's Blog

Password Hashing - How to Make It Not Suck. A Basic Guide.

| Comments

When you register for websites or online services, you have to set a password to enable yourself to login again in the future. Your username and password needs to be stored in a database so that when you ask to login, the server can verify your details are correct and allow you access.

Let’s look at the basic way of doing this (btw, the WRONG way) and then work our way up to how most websites (should) be storing your password.

(comic from

WordPress How to: Default Images to Link to the File

| Comments

My own website seems to handle this just fine, maybe it’s because I actually explore the options inside WordPress and it defaults to what I like.

However, when running a website for a large group of other people to mess around with, all their images link to an attachment page rather than the image itself (which causes havoc for shadowbox plugins etc.)

So, you can force the default link to be the file (or the attachment page… or even blank if you would like).

Goto the “secret WordPress options page” at (obviously, replace with your domain)

Find the option “image_default_link_type” and change as required:

  • leave - it blank no URL at all
  • file - Default to File URL eg. /wp-content/image.png
  • post - Default to Attachment Page URL eg. /?attachment=111

WordPress How to: Disable the Admin Bar in WordPress 3.1

| Comments

This may be helpful to those WordPress developers who want to keep their site as it was without the new admin bar arriving with WordPress 3.1 soon.

Simply use this code in your there’s function.php file or add it to a new file in the plugins folder and activate.

add_filter( 'show_admin_bar', '__return_false' );
remove_action( 'personal_options', '_admin_bar_preferences' );

Loricum - the Video Game Free Download

| Comments

The project is finally over, after a number of “post-release” issues, we’ve now got the full version (that is the full version - version 2) online for free.

If you haven’t been following my Twitter/Blog, Loricum is a Video Game developed by a group of young people aged 13-18. They were taught how to program by myself for the first time and they created the entire game themselves - including the art, music, storyline, coding, video and animations.

It was a wonderful experience to work with so many creative young people. It was a first-time teaching for me, first-time programming for them - and I think the result is spectacular all considering.

I’ve created a download portal for the game so we can log the number of downloads etc.

Download Loricum - The Video Game

Also, click here to read my article/blog-post about my experiences teaching this course to the young people.

Creating Dynamic Userbars in PHP

| Comments

A number of sites I’ve worked on have dynamic Userbars available for elements around the site. These are really useful for creating dynamic counters/countdowns etc.

To make it easier for myself so I could very quickly make more Userbars wherever I wanted, I built a PHP class that creates a GD image object containing a custom Userbar. With that object, you can save it to an image, output it to screen, store it in memory, store it in a database or whatever you need.

Here is an example that the given library produces by default (note, this example is saved and not dynamic itself):


  • Customisable:
    • Text
    • Background gradient colours
    • Icon
  • Reasonably efficient
  • Returned as a GD object, so you can do what you wish with the result
  • Includes font for creating the famous block text-effect


To use this library, first check out the code on my GitHub


Check out the infamous Silk Icon Set for some fantastic icons that fit perfectly in the userbar size

Display simple event countdowns for websites that span multiple timezones

Loricum - the Video Game

| Comments

What is Loricum?

Loricum is a point and click adventure game created entirely by a group of young people aged between 13-18 years old.

I’m very proud to have been the leading mentor on this project, teaching the youth group basic game design, how to create working graphics and finally a rather intense number of days teaching them a well-developed programming language.

Some Press coverage:

Made possible by Med Theatre

Continue reading for my summary and discussion of the project.

Authenticating XMPP Ejabberd With WordPress Through XML-RPC

| Comments

I was recently installing Ejabberd and wanted to integrate it with a Wordpress installation. I’m pretty nifty at hacking about with Wordpress, so thought I’d challenge myself to do it as neatly as possible.

To do this, we need:

  • An authentication script for Ejabberd to communicate with Wordpress
  • Configure Ejabberd to use the authentication script
  • Add a new XML-RPC method to Wordpress to allow user-login checking