Example #1
0
 /**
  * 基本设置
  */
 public function basic()
 {
     if (isset($GLOBALS['submit'])) {
         $formdata = array_map('strip_tags', $GLOBALS['form']);
         $formdata['copyright'] = $GLOBALS['form']['copyright'];
         $formdata['statcode'] = $GLOBALS['form']['statcode'];
         set_cache('siteconfigs', $formdata);
         $serialize_data = serialize($formdata);
         $updatetime = date('Y-m-d H:i:s', SYS_TIME);
         $this->db->update('setting', array('data' => $serialize_data, 'updatetime' => $updatetime), array('keyid' => 'configs', 'm' => 'core'));
         load_function('admin');
         set_web_config('CLOSE', intval($formdata['close']));
         MSG(L('edit success'), HTTP_REFERER);
     } else {
         $setting = array();
         $r = $this->db->get_one('setting', array('keyid' => 'configs', 'm' => 'core'));
         $setting = unserialize($r['data']);
         load_class('form');
         include $this->template('set_basic');
     }
 }
Example #2
0
 /**
  * 手机触屏配置
  */
 public function setting()
 {
     if (isset($GLOBALS['submit'])) {
         $setting = array_map('remove_xss', $GLOBALS['form']);
         $setting = serialize($setting);
         $this->db->update('setting', array('data' => $setting), array('m' => 'mobile', 'keyid' => 'configs'));
         load_function('admin');
         set_web_config('SUPPORT_MOBILE', intval($GLOBALS['support_mobile']));
         MSG(L('operation success'), HTTP_REFERER);
     } else {
         $show_formjs = 1;
         load_class('qrcode');
         if (is_writable(ATTACHMENT_ROOT . "qr_image/mobile.png")) {
             $iswrite = 1;
             WUZHI_qrcode::png(WEBURL . 'index.php', ATTACHMENT_ROOT . "qr_image/mobile.png", 'L', 4, 0);
         } else {
             $iswrite = 0;
         }
         $r = $this->db->get_one('setting', array('m' => 'mobile', 'keyid' => 'configs'));
         $setting = unserialize($r['data']);
         include $this->template('setting');
     }
 }