libreqr/inc.php

38 lines
1.2 KiB
PHP
Raw Normal View History

<?php // ----- This file is included everywhere -----
require "config.inc.php";
2021-07-11 14:00:35 +02:00
define("DEFAULT_REDONDANCY", "H");
2021-11-01 18:08:42 +01:00
define("DEFAULT_MARGIN", 10);
define("DEFAULT_SIZE", 100);
2021-07-11 14:00:35 +02:00
define("DEFAULT_BGCOLOR", "FFFFFF");
define("DEFAULT_MAINCOLOR", "000000");
2021-07-11 22:22:43 +02:00
$libreqrVersion = "1.4.0dev";
// Defines the locale to be used
if ($forceLocale == false AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$clientLocales = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$clientLocales = preg_replace("#[A-Z0-9]|q=|;|-|\.#", "", $clientLocales);
$clientLocales = explode(',', $clientLocales);
2021-01-01 16:42:36 +01:00
$availableLocales = array('en', 'fr', 'oc', 'template');
foreach ($clientLocales as $clientLocale) {
if (in_array($clientLocale, $availableLocales)) {
$locale = $clientLocale;
break;
}
}
}
require "locales/" . $locale . ".php";
// Defines the root URL
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
$protocol = "https";
else
$protocol = "http";
$rootPath = $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$rootPath = preg_replace('#\?.*$#', '', $rootPath);
$rootPath = preg_replace('#(manifest|opensearch|index).php$#i', '', $rootPath);
require "themes/" . $theme . "/theme.php"; // Load theme