I'm not a php guru dude at all, I just have a vague understanding of the basics and can only write the most basic of code (like I'll go back and forth from dreamweaver to php.net copy/pasting etc

) but i do understand what you mean.
There is not ANY data available in threadbit besides the username of the threadstarter?
Wouldn't it be simple enough just to add each username to an array, then check all the usernames in the array and and assign their usergroups with one query, before each individual thread is loaded? Like I said I don't know too much about PHP and wouldn't know how to create such a function, but since the username is available and there are no duplicate usernames in the db couldn't it be done by creating one array and executing one query with it?