setting.php
来自「哈克MusicPHP音乐程序v1.0一套基本于PHP+TXT的在线音乐播放程序。」· PHP 代码 · 共 68 行
PHP
68 行
<?php
!function_exists('adminmsg') && exit('Forbidden');
$basename="$admin_file?adminjob=setting";
if($right<3){
adminmsg('对不起,你没有权限进行此操作');
exit;
}
if (empty($action)){
$dir = opendir(R_P."/$skinpath");
$choseskin = "<option value=$skin>$skin</option>";
while ($userskin=readdir($dir)) {
if($userskin!=$skin && $userskin!='admin' && $userskin!='.' && $userskin!='..'){
$choseskin .= "<option value=$userskin>$userskin</option>";
}
}
closedir($dir);
ifcheck($downon,'down');
ifcheck($steal,'steal');
ifcheck($regon,'regon');
ifcheck($regright,'regright');
if (file_exists($datapath) && !is_writeable($datapath)){
$datadisabled='disabled';
}
if (file_exists($userpath) && !is_writeable($userpath)){
$userdisabled='disabled';
}
if (file_exists($uppath) && !is_writeable($uppath)){
$updisabled='disabled';
}
if (file_exists($stylepath) && !is_writeable($stylepath)){
$styledisabled='disabled';
}
include PrintEot('setting');
exit;
}elseif ($_POST['action']=="save"){
if(!is_writeable(D_P.'inc/config.php') && !chmod(D_P.'inc/config.php',0777)){
adminmsg('<font color=red>无法修改程序核心配置文件,请将 inc/config.php 文件属性设为可写模式(777)</font>');
}
!is_numeric($cfg['perpage']) && $cfg['perpage']=20;
!is_numeric($cfg['refreshtime']) && $cfg['refreshtime']=3;
!is_numeric($cfg['maxboxnum ']) && $cfg['maxboxnum ']=50;
if(!is_dir($cfg['datapath']) && $datapath!=$cfg['datapath'] && !@rename($datapath,$cfg['datapath'])){
$cfg['datapath']=$datapath;
adminmsg('<font color=red>无法更改音乐数据目录名,请设置其属性为可写模式(777)</font>');
}
if (!is_dir($cfg['userpath']) && $userpath<>$cfg['userpath'] && !@rename($userpath,$cfg['userpath'])){
$cfg['userpath']=$userpath;
adminmsg('<font color=red>无法更改用户数据目录名,请设置其属性为可写模式(777)</font>');
}
if(!is_dir($cfg['uppath']) && $uppath!=$cfg['uppath'] && !@rename($uppath,$cfg['uppath'])){
$cfg['uppath']=$uppath;
adminmsg('<font color=red>无法更改上传目录名,请设置其属性为可写模式(777)</font>');
}
if (!is_dir($cfg['stylepath']) && $stylepath<>$cfg['stylepath'] && !@rename($stylepath,$cfg['stylepath'])){
$cfg['stylepath']=$stylepath;
adminmsg('<font color=red>无法更改模板目录名,请设置其属性为可写模式(777)</font>');
}
$cfgcontent="<?PHP \r\n\$site_name='$cfg[site_name]';\r\n\$site_url='$cfg[site_url]';\r\n\$admin_email='$cfg[admin_email]';\r\n\$datadir='$cfg[datapath]';\r\n\$userdir='$cfg[userpath]';\r\n\$updir='$cfg[uppath]';\r\n\$skinpath='$cfg[stylepath]';\r\n\$skin= '$cfg[skin]';\r\n\$perpage='$cfg[perpage]';\r\n\$regon='$cfg[regon]';\r\n\$regbanname='$cfg[regbanname]';\r\n\$regright='$cfg[regright]';\r\n\$maxboxnum='$cfg[maxboxnum]';\r\n\$downon= '$cfg[down]';\r\n\$steal='$cfg[steal]';\r\n\$refreshtime='$cfg[refreshtime]';\r\n?>";
writeto(D_P.'inc/config.php',$cfgcontent);
adminmsg('完成相应操作');
}
?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?