<?php
$i=1;
$recent=date("U")-900;
$getusersonline="SELECT * FROM utilizatori WHERE lasttime>'$recent'"; //grab from sql users on in last 15 minutes
$getusersonline2=mysql_query($getusersonline) or die("Could not get users");
$num=mysql_num_rows($getusersonline2);
while($getusersonline3=mysql_fetch_array($getusersonline2))
{
$id = $getusersonline3["id"];
$mod = $getusersonline3["color"];
$avat = $getusersonline3["setavatar"];
$nume = $getusersonline3["nume"];
$avatar = $getusersonline3["avatar"];

echo "<sup>$i.</sup><a href='profile.php?id=$id' class='$mod' title='$nume'><b>";
   if($avat[0]=="1")
	  {
		echo "<img src='avatar/$avatar' alt='$nume' />";
	   }else{
		 echo "";
		}  
echo "$nume</b></a>  ";
$i++;
}
?>