<?php
defined('PROTECTOR') or die('Error: restricted access');

$laikas = 10000000000000600;
$dabar = time();
$timeout = $dabar - $laikas;

mysql_query("DELETE FROM online WHERE laikas<$timeout");
$ar_yra = mysql_num_rows(mysql_query("SELECT usr FROM online WHERE usr = '$log' LIMIT 1"));
if ($ar_yra == '0')
{
mysql_query("INSERT INTO online SET usr = '$log', laikas = '$dabar',`lvl`='$udata[lvl]'");
}
elseif($ar_yra > '0')
{
mysql_query("UPDATE online SET laikas = '$dabar',`lvl`='$udata[lvl]' WHERE usr = '$log' LIMIT 1");
}
?>
