Просмотр файла shcms/them.php
- <?
- /*
- =============================================
- Движок: SHCMS Engine
- =============================================
- Название файла: Настройки Темы
- =============================================
- Official website: http://shcms.ru
- =============================================
- */
- define('SHCMS', true);
- include_once'../system/inc/basic_settings.php';
- registrat();
- $shcmsengine['title'] = Lang::get('Настройка темы');
- include_once'../template/head.php';
- $themes_web = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$user_id'"));
- if($_GET['themes']) {$themes = $_GET['themes'];}
- if(isset($_GET['themes'])) {
- if(isset($_POST['submit'])) { $submit = $_POST['submit'];}
- if(isset($_POST['exit'])) {
- header("Location:them.php");
- }
- $config_list = parse_ini_file('../template/designs/'.$themes.'/conf.ini',true);
- if(!$submit) {
- messag(Lang::get('Вы подтверждаете установку темы:') .$config_list['config_themes']['name']);
- echo '<center>';
- $form = new form('?themes='.$themes);
- $form->submit(Lang::get('Установить'),'submit');
- $form->submit(Lang::get('Отмена'),'exit');
- $form->finish();
- echo '</center>';
- }else {
- if(detection::web_browser()) {
- if(isset($submit)) {
- messag(Lang::get('Тема установлена'));
- mysql_query("UPDATE `users` SET `web` = '$themes' WHERE `id` = '$user_id'");
- header('Refresh: 1; url=them.php');
- }else {
- errors(Lang::get('Ошибки при установки темы').' '.$config_list['config_themes']['name']);
- }
- }elseif(detection::wap_browser()) {
- if(isset($submit)) {
- messag(Lang::get('Тема установлена'));
- mysql_query("UPDATE `users` SET `wap` = '$themes' WHERE `id` = '$user_id'");
- header('Refresh: 1; url=them.php');
- } else {
- errors(Lang::get('Ошибки при установки темы').' '.$config_list['config_themes']['name']);
- }
- }elseif(detection::itouch_browser()) {
- if(isset($submit)) {
- messag(Lang::get('Тема установлена'));
- mysql_query("UPDATE `users` SET `itouch` = '$themes' WHERE `id` = '$user_id'");
- header('Refresh: 1; url=them.php');
- } else {
- errors(Lang::get('Ошибки при установки темы') .$config_list['config_themes']['name']);
- }
- }
- }
- }else {
- /*
- * Тема Оформление (WEB)
- * Компьютерная версия
- */
- if(detection::web_browser()) {
- echo "<div class='maintitle mainrazd'>".Lang::get('Тема оформления: WEB')."</div>";
- echo '<div class="maintext">';
- $dir_them = opendir('../template/designs/');
- while ($des_them = readdir( $dir_them)) {
- if (($des_them != '.') && ($des_them != '..' ) && is_dir(H.'template/designs/'.$des_them)) {
- $config = parse_ini_file('../template/designs/'.$des_them.'/conf.ini',true);
- if(parse_ini_file('../template/designs/'.$des_them.'/conf.ini',true)) {
- if($themes_web['web'] == $des_them) {
- echo '<div class="mysql_yes"><img src="../template/icon/themes.png"/> <b>'.$config['config_themes']['name'].'</b>
- <span class="mysql_yes_color" style="float:right;font-size:11px;">'.Lang::get('Используется').'</span><br/>
- <span style="font-size:10px;">
- '.Lang::get('Автор:').' '.$config['config_themes']['author'].' |
- '.Lang::get('Тип темы:').' '.$config['config_themes']['type'].'
- </span>
- </div>';
- }else {
- echo '<div class="mysql_no"><img src="../template/icon/themes.png"/> <a href="?themes='.$des_them.'">'.$config['config_themes']['name'].'</a>
- <span class="mysql_no_color" style="float:right;font-size:11px;">'.Lang::get('Не установлена').'</span><br/>
- <span style="font-size:10px;">
- '.Lang::get('Автор:').' '.$config['config_themes']['author'].' |
- '.Lang::get('Тип темы:').' '.$config['config_themes']['type'].'
- </span>
- </div>';
- }
- }else {
- echo '<div class="mysql_no"><img src="../template/icon/themes.png"/> <strong>'.$des_them.'</strong>
- <span class="mysql_no_color" style="float:right;font-size:11px;">'.Lang::get('Не используется').'</span><br/>
- <span style="font-size:10px;">
- '.Lang::get('В папке отсутствует файл conf.ini').'
- </span>
- </div>';
- }
- }
- }
- closedir( $dir_them);
- echo '</div>';
- /*
- * Установленная тема wap (по умолчанию)
- */
- echo "<div class='maintitle mainrazd'>".Lang::get('Тема оформления: WAP')." <span style='font-size:10px;'>".Lang::get('(По умолчанию)')."</span></div>";
- $config = parse_ini_file('../template/designs/'.$themes_web['wap'].'/conf.ini',true);
- echo '<div class="maintext">';
- echo '<div class="mysql_yes"><img src="../template/icon/themes.png"/> <b>'.$config['config_themes']['name'].'</b>
- <span class="mysql_yes_color" style="float:right;font-size:11px;">'.Lang::get('Используется').'</span><br/>
- <span style="font-size:10px;">
- '.Lang::get('Автор:').' '.$config['config_themes']['author'].' |
- '.Lang::get('Тип темы:').' '.$config['config_themes']['type'].'
- </span>
- </div>';
- echo '</div>';
- /*
- * Установленная тема itouch (по умолчанию)
- */
- echo "<div class='maintitle mainrazd'>".Lang::get('Тема оформления: ITOUCH')." <span style='font-size:10px;'>".Lang::get('(По умолчанию)')."</span></div>";
- $config_itouch = parse_ini_file('../template/designs/'.$themes_web['itouch'].'/conf.ini',true);
- echo '<div class="maintext">';
- echo '<div class="mysql_yes"><img src="../template/icon/themes.png"/> <b>'.$config_itouch['config_themes']['name'].'</b>
- <span class="mysql_yes_color" style="float:right;font-size:11px;">'.Lang::get('Используется').'</span><br/>
- <span style="font-size:10px;">
- '.Lang::get('Автор:').' '.$config_itouch['config_themes']['author'].' |
- '.Lang::get('Тип темы:').' '.$config_itouch['config_themes']['type'].'
- </span>
- </div>';
- echo '</div>';
- //Мобильная тема
- }elseif(detection::wap_browser()) {
- echo Lang::get("Тема оформления:")."<br />";
- $dir_them = opendir('../template/designs/');
- while ($des_them = readdir( $dir_them)) {
- if (($des_them != '.') && ($des_them != '..')) {
- echo '<div class="maintext"><a href="?themes='.$des_them.'">'.$des_them.'</a></div>';
- }
- }
- closedir( $dir_them);
- }elseif(detection::itouch_browser()) {
- echo Lang::get("Тема оформления:")."<br />";
- $dir_them = opendir('../template/designs/');
- while ($des_them = readdir( $dir_them)) {
- if (($des_them != '.') && ($des_them != '..')) {
- echo '<div class="maintext"><a href="?themes='.$des_them.'">'.$des_them.'</a></div>';
- }
- }
- closedir( $dir_them);
- }
- }
- include_once'../template/foot.php';
- ?>