<?


$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `zags` WHERE `ona`>'0' "), 0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($k_post==0)echo '<div class="menu">Не было свадьб !</div>';
$q = mysql_query("SELECT * FROM `zags` WHERE `ona`>'0' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while ($f = mysql_fetch_array($q))
{






echo '<table class="post"><tr><td class="p_m">';
$zags_on=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='".$f['on']."'"));
$zags_ona=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='".$f['ona']."'"));

echo "<a href='/id".$zags_on['id']."'>".$zags_on['nick']."</a> и <a href='/id".$zags_ona['id']."'>".$zags_ona['nick']."</a><br><img src='love.png'>  <a href='info.php?id=".$f['id']."'>Инфо о свадьбе</a><br/><img src='icon/clock.png'> <a href='zkom.php?id=".$f['id']."'>Поздравления</a>";
	echo "(" . mysql_result(mysql_query("SELECT COUNT(*) FROM `zags_komm` WHERE `id_zags` = '$f[id]'"),0) . ")<br />";

echo "</td>";
echo "</tr>";
echo '</table>';
}
echo "<div class='foot'>";
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
echo "</div>";


?>