MyBB Tutorials

Online/Offline in showteam.php

Submitted by linkzy, , Thread ID: 8735

Thread Closed

RE: Online/Offline in showteam.php

OP
#7
10-08-2015, 07:42 PM
Sozin Wrote:
Code:
$timesearch = TIME_NOW - (int)$mybb->settings['wolcutoff'];
$status = $db->fetch_array( $db->query("
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, 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."' AND s.uid ='".$users['uid']."'
") );

$status = empty($status) ? 'Offline' : 'Online';

Put this inside the while loop and use $status in template.

*I did not test it.

Worked fine mate. Thanks alot Smile
Solved
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |



Users browsing this thread: 3 Guest(s)