Home  >  Article  >  CMS Tutorial  >  How to call the parent column of the current column on the DEDECMS list page

How to call the parent column of the current column on the DEDECMS list page

藏色散人
藏色散人Original
2019-12-17 09:06:262290browse

How to call the parent column of the current column on the DEDECMS list page

How does the DEDECMS list page call the parent column of the current column?

The example in this article describes how the DEDECMS list page calls the current column The method of the column's parent column. Share it with everyone for your reference. The specific implementation method is as follows:

The modification method is as follows

First find the following code:

The code is as follows:

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==&#39;son&#39;) 
{ 
if($typeid==0) return &#39;&#39;; 
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath 
From `dede_arctype` WHERE reid=&#39;$typeid&#39; And ishidden<>1 order by sortrank asc limit 0, $line "; 
} 
else if($type==&#39;self&#39;) 
{ 
if($reid==0) return &#39;&#39;; 
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath 
FROM `dede_arctype` WHERE reid=&#39;$reid&#39; And ishidden<>1 order by sortrank asc limit 0, $line "; 
}

Then copy the following code behind it:

The code is as follows:

else if($type==&#39;topone&#39;) 
{ 
if($reid==0) return &#39;&#39;; 
$rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id=&#39;$typeid&#39; "); 
$topids = $rowR[&#39;topid&#39;]; 
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath 
FROM `dede_arctype` WHERE reid=&#39;0&#39; And id=&#39;$topids&#39; And ishidden<>1 order by sortrank asc limit 0, $line "; 
} 
else if($type==&#39;fatherlist&#39;) 
{ 
$rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id=&#39;$typeid&#39; "); 
$reid = $rowR[&#39;reid&#39;]; 
$rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id=&#39;$reid&#39; "); 
$reid = $rowR[&#39;reid&#39;]; 
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath 
FROM `dede_arctype` WHERE reid=&#39;$reid&#39; And ishidden<>1 order by sortrank asc limit 0, $line "; 
}

Description topone is to call the top-level directory corresponding to the current directory 'fatherlist' is to call the upper-level directory, the top-level directory mark corresponding to the current directory:

The code is as follows:

{dede:channel type=&#39;topone&#39;}[field:typename/]{/dede:channel}

This method is absolutely possible. If you want to use a link, you need [field:typeurl].

The above is the detailed content of How to call the parent column of the current column on the DEDECMS list page. 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