**comment評論標簽**
標簽:`<comment></comment>`
作用:評論標簽
用法示例:`<comment action="get_comment" catid="$catid" id="$id"> .. HTML ..</comment>`
[TOC]
##基本參數
| 參數 | 說明 |
| -- | -- |
| @action | 調用方法(`必填`) |
|@catid|欄目id(`必填`),列表頁,內容頁可以使用 $catid 獲取當前欄目。|
##公用參數
| 參數 | 說明 |
| -- | -- |
|@cache | 數據緩存時間,單位秒 |
|@return|返回值變量名稱,默認data|
##獲取評論總數
當`@action`為`get_comment`時,獲取評論總數
| 參數 | 說明 |
| -- | -- |
| @action | 調用方法(`必填`) |
|@catid|欄目id(`必填`),列表頁,內容頁可以使用 $catid 獲取當前欄目。|
> 獲取評論總數建議直接用:{:commcount($catid,$id)} 代替!
##獲取評論數據
當`@action`為`lists`時,獲取評論數據列表
| 參數 | 說明 |
| -- | -- |
| @action | 調用方法(`必填`) |
|@catid|欄目id(`必填`),列表頁,內容頁可以使用 $catid 獲取當前欄目。|
|@hot|排序方式{0:最新}|
|@date|時間格式 Y-m-d H:i:s A|
|@where|sql語句的where部分|
用法示例:
~~~
<comment?action="lists"?catid="10"?id="30">
循環列表,默認返回數據是$data
<ul>
<volist?name="data"?id="vo">
????<li>評論用戶:{$vo.author},評論內容:{$vo.content}</li>
</volist>
</ul>
</comment>
~~~
##獲取評論排行榜
| 參數 | 說明 |
| -- | -- |
|@num |返回信息數|
用法示例:
~~~
<comment?action="bang"?num="10">
循環列表,默認返回數據是$data
<ul>
<volist?name="data"?id="vo">
????<li>標題:{$vo.title},地址:{$vo.url}</li>
</volist>
</ul>
</comment>
~~~