📄 settings.php
字号:
if($showgroup){
$config['showgroup']=",".implode(",",$showgroup).",";
} else{
$config['showgroup']='';
}
$config['credits']=implode("\t",$credits);
if($config['datefm']){
if(strpos($config['datefm'],'mm')!==false){
$config['datefm'] = str_replace('mm','m',$config['datefm']);
} else{
$config['datefm'] = str_replace('m','n',$config['datefm']);
}
if(strpos($config['datefm'],'dd')!==false){
$config['datefm'] = str_replace('dd','d',$config['datefm']);
} else{
$config['datefm'] = str_replace('d','j',$config['datefm']);
}
$config['datefm'] = str_replace('yyyy','Y',$config['datefm']);
$config['datefm'] = str_replace('yy','y',$config['datefm']);
$timefm=$time_f=='12' ? ' h:i A' :' H:i';
$config['datefm'].=$timefm;
} else{
$config['datefm']='Y-n-j H:i';
}
if(!$config['recycle'] || !is_numeric($config['recycle'])){
$config['recycle']='0';
} else{
$forum=$db->get_one("SELECT type FROM pw_forums WHERE fid='$config[recycle]'");
if(!$forum){
adminmsg('setting_recycle_error');
} elseif($forum['type']=='category'){
adminmsg('setting_recycle_type');
}
}
if(!is_dir($set['picpath']) && $picpath!=$set['picpath'] && !@rename($picpath,$set['picpath'])){
$set['picpath']=$picpath;
$add_msg="无法更改图片或附件目录名,请设置其属性为可写模式(777)";
adminmsg('setting_777');
}
if (!is_dir($set['attachpath']) && $attachpath<>$set['attachpath'] && !@rename($attachpath,$set['attachpath'])){
$set['attachpath']=$attachpath;
adminmsg('setting_777');
}
if ($reg['regmaxname']>15) adminmsg('illegal_username');
if ($config['http']!='N' && !ereg("^http",$config['http'])){
adminmsg('setting_http');
}
if (!is_numeric($config['uploadmaxsize'])){
$config['uploadmaxsize']=0;
} else{
$config['uploadmaxsize']*=1024;
}
if (!is_numeric($config['imgsize'])){
$config['imgsize']=20480;
} else{
$config['imgsize']*=1024;
}
!is_numeric($config['imglen']) && $config['imglen']=200;
!is_numeric($config['imgwidth']) && $config['imgwidth']=180;
if (!$config['perpage']) $config['perpage']=0;
if (!$config['readperpage']) $config['readperpage']=0;
if (!$config['postmax']) $config['postmax']=50000;
if (!$config['showreplynum']) $config['showreplynum']=0;
if (!$config['dtreplyrvrc']) $config['dtreplyrvrc']=0;
if (!$config['maxmsg']) $config['maxmsg']=0;
if (!$config['honorpost']) $config['honorpost']=0;
if (!$config['refreshtime']) $config['refreshtime']=0;
if (!$config['onlinetime']) $config['onlinetime']=0;
if (!$config['indexshowbirth']) $config['indexshowbirth']=0;
if (!$config['footertime']) $config['footertime']=0;
if (!$config['dtpostrvrc']) $config['dtpostrvrc']=0;
if (!$config['dtpostmoney']) $config['dtpostmoney']=0;
if (!$config['dtjhrvrc']) $config['dtjhrvrc']=0;
if (!$config['dtjhmoney']) $config['dtjhmoney']=0;
if (!is_numeric($config['onlinelmt'])) $config['onlinelmt']=5000;
if (!$config['dtdelrvrc']) $config['dtdelrvrc']=0;
if (!$config['dtdelmoney']) $config['dtdelmoney']=0;
if (!$config['indexonline']) $config['indexonline']=0;
if (!$config['schpernum']) $config['schpernum']=10000;
if (!$config['autoimg']) $config['autoimg']=0;
if (!$config['postmin']) $config['postmin']=0;
if (!$config['selcount']) $config['selcount']=0;
if (!$config['searchtime']&&$config['searchtime']!=0) $config['searchtime']=15;
if (!$config['ipfrom']) $config['ipfrom']=0;
if (!$config['dtreplymoney']) $config['dtreplymoney']=0;
if (!$config['ipcheck']) $config['ipcheck']=0;
if (!$reg['rglower']) $reg['rglower']=0;
if (!is_numeric($reg['regrvrc'])) $reg['regrvrc']=1;
if (!is_numeric($reg['regmoney'])) $reg['regmoney']=0;
if (!$reg['regminname']) $reg['regminname']=3;
if (!$reg['regmaxname']) $reg['regmaxname']=12;
$config['onlinetime']*=60;
//$config[dtreplyrvrc] 回复不用转换
$config['dtpostrvrc']*=10;
$config['dtjhrvrc']*=10;
$config['dtdelrvrc']*=10;
$reg['regrvrc']*=10;
$config['upload']=$config['upload']."\t".$config['imglen']."\t".$config['imgwidth']."\t".$config['imgsize'];
$config['openpost']=$config['openpost']."\t".$config['poststart']."\t".$config['postend'];
unset($config['imglen'],$config['imgwidth'],$config['imgsize'],$config['poststart'],$config['postend']);
$dbcontent="<?php\n\$picpath='$set[picpath]';//图片目录名\n\$attachpath='$set[attachpath]';//附件目录名\n?>";
writeover(R_P.'data/bbscache/dbset.php',$dbcontent);
include_once(R_P."data/bbscache/dbreg.php");
foreach($config as $key=>$value){
$c_key=${'db_'.$key};
if(strpos($key,'_')!==false){
$c_db=explode('_',$key);
$c_db_array=${'db_'.$c_db[0]};
$c_key=$c_db_array[$c_db[1]];
$key=str_replace('_',"[\'",$key)."\']";
}
if($c_key!=$value){
$rt=$db->get_one("SELECT db_name FROM pw_config WHERE db_name='db_$key'");
if($rt['db_name']){
$db->update("UPDATE pw_config SET db_value='$value' WHERE db_name='db_$key'");
}else{
$db->update("INSERT INTO pw_config(db_name,db_value) VALUES ('db_$key','$value')");
}
}
}
/*$db_union_c=readover(R_P.'data/bbscache/file_lock.txt');
if($db_union!=$db_union_c){
$rt=$db->get_one("SELECT db_name FROM pw_config WHERE db_name='db_union'");
if($rt['db_name']){
$db->update("UPDATE pw_config SET db_value='$db_union_c' WHERE db_name='db_union'");
}else{
$db->update("INSERT INTO pw_config(db_name,db_value) VALUES ('db_union','$db_union_c')");
}
}*/
foreach($reg as $key=>$value){
if(${'rg_'.$key}!=$value){
$rt=$db->get_one("SELECT db_name FROM pw_config WHERE db_name='rg_$key'");
if($rt['db_name']=="rg_$key"){
$db->update("UPDATE pw_config SET db_value='$value' WHERE db_name='rg_$key'");
}else{
$db->update("INSERT INTO pw_config(db_name,db_value) VALUES ('rg_$key','$value')");
}
}
}
updatecache_c();
adminmsg('operate_success');
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -