Файл: mylaf.ru/love/index.php
Строк: 107
<?
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();
echo "<a href='search.php'><div class='gmenu'><img src='/otvet/img/search.png' alt=''> Поиск анкет</div></a>";
echo "<a href='man.php'><div class='gmenu'><img src='1.png' alt=''> Парни (".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `pol` = '1'"),0).")</div></a>n";
echo "<a href='woman.php'><div class='gmenu'><img src='0.png' alt=''> Девушки (".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `pol` = '0'"),0).")</div></a>";
echo '<div class="forum">Лучшая девушка:</div>';
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user`"),0) == 0) {
?>
<div class='noy'>Пользователей нет!</div>
<?
}else{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `pol` = '0'"),0) == 0) {
?>
<div class='err'>Лучшей девушки нет!</div>
<?
}else{
echo "<div class='enk_div'>n";
$female = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `pol` = '0' ORDER BY `rating` DESC LIMIT 1"));
avatar3($female['id']);
echo "<br />n";
#############
echo "".us($female['id'])."";
echo "</div>n";
}
echo '<div class="forum">Лучший парень:</div>';
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `pol` = '1'"),0) == 0){
?>
<div class='err'>Лучшего парня нет!</div>
<?
}else{
echo "<div class='enk_div'>n";
$male = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `pol` = '1' ORDER BY `rating` DESC LIMIT 1"));
avatar3($male['id']);
echo "<br />n";
#############
echo "".us($male['id'])."";
echo "</div>n";
}
}
$c=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-600)."'"), 0);
echo '<div class="fyt"><center>Сейчас на сайте ('.$c.')</center></div>';
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-600)."'"), 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()-600)."' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
if ($k_post==0)
{
?>
<div class='noy'>Сейчас на сайте никого нет</div>
<?
}
while ($ank = mysql_fetch_assoc($q))
{
$ank=get_user($ank['id']);
if($num==1){
echo "<div class='enk_div'>n";
$num=0;
}else{
echo "<div class='enk2_div'>n";
$num=1;}
echo "".avatar2($ank['id'])."<br />";
echo "".us($ank['id'])."<br />";
if ($ank['pol']==1)
echo "(Муж)";
else
echo "(Жен)";
if ($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL && $ank['ank_g_r']!=NULL){
$ank['ank_age']=date("Y")-$ank['ank_g_r'];
if (date("n")<$ank['ank_m_r'])$ank['ank_age']=$ank['ank_age']-1;
elseif (date("n")==$ank['ank_m_r']&& date("j")<$ank['ank_d_r'])$ank['ank_age']=$ank['ank_age']-1;
echo " ,$ank[ank_age] лет";
}
if ($ank['ank_city']!=NULL)echo ", $ank[ank_city]";
echo "</div>n";
}
if ($k_page>1)str("?",$k_page,$page);
include_once '../sys/inc/tfoot.php';
?>