hq金水

愿你是阳光,明媚不忧伤~
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

内容模块PC标签调用说明

Posted on 2016-07-19 12:03  hq金水  阅读(778)  评论(0编辑  收藏  举报
内容模块
模块名:content
模块提供的可用操作
操作名 说明
lists 内容数据列表
relation 内容相关文章
hits 内容数据点击排行榜
category 内容栏目列表
position 内容推荐位列表
position操作说明如下:

 
内容推荐位列表(position):
可用参数:
参数名 是否必须 默认值 说明
posid null 推荐位ID
catid null 调用栏目ID
thumb 0 是否仅必须缩略图
order null 排序类型
num null 数据调用数量
代码例子:
pccontent  action"position"= order"listorder DESC"=}
<ul>
{}
<li><=>{[]}</></>
{ul{/}
返回参数如下表:
字段 类型 默认 注释
title char(80) NULL 推荐位标题
url char NULL 推荐位链接地址
inputtime int(10) NULL 推荐位发布时间
thumb char NULL 推荐位缩略图
其他 不定   根据模型所设置的加入到推荐位中字段名称
 

 
内容列表(lists):
可用参数:
 
参数名 是否必须 默认值 说明
catid null 调用栏目ID
where null sql语句的where部分
thumb 0 是否仅必须缩略图
order null 排序类型
num null 数据调用数量
moreinfo 0 是否调用副表数据
提醒:从PHPCMS V9 Beta 20101105版本开始支持moreinfo参数属性,本参数表示在返回数据的时候,会把副表中的数据也一起返回。一个内容模型分为2个表,一个主表一个副表,主表中一般是保存了标题、所属栏目等等短小的数据(方便用于索引),而副表则保存了大字段的数据,如内容等数据。在模型管理中新建字段的时候,是允许你选择存入到主表还是副表的(我们推荐的是,把不重要的信息放到副表中)。想要在列表中调取副表的数据就需要在PC标签中使用moreinfo这个属性。
代码例子:
pccontent  action"lists"= order"id DESC"=}
<ul>
{}
<li><=>{[]}</></>
{ul{/}
where用法:
pccontent  action"lists"= = order"id DESC"=}
<ul>
{}
<li><=>{[]}</></>
{ul{/}
返回参数如下表:
 
字段 类型 默认 注释
title char(80) NULL 推荐位标题
url char NULL 推荐位链接地址
inputtime int(10) NULL 推荐位发布时间
thumb char NULL 推荐位缩略图
其他 不定   其他模型字段

 
点击排行榜(hits):
可用参数:
 
 
参数名 是否必须 默认值 说明
catid null 调用栏目ID
day 0 调用多少天内的排行
order null 排序类型(本月排行- monthviews DESC 、本周排行 - weekviews DESC、今日排行 - dayviews DESC)
num null 数据调用数量
 
 
代码例子:
pccontent  action"hits"= order"weekviews DESC"=}
<ul>
{}
<li><=>{[]}</></>
{ul{/}
返回参数如下表:
 
 
字段 类型 默认 注释
title char(80) NULL 推荐位标题
url char NULL 推荐位链接地址
inputtime int(10) NULL 推荐位发布时间
thumb char NULL 推荐位缩略图
其他 不定   其他模型字段
 

相关文章(relation):
可用参数:
 
 
 
参数名 是否必须 默认值 说明
catid null 调用栏目ID
relation $relation 无需更改
keywords null 内容页面取值:$rs[keywords]
num null 数据调用数量
 
 
代码例子:
pccontent action"relation"= catid"$catid"= keywords"$rs[keywords]"{}
<li>a href"{$r[url]}"=>{[]}</><>({(,[])})</></>
{pc返回参数如下表:
字段 类型 默认 注释
title char(80) NULL 推荐位标题
url char NULL 推荐位链接地址
inputtime int(10) NULL 推荐位发布时间
thumb char NULL 推荐位缩略图
其他 不定   其他模型字段

栏目列表(category):
可用参数:
参数名 是否必须 默认值 说明
catid 0 调用该栏目下的所有栏目 ,默认0,调用一级栏目
$siteid 1 默认调用系统站点
order null 排序方式、一般按照listorder ASC排序,即栏目的添加顺序
 
代码例子:
pccontent action"category"= num"25"= order"listorder ASC"{}
<li>a href"{$r[url]}"span$rcatnamespanali     /loop}
pc返回参数如下表:
字段 类型 默认值 说明
catid smallint 栏目ID
siteid tinyint(3) 0 站点ID
module varchar(15) 模块ID
type tinyint(1) 1 栏目类型ID
modelid tinyint(5) 5 模型ID
parentid smallint(5) 5 上级父栏目
arrparentid varchar(255) 所有父栏目
child tinyint(1) 0 子栏目
arrchildid mediumtext 所有子栏目
catname varchar(30) 栏目名称
image varchar(100) 栏目图片
description mediumtext 栏目描述
parentdir varchar(100) 父栏目目录
catdir varchar(30) 栏目目录
url varchar(100) 栏目链接
items mediumint(8) 0 栏目内容数
hits int(10) 0 点击数
setting mediumtext 栏目设置
listorder smallint(5) 0 排序
ismenu tinyint(1) 0 是否显示
sethtml tinyint(1) 0 是否生成到根目录
letter varchar(30) 栏目拼音