(2014-10-25, 05:36 PM)coxuso Wrote: index.php on line 319 :-)
Hey bud! Thanks for taking the time to reply back, that is awesome! You are great!
Check this out, I would love to get your opinion on this, below is my portal.php, after being manipulated to show "Who's online, on the portal page and
it creates the same who's online as the index page,
but I can't figure out where to manipulate the code to ouput to show only 9 online members online,
this is what it will look like when only 9 members are showing, anything beyond 9 members will screw up the layout, do you think you can take a look at the code and give me your opinion, in all regards, I'm so grateful for the help you've given me!
portal.php with added codefor user's online
$timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
$comma = '';
$guestcount = $membercount = $botcount = $anoncount = 0;
$onlinemembers = '';
$doneusers = array();
$query = $db->query("
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup, u.avatar
FROM ".TABLE_PREFIX."sessions s
LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
WHERE s.time>'$timesearch'
ORDER BY {$order_by}, {$order_by2}
");
while($user = $db->fetch_array($query))
{
// Create a key to test if this user is a search bot.
$botkey = my_strtolower(str_replace("bot=", '', $user['sid']));
if($user['uid'] == "0")
{
++$guestcount;
}
elseif(my_strpos($user['sid'], "bot=") !== false && $session->bots[$botkey])
{
// The user is a search bot.
$onlinemembers .= $comma.format_name($session->bots[$botkey], $session->botgroup);
$comma = $lang->comma;
++$botcount;
}
else
{
if(empty($doneusers[$user['uid']]) || $doneusers[$user['uid']] < $user['time'])
{
++$membercount;
$doneusers[$user['uid']] = $user['time'];
// If the user is logged in anonymously, update the count for that.
if($user['invisible'] == 1)
{
++$anoncount;
}
if($user['invisible'] == 1)
{
$invisiblemark = "*";
}
else
{
$invisiblemark = '';
}
if(($user['invisible'] == 1 && ($mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])) || $user['invisible'] != 1)
{
// Properly format the username and assign the template.
// $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
// $user['profilelink'] = build_profile_link($user['username'], $user['uid']);
$user['profilepath'] = $mybb->settings['bburl'] . '/' . get_profile_link($user['uid']);
if(!$user['avatar'])
{
$user['avatar'] = $mybb->settings['bburl'] . '/imgs/images.png';
}
eval("\$onlinemembers .= \"".$templates->get("portal_whosonline_memberbit", 1, 0)."\";");
$comma = $lang->comma;
}
}
}
}