change 3,4,5 to forums you want it ran in.
--------------- Added [DATE]1361812033[/DATE] at [TIME]1361812033[/TIME] ---------------
PHP Code:
if (in_array($thread['forumid'], array(3,4,5)))
{
$current_thread = $thread['threadid'];
$query = $vbulletin->db->query_first_slave("
SELECT user.usergroupid, user.membergroupids
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = thread.firstpostid)
WHERE thread.threadid = " . $current_thread . "
");
$primary_group = $query['usergroupid'];
$secondary_groups = $query['membergroupids'];
if(!empty($secondary_groups)) {
$groups = $primary_group . "," . $secondary_groups;
} else {
$groups = $primary_group;
}
$groups_all = explode(",", $groups);
} else {
$groups_all = array();
}
vB_Template::preRegister('threadbit',array('group' => $groups_all));
This is the proper working code. The reason the first conditional threw an error was because when you visit a forum not listed in the 3,4,5 the template threadbit was still looking for the $group array and it wasn't defined. New code puts null array in place so there isn't an error.