Файл: user/files/include.php
Строк: 24
<?php
/*
* Файлы
* DCMS Special
* Модифицировал densnet
* Файл include.php
*/
if (isset($_GET['id'])) {
$id = intval($_GET['id']);
} else {
$id = $user['id'];
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$id' LIMIT 1"), 0) == 0) {
header("Location: index.php?id=" . $user['id'] . "");
exit;
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `user_dir` WHERE `id_user` = '$id' AND `dir` = '0'"), 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 = 'razd'>";
echo "<img src = '/style/img/error.png' /> Нет результатов";
echo "</div>";
}
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$id' LIMIT 1"));
$q = mysql_query("SELECT * FROM `user_dir` WHERE `id_user` = '$id' AND `dir` = '0' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q)) {
$k_f = 0;
$q3 = mysql_query("SELECT * FROM `user_dir` WHERE `dir` = '$post[id]'");
while ($post2 = mysql_fetch_array($q3)) {
$k_f = $k_f + mysql_result(mysql_query("SELECT COUNT(*) FROM `user_files` WHERE `dir` = '$post2[id]'"), 0);
}
$k_f = $k_f + mysql_result(mysql_query("SELECT COUNT(*) FROM `user_files` WHERE `dir` = '$post[id]'"), 0);
echo "<div class = 'razd' id = 'hide'>";
echo "<span class = 'icon icon92' /> <a href = '/user/files/dir.php?id=$id&dir=$post[id]'>" . htmlentities($post['name'], ENT_QUOTES, 'UTF-8') . "</a> ($k_f)";
if ($id == $user['id']) {
echo "<div class = 'right'>";
echo "<a href = '/user/files/edit.php?id=$post[id]&act=rename' title = 'Переименовать'><img src = '/style/img/pencil.png' /></a> ";
echo "<a href = '/user/files/edit.php?id=$post[id]&act=delete' title = 'Удалить'><img src = '/style/img/delete.png' /></a>";
echo "</div>";
}
echo "</div>";
}
if ($id == $user['id']) {
echo "<div class = 'buttons razd'>";
echo "<a href = '/user/files/edit.php?id=0&act=new' class = 'button'><span class = 'icon icon3' />Создать папку</a>";
echo "</div>";
}
if ($k_page > 1) {
str('?', $k_page, $page);
}