Add a column called usergroupicon to your usergroup table.
in your showthread.php add
PHP Code:
$icon = $DB_site->query("SELECT usergroupid,usergroupicon FROM usergroup ORDER by usergroupid");
while($icons = $DB_site->fetch_array($icon)) {
$icon_cache["$icons[usergroupid]"] = $icons[usergroupicon];
}
unset($icons);
$DB_site->free_result($icon);
You then add global $icon_cache; in the getpostbit function in /admin/functions.php and then just add $icon_cache["$post[usergroupid]"] in the postbit template. I think, not tested this is all off the top of my head.