echo "<table><tr>"; $sql = "SELECT distinct uid, uname, user_avatar, last_login FROM ".$xoopsDB->prefix("users")." WHERE level > 0 AND uid NOT IN (0) AND last_login >= '" . $time . "' ORDER BY last_login DESC"; $result = $xoopsDB->query($sql);
while (list($uid, $uname,$user_avatar,$last_login) = $xoopsDB->fetchRow($result) ) { //Put this variable in the echo statements where you would like them to show up. $sinceLastLogin = ' ' . timeDifference($last_login,$now,'hours') . ' ago '; $kira++; if ($user_avatar == 'blank.gif') { echo "<td style='padding:5px;text-align:center'><a href='".XOOPS_URL."/userinfo.php?uid=".$uid."'><img src='".XOOPS_URL."/uploads/blank_avatar.gif' title='".$uname."' border='0' alt='".$uname."' height='48' width='48'></a><br /><a href='".XOOPS_URL."/userinfo.php?uid=".$uid."'>".$uname."</a><br />$sinceLastLogin</td>"; }
This will show:
Hours if it is greater than 0;
Minutes if they are greater than 0;
Seconds if they are greater than 0, and if Hours and Minutes are == 0;