Размер файла: 2.04Kb
<?php
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
// Sitchi CMS - Mobile Content Management System //
// The author: Nikoloz Sitchinava [sitchi] //
// Link: http://sitchicms.num.ge //
// Skype: SitchiCMS //
// License: LICENSE.txt (see attached file) //
// Version: VERSION.txt (see attached file) //
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
define('_SITCHICMS', 1);
$root_path='../';
require $root_path.'includes/db_connect.php';
require $root_path.'includes/start.php';
require $root_path.'includes/header.php';
require $root_path.'includes/functions.php';
require $root_path.'includes/head.php'; // თავი
if (isset($_POST['submit']))
{
if (isset($user)){
mysql_query("UPDATE `users` SET `set_lang` = '".$_POST['setlng']."' WHERE `id` = '$user[id]' LIMIT 1");}
header('Location: /?lang='.$_POST['setlng'].'');
exit;
}
head(''.$lng['1_69'].'');
echo'<div class="menu"><form action="lang.php" method="post">';
echo'<h3>'.$lng['1_70'].'</h3>';
if (isset($_SESSION['lang'])){
$lngs = $_SESSION['lang'];}
if (!isset($_SESSION['lang'])){
$lngs = $set['set_lang'];}
if (isset($user)){
$lngs = $user['set_lang'];}
$opendirthem=opendir($root_path.'/language');
while ($lang=readdir($opendirthem))
{
if ($lang=='.' || $lang=='..' || !is_dir($root_path."/language/$lang"))continue;
$lang_ini=parse_ini_file($root_path."/language/$lang/config.ini");
echo'<div><input type="radio" value="'.$lang.'" name="setlng" ' . ($lngs == $lang ? 'checked="checked"' : '') . '/> ' .
(file_exists(''.$root_path.'images/flags/'.$lang.'.gif') ? '<img src="'.$root_path.'images/flags/'.$lang.'.gif" alt=""/> '.$lang_ini['name'].'' : '') .''.($lang == $set['set_lang'] ? ' <small class="red">[default]</small>' : '') .
'</div>';
}
echo'<input type="submit" name="submit" value="'.$lng['1_73'].'" />';
echo'<br/><a href="'.htmlspecialchars($_SERVER['HTTP_REFERER']).'">'.$lng['1_50'].'</a></form></div>';
require $root_path.'includes/end.php'; // დასასრული
?>