Parašė And2s· 2009 Bir. 19 15:06:27
#2
openside("NARIAI");
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr><td><div class='komen'>";
echo "\n";
$result=dbquery("SELECT * FROM ".$db_prefix."users WHERE user_lastvisit>'0' AND user_status='0' ORDER BY user_lastvisit DESC LIMIT 0,10"); //<<LIMIT WYSWIETLANYCH U¯YTKOWNIKÓW//
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="<img src='".IMAGES."online.gif' height='11' width='52'>\n"; //<<uzytkownik online //
}elseif($lastseen<360){
$lastseen="<img src='".IMAGES."offline.gif' height='11' width='52'>\n"; //<<uzytkownik odchchodzi, po 360 sek od czasu wylogowania//
}elseif($iW>0){
if($iW==1) $Text="".$locale['XXX_007']."";
elseif($iW==2 || $iW==3 || $iW==4) $Text="".$locale['XXX_011']."";
else $Text="".$locale['XXX_008']."";
$lastseen="$iW $Text";
}elseif($iD>0){
if($iD==1) $Text="".$locale['XXX_009']."";
else $Text="".$locale['XXX_010']."";
$lastseen="$iD $Text";
}else{
$lastseen="$iH:$iM:$iS";
}
echo "<tr>\n<td class='side-small' align='left'>
<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".$data['user_name']."' class='side'>\n";
echo "<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".$data['user_name']."' class='side'>\n";
if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar'])) {
echo "<img src='".IMAGES."avatars/".$data['user_avatar']."' height='30' width='40' >\n";
} else {
echo "<img src='".IMAGES."avatars/neravataro.jpeg' height='30' width='40' >\n";
}
echo trimlink($data['user_name'], 15)."</a></td><td class='side-small' align='right'>".$lastseen."</td>\n</tr>\n";
}
}
echo "</table>";
closeside();
Redagavo And2s· 2009 Bir. 19 16:06:12