//(c) Karel Bednář, kbednar@tam.cz require_once ("main/inc/config.php"); require_once ($server["root"]."/inc/maininc.php"); $textform_vars = array(); $_GET["code"] = str_replace("_", "-", $_GET["code"]); $keyfor404 = SERVER_URLKEY_404; if (!file_exists($server["tpl_root"].'/text_'.$_GET["code"].'_tpl.php')) { $_GET["code"] = $keyfor404; } if ($_GET["code"] == $keyfor404) { header('Status: 404 Not Found'); header('HTTP/1.1 404 Not Found', true, 404); //$page->logstat = false; } //nacteni objektu definice textove stranky $page_vars["URLKEY"] = $_GET["code"]; //podle $page_vars["URLKEY"] naplni objekt $textpage a z nej title, desc a reklamni bloky require_once ($server["root"]."/inc/fillpagevarinc.php"); //naplneni H3 pokud je treba $textform_vars["H3"] = $textpage->valueget("tpah3"); //kontrola zda stranka je nakesovana $tpl = new templatecached('bodytext_tpl.php', $_GET["code"]); if ($tpl->cached) { //naplneni stranky z cache $page_vars["BODY"] = $tpl->cachecontents; } else { //naplneni stranky z db a do cache if (file_exists($server["tpl_root"].'/text_'.$_GET["code"].'_tpl.php')) { $tpli = new template(); $tpli->set_vars($textform_vars, true); $pagetext_vars["PAGE_TEXT"] = $tpli->fetch('text_'.$_GET["code"].'_tpl.php'); } else { header ('Location: '.$server["url"].'/'.$keyfor404.'/'); } //naplneni body stránky $tpl->set_vars($pagetext_vars, true); $page_vars["BODY"] = $tpl->fetch('bodytext_tpl.php'); } if ($page_vars["PAGE_TITLE"] == "") { $pagebody = $page_vars["BODY"]; $posh2s = strpos($pagebody, '