<?
$corec = $_SERVER['DOCUMENT_ROOT'];
require_once $corec.'/sys/inc/core.php';

only_reg();
$set['title']='Мои гости';
require_once $corec.'/sys/inc/thead.php';
title();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `my_guest` WHERE `id_user` = '$user[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($k_post==0)
{
echo "".$v." вашу страницу не кто посещали!\n";
}
$q=mysql_query("SELECT * FROM `my_guest` WHERE `id_user` = '".$user['id']."' ORDER BY time DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q))
{
?><div class="prof"><?
if ($post['newid']!=0)
{
$ank['id']=0;
$ank['pol']=1;
}
else
$ank=get_user($post['uid']);


if ($ank['id']==0)
echo "Невидимка";
else
echo "".online($ank['id'])." <a href='/info.php?id=".$ank['id']."'>".$ank['nick']."</a>\n";
if ($post['new']!=0) echo "<span style=\"color:#FF0000\">";
else "<span style=\"color:\">";
echo "<small>[".vremja($post['time'])."]</small>\n";
?></span><?

mysql_query("UPDATE `my_guest` SET `new` = '0' WHERE `id_user` = '".$user['id']."'"); 
?></div><?
}
?></div><?
if ($k_page>1)str("?sort=$sort&amp;",$k_page,$page);

require_once $corec.'/sys/inc/tfoot.php';
?>