Файл: LinkMod/LinkFrend.php
Строк: 49
<?php
if(isset($_GET['Link']) && num($_GET['Link']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_user` WHERE `id` = '".num($_GET['Link'])."'"),0)!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_blacklist` WHERE `user` = '$user[id]' AND `ank` = '".num($_GET['Link'])."'"),0)==0)
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_friends` WHERE `user` = '$user[id]' AND `ank` = '".num($_GET['Link'])."'"),0)!=0)mysql_query("DELETE FROM `mystyle_friends` WHERE `user` = '$user[id]' AND `ank` = '".num($_GET['Link'])."'");
mysql_query("INSERT INTO `mystyle_blacklist` SET `user` = '$user[id]', `ank` = '".num($_GET['Link'])."'");
}
echo '<div class="emptyPanel center"><span>Кореша</span></div><a class="btn center" href="?blacklist">Чёрный список</a>';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_friends` WHERE `user` = '$user[id]' ORDER BY `id` DESC"),0);
if ($k_post==0)
{
echo "<li class="emptyPanel">У вас нет корешей</li>";
}
$k_page=k_page($k_post,$user['set']);
$page=page($k_page);
$start=$user['set']*$page-$user['set'];
$q=mysql_query("SELECT * FROM `mystyle_friends` WHERE `user` = '$user[id]' LIMIT $start, $user[set]");
while($post=mysql_fetch_array($q))
{
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_user` WHERE `id` = '$post[ank]'"));
echo "<ul>
<li><div class="emptyPanel">";
echo '<span style="margin-top: 6px;" class="fl"><span class="nobr">';
echo " ".users($ank['id'])."</span></span>";
echo '<div class="inlinePanel fr"><a class="btnp" href="?friends&Link='.$ank['id'].'"><img width="16" height="16" src="/images/icons/cross.png" alt="o"/> В черный список</a></div>';
echo "";
echo '<div style="clear: both;"></div>';
echo '</div></li>
</ul>';
}
if ($k_page>1)str("?friends&",$k_page,$page);
?>