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'];}}在文章页或者栏目列表页调用时,在所要调用 名称的位置加上下面这行代码即可实现。{dede:field name='typeid' function="GetTopTypename(@me)" /}
function GetTopTypename($id){global $dsql;$row = $dsql->GetOne("SELECT typename,reid FROM gsh_arctype WHERE id= $id");if ($row['reid'] == '0'){return $row['typename'];}else{$row2 = $dsql->GetOne("SELECT typename FROM gsh_arctype WHERE id= $row[reid]");return $row2['typename'];}}
新闻热点
疑难解答