Файл: vsime.com/str/to_comm_others_web.php
Строк: 262
<?
######################################################################################################
if($user['comm_pol']==1){
$set['p']=1;
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `leaders` WHERE `pol` = '0'"),0);
$k_page=k_page($k_post,$set['p']);
$page=page($k_page);
$start=$set['p']*$page-$set['p'];
if ($k_post==0)
{echo "Нет желающих общаться!n";}
$q=mysql_query("SELECT * FROM `leaders` WHERE `pol` = '0' ORDER BY rand() LIMIT $start, $set[p]");
while ($a = mysql_fetch_array($q)){
$ankbest=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'])."'"); // удаление старых
$ankbest['ank_age']=date("Y")-$ankbest['ank_g_r'];
if (date("n")<$ankbest['ank_m_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
elseif (date("n")==$ankbest['ank_m_r']&& date("j")<$ankbest['ank_d_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
echo "<a href='/profile?id=$ankbest[id]'>n";
if(is_file("../images/avatars/$ankbest[id].gif")){
echo "<img src='/images/avatars/$ankbest[id].gif' align='left' title="$ankbest[nick]" style='margin-right:4px;border-right:px solid #99ccff'>n";
}else if(is_file("../images/avatars/$ankbest[id].jpg")){
echo "<img src='/images/avatars/$ankbest[id].jpg' align='left' title="$ankbest[nick]" style='margin-right:4px;border-right:px solid #99ccff'>n";
}else if(is_file("../images/avatars/$ankbest[id].png")){
echo "<img src='/images/avatars/$ankbest[id].png' align='left' title="$ankbest[nick]" style='margin-right:4px;border-right:px solid #99ccff'>n";
}else{
echo '<img src="/images/avatars/0.png" align="left" title="$ankbest[nick]" style="margin-right:4px;border-right:px solid #99ccff">';
}
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 ($ankbest['pol']==1)
echo " (М";
else
echo " (Ж";
if ($ankbest['ank_d_r']!=NULL && $ankbest['ank_m_r']!=NULL && $ankbest['ank_g_r']!=NULL){
$ankbest['ank_age']=date("Y")-$ankbest['ank_g_r'];
if (date("n")<$ankbest['ank_m_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
elseif (date("n")==$ankbest['ank_m_r']&& date("j")<$ankbest['ank_d_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
echo "/$ankbest[ank_age])n";
echo "</a>n";
}
}
}
######################################################################################################
if($user['comm_pol']==2){
$set['p']=1;
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `leaders` WHERE `pol` = '1'"),0);
$k_page=k_page($k_post,$set['p']);
$page=page($k_page);
$start=$set['p']*$page-$set['p'];
if ($k_post==0)
{echo "Нет желающих общаться!n";}
$q=mysql_query("SELECT * FROM `leaders` WHERE `pol` = '1' ORDER BY rand() LIMIT $start, $set[p]");
while ($a = mysql_fetch_array($q)){
$ankbest=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'])."'"); // удаление старых
$ankbest['ank_age']=date("Y")-$ankbest['ank_g_r'];
if (date("n")<$ankbest['ank_m_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
elseif (date("n")==$ankbest['ank_m_r']&& date("j")<$ankbest['ank_d_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
echo "<a href='/profile?id=$ankbest[id]'>n";
if(is_file("../images/avatars/$ankbest[id].gif")){
echo "<img src='/images/avatars/$ankbest[id].gif' align='left' title="$ankbest[nick]" style='margin-right:4px;border-right:px solid #99ccff'>n";
}else if(is_file("../images/avatars/$ankbest[id].jpg")){
echo "<img src='/images/avatars/$ankbest[id].jpg' align='left' title="$ankbest[nick]" style='margin-right:4px;border-right:px solid #99ccff'>n";
}else if(is_file("../images/avatars/$ankbest[id].png")){
echo "<img src='/images/avatars/$ankbest[id].png' align='left' title="$ankbest[nick]" style='margin-right:4px;border-right:px solid #99ccff'>n";
}else{
echo '<img src="/images/avatars/0.png" align="left" title="$ankbest[nick]" style="margin-right:4px;border-right:px solid #99ccff">';
}
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 ($ankbest['pol']==1)
echo " (М";
else
echo " (Ж";
if ($ankbest['ank_d_r']!=NULL && $ankbest['ank_m_r']!=NULL && $ankbest['ank_g_r']!=NULL){
$ankbest['ank_age']=date("Y")-$ankbest['ank_g_r'];
if (date("n")<$ankbest['ank_m_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
elseif (date("n")==$ankbest['ank_m_r']&& date("j")<$ankbest['ank_d_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
echo "/$ankbest[ank_age])n";
echo "</a>n";
}
}
}
######################################################################################################
if($user['comm_pol']==0){
$set['p']=1;
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `leaders`"),0);
$k_page=k_page($k_post,$set['p']);
$page=page($k_page);
$start=$set['p']*$page-$set['p'];
if ($k_post==0)
{echo "Нет желающих общаться!n";}
$q=mysql_query("SELECT * FROM `leaders` ORDER BY rand() LIMIT $start, $set[p]");
while ($a = mysql_fetch_array($q)){
$ankbest=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'])."'"); // удаление старых
$ankbest['ank_age']=date("Y")-$ankbest['ank_g_r'];
if (date("n")<$ankbest['ank_m_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
elseif (date("n")==$ankbest['ank_m_r']&& date("j")<$ankbest['ank_d_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
echo "<a href='/profile?id=$ankbest[id]'>n";
if(is_file("../images/avatars/$ankbest[id].gif")){
echo "<img src='/images/avatars/$ankbest[id].gif' align='left' title="$ankbest[nick]" style='margin-right:4px;border-right:px solid #99ccff'>n";
}else if(is_file("../images/avatars/$ankbest[id].jpg")){
echo "<img src='/images/avatars/$ankbest[id].jpg' align='left' title="$ankbest[nick]" style='margin-right:4px;border-right:px solid #99ccff'>n";
}else if(is_file("../images/avatars/$ankbest[id].png")){
echo "<img src='/images/avatars/$ankbest[id].png' align='left' title="$ankbest[nick]" style='margin-right:4px;border-right:px solid #99ccff'>n";
}else{
echo '<img src="/images/avatars/0.png" align="left" title="$ankbest[nick]" style="margin-right:4px;border-right:px solid #99ccff">';
}
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 ($ankbest['pol']==1)
echo " (М";
else
echo " (Ж";
if ($ankbest['ank_d_r']!=NULL && $ankbest['ank_m_r']!=NULL && $ankbest['ank_g_r']!=NULL){
$ankbest['ank_age']=date("Y")-$ankbest['ank_g_r'];
if (date("n")<$ankbest['ank_m_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
elseif (date("n")==$ankbest['ank_m_r']&& date("j")<$ankbest['ank_d_r'])$ankbest['ank_age']=$ankbest['ank_age']-1;
echo "/$ankbest[ank_age])n";
echo "</a>n";
}
}
}
######################################################################################################
?>