<?

$album['id']=intval($_GET['albom']);

err();

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery` WHERE `razd` = '$album[id]'"),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 "   <tr>\n";
echo "  <div class=''>\n";
echo "Нет фотоальбомов\n";
echo "  </td>\n";
echo "   </tr>\n";
}

$q=mysql_query("SELECT * FROM `gallery` WHERE `razd` = '$album[id]' ORDER BY RAND() DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q))
{
if($num==1){ 
echo "<div class='str'>"; 
$num=0;
}else{ 
echo "<div class='rowup'>"; 
$num=1;}

$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$post[id_user]' LIMIT 1"));

echo "$ank[nick]<br />\n";

echo "<a href='/foto/$ank[id]/$post[id]/'>$post[name]</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_gallery` = '$post[id]'"),0)." фото)<br />\n";

echo "</div>"; 

}


if ($k_page>1)str('?albom='.$album['id'].'&',$k_page,$page); // Вывод страниц

include_once '../sys/inc/tfoot.php';
exit;
?>