if(isset($_GET['controller']) && ($_GET['controller'] == 'custom_url' || $_GET['controller'] == 'router')) { //custom url controller $queryString = http_build_query($_GET); } elseif((!isset($_GET['controller']) || $_GET['controller'] == 'index') && isset($default_query_string)) { //index but default exists. $toParse = $_GET; if(isset($toParse['controller'])) { unset($toParse['controller']); } if(count($toParse) == 0) { parse_str($default_query_string,$parsed); if(is_array($parsed)) { $finalQueryString = array_merge($toParse,$parsed); $queryString = http_build_query($finalQueryString); } else { $queryString = parse_url($thisUrl, PHP_URL_QUERY); } } else { $queryString = parse_url($thisUrl, PHP_URL_QUERY); } } else { //index file $queryString = parse_url($thisUrl, PHP_URL_QUERY); } var_dump($queryString); if(isset($queryString) && !empty($queryString)) { setcookie('query_string', $queryString, time() + (86400 * 30), "/"); } if(isset($_COOKIE['query_string']) && !empty($_COOKIE['query_string'])) { $queryString = $_COOKIE['query_string']; } ini_set("display_startup_errors", "On"); ini_set("display_errors", "On"); error_reporting(E_ALL); //$translator = new \DeepL\Translator($authKey); include $_SERVER['DOCUMENT_ROOT'] . '/sqlite.php'; include 'controllers/checkfunc.php'; //$result = $translator->translateText('Hello, world!', null, 'fr'); //echo $result->text; // Bonjour, le monde! $acceptLanguage = $_SERVER['HTTP_ACCEPT_LANGUAGE']; $detectedLanguage = detectLanguage($acceptLanguage, $langs); //ho "Detected Language: " . $detectedLanguage; if (isset($_GET['modbongacams'])) file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/bongacams', $_GET['modbongacams']); if (isset($_GET['modstripchat'])) file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/stripchat', $_GET['modstripchat']); if (isset($_GET['testchat'])) { $cookie_name = "testchat"; $cookie_value = "true"; setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 day if ($_GET['testchat'] == 'false') { unset($_COOKIE['testchat']); setcookie('testchat', '', -1, '/'); } } require_once 'admin/mb.php'; $_template_header = false; $_template_content = false; $_template_footer = false; //var_dump($_GET);exit; /* Set maintenance mode page if site is offline and admin is not logged in */ if ($config['maintenance_mode'] && !isset($_SESSION['isAdmin'])) { ini_set('display_errors', 'off'); $thisController = 'maintenance'; //var_dump($_GET); /* ... otherwise search for existing controller file on a basis of current url */ } else if (isset($_GET['controller']) && $_GET['controller'] != "" && file_exists("$basepath/controllers/control.$_GET[controller].php")) { $thisController = $_template = $_GET['controller']; /* ... finally set index controller, if no existing controllers found before */ } else { $thisController = $_template = 'index'; } /* Include controller file */ require_once "$basepath/controllers/control.$thisController.php"; /* Include metatags setup */ include_once "$basepath/includes/inc.metatags.php"; function Quote($Str) // Double-quoting only { $Str = str_replace('"', '\"', $Str); return '"' . $Str . '"'; } // if (isset($_REQUEST['url'])&&preg_match('|/languages/|i',$_REQUEST['url'])) { /* Load header template corresponding with current page (overall_header by the default or custom defined in controller) */ if (is_string($_template_header)) { require_once $template_path . "/template.$_template_header.php"; } else if ($_template_header === false) { require_once $template_path . "/template.overall_header.php"; } /* Load content template corresponding with current page (or custom defined in controller, or 404 if no corresponding template found) */ if (is_string($_template_content)) { require_once $template_path . "/template.$_template_content.php"; } else if (isset($_template)) { require_once $template_path . "/template.$_template.php"; } else { require_once $template_path . '/template.404.php'; } /* Load footer template corresponding with current page (overall_footer by the default or custom defined in controller) */ if (is_string($_template_footer)) { require_once $template_path . "/template.$_template_footer.php"; } else if ($_template_footer === false) { require_once $template_path . "/template.overall_footer.php"; } if (function_exists("closeDB")) closeDB(); /* Show debugging output, if enabled in configuration */ debugClosure();