Quote:
Originally Posted by Boofo
Why would you want a blank table there?
Oh, wait, we're talking about LW. Never mind. 
|
Haha, your too old to understand a young mans mind
To get a seperate box for the users, replace all the code in the hook: admin_index_mail with this:
PHP Code:
require_once(DIR . '/includes/functions_bigthree.php');
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$numbervisible = 0;
$numberregistered = 0;
$numberguest = 0;
$forumusers = $db->query_read("
SELECT
user.username, (user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid,
session.userid, session.inforum, session.lastactivity,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "session AS session
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid)
WHERE session.lastactivity > $datecut
" . iif($vbulletin->options['displayloggedin'] == 1, "ORDER BY username ASC") . "
");
if ($vbulletin->userinfo['userid'])
{
// fakes the user being online for an initial page view of index.php
$vbulletin->userinfo['joingroupid'] = iif($vbulletin->userinfo['displaygroupid'], $vbulletin->userinfo['displaygroupid'], $vbulletin->userinfo['usergroupid']);
$userinfos = array
(
$vbulletin->userinfo['userid'] => array
(
'userid' => $vbulletin->userinfo['userid'],
'username' => $vbulletin->userinfo['username'],
'invisible' => $vbulletin->userinfo['invisible'],
'inforum' => 0,
'lastactivity' => TIMENOW,
'usergroupid' => $vbulletin->userinfo['usergroupid'],
'displaygroupid' => $vbulletin->userinfo['displaygroupid'],
)
);
}
else
{
$userinfos = array();
}
$inforum = array();
while ($loggedin = $db->fetch_array($forumusers))
{
$userid = $loggedin['userid'];
if (!$userid)
{ // Guest
$numberguest++;
$inforum["$loggedin[inforum]"]++;
}
else if (empty($userinfos["$userid"]) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity']))
{
$userinfos["$userid"] = $loggedin;
}
}
if (!$vbulletin->userinfo['userid'] AND $numberguest == 0)
{
$numberguest++;
}
foreach ($userinfos AS $userid => $loggedin)
{
$numberregistered++;
if ($userid != $vbulletin->userinfo['userid'])
{
$inforum["$loggedin[inforum]"]++;
}
$loggedin['username'] = fetch_musername($loggedin);
if (fetch_online_status($loggedin))
{
$numbervisible++;
$activeusers .= ", <a href=\"user.php?$session[sessionurl]do=edit&u=$loggedin[userid]\">$loggedin[username]</a>$loggedin[invisiblemark]$loggedin[buddymark]";
}
}
// memory saving
unset($userinfos, $loggedin);
$activeusers = substr($activeusers, 2);
print_table_break();
print_table_header($vbphrase['users_online']);
print_label_row($activeusers);
print_table_break();