Размер файла: 552B
<?php
if($user){
$lang = mysql_fetch_assoc(mysql_query("SELECT `language` FROM `users` WHERE `id` = '" . $userid . "';"));
if($_SERVER['PHP_SELF']!="/index.php"){
$arr = glob('../inc/lang/' . $lang['language'] . '/*.lng');
}else{
$arr = glob('inc/lang/' . $lang['language'] . '/*.lng');
}
foreach($arr as $name){
require('' . $name . '');
}
} else {
$language = isset($_SESSION['lang']) ? $_SESSION['lang'] : 'en';
$arr = glob('inc/lang/' . $language . '/*.lng');
foreach($arr as $name){
require('' . $name . '');
}
}