方法1:
在列表需要的位置加入下列代碼
[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;
}
然後在列表頁相應位置加入
[field:ID function="listtag(@me)"/]標記
*