Home  >  Article  >  CMS Tutorial  >  Classic Empire CMS custom function method to obtain the top column name

Classic Empire CMS custom function method to obtain the top column name

silencement
silencementforward
2019-11-29 13:24:062535browse

Classic Empire CMS custom function method to obtain the top column name

The example in this article describes the method of obtaining the top-level column name through the custom function of Empire CMS. Share it with everyone for your reference. The specific implementation method is as follows:

Step 1: Copy the following code

The code is as follows:

//取得顶级栏目名称函数
function user_GetTopBclassname($classid){
global $class_r;
$fr=explode('|',$class_r[$classid][featherclass]);
$topbclassid=$fr[1]?$fr[1]:$classid;//取得第一级栏目id
$topbclassname=$class_r[$topbclassid][classname];//第一级栏目名称
$cr[classid]=$topbclassid;
$topbclassurl=sys_ReturnBqClassname($cr,9); //第一级栏目链接
return "".$topbclassname."";
}

Copy all the above codes. . .

Recommended to study "Empire cms tutorial"

Step 2: Copy the above code and save it as a *.bq format file, and then go to Template Management-Tag-Manage Tags , follow the instructions to import tags.

Step 3: Repeat the first step (copy those codes) and copy it to e\class\userfun.php, remember to put it in the middle (put it in the original tag inside).

Step 4: Just call it in the template you want to use, the code is as follows:

The code is as follows:

<?=user_GetTopBclassname($GLOBALS[navclassid])?>

Hope this article The above will be helpful to everyone’s Imperial CMS website building.

The above is the detailed content of Classic Empire CMS custom function method to obtain the top column name. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:www.word666.com. If there is any infringement, please contact admin@php.cn delete