2007-02-27, 12:06 PM
Hey,
Open global.php
Find
Now in the footer template put
Or you can put this code in Side Boxes additional boxes.
Editing the login box of side boxes which is the same as the portal, will affect both.
regards
Open global.php
Find
$bbclosedwarning = '';
if($mybb->settings['boardclosed'] == "yes" && $mybb->usergroup['cancp'] == "yes")
{
eval("\$bbclosedwarning = \"".$templates->get("global_boardclosed_warning")."\";");
}
Below put$whosonline = '';
if($mybb->settings['showwol'] != "no" && $mybb->usergroup['canviewonline'] != "no")
{
$lang->load("index");
// Get the online users.
$timesearch = time() - $mybb->settings['wolcutoffmins']*60;
$comma = '';
$query = $db->query("
SELECT s.sid, s.ip, s.uid, s.time, s.location, u.username, u.invisible, u.usergroup, u.displaygroup
FROM ".TABLE_PREFIX."sessions s
LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
WHERE s.time>'$timesearch'
ORDER BY u.username ASC, s.time DESC
");
$membercount = 0;
$onlinemembers = '';
$guestcount = 0;
$anoncount = 0;
$doneusers = array();
// Loop through all users.
while($user = $db->fetch_array($query))
{
// Create a key to test if this user is a search bot.
$botkey = strtolower(str_replace("bot=", '', $user['sid']));
// Decide what type of user we are dealing with.
if($user['uid'] > 0)
{
// The user is registered.
if($doneusers[$user['uid']] < $user['time'] || !$doneusers[$user['uid']])
{
// If the user is logged in anonymously, update the count for that.
if($user['invisible'] == "yes")
{
++$anoncount;
}
++$membercount;
if($user['invisible'] != "yes" || $mybb->usergroup['canviewwolinvis'] == "yes" || $user['uid'] == $mybb->user['uid'])
{
// If this usergroup can see anonymously logged-in users, mark them.
if($user['invisible'] == "yes")
{
$invisiblemark = "*";
}
else
{
$invisiblemark = '';
}
// Properly format the username and assign the template.
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
eval("\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit", 1, 0)."\";");
$comma = ", ";
}
// This user has been handled.
$doneusers[$user['uid']] = $user['time'];
}
}
elseif(strstr($user['sid'], "bot=") !== false && $session->bots[$botkey])
{
// The user is a search bot.
$onlinemembers .= $comma.format_name($session->bots[$botkey], $session->botgroup);
$comma = ", ";
++$botcount;
}
else
{
// The user is a guest.
++$guestcount;
}
}
// Build the who's online bit on the index page.
$onlinecount = $membercount + $guestcount;
if($onlinecount != 1)
{
$onlinebit = $lang->online_online_plural;
}
else
{
$onlinebit = $lang->online_online_singular;
}
if($membercount != 1)
{
$memberbit = $lang->online_member_plural;
}
else
{
$memberbit = $lang->online_member_singular;
}
if($anoncount != 1)
{
$anonbit = $lang->online_anon_plural;
}
else
{
$anonbit = $lang->online_anon_singular;
}
if($guestcount != 1)
{
$guestbit = $lang->online_guest_plural;
}
else
{
$guestbit = $lang->online_guest_singular;
}
$lang->online_note = sprintf($lang->online_note, my_number_format($onlinecount), $onlinebit, $mybb->settings['wolcutoffmins'], my_number_format($membercount), $memberbit, my_number_format($anoncount), $anonbit, my_number_format($guestcount), $guestbit);
eval("\$whosonline = \"".$templates->get("index_whosonline")."\";");
}
This is the same code as the one on index.php, so remove it from index.php and just keep this new one in global.phpNow in the footer template put
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="tcat"><strong>{$lang->whos_online}</strong> [<a href="online.php">{$lang->complete_list}</a>]</td>
</tr>
<tr>
<td class="trow1"><span class="smalltext">{$lang->online_note}<br />{$onlinemembers}</span></td>
</tr>
</table>
<br />
Or you can put this code in Side Boxes additional boxes.
Editing the login box of side boxes which is the same as the portal, will affect both.
regards