T $*/0ireplace("-", " ",$partes[1]); $q = sprintf("SELECT id FROM `_trubricas` WHERE nome$lang like '%s' AND usar_titulo_na_url>0 AND sublevel<>38 LIMIT 0,1", cms_escape($titulo)); $este = cms_fetch_assoc(cms_query($q)); if ($este[id]>0){ $_GET['id'] = $este[id]; $_SERVER[QUERY_STRING] = "id=".$este[id]; key_store($CACHE_KEY."404:".md5($_SERVER['REQUEST_URI']), $este[id], 7200 + (int)rand(0,2)); chdir($_SERVER[DOCUMENT_ROOT]); set_include_path('../'); include('index.php'); exit; } key_store($CACHE_KEY."404:".md5($_SERVER['REQUEST_URI']), $este[id], 60); } } #30-08-2019 - A pedido do Serafim para as urls dos sites antigos da hoooked if ($_SERVER[HTTP_HOST] != $_SERVER[SERVER_NAME]) { $URL = "https://" . $_SERVER[SERVER_NAME]; header("Location: $URL", true, 301); exit; } ob_end_clean(); if(file_exists($_SERVER["DOCUMENT_ROOT"] . "/templates/404.html")){ header("HTTP/1.0 404 Not Found"); include ($_SERVER["DOCUMENT_ROOT"] . "/templates/404.html"); }elseif(file_exists($_SERVER["DOCUMENT_ROOT"] . "/templates_system/404.html")){ header("HTTP/1.0 404 Not Found"); include ($_SERVER["DOCUMENT_ROOT"] . "/templates_system/404.html"); }else{ header("HTTP/1.0 404 Not Found"); try { @include $_SERVER['DOCUMENT_ROOT']. "/custom/shared/store_settings.inc"; } catch (Throwable $t) {} $x = array(); $x['response']['content_blocks_with'] = 0; if((int)$CONFIG_404_CONTENTBLOCK > 0) { require_once $_SERVER['DOCUMENT_ROOT'].'/api/api_functions.php'; require_once $_SERVER['DOCUMENT_ROOT'].'/api/api_objects.php'; require_once $_SERVER['DOCUMENT_ROOT'].'/api/api_functions_products.php'; require_once $_SERVER['DOCUMENT_ROOT'].'/api/lib/client/client_rest.php'; $r = new Rest($slocation.'/api/api.php'); $vals = $r->get("/getContentBlock/0/$CONFIG_404_CONTENTBLOCK",true); $x = decode_array_to_UTF8(json_decode($vals, true)); foreach($x['response']['content_blocks'] as $k => $v){ foreach($v["banners"] as $kk => $vv){ $x['response']['content_blocks'][$k]['banners'][$kk]['html'] = base64_decode($vv['html']); $x['response']['content_blocks'][$k]['banners'][$kk]['description'] = base64_decode($vv['description']); } foreach($v["tabs"] as $kk => $vv){ foreach($vv['products'] as $kkk => $vvv){ $x['response']['content_blocks'][$k]['tabs'][$kk]['products'][$kkk]['info'] = base64_decode($vvv['info']); $x['response']['content_blocks'][$k]['tabs'][$kk]['products'][$kkk]['info_mob'] = base64_decode($vvv['info_mob']); } } } $x['response']['content_blocks_style'] = call_api_func('get_line_table', 'ContentBlocksStyles', "id=1"); $x['response']['shop'] = call_api_func('OBJ_shop_mini_head'); $x['response']['content_blocks_with'] = 1; } $fx->LoadTwig('../lib/Twig/Autoloader.php','../', false, './temp/'); $fx->printTwigTemplate("plugins/templates_base/error_pages/404.html", $x, false, $exp); } exit; ?>