<?
$set['title']='XXX-Альбомы Xhata.Su'; // заголовок страницы

include_once '../sys/inc/thead.php';
title();

err();

if (isset($user))
{
echo "<div class=\"rekl\">\n";
echo "<img src='/style/icons/top10.png' alt='' class='icon'/>\n";
echo "<a href='/xxxfoto/rating.php'>Фоторейтинг</a> | \n";
echo "<a href='/xxxfoto/$user[id]/'>Мои альбомы</a><br />\n";
echo "<img src='/style/icons/rules.png' alt='' class='icon'/>\n";
echo " <a href='/info/18.php'>Соглашение</a> (читаем)<br />\n";
echo "</div>\n";
}

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `gallerea`"),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 "  <div class='p_t'>\n";
echo "Нет фотоальбомов\n";
echo "   </div>\n";

}

$q=mysql_query("SELECT * FROM `gallerea` ORDER BY `time` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q))
{
$ank=get_user($post['id_user']);

echo '<tr><td class="icon16">';

$foto = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallerea_foto` WHERE `id_gallery` = '$post[id]' ORDER BY RAND()"));
if ($foto==null){
echo "<a href='/xxxfoto/$ank[id]/$post[id]/'><img src='/foto/foto48/0.png' alt='Нет фото' width='48' height='55' /></a>";
}
else
{
echo "<a href='/xxxfoto/$ank[id]/$post[id]/'><img src='/xxxfoto/foto128/$foto[id].$foto[ras]' alt='Фото_$foto[id]' width='48' height='55' /></a><br/>";
echo "<font color='red'>".mysql_result(mysql_query("SELECT COUNT(*) FROM `gallerea_foto` WHERE `id_gallery` = '$post[id]'"),0)."</font> фото \n";
}

echo '</td><td class="sponline">';
echo " ".online($ank['id'])." <a href='/info.php?id=$ank[id]'><span style=\"color:$ank[ncolor]\">$ank[nick]</span></a><br />\n";

echo " <span style=\"color:$ank[mcolor]\">$post[name]</span> <br/> \n";


if ($post['opis']==null)
echo "Описания нет =(\n";
else 
echo esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($post['opis']))))))))."\n";

echo "<br /><img src='/style/icons/008.png' alt='' class='icon'/> <font color='#afb0a3'>".vremja($post['time'])."</font><br />\n";
//echo "<img src='/style/icons/008.png' alt='' class='icon'/>\n";
//echo '<div style="text-align: right;"> '.vremja($post['time']).'<br/></div>';
echo '</td></tr>';
}

echo "</table>\n";




if ($k_page>1)str('?',$k_page,$page); // Вывод страниц


echo "<div class=\"tmn\">\n";

echo "<img src='/style/icons/foto14.gif' alt='' class='icon'/>\n";
echo "Всего фотографий ";
echo mysql_result(mysql_query("SELECT COUNT(*) FROM `gallerea_foto`"),0);
echo "<br/>";
echo "<img src='/style/icons/dnevnik.gif' alt='' class='icon'/>\n";
echo "Всего альбoмов ";
echo mysql_result(mysql_query("SELECT COUNT(*) FROM `gallerea`"),0);
echo "</div>\n";



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

?>