// TODO: Find a better way to work around Smarty's minimal looping logic
// TODO: Find a better way to work around Smarty's minimal looping logic
foreach($authinstancesas$key=>$val){
if(!empty($authinstances)){
$authinstances[$key]->index=$key;
foreach($authinstancesas$key=>$val){
$authinstances[$key]->total=$c;
$authinstances[$key]->index=$key;
$instancearray[]=$val->id;
$authinstances[$key]->total=$c;
}
$instancearray[]=$val->id;
}
$instancestring=implode(',',$instancearray);
$instancestring=implode(',',$instancearray);
$inuserecords=array();
$inuserecords=array();
$records=get_records_sql_assoc('select authinstance, count(id) from {usr} where authinstance in ('.$instancestring.') group by authinstance',array());
if($records=get_records_sql_assoc('select authinstance, count(id) from {usr} where authinstance in ('.$instancestring.') group by authinstance',array())){