Parašė Soo-2· 2009 Sau. 4 19:01:42
#1
Sveiki. Cia Yra kodas kuris rodo narys ar online ar offline, jo atsijungimo laika, bet kai bunu online man rodo kas as prisijunges "0s", o turetu buti uzrasas "Online", gal zinote kame beda :?
$x = 0;
while ($data = dbarray($result)) {
$x = $x+1;
$cell = $x%2 == 0 ? "tbl1" : "tbl2";
$stat = dbcount("(*)","online","online_user = '".$data['user_id']."'") ? "<font color='#009900'>Prisijungęs</font>" : "<font color='#990000'>Atsijungęs</font>";
$stat = time()-$data['user_lastvisit'];
$iW = sprintf("%2d",floor($stat/604800));
$iD = sprintf("%2d",floor($stat/(60*60*24)));
$iH = sprintf("%02d",floor((($stat%604800)%86400)/3600));
$iM = sprintf("%02d",floor(((($stat%604800)%86400)%3600)/60));
$iS = sprintf("%02d",floor((((($stat%604800)%86400)%3600)%60)));
if ($stat < 60){
$stat= $stat."s";
} elseif ($stat < 360){
$stat= "< 5 min.";
} elseif ($iW > 0){
$stat = $iW;
} elseif ($iD > 0){
$stat = $iD;
} else {
$stat = $iH.":".$iM.":".$iS;
}