This article describes how to implement the function of Zhimeng DedeCMS in Chinese and English navigation. This article provides detailed operation steps and related implementation code, for more information, see the next article. This article describes how DedeCMS implements the Chinese and English navigation function. This article provides detailed operation steps and related implementation code. For more information, see
Today, I saw a friend in the group who needed to implement the functions of the Chinese and English column names (for example,). let's take a look at how to implement the powerful Zhimeng CMS!
Dedecms Template: www.php1.cn/xiazai/code/dedecms
Find
The code is as follows:
Topic Name:
Add
The code is as follows:
English topic name:
Finally, open dede \ catalog_edit.php.
Find
The code is as follows:
$ Upquery = "updat' # separator @ arctype 'set issend = '$ issend', sortrank =' $ sortrank ', typename =' $ typename', typenameng = '$ typenameng ', typedir = '$ typedir', isdefault =' $ isdefault', defaultname = '$ defaname name ',
Add the red part and remove the three separators. now the separator is added.
Call method:
{dede:field name='typenameng'/}
To be used in a channel, for example
The code is as follows:
{dede:channel type='son' row='10' typeid='1'}
[field:typename/][field:typenameng/]{/dede:channel}
You also need to modify a file and find include \ taglib \ channel. lib. php.
Article 1:
The code is as follows:
If ($ type = 'top') {$ SQL = "SELECT id, typename, typenameng, typedir, isdefault, ispart, defaultname, namerule2, moresite, siteurl, sitepath From '# separator @ arctype' WHERE reid = 0 And ishidden <> 1 order by sortrank asc limit 0, $ line ";} else if ($ type = 'son ') {if ($ typeid = 0) return ''; $ SQL =" SELECT id, typename, typenameng, typedir, isdefault, ispart, defaultname, namerule2, moresite, siteurl, sitepath From '# separator @ arctype' WHERE reid = '$ typeid' And ishidden <> 1 order by sortrank asc limit 0, $ line ";} else if ($ type = 'self ') {if ($ reid = 0) return ''; $ SQL =" SELECT id, typename, typenameng, typedir, isdefault, ispart, defaultname, namerule2, moresite, siteurl, sitepath FROM '# separator @ arctype' WHERE reid = '$ reid' And ishidden <> 1 order by sortrank asc limit 0, $ line ";}
Second:
The code is as follows:
// If subtopic mode is used, if ($ type = 'son' & $ reid! = 0 & $ totalRow = 0) {$ SQL = "SELECT id, typename, typenameng, typedir, isdefault, ispart, defaultname, namerule2, moresite, siteurl, sitepath FROM '# separator @ arctype' WHERE reid = '$ reid' And ishidden <> 1 order by sortrank asc limit 0, $ line "; $ dsql-> SetQuery ($ SQL); $ dsql-> Execute ();}
You can add a query field to the channel, and add the query field to the corresponding lib class on the "type", "channelartlist", and other tabs. the length is quite good.
// Process the style of the current column in the same level column. Call in currentstyle, include \ taglib \ channel. lib. php line 140 $ linkOkstr = str_replace ("~ Typename ~ ", $ Row ['typename'], $ linkOkstr); add
$ LinkOkstr = str_replace ("~ Typenameeng ~ ", $ Row ['typenameeng'], $ linkOkstr.
The above is the detailed description of the steps (figure) for implementing the navigation function of DedeCMS in both Chinese and English. For more information, see other related articles in the first PHP community!