47 lines
1.7 KiB
PHP
47 lines
1.7 KiB
PHP
|
<?php
|
|||
|
ini_set('display_errors', 0);
|
|||
|
function compress($buffer) {
|
|||
|
/* удалить комментарии */
|
|||
|
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
|
|||
|
/* удалить табуляции, пробелы, символы новой строки и т.д. */
|
|||
|
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer);
|
|||
|
return $buffer;
|
|||
|
}
|
|||
|
header('Content-type: text/css');
|
|||
|
header("Cache-Control: public");
|
|||
|
header("Expires: " . date("r", time() + 86400));
|
|||
|
ob_start("compress");
|
|||
|
/* css файлы */
|
|||
|
|
|||
|
$css=\DB::getAll("SELECT `txt` FROM `css` WHERE `status`=1");
|
|||
|
|
|||
|
for ($i=0; $i<count($css); $i++){
|
|||
|
include_once( $_SERVER['DOCUMENT_ROOT'] . $css[$i]['txt']);
|
|||
|
}
|
|||
|
|
|||
|
/*
|
|||
|
|
|||
|
$c=count($css_list);
|
|||
|
for ($i = 0; $i < $c; $i++) include_once( $_SERVER['DOCUMENT_ROOT'] . $css_list[$i] );*/
|
|||
|
ob_end_flush();
|
|||
|
?>
|
|||
|
|
|||
|
|
|||
|
<?php
|
|||
|
/*
|
|||
|
ini_set('display_errors', 0 );
|
|||
|
$smarty -> caching = true;
|
|||
|
$smarty -> cache_lifetime = 86400;
|
|||
|
$_GET['id'] = ( $_GET['id'] ) ? $_GET['id'] : 0;
|
|||
|
$categoryInfo=\DB::getAll("SELECT * FROM `tovar_category` WHERE `id`=? LIMIT 1", $_GET['id']);
|
|||
|
$smarty->assign('page_info', $categoryInfo);//получаем инфо о категории
|
|||
|
//print_r($categoryInfo);
|
|||
|
$childrenCategory=\DB::getAll("SELECT `id`, `title` FROM `tovar_category` WHERE `status` = 1 AND `category` = ? ORDER BY `title` LIMIT 33", $_GET['id'] );
|
|||
|
$smarty->assign('list', $childrenCategory);//получаем дочерние категории
|
|||
|
|
|||
|
/* ----------------------------------------------------------------------
|
|||
|
19.09.2022
|
|||
|
Узнаем обложку раздела
|
|||
|
---------------------------------------------------------------------- */
|
|||
|
|
|||
|
?>
|