21,886
社区成员
发帖
与我相关
我的任务
分享
$str = preg_replace("/\{(\\$[a-zA-Z0-9_\[\]\'\"\$\x7f-\xff]+)\}/es", "\$this->addquote('<?php echo \\1;?>')",$str);
$str = preg_replace ( "/\{([A-Z_\x7f-\xff][A-Z0-9_\x7f-\xff]*)\}/s", "<?php echo \\1;?>", $str );
$str = preg_replace("/\{link(\s+.+?)\}/ies", "\$this->striplink('\\1')", $str);
$str = preg_replace("/\{lang\s+(.+?)\}/ies", "\$this->striplang('\\1')",$str);
$str = preg_replace("/\{img\s+(.+?)\}/is", "<?php echo img_path(\\1);?>",$str);
$str = preg_replace("/\{mp:(\w+)(\s+[^}]+)\}/ie", "\$this->mp_tag('\\1','\\2', '\\0')", $str);
$str = preg_replace("/\{\/mp\}/ie", "\$this->end_mp_tag()", $str);
$str = preg_replace("/\{filter:(\w+)(\s+.+?)\}/ie","\$this->do_filter('\\1','\\2')",$str);
$str = preg_replace("/\{thumbimg(\s+.+?)\}/ies","\$this->makethumbpath('\\1')",$str);
$str = preg_replace_callback("/\{(\\$[a-zA-Z0-9_\[\]\'\"\$\x7f-\xff]+)\}/s",function($r){ return $this->addquote("<?php echo $r[1]?>"); }, $str);
$str = preg_replace_callback("/\{([A-Z_\x7f-\xff][A-Z0-9_\x7f-\xff]*)\}/s",function($r){ return "<?php echo $r[1]?>"; }, $str);
$str = preg_replace_callback("/\{link(\s+.+?)\}/is",function($r){ return $this->striplink('$r[1]'); }, $str);
$str = preg_replace_callback("/\{lang\s+(.+?)\}/is",function($r){ return $this->striplang('$r[1]'); }, $str);
$str = preg_replace_callback("/\{mp:(\w+)(\s+[^}]+)\}/i",function($r){ return $this->mp_tag($r[1],$r[2],$r[3]); }, $str);
$str = preg_replace_callback("/\{\/mp\}/i",function($r){ return $this->end_mp_tag($r[1]); }, $str);
$str = preg_replace_callback("/\{filter:(\w+)(\s+.+?)\}/i",function($r){ return $this->do_filter($r[1],$r[2]); }, $str);
$str = preg_replace_callback("/\{thumbimg(\s+.+?)\}/is",function($r){ return $this->makethumbpath($r[1]);}, $str);
function index(){
need_login('page');
$site = $this->setting->get_conf('site');
$site['description'] = safe_invert($site['description']);
$site['footer'] = safe_invert($site['footer'],true);
$site['share_title'] = safe_invert($site['share_title']);
$this->output->set('site',$site);
$this->output->set('enable_comment',$this->setting->get_conf('system.enable_comment'));
$this->output->set('enable_comment_captcha',$this->setting->get_conf('system.enable_comment_captcha'));
$this->output->set('enable_login_captcha',$this->setting->get_conf('system.enable_login_captcha'));
$this->output->set('comment_audit',$this->setting->get_conf('system.comment_audit'));
$this->output->set('enable_auto_update',$this->setting->get_conf('system.enable_auto_update'));
$this->output->set('show_process_info',$this->setting->get_conf('system.show_process_info'));
$this->output->set('gravatar_url',$this->setting->get_conf('system.gravatar_url'));
//面包屑
$crumb_nav = array();
$crumb_nav[] = array('name'=>lang('system_setting'),'link'=>site_link('setting'));
$crumb_nav[] = array('name'=>lang('basic_setting'));
$this->page_crumb($crumb_nav);
$page_title = lang('basic_setting').' - '.lang('system_setting').' - '.$this->setting->get_conf('site.title');
$page_keywords = $this->setting->get_conf('site.keywords');
$page_description = $this->setting->get_conf('site.description');
$this->page_init($page_title,$page_keywords,$page_description);
$this->render();
}
function save_basic(){
need_login('ajax_box');
$site = $this->getPost('site');
$site['title'] = safe_convert($site['title']);
$site['url'] = safe_convert($site['url']);
$site['keywords'] = safe_convert($site['keywords']);
$site['description'] = safe_convert($site['description']);
$site['share_title'] = safe_convert($site['share_title']);
$gravatar_url = safe_convert($this->getPost('gravatar_url'));
if($site['title'] == ''){
form_ajax_failed('box',lang('empty_site_name'));
}
if($site['url'] == ''){
form_ajax_failed('box',lang('empty_site_url'));
}
$this->setting->set_conf('site.title',$site['title']);
$this->setting->set_conf('site.url',$site['url']);
$this->setting->set_conf('site.keywords',$site['keywords']);
$this->setting->set_conf('site.description',$site['description']);
$this->setting->set_conf('site.share_title',$site['share_title']);
$this->setting->set_conf('system.gravatar_url',$gravatar_url);
$this->setting->set_conf('system.comment_audit',intval($this->getPost('comment_audit')));
if($this->getPost('enable_comment')){
$this->setting->set_conf('system.enable_comment',true);
}else{
$this->setting->set_conf('system.enable_comment',false);
}
if($this->getPost('enable_comment_captcha')){
$this->setting->set_conf('system.enable_comment_captcha',true);
}else{
$this->setting->set_conf('system.enable_comment_captcha',false);
}
if($this->getPost('enable_login_captcha')){
$this->setting->set_conf('system.enable_login_captcha',true);
}else{
$this->setting->set_conf('system.enable_login_captcha',false);
}
if($this->getPost('enable_auto_update')){
$this->setting->set_conf('system.enable_auto_update',true);
}else{
$this->setting->set_conf('system.enable_auto_update',false);
}
form_ajax_success('box',lang('save_setting_success'),null,0.5,$_SERVER['HTTP_REFERER']);
}