Файл: user/inc/index.php
Строк: 35
<?php
only_reg();
$cache_file = H . 'sys/cache/user_menu/index_' . mt_rand($user['id'], 99) . '.html';
$cache_time = $set['user_cab_time'];
if (file_exists($cache_file) and time() - $cache_time < filemtime($cache_file)) {
echo "<!-- dcms-fiera " . date('H:i', filemtime($cache_file)) . "Время кэша))-->";
require_once($cache_file);
} else {
ob_start();
$q_menu = query("SELECT * FROM `user_menu` where `type_set` = 'index' ORDER BY `pos` ASC");
while ($post_menu = mysql_fetch_assoc($q_menu)) {
if ($post_menu['type'] != 'inc') {
if ($post_menu['type'] == 'link') {
echo "<a class='list-group-item' href='$post_menu[url]'>";
} else {
echo "<div class='list-group-item'>";
}
echo lang($post_menu['name']);
if ($post_menu['type'] == 'link') {
echo "</a>";
} else {
echo "</div>";
}
} else {
if ($post_menu['type'] == 'inc' and is_file(H . 'sys/user/index/' . $post_menu['url'])) {
include_once H . 'sys/user/index/' . $post_menu['url'];
}
}
}
$cached = fopen($cache_file, 'w');
fwrite($cached, ob_get_contents());
fclose($cached);
ob_end_flush(); # Отправялем вывод в браузер
}