<? @session_start();
$nameus=$_SESSION["username"];
$urlpage='×àò';

require_once("../config.php");
$uo_sessionTime = 1;
error_reporting(E_ERROR | E_PARSE);
$uo_ip = $_SERVER['REMOTE_ADDR'];
$uo_query = "DELETE FROM b_online WHERE unix_timestamp() - lastvisit >= $uo_sessionTime * 60";
mysql_query($uo_query);

$uo_query = "SELECT lastvisit FROM b_online WHERE visitor = '$uo_ip'";
$uo_result = mysql_query($uo_query);
if(mysql_num_rows($uo_result) == 0) {
	$uo_query = "INSERT INTO b_online (visitor,lastvisit,user,urlpage) VALUES('$uo_ip', unix_timestamp(), '$nameus', '$urlpage')";
	mysql_query($uo_query);

} else {
	$uo_query = "UPDATE b_online SET lastvisit = unix_timestamp(), urlpage='$urlpage', user='$nameus' WHERE visitor = '$uo_ip'";
	mysql_query($uo_query);
}
$res=mysql_query("select user from b_online where urlpage='×àò'");
?>
<table>
<?
while($row=mysql_fetch_assoc($res))
{

echo <<<STILL

<span class="ads_dates" style="color:#4F4F4F;padding:4px;">
<img src="chat/strel.png" align="absmiddle" style="margin-right:2px;"><a class="onli" style="text-decoration:none;" onclick="insert_text('','[b]{$row["user"]}:[/b]')" >{$row["user"]}</a></span>
STILL;
}?>
</table>