11
That will just show the rank ID and not the actual rank.
$user->rank(); will give the rank name, but with an SQL query for each user.
Try this instead:
$sql = "SELECT rank_id AS id, rank_title AS title, rank_image AS image FROM ".$db->prefix('ranks');
$result = $db->query($sql);
while ($rank = $db->fetchArray($result)) {
$ranks[$rank['id']] = $rank;
}
$users = $member_handler->getObjects(new Criteria('level', 0, '>'));
foreach ($users as $user) {
echo $user->getVar('uname').' | '.$ranks[$user->getVar('rank')].'
';
}