<?php

$q=mysql_query("SELECT * FROM `kolhoz_gifts` WHERE `id_user` = '$ank[id]' ORDER BY `id` DESC LIMIT 9");
echo"<br/><img width='16' height='16' src='/img/icons/gift_plus.png' alt='o'> <b>Подарки</b> / <a href='?presents=$ank[id]'>Bce</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_gifts` WHERE `id_user` = '$ank[id]'"),0).")\n<br />";
echo"<div class='block'>";
while ($post = mysql_fetch_array($q))
{

$qp=mysql_query("SELECT * FROM `kolhoz_gift` WHERE `id` = '$post[id_gift]' LIMIT 1");
$p = mysql_fetch_array($qp);
echo"<img src='img/gifts/$p[id].png' height='34' width='34'/>";
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_gifts` WHERE `id_user` = '$ank[id]' LIMIT 1"), 0);
if ($k_post==0){echo '<font color="#696969">У игрока <b>'.$ank['nick'].'</b> нет подарков</font>';}
echo"</div>";
?>