Originally posted by arg0s12
View Post
Code:
$noi = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$who."'")); $var1 = date("His",$noi[0]); $var2 = time(); $var21 = date("His",$var2); $var3 = $var21 - $var1; $var4 = date("s",$var3); echo "Idle: "; $remain = time() - $noi[0]; $idle = gettimemsg($remain); echo "$idle<br/>";
Code:
function gettimemsg($sec) { $ds = floor($sec/60/60/24); if($ds > 0) { return "$ds days"; } $hs = floor($sec/60/60); if($hs > 0) { return "$hs hours"; } $ms = floor($sec/60); if($ms > 0) { return "$ms minutes"; } return "$sec Seconds"; }
Comment