= 0) { $exp = explode('?', $uri); $uri = $exp[0]; } $URL = explode('/', $uri); // Parsing url // Checking cookies if($_SESSION['account']['ID'] == '') { if(isset($_COOKIE['bizzzAuth'])) { // Locate to auth handler header("Location: /user/auth/".$_COOKIE['bizzzAuth']); } } if($URL[0] == 'panel') { include_once ($WEB."panel/index.php"); } else { if($URL[0] == '') { // If homepage - include it module include_once ($WEB."engine/modules/homepage.php"); } else { $moduleActive = 0; // Check if selected module is connected $q = " SELECT * FROM `rce_modules` WHERE `word` = '".$URL[0]."' AND `active` = '1' AND `front` = '1' "; $module = $mysqli->query($q); if($module->num_rows) { // Connect module $module = $module->fetch_assoc(); $tpl_file = $module['word']; @include_once ($WEB."engine/modules/".$tpl_file.".php"); } else { /** * Check for category */ $q = " SELECT * FROM `rce_categories` WHERE `trans` = '".$URL[0]."' "; $info = $mysqli->query($q); if($info->num_rows) { // Have this category, use Category module $tpl_file = 'category'; @require_once ($WEB."engine/modules/category.php"); } /** * Check for company page */ $q = " SELECT * FROM rce_business WHERE trans = '$URL[0]' "; $info = $mysqli->query($q); if($info->num_rows) { // Have this business, open page $tpl_file = 'business'; $moduleActive++; @require_once ($WEB."engine/modules/business.php"); } /** * Check for normal page */ $q = " SELECT * FROM `rce_pages` WHERE `trans` = '".$URL[0]."' "; $info = $mysqli->query($q); if($info->num_rows) { // Have this page, use Page module $fullWidth = [ 'rules', 'license', 'policy' ]; if(in_array($URL[0], $fullWidth)) { $tpl_file = 'page-full'; } else { $tpl_file = 'page'; } @require_once ($WEB."engine/modules/page.php"); } // Nothing found, go to 404 if($moduleActive == 0) { // Set headers and show template header("HTTP/1.0 404 Not Found"); $tpl_file = '404'; } } } // Add widgets include_once ($WEB."engine/modules/widgets.php"); // Include template renderer for site front include_once ($WEB."template/template.php"); }