Просмотр файла modules/padmin/settings_modules.php

Размер файла: 3.58Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.ru *
  7. **********************************/
  8. $locate = 'in_padmin';
  9. if(isset($user) && $user['level'] >= 6) {
  10.  
  11. $title = $lang->word('padmin_modules_settings');
  12. require_once(SYS.'/view/header.php');
  13. $tpl->div('title', $lang->word('padmin_modules_settings'));
  14. if(isset($_POST['save']) && $_GET['act']== 'save') {
  15. $chat = input($_POST['chat']);
  16. $forum = input($_POST['forum']);
  17. $share = input($_POST['share']);
  18. $news = input($_POST['news']);
  19. $downloads = (int)$_POST['downloads'];
  20. $show_topics = (int)$_POST['show_topics'];
  21. $who_upload = (int)$_POST['who_upload'];
  22. $db->query("UPDATE `system` SET `open_chat` = '". $chat."', `open_forum` = '". $forum."', `open_share` = '". $share."', `open_news` = '". $news."', `who_upload` = '$who_upload', `downloads_opened` = '$downloads', `show_topics` = '$show_topics'");
  23. $tpl->div('menu', $lang->word('succ_save'));
  24. $tpl->div('block', img('settings.png') . '<a href="/padmin/settings_modules/">'.$lang->word('settings').'</a><br/>'. img('admin.png') .'<a href="/padmin/">'. $lang->word('padmin') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
  25. require_once(SYS.'/view/footer.php');
  26. exit;
  27. }
  28. echo '<div class="post">
  29. <form action="/padmin/settings_modules/?act=save" method="post">
  30. <b> '.$lang->word('chat').'</b>:<br />
  31. <input type="radio" name="chat" value="yes"'. ($system['open_chat'] == 'yes'?' checked="checked"':NULL) .' />'. $lang->word('ons') .'
  32. <input type="radio" name="chat" value="no"'. ($system['open_chat'] == 'no'?' checked="checked"':NULL) .' />'. $lang->word('offs') .'<br />
  33. <b> '.$lang->word('forum').'</b>:<br />
  34. <input type="radio" name="forum" value="yes"'. ($system['open_forum'] == 'yes'?' checked="checked"':NULL) .' />'. $lang->word('ons') .'
  35. <input type="radio" name="forum" value="no"'. ($system['open_forum'] == 'no'?' checked="checked"':NULL) .' />'. $lang->word('offs') .'<br />
  36. <b> '.$lang->word('share').'</b>:<br />
  37. <input type="radio" name="share" value="yes"'. ($system['open_share'] == 'yes'?' checked="checked"':NULL) .' />'. $lang->word('ons') .'
  38. <input type="radio" name="share" value="no"'. ($system['open_share'] == 'no'?' checked="checked"':NULL) .' />'. $lang->word('offs') .'<br />
  39. <b> '.$lang->word('news').'</b>:<br />
  40. <input type="radio" name="news" value="yes"'. ($system['open_news'] == 'yes'?' checked="checked"':NULL) .' />'. $lang->word('ons') .'
  41. <input type="radio" name="news" value="no"'. ($system['open_news'] == 'no'?' checked="checked"':NULL) .' />'. $lang->word('offs') .'<br />
  42. <b> '.$lang->word('downloads').'</b>:<br />
  43. <input type="radio" name="downloads" value="1"'. ($system['downloads_opened'] == '1'?' checked="checked"':NULL) .' />'. $lang->word('ons') .'
  44. <input type="radio" name="downloads" value="0"'. ($system['downloads_opened'] == '0'?' checked="checked"':NULL) .' />'. $lang->word('offs') .'<br />
  45. <b> '.$lang->word('show_forum_topics').'</b>:<br />
  46. <input type="radio" name="show_topics" value="1"'. ($system['show_topics'] == '1'?' checked="checked"':NULL) .' />'. $lang->word('yyes') .'
  47. <input type="radio" name="show_topics" value="0"'. ($system['show_topics'] == '0'?' checked="checked"':NULL) .' />'. $lang->word('yno') .'<br />
  48. <input type="submit" name="save" value="'. $lang->word('save') .'" />
  49. </form>
  50. </div>';
  51. $tpl->div('block', img('admin.png') .'<a href="/padmin/">'. $lang->word('padmin') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
  52. require_once(SYS.'/view/footer.php');
  53. } else { header('Location: /'); }
  54. ?>