That works, but I have a nice way of doing it. I'm going to see about getting it into a plugin instead of the code mod that it is currently, and it gives some nice options in the ACP too.
I could release the code mod version now, but I'd rather wait till I have it written as a plugin instead as it makes life a lot easier for everyone concerned.