init(); require_once($local_fw_root . "fw_file.php" ); require_once($local_fw_root . "fw_array.php" ); require_once($local_fw_root . "fw_func.php" ); require_once($local_tbl_root . "tbl_all.php" ); require_once($local_plugins . 'Route/Route.php'); if ($use_json) { require_once($local_fw_root . "fw_cache_json.php" ); $fw_cache_json = new fw_cache_json(); } /* Initialize objects */ $fw_file = new fw_file(); /* request variables */ $cid = !empty($_REQUEST['cid']) ? $_REQUEST['cid'] : ''; $tpl = !empty($_REQUEST['tpl']) ? $_REQUEST['tpl'] : ''; $offset = !empty($_REQUEST['offset']) ? $_REQUEST['offset'] : ''; $filter = !empty($_REQUEST['filter']) ? $_REQUEST['filter'] : ''; $page = !empty($_REQUEST['page']) ? $_REQUEST['page'] : ''; $search_query = !empty($_REQUEST['q']) ? $_REQUEST['q'] : ''; $search_page = !empty($_REQUEST['p']) ? $_REQUEST['p'] : ''; $date = !empty($_REQUEST['date']) ? $_REQUEST['date'] : ''; $part = !empty($_REQUEST['part']) ? str_replace(array(".", "..", "/"), "", $_REQUEST['part']) : ''; $partview = !empty($_REQUEST['partview']) ? str_replace(array(".", "..", "/"), "", $_REQUEST['partview']) : ''; $partview = !empty($_REQUEST['partview']) ? $_REQUEST['partview'] : ''; $limit = (($page - 1) * $page_limit) . ", " . $page_limit; /* Language, section and article requests */ /* @list($lid, $sid, $fid) = explode(",", $cid); if (!$sid || !is_numeric($sid)) { $sid = 1; } if (!$lid || !is_numeric($lid)) { $lid = 1; } if (isset($fid) && !is_numeric($fid)) { unset($fid); } */ if (isset($_REQUEST['url'])) { $route = new Route($_REQUEST['url']); $lid = $route->lid; $sid = $route->sid; $fid = $route->fid; $page = $route->page; $limit = (((is_null($page) ? 1 : $page) - 1) * $page_limit) . ", " . $page_limit; $article_route = $route->article; /* Language, section and article requests */ // @list($lid, $sid, $fid) = explode(",", $cid); } else { @list($lid, $sid, $fid) = explode(",", $cid); } if (!$sid || !is_numeric($sid)) { $sid = 1; } if (!$lid || !is_numeric($lid)) { $lid = 2; } if (isset($fid) && !is_numeric($fid)) { unset($fid); } /* Remove Html Cache */ if (isset($_GET["rmcache"])) { rm_dir($local_siteroot . "cache/html/", true); } if ($use_html_cache) { require_once($local_fw_root . 'fw_cache.php'); $cache = new fw_cache(); } /* get general json caches */ $sections = get_cache($tbl_section, $cache_fields["sections"], array("language" => $lid),"group,ASC,parent_id,ASC,ord,ASC"); /* templates */ $tpl = isset($sections[$sid]["template"]) ? $sections[$sid]["template"] : 'home_sector.php'; /* check if part exists */ if ($part && !file_exists($local_tpl_root . $partdir . $part . ".php")) { $part = ""; } /* check if partview exists */ if ($partview && !file_exists($local_tpl_root . $partdir . $partview . ".php")) { $partview = ""; } /* ajax request templates */ if ($part) { $tpl = $part . ".php"; } // check which header to show $headertpl = "header_section.php"; $footertpl = "footer.php"; // initialize fron end if (isset($noCache) && in_array($tpl, $noCache) || !$use_html_cache || $partview) { require_once($incdir . 'init.php'); // search template $search_id = get_field_from_array($sections, array("template" => "search.php"), "id"); if ($search_query) { $sid = $search_id; } if ($part) { require_once($local_tpl_root . $partdir . $part . ".php"); } else { require_once($local_tpl_root . $partdir . $headertpl); require_once($local_tpl_root . $tpl); require_once($local_tpl_root . $partdir . $footertpl); } } else { if ($part) { require_once($cache->template($local_tpl_root . $partdir . $part . ".php")); } else { require_once($cache->header($local_tpl_root . $partdir . $headertpl)); require_once($cache->template($local_tpl_root . $tpl)); require_once($cache->footer($local_tpl_root . $partdir . $footertpl)); } } ?>