[field:id runphp=yes] $tsql = new DedeSql(false); $tags = ''; $tsql->SetQuery("Select i.tagname From xkzzz_tag_list t left join xkzzz_tag_index i on i.id=t.tid where t.aid='@me'"); $tsql->Execute('t'); while($row = $tsql->GetArray('t',MYSQL_ASSOC)){ $tags .= "<a href='/tag.php?/".urlencode($row['tagname'])."'>".$row['tagname']."</a>";
} @me=$tags;
[/field:id]
方法2: 在inc_functions.php文件里加入
function listtag($aid){ $tsql = new DedeSql(false); $tags = ''; $tsql->SetQuery("Select i.tagname From xkzzz_tag_list t left join xkzzz_tag_index i on i.id=t.tid where t.aid='$aid'"); $tsql->Execute('t'); while($row = $tsql->GetArray('t',MYSQL_ASSOC)){ $tags .= "<a href='/tag.php?/".urlencode($row['tagname'])."'>".$row['tagname']."</a>"; } return $tags; }