ALTER TABLE `dd_users` ADD `last_on` INT NOT NULL AFTER `plays` ;
$usrdata = $db->fetch_row($db->query(sprintf('SELECT * FROM dd_users WHERE userid=\'%u\'', $suserid)));
$db->query("UPDATE dd_users SET last_on = unix_timestamp() WHERE userid = '$suserid'");
<?php$max = '70';$show = clean($_GET['page']);if(empty($show)){$show = 1;}$limits = ($show - 1) * $max; $r = $db->query(sprintf("SELECT * FROM dd_users ORDER BY userid DESC LIMIT $limits,$max"));$totalres = mysql_result($db->query('SELECT COUNT(userid) AS total FROM dd_users'),0); $totalpages = ceil($totalres / $max); echo '<table width="89%" align="center"> <tr> <td colspan=\'5\' class=\'header4\'>User List</td> </tr><tr><Th>#</th><th class="header4">User Name</th><th class="header4">Play Count</th><th class="header4">Online</th><th class="header4">Profile</th><th></th></tr>';while($ir = $db->fetch_row($r)){if($ir['last_on'] >= time()-15*60){ $online = '<font color=green><b>Online</b></font>'; }else{ $online = '<font color=red><b>Offline</b></font>'; }echo ' <tr><td class="content4">'.$ir['userid'].'</td><td class="content4">'.$ir['username'].'</td><td class="content4">'.$ir['plays'].'</td><td class="content4">'.$online.'</td><td class="content4"><a href="#">View Profile</a></td></tr>';}echo '</table><div align="center">Pages: ';for($i = 1; $i <= $totalpages; $i++){ echo '<a href="#" class="pagenat">'.$i.'</a> </div. ';}echo '<p>';$pgname = 'Member list';?>