需要:在课程讲义中,不显示文件的扩展名,只显示主文件名。
方法:document.php,第2127行:
(1)[麦豆网友提供]:在 $dspFileName = htmlspecialchars( basename($thisFile['path'])); 这一句后面加上下面两句,就不显示扩展名了:
$dl=end(explode('.', $dspFileName));
$dspFileName = substr($dspFileName,0,mb_strlen($str, "utf-8")-mb_strlen($dl, "utf-8")-1);
(2)$dspFileName = htmlspecialchars(pathinfo($thisFile['path'], PATHINFO_FILENAME)
(3) 在2127行后加上两行:
$dl=array_slice(explode('.', $dspFileName),0,-1);
$dspFileName = implode('.',$dl);
---------------
阅读(3368) | 评论(0) | 转发(0) |