Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use dedecms to display the title page file name of an article in pinyin

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report