好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

dedecms获取当前栏目的顶级栏目名称 - DeDecms

dedecms获取当前栏目的顶级栏目名称

模板中用 {dede:field.typeid function="GetTopname(@me)"/} 调用,include\helpers\channelunit.helper.php 末尾增加:

if  ( ! function_exists( 'GetTopname' ))  {       function  GetTopname( $tid )      {           global   $dsql , $cfg_Css ;           if (! is_array ( $cfg_Css ))          {               require_once (DEDEDATA. "/cache/inc_catalog_base.inc" );          }    $row  =  $dsql ->GetOne( "SELECT * FROM `detest_arctype` WHERE id=$tid" );           $toptypename  =   $row [ 'typename' ];        $reid  =  $row [ 'reid' ];             if ( $reid ==0){  return    $toptypename ;  }  //开源软件:phpfensi测试数据   else  {  $row  =  $dsql ->GetOne( "SELECT * FROM `detest_arctype` WHERE id=$reid" );           $toptypename  =   $row [ 'typename' ];  return    $toptypename ;  }      }  }

查看更多关于dedecms获取当前栏目的顶级栏目名称 - DeDecms的详细内容...

  阅读:56次