Home php教程 php手册 V9父栏目调用子栏目的办法

V9父栏目调用子栏目的办法

Jun 13, 2016 am 11:29 AM
under Method us article hour Column template father Purpose transfer this need

我们在做模板时有时候需要用到调用栏目的子栏目,下面这个文章将教大家实现目的,挺简单的。代码如下:

调用:

   
    {php $j=1;}
    {loop subcat($parentid) $v}
    {php if($v['type']!=0) continue;}
        [{$v[catname]}]
    {/loop}
   

调用 [或1级栏目的专题页面]:


   
    {php $j=1;}     {loop subcat($catid) $v}
    {php if($v['type']!=0) continue;}
        [{$v[catname]}]
    {/loop}
  
 
 PS:在调用时,还可以这样调用:
            {pc:content action="category" catid="$parentid" num="25" siteid="$siteid" order="listorder ASC"}
            {loop $data $r}
            {$r[catname]}|
            {/loop}
            {/pc}

参数如下表:

 

字段 类型 默认值  说明 
smallint  栏目ID
tinyint(3)  0  站点ID
varchar(15)    模块ID
tinyint(1)  1  栏目类型ID
tinyint(5)  5  模型ID
smallint(5)  5  上级父栏目
varchar(255)    所有父栏目
tinyint(1)  0  子栏目
mediumtext    所有子栏目
varchar(30)    栏目名称
varchar(100)    栏目图片
mediumtext    栏目描述
varchar(100)    父栏目目录
varchar(30)    栏目目录
varchar(100)    栏目链接
mediumint(8)  0  栏目内容数
int(10)  0  点击数
mediumtext    栏目设置
smallint(5)  0  排序
tinyint(1)  0  是否显示
tinyint(1)  0  是否生成到根目录
varchar(30)    栏目拼音
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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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 can I make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! How can I make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! Mar 15, 2024 pm 04:13 PM

1. How can you make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! 1. Activate basic rights and interests: original articles can earn profits by advertising, and videos must be original in horizontal screen mode to earn profits. 2. Activate the rights of 100 fans: if the number of fans reaches 100 fans or above, you can get profits from micro headlines, original Q&A creation and Q&A. 3. Insist on original works: Original works include articles, micro headlines, questions, etc., and are required to be more than 300 words. Please note that if illegally plagiarized works are published as original works, credit points will be deducted, and even any profits will be deducted. 4. Verticality: When writing articles in professional fields, you cannot write articles across fields at will. You will not get appropriate recommendations, you will not be able to achieve the professionalism and refinement of your work, and it will be difficult to attract fans and readers. 5. Activity: high activity,

PHP email templates: customize and personalize your email content. PHP email templates: customize and personalize your email content. Sep 19, 2023 pm 01:21 PM

PHP email templates: Customize and personalize your email content With the popularity and widespread use of email, traditional email templates can no longer meet people's needs for personalized and customized email content. Now we can create customized and personalized email templates by using PHP programming language. This article will show you how to use PHP to achieve this goal, and provide some specific code examples. 1. Create an email template First, we need to create a basic email template. This template can be an HTM

How to add PPT mask How to add PPT mask Mar 20, 2024 pm 12:28 PM

Regarding PPT masking, many people must be unfamiliar with it. Most people do not understand it thoroughly when making PPT, but just make it up to make what they like. Therefore, many people do not know what PPT masking means, nor do they understand it. I know what this mask does, and I don’t even know that it can make the picture less monotonous. Friends who want to learn, come and learn, and add some PPT masks to your PPT pictures. Make it less monotonous. So, how to add a PPT mask? Please read below. 1. First we open PPT, select a blank picture, then right-click [Set Background Format] and select a solid color. 2. Click [Insert], word art, enter the word 3. Click [Insert], click [Shape]

What are the benefits of Douyin account matrix? What is the purpose of making a Douyin account matrix? What are the benefits of Douyin account matrix? What is the purpose of making a Douyin account matrix? Mar 27, 2024 pm 02:31 PM

With the popularity of Douyin, more and more individuals and companies have begun to pay attention to the Douyin account matrix. The Douyin account matrix refers to the creation of multiple related accounts to form an organic whole to achieve the purpose of expanding brand influence and improving user stickiness. So, what are the benefits of Douyin account matrix? What is the purpose of making a Douyin account matrix? This article explores these issues in detail. 1. What are the benefits of Douyin account matrix? Increase brand exposure: By creating multiple Douyin accounts, brand information can reach more potential users, helping to increase the brand's visibility and reputation. Improve content exposure: Using Douyin’s recommendation algorithm to publish content through multiple accounts can increase the exposure opportunities of brands and products and improve their visibility on the platform. 3. Achieve precision

What configuration is required to run CAD smoothly? What configuration is required to run CAD smoothly? Jan 01, 2024 pm 07:17 PM

What configurations are needed to use CAD smoothly? To use CAD software smoothly, you need to meet the following configuration requirements: Processor requirements: In order to run "Word Play Flowers" smoothly, you need to be equipped with at least one Intel Corei5 or AMD Ryzen5 or above processor. Of course, if you choose a higher-performance processor, you'll be able to get faster processing speeds and better performance. Memory is a very important component in the computer. It has a direct impact on the performance and user experience of the computer. Generally speaking, we recommend at least 8GB of memory, which can meet the needs of most daily use. However, for better performance and smoother usage experience, it is recommended to choose a memory configuration of 16GB or above. This ensures that the

PHP camera calling skills: How to implement multi-camera switching PHP camera calling skills: How to implement multi-camera switching Aug 04, 2023 pm 07:07 PM

PHP camera calling skills: How to switch between multiple cameras. Camera applications have become an important part of many web applications, such as video conferencing, real-time monitoring, etc. In PHP, we can use various technologies to call and operate the camera. This article will focus on how to implement multi-camera switching and provide some sample code to help readers better understand. Basics of camera calling In PHP, we can call the camera by calling the JavaScript API. Specifically, we

Effects of C++ template specialization on function overloading and overriding Effects of C++ template specialization on function overloading and overriding Apr 20, 2024 am 09:09 AM

C++ template specializations affect function overloading and rewriting: Function overloading: Specialized versions can provide different implementations of a specific type, thus affecting the functions the compiler chooses to call. Function overriding: The specialized version in the derived class will override the template function in the base class, affecting the behavior of the derived class object when calling the function.

How to solve external resource access and calls in PHP development How to solve external resource access and calls in PHP development Oct 08, 2023 am 11:01 AM

How to solve the problem of accessing and calling external resources in PHP development requires specific code examples. In PHP development, we often encounter situations where we need to access and call external resources, such as API interfaces, third-party libraries or other server resources. When dealing with these external resources, we need to consider how to access and call safely while ensuring performance and reliability. This article describes several common solutions and provides corresponding code examples. 1. Use the curl library to call external resources. Curl is a very powerful open source library.

See all articles