DedeCMS 核心类TypeLink.class.php摘要笔记
注:'//+' 表示为本人另外加上的注释
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; //+ 类目下拉列表
功能一,获得某类目的链接
复制代码 代码如下:
//获得某分类连接的URL
function GetOneTypeUrl($typeinfos)
{
return GetTypeUrl();
}
//获得某个类目的超链接信息
function GetOneTypeLink($typeinfos)
{
$typepage = $this->GetOneTypeUrl($typeinfos);
$typelink = "".$typeinfos['typename']."";
return $typelink;
}
功能二,获得某类目的链接列表 如:'类目一>类目二>' 这样的形式。
复制代码 代码如下:
//islink 表示返回的列表是否带连接
//+ SplitSymbol 栏目位置的间隔符号 dede系统默认为'-'
function GetPositionLink($islink=true)
{ //+ 获得 主页链接名
$indexpage = "".$this->indexName."";
……
……
else
{
if($islink)
{
$this->valuePosition = $this->GetOneTypeLink($this->TypeInfos);
if($this->TypeInfos['reid']!=0)
{
//调用递归逻辑
$this->LogicGetPosition($this->TypeInfos['reid'],true);
}
$this->valuePosition = $indexpage.$this->SplitSymbol.$this->valuePosition;
return $this->valuePosition.$this->SplitSymbol;
}
else
{
$this->valuePositionName = $this->TypeInfos['typename'];
if($this->TypeInfos['reid']!=0)
{
//调用递归逻辑
$this->LogicGetPosition($this->TypeInfos['reid'],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['typename'].$this->SplitSymbol.$this->valuePositionName;
}
if($tinfos['reid']>0)
{ //+ 递归
$this->LogicGetPosition($tinfos['reid'],$islink);
}
}
功能三, 获得类别列表 高级搜索功能 即highsearch.php 即要用到此函数
复制代码 代码如下:
//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;
}
//+ 为下级类目递归加上 '-'
function LogicGetOptionArray($id, $step, $oper=0)
{
}
功能四,
//获得与该类相关的类目,本函数应用于模板标记{dede:channel}{/dede:channel}中
//$typetype 的值为: sun 下级分类 self 同级分类 top 顶级分类
复制代码 代码如下:
function GetChannelList($typeid=0,$reid=0,$row=8,$typetype='sun',$innertext='',
$col=1,$tablewidth=100,$myinnertext='')
{
}
}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function