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() ); ?>