phpcms_v9如何在首页显示或排除某些栏目subcat(0,0,0,$siteid)
v9如何在首页显示或排除某些栏目subcat(0,0,0,$siteid)
通过以下红色部分的栏目id来控制显示哪些栏目,id根据实际情况后台查询,subcat函数看最后附件解释,以下修改代码:
V9显示哪些栏目的方法
{loop subcat(0,0,0,$siteid) $r}
http://blog.csdn.net/a1079540945/article/details/{$r}更多>>
{str_cut($v['description'],100)}
V9排除某个栏目的方法
{loop subcat(0,0,0,$siteid) $r}
{if $r['catid']==3 }{/if} //排除某个栏目
http://blog.csdn.net/a1079540945/article/details/{$r}更多>>
{str_cut($v['description'],100)}
=====================================================
{loop subcat(0,0,0,$siteid) $r}{/loop}函数解释:
{loop subcat(0,0,0,$siteid) $r}{/loop}
/**
* 获取子栏目
* @param $parentid 父级id
* @param $type 栏目类型 1为单网页类型,0为栏目类型;(查看phpcms的mysql数据库可以看到)
* @param $self 是否包含本身 0为不包含
* @param $siteid 站点id
*/
function subcat($parentid = NULL, $type = NULL,$self = '0', $siteid = '') {
if (empty($siteid)) $siteid = get_siteid();
$category = getcache('category_content_'.$siteid,'commons');
foreach($category as $id=>$cat) {
if($cat['siteid'] == $siteid && ($parentid === NULL || $cat['parentid'] == $parentid) && ($type === NULL || $cat['type'] ==
$type)) $subcat[$id] = $cat;
if($self == 1 && $cat['catid'] == $parentid && !$cat['child']) $subcat[$id] = $cat;
}
return $subcat;
}

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

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

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver Mac version
Visual web development tools

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