织梦德德CMS在得以完毕中俄文导航作用方法步骤

修改方法如下,具体实现方法如下,arctype表中增加一个字段,并不一定是dede,首先要把/include/taglib/channerl.lib.php 文件的代码修改成以下的,而DEDECMS默认只能调用一级分类,FROM

本文实例陈诉了DEDECMS列表页调用当前栏目父级栏目标法子。分享给我们供我们仿照效法。具体得以达成情势如下:

今日在群里看到有位爱人要求完成中印度语印尼语栏目名字的机能(如下图),下边大家就来探问强盛的织梦CMS怎么落到实处呢!

做公司网址超越八分之四是行使DEDECMS,前几日在给客商设计网址时,把DEDE自动内链和UKoleosL全拼格式消除后,又碰着了个没失常,因为产物分类最多有四级,客商须求在左臂有个弹出式菜单调用各级子分类出来,而DEDECMS暗中认可只可以调用一级分类。经过萧涵的大力,百度+GOOGLE+本身底部,终于解决了那个东西,不敢独享,发出来给有供给的敌人分享。

改良一下函数,完毕排序方式基于自身写的ID排序就好了。
方法:
1、展开include/taglib/channelartlist.lib.php,找到大概78行,把

校订章程如下

图片 1

首先要把/include/taglib/channerl.lib.php 文件的代码更改成以下的:

复制代码代码如下:
$dsql->SetQuery(“SELECT
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `dede_arctype` WHERE $tpsql ORDER BY sortrank ASC LIMIT
$totalnum”);

率先找到如下代码:

首先给数据库中的dede_arctype表中加进叁个字段,前边的表前缀是你的站点的名,并不一定是dede_

复制代码代码如下:
function lib_channel(&$ctag,&$refObj)
{
global $_sys_globals,$envs,$dsql;
$attlist = “typeid|0,reid|0,row|100,col|1,type|son,currentstyle|”;
FillAttsDefault($ctag->CAttribute->Items,$attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = $ctag->GetInnerText();
if(empty($typeid) && $envs[‘typeid’]!=0)
{
$typeid = $envs[‘typeid’];
$reid = $envs[‘reid’];
}else{
$reid=0;
}
if($type==”||$type==’sun’) $type=”son”;
if($innertext==”) $innertext = GetSysTemplets(“channel_list.htm”);
if($reid==0 && $typeid>0)
{
$dbrow = $dsql->GetOne(“Select reid From ying_arctype where
id=’$typeid’ “);
if(is_array($dbrow)) $reid = $dbrow[‘reid’];
}
$likeType = ”;
if($type==’top’)
{
$sql = “Select
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From ying_arctype where reid=0 And ishidden<>1 order by sortrank
asc limit 0,$row”;
}
else if($type==”son”)
{
//if($_sys_globals[‘typeid’]>0) $typeid =
$_sys_globals[‘typeid’];
if($typeid==0) {
return ”;
}
$sql = “Select
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From ying_arctype where reid=’$typeid’ And ishidden<>1 order by
sortrank asc limit 0,$row”;
}
else if($type==”self”)
{
if($reid==0) {
return ”;
}
$sql = “Select
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From ‘ying_arctype’ where reid=’$reid’ And ishidden<>1 order by
sortrank asc limit 0,$row”;
}
//And id<>’$typeid’
$dtp2 = new DedeTagParse();
$dtp2->SetNameSpace(“field”,”[“,”]“);
$dtp2->LoadSource($innertext);
$dsql2 = clone $dsql;
$dsql->SetQuery($sql);
$dsql->Execute();
$line = $row;
$GLOBALS[‘autoindex’] = 0;
for($i=0;$i < $line;$i++)
{
if($col>1) $likeType .= “

修改为:

复制代码代码如下:if($type==’top’卡塔尔国
{
$sql = “SELECT
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
From `dede_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,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
From `dede_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,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `dede_arctype` WHERE reid=’$reid’ And ishidden<>1 order by
sortrank asc limit 0, $line “;
}
然后将下边代码拷贝到其背后:

图片 2

\r\n”;
for($j=0;$j{
if($col>1) $likeType .= “

复制代码代码如下:
$dsql->SetQuery(“SELECT
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `dede_arctype` WHERE $tpsql ORDER BY
substring_index(‘$typeid’,id,1) LIMIT $totalnum”);

复制代码代码如下:else
if($type==’topone’卡塔尔
{
if($reid==0) return ”;
$rowR = $dsql->GetOne(“SELECT * FROM `dede_arctype` WHERE
id=’$typeid’ “);
$topids = $rowR[‘topid’];
$sql = “SELECT
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `dede_arctype` WHERE reid=’0′ And id=’$topids’ And
ishidden<>1 order by sortrank asc limit 0, $line “;
}
else if($type==’fatherlist’)

增加后的效率如上海图书馆,具体的拉长办法另行就不详述了。当中typenameng便是本人扩展的字段,名称有一点点长,当然你也能够改为温馨愿意的称呼,这几个不伤大雅。
再找到dede\templets目录下的catalog_edit.htm
 
找到

\r\n”;
if($row=$dsql->GetArray())
{
if($type==’self’ && $row[‘id’]==$typeid卡塔尔//管理同级栏目中,当前栏目的体制
{
if($currentstyle!=”)
{
$linkOkstr = $currentstyle;
$row[‘typelink’] = GetOneTypeUrlA($row);
$linkOkstr = str_replace(“~typelink~”,$row[‘typelink’],$linkOkstr);
$linkOkstr = str_replace(“~typename~”,$row[‘typename’],$linkOkstr);
$likeType .= $linkOkstr;
}
}else
{
$row[‘typelink’] = $row[‘typeurl’] = GetOneTypeUrlA($row);
if(is_array($dtp2->CTags))
{
foreach($dtp2->CTags as $tagid=>$ctag){
if(isset($row[$ctag->GetName()]))
{
$dtp2->Assign($tagid,$row[$ctag->GetName()]);
}
elseif (preg_match(‘/^sonchannel[0-9]*$/’,$ctag->GetName()))
{
$dtp2->Assign($tagid,lib_channel_son($ctag,$row[‘id’],$dsql2));
}
}
}
$likeType .= $dtp2->GetResult();
}
}
if($col>1) $likeType .= “

2、前台调用标签: