在5.7SP1版本上修改的,其它版本还未测试
找到目录下的include/helper/archive.helper.php 文件,添加自己以下函数
//获取文章的TAGS
if ( ! function_exists('listtag'))
{
function listtag($aid){
global $dsql;
$sql = "SELECT tag FROM `wz__taglist` WHERE aid='$aid' ";
$dsql->SetQuery($sql);
$dsql->Execute();
$menu_i=1;
while ($row = $dsql->GetArray()) {
$tags .= "<a href='/tags.php?/".urlencode($row['tag'])."' class='pink'>".$row['tag']."</a> ";
}
return $tags;
}
}
模板中调用方法
{dede:list row='6' pagesize='6' titlelen='100'}
<div class="list_cont_redy">
<div class="lissttii"><span>[field:pubdate function="MyDate('Y-m-d',@me)"/]</span><a href="[field:arcurl/]" target="_blank" class="violet">[field:title/]</a></div>
<p>[field:description function="cn_substr(@me,260)"/]... <span>[<a href="[field:arcurl/]" target="_blank" class="pink">详细</a>]</span></p>
<p class="lissttii2">TAGS: <span>[field:id function="listtag(@me)"/]</span></p>
</div>
{/dede:list}