{* Template Name:首页 * Template Type:index *} <!DOCTYPE html> <html> <head> {template:seo} <link rel="stylesheet" href="{$host}zb_users/theme/{$theme}/style/{$style}.css?v={$themeinfo['modified']}"> </head> <body> <!--头部--> {template:header} <!--首页--> <div class="container index"> <!--调用置顶文章--> {php} $w=array(); $w['count']=3; //文章数量 $w['cate']=8; //分类ID $w['only_ontop']=1; //置顶 $array=GetList($w); {/php} {foreach $array as $article} {php} $titlepic = $article->Metas->titlepic ? $article->Metas->titlepic : $article->AllImages[0]; {/php} 文章标题:{$article.Title} 文章链接:{$article.Url} 文章摘要:{$article.Intro} 文章正文:{$article.Content} 文章图片:{$titlepic} 文章浏览数:{$article.ViewNums} 文章更新时间:{$article.Time("UpdateTime","Y-m-d H:i:s")} 分类名称:{$article.Category.Name} 分类链接:{$article.Category.Url} {/foreach} <!--获取10条最近发表的文章--> {$array=Getlist(10);} <!--获取分类ID为3下的10条最近发表的文章--> {$array=Getlist(10,3);} <!--获取文章ID为2的文章--> {php} $article=GetPost(2); {/php} {$article.Content} <!--友情链接--> {module:link} </div> <!--底部--> {template:footer} </body> </html>