if ( ! function_exists('GetTags')){function GetTags($aid){global $dsql;$tags = '';$query = "SELECT tag FROM `dede_taglist` WHERE aid='$aid' ";$dsql->Execute('tag',$query);while($row = $dsql->GetArray('tag')){$tags .= ($tags=='' ? $row['tag'] : ','.$row['tag']);}return $tags;}}
替换成以下代码:
if ( ! function_exists('GetTags')){function GetTags($aid){global $dsql;$tags = '';$query = "SELECT tag FROM `dede_taglist` WHERE aid='$aid' ";$dsql->Execute('tag',$query);while($row = $dsql->GetArray('tag')){$tags .= ($tags=='' ? ''.$row['tag'].'': ','.''.$row['tag'].''); }return $tags;}}
2.织梦dedecms按栏目调用tag标签的方法
{dede:sql sql="select * from dede_archives a left join dede_taglist t on a.id=t.aid where a.typeid='22' limit 4"} <a href='/tags.php?[field:tag/]' target="_blank" title="[field:tag /]">[field:tag /]</a>{/dede:sql}