I wrote this a number of years ago, and the code is badly in need of some serious revision if I want to use it in a more serious capacity. It functioned okay for what I wanted it to do and was decent practice, but I ended up dropping it in favor of PHPBB.