function TUsers_Cheking (){
include "sql.php";
clearstatcache();
$currenttime = getdate(time());
$currentdate = $currenttime["0"];
$querystat="select status from Register where nick='$this->chatuser'";$resultstat = mysql_query($querystat, $link); $rowstat=mysql_fetch_array($resultstat);$status=$rowstat[status];
echo "Ник :$this->chatuser<br>Статус: $status<br><hr>";
//создатели выводим
echo "ñîçäàòåëè<br>";
//берём юзеров Создателей ипоказываем
$query="select nick,otime,status from online where status='создатель' GROUP BY nick";
$result = mysql_query($query, $link) or die("SELECT error".mysql_error());
while ($row=mysql_fetch_array($result))
{
if ($currentdate-$row[otime]>$this -> awaytime && $currentdate-$row[otime]<$this->delay){
echo "<a href='' onkeypress=\"document.forms[0].message.focus()\" onclick=\"i=top.down.document.forms.send_form.item('message');i.value=i.value +'$row[nick]';return false \">$row[nick]</a> (молчит) <br>\n";
}
if ($currentdate-$row[otime]>$this->delay){
$query="DELETE from online where nick='$row[nick]'";
mysql_query($query, $link) or die("SELECT error".mysql_error());
}
else if ($currentdate-$row[otime]<$this->delay && $currentdate-$row[otime]<$this->awaytime) {
echo "<a href='' onkeypress=\"document.forms[0].message.focus()\" onclick=\"i=top.down.document.forms.send_form.item('message');i.value=i.value +'$row[nick]';return false \">$row[nick]</a><br>\n";
}
}
//вожди
echo "вожди<br>";
$query="select nick,otime,status from online where status='вождь' GROUP BY nick";
$result = mysql_query($query, $link) or die("SELECT error".mysql_error());
while ($row=mysql_fetch_array($result))
{
if ($currentdate-$row[otime]>$this -> awaytime && $currentdate-$row[otime]<$this->delay){
echo "<a href='' onkeypress=\"document.forms[0].message.focus()\" onclick=\"i=top.down.document.forms.send_form.item('message');i.value=i.value +'$row[nick]';return false \">$row[nick]</a> (молчит) <br>\n";
}
if ($currentdate-$row[otime]>$this->delay){
$query="DELETE from online where nick='$row[nick]'";
mysql_query($query, $link) or die("SELECT error".mysql_error());
}
else if ($currentdate-$row[otime]<$this->delay && $currentdate-$row[otime]<$this->awaytime) {
echo "<a href='' onkeypress=\"document.forms[0].message.focus()\" onclick=\"i=top.down.document.forms.send_form.item('message');i.value=i.value +'$row[nick]';return false \">$row[nick]</a><br>\n";
}
//Бати
echo "Бати<br>";
$query="select nick,otime,status from online where status='Батя' GROUP BY nick";
$result = mysql_query($query, $link) or die("SELECT error".mysql_error());
while ($row=mysql_fetch_array($result))
{
if ($currentdate-$row[otime]>$this -> awaytime && $currentdate-$row[otime]<$this->delay){
echo "<a href='' onkeypress=\"document.forms[0].message.focus()\" onclick=\"i=top.down.document.forms.send_form.item('message');i.value=i.value +'$row[nick]';return false \">$row[nick]</a> (молчит) <br>\n";
}
if ($currentdate-$row[otime]>$this->delay){
$query="DELETE from online where nick='$row[nick]'";
mysql_query($query, $link) or die("SELECT error".mysql_error());
}
else if ($currentdate-$row[otime]<$this->delay && $currentdate-$row[otime]<$this->awaytime) {
echo "<a href='' onkeypress=\"document.forms[0].message.focus()\" onclick=\"i=top.down.document.forms.send_form.item('message');i.value=i.value +'$row[nick]';return false \">$row[nick]</a><br>\n";
}
//крохи
echo "крохи<br>";
$query="select nick,otime,status from online where status='кроха' GROUP BY nick";
$result = mysql_query($query, $link) or die("SELECT error".mysql_error());
while ($row=mysql_fetch_array($result))
{
if ($currentdate-$row[otime]>$this -> awaytime && $currentdate-$row[otime]<$this->delay){
echo "<a href='' onkeypress=\"document.forms[0].message.focus()\" onclick=\"i=top.down.document.forms.send_form.item('message');i.value=i.value +'$row[nick]';return false \">$row[nick]</a> (молчит) <br>\n";
}
if ($currentdate-$row[otime]>$this->delay){
$query="DELETE from online where nick='$row[nick]'";
mysql_query($query, $link) or die("SELECT error".mysql_error());
}
else if ($currentdate-$row[otime]<$this->delay && $currentdate-$row[otime]<$this->awaytime) {
echo "<a href='' onkeypress=\"document.forms[0].message.focus()\" onclick=\"i=top.down.document.forms.send_form.item('message');i.value=i.value +'$row[nick]';return false \">$row[nick]</a><br>\n";
}
//соски
echo "соски<br>";
$query="select nick,otime,status from online where status='соска' GROUP BY nick";
$result = mysql_query($query, $link) or die("SELECT error".mysql_error());
while ($row=mysql_fetch_array($result))
{
if ($currentdate-$row[otime]>$this -> awaytime && $currentdate-$row[otime]<$this->delay){
echo "<a href='' onkeypress=\"document.forms[0].message.focus()\" onclick=\"i=top.down.document.forms.send_form.item('message');i.value=i.value +'$row[nick]';return false \">$row[nick]</a> (молчит) <br>\n";
}
//если долго молчит удаляем...
if ($currentdate-$row[otime]>$this->delay){
$query="DELETE from online where nick='$row[nick]'";
mysql_query($query, $link) or die("SELECT error".mysql_error());
}
else if ($currentdate-$row[otime]<$this->delay && $currentdate-$row[otime]<$this->awaytime) {
echo "<a href='' onkeypress=\"document.forms[0].message.focus()\" onclick=\"i=top.down.document.forms.send_form.item('message');i.value=i.value +'$row[nick]';return false \">$row[nick]</a><br>\n";
}
}
}