Файл: LinkMod/LinkBlack.php
Строк: 37
<?php
if(isset($_GET['friend']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_user` WHERE `id` = '".intval($_GET['friend'])."'"),0)!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_friends` WHERE `user` = '$user[id]' AND `ank` = '".intval($_GET['friend'])."'"),0)==0)
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_blacklist` WHERE `user` = '$user[id]' AND `ank` = '".intval($_GET['friend'])."'"),0)!=0)mysql_query("DELETE FROM `mystyle_blacklist` WHERE `user` = '$user[id]' AND `ank` = '".intval($_GET['friend'])."'");
mysql_query("INSERT INTO `mystyle_friends` SET `user` = '$user[id]', `ank` = '".intval($_GET['friend'])."'");
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_blacklist` 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_blacklist` 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 "
<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="?blacklist&friend='.$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>';
}
if ($k_page>1)str("?blacklist&",$k_page,$page);
?>