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