用flag="p"调用,意思就是只调用带有的文章
<!--热门推荐--><div class="hot">
<div class="com-title"><span><img src="/dedemao/html/images/symbol-6png" alt="" />热门推荐</span></div>
{dede:arclist row=14 titlelen=60 flag="p" noflag='h' infolen='230'}
<div class="hotbox">
<div class="hotimg">
<div class="hotimgzz"></div>
<img src="[field:litpic/]" alt="[field:fulltitle/]" width="250" height="165"/>
<div class="standpoint">[field:typename/]</div>
<a class="zzsz" href="[field:arcurl/]" target="_blank" title="[field:fulltitle/]"></a>
</div>
<h3><a href="[field:arcurl/]">[field:title/]</a></h3>
<p>[field:info/]</p>
<span>阅读:[field:click/]</span><span>[field:pubdate function="MyDate('Y-m-d H:i',@me)"/]</span>
</div>
{/dede:arclist}
</div>
<!--@热门推荐-->
{dede:fieldclick/}只能在文章页调用,且是静态数值,手动更新文章这个阅读数才会更新。
列表页动态更新阅读数调用:
<script src="/plus/countphpview=yes&aid=[field:id/]&mid=1" type='text/javascript' language="javascript"></script>
列表页调用文章关键词:
[field:id runphp=yes]
global $dsql;
$tags = '';
$query = "SELECT keywords FROM `dede_archives` WHERE id='@me' ";
$dsql->Execute('keywords',$query);
while($row = $dsql->GetArray('keywords'))
{
$keywords1=$row['keywords'];
}
@me=$keywords1;
[/field:id]
修改list_articlehtm模板,把列表部分改成
<div class="content">{dede:arclist limit='0,1' }
[field:id runphp='yes'] $aid = @me; $row = $GLOBALS['dsql']->GetOne("Select body From
`#@__addonarticle
` where aid='$aid' "); @me = $row['body'];[/field:id]
<div class="hiden"><script src="/plus/countphpaid=[field:id/]" type='text/javascript' language="javascript"></script></div>
{/dede:arclist}
</div>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)