模板中用 {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 `#@__arctype` WHERE id=$tid");
- $toptypename = $row['typename'];
- $reid = $row['reid'];
- if($reid==0){
- return $toptypename;
- } //开源软件:Vevb.com
- else {
- $row = $dsql->GetOne("SELECT * FROM `#@__arctype` WHERE id=$reid");
- $toptypename = $row['typename'];
- return $toptypename;
- }
- }
- }
新闻热点
疑难解答