<?
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();
if (!isset($_GET['dir']))
{
header("Location: index.php?");
exit;
}
$quer=mysql_fetch_array(mysql_query("select * from `zakladki_dir` where `id`='".intval($_GET['dir'])."' and `id_user`='$user[id]'"));
$set['title']='Закладки. Папка - '.esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($quer['name'])))))))).'';
include_once '../sys/inc/thead.php';
title();
err();
aut();
if(isset($_GET['dir']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `zakladki_dir` WHERE `id` = '".intval($_GET['dir'])."' and `id_user`='$user[id]'"),0))
{
$dir=mysql_fetch_array(mysql_query("select * from `zakladki_dir` where `id`='".intval($_GET['dir'])."' and `id_user`='$user[id]'"));
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `zakladki` WHERE `id_dir` = '$dir[id]' and `id_user`='$user[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 "<div class='err'>Вещей в категории нет.</div>";
$s = mysql_fetch_array(mysql_query("select * from `zakladki` WHERE `id_user`='$user[id]'"));
if ($s['set']==1){
echo "<div class='body'>";
$zakladki = mysql_query("select * from `zakladki` WHERE `id_dir` = '$dir[id]' and `id_user`='$user[id]' ORDER by `id` Asc LIMIT $start, $set[p_str]");
echo "<table class='post'><tr>";
while ($zakladka = mysql_fetch_array($zakladki)){
echo "<td class='p_m'><center><iframe width=$zakladka[width] height=$zakladka[heigh] src='$zakladka[url]' scrolling=no></iframe><br><a href='$zakladka[url]' title='$zakladka[opis]'>$zakladka[name]</a><center></td>";
if ($zakladka['br']=='no')echo " ";
else echo "</tr><tr>";
}
echo "</tr></table></div>";
}
else{
$zakladki = mysql_query("select * from `zakladki` WHERE `id_dir` = '$dir[id]' and `id_user`='$user[id]' ORDER by `id` DESC LIMIT $start, $set[p_str]");
while ($zakladka = mysql_fetch_array($zakladki)){
if ($zakladka['url']!=Null)echo "<div class='p_t'><img src='icons/bookmark.png'> <a href='$zakladka[url]'>$zakladka[name]</a></div>";
else echo "<div class='p_t'><img src='icons/bookmark.png'> $zakladka[name]</div>";
echo "<div class='p_m'><b>Описание</b>: $zakladka[opis]</div>";
}
}
if ($k_page>1)str("?dir=$dir[id]&amp;",$k_page,$page);
echo "<div class='p_m'><img src='icons/back.png' alt='' /> <a href='index.php'>Назад</a></div>";
}
include_once '../sys/inc/tfoot.php';
?>