在做zblogphp网站的时候,常常需要调用置顶文章列表,我们可以通过下面代码来实现
具体调用代码如下:{$topArray = GetList(10, null, null, null, null, null, array("only_ontop" => true));}
{foreach $topArray as $top}
{$top.Title}{/foreach}
其中GetList后面括号里的第一个 10 是要调用的置顶文章数量。
GetList 函数语法:Array GetList($count = 10, $cate = null, $auth = null, $date = null, $tags = null, $search = null, $option = null)
调用参数参数类型参数默认值描述int$count10提取条数
int$catenull分类ID
int$authnull用户ID
string$datenull时间
mixed$tagsnull标签ID、名称或者标签数组
string$searchnull搜索关键字
array$optionnull附加选项
参数说明
tags
tags参数允许使用三种类型:int,string,array参数类型示例int2
string“abc”
arrayArray(
[0] ⇒ Tag Object0,
[1] ⇒ Tag Object1
)
收藏 | 0