1、打开include/extend.func.php,在结尾加入以下代码:
function GetTopTypename($id) { global $dsql; $row = $dsql->GetOne("SELECT typename,topid FROM dede_arctype WHERE id= $id"); if ($row['topid'] == '0') { return $row['typename']; } else { $row1 = $dsql->GetOne("SELECT typename FROM dede_arctype WHERE id= $row[topid]"); return $row1['typename']; } } |
2、在列表、文档页模板,需要调用的位置,调用一下标签:
{dede:field name='typeid' function="GetTopTypename(@me)" /} |