Файл: mylaf.ru/online.php
Строк: 102
<?
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';
$set['title']='Сейчас на сайте';
include_once 'sys/inc/thead.php';
title();
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_user` = '".$user['id']."' AND `avatar` = '1'"),0)==0){
echo "<div class='forum'><center>Извините $user[nick] , но для того чтобы смотреть кто сейчас находится на <b>".$_SERVER['HTTP_HOST']."</b> нужно установить свой аватар.</center></div>";
include_once 'sys/inc/tfoot.php';
}
////////////////
$on=intval($_GET['on']);
///////////////
if($on == '3') {
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `ank_city` = '$user[ank_city]' AND `date_last` > '".(time()-1200)."'"), 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 `id` FROM `user` WHERE `ank_city` = '$user[ank_city]' AND `date_last` > '".(time()-1200)."' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
} else if($on == '2') {
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `pol` = '0' AND `date_last` > '".(time()-1200)."'"), 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 `id` FROM `user` WHERE `pol` = '0' AND `date_last` > '".(time()-1200)."' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
} else if($on == '1') {
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `pol` = '1' AND `date_last` > '".(time()-1200)."'"), 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 `id` FROM `user` WHERE `pol` = '1' AND `date_last` > '".(time()-1200)."' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
}else{
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-1200)."'"), 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 `id` FROM `user` WHERE `date_last` > '".(time()-1200)."' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
}
while ($ank = mysql_fetch_assoc($q))
{
$ank=get_user($ank['id']);
$q = mysql_query("select * from `user` ORDER BY `id` desc LIMIT 5;");
$post = mysql_fetch_array(mysql_query("select `nick` from `user` where `id` = '$id[0]';"));
echo "<div class='enk_div'>";
echo ' <center>Новички:<br/>';
while ($post = mysql_fetch_array($q))
{
echo " ".us($post['id'])." ";
}
echo "</center></div>n";
$b="<td class='block'>";
echo "<div class='gmenu'><table>$b<a href='/online.php'><b><font color='black'>Наших: ".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` >".(time()-1200).""),0)."</b></font></a></td>";
echo "$b<a href='/online_g.php'><b>(+".mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > ".(time()-600)." AND `pereh` > '0'"), 0)." гостей)</b></a></td></table></div>";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-1200)."'"), 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 `id` FROM `user` WHERE `date_last` > '".(time()-1500)."' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
if ($k_post==0)
{
msg("На сайте сейчас никого нет.");
}
while ($ank = mysql_fetch_array($q))
{
$ank=get_user($ank['id']);
if ($user['show_online']==0)
{
echo "<div class='post'><table><td class='w'>";
avatar2($ank['id']);
echo "</td><td>";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]' AND `time` > '$time'"), 0)!=0)
echo "<font color='red'>[BAN]</font>n";
echo "".us($ank['id'])."";
if (isset($user) && $user['id']==$ank['id']){echo " (Это Вы)<br/>n";}
if (isset($user) && $user['id']!=$ank['id'])echo " <a href='/user/mail/mail.php?id=$ank[id]'><img src='/images/mess.png' alt='' /></a> <br/>n";
if (otkuda($ank['url']))echo "</br><span class="ank_n">URL:</span> <span class="ank_d"><a href='$ank[url]'>".otkuda($ank['url'])."</a></span>";
echo "</td></table></div>n";
}}}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
echo "<div class='post'>";
include_once 'max_online.php';
echo "</div>";
include_once 'sys/inc/tfoot.php';
?>