function update_options() { $opt = $this->GetOptionInfo(); foreach ($opt as $key => $arr) { $name = $arr['new_name']; if (!isset($this->options[$name])) { $this->options[$name] = '0'; } //for damn checkboxes } foreach ($this->options as $i => $val) { $this->options[$i] = stripslashes($val); } $r = update_option('wp_noexternallinks', $this->options); if (!$r) { if (serialize($this->options) != serialize(get_option('wp_noexternallinks'))) { init_lang(); echo '<div class="error">' . __('Failed to update options!', 'wp-noexternallinks') . '</div>'; } /*else echo 'nothing changed ;_;';*/ } }
//数据地址定义。 $config['pic_thumb'] = BASIC_PATH . 'data/thumb/'; // 缩略图生成存放地址 $config['cache_dir'] = BASIC_PATH . 'data/cache/'; // 缓存文件地址 $config['system_os'] = 'windows'; //windows,linux,mac $config['system_charset'] = 'gbk'; //系统编码 $config['app_charset'] = 'utf-8'; //该程序整体统一编码 $config['app_startTime'] = mtime(); //起始时间 $config['check_charset'] = 'ASCII,UTF-8,GBK'; //文件打开自动检测编码 //when edit a file ;check charset and auto converto utf-8; //系统编码配置 if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $config['system_os'] = 'windows'; $config['system_charset'] = 'gbk'; } else { $config['system_os'] = 'linux'; $config['system_charset'] = 'utf-8'; } init_lang(); $in = parse_incoming(); //所有过滤处理。 session_start(); session_write_close(); //之后要修改$_SESSION 需要先调用session_start() $config['autorun'] = array(array('controller' => 'user', 'function' => 'loginCheck'), array('controller' => 'user', 'function' => 'authCheck'));