isCached()) { $cache_data = $cache->getCache(); $cache_mode = $cache->cache_mode; if ($cache_mode == SC_FULL_CACHE) die($cache_data); }else{ $cache_mode = 0; $cache->setCacheMode(0); } include ("lib.php"); global $__useSmarty; $__useSmarty = false; $QUERY_STRING = RemoveCacheRemover(getenv("QUERY_STRING")); if (isset($_GET["DocID"])) { if (!is_numeric($_GET["DocID"])) trigger_error("Incorrect parameter!", E_USER_ERROR); if (GetValueFromDB("select * from dm_doc where DocID=".$_GET["DocID"])=="") trigger_error("Record don't exists!", E_USER_ERROR); } LoadLib("page_client"); //Get page info $page_code=$_GET['page']; if ($page_code=="") GetDefaultPage($page_code);//Если ничего не установлено - пытаемся показать index list($cookie_PageName, $mod_id, $page_id) = GetRecordFromDB("select Title, PageProducer, ID from cm_page where code='".$page_code."'",__FILE__,__LINE__); if ($mod_id <= 0) unset($mod_id); if ($page_id == "" || $page_code == ""){ $page_code = "#error"; list($cookie_PageName, $mod_id, $page_id) = GetRecordFromDB("select Title, PageProducer, ID from cm_page where code='".$page_code."'",__FILE__,__LINE__); } if ($page_id == "" || $page_code == "") trigger_error("Page not found!",E_USER_ERROR); setcookie("cp_info_page_code",$page_code); if (!isset($lang_id)) $lang_id = GetCurrentLangID(); else SetCurrentLangID($lang_id); if (isset($mod_id) && !is_numeric($mod_id)) trigger_error("Error! mod_id must be numeric!", E_USER_ERROR); if (!isset($mod_id)) { // echo $lang_id; $lang_id = 2; $page = CreatePage($page_code, $lang_id); setNonCachedAtribs($page, $page_id, $lang_id); $Sign = "Created by 'index' for"; } else{ $module = LoadModule($mod_id); if ($module === false) trigger_error("Module with id $mod_id not exist!", E_USER_ERROR); $info = $module->GetInfo(); if (isset($info["UseSmarty"]) && $info["UseSmarty"] == true){ $__useSmarty = true; }else{ $__useSmarty = false; } $module->PageCode = $page_code; $language_id = $lang_id; if ($module->Actions($page_code, $lang_id)) die(); $cache_mode = $module->CacheMode; $cache->setCacheMode($module->CacheMode); if (!$cache->isCached()) { $page = $module->CreatePage($page_code, $lang_id); $cache_mode = $module->CacheMode; $cache->setCacheMode($module->CacheMode); if ($__useSmarty == true) $page = $page->fetch("cm:PageCache".$page_id.".".$lang_id); if ($module->CacheMode == SC_PART_CACHE) { setNonCachedAtribs($page, $page_id, $lang_id); $cache->WriteCache($page); } }else{ $page = $cache_data; } $module->CreatePage_PostCache(&$page, $lang_id); if ($module->CacheMode != SC_PART_CACHE) setNonCachedAtribs($page, $page_id, $lang_id); $cookie_PageName = $module->GetCurrentPageName(); $Sign = "Created by '".get_class($module)."' for"; } global $__notfound_message; if (isset($__notfound_message)) $page=str_replace("<%PAGE_URI%>", $__notfound_message, $page); setcookie("PageName",$cookie_PageName); if ($cache_mode == SC_FULL_CACHE) $cache->WriteCache($page); $finishtime = getmicrotime(); $page = str_replace("<%CUR_YEAR%>",date("Y"),$page); EchoPage($page,false); printf("\r\n\r\n", $finishtime-$begintime, $TotalQueryCount); //printf("
\n".$Sign." %1.5f sec\n
Query Count: %s\n
",$finishtime-$begintime, $TotalQueryCount); ?>