<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
only_reg();
$set['title']='Список моих гостей'; // заголовок страницы
include_once 'sys/inc/thead.php';

title();

$new=mysql_result(mysql_query("SELECT COUNT(*) FROM `myguests` WHERE `id_ank` = '$user[id]' AND `read`='1'"),0);
if($new!=0){
mysql_query("UPDATE `myguests` SET `read`='0' WHERE `id_ank`='$user[id]' AND `read`='1' LIMIT $new");}

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `myguests` WHERE `id_ank` = '$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'Вашу страничку еще не посещали<br/>';
echo'<table class="post">';
$q=mysql_query("SELECT * FROM `myguests` WHERE `id_ank` = '$user[id]' ORDER BY `time` DESC  LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q))
{
$ank=get_user($post['id_user']);
echo'<tr>';


echo '<tr><td class="icon14">';
if ($ank['show_secret']==0)
{
avatar3($ank['id']);
}
if ($ank['show_secret']==1)
{
echo "<img src='/style/secret.png' alt='' class='icon' width='24' height='32'/>\n";
}
if($num==1){
echo "  <td class='aut'>\n";
$num=0;
}else{
echo "  <td class='tf'>\n";
$num=1;}
if ($ank['show_secret']==1)
{
//echo '<tr><td class="icon16">';
echo "<font color='red'>Невидимка</font><br/><font color='#afb0a3'>(Скрытый профиль)</font>";
echo ' '.vremja($post['time']).' ';
//echo '</td></tr>';
}
if ($ank['show_secret']==0)
{
echo ''.online($ank['id']).' <a href="/info.php?id='.$ank['id'].'">'.$ank['nick'].'</a><br/>';
echo "<img src='/style/icons/alarm.png' alt='' class='icon'/>\n";
echo ' '.vremja($post['time']).' ';
echo " <img src='/style/icons/eye.png' alt='' class='icon'/>\n";
echo ' '.$post['count'].'';

echo '</td></tr>';
}}

echo'</table>';
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
include_once 'sys/inc/tfoot.php';
?>