From 76343fb91511b9f53e58b6c01b258bfe00ddb4c6 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 24 Oct 2014 08:31:47 +0200 Subject: Use an INI-style configuration file Replace web/lib/config.inc.php with an INI-style configuration file. This allows us to get rid of several globals and makes it easier to use the same configuration file in external scripts. Signed-off-by: Lukas Fleischer --- web/lib/translator.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'web/lib/translator.inc.php') diff --git a/web/lib/translator.inc.php b/web/lib/translator.inc.php index 448c41b..b50ef4b 100644 --- a/web/lib/translator.inc.php +++ b/web/lib/translator.inc.php @@ -11,7 +11,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../lib' . PATH_SEPARATOR # print __("%s has %s apples.", "Bill", "5"); # print __("This is a %smajor%s problem!", "", ""); -include_once('config.inc.php'); +include_once("confparser.inc.php"); include_once('DB.class.php'); include_once('gettext.php'); include_once('streams.php'); @@ -82,7 +82,6 @@ function _n($msgid1, $msgid2, $n) { function set_lang() { global $LANG; global $SUPPORTED_LANGS; - global $PERSISTENT_COOKIE_TIMEOUT; global $streamer, $l10n; $update_cookie = 0; @@ -116,11 +115,12 @@ function set_lang() { # Set $LANG to default if nothing is valid. if (!array_key_exists($LANG, $SUPPORTED_LANGS)) { - $LANG = DEFAULT_LANG; + $LANG = config_get('options', 'default_lang'); } if ($update_cookie) { - $cookie_time = time() + $PERSISTENT_COOKIE_TIMEOUT; + $timeout = intval(config_get('options', 'persistent_cookie_timeout')); + $cookie_time = time() + $timeout; setcookie("AURLANG", $LANG, $cookie_time, "/"); } -- cgit v1.2.3-54-g00ecf