<div class="event">
<h1>Друзья в игре</h1>
</div>
<div class="content">
<div class="block">
<div class="block"><img width="16" height="16" src="img/icons/favorite.png" alt=""> <b>Мои Друзья</b> | <img width="16" height="16" src="img/icons/ignore.png" alt=""> <a href="?blacklist">Чёрный список</a></div>

<ul>
<?
if(isset($_GET['blacklist']) && mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_user` WHERE `id` = '".intval($_GET['blacklist'])."'"),0)!=0 && mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_blacklist` WHERE `id_user` = '$ku[id]' AND `id_ank` = '".intval($_GET['blacklist'])."'"),0)==0)
{
if(mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_friends` WHERE `id_user` = '$ku[id]' AND `id_ank` = '".intval($_GET['blacklist'])."'"),0)!=0)mysql_querll("DELETE FROM `kolhoz_friends` WHERE `id_user` = '$ku[id]' AND `id_ank` = '".intval($_GET['blacklist'])."'");
mysql_querll("INSERT INTO `kolhoz_blacklist` SET `id_user` = '$ku[id]', `id_ank` = '".intval($_GET['blacklist'])."'");}$q=mysql_querll("SELECT * FROM `kolhoz_friends` WHERE `id_user` = '$ku[id]'");
while($post=mysql_fetch_array($q))
{
$ank=mysql_fetch_array(mysql_querll("SELECT * FROM `kolhoz_user` WHERE `id` = '$post[id_ank]'"));
echo "<div class='block'>";
echo on_k($ank['id']);
echo " <a href='?user=$ank[id]'><span>".nc($ank['id'])."</span></a></span>";

echo " ".med($ank['id'])."";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `id` = '$ank[id]' AND `date_last` > '".(time()-600)."' LIMIT 1"),0)==1)
echo " <img src='img/icons/online.gif' alt='' class='*'/>";

echo " [<a href='?mail&history=$ank[id]'>Написать</a>]</div>";
}

include_once 'inc/foot.php';
?>