写法如下:
-
-
-
-
-
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'];
-
}
-
}
-
-
-
-
-
-
-
function GetTopTypeEnName($id)
-
{
-
global $dsql;
-
$row = $dsql->GetOne("SELECT typedir,topid FROM dede_arctype WHERE id= $id");
-
if ($row['topid'] == '0')
-
{
-
$en = $row['typedir'];
-
-
} else {
-
$row1 = $dsql->GetOne("SELECT typedir FROM dede_arctype WHERE id= $row[topid]");
-
-
$en = $row1['typedir'];
-
}
-
$l=split("/", $en);
-
$en=array_pop($l);
-
return strtolower($en);
-
}
写到 \include\common.func.php 最后