site.ctrl.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. load()->model('system');
  8. $dos = array('copyright');
  9. $do = in_array($do, $dos) ? $do : 'copyright';
  10. $_W['page']['title'] = '站点设置 - 工具 - 系统管理';
  11. $settings = $_W['setting']['copyright'];
  12. if(empty($settings) || !is_array($settings)) {
  13. $settings = array();
  14. } else {
  15. $settings['slides'] = iunserializer($settings['slides']);
  16. }
  17. $path = IA_ROOT . '/web/themes/';
  18. if(is_dir($path)) {
  19. if ($handle = opendir($path)) {
  20. while (false !== ($templatepath = readdir($handle))) {
  21. if ($templatepath != '.' && $templatepath != '..') {
  22. if(is_dir($path.$templatepath)){
  23. $template[] = $templatepath;
  24. }
  25. }
  26. }
  27. }
  28. }
  29. if ($do == 'copyright') {
  30. $template_ch_name = system_template_ch_name();
  31. if (checksubmit('submit')) {
  32. $data = array(
  33. 'status' => intval($_GPC['status']),
  34. 'verifycode' => intval($_GPC['verifycode']),
  35. 'reason' => trim($_GPC['reason']),
  36. 'sitename' => trim($_GPC['sitename']),
  37. 'url' => (strexists($_GPC['url'], 'http://') || strexists($_GPC['url'], 'https://')) ? $_GPC['url'] : "http://{$_GPC['url']}",
  38. 'statcode' => preg_match('/https\:\/\/hm\.baidu\.com\/hm\.js\?/', $_GPC['statcode']) ? htmlspecialchars_decode($_GPC['statcode']) : safe_gpc_html(htmlspecialchars_decode($_GPC['statcode'])),
  39. 'footerleft' => safe_gpc_html(htmlspecialchars_decode($_GPC['footerleft'])),
  40. 'footerright' => safe_gpc_html(htmlspecialchars_decode($_GPC['footerright'])),
  41. 'icon' => trim($_GPC['icon']),
  42. 'flogo' => trim($_GPC['flogo']),
  43. 'background_img' => trim($_GPC['background_img']),
  44. 'slides' => iserializer($_GPC['slides']),
  45. 'notice' => trim($_GPC['notice']),
  46. 'blogo' => trim($_GPC['blogo']),
  47. 'baidumap' => $_GPC['baidumap'],
  48. 'company' => trim($_GPC['company']),
  49. 'companyprofile' => safe_gpc_html(htmlspecialchars_decode($_GPC['companyprofile'])),
  50. 'address' => trim($_GPC['address']),
  51. 'person' => trim($_GPC['person']),
  52. 'phone' => trim($_GPC['phone']),
  53. 'qq' => trim($_GPC['qq']),
  54. 'email' => trim($_GPC['email']),
  55. 'keywords' => trim($_GPC['keywords']),
  56. 'description' => trim($_GPC['description']),
  57. 'showhomepage' => intval($_GPC['showhomepage']),
  58. 'leftmenufixed' => (!empty($_GPC['leftmenu_fixed'])) ? 1 : 0,
  59. 'mobile_status' => $_GPC['mobile_status'],
  60. 'login_type' => $_GPC['login_type'],
  61. 'icp' => safe_gpc_string($_GPC['icp']),
  62. 'bind' => $_GPC['bind']
  63. );
  64. $test = setting_save($data, 'copyright');
  65. $template = trim($_GPC['template']);
  66. setting_save(array('template' => $template), 'basic');
  67. itoast('更新设置成功!', url('system/site'), 'success');
  68. }
  69. }
  70. template('system/site');