Файл: adm_panel/themes.php
Строк: 90
<?php
require_once '../sys/inc/start.php';
require_once '../sys/inc/compress.php';
require_once '../sys/inc/sess.php';
require_once '../sys/inc/settings.php';
$temp_set = $set;
require_once '../sys/inc/db_connect.php';
require_once '../sys/inc/ipua.php';
require_once '../sys/inc/fnc.php';
require_once '../sys/inc/adm_check.php';
require_once '../sys/inc/user.php';
user_access('adm_themes', null, 'index.php?' . SID);
adm_check();
$set['title'] = 'Темы оформления';
require_once '../sys/inc/thead.php';
$opendirthem = opendir(H . 'style/themes');
while ($themes2 = readdir($opendirthem)) {
// запись всех тем в массив
if ($themes2 == '.' || $themes2 == '..') {
continue;
}
$themes3[] = $themes2;
}
closedir($opendirthem);
if (isset($_GET['delete']) && in_array("$_GET[delete]", $themes3) && isset($_GET['ok'])) {
$del_them = $_GET['delete'];
if ($del_them == $temp_set['set_them2'] || $del_them == $temp_set['set_them']) {
$err = 'Тема используется по умолчанию';
} else {
if (@delete_dir(H . 'style/themes/' . $del_them)) {
$themes3 = NUll;
$opendirthem = opendir(H . 'style/themes');
while ($themes2 = readdir($opendirthem)) {
// запись всех тем в массив
if ($themes2 == '.' || $themes2 == '..') {
continue;
}
$themes3[] = $themes2;
}
closedir($opendirthem);
msg("Тема успешно удалена");
} else {
$err = "Невозможно удалить тему";
}
}
}
err();
aut();
$k_post = sizeof($themes3);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
for ($i = $start; $i < $k_post && $i < $set['p_str'] * $page; $i++) {
// постраничный вывод тем
$themes = $themes3[$i];
echo "<table class = 'foot'><tr><td class = 'icon48'>";
if (is_file(H . 'style/themes/' . $themes . '/screen_48.png')) {
echo "<img src='" . H . "style/themes/" . $themes . "/screen_48.png' alt='' /><br />n";
} else {
echo "Нет";
}
echo " </td><td class='null'>n";
echo ($name = @file_get_contents(H . 'style/themes/' . $themes . '/them.name')) ? $name : $themes;
echo "<br />n";
echo "Папка с темой: <span title='/style/themes/$themes/'>$themes</span><br />n";
// размер файла таблиц стилей
echo (is_file(H . 'style/themes/' . $themes . '/style.css')) ? "<a href='/style/themes/$themes/style.css'>style.css</a>: " . size_file(filesize(H . 'style/themes/' . $themes . '/style.css')) . "<br />n" : "Нет style.css<br />n";
if ($themes == $temp_set['set_them']) {
echo "По умолчанию для WAP<br />n";
}
if ($themes == $temp_set['set_them2']) {
echo "По умолчанию для WEB<br />n";
}
echo 'Стоит у ' . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `set_them` = '$themes' OR `set_them2` = '$themes'"), 0) . " чел.<br />n";
echo "<a href='?delete=$themes&page=$page'>Удалить</a><br />n";
echo "</td></tr></table>n";
}
if (isset($_GET['delete']) && in_array("$_GET[delete]", $themes3)) {
$del_them = $_GET['delete'];
echo "<div class='err'>n";
if ($del_them == $temp_set['set_them2'] || $del_them == $temp_set['set_them']) {
echo "Тема " . (($name = @file_get_contents(H . 'style/themes/' . $del_them . '/them.name')) ? $name : $del_them) . " установлена по умолчанию<br />n<a href='?page=$page'>Отмена</a><br />n";
} else {
echo "Подтвердите удаление (" . (($name = @file_get_contents(H . 'style/themes/' . $del_them . '/them.name')) ? $name : $del_them) . "):<br />n";
echo "<a href='?delete=$del_them&page=$page&ok'>Удалить</a> | <a href='?page=$page'>Отмена</a><br />n";
}
echo "</div>n";
}
if ($k_page > 1) {
str('?', $k_page, $page);
} // Вывод страниц
echo "<div class='foot'>n";
echo "»<a href='them_installer.php'>Установка тем</a><br />n";
if (user_access('adm_panel_show')) {
echo "«<a href='/adm_panel/'>Панель управления</a><br />n";
}
echo "</div>n";
require_once '../sys/inc/tfoot.php';