If you force the avatars to be square, then the aspect ratio of the images won't be preserved, and you will wind up with "squished" images. However, give this a try, and you'll see what I mean:
PHP Code:
global $vbulletin, $db; $max = 5; $output = '<div class="restore">';
$rep_users = $vbulletin->db->query_read(" SELECT user.* FROM " . TABLE_PREFIX . "user AS user WHERE options & 1024 AND usergroupid NOT IN (6,8) ORDER BY reputation DESC ");
$rcount = 0;
while ($rep_user = $db->fetch_array($rep_users) AND $rcount < $max) { $avatar_url = fetch_avatar_url($rep_user['userid']); $avatar = $avatar_url[0];
if (!$avatar) { $avatar = $vbulletin->stylevars['imgdir_misc']['imagedir'] . '/unknown.gif'; }
[20-Oct-2017 23:56:54 Europe/Rome] PHP Fatal error: Call to undefined function fetch_avatar_url() in /home/interfan/public_html/forum/includes/block/html.php(95) : eval()'d code on line 17
the forum crashes and was not available, I had to remove your code