It's an interesting way you have made it check for user permissions - based on cookies.

It's causing some issues with some members on my site... but I think I may have fixed it. Will report here if I have. For most members this is working well. I'll see if I can modify this to require global.php, so this can use all the normal vB variables - which means you can use the normal vB style colors, as well as normal vB permissions - no need to add extra queries to do this, plus queries to check censored words etc.