📄 inc_fun_funadmin.php
字号:
<?php
if(!defined('DEDEINC'))
{
exit("Request Error!");
}
function SpGetPinyin($str,$ishead=0,$isclose=1)
{
global $pinyins;
$restr = '';
$str = trim($str);
$slen = strlen($str);
if($slen<2)
{
return $str;
}
if(count($pinyins)==0)
{
$fp = fopen(DEDEINC.'/data/pinyin.dat','r');
while(!feof($fp))
{
$line = trim(fgets($fp));
$pinyins[$line[0].$line[1]] = substr($line,3,strlen($line)-3);
}
fclose($fp);
}
for($i=0;$i<$slen;$i++)
{
if(ord($str[$i])>0x80)
{
$c = $str[$i].$str[$i+1];
$i++;
if(isset($pinyins[$c]))
{
if($ishead==0)
{
$restr .= $pinyins[$c];
}
else
{
$restr .= $pinyins[$c][0];
}
}else
{
$restr .= "_";
}
}else if( eregi("[a-z0-9]",$str[$i]) )
{
$restr .= $str[$i];
}
else
{
$restr .= "_";
}
}
if($isclose==0)
{
unset($pinyins);
}
return $restr;
}
function SpCreateDir($spath)
{
global $cfg_dir_purview,$cfg_basedir,$cfg_ftp_mkdir,$isSafeMode;
if($spath=='')
{
return true;
}
$flink = false;
$truepath = $cfg_basedir;
$truepath = str_replace("\\","/",$truepath);
$spaths = explode("/",$spath);
$spath = "";
foreach($spaths as $spath)
{
if($spath=="")
{
continue;
}
$spath = trim($spath);
$truepath .= "/".$spath;
if(!is_dir($truepath) || !is_writeable($truepath))
{
if(!is_dir($truepath))
{
$isok = MkdirAll($truepath,$cfg_dir_purview);
}
else
{
$isok = ChmodAll($truepath,$cfg_dir_purview);
}
if(!$isok)
{
echo "鍒涘缓鎴栦慨鏀圭洰褰曪細".$truepath." 澶辫触锛
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -