<?
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';
$show_all=true; // показ для всех
include_once 'sys/inc/user.php';

$set['title']='Кто был за 2-е суток'; // заголовок страницы
include_once 'sys/inc/thead.php';
title();
echo "<img src='/style/back.gif' alt='' class='icon'/>\n";
echo "<a href='online.php'>Список онлайн</a><br />\n";
echo "</div>\n";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-172800)."'"), 0);//2е суток
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT `id` FROM `user` WHERE `date_last` > '".(time()-172800)."' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");//2е суток
echo "<table class='post'>\n";
if ($k_post==0)
{
echo "Никого не было\n";
}
while ($ank = mysql_fetch_array($q))
{
$ank=get_user($ank['id']);

echo "<table class='post'>\n";
if ($ank['show_secret']==1)
{
echo '<tr><td class="icon14">';
echo "<img src='/style/secret.png' alt='' class='icon' width='24' height='32'/>\n";
echo '<td class="anput">';
echo " <font color='red'>Невидимка</sont>\n";
if (user_access('adm_news'))echo " (<a href='/info.php?id=$ank[id]'><span style=\"color:$ank[ncolor]\">$ank[nick]</span></a>)\n";
echo "<br/>\n";
echo "<font color='#afb0a3'>(Скрытый профиль)</sont>\n";

echo "  </td>\n";
echo "   </tr>\n";
}
if ($ank['show_secret']==0)
{
echo '<tr><td class="icon14">';
echo " <a href='/foto/$ank[id]/'>\n";
avatar3($ank['id']);
echo "</a>\n";
echo '</td><td class="anput">';
echo "".online($ank['id'])." <a href='/info.php?id=$ank[id]'><span style=\"color:$ank[ncolor]\">$ank[nick]</span></a>\n";

if($ank['rating']>=0 && $ank['rating']<=14)echo " ";
if($ank['rating']>=15 && $ank['rating']<=30)echo " <img src='/rating/05.gif'></img> "; 
if($ank['rating']>=31 && $ank['rating']<=65)echo " <img src='/rating/medal_bronze.gif'></img> ";
if($ank['rating']>=66 && $ank['rating']<=90)echo " <img src='/rating/medal_silver.gif'></img> ";
if($ank['rating']>=91 && $ank['rating']<=130)echo " <img src='/rating/medal_gold.gif'></img> ";
if($ank['rating']>=131 && $ank['rating']<=180)echo " <img src='/rating/medal_bronze.gif'></img> ";
if($ank['rating']>=131 && $ank['rating']<=180)echo " <img src='/rating/medal_silver.gif'></img> ";
if($ank['rating']>=181 && $ank['rating']<=250)echo " <img src='/rating/medal_bronze.gif'></img> ";
if($ank['rating']>=181 && $ank['rating']<=250)echo " <img src='/rating/medal_silver.gif'></img> ";
if($ank['rating']>=181 && $ank['rating']<=250)echo " <img src='/rating/medal_gold.gif'></img> ";
if($ank['rating']>=251 && $ank['rating']<=2500)echo " <img src='/rating/konkurs.png'></img> ";
if ($ank['stran']==0)echo "\n";
if ($ank['stran']==1)echo "<img src='/style/strana/ru.png'>\n";
if ($ank['stran']==2)echo "<img src='/style/strana/ua.png'>\n";
if ($ank['stran']==3)echo "<img src='/style/strana/by.png'>\n";
if ($ank['stran']==4)echo "<img src='/style/strana/az.png'>\n";
if ($ank['stran']==5)echo "<img src='/style/strana/kz.png'>\n";
if ($ank['stran']==6)echo "<img src='/style/strana/uz.png'>\n";
if ($ank['stran']==7)echo "<img src='/style/strana/england.png'>\n";
if ($ank['stran']==8)echo "<img src='/style/strana/de.png'>\n";
if (isset($user) && $user['id']==$ank['id'])
{
echo " (Это Вы)<br/>\n";
}
if (isset($user) && $user['id']!=$ank['id'])echo " <a href='/mail.php?id=$ank[id]'><img src='/img/mail.gif' alt='' /></a><br/>\n";
if($ank['rating']>=0 && $ank['rating']<=10)echo " <img src='/style/stat.png'> Новичок</img>";
if($ank['rating']>=11 && $ank['rating']<=40)echo " <img src='/style/stat.png'> Продвинутый</img>";
if($ank['rating']>=41 && $ank['rating']<=60)echo " <img src='/style/stat.png'> Бывалый</img>";
if($ank['rating']>=61 && $ank['rating']<=80)echo " <img src='/style/stat.png'> МегаОбитатель</img>";
if($ank['rating']>=81 && $ank['rating']<=100)echo " <img src='/style/stat.png'> Ветеран</img>";
if($ank['rating']>=101 && $ank['rating']<=1120)echo " <img src='/style/stat.png'> Почетный Юзер</img>";

if (otkuda($ank['url'])){echo " <font color='#afb0a3'>(".otkuda($ank['url']).")</font><br />\n";
}else{echo " (Неизвестно)<br />\n";}
echo '</td></tr>';

}
}

echo "</table>\n";
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц

echo "<div class='rowup'>";
echo "<center>За последние двое суток на сайте побывало <font color='red'>".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > ".(time()-172800).""), 0)."</font> зарегистрированных пользователя</a>\n";
echo "</div>\n";




include_once 'sys/inc/tfoot.php';
?>