Hmm... i don't understand what you mean with your last sentence. With your code or my code the forum is hacked!? Well, I use my code, and you can use what you want

. But I think, it's more simple, when someone want to edit something, the the whole HTML-Code in one file (template) instead of two files. When you put extra HTML-Code in the ubb*.cgi files, noone can find the HTML-Tag so easy. That's the reason why UBB uses templates.
Btw: you forgot the last -Tag.