MyBB Tutorials
Who was online today [No plugin]
Submitted by Tutti Frutti, 24-12-2017, 12:53 AM, Thread ID: 66388
Thread Closed
Step 1: Go to the templates of your theme, open index templates, and then enter index_whosonline
Within index_whosonline, add this below all the code that already exists:
Now enter "Who's Online Templates" or "Who's online", and then online_today.
Replace the entire template with the following:
Now go to the template online_today_row and replace all the code with the following:
Any css that is GLOBAL, add the following
Now to show all users you have to edit a core file of MyBB, in this case it is online.php.
Open the file online.php, look for this line:
Delete (, "limit" => $ perpage, "limit_start" => $ start), thus remaining
Within index_whosonline, add this below all the code that already exists:
Code:
<script type="text/javascript">
jQuery(function(){
jQuery(".latestonlines").load("{$mybb->settings['bburl']}/online.php?action=today .latestonlines_index");
});
</script>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><i style="font-size: 14px;" class="fa fa-users fa-fw effect"></i>Who was online today?</td>
</tr>
<tr>
<td class="trow1">
<div class="latestonlines"></div>
</td>
</tr>
</table>
Now enter "Who's Online Templates" or "Who's online", and then online_today.
Replace the entire template with the following:
Code:
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->online_today}</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead thead_left" align="center" width="50%"><span class="smalltext"><strong>{$lang->on_username}</strong></span></td>
<td class="thead thead_right" align="center" width="50%"><span class="smalltext"><strong>{$lang->time}</strong></span></td>
</tr>
<span class="latestonlines_index smalltext">
{$onlinetoday}<br /><br />
{$todayrows}
</span>
<tr>
<td align="center" colspan="2" class="trow1" style="white-space: nowrap">{$onlinetoday}</td>
</tr>
</table>
<br />
{$multipage}
{$footer}
</body>
</html>
Now go to the template online_today_row and replace all the code with the following:
Code:
{$online['profilelink']},
Any css that is GLOBAL, add the following
Code:
.latestonlines_index {
position: relative;
}
.latestonlines_index:after {
content: "";
position: absolute;
background: #F5F5F5;
width: 15px;
height: 15px;
right: -10px;
}
Now to show all users you have to edit a core file of MyBB, in this case it is online.php.
Open the file online.php, look for this line:
Code:
$query = $db->simple_select("users", "*", "lastactive > '{$threshold}'", array("order_by" => "lastactive", "order_dir" => "desc", "limit" => $perpage, "limit_start" => $start));
Delete (, "limit" => $ perpage, "limit_start" => $ start), thus remaining
Code:
$query = $db->simple_select("users", "*", "lastactive > '{$threshold}'", array("order_by" => "lastactive", "order_dir" => "desc"));
This hidden content has been reported as still working 0 times this month.
1 times in total
RE: Who was online today [No plugin]
24-12-2017, 01:12 AM
#2 Is this for mybb? if it is thank you and I will use it for my forum! <3 Thank you
RE: Who was online today [No plugin]
24-12-2017, 01:12 AMMilanZake Wrote: Is this for mybb? if it is thank you and I will use it for my forum! <3 Thank you
Well it's in the MyBB Tutorials section so duh lol.
RE: Who was online today [No plugin]
04-01-2018, 01:55 AM
#4 24-12-2017, 12:53 AMTuttiFrutti Wrote: Step 1: Go to the templates of your theme, open index templates, and then enter index_whosonline
Within index_whosonline, add this below all the code that already exists:
Code:<script type="text/javascript">
jQuery(function(){
jQuery(".latestonlines").load("{$mybb->settings['bburl']}/online.php?action=today .latestonlines_index");
});
</script>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><i style="font-size: 14px;" class="fa fa-users fa-fw effect"></i>Who was online today?</td>
</tr>
<tr>
<td class="trow1">
<div class="latestonlines"></div>
</td>
</tr>
</table>
Now enter "Who's Online Templates" or "Who's online", and then online_today.
Replace the entire template with the following:
Code:<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->online_today}</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead thead_left" align="center" width="50%"><span class="smalltext"><strong>{$lang->on_username}</strong></span></td>
<td class="thead thead_right" align="center" width="50%"><span class="smalltext"><strong>{$lang->time}</strong></span></td>
</tr>
<span class="latestonlines_index smalltext">
{$onlinetoday}<br /><br />
{$todayrows}
</span>
<tr>
<td align="center" colspan="2" class="trow1" style="white-space: nowrap">{$onlinetoday}</td>
</tr>
</table>
<br />
{$multipage}
{$footer}
</body>
</html>
Now go to the template online_today_row and replace all the code with the following:
Code:{$online['profilelink']},
Any css that is GLOBAL, add the following
Code:.latestonlines_index {
position: relative;
}
.latestonlines_index:after {
content: "";
position: absolute;
background: #F5F5F5;
width: 15px;
height: 15px;
right: -10px;
}
Now to show all users you have to edit a core file of MyBB, in this case it is online.php.
Open the file online.php, look for this line:
Code:$query = $db->simple_select("users", "*", "lastactive > '{$threshold}'", array("order_by" => "lastactive", "order_dir" => "desc", "limit" => $perpage, "limit_start" => $start));
Delete (, "limit" => $ perpage, "limit_start" => $ start), thus remaining
Code:$query = $db->simple_select("users", "*", "lastactive > '{$threshold}'", array("order_by" => "lastactive", "order_dir" => "desc"));
thank you for this :helps out
RE: Who was online today [No plugin]
14-03-2018, 03:46 AM
#5 Could you provide a screenshot of what it would look like?
Users browsing this thread: 2 Guest(s)