Home > CMS Tutorial > DEDECMS > What is the core class TypeLink.class.php of Dreamweaver?

What is the core class TypeLink.class.php of Dreamweaver?

藏色散人
Release: 2020-01-11 09:12:57
Original
2579 people have browsed it

What is the core class TypeLink.class.php of Dreamweaver?

What is the core class TypeLink.class.php of Dreamweaver?

DreamWeaver DEDECMS core class TypeLink.class.php

Recommended learning: DreamWeavercms

DedeCMS Summary notes of the core class TypeLink.class.php. Learning PHP is about reference and analysis, so that you can master more.

Note: '//' represents an additional comment added by myself

Class TypeLink 
{ 
var $typeDir; 
var $dsql; 
var $TypeID; //+ 类别ID 
var $baseDir; //+ 站点根网址 
var $modDir; //+ 模板目录 
var $indexUrl; //+ 主页链接地址 
var $indexName; //+ 主页链接名 
var $TypeInfos; //+ 类目信息 
var $SplitSymbol; //+ 栏目位置的间隔符号 
var $valuePosition; //+ 主页 > 国内 > 两会动态 > (带连接) 
var $valuePositionName; //+ 主页 > 国内 > 两会动态 > (不带连接) 
var $OptionArrayList; //+ 类目下拉列表
Copy after login

Function 1, get a link to a certain category

The code is as follows:

//获得某分类连接的URL  
function GetOneTypeUrl($typeinfos)  
{  
return GetTypeUrl();  
}  
//获得某个类目的超链接信息  
function GetOneTypeLink($typeinfos)  
{  
$typepage = $this->GetOneTypeUrl($typeinfos);  
$typelink = "<a href=&#39;".$typepage."&#39;>".$typeinfos[&#39;typename&#39;]."</a>";  
return $typelink;  
}
Copy after login

Function 2: Get a link list of a certain category, such as: 'Category 1>Category 2>'.

The code is as follows:

//islink 表示返回的列表是否带连接  
//+ SplitSymbol 栏目位置的间隔符号 dede系统默认为&#39;-&#39;  
function GetPositionLink($islink=true)  
{ //+ 获得 主页链接名  
$indexpage = "<a href=&#39;".$this->indexUrl."&#39;>".$this->indexName."</a>";  
……  
……  
else  
{  
if($islink)  
{  
$this->valuePosition = $this->GetOneTypeLink($this->TypeInfos);  
if($this->TypeInfos[&#39;reid&#39;]!=0)  
{  
//调用递归逻辑  
$this->LogicGetPosition($this->TypeInfos[&#39;reid&#39;],true);  
}  
$this->valuePosition = $indexpage.$this->SplitSymbol.$this->valuePosition;  
return $this->valuePosition.$this->SplitSymbol;  
}  
else  
{  
$this->valuePositionName = $this->TypeInfos[&#39;typename&#39;];  
if($this->TypeInfos[&#39;reid&#39;]!=0)  
{  
//调用递归逻辑  
$this->LogicGetPosition($this->TypeInfos[&#39;reid&#39;],false);  
}  
return $this->valuePositionName;  
}  
}  
}  
//获得某类目的链接列表,递归逻辑部分  
function LogicGetPosition($id,$islink)  
{  
$this->dsql->SetQuery(" SQL查询语句 ");  
$tinfos = $this->dsql->GetOne();  
if($islink)  
{ //+ 列表带连接  
$this->valuePosition = $this->GetOneTypeLink($tinfos).$this->SplitSymbol.$this->valuePosition;  
}  
else  
{ //+ 列表不带连接  
$this->valuePositionName = $tinfos[&#39;typename&#39;].$this->SplitSymbol.$this->valuePositionName;  
}  
if($tinfos[&#39;reid&#39;]>0)  
{ //+ 递归  
$this->LogicGetPosition($tinfos[&#39;reid&#39;],$islink);  
}  
}
Copy after login

Function three, to obtain the advanced search function of category list, that is, highsearch.php, this function is used

The code is as follows:

//hid 是指默认选中类目,0 表示“请选择类目”或“不限类目”  
//oper 是用户允许管理的类目,0 表示所有类目  
//channeltype 是指类目的内容类型,0 表示不限频道  
function GetOptionArray($hid=0,$oper=0,$channeltype=0,$usersg=0)  
{  
return $this->GetOptionList($hid,$oper,$channeltype,$usersg);  
}  
function GetOptionList($hid=0,$oper=0,$channeltype=0,$usersg=0)  
{  
return $this->OptionArrayList;  
}  
//+ 为下级类目递归加上 &#39;-&#39;  
function LogicGetOptionArray($id, $step, $oper=0)  
{  
}
Copy after login

Function four,

//Get the categories related to this class, this function is applied to

//$typetype in template tag {dede:channel}{/dede:channel} The value is: sun lower-level classification self same-level classification top top-level classification

The code is as follows:

function GetChannelList($typeid=0,$reid=0,$row=8,$typetype=&#39;sun&#39;,$innertext=&#39;&#39;,  
$col=1,$tablewidth=100,$myinnertext=&#39;&#39;)  
{  
}  
}
Copy after login

The above is the detailed content of What is the core class TypeLink.class.php of Dreamweaver?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template