MyBB Tutorials
Who was online today [No plugin]
Submitted by Tutti Frutti, 24-12-2017, 12:53 AM, Thread ID: 66388
Thread Closed
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
Users browsing this thread: 1 Guest(s)