Файл: world-faces.ru/world-faces.ru/here.php
Строк: 108
<?
include_once 'i.php';
only_reg();
$set['title']='Сейчас на сайте';
include_once 'sys/inc/thead.php';
title();
aut();
$on=htmlspecialchars(mysql_real_escape_string($_GET['on']));
switch ($on){
default:
header("location:here.php?on=log");
break;
case log:
$on=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > ".(time()-3600).""), 0);
$ong=mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > ".(time()-3600).""), 0);
echo '<div class="dclass"> На сайте '.$on.' зарегистрированных + <a href="here.php?on=guests">'.$ong.' гостей</a></div>';
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-3600)."'"), 0);
$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 * FROM `user` WHERE `date_last` > '".(time()-3600)."' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
if ($k_post==0){
echo "Сейчас на сайте никого нетn";}
while ($al = mysql_fetch_array($q)){
echo "<div class='prof'>";
avatar3($al['id']);
echo " <a href='/info.php?id=$al[id]'><span style="color:$al[ncolor]">$al[nick]</span></a>";
echo "<br/>";
if ($al['pol']==1)
echo "(Муж)";
else
echo "(Жен)";
if ($al['ank_d_r']!=NULL && $al['ank_m_r']!=NULL && $al['ank_g_r']!=NULL){
$al['ank_age']=date("Y")-$al['ank_g_r'];
if (date("n")<$al['ank_m_r'])$al['ank_age']=$al['ank_age']-1;
elseif (date("n")==$al['ank_m_r']&& date("j")<$al['ank_d_r'])$al['ank_age']=$al['ank_age']-1;
echo ",$al[ank_age] лет";
}
if ($al['ank_city']!=NULL)echo ",$al[ank_city]";
echo "<br/>";
if($al['vip_time']>=time()){
echo "Где: Скрыто<br />n";
}else{
if (otkuda($al['url'])){echo "Где: <a href='$al[url]'>".otkuda($al['url'])."</a><br />n";
}else{echo "Где: Не определено<br />n";}
$status=mysql_query("SELECT * FROM `status_user` WHERE `id_user` = $al[id] ORDER BY time DESC LIMIT 1");
while ($s = mysql_fetch_array($status)){
$al=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $s[id_user] LIMIT 1"));
echo '<div class="guser_aut">';
echo '<b><a href="/user_status/alls.php?id='.$al['id'].'"><span style="color:'.$al['color'].'">';
echo output_text($s['msg'])."</a></b><small> (".vremja($s['time']).")</small> <a href='/user_status/komm.php?id=$s[id]'>[".mysql_result(mysql_query("SELECT COUNT(*) FROM `status_komm1` WHERE `id_status` = '$s[id]'"),0)."]<img src='/sys/inc/komm.png' alt''></a> <a href='/user_status/index.php?id=$s[id]&vote'>[".mysql_result(mysql_query("SELECT COUNT(*) FROM `status_vote` WHERE `id_status` = '$s[id]'"),0)."]<img src='/user_status/bbl3.png' alt''></a> n";
if (($us['level'])==4){echo'<a href="user_status/index.php?id='.$s['id'].'&delete">[x]</a>';}
echo "</span></div>n";
}
}
echo'</div>';
}
if ($k_page>1)str("?on=log&",$k_page,$page);
break;
case guests:
$on=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > ".(time()-3600).""), 0);
$ong=mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > ".(time()-3600).""), 0);
echo '<div class="dclass"> На сайте <a href="here.php?on=log">'.$on.' зарегистрированных</a> + '.$ong.' гостей</div>';
$k_posts=mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > '".(time()-3600)."'"), 0);
$k_pages=k_page($k_posts,$set['p_str']);
$pages=page($k_pages);
$starts=$set['p_str']*$pages-$set['p_str'];
$gues = mysql_query("SELECT * FROM `guests` WHERE `date_last` > '".(time()-3600)."' ORDER BY `date_aut` DESC LIMIT $starts, $set[p_str]");
if ($k_posts==0)
{
echo " <div='onmenu'>";
echo "Нет гостей на сайте";
echo " </div>";
}
echo " <div class='onmenu'>";
while ($gl = mysql_fetch_array($gues)){
if ($gl['ua']!=NULL)echo "<span class="ank_n">UA:</span> <span class="ank_d">$gl[ua]</span><br />n";
echo "<span class="ank_n">Переходов:</span> <span class="ank_d">$gl[pereh]</span><br />n";
if (isset($user) && ($user['level']>0))
{
if (isset($access['show_ip']) && $gl['ip']!=0)echo "<span class="ank_n">IP:</span> <span class="ank_d">".long2ip($gl['ip'])."</span><br />n";
if (isset($access['show_ip']) && opsos($gl['ip']))echo "<span class="ank_n">Пров:</span> <span class="ank_d">".opsos($gl['ip'])."</span><br />n";
if (otkuda($gl['url']))echo "<span class="ank_n">Где:</span> <span class="ank_d"><a href='$gl[url]'>".otkuda($gl['url'])."</a></span><br />n";
}
}
echo'</div>';
if ($k_posts>1)str("?on=guests&",$k_pages,$pages);
break;
}
include_once 'sys/inc/tfoot.php';
?>