I noticed this didn't work using additional usergroups; only primary. So I made a couple minor changes to cache the $decimators and the users memgroupids.
Code:
global $candecimate;
global $vbulletin;
global $decimators, $allowedids;
if($vbulletin->options['sd_enabled'])
{
$candecimate = false;
if ( !$decimators )
{
$modgroups = explode(",", $vbulletin->options['modgroupid']);
$supergroups = explode(",", $vbulletin->options['supermodid']);
$admingroups = explode(",", $vbulletin->options['adminid']);
$decimators = array_merge($admingroups,$modgroups,$supergroups);
$ids = $vbulletin->userinfo['usergroupid'];
if ( $vbulletin->userinfo['membergroupids'] != "" ) $ids .= ",". $vbulletin->userinfo['membergroupids'];
$allowedids = explode( ",", $ids );
}
if(!in_array($post['usergroupid'], $decimators))
{
foreach( $allowedids AS $allowedid )
{
if(in_array($allowedid, $decimators))
{
if($vbulletin->options['sd_postmax'] > 0)
{
if($post['posts'] < $vbulletin->options['sd_postmax'])
{
$candecimate = true;
}
}
else
{
$candecimate = true;
}
}
}
}
}
else
{
$candecimate = false;
}
if($candecimate)
{
$template_hook['postbit_controls'] .= "<a href=\"#\" onclick=\"window.open('decimator.php?userid=$post[userid]&threadid=$post[threadid]&postid=$post[postid]','spam_decimator','statusbar=yes,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes,width=800,height=600'); return false;\"><img src=\"images/misc/spambutton.gif\" alt=\"Spam Decimator\" border=\"0\"></a>";
}