今天分享DedeCMS添加栏目的一个小技巧,添加栏目以简拼作目录名,以拼音首字母作文件夹名称,默认情况情况下,DedeCMS添加栏目时是以全拼作为文件夹名称,后台也没有提公简拼的选项,但是我们可以通过修改源码的方式实现。

下面是具体方法: 打开/dede/catalog_add.php 搜索GetPinyin 会搜索到4个,分别在85,108,134,187行,把这4个地方的4个方法的第二个参数设置成true或者1,完工,修改之后的四处分别如下:

$toptypedir = GetPinyin(stripslashes($toptypename),true);

$typedir = $toptypedir.'/'.GetPinyin(stripslashes($v),true);

$typedir = GetPinyin(stripslashes($typename),true);

$typedir = GetPinyin(stripslashes($typename),true);