<?

$m = mysql_num_rows(mysql_query("select * from `pod_in` WHERE `komu_id` = '".$ank['id']."'"));

$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `pod_in` WHERE `komu_id` = '".$ank['id']."'"),0);
$num=4;
if(isset($_GET['page']))$page = intval($_GET['page']);
else $page = 0;

$total = intval(($k_post - 1) / $num) + 1; 
$page = intval($page);
if(empty($page) or $page < 0) $page = 1;  
if($page > $total) $page = $total;
$start = $page * $num - $num;
$str = 'info.php';
$str2 = '&id='.$ank['id'].'';

$kp = mysql_query("select * from `pod_in` WHERE `komu_id` = '".$ank['id']."' order by time desc LIMIT $start, $num");

if ($m>4)
{


while ($post = mysql_fetch_array($kp)){
$pods = mysql_fetch_array(mysql_query("select * from `pod_file` WHERE `id` = '".$post['pod_id']."'"));
echo '<a href="/pod/pod.php?id='.$post['id'].'"><img src="/pod/image/'.$pods['file'].'" height="25" width="25" alt="." title="" /></a> ';
}

echo '<a href="/pod/?id='.$ank['id'].'"> >></a><br/>';
echo '</div>'; 
}
 
if ($m == 0)
{

}
 
if ($m>0 && $m<5)
{
echo '<div class="busi">';

while ($post = mysql_fetch_array($kp)){
$pods = mysql_fetch_array(mysql_query("select * from `pod_file` WHERE `id` = '".$post['pod_id']."'"));
echo '<a href="/pod/pod.php?id='.$post['id'].'"><img src="/pod/image/'.$pods['file'].'" height="25" width="25" alt="." title="" /></a>';
}
echo ' <a href="/pod/?id='.$ank['id'].'">  >></a><br/>';
echo '</div>'; 
}
?>