04-07-2016, 01:14 AM
Hi,
I used very simple workaround which allows you to set language per user directly in the database (no web interface for changing user language)
1. Execute following query on the database:
2. Set user_language in the odm_user table
3. Add following code to functions.php line 49 (before include_once('includes/language/' . $GLOBALS['CONFIG']['language'] . '.php'); ):
I used very simple workaround which allows you to set language per user directly in the database (no web interface for changing user language)
1. Execute following query on the database:
Code:
ALTER TABLE `odm_user` ADD `user_language` VARCHAR(15) NOT NULL DEFAULT 'english' COMMENT 'Language of the application per user' ;
2. Set user_language in the odm_user table
3. Add following code to functions.php line 49 (before include_once('includes/language/' . $GLOBALS['CONFIG']['language'] . '.php'); ):
PHP Code:
if (isset($_SESSION['uid'])) {
$query = "SELECT user_language FROM {$GLOBALS['CONFIG']['db_prefix']}user WHERE id ='".$_SESSION['uid']."'";
$stmt = $pdo->prepare($query);
$stmt->execute();
$result = $stmt->fetchAll(); //print_r($result);
$GLOBALS['CONFIG']['language'] = $result[0]["user_language"]; //print_r($GLOBALS['CONFIG']);
}