织梦如何定义栏目路径名为拼音缩写


DedeCMS织梦默认的栏目页使用完整拼音为保存目录,当我们遇到栏目名称比较长的时候目录名称看起来有点冗长,这时候大多数站长喜欢使用拼音首字母作为栏目的保存目录,为此搜集教程,解决DedeCMS如何定义栏目路径名为拼音缩写的问题,具体教程如下:

打开dede/catalog.add.php文件:

1、找到代码(大概在第85行):

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

修改为:

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

 

2、找到代码(大概在第108行):

  $typedir = $toptypedir.’/’.GetPinyin(stripslashes($v));
 

修改为:

  $typedir = $toptypedir.’/’.GetPinyin(stripslashes($v),1);
 

3、找到代码(大概在第134行):

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

修改为:

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

4、找到代码(大概在第187行):

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

修改为:

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

修改完成后,再新建栏目就会以拼音缩写为栏目路径了,快去试试吧!