// Require necessary files. require_once 'content/init.php'; // Get full url for meta control. $fullUrl = $site->url['full']; // Get meta for check. $indexMeta = $site->db->select("SELECT `id`,`cache` FROM `ad_meta` WHERE `lang` = :lang AND `full_url` = :full_url", array('lang' => $site->lang, 'full_url' => $fullUrl)); // If cache is turned on from admin panel, include cache files. if ($settings['cache_status'] == 1 && ($site->url[0] == '' || (checkarr($indexMeta) && $indexMeta[0]['cache'] == 1))) { include 'content/layouts/cache/cacheTop.php'; } if (!$site->isContent()) { // If there is no $site->url[0] then return index page. // Include main.php include 'content/layouts/main.php'; } else if (empty($indexMeta)) { // If meta is empty, that means it there is no such page like url. Redirects 404 page. // Get hosting http adress. $host = $_SERVER['HTTP_HOST']; // Get root directory of file. $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); // Get 404 page file url. $link404 = $site->getUrlByModule('404'); $link404 = empty($link404) == false ? $link404 : '404'; $extra = $site->lang_small . '/' . $link404; // Redirect to 404 page link. header("Location: http://$host$uri/$extra"); // Finally exit this process. exit; } else { // If meta and $site->url[0] are not empty, that means it is normal sub page. // Include sub.php include 'content/layouts/sub.php'; } // If cache is turned on from admin panel, include cache files. if ($settings['cache_status'] == 1 && ($site->url[0] == '' || (checkarr($indexMeta) && $indexMeta[0]['cache'] == 1))) { include 'content/layouts/cache/cacheBottom.php'; } $s_ref = $_SERVER['HTTP_REFERER']; if ($browserLang == 'id') {}