Home php教程 php手册 DedeCMS 核心类TypeLink.class.php摘要笔记

DedeCMS 核心类TypeLink.class.php摘要笔记

Jun 13, 2016 pm 12:17 PM
c dedecms for Summary core Comment of notes kind express

注:'//+' 表示为本人另外加上的注释
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='')
{
}
}

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to delete Xiaohongshu notes How to delete Xiaohongshu notes Mar 21, 2024 pm 08:12 PM

How to delete Xiaohongshu notes? Notes can be edited in the Xiaohongshu APP. Most users don’t know how to delete Xiaohongshu notes. Next, the editor brings users pictures and texts on how to delete Xiaohongshu notes. Tutorial, interested users come and take a look! Xiaohongshu usage tutorial How to delete Xiaohongshu notes 1. First open the Xiaohongshu APP and enter the main page, select [Me] in the lower right corner to enter the special area; 2. Then in the My area, click on the note page shown in the picture below , select the note you want to delete; 3. Enter the note page, click [three dots] in the upper right corner; 4. Finally, the function bar will expand at the bottom, click [Delete] to complete.

What should I do if the notes I posted on Xiaohongshu are missing? What's the reason why the notes it just sent can't be found? What should I do if the notes I posted on Xiaohongshu are missing? What's the reason why the notes it just sent can't be found? Mar 21, 2024 pm 09:30 PM

As a Xiaohongshu user, we have all encountered the situation where published notes suddenly disappeared, which is undoubtedly confusing and worrying. In this case, what should we do? This article will focus on the topic of "What to do if the notes published by Xiaohongshu are missing" and give you a detailed answer. 1. What should I do if the notes published by Xiaohongshu are missing? First, don't panic. If you find that your notes are missing, staying calm is key and don't panic. This may be caused by platform system failure or operational errors. Checking release records is easy. Just open the Xiaohongshu App and click "Me" → "Publish" → "All Publications" to view your own publishing records. Here you can easily find previously published notes. 3.Repost. If found

How to publish notes tutorial on Xiaohongshu? Can it block people by posting notes? How to publish notes tutorial on Xiaohongshu? Can it block people by posting notes? Mar 25, 2024 pm 03:20 PM

As a lifestyle sharing platform, Xiaohongshu covers notes in various fields such as food, travel, and beauty. Many users want to share their notes on Xiaohongshu but don’t know how to do it. In this article, we will detail the process of posting notes on Xiaohongshu and explore how to block specific users on the platform. 1. How to publish notes tutorial on Xiaohongshu? 1. Register and log in: First, you need to download the Xiaohongshu APP on your mobile phone and complete the registration and login. It is very important to complete your personal information in the personal center. By uploading your avatar, filling in your nickname and personal introduction, you can make it easier for other users to understand your information, and also help them pay better attention to your notes. 3. Select the publishing channel: At the bottom of the homepage, click the "Send Notes" button and select the channel you want to publish.

Where is the imperial cms resource network template? Where is the imperial cms resource network template? Apr 17, 2024 am 10:00 AM

Empire CMS template download location: Official template download: https://www.phome.net/template/ Third-party template website: https://www.dedecms.com/diy/https://www.0978.com.cn /https://www.jiaocheng.com/Installation method: Download template Unzip template Upload template Select template

How dedecms implements template replacement How dedecms implements template replacement Apr 16, 2024 pm 12:12 PM

Template replacement can be implemented in Dedecms through the following steps: modify the global.cfg file and set the required language pack. Modify the taglib.inc.php hook file and add support for language suffix template files. Create a new template file with a language suffix and modify the required content. Clear Dedecms cache.

How to upload local videos to dedecms How to upload local videos to dedecms Apr 16, 2024 pm 12:39 PM

How to upload local videos using Dedecms? Prepare the video file in a format that is supported by Dedecms. Log in to the Dedecms management backend and create a new video category. Upload video files on the video management page, fill in the relevant information and select the video category. To embed a video while editing an article, enter the file name of the uploaded video and adjust its dimensions.

What website can dedecms do? What website can dedecms do? Apr 16, 2024 pm 12:24 PM

Dedecms is an open source CMS that can be used to create various types of websites, including: news websites, blogs, e-commerce websites, forums and community websites, educational websites, portals, other types of websites (such as corporate websites, personal websites, photo album websites, video sharing website)

How to use dedecms How to use dedecms Apr 16, 2024 pm 12:15 PM

Dedecms is an open source Chinese CMS system that provides content management, template system and security protection. The specific usage includes the following steps: 1. Install Dedecms. 2. Configure the database. 3. Log in to the management interface. 4. Create content. 5. Set up the template. 6. Manage users. 7. Maintain the system.

See all articles