Файл: vsime.com/str/to_comm.php
Строк: 265
<?
include_once '../system/includes/start.php';
if (!isset($user)){
$set['title']='Внимание!';
include_once '../sys/inc/thead.php';
title();
echo'<div class="func">Извините, эта функция доступна только зарегистрированным пользователям. <a href="/registration/">Регистрация</a> быстрая и бесплатная.</div><br />';
include_once '../sys/inc/tfoot.php';
exit();
}
$set['title']='Хочу общаться! '; // заголовок страницы
include_once '../sys/inc/thead.php';
title();
echo "<div class="headering">$urlik / Хочу общаться</div>";
aut();
if (isset($_GET['delete']) && ($user['group_access']==9 || $user['group_access']==15)) {
$loller=mysql_fetch_array(mysql_query("SELECT * FROM `leaders` WHERE `id` = '".(int)$_GET['delete']."'"));
if ($loller['id'] == 0) {
echo '<div class="err">Нет тут блять такого!</div>';
include_once '../sys/inc/tfoot.php';
exit();
}
mysql_query("DELETE FROM `leaders` WHERE `id` = '".(int)$_GET['delete']."' LIMIT 1");
admin_log('Модули','Хочу общаться',"Удаление пользователя с идентификатором XO ".my_esc((int)$_GET['delete'])." (id#$ank[id])");
header("Location: /comm/?okay,sy4ka");
exit();
}
#################################################################################################
if($user['comm_pol']==1){
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `leaders` WHERE `pol` = '0'"),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 "<div class='line'>Нет желающих общаться!</div>n";}
$q=mysql_query("SELECT * FROM `leaders` WHERE `pol` = '0' ORDER BY rand() LIMIT $start, $set[p_str]");
while ($a = mysql_fetch_array($q)){
mysql_query("DELETE FROM `leaders` WHERE `time` < '".(time()-86400*2)."'"); // удаление старых
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $a[user] LIMIT 1"));
$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;
if($num==1){
echo "<div class='line'>";
$num=0;
}else{
echo "<div class='line'>";
$num=1;}
echo "".online($ank['id'])." <a href='/profile?id=$ank[id]'>$ank[nick]</a>n";
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])n";
}
echo "<br/>n";
if ($a['text']!=NULL){
$string = mb_substr($a['text'],0,45,'utf-8');
echo smiles(bbcode($string)).'..';}
else
echo "...n";
if ($user['group_access']==9 || $user['group_access']==15) {
echo "<span style='float: right'><a href='/comm?delete=".$a['id']."'><img src='/images/delete.gif'></a></span>n";
}
echo "</div>n";
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
if($user){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `leaders` WHERE `user` = '$user[id]'"), 0)==0)
{
echo'<div class="line" align="center"> <a href= "/comm/add"><img src= "/images/comm.gif"/> <b>И я хочу общаться ;)</b></a></div>';
}
}
}
#################################################################################################
if($user['comm_pol']==2){
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `leaders` WHERE `pol` = '1'"),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 "<div class='line'>Нет желающих общаться!</div>n";}
$q=mysql_query("SELECT * FROM `leaders` WHERE `pol` = '1' ORDER BY rand() LIMIT $start, $set[p_str]");
while ($a = mysql_fetch_array($q)){
mysql_query("DELETE FROM `leaders` WHERE `time` < '".(time()-86400*2)."'"); // удаление старых
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $a[user] LIMIT 1"));
mysql_query("DELETE FROM `leaders` WHERE `time` < '86400'"); // удаление старых
$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;
if($num==1){
echo "<div class='line'>";
$num=0;
}else{
echo "<div class='line'>";
$num=1;}
echo "".online($ank['id'])." <a href='/profile?id=$ank[id]'><span style="color:$ank[color]">$ank[nick]</span></a>n";
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])n";
}
echo "<br/>n";
if ($a['text']!=NULL){
$string = mb_substr($a['text'],0,45,'utf-8');
echo smiles(bbcode($string)).'..';}
else
echo "...n";
if ($user['group_access']==9 || $user['group_access']==15) {
echo "<span style='float: right'><a href='/comm?delete=".$a['id']."'><img src='/images/delete.gif'></a></span>n";
}
echo "</div>n";
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
if($user){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `leaders` WHERE `user` = '$user[id]'"), 0)==0)
{
echo'<div class="line" align="center"> <a href= "/comm/add"><img src= "/images/comm.gif"/> <b>И я хочу общаться ;)</b></a></div>';
}
}
}
#################################################################################################
if($user['comm_pol']==0){
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `leaders`"),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 "<div class='line'>Нет желающих общаться!</div>n";}
$q=mysql_query("SELECT * FROM `leaders` ORDER BY rand() LIMIT $start, $set[p_str]");
while ($a = mysql_fetch_array($q)){
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $a[user] LIMIT 1"));
mysql_query("DELETE FROM `leaders` WHERE `time` < '".(time()-86400*$a['balls'])."'"); // удаление старых
$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;
if($num==1){
echo "<div class='line'>";
$num=0;
}else{
echo "<div class='line'>";
$num=1;}
echo "".online($ank['id'])." <a href='/profile?id=$ank[id]'><span style="color:$ank[color]">$ank[nick]</span></a><small> (В ".vremja($a['time']).") n";
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]n";
}
echo "</small><br/>n";
if ($a['text']!=NULL){
$string = mb_substr($a['text'],0,45,'utf-8');
echo smiles(bbcode($string)).'..';}
else
echo "...n";
if ($user['group_access']==9 || $user['group_access']==15) {
echo "<span style='float: right'><a href='/comm?delete=".$a['id']."'><img src='/images/delete.gif'></a></span>n";
}
echo "</div>n";
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
if($user){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `leaders` WHERE `user` = '$user[id]'"), 0)==0)
{
echo'<div class="line" align="center"> <a href= "/comm/add"><img src= "/images/comm.gif"/> <b>И я хочу общаться ;)</b></a></div>';
}
}
}
#######################################
include_once '../sys/inc/tfoot.php';
?>