Yes, you will need to create a new "Forum Block."
Follow:
AdminCP -> Forums & Moderators -> Forum Blocks Manager
At the bottom of the form, click "Add Block".
From the drop-down menu for "Select Block Type", choose "Custom HTML/PHP" then click "Continue".
You will be presented with a form for defining your new block. Give it a title, such as "Top 5 Reputations" and a description. I recommend caching the block for at least 60 minutes, this way the database need only be queried once an hour. Set the display order so that it shows where you desire in the sidebar.
For "Content Type" select "PHP".
And for the content, add the following code:
PHP Code:
global $vbulletin, $db;
$max = 5;
$output = '<div class="restore"><ul>';
$rep_users = $vbulletin->db->query_read("
SELECT user.*
FROM " . TABLE_PREFIX . "user AS user
WHERE options & 1024
AND usergroupid != 8
ORDER BY reputation DESC
");
$rcount = 0;
while ($rep_user = $db->fetch_array($rep_users) AND $rcount < $max)
{
$output .= '<li>' . repuser_link($rep_user) . ': ' . $rep_user['reputation'] . ' Points</li>';
$rcount++;
}
$output .= '</ul></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>';
}
Change the line:
to match the number of users you wish to display.
Note: Users who have elected to hide their reputations will not be displayed. It only makes sense to honor this setting here. Also, banned users are excluded.
If you have any changes to the way the users are displayed, please let me know. The usernames are shown with their username markup, and link to their profiles.