Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
} catch (PDOException $e) {
die("Connection failed: " . $e->getMessage());
}
// --- 2. Dynamic Path Management (Fixed for CSS) ---
// 1. Determine Protocol
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? "https://" : "http://";
// 2. Determine Domain
$domain = $_SERVER['HTTP_HOST'];
// 3. Determine the Project Folder (This is usually where the CSS break happens)
// This version is cleaner and handles the root directory properly
$public_path = str_replace($_SERVER['DOCUMENT_ROOT'], '', realpath(__DIR__ . '/..'));
$public_path = ltrim(str_replace('\\', '/', $public_path), '/');
// 4. Build Base URL
// If there is a path, add a slash after it; if not, just the domain slash.
$base_url = $protocol . $domain . '/' . ($public_path ? $public_path . '/' : '');
// Final cleanup to prevent triple slashes
$base_url = preg_replace('/([^:])(\/{2,})/', '$1/', $base_url);
if (!defined('BASE_URL')) define('BASE_URL', $base_url);
// --- 3. Helper Functions ---
function checkLogin() {
if (!isset($_SESSION['user_id'])) {
header("Location: " . BASE_URL . "index.php");
exit();
}
}
?>