summaryrefslogtreecommitdiffstats
path: root/web/lib/translator.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-10-24 08:31:47 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-10-24 10:03:54 +0200
commit76343fb91511b9f53e58b6c01b258bfe00ddb4c6 (patch)
tree60eb4d3727bae159a1807915a58348b210ead206 /web/lib/translator.inc.php
parenta0a523070847230565c2ad5993ee058ff475a8e1 (diff)
downloadaurweb-76343fb91511b9f53e58b6c01b258bfe00ddb4c6.tar.xz
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 <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/translator.inc.php')
-rw-r--r--web/lib/translator.inc.php8
1 files changed, 4 insertions, 4 deletions
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!", "<strong>", "</strong>");
-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, "/");
}