Просмотр файла shcms/them.php

Размер файла: 8.03Kb
  1. <?
  2. /*
  3. =============================================
  4. Движок: SHCMS Engine
  5. =============================================
  6. Название файла: Настройки Темы
  7. =============================================
  8. Official website: http://shcms.ru
  9. =============================================
  10. */
  11. define('SHCMS', true);
  12. include_once'../system/inc/basic_settings.php';
  13. registrat();
  14. $shcmsengine['title'] = Lang::get('Настройка темы');
  15. include_once'../template/head.php';
  16. $themes_web = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$user_id'"));
  17. if($_GET['themes']) {$themes = $_GET['themes'];}
  18. if(isset($_GET['themes'])) {
  19. if(isset($_POST['submit'])) { $submit = $_POST['submit'];}
  20. if(isset($_POST['exit'])) {
  21. header("Location:them.php");
  22. }
  23. $config_list = parse_ini_file('../template/designs/'.$themes.'/conf.ini',true);
  24. if(!$submit) {
  25. messag(Lang::get('Вы подтверждаете установку темы:') .$config_list['config_themes']['name']);
  26. echo '<center>';
  27. $form = new form('?themes='.$themes);
  28. $form->submit(Lang::get('Установить'),'submit');
  29. $form->submit(Lang::get('Отмена'),'exit');
  30. $form->finish();
  31. echo '</center>';
  32. }else {
  33. if(detection::web_browser()) {
  34. if(isset($submit)) {
  35. messag(Lang::get('Тема установлена'));
  36. mysql_query("UPDATE `users` SET `web` = '$themes' WHERE `id` = '$user_id'");
  37. header('Refresh: 1; url=them.php');
  38. }else {
  39. errors(Lang::get('Ошибки при установки темы').' '.$config_list['config_themes']['name']);
  40. }
  41. }elseif(detection::wap_browser()) {
  42. if(isset($submit)) {
  43. messag(Lang::get('Тема установлена'));
  44. mysql_query("UPDATE `users` SET `wap` = '$themes' WHERE `id` = '$user_id'");
  45. header('Refresh: 1; url=them.php');
  46. } else {
  47. errors(Lang::get('Ошибки при установки темы').' '.$config_list['config_themes']['name']);
  48. }
  49. }elseif(detection::itouch_browser()) {
  50. if(isset($submit)) {
  51. messag(Lang::get('Тема установлена'));
  52. mysql_query("UPDATE `users` SET `itouch` = '$themes' WHERE `id` = '$user_id'");
  53. header('Refresh: 1; url=them.php');
  54. } else {
  55. errors(Lang::get('Ошибки при установки темы') .$config_list['config_themes']['name']);
  56. }
  57. }
  58. }
  59. }else {
  60. /*
  61. * Тема Оформление (WEB)
  62. * Компьютерная версия
  63. */
  64. if(detection::web_browser()) {
  65. echo "<div class='maintitle mainrazd'>".Lang::get('Тема оформления: WEB')."</div>";
  66. echo '<div class="maintext">';
  67. $dir_them = opendir('../template/designs/');
  68. while ($des_them = readdir( $dir_them)) {
  69. if (($des_them != '.') && ($des_them != '..' ) && is_dir(H.'template/designs/'.$des_them)) {
  70. $config = parse_ini_file('../template/designs/'.$des_them.'/conf.ini',true);
  71. if(parse_ini_file('../template/designs/'.$des_them.'/conf.ini',true)) {
  72. if($themes_web['web'] == $des_them) {
  73. echo '<div class="mysql_yes"><img src="../template/icon/themes.png"/>&nbsp;<b>'.$config['config_themes']['name'].'</b>
  74. <span class="mysql_yes_color" style="float:right;font-size:11px;">'.Lang::get('Используется').'</span><br/>
  75. <span style="font-size:10px;">
  76. '.Lang::get('Автор:').' '.$config['config_themes']['author'].' |
  77. '.Lang::get('Тип темы:').' '.$config['config_themes']['type'].'
  78. </span>
  79. </div>';
  80. }else {
  81. echo '<div class="mysql_no"><img src="../template/icon/themes.png"/>&nbsp;<a href="?themes='.$des_them.'">'.$config['config_themes']['name'].'</a>
  82. <span class="mysql_no_color" style="float:right;font-size:11px;">'.Lang::get('Не установлена').'</span><br/>
  83. <span style="font-size:10px;">
  84. '.Lang::get('Автор:').' '.$config['config_themes']['author'].' |
  85. '.Lang::get('Тип темы:').' '.$config['config_themes']['type'].'
  86. </span>
  87. </div>';
  88. }
  89. }else {
  90. echo '<div class="mysql_no"><img src="../template/icon/themes.png"/>&nbsp;<strong>'.$des_them.'</strong>
  91. <span class="mysql_no_color" style="float:right;font-size:11px;">'.Lang::get('Не используется').'</span><br/>
  92. <span style="font-size:10px;">
  93. '.Lang::get('В папке отсутствует файл conf.ini').'
  94. </span>
  95. </div>';
  96. }
  97. }
  98. }
  99. closedir( $dir_them);
  100. echo '</div>';
  101. /*
  102. * Установленная тема wap (по умолчанию)
  103. */
  104. echo "<div class='maintitle mainrazd'>".Lang::get('Тема оформления: WAP')." <span style='font-size:10px;'>".Lang::get('(По умолчанию)')."</span></div>";
  105. $config = parse_ini_file('../template/designs/'.$themes_web['wap'].'/conf.ini',true);
  106. echo '<div class="maintext">';
  107. echo '<div class="mysql_yes"><img src="../template/icon/themes.png"/>&nbsp;<b>'.$config['config_themes']['name'].'</b>
  108. <span class="mysql_yes_color" style="float:right;font-size:11px;">'.Lang::get('Используется').'</span><br/>
  109. <span style="font-size:10px;">
  110. '.Lang::get('Автор:').' '.$config['config_themes']['author'].' |
  111. '.Lang::get('Тип темы:').' '.$config['config_themes']['type'].'
  112. </span>
  113. </div>';
  114. echo '</div>';
  115. /*
  116. * Установленная тема itouch (по умолчанию)
  117. */
  118. echo "<div class='maintitle mainrazd'>".Lang::get('Тема оформления: ITOUCH')." <span style='font-size:10px;'>".Lang::get('(По умолчанию)')."</span></div>";
  119. $config_itouch = parse_ini_file('../template/designs/'.$themes_web['itouch'].'/conf.ini',true);
  120. echo '<div class="maintext">';
  121. echo '<div class="mysql_yes"><img src="../template/icon/themes.png"/>&nbsp;<b>'.$config_itouch['config_themes']['name'].'</b>
  122. <span class="mysql_yes_color" style="float:right;font-size:11px;">'.Lang::get('Используется').'</span><br/>
  123. <span style="font-size:10px;">
  124. '.Lang::get('Автор:').' '.$config_itouch['config_themes']['author'].' |
  125. '.Lang::get('Тип темы:').' '.$config_itouch['config_themes']['type'].'
  126. </span>
  127. </div>';
  128. echo '</div>';
  129. //Мобильная тема
  130. }elseif(detection::wap_browser()) {
  131. echo Lang::get("Тема оформления:")."<br />";
  132. $dir_them = opendir('../template/designs/');
  133. while ($des_them = readdir( $dir_them)) {
  134. if (($des_them != '.') && ($des_them != '..')) {
  135. echo '<div class="maintext"><a href="?themes='.$des_them.'">'.$des_them.'</a></div>';
  136. }
  137. }
  138. closedir( $dir_them);
  139. }elseif(detection::itouch_browser()) {
  140. echo Lang::get("Тема оформления:")."<br />";
  141. $dir_them = opendir('../template/designs/');
  142. while ($des_them = readdir( $dir_them)) {
  143. if (($des_them != '.') && ($des_them != '..')) {
  144. echo '<div class="maintext"><a href="?themes='.$des_them.'">'.$des_them.'</a></div>';
  145. }
  146. }
  147. closedir( $dir_them);
  148. }
  149. }
  150. include_once'../template/foot.php';
  151. ?>