<?
echo "<center><font color='#696e6b'>Новые Фото - Лица</font><br/>\n";
$q=mysql_query("SELECT * FROM `gallery` ORDER BY `time` DESC LIMIT 5");
while ($post = mysql_fetch_assoc($q))
{
$ank=get_user($post['id_user']);
$foto = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$post[id]'  ORDER BY RAND()"));
if ($foto==null){
echo "<img src='/foto/foto48/0.png' width='35' height='33' alt='Нет фото' />";
}
else
{
echo "<a href='/foto/$ank[id]/$gallery[id]/$id_foto/'><img src='/foto/foto48/$foto[id].$foto[ras]' width='35' height='33' alt='Фото_$foto[id]' /></a> ";
}

}
echo "</center>";
//exit;
?>