#內容模塊
>內容模塊PC標簽調用說明
>模塊名content_tag
調用示例
```php
<?php $page_list=content_tag('lists', ['catid' => 13, 'num' => 20, 'order' => 'id DESC']);?>
<foreach name="page_list" item="v">
<li><span>05-17</span> <a href="{:getUrl($v['catid'], $v['id'])}" target="_blank" title="{$v[title]}" style="color:red;">{$v[title]}</a></li>
</foreach>
```
模塊提供的可用操作
操作名 | 說明
-|-
lists | 內容數據列表
category | 內容欄目列表
position | 內容推薦位列表
relation | 內容相關文章
hits | 內容數據點擊排行榜
---
###內容列表(lists)
可用參數:
參數名 | 是否必須 | 默認值 | 說明
-|-|-|-
catid | 否 | null | 調用欄目ID
where | 否 | null | sql語句的where部分
thumb | 否 | 0 | 是否僅必須縮略圖
order | 否 | null | 排序類型
num | 是 | null | 數據調用數量
moreinfo | 否 | 0 | 是否調用副表數據
代碼例子:
```php
<?php $page_list=content_tag('lists', ['catid' => 13, 'num' => 20, 'order' => 'id DESC']);?>
<foreach name="page_list" item="v">
<li><span>05-17</span> <a href="{:getUrl($v['catid'], $v['id'])}" target="_blank" title="{$v[title]}" style="color:red;">{$v[title]}</a></li>
</foreach>
```
返回參數如下表:
字段 | 類型 | 空 | 默認 | 注釋
-|-|-|-|-
title | char(80) | 否 | NULL | 推薦位標題
url | char | 否 | NULL | 推薦位鏈接地址
inputtime | int(10) | 否 | NULL | 推薦位發布時間
thumb | char | 是 | NULL | 推薦位縮略圖
其他 | 不定 | 是 | | 其他模型字段
---
###欄目列表(category):
可用參數:
參數名 | 是否必須 | 默認值 | 說明
-|-|-|-
catid | 否 | 0 | 調用該欄目下的所有欄目 ,默認0,調用一級欄目
$siteid | 否 | 1 | 默認調用系統站點
order | 否 | null | 排序方式、一般按照listorder ASC排序,即欄目的添加順序
代碼例子:
```php
<?php $category_list=content_tag(category, ['catid' => 0, 'limit' => 8]);?>
<foreach name="category_list" item="r">
<li><a href="{:getUrl($r['catid'])}">{$r['catname']}</a>
</foreach>
```
返回參數如下表:
字段 | 類型 | 默認值? | 說明?
-|-|-|-
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) | ?無 | ?欄目拼音