Home > CMS Tutorial > Empire CMS > body text

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

silencement
Release: 2019-11-29 13:24:06
forward
2553 people have browsed it

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 after login

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])?>
Copy after login

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!

Related labels:
source:www.word666.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template