"::1", "port" => 80, "secret" => "5174826b-8595-4958-aa7a-0609632ad7ca", "timeout" => 300, ); require_once('config.php'); switch (ENVIRONMENT) { case 'development': error_reporting(E_ALL); ini_set('display_errors', 1); break; case 'testing': case 'production': error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT); ini_set('display_errors', 0); break; } // session_start(); /* Security issues */ require_once($local_fw_root . "fw_security.php" ); $security = new fw_security(); $security->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 = ((isset($_GET['page']) AND is_numeric($_GET['page'])) ? intval($_GET['page']) : 1); $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']) : ''; $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)) { if (isset($default_lang)) { $lid = $default_lang; } else { $lid = 1; } } 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"); order_sections($sections); // search template if ($sections[$sid]["redirect_id"]) { $sid = $sections[$sid]["redirect_id"]; } /* templates */ $tpl = isset($sections[$sid]["template"]) ? $sections[$sid]["template"] : $frontpl; /* 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.php"; $header_tags = "head_tags.php"; $footertpl = "footer.php"; $general = array("right", "article_bottom"); $noCache = array("comment.php"); // initialize fron end if (isset($noCache) && in_array($tpl, $noCache) || !$use_html_cache || $partview) { require_once($incdir . 'init.php'); if ($part) { require_once($local_tpl_root . $partdir . $part . ".php"); } else { if (isset($fid)) { $article = $factory->get_table($tbl_article, array(), array("id" => $fid, "language" => $lid), "", 1); $article = $factory->db->fetch_assoc($article); $title = $article['title'] . ' - ' . $title; $og_desc = cut_text($article['text_short'], 300); $og_img = thumb("454x303") . $article['image']; } else { $og_desc = $settings['home_text']; $og_img = $http_siteroot . 'inc/images/logo.png'; } require_once($local_tpl_root . $partdir . $headertpl); require_once($local_tpl_root . $tpl); require_once($local_tpl_root . $partdir . $footertpl); } } else { if ($part) { $cache->part($part . ".php", true, (in_array($part, $general) ? false : true), ($part == $comment_list)); } else { if ($fid AND !$cache->exists($lid, $sid, $fid)) { require_once($incdir . 'init.php'); $article = $factory->get_table($tbl_article, array(), array("id" => $fid, "language" => $lid), "", 1); $article = $factory->db->fetch_assoc($article); $title = $article['title'] . ' - ' . $title; $tpl = "article.php"; } require_once($cache->metaTags($local_tpl_root . $partdir . $header_tags)); 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)); } } //Profiler define('PROFILER', 0); if (PROFILER == 1) { require_once($local_plugins . 'PHPBugLost/phpbuglost.php'); echo bl_debug(true); }