I don't have the code at hand unfortunately. It's specific to Coppermine as well, so if you want you can go and take a look at their forums. You are bound to find the solution still there.