dede在任一子级栏目获取顶级栏目名称 typename,包括该顶级栏目下(2)

        $typeid = ( isset($refObj->TypeLink->TypeInfos['id']) ? $refObj->TypeLink->TypeInfos['id'] : $envs['typeid'] );

    }

 

  if(empty($typeid)) return '';

 

    //$row = $dsql->GetOne("Select id,topid,description,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,typelitpic From `dede_arctype` where id='$typeid' ");

 

    $reid=$dsql->GetOne("Select reid From `dede_arctype` where id='$typeid' ");

    $reid=$reid['reid'];

    $row=$dsql->GetOne("Select id,reid,description,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,typelitpic From `dede_arctype` where id='$reid' ");

    

    if(!is_array($row)) return '';

    if($row['reid']==0){$row['reid']=$row['id'];}

    if(trim($innertext)=='') $innertext = GetSysTemplets("part_type_list.htm");

    

    $dtp = new DedeTagParse();

    $dtp->SetNameSpace('field','[',']');

    $dtp->LoadSource($innertext);

    if(!is_array($dtp->CTags))

    {

        unset($dtp);

        return '';

    }

    else

    {

        $row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);

        foreach($dtp->CTags as $tagid=>$ctag)

        {

            if(isset($row[$ctag->GetName()])) $dtp->Assign($tagid,$row[$ctag->GetName()]);

        }

        $revalue = $dtp->GetResult();

        unset($dtp);

        return $revalue;

    }

}

?>


模板调用: {dede:retype}[field:typename/]{/dede:retype}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/6f44f56fb78b5c10d2113f88787750c3.html