让phpcms v9的关键词标签列表tags中调用文章缩略图,并用判断语句加以判断,没有缩略图时不显示,办法如下:
先看演示地址:中国IT在线演示
找到phpcms/modules/content/tag.php文件,找到下面这段代码
$res = $this->db->get_one(array('id'=>$contentid), 'title, description, url, thumb, inputtime, style');
加入红色字段thumb就可以调出缩略图了,调用文章缩略图,并加以判断,代码如下:
{loop $data $r}
<dl>
{if $r[thumb]}
<dt><a href="{$r[url]}" target="_blank"><img src="{thumb($r[thumb],180,132)}"></a></dt>
{/if}
来源:IT在线 编者:流星,转载务必以链接形式注明来源。