Parašė Mantas_· 2009 Vas. 28 19:02:09
#4
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
$lastseen = time() - $data['user_lastvisit'];
$iW=sprintf("%2d",floor($lastseen/604800));
$iD=sprintf("%2d",floor($lastseen/(60*60*24)));
$iH=sprintf("%02d",floor((($lastseen%604800)%86400)/3600));
$iM=sprintf("%02d",floor(((($lastseen%604800)%86400)%3600)/60));
$iS=sprintf("%02d",floor((((($lastseen%604800)%86400)%3600)%60)));
if ($lastseen < 60){
$lastseen= Prisijunges;
} elseif ($lastseen < 360){
$lastseen="< 5min";
} elseif ($iW > 0){
if ($iW == 1) { $text = Savaitė; } else { $text = Savaitės; }
$lastseen = $iW." ".$text;
} elseif ($iD > 0){
if ($iD == 1) { $text = Diena; } else { $text = Dienos; }
$lastseen = $iD." ".$text;
} else {
$lastseen = $iH.":".$iM.":".$iS;
}
echo "<tr>\n<td class='side-small' align='left'><img src='".THEME."images/bullet.gif' alt=''>\n";
echo "<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".$data['user_name']."' class='side'>\n";
echo trimlink($data['user_name'], 15)."</a></td><td class='side-small' align='right'>".$lastseen."</td>\n</tr>\n";
}
}