Home  >  Article  >  CMS Tutorial  >  How to remove the id in the pinyin naming rules of DEDECMS articles

How to remove the id in the pinyin naming rules of DEDECMS articles

藏色散人
藏色散人Original
2019-12-20 10:10:522199browse

How to remove the id in the pinyin naming rules of DEDECMS articles

How to remove the id when using the pinyin naming rules of DEDECMS articles?

How to remove the id when using the pinyin naming rules of DEDECMS articles

How to remove the id when using the pinyin naming rules of DEDECMS articles. Friends who need it can For reference.

Recommended study: 梦Weavercms

Step one:

Select: Website column management, modify the advanced options of the column, article naming rules: {typedir}/{Y}{M}{D}/{aid}.html This is the default state

Changed aid to pinyin, but found that the static page produced still has the article id behind it.

Operating system

Second step:

Find channelunit.func.php in the include folder

Find it inside

if(ereg('\{p',$articleRule)) 
{ 
$articleRule = str_replace('{pinyin}',GetPinyin($title).'_'.$aid,$articleRule); 
$articleRule = str_replace('{py}',GetPinyin($title,1).'_'.$aid,$articleRule); 
} 
$articleUrl = '/'.ereg_replace('^/','',$articleRule); 
return $articleUrl; 
} 
} 
//获得指定类目的URL链接 
//对于使用封面文件和单独页面的情况,强制使用默认页名称

Pay attention to the red part: replace it with: $articleRule = str_replace('{pinyin}',GetPinyin($title),$articleRule);

The above is the detailed content of How to remove the id in the pinyin naming rules of DEDECMS articles. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn