方法一:
{dede:filed.typeid runphp='yes'}
$id = @me;
$sql="select * from 'dede_arctype' where id='$id' ";
$query = mysql_query($sql);
$row=mysql_fetch_array($query);
$relid = "$row[reid]";
if($relid == 0) {
@me = $row[typename];
}else{
$sql= "select 'typename' from 'dede_arctype' where id=$relid ";
$query = mysql_query($sql);
$row=mysql_frcth_array($query);
@me = $row[typename];}
{/dede:field.typeid}