How to use dedecms to display the title page file name of an article in pinyin
This article will explain in detail how to use dedecms to display the title page file name of the article in pinyin. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
How to use dedecms to display the title page file name of the article in pinyin?
The method of displaying the file name of the title page of an article in pinyin with dedecms
Use dede to make the article title page display path for the title pinyin .html, for example: the article title is: what is the website, the article path display: zhanyouwangshishenmea.html, what are the benefits of this display? Shit, do I have to tell you that?
Recommended study: dream weaving cms
Using dede to display the title page file name of an article in pinyin
Such as the title, use dede to make the article title page display path for the title pinyin .html, for example: the article title is: what is the website, the article path display: zhanyouwangshishenmea.html, what are the benefits of this display? Shit, do I have to tell you that?
Methods:
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
Modified to: {typedir} / {pinyin} .html. I think {Y} {M} {D} is useless, so it has been removed.
Update it again to see if it works.
Don't worry, Pinyin is displayed now, zhanyouwangshishenmea_1.html, but there is an extra _ 1 after it. How to get rid of this?
Modify the inc_channel_unit_function file in include to find $articleRule = str_replace ("{pinyin}", GetPinyin ($title). "_". $aid,$articleRule); remove. "_". $aid, and that's fine!
If the title of the article is in English, _ will be added between the words, but adding _ in the middle of the word has no meaning to gg. It must be changed to "-". The method of modification is as follows.
Open include/inc/inc_fun_funAdmin.php
The code is as follows:
For ($isset [$pinyins [$c]) {$c = $str [$I]. $str [$iTun1]; $iTunes; if ($ishead==0) $restr. = $pinyins [$c]; else $restr. = $pinyins [$c] [0];} else $restr. = "-";} else if (eregi ("[a-z0-9]", $str [$I])) {$restr. = $str [$I];} else {$restr. = "-";}
Change
Restr. = "-"; these things
Add "-" in the middle of Pinyin
Modify include\ inc\ inc_fun_funAdmin.php
The code is as follows:
For ($if ($ishead==0) $restr. = $pinyins [$c]. "-"; if ($isclose==0) unset ($pinyins); if (substr ($restr,-1) = "-") $restr = substr ($restr,0,strlen ($restr)-1); return $restr; if (substr ($restr,-1) = "-") $restr = substr ($restr,0,strlen ($restr)-1)
For the newly added
On how to use dedecms to achieve pinyin to display the title page file name of the article is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.