MyBB Tutorials

Online/Offline in showteam.php

Submitted by linkzy, , Thread ID: 8735

Thread Closed

RE: Online/Offline in showteam.php

#6
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.
Do not let your difficulties fill you with anxiety, after all it is only in the darkest nights that stars shine more brightly. - Ali(a.s)

Developer( PHP, Python, C++, HTML+CSS, JS I am available for Hire. Message Me for details.


Users browsing this thread: 2 Guest(s)