Файл: vsime.com/str/to_comm_others.php
Строк: 206
<?
######################################################################################################
if($user['comm_pol']==1){
$set['p_str']=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 "Нет желающих общаться!n";}
$q=mysql_query("SELECT * FROM `leaders` WHERE `pol` = '0' 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(is_file("../images/avatars/$ank[id].gif")){
echo "<img src='/images/avatars/$ank[id].gif' align='left' width='40' height='40' alt='' >n";
}else if(is_file("../images/avatars/$ank[id].jpg")){
echo "<img src='/images/avatars/$ank[id].jpg' align='left' width='40' height='40' alt='' >n";
}else if(is_file("../images/avatars/$ank[id].png")){
echo "<img src='/images/avatars/$ank[id].png' align='left' width='40' height='40' alt='' >n";
}else{
echo '<img src="/images/avatars/0.png" align="left" width="45" height="45" alt="">';
}
*/
echo " ".online($ank['id'])." <a href='/profile?id=$ank[id]'>$ank[nick]</a><br/>n";
if ($a['text']!=NULL){
//$string = mb_substr($a['text'],0,45,'utf-8');
//echo''.output_text($string).'..';
echo smiles(bbcode($a['text']));
}
else
echo "...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";
}
}
}
######################################################################################################
if($user['comm_pol']==2){
$set['p_str']=1;
$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 "Нет желающих общаться!n";}
$q=mysql_query("SELECT * FROM `leaders` WHERE `pol` = '1' 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;
echo " ".online($ank['id'])." <a href='/profile?id=$ank[id]'>$ank[nick]</a><br/>n";
if ($a['text']!=NULL){
//$string = mb_substr($a['text'],0,45,'utf-8');
//echo''.output_text($string).'..';
echo smiles(bbcode($a['text']));
}
else
echo "...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";
}
}
}
######################################################################################################
if($user['comm_pol']==0){
$set['p_str']=1;
$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 "Нет желающих общаться!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;
echo " ".online($ank['id'])." <a href='/profile?id=$ank[id]'>$ank[nick]</a><br/>n";
if ($a['text']!=NULL){
//$string = mb_substr($a['text'],0,45,'utf-8');
//echo''.output_text($string).'..';
echo htmlspecialchars(smiles(bbcode($a['text'])));
}
else
echo "...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";
}
}
}
######################################################################################################
?>