dede 常用標籤呼叫整理
阿新 • • 發佈:2019-01-07
15./*根據欄目ID返回欄目名稱
*$id 欄目id
*$type 0 父欄目連結 1 子欄目連結
*$divid 輸出格式<div id="$divid"><a title='typename' href='typeurl'>typename</a></div>
*/
function getColByID($ID,$type,$divid)
{
global $dsql;
if ($type==0){
//echo "0"."<br/>";
//父欄目連結
$query="select * from dede_arctype where id=(select topid from dede_arctype where id = '".$ID."') and ishidden <>1";
$row = $dsql->GetOne($query);
//$ReturnURL = GetTypeUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);
//echo $ReturnURL."<br/>";
$path=$row['typedir'];
$path=str_replace("{cmspath}","",$path);
if ($path=="/")
{
$path=$path.$row['defaultname'];
}
else
{
$path=$path."/".$row['defaultname'];
}
$ReturnURL="<a href='$path' title='".$row['typename']."'>".$row['typename']."</a>";
return $ReturnURL;
}
if ($type==1){
//echo "1"."<br/>";
//子欄目連結
$query="SELECT * FROM
*$id 欄目id
*$type 0 父欄目連結 1 子欄目連結
*$divid 輸出格式<div id="$divid"><a title='typename' href='typeurl'>typename</a></div>
*/
function getColByID($ID,$type,$divid)
{
global $dsql;
if ($type==0){
//echo "0"."<br/>";
//父欄目連結
$query="select * from dede_arctype where id=(select topid from dede_arctype where id = '".$ID."') and ishidden <>1";
$row = $dsql->GetOne($query);
//$ReturnURL = GetTypeUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);
//echo $ReturnURL."<br/>";
$path=$row['typedir'];
$path=str_replace("{cmspath}","",$path);
if ($path=="/")
{
$path=$path.$row['defaultname'];
}
else
{
$path=$path."/".$row['defaultname'];
}
$ReturnURL="<a href='$path' title='".$row['typename']."'>".$row['typename']."</a>";
return $ReturnURL;
}
if ($type==1){
//echo "1"."<br/>";
//子欄目連結
$query="SELECT * FROM