Файл: modules/smiles/dir.php
Строк: 34
<?php
/* DCMS Special
* Дата последнего редактирования 16.01.2015
* Модифицировал densnet
*/
foreach (array('start', 'compress', 'sess', 'settings', 'db_connect', 'ipua', 'fnc', 'user') as $inc) {
require_once "../../sys/inc/$inc.php";
}
if (isset($_GET['id'])) {
$id = intval($_GET['id']);
} else {
header("Location: /index.php");
}
$doc->Title('Смайлы');
require_once H . 'sys/inc/thead.php';
aut();
err();
$dir = mysql_fetch_array(mysql_query("SELECT * FROM `smiles_dir` WHERE `id` = '" . $id . "'"));
#Навигация
echo "<div class='card-header'>";
echo "<a href='/' data-toggle='tooltip' data-placement='right' title='" . lang('На главную') . "'><i class='fa fa-home fa-lg'></i></a> <i class='fa fa-angle-right fa-fw'></i> ";
echo "<a href='/modules/smiles/'>" . lang('Смайлы') . "</a> <i class='fa fa-angle-right fa-fw'></i> ";
echo toOutput($dir['name']);
echo "</div>";
if (!isset($user)) {
err(lang('Доступ закрыт'));
} else if ($id == 0 || $id < 0) {
err(lang('Директория не найдена'));
} else if ($id != $dir['id']) {
err(lang('Директория не найдена'));
} else if ($user['level'] != $dir['level'] && $user['level'] < 0) {
err(lang('Эти смайлы не для Вас'));
} else {
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `smiles_spis` WHERE `id_dir` = '$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) {
$doc->NoResult();
}
$q = mysql_query("SELECT * FROM `smiles_spis` WHERE `id_dir` = '$id' ORDER BY `id` ASC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q)) {
echo "<table class='list-group-item-komm'><tr><td class='icon14'>";
echo "<img src='/style/smiles/$post[name].png' alt='$post[name]' />";
echo "</td><td class='null'>";
echo "<input type='text' value='$post[sim]'>";
echo "</td></tr></table>";
}
if ($k_page > 1) {
echo "<div class='list-group-item'>";
str("dir.php?id=$id&", $k_page, $page);
echo "</div>";
}
}
require_once H . 'sys/inc/tfoot.php';