prokat/api/modules/main/tk-ligat.ru.php
2025-06-16 18:28:08 +05:00

62 lines
2.8 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/* ----------------------------------------------------------------------
05.01.2024
Описываем главную страницу сайта
---------------------------------------------------------------------- */
$smarty->assign('description', 'ТК Лигат - предлагает широкий выбор канцтоваров, хоз товаров, упаковку, моющие средства и многое другое по оптовым ценам');
$smarty->assign('keywords', 'оптовый поставщик хоз товаров в нижнем тагиле');
/* ----------------------------------------------------------------------
05.01.2024
Получаем то что подешевело
---------------------------------------------------------------------- */
$smarty->assign('tovar_act', modClass::getBonusPrice(16));
/* ----------------------------------------------------------------------
15.10.2023
Вынимаем последнее
---------------------------------------------------------------------- */
$smarty->assign('tovar_lost', modClass::getTovar(16, 'id'));
/* ----------------------------------------------------------------------
15.10.2023
Вынимаем самое покупаемое
---------------------------------------------------------------------- */
$smarty->assign('tovar_top', modClass::getTovar(16, 'see'));
/* ----------------------------------------------------------------------
05.01.2024
Получаем сезонные товары
---------------------------------------------------------------------- */
//$tovarSezons=modClass::tovarSezons();
//$smarty->assign('mes', $tovarSezons['mes'] );
//$smarty->assign('tovar_sezon', $tovarSezons['tovar_sezon'] );
/* ----------------------------------------------------------------------
10.02.2024
Получаем избранные категории
---------------------------------------------------------------------- */
function getTopCatgory(){
$cache='/tmp/cache/' . $_SERVER['SERVER_NAME'] . '/topcategory.json';
if (file_exists($cache)){
$text = file_get_contents($cache);
$topCategory=\core::j(\core::unzip($text));
//Чистим кеш через пять дней
$r=time()-filemtime($cache);
if ($r>432000)unlink($cache);
}else{
$topCategory = \DBmysql::getAll("SELECT `id`, `title`, `json` FROM `ctovar` WHERE `showInMain`=? ORDER BY `sort`", 1);
$j=\core::j($topCategory);
file_put_contents($cache, \core::zip($j));
}
return $topCategory;
}
$smarty->assign('topCategory', getTopCatgory() );
?>