在include/common.func.php里面增加函数:
//列表页标签调用function listtag($aid) { global $dsql; $tags=""; $sql = "Select i.tag From zmb_taglist t left join zmb_tagindex i on i.id=t.tid where t.aid='$aid'"; $dsql->SetQuery($sql); $dsql->Execute(); while($row = $dsql->GetArray()){ $arr[]=$row[tag]; } foreach($arr as $key=>$value){ $tg = $value; $tags .= "<a href='/tags.php?/". urlencode($tg)."/'>".$tg."</a> "; } return $tags;}
{dede:list pagesize='15' titlelen='70'} <div class="g"> <h2><a href="[field:arcurl/]" target="_blank"> [field:title function='html2text(@me)' /]</a></h2> [field:description/]... <a href="[field:arcurl/]" target="_blank">查看详细>></a> <span class="data"><em class="list_view"> [field:click/]围观</em><em class="list_tag"> 标签:[field:id function="listtag(@me)"/] </em> </span> </p> </div> {/dede:list}
如果本文对你有帮助,欢迎打赏本站