<?

include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';

only_reg();
$set['title']='Видеоальбомы';

include_once '../sys/inc/thead.php';
title();
err();
//aut();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `video_album`"),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";
$q=mysql_query("SELECT * FROM `video_album` ORDER BY id DESC LIMIT $start, $set[p_str]");
if (mysql_num_rows($q)==0) {
echo "   <tr>\n";
echo "  <td class='p_t'>\n";
echo "Нет видеоальбомов\n";
echo "  </td>\n";
echo "   </tr>\n";
}
while ($video = mysql_fetch_assoc($q))
{
echo "   <tr>\n";
echo "  <td class='p_t'>\n";
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$video[id_user]'"));
echo "<img src='name.gif' /> <a href='album.php?id=$video[id]'>".output_text($video['name'])."</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `video_user` WHERE `id_album`='$video[id]'"),0).")<br />";
echo "<img src='user.gif' /> ";
echo online($ank['id'])." <a href='/info.php?id=$ank[id]' title='Анкета \"$ank[nick]\"'><b>$ank[nick]</a><br/>\n";
if($video['opis']!=0)echo "<img src='opis.gif' /> ".output_text($video['opis'])."<br />";
echo "<img src='time.png' /> ".vremja($video['time']);
echo "  </td>\n";
echo "  </tr>\n";
}
echo "</table>\n";
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
echo "<div class='foot'>\n";
echo "<img src='add.png' /> <a href='albumadd.php'>Добавить альбом</a><br />\n";
if($user['level']>0)echo "<img src='set.png' /> <a href='admin.php'>Админка</a><br />\n";
echo "</div>\n";
include_once '../sys/inc/tfoot.php';
?>