Parašė Prometėjas· 2009 Spa. 21 14:10:52
#7
Na manau sitas tau tiks
openside("name");
$result = dbquery("SELECT * FROM ".$db_prefix."users ORDER BY user_lastvisit DESC LIMIT 0,12");
echo "<table width='340' cellpadding='0' cellspacing='0'>\n<tr>\n<td valign='top'>\n";
if (dbrows($result) != 0) {
$n = 1;
while ($data = dbarray($result)) {
if ($data['user_lastvisit'] != 0) {
$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 = "[ Tinkle ]";
} elseif ($lastseen < 360){
$lastseen = "[ < 5 min ]";
} elseif ($iW > 0){
if ($iW == 1) {
$text = "savaitæ";
} else {
$text = "savaites";
}
$lastseen = "[ ".$iW." ".$Text." ]";
} elseif ($iD > 0){
if ($iD == 1) {
$text = "dienà";
} else {
$text = "dienas";
}
$lastseen = "[ ".$iD." ".$text." ]";
} else {
$lastseen = "[ Prieð ".$iH.":".$iM.":".$iS." ]";
}
} else {
$lastseen = "[ Neaktyvus ]";
}
echo "<table cellpadding='0' cellspacing='0' width='140'>";
echo "<tr>\n<td class='small' align='left'><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'>".$data['user_name']."</a></td>\n";
echo "<td align='right' style='color: #3FC8F6'>".$lastseen."</td>\n</tr>\n";
echo "</table>\n";
if($n == 6) { echo "</td><td valign='top'>\n"; }
$n++;
}
}
echo "</td>
</tr>
</table>\n";
closeside();
Jei negaila +10 galetum