1. Open head.php and change this:
- Code: Select all
if ($action == 'dologin'){
$sql->update(array(
'table' => 'users',
'where' => array("username = $username"),
'values' => array('last_visit' => (time() + $config_date_adjust * 60))
));
}
to this:
- Code: Select all
if ($action == 'logout'){
$sql->update(array(
'table' => 'users',
'where' => array("username = $username"),
'values' => array('last_visit' => (time() + $config_date_adjust * 60 - 301))
));
}
else{
$sql->update(array(
'table' => 'users',
'where' => array("username = $username"),
'values' => array('last_visit' => (time() + $config_date_adjust * 60))
));
}
2. Open inc/mod/main.mdu and change this:
- Code: Select all
<?
}
?>
</table>
<td>
<td>
to this:
- Code: Select all
<?
}
if($member['level'] == 1){
$check_time = time() + $config_date_adjust * 60 - 300;
$online_users = '';
foreach($sql->select(array('table' => 'users', 'where' => array("level > 1", 'and', "last_visit > ".$check_time))) as $row){
$online_users .= ($row['name'] ? $row['name'] : $row['username']).', ';
}
$online_users = substr($online_users, 0, -2);
?>
<tr><td>Users online</td><td width="50%"><?=$online_users; ?></td></tr>
<?
}
?>
</table>
<td>
<td>
