Quote:
Originally Posted by MarkFL
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'; }
$output .= '<div style="margin: 5px 0;"><img src="' . $avatar . '" style="vertical-align: middle; width: 40px; height: 40px; margin-right: 0.25em" />' . repuser_link($rep_user) . ': ' . $rep_user['reputation'] . ' Points</div>'; $rcount++; }
$output .= '</div>';
return $output;
function repuser_link($user) { global $vbulletin; $link = 'member.php?do=getinfo&username=' . $user['username'];
if ($user['displaygroupid']) { $groupid = $user['displaygroupid']; } else { $groupid = $user['usergroupid']; }
$open_tag = $vbulletin->usergroupcache[$groupid]['opentag']; $close_tag = $vbulletin->usergroupcache[$groupid]['closetag']; $title = 'Visit ' . $user['username'] . '\'s Profile'; return '<a title="' . $title . '" href="' . $link . '">' . $open_tag . $user['username'] . $close_tag . '</a>'; }
|
Hey Mark,
because of this error:
Code:
[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