<?
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_gallery` = '$gallery[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo "<table class='post'>\n";
if ($k_post==0)
{
echo "Нет фотографий\n";
}
$q=mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$gallery[id]' ORDER BY rand() DESC LIMIT 10");
while ($post = mysql_fetch_assoc($q))
{
echo "<a href='/foto/$ank[id]/$gallery[id]/$post[id]/'><img src='/foto/foto48/$post[id].$post[ras]' alt='Фото_$post[id]' width='20' height='18' /></a>";
}
echo "</table>\n";

?>