???????ò???????
????wecenter?????????????
????· system_setting?淶????????????get_setting????
????· ??core_config??????????????????
????get_setting
??????÷??
????get_setting('weibo_msg_enabled')
???????
system/functions.inc.php
function get_setting($varname = null?? $permission_check = true)
{
if (! class_exists('AWS_APP'?? false))
{
return false;
}
if ($settings = AWS_APP::$settings)
{
// AWS_APP::session()->permission ????????????????????????????? users_group ???У????????? permission ???
if ($permission_check AND $settings['upload_enable'] == 'Y')
{
if (AWS_APP::session())
{
if (!AWS_APP::session()->permission['upload_attach'])
{
$settings['upload_enable'] = 'N';
}
}
}
}
if ($varname)
{
return $settings[$varname];
}
else
{
return $settings;
}
}
????AWS_APP::$settings????????????????
????system/aws_app.inc.php#init
????self::$settings = self::model('setting')->get_settings();
????models/setting.php#get_settings
public function get_settings()
{
if ($system_setting = $this->fetch_all('system_setting'))
{
foreach ($system_setting as $key => $val)
{
if ($val['value'])
{
$val['value'] = unserialize($val['value']);
}
$settings[$val['varname']] = $val['value'];
}
}
return $settings;
}
????system_setting???е??????а????????????????????
????install/system_settings.sql
INSERT INTO `[#DB_PREFIX#]system_setting` (`varname`?? `value`) VALUES
('site_name'?? 's:8:"WeCenter";')??
('description'?? 's:30:"WeCenter ?罻????????";')??
('keywords'?? 's:47:"WeCenter???????????罻?????????????";')??
('sensitive_words'?? 's:0:"";')??
('def_focus_uids'?? 's:1:"1";')??
('answer_edit_time'?? 's:2:"30";')??
('cache_level_high'?? 's:2:"60";')??
...