作为一个php新手,想把最近的一些优化学习心得记录下来,
1、修改栏目路径命名规则:
第一种是自己随意命名, 第二种是拼音,但是默认拼音是以全拼形式作为路径命名,这样显得会很长,在dedecms5.6(5.7会有所不同)根目录下,修改dede文件下catalog_add.php文件,108行左右,$typedir = $toptypedir.'/'.GetPinyin(stripslashes($v));修改为typedir = $toptypedir.'/'.GetPinyin(stripslashes($v),1);
148行左右,$typedir = GetPinyin(stripslashes($typename));改为$typedir = GetPinyin(stripslashes($typename),1);下来直接勾拼音就会以拼音首字母来命名。
2、修改文章命名,默认是{typedir}/{Y}/{M}{D}/{aid}.html,解释为/年/月日/id.html,根据需要可以改成 /{Y}/{D}/{aid}/index.html。
3、修改当前位置,也就是position规则,include文件下,typelink.class.php文件,$this->valuePosition = $indexpage.$this->SplitSymbol.$this->valuePosition;改成$this->valuePosition = .$this->valuePosition;